@rozenite/storage-plugin 2.1.0 → 2.2.0
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/CHANGELOG.md +18 -0
- package/dist/devtools/assets/panel-D5z1BY8U.js +32 -0
- package/dist/devtools/assets/panel-DVlWRg6d.css +1 -0
- package/dist/devtools/panel.html +2 -2
- package/dist/rozenite.json +1 -1
- package/package.json +7 -7
- package/src/ui/__tests__/panel.test.tsx +14 -0
- package/src/ui/add-entry-dialog.tsx +63 -73
- package/src/ui/binary-value-editor.tsx +1 -1
- package/src/ui/edit-entry-dialog.tsx +59 -70
- package/src/ui/entry-detail-dialog.tsx +4 -2
- package/src/ui/format-value.tsx +1 -1
- package/src/ui/import-dialog.tsx +5 -5
- package/src/ui/panel.tsx +70 -88
- package/tsconfig.json +4 -7
- package/dist/devtools/assets/panel-BlDRXgVW.js +0 -32
- package/dist/devtools/assets/panel-DBweZnW5.css +0 -1
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
function wH(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var CH=t=>t.disabled||Array.isArray(t.accessibilityStates)&&t.accessibilityStates.indexOf("disabled")>-1,RH={adjustable:"slider",button:"button",header:"heading",image:"img",imagebutton:null,keyboardkey:null,label:null,link:"link",none:"presentation",search:"search",summary:"region",text:null},Pk=t=>{var e=t.accessibilityRole,n=t.role,r=n||e;if(r){var i=RH[r];if(i!==null)return i||r}},EH={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"},TH={},AH=function(e){e===void 0&&(e=TH);var n=e.role||e.accessibilityRole;if(n==="label")return"label";var r=Pk(e);if(r){if(r==="heading"){var i=e.accessibilityLevel||e["aria-level"];return i!=null?"h"+i:"h1"}return EH[r]}},zk={isDisabled:CH,propsToAccessibilityComponent:AH,propsToAriaRole:Pk};function ld(t){"@babel/helpers - typeof";return ld=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ld(t)}function MH(t,e){if(ld(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(ld(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function OH(t){var e=MH(t,"string");return ld(e)=="symbol"?e:e+""}function kH(t,e,n){return(e=OH(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aT(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function mc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?aT(Object(n),!0).forEach(function(r){kH(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):aT(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function um(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var ip={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},IH=["ms","Moz","O","Webkit"],DH=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1);Object.keys(ip).forEach(t=>{IH.forEach(e=>{ip[DH(e,t)]=ip[t]})});var PH=t=>t==="currentcolor"||t==="currentColor"||t==="inherit"||t.indexOf("var(")===0;function _o(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Nk(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var i0,uT;function zH(){if(uT)return i0;uT=1;function t(w){if(typeof w=="number")return w>>>0===w&&w>=0&&w<=4294967295?w:null;if(typeof w!="string")return null;const C=g();let R;if(R=C.hex6.exec(w))return parseInt(R[1]+"ff",16)>>>0;const T=S(w);return T??((R=C.rgb.exec(w))?(p(R[1])<<24|p(R[2])<<16|p(R[3])<<8|255)>>>0:(R=C.rgba.exec(w))?R[6]!==void 0?(p(R[6])<<24|p(R[7])<<16|p(R[8])<<8|v(R[9]))>>>0:(p(R[2])<<24|p(R[3])<<16|p(R[4])<<8|v(R[5]))>>>0:(R=C.hex3.exec(w))?parseInt(R[1]+R[1]+R[2]+R[2]+R[3]+R[3]+"ff",16)>>>0:(R=C.hex8.exec(w))?parseInt(R[1],16)>>>0:(R=C.hex4.exec(w))?parseInt(R[1]+R[1]+R[2]+R[2]+R[3]+R[3]+R[4]+R[4],16)>>>0:(R=C.hsl.exec(w))?(n(m(R[1]),b(R[2]),b(R[3]))|255)>>>0:(R=C.hsla.exec(w))?R[6]!==void 0?(n(m(R[6]),b(R[7]),b(R[8]))|v(R[9]))>>>0:(n(m(R[2]),b(R[3]),b(R[4]))|v(R[5]))>>>0:(R=C.hwb.exec(w))?(r(m(R[1]),b(R[2]),b(R[3]))|255)>>>0:null)}function e(w,C,R){return R<0&&(R+=1),R>1&&(R-=1),R<1/6?w+(C-w)*6*R:R<1/2?C:R<2/3?w+(C-w)*(2/3-R)*6:w}function n(w,C,R){const T=R<.5?R*(1+C):R+C-R*C,A=2*R-T,k=e(A,T,w+1/3),P=e(A,T,w),M=e(A,T,w-1/3);return Math.round(k*255)<<24|Math.round(P*255)<<16|Math.round(M*255)<<8}function r(w,C,R){if(C+R>=1){const P=Math.round(C*255/(C+R));return P<<24|P<<16|P<<8}const T=e(0,1,w+1/3)*(1-C-R)+C,A=e(0,1,w)*(1-C-R)+C,k=e(0,1,w-1/3)*(1-C-R)+C;return Math.round(T*255)<<24|Math.round(A*255)<<16|Math.round(k*255)<<8}const i="[-+]?\\d*\\.?\\d+",s=i+"%";function a(...w){return"\\(\\s*("+w.join(")\\s*,?\\s*(")+")\\s*\\)"}function u(...w){return"\\(\\s*("+w.slice(0,w.length-1).join(")\\s*,?\\s*(")+")\\s*/\\s*("+w[w.length-1]+")\\s*\\)"}function f(...w){return"\\(\\s*("+w.join(")\\s*,\\s*(")+")\\s*\\)"}let d;function g(){return d===void 0&&(d={rgb:new RegExp("rgb"+a(i,i,i)),rgba:new RegExp("rgba("+f(i,i,i,i)+"|"+u(i,i,i,i)+")"),hsl:new RegExp("hsl"+a(i,s,s)),hsla:new RegExp("hsla("+f(i,s,s,i)+"|"+u(i,s,s,i)+")"),hwb:new RegExp("hwb"+a(i,s,s)),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})$/}),d}function p(w){const C=parseInt(w,10);return C<0?0:C>255?255:C}function m(w){return(parseFloat(w)%360+360)%360/360}function v(w){const C=parseFloat(w);return C<0?0:C>1?255:Math.round(C*255)}function b(w){const C=parseFloat(w);return C<0?0:C>100?1:C/100}function S(w){switch(w){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 i0=t,i0}var NH=zH();const LH=_o(NH);var BH=t=>{if(t==null)return t;var e=LH(t);if(e!=null)return e=(e<<24|e>>>8)>>>0,e},kS=function(e,n){if(n===void 0&&(n=1),e!=null){if(typeof e=="string"&&PH(e))return e;var r=BH(e);if(r!=null){var i=r>>16&255,s=r>>8&255,a=r&255,u=(r>>24&255)/255,f=(u*n).toFixed(2);return"rgba("+i+","+s+","+a+","+f+")"}}},_H={backgroundColor:!0,borderColor:!0,borderTopColor:!0,borderRightColor:!0,borderBottomColor:!0,borderLeftColor:!0,color:!0,shadowColor:!0,textDecorationColor:!0,textShadowColor:!0};function ni(t,e){var n=t;return(e==null||!ip[e])&&typeof t=="number"?n=t+"px":e!=null&&_H[e]&&(n=kS(t)),n}var hu=!!(typeof window<"u"&&window.document&&window.document.createElement),HH={},jH=!hu||window.CSS!=null&&window.CSS.supports!=null&&(window.CSS.supports("text-decoration-line","none")||window.CSS.supports("-webkit-text-decoration-line","none")),VH="monospace,monospace",cT='-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif',FH={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"]},Lk=(t,e)=>{if(!t)return HH;var n={},r=function(){var u=t[i];if(u==null)return"continue";if(i==="backgroundClip")u==="text"&&(n.backgroundClip=u,n.WebkitBackgroundClip=u);else if(i==="flex")u===-1?(n.flexGrow=0,n.flexShrink=1,n.flexBasis="auto"):n.flex=u;else if(i==="font")n[i]=u.replace("System",cT);else if(i==="fontFamily")if(u.indexOf("System")>-1){var f=u.split(/,\s*/);f[f.indexOf("System")]=cT,n[i]=f.join(",")}else u==="monospace"?n[i]=VH:n[i]=u;else if(i==="textDecorationLine")jH?n.textDecorationLine=u:n.textDecoration=u;else if(i==="writingDirection")n.direction=u;else{var d=ni(t[i],i),g=FH[i];e&&i==="inset"?(t.insetInline==null&&(n.left=d,n.right=d),t.insetBlock==null&&(n.top=d,n.bottom=d)):e&&i==="margin"?(t.marginInline==null&&(n.marginLeft=d,n.marginRight=d),t.marginBlock==null&&(n.marginTop=d,n.marginBottom=d)):e&&i==="padding"?(t.paddingInline==null&&(n.paddingLeft=d,n.paddingRight=d),t.paddingBlock==null&&(n.paddingTop=d,n.paddingBottom=d)):g?g.forEach((p,m)=>{t[p]==null&&(n[p]=d)}):n[i]=d}};for(var i in t)var s=r();return n};function UH(t,e){for(var n=t.length,r=e^n,i=0,s;n>=4;)s=t.charCodeAt(i)&255|(t.charCodeAt(++i)&255)<<8|(t.charCodeAt(++i)&255)<<16|(t.charCodeAt(++i)&255)<<24,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>24,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16)^s,n-=4,++i;switch(n){case 3:r^=(t.charCodeAt(i+2)&255)<<16;case 2:r^=(t.charCodeAt(i+1)&255)<<8;case 1:r^=t.charCodeAt(i)&255,r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16)}return r^=r>>>13,r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16),r^=r>>>15,r>>>0}var $H=t=>UH(t,1).toString(36),qH=/[A-Z]/g,GH=/^ms-/,o0={};function WH(t){return"-"+t.toLowerCase()}function KH(t){if(t in o0)return o0[t];var e=t.replace(qH,WH);return o0[t]=GH.test(e)?"-"+e:e}var ng={},rg={},ig={},fT;function Bk(){if(fT)return ig;fT=1,Object.defineProperty(ig,"__esModule",{value:!0}),ig.default=t;function t(e){return e.charAt(0).toUpperCase()+e.slice(1)}return ig}var dT;function YH(){if(dT)return rg;dT=1,Object.defineProperty(rg,"__esModule",{value:!0}),rg.default=r;var t=Bk(),e=n(t);function n(i){return i&&i.__esModule?i:{default:i}}function r(i,s,a){var u=i[s];if(u&&a.hasOwnProperty(s))for(var f=(0,e.default)(s),d=0;d<u.length;++d){var g=u[d]+f;a[g]||(a[g]=a[s])}return a}return rg}var og={},hT;function XH(){if(hT)return og;hT=1,Object.defineProperty(og,"__esModule",{value:!0}),og.default=t;function t(e,n,r,i,s){for(var a=0,u=e.length;a<u;++a){var f=e[a](n,r,i,s);if(f)return f}}return og}var sg={},gT;function QH(){if(gT)return sg;gT=1,Object.defineProperty(sg,"__esModule",{value:!0}),sg.default=e;function t(n,r){n.indexOf(r)===-1&&n.push(r)}function e(n,r){if(Array.isArray(r))for(var i=0,s=r.length;i<s;++i)t(n,r[i]);else t(n,r)}return sg}var lg={},pT;function ZH(){if(pT)return lg;pT=1,Object.defineProperty(lg,"__esModule",{value:!0}),lg.default=t;function t(e){return e instanceof Object&&!Array.isArray(e)}return lg}var mT;function JH(){if(mT)return ng;mT=1,Object.defineProperty(ng,"__esModule",{value:!0}),ng.default=d;var t=YH(),e=f(t),n=XH(),r=f(n),i=QH(),s=f(i),a=ZH(),u=f(a);function f(g){return g&&g.__esModule?g:{default:g}}function d(g){var p=g.prefixMap,m=g.plugins;return function v(b){for(var S in b){var w=b[S];if((0,u.default)(w))b[S]=v(w);else if(Array.isArray(w)){for(var C=[],R=0,T=w.length;R<T;++R){var A=(0,r.default)(m,S,w[R],b,p);(0,s.default)(C,A||w[R])}C.length>0&&(b[S]=C)}else{var k=(0,r.default)(m,S,w,b,p);k&&(b[S]=k),b=(0,e.default)(p,S,b)}}return b}}return ng}var ej=JH();const tj=_o(ej);var ag={};function op(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?op=function(n){return typeof n}:op=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},op(t)}function nj(t){return sj(t)||oj(t)||ij(t)||rj()}function rj(){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 ij(t,e){if(t){if(typeof t=="string")return Ib(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ib(t,e)}}function oj(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function sj(t){if(Array.isArray(t))return Ib(t)}function Ib(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function yT(t){return t.filter(function(e,n){return t.lastIndexOf(e)===n})}function _k(t){for(var e=0,n=arguments.length<=1?0:arguments.length-1;e<n;++e){var r=e+1<1||arguments.length<=e+1?void 0:arguments[e+1];for(var i in r){var s=r[i],a=t[i];if(a&&s){if(Array.isArray(a)){t[i]=yT(a.concat(s));continue}if(Array.isArray(s)){t[i]=yT([a].concat(nj(s)));continue}if(op(s)==="object"){t[i]=_k({},a,s);continue}}t[i]=s}}return t}var lj=/-([a-z])/g,aj=/^Ms/g,s0={};function uj(t){return t[1].toUpperCase()}function Hk(t){if(s0.hasOwnProperty(t))return s0[t];var e=t.replace(lj,uj).replace(aj,"ms");return s0[t]=e,e}var cj=/[A-Z]/g,fj=/^ms-/,l0={};function dj(t){return"-"+t.toLowerCase()}function jk(t){if(l0.hasOwnProperty(t))return l0[t];var e=t.replace(cj,dj);return l0[t]=fj.test(e)?"-"+e:e}const hj=Object.freeze(Object.defineProperty({__proto__:null,default:jk},Symbol.toStringTag,{value:"Module"}));function cm(t){return jk(t)}function Vk(t,e){return cm(t)+":"+e}function gj(t){var e="";for(var n in t){var r=t[n];typeof r!="string"&&typeof r!="number"||(e&&(e+=";"),e+=Vk(n,r))}return e}var pj=/^(Webkit|Moz|O|ms)/;function mj(t){return pj.test(t)}var yj=/-webkit-|-moz-|-ms-/;function vj(t){return typeof t=="string"&&yj.test(t)}var ad={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},vT=["animationIterationCount","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","order"],bT=["Webkit","ms","Moz","O"];function bj(t,e){return t+e.charAt(0).toUpperCase()+e.slice(1)}for(var a0=0,xj=vT.length;a0<xj;++a0){var xT=vT[a0];ad[xT]=!0;for(var u0=0,Sj=bT.length;u0<Sj;++u0)ad[bj(bT[u0],xT)]=!0}for(var wj in ad)ad[cm(wj)]=!0;function Cj(t){return ad.hasOwnProperty(t)}var Rj=/^(ms|Webkit|Moz|O)/;function Fk(t){var e=t.replace(Rj,"");return e.charAt(0).toLowerCase()+e.slice(1)}function Ej(t){return Fk(Hk(t))}function Tj(t,e){return e.join(";"+cm(t)+":")}var Aj=/(-ms-|-webkit-|-moz-|-o-)/g;function Mj(t){return typeof t=="string"?t.replace(Aj,""):t}const Oj=Object.freeze(Object.defineProperty({__proto__:null,assignStyle:_k,camelCaseProperty:Hk,cssifyDeclaration:Vk,cssifyObject:gj,hyphenateProperty:cm,isPrefixedProperty:mj,isPrefixedValue:vj,isUnitlessProperty:Cj,normalizeProperty:Ej,resolveArrayValue:Tj,unprefixProperty:Fk,unprefixValue:Mj},Symbol.toStringTag,{value:"Module"})),kj=Nk(Oj);var ST;function Ij(){if(ST)return ag;ST=1,Object.defineProperty(ag,"__esModule",{value:!0}),ag.default=r;var t=kj,e=/cross-fade\(/g,n=["-webkit-",""];function r(i,s){if(typeof s=="string"&&!(0,t.isPrefixedValue)(s)&&s.indexOf("cross-fade(")!==-1)return n.map(function(a){return s.replace(e,a+"cross-fade(")})}return ag}var Dj=Ij();const Pj=_o(Dj);var ug={},c0={},wT;function Uk(){return wT||(wT=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var e=/-webkit-|-moz-|-ms-/;function n(r){return typeof r=="string"&&e.test(r)}})(c0)),c0}var CT;function zj(){if(CT)return ug;CT=1,Object.defineProperty(ug,"__esModule",{value:!0}),ug.default=i;var t=Uk(),e=n(t);function n(s){return s&&s.__esModule?s:{default:s}}var r=["-webkit-",""];function i(s,a){if(typeof a=="string"&&!(0,e.default)(a)&&a.indexOf("image-set(")>-1)return r.map(function(u){return a.replace(/image-set\(/g,u+"image-set(")})}return ug}var Nj=zj();const Lj=_o(Nj);var cg={},RT;function Bj(){if(RT)return cg;RT=1,Object.defineProperty(cg,"__esModule",{value:!0}),cg.default=e;var t={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 e(n,r,i){if(Object.prototype.hasOwnProperty.call(t,n))for(var s=t[n],a=0,u=s.length;a<u;++a)i[s[a]]=r}return cg}var _j=Bj();const Hj=_o(_j);var fg={},ET;function jj(){if(ET)return fg;ET=1,Object.defineProperty(fg,"__esModule",{value:!0}),fg.default=t;function t(e,n){if(e==="position"&&n==="sticky")return["-webkit-sticky","sticky"]}return fg}var Vj=jj();const Fj=_o(Vj);var dg={},TT;function Uj(){if(TT)return dg;TT=1,Object.defineProperty(dg,"__esModule",{value:!0}),dg.default=r;var t=["-webkit-","-moz-",""],e={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},n={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};function r(i,s){if(e.hasOwnProperty(i)&&n.hasOwnProperty(s))return t.map(function(a){return a+s})}return dg}var $j=Uj();const qj=_o($j);var hg={},f0={};const Gj=Nk(hj);var AT;function Wj(){return AT||(AT=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var e=Gj,n=r(e);function r(s){return s&&s.__esModule?s:{default:s}}function i(s){return(0,n.default)(s)}})(f0)),f0}var MT;function Kj(){if(MT)return hg;MT=1,Object.defineProperty(hg,"__esModule",{value:!0}),hg.default=g;var t=Wj(),e=a(t),n=Uk(),r=a(n),i=Bk(),s=a(i);function a(p){return p&&p.__esModule?p:{default:p}}var u={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},f={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};function d(p,m){if((0,r.default)(p))return p;for(var v=p.split(/,(?![^()]*(?:\([^()]*\))?\))/g),b=0,S=v.length;b<S;++b){var w=v[b],C=[w];for(var R in m){var T=(0,e.default)(R);if(w.indexOf(T)>-1&&T!=="order")for(var A=m[R],k=0,P=A.length;k<P;++k)C.unshift(w.replace(T,f[A[k]]+T))}v[b]=C.join(",")}return v.join(",")}function g(p,m,v,b){if(typeof m=="string"&&u.hasOwnProperty(p)){var S=d(m,b),w=S.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(R){return!/-moz-|-ms-/.test(R)}).join(",");if(p.indexOf("Webkit")>-1)return w;var C=S.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(R){return!/-webkit-|-ms-/.test(R)}).join(",");return p.indexOf("Moz")>-1?C:(v["Webkit"+(0,s.default)(p)]=w,v["Moz"+(0,s.default)(p)]=C,S)}}return hg}var Yj=Kj();const Xj=_o(Yj);var wn=["Webkit"],Qj=["Moz"],Zj=["Webkit","Moz"],Kn=["Webkit","ms"],Jj=["Webkit","Moz","ms"];const eV={plugins:[Pj,Lj,Hj,Fj,qj,Xj],prefixMap:{appearance:Jj,userSelect:Zj,textEmphasisPosition:Kn,textEmphasis:Kn,textEmphasisStyle:Kn,textEmphasisColor:Kn,boxDecorationBreak:Kn,clipPath:wn,maskImage:Kn,maskMode:Kn,maskRepeat:Kn,maskPosition:Kn,maskClip:Kn,maskOrigin:Kn,maskSize:Kn,maskComposite:Kn,mask:Kn,maskBorderSource:Kn,maskBorderMode:Kn,maskBorderSlice:Kn,maskBorderWidth:Kn,maskBorderOutset:Kn,maskBorderRepeat:Kn,maskBorder:Kn,maskType:Kn,textDecorationStyle:wn,textDecorationSkip:wn,textDecorationLine:wn,textDecorationColor:wn,filter:wn,breakAfter:wn,breakBefore:wn,breakInside:wn,columnCount:wn,columnFill:wn,columnGap:wn,columnRule:wn,columnRuleColor:wn,columnRuleStyle:wn,columnRuleWidth:wn,columns:wn,columnSpan:wn,columnWidth:wn,backdropFilter:wn,hyphens:wn,flowInto:wn,flowFrom:wn,regionFragment:wn,textOrientation:wn,tabSize:Qj,fontKerning:wn,textSizeAdjust:wn}};var tV=tj(eV),nV=["animationKeyframes"],OT=new Map,rV={},iV=1,oV=3,sV={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},Db="borderTopLeftRadius",Pb="borderTopRightRadius",zb="borderBottomLeftRadius",Nb="borderBottomRightRadius",Lb="borderLeftColor",Bb="borderLeftStyle",_b="borderLeftWidth",Hb="borderRightColor",jb="borderRightStyle",Vb="borderRightWidth",Fb="right",Ub="marginLeft",$b="marginRight",qb="paddingLeft",Gb="paddingRight",Wb="left",wp={[Db]:Pb,[Pb]:Db,[zb]:Nb,[Nb]:zb,[Lb]:Hb,[Bb]:jb,[_b]:Vb,[Hb]:Lb,[jb]:Bb,[Vb]:_b,[Wb]:Fb,[Ub]:$b,[$b]:Ub,[qb]:Gb,[Gb]:qb,[Fb]:Wb},qf={borderStartStartRadius:Db,borderStartEndRadius:Pb,borderEndStartRadius:zb,borderEndEndRadius:Nb,borderInlineStartColor:Lb,borderInlineStartStyle:Bb,borderInlineStartWidth:_b,borderInlineEndColor:Hb,borderInlineEndStyle:jb,borderInlineEndWidth:Vb,insetInlineEnd:Fb,insetInlineStart:Wb,marginInlineStart:Ub,marginInlineEnd:$b,paddingInlineStart:qb,paddingInlineEnd:Gb},$k=["clear","float","textAlign"];function lV(t){var e={$$css:!0},n=[];function r(i,s,a){var u=cV(a,s),f=s+u,d=OT.get(f),g;if(d!=null)g=d[0],n.push(d[1]);else{var p=i!==s?f:u;g=IS("r",i,p);var m=sV[i]||oV,v=fV(g,s,a),b=[v,m];n.push(b),OT.set(f,[g,b])}return g}return Object.keys(t).sort().forEach(i=>{var s=t[i];if(s!=null){var a;if($k.indexOf(i)>-1){var u=r(i,i,"left"),f=r(i,i,"right");s==="start"?a=[u,f]:s==="end"&&(a=[f,u])}var d=qf[i];if(d!=null){var g=r(i,d,s),p=r(i,wp[d],s);a=[g,p]}if(i==="transitionProperty"){for(var m=Array.isArray(s)?s:[s],v=[],b=0;b<m.length;b++){var S=m[b];typeof S=="string"&&qf[S]!=null&&v.push(b)}if(v.length>0){var w=[...m],C=[...m];v.forEach(R=>{var T=w[R];if(typeof T=="string"){var A=qf[T],k=wp[A];w[R]=A,C[R]=k;var P=r(i,i,w),M=r(i,i,C);a=[P,M]}})}}a==null?a=r(i,i,s):e.$$css$localize=!0,e[i]=a}}),[e,n]}function aV(t,e){var n={$$css:!0},r=[],i=t.animationKeyframes,s=um(t,nV),a=IS("css",e,JSON.stringify(t)),u="."+a,f;if(i!=null){var d=qk(i),g=d[0],p=d[1];f=g.join(","),r.push(...p)}var m=ts(mc(mc({},s),{},{animationName:f}));return r.push(""+u+m),n[a]=a,[n,[[r,iV]]]}function uV(t,e){var n=t||rV,r={},i={},s=function(){var d=n[a],g=a,p=d;if(!Object.prototype.hasOwnProperty.call(n,a)||d==null)return"continue";$k.indexOf(a)>-1&&(d==="start"?p=e?"right":"left":d==="end"&&(p=e?"left":"right"));var m=qf[a];if(m!=null&&(g=e?wp[m]:m),a==="transitionProperty"){var v=Array.isArray(d)?d:[d];v.forEach((b,S)=>{if(typeof b=="string"){var w=qf[b];w!=null&&(v[S]=e?wp[w]:w,p=v.join(" "))}})}r[g]||(i[g]=p),g===a&&(r[g]=!0)};for(var a in n)var u=s();return Lk(i,!0)}function cV(t,e){var n=ni(t,e);return typeof n!="string"?JSON.stringify(n||""):n}function fV(t,e,n){var r=[],i="."+t;switch(e){case"animationKeyframes":{var s=qk(n),a=s[0],u=s[1],f=ts({animationName:a.join(",")});r.push(""+i+f,...u);break}case"placeholderTextColor":{var d=ts({color:n,opacity:1});r.push(i+"::-webkit-input-placeholder"+d,i+"::-moz-placeholder"+d,i+":-ms-input-placeholder"+d,i+"::placeholder"+d);break}case"pointerEvents":{var g=n;if(n==="auto")g="auto!important";else if(n==="none"){g="none!important";var p=ts({pointerEvents:"none"});r.push(i+">* "+p)}else if(n==="box-none"){g="none!important";var m=ts({pointerEvents:"auto"});r.push(i+">* "+m)}else if(n==="box-only"){g="auto!important";var v=ts({pointerEvents:"none"});r.push(i+">* "+v)}var b=ts({pointerEvents:g});r.push(""+i+b);break}case"scrollbarWidth":{n==="none"&&r.push(i+"::-webkit-scrollbar{display:none}");var S=ts({scrollbarWidth:n});r.push(""+i+S);break}default:{var w=ts({[e]:n});r.push(""+i+w);break}}return r}function ts(t){var e=tV(Lk(t)),n=Object.keys(e).map(r=>{var i=e[r],s=KH(r);return Array.isArray(i)?i.map(a=>s+":"+a).join(";"):s+":"+i}).sort().join(";");return"{"+n+";}"}function IS(t,e,n){var r=$H(e+n);return t+"-"+r}function dV(t){var e=["-webkit-",""],n=IS("r","animation",JSON.stringify(t)),r="{"+Object.keys(t).map(s=>{var a=t[s],u=ts(a);return""+s+u}).join("")+"}",i=e.map(s=>"@"+s+"keyframes "+n+r);return[n,i]}function qk(t){if(typeof t=="number")throw new Error("Invalid CSS keyframes type: "+typeof t);var e=[],n=[],r=Array.isArray(t)?t:[t];return r.forEach(i=>{if(typeof i=="string")e.push(i);else{var s=dV(i),a=s[0],u=s[1];e.push(a),n.push(...u)}}),[e,n]}function d0(t,e,n){if(hu){var r=e??document,i=r.getElementById(t);if(i==null)if(i=document.createElement("style"),i.setAttribute("id",t),typeof n=="string"&&i.appendChild(document.createTextNode(n)),r instanceof ShadowRoot)r.insertBefore(i,r.firstChild);else{var s=r.head;s&&s.insertBefore(i,s.firstChild)}return i.sheet}else return null}var hV=Array.prototype.slice;function h0(t){var e={},n={};if(t!=null){var r;hV.call(t.cssRules).forEach((a,u)=>{var f=a.cssText;if(f.indexOf("stylesheet-group")>-1)r=mV(a),e[r]={start:u,rules:[f]};else{var d=IT(f);d!=null&&(n[d]=!0,e[r].rules.push(f))}})}function i(a,u,f){var d=kT(e),g=d.indexOf(u),p=g+1,m=d[p],v=m!=null&&e[m].start!=null?e[m].start:a.cssRules.length,b=vV(a,f,v);if(b){e[u].start==null&&(e[u].start=v);for(var S=p;S<d.length;S+=1){var w=d[S],C=e[w].start||0;e[w].start=C+1}}return b}var s={getTextContent(){return kT(e).map(a=>{var u=e[a].rules,f=u.shift();return u.sort(),u.unshift(f),u.join(`
|
|
3
|
-
`)}).join(`
|
|
4
|
-
`)},insert(a,u){var f=Number(u);if(e[f]==null){var d=gV(f);e[f]={start:null,rules:[d]},t!=null&&i(t,f,d)}var g=IT(a);if(g!=null&&n[g]==null&&(n[g]=!0,e[f].rules.push(a),t!=null)){var p=i(t,f,a);p||e[f].rules.pop()}}};return s}function gV(t){return'[stylesheet-group="'+t+'"]{}'}var pV=/["']/g;function mV(t){return Number(t.selectorText.split(pV)[1])}function kT(t){return Object.keys(t).map(Number).sort((e,n)=>e>n?1:-1)}var yV=/\s*([,])\s*/g;function IT(t){var e=t.split("{")[0].trim();return e!==""?e.replace(yV,"$1"):null}function vV(t,e,n){try{return t.insertRule(e,n),!0}catch{return!1}}var bV="react-native-stylesheet",g0=new WeakMap,Ro=[],DT=["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 DS(t,e){e===void 0&&(e=bV);var n;if(hu){var r=t!=null?t.getRootNode():document;if(Ro.length===0)n=h0(d0(e)),DT.forEach(u=>{n.insert(u,0)}),g0.set(r,Ro.length),Ro.push(n);else{var i=g0.get(r);if(i==null){var s=Ro[0],a=s!=null?s.getTextContent():"";n=h0(d0(e,r,a)),g0.set(r,Ro.length),Ro.push(n)}else n=Ro[i]}}else Ro.length===0?(n=h0(d0(e)),DT.forEach(u=>{n.insert(u,0)}),Ro.push(n)):n=Ro[0];return{getTextContent(){return n.getTextContent()},id:e,insert(u,f){Ro.forEach(d=>{d.insert(u,f)})}}}var gg={},PT;function xV(){if(PT)return gg;PT=1,Object.defineProperty(gg,"__esModule",{value:!0}),gg.localizeStyle=r;var t=new WeakMap,e="$$css$localize";function n(i,s){var a={};for(var u in i)if(u!==e){var f=i[u];Array.isArray(f)?a[u]=s?f[1]:f[0]:a[u]=f}return a}function r(i,s){if(i[e]!=null){var a=s?1:0;if(t.has(i)){var u=t.get(i),f=u[a];return f==null&&(f=n(i,s),u[a]=f,t.set(i,u)),f}var d=n(i,s),g=new Array(2);return g[a]=d,t.set(i,g),d}return i}return gg}var p0,zT;function SV(){return zT||(zT=1,p0=xV()),p0}var wV=SV(),CV={},Gk={height:0,width:0},RV=t=>{var e=t.shadowColor,n=t.shadowOffset,r=t.shadowOpacity,i=t.shadowRadius,s=n||Gk,a=s.height,u=s.width,f=ni(u),d=ni(a),g=ni(i||0),p=kS(e||"black",r);if(p!=null&&f!=null&&d!=null&&g!=null)return f+" "+d+" "+g+" "+p},EV=t=>{var e=t.textShadowColor,n=t.textShadowOffset,r=t.textShadowRadius,i=n||Gk,s=i.height,a=i.width,u=r||0,f=ni(a),d=ni(s),g=ni(u),p=ni(e,"textShadowColor");if(p&&(s!==0||a!==0||u!==0)&&f!=null&&d!=null&&g!=null)return f+" "+d+" "+g+" "+p},TV=t=>{if(typeof t=="string")return t;var e=ni(t.offsetX)||0,n=ni(t.offsetY)||0,r=ni(t.blurRadius)||0,i=ni(t.spreadDistance)||0,s=kS(t.color)||"black",a=t.inset?"inset ":"";return""+a+e+" "+n+" "+r+" "+i+" "+s},AV=t=>t.map(TV).join(", "),MV=t=>{var e=Object.keys(t)[0],n=t[e];if(e==="matrix"||e==="matrix3d")return e+"("+n.join(",")+")";var r=ni(n,e);return e+"("+r+")"},OV=t=>t.map(MV).join(" "),kV=t=>t.map(e=>ni(e)).join(" "),IV={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"},DV={elevation:!0,overlayColor:!0,resizeMode:!0,tintColor:!0},Wk=function(e,n){n===void 0&&(n={});var r=e||CV,i={};if(n.shadow,r.shadowColor!=null||r.shadowOffset!=null||r.shadowOpacity!=null||r.shadowRadius!=null){var s=RV(r);s!=null&&(i.boxShadow=s)}if(n.textShadow,r.textShadowColor!=null||r.textShadowOffset!=null||r.textShadowRadius!=null){var a=EV(r);if(a!=null&&i.textShadow==null){var u=r.textShadow,f=u?u+", "+a:a;i.textShadow=f}}for(var d in r)if(!(DV[d]!=null||d==="shadowColor"||d==="shadowOffset"||d==="shadowOpacity"||d==="shadowRadius"||d==="textShadowColor"||d==="textShadowOffset"||d==="textShadowRadius")){var g=r[d],p=IV[d]||d,m=g;if(!(!Object.prototype.hasOwnProperty.call(r,d)||p!==d&&r[p]!=null))if(p==="aspectRatio"&&typeof m=="number")i[p]=m.toString();else if(p==="boxShadow"){Array.isArray(m)&&(m=AV(m));var v=i.boxShadow;i.boxShadow=v?m+", "+v:m}else p==="fontVariant"?(Array.isArray(m)&&m.length>0&&(m=m.join(" ")),i[p]=m):p==="textAlignVertical"?r.verticalAlign==null&&(i.verticalAlign=m==="center"?"middle":m):p==="transform"?(Array.isArray(m)&&(m=OV(m)),i.transform=m):p==="transformOrigin"?(Array.isArray(m)&&(m=kV(m)),i.transformOrigin=m):i[p]=m}return i},Ef={},NT;function PV(){if(NT)return Ef;NT=1,Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.styleq=void 0;var t=new WeakMap,e="$$css";function n(i){var s,a,u;return i!=null&&(s=i.disableCache===!0,a=i.disableMix===!0,u=i.transform),function(){for(var d=[],g="",p=null,m=s?null:t,v=new Array(arguments.length),b=0;b<arguments.length;b++)v[b]=arguments[b];for(;v.length>0;){var S=v.pop();if(!(S==null||S===!1)){if(Array.isArray(S)){for(var w=0;w<S.length;w++)v.push(S[w]);continue}var C=u!=null?u(S):S;if(C.$$css){var R="";if(m!=null&&m.has(C)){var T=m.get(C);T!=null&&(R=T[0],d.push.apply(d,T[1]),m=T[2])}else{var A=[];for(var k in C){var P=C[k];k!==e&&(typeof P=="string"||P===null?d.includes(k)||(d.push(k),m!=null&&A.push(k),typeof P=="string"&&(R+=R?" "+P:P)):console.error("styleq: ".concat(k," typeof ").concat(String(P),' is not "string" or "null".')))}if(m!=null){var M=new WeakMap;m.set(C,[R,A,M]),m=M}}R&&(g=g?R+" "+g:R)}else if(a)p==null&&(p={}),p=Object.assign({},C,p);else{var D=null;for(var L in C){var H=C[L];H!==void 0&&(d.includes(L)||(H!=null&&(p==null&&(p={}),D==null&&(D={}),D[L]=H),d.push(L),m=null))}D!=null&&(p=Object.assign(D,p))}}}var N=[g,p];return N}}var r=n();return Ef.styleq=r,r.factory=n,Ef}var zV=PV(),NV=["writingDirection"],Kk=new WeakMap,Cp=DS(),Yk={shadow:!0,textShadow:!0};function LV(t,e){e===void 0&&(e={});var n=e,r=n.writingDirection,i=um(n,NV),s=r==="rtl";return zV.styleq.factory({transform(a){var u=Kk.get(a);return u!=null?wV.localizeStyle(u,s):Wk(a,mc(mc({},Yk),i))}})(t)}function Xk(t){t.forEach(e=>{var n=e[0],r=e[1];Cp!=null&&n.forEach(i=>{Cp.insert(i,r)})})}function BV(t){var e=lV(Wk(t,Yk)),n=e[0],r=e[1];return Xk(r),n}function _V(t,e){var n=aV(t,e),r=n[0],i=n[1];return Xk(i),r}var Qk={position:"absolute",left:0,right:0,top:0,bottom:0},HV=Zk({x:mc({},Qk)}).x;function Zk(t){return Object.keys(t).forEach(e=>{var n=t[e];if(n!=null&&n.$$css!==!0){var r;e.indexOf("$raw")>-1?r=_V(n,e.split("$raw")[0]):r=BV(n),Kk.set(n,r)}}),t}function jV(t,e){return[t,e]}function VV(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=e.flat(1/0),i={},s=0;s<r.length;s++){var a=r[s];a!=null&&typeof a=="object"&&Object.assign(i,a)}return i}function FV(){return{id:Cp.id,textContent:Cp.getTextContent()}}function rl(t,e){e===void 0&&(e={});var n=e.writingDirection==="rtl",r=LV(t,e);return Array.isArray(r)&&r[1]!=null&&(r[1]=uV(r[1],n)),r}rl.absoluteFill=HV;rl.absoluteFillObject=Qk;rl.create=Zk;rl.compose=jV;rl.flatten=VV;rl.getSheet=FV;rl.hairlineWidth=1;hu&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__&&(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle=rl.flatten);var zd=rl,UV=["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"],$V={},qV=Object.prototype.hasOwnProperty,GV=Array.isArray,WV=/[A-Z]/g;function KV(t){return"-"+t.toLowerCase()}function YV(t){return t.replace(WV,KV)}function Xu(t){return GV(t)?t.join(" "):t}var XV=zd.create({auto:{pointerEvents:"auto"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"},none:{pointerEvents:"none"}}),QV=(t,e,n)=>{e||(e=$V);var r=e,i=r["aria-activedescendant"],s=r.accessibilityActiveDescendant,a=r["aria-atomic"],u=r.accessibilityAtomic,f=r["aria-autocomplete"],d=r.accessibilityAutoComplete,g=r["aria-busy"],p=r.accessibilityBusy,m=r["aria-checked"],v=r.accessibilityChecked,b=r["aria-colcount"],S=r.accessibilityColumnCount,w=r["aria-colindex"],C=r.accessibilityColumnIndex,R=r["aria-colspan"],T=r.accessibilityColumnSpan,A=r["aria-controls"],k=r.accessibilityControls,P=r["aria-current"],M=r.accessibilityCurrent,D=r["aria-describedby"],L=r.accessibilityDescribedBy,H=r["aria-details"],N=r.accessibilityDetails,_=r["aria-disabled"],$=r.accessibilityDisabled,F=r["aria-errormessage"],G=r.accessibilityErrorMessage,j=r["aria-expanded"],q=r.accessibilityExpanded,V=r["aria-flowto"],te=r.accessibilityFlowTo,J=r["aria-haspopup"],z=r.accessibilityHasPopup,U=r["aria-hidden"],W=r.accessibilityHidden,X=r["aria-invalid"],ie=r.accessibilityInvalid,ee=r["aria-keyshortcuts"],ue=r.accessibilityKeyShortcuts,Y=r["aria-label"],le=r.accessibilityLabel,xe=r["aria-labelledby"],ve=r.accessibilityLabelledBy,de=r["aria-level"],me=r.accessibilityLevel,Ce=r["aria-live"],De=r.accessibilityLiveRegion,Pe=r["aria-modal"],Ee=r.accessibilityModal,je=r["aria-multiline"],ke=r.accessibilityMultiline,_e=r["aria-multiselectable"],Ge=r.accessibilityMultiSelectable,We=r["aria-orientation"],fe=r.accessibilityOrientation,ne=r["aria-owns"],Q=r.accessibilityOwns,Se=r["aria-placeholder"],ge=r.accessibilityPlaceholder,Ie=r["aria-posinset"],Je=r.accessibilityPosInSet,nt=r["aria-pressed"],Le=r.accessibilityPressed,it=r["aria-readonly"],ht=r.accessibilityReadOnly,wt=r["aria-required"],bn=r.accessibilityRequired;r.role,r.accessibilityRole;var ut=r["aria-roledescription"],Mn=r.accessibilityRoleDescription,Qt=r["aria-rowcount"],xn=r.accessibilityRowCount,nn=r["aria-rowindex"],Wt=r.accessibilityRowIndex,lt=r["aria-rowspan"],yt=r.accessibilityRowSpan,rt=r["aria-selected"],Zt=r.accessibilitySelected,Hn=r["aria-setsize"],jn=r.accessibilitySetSize,Jt=r["aria-sort"],Rn=r.accessibilitySort,Dt=r["aria-valuemax"],Br=r.accessibilityValueMax,or=r["aria-valuemin"],ot=r.accessibilityValueMin,Ut=r["aria-valuenow"],$n=r.accessibilityValueNow,Ln=r["aria-valuetext"],wr=r.accessibilityValueText,rn=r.dataSet,Pt=r.focusable,zt=r.id,et=r.nativeID,Cr=r.pointerEvents,_c=r.style,xs=r.tabIndex,fl=r.testID,Ve=um(r,UV),Sa=_||$,Zn=zk.propsToAriaRole(e),Bi=i??s;Bi!=null&&(Ve["aria-activedescendant"]=Bi);var li=a!=null?i:u;li!=null&&(Ve["aria-atomic"]=li);var ai=f??d;ai!=null&&(Ve["aria-autocomplete"]=ai);var Vn=g??p;Vn!=null&&(Ve["aria-busy"]=Vn);var sr=m??v;sr!=null&&(Ve["aria-checked"]=sr);var _r=b??S;_r!=null&&(Ve["aria-colcount"]=_r);var _i=w??C;_i!=null&&(Ve["aria-colindex"]=_i);var mo=R??T;mo!=null&&(Ve["aria-colspan"]=mo);var wa=A??k;wa!=null&&(Ve["aria-controls"]=Xu(wa));var Ca=P??M;Ca!=null&&(Ve["aria-current"]=Ca);var Ss=D??L;Ss!=null&&(Ve["aria-describedby"]=Xu(Ss));var Ra=H??N;Ra!=null&&(Ve["aria-details"]=Ra),Sa===!0&&(Ve["aria-disabled"]=!0,(t==="button"||t==="form"||t==="input"||t==="select"||t==="textarea")&&(Ve.disabled=!0));var yo=F??G;yo!=null&&(Ve["aria-errormessage"]=yo);var ws=j??q;ws!=null&&(Ve["aria-expanded"]=ws);var Zr=V??te;Zr!=null&&(Ve["aria-flowto"]=Xu(Zr));var qn=J??z;qn!=null&&(Ve["aria-haspopup"]=qn);var Hr=U??W;Hr===!0&&(Ve["aria-hidden"]=Hr);var Jr=X??ie;Jr!=null&&(Ve["aria-invalid"]=Jr);var Hi=ee??ue;Hi!=null&&(Ve["aria-keyshortcuts"]=Xu(Hi));var Fo=Y??le;Fo!=null&&(Ve["aria-label"]=Fo);var Cs=xe??ve;Cs!=null&&(Ve["aria-labelledby"]=Xu(Cs));var bu=de??me;bu!=null&&(Ve["aria-level"]=bu);var lr=Ce??De;lr!=null&&(Ve["aria-live"]=lr==="none"?"off":lr);var dl=Pe??Ee;dl!=null&&(Ve["aria-modal"]=dl);var Ea=je??ke;Ea!=null&&(Ve["aria-multiline"]=Ea);var Rs=_e??Ge;Rs!=null&&(Ve["aria-multiselectable"]=Rs);var ui=We??fe;ui!=null&&(Ve["aria-orientation"]=ui);var hl=ne??Q;hl!=null&&(Ve["aria-owns"]=Xu(hl));var Uo=Se??ge;Uo!=null&&(Ve["aria-placeholder"]=Uo);var ji=Ie??Je;ji!=null&&(Ve["aria-posinset"]=ji);var Es=nt??Le;Es!=null&&(Ve["aria-pressed"]=Es);var gl=it??ht;gl!=null&&(Ve["aria-readonly"]=gl,(t==="input"||t==="select"||t==="textarea")&&(Ve.readOnly=!0));var $o=wt??bn;$o!=null&&(Ve["aria-required"]=$o,(t==="input"||t==="select"||t==="textarea")&&(Ve.required=bn)),Zn!=null&&(Ve.role=Zn==="none"?"presentation":Zn);var Si=ut??Mn;Si!=null&&(Ve["aria-roledescription"]=Si);var pl=Qt??xn;pl!=null&&(Ve["aria-rowcount"]=pl);var ml=nn??Wt;ml!=null&&(Ve["aria-rowindex"]=ml);var vo=lt??yt;vo!=null&&(Ve["aria-rowspan"]=vo);var jr=rt??Zt;jr!=null&&(Ve["aria-selected"]=jr);var yl=Hn??jn;yl!=null&&(Ve["aria-setsize"]=yl);var vl=Jt??Rn;vl!=null&&(Ve["aria-sort"]=vl);var bo=Dt??Br;bo!=null&&(Ve["aria-valuemax"]=bo);var xo=or??ot;xo!=null&&(Ve["aria-valuemin"]=xo);var Ts=Ut??$n;Ts!=null&&(Ve["aria-valuenow"]=Ts);var bl=Ln??wr;if(bl!=null&&(Ve["aria-valuetext"]=bl),rn!=null){for(var xl in rn)if(qV.call(rn,xl)){var Oe=YV(xl),ze=rn[xl];ze!=null&&(Ve["data-"+Oe]=ze)}}xs===0||xs==="0"||xs===-1||xs==="-1"?Ve.tabIndex=xs:(Pt===!1&&(Ve.tabIndex="-1"),t==="a"||t==="button"||t==="input"||t==="select"||t==="textarea"?(Pt===!1||$===!0)&&(Ve.tabIndex="-1"):Zn==="button"||Zn==="checkbox"||Zn==="link"||Zn==="radio"||Zn==="textbox"||Zn==="switch"?Pt!==!1&&(Ve.tabIndex="0"):Pt===!0&&(Ve.tabIndex="0"));var $t=zd([_c,Cr&&XV[Cr]],mc({writingDirection:"ltr"},n)),Bt=$t[0],en=$t[1];Bt&&(Ve.className=Bt),en&&(Ve.style=en);var Jn=zt??et;return Jn!=null&&(Ve.id=Jn),fl!=null&&(Ve["data-testid"]=fl),Ve.type==null&&t==="button"&&(Ve.type="button"),Ve},m0={exports:{}},bt={};var LT;function ZV(){if(LT)return bt;LT=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),m=Symbol.iterator;function v(z){return z===null||typeof z!="object"?null:(z=m&&z[m]||z["@@iterator"],typeof z=="function"?z:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function C(z,U,W){this.props=z,this.context=U,this.refs=w,this.updater=W||b}C.prototype.isReactComponent={},C.prototype.setState=function(z,U){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,U,"setState")},C.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function R(){}R.prototype=C.prototype;function T(z,U,W){this.props=z,this.context=U,this.refs=w,this.updater=W||b}var A=T.prototype=new R;A.constructor=T,S(A,C.prototype),A.isPureReactComponent=!0;var k=Array.isArray;function P(){}var M={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function L(z,U,W){var X=W.ref;return{$$typeof:t,type:z,key:U,ref:X!==void 0?X:null,props:W}}function H(z,U){return L(z.type,U,z.props)}function N(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function _(z){var U={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(W){return U[W]})}var $=/\/+/g;function F(z,U){return typeof z=="object"&&z!==null&&z.key!=null?_(""+z.key):U.toString(36)}function G(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(P,P):(z.status="pending",z.then(function(U){z.status==="pending"&&(z.status="fulfilled",z.value=U)},function(U){z.status==="pending"&&(z.status="rejected",z.reason=U)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function j(z,U,W,X,ie){var ee=typeof z;(ee==="undefined"||ee==="boolean")&&(z=null);var ue=!1;if(z===null)ue=!0;else switch(ee){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(z.$$typeof){case t:case e:ue=!0;break;case g:return ue=z._init,j(ue(z._payload),U,W,X,ie)}}if(ue)return ie=ie(z),ue=X===""?"."+F(z,0):X,k(ie)?(W="",ue!=null&&(W=ue.replace($,"$&/")+"/"),j(ie,U,W,"",function(xe){return xe})):ie!=null&&(N(ie)&&(ie=H(ie,W+(ie.key==null||z&&z.key===ie.key?"":(""+ie.key).replace($,"$&/")+"/")+ue)),U.push(ie)),1;ue=0;var Y=X===""?".":X+":";if(k(z))for(var le=0;le<z.length;le++)X=z[le],ee=Y+F(X,le),ue+=j(X,U,W,ee,ie);else if(le=v(z),typeof le=="function")for(z=le.call(z),le=0;!(X=z.next()).done;)X=X.value,ee=Y+F(X,le++),ue+=j(X,U,W,ee,ie);else if(ee==="object"){if(typeof z.then=="function")return j(G(z),U,W,X,ie);throw U=String(z),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ue}function q(z,U,W){if(z==null)return z;var X=[],ie=0;return j(z,X,"","",function(ee){return U.call(W,ee,ie++)}),X}function V(z){if(z._status===-1){var U=z._result;U=U(),U.then(function(W){(z._status===0||z._status===-1)&&(z._status=1,z._result=W)},function(W){(z._status===0||z._status===-1)&&(z._status=2,z._result=W)}),z._status===-1&&(z._status=0,z._result=U)}if(z._status===1)return z._result.default;throw z._result}var te=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},J={map:q,forEach:function(z,U,W){q(z,function(){U.apply(this,arguments)},W)},count:function(z){var U=0;return q(z,function(){U++}),U},toArray:function(z){return q(z,function(U){return U})||[]},only:function(z){if(!N(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return bt.Activity=p,bt.Children=J,bt.Component=C,bt.Fragment=n,bt.Profiler=i,bt.PureComponent=T,bt.StrictMode=r,bt.Suspense=f,bt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,bt.__COMPILER_RUNTIME={__proto__:null,c:function(z){return M.H.useMemoCache(z)}},bt.cache=function(z){return function(){return z.apply(null,arguments)}},bt.cacheSignal=function(){return null},bt.cloneElement=function(z,U,W){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var X=S({},z.props),ie=z.key;if(U!=null)for(ee in U.key!==void 0&&(ie=""+U.key),U)!D.call(U,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&U.ref===void 0||(X[ee]=U[ee]);var ee=arguments.length-2;if(ee===1)X.children=W;else if(1<ee){for(var ue=Array(ee),Y=0;Y<ee;Y++)ue[Y]=arguments[Y+2];X.children=ue}return L(z.type,ie,X)},bt.createContext=function(z){return z={$$typeof:a,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:s,_context:z},z},bt.createElement=function(z,U,W){var X,ie={},ee=null;if(U!=null)for(X in U.key!==void 0&&(ee=""+U.key),U)D.call(U,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(ie[X]=U[X]);var ue=arguments.length-2;if(ue===1)ie.children=W;else if(1<ue){for(var Y=Array(ue),le=0;le<ue;le++)Y[le]=arguments[le+2];ie.children=Y}if(z&&z.defaultProps)for(X in ue=z.defaultProps,ue)ie[X]===void 0&&(ie[X]=ue[X]);return L(z,ee,ie)},bt.createRef=function(){return{current:null}},bt.forwardRef=function(z){return{$$typeof:u,render:z}},bt.isValidElement=N,bt.lazy=function(z){return{$$typeof:g,_payload:{_status:-1,_result:z},_init:V}},bt.memo=function(z,U){return{$$typeof:d,type:z,compare:U===void 0?null:U}},bt.startTransition=function(z){var U=M.T,W={};M.T=W;try{var X=z(),ie=M.S;ie!==null&&ie(W,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(P,te)}catch(ee){te(ee)}finally{U!==null&&W.types!==null&&(U.types=W.types),M.T=U}},bt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},bt.use=function(z){return M.H.use(z)},bt.useActionState=function(z,U,W){return M.H.useActionState(z,U,W)},bt.useCallback=function(z,U){return M.H.useCallback(z,U)},bt.useContext=function(z){return M.H.useContext(z)},bt.useDebugValue=function(){},bt.useDeferredValue=function(z,U){return M.H.useDeferredValue(z,U)},bt.useEffect=function(z,U){return M.H.useEffect(z,U)},bt.useEffectEvent=function(z){return M.H.useEffectEvent(z)},bt.useId=function(){return M.H.useId()},bt.useImperativeHandle=function(z,U,W){return M.H.useImperativeHandle(z,U,W)},bt.useInsertionEffect=function(z,U){return M.H.useInsertionEffect(z,U)},bt.useLayoutEffect=function(z,U){return M.H.useLayoutEffect(z,U)},bt.useMemo=function(z,U){return M.H.useMemo(z,U)},bt.useOptimistic=function(z,U){return M.H.useOptimistic(z,U)},bt.useReducer=function(z,U,W){return M.H.useReducer(z,U,W)},bt.useRef=function(z){return M.H.useRef(z)},bt.useState=function(z){return M.H.useState(z)},bt.useSyncExternalStore=function(z,U,W){return M.H.useSyncExternalStore(z,U,W)},bt.useTransition=function(){return M.H.useTransition()},bt.version="19.2.3",bt}var BT;function Nd(){return BT||(BT=1,m0.exports=ZV()),m0.exports}var E=Nd();const Ne=_o(E),JV=wH({__proto__:null,default:Ne},[E]);var e3=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),_T=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"]),HT=new Map;function t3(t){var e=HT.get(t);if(e)return e;var n=!1;if(Intl.Locale)try{var r=new Intl.Locale(t).maximize().script;n=e3.has(r)}catch{var i=t.split("-")[0];n=_T.has(i)}else{var s=t.split("-")[0];n=_T.has(s)}return HT.set(t,n),n}var n3={direction:"ltr",locale:"en-US"},Jk=E.createContext(n3);function eI(t){return t3(t)?"rtl":"ltr"}function r3(t){var e=t.direction,n=t.locale,r=t.children,i=e||n;return i?Ne.createElement(Jk.Provider,{children:r,value:{direction:n?eI(n):e,locale:n}}):r}function i3(){return E.useContext(Jk)}var o3=(t,e,n)=>{var r;t&&t.constructor===String&&(r=zk.propsToAccessibilityComponent(e));var i=r||t,s=QV(i,e,n),a=Ne.createElement(i,s),u=s.dir?Ne.createElement(r3,{children:a,direction:s.dir,locale:s.lang}):a;return u},y0={exports:{}},Tf={},v0={exports:{}},b0={};var jT;function s3(){return jT||(jT=1,(function(t){function e(j,q){var V=j.length;j.push(q);e:for(;0<V;){var te=V-1>>>1,J=j[te];if(0<i(J,q))j[te]=q,j[V]=J,V=te;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var q=j[0],V=j.pop();if(V!==q){j[0]=V;e:for(var te=0,J=j.length,z=J>>>1;te<z;){var U=2*(te+1)-1,W=j[U],X=U+1,ie=j[X];if(0>i(W,V))X<J&&0>i(ie,W)?(j[te]=ie,j[X]=V,te=X):(j[te]=W,j[U]=V,te=U);else if(X<J&&0>i(ie,V))j[te]=ie,j[X]=V,te=X;else break e}}return q}function i(j,q){var V=j.sortIndex-q.sortIndex;return V!==0?V:j.id-q.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var f=[],d=[],g=1,p=null,m=3,v=!1,b=!1,S=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A(j){for(var q=n(d);q!==null;){if(q.callback===null)r(d);else if(q.startTime<=j)r(d),q.sortIndex=q.expirationTime,e(f,q);else break;q=n(d)}}function k(j){if(S=!1,A(j),!b)if(n(f)!==null)b=!0,P||(P=!0,_());else{var q=n(d);q!==null&&G(k,q.startTime-j)}}var P=!1,M=-1,D=5,L=-1;function H(){return w?!0:!(t.unstable_now()-L<D)}function N(){if(w=!1,P){var j=t.unstable_now();L=j;var q=!0;try{e:{b=!1,S&&(S=!1,R(M),M=-1),v=!0;var V=m;try{t:{for(A(j),p=n(f);p!==null&&!(p.expirationTime>j&&H());){var te=p.callback;if(typeof te=="function"){p.callback=null,m=p.priorityLevel;var J=te(p.expirationTime<=j);if(j=t.unstable_now(),typeof J=="function"){p.callback=J,A(j),q=!0;break t}p===n(f)&&r(f),A(j)}else r(f);p=n(f)}if(p!==null)q=!0;else{var z=n(d);z!==null&&G(k,z.startTime-j),q=!1}}break e}finally{p=null,m=V,v=!1}q=void 0}}finally{q?_():P=!1}}}var _;if(typeof T=="function")_=function(){T(N)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,F=$.port2;$.port1.onmessage=N,_=function(){F.postMessage(null)}}else _=function(){C(N,0)};function G(j,q){M=C(function(){j(t.unstable_now())},q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(j){j.callback=null},t.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<j?Math.floor(1e3/j):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_next=function(j){switch(m){case 1:case 2:case 3:var q=3;break;default:q=m}var V=m;m=q;try{return j()}finally{m=V}},t.unstable_requestPaint=function(){w=!0},t.unstable_runWithPriority=function(j,q){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var V=m;m=j;try{return q()}finally{m=V}},t.unstable_scheduleCallback=function(j,q,V){var te=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?te+V:te):V=te,j){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=V+J,j={id:g++,callback:q,priorityLevel:j,startTime:V,expirationTime:J,sortIndex:-1},V>te?(j.sortIndex=V,e(d,j),n(f)===null&&j===n(d)&&(S?(R(M),M=-1):S=!0,G(k,V-te))):(j.sortIndex=J,e(f,j),b||v||(b=!0,P||(P=!0,_()))),j},t.unstable_shouldYield=H,t.unstable_wrapCallback=function(j){var q=m;return function(){var V=m;m=q;try{return j.apply(this,arguments)}finally{m=V}}}})(b0)),b0}var VT;function l3(){return VT||(VT=1,v0.exports=s3()),v0.exports}var x0={exports:{}},Ur={};var FT;function a3(){if(FT)return Ur;FT=1;var t=Nd();function e(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(f,d,g){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:f,containerInfo:d,implementation:g}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Ur.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ur.createPortal=function(f,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return s(f,d,null,g)},Ur.flushSync=function(f){var d=a.T,g=r.p;try{if(a.T=null,r.p=2,f)return f()}finally{a.T=d,r.p=g,r.d.f()}},Ur.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},Ur.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Ur.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var g=d.as,p=u(g,d.crossOrigin),m=typeof d.integrity=="string"?d.integrity:void 0,v=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:m,fetchPriority:v}):g==="script"&&r.d.X(f,{crossOrigin:p,integrity:m,fetchPriority:v,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Ur.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=u(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},Ur.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,p=u(g,d.crossOrigin);r.d.L(f,g,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Ur.preloadModule=function(f,d){if(typeof f=="string")if(d){var g=u(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},Ur.requestFormReset=function(f){r.d.r(f)},Ur.unstable_batchedUpdates=function(f,d){return f(d)},Ur.useFormState=function(f,d,g){return a.H.useFormState(f,d,g)},Ur.useFormStatus=function(){return a.H.useHostTransitionStatus()},Ur.version="19.2.3",Ur}var UT;function tI(){if(UT)return x0.exports;UT=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),x0.exports=a3(),x0.exports}var $T;function u3(){if($T)return Tf;$T=1;var t=l3(),e=Nd(),n=tI();function r(o){var l="https://react.dev/errors/"+o;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)l+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function s(o){var l=o,c=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(c=l.return),o=l.return;while(o)}return l.tag===3?c:null}function a(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function u(o){if(o.tag===31){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function f(o){if(s(o)!==o)throw Error(r(188))}function d(o){var l=o.alternate;if(!l){if(l=s(o),l===null)throw Error(r(188));return l!==o?null:o}for(var c=o,h=l;;){var y=c.return;if(y===null)break;var x=y.alternate;if(x===null){if(h=y.return,h!==null){c=h;continue}break}if(y.child===x.child){for(x=y.child;x;){if(x===c)return f(y),o;if(x===h)return f(y),l;x=x.sibling}throw Error(r(188))}if(c.return!==h.return)c=y,h=x;else{for(var I=!1,B=y.child;B;){if(B===c){I=!0,c=y,h=x;break}if(B===h){I=!0,h=y,c=x;break}B=B.sibling}if(!I){for(B=x.child;B;){if(B===c){I=!0,c=x,h=y;break}if(B===h){I=!0,h=x,c=y;break}B=B.sibling}if(!I)throw Error(r(189))}}if(c.alternate!==h)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?o:l}function g(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o;for(o=o.child;o!==null;){if(l=g(o),l!==null)return l;o=o.sibling}return null}var p=Object.assign,m=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),T=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),N=Symbol.iterator;function _(o){return o===null||typeof o!="object"?null:(o=N&&o[N]||o["@@iterator"],typeof o=="function"?o:null)}var $=Symbol.for("react.client.reference");function F(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===$?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case S:return"Fragment";case C:return"Profiler";case w:return"StrictMode";case k:return"Suspense";case P:return"SuspenseList";case L:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case b:return"Portal";case T:return o.displayName||"Context";case R:return(o._context.displayName||"Context")+".Consumer";case A:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case M:return l=o.displayName||null,l!==null?l:F(o.type)||"Memo";case D:l=o._payload,o=o._init;try{return F(o(l))}catch{}}return null}var G=Array.isArray,j=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},te=[],J=-1;function z(o){return{current:o}}function U(o){0>J||(o.current=te[J],te[J]=null,J--)}function W(o,l){J++,te[J]=o.current,o.current=l}var X=z(null),ie=z(null),ee=z(null),ue=z(null);function Y(o,l){switch(W(ee,l),W(ie,o),W(X,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?IE(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=IE(l),o=DE(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}U(X),W(X,o)}function le(){U(X),U(ie),U(ee)}function xe(o){o.memoizedState!==null&&W(ue,o);var l=X.current,c=DE(l,o.type);l!==c&&(W(ie,o),W(X,c))}function ve(o){ie.current===o&&(U(X),U(ie)),ue.current===o&&(U(ue),Sf._currentValue=V)}var de,me;function Ce(o){if(de===void 0)try{throw Error()}catch(c){var l=c.stack.trim().match(/\n( *(at )?)/);de=l&&l[1]||"",me=-1<c.stack.indexOf(`
|
|
5
|
-
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
6
|
-
`+de+o+me}var De=!1;function Pe(o,l){if(!o||De)return"";De=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(ce){var ae=ce}Reflect.construct(o,[],be)}else{try{be.call()}catch(ce){ae=ce}o.call(be.prototype)}}else{try{throw Error()}catch(ce){ae=ce}(be=o())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(ce){if(ce&&ae&&typeof ce.stack=="string")return[ce.stack,ae.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=h.DetermineComponentFrameRoot(),I=x[0],B=x[1];if(I&&B){var K=I.split(`
|
|
7
|
-
`),se=B.split(`
|
|
8
|
-
`);for(y=h=0;h<K.length&&!K[h].includes("DetermineComponentFrameRoot");)h++;for(;y<se.length&&!se[y].includes("DetermineComponentFrameRoot");)y++;if(h===K.length||y===se.length)for(h=K.length-1,y=se.length-1;1<=h&&0<=y&&K[h]!==se[y];)y--;for(;1<=h&&0<=y;h--,y--)if(K[h]!==se[y]){if(h!==1||y!==1)do if(h--,y--,0>y||K[h]!==se[y]){var he=`
|
|
9
|
-
`+K[h].replace(" at new "," at ");return o.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",o.displayName)),he}while(1<=h&&0<=y);break}}}finally{De=!1,Error.prepareStackTrace=c}return(c=o?o.displayName||o.name:"")?Ce(c):""}function Ee(o,l){switch(o.tag){case 26:case 27:case 5:return Ce(o.type);case 16:return Ce("Lazy");case 13:return o.child!==l&&l!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return Pe(o.type,!1);case 11:return Pe(o.type.render,!1);case 1:return Pe(o.type,!0);case 31:return Ce("Activity");default:return""}}function je(o){try{var l="",c=null;do l+=Ee(o,c),c=o,o=o.return;while(o);return l}catch(h){return`
|
|
10
|
-
Error generating stack: `+h.message+`
|
|
11
|
-
`+h.stack}}var ke=Object.prototype.hasOwnProperty,_e=t.unstable_scheduleCallback,Ge=t.unstable_cancelCallback,We=t.unstable_shouldYield,fe=t.unstable_requestPaint,ne=t.unstable_now,Q=t.unstable_getCurrentPriorityLevel,Se=t.unstable_ImmediatePriority,ge=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,Je=t.unstable_LowPriority,nt=t.unstable_IdlePriority,Le=t.log,it=t.unstable_setDisableYieldValue,ht=null,wt=null;function bn(o){if(typeof Le=="function"&&it(o),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(ht,o)}catch{}}var ut=Math.clz32?Math.clz32:xn,Mn=Math.log,Qt=Math.LN2;function xn(o){return o>>>=0,o===0?32:31-(Mn(o)/Qt|0)|0}var nn=256,Wt=262144,lt=4194304;function yt(o){var l=o&42;if(l!==0)return l;switch(o&-o){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function rt(o,l,c){var h=o.pendingLanes;if(h===0)return 0;var y=0,x=o.suspendedLanes,I=o.pingedLanes;o=o.warmLanes;var B=h&134217727;return B!==0?(h=B&~x,h!==0?y=yt(h):(I&=B,I!==0?y=yt(I):c||(c=B&~o,c!==0&&(y=yt(c))))):(B=h&~x,B!==0?y=yt(B):I!==0?y=yt(I):c||(c=h&~o,c!==0&&(y=yt(c)))),y===0?0:l!==0&&l!==y&&(l&x)===0&&(x=y&-y,c=l&-l,x>=c||x===32&&(c&4194048)!==0)?l:y}function Zt(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function Hn(o,l){switch(o){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32: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 l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function jn(){var o=lt;return lt<<=1,(lt&62914560)===0&&(lt=4194304),o}function Jt(o){for(var l=[],c=0;31>c;c++)l.push(o);return l}function Rn(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Dt(o,l,c,h,y,x){var I=o.pendingLanes;o.pendingLanes=c,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=c,o.entangledLanes&=c,o.errorRecoveryDisabledLanes&=c,o.shellSuspendCounter=0;var B=o.entanglements,K=o.expirationTimes,se=o.hiddenUpdates;for(c=I&~c;0<c;){var he=31-ut(c),be=1<<he;B[he]=0,K[he]=-1;var ae=se[he];if(ae!==null)for(se[he]=null,he=0;he<ae.length;he++){var ce=ae[he];ce!==null&&(ce.lane&=-536870913)}c&=~be}h!==0&&Br(o,h,0),x!==0&&y===0&&o.tag!==0&&(o.suspendedLanes|=x&~(I&~l))}function Br(o,l,c){o.pendingLanes|=l,o.suspendedLanes&=~l;var h=31-ut(l);o.entangledLanes|=l,o.entanglements[h]=o.entanglements[h]|1073741824|c&261930}function or(o,l){var c=o.entangledLanes|=l;for(o=o.entanglements;c;){var h=31-ut(c),y=1<<h;y&l|o[h]&l&&(o[h]|=l),c&=~y}}function ot(o,l){var c=l&-l;return c=(c&42)!==0?1:Ut(c),(c&(o.suspendedLanes|l))!==0?0:c}function Ut(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function $n(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function Ln(){var o=q.p;return o!==0?o:(o=window.event,o===void 0?32:tT(o.type))}function wr(o,l){var c=q.p;try{return q.p=o,l()}finally{q.p=c}}var rn=Math.random().toString(36).slice(2),Pt="__reactFiber$"+rn,zt="__reactProps$"+rn,et="__reactContainer$"+rn,Cr="__reactEvents$"+rn,_c="__reactListeners$"+rn,xs="__reactHandles$"+rn,fl="__reactResources$"+rn,Ve="__reactMarker$"+rn;function Sa(o){delete o[Pt],delete o[zt],delete o[Cr],delete o[_c],delete o[xs]}function Zn(o){var l=o[Pt];if(l)return l;for(var c=o.parentNode;c;){if(l=c[et]||c[Pt]){if(c=l.alternate,l.child!==null||c!==null&&c.child!==null)for(o=HE(o);o!==null;){if(c=o[Pt])return c;o=HE(o)}return l}o=c,c=o.parentNode}return null}function Bi(o){if(o=o[Pt]||o[et]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function li(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function ai(o){var l=o[fl];return l||(l=o[fl]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Vn(o){o[Ve]=!0}var sr=new Set,_r={};function _i(o,l){mo(o,l),mo(o+"Capture",l)}function mo(o,l){for(_r[o]=l,o=0;o<l.length;o++)sr.add(l[o])}var wa=RegExp("^[: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]*$"),Ca={},Ss={};function Ra(o){return ke.call(Ss,o)?!0:ke.call(Ca,o)?!1:wa.test(o)?Ss[o]=!0:(Ca[o]=!0,!1)}function yo(o,l,c){if(Ra(l))if(c===null)o.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":o.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){o.removeAttribute(l);return}}o.setAttribute(l,""+c)}}function ws(o,l,c){if(c===null)o.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(l);return}o.setAttribute(l,""+c)}}function Zr(o,l,c,h){if(h===null)o.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(c);return}o.setAttributeNS(l,c,""+h)}}function qn(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Hr(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Jr(o,l,c){var h=Object.getOwnPropertyDescriptor(o.constructor.prototype,l);if(!o.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var y=h.get,x=h.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return y.call(this)},set:function(I){c=""+I,x.call(this,I)}}),Object.defineProperty(o,l,{enumerable:h.enumerable}),{getValue:function(){return c},setValue:function(I){c=""+I},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Hi(o){if(!o._valueTracker){var l=Hr(o)?"checked":"value";o._valueTracker=Jr(o,l,""+o[l])}}function Fo(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var c=l.getValue(),h="";return o&&(h=Hr(o)?o.checked?"true":"false":o.value),o=h,o!==c?(l.setValue(o),!0):!1}function Cs(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var bu=/[\n"\\]/g;function lr(o){return o.replace(bu,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function dl(o,l,c,h,y,x,I,B){o.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?o.type=I:o.removeAttribute("type"),l!=null?I==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+qn(l)):o.value!==""+qn(l)&&(o.value=""+qn(l)):I!=="submit"&&I!=="reset"||o.removeAttribute("value"),l!=null?Rs(o,I,qn(l)):c!=null?Rs(o,I,qn(c)):h!=null&&o.removeAttribute("value"),y==null&&x!=null&&(o.defaultChecked=!!x),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?o.name=""+qn(B):o.removeAttribute("name")}function Ea(o,l,c,h,y,x,I,B){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(o.type=x),l!=null||c!=null){if(!(x!=="submit"&&x!=="reset"||l!=null)){Hi(o);return}c=c!=null?""+qn(c):"",l=l!=null?""+qn(l):c,B||l===o.value||(o.value=l),o.defaultValue=l}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,o.checked=B?o.checked:!!h,o.defaultChecked=!!h,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(o.name=I),Hi(o)}function Rs(o,l,c){l==="number"&&Cs(o.ownerDocument)===o||o.defaultValue===""+c||(o.defaultValue=""+c)}function ui(o,l,c,h){if(o=o.options,l){l={};for(var y=0;y<c.length;y++)l["$"+c[y]]=!0;for(c=0;c<o.length;c++)y=l.hasOwnProperty("$"+o[c].value),o[c].selected!==y&&(o[c].selected=y),y&&h&&(o[c].defaultSelected=!0)}else{for(c=""+qn(c),l=null,y=0;y<o.length;y++){if(o[y].value===c){o[y].selected=!0,h&&(o[y].defaultSelected=!0);return}l!==null||o[y].disabled||(l=o[y])}l!==null&&(l.selected=!0)}}function hl(o,l,c){if(l!=null&&(l=""+qn(l),l!==o.value&&(o.value=l),c==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=c!=null?""+qn(c):""}function Uo(o,l,c,h){if(l==null){if(h!=null){if(c!=null)throw Error(r(92));if(G(h)){if(1<h.length)throw Error(r(93));h=h[0]}c=h}c==null&&(c=""),l=c}c=qn(l),o.defaultValue=c,h=o.textContent,h===c&&h!==""&&h!==null&&(o.value=h),Hi(o)}function ji(o,l){if(l){var c=o.firstChild;if(c&&c===o.lastChild&&c.nodeType===3){c.nodeValue=l;return}}o.textContent=l}var Es=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function gl(o,l,c){var h=l.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?h?o.setProperty(l,""):l==="float"?o.cssFloat="":o[l]="":h?o.setProperty(l,c):typeof c!="number"||c===0||Es.has(l)?l==="float"?o.cssFloat=c:o[l]=(""+c).trim():o[l]=c+"px"}function $o(o,l,c){if(l!=null&&typeof l!="object")throw Error(r(62));if(o=o.style,c!=null){for(var h in c)!c.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?o.setProperty(h,""):h==="float"?o.cssFloat="":o[h]="");for(var y in l)h=l[y],l.hasOwnProperty(y)&&c[y]!==h&&gl(o,y,h)}else for(var x in l)l.hasOwnProperty(x)&&gl(o,x,l[x])}function Si(o){if(o.indexOf("-")===-1)return!1;switch(o){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 pl=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),ml=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function vo(o){return ml.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function jr(){}var yl=null;function vl(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var bo=null,xo=null;function Ts(o){var l=Bi(o);if(l&&(o=l.stateNode)){var c=o[zt]||null;e:switch(o=l.stateNode,l.type){case"input":if(dl(o,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),l=c.name,c.type==="radio"&&l!=null){for(c=o;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+lr(""+l)+'"][type="radio"]'),l=0;l<c.length;l++){var h=c[l];if(h!==o&&h.form===o.form){var y=h[zt]||null;if(!y)throw Error(r(90));dl(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(l=0;l<c.length;l++)h=c[l],h.form===o.form&&Fo(h)}break e;case"textarea":hl(o,c.value,c.defaultValue);break e;case"select":l=c.value,l!=null&&ui(o,!!c.multiple,l,!1)}}}var bl=!1;function xl(o,l,c){if(bl)return o(l,c);bl=!0;try{var h=o(l);return h}finally{if(bl=!1,(bo!==null||xo!==null)&&(zh(),bo&&(l=bo,o=xo,xo=bo=null,Ts(l),o)))for(l=0;l<o.length;l++)Ts(o[l])}}function Oe(o,l){var c=o.stateNode;if(c===null)return null;var h=c[zt]||null;if(h===null)return null;c=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(o=o.type,h=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!h;break e;default:o=!1}if(o)return null;if(c&&typeof c!="function")throw Error(r(231,l,typeof c));return c}var ze=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$t=!1;if(ze)try{var Bt={};Object.defineProperty(Bt,"passive",{get:function(){$t=!0}}),window.addEventListener("test",Bt,Bt),window.removeEventListener("test",Bt,Bt)}catch{$t=!1}var en=null,Jn=null,dn=null;function Tr(){if(dn)return dn;var o,l=Jn,c=l.length,h,y="value"in en?en.value:en.textContent,x=y.length;for(o=0;o<c&&l[o]===y[o];o++);var I=c-o;for(h=1;h<=I&&l[c-h]===y[x-h];h++);return dn=y.slice(o,1<h?1-h:void 0)}function Vr(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function wi(){return!0}function Sl(){return!1}function Fr(o){function l(c,h,y,x,I){this._reactName=c,this._targetInst=y,this.type=h,this.nativeEvent=x,this.target=I,this.currentTarget=null;for(var B in o)o.hasOwnProperty(B)&&(c=o[B],this[B]=c?c(x):x[B]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?wi:Sl,this.isPropagationStopped=Sl,this}return p(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=wi)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=wi)},persist:function(){},isPersistent:wi}),l}var qo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xu=Fr(qo),Hc=p({},qo,{view:0,detail:0}),xB=Fr(Hc),sy,ly,jc,Zd=p({},Hc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uy,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==jc&&(jc&&o.type==="mousemove"?(sy=o.screenX-jc.screenX,ly=o.screenY-jc.screenY):ly=sy=0,jc=o),sy)},movementY:function(o){return"movementY"in o?o.movementY:ly}}),z1=Fr(Zd),SB=p({},Zd,{dataTransfer:0}),wB=Fr(SB),CB=p({},Hc,{relatedTarget:0}),ay=Fr(CB),RB=p({},qo,{animationName:0,elapsedTime:0,pseudoElement:0}),EB=Fr(RB),TB=p({},qo,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),AB=Fr(TB),MB=p({},qo,{data:0}),N1=Fr(MB),OB={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kB={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"},IB={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function DB(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=IB[o])?!!l[o]:!1}function uy(){return DB}var PB=p({},Hc,{key:function(o){if(o.key){var l=OB[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Vr(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?kB[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uy,charCode:function(o){return o.type==="keypress"?Vr(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Vr(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),zB=Fr(PB),NB=p({},Zd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),L1=Fr(NB),LB=p({},Hc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uy}),BB=Fr(LB),_B=p({},qo,{propertyName:0,elapsedTime:0,pseudoElement:0}),HB=Fr(_B),jB=p({},Zd,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),VB=Fr(jB),FB=p({},qo,{newState:0,oldState:0}),UB=Fr(FB),$B=[9,13,27,32],cy=ze&&"CompositionEvent"in window,Vc=null;ze&&"documentMode"in document&&(Vc=document.documentMode);var qB=ze&&"TextEvent"in window&&!Vc,B1=ze&&(!cy||Vc&&8<Vc&&11>=Vc),_1=" ",H1=!1;function j1(o,l){switch(o){case"keyup":return $B.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function V1(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Su=!1;function GB(o,l){switch(o){case"compositionend":return V1(l);case"keypress":return l.which!==32?null:(H1=!0,_1);case"textInput":return o=l.data,o===_1&&H1?null:o;default:return null}}function WB(o,l){if(Su)return o==="compositionend"||!cy&&j1(o,l)?(o=Tr(),dn=Jn=en=null,Su=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return B1&&l.locale!=="ko"?null:l.data;default:return null}}var KB={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 F1(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!KB[o.type]:l==="textarea"}function U1(o,l,c,h){bo?xo?xo.push(h):xo=[h]:bo=h,l=Vh(l,"onChange"),0<l.length&&(c=new xu("onChange","change",null,c,h),o.push({event:c,listeners:l}))}var Fc=null,Uc=null;function YB(o){EE(o,0)}function Jd(o){var l=li(o);if(Fo(l))return o}function $1(o,l){if(o==="change")return l}var q1=!1;if(ze){var fy;if(ze){var dy="oninput"in document;if(!dy){var G1=document.createElement("div");G1.setAttribute("oninput","return;"),dy=typeof G1.oninput=="function"}fy=dy}else fy=!1;q1=fy&&(!document.documentMode||9<document.documentMode)}function W1(){Fc&&(Fc.detachEvent("onpropertychange",K1),Uc=Fc=null)}function K1(o){if(o.propertyName==="value"&&Jd(Uc)){var l=[];U1(l,Uc,o,vl(o)),xl(YB,l)}}function XB(o,l,c){o==="focusin"?(W1(),Fc=l,Uc=c,Fc.attachEvent("onpropertychange",K1)):o==="focusout"&&W1()}function QB(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Jd(Uc)}function ZB(o,l){if(o==="click")return Jd(l)}function JB(o,l){if(o==="input"||o==="change")return Jd(l)}function e_(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Ci=typeof Object.is=="function"?Object.is:e_;function $c(o,l){if(Ci(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var c=Object.keys(o),h=Object.keys(l);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var y=c[h];if(!ke.call(l,y)||!Ci(o[y],l[y]))return!1}return!0}function Y1(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function X1(o,l){var c=Y1(o);o=0;for(var h;c;){if(c.nodeType===3){if(h=o+c.textContent.length,o<=l&&h>=l)return{node:c,offset:l-o};o=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Y1(c)}}function Q1(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?Q1(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function Z1(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=Cs(o.document);l instanceof o.HTMLIFrameElement;){try{var c=typeof l.contentWindow.location.href=="string"}catch{c=!1}if(c)o=l.contentWindow;else break;l=Cs(o.document)}return l}function hy(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}var t_=ze&&"documentMode"in document&&11>=document.documentMode,wu=null,gy=null,qc=null,py=!1;function J1(o,l,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;py||wu==null||wu!==Cs(h)||(h=wu,"selectionStart"in h&&hy(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),qc&&$c(qc,h)||(qc=h,h=Vh(gy,"onSelect"),0<h.length&&(l=new xu("onSelect","select",null,l,c),o.push({event:l,listeners:h}),l.target=wu)))}function Ta(o,l){var c={};return c[o.toLowerCase()]=l.toLowerCase(),c["Webkit"+o]="webkit"+l,c["Moz"+o]="moz"+l,c}var Cu={animationend:Ta("Animation","AnimationEnd"),animationiteration:Ta("Animation","AnimationIteration"),animationstart:Ta("Animation","AnimationStart"),transitionrun:Ta("Transition","TransitionRun"),transitionstart:Ta("Transition","TransitionStart"),transitioncancel:Ta("Transition","TransitionCancel"),transitionend:Ta("Transition","TransitionEnd")},my={},eC={};ze&&(eC=document.createElement("div").style,"AnimationEvent"in window||(delete Cu.animationend.animation,delete Cu.animationiteration.animation,delete Cu.animationstart.animation),"TransitionEvent"in window||delete Cu.transitionend.transition);function Aa(o){if(my[o])return my[o];if(!Cu[o])return o;var l=Cu[o],c;for(c in l)if(l.hasOwnProperty(c)&&c in eC)return my[o]=l[c];return o}var tC=Aa("animationend"),nC=Aa("animationiteration"),rC=Aa("animationstart"),n_=Aa("transitionrun"),r_=Aa("transitionstart"),i_=Aa("transitioncancel"),iC=Aa("transitionend"),oC=new Map,yy="abort auxClick beforeToggle 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(" ");yy.push("scrollEnd");function So(o,l){oC.set(o,l),_i(l,[o])}var eh=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Vi=[],Ru=0,vy=0;function th(){for(var o=Ru,l=vy=Ru=0;l<o;){var c=Vi[l];Vi[l++]=null;var h=Vi[l];Vi[l++]=null;var y=Vi[l];Vi[l++]=null;var x=Vi[l];if(Vi[l++]=null,h!==null&&y!==null){var I=h.pending;I===null?y.next=y:(y.next=I.next,I.next=y),h.pending=y}x!==0&&sC(c,y,x)}}function nh(o,l,c,h){Vi[Ru++]=o,Vi[Ru++]=l,Vi[Ru++]=c,Vi[Ru++]=h,vy|=h,o.lanes|=h,o=o.alternate,o!==null&&(o.lanes|=h)}function by(o,l,c,h){return nh(o,l,c,h),rh(o)}function Ma(o,l){return nh(o,null,null,l),rh(o)}function sC(o,l,c){o.lanes|=c;var h=o.alternate;h!==null&&(h.lanes|=c);for(var y=!1,x=o.return;x!==null;)x.childLanes|=c,h=x.alternate,h!==null&&(h.childLanes|=c),x.tag===22&&(o=x.stateNode,o===null||o._visibility&1||(y=!0)),o=x,x=x.return;return o.tag===3?(x=o.stateNode,y&&l!==null&&(y=31-ut(c),o=x.hiddenUpdates,h=o[y],h===null?o[y]=[l]:h.push(l),l.lane=c|536870912),x):null}function rh(o){if(50<gf)throw gf=0,Mv=null,Error(r(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var Eu={};function o_(o,l,c,h){this.tag=o,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ri(o,l,c,h){return new o_(o,l,c,h)}function xy(o){return o=o.prototype,!(!o||!o.isReactComponent)}function As(o,l){var c=o.alternate;return c===null?(c=Ri(o.tag,l,o.key,o.mode),c.elementType=o.elementType,c.type=o.type,c.stateNode=o.stateNode,c.alternate=o,o.alternate=c):(c.pendingProps=l,c.type=o.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=o.flags&65011712,c.childLanes=o.childLanes,c.lanes=o.lanes,c.child=o.child,c.memoizedProps=o.memoizedProps,c.memoizedState=o.memoizedState,c.updateQueue=o.updateQueue,l=o.dependencies,c.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},c.sibling=o.sibling,c.index=o.index,c.ref=o.ref,c.refCleanup=o.refCleanup,c}function lC(o,l){o.flags&=65011714;var c=o.alternate;return c===null?(o.childLanes=0,o.lanes=l,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=c.childLanes,o.lanes=c.lanes,o.child=c.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=c.memoizedProps,o.memoizedState=c.memoizedState,o.updateQueue=c.updateQueue,o.type=c.type,l=c.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),o}function ih(o,l,c,h,y,x){var I=0;if(h=o,typeof o=="function")xy(o)&&(I=1);else if(typeof o=="string")I=cH(o,c,X.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case L:return o=Ri(31,c,l,y),o.elementType=L,o.lanes=x,o;case S:return Oa(c.children,y,x,l);case w:I=8,y|=24;break;case C:return o=Ri(12,c,l,y|2),o.elementType=C,o.lanes=x,o;case k:return o=Ri(13,c,l,y),o.elementType=k,o.lanes=x,o;case P:return o=Ri(19,c,l,y),o.elementType=P,o.lanes=x,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case T:I=10;break e;case R:I=9;break e;case A:I=11;break e;case M:I=14;break e;case D:I=16,h=null;break e}I=29,c=Error(r(130,o===null?"null":typeof o,"")),h=null}return l=Ri(I,c,l,y),l.elementType=o,l.type=h,l.lanes=x,l}function Oa(o,l,c,h){return o=Ri(7,o,h,l),o.lanes=c,o}function Sy(o,l,c){return o=Ri(6,o,null,l),o.lanes=c,o}function aC(o){var l=Ri(18,null,null,0);return l.stateNode=o,l}function wy(o,l,c){return l=Ri(4,o.children!==null?o.children:[],o.key,l),l.lanes=c,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var uC=new WeakMap;function Fi(o,l){if(typeof o=="object"&&o!==null){var c=uC.get(o);return c!==void 0?c:(l={value:o,source:l,stack:je(l)},uC.set(o,l),l)}return{value:o,source:l,stack:je(l)}}var Tu=[],Au=0,oh=null,Gc=0,Ui=[],$i=0,wl=null,Go=1,Wo="";function Ms(o,l){Tu[Au++]=Gc,Tu[Au++]=oh,oh=o,Gc=l}function cC(o,l,c){Ui[$i++]=Go,Ui[$i++]=Wo,Ui[$i++]=wl,wl=o;var h=Go;o=Wo;var y=32-ut(h)-1;h&=~(1<<y),c+=1;var x=32-ut(l)+y;if(30<x){var I=y-y%5;x=(h&(1<<I)-1).toString(32),h>>=I,y-=I,Go=1<<32-ut(l)+y|c<<y|h,Wo=x+o}else Go=1<<x|c<<y|h,Wo=o}function Cy(o){o.return!==null&&(Ms(o,1),cC(o,1,0))}function Ry(o){for(;o===oh;)oh=Tu[--Au],Tu[Au]=null,Gc=Tu[--Au],Tu[Au]=null;for(;o===wl;)wl=Ui[--$i],Ui[$i]=null,Wo=Ui[--$i],Ui[$i]=null,Go=Ui[--$i],Ui[$i]=null}function fC(o,l){Ui[$i++]=Go,Ui[$i++]=Wo,Ui[$i++]=wl,Go=l.id,Wo=l.overflow,wl=o}var Ar=null,On=null,jt=!1,Cl=null,qi=!1,Ey=Error(r(519));function Rl(o){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wc(Fi(l,o)),Ey}function dC(o){var l=o.stateNode,c=o.type,h=o.memoizedProps;switch(l[Pt]=o,l[zt]=h,c){case"dialog":Lt("cancel",l),Lt("close",l);break;case"iframe":case"object":case"embed":Lt("load",l);break;case"video":case"audio":for(c=0;c<mf.length;c++)Lt(mf[c],l);break;case"source":Lt("error",l);break;case"img":case"image":case"link":Lt("error",l),Lt("load",l);break;case"details":Lt("toggle",l);break;case"input":Lt("invalid",l),Ea(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":Lt("invalid",l);break;case"textarea":Lt("invalid",l),Uo(l,h.value,h.defaultValue,h.children)}c=h.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||l.textContent===""+c||h.suppressHydrationWarning===!0||OE(l.textContent,c)?(h.popover!=null&&(Lt("beforetoggle",l),Lt("toggle",l)),h.onScroll!=null&&Lt("scroll",l),h.onScrollEnd!=null&&Lt("scrollend",l),h.onClick!=null&&(l.onclick=jr),l=!0):l=!1,l||Rl(o,!0)}function hC(o){for(Ar=o.return;Ar;)switch(Ar.tag){case 5:case 31:case 13:qi=!1;return;case 27:case 3:qi=!0;return;default:Ar=Ar.return}}function Mu(o){if(o!==Ar)return!1;if(!jt)return hC(o),jt=!0,!1;var l=o.tag,c;if((c=l!==3&&l!==27)&&((c=l===5)&&(c=o.type,c=!(c!=="form"&&c!=="button")||Uv(o.type,o.memoizedProps)),c=!c),c&&On&&Rl(o),hC(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));On=_E(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));On=_E(o)}else l===27?(l=On,_l(o.type)?(o=Kv,Kv=null,On=o):On=l):On=Ar?Wi(o.stateNode.nextSibling):null;return!0}function ka(){On=Ar=null,jt=!1}function Ty(){var o=Cl;return o!==null&&(hi===null?hi=o:hi.push.apply(hi,o),Cl=null),o}function Wc(o){Cl===null?Cl=[o]:Cl.push(o)}var Ay=z(null),Ia=null,Os=null;function El(o,l,c){W(Ay,l._currentValue),l._currentValue=c}function ks(o){o._currentValue=Ay.current,U(Ay)}function My(o,l,c){for(;o!==null;){var h=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),o===c)break;o=o.return}}function Oy(o,l,c,h){var y=o.child;for(y!==null&&(y.return=o);y!==null;){var x=y.dependencies;if(x!==null){var I=y.child;x=x.firstContext;e:for(;x!==null;){var B=x;x=y;for(var K=0;K<l.length;K++)if(B.context===l[K]){x.lanes|=c,B=x.alternate,B!==null&&(B.lanes|=c),My(x.return,c,o),h||(I=null);break e}x=B.next}}else if(y.tag===18){if(I=y.return,I===null)throw Error(r(341));I.lanes|=c,x=I.alternate,x!==null&&(x.lanes|=c),My(I,c,o),I=null}else I=y.child;if(I!==null)I.return=y;else for(I=y;I!==null;){if(I===o){I=null;break}if(y=I.sibling,y!==null){y.return=I.return,I=y;break}I=I.return}y=I}}function Ou(o,l,c,h){o=null;for(var y=l,x=!1;y!==null;){if(!x){if((y.flags&524288)!==0)x=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var I=y.alternate;if(I===null)throw Error(r(387));if(I=I.memoizedProps,I!==null){var B=y.type;Ci(y.pendingProps.value,I.value)||(o!==null?o.push(B):o=[B])}}else if(y===ue.current){if(I=y.alternate,I===null)throw Error(r(387));I.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(o!==null?o.push(Sf):o=[Sf])}y=y.return}o!==null&&Oy(l,o,c,h),l.flags|=262144}function sh(o){for(o=o.firstContext;o!==null;){if(!Ci(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Da(o){Ia=o,Os=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Mr(o){return gC(Ia,o)}function lh(o,l){return Ia===null&&Da(o),gC(o,l)}function gC(o,l){var c=l._currentValue;if(l={context:l,memoizedValue:c,next:null},Os===null){if(o===null)throw Error(r(308));Os=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else Os=Os.next=l;return c}var s_=typeof AbortController<"u"?AbortController:function(){var o=[],l=this.signal={aborted:!1,addEventListener:function(c,h){o.push(h)}};this.abort=function(){l.aborted=!0,o.forEach(function(c){return c()})}},l_=t.unstable_scheduleCallback,a_=t.unstable_NormalPriority,ar={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ky(){return{controller:new s_,data:new Map,refCount:0}}function Kc(o){o.refCount--,o.refCount===0&&l_(a_,function(){o.controller.abort()})}var Yc=null,Iy=0,ku=0,Iu=null;function u_(o,l){if(Yc===null){var c=Yc=[];Iy=0,ku=zv(),Iu={status:"pending",value:void 0,then:function(h){c.push(h)}}}return Iy++,l.then(pC,pC),l}function pC(){if(--Iy===0&&Yc!==null){Iu!==null&&(Iu.status="fulfilled");var o=Yc;Yc=null,ku=0,Iu=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function c_(o,l){var c=[],h={status:"pending",value:null,reason:null,then:function(y){c.push(y)}};return o.then(function(){h.status="fulfilled",h.value=l;for(var y=0;y<c.length;y++)(0,c[y])(l)},function(y){for(h.status="rejected",h.reason=y,y=0;y<c.length;y++)(0,c[y])(void 0)}),h}var mC=j.S;j.S=function(o,l){JR=ne(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&u_(o,l),mC!==null&&mC(o,l)};var Pa=z(null);function Dy(){var o=Pa.current;return o!==null?o:Sn.pooledCache}function ah(o,l){l===null?W(Pa,Pa.current):W(Pa,l.pool)}function yC(){var o=Dy();return o===null?null:{parent:ar._currentValue,pool:o}}var Du=Error(r(460)),Py=Error(r(474)),uh=Error(r(542)),ch={then:function(){}};function vC(o){return o=o.status,o==="fulfilled"||o==="rejected"}function bC(o,l,c){switch(c=o[c],c===void 0?o.push(l):c!==l&&(l.then(jr,jr),l=c),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,SC(o),o;default:if(typeof l.status=="string")l.then(jr,jr);else{if(o=Sn,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=l,o.status="pending",o.then(function(h){if(l.status==="pending"){var y=l;y.status="fulfilled",y.value=h}},function(h){if(l.status==="pending"){var y=l;y.status="rejected",y.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,SC(o),o}throw Na=l,Du}}function za(o){try{var l=o._init;return l(o._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Na=c,Du):c}}var Na=null;function xC(){if(Na===null)throw Error(r(459));var o=Na;return Na=null,o}function SC(o){if(o===Du||o===uh)throw Error(r(483))}var Pu=null,Xc=0;function fh(o){var l=Xc;return Xc+=1,Pu===null&&(Pu=[]),bC(Pu,o,l)}function Qc(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function dh(o,l){throw l.$$typeof===m?Error(r(525)):(o=Object.prototype.toString.call(l),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function wC(o){function l(re,Z){if(o){var oe=re.deletions;oe===null?(re.deletions=[Z],re.flags|=16):oe.push(Z)}}function c(re,Z){if(!o)return null;for(;Z!==null;)l(re,Z),Z=Z.sibling;return null}function h(re){for(var Z=new Map;re!==null;)re.key!==null?Z.set(re.key,re):Z.set(re.index,re),re=re.sibling;return Z}function y(re,Z){return re=As(re,Z),re.index=0,re.sibling=null,re}function x(re,Z,oe){return re.index=oe,o?(oe=re.alternate,oe!==null?(oe=oe.index,oe<Z?(re.flags|=67108866,Z):oe):(re.flags|=67108866,Z)):(re.flags|=1048576,Z)}function I(re){return o&&re.alternate===null&&(re.flags|=67108866),re}function B(re,Z,oe,ye){return Z===null||Z.tag!==6?(Z=Sy(oe,re.mode,ye),Z.return=re,Z):(Z=y(Z,oe),Z.return=re,Z)}function K(re,Z,oe,ye){var st=oe.type;return st===S?he(re,Z,oe.props.children,ye,oe.key):Z!==null&&(Z.elementType===st||typeof st=="object"&&st!==null&&st.$$typeof===D&&za(st)===Z.type)?(Z=y(Z,oe.props),Qc(Z,oe),Z.return=re,Z):(Z=ih(oe.type,oe.key,oe.props,null,re.mode,ye),Qc(Z,oe),Z.return=re,Z)}function se(re,Z,oe,ye){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==oe.containerInfo||Z.stateNode.implementation!==oe.implementation?(Z=wy(oe,re.mode,ye),Z.return=re,Z):(Z=y(Z,oe.children||[]),Z.return=re,Z)}function he(re,Z,oe,ye,st){return Z===null||Z.tag!==7?(Z=Oa(oe,re.mode,ye,st),Z.return=re,Z):(Z=y(Z,oe),Z.return=re,Z)}function be(re,Z,oe){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Sy(""+Z,re.mode,oe),Z.return=re,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:return oe=ih(Z.type,Z.key,Z.props,null,re.mode,oe),Qc(oe,Z),oe.return=re,oe;case b:return Z=wy(Z,re.mode,oe),Z.return=re,Z;case D:return Z=za(Z),be(re,Z,oe)}if(G(Z)||_(Z))return Z=Oa(Z,re.mode,oe,null),Z.return=re,Z;if(typeof Z.then=="function")return be(re,fh(Z),oe);if(Z.$$typeof===T)return be(re,lh(re,Z),oe);dh(re,Z)}return null}function ae(re,Z,oe,ye){var st=Z!==null?Z.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return st!==null?null:B(re,Z,""+oe,ye);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:return oe.key===st?K(re,Z,oe,ye):null;case b:return oe.key===st?se(re,Z,oe,ye):null;case D:return oe=za(oe),ae(re,Z,oe,ye)}if(G(oe)||_(oe))return st!==null?null:he(re,Z,oe,ye,null);if(typeof oe.then=="function")return ae(re,Z,fh(oe),ye);if(oe.$$typeof===T)return ae(re,Z,lh(re,oe),ye);dh(re,oe)}return null}function ce(re,Z,oe,ye,st){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return re=re.get(oe)||null,B(Z,re,""+ye,st);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case v:return re=re.get(ye.key===null?oe:ye.key)||null,K(Z,re,ye,st);case b:return re=re.get(ye.key===null?oe:ye.key)||null,se(Z,re,ye,st);case D:return ye=za(ye),ce(re,Z,oe,ye,st)}if(G(ye)||_(ye))return re=re.get(oe)||null,he(Z,re,ye,st,null);if(typeof ye.then=="function")return ce(re,Z,oe,fh(ye),st);if(ye.$$typeof===T)return ce(re,Z,oe,lh(Z,ye),st);dh(Z,ye)}return null}function qe(re,Z,oe,ye){for(var st=null,Kt=null,Ze=Z,Ct=Z=0,Ht=null;Ze!==null&&Ct<oe.length;Ct++){Ze.index>Ct?(Ht=Ze,Ze=null):Ht=Ze.sibling;var Yt=ae(re,Ze,oe[Ct],ye);if(Yt===null){Ze===null&&(Ze=Ht);break}o&&Ze&&Yt.alternate===null&&l(re,Ze),Z=x(Yt,Z,Ct),Kt===null?st=Yt:Kt.sibling=Yt,Kt=Yt,Ze=Ht}if(Ct===oe.length)return c(re,Ze),jt&&Ms(re,Ct),st;if(Ze===null){for(;Ct<oe.length;Ct++)Ze=be(re,oe[Ct],ye),Ze!==null&&(Z=x(Ze,Z,Ct),Kt===null?st=Ze:Kt.sibling=Ze,Kt=Ze);return jt&&Ms(re,Ct),st}for(Ze=h(Ze);Ct<oe.length;Ct++)Ht=ce(Ze,re,Ct,oe[Ct],ye),Ht!==null&&(o&&Ht.alternate!==null&&Ze.delete(Ht.key===null?Ct:Ht.key),Z=x(Ht,Z,Ct),Kt===null?st=Ht:Kt.sibling=Ht,Kt=Ht);return o&&Ze.forEach(function(Ul){return l(re,Ul)}),jt&&Ms(re,Ct),st}function at(re,Z,oe,ye){if(oe==null)throw Error(r(151));for(var st=null,Kt=null,Ze=Z,Ct=Z=0,Ht=null,Yt=oe.next();Ze!==null&&!Yt.done;Ct++,Yt=oe.next()){Ze.index>Ct?(Ht=Ze,Ze=null):Ht=Ze.sibling;var Ul=ae(re,Ze,Yt.value,ye);if(Ul===null){Ze===null&&(Ze=Ht);break}o&&Ze&&Ul.alternate===null&&l(re,Ze),Z=x(Ul,Z,Ct),Kt===null?st=Ul:Kt.sibling=Ul,Kt=Ul,Ze=Ht}if(Yt.done)return c(re,Ze),jt&&Ms(re,Ct),st;if(Ze===null){for(;!Yt.done;Ct++,Yt=oe.next())Yt=be(re,Yt.value,ye),Yt!==null&&(Z=x(Yt,Z,Ct),Kt===null?st=Yt:Kt.sibling=Yt,Kt=Yt);return jt&&Ms(re,Ct),st}for(Ze=h(Ze);!Yt.done;Ct++,Yt=oe.next())Yt=ce(Ze,re,Ct,Yt.value,ye),Yt!==null&&(o&&Yt.alternate!==null&&Ze.delete(Yt.key===null?Ct:Yt.key),Z=x(Yt,Z,Ct),Kt===null?st=Yt:Kt.sibling=Yt,Kt=Yt);return o&&Ze.forEach(function(SH){return l(re,SH)}),jt&&Ms(re,Ct),st}function pn(re,Z,oe,ye){if(typeof oe=="object"&&oe!==null&&oe.type===S&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:e:{for(var st=oe.key;Z!==null;){if(Z.key===st){if(st=oe.type,st===S){if(Z.tag===7){c(re,Z.sibling),ye=y(Z,oe.props.children),ye.return=re,re=ye;break e}}else if(Z.elementType===st||typeof st=="object"&&st!==null&&st.$$typeof===D&&za(st)===Z.type){c(re,Z.sibling),ye=y(Z,oe.props),Qc(ye,oe),ye.return=re,re=ye;break e}c(re,Z);break}else l(re,Z);Z=Z.sibling}oe.type===S?(ye=Oa(oe.props.children,re.mode,ye,oe.key),ye.return=re,re=ye):(ye=ih(oe.type,oe.key,oe.props,null,re.mode,ye),Qc(ye,oe),ye.return=re,re=ye)}return I(re);case b:e:{for(st=oe.key;Z!==null;){if(Z.key===st)if(Z.tag===4&&Z.stateNode.containerInfo===oe.containerInfo&&Z.stateNode.implementation===oe.implementation){c(re,Z.sibling),ye=y(Z,oe.children||[]),ye.return=re,re=ye;break e}else{c(re,Z);break}else l(re,Z);Z=Z.sibling}ye=wy(oe,re.mode,ye),ye.return=re,re=ye}return I(re);case D:return oe=za(oe),pn(re,Z,oe,ye)}if(G(oe))return qe(re,Z,oe,ye);if(_(oe)){if(st=_(oe),typeof st!="function")throw Error(r(150));return oe=st.call(oe),at(re,Z,oe,ye)}if(typeof oe.then=="function")return pn(re,Z,fh(oe),ye);if(oe.$$typeof===T)return pn(re,Z,lh(re,oe),ye);dh(re,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,Z!==null&&Z.tag===6?(c(re,Z.sibling),ye=y(Z,oe),ye.return=re,re=ye):(c(re,Z),ye=Sy(oe,re.mode,ye),ye.return=re,re=ye),I(re)):c(re,Z)}return function(re,Z,oe,ye){try{Xc=0;var st=pn(re,Z,oe,ye);return Pu=null,st}catch(Ze){if(Ze===Du||Ze===uh)throw Ze;var Kt=Ri(29,Ze,null,re.mode);return Kt.lanes=ye,Kt.return=re,Kt}}}var La=wC(!0),CC=wC(!1),Tl=!1;function zy(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ny(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Al(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Ml(o,l,c){var h=o.updateQueue;if(h===null)return null;if(h=h.shared,(tn&2)!==0){var y=h.pending;return y===null?l.next=l:(l.next=y.next,y.next=l),h.pending=l,l=rh(o),sC(o,null,c),l}return nh(o,h,l,c),rh(o)}function Zc(o,l,c){if(l=l.updateQueue,l!==null&&(l=l.shared,(c&4194048)!==0)){var h=l.lanes;h&=o.pendingLanes,c|=h,l.lanes=c,or(o,c)}}function Ly(o,l){var c=o.updateQueue,h=o.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var y=null,x=null;if(c=c.firstBaseUpdate,c!==null){do{var I={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};x===null?y=x=I:x=x.next=I,c=c.next}while(c!==null);x===null?y=x=l:x=x.next=l}else y=x=l;c={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:x,shared:h.shared,callbacks:h.callbacks},o.updateQueue=c;return}o=c.lastBaseUpdate,o===null?c.firstBaseUpdate=l:o.next=l,c.lastBaseUpdate=l}var By=!1;function Jc(){if(By){var o=Iu;if(o!==null)throw o}}function ef(o,l,c,h){By=!1;var y=o.updateQueue;Tl=!1;var x=y.firstBaseUpdate,I=y.lastBaseUpdate,B=y.shared.pending;if(B!==null){y.shared.pending=null;var K=B,se=K.next;K.next=null,I===null?x=se:I.next=se,I=K;var he=o.alternate;he!==null&&(he=he.updateQueue,B=he.lastBaseUpdate,B!==I&&(B===null?he.firstBaseUpdate=se:B.next=se,he.lastBaseUpdate=K))}if(x!==null){var be=y.baseState;I=0,he=se=K=null,B=x;do{var ae=B.lane&-536870913,ce=ae!==B.lane;if(ce?(_t&ae)===ae:(h&ae)===ae){ae!==0&&ae===ku&&(By=!0),he!==null&&(he=he.next={lane:0,tag:B.tag,payload:B.payload,callback:null,next:null});e:{var qe=o,at=B;ae=l;var pn=c;switch(at.tag){case 1:if(qe=at.payload,typeof qe=="function"){be=qe.call(pn,be,ae);break e}be=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=at.payload,ae=typeof qe=="function"?qe.call(pn,be,ae):qe,ae==null)break e;be=p({},be,ae);break e;case 2:Tl=!0}}ae=B.callback,ae!==null&&(o.flags|=64,ce&&(o.flags|=8192),ce=y.callbacks,ce===null?y.callbacks=[ae]:ce.push(ae))}else ce={lane:ae,tag:B.tag,payload:B.payload,callback:B.callback,next:null},he===null?(se=he=ce,K=be):he=he.next=ce,I|=ae;if(B=B.next,B===null){if(B=y.shared.pending,B===null)break;ce=B,B=ce.next,ce.next=null,y.lastBaseUpdate=ce,y.shared.pending=null}}while(!0);he===null&&(K=be),y.baseState=K,y.firstBaseUpdate=se,y.lastBaseUpdate=he,x===null&&(y.shared.lanes=0),Pl|=I,o.lanes=I,o.memoizedState=be}}function RC(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function EC(o,l){var c=o.callbacks;if(c!==null)for(o.callbacks=null,o=0;o<c.length;o++)RC(c[o],l)}var zu=z(null),hh=z(0);function TC(o,l){o=Hs,W(hh,o),W(zu,l),Hs=o|l.baseLanes}function _y(){W(hh,Hs),W(zu,zu.current)}function Hy(){Hs=hh.current,U(zu),U(hh)}var Ei=z(null),Gi=null;function Ol(o){var l=o.alternate;W(er,er.current&1),W(Ei,o),Gi===null&&(l===null||zu.current!==null||l.memoizedState!==null)&&(Gi=o)}function jy(o){W(er,er.current),W(Ei,o),Gi===null&&(Gi=o)}function AC(o){o.tag===22?(W(er,er.current),W(Ei,o),Gi===null&&(Gi=o)):kl()}function kl(){W(er,er.current),W(Ei,Ei.current)}function Ti(o){U(Ei),Gi===o&&(Gi=null),U(er)}var er=z(0);function gh(o){for(var l=o;l!==null;){if(l.tag===13){var c=l.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Gv(c)||Wv(c)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Is=0,xt=null,hn=null,ur=null,ph=!1,Nu=!1,Ba=!1,mh=0,tf=0,Lu=null,f_=0;function Gn(){throw Error(r(321))}function Vy(o,l){if(l===null)return!1;for(var c=0;c<l.length&&c<o.length;c++)if(!Ci(o[c],l[c]))return!1;return!0}function Fy(o,l,c,h,y,x){return Is=x,xt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,j.H=o===null||o.memoizedState===null?cR:rv,Ba=!1,x=c(h,y),Ba=!1,Nu&&(x=OC(l,c,h,y)),MC(o),x}function MC(o){j.H=of;var l=hn!==null&&hn.next!==null;if(Is=0,ur=hn=xt=null,ph=!1,tf=0,Lu=null,l)throw Error(r(300));o===null||cr||(o=o.dependencies,o!==null&&sh(o)&&(cr=!0))}function OC(o,l,c,h){xt=o;var y=0;do{if(Nu&&(Lu=null),tf=0,Nu=!1,25<=y)throw Error(r(301));if(y+=1,ur=hn=null,o.updateQueue!=null){var x=o.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}j.H=fR,x=l(c,h)}while(Nu);return x}function d_(){var o=j.H,l=o.useState()[0];return l=typeof l.then=="function"?nf(l):l,o=o.useState()[0],(hn!==null?hn.memoizedState:null)!==o&&(xt.flags|=1024),l}function Uy(){var o=mh!==0;return mh=0,o}function $y(o,l,c){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~c}function qy(o){if(ph){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}ph=!1}Is=0,ur=hn=xt=null,Nu=!1,tf=mh=0,Lu=null}function ei(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ur===null?xt.memoizedState=ur=o:ur=ur.next=o,ur}function tr(){if(hn===null){var o=xt.alternate;o=o!==null?o.memoizedState:null}else o=hn.next;var l=ur===null?xt.memoizedState:ur.next;if(l!==null)ur=l,hn=o;else{if(o===null)throw xt.alternate===null?Error(r(467)):Error(r(310));hn=o,o={memoizedState:hn.memoizedState,baseState:hn.baseState,baseQueue:hn.baseQueue,queue:hn.queue,next:null},ur===null?xt.memoizedState=ur=o:ur=ur.next=o}return ur}function yh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function nf(o){var l=tf;return tf+=1,Lu===null&&(Lu=[]),o=bC(Lu,o,l),l=xt,(ur===null?l.memoizedState:ur.next)===null&&(l=l.alternate,j.H=l===null||l.memoizedState===null?cR:rv),o}function vh(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return nf(o);if(o.$$typeof===T)return Mr(o)}throw Error(r(438,String(o)))}function Gy(o){var l=null,c=xt.updateQueue;if(c!==null&&(l=c.memoCache),l==null){var h=xt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(y){return y.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),c===null&&(c=yh(),xt.updateQueue=c),c.memoCache=l,c=l.data[l.index],c===void 0)for(c=l.data[l.index]=Array(o),h=0;h<o;h++)c[h]=H;return l.index++,c}function Ds(o,l){return typeof l=="function"?l(o):l}function bh(o){var l=tr();return Wy(l,hn,o)}function Wy(o,l,c){var h=o.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=c;var y=o.baseQueue,x=h.pending;if(x!==null){if(y!==null){var I=y.next;y.next=x.next,x.next=I}l.baseQueue=y=x,h.pending=null}if(x=o.baseState,y===null)o.memoizedState=x;else{l=y.next;var B=I=null,K=null,se=l,he=!1;do{var be=se.lane&-536870913;if(be!==se.lane?(_t&be)===be:(Is&be)===be){var ae=se.revertLane;if(ae===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),be===ku&&(he=!0);else if((Is&ae)===ae){se=se.next,ae===ku&&(he=!0);continue}else be={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},K===null?(B=K=be,I=x):K=K.next=be,xt.lanes|=ae,Pl|=ae;be=se.action,Ba&&c(x,be),x=se.hasEagerState?se.eagerState:c(x,be)}else ae={lane:be,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},K===null?(B=K=ae,I=x):K=K.next=ae,xt.lanes|=be,Pl|=be;se=se.next}while(se!==null&&se!==l);if(K===null?I=x:K.next=B,!Ci(x,o.memoizedState)&&(cr=!0,he&&(c=Iu,c!==null)))throw c;o.memoizedState=x,o.baseState=I,o.baseQueue=K,h.lastRenderedState=x}return y===null&&(h.lanes=0),[o.memoizedState,h.dispatch]}function Ky(o){var l=tr(),c=l.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=o;var h=c.dispatch,y=c.pending,x=l.memoizedState;if(y!==null){c.pending=null;var I=y=y.next;do x=o(x,I.action),I=I.next;while(I!==y);Ci(x,l.memoizedState)||(cr=!0),l.memoizedState=x,l.baseQueue===null&&(l.baseState=x),c.lastRenderedState=x}return[x,h]}function kC(o,l,c){var h=xt,y=tr(),x=jt;if(x){if(c===void 0)throw Error(r(407));c=c()}else c=l();var I=!Ci((hn||y).memoizedState,c);if(I&&(y.memoizedState=c,cr=!0),y=y.queue,Qy(PC.bind(null,h,y,o),[o]),y.getSnapshot!==l||I||ur!==null&&ur.memoizedState.tag&1){if(h.flags|=2048,Bu(9,{destroy:void 0},DC.bind(null,h,y,c,l),null),Sn===null)throw Error(r(349));x||(Is&127)!==0||IC(h,l,c)}return c}function IC(o,l,c){o.flags|=16384,o={getSnapshot:l,value:c},l=xt.updateQueue,l===null?(l=yh(),xt.updateQueue=l,l.stores=[o]):(c=l.stores,c===null?l.stores=[o]:c.push(o))}function DC(o,l,c,h){l.value=c,l.getSnapshot=h,zC(l)&&NC(o)}function PC(o,l,c){return c(function(){zC(l)&&NC(o)})}function zC(o){var l=o.getSnapshot;o=o.value;try{var c=l();return!Ci(o,c)}catch{return!0}}function NC(o){var l=Ma(o,2);l!==null&&gi(l,o,2)}function Yy(o){var l=ei();if(typeof o=="function"){var c=o;if(o=c(),Ba){bn(!0);try{c()}finally{bn(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:o},l}function LC(o,l,c,h){return o.baseState=c,Wy(o,hn,typeof h=="function"?h:Ds)}function h_(o,l,c,h,y){if(wh(o))throw Error(r(485));if(o=l.action,o!==null){var x={payload:y,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){x.listeners.push(I)}};j.T!==null?c(!0):x.isTransition=!1,h(x),c=l.pending,c===null?(x.next=l.pending=x,BC(l,x)):(x.next=c.next,l.pending=c.next=x)}}function BC(o,l){var c=l.action,h=l.payload,y=o.state;if(l.isTransition){var x=j.T,I={};j.T=I;try{var B=c(y,h),K=j.S;K!==null&&K(I,B),_C(o,l,B)}catch(se){Xy(o,l,se)}finally{x!==null&&I.types!==null&&(x.types=I.types),j.T=x}}else try{x=c(y,h),_C(o,l,x)}catch(se){Xy(o,l,se)}}function _C(o,l,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(h){HC(o,l,h)},function(h){return Xy(o,l,h)}):HC(o,l,c)}function HC(o,l,c){l.status="fulfilled",l.value=c,jC(l),o.state=c,l=o.pending,l!==null&&(c=l.next,c===l?o.pending=null:(c=c.next,l.next=c,BC(o,c)))}function Xy(o,l,c){var h=o.pending;if(o.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=c,jC(l),l=l.next;while(l!==h)}o.action=null}function jC(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function VC(o,l){return l}function FC(o,l){if(jt){var c=Sn.formState;if(c!==null){e:{var h=xt;if(jt){if(On){t:{for(var y=On,x=qi;y.nodeType!==8;){if(!x){y=null;break t}if(y=Wi(y.nextSibling),y===null){y=null;break t}}x=y.data,y=x==="F!"||x==="F"?y:null}if(y){On=Wi(y.nextSibling),h=y.data==="F!";break e}}Rl(h)}h=!1}h&&(l=c[0])}}return c=ei(),c.memoizedState=c.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:VC,lastRenderedState:l},c.queue=h,c=lR.bind(null,xt,h),h.dispatch=c,h=Yy(!1),x=nv.bind(null,xt,!1,h.queue),h=ei(),y={state:l,dispatch:null,action:o,pending:null},h.queue=y,c=h_.bind(null,xt,y,x,c),y.dispatch=c,h.memoizedState=o,[l,c,!1]}function UC(o){var l=tr();return $C(l,hn,o)}function $C(o,l,c){if(l=Wy(o,l,VC)[0],o=bh(Ds)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=nf(l)}catch(I){throw I===Du?uh:I}else h=l;l=tr();var y=l.queue,x=y.dispatch;return c!==l.memoizedState&&(xt.flags|=2048,Bu(9,{destroy:void 0},g_.bind(null,y,c),null)),[h,x,o]}function g_(o,l){o.action=l}function qC(o){var l=tr(),c=hn;if(c!==null)return $C(l,c,o);tr(),l=l.memoizedState,c=tr();var h=c.queue.dispatch;return c.memoizedState=o,[l,h,!1]}function Bu(o,l,c,h){return o={tag:o,create:c,deps:h,inst:l,next:null},l=xt.updateQueue,l===null&&(l=yh(),xt.updateQueue=l),c=l.lastEffect,c===null?l.lastEffect=o.next=o:(h=c.next,c.next=o,o.next=h,l.lastEffect=o),o}function GC(){return tr().memoizedState}function xh(o,l,c,h){var y=ei();xt.flags|=o,y.memoizedState=Bu(1|l,{destroy:void 0},c,h===void 0?null:h)}function Sh(o,l,c,h){var y=tr();h=h===void 0?null:h;var x=y.memoizedState.inst;hn!==null&&h!==null&&Vy(h,hn.memoizedState.deps)?y.memoizedState=Bu(l,x,c,h):(xt.flags|=o,y.memoizedState=Bu(1|l,x,c,h))}function WC(o,l){xh(8390656,8,o,l)}function Qy(o,l){Sh(2048,8,o,l)}function p_(o){xt.flags|=4;var l=xt.updateQueue;if(l===null)l=yh(),xt.updateQueue=l,l.events=[o];else{var c=l.events;c===null?l.events=[o]:c.push(o)}}function KC(o){var l=tr().memoizedState;return p_({ref:l,nextImpl:o}),function(){if((tn&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function YC(o,l){return Sh(4,2,o,l)}function XC(o,l){return Sh(4,4,o,l)}function QC(o,l){if(typeof l=="function"){o=o();var c=l(o);return function(){typeof c=="function"?c():l(null)}}if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function ZC(o,l,c){c=c!=null?c.concat([o]):null,Sh(4,4,QC.bind(null,l,o),c)}function Zy(){}function JC(o,l){var c=tr();l=l===void 0?null:l;var h=c.memoizedState;return l!==null&&Vy(l,h[1])?h[0]:(c.memoizedState=[o,l],o)}function eR(o,l){var c=tr();l=l===void 0?null:l;var h=c.memoizedState;if(l!==null&&Vy(l,h[1]))return h[0];if(h=o(),Ba){bn(!0);try{o()}finally{bn(!1)}}return c.memoizedState=[h,l],h}function Jy(o,l,c){return c===void 0||(Is&1073741824)!==0&&(_t&261930)===0?o.memoizedState=l:(o.memoizedState=c,o=tE(),xt.lanes|=o,Pl|=o,c)}function tR(o,l,c,h){return Ci(c,l)?c:zu.current!==null?(o=Jy(o,c,h),Ci(o,l)||(cr=!0),o):(Is&42)===0||(Is&1073741824)!==0&&(_t&261930)===0?(cr=!0,o.memoizedState=c):(o=tE(),xt.lanes|=o,Pl|=o,l)}function nR(o,l,c,h,y){var x=q.p;q.p=x!==0&&8>x?x:8;var I=j.T,B={};j.T=B,nv(o,!1,l,c);try{var K=y(),se=j.S;if(se!==null&&se(B,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var he=c_(K,h);rf(o,l,he,Oi(o))}else rf(o,l,h,Oi(o))}catch(be){rf(o,l,{then:function(){},status:"rejected",reason:be},Oi())}finally{q.p=x,I!==null&&B.types!==null&&(I.types=B.types),j.T=I}}function m_(){}function ev(o,l,c,h){if(o.tag!==5)throw Error(r(476));var y=rR(o).queue;nR(o,y,l,V,c===null?m_:function(){return iR(o),c(h)})}function rR(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:V},next:null};var c={};return l.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:c},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function iR(o){var l=rR(o);l.next===null&&(l=o.alternate.memoizedState),rf(o,l.next.queue,{},Oi())}function tv(){return Mr(Sf)}function oR(){return tr().memoizedState}function sR(){return tr().memoizedState}function y_(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var c=Oi();o=Al(c);var h=Ml(l,o,c);h!==null&&(gi(h,l,c),Zc(h,l,c)),l={cache:ky()},o.payload=l;return}l=l.return}}function v_(o,l,c){var h=Oi();c={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},wh(o)?aR(l,c):(c=by(o,l,c,h),c!==null&&(gi(c,o,h),uR(c,l,h)))}function lR(o,l,c){var h=Oi();rf(o,l,c,h)}function rf(o,l,c,h){var y={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(wh(o))aR(l,y);else{var x=o.alternate;if(o.lanes===0&&(x===null||x.lanes===0)&&(x=l.lastRenderedReducer,x!==null))try{var I=l.lastRenderedState,B=x(I,c);if(y.hasEagerState=!0,y.eagerState=B,Ci(B,I))return nh(o,l,y,0),Sn===null&&th(),!1}catch{}if(c=by(o,l,y,h),c!==null)return gi(c,o,h),uR(c,l,h),!0}return!1}function nv(o,l,c,h){if(h={lane:2,revertLane:zv(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},wh(o)){if(l)throw Error(r(479))}else l=by(o,c,h,2),l!==null&&gi(l,o,2)}function wh(o){var l=o.alternate;return o===xt||l!==null&&l===xt}function aR(o,l){Nu=ph=!0;var c=o.pending;c===null?l.next=l:(l.next=c.next,c.next=l),o.pending=l}function uR(o,l,c){if((c&4194048)!==0){var h=l.lanes;h&=o.pendingLanes,c|=h,l.lanes=c,or(o,c)}}var of={readContext:Mr,use:vh,useCallback:Gn,useContext:Gn,useEffect:Gn,useImperativeHandle:Gn,useLayoutEffect:Gn,useInsertionEffect:Gn,useMemo:Gn,useReducer:Gn,useRef:Gn,useState:Gn,useDebugValue:Gn,useDeferredValue:Gn,useTransition:Gn,useSyncExternalStore:Gn,useId:Gn,useHostTransitionStatus:Gn,useFormState:Gn,useActionState:Gn,useOptimistic:Gn,useMemoCache:Gn,useCacheRefresh:Gn};of.useEffectEvent=Gn;var cR={readContext:Mr,use:vh,useCallback:function(o,l){return ei().memoizedState=[o,l===void 0?null:l],o},useContext:Mr,useEffect:WC,useImperativeHandle:function(o,l,c){c=c!=null?c.concat([o]):null,xh(4194308,4,QC.bind(null,l,o),c)},useLayoutEffect:function(o,l){return xh(4194308,4,o,l)},useInsertionEffect:function(o,l){xh(4,2,o,l)},useMemo:function(o,l){var c=ei();l=l===void 0?null:l;var h=o();if(Ba){bn(!0);try{o()}finally{bn(!1)}}return c.memoizedState=[h,l],h},useReducer:function(o,l,c){var h=ei();if(c!==void 0){var y=c(l);if(Ba){bn(!0);try{c(l)}finally{bn(!1)}}}else y=l;return h.memoizedState=h.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},h.queue=o,o=o.dispatch=v_.bind(null,xt,o),[h.memoizedState,o]},useRef:function(o){var l=ei();return o={current:o},l.memoizedState=o},useState:function(o){o=Yy(o);var l=o.queue,c=lR.bind(null,xt,l);return l.dispatch=c,[o.memoizedState,c]},useDebugValue:Zy,useDeferredValue:function(o,l){var c=ei();return Jy(c,o,l)},useTransition:function(){var o=Yy(!1);return o=nR.bind(null,xt,o.queue,!0,!1),ei().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,c){var h=xt,y=ei();if(jt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=l(),Sn===null)throw Error(r(349));(_t&127)!==0||IC(h,l,c)}y.memoizedState=c;var x={value:c,getSnapshot:l};return y.queue=x,WC(PC.bind(null,h,x,o),[o]),h.flags|=2048,Bu(9,{destroy:void 0},DC.bind(null,h,x,c,l),null),c},useId:function(){var o=ei(),l=Sn.identifierPrefix;if(jt){var c=Wo,h=Go;c=(h&~(1<<32-ut(h)-1)).toString(32)+c,l="_"+l+"R_"+c,c=mh++,0<c&&(l+="H"+c.toString(32)),l+="_"}else c=f_++,l="_"+l+"r_"+c.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:tv,useFormState:FC,useActionState:FC,useOptimistic:function(o){var l=ei();l.memoizedState=l.baseState=o;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=c,l=nv.bind(null,xt,!0,c),c.dispatch=l,[o,l]},useMemoCache:Gy,useCacheRefresh:function(){return ei().memoizedState=y_.bind(null,xt)},useEffectEvent:function(o){var l=ei(),c={impl:o};return l.memoizedState=c,function(){if((tn&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},rv={readContext:Mr,use:vh,useCallback:JC,useContext:Mr,useEffect:Qy,useImperativeHandle:ZC,useInsertionEffect:YC,useLayoutEffect:XC,useMemo:eR,useReducer:bh,useRef:GC,useState:function(){return bh(Ds)},useDebugValue:Zy,useDeferredValue:function(o,l){var c=tr();return tR(c,hn.memoizedState,o,l)},useTransition:function(){var o=bh(Ds)[0],l=tr().memoizedState;return[typeof o=="boolean"?o:nf(o),l]},useSyncExternalStore:kC,useId:oR,useHostTransitionStatus:tv,useFormState:UC,useActionState:UC,useOptimistic:function(o,l){var c=tr();return LC(c,hn,o,l)},useMemoCache:Gy,useCacheRefresh:sR};rv.useEffectEvent=KC;var fR={readContext:Mr,use:vh,useCallback:JC,useContext:Mr,useEffect:Qy,useImperativeHandle:ZC,useInsertionEffect:YC,useLayoutEffect:XC,useMemo:eR,useReducer:Ky,useRef:GC,useState:function(){return Ky(Ds)},useDebugValue:Zy,useDeferredValue:function(o,l){var c=tr();return hn===null?Jy(c,o,l):tR(c,hn.memoizedState,o,l)},useTransition:function(){var o=Ky(Ds)[0],l=tr().memoizedState;return[typeof o=="boolean"?o:nf(o),l]},useSyncExternalStore:kC,useId:oR,useHostTransitionStatus:tv,useFormState:qC,useActionState:qC,useOptimistic:function(o,l){var c=tr();return hn!==null?LC(c,hn,o,l):(c.baseState=o,[o,c.queue.dispatch])},useMemoCache:Gy,useCacheRefresh:sR};fR.useEffectEvent=KC;function iv(o,l,c,h){l=o.memoizedState,c=c(h,l),c=c==null?l:p({},l,c),o.memoizedState=c,o.lanes===0&&(o.updateQueue.baseState=c)}var ov={enqueueSetState:function(o,l,c){o=o._reactInternals;var h=Oi(),y=Al(h);y.payload=l,c!=null&&(y.callback=c),l=Ml(o,y,h),l!==null&&(gi(l,o,h),Zc(l,o,h))},enqueueReplaceState:function(o,l,c){o=o._reactInternals;var h=Oi(),y=Al(h);y.tag=1,y.payload=l,c!=null&&(y.callback=c),l=Ml(o,y,h),l!==null&&(gi(l,o,h),Zc(l,o,h))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var c=Oi(),h=Al(c);h.tag=2,l!=null&&(h.callback=l),l=Ml(o,h,c),l!==null&&(gi(l,o,c),Zc(l,o,c))}};function dR(o,l,c,h,y,x,I){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(h,x,I):l.prototype&&l.prototype.isPureReactComponent?!$c(c,h)||!$c(y,x):!0}function hR(o,l,c,h){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(c,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(c,h),l.state!==o&&ov.enqueueReplaceState(l,l.state,null)}function _a(o,l){var c=l;if("ref"in l){c={};for(var h in l)h!=="ref"&&(c[h]=l[h])}if(o=o.defaultProps){c===l&&(c=p({},c));for(var y in o)c[y]===void 0&&(c[y]=o[y])}return c}function gR(o){eh(o)}function pR(o){console.error(o)}function mR(o){eh(o)}function Ch(o,l){try{var c=o.onUncaughtError;c(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function yR(o,l,c){try{var h=o.onCaughtError;h(c.value,{componentStack:c.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function sv(o,l,c){return c=Al(c),c.tag=3,c.payload={element:null},c.callback=function(){Ch(o,l)},c}function vR(o){return o=Al(o),o.tag=3,o}function bR(o,l,c,h){var y=c.type.getDerivedStateFromError;if(typeof y=="function"){var x=h.value;o.payload=function(){return y(x)},o.callback=function(){yR(l,c,h)}}var I=c.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(o.callback=function(){yR(l,c,h),typeof y!="function"&&(zl===null?zl=new Set([this]):zl.add(this));var B=h.stack;this.componentDidCatch(h.value,{componentStack:B!==null?B:""})})}function b_(o,l,c,h,y){if(c.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=c.alternate,l!==null&&Ou(l,c,y,!0),c=Ei.current,c!==null){switch(c.tag){case 31:case 13:return Gi===null?Nh():c.alternate===null&&Wn===0&&(Wn=3),c.flags&=-257,c.flags|=65536,c.lanes=y,h===ch?c.flags|=16384:(l=c.updateQueue,l===null?c.updateQueue=new Set([h]):l.add(h),Iv(o,h,y)),!1;case 22:return c.flags|=65536,h===ch?c.flags|=16384:(l=c.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},c.updateQueue=l):(c=l.retryQueue,c===null?l.retryQueue=new Set([h]):c.add(h)),Iv(o,h,y)),!1}throw Error(r(435,c.tag))}return Iv(o,h,y),Nh(),!1}if(jt)return l=Ei.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=y,h!==Ey&&(o=Error(r(422),{cause:h}),Wc(Fi(o,c)))):(h!==Ey&&(l=Error(r(423),{cause:h}),Wc(Fi(l,c))),o=o.current.alternate,o.flags|=65536,y&=-y,o.lanes|=y,h=Fi(h,c),y=sv(o.stateNode,h,y),Ly(o,y),Wn!==4&&(Wn=2)),!1;var x=Error(r(520),{cause:h});if(x=Fi(x,c),hf===null?hf=[x]:hf.push(x),Wn!==4&&(Wn=2),l===null)return!0;h=Fi(h,c),c=l;do{switch(c.tag){case 3:return c.flags|=65536,o=y&-y,c.lanes|=o,o=sv(c.stateNode,h,o),Ly(c,o),!1;case 1:if(l=c.type,x=c.stateNode,(c.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(zl===null||!zl.has(x))))return c.flags|=65536,y&=-y,c.lanes|=y,y=vR(y),bR(y,o,c,h),Ly(c,y),!1}c=c.return}while(c!==null);return!1}var lv=Error(r(461)),cr=!1;function Or(o,l,c,h){l.child=o===null?CC(l,null,c,h):La(l,o.child,c,h)}function xR(o,l,c,h,y){c=c.render;var x=l.ref;if("ref"in h){var I={};for(var B in h)B!=="ref"&&(I[B]=h[B])}else I=h;return Da(l),h=Fy(o,l,c,I,x,y),B=Uy(),o!==null&&!cr?($y(o,l,y),Ps(o,l,y)):(jt&&B&&Cy(l),l.flags|=1,Or(o,l,h,y),l.child)}function SR(o,l,c,h,y){if(o===null){var x=c.type;return typeof x=="function"&&!xy(x)&&x.defaultProps===void 0&&c.compare===null?(l.tag=15,l.type=x,wR(o,l,x,h,y)):(o=ih(c.type,null,h,l,l.mode,y),o.ref=l.ref,o.return=l,l.child=o)}if(x=o.child,!pv(o,y)){var I=x.memoizedProps;if(c=c.compare,c=c!==null?c:$c,c(I,h)&&o.ref===l.ref)return Ps(o,l,y)}return l.flags|=1,o=As(x,h),o.ref=l.ref,o.return=l,l.child=o}function wR(o,l,c,h,y){if(o!==null){var x=o.memoizedProps;if($c(x,h)&&o.ref===l.ref)if(cr=!1,l.pendingProps=h=x,pv(o,y))(o.flags&131072)!==0&&(cr=!0);else return l.lanes=o.lanes,Ps(o,l,y)}return av(o,l,c,h,y)}function CR(o,l,c,h){var y=h.children,x=o!==null?o.memoizedState:null;if(o===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((l.flags&128)!==0){if(x=x!==null?x.baseLanes|c:c,o!==null){for(h=l.child=o.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;h=y&~x}else h=0,l.child=null;return RR(o,l,x,c,h)}if((c&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&ah(l,x!==null?x.cachePool:null),x!==null?TC(l,x):_y(),AC(l);else return h=l.lanes=536870912,RR(o,l,x!==null?x.baseLanes|c:c,c,h)}else x!==null?(ah(l,x.cachePool),TC(l,x),kl(),l.memoizedState=null):(o!==null&&ah(l,null),_y(),kl());return Or(o,l,y,c),l.child}function sf(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function RR(o,l,c,h,y){var x=Dy();return x=x===null?null:{parent:ar._currentValue,pool:x},l.memoizedState={baseLanes:c,cachePool:x},o!==null&&ah(l,null),_y(),AC(l),o!==null&&Ou(o,l,h,!0),l.childLanes=y,null}function Rh(o,l){return l=Th({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function ER(o,l,c){return La(l,o.child,null,c),o=Rh(l,l.pendingProps),o.flags|=2,Ti(l),l.memoizedState=null,o}function x_(o,l,c){var h=l.pendingProps,y=(l.flags&128)!==0;if(l.flags&=-129,o===null){if(jt){if(h.mode==="hidden")return o=Rh(l,h),l.lanes=536870912,sf(null,o);if(jy(l),(o=On)?(o=BE(o,qi),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:wl!==null?{id:Go,overflow:Wo}:null,retryLane:536870912,hydrationErrors:null},c=aC(o),c.return=l,l.child=c,Ar=l,On=null)):o=null,o===null)throw Rl(l);return l.lanes=536870912,null}return Rh(l,h)}var x=o.memoizedState;if(x!==null){var I=x.dehydrated;if(jy(l),y)if(l.flags&256)l.flags&=-257,l=ER(o,l,c);else if(l.memoizedState!==null)l.child=o.child,l.flags|=128,l=null;else throw Error(r(558));else if(cr||Ou(o,l,c,!1),y=(c&o.childLanes)!==0,cr||y){if(h=Sn,h!==null&&(I=ot(h,c),I!==0&&I!==x.retryLane))throw x.retryLane=I,Ma(o,I),gi(h,o,I),lv;Nh(),l=ER(o,l,c)}else o=x.treeContext,On=Wi(I.nextSibling),Ar=l,jt=!0,Cl=null,qi=!1,o!==null&&fC(l,o),l=Rh(l,h),l.flags|=4096;return l}return o=As(o.child,{mode:h.mode,children:h.children}),o.ref=l.ref,l.child=o,o.return=l,o}function Eh(o,l){var c=l.ref;if(c===null)o!==null&&o.ref!==null&&(l.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(o===null||o.ref!==c)&&(l.flags|=4194816)}}function av(o,l,c,h,y){return Da(l),c=Fy(o,l,c,h,void 0,y),h=Uy(),o!==null&&!cr?($y(o,l,y),Ps(o,l,y)):(jt&&h&&Cy(l),l.flags|=1,Or(o,l,c,y),l.child)}function TR(o,l,c,h,y,x){return Da(l),l.updateQueue=null,c=OC(l,h,c,y),MC(o),h=Uy(),o!==null&&!cr?($y(o,l,x),Ps(o,l,x)):(jt&&h&&Cy(l),l.flags|=1,Or(o,l,c,x),l.child)}function AR(o,l,c,h,y){if(Da(l),l.stateNode===null){var x=Eu,I=c.contextType;typeof I=="object"&&I!==null&&(x=Mr(I)),x=new c(h,x),l.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=ov,l.stateNode=x,x._reactInternals=l,x=l.stateNode,x.props=h,x.state=l.memoizedState,x.refs={},zy(l),I=c.contextType,x.context=typeof I=="object"&&I!==null?Mr(I):Eu,x.state=l.memoizedState,I=c.getDerivedStateFromProps,typeof I=="function"&&(iv(l,c,I,h),x.state=l.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(I=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),I!==x.state&&ov.enqueueReplaceState(x,x.state,null),ef(l,h,x,y),Jc(),x.state=l.memoizedState),typeof x.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(o===null){x=l.stateNode;var B=l.memoizedProps,K=_a(c,B);x.props=K;var se=x.context,he=c.contextType;I=Eu,typeof he=="object"&&he!==null&&(I=Mr(he));var be=c.getDerivedStateFromProps;he=typeof be=="function"||typeof x.getSnapshotBeforeUpdate=="function",B=l.pendingProps!==B,he||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(B||se!==I)&&hR(l,x,h,I),Tl=!1;var ae=l.memoizedState;x.state=ae,ef(l,h,x,y),Jc(),se=l.memoizedState,B||ae!==se||Tl?(typeof be=="function"&&(iv(l,c,be,h),se=l.memoizedState),(K=Tl||dR(l,c,K,h,ae,se,I))?(he||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(l.flags|=4194308)):(typeof x.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=se),x.props=h,x.state=se,x.context=I,h=K):(typeof x.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{x=l.stateNode,Ny(o,l),I=l.memoizedProps,he=_a(c,I),x.props=he,be=l.pendingProps,ae=x.context,se=c.contextType,K=Eu,typeof se=="object"&&se!==null&&(K=Mr(se)),B=c.getDerivedStateFromProps,(se=typeof B=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(I!==be||ae!==K)&&hR(l,x,h,K),Tl=!1,ae=l.memoizedState,x.state=ae,ef(l,h,x,y),Jc();var ce=l.memoizedState;I!==be||ae!==ce||Tl||o!==null&&o.dependencies!==null&&sh(o.dependencies)?(typeof B=="function"&&(iv(l,c,B,h),ce=l.memoizedState),(he=Tl||dR(l,c,he,h,ae,ce,K)||o!==null&&o.dependencies!==null&&sh(o.dependencies))?(se||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(h,ce,K),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(h,ce,K)),typeof x.componentDidUpdate=="function"&&(l.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof x.componentDidUpdate!="function"||I===o.memoizedProps&&ae===o.memoizedState||(l.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||I===o.memoizedProps&&ae===o.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=ce),x.props=h,x.state=ce,x.context=K,h=he):(typeof x.componentDidUpdate!="function"||I===o.memoizedProps&&ae===o.memoizedState||(l.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||I===o.memoizedProps&&ae===o.memoizedState||(l.flags|=1024),h=!1)}return x=h,Eh(o,l),h=(l.flags&128)!==0,x||h?(x=l.stateNode,c=h&&typeof c.getDerivedStateFromError!="function"?null:x.render(),l.flags|=1,o!==null&&h?(l.child=La(l,o.child,null,y),l.child=La(l,null,c,y)):Or(o,l,c,y),l.memoizedState=x.state,o=l.child):o=Ps(o,l,y),o}function MR(o,l,c,h){return ka(),l.flags|=256,Or(o,l,c,h),l.child}var uv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cv(o){return{baseLanes:o,cachePool:yC()}}function fv(o,l,c){return o=o!==null?o.childLanes&~c:0,l&&(o|=Mi),o}function OR(o,l,c){var h=l.pendingProps,y=!1,x=(l.flags&128)!==0,I;if((I=x)||(I=o!==null&&o.memoizedState===null?!1:(er.current&2)!==0),I&&(y=!0,l.flags&=-129),I=(l.flags&32)!==0,l.flags&=-33,o===null){if(jt){if(y?Ol(l):kl(),(o=On)?(o=BE(o,qi),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:wl!==null?{id:Go,overflow:Wo}:null,retryLane:536870912,hydrationErrors:null},c=aC(o),c.return=l,l.child=c,Ar=l,On=null)):o=null,o===null)throw Rl(l);return Wv(o)?l.lanes=32:l.lanes=536870912,null}var B=h.children;return h=h.fallback,y?(kl(),y=l.mode,B=Th({mode:"hidden",children:B},y),h=Oa(h,y,c,null),B.return=l,h.return=l,B.sibling=h,l.child=B,h=l.child,h.memoizedState=cv(c),h.childLanes=fv(o,I,c),l.memoizedState=uv,sf(null,h)):(Ol(l),dv(l,B))}var K=o.memoizedState;if(K!==null&&(B=K.dehydrated,B!==null)){if(x)l.flags&256?(Ol(l),l.flags&=-257,l=hv(o,l,c)):l.memoizedState!==null?(kl(),l.child=o.child,l.flags|=128,l=null):(kl(),B=h.fallback,y=l.mode,h=Th({mode:"visible",children:h.children},y),B=Oa(B,y,c,null),B.flags|=2,h.return=l,B.return=l,h.sibling=B,l.child=h,La(l,o.child,null,c),h=l.child,h.memoizedState=cv(c),h.childLanes=fv(o,I,c),l.memoizedState=uv,l=sf(null,h));else if(Ol(l),Wv(B)){if(I=B.nextSibling&&B.nextSibling.dataset,I)var se=I.dgst;I=se,h=Error(r(419)),h.stack="",h.digest=I,Wc({value:h,source:null,stack:null}),l=hv(o,l,c)}else if(cr||Ou(o,l,c,!1),I=(c&o.childLanes)!==0,cr||I){if(I=Sn,I!==null&&(h=ot(I,c),h!==0&&h!==K.retryLane))throw K.retryLane=h,Ma(o,h),gi(I,o,h),lv;Gv(B)||Nh(),l=hv(o,l,c)}else Gv(B)?(l.flags|=192,l.child=o.child,l=null):(o=K.treeContext,On=Wi(B.nextSibling),Ar=l,jt=!0,Cl=null,qi=!1,o!==null&&fC(l,o),l=dv(l,h.children),l.flags|=4096);return l}return y?(kl(),B=h.fallback,y=l.mode,K=o.child,se=K.sibling,h=As(K,{mode:"hidden",children:h.children}),h.subtreeFlags=K.subtreeFlags&65011712,se!==null?B=As(se,B):(B=Oa(B,y,c,null),B.flags|=2),B.return=l,h.return=l,h.sibling=B,l.child=h,sf(null,h),h=l.child,B=o.child.memoizedState,B===null?B=cv(c):(y=B.cachePool,y!==null?(K=ar._currentValue,y=y.parent!==K?{parent:K,pool:K}:y):y=yC(),B={baseLanes:B.baseLanes|c,cachePool:y}),h.memoizedState=B,h.childLanes=fv(o,I,c),l.memoizedState=uv,sf(o.child,h)):(Ol(l),c=o.child,o=c.sibling,c=As(c,{mode:"visible",children:h.children}),c.return=l,c.sibling=null,o!==null&&(I=l.deletions,I===null?(l.deletions=[o],l.flags|=16):I.push(o)),l.child=c,l.memoizedState=null,c)}function dv(o,l){return l=Th({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function Th(o,l){return o=Ri(22,o,null,l),o.lanes=0,o}function hv(o,l,c){return La(l,o.child,null,c),o=dv(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function kR(o,l,c){o.lanes|=l;var h=o.alternate;h!==null&&(h.lanes|=l),My(o.return,l,c)}function gv(o,l,c,h,y,x){var I=o.memoizedState;I===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:y,treeForkCount:x}:(I.isBackwards=l,I.rendering=null,I.renderingStartTime=0,I.last=h,I.tail=c,I.tailMode=y,I.treeForkCount=x)}function IR(o,l,c){var h=l.pendingProps,y=h.revealOrder,x=h.tail;h=h.children;var I=er.current,B=(I&2)!==0;if(B?(I=I&1|2,l.flags|=128):I&=1,W(er,I),Or(o,l,h,c),h=jt?Gc:0,!B&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&kR(o,c,l);else if(o.tag===19)kR(o,c,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(y){case"forwards":for(c=l.child,y=null;c!==null;)o=c.alternate,o!==null&&gh(o)===null&&(y=c),c=c.sibling;c=y,c===null?(y=l.child,l.child=null):(y=c.sibling,c.sibling=null),gv(l,!1,y,c,x,h);break;case"backwards":case"unstable_legacy-backwards":for(c=null,y=l.child,l.child=null;y!==null;){if(o=y.alternate,o!==null&&gh(o)===null){l.child=y;break}o=y.sibling,y.sibling=c,c=y,y=o}gv(l,!0,c,null,x,h);break;case"together":gv(l,!1,null,null,void 0,h);break;default:l.memoizedState=null}return l.child}function Ps(o,l,c){if(o!==null&&(l.dependencies=o.dependencies),Pl|=l.lanes,(c&l.childLanes)===0)if(o!==null){if(Ou(o,l,c,!1),(c&l.childLanes)===0)return null}else return null;if(o!==null&&l.child!==o.child)throw Error(r(153));if(l.child!==null){for(o=l.child,c=As(o,o.pendingProps),l.child=c,c.return=l;o.sibling!==null;)o=o.sibling,c=c.sibling=As(o,o.pendingProps),c.return=l;c.sibling=null}return l.child}function pv(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&sh(o)))}function S_(o,l,c){switch(l.tag){case 3:Y(l,l.stateNode.containerInfo),El(l,ar,o.memoizedState.cache),ka();break;case 27:case 5:xe(l);break;case 4:Y(l,l.stateNode.containerInfo);break;case 10:El(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,jy(l),null;break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(Ol(l),l.flags|=128,null):(c&l.child.childLanes)!==0?OR(o,l,c):(Ol(l),o=Ps(o,l,c),o!==null?o.sibling:null);Ol(l);break;case 19:var y=(o.flags&128)!==0;if(h=(c&l.childLanes)!==0,h||(Ou(o,l,c,!1),h=(c&l.childLanes)!==0),y){if(h)return IR(o,l,c);l.flags|=128}if(y=l.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),W(er,er.current),h)break;return null;case 22:return l.lanes=0,CR(o,l,c,l.pendingProps);case 24:El(l,ar,o.memoizedState.cache)}return Ps(o,l,c)}function DR(o,l,c){if(o!==null)if(o.memoizedProps!==l.pendingProps)cr=!0;else{if(!pv(o,c)&&(l.flags&128)===0)return cr=!1,S_(o,l,c);cr=(o.flags&131072)!==0}else cr=!1,jt&&(l.flags&1048576)!==0&&cC(l,Gc,l.index);switch(l.lanes=0,l.tag){case 16:e:{var h=l.pendingProps;if(o=za(l.elementType),l.type=o,typeof o=="function")xy(o)?(h=_a(o,h),l.tag=1,l=AR(null,l,o,h,c)):(l.tag=0,l=av(null,l,o,h,c));else{if(o!=null){var y=o.$$typeof;if(y===A){l.tag=11,l=xR(null,l,o,h,c);break e}else if(y===M){l.tag=14,l=SR(null,l,o,h,c);break e}}throw l=F(o)||o,Error(r(306,l,""))}}return l;case 0:return av(o,l,l.type,l.pendingProps,c);case 1:return h=l.type,y=_a(h,l.pendingProps),AR(o,l,h,y,c);case 3:e:{if(Y(l,l.stateNode.containerInfo),o===null)throw Error(r(387));h=l.pendingProps;var x=l.memoizedState;y=x.element,Ny(o,l),ef(l,h,null,c);var I=l.memoizedState;if(h=I.cache,El(l,ar,h),h!==x.cache&&Oy(l,[ar],c,!0),Jc(),h=I.element,x.isDehydrated)if(x={element:h,isDehydrated:!1,cache:I.cache},l.updateQueue.baseState=x,l.memoizedState=x,l.flags&256){l=MR(o,l,h,c);break e}else if(h!==y){y=Fi(Error(r(424)),l),Wc(y),l=MR(o,l,h,c);break e}else for(o=l.stateNode.containerInfo,o.nodeType===9?o=o.body:o=o.nodeName==="HTML"?o.ownerDocument.body:o,On=Wi(o.firstChild),Ar=l,jt=!0,Cl=null,qi=!0,c=CC(l,null,h,c),l.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(ka(),h===y){l=Ps(o,l,c);break e}Or(o,l,h,c)}l=l.child}return l;case 26:return Eh(o,l),o===null?(c=UE(l.type,null,l.pendingProps,null))?l.memoizedState=c:jt||(c=l.type,o=l.pendingProps,h=Fh(ee.current).createElement(c),h[Pt]=l,h[zt]=o,kr(h,c,o),Vn(h),l.stateNode=h):l.memoizedState=UE(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return xe(l),o===null&&jt&&(h=l.stateNode=jE(l.type,l.pendingProps,ee.current),Ar=l,qi=!0,y=On,_l(l.type)?(Kv=y,On=Wi(h.firstChild)):On=y),Or(o,l,l.pendingProps.children,c),Eh(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&jt&&((y=h=On)&&(h=Q_(h,l.type,l.pendingProps,qi),h!==null?(l.stateNode=h,Ar=l,On=Wi(h.firstChild),qi=!1,y=!0):y=!1),y||Rl(l)),xe(l),y=l.type,x=l.pendingProps,I=o!==null?o.memoizedProps:null,h=x.children,Uv(y,x)?h=null:I!==null&&Uv(y,I)&&(l.flags|=32),l.memoizedState!==null&&(y=Fy(o,l,d_,null,null,c),Sf._currentValue=y),Eh(o,l),Or(o,l,h,c),l.child;case 6:return o===null&&jt&&((o=c=On)&&(c=Z_(c,l.pendingProps,qi),c!==null?(l.stateNode=c,Ar=l,On=null,o=!0):o=!1),o||Rl(l)),null;case 13:return OR(o,l,c);case 4:return Y(l,l.stateNode.containerInfo),h=l.pendingProps,o===null?l.child=La(l,null,h,c):Or(o,l,h,c),l.child;case 11:return xR(o,l,l.type,l.pendingProps,c);case 7:return Or(o,l,l.pendingProps,c),l.child;case 8:return Or(o,l,l.pendingProps.children,c),l.child;case 12:return Or(o,l,l.pendingProps.children,c),l.child;case 10:return h=l.pendingProps,El(l,l.type,h.value),Or(o,l,h.children,c),l.child;case 9:return y=l.type._context,h=l.pendingProps.children,Da(l),y=Mr(y),h=h(y),l.flags|=1,Or(o,l,h,c),l.child;case 14:return SR(o,l,l.type,l.pendingProps,c);case 15:return wR(o,l,l.type,l.pendingProps,c);case 19:return IR(o,l,c);case 31:return x_(o,l,c);case 22:return CR(o,l,c,l.pendingProps);case 24:return Da(l),h=Mr(ar),o===null?(y=Dy(),y===null&&(y=Sn,x=ky(),y.pooledCache=x,x.refCount++,x!==null&&(y.pooledCacheLanes|=c),y=x),l.memoizedState={parent:h,cache:y},zy(l),El(l,ar,y)):((o.lanes&c)!==0&&(Ny(o,l),ef(l,null,null,c),Jc()),y=o.memoizedState,x=l.memoizedState,y.parent!==h?(y={parent:h,cache:h},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),El(l,ar,h)):(h=x.cache,El(l,ar,h),h!==y.cache&&Oy(l,[ar],c,!0))),Or(o,l,l.pendingProps.children,c),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function zs(o){o.flags|=4}function mv(o,l,c,h,y){if((l=(o.mode&32)!==0)&&(l=!1),l){if(o.flags|=16777216,(y&335544128)===y)if(o.stateNode.complete)o.flags|=8192;else if(oE())o.flags|=8192;else throw Na=ch,Py}else o.flags&=-16777217}function PR(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!KE(l))if(oE())o.flags|=8192;else throw Na=ch,Py}function Ah(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?jn():536870912,o.lanes|=l,Vu|=l)}function lf(o,l){if(!jt)switch(o.tailMode){case"hidden":l=o.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?o.tail=null:c.sibling=null;break;case"collapsed":c=o.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:h.sibling=null}}function kn(o){var l=o.alternate!==null&&o.alternate.child===o.child,c=0,h=0;if(l)for(var y=o.child;y!==null;)c|=y.lanes|y.childLanes,h|=y.subtreeFlags&65011712,h|=y.flags&65011712,y.return=o,y=y.sibling;else for(y=o.child;y!==null;)c|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=o,y=y.sibling;return o.subtreeFlags|=h,o.childLanes=c,l}function w_(o,l,c){var h=l.pendingProps;switch(Ry(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kn(l),null;case 1:return kn(l),null;case 3:return c=l.stateNode,h=null,o!==null&&(h=o.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),ks(ar),le(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(o===null||o.child===null)&&(Mu(l)?zs(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ty())),kn(l),null;case 26:var y=l.type,x=l.memoizedState;return o===null?(zs(l),x!==null?(kn(l),PR(l,x)):(kn(l),mv(l,y,null,h,c))):x?x!==o.memoizedState?(zs(l),kn(l),PR(l,x)):(kn(l),l.flags&=-16777217):(o=o.memoizedProps,o!==h&&zs(l),kn(l),mv(l,y,o,h,c)),null;case 27:if(ve(l),c=ee.current,y=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==h&&zs(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return kn(l),null}o=X.current,Mu(l)?dC(l):(o=jE(y,h,c),l.stateNode=o,zs(l))}return kn(l),null;case 5:if(ve(l),y=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==h&&zs(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return kn(l),null}if(x=X.current,Mu(l))dC(l);else{var I=Fh(ee.current);switch(x){case 1:x=I.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:x=I.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":x=I.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":x=I.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":x=I.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof h.is=="string"?I.createElement("select",{is:h.is}):I.createElement("select"),h.multiple?x.multiple=!0:h.size&&(x.size=h.size);break;default:x=typeof h.is=="string"?I.createElement(y,{is:h.is}):I.createElement(y)}}x[Pt]=l,x[zt]=h;e:for(I=l.child;I!==null;){if(I.tag===5||I.tag===6)x.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===l)break e;for(;I.sibling===null;){if(I.return===null||I.return===l)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}l.stateNode=x;e:switch(kr(x,y,h),y){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&zs(l)}}return kn(l),mv(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,c),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==h&&zs(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(r(166));if(o=ee.current,Mu(l)){if(o=l.stateNode,c=l.memoizedProps,h=null,y=Ar,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}o[Pt]=l,o=!!(o.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||OE(o.nodeValue,c)),o||Rl(l,!0)}else o=Fh(o).createTextNode(h),o[Pt]=l,l.stateNode=o}return kn(l),null;case 31:if(c=l.memoizedState,o===null||o.memoizedState!==null){if(h=Mu(l),c!==null){if(o===null){if(!h)throw Error(r(318));if(o=l.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[Pt]=l}else ka(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;kn(l),o=!1}else c=Ty(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=c),o=!0;if(!o)return l.flags&256?(Ti(l),l):(Ti(l),null);if((l.flags&128)!==0)throw Error(r(558))}return kn(l),null;case 13:if(h=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=Mu(l),h!==null&&h.dehydrated!==null){if(o===null){if(!y)throw Error(r(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[Pt]=l}else ka(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;kn(l),y=!1}else y=Ty(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=y),y=!0;if(!y)return l.flags&256?(Ti(l),l):(Ti(l),null)}return Ti(l),(l.flags&128)!==0?(l.lanes=c,l):(c=h!==null,o=o!==null&&o.memoizedState!==null,c&&(h=l.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool),x=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(x=h.memoizedState.cachePool.pool),x!==y&&(h.flags|=2048)),c!==o&&c&&(l.child.flags|=8192),Ah(l,l.updateQueue),kn(l),null);case 4:return le(),o===null&&_v(l.stateNode.containerInfo),kn(l),null;case 10:return ks(l.type),kn(l),null;case 19:if(U(er),h=l.memoizedState,h===null)return kn(l),null;if(y=(l.flags&128)!==0,x=h.rendering,x===null)if(y)lf(h,!1);else{if(Wn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(x=gh(o),x!==null){for(l.flags|=128,lf(h,!1),o=x.updateQueue,l.updateQueue=o,Ah(l,o),l.subtreeFlags=0,o=c,c=l.child;c!==null;)lC(c,o),c=c.sibling;return W(er,er.current&1|2),jt&&Ms(l,h.treeForkCount),l.child}o=o.sibling}h.tail!==null&&ne()>Dh&&(l.flags|=128,y=!0,lf(h,!1),l.lanes=4194304)}else{if(!y)if(o=gh(x),o!==null){if(l.flags|=128,y=!0,o=o.updateQueue,l.updateQueue=o,Ah(l,o),lf(h,!0),h.tail===null&&h.tailMode==="hidden"&&!x.alternate&&!jt)return kn(l),null}else 2*ne()-h.renderingStartTime>Dh&&c!==536870912&&(l.flags|=128,y=!0,lf(h,!1),l.lanes=4194304);h.isBackwards?(x.sibling=l.child,l.child=x):(o=h.last,o!==null?o.sibling=x:l.child=x,h.last=x)}return h.tail!==null?(o=h.tail,h.rendering=o,h.tail=o.sibling,h.renderingStartTime=ne(),o.sibling=null,c=er.current,W(er,y?c&1|2:c&1),jt&&Ms(l,h.treeForkCount),o):(kn(l),null);case 22:case 23:return Ti(l),Hy(),h=l.memoizedState!==null,o!==null?o.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(c&536870912)!==0&&(l.flags&128)===0&&(kn(l),l.subtreeFlags&6&&(l.flags|=8192)):kn(l),c=l.updateQueue,c!==null&&Ah(l,c.retryQueue),c=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(c=o.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==c&&(l.flags|=2048),o!==null&&U(Pa),null;case 24:return c=null,o!==null&&(c=o.memoizedState.cache),l.memoizedState.cache!==c&&(l.flags|=2048),ks(ar),kn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function C_(o,l){switch(Ry(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return ks(ar),le(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return ve(l),null;case 31:if(l.memoizedState!==null){if(Ti(l),l.alternate===null)throw Error(r(340));ka()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if(Ti(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));ka()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return U(er),null;case 4:return le(),null;case 10:return ks(l.type),null;case 22:case 23:return Ti(l),Hy(),o!==null&&U(Pa),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return ks(ar),null;case 25:return null;default:return null}}function zR(o,l){switch(Ry(l),l.tag){case 3:ks(ar),le();break;case 26:case 27:case 5:ve(l);break;case 4:le();break;case 31:l.memoizedState!==null&&Ti(l);break;case 13:Ti(l);break;case 19:U(er);break;case 10:ks(l.type);break;case 22:case 23:Ti(l),Hy(),o!==null&&U(Pa);break;case 24:ks(ar)}}function af(o,l){try{var c=l.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var y=h.next;c=y;do{if((c.tag&o)===o){h=void 0;var x=c.create,I=c.inst;h=x(),I.destroy=h}c=c.next}while(c!==y)}}catch(B){un(l,l.return,B)}}function Il(o,l,c){try{var h=l.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var x=y.next;h=x;do{if((h.tag&o)===o){var I=h.inst,B=I.destroy;if(B!==void 0){I.destroy=void 0,y=l;var K=c,se=B;try{se()}catch(he){un(y,K,he)}}}h=h.next}while(h!==x)}}catch(he){un(l,l.return,he)}}function NR(o){var l=o.updateQueue;if(l!==null){var c=o.stateNode;try{EC(l,c)}catch(h){un(o,o.return,h)}}}function LR(o,l,c){c.props=_a(o.type,o.memoizedProps),c.state=o.memoizedState;try{c.componentWillUnmount()}catch(h){un(o,l,h)}}function uf(o,l){try{var c=o.ref;if(c!==null){switch(o.tag){case 26:case 27:case 5:var h=o.stateNode;break;case 30:h=o.stateNode;break;default:h=o.stateNode}typeof c=="function"?o.refCleanup=c(h):c.current=h}}catch(y){un(o,l,y)}}function Ko(o,l){var c=o.ref,h=o.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(y){un(o,l,y)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(y){un(o,l,y)}else c.current=null}function BR(o){var l=o.type,c=o.memoizedProps,h=o.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break e;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(y){un(o,o.return,y)}}function yv(o,l,c){try{var h=o.stateNode;q_(h,o.type,c,l),h[zt]=l}catch(y){un(o,o.return,y)}}function _R(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&_l(o.type)||o.tag===4}function vv(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||_R(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&_l(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function bv(o,l,c){var h=o.tag;if(h===5||h===6)o=o.stateNode,l?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(o,l):(l=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,l.appendChild(o),c=c._reactRootContainer,c!=null||l.onclick!==null||(l.onclick=jr));else if(h!==4&&(h===27&&_l(o.type)&&(c=o.stateNode,l=null),o=o.child,o!==null))for(bv(o,l,c),o=o.sibling;o!==null;)bv(o,l,c),o=o.sibling}function Mh(o,l,c){var h=o.tag;if(h===5||h===6)o=o.stateNode,l?c.insertBefore(o,l):c.appendChild(o);else if(h!==4&&(h===27&&_l(o.type)&&(c=o.stateNode),o=o.child,o!==null))for(Mh(o,l,c),o=o.sibling;o!==null;)Mh(o,l,c),o=o.sibling}function HR(o){var l=o.stateNode,c=o.memoizedProps;try{for(var h=o.type,y=l.attributes;y.length;)l.removeAttributeNode(y[0]);kr(l,h,c),l[Pt]=o,l[zt]=c}catch(x){un(o,o.return,x)}}var Ns=!1,fr=!1,xv=!1,jR=typeof WeakSet=="function"?WeakSet:Set,Rr=null;function R_(o,l){if(o=o.containerInfo,Vv=Yh,o=Z1(o),hy(o)){if("selectionStart"in o)var c={start:o.selectionStart,end:o.selectionEnd};else e:{c=(c=o.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var y=h.anchorOffset,x=h.focusNode;h=h.focusOffset;try{c.nodeType,x.nodeType}catch{c=null;break e}var I=0,B=-1,K=-1,se=0,he=0,be=o,ae=null;t:for(;;){for(var ce;be!==c||y!==0&&be.nodeType!==3||(B=I+y),be!==x||h!==0&&be.nodeType!==3||(K=I+h),be.nodeType===3&&(I+=be.nodeValue.length),(ce=be.firstChild)!==null;)ae=be,be=ce;for(;;){if(be===o)break t;if(ae===c&&++se===y&&(B=I),ae===x&&++he===h&&(K=I),(ce=be.nextSibling)!==null)break;be=ae,ae=be.parentNode}be=ce}c=B===-1||K===-1?null:{start:B,end:K}}else c=null}c=c||{start:0,end:0}}else c=null;for(Fv={focusedElem:o,selectionRange:c},Yh=!1,Rr=l;Rr!==null;)if(l=Rr,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Rr=o;else for(;Rr!==null;){switch(l=Rr,x=l.alternate,o=l.flags,l.tag){case 0:if((o&4)!==0&&(o=l.updateQueue,o=o!==null?o.events:null,o!==null))for(c=0;c<o.length;c++)y=o[c],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&x!==null){o=void 0,c=l,y=x.memoizedProps,x=x.memoizedState,h=c.stateNode;try{var qe=_a(c.type,y);o=h.getSnapshotBeforeUpdate(qe,x),h.__reactInternalSnapshotBeforeUpdate=o}catch(at){un(c,c.return,at)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,c=o.nodeType,c===9)qv(o);else if(c===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":qv(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=l.sibling,o!==null){o.return=l.return,Rr=o;break}Rr=l.return}}function VR(o,l,c){var h=c.flags;switch(c.tag){case 0:case 11:case 15:Bs(o,c),h&4&&af(5,c);break;case 1:if(Bs(o,c),h&4)if(o=c.stateNode,l===null)try{o.componentDidMount()}catch(I){un(c,c.return,I)}else{var y=_a(c.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(y,l,o.__reactInternalSnapshotBeforeUpdate)}catch(I){un(c,c.return,I)}}h&64&&NR(c),h&512&&uf(c,c.return);break;case 3:if(Bs(o,c),h&64&&(o=c.updateQueue,o!==null)){if(l=null,c.child!==null)switch(c.child.tag){case 27:case 5:l=c.child.stateNode;break;case 1:l=c.child.stateNode}try{EC(o,l)}catch(I){un(c,c.return,I)}}break;case 27:l===null&&h&4&&HR(c);case 26:case 5:Bs(o,c),l===null&&h&4&&BR(c),h&512&&uf(c,c.return);break;case 12:Bs(o,c);break;case 31:Bs(o,c),h&4&&$R(o,c);break;case 13:Bs(o,c),h&4&&qR(o,c),h&64&&(o=c.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(c=P_.bind(null,c),J_(o,c))));break;case 22:if(h=c.memoizedState!==null||Ns,!h){l=l!==null&&l.memoizedState!==null||fr,y=Ns;var x=fr;Ns=h,(fr=l)&&!x?_s(o,c,(c.subtreeFlags&8772)!==0):Bs(o,c),Ns=y,fr=x}break;case 30:break;default:Bs(o,c)}}function FR(o){var l=o.alternate;l!==null&&(o.alternate=null,FR(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&Sa(l)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Bn=null,ci=!1;function Ls(o,l,c){for(c=c.child;c!==null;)UR(o,l,c),c=c.sibling}function UR(o,l,c){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(ht,c)}catch{}switch(c.tag){case 26:fr||Ko(c,l),Ls(o,l,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:fr||Ko(c,l);var h=Bn,y=ci;_l(c.type)&&(Bn=c.stateNode,ci=!1),Ls(o,l,c),vf(c.stateNode),Bn=h,ci=y;break;case 5:fr||Ko(c,l);case 6:if(h=Bn,y=ci,Bn=null,Ls(o,l,c),Bn=h,ci=y,Bn!==null)if(ci)try{(Bn.nodeType===9?Bn.body:Bn.nodeName==="HTML"?Bn.ownerDocument.body:Bn).removeChild(c.stateNode)}catch(x){un(c,l,x)}else try{Bn.removeChild(c.stateNode)}catch(x){un(c,l,x)}break;case 18:Bn!==null&&(ci?(o=Bn,NE(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,c.stateNode),Yu(o)):NE(Bn,c.stateNode));break;case 4:h=Bn,y=ci,Bn=c.stateNode.containerInfo,ci=!0,Ls(o,l,c),Bn=h,ci=y;break;case 0:case 11:case 14:case 15:Il(2,c,l),fr||Il(4,c,l),Ls(o,l,c);break;case 1:fr||(Ko(c,l),h=c.stateNode,typeof h.componentWillUnmount=="function"&&LR(c,l,h)),Ls(o,l,c);break;case 21:Ls(o,l,c);break;case 22:fr=(h=fr)||c.memoizedState!==null,Ls(o,l,c),fr=h;break;default:Ls(o,l,c)}}function $R(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{Yu(o)}catch(c){un(l,l.return,c)}}}function qR(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{Yu(o)}catch(c){un(l,l.return,c)}}function E_(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new jR),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new jR),l;default:throw Error(r(435,o.tag))}}function Oh(o,l){var c=E_(o);l.forEach(function(h){if(!c.has(h)){c.add(h);var y=z_.bind(null,o,h);h.then(y,y)}})}function fi(o,l){var c=l.deletions;if(c!==null)for(var h=0;h<c.length;h++){var y=c[h],x=o,I=l,B=I;e:for(;B!==null;){switch(B.tag){case 27:if(_l(B.type)){Bn=B.stateNode,ci=!1;break e}break;case 5:Bn=B.stateNode,ci=!1;break e;case 3:case 4:Bn=B.stateNode.containerInfo,ci=!0;break e}B=B.return}if(Bn===null)throw Error(r(160));UR(x,I,y),Bn=null,ci=!1,x=y.alternate,x!==null&&(x.return=null),y.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)GR(l,o),l=l.sibling}var wo=null;function GR(o,l){var c=o.alternate,h=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:fi(l,o),di(o),h&4&&(Il(3,o,o.return),af(3,o),Il(5,o,o.return));break;case 1:fi(l,o),di(o),h&512&&(fr||c===null||Ko(c,c.return)),h&64&&Ns&&(o=o.updateQueue,o!==null&&(h=o.callbacks,h!==null&&(c=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=c===null?h:c.concat(h))));break;case 26:var y=wo;if(fi(l,o),di(o),h&512&&(fr||c===null||Ko(c,c.return)),h&4){var x=c!==null?c.memoizedState:null;if(h=o.memoizedState,c===null)if(h===null)if(o.stateNode===null){e:{h=o.type,c=o.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":x=y.getElementsByTagName("title")[0],(!x||x[Ve]||x[Pt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=y.createElement(h),y.head.insertBefore(x,y.querySelector("head > title"))),kr(x,h,c),x[Pt]=o,Vn(x),h=x;break e;case"link":var I=GE("link","href",y).get(h+(c.href||""));if(I){for(var B=0;B<I.length;B++)if(x=I[B],x.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&x.getAttribute("rel")===(c.rel==null?null:c.rel)&&x.getAttribute("title")===(c.title==null?null:c.title)&&x.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){I.splice(B,1);break t}}x=y.createElement(h),kr(x,h,c),y.head.appendChild(x);break;case"meta":if(I=GE("meta","content",y).get(h+(c.content||""))){for(B=0;B<I.length;B++)if(x=I[B],x.getAttribute("content")===(c.content==null?null:""+c.content)&&x.getAttribute("name")===(c.name==null?null:c.name)&&x.getAttribute("property")===(c.property==null?null:c.property)&&x.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&x.getAttribute("charset")===(c.charSet==null?null:c.charSet)){I.splice(B,1);break t}}x=y.createElement(h),kr(x,h,c),y.head.appendChild(x);break;default:throw Error(r(468,h))}x[Pt]=o,Vn(x),h=x}o.stateNode=h}else WE(y,o.type,o.stateNode);else o.stateNode=qE(y,h,o.memoizedProps);else x!==h?(x===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):x.count--,h===null?WE(y,o.type,o.stateNode):qE(y,h,o.memoizedProps)):h===null&&o.stateNode!==null&&yv(o,o.memoizedProps,c.memoizedProps)}break;case 27:fi(l,o),di(o),h&512&&(fr||c===null||Ko(c,c.return)),c!==null&&h&4&&yv(o,o.memoizedProps,c.memoizedProps);break;case 5:if(fi(l,o),di(o),h&512&&(fr||c===null||Ko(c,c.return)),o.flags&32){y=o.stateNode;try{ji(y,"")}catch(qe){un(o,o.return,qe)}}h&4&&o.stateNode!=null&&(y=o.memoizedProps,yv(o,y,c!==null?c.memoizedProps:y)),h&1024&&(xv=!0);break;case 6:if(fi(l,o),di(o),h&4){if(o.stateNode===null)throw Error(r(162));h=o.memoizedProps,c=o.stateNode;try{c.nodeValue=h}catch(qe){un(o,o.return,qe)}}break;case 3:if(qh=null,y=wo,wo=Uh(l.containerInfo),fi(l,o),wo=y,di(o),h&4&&c!==null&&c.memoizedState.isDehydrated)try{Yu(l.containerInfo)}catch(qe){un(o,o.return,qe)}xv&&(xv=!1,WR(o));break;case 4:h=wo,wo=Uh(o.stateNode.containerInfo),fi(l,o),di(o),wo=h;break;case 12:fi(l,o),di(o);break;case 31:fi(l,o),di(o),h&4&&(h=o.updateQueue,h!==null&&(o.updateQueue=null,Oh(o,h)));break;case 13:fi(l,o),di(o),o.child.flags&8192&&o.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Ih=ne()),h&4&&(h=o.updateQueue,h!==null&&(o.updateQueue=null,Oh(o,h)));break;case 22:y=o.memoizedState!==null;var K=c!==null&&c.memoizedState!==null,se=Ns,he=fr;if(Ns=se||y,fr=he||K,fi(l,o),fr=he,Ns=se,di(o),h&8192)e:for(l=o.stateNode,l._visibility=y?l._visibility&-2:l._visibility|1,y&&(c===null||K||Ns||fr||Ha(o)),c=null,l=o;;){if(l.tag===5||l.tag===26){if(c===null){K=c=l;try{if(x=K.stateNode,y)I=x.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{B=K.stateNode;var be=K.memoizedProps.style,ae=be!=null&&be.hasOwnProperty("display")?be.display:null;B.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(qe){un(K,K.return,qe)}}}else if(l.tag===6){if(c===null){K=l;try{K.stateNode.nodeValue=y?"":K.memoizedProps}catch(qe){un(K,K.return,qe)}}}else if(l.tag===18){if(c===null){K=l;try{var ce=K.stateNode;y?LE(ce,!0):LE(K.stateNode,!1)}catch(qe){un(K,K.return,qe)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===o)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;c===l&&(c=null),l=l.return}c===l&&(c=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=o.updateQueue,h!==null&&(c=h.retryQueue,c!==null&&(h.retryQueue=null,Oh(o,c))));break;case 19:fi(l,o),di(o),h&4&&(h=o.updateQueue,h!==null&&(o.updateQueue=null,Oh(o,h)));break;case 30:break;case 21:break;default:fi(l,o),di(o)}}function di(o){var l=o.flags;if(l&2){try{for(var c,h=o.return;h!==null;){if(_R(h)){c=h;break}h=h.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var y=c.stateNode,x=vv(o);Mh(o,x,y);break;case 5:var I=c.stateNode;c.flags&32&&(ji(I,""),c.flags&=-33);var B=vv(o);Mh(o,B,I);break;case 3:case 4:var K=c.stateNode.containerInfo,se=vv(o);bv(o,se,K);break;default:throw Error(r(161))}}catch(he){un(o,o.return,he)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function WR(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;WR(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function Bs(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)VR(o,l.alternate,l),l=l.sibling}function Ha(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:Il(4,l,l.return),Ha(l);break;case 1:Ko(l,l.return);var c=l.stateNode;typeof c.componentWillUnmount=="function"&&LR(l,l.return,c),Ha(l);break;case 27:vf(l.stateNode);case 26:case 5:Ko(l,l.return),Ha(l);break;case 22:l.memoizedState===null&&Ha(l);break;case 30:Ha(l);break;default:Ha(l)}o=o.sibling}}function _s(o,l,c){for(c=c&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,y=o,x=l,I=x.flags;switch(x.tag){case 0:case 11:case 15:_s(y,x,c),af(4,x);break;case 1:if(_s(y,x,c),h=x,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(se){un(h,h.return,se)}if(h=x,y=h.updateQueue,y!==null){var B=h.stateNode;try{var K=y.shared.hiddenCallbacks;if(K!==null)for(y.shared.hiddenCallbacks=null,y=0;y<K.length;y++)RC(K[y],B)}catch(se){un(h,h.return,se)}}c&&I&64&&NR(x),uf(x,x.return);break;case 27:HR(x);case 26:case 5:_s(y,x,c),c&&h===null&&I&4&&BR(x),uf(x,x.return);break;case 12:_s(y,x,c);break;case 31:_s(y,x,c),c&&I&4&&$R(y,x);break;case 13:_s(y,x,c),c&&I&4&&qR(y,x);break;case 22:x.memoizedState===null&&_s(y,x,c),uf(x,x.return);break;case 30:break;default:_s(y,x,c)}l=l.sibling}}function Sv(o,l){var c=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(c=o.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==c&&(o!=null&&o.refCount++,c!=null&&Kc(c))}function wv(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Kc(o))}function Co(o,l,c,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)KR(o,l,c,h),l=l.sibling}function KR(o,l,c,h){var y=l.flags;switch(l.tag){case 0:case 11:case 15:Co(o,l,c,h),y&2048&&af(9,l);break;case 1:Co(o,l,c,h);break;case 3:Co(o,l,c,h),y&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Kc(o)));break;case 12:if(y&2048){Co(o,l,c,h),o=l.stateNode;try{var x=l.memoizedProps,I=x.id,B=x.onPostCommit;typeof B=="function"&&B(I,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(K){un(l,l.return,K)}}else Co(o,l,c,h);break;case 31:Co(o,l,c,h);break;case 13:Co(o,l,c,h);break;case 23:break;case 22:x=l.stateNode,I=l.alternate,l.memoizedState!==null?x._visibility&2?Co(o,l,c,h):cf(o,l):x._visibility&2?Co(o,l,c,h):(x._visibility|=2,_u(o,l,c,h,(l.subtreeFlags&10256)!==0||!1)),y&2048&&Sv(I,l);break;case 24:Co(o,l,c,h),y&2048&&wv(l.alternate,l);break;default:Co(o,l,c,h)}}function _u(o,l,c,h,y){for(y=y&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var x=o,I=l,B=c,K=h,se=I.flags;switch(I.tag){case 0:case 11:case 15:_u(x,I,B,K,y),af(8,I);break;case 23:break;case 22:var he=I.stateNode;I.memoizedState!==null?he._visibility&2?_u(x,I,B,K,y):cf(x,I):(he._visibility|=2,_u(x,I,B,K,y)),y&&se&2048&&Sv(I.alternate,I);break;case 24:_u(x,I,B,K,y),y&&se&2048&&wv(I.alternate,I);break;default:_u(x,I,B,K,y)}l=l.sibling}}function cf(o,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var c=o,h=l,y=h.flags;switch(h.tag){case 22:cf(c,h),y&2048&&Sv(h.alternate,h);break;case 24:cf(c,h),y&2048&&wv(h.alternate,h);break;default:cf(c,h)}l=l.sibling}}var ff=8192;function Hu(o,l,c){if(o.subtreeFlags&ff)for(o=o.child;o!==null;)YR(o,l,c),o=o.sibling}function YR(o,l,c){switch(o.tag){case 26:Hu(o,l,c),o.flags&ff&&o.memoizedState!==null&&fH(c,wo,o.memoizedState,o.memoizedProps);break;case 5:Hu(o,l,c);break;case 3:case 4:var h=wo;wo=Uh(o.stateNode.containerInfo),Hu(o,l,c),wo=h;break;case 22:o.memoizedState===null&&(h=o.alternate,h!==null&&h.memoizedState!==null?(h=ff,ff=16777216,Hu(o,l,c),ff=h):Hu(o,l,c));break;default:Hu(o,l,c)}}function XR(o){var l=o.alternate;if(l!==null&&(o=l.child,o!==null)){l.child=null;do l=o.sibling,o.sibling=null,o=l;while(o!==null)}}function df(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var c=0;c<l.length;c++){var h=l[c];Rr=h,ZR(h,o)}XR(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)QR(o),o=o.sibling}function QR(o){switch(o.tag){case 0:case 11:case 15:df(o),o.flags&2048&&Il(9,o,o.return);break;case 3:df(o);break;case 12:df(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,kh(o)):df(o);break;default:df(o)}}function kh(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var c=0;c<l.length;c++){var h=l[c];Rr=h,ZR(h,o)}XR(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:Il(8,l,l.return),kh(l);break;case 22:c=l.stateNode,c._visibility&2&&(c._visibility&=-3,kh(l));break;default:kh(l)}o=o.sibling}}function ZR(o,l){for(;Rr!==null;){var c=Rr;switch(c.tag){case 0:case 11:case 15:Il(8,c,l);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var h=c.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Kc(c.memoizedState.cache)}if(h=c.child,h!==null)h.return=c,Rr=h;else e:for(c=o;Rr!==null;){h=Rr;var y=h.sibling,x=h.return;if(FR(h),h===c){Rr=null;break e}if(y!==null){y.return=x,Rr=y;break e}Rr=x}}}var T_={getCacheForType:function(o){var l=Mr(ar),c=l.data.get(o);return c===void 0&&(c=o(),l.data.set(o,c)),c},cacheSignal:function(){return Mr(ar).controller.signal}},A_=typeof WeakMap=="function"?WeakMap:Map,tn=0,Sn=null,Nt=null,_t=0,an=0,Ai=null,Dl=!1,ju=!1,Cv=!1,Hs=0,Wn=0,Pl=0,ja=0,Rv=0,Mi=0,Vu=0,hf=null,hi=null,Ev=!1,Ih=0,JR=0,Dh=1/0,Ph=null,zl=null,gr=0,Nl=null,Fu=null,js=0,Tv=0,Av=null,eE=null,gf=0,Mv=null;function Oi(){return(tn&2)!==0&&_t!==0?_t&-_t:j.T!==null?zv():Ln()}function tE(){if(Mi===0)if((_t&536870912)===0||jt){var o=Wt;Wt<<=1,(Wt&3932160)===0&&(Wt=262144),Mi=o}else Mi=536870912;return o=Ei.current,o!==null&&(o.flags|=32),Mi}function gi(o,l,c){(o===Sn&&(an===2||an===9)||o.cancelPendingCommit!==null)&&(Uu(o,0),Ll(o,_t,Mi,!1)),Rn(o,c),((tn&2)===0||o!==Sn)&&(o===Sn&&((tn&2)===0&&(ja|=c),Wn===4&&Ll(o,_t,Mi,!1)),Yo(o))}function nE(o,l,c){if((tn&6)!==0)throw Error(r(327));var h=!c&&(l&127)===0&&(l&o.expiredLanes)===0||Zt(o,l),y=h?k_(o,l):kv(o,l,!0),x=h;do{if(y===0){ju&&!h&&Ll(o,l,0,!1);break}else{if(c=o.current.alternate,x&&!M_(c)){y=kv(o,l,!1),x=!1;continue}if(y===2){if(x=l,o.errorRecoveryDisabledLanes&x)var I=0;else I=o.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){l=I;e:{var B=o;y=hf;var K=B.current.memoizedState.isDehydrated;if(K&&(Uu(B,I).flags|=256),I=kv(B,I,!1),I!==2){if(Cv&&!K){B.errorRecoveryDisabledLanes|=x,ja|=x,y=4;break e}x=hi,hi=y,x!==null&&(hi===null?hi=x:hi.push.apply(hi,x))}y=I}if(x=!1,y!==2)continue}}if(y===1){Uu(o,0),Ll(o,l,0,!0);break}e:{switch(h=o,x=y,x){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Ll(h,l,Mi,!Dl);break e;case 2:hi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(y=Ih+300-ne(),10<y)){if(Ll(h,l,Mi,!Dl),rt(h,0,!0)!==0)break e;js=l,h.timeoutHandle=PE(rE.bind(null,h,c,hi,Ph,Ev,l,Mi,ja,Vu,Dl,x,"Throttled",-0,0),y);break e}rE(h,c,hi,Ph,Ev,l,Mi,ja,Vu,Dl,x,null,-0,0)}}break}while(!0);Yo(o)}function rE(o,l,c,h,y,x,I,B,K,se,he,be,ae,ce){if(o.timeoutHandle=-1,be=l.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:jr},YR(l,x,be);var qe=(x&62914560)===x?Ih-ne():(x&4194048)===x?JR-ne():0;if(qe=dH(be,qe),qe!==null){js=x,o.cancelPendingCommit=qe(fE.bind(null,o,l,x,c,h,y,I,B,K,he,be,null,ae,ce)),Ll(o,x,I,!se);return}}fE(o,l,x,c,h,y,I,B,K)}function M_(o){for(var l=o;;){var c=l.tag;if((c===0||c===11||c===15)&&l.flags&16384&&(c=l.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var h=0;h<c.length;h++){var y=c[h],x=y.getSnapshot;y=y.value;try{if(!Ci(x(),y))return!1}catch{return!1}}if(c=l.child,l.subtreeFlags&16384&&c!==null)c.return=l,l=c;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Ll(o,l,c,h){l&=~Rv,l&=~ja,o.suspendedLanes|=l,o.pingedLanes&=~l,h&&(o.warmLanes|=l),h=o.expirationTimes;for(var y=l;0<y;){var x=31-ut(y),I=1<<x;h[x]=-1,y&=~I}c!==0&&Br(o,c,l)}function zh(){return(tn&6)===0?(pf(0),!1):!0}function Ov(){if(Nt!==null){if(an===0)var o=Nt.return;else o=Nt,Os=Ia=null,qy(o),Pu=null,Xc=0,o=Nt;for(;o!==null;)zR(o.alternate,o),o=o.return;Nt=null}}function Uu(o,l){var c=o.timeoutHandle;c!==-1&&(o.timeoutHandle=-1,K_(c)),c=o.cancelPendingCommit,c!==null&&(o.cancelPendingCommit=null,c()),js=0,Ov(),Sn=o,Nt=c=As(o.current,null),_t=l,an=0,Ai=null,Dl=!1,ju=Zt(o,l),Cv=!1,Vu=Mi=Rv=ja=Pl=Wn=0,hi=hf=null,Ev=!1,(l&8)!==0&&(l|=l&32);var h=o.entangledLanes;if(h!==0)for(o=o.entanglements,h&=l;0<h;){var y=31-ut(h),x=1<<y;l|=o[y],h&=~x}return Hs=l,th(),c}function iE(o,l){xt=null,j.H=of,l===Du||l===uh?(l=xC(),an=3):l===Py?(l=xC(),an=4):an=l===lv?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Ai=l,Nt===null&&(Wn=1,Ch(o,Fi(l,o.current)))}function oE(){var o=Ei.current;return o===null?!0:(_t&4194048)===_t?Gi===null:(_t&62914560)===_t||(_t&536870912)!==0?o===Gi:!1}function sE(){var o=j.H;return j.H=of,o===null?of:o}function lE(){var o=j.A;return j.A=T_,o}function Nh(){Wn=4,Dl||(_t&4194048)!==_t&&Ei.current!==null||(ju=!0),(Pl&134217727)===0&&(ja&134217727)===0||Sn===null||Ll(Sn,_t,Mi,!1)}function kv(o,l,c){var h=tn;tn|=2;var y=sE(),x=lE();(Sn!==o||_t!==l)&&(Ph=null,Uu(o,l)),l=!1;var I=Wn;e:do try{if(an!==0&&Nt!==null){var B=Nt,K=Ai;switch(an){case 8:Ov(),I=6;break e;case 3:case 2:case 9:case 6:Ei.current===null&&(l=!0);var se=an;if(an=0,Ai=null,$u(o,B,K,se),c&&ju){I=0;break e}break;default:se=an,an=0,Ai=null,$u(o,B,K,se)}}O_(),I=Wn;break}catch(he){iE(o,he)}while(!0);return l&&o.shellSuspendCounter++,Os=Ia=null,tn=h,j.H=y,j.A=x,Nt===null&&(Sn=null,_t=0,th()),I}function O_(){for(;Nt!==null;)aE(Nt)}function k_(o,l){var c=tn;tn|=2;var h=sE(),y=lE();Sn!==o||_t!==l?(Ph=null,Dh=ne()+500,Uu(o,l)):ju=Zt(o,l);e:do try{if(an!==0&&Nt!==null){l=Nt;var x=Ai;t:switch(an){case 1:an=0,Ai=null,$u(o,l,x,1);break;case 2:case 9:if(vC(x)){an=0,Ai=null,uE(l);break}l=function(){an!==2&&an!==9||Sn!==o||(an=7),Yo(o)},x.then(l,l);break e;case 3:an=7;break e;case 4:an=5;break e;case 7:vC(x)?(an=0,Ai=null,uE(l)):(an=0,Ai=null,$u(o,l,x,7));break;case 5:var I=null;switch(Nt.tag){case 26:I=Nt.memoizedState;case 5:case 27:var B=Nt;if(I?KE(I):B.stateNode.complete){an=0,Ai=null;var K=B.sibling;if(K!==null)Nt=K;else{var se=B.return;se!==null?(Nt=se,Lh(se)):Nt=null}break t}}an=0,Ai=null,$u(o,l,x,5);break;case 6:an=0,Ai=null,$u(o,l,x,6);break;case 8:Ov(),Wn=6;break e;default:throw Error(r(462))}}I_();break}catch(he){iE(o,he)}while(!0);return Os=Ia=null,j.H=h,j.A=y,tn=c,Nt!==null?0:(Sn=null,_t=0,th(),Wn)}function I_(){for(;Nt!==null&&!We();)aE(Nt)}function aE(o){var l=DR(o.alternate,o,Hs);o.memoizedProps=o.pendingProps,l===null?Lh(o):Nt=l}function uE(o){var l=o,c=l.alternate;switch(l.tag){case 15:case 0:l=TR(c,l,l.pendingProps,l.type,void 0,_t);break;case 11:l=TR(c,l,l.pendingProps,l.type.render,l.ref,_t);break;case 5:qy(l);default:zR(c,l),l=Nt=lC(l,Hs),l=DR(c,l,Hs)}o.memoizedProps=o.pendingProps,l===null?Lh(o):Nt=l}function $u(o,l,c,h){Os=Ia=null,qy(l),Pu=null,Xc=0;var y=l.return;try{if(b_(o,y,l,c,_t)){Wn=1,Ch(o,Fi(c,o.current)),Nt=null;return}}catch(x){if(y!==null)throw Nt=y,x;Wn=1,Ch(o,Fi(c,o.current)),Nt=null;return}l.flags&32768?(jt||h===1?o=!0:ju||(_t&536870912)!==0?o=!1:(Dl=o=!0,(h===2||h===9||h===3||h===6)&&(h=Ei.current,h!==null&&h.tag===13&&(h.flags|=16384))),cE(l,o)):Lh(l)}function Lh(o){var l=o;do{if((l.flags&32768)!==0){cE(l,Dl);return}o=l.return;var c=w_(l.alternate,l,Hs);if(c!==null){Nt=c;return}if(l=l.sibling,l!==null){Nt=l;return}Nt=l=o}while(l!==null);Wn===0&&(Wn=5)}function cE(o,l){do{var c=C_(o.alternate,o);if(c!==null){c.flags&=32767,Nt=c;return}if(c=o.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!l&&(o=o.sibling,o!==null)){Nt=o;return}Nt=o=c}while(o!==null);Wn=6,Nt=null}function fE(o,l,c,h,y,x,I,B,K){o.cancelPendingCommit=null;do Bh();while(gr!==0);if((tn&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(x=l.lanes|l.childLanes,x|=vy,Dt(o,c,x,I,B,K),o===Sn&&(Nt=Sn=null,_t=0),Fu=l,Nl=o,js=c,Tv=x,Av=y,eE=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,N_(Ie,function(){return mE(),null})):(o.callbackNode=null,o.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=j.T,j.T=null,y=q.p,q.p=2,I=tn,tn|=4;try{R_(o,l,c)}finally{tn=I,q.p=y,j.T=h}}gr=1,dE(),hE(),gE()}}function dE(){if(gr===1){gr=0;var o=Nl,l=Fu,c=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||c){c=j.T,j.T=null;var h=q.p;q.p=2;var y=tn;tn|=4;try{GR(l,o);var x=Fv,I=Z1(o.containerInfo),B=x.focusedElem,K=x.selectionRange;if(I!==B&&B&&B.ownerDocument&&Q1(B.ownerDocument.documentElement,B)){if(K!==null&&hy(B)){var se=K.start,he=K.end;if(he===void 0&&(he=se),"selectionStart"in B)B.selectionStart=se,B.selectionEnd=Math.min(he,B.value.length);else{var be=B.ownerDocument||document,ae=be&&be.defaultView||window;if(ae.getSelection){var ce=ae.getSelection(),qe=B.textContent.length,at=Math.min(K.start,qe),pn=K.end===void 0?at:Math.min(K.end,qe);!ce.extend&&at>pn&&(I=pn,pn=at,at=I);var re=X1(B,at),Z=X1(B,pn);if(re&&Z&&(ce.rangeCount!==1||ce.anchorNode!==re.node||ce.anchorOffset!==re.offset||ce.focusNode!==Z.node||ce.focusOffset!==Z.offset)){var oe=be.createRange();oe.setStart(re.node,re.offset),ce.removeAllRanges(),at>pn?(ce.addRange(oe),ce.extend(Z.node,Z.offset)):(oe.setEnd(Z.node,Z.offset),ce.addRange(oe))}}}}for(be=[],ce=B;ce=ce.parentNode;)ce.nodeType===1&&be.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof B.focus=="function"&&B.focus(),B=0;B<be.length;B++){var ye=be[B];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}Yh=!!Vv,Fv=Vv=null}finally{tn=y,q.p=h,j.T=c}}o.current=l,gr=2}}function hE(){if(gr===2){gr=0;var o=Nl,l=Fu,c=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||c){c=j.T,j.T=null;var h=q.p;q.p=2;var y=tn;tn|=4;try{VR(o,l.alternate,l)}finally{tn=y,q.p=h,j.T=c}}gr=3}}function gE(){if(gr===4||gr===3){gr=0,fe();var o=Nl,l=Fu,c=js,h=eE;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?gr=5:(gr=0,Fu=Nl=null,pE(o,o.pendingLanes));var y=o.pendingLanes;if(y===0&&(zl=null),$n(c),l=l.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(ht,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=j.T,y=q.p,q.p=2,j.T=null;try{for(var x=o.onRecoverableError,I=0;I<h.length;I++){var B=h[I];x(B.value,{componentStack:B.stack})}}finally{j.T=l,q.p=y}}(js&3)!==0&&Bh(),Yo(o),y=o.pendingLanes,(c&261930)!==0&&(y&42)!==0?o===Mv?gf++:(gf=0,Mv=o):gf=0,pf(0)}}function pE(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,Kc(l)))}function Bh(){return dE(),hE(),gE(),mE()}function mE(){if(gr!==5)return!1;var o=Nl,l=Tv;Tv=0;var c=$n(js),h=j.T,y=q.p;try{q.p=32>c?32:c,j.T=null,c=Av,Av=null;var x=Nl,I=js;if(gr=0,Fu=Nl=null,js=0,(tn&6)!==0)throw Error(r(331));var B=tn;if(tn|=4,QR(x.current),KR(x,x.current,I,c),tn=B,pf(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(ht,x)}catch{}return!0}finally{q.p=y,j.T=h,pE(o,l)}}function yE(o,l,c){l=Fi(c,l),l=sv(o.stateNode,l,2),o=Ml(o,l,2),o!==null&&(Rn(o,2),Yo(o))}function un(o,l,c){if(o.tag===3)yE(o,o,c);else for(;l!==null;){if(l.tag===3){yE(l,o,c);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(zl===null||!zl.has(h))){o=Fi(c,o),c=vR(2),h=Ml(l,c,2),h!==null&&(bR(c,h,l,o),Rn(h,2),Yo(h));break}}l=l.return}}function Iv(o,l,c){var h=o.pingCache;if(h===null){h=o.pingCache=new A_;var y=new Set;h.set(l,y)}else y=h.get(l),y===void 0&&(y=new Set,h.set(l,y));y.has(c)||(Cv=!0,y.add(c),o=D_.bind(null,o,l,c),l.then(o,o))}function D_(o,l,c){var h=o.pingCache;h!==null&&h.delete(l),o.pingedLanes|=o.suspendedLanes&c,o.warmLanes&=~c,Sn===o&&(_t&c)===c&&(Wn===4||Wn===3&&(_t&62914560)===_t&&300>ne()-Ih?(tn&2)===0&&Uu(o,0):Rv|=c,Vu===_t&&(Vu=0)),Yo(o)}function vE(o,l){l===0&&(l=jn()),o=Ma(o,l),o!==null&&(Rn(o,l),Yo(o))}function P_(o){var l=o.memoizedState,c=0;l!==null&&(c=l.retryLane),vE(o,c)}function z_(o,l){var c=0;switch(o.tag){case 31:case 13:var h=o.stateNode,y=o.memoizedState;y!==null&&(c=y.retryLane);break;case 19:h=o.stateNode;break;case 22:h=o.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(l),vE(o,c)}function N_(o,l){return _e(o,l)}var _h=null,qu=null,Dv=!1,Hh=!1,Pv=!1,Bl=0;function Yo(o){o!==qu&&o.next===null&&(qu===null?_h=qu=o:qu=qu.next=o),Hh=!0,Dv||(Dv=!0,B_())}function pf(o,l){if(!Pv&&Hh){Pv=!0;do for(var c=!1,h=_h;h!==null;){if(o!==0){var y=h.pendingLanes;if(y===0)var x=0;else{var I=h.suspendedLanes,B=h.pingedLanes;x=(1<<31-ut(42|o)+1)-1,x&=y&~(I&~B),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(c=!0,wE(h,x))}else x=_t,x=rt(h,h===Sn?x:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(x&3)===0||Zt(h,x)||(c=!0,wE(h,x));h=h.next}while(c);Pv=!1}}function L_(){bE()}function bE(){Hh=Dv=!1;var o=0;Bl!==0&&W_()&&(o=Bl);for(var l=ne(),c=null,h=_h;h!==null;){var y=h.next,x=xE(h,l);x===0?(h.next=null,c===null?_h=y:c.next=y,y===null&&(qu=c)):(c=h,(o!==0||(x&3)!==0)&&(Hh=!0)),h=y}gr!==0&&gr!==5||pf(o),Bl!==0&&(Bl=0)}function xE(o,l){for(var c=o.suspendedLanes,h=o.pingedLanes,y=o.expirationTimes,x=o.pendingLanes&-62914561;0<x;){var I=31-ut(x),B=1<<I,K=y[I];K===-1?((B&c)===0||(B&h)!==0)&&(y[I]=Hn(B,l)):K<=l&&(o.expiredLanes|=B),x&=~B}if(l=Sn,c=_t,c=rt(o,o===l?c:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),h=o.callbackNode,c===0||o===l&&(an===2||an===9)||o.cancelPendingCommit!==null)return h!==null&&h!==null&&Ge(h),o.callbackNode=null,o.callbackPriority=0;if((c&3)===0||Zt(o,c)){if(l=c&-c,l===o.callbackPriority)return l;switch(h!==null&&Ge(h),$n(c)){case 2:case 8:c=ge;break;case 32:c=Ie;break;case 268435456:c=nt;break;default:c=Ie}return h=SE.bind(null,o),c=_e(c,h),o.callbackPriority=l,o.callbackNode=c,l}return h!==null&&h!==null&&Ge(h),o.callbackPriority=2,o.callbackNode=null,2}function SE(o,l){if(gr!==0&&gr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var c=o.callbackNode;if(Bh()&&o.callbackNode!==c)return null;var h=_t;return h=rt(o,o===Sn?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),h===0?null:(nE(o,h,l),xE(o,ne()),o.callbackNode!=null&&o.callbackNode===c?SE.bind(null,o):null)}function wE(o,l){if(Bh())return null;nE(o,l,!0)}function B_(){Y_(function(){(tn&6)!==0?_e(Se,L_):bE()})}function zv(){if(Bl===0){var o=ku;o===0&&(o=nn,nn<<=1,(nn&261888)===0&&(nn=256)),Bl=o}return Bl}function CE(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:vo(""+o)}function RE(o,l){var c=l.ownerDocument.createElement("input");return c.name=l.name,c.value=l.value,o.id&&c.setAttribute("form",o.id),l.parentNode.insertBefore(c,l),o=new FormData(o),c.parentNode.removeChild(c),o}function __(o,l,c,h,y){if(l==="submit"&&c&&c.stateNode===y){var x=CE((y[zt]||null).action),I=h.submitter;I&&(l=(l=I[zt]||null)?CE(l.formAction):I.getAttribute("formAction"),l!==null&&(x=l,I=null));var B=new xu("action","action",null,h,y);o.push({event:B,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Bl!==0){var K=I?RE(y,I):new FormData(y);ev(c,{pending:!0,data:K,method:y.method,action:x},null,K)}}else typeof x=="function"&&(B.preventDefault(),K=I?RE(y,I):new FormData(y),ev(c,{pending:!0,data:K,method:y.method,action:x},x,K))},currentTarget:y}]})}}for(var Nv=0;Nv<yy.length;Nv++){var Lv=yy[Nv],H_=Lv.toLowerCase(),j_=Lv[0].toUpperCase()+Lv.slice(1);So(H_,"on"+j_)}So(tC,"onAnimationEnd"),So(nC,"onAnimationIteration"),So(rC,"onAnimationStart"),So("dblclick","onDoubleClick"),So("focusin","onFocus"),So("focusout","onBlur"),So(n_,"onTransitionRun"),So(r_,"onTransitionStart"),So(i_,"onTransitionCancel"),So(iC,"onTransitionEnd"),mo("onMouseEnter",["mouseout","mouseover"]),mo("onMouseLeave",["mouseout","mouseover"]),mo("onPointerEnter",["pointerout","pointerover"]),mo("onPointerLeave",["pointerout","pointerover"]),_i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_i("onBeforeInput",["compositionend","keypress","textInput","paste"]),_i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mf="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(" "),V_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mf));function EE(o,l){l=(l&4)!==0;for(var c=0;c<o.length;c++){var h=o[c],y=h.event;h=h.listeners;e:{var x=void 0;if(l)for(var I=h.length-1;0<=I;I--){var B=h[I],K=B.instance,se=B.currentTarget;if(B=B.listener,K!==x&&y.isPropagationStopped())break e;x=B,y.currentTarget=se;try{x(y)}catch(he){eh(he)}y.currentTarget=null,x=K}else for(I=0;I<h.length;I++){if(B=h[I],K=B.instance,se=B.currentTarget,B=B.listener,K!==x&&y.isPropagationStopped())break e;x=B,y.currentTarget=se;try{x(y)}catch(he){eh(he)}y.currentTarget=null,x=K}}}}function Lt(o,l){var c=l[Cr];c===void 0&&(c=l[Cr]=new Set);var h=o+"__bubble";c.has(h)||(TE(l,o,2,!1),c.add(h))}function Bv(o,l,c){var h=0;l&&(h|=4),TE(c,o,h,l)}var jh="_reactListening"+Math.random().toString(36).slice(2);function _v(o){if(!o[jh]){o[jh]=!0,sr.forEach(function(c){c!=="selectionchange"&&(V_.has(c)||Bv(c,!1,o),Bv(c,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[jh]||(l[jh]=!0,Bv("selectionchange",!1,l))}}function TE(o,l,c,h){switch(tT(l)){case 2:var y=pH;break;case 8:y=mH;break;default:y=Jv}c=y.bind(null,l,c,o),y=void 0,!$t||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),h?y!==void 0?o.addEventListener(l,c,{capture:!0,passive:y}):o.addEventListener(l,c,!0):y!==void 0?o.addEventListener(l,c,{passive:y}):o.addEventListener(l,c,!1)}function Hv(o,l,c,h,y){var x=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var I=h.tag;if(I===3||I===4){var B=h.stateNode.containerInfo;if(B===y)break;if(I===4)for(I=h.return;I!==null;){var K=I.tag;if((K===3||K===4)&&I.stateNode.containerInfo===y)return;I=I.return}for(;B!==null;){if(I=Zn(B),I===null)return;if(K=I.tag,K===5||K===6||K===26||K===27){h=x=I;continue e}B=B.parentNode}}h=h.return}xl(function(){var se=x,he=vl(c),be=[];e:{var ae=oC.get(o);if(ae!==void 0){var ce=xu,qe=o;switch(o){case"keypress":if(Vr(c)===0)break e;case"keydown":case"keyup":ce=zB;break;case"focusin":qe="focus",ce=ay;break;case"focusout":qe="blur",ce=ay;break;case"beforeblur":case"afterblur":ce=ay;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":ce=z1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=wB;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=BB;break;case tC:case nC:case rC:ce=EB;break;case iC:ce=HB;break;case"scroll":case"scrollend":ce=xB;break;case"wheel":ce=VB;break;case"copy":case"cut":case"paste":ce=AB;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=L1;break;case"toggle":case"beforetoggle":ce=UB}var at=(l&4)!==0,pn=!at&&(o==="scroll"||o==="scrollend"),re=at?ae!==null?ae+"Capture":null:ae;at=[];for(var Z=se,oe;Z!==null;){var ye=Z;if(oe=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||oe===null||re===null||(ye=Oe(Z,re),ye!=null&&at.push(yf(Z,ye,oe))),pn)break;Z=Z.return}0<at.length&&(ae=new ce(ae,qe,null,c,he),be.push({event:ae,listeners:at}))}}if((l&7)===0){e:{if(ae=o==="mouseover"||o==="pointerover",ce=o==="mouseout"||o==="pointerout",ae&&c!==yl&&(qe=c.relatedTarget||c.fromElement)&&(Zn(qe)||qe[et]))break e;if((ce||ae)&&(ae=he.window===he?he:(ae=he.ownerDocument)?ae.defaultView||ae.parentWindow:window,ce?(qe=c.relatedTarget||c.toElement,ce=se,qe=qe?Zn(qe):null,qe!==null&&(pn=s(qe),at=qe.tag,qe!==pn||at!==5&&at!==27&&at!==6)&&(qe=null)):(ce=null,qe=se),ce!==qe)){if(at=z1,ye="onMouseLeave",re="onMouseEnter",Z="mouse",(o==="pointerout"||o==="pointerover")&&(at=L1,ye="onPointerLeave",re="onPointerEnter",Z="pointer"),pn=ce==null?ae:li(ce),oe=qe==null?ae:li(qe),ae=new at(ye,Z+"leave",ce,c,he),ae.target=pn,ae.relatedTarget=oe,ye=null,Zn(he)===se&&(at=new at(re,Z+"enter",qe,c,he),at.target=oe,at.relatedTarget=pn,ye=at),pn=ye,ce&&qe)t:{for(at=F_,re=ce,Z=qe,oe=0,ye=re;ye;ye=at(ye))oe++;ye=0;for(var st=Z;st;st=at(st))ye++;for(;0<oe-ye;)re=at(re),oe--;for(;0<ye-oe;)Z=at(Z),ye--;for(;oe--;){if(re===Z||Z!==null&&re===Z.alternate){at=re;break t}re=at(re),Z=at(Z)}at=null}else at=null;ce!==null&&AE(be,ae,ce,at,!1),qe!==null&&pn!==null&&AE(be,pn,qe,at,!0)}}e:{if(ae=se?li(se):window,ce=ae.nodeName&&ae.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ae.type==="file")var Kt=$1;else if(F1(ae))if(q1)Kt=JB;else{Kt=QB;var Ze=XB}else ce=ae.nodeName,!ce||ce.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?se&&Si(se.elementType)&&(Kt=$1):Kt=ZB;if(Kt&&(Kt=Kt(o,se))){U1(be,Kt,c,he);break e}Ze&&Ze(o,ae,se),o==="focusout"&&se&&ae.type==="number"&&se.memoizedProps.value!=null&&Rs(ae,"number",ae.value)}switch(Ze=se?li(se):window,o){case"focusin":(F1(Ze)||Ze.contentEditable==="true")&&(wu=Ze,gy=se,qc=null);break;case"focusout":qc=gy=wu=null;break;case"mousedown":py=!0;break;case"contextmenu":case"mouseup":case"dragend":py=!1,J1(be,c,he);break;case"selectionchange":if(t_)break;case"keydown":case"keyup":J1(be,c,he)}var Ct;if(cy)e:{switch(o){case"compositionstart":var Ht="onCompositionStart";break e;case"compositionend":Ht="onCompositionEnd";break e;case"compositionupdate":Ht="onCompositionUpdate";break e}Ht=void 0}else Su?j1(o,c)&&(Ht="onCompositionEnd"):o==="keydown"&&c.keyCode===229&&(Ht="onCompositionStart");Ht&&(B1&&c.locale!=="ko"&&(Su||Ht!=="onCompositionStart"?Ht==="onCompositionEnd"&&Su&&(Ct=Tr()):(en=he,Jn="value"in en?en.value:en.textContent,Su=!0)),Ze=Vh(se,Ht),0<Ze.length&&(Ht=new N1(Ht,o,null,c,he),be.push({event:Ht,listeners:Ze}),Ct?Ht.data=Ct:(Ct=V1(c),Ct!==null&&(Ht.data=Ct)))),(Ct=qB?GB(o,c):WB(o,c))&&(Ht=Vh(se,"onBeforeInput"),0<Ht.length&&(Ze=new N1("onBeforeInput","beforeinput",null,c,he),be.push({event:Ze,listeners:Ht}),Ze.data=Ct)),__(be,o,se,c,he)}EE(be,l)})}function yf(o,l,c){return{instance:o,listener:l,currentTarget:c}}function Vh(o,l){for(var c=l+"Capture",h=[];o!==null;){var y=o,x=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||x===null||(y=Oe(o,c),y!=null&&h.unshift(yf(o,y,x)),y=Oe(o,l),y!=null&&h.push(yf(o,y,x))),o.tag===3)return h;o=o.return}return[]}function F_(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function AE(o,l,c,h,y){for(var x=l._reactName,I=[];c!==null&&c!==h;){var B=c,K=B.alternate,se=B.stateNode;if(B=B.tag,K!==null&&K===h)break;B!==5&&B!==26&&B!==27||se===null||(K=se,y?(se=Oe(c,x),se!=null&&I.unshift(yf(c,se,K))):y||(se=Oe(c,x),se!=null&&I.push(yf(c,se,K)))),c=c.return}I.length!==0&&o.push({event:l,listeners:I})}var U_=/\r\n?/g,$_=/\u0000|\uFFFD/g;function ME(o){return(typeof o=="string"?o:""+o).replace(U_,`
|
|
12
|
-
`).replace($_,"")}function OE(o,l){return l=ME(l),ME(o)===l}function gn(o,l,c,h,y,x){switch(c){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||ji(o,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&ji(o,""+h);break;case"className":ws(o,"class",h);break;case"tabIndex":ws(o,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":ws(o,c,h);break;case"style":$o(o,h,x);break;case"data":if(l!=="object"){ws(o,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||c!=="href")){o.removeAttribute(c);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){o.removeAttribute(c);break}h=vo(""+h),o.setAttribute(c,h);break;case"action":case"formAction":if(typeof h=="function"){o.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(c==="formAction"?(l!=="input"&&gn(o,l,"name",y.name,y,null),gn(o,l,"formEncType",y.formEncType,y,null),gn(o,l,"formMethod",y.formMethod,y,null),gn(o,l,"formTarget",y.formTarget,y,null)):(gn(o,l,"encType",y.encType,y,null),gn(o,l,"method",y.method,y,null),gn(o,l,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){o.removeAttribute(c);break}h=vo(""+h),o.setAttribute(c,h);break;case"onClick":h!=null&&(o.onclick=jr);break;case"onScroll":h!=null&&Lt("scroll",o);break;case"onScrollEnd":h!=null&&Lt("scrollend",o);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(c=h.__html,c!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=c}}break;case"multiple":o.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":o.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){o.removeAttribute("xlink:href");break}c=vo(""+h),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(c,""+h):o.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(c,""):o.removeAttribute(c);break;case"capture":case"download":h===!0?o.setAttribute(c,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(c,h):o.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?o.setAttribute(c,h):o.removeAttribute(c);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?o.removeAttribute(c):o.setAttribute(c,h);break;case"popover":Lt("beforetoggle",o),Lt("toggle",o),yo(o,"popover",h);break;case"xlinkActuate":Zr(o,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Zr(o,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Zr(o,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Zr(o,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Zr(o,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Zr(o,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Zr(o,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Zr(o,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Zr(o,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":yo(o,"is",h);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=pl.get(c)||c,yo(o,c,h))}}function jv(o,l,c,h,y,x){switch(c){case"style":$o(o,h,x);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(c=h.__html,c!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=c}}break;case"children":typeof h=="string"?ji(o,h):(typeof h=="number"||typeof h=="bigint")&&ji(o,""+h);break;case"onScroll":h!=null&&Lt("scroll",o);break;case"onScrollEnd":h!=null&&Lt("scrollend",o);break;case"onClick":h!=null&&(o.onclick=jr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_r.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(y=c.endsWith("Capture"),l=c.slice(2,y?c.length-7:void 0),x=o[zt]||null,x=x!=null?x[c]:null,typeof x=="function"&&o.removeEventListener(l,x,y),typeof h=="function")){typeof x!="function"&&x!==null&&(c in o?o[c]=null:o.hasAttribute(c)&&o.removeAttribute(c)),o.addEventListener(l,h,y);break e}c in o?o[c]=h:h===!0?o.setAttribute(c,""):yo(o,c,h)}}}function kr(o,l,c){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Lt("error",o),Lt("load",o);var h=!1,y=!1,x;for(x in c)if(c.hasOwnProperty(x)){var I=c[x];if(I!=null)switch(x){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:gn(o,l,x,I,c,null)}}y&&gn(o,l,"srcSet",c.srcSet,c,null),h&&gn(o,l,"src",c.src,c,null);return;case"input":Lt("invalid",o);var B=x=I=y=null,K=null,se=null;for(h in c)if(c.hasOwnProperty(h)){var he=c[h];if(he!=null)switch(h){case"name":y=he;break;case"type":I=he;break;case"checked":K=he;break;case"defaultChecked":se=he;break;case"value":x=he;break;case"defaultValue":B=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,l));break;default:gn(o,l,h,he,c,null)}}Ea(o,x,B,K,se,I,y,!1);return;case"select":Lt("invalid",o),h=I=x=null;for(y in c)if(c.hasOwnProperty(y)&&(B=c[y],B!=null))switch(y){case"value":x=B;break;case"defaultValue":I=B;break;case"multiple":h=B;default:gn(o,l,y,B,c,null)}l=x,c=I,o.multiple=!!h,l!=null?ui(o,!!h,l,!1):c!=null&&ui(o,!!h,c,!0);return;case"textarea":Lt("invalid",o),x=y=h=null;for(I in c)if(c.hasOwnProperty(I)&&(B=c[I],B!=null))switch(I){case"value":h=B;break;case"defaultValue":y=B;break;case"children":x=B;break;case"dangerouslySetInnerHTML":if(B!=null)throw Error(r(91));break;default:gn(o,l,I,B,c,null)}Uo(o,h,y,x);return;case"option":for(K in c)c.hasOwnProperty(K)&&(h=c[K],h!=null)&&(K==="selected"?o.selected=h&&typeof h!="function"&&typeof h!="symbol":gn(o,l,K,h,c,null));return;case"dialog":Lt("beforetoggle",o),Lt("toggle",o),Lt("cancel",o),Lt("close",o);break;case"iframe":case"object":Lt("load",o);break;case"video":case"audio":for(h=0;h<mf.length;h++)Lt(mf[h],o);break;case"image":Lt("error",o),Lt("load",o);break;case"details":Lt("toggle",o);break;case"embed":case"source":case"link":Lt("error",o),Lt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in c)if(c.hasOwnProperty(se)&&(h=c[se],h!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:gn(o,l,se,h,c,null)}return;default:if(Si(l)){for(he in c)c.hasOwnProperty(he)&&(h=c[he],h!==void 0&&jv(o,l,he,h,c,void 0));return}}for(B in c)c.hasOwnProperty(B)&&(h=c[B],h!=null&&gn(o,l,B,h,c,null))}function q_(o,l,c,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,x=null,I=null,B=null,K=null,se=null,he=null;for(ce in c){var be=c[ce];if(c.hasOwnProperty(ce)&&be!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":K=be;default:h.hasOwnProperty(ce)||gn(o,l,ce,null,h,be)}}for(var ae in h){var ce=h[ae];if(be=c[ae],h.hasOwnProperty(ae)&&(ce!=null||be!=null))switch(ae){case"type":x=ce;break;case"name":y=ce;break;case"checked":se=ce;break;case"defaultChecked":he=ce;break;case"value":I=ce;break;case"defaultValue":B=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,l));break;default:ce!==be&&gn(o,l,ae,ce,h,be)}}dl(o,I,B,K,se,he,x,y);return;case"select":ce=I=B=ae=null;for(x in c)if(K=c[x],c.hasOwnProperty(x)&&K!=null)switch(x){case"value":break;case"multiple":ce=K;default:h.hasOwnProperty(x)||gn(o,l,x,null,h,K)}for(y in h)if(x=h[y],K=c[y],h.hasOwnProperty(y)&&(x!=null||K!=null))switch(y){case"value":ae=x;break;case"defaultValue":B=x;break;case"multiple":I=x;default:x!==K&&gn(o,l,y,x,h,K)}l=B,c=I,h=ce,ae!=null?ui(o,!!c,ae,!1):!!h!=!!c&&(l!=null?ui(o,!!c,l,!0):ui(o,!!c,c?[]:"",!1));return;case"textarea":ce=ae=null;for(B in c)if(y=c[B],c.hasOwnProperty(B)&&y!=null&&!h.hasOwnProperty(B))switch(B){case"value":break;case"children":break;default:gn(o,l,B,null,h,y)}for(I in h)if(y=h[I],x=c[I],h.hasOwnProperty(I)&&(y!=null||x!=null))switch(I){case"value":ae=y;break;case"defaultValue":ce=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==x&&gn(o,l,I,y,h,x)}hl(o,ae,ce);return;case"option":for(var qe in c)ae=c[qe],c.hasOwnProperty(qe)&&ae!=null&&!h.hasOwnProperty(qe)&&(qe==="selected"?o.selected=!1:gn(o,l,qe,null,h,ae));for(K in h)ae=h[K],ce=c[K],h.hasOwnProperty(K)&&ae!==ce&&(ae!=null||ce!=null)&&(K==="selected"?o.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":gn(o,l,K,ae,h,ce));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var at in c)ae=c[at],c.hasOwnProperty(at)&&ae!=null&&!h.hasOwnProperty(at)&&gn(o,l,at,null,h,ae);for(se in h)if(ae=h[se],ce=c[se],h.hasOwnProperty(se)&&ae!==ce&&(ae!=null||ce!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,l));break;default:gn(o,l,se,ae,h,ce)}return;default:if(Si(l)){for(var pn in c)ae=c[pn],c.hasOwnProperty(pn)&&ae!==void 0&&!h.hasOwnProperty(pn)&&jv(o,l,pn,void 0,h,ae);for(he in h)ae=h[he],ce=c[he],!h.hasOwnProperty(he)||ae===ce||ae===void 0&&ce===void 0||jv(o,l,he,ae,h,ce);return}}for(var re in c)ae=c[re],c.hasOwnProperty(re)&&ae!=null&&!h.hasOwnProperty(re)&&gn(o,l,re,null,h,ae);for(be in h)ae=h[be],ce=c[be],!h.hasOwnProperty(be)||ae===ce||ae==null&&ce==null||gn(o,l,be,ae,h,ce)}function kE(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function G_(){if(typeof performance.getEntriesByType=="function"){for(var o=0,l=0,c=performance.getEntriesByType("resource"),h=0;h<c.length;h++){var y=c[h],x=y.transferSize,I=y.initiatorType,B=y.duration;if(x&&B&&kE(I)){for(I=0,B=y.responseEnd,h+=1;h<c.length;h++){var K=c[h],se=K.startTime;if(se>B)break;var he=K.transferSize,be=K.initiatorType;he&&kE(be)&&(K=K.responseEnd,I+=he*(K<B?1:(B-se)/(K-se)))}if(--h,l+=8*(x+I)/(y.duration/1e3),o++,10<o)break}}if(0<o)return l/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Vv=null,Fv=null;function Fh(o){return o.nodeType===9?o:o.ownerDocument}function IE(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function DE(o,l){if(o===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&l==="foreignObject"?0:o}function Uv(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var $v=null;function W_(){var o=window.event;return o&&o.type==="popstate"?o===$v?!1:($v=o,!0):($v=null,!1)}var PE=typeof setTimeout=="function"?setTimeout:void 0,K_=typeof clearTimeout=="function"?clearTimeout:void 0,zE=typeof Promise=="function"?Promise:void 0,Y_=typeof queueMicrotask=="function"?queueMicrotask:typeof zE<"u"?function(o){return zE.resolve(null).then(o).catch(X_)}:PE;function X_(o){setTimeout(function(){throw o})}function _l(o){return o==="head"}function NE(o,l){var c=l,h=0;do{var y=c.nextSibling;if(o.removeChild(c),y&&y.nodeType===8)if(c=y.data,c==="/$"||c==="/&"){if(h===0){o.removeChild(y),Yu(l);return}h--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")h++;else if(c==="html")vf(o.ownerDocument.documentElement);else if(c==="head"){c=o.ownerDocument.head,vf(c);for(var x=c.firstChild;x;){var I=x.nextSibling,B=x.nodeName;x[Ve]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&x.rel.toLowerCase()==="stylesheet"||c.removeChild(x),x=I}}else c==="body"&&vf(o.ownerDocument.body);c=y}while(c);Yu(l)}function LE(o,l){var c=o;o=0;do{var h=c.nextSibling;if(c.nodeType===1?l?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(l?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),h&&h.nodeType===8)if(c=h.data,c==="/$"){if(o===0)break;o--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||o++;c=h}while(c)}function qv(o){var l=o.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var c=l;switch(l=l.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":qv(c),Sa(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}o.removeChild(c)}}function Q_(o,l,c,h){for(;o.nodeType===1;){var y=c;if(o.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(h){if(!o[Ve])switch(l){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(x=o.getAttribute("rel"),x==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(x!==y.rel||o.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||o.getAttribute("title")!==(y.title==null?null:y.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(x=o.getAttribute("src"),(x!==(y.src==null?null:y.src)||o.getAttribute("type")!==(y.type==null?null:y.type)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&x&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var x=y.name==null?null:""+y.name;if(y.type==="hidden"&&o.getAttribute("name")===x)return o}else return o;if(o=Wi(o.nextSibling),o===null)break}return null}function Z_(o,l,c){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!c||(o=Wi(o.nextSibling),o===null))return null;return o}function BE(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=Wi(o.nextSibling),o===null))return null;return o}function Gv(o){return o.data==="$?"||o.data==="$~"}function Wv(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function J_(o,l){var c=o.ownerDocument;if(o.data==="$~")o._reactRetry=l;else if(o.data!=="$?"||c.readyState!=="loading")l();else{var h=function(){l(),c.removeEventListener("DOMContentLoaded",h)};c.addEventListener("DOMContentLoaded",h),o._reactRetry=h}}function Wi(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return o}var Kv=null;function _E(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var c=o.data;if(c==="/$"||c==="/&"){if(l===0)return Wi(o.nextSibling);l--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||l++}o=o.nextSibling}return null}function HE(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var c=o.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(l===0)return o;l--}else c!=="/$"&&c!=="/&"||l++}o=o.previousSibling}return null}function jE(o,l,c){switch(l=Fh(c),o){case"html":if(o=l.documentElement,!o)throw Error(r(452));return o;case"head":if(o=l.head,!o)throw Error(r(453));return o;case"body":if(o=l.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function vf(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);Sa(o)}var Ki=new Map,VE=new Set;function Uh(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Vs=q.d;q.d={f:eH,r:tH,D:nH,C:rH,L:iH,m:oH,X:lH,S:sH,M:aH};function eH(){var o=Vs.f(),l=zh();return o||l}function tH(o){var l=Bi(o);l!==null&&l.tag===5&&l.type==="form"?iR(l):Vs.r(o)}var Gu=typeof document>"u"?null:document;function FE(o,l,c){var h=Gu;if(h&&typeof l=="string"&&l){var y=lr(l);y='link[rel="'+o+'"][href="'+y+'"]',typeof c=="string"&&(y+='[crossorigin="'+c+'"]'),VE.has(y)||(VE.add(y),o={rel:o,crossOrigin:c,href:l},h.querySelector(y)===null&&(l=h.createElement("link"),kr(l,"link",o),Vn(l),h.head.appendChild(l)))}}function nH(o){Vs.D(o),FE("dns-prefetch",o,null)}function rH(o,l){Vs.C(o,l),FE("preconnect",o,l)}function iH(o,l,c){Vs.L(o,l,c);var h=Gu;if(h&&o&&l){var y='link[rel="preload"][as="'+lr(l)+'"]';l==="image"&&c&&c.imageSrcSet?(y+='[imagesrcset="'+lr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(y+='[imagesizes="'+lr(c.imageSizes)+'"]')):y+='[href="'+lr(o)+'"]';var x=y;switch(l){case"style":x=Wu(o);break;case"script":x=Ku(o)}Ki.has(x)||(o=p({rel:"preload",href:l==="image"&&c&&c.imageSrcSet?void 0:o,as:l},c),Ki.set(x,o),h.querySelector(y)!==null||l==="style"&&h.querySelector(bf(x))||l==="script"&&h.querySelector(xf(x))||(l=h.createElement("link"),kr(l,"link",o),Vn(l),h.head.appendChild(l)))}}function oH(o,l){Vs.m(o,l);var c=Gu;if(c&&o){var h=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+lr(h)+'"][href="'+lr(o)+'"]',x=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Ku(o)}if(!Ki.has(x)&&(o=p({rel:"modulepreload",href:o},l),Ki.set(x,o),c.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(xf(x)))return}h=c.createElement("link"),kr(h,"link",o),Vn(h),c.head.appendChild(h)}}}function sH(o,l,c){Vs.S(o,l,c);var h=Gu;if(h&&o){var y=ai(h).hoistableStyles,x=Wu(o);l=l||"default";var I=y.get(x);if(!I){var B={loading:0,preload:null};if(I=h.querySelector(bf(x)))B.loading=5;else{o=p({rel:"stylesheet",href:o,"data-precedence":l},c),(c=Ki.get(x))&&Yv(o,c);var K=I=h.createElement("link");Vn(K),kr(K,"link",o),K._p=new Promise(function(se,he){K.onload=se,K.onerror=he}),K.addEventListener("load",function(){B.loading|=1}),K.addEventListener("error",function(){B.loading|=2}),B.loading|=4,$h(I,l,h)}I={type:"stylesheet",instance:I,count:1,state:B},y.set(x,I)}}}function lH(o,l){Vs.X(o,l);var c=Gu;if(c&&o){var h=ai(c).hoistableScripts,y=Ku(o),x=h.get(y);x||(x=c.querySelector(xf(y)),x||(o=p({src:o,async:!0},l),(l=Ki.get(y))&&Xv(o,l),x=c.createElement("script"),Vn(x),kr(x,"link",o),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(y,x))}}function aH(o,l){Vs.M(o,l);var c=Gu;if(c&&o){var h=ai(c).hoistableScripts,y=Ku(o),x=h.get(y);x||(x=c.querySelector(xf(y)),x||(o=p({src:o,async:!0,type:"module"},l),(l=Ki.get(y))&&Xv(o,l),x=c.createElement("script"),Vn(x),kr(x,"link",o),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(y,x))}}function UE(o,l,c,h){var y=(y=ee.current)?Uh(y):null;if(!y)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(l=Wu(c.href),c=ai(y).hoistableStyles,h=c.get(l),h||(h={type:"style",instance:null,count:0,state:null},c.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){o=Wu(c.href);var x=ai(y).hoistableStyles,I=x.get(o);if(I||(y=y.ownerDocument||y,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(o,I),(x=y.querySelector(bf(o)))&&!x._p&&(I.instance=x,I.state.loading=5),Ki.has(o)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Ki.set(o,c),x||uH(y,o,c,I.state))),l&&h===null)throw Error(r(528,""));return I}if(l&&h!==null)throw Error(r(529,""));return null;case"script":return l=c.async,c=c.src,typeof c=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Ku(c),c=ai(y).hoistableScripts,h=c.get(l),h||(h={type:"script",instance:null,count:0,state:null},c.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Wu(o){return'href="'+lr(o)+'"'}function bf(o){return'link[rel="stylesheet"]['+o+"]"}function $E(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function uH(o,l,c,h){o.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=o.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),kr(l,"link",c),Vn(l),o.head.appendChild(l))}function Ku(o){return'[src="'+lr(o)+'"]'}function xf(o){return"script[async]"+o}function qE(o,l,c){if(l.count++,l.instance===null)switch(l.type){case"style":var h=o.querySelector('style[data-href~="'+lr(c.href)+'"]');if(h)return l.instance=h,Vn(h),h;var y=p({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(o.ownerDocument||o).createElement("style"),Vn(h),kr(h,"style",y),$h(h,c.precedence,o),l.instance=h;case"stylesheet":y=Wu(c.href);var x=o.querySelector(bf(y));if(x)return l.state.loading|=4,l.instance=x,Vn(x),x;h=$E(c),(y=Ki.get(y))&&Yv(h,y),x=(o.ownerDocument||o).createElement("link"),Vn(x);var I=x;return I._p=new Promise(function(B,K){I.onload=B,I.onerror=K}),kr(x,"link",h),l.state.loading|=4,$h(x,c.precedence,o),l.instance=x;case"script":return x=Ku(c.src),(y=o.querySelector(xf(x)))?(l.instance=y,Vn(y),y):(h=c,(y=Ki.get(x))&&(h=p({},c),Xv(h,y)),o=o.ownerDocument||o,y=o.createElement("script"),Vn(y),kr(y,"link",h),o.head.appendChild(y),l.instance=y);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(h=l.instance,l.state.loading|=4,$h(h,c.precedence,o));return l.instance}function $h(o,l,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,x=y,I=0;I<h.length;I++){var B=h[I];if(B.dataset.precedence===l)x=B;else if(x!==y)break}x?x.parentNode.insertBefore(o,x.nextSibling):(l=c.nodeType===9?c.head:c,l.insertBefore(o,l.firstChild))}function Yv(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function Xv(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var qh=null;function GE(o,l,c){if(qh===null){var h=new Map,y=qh=new Map;y.set(c,h)}else y=qh,h=y.get(c),h||(h=new Map,y.set(c,h));if(h.has(o))return h;for(h.set(o,null),c=c.getElementsByTagName(o),y=0;y<c.length;y++){var x=c[y];if(!(x[Ve]||x[Pt]||o==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var I=x.getAttribute(l)||"";I=o+I;var B=h.get(I);B?B.push(x):h.set(I,[x])}}return h}function WE(o,l,c){o=o.ownerDocument||o,o.head.insertBefore(c,l==="title"?o.querySelector("head > title"):null)}function cH(o,l,c){if(c===1||l.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(o=l.disabled,typeof l.precedence=="string"&&o==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function KE(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function fH(o,l,c,h){if(c.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var y=Wu(h.href),x=l.querySelector(bf(y));if(x){l=x._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=Gh.bind(o),l.then(o,o)),c.state.loading|=4,c.instance=x,Vn(x);return}x=l.ownerDocument||l,h=$E(h),(y=Ki.get(y))&&Yv(h,y),x=x.createElement("link"),Vn(x);var I=x;I._p=new Promise(function(B,K){I.onload=B,I.onerror=K}),kr(x,"link",h),c.instance=x}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(c,l),(l=c.state.preload)&&(c.state.loading&3)===0&&(o.count++,c=Gh.bind(o),l.addEventListener("load",c),l.addEventListener("error",c))}}var Qv=0;function dH(o,l){return o.stylesheets&&o.count===0&&Kh(o,o.stylesheets),0<o.count||0<o.imgCount?function(c){var h=setTimeout(function(){if(o.stylesheets&&Kh(o,o.stylesheets),o.unsuspend){var x=o.unsuspend;o.unsuspend=null,x()}},6e4+l);0<o.imgBytes&&Qv===0&&(Qv=62500*G_());var y=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Kh(o,o.stylesheets),o.unsuspend)){var x=o.unsuspend;o.unsuspend=null,x()}},(o.imgBytes>Qv?50:800)+l);return o.unsuspend=c,function(){o.unsuspend=null,clearTimeout(h),clearTimeout(y)}}:null}function Gh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kh(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Wh=null;function Kh(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Wh=new Map,l.forEach(hH,o),Wh=null,Gh.call(o))}function hH(o,l){if(!(l.state.loading&4)){var c=Wh.get(o);if(c)var h=c.get(null);else{c=new Map,Wh.set(o,c);for(var y=o.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<y.length;x++){var I=y[x];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(c.set(I.dataset.precedence,I),h=I)}h&&c.set(null,h)}y=l.instance,I=y.getAttribute("data-precedence"),x=c.get(I)||h,x===h&&c.set(null,y),c.set(I,y),this.count++,h=Gh.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),x?x.parentNode.insertBefore(y,x.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(y,o.firstChild)),l.state.loading|=4}}var Sf={$$typeof:T,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function gH(o,l,c,h,y,x,I,B,K){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Jt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jt(0),this.hiddenUpdates=Jt(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=x,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function YE(o,l,c,h,y,x,I,B,K,se,he,be){return o=new gH(o,l,c,I,K,se,he,be,B),l=1,x===!0&&(l|=24),x=Ri(3,null,null,l),o.current=x,x.stateNode=o,l=ky(),l.refCount++,o.pooledCache=l,l.refCount++,x.memoizedState={element:h,isDehydrated:c,cache:l},zy(x),o}function XE(o){return o?(o=Eu,o):Eu}function QE(o,l,c,h,y,x){y=XE(y),h.context===null?h.context=y:h.pendingContext=y,h=Al(l),h.payload={element:c},x=x===void 0?null:x,x!==null&&(h.callback=x),c=Ml(o,h,l),c!==null&&(gi(c,o,l),Zc(c,o,l))}function ZE(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var c=o.retryLane;o.retryLane=c!==0&&c<l?c:l}}function Zv(o,l){ZE(o,l),(o=o.alternate)&&ZE(o,l)}function JE(o){if(o.tag===13||o.tag===31){var l=Ma(o,67108864);l!==null&&gi(l,o,67108864),Zv(o,67108864)}}function eT(o){if(o.tag===13||o.tag===31){var l=Oi();l=Ut(l);var c=Ma(o,l);c!==null&&gi(c,o,l),Zv(o,l)}}var Yh=!0;function pH(o,l,c,h){var y=j.T;j.T=null;var x=q.p;try{q.p=2,Jv(o,l,c,h)}finally{q.p=x,j.T=y}}function mH(o,l,c,h){var y=j.T;j.T=null;var x=q.p;try{q.p=8,Jv(o,l,c,h)}finally{q.p=x,j.T=y}}function Jv(o,l,c,h){if(Yh){var y=e0(h);if(y===null)Hv(o,l,h,Xh,c),nT(o,h);else if(vH(y,o,l,c,h))h.stopPropagation();else if(nT(o,h),l&4&&-1<yH.indexOf(o)){for(;y!==null;){var x=Bi(y);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var I=yt(x.pendingLanes);if(I!==0){var B=x;for(B.pendingLanes|=2,B.entangledLanes|=2;I;){var K=1<<31-ut(I);B.entanglements[1]|=K,I&=~K}Yo(x),(tn&6)===0&&(Dh=ne()+500,pf(0))}}break;case 31:case 13:B=Ma(x,2),B!==null&&gi(B,x,2),zh(),Zv(x,2)}if(x=e0(h),x===null&&Hv(o,l,h,Xh,c),x===y)break;y=x}y!==null&&h.stopPropagation()}else Hv(o,l,h,null,c)}}function e0(o){return o=vl(o),t0(o)}var Xh=null;function t0(o){if(Xh=null,o=Zn(o),o!==null){var l=s(o);if(l===null)o=null;else{var c=l.tag;if(c===13){if(o=a(l),o!==null)return o;o=null}else if(c===31){if(o=u(l),o!==null)return o;o=null}else if(c===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null)}}return Xh=o,null}function tT(o){switch(o){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Q()){case Se:return 2;case ge:return 8;case Ie:case Je:return 32;case nt:return 268435456;default:return 32}default:return 32}}var n0=!1,Hl=null,jl=null,Vl=null,wf=new Map,Cf=new Map,Fl=[],yH="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".split(" ");function nT(o,l){switch(o){case"focusin":case"focusout":Hl=null;break;case"dragenter":case"dragleave":jl=null;break;case"mouseover":case"mouseout":Vl=null;break;case"pointerover":case"pointerout":wf.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cf.delete(l.pointerId)}}function Rf(o,l,c,h,y,x){return o===null||o.nativeEvent!==x?(o={blockedOn:l,domEventName:c,eventSystemFlags:h,nativeEvent:x,targetContainers:[y]},l!==null&&(l=Bi(l),l!==null&&JE(l)),o):(o.eventSystemFlags|=h,l=o.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),o)}function vH(o,l,c,h,y){switch(l){case"focusin":return Hl=Rf(Hl,o,l,c,h,y),!0;case"dragenter":return jl=Rf(jl,o,l,c,h,y),!0;case"mouseover":return Vl=Rf(Vl,o,l,c,h,y),!0;case"pointerover":var x=y.pointerId;return wf.set(x,Rf(wf.get(x)||null,o,l,c,h,y)),!0;case"gotpointercapture":return x=y.pointerId,Cf.set(x,Rf(Cf.get(x)||null,o,l,c,h,y)),!0}return!1}function rT(o){var l=Zn(o.target);if(l!==null){var c=s(l);if(c!==null){if(l=c.tag,l===13){if(l=a(c),l!==null){o.blockedOn=l,wr(o.priority,function(){eT(c)});return}}else if(l===31){if(l=u(c),l!==null){o.blockedOn=l,wr(o.priority,function(){eT(c)});return}}else if(l===3&&c.stateNode.current.memoizedState.isDehydrated){o.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Qh(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var c=e0(o.nativeEvent);if(c===null){c=o.nativeEvent;var h=new c.constructor(c.type,c);yl=h,c.target.dispatchEvent(h),yl=null}else return l=Bi(c),l!==null&&JE(l),o.blockedOn=c,!1;l.shift()}return!0}function iT(o,l,c){Qh(o)&&c.delete(l)}function bH(){n0=!1,Hl!==null&&Qh(Hl)&&(Hl=null),jl!==null&&Qh(jl)&&(jl=null),Vl!==null&&Qh(Vl)&&(Vl=null),wf.forEach(iT),Cf.forEach(iT)}function Zh(o,l){o.blockedOn===l&&(o.blockedOn=null,n0||(n0=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,bH)))}var Jh=null;function oT(o){Jh!==o&&(Jh=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Jh===o&&(Jh=null);for(var l=0;l<o.length;l+=3){var c=o[l],h=o[l+1],y=o[l+2];if(typeof h!="function"){if(t0(h||c)===null)continue;break}var x=Bi(c);x!==null&&(o.splice(l,3),l-=3,ev(x,{pending:!0,data:y,method:c.method,action:h},h,y))}}))}function Yu(o){function l(K){return Zh(K,o)}Hl!==null&&Zh(Hl,o),jl!==null&&Zh(jl,o),Vl!==null&&Zh(Vl,o),wf.forEach(l),Cf.forEach(l);for(var c=0;c<Fl.length;c++){var h=Fl[c];h.blockedOn===o&&(h.blockedOn=null)}for(;0<Fl.length&&(c=Fl[0],c.blockedOn===null);)rT(c),c.blockedOn===null&&Fl.shift();if(c=(o.ownerDocument||o).$$reactFormReplay,c!=null)for(h=0;h<c.length;h+=3){var y=c[h],x=c[h+1],I=y[zt]||null;if(typeof x=="function")I||oT(c);else if(I){var B=null;if(x&&x.hasAttribute("formAction")){if(y=x,I=x[zt]||null)B=I.formAction;else if(t0(y)!==null)continue}else B=I.action;typeof B=="function"?c[h+1]=B:(c.splice(h,3),h-=3),oT(c)}}}function sT(){function o(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(I){return y=I})},focusReset:"manual",scroll:"manual"})}function l(){y!==null&&(y(),y=null),h||setTimeout(c,20)}function c(){if(!h&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,y=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(c,100),function(){h=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),y!==null&&(y(),y=null)}}}function r0(o){this._internalRoot=o}eg.prototype.render=r0.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var c=l.current,h=Oi();QE(c,h,o,l,null,null)},eg.prototype.unmount=r0.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;QE(o.current,2,null,o,null,null),zh(),l[et]=null}};function eg(o){this._internalRoot=o}eg.prototype.unstable_scheduleHydration=function(o){if(o){var l=Ln();o={blockedOn:null,target:o,priority:l};for(var c=0;c<Fl.length&&l!==0&&l<Fl[c].priority;c++);Fl.splice(c,0,o),c===0&&rT(o)}};var lT=e.version;if(lT!=="19.2.3")throw Error(r(527,lT,"19.2.3"));q.findDOMNode=function(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=d(l),o=o!==null?g(o):null,o=o===null?null:o.stateNode,o};var xH={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tg.isDisabled&&tg.supportsFiber)try{ht=tg.inject(xH),wt=tg}catch{}}return Tf.createRoot=function(o,l){if(!i(o))throw Error(r(299));var c=!1,h="",y=gR,x=pR,I=mR;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(x=l.onCaughtError),l.onRecoverableError!==void 0&&(I=l.onRecoverableError)),l=YE(o,1,!1,null,null,c,h,null,y,x,I,sT),o[et]=l.current,_v(o),new r0(l)},Tf.hydrateRoot=function(o,l,c){if(!i(o))throw Error(r(299));var h=!1,y="",x=gR,I=pR,B=mR,K=null;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(x=c.onUncaughtError),c.onCaughtError!==void 0&&(I=c.onCaughtError),c.onRecoverableError!==void 0&&(B=c.onRecoverableError),c.formState!==void 0&&(K=c.formState)),l=YE(o,1,!0,l,c??null,h,y,K,x,I,B,sT),l.context=XE(null),c=l.current,h=Oi(),h=Ut(h),y=Al(h),y.callback=null,Ml(c,y,h),c=h,l.current.lanes=c,Rn(l,c),Yo(l),o[et]=l.current,_v(o),new eg(l)},Tf.version="19.2.3",Tf}var qT;function c3(){if(qT)return y0.exports;qT=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),y0.exports=u3(),y0.exports}var nI=c3();function f3(t,e){return DS(e),nI.hydrateRoot(e,t)}function d3(t,e){DS(e);var n=nI.createRoot(e);return n.render(t),n}function h3(t){return t.unmount(),!0}var Kb=t=>{if(t!=null){var e=t.nodeType===1;if(e&&typeof t.getBoundingClientRect=="function")return t.getBoundingClientRect()}},Gf={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},g3=["ms","Moz","O","Webkit"],p3=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1);Object.keys(Gf).forEach(t=>{g3.forEach(e=>{Gf[p3(e,t)]=Gf[t]})});function m3(t,e,n){var r=e==null||typeof e=="boolean"||e==="";return r?"":!n&&typeof e=="number"&&e!==0&&!(Gf.hasOwnProperty(t)&&Gf[t])?e+"px":(""+e).trim()}function y3(t,e){var n=t.style;for(var r in e)if(e.hasOwnProperty(r)){var i=r.indexOf("--")===0,s=m3(r,e[r],i);r==="float"&&(r="cssFloat"),i?n.setProperty(r,s):n[r]=s}}var GT=t=>{var e=t.offsetHeight,n=t.offsetWidth,r=t.offsetLeft,i=t.offsetTop;for(t=t.offsetParent;t&&t.nodeType===1;)r+=t.offsetLeft+t.clientLeft-t.scrollLeft,i+=t.offsetTop+t.clientTop-t.scrollTop,t=t.offsetParent;return i-=window.scrollY,r-=window.scrollX,{width:n,height:e,top:i,left:r}},WT=(t,e,n)=>{var r=e||t&&t.parentNode;t&&r&&setTimeout(()=>{if(t.isConnected&&r.isConnected){var i=GT(r),s=GT(t),a=s.height,u=s.left,f=s.top,d=s.width,g=u-i.left,p=f-i.top;n(g,p,d,a,u,f)}},0)},v3={A:!0,BODY:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0},sp={blur(t){try{t.blur()}catch{}},focus(t){try{var e=t.nodeName;t.getAttribute("tabIndex")==null&&t.isContentEditable!==!0&&v3[e]==null&&t.setAttribute("tabIndex","-1"),t.focus()}catch{}},measure(t,e){WT(t,null,e)},measureInWindow(t,e){t&&setTimeout(()=>{var n=Kb(t),r=n.height,i=n.left,s=n.top,a=n.width;e(i,s,a,r)},0)},measureLayout(t,e,n,r){WT(t,e,r)},updateView(t,e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];switch(n){case"style":{y3(t,r);break}case"class":case"className":{t.setAttribute("class",r);break}case"text":case"value":t.value=r;break;default:t.setAttribute(n,r)}}},configureNextLayoutAnimation(t,e){e()},setLayoutAnimationEnabledExperimental(){}};function Yb(){return Yb=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Yb.apply(null,arguments)}var b3={children:!0,dataSet:!0,dir:!0,id:!0,ref:!0,suppressHydrationWarning:!0,tabIndex:!0,testID:!0,focusable:!0,nativeID:!0},x3={"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,inert:!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},S3={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},w3={onBlur:!0,onFocus:!0},C3={onKeyDown:!0,onKeyDownCapture:!0,onKeyUp:!0,onKeyUpCapture:!0},R3={onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOver:!0,onMouseOut:!0,onMouseUp:!0},E3={onTouchCancel:!0,onTouchCancelCapture:!0,onTouchEnd:!0,onTouchEndCapture:!0,onTouchMove:!0,onTouchMoveCapture:!0,onTouchStart:!0,onTouchStartCapture:!0},T3={style:!0};function A3(t,e){var n={};for(var r in t)t.hasOwnProperty(r)&&e[r]===!0&&(n[r]=t[r]);return n}var KT=hu?E.useLayoutEffect:E.useEffect,Xb="__reactLayoutHandler",S0=null;function M3(){return hu&&typeof window.ResizeObserver<"u"&&S0==null&&(S0=new window.ResizeObserver(function(t){t.forEach(e=>{var n=e.target,r=n[Xb];typeof r=="function"&&sp.measure(n,(i,s,a,u,f,d)=>{var g={nativeEvent:{layout:{x:i,y:s,width:a,height:u,left:f,top:d}},timeStamp:Date.now()};Object.defineProperty(g.nativeEvent,"target",{enumerable:!0,get:()=>e.target}),r(g)})})})),S0}function O3(t,e){var n=M3();KT(()=>{var r=t.current;r!=null&&(r[Xb]=e)},[t,e]),KT(()=>{var r=t.current;return r!=null&&n!=null&&(typeof r[Xb]=="function"?n.observe(r):n.unobserve(r)),()=>{r!=null&&n!=null&&n.unobserve(r)}},[t,n])}function k3(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(i){e.forEach(s=>{if(s!=null){if(typeof s=="function"){s(i);return}if(typeof s=="object"){s.current=i;return}console.error("mergeRefs cannot handle Refs of type boolean, number or string, received ref "+String(s))}})}}function I3(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return E.useMemo(()=>k3(...e),[...e])}var YT=typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():Object.freeze({});function D3(t){var e=E.useRef(YT);return e.current===YT&&(e.current=t()),e.current}function P3(t){t.pointerEvents,t.style;var e=D3(()=>n=>{n!=null&&(n.measure=r=>sp.measure(n,r),n.measureLayout=(r,i,s)=>sp.measureLayout(n,r,s,i),n.measureInWindow=r=>sp.measureInWindow(n,r))});return e}var XT=()=>{},z3={},N3=[];function QT(t){return t>20?t%20:t}function rI(t,e){var n,r=!1,i,s,a=t.changedTouches,u=t.type,f=t.metaKey===!0,d=t.shiftKey===!0,g=a&&a[0].force||0,p=QT(a&&a[0].identifier||0),m=a&&a[0].clientX||t.clientX,v=a&&a[0].clientY||t.clientY,b=a&&a[0].pageX||t.pageX,S=a&&a[0].pageY||t.pageY,w=typeof t.preventDefault=="function"?t.preventDefault.bind(t):XT,C=t.timeStamp;function R(M){return Array.prototype.slice.call(M).map(D=>({force:D.force,identifier:QT(D.identifier),get locationX(){return k(D.clientX)},get locationY(){return P(D.clientY)},pageX:D.pageX,pageY:D.pageY,target:D.target,timestamp:C}))}if(a!=null)i=R(a),s=R(t.touches);else{var T=[{force:g,identifier:p,get locationX(){return k(m)},get locationY(){return P(v)},pageX:b,pageY:S,target:t.target,timestamp:C}];i=T,s=u==="mouseup"||u==="dragstart"?N3:T}var A={bubbles:!0,cancelable:!0,currentTarget:null,defaultPrevented:t.defaultPrevented,dispatchConfig:z3,eventPhase:t.eventPhase,isDefaultPrevented(){return t.defaultPrevented},isPropagationStopped(){return r},isTrusted:t.isTrusted,nativeEvent:{altKey:!1,ctrlKey:!1,metaKey:f,shiftKey:d,changedTouches:i,force:g,identifier:p,get locationX(){return k(m)},get locationY(){return P(v)},pageX:b,pageY:S,target:t.target,timestamp:C,touches:s,type:u},persist:XT,preventDefault:w,stopPropagation(){r=!0},target:t.target,timeStamp:C,touchHistory:e.touchHistory};function k(M){if(n=n||Kb(A.currentTarget),n)return M-n.left}function P(M){if(n=n||Kb(A.currentTarget),n)return M-n.top}return A}var L3="mousedown",B3="mousemove",_3="mouseup",H3="dragstart",j3="touchstart",V3="touchmove",F3="touchend",U3="touchcancel",$3="scroll",q3="select",G3="selectionchange";function iI(t){return t===j3||t===L3}function oI(t){return t===V3||t===B3}function sI(t){return t===F3||t===_3||lI(t)}function lI(t){return t===U3||t===H3}function W3(t){return t===$3}function K3(t){return t===q3||t===G3}function Y3(){var t=window.getSelection(),e=t.toString(),n=t.anchorNode,r=t.focusNode,i=n&&n.nodeType===window.Node.TEXT_NODE||r&&r.nodeType===window.Node.TEXT_NODE;return e.length>=1&&e!==`
|
|
13
|
-
`&&i}var aI="__reactResponderId";function X3(t){if(t.type==="selectionchange"){var e=window.getSelection().anchorNode;return ZT(e)}else{var n=t.composedPath!=null?t.composedPath():ZT(t.target);return n}}function ZT(t){for(var e=[];t!=null&&t!==document.body;)e.push(t),t=t.parentNode;return e}function Q3(t){return t!=null?t[aI]:null}function Z3(t,e){t!=null&&(t[aI]=e)}function J3(t){for(var e=[],n=[],r=X3(t),i=0;i<r.length;i++){var s=r[i],a=Q3(s);a!=null&&(e.push(a),n.push(s))}return{idPath:e,nodePath:n}}function eF(t,e){var n=t.length,r=e.length;if(n===0||r===0||t[n-1]!==e[r-1])return null;var i=t[0],s=0,a=e[0],u=0;n-r>0&&(s=n-r,i=t[s],n=r),r-n>0&&(u=r-n,a=e[u],r=n);for(var f=n;f--;){if(i===a)return i;i=t[s++],a=e[u++]}return null}function tF(t,e){if(!e||e.length===0)return!1;for(var n=0;n<e.length;n++){var r=e[n].target;if(r!=null&&t.contains(r))return!0}return!1}function nF(t){return t.type==="selectionchange"?Y3():t.type==="select"}function rF(t){var e=t.altKey,n=t.button,r=t.buttons,i=t.ctrlKey,s=t.type,a=s==="touchstart"||s==="touchmove",u=s==="mousedown"&&(n===0||r===1),f=s==="mousemove"&&r===1,d=e===!1&&i===!1;return!!(a||u&&d||f&&d)}var JT=20;function oo(t){return t.timeStamp||t.timestamp}function iF(t){return{touchActive:!0,startPageX:t.pageX,startPageY:t.pageY,startTimeStamp:oo(t),currentPageX:t.pageX,currentPageY:t.pageY,currentTimeStamp:oo(t),previousPageX:t.pageX,previousPageY:t.pageY,previousTimeStamp:oo(t)}}function oF(t,e){t.touchActive=!0,t.startPageX=e.pageX,t.startPageY=e.pageY,t.startTimeStamp=oo(e),t.currentPageX=e.pageX,t.currentPageY=e.pageY,t.currentTimeStamp=oo(e),t.previousPageX=e.pageX,t.previousPageY=e.pageY,t.previousTimeStamp=oo(e)}function PS(t){var e=t.identifier;return e==null&&console.error("Touch object is missing identifier."),e}function sF(t,e){var n=PS(t),r=e.touchBank[n];r?oF(r,t):e.touchBank[n]=iF(t),e.mostRecentTimeStamp=oo(t)}function lF(t,e){var n=e.touchBank[PS(t)];n?(n.touchActive=!0,n.previousPageX=n.currentPageX,n.previousPageY=n.currentPageY,n.previousTimeStamp=n.currentTimeStamp,n.currentPageX=t.pageX,n.currentPageY=t.pageY,n.currentTimeStamp=oo(t),e.mostRecentTimeStamp=oo(t)):console.warn(`Cannot record touch move without a touch start.
|
|
14
|
-
`,"Touch Move: "+uI(t)+`
|
|
15
|
-
`,"Touch Bank: "+cI(e))}function aF(t,e){var n=e.touchBank[PS(t)];n?(n.touchActive=!1,n.previousPageX=n.currentPageX,n.previousPageY=n.currentPageY,n.previousTimeStamp=n.currentTimeStamp,n.currentPageX=t.pageX,n.currentPageY=t.pageY,n.currentTimeStamp=oo(t),e.mostRecentTimeStamp=oo(t)):console.warn(`Cannot record touch end without a touch start.
|
|
16
|
-
`,"Touch End: "+uI(t)+`
|
|
17
|
-
`,"Touch Bank: "+cI(e))}function uI(t){return JSON.stringify({identifier:t.identifier,pageX:t.pageX,pageY:t.pageY,timestamp:oo(t)})}function cI(t){var e=t.touchBank,n=JSON.stringify(e.slice(0,JT));return e.length>JT&&(n+=" (original size: "+e.length+")"),n}class uF{constructor(){this._touchHistory={touchBank:[],numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0}}recordTouchTrack(e,n){var r=this._touchHistory;if(oI(e))n.changedTouches.forEach(u=>lF(u,r));else if(iI(e))n.changedTouches.forEach(u=>sF(u,r)),r.numberActiveTouches=n.touches.length,r.numberActiveTouches===1&&(r.indexOfSingleActiveTouch=n.touches[0].identifier);else if(sI(e)&&(n.changedTouches.forEach(u=>aF(u,r)),r.numberActiveTouches=n.touches.length,r.numberActiveTouches===1))for(var i=r.touchBank,s=0;s<i.length;s++){var a=i[s];if(a!=null&&a.touchActive){r.indexOfSingleActiveTouch=s;break}}}get touchHistory(){return this._touchHistory}}var cF={},eA=["onStartShouldSetResponderCapture","onStartShouldSetResponder",{bubbles:!0}],tA=["onMoveShouldSetResponderCapture","onMoveShouldSetResponder",{bubbles:!0}],fF=["onScrollShouldSetResponderCapture","onScrollShouldSetResponder",{bubbles:!1}],dF={touchstart:eA,mousedown:eA,touchmove:tA,mousemove:tA,scroll:fF},Qb={id:null,idPath:null,node:null},Rp=new Map,ql=!1,Jo=0,ss={id:null,node:null,idPath:null},Zb=new uF;function ud(t){ss=t}function cd(t){var e=Rp.get(t);return e??cF}function w0(t){var e=t.type,n=t.target;if(e==="touchstart"&&(ql=!0),(e==="touchmove"||Jo>1)&&(ql=!1),!(e==="mousedown"&&ql||e==="mousemove"&&ql||e==="mousemove"&&Jo<1)){if(ql&&e==="mouseup"){Jo===0&&(ql=!1);return}var r=iI(e)&&rF(t),i=oI(e),s=sI(e),a=W3(e),u=K3(e),f=rI(t,Zb);(r||i||s)&&(t.touches?Jo=t.touches.length:r?Jo=1:s&&(Jo=0),Zb.recordTouchTrack(e,f.nativeEvent));var d=J3(t),g=!1,p;if(r||i||a&&Jo>0){var m=ss.idPath,v=d.idPath;if(m!=null&&v!=null){var b=eF(m,v);if(b!=null){var S=v.indexOf(b),w=S+(b===ss.id?1:0);d={idPath:v.slice(w),nodePath:d.nodePath.slice(w)}}else d=null}d!=null&&(p=hF(d,t,f),p!=null&&(gF(f,p),g=!0))}if(ss.id!=null&&ss.node!=null){var C=ss,R=C.id,T=C.node,A=cd(R),k=A.onResponderStart,P=A.onResponderMove,M=A.onResponderEnd,D=A.onResponderRelease,L=A.onResponderTerminate,H=A.onResponderTerminationRequest;if(f.bubbles=!1,f.cancelable=!1,f.currentTarget=T,r)k!=null&&(f.dispatchConfig.registrationName="onResponderStart",k(f));else if(i)P!=null&&(f.dispatchConfig.registrationName="onResponderMove",P(f));else{var N=lI(e)||e==="contextmenu"||e==="blur"&&n===window||e==="blur"&&n.contains(T)&&t.relatedTarget!==T||a&&Jo===0||a&&n.contains(T)&&n!==T||u&&nF(t),_=s&&!N&&!tF(T,t.touches);if(s&&M!=null&&(f.dispatchConfig.registrationName="onResponderEnd",M(f)),_&&(D!=null&&(f.dispatchConfig.registrationName="onResponderRelease",D(f)),ud(Qb)),N){var $=!0;(e==="contextmenu"||e==="scroll"||e==="selectionchange")&&(g?$=!1:H!=null&&(f.dispatchConfig.registrationName="onResponderTerminationRequest",H(f)===!1&&($=!1))),$&&(L!=null&&(f.dispatchConfig.registrationName="onResponderTerminate",L(f)),ud(Qb),ql=!1,Jo=0)}}}}}function hF(t,e,n){var r=dF[e.type];if(r!=null){for(var i=t.idPath,s=t.nodePath,a=r[0],u=r[1],f=r[2].bubbles,d=function(P,M,D){var L=cd(P),H=L[D];if(H!=null&&(n.currentTarget=M,H(n)===!0)){var N=i.slice(i.indexOf(P));return{id:P,node:M,idPath:N}}},g=i.length-1;g>=0;g--){var p=i[g],m=s[g],v=d(p,m,a);if(v!=null)return v;if(n.isPropagationStopped()===!0)return}if(f)for(var b=0;b<i.length;b++){var S=i[b],w=s[b],C=d(S,w,u);if(C!=null)return C;if(n.isPropagationStopped()===!0)return}else{var R=i[0],T=s[0],A=e.target;if(A===T)return d(R,T,u)}}}function gF(t,e){var n=ss,r=n.id,i=n.node,s=e.id,a=e.node,u=cd(s),f=u.onResponderGrant,d=u.onResponderReject;if(t.bubbles=!1,t.cancelable=!1,t.currentTarget=a,r==null)f!=null&&(t.currentTarget=a,t.dispatchConfig.registrationName="onResponderGrant",f(t)),ud(e);else{var g=cd(r),p=g.onResponderTerminate,m=g.onResponderTerminationRequest,v=!0;m!=null&&(t.currentTarget=i,t.dispatchConfig.registrationName="onResponderTerminationRequest",m(t)===!1&&(v=!1)),v?(p!=null&&(t.currentTarget=i,t.dispatchConfig.registrationName="onResponderTerminate",p(t)),f!=null&&(t.currentTarget=a,t.dispatchConfig.registrationName="onResponderGrant",f(t)),ud(e)):d!=null&&(t.currentTarget=a,t.dispatchConfig.registrationName="onResponderReject",d(t))}}var pF=["blur","scroll"],mF=["mousedown","mousemove","mouseup","dragstart","touchstart","touchmove","touchend","touchcancel","contextmenu","select","selectionchange"];function yF(){hu&&window.__reactResponderSystemActive==null&&(window.addEventListener("blur",w0),mF.forEach(t=>{document.addEventListener(t,w0)}),pF.forEach(t=>{document.addEventListener(t,w0,!0)}),window.__reactResponderSystemActive=!0)}function vF(t,e,n){Z3(e,t),Rp.set(t,n)}function nA(t){ss.id===t&&bF(),Rp.has(t)&&Rp.delete(t)}function bF(){var t=ss,e=t.id,n=t.node;if(e!=null&&n!=null){var r=cd(e),i=r.onResponderTerminate;if(i!=null){var s=rI({},Zb);s.currentTarget=n,i(s)}ud(Qb)}ql=!1,Jo=0}function xF(){return ss.node}var SF={},wF=0;function CF(t){var e=E.useRef(null);return e.current==null&&(e.current=t()),e.current}function RF(t,e){e===void 0&&(e=SF);var n=CF(()=>wF++),r=E.useRef(!1);E.useEffect(()=>(yF(),()=>{nA(n)}),[n]),E.useEffect(()=>{var i=e,s=i.onMoveShouldSetResponder,a=i.onMoveShouldSetResponderCapture,u=i.onScrollShouldSetResponder,f=i.onScrollShouldSetResponderCapture,d=i.onSelectionChangeShouldSetResponder,g=i.onSelectionChangeShouldSetResponderCapture,p=i.onStartShouldSetResponder,m=i.onStartShouldSetResponderCapture,v=s!=null||a!=null||u!=null||f!=null||d!=null||g!=null||p!=null||m!=null,b=t.current;v?(vF(n,b,e),r.current=!0):r.current&&(nA(n),r.current=!1)},[e,t,n]),E.useDebugValue({isResponder:t.current===xF()}),E.useDebugValue(e)}var EF=E.createContext(!1),TF=["hrefAttrs","onLayout","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStartShouldSetResponder","onStartShouldSetResponderCapture"],AF=Object.assign({},b3,x3,S3,w3,C3,R3,E3,T3,{href:!0,lang:!0,onScroll:!0,onWheel:!0,pointerEvents:!0}),MF=t=>A3(t,AF),Jb=E.forwardRef((t,e)=>{var n=t.hrefAttrs,r=t.onLayout,i=t.onMoveShouldSetResponder,s=t.onMoveShouldSetResponderCapture,a=t.onResponderEnd,u=t.onResponderGrant,f=t.onResponderMove,d=t.onResponderReject,g=t.onResponderRelease,p=t.onResponderStart,m=t.onResponderTerminate,v=t.onResponderTerminationRequest,b=t.onScrollShouldSetResponder,S=t.onScrollShouldSetResponderCapture,w=t.onSelectionChangeShouldSetResponder,C=t.onSelectionChangeShouldSetResponderCapture,R=t.onStartShouldSetResponder,T=t.onStartShouldSetResponderCapture,A=um(t,TF),k=E.useContext(EF),P=E.useRef(null),M=i3(),D=M.direction;O3(P,r),RF(P,{onMoveShouldSetResponder:i,onMoveShouldSetResponderCapture:s,onResponderEnd:a,onResponderGrant:u,onResponderMove:f,onResponderReject:d,onResponderRelease:g,onResponderStart:p,onResponderTerminate:m,onResponderTerminationRequest:v,onScrollShouldSetResponder:b,onScrollShouldSetResponderCapture:S,onSelectionChangeShouldSetResponder:w,onSelectionChangeShouldSetResponderCapture:C,onStartShouldSetResponder:R,onStartShouldSetResponderCapture:T});var L="div",H=t.lang!=null?eI(t.lang):null,N=t.dir||H,_=N||D,$=MF(A);if($.dir=N,$.style=[rA.view$raw,k&&rA.inline,t.style],t.href!=null&&(L="a",n!=null)){var F=n.download,G=n.rel,j=n.target;F!=null&&($.download=F),G!=null&&($.rel=G),typeof j=="string"&&($.target=j.charAt(0)!=="_"?"_"+j:j)}var q=P3($),V=I3(P,q,e);return $.ref=V,o3(L,$,{writingDirection:_})});Jb.displayName="View";var rA=zd.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"}}),C0,iA;function OF(){if(iA)return C0;iA=1;function t(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];if(!e){var a;if(n===void 0)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=0;a=new Error(n.replace(/%s/g,function(){return String(i[u++])})),a.name="Invariant Violation"}throw a.framesToPop=1,a}}return C0=t,C0}var kF=OF();const lp=_o(kF);var IF=E.createContext(null),zS=E.forwardRef((t,e)=>{var n=t.children,r=t.WrapperComponent,i=E.createElement(Jb,{children:n,key:1,style:oA.appContainer});return r&&(i=E.createElement(r,null,i)),E.createElement(IF.Provider,{value:t.rootTag},E.createElement(Jb,{ref:e,style:oA.appContainer},i))});zS.displayName="AppContainer";var oA=zd.create({appContainer:{flex:1,pointerEvents:"box-none"}});function DF(t,e,n,r){var i=r.hydrate,s=r.initialProps,a=r.rootTag,u=i?f3:d3;return lp(a,"Expect to have a valid rootTag, instead got ",a),u(Ne.createElement(zS,{WrapperComponent:e,ref:n,rootTag:a},Ne.createElement(t,s)),a)}function PF(t,e,n){var r=Ne.createElement(zS,{WrapperComponent:n,rootTag:{}},Ne.createElement(t,e)),i=s=>{var a=zd.getSheet();return Ne.createElement("style",Yb({},s,{dangerouslySetInnerHTML:{__html:a.textContent},id:a.id}))};return{element:r,getStyleElement:i}}var sA={},Fs={},R0=t=>t(),Af;class fd{static getAppKeys(){return Object.keys(Fs)}static getApplication(e,n){return lp(Fs[e]&&Fs[e].getApplication,"Application "+e+" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent."),Fs[e].getApplication(n)}static registerComponent(e,n){return Fs[e]={getApplication:r=>PF(R0(n),r?r.initialProps:sA,Af&&Af(r)),run:r=>DF(R0(n),Af&&Af(r),r.callback,{hydrate:r.hydrate||!1,initialProps:r.initialProps||sA,mode:r.mode||"concurrent",rootTag:r.rootTag})},e}static registerConfig(e){e.forEach(n=>{var r=n.appKey,i=n.component,s=n.run;s?fd.registerRunnable(r,s):(lp(i,"No component provider passed in"),fd.registerComponent(r,i))})}static registerRunnable(e,n){return Fs[e]={run:n},e}static runApplication(e,n){return lp(Fs[e]&&Fs[e].run,'Application "'+e+'" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.'),Fs[e].run(n)}static setComponentProviderInstrumentationHook(e){R0=e}static setWrapperComponentProvider(e){Af=e}static unmountApplicationComponentAtRootTag(e){h3(e)}}var il=tI();const zF=_o(il);var E0={exports:{}},Mf={};var lA;function NF(){if(lA)return Mf;lA=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var a=null;if(s!==void 0&&(a=""+s),i.key!==void 0&&(a=""+i.key),"key"in i){s={};for(var u in i)u!=="key"&&(s[u]=i[u])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:a,ref:i!==void 0?i:null,props:s}}return Mf.Fragment=e,Mf.jsx=n,Mf.jsxs=n,Mf}var aA;function LF(){return aA||(aA=1,E0.exports=NF()),E0.exports}var O=LF(),Ld=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ru=typeof window>"u"||"Deno"in globalThis;function pi(){}function BF(t,e){return typeof t=="function"?t(e):t}function ex(t){return typeof t=="number"&&t>=0&&t!==1/0}function fI(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Jl(t,e){return typeof t=="function"?t(e):t}function Qi(t,e){return typeof t=="function"?t(e):t}function uA(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==NS(a,e.options))return!1}else if(!hd(e.queryKey,a))return!1}if(n!=="all"){const f=e.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||i&&i!==e.state.fetchStatus||s&&!s(e))}function cA(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(dd(e.options.mutationKey)!==dd(s))return!1}else if(!hd(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function NS(t,e){return(e?.queryKeyHashFn||dd)(t)}function dd(t){return JSON.stringify(t,(e,n)=>nx(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function hd(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>hd(t[n],e[n])):!1}function dI(t,e){if(t===e)return t;const n=fA(t)&&fA(e);if(n||nx(t)&&nx(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),a=s.length,u=n?[]:{},f=new Set(r);let d=0;for(let g=0;g<a;g++){const p=n?g:s[g];(!n&&f.has(p)||n)&&t[p]===void 0&&e[p]===void 0?(u[p]=void 0,d++):(u[p]=dI(t[p],e[p]),u[p]===t[p]&&t[p]!==void 0&&d++)}return i===a&&d===i?t:u}return e}function tx(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function fA(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function nx(t){if(!dA(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!dA(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function dA(t){return Object.prototype.toString.call(t)==="[object Object]"}function _F(t){return new Promise(e=>{setTimeout(e,t)})}function rx(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?dI(t,e):e}function HF(t){return t}function jF(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function VF(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var LS=Symbol();function hI(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===LS?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function FF(t,e){return typeof t=="function"?t(...e):!!t}var UF=class extends Ld{#e;#t;#n;constructor(){super(),this.#n=t=>{if(!ru&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},BS=new UF,$F=class extends Ld{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(!ru&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#e}},Ep=new $F;function ix(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function qF(t){return Math.min(1e3*2**t,3e4)}function gI(t){return(t??"online")==="online"?Ep.isOnline():!0}var pI=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function T0(t){return t instanceof pI}function mI(t){let e=!1,n=0,r=!1,i;const s=ix(),a=S=>{r||(m(new pI(S)),t.abort?.())},u=()=>{e=!0},f=()=>{e=!1},d=()=>BS.isFocused()&&(t.networkMode==="always"||Ep.isOnline())&&t.canRun(),g=()=>gI(t.networkMode)&&t.canRun(),p=S=>{r||(r=!0,t.onSuccess?.(S),i?.(),s.resolve(S))},m=S=>{r||(r=!0,t.onError?.(S),i?.(),s.reject(S))},v=()=>new Promise(S=>{i=w=>{(r||d())&&S(w)},t.onPause?.()}).then(()=>{i=void 0,r||t.onContinue?.()}),b=()=>{if(r)return;let S;const w=n===0?t.initialPromise:void 0;try{S=w??t.fn()}catch(C){S=Promise.reject(C)}Promise.resolve(S).then(p).catch(C=>{if(r)return;const R=t.retry??(ru?0:3),T=t.retryDelay??qF,A=typeof T=="function"?T(n,C):T,k=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,C);if(e||!k){m(C);return}n++,t.onFail?.(n,C),_F(A).then(()=>d()?void 0:v()).then(()=>{e?m(C):b()})})};return{promise:s,cancel:a,continue:()=>(i?.(),s),cancelRetry:u,continueRetry:f,canStart:g,start:()=>(g()?b():v().then(b),s)}}var GF=t=>setTimeout(t,0);function WF(){let t=[],e=0,n=u=>{u()},r=u=>{u()},i=GF;const s=u=>{e?t.push(u):i(()=>{n(u)})},a=()=>{const u=t;t=[],u.length&&i(()=>{r(()=>{u.forEach(f=>{n(f)})})})};return{batch:u=>{let f;e++;try{f=u()}finally{e--,e||a()}return f},batchCalls:u=>(...f)=>{s(()=>{u(...f)})},schedule:s,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var Pr=WF(),yI=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ex(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(ru?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},KF=class extends yI{#e;#t;#n;#r;#i;#l;#s;constructor(t){super(),this.#s=!1,this.#l=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#n=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=YF(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(t){this.options={...this.#l,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(t,e){const n=rx(this.state.data,t,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t,e){this.#o({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#i?.promise;return this.#i?.cancel(t),e?e.then(pi).catch(pi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>Qi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===LS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Jl(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!fI(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#i&&(this.#s?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}fetch(t,e){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(d=>d.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,r=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{const f=hI(this.options,e),g=(()=>{const p={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#s=!1,this.options.persister?this.options.persister(f,g,this):f(g)},a=(()=>{const f={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(f),f})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#o({type:"fetch",meta:a.fetchOptions?.meta});const u=f=>{T0(f)&&f.silent||this.#o({type:"error",error:f}),T0(f)||(this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this)),this.scheduleGc()};return this.#i=mI({initialPromise:e?.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{if(f===void 0){u(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(d){u(d);return}this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),this.scheduleGc()},onError:u,onFail:(f,d)=>{this.#o({type:"failed",failureCount:f,error:d})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),this.#i.start()}#o(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...vI(n.data,this.options),fetchMeta:t.meta??null};case"success":return this.#t=void 0,{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=t.error;return T0(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),Pr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:t})})}};function vI(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:gI(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function YF(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var XF=class extends Ld{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,n){const r=e.queryKey,i=e.queryHash??NS(r,e);let s=this.get(i);return s||(s=new KF({client:t,queryKey:r,queryHash:i,options:t.defaultQueryOptions(e),state:n,defaultOptions:t.getQueryDefaults(r)}),this.add(s)),s}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Pr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(n=>uA(e,n))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(n=>uA(t,n)):e}notify(t){Pr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){Pr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Pr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},QF=class extends yI{#e;#t;#n;constructor(t){super(),this.mutationId=t.mutationId,this.#t=t.mutationCache,this.#e=[],this.state=t.state||ZF(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#r({type:"continue"})};this.#n=mI({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(i,s)=>{this.#r({type:"failed",failureCount:i,error:s})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const n=this.state.status==="pending",r=!this.#n.canStart();try{if(n)e();else{this.#r({type:"pending",variables:t,isPaused:r}),await this.#t.config.onMutate?.(t,this);const s=await this.options.onMutate?.(t);s!==this.state.context&&this.#r({type:"pending",context:s,variables:t,isPaused:r})}const i=await this.#n.start();return await this.#t.config.onSuccess?.(i,t,this.state.context,this),await this.options.onSuccess?.(i,t,this.state.context),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,t,this.state.context),this.#r({type:"success",data:i}),i}catch(i){try{throw await this.#t.config.onError?.(i,t,this.state.context,this),await this.options.onError?.(i,t,this.state.context),await this.#t.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,i,t,this.state.context),i}finally{this.#r({type:"error",error:i})}}finally{this.#t.runNext(this)}}#r(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Pr.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(t)}),this.#t.notify({mutation:this,type:"updated",action:t})})}};function ZF(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var JF=class extends Ld{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(t,e,n){const r=new QF({mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:n});return this.add(r),r}add(t){this.#e.add(t);const e=pg(t);if(typeof e=="string"){const n=this.#t.get(e);n?n.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=pg(t);if(typeof e=="string"){const n=this.#t.get(e);if(n)if(n.length>1){const r=n.indexOf(t);r!==-1&&n.splice(r,1)}else n[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=pg(t);if(typeof e=="string"){const r=this.#t.get(e)?.find(i=>i.state.status==="pending");return!r||r===t}else return!0}runNext(t){const e=pg(t);return typeof e=="string"?this.#t.get(e)?.find(r=>r!==t&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Pr.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(n=>cA(e,n))}findAll(t={}){return this.getAll().filter(e=>cA(t,e))}notify(t){Pr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return Pr.batch(()=>Promise.all(t.map(e=>e.continue().catch(pi))))}};function pg(t){return t.options.scope?.id}function Tp(t){return{onFetch:(e,n)=>{const r=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,s=e.state.data?.pages||[],a=e.state.data?.pageParams||[];let u={pages:[],pageParams:[]},f=0;const d=async()=>{let g=!1;const p=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?g=!0:e.signal.addEventListener("abort",()=>{g=!0}),e.signal)})},m=hI(e.options,e.fetchOptions),v=async(b,S,w)=>{if(g)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const R=(()=>{const P={client:e.client,queryKey:e.queryKey,pageParam:S,direction:w?"backward":"forward",meta:e.options.meta};return p(P),P})(),T=await m(R),{maxPages:A}=e.options,k=w?VF:jF;return{pages:k(b.pages,T,A),pageParams:k(b.pageParams,S,A)}};if(i&&s.length){const b=i==="backward",S=b?bI:ox,w={pages:s,pageParams:a},C=S(r,w);u=await v(w,C,b)}else{const b=t??s.length;do{const S=f===0?a[0]??r.initialPageParam:ox(r,u);if(f>0&&S==null)break;u=await v(u,S),f++}while(f<b)}return u};e.options.persister?e.fetchFn=()=>e.options.persister?.(d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=d}}}function ox(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function bI(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}function e4(t,e){return e?ox(t,e)!=null:!1}function t4(t,e){return!e||!t.getPreviousPageParam?!1:bI(t,e)!=null}var n4=class{#e;#t;#n;#r;#i;#l;#s;#o;constructor(t={}){this.#e=t.queryCache||new XF,this.#t=t.mutationCache||new JF,this.#n=t.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#s=BS.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Ep.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#s?.(),this.#s=void 0,this.#o?.(),this.#o=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=this.#e.build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Jl(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=this.#e.get(r.queryHash)?.state.data,a=BF(e,s);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Pr.batch(()=>this.#e.findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;Pr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=this.#e;return Pr.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Pr.batch(()=>this.#e.findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(pi).catch(pi)}invalidateQueries(t,e={}){return Pr.batch(()=>(this.#e.findAll(t).forEach(n=>{n.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Pr.batch(()=>this.#e.findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(pi)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(pi)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=this.#e.build(this,e);return n.isStaleByTime(Jl(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(pi).catch(pi)}fetchInfiniteQuery(t){return t.behavior=Tp(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(pi).catch(pi)}ensureInfiniteQueryData(t){return t.behavior=Tp(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ep.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#r.set(dd(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#r.values()],n={};return e.forEach(r=>{hd(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){this.#i.set(dd(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#i.values()],n={};return e.forEach(r=>{hd(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=NS(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===LS&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},xI=class extends Ld{constructor(t,e){super(),this.options=e,this.#e=t,this.#o=null,this.#s=ix(),this.options.experimental_prefetchInRender||this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#l;#s;#o;#p;#d;#h;#u;#c;#a;#g=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),hA(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return sx(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return sx(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Qi(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),e._defaulted&&!tx(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&gA(this.#t,n,this.options,e)&&this.#f(),this.updateResult(),r&&(this.#t!==n||Qi(this.options.enabled,this.#t)!==Qi(e.enabled,this.#t)||Jl(this.options.staleTime,this.#t)!==Jl(e.staleTime,this.#t))&&this.#m();const i=this.#y();r&&(this.#t!==n||Qi(this.options.enabled,this.#t)!==Qi(e.enabled,this.#t)||i!==this.#a)&&this.#v(i)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),n=this.createResult(e,t);return i4(this,n)&&(this.#r=n,this.#l=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(t,e){return new Proxy(t,{get:(n,r)=>(this.trackProp(r),e?.(r),Reflect.get(n,r))})}trackProp(t){this.#g.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),n=this.#e.getQueryCache().build(this.#e,e);return n.fetch().then(()=>this.createResult(n,e))}fetch(t){return this.#f({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(t){this.#w();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(pi)),e}#m(){this.#x();const t=Jl(this.options.staleTime,this.#t);if(ru||this.#r.isStale||!ex(t))return;const n=fI(this.#r.dataUpdatedAt,t)+1;this.#u=setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(t){this.#S(),this.#a=t,!(ru||Qi(this.options.enabled,this.#t)===!1||!ex(this.#a)||this.#a===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||BS.isFocused())&&this.#f()},this.#a))}#b(){this.#m(),this.#v(this.#y())}#x(){this.#u&&(clearTimeout(this.#u),this.#u=void 0)}#S(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const n=this.#t,r=this.options,i=this.#r,s=this.#i,a=this.#l,f=t!==n?t.state:this.#n,{state:d}=t;let g={...d},p=!1,m;if(e._optimisticResults){const D=this.hasListeners(),L=!D&&hA(t,e),H=D&&gA(t,n,e,r);(L||H)&&(g={...g,...vI(d.data,t.options)}),e._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:v,errorUpdatedAt:b,status:S}=g;m=g.data;let w=!1;if(e.placeholderData!==void 0&&m===void 0&&S==="pending"){let D;i?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(D=i.data,w=!0):D=typeof e.placeholderData=="function"?e.placeholderData(this.#h?.state.data,this.#h):e.placeholderData,D!==void 0&&(S="success",m=rx(i?.data,D,e),p=!0)}if(e.select&&m!==void 0&&!w)if(i&&m===s?.data&&e.select===this.#p)m=this.#d;else try{this.#p=e.select,m=e.select(m),m=rx(i?.data,m,e),this.#d=m,this.#o=null}catch(D){this.#o=D}this.#o&&(v=this.#o,m=this.#d,b=Date.now(),S="error");const C=g.fetchStatus==="fetching",R=S==="pending",T=S==="error",A=R&&C,k=m!==void 0,M={status:S,fetchStatus:g.fetchStatus,isPending:R,isSuccess:S==="success",isError:T,isInitialLoading:A,isLoading:A,data:m,dataUpdatedAt:g.dataUpdatedAt,error:v,errorUpdatedAt:b,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>f.dataUpdateCount||g.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!R,isLoadingError:T&&!k,isPaused:g.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:T&&k,isStale:_S(t,e),refetch:this.refetch,promise:this.#s,isEnabled:Qi(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const D=N=>{M.status==="error"?N.reject(M.error):M.data!==void 0&&N.resolve(M.data)},L=()=>{const N=this.#s=M.promise=ix();D(N)},H=this.#s;switch(H.status){case"pending":t.queryHash===n.queryHash&&D(H);break;case"fulfilled":(M.status==="error"||M.data!==H.value)&&L();break;case"rejected":(M.status!=="error"||M.error!==H.reason)&&L();break}}return M}updateResult(){const t=this.#r,e=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#l=this.options,this.#i.data!==void 0&&(this.#h=this.#t),tx(e,t))return;this.#r=e;const n=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#g.size)return!0;const s=new Set(i??this.#g);return this.options.throwOnError&&s.add("error"),Object.keys(this.#r).some(a=>{const u=a;return this.#r[u]!==t[u]&&s.has(u)})};this.#C({listeners:n()})}#w(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#n=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(t){Pr.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function r4(t,e){return Qi(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function hA(t,e){return r4(t,e)||t.state.data!==void 0&&sx(t,e,e.refetchOnMount)}function sx(t,e,n){if(Qi(e.enabled,t)!==!1&&Jl(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&_S(t,e)}return!1}function gA(t,e,n,r){return(t!==e||Qi(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&_S(t,n)}function _S(t,e){return Qi(e.enabled,t)!==!1&&t.isStaleByTime(Jl(e.staleTime,t))}function i4(t,e){return!tx(t.getCurrentResult(),e)}var o4=class extends xI{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:Tp()})}getOptimisticResult(t){return t.behavior=Tp(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:n}=t,r=super.createResult(t,e),{isFetching:i,isRefetching:s,isError:a,isRefetchError:u}=r,f=n.fetchMeta?.fetchMore?.direction,d=a&&f==="forward",g=i&&f==="forward",p=a&&f==="backward",m=i&&f==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:e4(e,n.data),hasPreviousPage:t4(e,n.data),isFetchNextPageError:d,isFetchingNextPage:g,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:u&&!d&&!p,isRefetching:s&&!g&&!m}}},SI=E.createContext(void 0),HS=t=>{const e=E.useContext(SI);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},s4=({client:t,children:e})=>(E.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),O.jsx(SI.Provider,{value:t,children:e})),wI=E.createContext(!1),l4=()=>E.useContext(wI);wI.Provider;function a4(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var u4=E.createContext(a4()),c4=()=>E.useContext(u4),f4=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},d4=t=>{E.useEffect(()=>{t.clearReset()},[t])},h4=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||FF(n,[t.error,r])),g4=t=>{if(t.suspense){const e=r=>r==="static"?r:Math.max(r??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...r)=>e(n(...r)):e(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},p4=(t,e)=>t.isLoading&&t.isFetching&&!e,m4=(t,e)=>t?.suspense&&e.isPending,pA=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function CI(t,e,n){const r=l4(),i=c4(),s=HS(),a=s.defaultQueryOptions(t);s.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=r?"isRestoring":"optimistic",g4(a),f4(a,i),d4(i);const u=!s.getQueryCache().get(a.queryHash),[f]=E.useState(()=>new e(s,a)),d=f.getOptimisticResult(a),g=!r&&t.subscribed!==!1;if(E.useSyncExternalStore(E.useCallback(p=>{const m=g?f.subscribe(Pr.batchCalls(p)):pi;return f.updateResult(),m},[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),E.useEffect(()=>{f.setOptions(a)},[a,f]),m4(a,d))throw pA(a,f,i);if(h4({result:d,errorResetBoundary:i,throwOnError:a.throwOnError,query:s.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw d.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(a,d),a.experimental_prefetchInRender&&!ru&&p4(d,r)&&(u?pA(a,f,i):s.getQueryCache().get(a.queryHash)?.promise)?.catch(pi).finally(()=>{f.updateResult()}),a.notifyOnChangeProps?d:f.trackResult(d)}function y4(t,e){return CI(t,xI)}function v4(t,e){return CI(t,o4)}const RI=()=>typeof window<"u"&&typeof window.document<"u",b4=()=>RI()&&typeof window.__ROZENITE_WEB__<"u",x4=()=>typeof window>"u";let EI=class extends Error{constructor(e){super(`Unsupported platform: ${e}`),this.name="UnsupportedPlatformError"}},TI=class extends Error{constructor(){super("Rozenite for web is not configured. A separate integration is required for web. Consult Rozenite docs for details."),this.name="MissingRozeniteForWebError"}};const jS="rozenite",S4=()=>{const t=self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__,e=t.BINDING_NAME;return self[e]!=null?t.initializeDomain(jS):null},w4=()=>new Promise(t=>{const e=n=>{n.name===jS&&(self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.removeEventListener(e),setTimeout(()=>t(n)))};self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.addEventListener(e)}),C4=async()=>{const t=new Set;let e=S4();e||(e=await w4());const n=()=>{if(!e)throw new Error("Domain not initialized");return e},r=i=>{i.name===jS&&(e&&t.forEach(s=>{e.onMessage.removeEventListener(s)}),e=i,t.forEach(s=>{i.onMessage.addEventListener(s)}))};return self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.addEventListener(r),{send:i=>{n().sendMessage(i)},onMessage(i){const s=a=>{setTimeout(()=>{i(a)})};return t.add(s),n().onMessage.addEventListener(s),{remove:()=>{t.delete(s),n().onMessage.removeEventListener(s)}}},close:()=>{self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.removeEventListener(r)}}},R4=async()=>{if(RI()&&!b4())throw new TI;if(x4())throw new EI("server");return C4()},E4=async()=>{const t=new Set,e=n=>{t.forEach(r=>{r(n.data)})};return window.addEventListener("message",e),{send:n=>{window.parent.postMessage({type:"rozenite-message",payload:n},"*")},onMessage:n=>(t.add(n),{remove:()=>{t.delete(n)}}),close:()=>{t.clear(),window.removeEventListener("message",e)}}};let Of=null;const T4=async()=>{if(Of)return Of;const t="__ROZENITE_PANEL__"in window?E4():R4();Of=t;try{const e=await t;return Of=e,e}catch(e){throw Of=null,e}},A4=t=>typeof t!="object"||t===null||!("type"in t)||!("payload"in t)||!("pluginId"in t)?null:t;class mA extends Error{constructor(e){super(`Request "${e}" was aborted.`),this.requestId=e,this.name="RozeniteDevToolsRequestAbortedError"}}let M4=class extends Error{constructor(e,n){super(`Request "${e}" timed out after ${n}ms.`),this.requestId=e,this.timeoutMs=n,this.name="RozeniteDevToolsRequestTimeoutError"}},yA=class extends Error{constructor(e){super(`Request "${e}" was cancelled because the client closed.`),this.requestId=e,this.name="RozeniteDevToolsRequestClientClosedError"}},O4=class extends Error{constructor(e){super(`Request "${e.requestId}" received an error response.`),this.payload=e,this.name="RozeniteDevToolsRequestResponseError"}};const k4=3e4;let vA=0;const I4=()=>typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID():(vA+=1,`rozenite-${Date.now()}-${vA}`),D4=async t=>{const e=await T4(),n=new Map,r=new Set;let i=!1;const s=async d=>{const g=A4(d);if(!g||g.pluginId!==t)return;n.get(g.type)?.forEach(m=>{m(g.payload)})},a=(d,g)=>{e.send({pluginId:t,type:d,payload:g})},u=e.onMessage(s),f={send:a,onMessage:(d,g)=>{const p=n.get(d)??new Set;return p.add(g),n.set(d,p),{remove:()=>{p.delete(g),p.size===0&&n.delete(d)}}},request:d=>{const g=d.requestId??I4(),p=d.timeoutMs??k4;return!Number.isFinite(p)||p<0?Promise.reject(new RangeError("timeoutMs must be a finite, non-negative number.")):i?Promise.reject(new yA(g)):d.signal?.aborted?Promise.reject(new mA(g)):new Promise((m,v)=>{let b=!1;const S=()=>{R(new mA(g))},w=()=>{A.remove(),k?.remove(),clearTimeout(P),d.signal?.removeEventListener("abort",S),r.delete(T)},C=M=>{b||(b=!0,w(),M())},R=M=>{C(()=>{v(M)})},T=()=>{R(new yA(g))},A=f.onMessage(d.responseType,M=>{M.requestId===g&&C(()=>{m(M)})}),k=d.errorType!=null?f.onMessage(d.errorType,M=>{M.requestId===g&&C(()=>{v(new O4(M))})}):void 0;d.signal?.addEventListener("abort",S,{once:!0}),r.add(T);const P=setTimeout(()=>{R(new M4(g,p))},p);try{f.send(d.requestType,{...d.payload,requestId:g})}catch(M){R(M instanceof Error?M:new Error(String(M)))}})},close:()=>{i||(i=!0,r.forEach(d=>{d()}),n.clear(),u.remove(),e.close())}};return f},P4=async t=>D4(t),z4=()=>"__ROZENITE_PANEL__"in globalThis,N4=({pluginId:t})=>{const[e,n]=E.useState(null),[r,i]=E.useState(null);if(E.useEffect(()=>{let s=!0,a=null;const u=async()=>{try{a=await P4(t),s&&n(a)}catch(d){if(d instanceof TI){console.warn(`[Rozenite, ${t}] Rozenite for web is not configured. A separate integration is required for web. Consult Rozenite docs for details.`);return}if(d instanceof EI){console.warn(`[Rozenite, ${t}] Unsupported platform, skipping setup.`);return}console.error(`[Rozenite, ${t}] Error setting up client.`,d),s&&i(d)}},f=async()=>{try{a?.close()}catch{}};return u(),()=>{s=!1,f()}},[t]),r!=null)throw r;return E.useEffect(()=>{if(!e||z4())return;const s=e,a=setTimeout(()=>{s.send("plugin-mounted",{pluginId:t})},0);return()=>{clearTimeout(a)}},[e,t]),e};function AI(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=AI(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function MI(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=AI(t))&&(r&&(r+=" "),r+=e);return r}const L4=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},B4=(t,e)=>({classGroupId:t,validator:e}),OI=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Ap="-",bA=[],_4="arbitrary..",H4=t=>{const e=V4(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return j4(a);const u=a.split(Ap),f=u[0]===""&&u.length>1?1:0;return kI(u,f,e)},getConflictingClassGroupIds:(a,u)=>{if(u){const f=r[a],d=n[a];return f?d?L4(d,f):f:d||bA}return n[a]||bA}}},kI=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const i=t[e],s=n.nextPart.get(i);if(s){const d=kI(t,e+1,s);if(d)return d}const a=n.validators;if(a===null)return;const u=e===0?t.join(Ap):t.slice(e).join(Ap),f=a.length;for(let d=0;d<f;d++){const g=a[d];if(g.validator(u))return g.classGroupId}},j4=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?_4+r:void 0})(),V4=t=>{const{theme:e,classGroups:n}=t;return F4(n,e)},F4=(t,e)=>{const n=OI();for(const r in t){const i=t[r];VS(i,n,r,e)}return n},VS=(t,e,n,r)=>{const i=t.length;for(let s=0;s<i;s++){const a=t[s];U4(a,e,n,r)}},U4=(t,e,n,r)=>{if(typeof t=="string"){$4(t,e,n);return}if(typeof t=="function"){q4(t,e,n,r);return}G4(t,e,n,r)},$4=(t,e,n)=>{const r=t===""?e:II(e,t);r.classGroupId=n},q4=(t,e,n,r)=>{if(W4(t)){VS(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(B4(n,t))},G4=(t,e,n,r)=>{const i=Object.entries(t),s=i.length;for(let a=0;a<s;a++){const[u,f]=i[a];VS(f,II(e,u),n,r)}},II=(t,e)=>{let n=t;const r=e.split(Ap),i=r.length;for(let s=0;s<i;s++){const a=r[s];let u=n.nextPart.get(a);u||(u=OI(),n.nextPart.set(a,u)),n=u}return n},W4=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,K4=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const i=(s,a)=>{n[s]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=r[s])!==void 0)return i(s,a),a},set(s,a){s in n?n[s]=a:i(s,a)}}},lx="!",xA=":",Y4=[],SA=(t,e,n,r,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),X4=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=i=>{const s=[];let a=0,u=0,f=0,d;const g=i.length;for(let S=0;S<g;S++){const w=i[S];if(a===0&&u===0){if(w===xA){s.push(i.slice(f,S)),f=S+1;continue}if(w==="/"){d=S;continue}}w==="["?a++:w==="]"?a--:w==="("?u++:w===")"&&u--}const p=s.length===0?i:i.slice(f);let m=p,v=!1;p.endsWith(lx)?(m=p.slice(0,-1),v=!0):p.startsWith(lx)&&(m=p.slice(1),v=!0);const b=d&&d>f?d-f:void 0;return SA(s,v,m,b)};if(e){const i=e+xA,s=r;r=a=>a.startsWith(i)?s(a.slice(i.length)):SA(Y4,!1,a,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},Q4=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s<n.length;s++){const a=n[s],u=a[0]==="[",f=e.has(a);u||f?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(a)):i.push(a)}return i.length>0&&(i.sort(),r.push(...i)),r}},Z4=t=>({cache:K4(t.cacheSize),parseClassName:X4(t),sortModifiers:Q4(t),...H4(t)}),J4=/\s+/,e5=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=e,a=[],u=t.trim().split(J4);let f="";for(let d=u.length-1;d>=0;d-=1){const g=u[d],{isExternal:p,modifiers:m,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:S}=n(g);if(p){f=g+(f.length>0?" "+f:f);continue}let w=!!S,C=r(w?b.substring(0,S):b);if(!C){if(!w){f=g+(f.length>0?" "+f:f);continue}if(C=r(b),!C){f=g+(f.length>0?" "+f:f);continue}w=!1}const R=m.length===0?"":m.length===1?m[0]:s(m).join(":"),T=v?R+lx:R,A=T+C;if(a.indexOf(A)>-1)continue;a.push(A);const k=i(C,w);for(let P=0;P<k.length;++P){const M=k[P];a.push(T+M)}f=g+(f.length>0?" "+f:f)}return f},t5=(...t)=>{let e=0,n,r,i="";for(;e<t.length;)(n=t[e++])&&(r=DI(n))&&(i&&(i+=" "),i+=r);return i},DI=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=DI(t[r]))&&(n&&(n+=" "),n+=e);return n},n5=(t,...e)=>{let n,r,i,s;const a=f=>{const d=e.reduce((g,p)=>p(g),t());return n=Z4(d),r=n.cache.get,i=n.cache.set,s=u,u(f)},u=f=>{const d=r(f);if(d)return d;const g=e5(f,n);return i(f,g),g};return s=a,(...f)=>s(t5(...f))},r5=[],pr=t=>{const e=n=>n[t]||r5;return e.isThemeGetter=!0,e},PI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,zI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,i5=/^\d+\/\d+$/,o5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,s5=/\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$/,l5=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,a5=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,u5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qu=t=>i5.test(t),It=t=>!!t&&!Number.isNaN(Number(t)),$l=t=>!!t&&Number.isInteger(Number(t)),A0=t=>t.endsWith("%")&&It(t.slice(0,-1)),Us=t=>o5.test(t),c5=()=>!0,f5=t=>s5.test(t)&&!l5.test(t),NI=()=>!1,d5=t=>a5.test(t),h5=t=>u5.test(t),g5=t=>!Ke(t)&&!Ye(t),p5=t=>Dc(t,_I,NI),Ke=t=>PI.test(t),Va=t=>Dc(t,HI,f5),M0=t=>Dc(t,x5,It),wA=t=>Dc(t,LI,NI),m5=t=>Dc(t,BI,h5),mg=t=>Dc(t,jI,d5),Ye=t=>zI.test(t),kf=t=>Pc(t,HI),y5=t=>Pc(t,S5),CA=t=>Pc(t,LI),v5=t=>Pc(t,_I),b5=t=>Pc(t,BI),yg=t=>Pc(t,jI,!0),Dc=(t,e,n)=>{const r=PI.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Pc=(t,e,n=!1)=>{const r=zI.exec(t);return r?r[1]?e(r[1]):n:!1},LI=t=>t==="position"||t==="percentage",BI=t=>t==="image"||t==="url",_I=t=>t==="length"||t==="size"||t==="bg-size",HI=t=>t==="length",x5=t=>t==="number",S5=t=>t==="family-name",jI=t=>t==="shadow",w5=()=>{const t=pr("color"),e=pr("font"),n=pr("text"),r=pr("font-weight"),i=pr("tracking"),s=pr("leading"),a=pr("breakpoint"),u=pr("container"),f=pr("spacing"),d=pr("radius"),g=pr("shadow"),p=pr("inset-shadow"),m=pr("text-shadow"),v=pr("drop-shadow"),b=pr("blur"),S=pr("perspective"),w=pr("aspect"),C=pr("ease"),R=pr("animate"),T=()=>["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"],k=()=>[...A(),Ye,Ke],P=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],D=()=>[Ye,Ke,f],L=()=>[Qu,"full","auto",...D()],H=()=>[$l,"none","subgrid",Ye,Ke],N=()=>["auto",{span:["full",$l,Ye,Ke]},$l,Ye,Ke],_=()=>[$l,"auto",Ye,Ke],$=()=>["auto","min","max","fr",Ye,Ke],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...D()],q=()=>[Qu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],V=()=>[t,Ye,Ke],te=()=>[...A(),CA,wA,{position:[Ye,Ke]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",v5,p5,{size:[Ye,Ke]}],U=()=>[A0,kf,Va],W=()=>["","none","full",d,Ye,Ke],X=()=>["",It,kf,Va],ie=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[It,A0,CA,wA],Y=()=>["","none",b,Ye,Ke],le=()=>["none",It,Ye,Ke],xe=()=>["none",It,Ye,Ke],ve=()=>[It,Ye,Ke],de=()=>[Qu,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Us],breakpoint:[Us],color:[c5],container:[Us],"drop-shadow":[Us],ease:["in","out","in-out"],font:[g5],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Us],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Us],shadow:[Us],spacing:["px",It],text:[Us],"text-shadow":[Us],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Qu,Ke,Ye,w]}],container:["container"],columns:[{columns:[It,Ke,Ye,u]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:k()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[$l,"auto",Ye,Ke]}],basis:[{basis:[Qu,"full","auto",u,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[It,Qu,"auto","initial","none",Ke]}],grow:[{grow:["",It,Ye,Ke]}],shrink:[{shrink:["",It,Ye,Ke]}],order:[{order:[$l,"first","last","none",Ye,Ke]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[u,"screen",...q()]}],"min-w":[{"min-w":[u,"screen","none",...q()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,kf,Va]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ye,M0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",A0,Ke]}],"font-family":[{font:[y5,Ke,e]}],"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:[i,Ye,Ke]}],"line-clamp":[{"line-clamp":[It,"none",Ye,M0]}],leading:[{leading:[s,...D()]}],"list-image":[{"list-image":["none",Ye,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ye,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[It,"from-font","auto",Ye,Va]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[It,"auto",Ye,Ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye,Ke]}],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",Ye,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:te()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$l,Ye,Ke],radial:["",Ye,Ke],conic:[$l,Ye,Ke]},b5,m5]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ie(),"hidden","none"]}],"divide-style":[{divide:[...ie(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[It,Ye,Ke]}],"outline-w":[{outline:["",It,kf,Va]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",g,yg,mg]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",p,yg,mg]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[It,Va]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",m,yg,mg]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[It,Ye,Ke]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"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":[It]}],"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":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"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":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"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":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"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":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"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":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"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":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"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":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[Ye,Ke]}],"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":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"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":[It]}],"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":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ye,Ke]}],filter:[{filter:["","none",Ye,Ke]}],blur:[{blur:Y()}],brightness:[{brightness:[It,Ye,Ke]}],contrast:[{contrast:[It,Ye,Ke]}],"drop-shadow":[{"drop-shadow":["","none",v,yg,mg]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",It,Ye,Ke]}],"hue-rotate":[{"hue-rotate":[It,Ye,Ke]}],invert:[{invert:["",It,Ye,Ke]}],saturate:[{saturate:[It,Ye,Ke]}],sepia:[{sepia:["",It,Ye,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ye,Ke]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[It,Ye,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[It,Ye,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",It,Ye,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[It,Ye,Ke]}],"backdrop-invert":[{"backdrop-invert":["",It,Ye,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[It,Ye,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[It,Ye,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",It,Ye,Ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ye,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[It,"initial",Ye,Ke]}],ease:[{ease:["linear","initial",C,Ye,Ke]}],delay:[{delay:[It,Ye,Ke]}],animate:[{animate:["none",R,Ye,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ye,Ke]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:xe()}],"scale-x":[{"scale-x":xe()}],"scale-y":[{"scale-y":xe()}],"scale-z":[{"scale-z":xe()}],"scale-3d":["scale-3d"],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[Ye,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"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",Ye,Ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",Ye,Ke]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[It,kf,Va,M0]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["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-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["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-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},C5=n5(w5);function R5(t,e){const n=getComputedStyle(t),r=parseFloat(n.fontSize);return e*r}function E5(t,e){const n=getComputedStyle(t.ownerDocument.documentElement),r=parseFloat(n.fontSize);return e*r}function T5(t){return t/100*window.innerHeight}function A5(t){return t/100*window.innerWidth}function M5(t){switch(typeof t){case"number":return[t,"px"];case"string":{const e=parseFloat(t);return t.endsWith("%")?[e,"%"]:t.endsWith("px")?[e,"px"]:t.endsWith("rem")?[e,"rem"]:t.endsWith("em")?[e,"em"]:t.endsWith("vh")?[e,"vh"]:t.endsWith("vw")?[e,"vw"]:[e,"%"]}}}function Hf({groupSize:t,panelElement:e,styleProp:n}){let r;const[i,s]=M5(n);switch(s){case"%":{r=i/100*t;break}case"px":{r=i;break}case"rem":{r=E5(e,i);break}case"em":{r=R5(e,i);break}case"vh":{r=T5(i);break}case"vw":{r=A5(i);break}}return r}function ri(t){return parseFloat(t.toFixed(3))}function yc({group:t}){const{orientation:e,panels:n}=t;return n.reduce((r,i)=>(r+=e==="horizontal"?i.element.offsetWidth:i.element.offsetHeight,r),0)}function ax(t){const{panels:e}=t,n=yc({group:t});return n===0?e.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):e.map(r=>{const{element:i,panelConstraints:s}=r;let a=0;if(s.collapsedSize!==void 0){const g=Hf({groupSize:n,panelElement:i,styleProp:s.collapsedSize});a=ri(g/n*100)}let u;if(s.defaultSize!==void 0){const g=Hf({groupSize:n,panelElement:i,styleProp:s.defaultSize});u=ri(g/n*100)}let f=0;if(s.minSize!==void 0){const g=Hf({groupSize:n,panelElement:i,styleProp:s.minSize});f=ri(g/n*100)}let d=100;if(s.maxSize!==void 0){const g=Hf({groupSize:n,panelElement:i,styleProp:s.maxSize});d=ri(g/n*100)}return{groupResizeBehavior:s.groupResizeBehavior,collapsedSize:a,collapsible:s.collapsible===!0,defaultSize:u,disabled:s.disabled,minSize:f,maxSize:d,panelId:r.id}})}function yn(t,e="Assertion error"){if(!t)throw Error(e)}function ux(t,e){return Array.from(e).sort(t==="horizontal"?O5:k5)}function O5(t,e){const n=t.element.offsetLeft-e.element.offsetLeft;return n!==0?n:t.element.offsetWidth-e.element.offsetWidth}function k5(t,e){const n=t.element.offsetTop-e.element.offsetTop;return n!==0?n:t.element.offsetHeight-e.element.offsetHeight}function VI(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.ELEMENT_NODE}function FI(t,e){return{x:t.x>=e.left&&t.x<=e.right?0:Math.min(Math.abs(t.x-e.left),Math.abs(t.x-e.right)),y:t.y>=e.top&&t.y<=e.bottom?0:Math.min(Math.abs(t.y-e.top),Math.abs(t.y-e.bottom))}}function I5({orientation:t,rects:e,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let i,s=Number.MAX_VALUE;for(const a of e){const{x:u,y:f}=FI(r,a),d=t==="horizontal"?u:f;d<s&&(s=d,i=a)}return yn(i,"No rect found"),i}let vg;function D5(){return vg===void 0&&(typeof matchMedia=="function"?vg=!!matchMedia("(pointer:coarse)").matches:vg=!1),vg}function UI(t){const{element:e,orientation:n,panels:r,separators:i}=t,s=ux(n,Array.from(e.children).filter(VI).map(b=>({element:b}))).map(({element:b})=>b),a=[];let u=!1,f=!1,d=-1,g=-1,p=0,m,v=[];{let b=-1;for(const S of s)S.hasAttribute("data-panel")&&(b++,S.hasAttribute("data-disabled")||(p++,d===-1&&(d=b),g=b))}if(p>1){let b=-1;for(const S of s)if(S.hasAttribute("data-panel")){b++;const w=r.find(C=>C.element===S);if(w){if(m){const C=m.element.getBoundingClientRect(),R=S.getBoundingClientRect();let T;if(f){const A=n==="horizontal"?new DOMRect(C.right,C.top,0,C.height):new DOMRect(C.left,C.bottom,C.width,0),k=n==="horizontal"?new DOMRect(R.left,R.top,0,R.height):new DOMRect(R.left,R.top,R.width,0);switch(v.length){case 0:{T=[A,k];break}case 1:{const P=v[0],M=I5({orientation:n,rects:[C,R],targetRect:P.element.getBoundingClientRect()});T=[P,M===C?k:A];break}default:{T=v;break}}}else v.length?T=v:T=[n==="horizontal"?new DOMRect(C.right,R.top,R.left-C.right,R.height):new DOMRect(R.left,C.bottom,R.width,R.top-C.bottom)];for(const A of T){let k="width"in A?A:A.element.getBoundingClientRect();const P=D5()?t.resizeTargetMinimumSize.coarse:t.resizeTargetMinimumSize.fine;if(k.width<P){const D=P-k.width;k=new DOMRect(k.x-D/2,k.y,k.width+D,k.height)}if(k.height<P){const D=P-k.height;k=new DOMRect(k.x,k.y-D/2,k.width,k.height+D)}const M=b<=d||b>g;!u&&!M&&a.push({group:t,groupSize:yc({group:t}),panels:[m,w],separator:"width"in A?void 0:A,rect:k}),u=!1}}f=!1,m=w,v=[]}}else if(S.hasAttribute("data-separator")){S.ariaDisabled!==null&&(u=!0);const w=i.find(C=>C.element===S);w?v.push(w):(m=void 0,v=[])}else f=!0}return a}let $I=class{#e={};addListener(e,n){const r=this.#e[e];return r===void 0?this.#e[e]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(e,n)}}emit(e,n){const r=this.#e[e];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let i=!1,s=null;const a=Array.from(r);for(let u=0;u<a.length;u++){const f=a[u];try{f.call(null,n)}catch(d){s===null&&(i=!0,s=d)}}if(i)throw s}}removeAllListeners(){this.#e={}}removeListener(e,n){const r=this.#e[e];if(r!==void 0){const i=r.indexOf(n);i>=0&&r.splice(i,1)}}},oc={cursorFlags:0,state:"inactive"};const FS=new $I;function iu(){return oc}function P5(t){return FS.addListener("change",t)}function z5(t){const e=oc,n={...oc};n.cursorFlags=t,oc=n,FS.emit("change",{prev:e,next:n})}function sc(t){const e=oc;oc=t,FS.emit("change",{prev:e,next:t})}const N5=t=>t,O0=()=>{},qI=1,GI=2,WI=4,KI=8,RA=3,EA=12;let bg;function TA(){return bg===void 0&&(bg=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(bg=!0)),bg}function L5({cursorFlags:t,groups:e,state:n}){let r=0,i=0;switch(n){case"active":case"hover":e.forEach(s=>{if(!s.mutableState.disableCursor)switch(s.orientation){case"horizontal":{r++;break}case"vertical":{i++;break}}})}if(!(r===0&&i===0)){switch(n){case"active":{if(t&&TA()){const s=(t&qI)!==0,a=(t&GI)!==0,u=(t&WI)!==0,f=(t&KI)!==0;if(s)return u?"se-resize":f?"ne-resize":"e-resize";if(a)return u?"sw-resize":f?"nw-resize":"w-resize";if(u)return"s-resize";if(f)return"n-resize"}break}}return TA()?r>0&&i>0?"move":r>0?"ew-resize":"ns-resize":r>0&&i>0?"grab":r>0?"col-resize":"row-resize"}}const AA=new WeakMap;function US(t){if(t.defaultView===null||t.defaultView===void 0)return;let{prevStyle:e,styleSheet:n}=AA.get(t)??{};n===void 0&&(n=new t.defaultView.CSSStyleSheet,t.adoptedStyleSheets&&(Object.isExtensible(t.adoptedStyleSheets)?t.adoptedStyleSheets.push(n):t.adoptedStyleSheets=[...t.adoptedStyleSheets,n]));const r=iu();switch(r.state){case"active":case"hover":{const i=L5({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(a=>a.group),state:r.state}),s=`*, *:hover {cursor: ${i} !important; }`;if(e===s)return;e=s,i?n.cssRules.length===0?n.insertRule(s):n.replaceSync(s):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{e=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}AA.set(t,{prevStyle:e,styleSheet:n})}let cs=new Map;const YI=new $I;function B5(t){cs=new Map(cs),cs.delete(t)}function MA(t,e){for(const[n]of cs)if(n.id===t)return n}function ea(t,e){for(const[n,r]of cs)if(n.id===t)return r;if(e)throw Error(`Could not find data for Group with id ${t}`)}function gu(){return cs}function $S(t,e){return YI.addListener("groupChange",n=>{n.group.id===t&&e(n)})}function el(t,e,n){const r=cs.get(t);cs=new Map(cs),cs.set(t,e),YI.emit("groupChange",{group:t,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:e})}function XI(t){const e=iu();let n=!1;return e.state==="active"&&(sc({cursorFlags:0,state:"inactive"}),e.hitRegions.length>0&&(US(t),n=!0,e.hitRegions.forEach(r=>{const i=ea(r.group.id,!0);el(r.group,i,{isUserInteraction:!0})}))),n}function OA(t){t.defaultPrevented||XI(t.currentTarget)}function _5(t,e,n){let r,i={x:1/0,y:1/0};for(const s of e){const a=FI(n,s.rect);switch(t){case"horizontal":{a.x<=i.x&&(r=s,i=a);break}case"vertical":{a.y<=i.y&&(r=s,i=a);break}}}return r?{distance:i,hitRegion:r}:void 0}function H5(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function j5(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:DA(t),b:DA(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();yn(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:IA(kA(n.a)),b:IA(kA(n.b))};if(i.a===i.b){const s=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let u=s.length;for(;u--;){const f=s[u];if(f===a.a)return 1;if(f===a.b)return-1}}return Math.sign(i.a-i.b)}const V5=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function F5(t){const e=getComputedStyle(QI(t)??t).display;return e==="flex"||e==="inline-flex"}function U5(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||F5(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||V5.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function kA(t){let e=t.length;for(;e--;){const n=t[e];if(yn(n,"Missing node"),U5(n))return n}return null}function IA(t){return t&&Number(getComputedStyle(t).zIndex)||0}function DA(t){const e=[];for(;t;)e.push(t),t=QI(t);return e}function QI(t){const{parentNode:e}=t;return H5(e)?e.host:e}function $5(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function q5({groupElement:t,hitRegion:e,pointerEventTarget:n}){if(!VI(n)||n.contains(t)||t.contains(n))return!0;if(j5(n,t)>0){let r=n;for(;r;){if(r.contains(t))return!0;if($5(r.getBoundingClientRect(),e))return!1;r=r.parentElement}}return!0}function qS(t,e){const n=[];return e.forEach((r,i)=>{if(i.disabled)return;const s=UI(i),a=_5(i.orientation,s,{x:t.clientX,y:t.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&q5({groupElement:i.element,hitRegion:a.hitRegion.rect,pointerEventTarget:t.target})&&n.push(a.hitRegion)}),n}function G5(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function qr(t,e,n=0){return Math.abs(ri(t)-ri(e))<=n}function rs(t,e){return qr(t,e)?0:t>e?1:-1}function tc({overrideDisabledPanels:t,panelConstraints:e,prevSize:n,size:r}){const{collapsedSize:i=0,collapsible:s,disabled:a,maxSize:u=100,minSize:f=0}=e;if(a&&!t)return n;if(rs(r,f)<0)if(s){const d=(i+f)/2;rs(r,d)<0?r=i:r=f}else r=f;return r=Math.min(u,r),r=ri(r),r}function gd({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:s}){if(qr(t,0))return e;const a=s==="imperative-api",u=Object.values(e),f=Object.values(i),d=[...u],[g,p]=r;yn(g!=null,"Invalid first pivot index"),yn(p!=null,"Invalid second pivot index");let m=0;switch(s){case"keyboard":{{const S=t<0?p:g,w=n[S];yn(w,`Panel constraints not found for index ${S}`);const{collapsedSize:C=0,collapsible:R,minSize:T=0}=w;if(R){const A=u[S];if(yn(A!=null,`Previous layout not found for panel index ${S}`),qr(A,C)){const k=T-A;rs(k,Math.abs(t))>0&&(t=t<0?0-k:k)}}}{const S=t<0?g:p,w=n[S];yn(w,`No panel constraints found for index ${S}`);const{collapsedSize:C=0,collapsible:R,minSize:T=0}=w;if(R){const A=u[S];if(yn(A!=null,`Previous layout not found for panel index ${S}`),qr(A,T)){const k=A-C;rs(k,Math.abs(t))>0&&(t=t<0?0-k:k)}}}break}default:{const S=t<0?p:g,w=n[S];yn(w,`Panel constraints not found for index ${S}`);const C=u[S],{collapsible:R,collapsedSize:T,minSize:A}=w;if(R&&rs(C,A)<0)if(t>0){const k=A-T,P=k/2,M=C+t;rs(M,A)<0&&(t=rs(t,P)<=0?0:k)}else{const k=A-T,P=100-k/2,M=C-t;rs(M,A)<0&&(t=rs(100+t,P)>0?0:-k)}break}}{const S=t<0?1:-1;let w=t<0?p:g,C=0;for(;;){const T=u[w];yn(T!=null,`Previous layout not found for panel index ${w}`);const A=tc({overrideDisabledPanels:a,panelConstraints:n[w],prevSize:T,size:100})-T;if(C+=A,w+=S,w<0||w>=n.length)break}const R=Math.min(Math.abs(t),Math.abs(C));t=t<0?0-R:R}{let S=t<0?g:p;for(;S>=0&&S<n.length;){const w=Math.abs(t)-Math.abs(m),C=u[S];yn(C!=null,`Previous layout not found for panel index ${S}`);const R=C-w,T=tc({overrideDisabledPanels:a,panelConstraints:n[S],prevSize:C,size:R});if(!qr(C,T)&&(m+=C-T,d[S]=T,m.toFixed(3).localeCompare(Math.abs(t).toFixed(3),void 0,{numeric:!0})>=0))break;t<0?S--:S++}}if(G5(f,d))return i;{const S=t<0?p:g,w=u[S];yn(w!=null,`Previous layout not found for panel index ${S}`);const C=w+m,R=tc({overrideDisabledPanels:a,panelConstraints:n[S],prevSize:w,size:C});if(d[S]=R,!qr(R,C)){let T=C-R,A=t<0?p:g;for(;A>=0&&A<n.length;){const k=d[A];yn(k!=null,`Previous layout not found for panel index ${A}`);const P=k+T,M=tc({overrideDisabledPanels:a,panelConstraints:n[A],prevSize:k,size:P});if(qr(k,M)||(T-=M-k,d[A]=M),qr(T,0))break;t>0?A--:A++}}}const v=Object.values(d).reduce((S,w)=>w+S,0);if(!qr(v,100,.1))return i;const b=Object.keys(i);return d.reduce((S,w,C)=>(S[b[C]]=w,S),{})}function ou(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(e[n]===void 0||rs(t[n],e[n])!==0)return!1;return!0}function su({layout:t,panelConstraints:e}){const n=Object.values(t),r=[...n],i=r.reduce((u,f)=>u+f,0);if(r.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${r.map(u=>`${u}%`).join(", ")}`);if(!qr(i,100)&&r.length>0)for(let u=0;u<e.length;u++){const f=r[u];yn(f!=null,`No layout data found for index ${u}`);const d=100/i*f;r[u]=d}let s=0;for(let u=0;u<e.length;u++){const f=n[u];yn(f!=null,`No layout data found for index ${u}`);const d=r[u];yn(d!=null,`No layout data found for index ${u}`);const g=tc({overrideDisabledPanels:!0,panelConstraints:e[u],prevSize:f,size:d});d!=g&&(s+=d-g,r[u]=g)}if(!qr(s,0))for(let u=0;u<e.length;u++){const f=r[u];yn(f!=null,`No layout data found for index ${u}`);const d=f+s,g=tc({overrideDisabledPanels:!0,panelConstraints:e[u],prevSize:f,size:d});if(f!==g&&(s-=g-f,r[u]=g,qr(s,0)))break}const a=Object.keys(t);return r.reduce((u,f,d)=>(u[a[d]]=f,u),{})}function ZI({groupId:t,panelId:e}){const n=()=>{const f=gu();for(const[d,{defaultLayoutDeferred:g,derivedPanelConstraints:p,layout:m,groupSize:v,separatorToPanels:b}]of f)if(d.id===t)return{defaultLayoutDeferred:g,derivedPanelConstraints:p,group:d,groupSize:v,layout:m,separatorToPanels:b};throw Error(`Group ${t} not found`)},r=()=>{const f=n().derivedPanelConstraints.find(d=>d.panelId===e);if(f!==void 0)return f;throw Error(`Panel constraints not found for Panel ${e}`)},i=()=>{const f=n().group.panels.find(d=>d.id===e);if(f!==void 0)return f;throw Error(`Layout not found for Panel ${e}`)},s=()=>{const f=n().layout[e];if(f!==void 0)return f;throw Error(`Layout not found for Panel ${e}`)},a=({nextSize:f,panels:d,prevLayout:g,derivedPanelConstraints:p})=>{const m=s(),v=d.findIndex(w=>w.id===e),b=v===0,S=v===d.length-1;if(S&&f<m&&(b||d.slice(0,v).every((w,C)=>{const R=p[C];return R?.collapsible&&qr(R.collapsedSize,g[R.panelId])}))){const w=d.slice(0,v).reduce((C,R)=>C+g[R.id],0);return{...g,[e]:ri(100-w)}}return gd({delta:S?m-f:f-m,initialLayout:g,panelConstraints:p,pivotIndices:S?[v-1,v]:[v,v+1],prevLayout:g,trigger:"imperative-api"})},u=f=>{const d=s();if(f===d)return;const{defaultLayoutDeferred:g,derivedPanelConstraints:p,group:m,groupSize:v,layout:b,separatorToPanels:S}=n(),w=a({nextSize:f,panels:m.panels,prevLayout:b,derivedPanelConstraints:p}),C=su({layout:w,panelConstraints:p});ou(b,C)||el(m,{defaultLayoutDeferred:g,derivedPanelConstraints:p,groupSize:v,layout:C,separatorToPanels:S})};return{collapse:()=>{const{collapsible:f,collapsedSize:d}=r(),{mutableValues:g}=i(),p=s();f&&p!==d&&(g.expandToSize=p,u(d))},expand:()=>{const{collapsible:f,collapsedSize:d,minSize:g}=r(),{mutableValues:p}=i(),m=s();if(f&&m===d){let v=p.expandToSize??g;v===0&&(v=1),u(v)}},getSize:()=>{const{group:f}=n(),d=s(),{element:g}=i(),p=f.orientation==="horizontal"?g.offsetWidth:g.offsetHeight;return{asPercentage:d,inPixels:p}},isCollapsed:()=>{const{collapsible:f,collapsedSize:d}=r(),g=s();return f&&qr(d,g)},resize:f=>{const{group:d}=n(),{element:g}=i(),p=yc({group:d}),m=Hf({groupSize:p,panelElement:g,styleProp:f}),v=ri(m/p*100);u(v)}}}function PA(t){if(t.defaultPrevented)return;const e=gu();qS(t,e).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const r=n.panels.find(i=>i.panelConstraints.defaultSize!==void 0);if(r){const i=r.panelConstraints.defaultSize,s=ZI({groupId:n.group.id,panelId:r.id});s&&i!==void 0&&(s.resize(i),t.preventDefault())}}})}function ap(t){const e=gu();for(const[n]of e)if(n.separators.some(r=>r.element===t))return n;throw Error("Could not find parent Group for separator element")}function JI({groupId:t}){const e=()=>{const n=gu();for(const[r,i]of n)if(r.id===t)return{group:r,...i};throw Error(`Could not find Group with id "${t}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=e();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:s,groupSize:a,layout:u,separatorToPanels:f}=e(),d=su({layout:n,panelConstraints:i});return r?u:(ou(u,d)||el(s,{defaultLayoutDeferred:r,derivedPanelConstraints:i,groupSize:a,layout:d,separatorToPanels:f}),d)}}}function Fa(t,e){const n=ap(t),r=ea(n.id,!0),i=n.separators.find(g=>g.element===t);yn(i,"Matching separator not found");const s=r.separatorToPanels.get(i);yn(s,"Matching panels not found");const a=s.map(g=>n.panels.indexOf(g)),u=JI({groupId:n.id}).getLayout(),f=gd({delta:e,initialLayout:u,panelConstraints:r.derivedPanelConstraints,pivotIndices:a,prevLayout:u,trigger:"keyboard"}),d=su({layout:f,panelConstraints:r.derivedPanelConstraints});ou(u,d)||el(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:d,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function zA(t){if(t.defaultPrevented)return;const e=t.currentTarget,n=ap(e);if(!n.disabled)switch(t.key){case"ArrowDown":{t.preventDefault(),n.orientation==="vertical"&&Fa(e,5);break}case"ArrowLeft":{t.preventDefault(),n.orientation==="horizontal"&&Fa(e,-5);break}case"ArrowRight":{t.preventDefault(),n.orientation==="horizontal"&&Fa(e,5);break}case"ArrowUp":{t.preventDefault(),n.orientation==="vertical"&&Fa(e,-5);break}case"End":{t.preventDefault(),Fa(e,100);break}case"Enter":{t.preventDefault();const r=ap(e),i=ea(r.id,!0),{derivedPanelConstraints:s,layout:a,separatorToPanels:u}=i,f=r.separators.find(m=>m.element===e);yn(f,"Matching separator not found");const d=u.get(f);yn(d,"Matching panels not found");const g=d[0],p=s.find(m=>m.panelId===g.id);if(yn(p,"Panel metadata not found"),p.collapsible){const m=a[g.id],v=p.collapsedSize===m?r.mutableState.expandedPanelSizes[g.id]??p.minSize:p.collapsedSize;Fa(e,v-m)}break}case"F6":{t.preventDefault();const r=ap(e).separators.map(a=>a.element),i=Array.from(r).findIndex(a=>a===t.currentTarget);yn(i!==null,"Index not found");const s=t.shiftKey?i>0?i-1:r.length-1:i+1<r.length?i+1:0;r[s].focus({preventScroll:!0});break}case"Home":{t.preventDefault(),Fa(e,-100);break}}}function NA(t){if(t.defaultPrevented||t.pointerType==="mouse"&&t.button>0)return;const e=gu(),n=qS(t,e),r=new Map;let i=!1;n.forEach(s=>{s.separator&&(i||(i=!0,s.separator.element.focus({focusVisible:!1,preventScroll:!0})));const a=e.get(s.group);a&&r.set(s.group,a.layout)}),sc({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:t.clientX,y:t.clientY},state:"active"}),n.length&&t.preventDefault()}function eD({document:t,event:e,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:s,prevCursorFlags:a}){let u=0;n.forEach(d=>{const{group:g,groupSize:p}=d,{orientation:m,panels:v}=g,{disableCursor:b}=g.mutableState;let S=0;s?m==="horizontal"?S=(e.clientX-s.x)/p*100:S=(e.clientY-s.y)/p*100:m==="horizontal"?S=e.clientX<0?-100:100:S=e.clientY<0?-100:100;const w=r.get(g),C=i.get(g);if(!w||!C)return;const{defaultLayoutDeferred:R,derivedPanelConstraints:T,groupSize:A,layout:k,separatorToPanels:P}=C;if(T&&k&&P){const M=gd({delta:S,initialLayout:w,panelConstraints:T,pivotIndices:d.panels.map(D=>v.indexOf(D)),prevLayout:k,trigger:"mouse-or-touch"});if(ou(M,k)){if(S!==0&&!b)switch(m){case"horizontal":{u|=S<0?qI:GI;break}case"vertical":{u|=S<0?WI:KI;break}}}else el(d.group,{defaultLayoutDeferred:R,derivedPanelConstraints:T,groupSize:A,layout:M,separatorToPanels:P})}});let f=0;e.movementX===0?f|=a&RA:f|=u&RA,e.movementY===0?f|=a&EA:f|=u&EA,z5(f),US(t)}function LA(t){const e=gu(),n=iu();n.state==="active"&&eD({document:t.currentTarget,event:t,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:e,prevCursorFlags:n.cursorFlags})}function BA(t){if(t.defaultPrevented)return;const e=iu(),n=gu();switch(e.state){case"active":{if(t.buttons===0){sc({cursorFlags:0,state:"inactive"}),e.hitRegions.forEach(r=>{const i=ea(r.group.id,!0);el(r.group,i,{isUserInteraction:!0})});return}for(const r of e.hitRegions)if(r.separator){const{element:i}=r.separator;i.hasPointerCapture?.(t.pointerId)||i.setPointerCapture?.(t.pointerId)}eD({document:t.currentTarget,event:t,hitRegions:e.hitRegions,initialLayoutMap:e.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:e.pointerDownAtPoint,prevCursorFlags:e.cursorFlags});break}default:{const r=qS(t,n);r.length===0?e.state!=="inactive"&&sc({cursorFlags:0,state:"inactive"}):sc({cursorFlags:0,hitRegions:r,state:"hover"}),US(t.currentTarget);break}}}function _A(t){t.relatedTarget instanceof HTMLIFrameElement&&iu().state==="hover"&&sc({cursorFlags:0,state:"inactive"})}function HA(t){t.defaultPrevented||t.pointerType==="mouse"&&t.button>0||XI(t.currentTarget)&&t.preventDefault()}function jA(t){let e=0,n=0;const r={};for(const s of t)if(s.defaultSize!==void 0){e++;const a=ri(s.defaultSize);n+=a,r[s.panelId]=a}else r[s.panelId]=void 0;const i=t.length-e;if(i!==0){const s=ri((100-n)/i);for(const a of t)a.defaultSize===void 0&&(r[a.panelId]=s)}return r}function W5(t,e,n){if(!n[0])return;const r=t.panels.find(f=>f.element===e);if(!r||!r.onResize)return;const i=yc({group:t}),s=t.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,a=r.mutableValues.prevSize,u={asPercentage:ri(s/i*100),inPixels:s};r.mutableValues.prevSize=u,r.onResize(u,r.id,a)}function K5(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Y5({group:t,nextGroupSize:e,prevGroupSize:n,prevLayout:r}){if(n<=0||e<=0||n===e)return r;let i=0,s=0,a=!1;const u=new Map,f=[];for(const p of t.panels){const m=r[p.id]??0;if(p.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){a=!0;const v=m/100*n,b=ri(v/e*100);u.set(p.id,b),i+=b}else f.push(p.id),s+=m}if(!a||f.length===0)return r;const d=100-i,g={...r};if(u.forEach((p,m)=>{g[m]=p}),s>0)for(const p of f){const m=r[p]??0;g[p]=ri(m/s*d)}else{const p=ri(d/f.length);for(const m of f)g[m]=p}return g}function X5(t,e){const n=t.map(i=>i.id),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i))return!1;return!0}const Zu=new Map;function Q5(t){let e=!0;yn(t.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=t.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,s=new n(b=>{for(const S of b){const{borderBoxSize:w,target:C}=S;if(C===t.element){if(e){const R=yc({group:t});if(R===0)return;const T=ea(t.id);if(!T)return;const A=ax(t),k=T.defaultLayoutDeferred?jA(A):T.layout,P=Y5({group:t,nextGroupSize:R,prevGroupSize:T.groupSize,prevLayout:k}),M=su({layout:P,panelConstraints:A});if(!T.defaultLayoutDeferred&&ou(T.layout,M)&&K5(T.derivedPanelConstraints,A)&&T.groupSize===R)return;el(t,{defaultLayoutDeferred:!1,derivedPanelConstraints:A,groupSize:R,layout:M,separatorToPanels:T.separatorToPanels})}}else W5(t,C,w)}});s.observe(t.element),t.panels.forEach(b=>{yn(!r.has(b.id),`Panel ids must be unique; id "${b.id}" was used more than once`),r.add(b.id),b.onResize&&s.observe(b.element)});const a=yc({group:t}),u=ax(t),f=t.panels.map(({id:b})=>b).join(",");let d=t.mutableState.defaultLayout;d&&(X5(t.panels,d)||(d=void 0));const g=t.mutableState.layouts[f]??d??jA(u),p=su({layout:g,panelConstraints:u}),m=t.element.ownerDocument;Zu.set(m,(Zu.get(m)??0)+1);const v=new Map;return UI(t).forEach(b=>{b.separator&&v.set(b.separator,b.panels)}),el(t,{defaultLayoutDeferred:a===0,derivedPanelConstraints:u,groupSize:a,layout:p,separatorToPanels:v}),t.separators.forEach(b=>{yn(!i.has(b.id),`Separator ids must be unique; id "${b.id}" was used more than once`),i.add(b.id),b.element.addEventListener("keydown",zA)}),Zu.get(m)===1&&(m.addEventListener("contextmenu",OA,!0),m.addEventListener("dblclick",PA,!0),m.addEventListener("pointerdown",NA,!0),m.addEventListener("pointerleave",LA),m.addEventListener("pointermove",BA),m.addEventListener("pointerout",_A),m.addEventListener("pointerup",HA,!0)),function(){e=!1,Zu.set(m,Math.max(0,(Zu.get(m)??0)-1)),B5(t),t.separators.forEach(b=>{b.element.removeEventListener("keydown",zA)}),Zu.get(m)||(m.removeEventListener("contextmenu",OA,!0),m.removeEventListener("dblclick",PA,!0),m.removeEventListener("pointerdown",NA,!0),m.removeEventListener("pointerleave",LA),m.removeEventListener("pointermove",BA),m.removeEventListener("pointerout",_A),m.removeEventListener("pointerup",HA,!0)),s.disconnect()}}function Z5(){const[t,e]=E.useState({}),n=E.useCallback(()=>e({}),[]);return[t,n]}function GS(t){const e=E.useId();return`${t??e}`}const pu=typeof window<"u"?E.useLayoutEffect:E.useEffect;function Wf(t){const e=E.useRef(t);return pu(()=>{e.current=t},[t]),E.useCallback((...n)=>e.current?.(...n),[e])}function WS(...t){return Wf(e=>{t.forEach(n=>{if(n)switch(typeof n){case"function":{n(e);break}case"object":{n.current=e;break}}})})}function KS(t){const e=E.useRef({...t});return pu(()=>{for(const n in t)e.current[n]=t[n]},[t]),e.current}const tD=E.createContext(null);function J5(t,e){const n=E.useRef({getLayout:()=>({}),setLayout:N5});E.useImperativeHandle(e,()=>n.current,[]),pu(()=>{Object.assign(n.current,JI({groupId:t}))})}function nD({children:t,className:e,defaultLayout:n,disableCursor:r,disabled:i,elementRef:s,groupRef:a,id:u,onLayoutChange:f,onLayoutChanged:d,orientation:g="horizontal",resizeTargetMinimumSize:p={coarse:20,fine:10},style:m,...v}){const b=E.useRef({onLayoutChange:{},onLayoutChanged:{}}),S=Wf(N=>{ou(b.current.onLayoutChange,N)||(b.current.onLayoutChange=N,f?.(N))}),w=Wf((N,_)=>{ou(b.current.onLayoutChanged,N)||(b.current.onLayoutChanged=N,d?.(N,{isUserInteraction:_}))}),C=GS(u),R=E.useRef(null),[T,A]=Z5(),k=E.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:p,separators:[]}),P=WS(R,s);J5(C,a);const M=Wf((N,_)=>{const $=iu(),F=MA(N),G=ea(N);if(G){let j=!1;return $.state==="active"&&(j=$.hitRegions.some(q=>q.group===F)),{flexGrow:G.layout[_]??1,pointerEvents:j?"none":void 0}}if(n?.[_])return{flexGrow:n?.[_]}}),D=KS({defaultLayout:n,disableCursor:r}),L=E.useMemo(()=>({get disableCursor(){return!!D.disableCursor},getPanelStyles:M,id:C,orientation:g,registerPanel:N=>{const _=k.current;return _.panels=ux(g,[..._.panels,N]),A(),()=>{_.panels=_.panels.filter($=>$!==N),A()}},registerSeparator:N=>{const _=k.current;return _.separators=ux(g,[..._.separators,N]),A(),()=>{_.separators=_.separators.filter($=>$!==N),A()}},updatePanelProps:(N,{disabled:_})=>{const $=k.current.panels.find(j=>j.id===N);$&&($.panelConstraints.disabled=_);const F=MA(C),G=ea(C);F&&G&&el(F,{...G,derivedPanelConstraints:ax(F)})},updateSeparatorProps:(N,{disabled:_,disableDoubleClick:$})=>{const F=k.current.separators.find(G=>G.id===N);F&&(F.disabled=_,F.disableDoubleClick=$)}}),[M,C,A,g,D]),H=E.useRef(null);return pu(()=>{const N=R.current;if(N===null)return;const _=k.current;let $;if(D.defaultLayout!==void 0&&Object.keys(D.defaultLayout).length===_.panels.length){$={};for(const J of _.panels){const z=D.defaultLayout[J.id];z!==void 0&&($[J.id]=z)}}const F={disabled:!!i,element:N,id:C,mutableState:{defaultLayout:$,disableCursor:!!D.disableCursor,expandedPanelSizes:k.current.lastExpandedPanelSizes,layouts:k.current.layouts},orientation:g,panels:_.panels,resizeTargetMinimumSize:_.resizeTargetMinimumSize,separators:_.separators};H.current=F;const G=Q5(F),{defaultLayoutDeferred:j,derivedPanelConstraints:q,layout:V}=ea(F.id,!0);!j&&q.length>0&&(S(V),w(V,!1));const te=$S(C,J=>{const{defaultLayoutDeferred:z,derivedPanelConstraints:U,layout:W}=J.next;if(z||U.length===0)return;const X=F.panels.map(({id:ee})=>ee).join(",");F.mutableState.layouts[X]=W,U.forEach(ee=>{if(ee.collapsible){const{layout:ue}=J.prev??{};if(ue){const Y=qr(ee.collapsedSize,W[ee.panelId]),le=qr(ee.collapsedSize,ue[ee.panelId]);Y&&!le&&(F.mutableState.expandedPanelSizes[ee.panelId]=ue[ee.panelId])}}});const ie=iu().state!=="active";S(W),ie&&w(W,J.isUserInteraction)});return()=>{H.current=null,G(),te()}},[i,C,w,S,g,T,D]),E.useEffect(()=>{const N=H.current;N&&(N.mutableState.defaultLayout=n,N.mutableState.disableCursor=!!r)}),O.jsx(tD.Provider,{value:L,children:O.jsx("div",{...v,className:e,"data-group":!0,"data-testid":C,id:C,ref:P,style:{height:"100%",width:"100%",overflow:"hidden",...m,display:"flex",flexDirection:g==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:g==="horizontal"?"pan-y":"pan-x"},children:t})})}nD.displayName="Group";function YS(){const t=E.useContext(tD);return yn(t,"Group Context not found; did you render a Panel or Separator outside of a Group?"),t}function e8(t,e){const{id:n}=YS(),r=E.useRef({collapse:O0,expand:O0,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:O0});E.useImperativeHandle(e,()=>r.current,[]),pu(()=>{Object.assign(r.current,ZI({groupId:n,panelId:t}))})}function rD({children:t,className:e,collapsedSize:n="0%",collapsible:r=!1,defaultSize:i,disabled:s,elementRef:a,groupResizeBehavior:u="preserve-relative-size",id:f,maxSize:d="100%",minSize:g="0%",onResize:p,panelRef:m,style:v,...b}){const S=!!f,w=GS(f),C=KS({disabled:s}),R=E.useRef(null),T=WS(R,a),{getPanelStyles:A,id:k,orientation:P,registerPanel:M,updatePanelProps:D}=YS(),L=p!==null,H=Wf((F,G,j)=>{p?.(F,f,j)});pu(()=>{const F=R.current;if(F!==null){const G={element:F,id:w,idIsStable:S,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:L?H:void 0,panelConstraints:{groupResizeBehavior:u,collapsedSize:n,collapsible:r,defaultSize:i,disabled:C.disabled,maxSize:d,minSize:g}};return M(G)}},[u,n,r,i,L,w,S,d,g,H,M,C]),E.useEffect(()=>{D(w,{disabled:s})},[s,w,D]),e8(w,m);const N=()=>{const F=A(k,w);if(F)return JSON.stringify(F)},_=E.useSyncExternalStore(F=>$S(k,F),N,N);let $;return _?$=JSON.parse(_):i!==void 0?$={flexGrow:void 0,flexShrink:void 0,flexBasis:i}:$={flexGrow:1},O.jsx("div",{...b,"data-disabled":s||void 0,"data-panel":!0,"data-testid":w,id:w,ref:T,style:{...t8,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...$},children:O.jsx("div",{className:e,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...v,touchAction:P==="horizontal"?"pan-y":"pan-x"},children:t})})}rD.displayName="Panel";const t8={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function n8({layout:t,panelConstraints:e,panelId:n,panelIndex:r}){let i,s;const a=t[n],u=e.find(f=>f.panelId===n);if(u){const f=u.maxSize,d=u.collapsible?u.collapsedSize:u.minSize,g=[r,r+1];s=su({layout:gd({delta:d-a,initialLayout:t,panelConstraints:e,pivotIndices:g,prevLayout:t}),panelConstraints:e})[n],i=su({layout:gd({delta:f-a,initialLayout:t,panelConstraints:e,pivotIndices:g,prevLayout:t}),panelConstraints:e})[n]}return{valueControls:n,valueMax:i,valueMin:s,valueNow:a}}function iD({children:t,className:e,disabled:n,disableDoubleClick:r,elementRef:i,id:s,style:a,...u}){const f=GS(s),d=KS({disabled:n,disableDoubleClick:r}),[g,p]=E.useState({}),[m,v]=E.useState("inactive"),[b,S]=E.useState(!1),w=E.useRef(null),C=WS(w,i),{disableCursor:R,id:T,orientation:A,registerSeparator:k,updateSeparatorProps:P}=YS(),M=A==="horizontal"?"vertical":"horizontal";pu(()=>{const H=w.current;if(H!==null){const N={disabled:d.disabled,disableDoubleClick:d.disableDoubleClick,element:H,id:f},_=k(N),$=P5(G=>{v(G.next.state!=="inactive"&&G.next.hitRegions.some(j=>j.separator===N)?G.next.state:"inactive")}),F=$S(T,G=>{const{derivedPanelConstraints:j,layout:q,separatorToPanels:V}=G.next,te=V.get(N);if(te){const J=te[0],z=te.indexOf(J);p(n8({layout:q,panelConstraints:j,panelId:J.id,panelIndex:z}))}});return()=>{$(),F(),_()}}},[T,f,k,d]),E.useEffect(()=>{P(f,{disabled:n,disableDoubleClick:r})},[n,r,f,P]);let D;n&&!R&&(D="not-allowed");let L;return n?L="disabled":m==="active"?L="active":b?L="focus":L=m,O.jsx("div",{...u,"aria-controls":g.valueControls,"aria-disabled":n||void 0,"aria-orientation":M,"aria-valuemax":g.valueMax,"aria-valuemin":g.valueMin,"aria-valuenow":g.valueNow,children:t,className:e,"data-separator":L,"data-testid":f,id:f,onBlur:()=>S(!1),onFocus:()=>S(!0),ref:C,role:"separator",style:{flexBasis:"auto",cursor:D,...a,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}iD.displayName="Separator";var r8={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const i8=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),o8=(t,e)=>{const n=E.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:a,children:u,...f},d)=>E.createElement("svg",{ref:d,...r8,width:i,height:i,stroke:r,strokeWidth:a?Number(s)*24/Number(i):s,className:`lucide lucide-${i8(t)}`,...f},[...e.map(([g,p])=>E.createElement(g,p)),...(Array.isArray(u)?u:[u])||[]]));return n.displayName=`${t}`,n};var Qn=o8;const s8=Qn("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),l8=Qn("CheckCircle2",[["path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z",key:"14v8dr"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),oD=Qn("Check",[["polyline",{points:"20 6 9 17 4 12",key:"10jjfj"}]]),a8=Qn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),XS=Qn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),u8=Qn("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),QS=Qn("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),VA=Qn("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),c8=Qn("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),f8=Qn("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),d8=Qn("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),h8=Qn("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),g8=Qn("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),sD=Qn("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]),p8=Qn("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),m8=Qn("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),y8=Qn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),v8=Qn("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),FA=Qn("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),b8=Qn("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]),lD=Qn("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),ZS=Qn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),aD={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},JS={...aD,position:"fixed",top:0,left:0},ew={...aD,position:"absolute"},UA={};function Sr(t,e){const n=E.useRef(UA);return n.current===UA&&(n.current=t(e)),n}function tl(t,e,n,r){const i=Sr(uD).current;return S8(i,t,e,n,r)&&cD(i,[t,e,n,r]),i.callback}function x8(t){const e=Sr(uD).current;return w8(e,t)&&cD(e,t),e.callback}function uD(){return{callback:null,cleanup:null,refs:[]}}function S8(t,e,n,r,i){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==r||t.refs[3]!==i}function w8(t,e){return t.refs.length!==e.length||t.refs.some((n,r)=>n!==e[r])}function cD(t,e){if(t.refs=e,e.every(n=>n==null)){t.callback=null;return}t.callback=n=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),n!=null){const r=Array(e.length).fill(null);for(let i=0;i<e.length;i+=1){const s=e[i];if(s!=null)switch(typeof s){case"function":{const a=s(n);typeof a=="function"&&(r[i]=a);break}case"object":{s.current=n;break}}}t.cleanup=()=>{for(let i=0;i<e.length;i+=1){const s=e[i];if(s!=null)switch(typeof s){case"function":{const a=r[i];typeof a=="function"?a():s(null);break}case"object":{s.current=null;break}}}}}}}function fD(t){const e=E.useRef(!0);e.current&&(e.current=!1,t())}function C8(t){const[e,n]=E.useState({current:t,previous:null});return Object.is(t,e.current)||n({current:t,previous:e.current}),e.previous}function dD(t){return t==null||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}function Ja({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=E.useRef(t!==void 0),[s,a]=E.useState(e),u=i?t:s,f=E.useCallback(d=>{i||a(d)},[]);return[u,f]}const R8=()=>{},Me=typeof document<"u"?E.useLayoutEffect:R8,tw={...JV},k0=tw.useInsertionEffect,E8=k0&&k0!==tw.useLayoutEffect?k0:t=>t();function Re(t){const e=Sr(T8).current;return e.next=t,E8(e.effect),e.trampoline}function T8(){const t={next:void 0,callback:A8,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function A8(){}function Fn(t){const e=Sr(M8,t).current;return e.next=t,Me(e.effect),e}function M8(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}function O8(t,e){return function(r,...i){const s=new URL(t);return s.searchParams.set("code",r.toString()),i.forEach(a=>s.searchParams.append("args[]",a)),`${e} error #${r}; visit ${s} for the full message.`}}const Un=O8("https://base-ui.com/production-error","Base UI");var I0={exports:{}},D0={};var $A;function k8(){if($A)return D0;$A=1;var t=Nd();function e(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,a=t.useDebugValue;function u(p,m){var v=m(),b=r({inst:{value:v,getSnapshot:m}}),S=b[0].inst,w=b[1];return s(function(){S.value=v,S.getSnapshot=m,f(S)&&w({inst:S})},[p,v,m]),i(function(){return f(S)&&w({inst:S}),p(function(){f(S)&&w({inst:S})})},[p]),a(v),v}function f(p){var m=p.getSnapshot;p=p.value;try{var v=m();return!n(p,v)}catch{return!0}}function d(p,m){return m()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:u;return D0.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:g,D0}var qA;function hD(){return qA||(qA=1,I0.exports=k8()),I0.exports}var nw=hD(),P0={exports:{}},z0={};var GA;function I8(){if(GA)return z0;GA=1;var t=Nd(),e=hD();function n(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,a=t.useEffect,u=t.useMemo,f=t.useDebugValue;return z0.useSyncExternalStoreWithSelector=function(d,g,p,m,v){var b=s(null);if(b.current===null){var S={hasValue:!1,value:null};b.current=S}else S=b.current;b=u(function(){function C(P){if(!R){if(R=!0,T=P,P=m(P),v!==void 0&&S.hasValue){var M=S.value;if(v(M,P))return A=M}return A=P}if(M=A,r(T,P))return M;var D=m(P);return v!==void 0&&v(M,D)?(T=P,M):(T=P,A=D)}var R=!1,T,A,k=p===void 0?null:p;return[function(){return C(g())},k===null?void 0:function(){return C(k())}]},[g,p,m,v]);var w=i(d,b[0],b[1]);return a(function(){S.hasValue=!0,S.value=w},[w]),f(w),w},z0}var WA;function D8(){return WA||(WA=1,P0.exports=I8()),P0.exports}var P8=D8();const z8=parseInt(E.version,10);function rw(t){return z8>=t}const cx=[];let fx;function N8(){return fx}function L8(t){cx.push(t)}function gD(t){const e=(n,r)=>{const i=Sr(_8).current;let s;try{fx=i;for(const a of cx)a.before(i);s=t(n,r);for(const a of cx)a.after(i);i.didInitialize=!0}finally{fx=void 0}return s};return e.displayName=t.displayName||t.name,e}function B8(t){return E.forwardRef(gD(t))}function _8(){return{didInitialize:!1}}const H8=rw(19),j8=H8?F8:U8;function pe(t,e,n,r,i){return j8(t,e,n,r,i)}function V8(t,e,n,r,i){const s=E.useCallback(()=>e(t.getSnapshot(),n,r,i),[t,e,n,r,i]);return nw.useSyncExternalStore(t.subscribe,s,s)}L8({before(t){t.syncIndex=0,t.didInitialize||(t.syncTick=1,t.syncHooks=[],t.didChangeStore=!0,t.getSnapshot=()=>{let e=!1;for(let n=0;n<t.syncHooks.length;n+=1){const r=t.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(e=!0,r.value=i)}return e&&(t.syncTick+=1),t.syncTick})},after(t){t.syncHooks.length>0&&(t.didChangeStore&&(t.didChangeStore=!1,t.subscribe=e=>{const n=new Set;for(const i of t.syncHooks)n.add(i.store);const r=[];for(const i of n)r.push(i.subscribe(e));return()=>{for(const i of r)i()}}),nw.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot))}});function F8(t,e,n,r,i){const s=N8();if(!s)return V8(t,e,n,r,i);const a=s.syncIndex;s.syncIndex+=1;let u;return s.didInitialize?(u=s.syncHooks[a],(u.store!==t||u.selector!==e||!Object.is(u.a1,n)||!Object.is(u.a2,r)||!Object.is(u.a3,i))&&(u.store!==t&&(s.didChangeStore=!0),u.store=t,u.selector=e,u.a1=n,u.a2=r,u.a3=i,u.value=e(t.getSnapshot(),n,r,i))):(u={store:t,selector:e,a1:n,a2:r,a3:i,value:e(t.getSnapshot(),n,r,i)},s.syncHooks.push(u)),u.value}function U8(t,e,n,r,i){return P8.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,s=>e(s,n,r,i))}class pD{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(e)}}update(e){for(const n in e)if(!Object.is(this.state[n],e[n])){this.setState({...this.state,...e});return}}set(e,n){Object.is(this.state[e],n)||this.setState({...this.state,[e]:n})}notifyAll(){const e={...this.state};this.setState(e)}use(e,n,r,i){return pe(this,e,n,r,i)}}function Tn(){}const Pi=Object.freeze([]),zn=Object.freeze({});class fm extends pD{constructor(e,n={},r){super(e),this.context=n,this.selectors=r}useSyncedValue(e,n){E.useDebugValue(e);const r=this;Me(()=>{r.state[e]!==n&&r.set(e,n)},[r,e,n])}useSyncedValueWithCleanup(e,n){const r=this;Me(()=>(r.state[e]!==n&&r.set(e,n),()=>{r.set(e,void 0)}),[r,e,n])}useSyncedValues(e){const n=this,r=Object.values(e);Me(()=>{n.update(e)},[n,...r])}useControlledProp(e,n){E.useDebugValue(e);const r=this,i=n!==void 0;Me(()=>{i&&!Object.is(r.state[e],n)&&r.setState({...r.state,[e]:n})},[r,e,n,i])}select(e,n,r,i){const s=this.selectors[e];return s(this.state,n,r,i)}useState(e,n,r,i){return E.useDebugValue(e),pe(this,this.selectors[e],n,r,i)}useContextCallback(e,n){E.useDebugValue(e);const r=Re(n??Tn);this.context[e]=r}useStateSetter(e){const n=E.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(e,r)}),n.current}observe(e,n){let r;typeof e=="function"?r=e:r=this.selectors[e];let i=r(this.state);return n(i,i,this),this.subscribe(s=>{const a=r(s);if(!Object.is(i,a)){const u=i;i=a,n(a,u,this)}})}}function dm(){return typeof window<"u"}function Lr(t){return iw(t)?(t.nodeName||"").toLowerCase():"#document"}function An(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ol(t){var e;return(e=(iw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function iw(t){return dm()?t instanceof Node||t instanceof An(t).Node:!1}function Ot(t){return dm()?t instanceof Element||t instanceof An(t).Element:!1}function fn(t){return dm()?t instanceof HTMLElement||t instanceof An(t).HTMLElement:!1}function vc(t){return!dm()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof An(t).ShadowRoot}function Bd(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=bi(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function $8(t){return/^(table|td|th)$/.test(Lr(t))}function hm(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const q8=/transform|translate|scale|rotate|perspective|filter/,G8=/paint|layout|strict|content/,Ua=t=>!!t&&t!=="none";let N0;function ow(t){const e=Ot(t)?bi(t):t;return Ua(e.transform)||Ua(e.translate)||Ua(e.scale)||Ua(e.rotate)||Ua(e.perspective)||!sw()&&(Ua(e.backdropFilter)||Ua(e.filter))||q8.test(e.willChange||"")||G8.test(e.contain||"")}function W8(t){let e=ia(t);for(;fn(e)&&!ta(e);){if(ow(e))return e;if(hm(e))return null;e=ia(e)}return null}function sw(){return N0==null&&(N0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),N0}function ta(t){return/^(html|body|#document)$/.test(Lr(t))}function bi(t){return An(t).getComputedStyle(t)}function gm(t){return Ot(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ia(t){if(Lr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||vc(t)&&t.host||ol(t);return vc(e)?e.host:e}function mD(t){const e=ia(t);return ta(e)?(t.ownerDocument||t).body:fn(e)&&Bd(e)?e:mD(e)}function bc(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=mD(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),a=An(i);if(s){const u=dx(a);return e.concat(a,a.visualViewport||[],Bd(i)?i:[],u&&n?bc(u):[])}else return e.concat(i,bc(i,[],n))}function dx(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ps(...t){return()=>{for(let e=0;e<t.length;e+=1){const n=t[e];n&&n()}}}function Vt(t){return t?.ownerDocument||document}function At(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function lw(t){E.useEffect(t,Pi)}const xg=null;class K8{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let i=0;i<n.length;i+=1)n[i]?.(e)};request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let Sg=new K8;class is{static create(){return new is}static request(e){return Sg.request(e)}static cancel(e){return Sg.cancel(e)}currentId=xg;request(e){this.cancel(),this.currentId=Sg.request(()=>{this.currentId=xg,e()})}cancel=()=>{this.currentId!==xg&&(Sg.cancel(this.currentId),this.currentId=xg)};disposeEffect=()=>this.cancel}function xc(){const t=Sr(is.create).current;return lw(t.disposeEffect),t}const If=0;class zo{static create(){return new zo}currentId=If;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=If,n()},e)}isStarted(){return this.currentId!==If}clear=()=>{this.currentId!==If&&(clearTimeout(this.currentId),this.currentId=If)};disposeEffect=()=>this.clear}function ii(){const t=Sr(zo.create).current;return lw(t.disposeEffect),t}function Y8(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:X8,platform:Q8,maxTouchPoints:Z8}=Y8(),pm=X8.toLowerCase(),pd=Q8.toLowerCase(),_d=/^i(os$|p)/.test(pd)||pd==="macintel"&&Z8>1,KA="android",Mp=pd===KA||pm.includes(KA),yD=!_d&&pd.startsWith("mac");pd.startsWith("win");const J8=yD||_d,sl=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),YA=!sl&&pm.includes("firefox");!sl&&pm.includes("chrom");const e6=J8,aw=/jsdom|happydom/.test(pm);function Dr(t){t.preventDefault(),t.stopPropagation()}function t6(t){return"nativeEvent"in t}function uw(t){return t.pointerType===""&&t.isTrusted?!0:Mp&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function cw(t){return aw?!1:!Mp&&t.width===0&&t.height===0||Mp&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function na(t,e){const n=["mouse","pen"];return e||n.push("",void 0),n.includes(t)}function n6(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}const hx="data-base-ui-focusable",vD="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",eu="ArrowLeft",tu="ArrowRight",fw="ArrowUp",mm="ArrowDown";function Gr(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Qe(t,e){if(!t||!e)return!1;const n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&vc(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function Yn(t){return"composedPath"in t?t.composedPath()[0]:t.target}function Op(t,e){if(!Ot(t))return!1;const n=t;if(e.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of e.entries())if(Qe(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function L0(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function r6(t){return t.matches("html,body")}function ym(t){return fn(t)&&t.matches(vD)}function bD(t){return t?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${vD}`)!=null}function gx(t){return t?t.getAttribute("role")==="combobox"&&ym(t):!1}function i6(t){if(!t||aw)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function kp(t){return t?t.hasAttribute(hx)?t:t.querySelector(`[${hx}]`)||t:null}function o6(t,e){return e!=null&&!na(e)?0:typeof t=="function"?t():t}function oa(t,e,n){const r=o6(t,n);return typeof r=="number"?r:r?.[e]}function XA(t){return typeof t=="function"?t():t}function xD(t,e){return e||t==="click"||t==="mousedown"}function s6(t){return t?.includes("mouse")&&t!=="mousedown"}const yr="none",Hd="trigger-press",mi="trigger-hover",up="trigger-focus",vm="outside-press",cp="item-press",SD="close-press",QA="clear-press",Kf="input-change",ns="input-clear",wD="input-press",jd="focus-out",Vd="escape-key",ZA="list-navigation",dw="keyboard",hw="pointer",l6="cancel-open",CD="disabled",JA="missing",eM="initial",RD="imperative-action",a6="window-resize";function Xe(t,e,n,r){let i=!1,s=!1;const a=r??zn;return{reason:t,event:e??new Event("base-ui"),cancel(){i=!0},allowPropagation(){s=!0},get isCanceled(){return i},get isPropagationAllowed(){return s},trigger:n,...a}}function u6(t,e,n){const r=n??zn;return{reason:t,event:e??new Event("base-ui"),...r}}const ED=E.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new zo,currentIdRef:{current:null},currentContextRef:{current:null}});function c6(t,e){t.current=e.current}function f6(t){const{children:e,delay:n,timeoutMs:r=0}=t,i=E.useRef(n),s=E.useRef(n),a=E.useRef(null),u=E.useRef(null),f=ii();return Me(()=>{if(s.current=n,!a.current){i.current=n;return}i.current={open:oa(i.current,"open"),close:oa(n,"close")}},[n,a,i,s]),O.jsx(ED.Provider,{value:E.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:s,currentIdRef:a,timeoutMs:r,currentContextRef:u,timeout:f}),[r,f]),children:e})}function d6(t,e={open:!1}){const{open:n}=e,r="rootStore"in t?t.rootStore:t,i=r.useState("floatingId"),s=E.useContext(ED),{currentIdRef:a,delayRef:u,timeoutMs:f,initialDelayRef:d,currentContextRef:g,hasProvider:p,timeout:m}=s,[v,b]=E.useState(!1),S=E.useRef(n);return Me(()=>{S.current=n},[n]),Me(()=>{function w(){g.current?.setIsInstantPhase(!1),a.current=null,g.current=null,u.current=d.current,m.clear()}if(a.current&&!n&&a.current===i){if(b(!1),f){const C=i;return m.start(f,()=>{r.select("open")||a.current&&a.current!==C||w()}),()=>{(S.current||a.current!==C)&&m.clear()}}w()}},[n,i,a,u,f,d,g,m,r]),Me(()=>{if(!n)return;const w=g.current,C=a.current;m.clear(),g.current={onOpenChange:r.setOpen,setIsInstantPhase:b},a.current=i,u.current={open:0,close:oa(d.current,"close")},C!==null&&C!==i?(b(!0),w?.setIsInstantPhase(!0),w?.onOpenChange(!1,Xe(yr))):(b(!1),w?.setIsInstantPhase(!1))},[n,i,r,a,u,d,g,m]),Me(()=>()=>{if(a.current===i){if(g.current=null,!S.current)return;a.current=null,c6(u,d),m.clear()}},[g,a,u,i,d,m]),E.useMemo(()=>({hasProvider:p,delayRef:u,isInstantPhase:v}),[p,u,v])}const Ip=E.forwardRef(function(e,n){const[r,i]=E.useState();Me(()=>{e6&&sl&&i("button")},[]);const s={tabIndex:0,role:r};return O.jsx("span",{...e,ref:n,style:JS,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})}),Sc=Math.min,Qs=Math.max,Dp=Math.round,Wa=Math.floor,Zs=t=>({x:t,y:t}),h6={left:"right",right:"left",bottom:"top",top:"bottom"};function TD(t,e,n){return Qs(t,Sc(e,n))}function sa(t,e){return typeof t=="function"?t(e):t}function so(t){return t.split("-")[0]}function ha(t){return t.split("-")[1]}function gw(t){return t==="x"?"y":"x"}function pw(t){return t==="y"?"height":"width"}function eo(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function mw(t){return gw(eo(t))}function g6(t,e,n){n===void 0&&(n=!1);const r=ha(t),i=mw(t),s=pw(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=Pp(a)),[a,Pp(a)]}function p6(t){const e=Pp(t);return[px(t),e,px(e)]}function px(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const tM=["left","right"],nM=["right","left"],m6=["top","bottom"],y6=["bottom","top"];function v6(t,e,n){switch(t){case"top":case"bottom":return n?e?nM:tM:e?tM:nM;case"left":case"right":return e?m6:y6;default:return[]}}function b6(t,e,n,r){const i=ha(t);let s=v6(so(t),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(px)))),s}function Pp(t){const e=so(t);return h6[e]+t.slice(e.length)}function x6(t){var e,n,r,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(i=t.left)!=null?i:0}}function AD(t){return typeof t!="number"?x6(t):{top:t,right:t,bottom:t,left:t}}function md(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function wg(t,e,n){return Math.floor(t/e)!==n}function ra(t,e){return e<0||e>=t.length}function fp(t,e){return Er(t.current,{disabledIndices:e})}function mx(t,e){return Er(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}function Er(t,{startingIndex:e=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let s=e;do s+=n?-i:i;while(s>=0&&s<=t.length-1&&wc(t,s,r));return s}function S6(t,{event:e,orientation:n,loopFocus:r,onLoop:i,rtl:s,cols:a,disabledIndices:u,minIndex:f,maxIndex:d,prevIndex:g,stopEvent:p=!1}){let m=g,v;if(e.key===fw?v="up":e.key===mm&&(v="down"),v){const b=[],S=[];let w=!1,C=0;{let L=null,H=-1;t.forEach((N,_)=>{if(N==null)return;C+=1;const $=N.closest('[role="row"]');$&&(w=!0),($!==L||H===-1)&&(L=$,H+=1,b[H]=[]),b[H].push(_),S[_]=H})}let R=!1,T=0;if(w)for(const L of b){const H=L.length;H>T&&(T=H),H!==a&&(R=!0)}const A=R&&C<t.length,k=T||a,P=L=>{if(!R||g===-1)return;const H=S[g];if(H==null)return;const N=b[H].indexOf(g),_=L==="up"?-1:1;for(let $=H+_,F=0;F<b.length;F+=1,$+=_){if($<0||$>=b.length){if(!r||A)return;if($=$<0?b.length-1:0,i){const j=Math.min(N,b[$].length-1),q=b[$][j]??b[$][0],V=i(e,g,q);$=S[V]??$}}const G=b[$];for(let j=Math.min(N,G.length-1);j>=0;j-=1){const q=G[j];if(!wc(t,q,u))return q}}},M=L=>{if(!A||g===-1)return;const H=g%k,N=L==="up"?-k:k,_=d-d%k,$=Wa(d/k)+1;for(let F=g-H+N,G=0;G<$;G+=1,F+=N){if(F<0||F>d){if(!r)return;F=F<0?_:0}const j=Math.min(F+k-1,d);for(let q=Math.min(F+H,j);q>=F;q-=1)if(!wc(t,q,u))return q}};p&&Dr(e);const D=P(v)??M(v);if(D!==void 0)m=D;else if(g===-1)m=v==="up"?d:f;else if(m=Er(t,{startingIndex:g,amount:k,decrement:v==="up",disabledIndices:u}),r){if(v==="up"&&(g-k<f||m<0)){const L=g%k,H=d%k,N=d-(H-L);H===L?m=d:m=H>L?N:N-k,i&&(m=i(e,g,m))}v==="down"&&g+k>d&&(m=Er(t,{startingIndex:g%k-k,amount:k,disabledIndices:u}),i&&(m=i(e,g,m)))}ra(t,m)&&(m=g)}if(n==="both"){const b=Wa(g/a);e.key===(s?eu:tu)&&(p&&Dr(e),g%a!==a-1?(m=Er(t,{startingIndex:g,disabledIndices:u}),r&&wg(m,a,b)&&(m=Er(t,{startingIndex:g-g%a-1,disabledIndices:u}),i&&(m=i(e,g,m)))):r&&(m=Er(t,{startingIndex:g-g%a-1,disabledIndices:u}),i&&(m=i(e,g,m))),wg(m,a,b)&&(m=g)),e.key===(s?tu:eu)&&(p&&Dr(e),g%a!==0?(m=Er(t,{startingIndex:g,decrement:!0,disabledIndices:u}),r&&wg(m,a,b)&&(m=Er(t,{startingIndex:g+(a-g%a),decrement:!0,disabledIndices:u}),i&&(m=i(e,g,m)))):r&&(m=Er(t,{startingIndex:g+(a-g%a),decrement:!0,disabledIndices:u}),i&&(m=i(e,g,m))),wg(m,a,b)&&(m=g));const S=Wa(d/a)===b;ra(t,m)&&(r&&S?(m=e.key===(s?tu:eu)?d:Er(t,{startingIndex:g-g%a-1,disabledIndices:u}),i&&(m=i(e,g,m))):m=g)}return m}function wc(t,e,n){if(typeof n=="function"?n(e):n?.includes(e)??!1)return!0;const i=t[e];return i?!bm(i)||i.matches(":disabled")?!0:!n&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!1}function w6(t){return t.visibility==="hidden"||t.visibility==="collapse"}function bm(t,e=t?bi(t):null){return!t||!t.isConnected||!e||w6(e)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():e.display!=="none"&&e.display!=="contents"}const C6='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function R6(t){const e=t.assignedSlot;if(e)return e;if(t.parentElement)return t.parentElement;const n=t.getRootNode();return vc(n)?n.host:null}function yx(t){for(const e of Array.from(t.children))if(Lr(e)==="summary")return e;return null}function E6(t,e){const n=yx(e);return!!n&&(t===n||Qe(n,t))}function MD(t){const e=t?Lr(t):"";return t!=null&&t.matches(C6)&&(e!=="summary"||t.parentElement!=null&&Lr(t.parentElement)==="details"&&yx(t.parentElement)===t)&&(e!=="details"||yx(t)==null)&&(e!=="input"||t.type!=="hidden")}function OD(t){if(!MD(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let e=t;e;e=R6(e)){const n=e!==t,r=Lr(e)==="slot";if(e.hasAttribute("inert")||n&&Lr(e)==="details"&&!e.open&&!E6(t,e)||e.hasAttribute("hidden")||!r&&!T6(e,n))return!1}return!0}function T6(t,e){const n=bi(t);return e?n.display!=="none":bm(t,n)}function kD(t){const e=t.tabIndex;if(e<0){const n=Lr(t);if(n==="details"||n==="audio"||n==="video"||fn(t)&&t.isContentEditable)return 0}return e}function B0(t){if(Lr(t)!=="input")return null;const e=t;return e.type==="radio"&&e.name!==""?e:null}function A6(t,e){const n=B0(t);if(!n)return!0;const r=e.find(i=>{const s=B0(i);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:e.find(i=>{const s=B0(i);return s?.name===n.name&&s.form===n.form})===n}function ID(t){if(fn(t)&&Lr(t)==="slot"){const e=t.assignedElements({flatten:!0});if(e.length>0)return e}return fn(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function DD(t,e){ID(t).forEach(n=>{MD(n)&&e.push(n),DD(n,e)})}function PD(t,e,n){ID(t).forEach(r=>{fn(r)&&r.matches(e)&&n.push(r),PD(r,e,n)})}function yw(t){return OD(t)&&kD(t)>=0}function zD(t){const e=[];return DD(t,e),e.filter(OD)}function xm(t){const e=zD(t);return e.filter(n=>kD(n)>=0&&A6(n,e))}function ND(t,e){const n=xm(t),r=n.length;if(r===0)return;const i=Gr(Vt(t)),s=n.indexOf(i),a=s===-1?e===1?0:r-1:s+e;return n[a]}function LD(t){return ND(Vt(t).body,1)||t}function BD(t){return ND(Vt(t).body,-1)||t}function Yf(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!Qe(n,r)}function M6(t){xm(t).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function rM(t){const e=[];PD(t,"[data-tabindex]",e),e.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function la(t,e,n=!0){return t.filter(i=>i.parentId===e).flatMap(i=>[...!n||i.context?.open?[i]:[],...la(t,i.id,n)])}function iM(t,e){let n=[],r=t.find(i=>i.id===e)?.parentId;for(;r;){const i=t.find(s=>s.id===r);r=i?.parentId,i&&(n=n.concat(i))}return n}function yd(t){return`data-base-ui-${t}`}let Cg=0;function dp(t,e={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=e;cancelAnimationFrame(Cg);function s(){i&&!i()||t?.focus({preventScroll:n})}if(r)return s(),Tn;const a=requestAnimationFrame(s);return Cg=a,()=>{Cg===a&&(cancelAnimationFrame(a),Cg=0)}}const _0={inert:new WeakMap,"aria-hidden":new WeakMap},oM="data-base-ui-inert",vx={inert:new WeakSet,"aria-hidden":new WeakSet};let Df=new WeakMap,H0=0;function O6(t){return vx[t]}function _D(t){return t?vc(t)?t.host:_D(t.parentNode):null}const sM=(t,e)=>e.map(n=>{if(t.contains(n))return n;const r=_D(n);return t.contains(r)?r:null}).filter(n=>n!=null),lM=t=>{const e=new Set;return t.forEach(n=>{let r=n;for(;r&&!e.has(r);)e.add(r),r=r.parentNode}),e},aM=(t,e,n)=>{const r=[],i=s=>{!s||n.has(s)||Array.from(s.children).forEach(a=>{Lr(a)!=="script"&&(e.has(a)?i(a):r.push(a))})};return i(t),r};function k6(t,e,n,r,{mark:i=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let a=null,u=null;const f=sM(e,t),d=i?aM(e,lM(f),new Set(f)):[],g=[],p=[];if(s){const m=_0[s],v=O6(s);u=v,a=m;const b=sM(e,Array.from(e.querySelectorAll("[aria-live]"))),S=f.concat(b);aM(e,lM(S),new Set(S)).forEach(C=>{const R=C.getAttribute(s),T=R!==null&&R!=="false",A=(m.get(C)||0)+1;m.set(C,A),g.push(C),A===1&&T&&v.add(C),T||C.setAttribute(s,s==="inert"?"":"true")})}return i&&d.forEach(m=>{const v=(Df.get(m)||0)+1;Df.set(m,v),p.push(m),v===1&&m.setAttribute(oM,"")}),H0+=1,()=>{a&&g.forEach(m=>{const b=(a.get(m)||0)-1;a.set(m,b),b||(!u?.has(m)&&s&&m.removeAttribute(s),u?.delete(m))}),i&&p.forEach(m=>{const v=(Df.get(m)||0)-1;Df.set(m,v),v||m.removeAttribute(oM)}),H0-=1,H0||(_0.inert=new WeakMap,_0["aria-hidden"]=new WeakMap,vx.inert=new WeakSet,vx["aria-hidden"]=new WeakSet,Df=new WeakMap)}}function uM(t,e={}){const{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=e,s=Vt(t[0]).body;return k6(t,s,n,r,{mark:i})}let cM=0;function I6(t,e="mui"){const[n,r]=E.useState(t),i=t||n;return E.useEffect(()=>{n==null&&(cM+=1,r(`${e}-${cM}`))},[n,e]),i}const fM=tw.useId;function Sm(t,e){if(fM!==void 0){const n=fM();return t??(e?`${e}-${n}`:n)}return I6(t,e)}function dM(t){if(!E.isValidElement(t))return null;const e=t,n=e.props;return(rw(19)?n?.ref:e.ref)??null}function bx(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}function D6(t,e){const n={};for(const r in t){const i=t[r];if(e?.hasOwnProperty(r)){const s=e[r](i);s!=null&&Object.assign(n,s);continue}i===!0?n[`data-${r.toLowerCase()}`]="":i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function P6(t,e){return typeof t=="function"?t(e):t}function z6(t,e){return typeof t=="function"?t(e):t}const vw={};function ko(t,e,n,r,i){if(!n&&!r&&!i&&!t)return zp(e);let s=zp(t);return e&&(s=jf(s,e)),n&&(s=jf(s,n)),r&&(s=jf(s,r)),i&&(s=jf(s,i)),s}function N6(t){if(t.length===0)return vw;if(t.length===1)return zp(t[0]);let e=zp(t[0]);for(let n=1;n<t.length;n+=1)e=jf(e,t[n]);return e}function zp(t){return bw(t)?{...jD(t,vw)}:L6(t)}function jf(t,e){return bw(e)?jD(e,t):B6(t,e)}function L6(t){const e={...t};for(const n in e){const r=e[n];HD(n,r)&&(e[n]=VD(r))}return e}function B6(t,e){if(!e)return t;for(const n in e){const r=e[n];switch(n){case"style":{t[n]=bx(t.style,r);break}case"className":{t[n]=FD(t.className,r);break}default:HD(n,r)?t[n]=_6(t[n],r):t[n]=r}}return t}function HD(t,e){const n=t.charCodeAt(0),r=t.charCodeAt(1),i=t.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof e=="function"||typeof e>"u")}function bw(t){return typeof t=="function"}function jD(t,e){return bw(t)?t(e):t??vw}function _6(t,e){return e?t?(...n)=>{const r=n[0];if(UD(r)){const s=r;Np(s);const a=e(...n);return s.baseUIHandlerPrevented||t?.(...n),a}const i=e(...n);return t?.(...n),i}:VD(e):t}function VD(t){return t&&((...e)=>{const n=e[0];return UD(n)&&Np(n),t(...e)})}function Np(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function FD(t,e){return e?t?e+" "+t:e:t}function UD(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function kt(t,e,n={}){const r=e.render,i=H6(e,n);if(n.enabled===!1)return null;const s=n.state??zn;return F6(t,r,i,s)}function H6(t,e={}){const{className:n,style:r,render:i}=t,{state:s=zn,ref:a,props:u,stateAttributesMapping:f,enabled:d=!0}=e,g=d?P6(n,s):void 0,p=d?z6(r,s):void 0,m=d?D6(s,f):zn,v=d&&u?j6(u):void 0,b=d?bx(m,v)??{}:zn;return typeof document<"u"&&(d?Array.isArray(a)?b.ref=x8([b.ref,dM(i),...a]):b.ref=tl(b.ref,dM(i),a):tl(null,null)),d?(g!==void 0&&(b.className=FD(b.className,g)),p!==void 0&&(b.style=bx(b.style,p)),b):zn}function j6(t){return Array.isArray(t)?N6(t):ko(void 0,t)}const V6=Symbol.for("react.lazy");function F6(t,e,n,r){if(e){if(typeof e=="function")return e(n,r);const i=ko(n,e.props);i.ref=n.ref;let s=e;return s?.$$typeof===V6&&(s=E.Children.toArray(e)[0]),E.cloneElement(s,i)}if(t&&typeof t=="string")return U6(t,n);throw new Error(Un(8))}function U6(t,e){return t==="button"?E.createElement("button",{type:"button",...e,key:e.key}):t==="img"?E.createElement("img",{alt:"",...e,key:e.key}):E.createElement(t,e)}const $6={style:{transition:"none"}},$D="data-base-ui-click-trigger",qD={fallbackAxisSide:"none"},q6={fallbackAxisSide:"end"},G6={clipPath:"inset(50%)",position:"fixed",top:0,left:0},GD=E.createContext(null),WD=()=>E.useContext(GD),W6=yd("portal");function KD(t={}){const{ref:e,container:n,componentProps:r=zn,elementProps:i}=t,s=Sm(),u=WD()?.portalNode,[f,d]=E.useState(null),[g,p]=E.useState(null),m=Re(w=>{w!==null&&p(w)}),v=E.useRef(null);Me(()=>{if(n===null){v.current&&(v.current=null,p(null),d(null));return}const w=(n&&(iw(n)?n:n.current))??u??document.body;if(w==null){v.current&&(v.current=null,p(null),d(null));return}v.current!==w&&(v.current=w,p(null),d(w))},[n,u]);const b=kt("div",r,{ref:[e,m],props:[{id:s,[W6]:""},i]}),S=f&&b?il.createPortal(b,f):null;return{node:g,nodeId:E.isValidElement(b)?b.props.id:void 0,subtree:S}}const xw=E.forwardRef(function(e,n){const{render:r,className:i,style:s,children:a,container:u,...f}=e,{node:d,nodeId:g,subtree:p}=KD({container:u,ref:n,componentProps:e,elementProps:f}),m=E.useRef(null),v=E.useRef(null),b=E.useRef(null),S=E.useRef(null),[w,C]=E.useState(null),R=E.useRef(!1),T=w?.modal,A=w?.open,k=!!w&&!w.modal&&w.open&&!!d;E.useEffect(()=>{if(!d||T)return;function M(D){d&&D.relatedTarget&&Yf(D)&&(D.type==="focusin"?R.current&&(rM(d),R.current=!1):(M6(d),R.current=!0))}return ps(At(d,"focusin",M,!0),At(d,"focusout",M,!0))},[d,T]),Me(()=>{!d||A!==!0||!R.current||(rM(d),R.current=!1)},[A,d]);const P=E.useMemo(()=>({beforeOutsideRef:m,afterOutsideRef:v,beforeInsideRef:b,afterInsideRef:S,portalNode:d,setFocusManagerState:C}),[d]);return O.jsxs(E.Fragment,{children:[p,O.jsxs(GD.Provider,{value:P,children:[k&&d&&O.jsx(Ip,{"data-type":"outside",ref:m,onFocus:M=>{if(Yf(M,d))b.current?.focus();else{const D=w?w.domReference:null;BD(D)?.focus()}}}),k&&d&&O.jsx("span",{"aria-owns":g,style:G6}),d&&il.createPortal(a,d),k&&d&&O.jsx(Ip,{"data-type":"outside",ref:v,onFocus:M=>{if(Yf(M,d))S.current?.focus();else{const D=w?w.domReference:null;LD(D)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Xe(jd,M.nativeEvent))}}})]})]})});function K6(){const t=new Map;return{emit(e,n){t.get(e)?.forEach(r=>r(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){t.get(e)?.delete(n)}}}const Y6=E.createContext(null),X6=E.createContext(null),wm=()=>E.useContext(Y6)?.id||null,zc=t=>{const e=E.useContext(X6);return t??e};function $s(t){return t==null?t:"current"in t?t.current:t}function Q6(t,e){const n=An(Yn(t));return t instanceof n.KeyboardEvent?"keyboard":t instanceof n.FocusEvent?e||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof n.MouseEvent?e||(t.detail===0?"keyboard":"mouse"):""}const hM=20;let Yl=[];function Sw(){Yl=Yl.filter(t=>t.deref()?.isConnected)}function gM(t){Sw(),t&&Lr(t)!=="body"&&(Yl.push(new WeakRef(t)),Yl.length>hM&&(Yl=Yl.slice(-hM)))}function pM(){return Sw(),Yl[Yl.length-1]?.deref()}function Z6(t){return t?yw(t)?t:xm(t)[0]||t:null}function mM(t){if(t.hasAttribute("tabindex")&&!t.hasAttribute("data-tabindex")||!t.getAttribute("role")?.includes("dialog"))return;const n=zD(t).filter(i=>{const s=i.getAttribute("data-tabindex")||"";return yw(i)||i.hasAttribute("data-tabindex")&&!s.startsWith("-")}),r=t.getAttribute("tabindex");n.length===0?r!=="0"&&(t.setAttribute("tabindex","0"),t.setAttribute("data-tabindex","0")):(r!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}function ww(t){const{context:e,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:s=!0,restoreFocus:a=!1,modal:u=!0,closeOnFocusOut:f=!0,openInteractionType:d="",nextFocusableElement:g,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:v,getInsideElements:b}=t,S="rootStore"in e?e.rootStore:e,w=S.useState("open"),C=S.useState("domReferenceElement"),R=S.useState("floatingElement"),{events:T,dataRef:A}=S.context,k=Re(()=>A.current.floatingContext?.nodeId),P=i===!1,M=gx(C)&&P,D=Fn(i),L=Fn(s),H=Fn(d),N=Fn(w),_=zc(v),$=WD(),F=E.useRef(!1),G=E.useRef(!1),j=E.useRef(!1),q=E.useRef(null),V=E.useRef(""),te=E.useRef(""),J=E.useRef(null),z=E.useRef(null),U=tl(J,m,$?.beforeInsideRef),W=tl(z,$?.afterInsideRef),X=ii(),ie=ii(),ee=xc(),ue=$!=null,Y=kp(R),le=Re((de=Y)=>de?xm(de):[]),xe=Re(()=>b?.().filter(de=>de!=null)??[]);E.useEffect(()=>{if(r||!u)return;function de(Ce){Ce.key==="Tab"&&Qe(Y,Gr(Vt(Y)))&&le().length===0&&!M&&Dr(Ce)}const me=Vt(Y);return At(me,"keydown",de)},[r,Y,u,M,le]),E.useEffect(()=>{if(r||!w)return;const de=Vt(Y);function me(){j.current=!1}function Ce(Pe){const Ee=Yn(Pe),je=xe(),ke=Qe(R,Ee)||Qe(C,Ee)||Qe($?.portalNode,Ee)||je.some(_e=>_e===Ee||Qe(_e,Ee));j.current=!ke,te.current=Pe.pointerType||"keyboard",Ee?.closest(`[${$D}]`)&&(G.current=!0,ie.start(0,()=>{G.current=!1}))}function De(){te.current="keyboard"}return ps(At(de,"pointerdown",Ce,!0),At(de,"pointerup",me,!0),At(de,"pointercancel",me,!0),At(de,"keydown",De,!0),me)},[r,R,C,Y,w,$,ie,xe]),E.useEffect(()=>{if(r||!f)return;const de=Vt(Y);function me(){G.current=!0,ie.start(0,()=>{G.current=!1})}function Ce(je){const ke=Yn(je);yw(ke)&&(q.current=ke)}function De(je){const ke=je.relatedTarget,_e=je.currentTarget,Ge=Yn(je);u&&ke==null&&Ge!=null&&Qe(R,Ge)&&gM(Ge),queueMicrotask(()=>{const We=k(),fe=S.context.triggerElements,ne=xe(),Q=ke?.hasAttribute(yd("focus-guard"))&&[J.current,z.current,$?.beforeInsideRef.current,$?.afterInsideRef.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,$s(p),$s(g)].includes(ke),Se=!(Qe(C,ke)||Qe(R,ke)||Qe(ke,R)||Qe($?.portalNode,ke)||ne.some(ge=>ge===ke||Qe(ge,ke))||fe.hasMatchingElement(ge=>Qe(ge,ke))||Q||_&&(la(_.nodesRef.current,We).find(ge=>Qe(ge.context?.elements.floating,ke)||Qe(ge.context?.elements.domReference,ke))||iM(_.nodesRef.current,We).find(ge=>[ge.context?.elements.floating,kp(ge.context?.elements.floating)].includes(ke)||ge.context?.elements.domReference===ke)));if(_e===C&&Y&&mM(Y),a&&_e!==C&&!bm(Ge)&&Gr(de)===de.body){if(fn(Y)&&(Y.focus(),a==="popup")){ee.request(()=>{Y.focus()});return}const ge=le(),Ie=q.current,Je=(Ie&&ge.includes(Ie)?Ie:null)||ge[ge.length-1]||Y;fn(Je)&&Je.focus()}if(A.current.insideReactTree){A.current.insideReactTree=!1;return}(M||!u)&&ke&&Se&&!G.current&&(M||ke!==pM())&&(F.current=!0,S.setOpen(!1,Xe(jd,je)))})}function Pe(){j.current||(A.current.insideReactTree=!0,X.start(0,()=>{A.current.insideReactTree=!1}))}const Ee=fn(C)?C:null;if(!(!R&&!Ee))return ps(Ee&&At(Ee,"focusout",De),Ee&&At(Ee,"pointerdown",me),R&&At(R,"focusin",Ce),R&&At(R,"focusout",De),R&&$&&At(R,"focusout",Pe,!0))},[r,C,R,Y,u,_,$,S,f,a,le,M,k,A,X,ie,ee,g,p,xe]),E.useEffect(()=>{if(r||!R||!w)return;const de=Array.from($?.portalNode?.querySelectorAll(`[${yd("portal")}]`)||[]),Ce=(_?iM(_.nodesRef.current,k()):[]).find(_e=>gx(_e.context?.elements.domReference||null))?.context?.elements.domReference,Pe=[...[R,...de,J.current,z.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,...xe()],Ce,$s(p),$s(g),M?C:null].filter(_e=>_e!=null),Ee=uM(Pe,{ariaHidden:u||M,mark:!1}),je=[R,...de].filter(_e=>_e!=null),ke=uM(je);return()=>{ke(),Ee()}},[w,r,C,R,u,$,M,_,k,g,p,xe]),Me(()=>{if(!w||r||!fn(Y))return;V.current="",te.current="";const de=Vt(Y),me=Gr(de);queueMicrotask(()=>{const Ce=D.current,De=typeof Ce=="function"?Ce(H.current||""):Ce;if(De===void 0||De===!1||Qe(Y,me))return;let Ee=null;const je=()=>(Ee==null&&(Ee=le(Y)),Ee[0]||Y);let ke;De===!0||De===null?ke=je():ke=$s(De),ke=ke||je();const _e=Qe(Y,Gr(de));dp(ke,{preventScroll:ke===Y,shouldFocus(){if(!N.current)return!1;if(_e)return!0;const Ge=Gr(de);return!(Ge!==ke&&Qe(Y,Ge))}})})},[r,w,Y,le,D,H,N]),Me(()=>{if(r||!Y)return;const de=Vt(Y),me=Gr(de),Ce=H.current==null;gM(me);function De(Ee){if(Ee.open||(V.current=Q6(Ee.nativeEvent,te.current)),Ee.reason===mi&&Ee.nativeEvent.type==="mouseleave"&&(F.current=!0),Ee.reason===vm)if(Ee.nested)F.current=!1;else if(uw(Ee.nativeEvent)||cw(Ee.nativeEvent))F.current=!1;else{let je=!1;Vt(Y).createElement("div").focus({get preventScroll(){return je=!0,!1}}),je?F.current=!1:F.current=!0}}T.on("openchange",De);function Pe(Ee){const je=L.current;let ke=typeof je=="function"?je(Ee):je;if(ke===void 0||ke===!1)return null;ke===null&&(ke=!0);const _e=C?.isConnected?C:null,Ge=me?.isConnected&&Lr(me)!=="body"?me:null;let We=Ce?Ge||_e:_e||Ge;return We||(We=pM()||null),typeof ke=="boolean"?We:$s(ke)||We||null}return()=>{T.off("openchange",De);const Ee=Gr(de),je=xe(),ke=Qe(R,Ee)||je.some(fe=>fe===Ee||Qe(fe,Ee))||_&&la(_.nodesRef.current,k(),!1).some(fe=>Qe(fe.context?.elements.floating,Ee)),_e=L.current,Ge=V.current,We=Pe(Ge);queueMicrotask(()=>{const fe=Z6(We),ne=typeof _e!="boolean";if(_e&&!F.current&&fn(fe)&&(!(!ne&&fe!==Ee&&Ee!==de.body)||ke)){const Q={preventScroll:!0};Ge==="keyboard"&&(Q.focusVisible=!0),fe.focus(Q)}F.current=!1})}},[r,R,Y,L,H,T,_,C,k,xe]),Me(()=>{if(!sl||w||!R)return;const de=Gr(Vt(R));!fn(de)||!ym(de)||Qe(R,de)&&de.blur()},[w,R]),Me(()=>{if(!(r||!$))return $.setFocusManagerState({modal:u,closeOnFocusOut:f,open:w,onOpenChange:S.setOpen,domReference:C}),()=>{$.setFocusManagerState(null)}},[r,$,u,w,S,f,C]),Me(()=>{if(!(r||!Y))return mM(Y),()=>{queueMicrotask(Sw)}},[r,Y]);const ve=!r&&(u?!M:!0)&&(ue||u);return O.jsxs(E.Fragment,{children:[ve&&O.jsx(Ip,{"data-type":"inside",ref:U,onFocus:de=>{if(u){const me=le();dp(me[me.length-1])}else $?.portalNode&&(F.current=!1,Yf(de,$.portalNode)?LD(C)?.focus():$s(p??$.beforeOutsideRef)?.focus())}}),n,ve&&O.jsx(Ip,{"data-type":"inside",ref:W,onFocus:de=>{u?dp(le()[0]):$?.portalNode&&(f&&(F.current=!0),Yf(de,$.portalNode)?BD(C)?.focus():$s(g??$.afterOutsideRef)?.focus())}})]})}function Cw(t,e={}){const{enabled:n=!0,event:r="click",toggle:i=!0,ignoreMouse:s=!1,stickIfOpen:a=!0,touchOpenDelay:u=0,reason:f=Hd}=e,d="rootStore"in t?t.rootStore:t,g=d.context.dataRef,p=E.useRef(void 0),m=xc(),v=ii(),b=E.useMemo(()=>{function S(C,R,T,A){const k=Xe(f,R,T);C&&A==="touch"&&u>0?v.start(u,()=>{d.setOpen(!0,k)}):d.setOpen(C,k)}function w(C,R,T){const A=g.current.openEvent,k=d.select("domReferenceElement")!==R;return C&&k||!C||!i?!0:A&&a?!T(A.type):!1}return{onPointerDown(C){p.current=na(C.pointerType,!0)&&cw(C.nativeEvent)?"virtual":C.pointerType},onMouseDown(C){const R=p.current,T=C.nativeEvent,A=d.select("open");if(C.button!==0||r==="click"||na(R,!0)&&s)return;const k=w(A,C.currentTarget,D=>D==="click"||D==="mousedown"),P=Yn(T);if(ym(P)){S(k,T,P,R);return}const M=C.currentTarget;m.request(()=>{S(k,T,M,R)})},onClick(C){if(r==="mousedown-only")return;const R=p.current;if(r==="mousedown"&&R){p.current=void 0;return}if(na(R,!0)&&s)return;const T=d.select("open"),A=w(T,C.currentTarget,k=>k==="click"||k==="mousedown"||k==="keydown"||k==="keyup");S(A,C.nativeEvent,C.currentTarget,R)},onKeyDown(){p.current=void 0}}},[g,r,s,f,d,a,i,m,v,u]);return E.useMemo(()=>n?{reference:b}:zn,[n,b])}function J6(t,e){let n=null,r=null,i=!1;return{contextElement:t||void 0,getBoundingClientRect(){const s=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},a=e.axis==="x"||e.axis==="both",u=e.axis==="y"||e.axis==="both",f=["mouseenter","mousemove"].includes(e.dataRef.current.openEvent?.type||"")&&e.pointerType!=="touch";let d=s.width,g=s.height,p=s.x,m=s.y;return n==null&&e.x&&a&&(n=s.x-e.x),r==null&&e.y&&u&&(r=s.y-e.y),p-=n||0,m-=r||0,d=0,g=0,!i||f?(d=e.axis==="y"?s.width:0,g=e.axis==="x"?s.height:0,p=a&&e.x!=null?e.x:p,m=u&&e.y!=null?e.y:m):i&&!f&&(g=e.axis==="x"?s.height:g,d=e.axis==="y"?s.width:d),i=!0,{width:d,height:g,x:p,y:m,top:m,right:p+d,bottom:m+g,left:p}}}}function yM(t){return t!=null&&t.clientX!=null}function eU(t,e={}){const{enabled:n=!0,axis:r="both"}=e,i="rootStore"in t?t.rootStore:t,s=i.useState("open"),a=i.useState("floatingElement"),u=i.useState("domReferenceElement"),f=i.context.dataRef,d=E.useRef(!1),g=E.useRef(null),[p,m]=E.useState(),[v,b]=E.useState([]),S=Re(A=>{i.set("positionReference",A)}),w=Re((A,k,P)=>{d.current||f.current.openEvent&&!yM(f.current.openEvent)||i.set("positionReference",J6(P??u,{x:A,y:k,axis:r,dataRef:f,pointerType:p}))}),C=Re(A=>{s?g.current||(w(A.clientX,A.clientY,A.currentTarget),b([])):w(A.clientX,A.clientY,A.currentTarget)}),R=na(p)?a:s;E.useEffect(()=>{if(!n){S(u);return}if(!R)return;function A(){g.current?.(),g.current=null}const k=An(a);function P(M){const D=Yn(M);Qe(a,D)?A():w(M.clientX,M.clientY)}return!f.current.openEvent||yM(f.current.openEvent)?g.current=At(k,"mousemove",P):S(u),A},[R,n,a,f,u,i,w,S,v]),E.useEffect(()=>()=>{i.set("positionReference",null)},[i]),E.useEffect(()=>{n&&!a&&(d.current=!1)},[n,a]),E.useEffect(()=>{!n&&s&&(d.current=!0)},[n,s]);const T=E.useMemo(()=>{function A(k){m(k.pointerType)}return{onPointerDown:A,onPointerEnter:A,onMouseMove:C,onMouseEnter:C}},[C]);return E.useMemo(()=>n?{reference:T,trigger:T}:{},[n,T])}function tU(){return!1}function nU(t){return{escapeKey:typeof t=="boolean"?t:t?.escapeKey??!1,outsidePress:typeof t=="boolean"?t:t?.outsidePress??!0}}function Cm(t,e={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:s="sloppy",referencePress:a=tU,bubbles:u,externalTree:f}=e,d="rootStore"in t?t.rootStore:t,g=d.useState("open"),p=d.useState("floatingElement"),{dataRef:m}=d.context,v=zc(f),b=Re(typeof i=="function"?i:()=>!1),S=typeof i=="function"?b:i,w=S!==!1,C=Re(()=>s),{escapeKey:R,outsidePress:T}=nU(u),A=E.useRef(!1),k=E.useRef(!1),P=E.useRef(!1),M=E.useRef(!1),D=E.useRef(""),L=E.useRef(null),H=ii(),N=ii(),_=Re(()=>{N.clear(),m.current.insideReactTree=!1}),$=Re(U=>{const W=m.current.floatingContext?.nodeId;return(v?la(v.nodesRef.current,W):[]).some(ie=>ie.context?.open&&!ie.context.dataRef.current[U])}),F=Re(U=>L0(U,d.select("floatingElement"))||L0(U,d.select("domReferenceElement"))),G=Re(U=>{a()&&d.setOpen(!1,Xe(Hd,U.nativeEvent))}),j=Re(U=>{if(!g||!n||!r||U.key!=="Escape"||M.current||!R&&$("__escapeKeyBubbles"))return;const W=t6(U)?U.nativeEvent:U,X=Xe(Vd,W);d.setOpen(!1,X),X.isCanceled||U.preventDefault(),!R&&!X.isPropagationAllowed&&U.stopPropagation()}),q=Re(()=>{m.current.insideReactTree=!0,N.start(0,_)}),V=Re(U=>{if(!g||!n||U.button!==0)return;const W=Yn(U.nativeEvent);Qe(d.select("floatingElement"),W)&&(A.current||(A.current=!0,k.current=!1))}),te=Re(U=>{!g||!n||(U.defaultPrevented||U.nativeEvent.defaultPrevented)&&A.current&&(k.current=!0)});E.useEffect(()=>{if(!g||!n)return _;m.current.__escapeKeyBubbles=R,m.current.__outsidePressBubbles=T;const U=new zo,W=new zo;function X(){U.clear(),M.current=!0}function ie(){U.start(sl?5:0,()=>{M.current=!1})}function ee(){P.current=!0,W.start(0,()=>{P.current=!1})}function ue(){A.current=!1,k.current=!1}function Y(){const ne=D.current,Q=ne==="pen"||!ne?"mouse":ne,Se=C(),ge=typeof Se=="function"?Se():Se;return typeof ge=="string"?ge:ge[Q]}function le(ne){const Q=Y();return Q==="intentional"&&ne.type!=="click"||Q==="sloppy"&&ne.type==="click"}function xe(ne){const Q=m.current.floatingContext?.nodeId,Se=v&&la(v.nodesRef.current,Q).some(ge=>L0(ne,ge.context?.elements.floating));return F(ne)||Se}function ve(ne){if(le(ne)){ne.type!=="click"&&!F(ne)&&(W.clear(),P.current=!1),_();return}if(m.current.insideReactTree){_();return}const Q=Yn(ne),Se=`[${yd("inert")}]`,ge=Ot(Q)?Q.getRootNode():null,Ie=Array.from((vc(ge)?ge:Vt(d.select("floatingElement"))).querySelectorAll(Se)),Je=d.context.triggerElements;if(Q&&(Je.hasElement(Q)||Je.hasMatchingElement(Le=>Qe(Le,Q))))return;let nt=Ot(Q)?Q:null;for(;nt&&!ta(nt);){const Le=ia(nt);if(ta(Le)||!Ot(Le))break;nt=Le}if(!(Ie.length&&Ot(Q)&&!r6(Q)&&!Qe(Q,d.select("floatingElement"))&&Ie.every(Le=>!Qe(nt,Le)))){if(fn(Q)&&!("touches"in ne)){const Le=ta(Q),it=bi(Q),ht=/auto|scroll/,wt=Le||ht.test(it.overflowX),bn=Le||ht.test(it.overflowY),ut=wt&&Q.clientWidth>0&&Q.scrollWidth>Q.clientWidth,Mn=bn&&Q.clientHeight>0&&Q.scrollHeight>Q.clientHeight,Qt=it.direction==="rtl",xn=Mn&&(Qt?ne.offsetX<=Q.offsetWidth-Q.clientWidth:ne.offsetX>Q.clientWidth),nn=ut&&ne.offsetY>Q.clientHeight;if(xn||nn)return}if(!xe(ne)){if(Y()==="intentional"&&P.current){W.clear(),P.current=!1;return}typeof S=="function"&&!S(ne)||$("__outsidePressBubbles")||(d.setOpen(!1,Xe(vm,ne)),_())}}}function de(ne){Y()!=="sloppy"||ne.pointerType==="touch"||!d.select("open")||!n||F(ne)||ve(ne)}function me(ne){if(Y()!=="sloppy"||!d.select("open")||!n||F(ne))return;const Q=ne.touches[0];Q&&(L.current={startTime:Date.now(),startX:Q.clientX,startY:Q.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},H.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}function Ce(ne,Q){const Se=Yn(ne);if(!Se)return;const ge=At(Se,ne.type,()=>{Q(ne),ge()})}function De(ne){D.current="touch",Ce(ne,me)}function Pe(ne){H.clear(),ne.type==="pointerdown"&&(D.current=ne.pointerType),!(ne.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)&&Ce(ne,Q=>{Q.type==="pointerdown"?de(Q):ve(Q)})}function Ee(ne){if(!A.current)return;const Q=k.current;if(ue(),Y()==="intentional"){if(ne.type==="pointercancel"){Q&&ee();return}if(!xe(ne)){if(Q){ee();return}typeof S=="function"&&!S(ne)||(W.clear(),P.current=!0,_())}}}function je(ne){if(Y()!=="sloppy"||!L.current||F(ne))return;const Q=ne.touches[0];if(!Q)return;const Se=Math.abs(Q.clientX-L.current.startX),ge=Math.abs(Q.clientY-L.current.startY),Ie=Math.sqrt(Se*Se+ge*ge);Ie>5&&(L.current.dismissOnTouchEnd=!0),Ie>10&&(ve(ne),H.clear(),L.current=null)}function ke(ne){Ce(ne,je)}function _e(ne){Y()!=="sloppy"||!L.current||F(ne)||(L.current.dismissOnTouchEnd&&ve(ne),H.clear(),L.current=null)}function Ge(ne){Ce(ne,_e)}const We=Vt(p),fe=ps(r&&ps(At(We,"keydown",j),At(We,"compositionstart",X),At(We,"compositionend",ie)),w&&ps(At(We,"click",Pe,!0),At(We,"pointerdown",Pe,!0),At(We,"pointerup",Ee,!0),At(We,"pointercancel",Ee,!0),At(We,"mousedown",Pe,!0),At(We,"mouseup",Ee,!0),At(We,"touchstart",De,!0),At(We,"touchmove",ke,!0),At(We,"touchend",Ge,!0)));return()=>{fe(),U.clear(),W.clear(),ue(),P.current=!1,_()}},[m,p,r,w,S,g,n,R,T,j,_,C,$,F,v,d,H]);const J=E.useMemo(()=>({onKeyDown:j,onPointerDown:G,onClick:G}),[j,G]),z=E.useMemo(()=>({onKeyDown:j,onPointerDown:te,onMouseDown:te,onClickCapture:q,onMouseDownCapture(U){q(),V(U)},onPointerDownCapture(U){q(),V(U)},onMouseUpCapture:q,onTouchEndCapture:q,onTouchMoveCapture:q}),[j,q,V,te]);return E.useMemo(()=>n?{reference:J,floating:z,trigger:J}:{},[n,J,z])}function vM(t,e,n){let{reference:r,floating:i}=t;const s=eo(e),a=mw(e),u=pw(a),f=so(e),d=s==="y",g=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,m=r[u]/2-i[u]/2;let v;switch(f){case"top":v={x:g,y:r.y-i.height};break;case"bottom":v={x:g,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:p};break;case"left":v={x:r.x-i.width,y:p};break;default:v={x:r.x,y:r.y}}const b=ha(e);return b&&(v[a]+=m*(b==="end"?1:-1)*(n&&d?-1:1)),v}async function rU(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:a,elements:u,strategy:f}=t,{boundary:d="clippingAncestors",rootBoundary:g="viewport",elementContext:p="floating",altBoundary:m=!1,padding:v=0}=sa(e,t),b=AD(v),w=u[m?p==="floating"?"reference":"floating":p],C=md(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:d,rootBoundary:g,strategy:f})),R=p==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),A=await(s.isElement==null?void 0:s.isElement(T))&&await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1},k=md(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:R,offsetParent:T,strategy:f}):R);return{top:(C.top-k.top+b.top)/A.y,bottom:(k.bottom-C.bottom+b.bottom)/A.y,left:(C.left-k.left+b.left)/A.x,right:(k.right-C.right+b.right)/A.x}}const iU=50,oU=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:rU},f=await(a.isRTL==null?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:g,y:p}=vM(d,r,f),m=r,v=0;const b={};for(let S=0;S<s.length;S++){const w=s[S];if(!w)continue;const{name:C,fn:R}=w,{x:T,y:A,data:k,reset:P}=await R({x:g,y:p,initialPlacement:r,placement:m,strategy:i,middlewareData:b,rects:d,platform:u,elements:{reference:t,floating:e}});g=T??g,p=A??p,b[C]={...b[C],...k},P&&v<iU&&(v++,typeof P=="object"&&(P.placement&&(m=P.placement),P.rects&&(d=P.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):P.rects),{x:g,y:p}=vM(d,m,f)),S=-1)}return{x:g,y:p,placement:m,strategy:i,middlewareData:b}},sU=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:u,platform:f,elements:d}=e,{mainAxis:g=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:S=!0,...w}=sa(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const C=so(i),R=eo(u),T=so(u)===u,A=await(f.isRTL==null?void 0:f.isRTL(d.floating)),k=m||(T||!S?[Pp(u)]:p6(u)),P=b!=="none";!m&&P&&k.push(...b6(u,S,b,A));const M=[u,...k],D=await f.detectOverflow(e,w),L=[];let H=((r=s.flip)==null?void 0:r.overflows)||[];if(g&&L.push(D[C]),p){const F=g6(i,a,A);L.push(D[F[0]],D[F[1]])}if(H=[...H,{placement:i,overflows:L}],!L.every(F=>F<=0)){var N,_;const F=(((N=s.flip)==null?void 0:N.index)||0)+1,G=M[F];if(G&&(!(p==="alignment"?R!==eo(G):!1)||H.every(V=>eo(V.placement)===R?V.overflows[0]>0:!0)))return{data:{index:F,overflows:H},reset:{placement:G}};let j=(_=H.filter(q=>q.overflows[0]<=0).sort((q,V)=>q.overflows[1]-V.overflows[1])[0])==null?void 0:_.placement;if(!j)switch(v){case"bestFit":{var $;const q=($=H.filter(V=>{if(P){const te=eo(V.placement);return te===R||te==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(te=>te>0).reduce((te,J)=>te+J,0)]).sort((V,te)=>V[1]-te[1])[0])==null?void 0:$[0];q&&(j=q);break}case"initialPlacement":j=u;break}if(i!==j)return{reset:{placement:j}}}return{}}}},YD=new Set(["left","top"]);async function lU(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=so(n),u=ha(n),f=eo(n)==="y",d=YD.has(a)?-1:1,g=s&&f?-1:1,p=sa(e,t);let{mainAxis:m,crossAxis:v,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof b=="number"&&(v=u==="end"?b*-1:b),f?{x:v*g,y:m*d}:{x:m*d,y:v*g}}const aU=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:a,middlewareData:u}=e,f=await lU(e,t);return a===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+f.x,y:s+f.y,data:{...f,placement:a}}}}},uU=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:s}=e,{mainAxis:a=!0,crossAxis:u=!1,limiter:f={fn:R=>{let{x:T,y:A}=R;return{x:T,y:A}}},...d}=sa(t,e),g={x:n,y:r},p=await s.detectOverflow(e,d),m=eo(i),v=gw(m);let b=g[v],S=g[m];const w=(R,T)=>TD(T+p[R==="y"?"top":"left"],T,T-p[R==="y"?"bottom":"right"]);a&&(b=w(v,b)),u&&(S=w(m,S));const C=f.fn({...e,[v]:b,[m]:S});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[v]:a,[m]:u}}}}}},cU=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:i,y:s,placement:a,rects:u,middlewareData:f}=e,{offset:d=0,mainAxis:g=!0,crossAxis:p=!0}=sa(t,e),m={x:i,y:s},v=eo(a),b=gw(v);let S=m[b],w=m[v];const C=sa(d,e),R=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(n=C.mainAxis)!=null?n:0,crossAxis:(r=C.crossAxis)!=null?r:0};if(g){const k=b==="y"?"height":"width",P=u.reference[b]-u.floating[k]+R.mainAxis,M=u.reference[b]+u.reference[k]-R.mainAxis;S<P?S=P:S>M&&(S=M)}if(p){var T,A;const k=b==="y"?"width":"height",P=YD.has(so(a)),M=u.reference[v]-u.floating[k]+(P&&((T=f.offset)==null?void 0:T[v])||0)+(P?0:R.crossAxis),D=u.reference[v]+u.reference[k]+(P?0:((A=f.offset)==null?void 0:A[v])||0)-(P?R.crossAxis:0);w<M?w=M:w>D&&(w=D)}return{[b]:S,[v]:w}}}},fU=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:i,elements:s}=e,{apply:a=()=>{},...u}=sa(t,e),f=await i.detectOverflow(e,u),d=so(n),g=ha(n),p=eo(n)==="y",{width:m,height:v}=r.floating;let b,S;d==="top"||d==="bottom"?(b=d,S=g===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(S=d,b=g==="end"?"top":"bottom");const w=v-f.top-f.bottom,C=m-f.left-f.right,R=Sc(v-f[b],w),T=Sc(m-f[S],C),A=e.middlewareData.shift,k=!A;let P=R,M=T;A!=null&&A.enabled.x&&(M=C),A!=null&&A.enabled.y&&(P=w),k&&!g&&(p?M=m-2*Qs(f.left,f.right):P=v-2*Qs(f.top,f.bottom)),await a({...e,availableWidth:M,availableHeight:P});const D=await i.getDimensions(s.floating);return m!==D.width||v!==D.height?{reset:{rects:!0}}:{}}}};function XD(t){const e=bi(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=fn(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:r,u=Dp(n)!==s||Dp(r)!==a;return u&&(n=s,r=a),{width:n,height:r,$:u}}function Rw(t){return Ot(t)?t:t.contextElement}function lc(t){const e=Rw(t);if(!fn(e))return Zs(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=XD(e);let a=(s?Dp(n.width):n.width)/r,u=(s?Dp(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const dU=Zs(0);function QD(t){const e=An(t);return!sw()||!e.visualViewport?dU:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function hU(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===An(t)}function lu(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Rw(t);let a=Zs(1);e&&(r?Ot(r)&&(a=lc(r)):a=lc(t));const u=hU(s,n,r)?QD(s):Zs(0);let f=(i.left+u.x)/a.x,d=(i.top+u.y)/a.y,g=i.width/a.x,p=i.height/a.y;if(s&&r){const m=An(s),v=Ot(r)?An(r):r;let b=m,S=dx(b);for(;S&&v!==b;){const w=lc(S),C=S.getBoundingClientRect(),R=bi(S),T=C.left+(S.clientLeft+parseFloat(R.paddingLeft))*w.x,A=C.top+(S.clientTop+parseFloat(R.paddingTop))*w.y;f*=w.x,d*=w.y,g*=w.x,p*=w.y,f+=T,d+=A,b=An(S),S=dx(b)}}return md({width:g,height:p,x:f,y:d})}function Rm(t,e){const n=gm(t).scrollLeft;return e?e.left+n:lu(ol(t)).left+n}function ZD(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Rm(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function gU(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",a=ol(r),u=e?hm(e.floating):!1;if(r===a||u&&s)return n;let f={scrollLeft:0,scrollTop:0},d=Zs(1);const g=Zs(0),p=fn(r);if((p||!s)&&((Lr(r)!=="body"||Bd(a))&&(f=gm(r)),p)){const v=lu(r);d=lc(r),g.x=v.x+r.clientLeft,g.y=v.y+r.clientTop}const m=a&&!p&&!s?ZD(a,f):Zs(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+g.x+m.x,y:n.y*d.y-f.scrollTop*d.y+g.y+m.y}}function pU(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function mU(t){const e=gm(t),n=t.ownerDocument.body,r=Qs(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Qs(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+Rm(t);const a=-e.scrollTop;return bi(n).direction==="rtl"&&(s+=Qs(t.clientWidth,n.clientWidth)-r),{width:r,height:i,x:s,y:a}}const yU=25;function vU(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",i=An(t),s=ol(t),a=i.visualViewport;let u=s.clientWidth,f=s.clientHeight,d=0,g=0;if(a){const m=!sw()||e==="fixed";r?m||(d=-a.offsetLeft,g=-a.offsetTop):(u=a.width,f=a.height,m&&(d=a.offsetLeft,g=a.offsetTop))}if(Rm(s)<=0){const m=s.ownerDocument,v=m.body,b=getComputedStyle(v),S=m.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,w=Math.abs(s.clientWidth-v.clientWidth-S),C=getComputedStyle(s).scrollbarGutter==="stable both-edges"?w/2:w;C<=yU&&(u-=C)}return{width:u,height:f,x:d,y:g}}function bU(t,e){const n=lu(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=lc(t),a=t.clientWidth*s.x,u=t.clientHeight*s.y,f=i*s.x,d=r*s.y;return{width:a,height:u,x:f,y:d}}function bM(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=vU(t,n,e);else if(e==="document")r=mU(ol(t));else if(Ot(e))r=bU(e,n);else{const i=QD(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return md(r)}function xU(t,e){const n=e.get(t);if(n)return n;let r=bc(t,[],!1).filter(u=>Ot(u)&&Lr(u)!=="body"),i=null;const s=bi(t).position==="fixed";let a=s?ia(t):t;for(;Ot(a)&&!ta(a);){const u=bi(a),f=ow(a),d=i?i.position:s?"fixed":"";!f&&(d==="fixed"||d==="absolute"&&u.position==="static")?r=r.filter(p=>p!==a):i=u,a=ia(a)}return e.set(t,r),r}function SU(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?hm(e)?[]:xU(e,this._c):[].concat(n),r],u=bM(e,a[0],i);let f=u.top,d=u.right,g=u.bottom,p=u.left;for(let m=1;m<a.length;m++){const v=bM(e,a[m],i);f=Qs(v.top,f),d=Sc(v.right,d),g=Sc(v.bottom,g),p=Qs(v.left,p)}return{width:d-p,height:g-f,x:p,y:f}}function wU(t){const{width:e,height:n}=XD(t);return{width:e,height:n}}function CU(t,e,n){const r=fn(e),i=ol(e),s=n==="fixed",a=lu(t,!0,s,e);let u={scrollLeft:0,scrollTop:0};const f=Zs(0);if((r||!s)&&((Lr(e)!=="body"||Bd(i))&&(u=gm(e)),r)){const m=lu(e,!0,s,e);f.x=m.x+e.clientLeft,f.y=m.y+e.clientTop}!r&&i&&(f.x=Rm(i));const d=i&&!r&&!s?ZD(i,u):Zs(0),g=a.left+u.scrollLeft-f.x-d.x,p=a.top+u.scrollTop-f.y-d.y;return{x:g,y:p,width:a.width,height:a.height}}function j0(t){return bi(t).position==="static"}function xM(t,e){if(!fn(t)||bi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ol(t)===n&&(n=n.ownerDocument.body),n}function JD(t,e){const n=An(t);if(hm(t))return n;if(!fn(t)){let i=ia(t);for(;i&&!ta(i);){if(Ot(i)&&!j0(i))return i;i=ia(i)}return n}let r=xM(t,e);for(;r&&$8(r)&&j0(r);)r=xM(r,e);return r&&ta(r)&&j0(r)&&!ow(r)?n:r||W8(t)||n}const RU=async function(t){const e=this.getOffsetParent||JD,n=this.getDimensions,r=await n(t.floating);return{reference:CU(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function EU(t){return bi(t).direction==="rtl"}const eP={convertOffsetParentRelativeRectToViewportRelativeRect:gU,getDocumentElement:ol,getClippingRect:SU,getOffsetParent:JD,getElementRects:RU,getClientRects:pU,getDimensions:wU,getScale:lc,isElement:Ot,isRTL:EU};function tP(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function TU(t,e,n){let r=null,i;const s=ol(t);function a(){var g;clearTimeout(i),(g=r)==null||g.disconnect(),r=null}function u(g,p){g===void 0&&(g=!1),p===void 0&&(p=1),a();const m=t.getBoundingClientRect(),{left:v,top:b,width:S,height:w}=m;if(g||e(),!S||!w)return;const C=Wa(b),R=Wa(s.clientWidth-(v+S)),T=Wa(s.clientHeight-(b+w)),A=Wa(v),P={rootMargin:-C+"px "+-R+"px "+-T+"px "+-A+"px",threshold:Qs(0,Sc(1,p))||1};let M=!0;function D(L){const H=L[0].intersectionRatio;if(!tP(m,t.getBoundingClientRect()))return u();if(H!==p){if(!M)return u();H?u(!1,H):i=setTimeout(()=>{u(!1,1e-7)},1e3)}M=!1}try{r=new IntersectionObserver(D,{...P,root:s.ownerDocument})}catch{r=new IntersectionObserver(D,P)}r.observe(t)}const f=An(t),d=()=>u(n);return f.addEventListener("resize",d),u(!0),()=>{f.removeEventListener("resize",d),a()}}function SM(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,d=Rw(t),g=i||s?[...d?bc(d):[],...e?bc(e):[]]:[];g.forEach(C=>{i&&C.addEventListener("scroll",n),s&&C.addEventListener("resize",n)});const p=d&&u?TU(d,n,s):null;let m=-1,v=null;a&&(v=new ResizeObserver(C=>{let[R]=C;R&&R.target===d&&v&&e&&(v.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=v)==null||T.observe(e)})),n()}),d&&!f&&v.observe(d),e&&v.observe(e));let b,S=f?lu(t):null;f&&w();function w(){const C=lu(t);S&&!tP(S,C)&&n(),S=C,b=requestAnimationFrame(w)}return n(),()=>{var C;g.forEach(R=>{i&&R.removeEventListener("scroll",n),s&&R.removeEventListener("resize",n)}),p?.(),(C=v)==null||C.disconnect(),v=null,f&&cancelAnimationFrame(b)}}const AU=aU,MU=uU,OU=sU,kU=fU,IU=cU,DU=(t,e,n)=>{const r=new Map,i=n??{},s={...eP,...i.platform,_c:r};return oU(t,e,{...i,platform:s})};var PU=typeof document<"u",zU=function(){},hp=PU?E.useLayoutEffect:zU;function Lp(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Lp(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!Lp(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function nP(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function wM(t,e){const n=nP(t);return Math.round(e*n)/n}function V0(t){const e=E.useRef(t);return hp(()=>{e.current=t}),e}function NU(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:u=!0,whileElementsMounted:f,open:d}=t,[g,p]=E.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,v]=E.useState(r);Lp(m,r)||v(r);const[b,S]=E.useState(null),[w,C]=E.useState(null),R=E.useCallback(V=>{V!==P.current&&(P.current=V,S(V))},[]),T=E.useCallback(V=>{V!==M.current&&(M.current=V,C(V))},[]),A=s||b,k=a||w,P=E.useRef(null),M=E.useRef(null),D=E.useRef(g),L=f!=null,H=V0(f),N=V0(i),_=V0(d),$=E.useCallback(()=>{if(!P.current||!M.current)return;const V={placement:e,strategy:n,middleware:m};N.current&&(V.platform=N.current),DU(P.current,M.current,V).then(te=>{const J={...te,isPositioned:_.current!==!1};F.current&&!Lp(D.current,J)&&(D.current=J,il.flushSync(()=>{p(J)}))})},[m,e,n,N,_]);hp(()=>{d===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,p(V=>({...V,isPositioned:!1})))},[d]);const F=E.useRef(!1);hp(()=>(F.current=!0,()=>{F.current=!1}),[]),hp(()=>{if(A&&(P.current=A),k&&(M.current=k),A&&k){if(H.current)return H.current(A,k,$);$()}},[A,k,$,H,L]);const G=E.useMemo(()=>({reference:P,floating:M,setReference:R,setFloating:T}),[R,T]),j=E.useMemo(()=>({reference:A,floating:k}),[A,k]),q=E.useMemo(()=>{const V={position:n,left:0,top:0};if(!j.floating)return V;const te=wM(j.floating,g.x),J=wM(j.floating,g.y);return u?{...V,transform:"translate("+te+"px, "+J+"px)",...nP(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:J}},[n,u,j.floating,g.x,g.y]);return E.useMemo(()=>({...g,update:$,refs:G,elements:j,floatingStyles:q}),[g,$,G,j,q])}const LU=(t,e)=>{const n=AU(t);return{name:n.name,fn:n.fn,options:[t,e]}},BU=(t,e)=>{const n=MU(t);return{name:n.name,fn:n.fn,options:[t,e]}},_U=(t,e)=>({fn:IU(t).fn,options:[t,e]}),HU=(t,e)=>{const n=OU(t);return{name:n.name,fn:n.fn,options:[t,e]}},jU=(t,e)=>{const n=kU(t);return{name:n.name,fn:n.fn,options:[t,e]}},VU={open:t=>t.open,transitionStatus:t=>t.transitionStatus,domReferenceElement:t=>t.domReferenceElement,referenceElement:t=>t.positionReference??t.referenceElement,floatingElement:t=>t.floatingElement,floatingId:t=>t.floatingId};class Em extends fm{constructor(e){const{syncOnly:n,nested:r,onOpenChange:i,triggerElements:s,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:K6(),nested:r,triggerElements:s},VU),this.syncOnly=n}syncOpenEvent=(e,n)=>{(!e||!this.state.open||n!=null&&n6(n))&&(this.context.dataRef.current.openEvent=e?n:void 0)};dispatchOpenChange=(e,n)=>{this.syncOpenEvent(e,n.event);const r={open:e,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(e,n)=>{if(this.syncOnly){this.context.onOpenChange?.(e,n);return}this.dispatchOpenChange(e,n),this.context.onOpenChange?.(e,n)}}function FU(t){const{popupStore:e,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:s,onOpenChange:a}=t,u=e.useState("open"),f=e.useState("activeTriggerElement"),d=e.useState(n?"popupElement":"positionerElement"),g=e.context.triggerElements,p=a,m=E.useRef(null);r===void 0&&m.current===null&&(m.current=new Em({open:u,transitionStatus:void 0,referenceElement:f,floatingElement:d,triggerElements:g,onOpenChange:p,floatingId:i,syncOnly:!0,nested:s}));const v=r??m.current;return e.useSyncedValue("floatingId",i),Me(()=>{const b={open:u,floatingId:i,referenceElement:f,floatingElement:d};Ot(f)&&(b.domReferenceElement=f),v.state.positionReference===v.state.referenceElement&&(b.positionReference=f),v.update(b)},[u,i,f,d,v]),v.context.onOpenChange=p,v.context.nested=s,v}function ga(t,e=!1,n=!1){const[r,i]=E.useState(t&&e?"idle":void 0),[s,a]=E.useState(t);return t&&!s&&(a(!0),i("starting")),!t&&s&&r!=="ending"&&!n&&i("ending"),!t&&!s&&r==="ending"&&i(void 0),Me(()=>{if(!t&&s&&r!=="ending"&&n){const u=is.request(()=>{i("ending")});return()=>{is.cancel(u)}}},[t,s,r,n]),Me(()=>{if(!t||e)return;const u=is.request(()=>{i(void 0)});return()=>{is.cancel(u)}},[e,t]),Me(()=>{if(!t||!e)return;t&&s&&r!=="idle"&&i("starting");const u=is.request(()=>{i("idle")});return()=>{is.cancel(u)}},[e,t,s,r]),{mounted:s,setMounted:a,transitionStatus:r}}function UU(t,e=!1){const n=xc();return Re((r,i=null)=>{n.cancel();const s=$s(t);if(s==null)return;const a=s,u=()=>{il.flushSync(r)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function f(){Promise.all(a.getAnimations().map(d=>d.finished)).then(()=>{i?.aborted||u()},()=>{if(i?.aborted)return;if(a.getAnimations().some(g=>g.pending||g.playState!=="finished")){f();return}u()})}if(e){const d="data-starting-style";if(!a.hasAttribute(d)){n.request(f);return}const g=new MutationObserver(()=>{a.hasAttribute(d)||(g.disconnect(),f())});g.observe(a,{attributes:!0,attributeFilter:[d]}),i?.addEventListener("abort",()=>g.disconnect(),{once:!0});return}n.request(f)})}function fo(t){const{enabled:e=!0,open:n,ref:r,onComplete:i}=t,s=Re(i),a=UU(r,n);E.useEffect(()=>{if(!e)return;const u=new AbortController;return a(s,u.signal),()=>{u.abort()}},[e,n,s,a])}const Tm={tabIndex:-1,[hx]:""};function $U(t){return e=>e==="touch"?t.current:!0}function rP(t,e=!1){const n=Sm(),r=wm()!=null,i=Sr(()=>t(n,r)).current;return FU({popupStore:i,treatPopupAsFloatingElement:e,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function iP({handle:t,store:e}){return Me(()=>t.attachStore(e),[t,e]),null}function qU(t,e){const n=E.useRef(null),r=E.useRef(null);return E.useCallback(i=>{if(t===void 0)return;let s=!1;if(n.current!==null){const a=n.current,u=r.current,f=e.context.triggerElements.getById(a);u&&f===u&&(e.context.triggerElements.delete(a),s=!0),n.current=null,r.current=null}if(i!==null&&(n.current=t,r.current=i,e.context.triggerElements.add(t,i),s=!0),s){const a=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==a&&e.set("triggerCount",a)}},[e,t])}function oP(t,e,n,r=!1){e?t.preventUnmountingOnClose=!1:r&&(t.preventUnmountingOnClose=!0);const i=n?.id??null;(i||e)&&(t.activeTriggerId=i,t.activeTriggerElement=n??null)}function GU(t){let e=!1;return t.preventUnmountOnClose=()=>{e=!0},()=>e}function WU(t,e,n,r={}){const i=n.reason,s=i===mi,a=e&&i===up,u=!e&&(i===Hd||i===Vd),f=GU(n);if(t.context.onOpenChange?.(e,n),n.isCanceled)return;r.onBeforeDispatch?.(),t.state.floatingRootContext.dispatchOpenChange(e,n);const d=()=>{const g={...r.extraState,open:e};a?g.instantType="focus":u?g.instantType="dismiss":s&&(g.instantType=void 0),oP(g,e,n.trigger,f()),t.update(g)};s?il.flushSync(d):d()}function sP(t,e,n,r){const i=n.useState("isMountedByTrigger",t),s=qU(t,n),a=Re(f=>{const d=n.select("open"),g=n.select("activeTriggerId");if(g===t){n.update({activeTriggerElement:f,...d?r:null});return}g==null&&d&&n.update({activeTriggerId:t,activeTriggerElement:f,...r})}),u=E.useCallback(f=>{s(f),f&&a(f)},[s,a]);return Me(()=>{i&&n.update({activeTriggerElement:e.current,...r})},[i,n,e,...Object.values(r)]),{registerTrigger:u,isMountedByThisTrigger:i}}function lP(t,e={}){const{closeOnActiveTriggerUnmount:n=!1}=e,r=E.useRef(null),i=t.useState("open"),s=t.useState("triggerCount"),a=t.useState("activeTriggerId"),u=t.useState("activeTriggerElement");Me(()=>{if(!i){r.current=null,t.state.triggerCount!==0&&t.set("triggerCount",0);return}const f=t.context.triggerElements.size,d={};t.state.triggerCount!==f&&(d.triggerCount=f);const g=t.select("activeTriggerId");let p=null;if(g){const m=t.context.triggerElements.getById(g);if(m)r.current=g,m!==t.state.activeTriggerElement&&(d.activeTriggerElement=m);else{for(const[v,b]of t.context.triggerElements.entries())if(b===t.state.activeTriggerElement){d.activeTriggerId=v,d.activeTriggerElement=b,r.current=v;break}d.activeTriggerId===void 0&&(r.current===g?p=g:r.current=null)}}else r.current=null;if(!p&&!g&&f===1){const m=t.context.triggerElements.entries().next();if(!m.done){const[v,b]=m.value;d.activeTriggerId=v,d.activeTriggerElement=b,r.current=v}}(d.triggerCount!==void 0||d.activeTriggerId!==void 0||d.activeTriggerElement!==void 0)&&t.update(d),p&&n&&queueMicrotask(()=>{if(t.select("open")&&t.select("activeTriggerId")===p&&!t.context.triggerElements.getById(p)){const m=Xe(yr);t.setOpen(!1,m),m.isCanceled||t.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,t,s,a,u,n])}function aP(t,e,n){const{mounted:r,setMounted:i,transitionStatus:s}=ga(t),a=e.useState("preventUnmountingOnClose"),u=t?!1:a;e.useSyncedValues({mounted:r,transitionStatus:s,preventUnmountingOnClose:u});const f=Re(()=>{i(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),e.context.onOpenChangeComplete?.(!1)});return fo({enabled:r&&!t&&!u,open:t,ref:e.context.popupRef,onComplete(){t||f()}}),{forceUnmount:f,transitionStatus:s}}function uP(t,e){t.useSyncedValues(e),Me(()=>()=>{t.update({activeTriggerProps:zn,inactiveTriggerProps:zn,popupProps:zn})},[t])}function KU(t,e){Me(()=>{!e&&t.state.openMethod!==null&&t.set("openMethod",null)},[e,t]),Me(()=>()=>{t.state.openMethod!==null&&t.set("openMethod",null)},[t])}class Am{constructor(){this.idMap=new Map}add(e,n){this.idMap.set(e,n)}delete(e){this.idMap.delete(e)}hasElement(e){for(const n of this.idMap.values())if(n===e)return!0;return!1}hasMatchingElement(e){for(const n of this.idMap.values())if(e(n))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function YU(){return new Em({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Am,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function cP(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:YU(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:zn,inactiveTriggerProps:zn,popupProps:zn}}function fP(t,e,n=!1){return new Em({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:t,floatingId:e,syncOnly:!0,nested:n,onOpenChange:void 0})}const Xf=t=>t.triggerIdProp??t.activeTriggerId,Ew=t=>t.openProp??t.open,CM=t=>(t.popupElement?.id??t.floatingId)||void 0;function dP(t,e){return e!==void 0&&Ew(t)&&Xf(t)===e}function XU(t,e){return dP(t,e)?!0:e!==void 0&&Ew(t)&&Xf(t)==null&&t.triggerCount===1}const hP={open:Ew,mounted:t=>t.mounted,transitionStatus:t=>t.transitionStatus,floatingRootContext:t=>t.floatingRootContext,triggerCount:t=>t.triggerCount,preventUnmountingOnClose:t=>t.preventUnmountingOnClose,payload:t=>t.payload,activeTriggerId:Xf,activeTriggerElement:t=>t.mounted?t.activeTriggerElement:null,popupId:CM,isTriggerActive:(t,e)=>e!==void 0&&Xf(t)===e,isOpenedByTrigger:(t,e)=>dP(t,e),isMountedByTrigger:(t,e)=>e!==void 0&&Xf(t)===e&&t.mounted,triggerProps:(t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps,triggerPopupId:(t,e)=>XU(t,e)?CM(t):void 0,popupProps:t=>t.popupProps,popupElement:t=>t.popupElement,positionerElement:t=>t.positionerElement};function gP(t){const e=E.useCallback(r=>t===void 0?Tn:t.subscribeStore(r),[t]),n=E.useCallback(()=>t===void 0?void 0:t.store,[t]);return nw.useSyncExternalStore(e,n,()=>t?.serverStore)}function pP(t){const{open:e=!1,onOpenChange:n,elements:r={}}=t,i=Sm(),s=wm()!=null,a=Sr(()=>new Em({open:e,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Am,floatingId:i,syncOnly:!1,nested:s})).current;return Me(()=>{const u={open:e,floatingId:i};r.reference!==void 0&&(u.referenceElement=r.reference,u.domReferenceElement=Ot(r.reference)?r.reference:null),r.floating!==void 0&&(u.floatingElement=r.floating),a.update(u)},[e,i,r.reference,r.floating,a]),a.context.onOpenChange=n,a.context.nested=s,a}function QU(t){return ZU(t,t.rootContext)}function ZU(t,e){const{nodeId:n,externalTree:r}=t,i=e.useState("referenceElement"),s=e.useState("floatingElement"),a=e.useState("domReferenceElement"),u=e.useState("open"),f=e.useState("floatingId"),[d,g]=E.useState(null),[p,m]=E.useState(void 0),[v,b]=E.useState(void 0),S=E.useRef(null),w=zc(r),C=E.useMemo(()=>({reference:i,floating:s,domReference:a}),[i,s,a]),R=NU({...t,elements:{...C,...d&&{reference:d}}}),T=Ot(p)?p:null,A=v===void 0?e.state.floatingElement:v;e.useSyncedValue("referenceElement",p??null),e.useSyncedValue("domReferenceElement",p===void 0?a:T),e.useSyncedValue("floatingElement",A);const k=E.useCallback(N=>{const _=Ot(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;g(_),R.refs.setReference(_)},[R.refs]),P=E.useCallback(N=>{(Ot(N)||N===null)&&(S.current=N,m(N)),(Ot(R.refs.reference.current)||R.refs.reference.current===null||N!==null&&!Ot(N))&&R.refs.setReference(N)},[R.refs,m]),M=E.useCallback(N=>{b(N),R.refs.setFloating(N)},[R.refs]),D=E.useMemo(()=>({...R.refs,setReference:P,setFloating:M,setPositionReference:k,domReference:S}),[R.refs,P,M,k]),L=E.useMemo(()=>({...R.elements,domReference:a}),[R.elements,a]),H=E.useMemo(()=>({...R,dataRef:e.context.dataRef,open:u,onOpenChange:e.setOpen,events:e.context.events,floatingId:f,refs:D,elements:L,nodeId:n,rootStore:e}),[R,D,L,n,e,u,f]);return Me(()=>{a&&(S.current=a)},[a]),Me(()=>{e.context.dataRef.current.floatingContext=H;const N=w?.nodesRef.current.find(_=>_.id===n);N&&(N.context=H)}),E.useMemo(()=>({...R,context:H,refs:D,elements:L,rootStore:e}),[R,D,L,H,e])}const F0=yD&&sl;function JU(t,e={}){const{enabled:n=!0,delay:r}=e,i="rootStore"in t?t.rootStore:t,{events:s,dataRef:a}=i.context,u=E.useRef(!1),f=E.useRef(null),d=E.useRef(!0),g=ii();E.useEffect(()=>{const m=i.select("domReferenceElement");if(!n)return;const v=An(m);function b(){const C=i.select("domReferenceElement");!i.select("open")&&fn(C)&&C===Gr(Vt(C))&&(u.current=!0)}function S(){d.current=!0}function w(){d.current=!1}return ps(At(v,"blur",b),F0&&At(v,"keydown",S,!0),F0&&At(v,"pointerdown",w,!0))},[i,n]),E.useEffect(()=>{if(!n)return;function m(v){if(v.reason===Hd||v.reason===Vd){const b=i.select("domReferenceElement");Ot(b)&&(f.current=b,u.current=!0)}}return s.on("openchange",m),()=>{s.off("openchange",m)}},[s,n,i]);const p=E.useMemo(()=>{function m(){u.current=!1,f.current=null}return{onMouseLeave(){m()},onFocus(v){const b=v.currentTarget;if(u.current){if(f.current===b)return;m()}const S=Yn(v.nativeEvent);if(Ot(S)){if(F0&&!v.relatedTarget){if(!d.current&&!ym(S))return}else if(!i6(S))return}const w=Op(v.relatedTarget,i.context.triggerElements),{nativeEvent:C,currentTarget:R}=v,T=typeof r=="function"?r():r;if(i.select("open")&&w||T===0||T===void 0){i.setOpen(!0,Xe(up,C,R));return}g.start(T,()=>{u.current||i.setOpen(!0,Xe(up,C,R))})},onBlur(v){m();const b=v.relatedTarget,S=v.nativeEvent,w=Ot(b)&&b.hasAttribute(yd("focus-guard"))&&b.getAttribute("data-type")==="outside";g.start(0,()=>{const C=i.select("domReferenceElement"),R=Gr(Vt(C));!b&&R===C||Qe(a.current.floatingContext?.refs.floating.current,R)||Qe(C,R)||w||Op(b??R,i.context.triggerElements)||i.setOpen(!1,Xe(up,S))})}}},[a,r,i,g]);return E.useMemo(()=>n?{reference:p,trigger:p}:{},[n,p])}class Tw{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 zo,this.restTimeout=new zo,this.handleCloseOptions=void 0}static create(){return new Tw}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Bp=new WeakMap;function _p(t){if(!t.performedPointerEventsMutation)return;const e=t.pointerEventsScopeElement;e&&Bp.get(e)===t&&(t.pointerEventsScopeElement?.style.removeProperty("pointer-events"),t.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),t.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Bp.delete(e)),t.performedPointerEventsMutation=!1,t.pointerEventsScopeElement=null,t.pointerEventsReferenceElement=null,t.pointerEventsFloatingElement=null}function mP(t,e){const{scopeElement:n,referenceElement:r,floatingElement:i}=e,s=Bp.get(n);s&&s!==t&&_p(s),_p(t),t.performedPointerEventsMutation=!0,t.pointerEventsScopeElement=n,t.pointerEventsReferenceElement=r,t.pointerEventsFloatingElement=i,Bp.set(n,t),n.style.pointerEvents="none",r.style.pointerEvents="auto",i.style.pointerEvents="auto"}function Aw(t){const e=t.context.dataRef.current,n=Sr(()=>e.hoverInteractionState??Tw.create()).current;return e.hoverInteractionState||(e.hoverInteractionState=n),lw(e.hoverInteractionState.disposeEffect),e.hoverInteractionState}function e$(t,e={}){const{enabled:n=!0,closeDelay:r=0,nodeId:i}=e,s="rootStore"in t?t.rootStore:t,a=s.useState("open"),u=s.useState("floatingElement"),f=s.useState("domReferenceElement"),{dataRef:d}=s.context,g=zc(),p=wm(),m=Aw(s),v=ii(),b=Re(()=>xD(d.current.openEvent?.type,m.interactedInside)),S=Re(()=>s6(d.current.openEvent?.type)),w=Re(()=>{_p(m)});Me(()=>{a||(m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,w())},[a,m,w]),E.useEffect(()=>w,[w]),Me(()=>{if(n&&a&&m.handleCloseOptions?.blockPointerEvents&&S()&&Ot(f)&&u){const C=f,R=u,T=Vt(u),A=g?.nodesRef.current.find(D=>D.id===p)?.context?.elements.floating;A&&(A.style.pointerEvents="");const k=m.pointerEventsScopeElement!==R?m.pointerEventsScopeElement:null,P=A!==R?A:null,M=m.handleCloseOptions?.getScope?.()??k??P??C.closest("[data-rootownerid]")??T.body;return mP(m,{scopeElement:M,referenceElement:C,floatingElement:R}),()=>{w()}}},[n,a,f,u,m,S,g,p,w]),E.useEffect(()=>{if(!n)return;function C(){return!!(g&&p&&la(g.nodesRef.current,p).length>0)}function R(D){const L=oa(r,"close",m.pointerType),H=()=>{s.setOpen(!1,Xe(mi,D)),g?.events.emit("floating.closed",D)};L?m.openChangeTimeout.start(L,H):(m.openChangeTimeout.clear(),H())}function T(D){const L=Yn(D);if(!bD(L)){m.interactedInside=!1;return}m.interactedInside=L?.closest("[aria-haspopup]")!=null}function A(){m.openChangeTimeout.clear(),v.clear(),g?.events.off("floating.closed",P),w()}function k(D){if(C()&&g){g.events.on("floating.closed",P);return}if(Op(D.relatedTarget,s.context.triggerElements))return;const L=d.current.floatingContext?.nodeId??i,H=D.relatedTarget;if(!(g&&L&&Ot(H)&&la(g.nodesRef.current,L,!1).some(_=>Qe(_.context?.elements.floating,H)))){if(m.handler){m.handler(D);return}w(),S()&&!b()&&R(D)}}function P(D){!g||!p||C()||v.start(0,()=>{g.events.off("floating.closed",P),s.setOpen(!1,Xe(mi,D)),g.events.emit("floating.closed",D)})}const M=u;return ps(M&&At(M,"mouseenter",A),M&&At(M,"mouseleave",k),M&&At(M,"pointerdown",T,!0),()=>{g?.events.off("floating.closed",P)})},[n,u,s,d,r,i,S,b,w,m,g,p,v])}const t$={current:null};function n$(t,e={}){const{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:s=!1,restMs:a=0,move:u=!0,triggerElementRef:f=t$,externalTree:d,isActiveTrigger:g=!0,getHandleCloseContext:p,isClosing:m,shouldOpen:v,guardStaleOpen:b=!1}=e,S="rootStore"in t?t.rootStore:t,{dataRef:w,events:C}=S.context,R=zc(d),T=Aw(S),A=E.useRef(!1),k=Fn(i),P=Fn(r),M=Fn(a),D=Fn(n),L=Fn(v),H=Fn(m),N=Re(()=>xD(w.current.openEvent?.type,T.interactedInside)),_=Re(()=>L.current?.()!==!1),$=Re((j,q,V)=>{const te=S.context.triggerElements;if(te.hasElement(q))return!j||!Qe(j,q);if(!Ot(V))return!1;const J=V;return te.hasMatchingElement(z=>Qe(z,J))&&(!j||!Qe(j,J))}),F=Re(()=>{if(!T.handler)return;Vt(S.select("domReferenceElement")).removeEventListener("mousemove",T.handler),T.handler=void 0}),G=Re(()=>{_p(T)});return g&&(T.handleCloseOptions=k.current?.__options),E.useEffect(()=>F,[F]),E.useEffect(()=>{if(!n)return;function j(q){q.open?A.current=!1:(A.current=q.reason===mi,F(),T.openChangeTimeout.clear(),T.restTimeout.clear(),T.blockMouseMove=!0,T.restTimeoutPending=!1)}return C.on("openchange",j),()=>{C.off("openchange",j)}},[n,C,T,F]),E.useEffect(()=>{if(!n)return;function j(U,W=!0){const X=oa(P.current,"close",T.pointerType);X?T.openChangeTimeout.start(X,()=>{S.setOpen(!1,Xe(mi,U)),R?.events.emit("floating.closed",U)}):W&&(T.openChangeTimeout.clear(),S.setOpen(!1,Xe(mi,U)),R?.events.emit("floating.closed",U))}const q=f.current??(g?S.select("domReferenceElement"):null);if(!Ot(q))return;function V(U){if(T.openChangeTimeout.clear(),T.blockMouseMove=!1,s&&!na(T.pointerType))return;const W=XA(M.current),X=oa(P.current,"open",T.pointerType),ie=Yn(U),ee=U.currentTarget??null,ue=S.select("domReferenceElement");let Y=ee;if(Ot(ie)&&!S.context.triggerElements.hasElement(ie)){for(const Ee of S.context.triggerElements.elements())if(Qe(Ee,ie)){Y=Ee;break}}Ot(ee)&&Ot(ue)&&!S.context.triggerElements.hasElement(ee)&&Qe(ee,ue)&&(Y=ue);const le=Y==null?!1:$(ue,Y,ie),xe=S.select("open"),ve=H.current?.()??S.select("transitionStatus")==="ending",de=!xe&&ve&&A.current,me=!le&&Ot(Y)&&Ot(ue)&&Qe(ue,Y)&&de,Ce=W>0&&!X,De=le&&(xe||de)||me,Pe=!xe||le;if(De){_()&&S.setOpen(!0,Xe(mi,U,Y));return}Ce||(X?T.openChangeTimeout.start(X,()=>{Pe&&_()&&S.setOpen(!0,Xe(mi,U,Y))}):Pe&&_()&&S.setOpen(!0,Xe(mi,U,Y)))}function te(U){if(N()){G();return}F();const W=S.select("domReferenceElement"),X=Vt(W);T.restTimeout.clear(),T.restTimeoutPending=!1;const ie=w.current.floatingContext??p?.();if(Op(U.relatedTarget,S.context.triggerElements))return;if(k.current&&ie){S.select("open")||T.openChangeTimeout.clear();const ue=f.current;T.handler=k.current({...ie,tree:R,x:U.clientX,y:U.clientY,onClose(){G(),F(),D.current&&!N()&&ue===S.select("domReferenceElement")&&j(U,!0)}}),X.addEventListener("mousemove",T.handler),T.handler(U);return}(T.pointerType!=="touch"||!Qe(S.select("floatingElement"),U.relatedTarget))&&j(U)}function J(U){Qe(q,U.relatedTarget)||(T.openChangeTimeout.clear(),T.restTimeout.clear(),T.restTimeoutPending=!1)}const z=b?At(q,"mouseout",J):void 0;return u?ps(At(q,"mousemove",V,{once:!0}),At(q,"mouseenter",V),At(q,"mouseleave",te),z):ps(At(q,"mouseenter",V),At(q,"mouseleave",te),z)},[F,G,w,P,S,n,k,T,g,$,N,s,u,M,f,R,D,p,H,_,b]),E.useMemo(()=>{if(!n)return;function j(q){T.pointerType=q.pointerType}return{onPointerDown:j,onPointerEnter:j,onMouseMove(q){const{nativeEvent:V}=q,te=q.currentTarget,J=S.select("domReferenceElement"),z=S.select("open"),U=$(J,te,q.target);if(s&&!na(T.pointerType))return;if(z&&U&&T.handleCloseOptions?.blockPointerEvents){const ie=S.select("floatingElement");if(ie){const ee=T.handleCloseOptions?.getScope?.()??te.ownerDocument.body;mP(T,{scopeElement:ee,referenceElement:te,floatingElement:ie})}}const W=XA(M.current);if(z&&!U||W===0||!U&&T.restTimeoutPending&&q.movementX**2+q.movementY**2<2)return;T.restTimeout.clear();function X(){if(T.restTimeoutPending=!1,N())return;const ie=S.select("open");!T.blockMouseMove&&(!ie||U)&&_()&&S.setOpen(!0,Xe(mi,V,te))}T.pointerType==="touch"?il.flushSync(()=>{X()}):U&&z?X():(T.restTimeoutPending=!0,T.restTimeout.start(W,X))}}},[n,T,N,$,s,S,M,_])}const r$="Escape";function RM(t){return sl&&t.movementX===0&&t.movementY===0}function Mm(t,e,n){switch(t){case"vertical":return e;case"horizontal":return n;default:return e||n}}function Rg(t,e){return Mm(e,t===fw||t===mm,t===eu||t===tu)}function U0(t,e,n){return Mm(e,t===mm,n?t===eu:t===tu)||t==="Enter"||t===" "||t===""}function i$(t,e,n){return Mm(e,n?t===eu:t===tu,t===mm)}function o$(t,e,n,r){const i=n?t===tu:t===eu,s=t===fw;return e==="both"||e==="horizontal"&&r?t===r$:Mm(e,i,s)}function yP(t,e){const{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:s=!0,selectedIndex:a=null,allowEscape:u=!1,loopFocus:f=!1,nested:d=!1,rtl:g=!1,virtual:p=!1,focusItemOnOpen:m="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:S=void 0,orientation:w="vertical",parentOrientation:C,id:R,resetOnPointerLeave:T=!0,externalTree:A,grid:k}=e,P=k!=null,M="rootStore"in t?t.rootStore:t,D=M.useState("open"),L=M.useState("floatingElement"),H=M.useState("domReferenceElement"),N=M.context.dataRef,_=kp(L),$=gx(H),F=Fn(_),G=wm(),j=zc(A),q=E.useRef(m),V=E.useRef(a??-1),te=E.useRef(null),J=E.useRef(!0),z=Re(ne=>{i(V.current===-1?null:V.current,ne)}),U=E.useRef(!!L),W=E.useRef(D),X=E.useRef(!1),ie=E.useRef(!1),ee=E.useRef(null),ue=Fn(S),Y=Fn(D),le=Fn(a),xe=Fn(T),ve=xc(),de=xc(),me=Re(()=>{function ne(Ie){p?j?.events.emit("virtualfocus",Ie):ee.current=dp(Ie,{sync:X.current,preventScroll:!0})}const Q=n.current[V.current],Se=ie.current;Q&&ne(Q),(X.current?Ie=>Ie():Ie=>ve.request(Ie))(()=>{const Ie=n.current[V.current]||Q;if(!Ie)return;Q||ne(Ie),ke&&(Se||!J.current)&&Ie.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Me(()=>{N.current.orientation=w},[N,w]),Me(()=>{s&&(D&&L?(V.current=a??-1,q.current&&a!=null&&(ie.current=!0,z())):U.current&&(V.current=-1,z()))},[s,D,L,a,z]),Me(()=>{if(s){if(!D){X.current=!1;return}if(L)if(r==null){if(X.current=!1,le.current!=null)return;if(U.current&&(V.current=-1,me()),(!W.current||!U.current)&&q.current&&(te.current!=null||q.current===!0&&te.current==null)){let ne=0;const Q=()=>{n.current[0]==null?(ne<2&&(ne?ge=>de.request(ge):queueMicrotask)(Q),ne+=1):(V.current=te.current==null||U0(te.current,w,g)||d?fp(n):mx(n),te.current=null,z())};Q()}}else ra(n.current,r)||(V.current=r,me(),ie.current=!1)}},[s,D,L,r,le,d,n,w,g,z,me,de]),Me(()=>{if(!s||L||!j||p||!U.current)return;const ne=j.nodesRef.current,Q=ne.find(Ie=>Ie.id===G)?.context?.elements.floating,Se=Gr(Vt(H??Q??null)),ge=ne.some(Ie=>Ie.context&&Qe(Ie.context.elements.floating,Se));Q&&!ge&&J.current&&Q.focus({preventScroll:!0})},[s,L,H,j,G,p]),Me(()=>{W.current=D,U.current=!!L}),Me(()=>{D||(te.current=null,q.current=m)},[D,m]);const Ce=r!=null,De=Re(ne=>{if(!Y.current)return;const Q=n.current.indexOf(ne.currentTarget);Q!==-1&&(V.current!==Q||r!==Q)&&(V.current=Q,z(ne))}),Pe=Re(()=>C??j?.nodesRef.current.find(ne=>ne.id===G)?.context?.dataRef?.current.orientation),Ee=Re(()=>fp(n,ue.current)),je=Re(ne=>{if(J.current=!1,X.current=!0,ne.which===229||!Y.current&&ne.currentTarget===F.current)return;if(d&&o$(ne.key,w,g,P)){Rg(ne.key,Pe())||Dr(ne),M.setOpen(!1,Xe(ZA,ne.nativeEvent)),fn(H)&&(p?j?.events.emit("virtualfocus",H):H.focus());return}const Q=V.current,Se=fp(n,S),ge=mx(n,S);if($||(ne.key==="Home"&&(Dr(ne),V.current=Se,z(ne)),ne.key==="End"&&(Dr(ne),V.current=ge,z(ne))),k!=null){const Ie=k(ne,V.current,n,w,f,g,S,Se,ge);if(Ie!=null&&(V.current=Ie,z(ne)),w==="both")return}if(Rg(ne.key,w)){if(Dr(ne),D&&!p&&Gr(ne.currentTarget.ownerDocument)===ne.currentTarget){V.current=U0(ne.key,w,g)?Se:ge,z(ne);return}U0(ne.key,w,g)?f?Q>=ge?u&&Q!==n.current.length?V.current=-1:(X.current=!1,V.current=Se):V.current=Er(n.current,{startingIndex:Q,disabledIndices:S}):V.current=Math.min(ge,Er(n.current,{startingIndex:Q,disabledIndices:S})):f?Q<=Se?u&&Q!==-1?V.current=n.current.length:(X.current=!1,V.current=ge):V.current=Er(n.current,{startingIndex:Q,decrement:!0,disabledIndices:S}):V.current=Math.max(Se,Er(n.current,{startingIndex:Q,decrement:!0,disabledIndices:S})),ra(n.current,V.current)&&(V.current=-1),z(ne)}}),ke=E.useMemo(()=>({onFocus(Q){X.current=!0,De(Q)},onClick:({currentTarget:Q})=>Q.focus({preventScroll:!0}),onMouseMove(Q){RM(Q)||(X.current=!0,ie.current=!1,v&&De(Q))},onPointerLeave(Q){if(!Y.current||!J.current||Q.pointerType==="touch")return;X.current=!0;const Se=Q.relatedTarget;if(!(!v||n.current.includes(Se))&&xe.current&&(ee.current?.(),ee.current=null,V.current=-1,z(Q),!p)){const ge=F.current,Ie=Gr(Vt(ge));ge&&Qe(ge,Ie)&&ge.focus({preventScroll:!0})}}}),[De,Y,F,v,n,z,xe,p]),_e=E.useMemo(()=>p&&D&&Ce&&{"aria-activedescendant":`${R}-${r}`},[p,D,Ce,R,r]),Ge=E.useMemo(()=>({"aria-orientation":w==="both"?void 0:w,...$?{}:_e,onKeyDown(ne){if(ne.key==="Tab"&&ne.shiftKey&&D&&!p){const Q=Yn(ne.nativeEvent);if(Q&&!Qe(F.current,Q))return;Dr(ne),M.setOpen(!1,Xe(jd,ne.nativeEvent)),fn(H)&&H.focus();return}je(ne)},onPointerMove(ne){RM(ne)||(J.current=!0)}}),[_e,je,F,w,$,M,D,p,H]),We=E.useMemo(()=>{function ne(ge){M.setOpen(!0,Xe(ZA,ge.nativeEvent,ge.currentTarget))}function Q(ge){m==="auto"&&uw(ge.nativeEvent)&&(q.current=!p)}function Se(ge){q.current=m,m==="auto"&&cw(ge.nativeEvent)&&(q.current=!0)}return{onKeyDown(ge){const Ie=M.select("open");J.current=!1;const Je=ge.key.startsWith("Arrow"),nt=i$(ge.key,Pe(),g),Le=Rg(ge.key,w),it=(d?nt:Le)||ge.key==="Enter"||ge.key.trim()==="";if(p&&Ie)return je(ge);if(!(!Ie&&!b&&Je)){if(it){const ht=Rg(ge.key,Pe());te.current=d&&ht?null:ge.key}if(d){nt&&(Dr(ge),Ie?(V.current=Ee(),z(ge)):ne(ge));return}Le&&(le.current!=null&&(V.current=le.current),Dr(ge),!Ie&&b?ne(ge):je(ge),Ie&&z(ge))}},onFocus(ge){M.select("open")&&!p&&(V.current=-1,z(ge))},onPointerDown:Se,onPointerEnter:Se,onMouseDown:Q,onClick:Q}},[je,m,Ee,d,z,M,b,w,Pe,g,le,p]),fe=E.useMemo(()=>({..._e,...We}),[_e,We]);return E.useMemo(()=>s?{reference:fe,floating:Ge,item:ke,trigger:We}:{},[s,fe,Ge,We,ke])}function s$(t,e){const{listRef:n,elementsRef:r,activeIndex:i,onMatch:s,disabledIndices:a,onTyping:u,enabled:f=!0,resetMs:d=750,selectedIndex:g=null}=e,p="rootStore"in t?t.rootStore:t,m=p.useState("open"),v=ii(),b=E.useRef(""),S=E.useRef(g??i??-1),w=E.useRef(null),C=Re(A=>{function k(F){return r?.current[F]}function P(F){const G=k(F);return G&&!bm(G)||G?.matches(":disabled")?!1:a==null||!wc(Pi,F,a)}function M(F,G,j=0){if(F.length===0)return-1;const q=(j%F.length+F.length)%F.length,V=G.toLowerCase();for(let te=0;te<F.length;te+=1){const J=(q+te)%F.length;if(!(!F[J]?.toLowerCase().startsWith(V)||!P(J)))return J}return-1}const D=n.current;if(b.current.length>0&&A.key===" "&&(Dr(A),u?.(!0)),b.current.length>0&&b.current[0]!==" "&&M(D,b.current)===-1&&A.key!==" "&&u?.(!1),D==null||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;m&&A.key!==" "&&(Dr(A),u?.(!0));const L=b.current==="";L&&(S.current=g??i??-1),D.every((F,G)=>F&&P(G)?F[0]?.toLowerCase()!==F[1]?.toLowerCase():!0)&&b.current===A.key&&(b.current="",S.current=w.current),b.current+=A.key,v.start(d,()=>{b.current="",S.current=w.current,u?.(!1)});const _=((L?g??i??-1:S.current)??0)+1,$=M(D,b.current,_);$!==-1?(s?.($),w.current=$):A.key!==" "&&(b.current="",u?.(!1))}),R=Re(A=>{const k=A.relatedTarget,P=p.select("domReferenceElement"),M=p.select("floatingElement");Qe(P,k)||Qe(M,k)||(v.clear(),b.current="",S.current=w.current,u?.(!1))});Me(()=>{!m&&g!==null||(v.clear(),w.current=null,b.current!==""&&(b.current=""))},[m,g,v]);const T=E.useMemo(()=>({onKeyDown:C,onBlur:R}),[C,R]);return E.useMemo(()=>f?{reference:T,floating:T}:{},[f,T])}const EM=.1,l$=EM*EM,mn=.5;function Eg(t,e,n,r,i,s){return r>=e!=s>=e&&t<=(i-n)*(e-r)/(s-r)+n}function Tg(t,e,n,r,i,s,a,u,f,d){let g=!1;return Eg(t,e,n,r,i,s)&&(g=!g),Eg(t,e,i,s,a,u)&&(g=!g),Eg(t,e,a,u,f,d)&&(g=!g),Eg(t,e,f,d,n,r)&&(g=!g),g}function a$(t,e,n){return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height}function Ag(t,e,n,r,i,s){const a=Math.min(n,i),u=Math.max(n,i),f=Math.min(r,s),d=Math.max(r,s);return t>=a&&t<=u&&e>=f&&e<=d}function u$(t={}){const{blockPointerEvents:e=!1}=t,n=new zo,r=({x:i,y:s,placement:a,elements:u,onClose:f,nodeId:d,tree:g})=>{const p=a?.split("-")[0];let m=!1,v=null,b=null,S=typeof performance<"u"?performance.now():0;function w(R,T){const A=performance.now(),k=A-S;if(v===null||b===null||k===0)return v=R,b=T,S=A,!1;const P=R-v,M=T-b,D=P*P+M*M,L=k*k*l$;return v=R,b=T,S=A,D<L}function C(){n.clear(),f()}return function(T){n.clear();const A=u.domReference,k=u.floating;if(!A||!k||p==null||i==null||s==null)return;const{clientX:P,clientY:M}=T,D=Yn(T),L=T.type==="mouseleave",H=Qe(k,D),N=Qe(A,D);if(H&&(m=!0,!L))return;if(N&&(m=!1,!L)){m=!0;return}if(L&&Ot(T.relatedTarget)&&Qe(k,T.relatedTarget))return;function _(){return!!(g&&la(g.nodesRef.current,d).length>0)}function $(){_()||C()}if(_())return;const F=A.getBoundingClientRect(),G=k.getBoundingClientRect(),j=i>G.right-G.width/2,q=s>G.bottom-G.height/2,V=G.width>F.width,te=G.height>F.height,J=(V?F:G).left,z=(V?F:G).right,U=(te?F:G).top,W=(te?F:G).bottom;if(p==="top"&&s>=F.bottom-1||p==="bottom"&&s<=F.top+1||p==="left"&&i>=F.right-1||p==="right"&&i<=F.left+1){$();return}let X=!1;switch(p){case"top":X=Ag(P,M,J,F.top+1,z,G.bottom-1);break;case"bottom":X=Ag(P,M,J,G.top+1,z,F.bottom-1);break;case"left":X=Ag(P,M,G.right-1,W,F.left+1,U);break;case"right":X=Ag(P,M,F.right-1,W,G.left+1,U);break}if(X)return;if(m&&!a$(P,M,F)){$();return}if(!L&&w(P,M)){$();return}let ie=!1;switch(p){case"top":{const ee=V?mn/2:mn*4,ue=V||j?i+ee:i-ee,Y=V?i-ee:j?i+ee:i-ee,le=s+mn+1,xe=j||V?G.bottom-mn:G.top,ve=j?V?G.bottom-mn:G.top:G.bottom-mn;ie=Tg(P,M,ue,le,Y,le,G.left,xe,G.right,ve);break}case"bottom":{const ee=V?mn/2:mn*4,ue=V||j?i+ee:i-ee,Y=V?i-ee:j?i+ee:i-ee,le=s-mn,xe=j||V?G.top+mn:G.bottom,ve=j?V?G.top+mn:G.bottom:G.top+mn;ie=Tg(P,M,ue,le,Y,le,G.left,xe,G.right,ve);break}case"left":{const ee=te?mn/2:mn*4,ue=te||q?s+ee:s-ee,Y=te?s-ee:q?s+ee:s-ee,le=i+mn+1,xe=q||te?G.right-mn:G.left,ve=q?te?G.right-mn:G.left:G.right-mn;ie=Tg(P,M,xe,G.top,ve,G.bottom,le,ue,le,Y);break}case"right":{const ee=te?mn/2:mn*4,ue=te||q?s+ee:s-ee,Y=te?s-ee:q?s+ee:s-ee,le=i-mn,xe=q||te?G.left+mn:G.right,ve=q?te?G.left+mn:G.right:G.left+mn;ie=Tg(P,M,le,ue,le,Y,xe,G.top,ve,G.bottom);break}}ie?m||n.start(40,$):$()}};return r.__options={...t,blockPointerEvents:e},r}const vP=E.createContext(null);function ll(){const t=E.useContext(vP);if(t===null)throw new Error(Un(60));return t}const vd={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},bP={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},c$={disabled:!1,...bP},mu={valid(t){return t===null?null:t?{"data-valid":""}:{"data-invalid":""}}},xP={invalid:void 0,name:void 0,validityData:{state:vd,errors:[],error:"",value:"",initialValue:null},setValidityData:Tn,disabled:void 0,setTouched:Tn,setDirty:Tn,setFilled:Tn,setFocused:Tn,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:c$,registerFieldControl:Tn,validation:{getValidationProps:(t,e=zn)=>e,inputRef:{current:null},registeredInputs:new Map,registerInput:Tn,getInputControl:()=>null,commit:async()=>{},change:Tn}},Mw=E.createContext(xP);function Ho(t=!0){const e=E.useContext(Mw);if(e.setValidityData===Tn&&!t)throw new Error(Un(28));return e}function Ow(t,e,n,r,i=!0,s){const{registerFieldControl:a}=Ho(),u=Sr(()=>Symbol());Me(()=>{const f=u.current;if(!i){a(f,void 0);return}a(f,{controlRef:t,getValue:r,id:e,name:s,value:n})},[t,i,r,e,s,a,u,n]),Me(()=>{const f=u.current;return()=>{a(f,void 0)}},[a,u])}function ho(t){return Sm(t,"base-ui")}const SP=E.createContext({controlId:void 0,registerControlId:Tn,labelId:void 0,setLabelId:Tn,messageIds:[],setMessageIds:Tn,getDescriptionProps:t=>t});function vs(){return E.useContext(SP)}function Om(t={}){const{id:e,implicit:n=!1,controlRef:r}=t,{controlId:i,registerControlId:s}=vs(),a=ho(e),u=n?i:void 0,f=Sr(()=>Symbol()),d=E.useRef(!1),g=E.useRef(e!=null),p=Re(()=>{!d.current||s===Tn||(d.current=!1,s(f.current,void 0))});return Me(()=>{if(s===Tn)return;let m;if(n){const v=r?.current;Ot(v)&&v.closest("label")!=null?m=e??null:m=u??a}else if(e!=null)g.current=!0,m=e;else if(g.current)m=a;else{p();return}if(m===void 0){p();return}d.current=!0,s(f.current,m)},[e,r,u,s,n,a,f,p]),E.useEffect(()=>p,[p]),i??a}const wP=(t,e)=>Object.is(t,e);function uo(t,e,n){return t==null||e==null?Object.is(t,e):n(t,e)}function f$(t,e,n){return!t||t.length===0?!1:t.some(r=>r===void 0?!1:uo(e,r,n))}function ac(t,e,n){return!t||t.length===0?-1:t.findIndex(r=>r===void 0?!1:uo(r,e,n))}function $0(t,e,n,r){const i=r&&Array.isArray(e)?e[e.length-1]:e,s=ac(t,i,n);return s===-1?null:s}function CP(t,e,n){return t.filter(r=>!uo(e,r,n))}function xx(t){if(t==null)return"";if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function kw(t){return t!=null&&t.length>0&&typeof t[0]=="object"&&t[0]!=null&&"items"in t[0]}function d$(t){if(!Array.isArray(t))return t!=null&&"null"in t;const e=t;if(kw(e)){for(const n of e)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of e)if(n&&n.value==null&&n.label!=null)return!0;return!1}function Zi(t,e){if(e&&t!=null)return e(t)??"";if(t&&typeof t=="object"){if("label"in t&&t.label!=null)return String(t.label);if("value"in t)return String(t.value)}return xx(t)}function To(t,e){return e&&t!=null?e(t)??"":t&&typeof t=="object"&&"value"in t&&"label"in t?xx(t.value):xx(t)}function RP(t,e,n){function r(){return Zi(t,n)}if(n&&t!=null)return n(t);if(t&&typeof t=="object"&&"label"in t&&t.label!=null)return t.label;if(e&&!Array.isArray(e))return e[t]??r();if(Array.isArray(e)){const i=e,s=kw(i)?i.flatMap(a=>a.items):i;if(t==null||typeof t!="object"){const a=s.find(u=>u.value===t);return a&&a.label!=null?a.label:r()}if("value"in t){const a=s.find(u=>u&&u.value===t.value);if(a&&a.label!=null)return a.label}}return r()}function h$(t,e,n){return t.reduce((r,i,s)=>(s>0&&r.push(", "),r.push(O.jsx(E.Fragment,{children:RP(i,e,n)},s)),r),[])}const dt={id:t=>t.id,labelId:t=>t.labelId,modal:t=>t.modal,items:t=>t.items,itemToStringLabel:t=>t.itemToStringLabel,isItemEqualToValue:t=>t.isItemEqualToValue,value:t=>t.value,hasSelectedValue:t=>{const{value:e,multiple:n,itemToStringValue:r}=t;return e==null?!1:n&&Array.isArray(e)?e.length>0:To(e,r)!==""},hasNullItemLabel:(t,e)=>e?d$(t.items):!1,open:t=>t.open,mounted:t=>t.mounted,forceMount:t=>t.forceMount,transitionStatus:t=>t.transitionStatus,openMethod:t=>t.openMethod,activeIndex:t=>t.activeIndex,selectedIndex:t=>t.selectedIndex,isActive:(t,e)=>t.activeIndex===e,isSelected:(t,e)=>{const n=t.isItemEqualToValue,r=t.value;return t.multiple?Array.isArray(r)&&r.some(i=>uo(e,i,n)):uo(e,r,n)},isSelectedByFocus:(t,e)=>t.selectedIndex===e,popupProps:t=>t.popupProps,triggerProps:t=>t.triggerProps,triggerElement:t=>t.triggerElement,positionerElement:t=>t.positionerElement,listElement:t=>t.listElement,popupSide:t=>t.popupSide,scrollUpArrowVisible:t=>t.scrollUpArrowVisible,scrollDownArrowVisible:t=>t.scrollDownArrowVisible,hasScrollArrows:t=>t.hasScrollArrows},g$=E.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Tn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function yu(){return E.useContext(g$)}function EP(t,e,n=(r,i)=>r===i){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}function nc(t,e){const n=E.useRef(t),r=Re(e);Me(()=>{n.current!==t&&r(n.current),n.current=t},[t,r])}function p$(t){const e=E.useRef(""),n=E.useCallback(i=>{i.defaultPrevented||(e.current=i.pointerType,t(i,i.pointerType))},[t]);return{onClick:E.useCallback(i=>{if(i.detail===0){t(i,"keyboard");return}"pointerType"in i?t(i,i.pointerType):t(i,e.current),e.current=""},[t]),onPointerDown:n}}function TP(t,e){const n=Re((s,a)=>{(typeof t=="function"?t():t)||e(a||(_d?"touch":""))}),{onClick:r,onPointerDown:i}=p$(n);return E.useMemo(()=>({onClick:r,onPointerDown:i}),[r,i])}function AP(t){const[e,n]=E.useState(null),r=TP(t,n);return nc(t,i=>{i&&!t&&n(null)}),E.useMemo(()=>({openMethod:e,triggerProps:r}),[e,r])}function Vf(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}const qs=1;function MP(t,e){return Math.max(0,t-e)}function m$(t,e){if(e<=0)return 0;const n=Vf(t,0,e),r=n,i=e-n,s=r<=qs,a=i<=qs;return s&&a?r<=i?0:e:s?0:a?e:n}function y$(t){const{id:e,value:n,defaultValue:r=null,onValueChange:i,open:s,defaultOpen:a=!1,onOpenChange:u,name:f,form:d,autoComplete:g,disabled:p=!1,readOnly:m=!1,required:v=!1,modal:b=!0,actionsRef:S,inputRef:w,onOpenChangeComplete:C,items:R,multiple:T=!1,itemToStringLabel:A,itemToStringValue:k,isItemEqualToValue:P=wP,highlightItemOnHover:M=!0,children:D}=t,{clearErrors:L}=yu(),{setDirty:H,setTouched:N,setFocused:_,validityData:$,setFilled:F,name:G,disabled:j,validation:q,validationMode:V}=Ho(),te=Om({id:e}),J=j||p,z=G??f,[U,W]=Ja({controlled:n,default:T?r??Pi:r,name:"Select",state:"value"}),[X,ie]=Ja({controlled:s,default:a,name:"Select",state:"open"}),ee=E.useRef([]),ue=E.useRef([]),Y=E.useRef(null),le=E.useRef(null),xe=E.useRef(0),ve=E.useRef(null),de=E.useRef([]),me=E.useRef(!1),Ce=E.useRef(null),De=E.useRef(null),Pe=E.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Ee=E.useRef(!1),{mounted:je,setMounted:ke,transitionStatus:_e}=ga(X),{openMethod:Ge,triggerProps:We}=AP(X),fe=Sr(()=>new fm({id:te,labelId:void 0,modal:b,multiple:T,itemToStringLabel:A,itemToStringValue:k,isItemEqualToValue:P,value:U,open:X,mounted:je,transitionStatus:_e,items:R,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ne=pe(fe,dt.activeIndex),Q=pe(fe,dt.selectedIndex),Se=pe(fe,dt.triggerElement),ge=pe(fe,dt.positionerElement),Ie=C8(Ge),Je=Ge??Ie,nt=E.useMemo(()=>T?"":To(U,k),[T,U,k]),Le=E.useMemo(()=>T&&Array.isArray(U)?U.map(ot=>To(ot,k)):To(U,k),[T,U,k]),it=Fn(Se),ht=Re(()=>Le);Ow(it,te,U,ht,!J,f);const wt=E.useRef(U),bn=T?Array.isArray(U)&&U.length>0:U!=null&&nt!=="";Me(()=>{F(bn)},[bn,F]),Me(function(){let Ut=U,$n=!1;if(T){const rn=Array.isArray(U)?U:[];$n=rn.length===0,Ut=rn[rn.length-1]}const Ln=$n?-1:ac(de.current,Ut,P),wr=Ln===-1?null:Ln;wr===null&&(De.current=null),!X&&fe.set("selectedIndex",wr)},[T,X,U,P,fe]);function ut(ot){const Ut=$.initialValue;return Array.isArray(ot)&&Array.isArray(Ut)?!EP(ot,Ut,($n,Ln)=>uo($n,Ln,P)):ot!==Ut}nc(U,()=>{L(z),H(ut(U)),q.change(U)});const Mn=Re((ot,Ut)=>{u?.(ot,Ut),!Ut.isCanceled&&(ie(ot),!ot&&(Ut.reason===jd||Ut.reason===vm)&&(N(!0),_(!1),V==="onBlur"&&q.commit(U)))}),Qt=Re(()=>{ke(!1),fe.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),C?.(!1)});fo({enabled:!S,open:X,ref:Y,onComplete(){X||Qt()}}),E.useImperativeHandle(S,()=>({unmount:Qt}),[Qt]);const xn=Re((ot,Ut)=>{i?.(ot,Ut),!Ut.isCanceled&&W(ot)}),nn=Re(ot=>{const Ut=MP(ot.scrollHeight,ot.clientHeight),$n=m$(ot.scrollTop,Ut),Ln=$n>0,wr=$n<Ut;fe.set("scrollUpArrowVisible",Ln),fe.set("scrollDownArrowVisible",wr)}),Wt=pP({open:X,onOpenChange:Mn,elements:{reference:Se,floating:ge}}),lt=Cw(Wt,{enabled:!m&&!J,event:"mousedown"}),yt=Cm(Wt),rt=yP(Wt,{enabled:!m&&!J,listRef:ee,activeIndex:ne,selectedIndex:Q,disabledIndices:Pi,onNavigate(ot){ot===null&&!X||fe.set("activeIndex",ot)},focusItemOnHover:M}),Zt=s$(Wt,{enabled:!m&&!J&&(X||!T),listRef:ue,activeIndex:ne,selectedIndex:Q,disabledIndices:ot=>dD(ee.current[ot]),onMatch(ot){X?fe.set("activeIndex",ot):xn(de.current[ot],Xe(yr))},onTyping(ot){me.current=ot}}),Hn=E.useMemo(()=>ko(Zt.reference,rt.reference,yt.reference,lt.reference,We),[lt.reference,Zt.reference,rt.reference,yt.reference,We]),jn=E.useMemo(()=>ko(Tm,Zt.floating,rt.floating,yt.floating),[Zt.floating,rt.floating,yt.floating]),Jt=rt.item??zn;fD(()=>{fe.update({popupProps:jn,triggerProps:Hn})}),fe.useSyncedValues({id:te,modal:b,multiple:T,value:U,open:X,mounted:je,transitionStatus:_e,popupProps:jn,triggerProps:Hn,items:R,itemToStringLabel:A,itemToStringValue:k,isItemEqualToValue:P,openMethod:Je});const Rn=E.useMemo(()=>({store:fe,floatingContext:Wt,required:v,disabled:J,readOnly:m,multiple:T,highlightItemOnHover:M,setValue:xn,setOpen:Mn,listRef:ee,popupRef:Y,scrollHandlerRef:le,handleScrollArrowVisibility:nn,scrollArrowsMountedCountRef:xe,itemProps:Jt,valueRef:ve,valuesRef:de,labelsRef:ue,typingRef:me,selectionRef:Pe,firstItemTextRef:Ce,selectedItemTextRef:De,validation:q,onOpenChangeComplete:C,alignItemWithTriggerActiveRef:Ee,initialValueRef:wt}),[fe,Wt,v,J,m,T,M,xn,Mn,Jt,q,C,nn]),Dt=tl(w,q.inputRef),Br=T?void 0:z,or=E.useMemo(()=>!T||!Array.isArray(U)||!z?null:U.map(ot=>{const Ut=To(ot,k);return O.jsx("input",{type:"hidden",form:d,name:z,value:Ut,disabled:J},Ut)}),[T,U,d,z,k,J]);return O.jsxs(vP.Provider,{value:Rn,children:[D,O.jsx("input",{...q.getValidationProps(J,{onFocus(){fe.state.triggerElement?.focus({focusVisible:!0})},onChange(ot){if(ot.nativeEvent.defaultPrevented||J||m)return;const Ut=ot.currentTarget.value,$n=Xe(yr,ot.nativeEvent);function Ln(){if(T)return;const wr=Ut.toLowerCase();let rn=de.current.findIndex(zt=>To(zt,k).toLowerCase()===wr||Zi(zt,A).toLowerCase()===wr);rn===-1&&(rn=de.current.findIndex((zt,et)=>{const Cr=ue.current[et];return Cr!=null&&Cr.toLowerCase()===wr}));const Pt=de.current[rn];Pt!=null&&xn(Pt,$n)}fe.set("forceMount",!0),queueMicrotask(Ln)}}),id:te&&Br==null?`${te}-hidden-input`:void 0,form:d,name:Br,autoComplete:g,value:nt,disabled:J,required:v&&!(T&&bn),readOnly:m,ref:Dt,style:z?ew:JS,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),or]})}function v$(t,e){const n=ho(t);return Me(()=>(e(n),()=>{e(r=>r===n?void 0:r)}),[n,e]),n}function b$(t={}){const{id:e,fallbackControlId:n,native:r=!1,setLabelId:i,focusControl:s}=t,{controlId:a,setLabelId:u}=vs(),f=Re(v=>{u(v),i?.(v)}),d=v$(e,f),g=a??n;function p(v){if(s){s(v,g);return}if(!g)return;const b=Vt(v.currentTarget).getElementById(g);fn(b)&&x$(b)}function m(v){Yn(v.nativeEvent)?.closest("button,input,select,textarea")||(!v.defaultPrevented&&v.detail>1&&v.preventDefault(),!r&&p(v))}return r?{id:d,htmlFor:g??void 0,onMouseDown:m}:{id:d,onClick:m,onPointerDown(v){v.preventDefault()}}}function x$(t){t.focus({focusVisible:!0})}function S$(t,e){return t??e}let TM=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const w$={"data-starting-style":""},C$={"data-ending-style":""},al={transitionStatus(t){return t==="starting"?w$:t==="ending"?C$:null}};(function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=TM.startingStyle]="startingStyle",t[t.endingStyle=TM.endingStyle]="endingStyle",t.anchorHidden="data-anchor-hidden",t.side="data-side",t.align="data-align",t})({});const R$={"data-popup-open":""},E$={"data-popup-open":"","data-pressed":""},T$={"data-open":""},A$={"data-closed":""},M$={"data-anchor-hidden":""},km={open(t){return t?R$:null}},OP={open(t){return t?E$:null}},Fd={open(t){return t?T$:A$},anchorHidden(t){return t?M$:null}},kP={...Fd,...al},Mg=5;function O$(t,e){const n=k$(e);return t.clientX>=n.left-Mg&&t.clientX<=n.right+Mg&&t.clientY>=n.top-Mg&&t.clientY<=n.bottom+Mg}function k$(t){const e=t.getBoundingClientRect(),n=An(t);if(aw)return e;const r=n.getComputedStyle(t,"::before"),i=n.getComputedStyle(t,"::after");if(!(r.content!=="none"||i.content!=="none"))return e;const a=parseFloat(r.width)||0,u=parseFloat(r.height)||0,f=parseFloat(i.width)||0,d=parseFloat(i.height)||0,g=Math.max(e.width,a,f),p=Math.max(e.height,u,d),m=g-e.width,v=p-e.height;return{left:e.left-m/2,right:e.right+m/2,top:e.top-v/2,bottom:e.bottom+v/2}}const IP=E.createContext(void 0);function Iw(t=!1){const e=E.useContext(IP);if(e===void 0&&!t)throw new Error(Un(16));return e}function I$(t){const{focusableWhenDisabled:e,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:s}=t,a=r&&e!==!1,u=r&&e===!1;return{props:E.useMemo(()=>{const d={onKeyDown(g){n&&e&&g.key!=="Tab"&&g.preventDefault()}};return r||(d.tabIndex=i,!s&&n&&(d.tabIndex=e?i:-1)),(s&&(e||a)||!s&&n)&&(d["aria-disabled"]=n),s&&(!e||u)&&(d.disabled=n),d},[r,n,e,a,u,s,i])}}function q0(t,e,{detail:n=0}={}){t.dispatchEvent(new(An(t)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}function ul(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:s}=t,a=E.useRef(null),u=Iw(!0),f=s??u!==void 0,{props:d}=I$({focusableWhenDisabled:n,disabled:e,composite:f,tabIndex:r,isNativeButton:i}),g=E.useCallback(()=>{const v=a.current;G0(v)&&f&&e&&d.disabled===void 0&&v.disabled&&(v.disabled=!1)},[e,d.disabled,f]);Me(g,[g]);const p=E.useCallback((v={})=>{const{onClick:b,onMouseDown:S,onKeyUp:w,onKeyDown:C,onPointerDown:R,...T}=v;return ko({onClick(A){if(e){A.preventDefault();return}b?.(A)},onMouseDown(A){e||S?.(A)},onKeyDown(A){if(e||(Np(A),C?.(A),A.baseUIHandlerPrevented))return;const k=A.target===A.currentTarget,P=A.currentTarget,M=G0(P),D=!i&&D$(P),L=k&&(i?M:!D),H=A.key==="Enter",N=A.key===" ",_=P.getAttribute("role"),$=_?.startsWith("menuitem")||_==="option"||_==="gridcell";if(k&&f&&N){if(A.defaultPrevented&&$)return;A.preventDefault(),(!i||M)&&(A.preventBaseUIHandler(),q0(P,A));return}if(!L||i||!N&&!H){k&&D&&N&&A.preventDefault();return}A.defaultPrevented||(A.preventDefault(),H&&(A.preventBaseUIHandler(),q0(P,A)))},onKeyUp(A){if(!e){if(Np(A),w?.(A),A.target===A.currentTarget&&i&&f&&G0(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!i&&!f&&!A.defaultPrevented&&A.key===" "&&(A.preventBaseUIHandler(),q0(A.currentTarget,A))}},onPointerDown(A){if(e){A.preventDefault();return}R?.(A)}},i?{type:"button"}:{role:"button"},d,T)},[e,d,f,i]),m=Re(v=>{a.current=v,g()});return{getButtonProps:p,buttonRef:m}}function G0(t){return fn(t)&&t.tagName==="BUTTON"}function D$(t){return fn(t)&&t.tagName==="A"&&!!t.href}const P$=400,z$={...OP,...mu,popupSide:t=>t?{"data-popup-side":t}:null,value:()=>null},N$=E.forwardRef(function(e,n){const{render:r,className:i,id:s,disabled:a=!1,nativeButton:u=!0,style:f,...d}=e,{setTouched:g,setFocused:p,validationMode:m,state:v,disabled:b}=Ho(),{labelId:S}=vs(),{store:w,setOpen:C,selectionRef:R,validation:T,readOnly:A,required:k,alignItemWithTriggerActiveRef:P,disabled:M}=ll(),D=b||M||a,L=pe(w,dt.open),H=pe(w,dt.mounted),N=pe(w,dt.value),_=pe(w,dt.triggerProps),$=pe(w,dt.positionerElement),F=pe(w,dt.listElement),G=pe(w,dt.popupSide),j=pe(w,dt.id),q=pe(w,dt.labelId),V=pe(w,dt.hasSelectedValue),te=H&&$?G:null,J=s??j,z=S$(S,q);Om({id:J});const U=Fn($),W=E.useRef(null),{getButtonProps:X,buttonRef:ie}=ul({disabled:D,native:u}),ee=w.useStateSetter("triggerElement"),ue=ii(),Y=ii(),le=ii();E.useEffect(()=>{if(L)return le.start(P$,()=>{R.current.allowUnselectedMouseUp=!0,R.current.allowSelectedMouseUp=!0}),()=>{le.clear()};R.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},Y.clear()},[L,R,Y,le]);const xe=ko(_,{id:J,role:"combobox","aria-expanded":L,"aria-haspopup":"listbox","aria-controls":L?F?.id??kp($)?.id:void 0,"aria-labelledby":z,"aria-readonly":A||void 0,"aria-required":k||void 0,tabIndex:D?-1:0,onFocus(me){p(!0),L&&P.current&&C(!1,Xe(yr,me.nativeEvent)),ue.start(0,()=>{w.set("forceMount",!0)})},onBlur(me){Qe($,me.relatedTarget)||(g(!0),p(!1),m==="onBlur"&&T.commit(N))},onMouseDown(me){if(L)return;const Ce=Vt(me.currentTarget);function De(Pe){if(!W.current)return;const Ee=Pe.target;Qe(W.current,Ee)||Qe(U.current,Ee)||O$(Pe,W.current)||C(!1,Xe(l6,Pe))}Y.start(0,()=>{Ce.addEventListener("mouseup",De,{once:!0})})}},d,X),ve=T.getValidationProps(D,xe);ve.role="combobox";const de={...v,open:L,disabled:D,value:N,readOnly:A,popupSide:te,placeholder:!V};return kt("button",e,{ref:[n,W,ie,ee],state:de,stateAttributesMapping:z$,props:ve})}),L$={value:()=>null},B$=E.forwardRef(function(e,n){const{className:r,render:i,children:s,placeholder:a,style:u,...f}=e,{store:d,valueRef:g}=ll(),p=pe(d,dt.value),m=pe(d,dt.items),v=pe(d,dt.itemToStringLabel),b=pe(d,dt.hasSelectedValue),S=!b&&a!=null&&s==null,w=pe(d,dt.hasNullItemLabel,S),C={value:p,placeholder:!b};let R=null;return typeof s=="function"?R=s(p):s!=null?R=s:S&&!w?R=a:Array.isArray(p)?R=h$(p,m,v):R=RP(p,m,v),kt("span",e,{state:C,ref:[n,g],props:[{children:R},f],stateAttributesMapping:L$})}),_$=E.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,{store:u}=ll(),d={open:pe(u,dt.open)};return kt("span",e,{state:d,ref:n,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:km})}),H$=E.forwardRef(function(e,n){const{store:r}=ll(),i=pe(r,dt.mounted),s=pe(r,dt.forceMount);return i||s?O.jsx(xw,{ref:n,...e}):null});function Im(t){return rw(19)?t:t?"true":void 0}const DP=E.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function j$(){return E.useContext(DP)}function Dm(t){const{children:e,elementsRef:n,labelsRef:r,onMapChange:i}=t,s=Re(i),[,a]=E.useState(!1),u=Sr(F$).current,f=Sr(V$).current,d=E.useRef(0),g=E.useRef(!0),p=E.useRef([]),m=E.useRef(null),v=Re(()=>{g.current||(g.current=!0,a(k=>!k))}),b=Re((k,P)=>{f.set(k,P),v()}),S=Re(k=>{f.delete(k),v()}),w=Re(k=>{const P=new Map;return n.current.length=0,r&&(r.current.length=0),k.forEach(M=>{P.set(M.element,{...M.registration.metadata??{},index:M.index}),n.current[M.index]=M.element,r&&(r.current[M.index]=M.registration.label!==void 0?M.registration.label:M.registration.textRef?.current?.textContent??M.element.textContent)}),d.current=n.current.length,P});function C(k){if(m.current?.disconnect(),m.current=null,typeof MutationObserver!="function"||k.length<2)return;const P=new MutationObserver(D=>{if(!q$(D))return;let L=null;for(const H of k)if(H.isConnected){if(L&&PP(L,H)>0){P.disconnect(),v();return}L=H}});m.current=P;const M=new Set;for(let D=1;D<k.length;D+=1){const L=$$(k[D-1],k[D]);L&&M.add(L)}M.forEach(D=>P.observe(D,{childList:!0}))}const R=Re(()=>{const[k,P]=U$(f),M=w(k);C(P),p.current=k,g.current=!1,u.forEach(D=>D(M)),s(M)});Me(()=>(g.current||w(p.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,w]),Me(()=>{g.current&&R()}),Me(()=>()=>{m.current?.disconnect(),g.current=!0},[]);const T=Re(k=>(u.add(k),()=>{u.delete(k)})),A=E.useMemo(()=>({register:b,unregister:S,subscribeMapChange:T,nextIndexRef:d}),[b,S,T,d]);return O.jsx(DP.Provider,{value:A,children:e})}function V$(){return new Map}function F$(){return new Set}function U$(t){const e=new Set,n=[],r=[];t.forEach((s,a)=>{if(!a.isConnected)return;const u=s.index,f={index:u??-1,element:a,registration:s};u===null?r.push(f):u>=0&&(e.add(u),n.push(f))});let i=0;return r.sort((s,a)=>PP(s.element,a.element)),r.forEach(s=>{for(;e.has(i);)i+=1;s.index=i,n.push(s),i+=1}),e.size>0&&n.sort((s,a)=>s.index-a.index),[n,r.map(s=>s.element)]}function $$(t,e){let n=t.parentElement;for(;n&&!n.contains(e);)n=n.parentElement;return n}function q$(t){for(const e of t)for(let n=0;n<e.removedNodes.length;n+=1)if(e.removedNodes[n].isConnected)return!0;return!1}function PP(t,e){return t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const G$=E.createContext(void 0);function Ud(){return E.useContext(G$)?.direction??"ltr"}const W$=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:a,elements:u,middlewareData:f}=e,{element:d,padding:g=0,offsetParent:p="real"}=sa(t,e)||{};if(d==null)return{};const m=AD(g),v={x:n,y:r},b=mw(i),S=pw(b),w=await a.getDimensions(d),C=b==="y",R=C?"top":"left",T=C?"bottom":"right",A=C?"clientHeight":"clientWidth",k=s.reference[S]+s.reference[b]-v[b]-s.floating[S],P=v[b]-s.reference[b],M=p==="real"?await a.getOffsetParent?.(d):u.floating;let D=u.floating[A]||s.floating[S];(!D||!await a.isElement?.(M))&&(D=u.floating[A]||s.floating[S]);const L=k/2-P/2,H=D/2-w[S]/2-1,N=Math.min(m[R],H),_=Math.min(m[T],H),$=N,F=D-w[S]-_,G=D/2-w[S]/2+L,j=TD($,G,F),q=!f.arrow&&ha(i)!=null&&G!==j&&s.reference[S]/2-(G<$?N:_)-w[S]/2<0,V=q?G<$?G-$:G-F:0;return{[b]:v[b]+V,data:{[b]:j,centerOffset:G-j-V,...q&&{alignmentOffset:V}},reset:q}}}),K$=(t,e)=>({...W$(t),options:[t,e]}),Y$={name:"hide",async fn(t){const{width:e,height:n,x:r,y:i}=t.rects.reference,s=e===0&&n===0&&r===0&&i===0,a=await t.platform.detectOverflow(t,{elementContext:"reference"});return{data:{referenceHidden:a.top-n>=0||a.right-e>=0||a.bottom-n>=0||a.left-e>=0||s}}}},X$={sideX:"left",sideY:"top"},AM="--available-width",MM="--available-height";function zP(t,e,n){const r=t==="inline-start"||t==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[e]}function OM(t,e,n){const{rects:r,placement:i}=t;return{side:zP(e,so(i),n),align:ha(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Dw(t){return Q$(t,QU)}function Q$(t,e){const{anchor:n,positionMethod:r="absolute",side:i="bottom",sideOffset:s=0,align:a="center",alignOffset:u=0,collisionBoundary:f,collisionPadding:d=5,sticky:g=!1,arrowPadding:p=5,disableAnchorTracking:m=!1,inline:v,keepMounted:b=!1,floatingRootContext:S,mounted:w,collisionAvoidance:C,shift:R,nodeId:T,adaptiveOrigin:A,lazyFlip:k=!1,externalTree:P}=t,[M,D]=E.useState(null);!w&&M!==null&&D(null);const L=C.side||"flip",H=C.align||"flip",N=C.fallbackAxisSide||"end",_=R?.crossAxis??!1,$=R?.rootBoundary,F=typeof n=="function"?n:void 0,G=Re(F),j=F?G:n,q=Fn(n),V=Fn(w),J=Ud()==="rtl",z=M||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":J?"left":"right","inline-start":J?"right":"left"}[i],U=a==="center"?z:`${z}-${a}`;let W=d;typeof W=="number"?W={top:W,right:W,bottom:W,left:W}:W&&(W={top:W.top||0,right:W.right||0,bottom:W.bottom||0,left:W.left||0});const X=1,ie=i==="bottom"?X:0,ee=i==="top"?X:0,ue=i==="right"?X:0,Y=i==="left"?X:0,le={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:W},xe=E.useRef(null),ve=Fn(s),de=Fn(u),me=typeof s!="function"?s:0,Ce=typeof u!="function"?u:0,De=[];v&&De.push(v),De.push(LU(lt=>{const yt=OM(lt,i,J),rt=typeof ve.current=="function"?ve.current(yt):ve.current,Zt=typeof de.current=="function"?de.current(yt):de.current;return{mainAxis:rt,crossAxis:Zt,alignmentAxis:Zt}},[me,Ce,J,i]));const Pe=H==="none"&&L!=="shift",Ee=!Pe&&(g||_||L==="shift"),je=L==="none"?null:HU({...le,padding:{top:W.top+X+ie,right:W.right+X+Y,bottom:W.bottom+X+ee,left:W.left+X+ue},mainAxis:!_&&L==="flip",crossAxis:H==="flip"?"alignment":!1,fallbackAxisSideDirection:N}),ke=Pe?null:BU({...le,rootBoundary:$,mainAxis:H!=="none",crossAxis:Ee,limiter:g||_?void 0:_U(lt=>{if(!xe.current)return{};const{width:yt,height:rt}=xe.current.getBoundingClientRect(),Zt=eo(so(lt.placement)),Hn=Zt==="y"?yt:rt,jn=Zt==="y"?W.left+W.right:W.top+W.bottom;return{offset:Hn/2+jn/2}})},[le,g,_,$,W,H]);L==="shift"||H==="shift"||a==="center"?De.push(ke,je):De.push(je,ke),De.push(jU({...le,apply({elements:{floating:lt},availableWidth:yt,availableHeight:rt,rects:Zt}){if(!V.current)return;const Hn=lt.style;Hn.setProperty(AM,`${yt}px`),Hn.setProperty(MM,`${rt}px`);const jn=An(lt).devicePixelRatio||1,{x:Jt,y:Rn,width:Dt,height:Br}=Zt.reference,or=(Math.round((Jt+Dt)*jn)-Math.round(Jt*jn))/jn,ot=(Math.round((Rn+Br)*jn)-Math.round(Rn*jn))/jn;Hn.setProperty("--anchor-width",`${or}px`),Hn.setProperty("--anchor-height",`${ot}px`)}}),K$(lt=>({element:xe.current||Vt(lt.elements.floating).createElement("div"),padding:p,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(lt){const{elements:yt,middlewareData:rt,placement:Zt,rects:Hn,y:jn}=lt,Jt=so(Zt),Rn=eo(Jt),Dt=xe.current,Br=rt.arrow?.x||0,or=rt.arrow?.y||0,ot=Dt?.clientWidth||0,Ut=Dt?.clientHeight||0,$n=Br+ot/2,Ln=or+Ut/2,wr=Math.abs(rt.shift?.y||0),rn=Hn.reference.height/2,Pt=typeof s=="function"?s(OM(lt,i,J)):s,zt=wr>Pt,et={top:`${$n}px calc(100% + ${Pt}px)`,bottom:`${$n}px ${-Pt}px`,left:`calc(100% + ${Pt}px) ${Ln}px`,right:`${-Pt}px ${Ln}px`}[Jt],Cr=`${$n}px ${Hn.reference.y+rn-jn}px`;return yt.floating.style.setProperty("--transform-origin",Ee&&Rn==="y"&&zt?Cr:et),{}}},Y$,A),Me(()=>{!w&&S&&S.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[w,S]);const _e=E.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:Ge,elements:We,x:fe,y:ne,middlewareData:Q,update:Se,placement:ge,context:Ie,isPositioned:Je,floatingStyles:nt}=e({rootContext:S,open:b?w:void 0,placement:U,middleware:De,strategy:r,whileElementsMounted:b?void 0:(...lt)=>SM(...lt,_e),nodeId:T,externalTree:P}),{sideX:Le,sideY:it}=Q.adaptiveOrigin||X$,ht=Je?r:"fixed",wt=E.useMemo(()=>{let lt;return Je?A?lt={position:ht,[Le]:fe,[it]:ne}:lt={...nt,position:ht}:lt={position:ht,top:0,left:0},lt[AM]="100vw",lt[MM]="100vh",Je||(lt.opacity=0),lt},[A,ht,Le,fe,it,ne,nt,Je]),bn=E.useRef(null);Me(()=>{if(!w)return;const lt=q.current,yt=typeof lt=="function"?lt():lt,Zt=(kM(yt)?yt.current:yt)||null||null;Zt!==bn.current&&(Ge.setPositionReference(Zt),bn.current=Zt)},[w,Ge,j,q]),E.useEffect(()=>{if(!w)return;const lt=q.current;typeof lt!="function"&&kM(lt)&<.current!==bn.current&&(Ge.setPositionReference(lt.current),bn.current=lt.current)},[w,Ge,j,q]),E.useEffect(()=>{if(b&&w&&We.reference&&We.floating)return SM(We.reference,We.floating,Se,_e)},[b,w,We,Se,_e]);const ut=so(ge),Mn=zP(i,ut,J),Qt=ha(ge)||"center",xn=!!Q.hide?.referenceHidden;Me(()=>{k&&w&&Je&&ut!==z&&D(ut)},[k,w,Je,ut,z]);const nn=E.useMemo(()=>({position:"absolute",top:Q.arrow?.y,left:Q.arrow?.x}),[Q.arrow]),Wt=Q.arrow?.centerOffset!==0;return E.useMemo(()=>({positionerStyles:wt,arrowStyles:nn,arrowRef:xe,arrowUncentered:Wt,side:Mn,align:Qt,physicalSide:ut,anchorHidden:xn,refs:Ge,context:Ie,isPositioned:Je,update:Se}),[wt,nn,xe,Wt,Mn,Qt,ut,xn,Ge,Ie,Je,Se])}function kM(t){return t!=null&&"current"in t}const NP=E.createContext(void 0);function LP(){const t=E.useContext(NP);if(!t)throw new Error(Un(59));return t}const Pw=E.forwardRef(function(e,n){const{cutout:r,...i}=e;let s;if(r){const a=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${a.left}px ${a.top}px,${a.left}px ${a.bottom}px,${a.right}px ${a.bottom}px,${a.right}px ${a.top}px,${a.left}px ${a.top}px)`}return O.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});function Hp(t,e){t&&Object.assign(t.style,e)}const BP={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};function Pm(t){return t==="starting"?$6:zn}function zw(t,e,{styles:n,transitionStatus:r,props:i,refs:s,hidden:a,inert:u=!1}){const f={...n};return u&&(f.pointerEvents="none"),kt("div",t,{state:e,ref:s,props:[{role:"presentation",hidden:a,style:f},Pm(r),i],stateAttributesMapping:Fd})}let IM={},DM={},PM="";function zm(t,e){return Bd(t)?t:e}function zM(t,e,n){return/hidden|clip/.test(t.getComputedStyle(zm(e,n)).overflowY)}function Z$(t){if(typeof document>"u")return!1;const e=Vt(t);return An(e).innerWidth-e.documentElement.clientWidth>0}function J$(t){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Vt(t),r=n.documentElement,i=n.body,s=zm(r,i),a=s.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const f=s.offsetWidth;s.style.overflowY="hidden";const d=s.offsetWidth;return s.style.overflowY=a,r.style.scrollbarGutter=u,f===d}function eq(t){const e=Vt(t),n=e.documentElement,r=e.body,i=zm(n,r),s={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,s)}}function tq(t){const e=Vt(t),n=e.documentElement,r=e.body,i=An(n);let s=0,a=0,u=!1;const f=is.create();if(sl&&(i.visualViewport?.scale??1)!==1)return()=>{};function d(){const v=i.getComputedStyle(n),b=i.getComputedStyle(r),C=(v.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,a=n.scrollLeft,IM={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},PM=n.style.scrollBehavior,DM={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const R=n.scrollHeight>n.clientHeight,T=n.scrollWidth>n.clientWidth,A=v.overflowY==="scroll"||b.overflowY==="scroll",k=v.overflowX==="scroll"||b.overflowX==="scroll",P=Math.max(0,i.innerWidth-r.clientWidth),M=Math.max(0,i.innerHeight-r.clientHeight),D=parseFloat(b.marginTop)+parseFloat(b.marginBottom),L=parseFloat(b.marginLeft)+parseFloat(b.marginRight),H=zm(n,r);if(u=J$(t),u){n.style.scrollbarGutter=C,H.style.overflowY="hidden",H.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:C,overflowY:"hidden",overflowX:"hidden"}),(R||A)&&(n.style.overflowY="scroll"),(T||k)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:D||M?`calc(100dvh - ${D+M}px)`:"100dvh",width:L||P?`calc(100vw - ${L+P}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function g(){Object.assign(n.style,IM),Object.assign(r.style,DM),u||(n.scrollTop=s,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=PM)}function p(){g(),f.request(d)}d();const m=At(i,"resize",p);return()=>{f.cancel(),g(),typeof i.removeEventListener=="function"&&m()}}class nq{lockCount=0;restore=null;timeoutLock=zo.create();timeoutUnlock=zo.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),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(e){if(this.lockCount===0||this.restore!==null)return;const n=Vt(e),r=n.documentElement,i=n.body,s=An(r);if(zM(s,r,i)){const u=new s.MutationObserver(()=>{zM(s,r,i)||(u.disconnect(),this.restore=null,this.lock(e))}),f={attributes:!0};u.observe(r,f),u.observe(i,f),this.restore=()=>u.disconnect();return}const a=_d||!Z$(e);this.restore=a?eq(e):tq(e)}}const rq=new nq;function _P(t=!0,e=null){Me(()=>{if(t)return rq.acquire(e)},[t,e])}const iq=20;function HP(t,e,n,r){const[i,s]=E.useState(!1);Me(()=>{if(!t||!e||n==null){s(!1);return}const a=Vt(n).documentElement.clientWidth,u=n.offsetWidth;s(a>0&&u>0&&u>=a-iq)},[t,e,n]),_P(t&&(!e||i),r)}const oq={position:"fixed"},sq=E.forwardRef(function(e,n){const{anchor:r,className:i,render:s,positionMethod:a,side:u,align:f,sideOffset:d,alignOffset:g,collisionBoundary:p="clipping-ancestors",collisionPadding:m,arrowPadding:v,sticky:b,disableAnchorTracking:S,alignItemWithTrigger:w=!0,collisionAvoidance:C=qD,style:R,...T}=e,{store:A,listRef:k,labelsRef:P,alignItemWithTriggerActiveRef:M,selectedItemTextRef:D,valuesRef:L,initialValueRef:H,popupRef:N,setValue:_,floatingContext:$}=ll(),F=pe(A,dt.open),G=pe(A,dt.mounted),j=pe(A,dt.modal),q=pe(A,dt.value),V=pe(A,dt.openMethod),te=pe(A,dt.positionerElement),J=pe(A,dt.triggerElement),z=pe(A,dt.isItemEqualToValue),U=pe(A,dt.transitionStatus),W=E.useRef(null),X=E.useRef(null),[ie,ee]=E.useState(w),ue=G&&ie&&V!=="touch";!G&&ie!==w&&ee(w),E.useImperativeHandle(M,()=>ue),HP((ue||j)&&F,V==="touch",te,J);const Y=Dw({anchor:r,floatingRootContext:$,positionMethod:a,mounted:G,side:u,sideOffset:d,align:f,alignOffset:g,arrowPadding:v,collisionBoundary:p,collisionPadding:m,sticky:b,disableAnchorTracking:S??ue,collisionAvoidance:C,keepMounted:!0}),le=ue?"none":Y.side,xe=ue?oq:Y.positionerStyles,ve={open:F,side:le,align:Y.align,anchorHidden:Y.anchorHidden};Me(()=>{A.set("popupSide",Y.side)},[A,Y.side]);const de=A.useStateSetter("positionerElement"),me=zw(e,ve,{styles:xe,transitionStatus:U,props:T,refs:[n,de],hidden:!G,inert:!F}),Ce=E.useRef(0),De=Re(Ee=>{if(L.current.length===0)return;const je=Ce.current;if(Ce.current=Ee.size,Ee.size===je)return;const ke=Xe(yr);if(je!==0&&!A.state.multiple&&q!==null&&ac(L.current,q,z)===-1){const Ge=H.current,fe=Ge!=null&&ac(L.current,Ge,z)!==-1?Ge:null;_(fe,ke),fe===null&&(A.set("selectedIndex",null),D.current=null)}if(je!==0&&A.state.multiple&&Array.isArray(q)){const _e=q.filter(Ge=>ac(L.current,Ge,z)!==-1);_e.length!==q.length&&(_(_e,ke),_e.length===0&&(A.set("selectedIndex",null),D.current=null))}if(F&&ue){A.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const _e={height:""};Hp(te,_e),Hp(N.current,_e)}}),Pe=E.useMemo(()=>({...Y,side:le,alignItemWithTriggerActive:ue,setControlledAlignItemWithTrigger:ee,scrollUpArrowRef:W,scrollDownArrowRef:X}),[Y,le,ue,ee]);return O.jsx(Dm,{elementsRef:k,labelsRef:P,onMapChange:De,children:O.jsxs(NP.Provider,{value:Pe,children:[G&&j&&O.jsx(Pw,{inert:Im(!F),cutout:J}),me]})})}),Og="base-ui-disable-scrollbar",Sx={className:Og,getElement(t){return O.jsx("style",{nonce:t,href:Og,precedence:"base-ui:low",children:`.${Og}{scrollbar-width:none}.${Og}::-webkit-scrollbar{display:none}`})}},jP=E.createContext(void 0);function Nw(t){const e=E.useContext(jP);if(e===void 0&&!t)throw new Error(Un(69));return e}const wx="ArrowUp",Cx="ArrowDown",Rx="ArrowLeft",Ex="ArrowRight",Tx="Home",Ax="End",Lw=new Set([wx,Cx,Rx,Ex,Tx,Ax]),lq="Shift",aq=[lq,"Control","Alt","Meta"];function uq(t){return fn(t)&&t.tagName==="INPUT"}function NM(t){return!!(uq(t)&&t.selectionStart!=null||fn(t)&&t.tagName==="TEXTAREA")}function LM(t,e,n,r){if(!t||!e||!e.scrollTo)return;let i=t.scrollLeft,s=t.scrollTop;const a=t.clientWidth<t.scrollWidth,u=t.clientHeight<t.scrollHeight;if(a&&r!=="vertical"){const f=BM(t,e,"left"),d=kg(t),g=kg(e);n==="ltr"&&(f+e.offsetWidth+g.scrollMarginRight>t.scrollLeft+t.clientWidth-d.scrollPaddingRight?i=f+e.offsetWidth+g.scrollMarginRight-t.clientWidth+d.scrollPaddingRight:f-g.scrollMarginLeft<t.scrollLeft+d.scrollPaddingLeft&&(i=f-g.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(f-g.scrollMarginLeft<t.scrollLeft+d.scrollPaddingLeft?i=f-g.scrollMarginLeft-d.scrollPaddingLeft:f+e.offsetWidth+g.scrollMarginRight>t.scrollLeft+t.clientWidth-d.scrollPaddingRight&&(i=f+e.offsetWidth+g.scrollMarginRight-t.clientWidth+d.scrollPaddingRight))}if(u&&r!=="horizontal"){const f=BM(t,e,"top"),d=kg(t),g=kg(e);f-g.scrollMarginTop<t.scrollTop+d.scrollPaddingTop?s=f-g.scrollMarginTop-d.scrollPaddingTop:f+e.offsetHeight+g.scrollMarginBottom>t.scrollTop+t.clientHeight-d.scrollPaddingBottom&&(s=f+e.offsetHeight+g.scrollMarginBottom-t.clientHeight+d.scrollPaddingBottom)}t.scrollTo({left:i,top:s,behavior:"auto"})}function BM(t,e,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;e.offsetParent&&(i+=e[r],e.offsetParent!==t);)e=e.offsetParent;return i}function kg(t){const e=getComputedStyle(t);return{scrollMarginTop:parseFloat(e.scrollMarginTop)||0,scrollMarginRight:parseFloat(e.scrollMarginRight)||0,scrollMarginBottom:parseFloat(e.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(e.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(e.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(e.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(e.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(e.scrollPaddingLeft)||0}}const cq=E.createContext(void 0),fq={disableStyleElements:!1};function dq(){return E.useContext(cq)??fq}const hq={...Fd,...al},gq=E.forwardRef(function(e,n){const{render:r,className:i,style:s,finalFocus:a,...u}=e,{store:f,popupRef:d,onOpenChangeComplete:g,setOpen:p,valueRef:m,firstItemTextRef:v,selectedItemTextRef:b,multiple:S,handleScrollArrowVisibility:w,scrollHandlerRef:C,listRef:R,highlightItemOnHover:T,floatingContext:A}=ll(),{side:k,align:P,alignItemWithTriggerActive:M,isPositioned:D,setControlledAlignItemWithTrigger:L}=LP(),H=Nw(!0)!=null,N=Ud(),{nonce:_,disableStyleElements:$}=dq(),F=pe(f,dt.id),G=pe(f,dt.open),j=pe(f,dt.openMethod),q=pe(f,dt.mounted),V=pe(f,dt.popupProps),te=pe(f,dt.transitionStatus),J=pe(f,dt.triggerElement),z=pe(f,dt.positionerElement),U=pe(f,dt.listElement),W=E.useRef(!1),X=E.useRef(!1),ie=E.useRef({}),ee=xc(),ue=Re(ve=>{if(!z||!d.current||!X.current)return;const de=z.style.top==="0px",me=z.style.bottom==="0px";if(W.current||!M||!de&&!me){w(ve);return}const Ce=HM(z),De=Ff(z.getBoundingClientRect().height,"y",Ce),Pe=Vt(z),Ee=An(z),je=Ee.getComputedStyle(z),ke=parseFloat(je.marginTop),_e=parseFloat(je.marginBottom),Ge=_M(Ee.getComputedStyle(d.current)),We=Math.min(Pe.documentElement.clientHeight-ke-_e,Ge),fe=ve.scrollTop,ne=Ig(ve);let Q=null;const Se=nt=>{z.style.height=`${nt}px`},ge=de?ne-fe:fe,Ie=Math.min(De+ge,We);if(ge<=qs){const nt=Vf(ge,0,We-De);nt>0&&Se(De+nt),ve.scrollTop=de?ne:0,We-(De+nt)<=qs&&(W.current=!0),w(ve);return}if(We-Ie>qs)Q=de?1/0:0;else if(me&&fe<ne){const nt=De+ge-We;Q=fe-(ge-nt)}const Je=Math.ceil(Ie);if(Je!==0&&Se(Je),Q!=null){const nt=Vf(Q,0,Ig(ve));Math.abs(ve.scrollTop-nt)>qs&&(ve.scrollTop=nt)}Je>=We-qs&&(W.current=!0),w(ve)});E.useImperativeHandle(C,()=>ue,[ue]),fo({open:G,ref:d,onComplete(){G&&g?.(!0)}});const Y={open:G,transitionStatus:te,side:k,align:P};Me(()=>{!z||!d.current||Object.keys(ie.current).length||(ie.current={top:z.style.top||"0",left:z.style.left||"0",right:z.style.right,height:z.style.height,bottom:z.style.bottom,minHeight:z.style.minHeight,maxHeight:z.style.maxHeight,marginTop:z.style.marginTop,marginBottom:z.style.marginBottom})},[d,z]),Me(()=>{G||M||(X.current=!1,W.current=!1,Hp(z,ie.current))},[G,M,z,d]),Me(()=>{const ve=d.current;if(!G||!J||!z||!ve||M&&!D||f.state.transitionStatus==="ending")return;if(X.current=!0,ve.style.removeProperty("--transform-origin"),!M){ee.request(()=>w(U||ve));return}const de=pq(ve);try{let me=b.current;me?.isConnected||(me=!dt.hasSelectedValue(f.state)&&v.current?.isConnected?v.current:null);const Ce=m.current,De=An(z),Pe=De.getComputedStyle(z),Ee=De.getComputedStyle(ve),je=Vt(J),ke=HM(J),_e=Dg(J.getBoundingClientRect(),ke),Ge=Dg(z.getBoundingClientRect(),ke),We=_e.height,fe=U||ve,ne=fe.scrollHeight,Q=parseFloat(Ee.borderBottomWidth),Se=parseFloat(Pe.marginTop)||10,ge=parseFloat(Pe.marginBottom)||10,Ie=parseFloat(Pe.minHeight)||100,Je=_M(Ee),nt=5,Le=5,it=20,ht=je.documentElement.clientHeight-Se-ge,wt=je.documentElement.clientWidth,bn=ht-_e.bottom+We;let ut,Mn=N==="rtl"?_e.right-Ge.width:_e.left,Qt=0;if(me&&Ce){const Rn=Dg(Ce.getBoundingClientRect(),ke);ut=Dg(me.getBoundingClientRect(),ke),Mn=Ge.left+(N==="rtl"?Rn.right-ut.right:Rn.left-ut.left);const Dt=Rn.top-_e.top+Rn.height/2;Qt=ut.top-Ge.top+ut.height/2-Dt}const xn=bn+Qt+ge+Q;let nn=Math.min(ht,xn);const Wt=ht-Se-ge,lt=xn-nn,yt=wt-Le;z.style.left=`${Vf(Mn,nt,yt-Ge.width)}px`,z.style.height=`${nn}px`,z.style.maxHeight="none",z.style.marginTop=`${Se}px`,z.style.marginBottom=`${ge}px`,ve.style.height="100%";const rt=Ig(fe),Zt=lt>=rt-qs;Zt&&(nn=Math.min(ht,Ge.height)-(lt-rt));const Hn=_e.top<it||_e.bottom>ht-it||Math.ceil(nn)+qs<Math.min(ne,Ie),jn=(De.visualViewport?.scale??1)!==1&&sl;if(Hn||jn){Hp(z,ie.current),L(!1);return}const Jt=Math.max(Ie,nn);if(Zt){const Rn=Math.max(0,ht-xn);z.style.top=Ge.height>=Wt?"0":`${Rn}px`,z.style.height=`${nn}px`,fe.scrollTop=Ig(fe)}else z.style.bottom="0",fe.scrollTop=lt;if(ut){const Rn=Ge.top,Dt=Ge.height,Br=ut.top+ut.height/2,or=Vf(Dt>0?(Br-Rn)/Dt*100:50,0,100);ve.style.setProperty("--transform-origin",`50% ${or}%`)}(Jt===ht||nn>=Je)&&(W.current=!0),w(fe),T&&f.state.selectedIndex===null&&f.state.activeIndex===null&&R.current[0]!=null&&f.set("activeIndex",0)}finally{de()}},[f,G,z,J,m,v,b,d,w,M,L,ee,U,R,T,N,D]),E.useEffect(()=>{if(!M||!z||!G)return;const ve=An(z);function de(me){p(!1,Xe(a6,me))}return At(ve,"resize",de)},[p,M,z,G]);const le={...U?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":S||void 0,id:`${F}-list`},onKeyDown(ve){H&&Lw.has(ve.key)&&ve.stopPropagation()},onScroll(ve){U||ue(ve.currentTarget)},...M&&{style:U?{height:"100%"}:BP},className:!U&&M?Sx.className:void 0},xe=kt("div",e,{ref:[n,d],state:Y,stateAttributesMapping:hq,props:[V,le,Pm(te),u]});return O.jsxs(E.Fragment,{children:[!$&&Sx.getElement(_),O.jsx(ww,{context:A,modal:!1,disabled:!q,openInteractionType:j,returnFocus:a,restoreFocus:!0,children:xe})]})});function _M(t){const e=t.maxHeight;return e.endsWith("px")&&parseFloat(e)||1/0}function Ig(t){return MP(t.scrollHeight,t.clientHeight)}function HM(t){return eP.getScale(t)}function Ff(t,e,n){return t/n[e]}function Dg(t,e){return md({x:Ff(t.x,"x",e),y:Ff(t.y,"y",e),width:Ff(t.width,"x",e),height:Ff(t.height,"y",e)})}const jM=[["transform","none"],["scale","1"],["translate","0 0"]];function pq(t){const{style:e}=t,n={};for(const[r,i]of jM)n[r]=e.getPropertyValue(r),e.setProperty(r,i,"important");return()=>{for(const[r]of jM){const i=n[r];i?e.setProperty(r,i):e.removeProperty(r)}}}const mq=E.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,{store:u,scrollHandlerRef:f,multiple:d}=ll(),{alignItemWithTriggerActive:g}=LP(),p=pe(u,dt.hasScrollArrows),m=pe(u,dt.openMethod),b={id:`${pe(u,dt.id)}-list`,role:"listbox","aria-multiselectable":d||void 0,onScroll(w){f.current?.(w.currentTarget)},...g&&{style:BP},className:p&&m!=="touch"?Sx.className:void 0},S=u.useStateSetter("listElement");return kt("div",e,{ref:[n,S],props:[b,a]})});function Nm(t={}){const{guess:e,label:n,metadata:r,textRef:i,index:s}=t,{register:a,unregister:u,subscribeMapChange:f,nextIndexRef:d}=j$(),g=E.useRef(-1),[p,m]=E.useState(s==null&&e?()=>{if(g.current===-1){const w=d.current;d.current+=1,g.current=w}return g.current}:-1),v=s??p,b=E.useRef(null),S=E.useCallback(w=>{const C=b.current;C&&u(C),b.current=w,w&&a(w,{metadata:r??null,index:s??null,label:n,textRef:i})},[s,a,u,r,n,i]);return Me(()=>{if(s==null)return f(w=>{const C=b.current?w.get(b.current)?.index:null;C!=null&&m(C)})},[s,f]),{ref:S,index:v}}const VP=E.createContext(void 0);function Bw(){const t=E.useContext(VP);if(!t)throw new Error(Un(57));return t}const yq=E.memo(E.forwardRef(function(e,n){const{render:r,className:i,style:s,value:a=null,label:u,disabled:f=!1,nativeButton:d=!1,...g}=e,p=E.useRef(null),m=Nm({guess:!0,label:u,textRef:p}),{store:v,itemProps:b,setOpen:S,setValue:w,selectionRef:C,typingRef:R,valuesRef:T,multiple:A,selectedItemTextRef:k,disabled:P,readOnly:M}=ll(),D=P||f,L=pe(v,dt.isActive,m.index),H=pe(v,dt.open),N=pe(v,dt.isSelected,a),_=pe(v,dt.isSelectedByFocus,m.index),$=pe(v,dt.isItemEqualToValue),F=m.index,G=E.useRef(null);Me(()=>{const ee=T.current;return ee[F]=a,()=>{delete ee[F]}},[F,a,T]),Me(()=>{const ee=v.state.value;let ue=ee;A&&Array.isArray(ee)&&(ue=ee.length>0?ee[ee.length-1]:void 0),ue!==void 0&&uo(a,ue,$)&&(v.set("selectedIndex",F),p.current&&(k.current=p.current))},[F,A,$,v,a,k]);const j=E.useRef("mouse"),q=E.useRef(!1),{getButtonProps:V,buttonRef:te}=ul({disabled:D,focusableWhenDisabled:!0,native:d,composite:!0}),J={disabled:D,selected:N,highlighted:L};function z(ee){if(P||M)return;const ue=v.state.value;if(A){const Y=Array.isArray(ue)?ue:[],le=N?CP(Y,a,$):[...Y,a];w(le,Xe(cp,ee))}else w(a,Xe(cp,ee)),S(!1,Xe(cp,ee))}function U(){C.current.dragY=0}const W={role:"option","aria-selected":N,tabIndex:H&&L?0:-1,onKeyDown(ee){v.set("activeIndex",F),ee.key===" "&&R.current&&ee.preventDefault()},onClick(ee){const ue=j.current!=="touch",Y=ee.nativeEvent.pointerType,le=ue&&uw(ee.nativeEvent)&&(Y!==void 0||L),xe=ue&&!le&&!q.current;q.current=!1,!(D||xe)&&z(ee.nativeEvent)},onPointerEnter(ee){j.current=ee.pointerType},onPointerMove(ee){if(ee.pointerType==="mouse"&&ee.buttons===1){const ue=C.current;ue.dragY+=ee.movementY,ue.dragY**2>=64&&(ue.allowUnselectedMouseUp=!0)}},onPointerDown(ee){j.current=ee.pointerType,q.current=!0,U()},onMouseUp(){if(U(),D||j.current==="touch"||q.current)return;const ee=!C.current.allowSelectedMouseUp&&N,ue=!C.current.allowUnselectedMouseUp&&!N;ee||ue||(q.current=!0,G.current?.click(),q.current=!1)}},X=kt("div",e,{ref:[te,n,m.ref,G],state:J,props:[b,W,g,V]}),ie=E.useMemo(()=>({selected:N,index:F,textRef:p,selectedByFocus:_}),[N,F,p,_]);return O.jsx(VP.Provider,{value:ie,children:X})})),vq=E.forwardRef(function(e,n){const{selected:r}=Bw();return e.keepMounted||r?O.jsx(bq,{...e,ref:n}):null}),bq=E.memo(E.forwardRef((t,e)=>{const{render:n,className:r,style:i,keepMounted:s,...a}=t,{selected:u}=Bw(),f=E.useRef(null),{transitionStatus:d,setMounted:g}=ga(u),m=kt("span",t,{ref:[e,f],state:{selected:u,transitionStatus:d},props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:al});return fo({open:u,ref:f,onComplete(){u||g(!1)}}),m})),xq=E.memo(E.forwardRef(function(e,n){const{index:r,textRef:i,selectedByFocus:s}=Bw(),{firstItemTextRef:a,selectedItemTextRef:u}=ll(),{render:f,className:d,style:g,...p}=e,m=E.useCallback(b=>{b&&(r===0&&(a.current=b),s&&(u.current=b))},[a,u,r,s]);return kt("div",e,{ref:[m,n,i],props:p})}));function Sq(t,e,n,r,i,s,a,u,f,d=2){const g=S6(n.current,{event:t,orientation:r,loopFocus:i,rtl:s,cols:d,disabledIndices:a,minIndex:u,maxIndex:f,prevIndex:e>f?u:e,stopEvent:!0});return ra(n.current,g)?void 0:g}const FP=E.createContext(void 0),UP=E.createContext(void 0),$P=E.createContext(void 0),qP=E.createContext(!1),GP=E.createContext("");function go(){const t=E.useContext(FP);if(!t)throw new Error(Un(22));return t}function _w(){const t=E.useContext(UP);if(!t)throw new Error(Un(23));return t}function $d(){const t=E.useContext($P);if(!t)throw new Error(Un(24));return t}function WP(){return E.useContext(GP)}function wq(){return E.useContext(qP)}const He={id:t=>t.id,selectedValue:t=>t.selectedValue,hasSelectionChips:t=>{const e=t.selectedValue;return Array.isArray(e)&&e.length>0},hasSelectedValue:t=>{const{selectedValue:e,selectionMode:n}=t;return e==null?!1:n==="multiple"&&Array.isArray(e)?e.length>0:!0},open:t=>t.open,mounted:t=>t.mounted,forceMounted:t=>t.forceMounted,inline:t=>t.inline,activeIndex:t=>t.activeIndex,selectedIndex:t=>t.selectedIndex,isActive:(t,e)=>t.activeIndex===e,isSelected:(t,e)=>{const n=t.isItemEqualToValue,r=t.selectedValue;return Array.isArray(r)?r.some(i=>uo(e,i,n)):uo(e,r,n)},transitionStatus:t=>t.transitionStatus,popupProps:t=>t.popupProps,listProps:t=>t.listProps,inputProps:t=>t.inputProps,triggerProps:t=>t.triggerProps,itemProps:t=>t.itemProps,positionerElement:t=>t.positionerElement,listElement:t=>t.listElement,triggerElement:t=>t.triggerElement,inputElement:t=>t.inputElement,inputGroupElement:t=>t.inputGroupElement,popupSide:t=>t.popupSide,openMethod:t=>t.openMethod,inputInsidePopup:t=>t.inputInsidePopup,inputOwnsFormValue:t=>t.inputOwnsFormValue,selectionMode:t=>t.selectionMode,name:t=>t.name,form:t=>t.form,disabled:t=>t.disabled,readOnly:t=>t.readOnly,required:t=>t.required,grid:t=>t.grid,virtualized:t=>t.virtualized,isItemEqualToValue:t=>t.isItemEqualToValue,modal:t=>t.modal,autoHighlight:t=>t.autoHighlight};function Cq(t){return t==null?void 0:`${t}-popup`}function Rq(t,e){return(n,r)=>n==null?!1:t.contains(n,r,e)}function KP(t){return Array.isArray(t)?t.map(e=>KP(e)).join(","):t==null?"":String(t)}const VM=new Map;function Eq(t={}){const e={usage:"search",sensitivity:"base",ignorePunctuation:!0,...t},n=`${KP(t.locale)}|${JSON.stringify(e)}`,r=VM.get(n);if(r)return r;const i=new Intl.Collator(t.locale,e),s={contains(a,u,f){if(!u)return!0;const d=Zi(a,f);for(let g=0;g<=d.length-u.length;g+=1)if(i.compare(d.slice(g,g+u.length),u)===0)return!0;return!1},startsWith(a,u,f){if(!u)return!0;const d=Zi(a,f);return i.compare(d.slice(0,u.length),u)===0},endsWith(a,u,f){if(!u)return!0;const d=Zi(a,f),g=u.length;return d.length>=g&&i.compare(d.slice(d.length-g),u)===0}};return VM.set(n,s),s}const Tq=Eq;function Aq(t,e=!1){const{overflowY:n}=bi(t);return n!=="auto"&&n!=="scroll"?!1:e?t.clientHeight>0:t.scrollHeight>t.clientHeight}const YP=Symbol("none"),W0={value:YP,index:-1};function Mq(t){const{id:e,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:s,defaultInputValue:a,inputValue:u,open:f,defaultOpen:d=!1,selectionMode:g,onItemHighlighted:p,name:m,form:v,disabled:b=!1,readOnly:S=!1,required:w=!1,inputRef:C,grid:R=!1,items:T,filteredItems:A,filter:k,openOnInputClick:P=!0,autoHighlight:M=!1,keepHighlight:D=!1,highlightItemOnHover:L=!0,loopFocus:H=!0,itemToStringLabel:N,itemToStringValue:_,isItemEqualToValue:$=wP,virtualized:F=!1,inline:G=!1,fillInputOnItemPress:j=!0,modal:q=!1,limit:V=-1,autoComplete:te="list",formAutoComplete:J,locale:z,submitOnItemClick:U=!1}=t,{clearErrors:W}=yu(),{setDirty:X,validityData:ie,setFilled:ee,name:ue,disabled:Y,setTouched:le,setFocused:xe,validationMode:ve,validation:de}=Ho(),me=Ud(),Ce=Om({id:e}),De=Tq({locale:z}),[Pe,Ee]=E.useState(!1),[je,ke]=E.useState(null),_e=E.useRef([]),Ge=E.useRef([]),We=E.useRef(null),fe=E.useRef(null),ne=E.useRef(null),Q=E.useRef(null),Se=E.useRef(null),ge=E.useRef(!0),Ie=E.useRef(!1),Je=E.useRef(null),nt=E.useRef(null),Le=E.useRef(null),it=E.useRef(W0),ht=E.useRef(null),wt=E.useRef([]),bn=E.useRef(null),ut=Y||b,Mn=ue??m,Qt=g==="multiple",xn=g==="single",nn=u!==void 0||a!==void 0,Wt=T!==void 0,lt=A!==void 0;let yt;M==="always"?yt="always":yt=M?"input-change":!1;const[rt,Zt]=Ja({controlled:i,default:Qt?r??Pi:r,name:"Combobox",state:"selectedValue"}),Hn=E.useMemo(()=>k===null?()=>!0:k!==void 0?k:Rq(De,N),[k,De,N]),jn=Sr(()=>nn?a??"":xn?Zi(rt,N):"").current,[Jt,Rn]=Ja({controlled:u,default:jn,name:"Combobox",state:"inputValue"}),[Dt,Br]=Ja({controlled:f,default:d,name:"Combobox",state:"open"}),or=kw(T),ot=je??String(Jt).trim(),Ut=xn?Zi(rt,N):"",$n=xn&&!Pe&&ot!==""&&Ut.length===ot.length&&De.contains(Ut,ot),Ln=$n?"":ot,wr=Wt&<&&$n,rn=E.useMemo(()=>T?or?T.flatMap(Oe=>Oe.items):T:Pi,[T,or]),Pt=E.useMemo(()=>{if(A&&!wr)return A;if(!T)return Pi;if(or){const ze=T,$t=[];let Bt=0;for(const en of ze){if(V>-1&&Bt>=V)break;const Jn=V>-1?V-Bt:1/0,dn=Ln===""?en.items.slice(0,Jn):[];if(Ln!=="")for(const Tr of en.items){if(dn.length>=Jn)break;Hn(Tr,Ln,N)&&dn.push(Tr)}if(dn.length>0){const Tr={...en,items:dn};$t.push(Tr),Bt+=dn.length}}return $t}if(Ln==="")return V>-1?rn.slice(0,V):rn;const Oe=[];for(const ze of rn){if(V>-1&&Oe.length>=V)break;Hn(ze,Ln,N)&&Oe.push(ze)}return Oe},[A,wr,T,or,Ln,V,Hn,N,rn]),zt=E.useMemo(()=>or?Pt.flatMap(ze=>ze.items):Pt,[Pt,or]),et=Sr(()=>{let Oe=null;return G&&Dt&&Wt&&g!=="none"&&(Oe=$0(zt,rt,$,Qt)),new pD({id:Ce,labelId:void 0,selectedValue:rt,open:Dt,items:T,selectionMode:g,listRef:_e,labelsRef:Ge,popupRef:We,emptyRef:Se,inputRef:fe,startDismissRef:ne,endDismissRef:Q,keyboardActiveRef:ge,chipsContainerRef:Je,clearRef:nt,valuesRef:wt,pointerDownItemRef:bn,selectionEventRef:Le,name:Mn,form:v,disabled:ut,readOnly:S,required:w,grid:R,virtualized:F,openOnInputClick:P,itemToStringLabel:N,isItemEqualToValue:$,modal:q,autoHighlight:yt,submitOnItemClick:U,hasInputValue:nn,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:G,activeIndex:null,selectedIndex:Oe,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:zn,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:g==="none",onOpenChangeComplete:Tn,setOpen:Tn,setInputValue:Tn,setSelectedValue:Tn,setIndices:Tn,handleSelection:Tn,forceMount:Tn,requestSubmit:Tn})}).current,Cr=g==="none"?Jt:rt,_c=E.useMemo(()=>g==="none"?Cr:Array.isArray(rt)?rt.map(Oe=>To(Oe,_)):To(rt,_),[Cr,_,g,rt]),xs=Re(p),fl=Re(n),Ve=pe(et,He.activeIndex),Sa=pe(et,He.selectedIndex),Zn=pe(et,He.positionerElement),Bi=pe(et,He.listElement),li=pe(et,He.triggerElement),ai=pe(et,He.inputElement),Vn=pe(et,He.inputGroupElement),sr=pe(et,He.inline),_r=pe(et,He.inputInsidePopup),_i=pe(et,He.inputOwnsFormValue),mo=Fn(li),{mounted:wa,setMounted:Ca,transitionStatus:Ss}=ga(Dt),{openMethod:Ra,triggerProps:yo}=AP(Dt),ws=Re(()=>_c);Ow(_r?mo:fe,Ce,Cr,ws,!ut,m);const Zr=Re(()=>{T?Ge.current=zt.map(Oe=>Zi(Oe,N)):et.set("forceMounted",!0)}),qn=Re((Oe,ze,$t)=>{if(ze===-1){if(it.current===W0)return;it.current=W0}else it.current={value:Oe,index:ze};xs(Oe,u6($t,void 0,{index:ze}))}),Hr=Re(Oe=>{et.update(Oe);const ze=Oe.activeIndex;if(ze===void 0)return;const $t=Oe.type||yr;ze===null?qn(void 0,-1,$t):qn(wt.current[ze],ze,$t)}),Jr=Re((Oe,ze)=>{if(Ie.current=ze.reason===ns,t.onInputValueChange?.(Oe,ze),!ze.isCanceled){if(ze.reason===Kf){Dt&&je!==null&&ke(null);const $t=ze.event,Bt=$t.inputType;if($t.type==="compositionend"||Bt!=null&&Bt!==""&&Bt!=="insertReplacementText"){const Jn=Oe.trim()!=="";Jn&&Ee(!0),ht.current={hasQuery:Jn};const dn=et.state.listElement;if(!et.state.virtualized&&dn){const Tr=We.current;for(const Vr of bc(dn.firstElementChild??dn)){if(!fn(Vr)||(Tr?!Qe(Tr,Vr):Vr.getAttribute("role")==="dialog"))break;if(Aq(Vr)){Vr.scrollTop=0;break}}}Jn&&yt&&et.state.activeIndex==null&&(Dt||sr)&&et.set("activeIndex",0)}}else ze.reason===ns&&Oe===""&&et.state.inputInsidePopup&&(ht.current={hasQuery:!1,selection:!0});Rn(Oe)}}),Hi=Re((Oe,ze)=>{if(Dt!==Oe&&(ze.reason===Vd&&Wt&&zt.length===0&&!Se.current&&ze.allowPropagation(),t.onOpenChange?.(Oe,ze),!ze.isCanceled&&(Oe&&_r&&!sr&&je!==null&&(Ee(!1),ke(null),Jt!==""&&ze.reason!==Kf&&Jr("",Xe(ns,ze.event))),!Oe&&Pe&&(xn?(sr||ke(ot),ot===""&&Ee(!1)):Qt&&(sr||ke(ot),_r&&Hr({activeIndex:null}),(!_r||sr)&&Jr("",Xe(ns,ze.event)))),Br(Oe),!Oe&&_r&&(ze.reason===jd||ze.reason===vm)&&(le(!0),xe(!1),ve==="onBlur")))){const $t=g==="none"?Jt:rt;de.commit($t)}}),Fo=Re((Oe,ze)=>{if(s?.(Oe,ze),ze.isCanceled)return;Zt(Oe),(g==="none"&&We.current&&j||xn&&!et.state.inputInsidePopup)&&Jr(Zi(Oe,N),Xe(ze.reason,ze.event))}),Cs=Re((Oe,ze)=>{const $t=Yn(Oe),Bt=Le.current??Oe;Le.current=null;const en=Xe(cp,Bt),Jn=$t?.closest("a")?.getAttribute("href");if(Jn){Jn.startsWith("#")&&Hi(!1,en);return}if(Qt){const dn=Array.isArray(rt)?rt:[],Vr=f$(dn,ze,$)?CP(dn,ze,$):[...dn,ze];if(Fo(Vr,en),en.isCanceled||!(fe.current?fe.current.value.trim()!=="":!1))return;et.state.inputInsidePopup?Jr("",Xe(ns,en.event)):Hi(!1,en)}else{if(Fo(ze,en),en.isCanceled)return;Hi(!1,en)}}),bu=Re(()=>{const Oe=de.inputRef.current?.form??et.state.inputElement?.form;Oe&&typeof Oe.requestSubmit=="function"&&Oe.requestSubmit()}),lr=Re(()=>{if(Ca(!1),fl?.(!1),Ee(!1),ke(null),Hr(g==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Qt&&fe.current&&fe.current.value!==""&&!Ie.current&&Jr("",Xe(ns)),xn)if(et.state.inputInsidePopup)fe.current&&fe.current.value!==""&&Jr("",Xe(ns));else{const Oe=Zi(rt,N);fe.current&&fe.current.value!==Oe&&Jr(Oe,Xe(Oe===""?ns:yr))}}),dl=E.useMemo(()=>sr&&Zn?{current:Zn.closest('[role="dialog"]')}:We,[sr,Zn]);fo({enabled:!t.actionsRef,open:Dt,ref:dl,onComplete(){Dt||lr()}}),E.useImperativeHandle(t.actionsRef,()=>({unmount:lr}),[lr]),Me(function(){if(Dt||(bn.current=null,g==="none"))return;const ze=Wt?rn:wt.current;Hr({selectedIndex:$0(ze,rt,$,Qt)})},[Dt,rt,g,Qt,Wt,rn,$,Hr]),Me(()=>{T&&(wt.current=zt,_e.current.length=zt.length)},[T,zt]),Me(()=>{const Oe=ht.current;if(Oe){const Tr=Dt||sr||et.state.positionerElement?.hidden===!1;if(Oe.hasQuery)yt&&Tr&&et.set("activeIndex",0),ht.current=null;else if(String(Jt).trim()===""&&(ht.current=null,Tr)){const Vr=Oe.selection;yt==="always"&&!Vr&&et.state.selectionMode==="none"&&et.set("activeIndex",0),queueMicrotask(()=>{if(!et.state.open&&!et.state.inline||fe.current&&fe.current.value.trim()!=="")return;const wi=et.state.selectedValue,Sl=et.state.selectionMode==="multiple",Fr=Sl&&Array.isArray(wi)?wi[wi.length-1]:wi,qo=et.state.selectionMode!=="none"&&Fr!=null;if(qo||Vr){const xu=Wt||lt?zt:wt.current;et.set("activeIndex",qo?$0(xu,wi,et.state.isItemEqualToValue,Sl):null)}else yt==="always"&&et.set("activeIndex",0)})}}if(!Dt&&!sr)return;const $t=Wt||lt?zt:wt.current,Bt=et.state.activeIndex;if(Bt==null){if(yt==="always"&&$t.length>0){et.set("activeIndex",0);return}qn(void 0,-1,yr);return}if(Bt>=$t.length){qn(void 0,-1,yr),et.set("activeIndex",null);return}const en=$t[Bt],Jn=it.current.value,dn=Jn!==YP&&uo(en,Jn,et.state.isItemEqualToValue);(it.current.index!==Bt||!dn)&&qn(en,Bt,yr)},[Ve,yt,qn,lt,Wt,zt,sr,Dt,et,Jt]),Me(()=>{if(g==="none"){ee(String(Jt)!=="");return}ee(Qt?Array.isArray(rt)&&rt.length>0:rt!=null)},[ee,g,Jt,rt,Qt]),E.useEffect(()=>{Wt&&yt&&zt.length===0&&Hr({activeIndex:null})},[Wt,yt,zt.length,Hr]);function Ea(Oe){const ze=ie.initialValue;return Array.isArray(Oe)&&Array.isArray(ze)?!EP(Oe,ze,($t,Bt)=>uo($t,Bt,$)):Oe!==ze}nc(ot,()=>{!Dt||ot===""||ot===String(jn)||Ee(!0)});function Rs(){const Oe=Zi(rt,N);Jt!==Oe&&Jr(Oe,Xe(yr))}nc(rt,()=>{g!=="none"&&(W(Mn),X(Ea(rt)),de.change(rt),xn&&!nn&&!_r&&Rs())}),nc(Jt,()=>{g==="none"&&(W(Mn),X(Jt!==ie.initialValue),de.change(Jt))}),nc(T,()=>{!xn||nn||_r||Pe||Rs()});const ui=pP({open:sr?!0:Dt,onOpenChange:Hi,elements:{reference:_r?li:ai,floating:Zn}}),hl=R?"grid":"listbox",Uo=Dt||sr,ji=Uo?"true":"false",Es=E.useMemo(()=>{const Oe=ai?.tagName==="INPUT",ze=ai==null||Oe,$t=ze||Uo,Bt=ze?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return $t&&(Bt.role="combobox",Bt["aria-expanded"]=ji,Bt["aria-haspopup"]=hl,Bt["aria-controls"]=Uo?Bi?.id:void 0,Bt["aria-autocomplete"]=te),{reference:Bt,floating:{role:"presentation"}}},[ai,Uo,ji,hl,Bi?.id,te]),gl=Cw(ui,{enabled:!S&&!ut&&P,event:"mousedown-only",toggle:!1,touchOpenDelay:_r?0:100,reason:wD}),$o=Cm(ui,{enabled:!S&&!ut&&!sr,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:sr?!0:void 0,outsidePress(Oe){const ze=Yn(Oe);return!Qe(li,ze)&&!Qe(nt.current,ze)&&!Qe(Je.current,ze)&&!Qe(Vn,ze)}}),Si=yP(ui,{enabled:!S&&!ut,id:Ce,listRef:_e,activeIndex:Ve,selectedIndex:Sa,virtual:!0,loopFocus:H,allowEscape:H&&!yt,focusItemOnOpen:Pe||g==="none"&&!yt?!1:"auto",focusItemOnHover:L,resetOnPointerLeave:!D,orientation:R?"horizontal":void 0,rtl:me==="rtl",disabledIndices:Pi,grid:R?Sq:void 0,onNavigate(Oe,ze){!ze&&!Dt||Ss==="ending"||Hr(ze?{activeIndex:Oe,type:ge.current?dw:hw}:{activeIndex:Oe})}}),pl=E.useMemo(()=>ko(Si.reference,{onKeyDown(Oe){R&&et.state.activeIndex==null&&(Oe.key==="ArrowLeft"||Oe.key==="ArrowRight")&&Oe.preventBaseUIHandler()}},$o.reference,gl.reference,Es.reference),[Si.reference,$o.reference,gl.reference,Es.reference,R,et]),ml=E.useMemo(()=>ko(Tm,$o.floating),[$o.floating]),vo=E.useMemo(()=>ko(Si.floating,Es.floating),[Si.floating,Es.floating]),jr=E.useMemo(()=>{const Oe=Si.item;return Oe?{...Oe,onFocus:void 0}:zn},[Si.item]);fD(()=>{et.update({inline:G,popupProps:ml,listProps:vo,inputProps:pl,triggerProps:yo,itemProps:jr,setOpen:Hi,setInputValue:Jr,setSelectedValue:Fo,setIndices:Hr,handleSelection:Cs,forceMount:Zr,requestSubmit:bu,onOpenChangeComplete:fl})}),Me(()=>{et.update({id:Ce,selectedValue:rt,open:Dt,mounted:wa,transitionStatus:Ss,items:T,inline:G,popupProps:ml,listProps:vo,inputProps:pl,triggerProps:yo,openMethod:Ra,itemProps:jr,selectionMode:g,name:Mn,form:v,disabled:ut,readOnly:S,required:w,grid:R,virtualized:F,openOnInputClick:P,itemToStringLabel:N,modal:q,autoHighlight:yt,isItemEqualToValue:$,submitOnItemClick:U,hasInputValue:nn,inputOwnsFormValue:g==="none"&&(G||!et.state.inputInsidePopup)})},[et,Ce,rt,Dt,wa,Ss,T,ml,vo,pl,jr,Ra,yo,g,Mn,ut,S,w,R,F,P,N,q,$,U,nn,G,yt,v]);const yl=tl(C,de.inputRef),vl=E.useMemo(()=>({query:ot,hasItems:Wt,filteredItems:Pt,flatFilteredItems:zt}),[ot,Wt,Pt,zt]),bo=E.useMemo(()=>Array.isArray(Cr)?"":To(Cr,_),[Cr,_]),xo=Qt&&Array.isArray(rt)&&rt.length>0,Ts=Qt||g==="none"&&_i?void 0:Mn,bl=E.useMemo(()=>!Qt||!Array.isArray(rt)||!Mn?null:rt.map(Oe=>{const ze=To(Oe,_);return O.jsx("input",{type:"hidden",form:v,name:Mn,value:ze,disabled:ut},ze)}),[Qt,rt,v,Mn,_,ut]),xl=O.jsxs(E.Fragment,{children:[t.children,O.jsx("input",{...de.getValidationProps(ut,{onFocus(){if(_r){li?.focus();return}(fe.current||li)?.focus()},onChange(Oe){if(Oe.nativeEvent.defaultPrevented||ut||S)return;const ze=Oe.currentTarget.value,$t=ze.toLowerCase(),Bt=Xe(yr,Oe.nativeEvent),en=()=>wt.current.findIndex(dn=>To(dn,_).toLowerCase()===$t||Zi(dn,N).toLowerCase()===$t);function Jn(){if(Qt)return;if(g==="none"){Jr(ze,Bt);return}let dn=en();dn===-1&&(dn=wt.current.findIndex((Vr,wi)=>{const Sl=Ge.current[wi];return Sl!=null&&Sl.toLowerCase()===$t}));const Tr=dn===-1?void 0:wt.current[dn];Tr!=null&&Fo?.(Tr,Bt)}xn&&(Zr(),T&&en()===-1&&et.set("forceMounted",!0)),queueMicrotask(Jn)}}),id:Ce&&Ts==null?`${Ce}-hidden-input`:void 0,form:v,name:Ts,autoComplete:J,disabled:ut,required:w&&!xo,readOnly:S,value:bo,ref:yl,style:Ts?ew:JS,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),bl]});return O.jsx(FP.Provider,{value:et,children:O.jsx(UP.Provider,{value:ui,children:O.jsx(qP.Provider,{value:Wt,children:O.jsx($P.Provider,{value:vl,children:O.jsx(GP.Provider,{value:Jt,children:xl})})})})})}function Oq(t){const{multiple:e=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:s,...a}=t;return O.jsx(Mq,{...a,selectionMode:e?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:s})}const XP={...OP,...mu,popupSide:t=>t?{"data-popup-side":t}:null,listEmpty:t=>t?{"data-list-empty":""}:null},kq=E.createContext(void 0);function Iq(){return E.useContext(kq)}const QP=E.createContext(void 0);function Hw(t){const e=E.useContext(QP);if(e===void 0&&!t)throw new Error(Un(21));return e}const ZP=E.forwardRef(function(e,n){const r=go(),{buttonRef:i,getButtonProps:s}=ul({native:!1}),a=tl(n,i);function u(d){r.state.setOpen(!1,Xe(SD,d.nativeEvent,d.currentTarget))}const f=s({onClick:u});return O.jsx("span",{ref:a,...f,"aria-label":"Dismiss",tabIndex:void 0,style:ew})});function JP(t){const e=pe(t,He.mounted),n=pe(t,He.popupSide),r=pe(t,He.positionerElement);return e&&r?n:null}function Lm(){return $d().filteredItems.length===0}function Dq(t){return t==="rtl"?["ArrowRight","ArrowLeft"]:["ArrowLeft","ArrowRight"]}function Pq(t,e){const n=t>=e-1?e-2:t;return n>=0?n:void 0}function ez(t,e,n){const r=t.state.listRef.current[e];r&&(t.state.selectionEventRef.current=n,r.click(),t.state.selectionEventRef.current=null)}const zq=E.forwardRef(function(e,n){const{render:r,className:i,disabled:s=!1,id:a,style:u,...f}=e,{state:d,disabled:g,setTouched:p,setFocused:m,validationMode:v,validation:b}=Ho(),{labelId:S}=vs(),w=Iq(),R=!!Hw(!0),T=go(),A=WP(),k=Ud(),P=pe(T,He.required),M=pe(T,He.disabled),D=pe(T,He.readOnly),L=pe(T,He.name),H=pe(T,He.form),N=pe(T,He.selectionMode),_=pe(T,He.autoHighlight),$=pe(T,He.inputProps),F=pe(T,He.triggerProps),G=pe(T,He.open),j=pe(T,He.mounted),q=pe(T,He.selectedValue),V=pe(T,He.id),te=pe(T,He.inline),J=pe(T,He.modal),z=!!_,U=JP(T),W=g||M||s,X=Lm(),ie=R||te,ee=!ie||J,ue=ho(a??(ie?void 0:V)),Y=R?bP:d,[le,xe]=E.useState(null),ve=E.useRef(!1),de=E.useRef(null),me=E.useRef(!1),Ce=N==="none"&&!R,De=Re(fe=>{const ne=R||T.state.inline;ne&&!T.state.hasInputValue&&T.state.setInputValue("",Xe(yr)),T.update({inputElement:fe,inputInsidePopup:ne,inputOwnsFormValue:Ce})}),Pe=R?f:b.getValidationProps(W,f);function Ee(){T.state.setIndices({activeIndex:null,selectedIndex:null,type:T.state.keyboardActiveRef.current?dw:hw})}function je(){T.state.keyboardActiveRef.current=!1}const ke={...Y,open:G,disabled:W,readOnly:D,popupSide:U,listEmpty:X};function _e(fe){if(!w)return;let ne;const{highlightedChipIndex:Q}=w,Se=w.chipsRef.current.length,[ge,Ie]=Dq(k);return Q!==void 0?(fe.key===ge?(fe.preventDefault(),Q>0?ne=Q-1:ne=void 0):fe.key===Ie?(fe.preventDefault(),Q<Se-1?ne=Q+1:ne=void 0):(fe.key==="Backspace"||fe.key==="Delete")&&(fe.preventDefault(),ne=Pq(Q,q.length),Ee()),ne):(fe.key===ge&&(fe.currentTarget.selectionStart??0)===0&&q.length>0&&(fe.preventDefault(),ne=Se>0?Se-1:void 0),ne)}const Ge=kt("input",e,{state:ke,ref:[n,T.state.inputRef,De],props:[$,F,{value:le??A,"aria-readonly":D||void 0,"aria-required":P||void 0,"aria-labelledby":S,disabled:W,readOnly:D,required:N==="none"?P:void 0,form:H,...Ce&&L&&{name:L},id:ue,onFocus(){if(m(!0),!te||!me.current)return;me.current=!1;const fe=de.current;fe==null||!Object.hasOwn(T.state.valuesRef.current,fe)||T.state.setIndices({activeIndex:fe})},onBlur(){p(!0),m(!1);const fe=T.state.activeIndex;if(te&&fe!==null&&_!=="always"&&(de.current=fe,me.current=!0,T.state.setIndices({activeIndex:null})),v==="onBlur"){const ne=N==="none"?A:q;b.commit(ne)}},onCompositionStart(fe){Mp||(ve.current=!0,xe(fe.currentTarget.value))},onCompositionEnd(fe){ve.current=!1;const ne=fe.currentTarget.value;xe(null),T.state.setInputValue(ne,Xe(Kf,fe.nativeEvent))},onChange(fe){const ne=fe.nativeEvent,Q=ne.inputType,Se=!Q||Q==="insertReplacementText",ge=ve.current||!Se;function Ie(it){D||W||!it||!ge||(T.state.setOpen(!0,Xe(Kf,ne)),z||Ee())}if(ve.current){const it=fe.currentTarget.value;xe(it),it===""&&!T.state.openOnInputClick&&!T.state.inputInsidePopup&&T.state.setOpen(!1,Xe(ns,ne));const ht=it.trim(),wt=z&&ht!=="";Ie(ht),G&&T.state.activeIndex!==null&&!wt&&Ee();return}const Je=Xe(Kf,ne);if(T.state.setInputValue(fe.currentTarget.value,Je),Je.isCanceled)return;const nt=fe.currentTarget.value==="",Le=Xe(ns,ne);nt&&!T.state.inputInsidePopup&&(N==="single"&&T.state.setSelectedValue(null,Le),T.state.openOnInputClick||T.state.setOpen(!1,Le)),Ie(fe.currentTarget.value.trim()),G&&T.state.activeIndex!==null&&!z&&Ee()},onKeyDown(fe){if(W||D||fe.ctrlKey||fe.shiftKey||fe.altKey||fe.metaKey)return;T.state.keyboardActiveRef.current=!0;const ne=fe.currentTarget,Q=ne.scrollWidth-ne.clientWidth,Se=k==="rtl";if(fe.key==="Home"){Dr(fe);const Je=YA&&Se?ne.value.length:0;ne.setSelectionRange(Je,Je),ne.scrollLeft=0;return}if(fe.key==="End"){Dr(fe);const Je=YA&&Se?0:ne.value.length;ne.setSelectionRange(Je,Je),ne.scrollLeft=Se?-Q:Q;return}if(!j&&fe.key==="Escape"){const Je=N==="multiple"&&Array.isArray(q)?q.length===0:q===null,nt=Xe(Vd,fe.nativeEvent),Le=N==="multiple"?[]:null;T.state.setInputValue("",nt),T.state.setSelectedValue(Le,nt),!Je&&!T.state.inline&&!nt.isPropagationAllowed&&fe.stopPropagation();return}if(w&&fe.key==="Backspace"&&ne.value===""&&w.highlightedChipIndex===void 0&&Array.isArray(q)&&q.length>0){const Je=w.chipsRef.current.length,nt=Je>0?Je-1:q.length-1,Le=q.filter((it,ht)=>ht!==nt);Ee(),T.state.setSelectedValue(Le,Xe(yr,fe.nativeEvent));return}const ge=w?.highlightedChipIndex!==void 0,Ie=_e(fe);if(w?.setHighlightedChipIndex(Ie),Ie!==void 0?w?.chipsRef.current[Ie]?.focus():ge&&T.state.inputRef.current?.focus(),fe.which!==229&&fe.key==="Enter"&&G){const Je=T.state.activeIndex,nt=fe.nativeEvent;if(Je===null){if(te)return;T.state.setOpen(!1,Xe(yr,nt));return}Dr(fe),ez(T,Je,nt)}},onPointerMove:je,onPointerDown:je},Pe],stateAttributesMapping:XP}),We=R?O.jsx(Mw.Provider,{value:xP,children:Ge}):Ge;return O.jsxs(E.Fragment,{children:[G&&ee&&O.jsx(ZP,{ref:T.state.startDismissRef}),We]})});function Nq(t,e,n,r,i){if(t.baseUIHandlerPrevented||r)return;const s=Yn(t.nativeEvent),a=Ot(s)?s:null;a!==t.currentTarget&&(i?.(a)||bD(a))||(t.preventDefault(),!n&&(e.state.inputRef.current?.focus(),e.state.openOnInputClick&&e.state.setOpen(!0,Xe(wD,t.nativeEvent))))}const Lq=E.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,{state:u}=Ho(),f=go(),d=pe(f,He.open),g=pe(f,He.disabled),p=pe(f,He.readOnly),m=pe(f,He.hasSelectedValue),v=pe(f,He.selectionMode),b=JP(f),S=g,w=Lm(),R={...u,open:d,disabled:S,readOnly:p,popupSide:b,listEmpty:w,placeholder:v==="none"?!1:!m},T=Re(A=>{f.set("inputGroupElement",A)});return kt("div",e,{ref:[n,T],props:[{role:"group",onMouseDown(A){Nq(A,f,S,p,k=>Qe(f.state.chipsContainerRef.current,k))}},a],state:R,stateAttributesMapping:XP})}),Bq=E.createContext(null);function _q(){return E.useContext(Bq)}function Hq(t){const{children:e}=t,{filteredItems:n}=$d(),r=_q(),i=r?r.items:n;return O.jsx(E.Fragment,{children:i.map(e)})}const jq=E.forwardRef(function(e,n){var r;const{render:i,className:s,style:a,children:u,...f}=e,d=go(),g=_w(),p=!!Hw(!0),{filteredItems:m,hasItems:v}=$d(),b=pe(d,He.selectionMode),S=pe(d,He.grid),w=pe(d,He.listProps),C=pe(d,He.virtualized),R=pe(d,He.forceMounted),T=b==="multiple",A=m.length===0,k=Re(_=>{d.set("positionerElement",_)}),P=Re(_=>{d.set("listElement",_)}),M=E.useMemo(()=>typeof u=="function"?r||(r=O.jsx(Hq,{children:u})):u,[u]),D={empty:A},L=g.useState("floatingId"),H=kt("div",e,{state:D,ref:[n,P,p?null:k],props:[w,{children:M,tabIndex:-1,id:L,role:S?"grid":"listbox","aria-multiselectable":T?"true":void 0,onKeyDown(_){if(!(d.state.disabled||d.state.readOnly)&&_.key==="Enter"){const $=d.state.activeIndex;if($==null)return;Dr(_),ez(d,$,_.nativeEvent)}},onKeyDownCapture(){d.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){d.state.keyboardActiveRef.current=!1}},f]});if(C)return H;const N=v&&!R?void 0:d.state.labelsRef;return O.jsx(Dm,{elementsRef:d.state.listRef,labelsRef:N,children:H})}),Vq="",Fq=200;function Uq(t){const e=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT);let n=null;for(;e.nextNode();){const r=e.currentNode;r.nodeValue!==""&&(n=r)}return n}function $q(){const t=ii(),e=E.useRef(null);return E.useEffect(()=>{if(_d)return;const n=e.current;if(n==null)return;const r=Uq(n);if(r==null)return;const i=r.data,s=`${i}${Vq}`;return r.nodeValue=s,t.start(Fq,()=>{r.nodeValue===s&&(r.nodeValue=i)}),()=>{t.clear(),r.nodeValue===s&&(r.nodeValue=i)}},[e,t]),e}const tz=E.createContext(void 0);function qq(){const t=E.useContext(tz);if(t===void 0)throw new Error(Un(20));return t}const Gq=E.forwardRef(function(e,n){const{keepMounted:r=!1,...i}=e,s=go(),a=pe(s,He.mounted),u=pe(s,He.forceMounted);return a||r||u?O.jsx(tz.Provider,{value:r,children:O.jsx(xw,{ref:n,...i})}):null}),Wq=E.forwardRef(function(e,n){const{render:r,className:i,anchor:s,positionMethod:a,side:u,align:f,sideOffset:d,alignOffset:g,collisionBoundary:p="clipping-ancestors",collisionPadding:m,arrowPadding:v,sticky:b,disableAnchorTracking:S=!1,collisionAvoidance:w=qD,style:C,...R}=e,T=go(),A=_w(),k=qq(),P=pe(T,He.modal),M=pe(T,He.open),D=pe(T,He.mounted),L=pe(T,He.openMethod),H=pe(T,He.positionerElement),N=pe(T,He.triggerElement),_=pe(T,He.inputElement),$=pe(T,He.inputGroupElement),F=pe(T,He.inputInsidePopup),G=pe(T,He.transitionStatus),j=Lm(),V=Dw({anchor:s??(F?N:$??_),floatingRootContext:A,positionMethod:a,mounted:D,side:u,sideOffset:d,align:f,alignOffset:g,arrowPadding:v,collisionBoundary:p,collisionPadding:m,sticky:b,disableAnchorTracking:S,keepMounted:k,collisionAvoidance:w,lazyFlip:!0});HP(M&&P,L==="touch",H,N);const te={open:M,side:V.side,align:V.align,anchorHidden:V.anchorHidden,empty:j};Me(()=>{T.set("popupSide",V.side)},[T,V.side]);const J=Re(U=>{T.set("positionerElement",U)}),z=zw(e,te,{styles:V.positionerStyles,transitionStatus:G,props:R,refs:[n,J],hidden:!D,inert:!M});return O.jsxs(QP.Provider,{value:V,children:[D&&P&&O.jsx(Pw,{inert:Im(!M),cutout:$??_??N}),z]})}),Kq={...Fd,...al},Yq=E.forwardRef(function(e,n){const{render:r,className:i,style:s,initialFocus:a,finalFocus:u,...f}=e,d=go(),g=Hw(),p=_w(),m=pe(d,He.mounted),v=pe(d,He.open),b=pe(d,He.openMethod),S=pe(d,He.popupProps),w=pe(d,He.transitionStatus),C=pe(d,He.inputInsidePopup),R=pe(d,He.inputElement),T=pe(d,He.modal),A=pe(d,He.id),k=Lm(),P=f.id??(C?Cq(A):void 0);Me(()=>(d.set("popupId",d.state.popupRef.current?.id||P),()=>{d.set("popupId",void 0)}),[d,P]),fo({open:v,ref:d.state.popupRef,onComplete(){v&&d.state.onOpenChangeComplete(!0)}});const M={open:v,side:g.side,align:g.align,anchorHidden:g.anchorHidden,transitionStatus:w,empty:k},D=kt("div",e,{state:M,ref:[n,d.state.popupRef],props:[S,{id:P,role:C?"dialog":"presentation",onFocus($){const F=Yn($.nativeEvent);b!=="touch"&&(Qe(d.state.listElement,F)||F===$.currentTarget)&&d.state.inputRef.current?.focus()}},Pm(w),f],stateAttributesMapping:Kq}),H=a===void 0?C?$=>$==="touch"?d.state.popupRef.current:R:!1:a;let N;u!=null?N=u:N=C?void 0:!1;const _=!C||T;return O.jsx(ww,{context:p,disabled:!m,modal:_,openInteractionType:b,initialFocus:H,returnFocus:N,getInsideElements:()=>[d.state.startDismissRef.current,d.state.endDismissRef.current],children:O.jsxs(E.Fragment,{children:[D,_&&O.jsx(ZP,{ref:d.state.endDismissRef})]})})}),Xq=E.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e;return kt("span",e,{ref:n,props:[{"aria-hidden":!0,children:"▼"},a]})}),nz=E.createContext(void 0);function rz(){const t=E.useContext(nz);if(!t)throw new Error(Un(19));return t}const Qq=E.createContext(!1);function Zq(){return E.useContext(Qq)}function iz(t){const{componentProps:e,forwardedRef:n,virtualized:r,indexFromFilter:i}=t,{render:s,className:a,style:u,value:f=null,index:d,disabled:g=!1,nativeButton:p=!1,...m}=e,v=E.useRef(null),b=Nm({guess:!0,index:d,textRef:v}),S=go(),w=Zq(),C=wq(),R=pe(S,He.selectionMode),T=pe(S,He.disabled),A=pe(S,He.readOnly),k=pe(S,He.isItemEqualToValue),P=T||g,M=R!=="none",D=d??i??b.index,L=D!==-1,H=pe(S,He.id),N=pe(S,He.isActive,D),_=pe(S,He.isSelected,f),$=pe(S,He.itemProps),F=E.useRef(null),G=H!=null&&L?`${H}-${D}`:void 0,j=_&&M;Me(()=>{if(!(L&&(r||d!=null)))return;const ie=S.state.listRef.current;return ie[D]=F.current,()=>{delete ie[D]}},[L,r,D,d,S]),Me(()=>{if(!L||C)return;const X=S.state.valuesRef.current;return X[D]=f,()=>{delete X[D]}},[L,C,D,f,S]),Me(()=>{if(!L||C)return;const X=S.state.selectedValue,ie=Array.isArray(X)?X[X.length-1]:X;uo(f,ie,k)&&S.set("selectedIndex",D)},[L,C,S,D,f,k]);const{getButtonProps:q,buttonRef:V}=ul({disabled:P,focusableWhenDisabled:!0,native:p,composite:!0}),te={disabled:P,selected:j,highlighted:N};function J(X){function ie(){S.state.handleSelection(X,f)}S.state.submitOnItemClick?(il.flushSync(ie),S.state.requestSubmit()):ie()}const z={id:G,role:w?"gridcell":"option","aria-selected":M?j:void 0,tabIndex:void 0,onPointerDownCapture(X){X.isPrimary&&(S.state.pointerDownItemRef.current=X.currentTarget),X.preventDefault()},onMouseDown(X){X.preventDefault()},onClick(X){P||A||J(X.nativeEvent)},onMouseUp(X){const ie=S.state.pointerDownItemRef.current===X.currentTarget;S.state.pointerDownItemRef.current=null,!(P||A||X.button!==0||ie||!N)&&J(X.nativeEvent)}},U=kt("div",e,{ref:[V,n,b.ref,F],state:te,props:[$,z,m,q]}),W=E.useMemo(()=>({selected:j,textRef:v}),[j,v]);return O.jsx(nz.Provider,{value:W,children:U})}function Jq(t){const{componentProps:e,forwardedRef:n}=t,r=go(),i=pe(r,He.isItemEqualToValue),{flatFilteredItems:s}=$d(),a=ac(s,e.value??null,i);return O.jsx(iz,{componentProps:e,forwardedRef:n,virtualized:!0,indexFromFilter:a})}const e9=E.memo(E.forwardRef(function(e,n){const r=go(),i=pe(r,He.virtualized);return i&&e.index==null?O.jsx(Jq,{componentProps:e,forwardedRef:n}):O.jsx(iz,{componentProps:e,forwardedRef:n,virtualized:i,indexFromFilter:void 0})})),t9=E.forwardRef(function(e,n){const{selected:r}=rz();return e.keepMounted||r?O.jsx(n9,{...e,ref:n}):null}),n9=E.memo(E.forwardRef((t,e)=>{const{render:n,className:r,style:i,keepMounted:s,...a}=t,{selected:u}=rz(),f=E.useRef(null),{transitionStatus:d,setMounted:g}=ga(u),m=kt("span",t,{ref:[e,f],state:{selected:u,transitionStatus:d},props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:al});return fo({open:u,ref:f,onComplete(){u||g(!1)}}),m})),r9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,children:a,...u}=e,{filteredItems:f}=$d(),d=go(),g=$q(),p=f.length===0?a:null;return kt("div",e,{ref:[n,d.state.emptyRef,g],props:[{children:p,role:"status","aria-live":"polite","aria-atomic":!0},u]})}),i9={...al,...km},o9=E.forwardRef(function(e,n){const{render:r,className:i,disabled:s=!1,nativeButton:a=!0,keepMounted:u=!1,style:f,...d}=e,{disabled:g}=Ho(),p=go(),m=pe(p,He.selectionMode),v=pe(p,He.disabled),b=pe(p,He.readOnly),S=pe(p,He.open),w=pe(p,He.selectedValue),C=pe(p,He.hasSelectionChips),R=WP();let T=!1;m==="none"?T=R!=="":m==="single"?T=w!=null:T=C;const A=g||v||s,{buttonRef:k,getButtonProps:P}=ul({native:a,disabled:A}),{mounted:M,transitionStatus:D,setMounted:L}=ga(T),H={disabled:A,visible:T,open:S,transitionStatus:D};fo({open:T,ref:p.state.clearRef,onComplete(){T||L(!1)}});const N=kt("button",e,{state:H,ref:[n,k,p.state.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown($){$.preventDefault()},onClick($){if(A||b)return;const F=p.state.keyboardActiveRef.current?dw:hw;p.state.setInputValue("",Xe(QA,$.nativeEvent)),m!=="none"?(p.state.setSelectedValue(Array.isArray(w)?[]:null,Xe(QA,$.nativeEvent)),p.state.setIndices({activeIndex:null,selectedIndex:null,type:F})):p.state.setIndices({activeIndex:null,type:F}),p.state.inputRef.current?.focus()}},d,P],stateAttributesMapping:i9});return u||M?N:null}),oz=E.createContext(void 0);function cl(t){const e=E.useContext(oz);if(!t&&e===void 0)throw new Error(Un(27));return e}const s9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,forceRender:a=!1,...u}=e,f=cl(),d=f.useState("open"),g=f.useState("nested"),p=f.useState("mounted"),m=f.useState("transitionStatus");return kt("div",e,{state:{open:d,transitionStatus:m},ref:[f.context.backdropRef,n],stateAttributesMapping:kP,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},u],enabled:a||!g})}),sz=E.forwardRef(function(e,n){const{render:r,className:i,style:s,disabled:a=!1,nativeButton:u=!0,...f}=e,d=cl(),g=d.useState("open"),{getButtonProps:p,buttonRef:m}=ul({disabled:a,native:u}),v={disabled:a};function b(S){g&&d.setOpen(!1,Xe(SD,S.nativeEvent))}return kt("button",e,{state:v,ref:[n,m],props:[{onClick:b},f,p]})}),l9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,...u}=e,f=cl(),d=ho(a);return f.useSyncedValueWithCleanup("descriptionElementId",d),kt("p",e,{ref:n,props:[{id:d},u]})}),lz=E.createContext(void 0);function az(){const t=E.useContext(lz);if(t===void 0)throw new Error(Un(26));return t}const uz={...Fd,...al,nestedDialogOpen(t){return t?{"data-nested-dialog-open":""}:null}},a9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,finalFocus:a,initialFocus:u,...f}=e,d=cl(),g=d.useState("descriptionElementId"),p=d.useState("disablePointerDismissal"),m=d.useState("floatingRootContext"),v=d.useState("popupProps"),b=d.useState("modal"),S=d.useState("mounted"),w=d.useState("nested"),C=d.useState("nestedOpenDialogCount"),R=d.useState("open"),T=d.useState("openMethod"),A=d.useState("titleElementId"),k=d.useState("transitionStatus"),P=d.useState("role"),M=m.useState("floatingId");az(),fo({open:R,ref:d.context.popupRef,onComplete(){R&&d.context.onOpenChangeComplete?.(!0)}});const D=u===void 0?$U(d.context.popupRef):u,L=C>0,H=d.useStateSetter("popupElement"),_=kt("div",e,{state:{open:R,nested:w,transitionStatus:k,nestedDialogOpen:L},props:[v,{id:M,"aria-labelledby":A,"aria-describedby":g,role:P,...Tm,hidden:!S,onKeyDown($){Lw.has($.key)&&$.stopPropagation()},style:{"--nested-dialogs":C}},f],ref:[n,d.context.popupRef,H],stateAttributesMapping:uz});return O.jsx(ww,{context:m,openInteractionType:T,disabled:!S,closeOnFocusOut:!p,initialFocus:D,returnFocus:a,modal:b!==!1,restoreFocus:"popup",children:_})}),u9=E.forwardRef(function(e,n){const{keepMounted:r=!1,...i}=e,s=cl(),a=s.useState("mounted"),u=s.useState("modal"),f=s.useState("open");return a||r?O.jsx(lz.Provider,{value:r,children:O.jsxs(xw,{ref:n,...i,children:[a&&u===!0&&O.jsx(Pw,{ref:s.context.internalBackdropRef,inert:Im(!f)}),e.children]})}):null});function c9({store:t,parentContext:e,isDrawer:n}){const r=t.useState("open"),i=t.useState("disablePointerDismissal"),s=t.useState("modal"),a=t.useState("popupElement"),u=t.useState("floatingRootContext"),[f,d]=E.useState(0),[g,p]=E.useState(0),m=f===0,v=Cm(u,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(b){if(!t.context.outsidePressEnabledRef.current||"button"in b&&b.button!==0)return!1;if("touches"in b){if(b.type==="touchend"){if(b.changedTouches.length!==1||b.touches.length!==0)return!1}else if(b.touches.length!==1)return!1}const S=Yn(b);if(m&&!i){if(s){const w=t.context.internalBackdropRef.current,C=t.context.backdropRef.current;return w||C?w===S||C===S||Qe(S,a)&&!S?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:m});return _P(r&&s===!0,a),t.useContextCallback("onNestedDialogOpen",(b,S)=>{d(b),p(S)}),Me(()=>(e?.onNestedDialogOpen&&(r?e.onNestedDialogOpen(f+1,g+(n?1:0)):e.onNestedDialogOpen(0,0)),()=>{e?.onNestedDialogOpen&&r&&e.onNestedDialogOpen(0,0)}),[n,r,f,g,e]),uP(t,{activeTriggerProps:v.reference,inactiveTriggerProps:v.trigger,popupProps:v.floating,nestedOpenDialogCount:f,nestedOpenDrawerCount:g}),null}const f9={...hP,modal:t=>t.modal,nested:t=>t.nested,nestedOpenDialogCount:t=>t.nestedOpenDialogCount,nestedOpenDrawerCount:t=>t.nestedOpenDrawerCount,disablePointerDismissal:t=>t.disablePointerDismissal,openMethod:t=>t.openMethod,descriptionElementId:t=>t.descriptionElementId,titleElementId:t=>t.titleElementId,viewportElement:t=>t.viewportElement,role:t=>t.role};class d9 extends fm{constructor(e,n,r){const i=new Am,s=h9(e,i,n,r);super(s,g9(i),f9)}setOpen=(e,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,n);const r={open:e};oP(r,e,n.trigger),this.update(r)}}function h9(t,e,n,r=!1){const i={...cP(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t};return i.floatingRootContext=fP(e,n,r),i}function g9(t){return{popupRef:E.createRef(),backdropRef:E.createRef(),internalBackdropRef:E.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:t,onOpenChange:void 0,onOpenChangeComplete:void 0}}function p9(t,e){const{children:n,open:r,defaultOpen:i=!1,onOpenChange:s,onOpenChangeComplete:a,disablePointerDismissal:u=!1,modal:f=!0,actionsRef:d,handle:g,triggerId:p,defaultTriggerId:m=null}=e,v=t==="drawer",b=f,S=u,w="dialog",C=cl(!0),R=C!=null,T={modal:b,disablePointerDismissal:S,nested:R,role:w},A=rP((H,N)=>new d9({open:i,openProp:r,activeTriggerId:m,triggerIdProp:p,...T},H,N),!0);A.useControlledProp("openProp",r),A.useControlledProp("triggerIdProp",p),A.useSyncedValues(T),A.useContextCallback("onOpenChange",s),A.useContextCallback("onOpenChangeComplete",a);const k=A.useState("open"),P=A.useState("mounted"),M=A.useState("payload");KU(A,k),lP(A);const{forceUnmount:D}=aP(k,A);E.useImperativeHandle(d,()=>({unmount:D,close:()=>A.setOpen(!1,Xe(RD))}),[D,A]);const L=k||P;return O.jsxs(oz.Provider,{value:A,children:[g&&O.jsx(iP,{handle:g,store:A}),L&&O.jsx(c9,{store:A,parentContext:C?.context,isDrawer:v}),typeof n=="function"?n({payload:M}):n]})}function m9(t){return p9("dialog",t)}const y9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,children:a,...u}=e,f=az(),d=cl(),g=d.useState("open"),p=d.useState("nested"),m=d.useState("transitionStatus"),v=d.useState("nestedOpenDialogCount"),b=d.useState("mounted"),S=d.useStateSetter("viewportElement"),w=v>0;return kt("div",e,{enabled:f||b,state:{open:g,nested:p,transitionStatus:m,nestedDialogOpen:w},ref:[n,S],stateAttributesMapping:uz,props:[{role:"presentation",hidden:!b,style:{pointerEvents:g?void 0:"none"},children:a},u]})}),v9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,...u}=e,f=cl(),d=ho(a);return f.useSyncedValueWithCleanup("titleElementId",d),kt("h2",e,{ref:n,props:[{id:d},u]})}),b9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,disabled:a=!1,nativeButton:u=!0,id:f,payload:d,handle:g,...p}=e,m=cl(!0),b=gP(g)??m;if(!b)throw new Error(Un(79));const S=ho(f),w=b.useState("floatingRootContext"),C=b.useState("isOpenedByTrigger",S),R=b.useState("triggerPopupId",S),T=E.useRef(null),{registerTrigger:A,isMountedByThisTrigger:k}=sP(S,T,b,{payload:d}),{getButtonProps:P,buttonRef:M}=ul({disabled:a,native:u}),D=Cw(w),L=TP(()=>b.select("open"),_=>{b.set("openMethod",_)}),H={disabled:a,open:C},N=b.useState("triggerProps",k);return kt("button",e,{state:H,ref:[M,n,A,T],props:[D.reference,N,L,{[$D]:"",id:S,"aria-haspopup":"dialog","aria-expanded":C,"aria-controls":R},p,P],stateAttributesMapping:km})}),cz=E.createContext(void 0);function Bm(t){const e=E.useContext(cz);if(e===void 0&&!t)throw new Error(Un(72));return e}const x9={...hP,disabled:t=>t.disabled,instantType:t=>t.instantType,isInstantPhase:t=>t.isInstantPhase,trackCursorAxis:t=>t.trackCursorAxis,disableHoverablePopup:t=>t.disableHoverablePopup,lastOpenChangeReason:t=>t.openChangeReason,closeOnClick:t=>t.closeOnClick,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class S9 extends fm{constructor(e,n,r){const i=new Am;super(w9(e,i,n,r),C9(i),x9)}setOpen=(e,n)=>{WU(this,e,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Xe(Hd,e))}}function w9(t,e,n,r=!1){const i={...cP(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t};return i.floatingRootContext=fP(e,n,r),i}function C9(t){return{popupRef:E.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}const R9=gD(function(e){const{disabled:n=!1,defaultOpen:r=!1,open:i,disableHoverablePopup:s=!1,trackCursorAxis:a="none",actionsRef:u,onOpenChange:f,onOpenChangeComplete:d,handle:g,triggerId:p,defaultTriggerId:m=null,children:v}=e,b=rP((N,_)=>new S9({open:r,openProp:i,activeTriggerId:m,triggerIdProp:p},N,_));b.useControlledProp("openProp",i),b.useControlledProp("triggerIdProp",p),b.useContextCallback("onOpenChange",f),b.useContextCallback("onOpenChangeComplete",d);const S=b.useState("open"),w=!n&&S,C=b.useState("activeTriggerId"),R=b.useState("mounted"),T=b.useState("payload");b.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:s,disabled:n}),lP(b,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:A,transitionStatus:k}=aP(w,b),P=b.useState("isInstantPhase"),M=b.useState("instantType"),D=b.useState("lastOpenChangeReason"),L=E.useRef(null);Me(()=>{S&&n&&b.setOpen(!1,Xe(CD))},[S,n,b]),Me(()=>{k==="ending"&&D===yr||k!=="ending"&&P?(M!=="delay"&&(L.current=M),b.set("instantType","delay")):L.current!==null&&(b.set("instantType",L.current),L.current=null)},[k,P,D,M,b]),Me(()=>{w&&C==null&&b.set("payload",void 0)},[b,C,w]),E.useImperativeHandle(u,()=>({unmount:A,close:()=>b.setOpen(!1,Xe(RD))}),[A,b]);const H=w||R||!n&&a!=="none";return O.jsxs(cz.Provider,{value:b,children:[g&&O.jsx(iP,{handle:g,store:b}),H&&O.jsx(E9,{store:b,disabled:n,trackCursorAxis:a}),typeof v=="function"?v({payload:T}):v]})});function E9({store:t,disabled:e,trackCursorAxis:n}){const r=t.useState("floatingRootContext"),i=Cm(r,{enabled:!e,referencePress:()=>t.select("closeOnClick")}),s=eU(r,{enabled:!e&&n!=="none",axis:n==="none"?void 0:n}),a=E.useMemo(()=>ko(s.reference,i.reference),[s.reference,i.reference]);return uP(t,{activeTriggerProps:a,inactiveTriggerProps:a,popupProps:i.floating??zn}),null}const fz=E.createContext(void 0);function T9(){return E.useContext(fz)}const FM=600,dz="data-base-ui-tooltip-trigger";function UM(t){if("composedPath"in t){const n=t.composedPath();for(let r=0;r<n.length;r+=1){const i=n[r];if(Ot(i))return i}}const e=t.target;return Ot(e)?e:null}function A9(t){let e=t;for(;e;){const n=e.closest(`[${dz}]`);if(n)return n;const r=e.getRootNode();e="host"in r&&Ot(r.host)?r.host:null}return null}const M9=B8(function(e,n){const{render:r,className:i,style:s,handle:a,payload:u,disabled:f,delay:d,closeOnClick:g=!0,closeDelay:p,id:m,...v}=e,b=Bm(!0),w=gP(a)??b;if(!w)throw new Error(Un(82));const C=ho(m),R=w.useState("isTriggerActive",C),T=w.useState("isOpenedByTrigger",C),A=w.useState("floatingRootContext"),k=E.useRef(null),P=d??FM,M=p??0,{registerTrigger:D,isMountedByThisTrigger:L}=sP(C,k,w,{payload:u,closeOnClick:g,closeDelay:M}),H=T9(),{delayRef:N,isInstantPhase:_,hasProvider:$}=d6(A,{open:T}),F=Aw(A);w.useSyncedValue("isInstantPhase",_);const G=w.useState("disabled"),j=f??G,q=Fn(j),V=w.useState("trackCursorAxis"),te=w.useState("disableHoverablePopup"),J=E.useRef(!1),z=ii(),U=E.useRef(void 0);function W(){return $?oa(N.current,"open")===0?0:d??H??FM:P}function X(me){const Ce=k.current;if(!Ce||!me)return!1;const De=A9(me);return De!==null&&De!==Ce&&Qe(Ce,De)}function ie(me){const Ce=X(me);return J.current=Ce,Ce&&(F.openChangeTimeout.clear(),F.restTimeout.clear(),F.restTimeoutPending=!1,z.clear()),Ce}const ee=n$(A,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!te&&V!=="both"?u$():null,restMs:W,delay(){return p==null&&$?{close:oa(N.current,"close")}:{close:M}},triggerElementRef:k,isActiveTrigger:R,isClosing:()=>w.select("transitionStatus")==="ending",shouldOpen(){return!J.current}}),ue=JU(A,{enabled:!j}).reference,Y=me=>{const Ce=J.current,De=UM(me),Pe=ie(De),Ee=k.current,je=Ee&&De&&Qe(Ee,De);if(Pe&&w.select("open")&&w.select("lastOpenChangeReason")===mi){w.setOpen(!1,Xe(mi,me));return}if(Ce&&!Pe&&je&&!q.current&&!w.select("open")&&Ee&&na(U.current)){const ke=()=>{!J.current&&!q.current&&!w.select("open")&&w.setOpen(!0,Xe(mi,me,Ee))},_e=W();_e===0?(z.clear(),ke()):z.start(_e,ke)}},le=w.useState("triggerProps",L);return kt("button",e,{state:{open:T},ref:[n,D,k],props:[ee,ue,L||V!=="none"?le:void 0,{onMouseOver(me){Y(me.nativeEvent)},onFocus(me){X(UM(me.nativeEvent))&&me.preventBaseUIHandler()},onMouseLeave(){J.current=!1,z.clear(),U.current=void 0},onPointerEnter(me){U.current=me.pointerType},onPointerDown(me){U.current=me.pointerType,w.set("closeOnClick",g),g&&!w.select("open")&&w.cancelPendingOpen(me.nativeEvent)},onClick(me){g&&!w.select("open")&&w.cancelPendingOpen(me.nativeEvent)},id:C,"data-trigger-disabled":j?"":void 0,[dz]:j?void 0:""},v],stateAttributesMapping:km})}),hz=E.createContext(void 0);function O9(){const t=E.useContext(hz);if(t===void 0)throw new Error(Un(70));return t}const k9=E.forwardRef(function(e,n){const{children:r,container:i,className:s,render:a,style:u,...f}=e,{node:d,subtree:g}=KD({container:i,ref:n,componentProps:e,elementProps:f});return!g&&!d?null:O.jsxs(E.Fragment,{children:[g,d&&il.createPortal(r,d)]})}),I9=E.forwardRef(function(e,n){const{keepMounted:r=!1,...i}=e;return Bm().useState("mounted")||r?O.jsx(hz.Provider,{value:r,children:O.jsx(k9,{ref:n,...i})}):null}),gz=E.createContext(void 0);function D9(){const t=E.useContext(gz);if(t===void 0)throw new Error(Un(71));return t}const P9=E.forwardRef(function(e,n){const{render:r,className:i,anchor:s,positionMethod:a="absolute",side:u="top",align:f="center",sideOffset:d=0,alignOffset:g=0,collisionBoundary:p="clipping-ancestors",collisionPadding:m=5,arrowPadding:v=5,sticky:b=!1,disableAnchorTracking:S=!1,collisionAvoidance:w=q6,style:C,...R}=e,T=Bm(),A=O9(),k=T.useState("open"),P=T.useState("mounted"),M=T.useState("trackCursorAxis"),D=T.useState("disableHoverablePopup"),L=T.useState("floatingRootContext"),H=T.useState("instantType"),N=T.useState("transitionStatus"),_=T.useState("adaptiveOrigin"),$=Dw({anchor:s,positionMethod:a,floatingRootContext:L,mounted:P,side:u,sideOffset:d,align:f,alignOffset:g,collisionBoundary:p,collisionPadding:m,sticky:b,arrowPadding:v,disableAnchorTracking:S,keepMounted:A,collisionAvoidance:w,adaptiveOrigin:_}),F=E.useMemo(()=>({open:k,side:$.side,align:$.align,anchorHidden:$.anchorHidden,instant:M!=="none"?"tracking-cursor":H}),[k,$.side,$.align,$.anchorHidden,M,H]),G=zw(e,F,{styles:$.positionerStyles,transitionStatus:N,props:R,refs:[n,T.useStateSetter("positionerElement")],hidden:!P,inert:!k||M==="both"||D});return O.jsx(gz.Provider,{value:$,children:G})}),z9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,u=Bm(),{side:f,align:d}=D9(),g=u.useState("open"),p=u.useState("instantType"),m=u.useState("transitionStatus"),v=u.useState("popupProps"),b=u.useState("floatingRootContext"),S=u.useState("disabled"),w=u.useState("closeDelay");fo({open:g,ref:u.context.popupRef,onComplete(){g&&u.context.onOpenChangeComplete?.(!0)}}),e$(b,{enabled:!S,closeDelay:w});const C=u.useStateSetter("popupElement");return kt("div",e,{state:{open:g,side:f,align:d,instant:p,transitionStatus:m},ref:[n,u.context.popupRef,C],props:[Tm,v,Pm(m),a],stateAttributesMapping:kP})}),N9=function(e){const{delay:n,closeDelay:r,timeout:i=400}=e,s=E.useMemo(()=>({open:n,close:r}),[n,r]);return O.jsx(fz.Provider,{value:n,children:O.jsx(f6,{delay:s,timeoutMs:i,children:e.children})})},pz=E.createContext(void 0);function jw(){const t=E.useContext(pz);if(t===void 0)throw new Error(Un(64));return t}const _m={tabActivationDirection:t=>({"data-activation-direction":t})},L9=E.forwardRef(function(e,n){const{className:r,defaultValue:i=0,onValueChange:s,orientation:a="horizontal",render:u,value:f,style:d,...g}=e,p=e.defaultValue!==void 0,m=E.useRef([]),[v,b]=E.useState(()=>new Map),[S,w]=Ja({controlled:f,default:i,name:"Tabs",state:"value"}),C=f!==void 0,[R,T]=E.useState(()=>new Map),A=E.useRef(void 0),k=E.useCallback(Y=>Mx(R,Y),[R]),[P,M]=E.useState(()=>({previousValue:S,tabActivationDirection:"none"})),{previousValue:D,tabActivationDirection:L}=P;let H=L,N=!1;D!==S&&(H=$M(D,S,a,R),N=D!=null&&S!=null&&k(S)==null);const _=N?D:S,$=D!==_||L!==H;Me(()=>{$&&M({previousValue:_,tabActivationDirection:H})},[_,$,H]);const F=Re((Y,le)=>{const xe=$M(S,Y,a,R);le.activationDirection=xe,s?.(Y,le),!le.isCanceled&&w(Y)}),G=Re((Y,le)=>{s?.(Y,Xe(le,void 0,void 0,{activationDirection:"none"}))}),j=Re((Y,le)=>(b(xe=>{const ve=new Map(xe);return ve.set(Y,le),ve}),()=>{b(xe=>{if(xe.get(Y)!==le)return xe;const ve=new Map(xe);return ve.delete(Y),ve})})),q=E.useCallback(Y=>v.get(Y),[v]),V=E.useCallback(Y=>{for(const le of R.values())if(Y===le.value)return le.id},[R]),te=E.useMemo(()=>({getTabElementBySelectedValue:k,getTabIdByPanelValue:V,getTabPanelIdByValue:q,onValueChange:F,orientation:a,registerMountedTabPanel:j,setTabMap:T,tabActivationDirection:H,value:S}),[k,V,q,F,a,j,T,H,S]),J=E.useMemo(()=>{for(const Y of R.values())if(Y.value===S)return Y},[R,S]),z=E.useMemo(()=>{for(const Y of R.values())if(!Y.disabled)return Y.value},[R]),U=E.useRef(!p),W=E.useRef(i),X=E.useRef(p),ie=E.useRef(!1);Me(()=>{if(C)return;function Y(de,me){w(de),M({previousValue:de,tabActivationDirection:"none"}),G(de,me),U.current=!1}if(R.size===0){ie.current&&S!==null&&!A.current?.isConnected&&Y(null,JA);return}ie.current=!0,A.current=R.keys().next().value;const le=J?.disabled,xe=J==null&&S!==null;if(!le&&S===W.current&&(X.current=!1),X.current&&le&&S===W.current)return;const ve=U.current;if(le||xe){const de=z??null;if(S===de){U.current=!1;return}let me=JA;ve?me=eM:le&&(me=CD),Y(de,me);return}ve&&J!=null&&(G(S,eM),U.current=!1)},[z,C,G,J,w,R,S]);const ue=kt("div",e,{state:{orientation:a,tabActivationDirection:H},ref:n,props:g,stateAttributesMapping:_m});return O.jsx(pz.Provider,{value:te,children:O.jsx(Dm,{elementsRef:m,children:ue})})});function Mx(t,e){for(const[n,r]of t.entries())if(e===r.value)return n;return null}function $M(t,e,n,r){if(t==null||e==null)return"none";const[i,s,a]=n==="horizontal"?["left","left","right"]:["top","up","down"],u=Mx(r,t),f=Mx(r,e);if(u==null||f==null)return u!==f&&(typeof t=="number"||typeof t=="string")&&typeof t==typeof e?e>t?a:s:"none";const d=u.getBoundingClientRect()[i],g=f.getBoundingClientRect()[i];return g<d?s:g>d?a:"none"}const mz="data-composite-item-active";function yz(t={}){const{highlightItemOnHover:e,highlightedIndex:n,onHighlightedIndexChange:r}=Iw(),{ref:i,index:s}=Nm(t),a=n===s,u=E.useRef(null),f=tl(i,u);return{compositeProps:{tabIndex:a?0:-1,onFocus(){r(s)},onMouseMove(){const g=u.current;if(!e||!g)return;const p=g.hasAttribute("disabled")||g.ariaDisabled==="true";!a&&!p&&g.focus()}},compositeRef:f,index:s}}const vz=E.createContext(void 0);function B9(){const t=E.useContext(vz);if(t===void 0)throw new Error(Un(65));return t}const _9=E.forwardRef(function(e,n){const{className:r,disabled:i=!1,render:s,value:a,id:u,nativeButton:f=!0,style:d,...g}=e,{value:p,getTabPanelIdByValue:m,onValueChange:v,orientation:b,tabActivationDirection:S}=jw(),{activateOnFocus:w,registerTabResizeObserverElement:C,tabsListElement:R}=B9(),{highlightedIndex:T,onHighlightedIndexChange:A}=Iw(),k=ho(u),P=E.useMemo(()=>({disabled:i,id:k,value:a}),[i,k,a]),{compositeProps:M,compositeRef:D,index:L}=yz({metadata:P}),H=a===p,N=E.useRef(!1),_=E.useRef(null),$=Re(ie=>{_.current?.(),_.current=ie?C(ie):null});Me(()=>{if(N.current){N.current=!1;return}if(!(H&&L>-1&&T!==L))return;const ie=R;if(ie!=null){const ee=Gr(Vt(ie));if(ee&&Qe(ie,ee))return}i||A(L)},[H,L,T,A,i,R]);const{getButtonProps:F,buttonRef:G}=ul({disabled:i,native:f,focusableWhenDisabled:!0}),j=m(a),q=E.useRef(!1),V=E.useRef(!1);function te(ie){v(a,Xe(yr,ie.nativeEvent,void 0,{activationDirection:"none"}))}function J(ie){H||i||te(ie)}function z(ie){H||i||w&&(!q.current||V.current)&&te(ie)}function U(ie){if(H||i)return;q.current=!0,V.current=ie.button===0;const ee=Vt(ie.currentTarget);function ue(){q.current=!1,V.current=!1,ee.removeEventListener("pointerup",ue),ee.removeEventListener("pointercancel",ue)}ee.addEventListener("pointerup",ue),ee.addEventListener("pointercancel",ue)}return kt("button",e,{state:{disabled:i,active:H,orientation:b,tabActivationDirection:S},ref:[n,G,D,$],props:[M,{role:"tab","aria-controls":j,"aria-selected":H,id:k,onClick:J,onFocus:z,onPointerDown:U,[mz]:H?"":void 0,onKeyDownCapture(){N.current=!0}},g,F],stateAttributesMapping:_m})}),H9={..._m,...al},j9=E.forwardRef(function(e,n){const{className:r,value:i,render:s,keepMounted:a=!1,style:u,...f}=e,{value:d,getTabIdByPanelValue:g,orientation:p,tabActivationDirection:m,registerMountedTabPanel:v}=jw(),b=ho(),{ref:S,index:w}=Nm(),C=i===d,{mounted:R,transitionStatus:T,setMounted:A}=ga(C),k=!R,P=g(i),M={hidden:k,orientation:p,tabActivationDirection:m,transitionStatus:T},D=E.useRef(null),L=kt("div",e,{state:M,ref:[n,S,D],props:[{"aria-labelledby":P,hidden:k,id:b,role:"tabpanel",tabIndex:C?0:-1,inert:Im(!C),"data-index":w},f],stateAttributesMapping:H9});return fo({open:C,ref:D,onComplete(){C||A(!1)}}),Me(()=>{if(!(b==null||k&&!a))return v(i,b)},[k,a,i,b,v]),a||R?L:null}),V9=[];function F9(t){const{loopFocus:e=!0,orientation:n="both",grid:r,onLoop:i,direction:s,highlightedIndex:a,onHighlightedIndexChange:u,rootRef:f,enableHomeAndEndKeys:d=!1,stopEventPropagation:g,disabledIndices:p,modifierKeys:m=V9}=t,[v,b]=E.useState(0),S=r!=null,w=E.useRef(null),C=tl(w,f),R=E.useRef([]),T=E.useRef(!1),A=a??v,k=Re((H,N=!1)=>{if((u??b)(H),N){const _=R.current[H];LM(w.current,_,s,n)}}),P=Re(H=>{if(H.size===0||T.current)return;T.current=!0;const N=Array.from(H.keys()),_=N.find(F=>F?.hasAttribute(mz))??null,$=_?H.get(_)?.index??-1:-1;if($!==-1)k($);else if(wc(N,A,p)){const F=Er(N,{disabledIndices:p});ra(N,F)||k(F)}LM(w.current,_,s,n)});Me(()=>{if(p==null||a!=null||!T.current)return;const H=R.current;if(wc(H,A,p)){const N=Er(H,{disabledIndices:p});ra(H,N)||k(N)}},[p,a,A,R,k]);const M=Re((H,N,_)=>i?i(H,N,_,R):_),D=Re(H=>{const N=H.key===Tx||H.key===Ax;if(!Lw.has(H.key)||!d&&N||U9(H,m)||!w.current)return;const $=s==="rtl",F=$?Rx:Ex,G=$?Ex:Rx,j=n==="vertical"?Cx:F,q=n==="vertical"?wx:G,V=Yn(H.nativeEvent);if(V!=null&&NM(V)&&!dD(V)){const X=V.selectionStart,ie=V.selectionEnd,ee=V.value;if(X==null||H.shiftKey||X!==ie||H.key!==q&&X<ee.length||H.key!==j&&X>0)return}let te=A;const J=fp(R,p),z=mx(R,p);r!=null&&(te=r({disabledIndices:p,elementsRef:R,event:H,highlightedIndex:A,loopFocus:e,maxIndex:z,minIndex:J,onLoop:M,orientation:n,rtl:$}));const U=n!=="vertical"&&H.key===F||n!=="horizontal"&&H.key===Cx,W=n!=="vertical"&&H.key===G||n!=="horizontal"&&H.key===wx;d&&(H.key===Tx?te=J:H.key===Ax&&(te=z)),te===A&&(U||W)&&(e&&te===z&&U?(te=J,i&&(te=i(H,A,te,R))):e&&te===J&&W?(te=z,i&&(te=i(H,A,te,R))):te=Er(R.current,{startingIndex:te,decrement:W,disabledIndices:p})),te!==A&&!ra(R.current,te)&&(g&&H.stopPropagation(),(S||N||U||W)&&H.preventDefault(),k(te,!0),queueMicrotask(()=>{R.current[te]?.focus()}))});return{props:{ref:C,onFocus(H){const N=w.current,_=Yn(H.nativeEvent);!N||_==null||!NM(_)||_.setSelectionRange(0,_.value.length)},onKeyDown:D},highlightedIndex:A,onHighlightedIndexChange:k,elementsRef:R,onMapChange:P,relayKeyboardEvent:D}}function U9(t,e){for(const n of aq)if(!e.includes(n)&&t.getModifierState(n))return!0;return!1}function bz(t){const{render:e,className:n,style:r,refs:i=Pi,props:s=Pi,state:a=zn,stateAttributesMapping:u,highlightedIndex:f,onHighlightedIndexChange:d,orientation:g,grid:p,loopFocus:m,onLoop:v,enableHomeAndEndKeys:b,onMapChange:S,stopEventPropagation:w=!0,rootRef:C,disabledIndices:R,modifierKeys:T,highlightItemOnHover:A=!1,tag:k="div",...P}=t,M=Ud(),{props:D,highlightedIndex:L,onHighlightedIndexChange:H,elementsRef:N,onMapChange:_,relayKeyboardEvent:$}=F9({grid:p,loopFocus:m,onLoop:v,orientation:g,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:C,stopEventPropagation:w,enableHomeAndEndKeys:b,direction:M,disabledIndices:R,modifierKeys:T}),F=kt(k,t,{state:a,ref:i,props:[D,...s,P],stateAttributesMapping:u}),G=E.useMemo(()=>({highlightedIndex:L,onHighlightedIndexChange:H,highlightItemOnHover:A,relayKeyboardEvent:$}),[L,H,A,$]);return O.jsx(IP.Provider,{value:G,children:O.jsx(Dm,{elementsRef:N,onMapChange:j=>{S?.(j),_(j)},children:F})})}const $9=E.forwardRef(function(e,n){const{activateOnFocus:r=!1,className:i,loopFocus:s=!0,render:a,style:u,...f}=e,{orientation:d,setTabMap:g,tabActivationDirection:p}=jw(),[m,v]=E.useState(0),[b,S]=E.useState(null),w=E.useRef(new Set),C=E.useRef(new Set),R=E.useRef(null);Me(()=>{if(typeof ResizeObserver>"u")return;const D=new ResizeObserver(()=>{w.current.forEach(L=>{L()})});return R.current=D,b&&D.observe(b),C.current.forEach(L=>{D.observe(L)}),()=>{D.disconnect(),R.current=null}},[b]);const T=Re(D=>(w.current.add(D),()=>{w.current.delete(D)})),A=Re(D=>(C.current.add(D),R.current?.observe(D),()=>{C.current.delete(D),R.current?.unobserve(D)})),k={orientation:d,tabActivationDirection:p},P={"aria-orientation":d==="vertical"?"vertical":void 0,role:"tablist"},M=E.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:T,registerTabResizeObserverElement:A,tabsListElement:b}),[r,T,A,b]);return O.jsx(vz.Provider,{value:M,children:O.jsx(bz,{render:a,className:i,style:u,state:k,refs:[n,S],props:[P,f],stateAttributesMapping:_m,highlightedIndex:m,enableHomeAndEndKeys:!0,loopFocus:s,orientation:d,onHighlightedIndexChange:v,onMapChange:g,disabledIndices:Pi})})}),q9=E.createContext(void 0);function G9(t=!1){const e=E.useContext(q9);if(!e&&!t)throw new Error(Un(86));return e}const W9=function(e){const n=ho(),r=e.controlId===void 0?n:e.controlId,[i,s]=E.useState(r),[a,u]=E.useState(e.labelId),[f,d]=E.useState([]),g=Sr(()=>new Map),{messageIds:p}=vs(),m=Re((S,w)=>{const C=g.current;if(w===void 0){C.delete(S);return}C.set(S,w),s(R=>{if(C.size===0)return;let T;for(const A of C.values()){if(R!==void 0&&A===R)return R;T===void 0&&(T=A)}return T})}),v=E.useCallback(S=>{const w=S["aria-describedby"]?S["aria-describedby"].split(" "):[];return w.push(...p,...f),{...S,"aria-describedby":Array.from(new Set(w)).join(" ")||void 0}},[p,f]),b=E.useMemo(()=>({controlId:i,registerControlId:m,labelId:a,setLabelId:u,messageIds:f,setMessageIds:d,getDescriptionProps:v}),[i,m,a,u,f,d,v]);return O.jsx(SP.Provider,{value:b,children:e.children})};function Ox(t,e){return{...t,state:{...t.state,valid:!e&&t.state.valid}}}const K0=Object.keys(vd);function K9(t,e){return t.matches(":disabled")?!1:!e||t.form===e?!0:t.form===null&&!t.hasAttribute("form")}function qM(t,e){let n=null;for(const r of t.keys())if(K9(r,e)){if(!r.validity.valid)return r;n??=r}return n}function GM(t,e){for(const n of e.keys())n.setCustomValidity("");t?.setCustomValidity("")}function Y9(t){const{elementRef:e,formRef:n}=yu(),{setValidityData:r,validate:i,validityData:s,validationDebounceTime:a,invalid:u,markedDirtyRef:f,state:d,shouldValidateOnChange:g,registeredFieldIdRef:p}=t,{controlId:m,getDescriptionProps:v}=vs(),b=ii(),S=E.useRef(null),w=Sr(()=>new Map).current,C=E.useRef(0),R=E.useCallback((M,D)=>(w.set(M,D),()=>{w.delete(M)}),[w]),T=Re(()=>{const M=qM(w,e.current);return M&&w.get(M)?.controlRef.current||null}),A=Re(async(M,D=!1)=>{C.current+=1;const L=C.current;function H(J,z=u){const U=p.current??m;if(U==null)return;const W=n.current.fields.get(U);if(!W)return;const X=Ox(J,z);n.current.fields.set(U,{...W,validityData:X})}function N(J,z){const U={value:M,state:{...vd,valid:!0},error:"",errors:[],initialValue:s.initialValue};GM(J,w),H(U,z),r(U)}const _=w.size>0?qM(w,e.current):S.current;if(D){if(d.valid!==!1||!_)return;const J=_.validity;if(!J.valueMissing){N(_,!1);return}for(const z of K0)if(z!=="valid"&&z!=="valueMissing"&&z!=="customError"&&J[z])return}function $(J){const z=K0.reduce((W,X)=>(W[X]=J.validity[X],W),{});let U=!1;for(const W of K0)if(W!=="valid"){if(W==="valueMissing"&&z[W])U=!0;else if(z[W])return z}return U&&!f.current&&(z.valid=!0,z.valueMissing=!1),z}b.clear();let F=null,G=[];const j=_?$(_):{...vd,valid:!0};let q;const V=g();if(_&&_.validationMessage&&!V)q=_.validationMessage,G=[_.validationMessage];else{const J=Array.from(n.current.fields.values()).reduce((U,W)=>(W.name&&(U[W.name]=W.getValue()),U),{}),z=i(M,J);if(typeof z=="object"&&z!==null&&"then"in z){if(F=await z,L!==C.current)return}else F=z;F!==null?(j.valid=!1,j.customError=!0,Array.isArray(F)?(G=F,_?.setCustomValidity(F.join(`
|
|
18
|
-
`))):F&&(G=[F],_?.setCustomValidity(F))):V&&(GM(_,w),j.customError=!1,_&&_.validationMessage?(q=_.validationMessage,G=[_.validationMessage]):(!_||_.validity.valid)&&!j.valid&&(j.valid=!0))}const te={value:M,state:j,error:q??(Array.isArray(F)?F[0]:F??""),errors:G,initialValue:s.initialValue};H(te),r(te)}),k=Re(M=>{b.clear();const D=g();D&&M!==""&&a?(C.current+=1,b.start(a,()=>{A(M)})):A(M,!D)}),P=E.useCallback((M,D={})=>ko(v(D),d.valid===!1&&!d.disabled&&!M?{"aria-invalid":!0}:zn),[v,d.disabled,d.valid]);return E.useMemo(()=>({getValidationProps:P,inputRef:S,registeredInputs:w,registerInput:R,getInputControl:T,commit:A,change:k}),[P,w,R,T,A,k])}function X9(t){const{commit:e,invalid:n,markedDirtyRef:r,name:i,setRegisteredFieldName:s,registeredFieldIdRef:a,setValidityData:u,validityData:f}=t,{formRef:d}=yu(),g=E.useRef(null),p=E.useRef(null),m=E.useRef(!1),v=Re(()=>{const A=p.current;if(A)return A.getValue?A.getValue():A.value});function b(A){return A.value===void 0?v():A.value}const S=Re(()=>{const A=p.current;if(r.current=!0,!A){e(f.value);return}e(b(A))});function w(){const A=p.current;!A||!A.id||d.current.fields.set(A.id,{getValue:v,name:i??A.name,controlRef:A.controlRef,validityData:Ox(f,n),validate:S})}function C(A=p.current?.id){A&&d.current.fields.delete(A)}function R(A){if(m.current)return;m.current=!0;const k=b(A);u(P=>P.initialValue===k?P:{...P,initialValue:k})}Me(()=>{const A=p.current;!A||!A.id||(s(i?void 0:A.name),d.current.fields.set(A.id,{getValue:v,name:i??A.name,controlRef:A.controlRef,validityData:Ox(f,n),validate:S}))},[d,v,n,i,s,S,f]),Me(()=>{const A=d.current.fields;return()=>{const k=p.current?.id;k&&A.delete(k)}},[d]);const T=Re((A,k)=>{if(!k){g.current===A&&(g.current=null,C(),p.current=null,s(void 0),a.current=void 0);return}const P=p.current?.id;g.current=A,p.current=k,i||s(k.name),a.current=k.id,P&&P!==k.id&&C(P),R(k),w()});return[S,T]}const Q9=E.forwardRef(function(e,n){const{errors:r,validationMode:i,submitAttemptedRef:s}=yu(),{render:a,className:u,validate:f,validationDebounceTime:d=0,validationMode:g=i,name:p,disabled:m=!1,invalid:v,dirty:b,touched:S,actionsRef:w,style:C,...R}=e,T=G9(!0)?.disabled,A=Re(f||(()=>null)),k=T||m,[P,M]=E.useState(!1),[D,L]=E.useState(!1),[H,N]=E.useState(!1),[_,$]=E.useState(!1),F=b??D,G=S??P,j=E.useRef(F),q=E.useRef(void 0),[V,te]=E.useState(),J=p??V;Me(()=>{b!==void 0&&(j.current=b)},[b]);const z=Re(Pe=>{b===void 0&&(Pe&&(j.current=!0),L(Pe))}),U=Re(Pe=>{S===void 0&&M(Pe)}),W=Re(()=>g==="onChange"||g==="onSubmit"&&s.current),X=J&&Object.hasOwn(r,J)?r[J]:null,ie=!!(Array.isArray(X)?X.length:X),ee=v===!0||ie,[ue,Y]=E.useState({state:vd,error:"",errors:[],value:null,initialValue:null}),le=!ee&&(k?null:ue.state.valid),xe=E.useMemo(()=>({disabled:k,touched:G,dirty:F,valid:le,filled:H,focused:_}),[k,G,F,le,H,_]),ve=Y9({setValidityData:Y,validate:A,validityData:ue,validationDebounceTime:d,invalid:ee,markedDirtyRef:j,state:xe,shouldValidateOnChange:W,registeredFieldIdRef:q}),[de,me]=X9({commit:ve.commit,invalid:ee,markedDirtyRef:j,name:p,setRegisteredFieldName:te,registeredFieldIdRef:q,setValidityData:Y,validityData:ue});E.useImperativeHandle(w,()=>({validate:de}),[de]);const Ce=E.useMemo(()=>({invalid:ee,name:J,validityData:ue,setValidityData:Y,disabled:k,setTouched:U,setDirty:z,setFilled:N,setFocused:$,validationMode:g,shouldValidateOnChange:W,state:xe,registerFieldControl:me,validation:ve}),[ee,J,ue,k,U,z,N,$,g,W,xe,me,ve]),De=kt("div",e,{ref:n,state:xe,props:R,stateAttributesMapping:mu});return O.jsx(Mw.Provider,{value:Ce,children:De})}),Z9=E.forwardRef(function(e,n){return O.jsx(W9,{children:O.jsx(Q9,{...e,ref:n})})}),J9=E.createContext({disabled:!1});function xz(){return E.useContext(J9)}const e2=E.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,nativeLabel:u=!0,...f}=e,d=Ho(!1),g=xz(),{labelId:p}=vs(),m={...d.state,disabled:d.disabled||g.disabled},v=E.useRef(null),b=b$({id:p??a,native:u});return kt("label",e,{ref:[n,v],state:m,props:[b,f],stateAttributesMapping:mu})}),t2={...mu,...al},n2=E.forwardRef(function(e,n){const{render:r,id:i,className:s,match:a,style:u,...f}=e,d=ho(i),{validityData:g,state:p,name:m}=Ho(!1),{setMessageIds:v}=vs(),{errors:b}=yu(),S=m&&Object.hasOwn(b,m)?b[m]:null,w=!!(Array.isArray(S)?S.length:S),C=typeof a=="string";let R=!1;a===!0?R=!0:p.disabled?R=!1:C?R=!!g.state[a]:R=w||g.state.valid===!1;const{mounted:T,transitionStatus:A,setMounted:k}=ga(R);Me(()=>{if(!(!R||!d))return v(j=>j.concat(d)),()=>{v(j=>j.filter(q=>q!==d))}},[R,d,v]);const P=E.useRef(null),[M,D]=E.useState(null),[L,H]=E.useState(null);let N=g.error;!C&&w?N=S:g.errors.length>1&&(N=g.errors);let _=N;Array.isArray(N)&&(_=N.length>1?O.jsx("ul",{children:N.map(j=>O.jsx("li",{children:j},j))}):N[0]);const $=Array.isArray(N)?JSON.stringify(N):N;R&&$!==L&&(H($),D(_)),fo({open:R,ref:P,onComplete(){R||k(!1)}});const F={...p,transitionStatus:A},G=kt("div",e,{ref:[n,P],state:F,props:[{id:d,children:R?_:M},f],stateAttributesMapping:t2,enabled:T});return T?G:null}),r2=E.forwardRef(function(e,n){const{render:r,id:i,className:s,style:a,...u}=e,f=ho(i),d=Ho(!1),g=xz(),{setMessageIds:p}=vs(),m={...d.state,disabled:d.disabled||g.disabled};return Me(()=>{if(f)return p(b=>b.concat(f)),()=>{p(b=>b.filter(S=>S!==f))}},[f,p]),kt("p",e,{ref:n,state:m,props:[{id:f},u],stateAttributesMapping:mu})}),i2=E.forwardRef(function(e,n){const{render:r,className:i,id:s,name:a,value:u,disabled:f=!1,onValueChange:d,defaultValue:g,autoFocus:p=!1,style:m,...v}=e,{state:b,name:S,disabled:w,setTouched:C,setDirty:R,validityData:T,setFocused:A,setFilled:k,validationMode:P,validation:M}=Ho(),{clearErrors:D}=yu(),L=w||f,H=S??a,N={...b,disabled:L},{labelId:_}=vs(),$=Om({id:s});Me(()=>{const J=u!=null;M.inputRef.current?.value||J&&u!==""?k(!0):J&&u===""&&k(!1)},[M.inputRef,k,u]);const F=E.useRef(null);Me(()=>{p&&F.current===Gr(Vt(F.current))&&A(!0)},[p,A]);const[G]=Ja({controlled:u,default:g,name:"FieldControl",state:"value"}),j=u!==void 0,q=j?G:void 0,V=Re(()=>M.inputRef.current?.value);return Ow(M.inputRef,$,q,V,!L,a),kt("input",e,{ref:[n,F],state:N,props:[{id:$,disabled:L,name:H,ref:M.inputRef,"aria-labelledby":_,autoFocus:p,...j?{value:q}:{defaultValue:g},onChange(J){const z=J.currentTarget.value;d?.(z,Xe(yr,J.nativeEvent)),R(z!==(T.initialValue??"")),k(z!==""),J.nativeEvent.defaultPrevented||(D(H),M.change(z))},onFocus(){A(!0)},onBlur(J){C(!0),A(!1),P==="onBlur"&&M.commit(J.currentTarget.value)},onKeyDown(J){J.currentTarget.tagName==="INPUT"&&J.key==="Enter"&&(C(!0),M.commit(J.currentTarget.value))}},v,J=>M.getValidationProps(L,J)],stateAttributesMapping:mu})}),o2=E.forwardRef(function(e,n){const{className:r,render:i,orientation:s="horizontal",style:a,...u}=e;return kt("div",e,{state:{orientation:s},ref:n,props:[{role:"separator","aria-orientation":s},u]})}),s2=E.forwardRef(function(e,n){const{disabled:r=!1,loopFocus:i,orientation:s="horizontal",className:a,render:u,style:f,...d}=e,[g,p]=E.useState(()=>new Map),m=E.useMemo(()=>{const w=[];for(const C of g.values())C.disabled&&!C.focusableWhenDisabled&&w.push(C.index);return w},[g]),v=E.useMemo(()=>({disabled:r,orientation:s}),[r,s]),b={disabled:r,orientation:s},S={"aria-orientation":s,role:"toolbar"};return O.jsx(jP.Provider,{value:v,children:O.jsx(bz,{render:u,className:a,style:f,state:b,refs:[n],props:[S,d],disabledIndices:m,loopFocus:i,onMapChange:p,orientation:s})})}),Sz=E.createContext(void 0);function l2(){return E.useContext(Sz)}const a2=E.forwardRef(function(e,n){const{className:r,disabled:i=!1,render:s,style:a,...u}=e,{orientation:f,disabled:d}=Nw(),g=d||i,p=E.useMemo(()=>({disabled:g}),[g]),v=kt("div",e,{state:{disabled:g,orientation:f},ref:n,props:[{role:"group"},u]});return O.jsx(Sz.Provider,{value:p,children:v})});function u2(t){const{render:e,className:n,style:r,state:i=zn,props:s=Pi,refs:a=Pi,metadata:u,stateAttributesMapping:f,tag:d="div",...g}=t,{compositeProps:p,compositeRef:m}=yz({metadata:u});return kt(d,t,{state:i,ref:[m,...a],props:[p,...s,g],stateAttributesMapping:f})}const c2=E.forwardRef(function(e,n){const{className:r,disabled:i=!1,focusableWhenDisabled:s=!0,render:a,nativeButton:u,style:f,...d}=e,{disabled:g,orientation:p}=Nw(),m=l2(),v=g||(m?.disabled??!1)||i,b=E.useMemo(()=>({disabled:v,focusableWhenDisabled:s}),[v,s]),{getButtonProps:S,buttonRef:w}=ul({disabled:v,focusableWhenDisabled:s,native:u}),C={disabled:v,orientation:p,focusable:s};return O.jsx(u2,{tag:"button",render:a,className:r,style:f,metadata:b,state:C,refs:[n,w],props:[d,a?{disabled:v}:zn,S]})}),WM=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,KM=MI,wz=(t,e)=>n=>{var r;if(e?.variants==null)return KM(t,n?.class,n?.className);const{variants:i,defaultVariants:s}=e,a=Object.keys(i).map(d=>{const g=n?.[d],p=s?.[d];if(g===null)return null;const m=WM(g)||WM(p);return i[d][m]}),u=n&&Object.entries(n).reduce((d,g)=>{let[p,m]=g;return m===void 0||(d[p]=m),d},{}),f=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,g)=>{let{class:p,className:m,...v}=g;return Object.entries(v).every(b=>{let[S,w]=b;return Array.isArray(w)?w.includes({...s,...u}[S]):{...s,...u}[S]===w})?[...d,p,m]:d},[]);return KM(t,a,f,n?.class,n?.className)};function Xl(t,e){return typeof t=="function"?t(e):t}function Ni(t,e){return n=>{e.setState(r=>({...r,[t]:Xl(n,r[t])}))}}function Hm(t){return t instanceof Function}function f2(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function d2(t,e){const n=[],r=i=>{i.forEach(s=>{n.push(s);const a=e(s);a!=null&&a.length&&r(a)})};return r(t),n}function gt(t,e,n){let r=[],i;return s=>{let a;n.key&&n.debug&&(a=Date.now());const u=t(s);if(!(u.length!==r.length||u.some((g,p)=>r[p]!==g)))return i;r=u;let d;if(n.key&&n.debug&&(d=Date.now()),i=e(...u),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const g=Math.round((Date.now()-a)*100)/100,p=Math.round((Date.now()-d)*100)/100,m=p/16,v=(b,S)=>{for(b=String(b);b.length<S;)b=" "+b;return b};console.info(`%c⏱ ${v(p,5)} /${v(g,5)} ms`,`
|
|
19
|
-
font-size: .6rem;
|
|
20
|
-
font-weight: bold;
|
|
21
|
-
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n?.key)}return i}}function pt(t,e,n,r){return{debug:()=>{var i;return(i=t?.debugAll)!=null?i:t[e]},key:!1,onChange:r}}function h2(t,e,n,r){const i=()=>{var a;return(a=s.getValue())!=null?a:t.options.renderFallbackValue},s={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(r),renderValue:i,getContext:gt(()=>[t,n,e,s],(a,u,f,d)=>({table:a,column:u,row:f,cell:d,getValue:d.getValue,renderValue:d.renderValue}),pt(t.options,"debugCells"))};return t._features.forEach(a=>{a.createCell==null||a.createCell(s,n,e,t)},{}),s}function g2(t,e,n,r){var i,s;const u={...t._getDefaultColumnDef(),...e},f=u.accessorKey;let d=(i=(s=u.id)!=null?s:f?typeof String.prototype.replaceAll=="function"?f.replaceAll(".","_"):f.replace(/\./g,"_"):void 0)!=null?i:typeof u.header=="string"?u.header:void 0,g;if(u.accessorFn?g=u.accessorFn:f&&(f.includes(".")?g=m=>{let v=m;for(const S of f.split(".")){var b;v=(b=v)==null?void 0:b[S]}return v}:g=m=>m[u.accessorKey]),!d)throw new Error;let p={id:`${String(d)}`,accessorFn:g,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:gt(()=>[!0],()=>{var m;return[p,...(m=p.columns)==null?void 0:m.flatMap(v=>v.getFlatColumns())]},pt(t.options,"debugColumns")),getLeafColumns:gt(()=>[t._getOrderColumnsFn()],m=>{var v;if((v=p.columns)!=null&&v.length){let b=p.columns.flatMap(S=>S.getLeafColumns());return m(b)}return[p]},pt(t.options,"debugColumns"))};for(const m of t._features)m.createColumn==null||m.createColumn(p,t);return p}const $r="debugHeaders";function YM(t,e,n){var r;let s={id:(r=n.id)!=null?r:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],u=f=>{f.subHeaders&&f.subHeaders.length&&f.subHeaders.map(u),a.push(f)};return u(s),a},getContext:()=>({table:t,header:s,column:e})};return t._features.forEach(a=>{a.createHeader==null||a.createHeader(s,t)}),s}const p2={createTable:t=>{t.getHeaderGroups=gt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,i)=>{var s,a;const u=(s=r?.map(p=>n.find(m=>m.id===p)).filter(Boolean))!=null?s:[],f=(a=i?.map(p=>n.find(m=>m.id===p)).filter(Boolean))!=null?a:[],d=n.filter(p=>!(r!=null&&r.includes(p.id))&&!(i!=null&&i.includes(p.id)));return Pg(e,[...u,...d,...f],t)},pt(t.options,$r)),t.getCenterHeaderGroups=gt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,i)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(i!=null&&i.includes(s.id))),Pg(e,n,t,"center")),pt(t.options,$r)),t.getLeftHeaderGroups=gt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,r)=>{var i;const s=(i=r?.map(a=>n.find(u=>u.id===a)).filter(Boolean))!=null?i:[];return Pg(e,s,t,"left")},pt(t.options,$r)),t.getRightHeaderGroups=gt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,r)=>{var i;const s=(i=r?.map(a=>n.find(u=>u.id===a)).filter(Boolean))!=null?i:[];return Pg(e,s,t,"right")},pt(t.options,$r)),t.getFooterGroups=gt(()=>[t.getHeaderGroups()],e=>[...e].reverse(),pt(t.options,$r)),t.getLeftFooterGroups=gt(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),pt(t.options,$r)),t.getCenterFooterGroups=gt(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),pt(t.options,$r)),t.getRightFooterGroups=gt(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),pt(t.options,$r)),t.getFlatHeaders=gt(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),pt(t.options,$r)),t.getLeftFlatHeaders=gt(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),pt(t.options,$r)),t.getCenterFlatHeaders=gt(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),pt(t.options,$r)),t.getRightFlatHeaders=gt(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),pt(t.options,$r)),t.getCenterLeafHeaders=gt(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),pt(t.options,$r)),t.getLeftLeafHeaders=gt(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),pt(t.options,$r)),t.getRightLeafHeaders=gt(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),pt(t.options,$r)),t.getLeafHeaders=gt(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,r)=>{var i,s,a,u,f,d;return[...(i=(s=e[0])==null?void 0:s.headers)!=null?i:[],...(a=(u=n[0])==null?void 0:u.headers)!=null?a:[],...(f=(d=r[0])==null?void 0:d.headers)!=null?f:[]].map(g=>g.getLeafHeaders()).flat()},pt(t.options,$r))}};function Pg(t,e,n,r){var i,s;let a=0;const u=function(m,v){v===void 0&&(v=1),a=Math.max(a,v),m.filter(b=>b.getIsVisible()).forEach(b=>{var S;(S=b.columns)!=null&&S.length&&u(b.columns,v+1)},0)};u(t);let f=[];const d=(m,v)=>{const b={depth:v,id:[r,`${v}`].filter(Boolean).join("_"),headers:[]},S=[];m.forEach(w=>{const C=[...S].reverse()[0],R=w.column.depth===b.depth;let T,A=!1;if(R&&w.column.parent?T=w.column.parent:(T=w.column,A=!0),C&&C?.column===T)C.subHeaders.push(w);else{const k=YM(n,T,{id:[r,v,T.id,w?.id].filter(Boolean).join("_"),isPlaceholder:A,placeholderId:A?`${S.filter(P=>P.column===T).length}`:void 0,depth:v,index:S.length});k.subHeaders.push(w),S.push(k)}b.headers.push(w),w.headerGroup=b}),f.push(b),v>0&&d(S,v-1)},g=e.map((m,v)=>YM(n,m,{depth:a,index:v}));d(g,a-1),f.reverse();const p=m=>m.filter(b=>b.column.getIsVisible()).map(b=>{let S=0,w=0,C=[0];b.subHeaders&&b.subHeaders.length?(C=[],p(b.subHeaders).forEach(T=>{let{colSpan:A,rowSpan:k}=T;S+=A,C.push(k)})):S=1;const R=Math.min(...C);return w=w+R,b.colSpan=S,b.rowSpan=w,{colSpan:S,rowSpan:w}});return p((i=(s=f[0])==null?void 0:s.headers)!=null?i:[]),f}const m2=(t,e,n,r,i,s,a)=>{let u={id:e,index:r,original:n,depth:i,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:f=>{if(u._valuesCache.hasOwnProperty(f))return u._valuesCache[f];const d=t.getColumn(f);if(d!=null&&d.accessorFn)return u._valuesCache[f]=d.accessorFn(u.original,r),u._valuesCache[f]},getUniqueValues:f=>{if(u._uniqueValuesCache.hasOwnProperty(f))return u._uniqueValuesCache[f];const d=t.getColumn(f);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(u._uniqueValuesCache[f]=d.columnDef.getUniqueValues(u.original,r),u._uniqueValuesCache[f]):(u._uniqueValuesCache[f]=[u.getValue(f)],u._uniqueValuesCache[f])},renderValue:f=>{var d;return(d=u.getValue(f))!=null?d:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>d2(u.subRows,f=>f.subRows),getParentRow:()=>u.parentId?t.getRow(u.parentId,!0):void 0,getParentRows:()=>{let f=[],d=u;for(;;){const g=d.getParentRow();if(!g)break;f.push(g),d=g}return f.reverse()},getAllCells:gt(()=>[t.getAllLeafColumns()],f=>f.map(d=>h2(t,u,d,d.id)),pt(t.options,"debugRows")),_getAllCellsByColumnId:gt(()=>[u.getAllCells()],f=>f.reduce((d,g)=>(d[g.column.id]=g,d),{}),pt(t.options,"debugRows"))};for(let f=0;f<t._features.length;f++){const d=t._features[f];d==null||d.createRow==null||d.createRow(u,t)}return u},y2={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},Cz=(t,e,n)=>{var r,i;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=t.getValue(e))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(s))};Cz.autoRemove=t=>Io(t);const Rz=(t,e,n)=>{var r;return!!(!((r=t.getValue(e))==null||(r=r.toString())==null)&&r.includes(n))};Rz.autoRemove=t=>Io(t);const Ez=(t,e,n)=>{var r;return((r=t.getValue(e))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};Ez.autoRemove=t=>Io(t);const Tz=(t,e,n)=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(n)};Tz.autoRemove=t=>Io(t);const Az=(t,e,n)=>!n.some(r=>{var i;return!((i=t.getValue(e))!=null&&i.includes(r))});Az.autoRemove=t=>Io(t)||!(t!=null&&t.length);const Mz=(t,e,n)=>n.some(r=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(r)});Mz.autoRemove=t=>Io(t)||!(t!=null&&t.length);const Oz=(t,e,n)=>t.getValue(e)===n;Oz.autoRemove=t=>Io(t);const kz=(t,e,n)=>t.getValue(e)==n;kz.autoRemove=t=>Io(t);const Vw=(t,e,n)=>{let[r,i]=n;const s=t.getValue(e);return s>=r&&s<=i};Vw.resolveFilterValue=t=>{let[e,n]=t,r=typeof e!="number"?parseFloat(e):e,i=typeof n!="number"?parseFloat(n):n,s=e===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(i)?1/0:i;if(s>a){const u=s;s=a,a=u}return[s,a]};Vw.autoRemove=t=>Io(t)||Io(t[0])&&Io(t[1]);const Gs={includesString:Cz,includesStringSensitive:Rz,equalsString:Ez,arrIncludes:Tz,arrIncludesAll:Az,arrIncludesSome:Mz,equals:Oz,weakEquals:kz,inNumberRange:Vw};function Io(t){return t==null||t===""}const v2={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Ni("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n?.getValue(t.id);return typeof r=="string"?Gs.includesString:typeof r=="number"?Gs.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Gs.equals:Array.isArray(r)?Gs.arrIncludes:Gs.weakEquals},t.getFilterFn=()=>{var n,r;return Hm(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[t.columnDef.filterFn])!=null?n:Gs[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,r,i;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((r=e.options.enableColumnFilters)!=null?r:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(r=>r.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,r;return(n=(r=e.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(r=>{const i=t.getFilterFn(),s=r?.find(g=>g.id===t.id),a=Xl(n,s?s.value:void 0);if(XM(i,a,t)){var u;return(u=r?.filter(g=>g.id!==t.id))!=null?u:[]}const f={id:t.id,value:a};if(s){var d;return(d=r?.map(g=>g.id===t.id?f:g))!=null?d:[]}return r!=null&&r.length?[...r,f]:[f]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),r=i=>{var s;return(s=Xl(e,i))==null?void 0:s.filter(a=>{const u=n.find(f=>f.id===a.id);if(u){const f=u.getFilterFn();if(XM(f,a.value,u))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(r)},t.resetColumnFilters=e=>{var n,r;t.setColumnFilters(e?[]:(n=(r=t.initialState)==null?void 0:r.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function XM(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const b2=(t,e,n)=>n.reduce((r,i)=>{const s=i.getValue(t);return r+(typeof s=="number"?s:0)},0),x2=(t,e,n)=>{let r;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},S2=(t,e,n)=>{let r;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},w2=(t,e,n)=>{let r,i;return n.forEach(s=>{const a=s.getValue(t);a!=null&&(r===void 0?a>=a&&(r=i=a):(r>a&&(r=a),i<a&&(i=a)))}),[r,i]},C2=(t,e)=>{let n=0,r=0;if(e.forEach(i=>{let s=i.getValue(t);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},R2=(t,e)=>{if(!e.length)return;const n=e.map(s=>s.getValue(t));if(!f2(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((s,a)=>s-a);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},E2=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),T2=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,A2=(t,e)=>e.length,Y0={sum:b2,min:x2,max:S2,extent:w2,mean:C2,median:R2,unique:E2,uniqueCount:T2,count:A2},M2={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:Ni("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(r=>r!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,r;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((r=e.options.enableGrouping)!=null?r:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n?.getValue(t.id);if(typeof r=="number")return Y0.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Y0.extent},t.getAggregationFn=()=>{var n,r;if(!t)throw new Error;return Hm(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(r=e.options.aggregationFns)==null?void 0:r[t.columnDef.aggregationFn])!=null?n:Y0[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,r;t.setGrouping(e?[]:(n=(r=t.initialState)==null?void 0:r.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const r=e.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(t._groupingValuesCache[n]=r.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,r)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var i;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function O2(t,e,n){if(!(e!=null&&e.length)||!n)return t;const r=t.filter(s=>!e.includes(s.id));return n==="remove"?r:[...e.map(s=>t.find(a=>a.id===s)).filter(Boolean),...r]}const k2={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Ni("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=gt(n=>[Qf(e,n)],n=>n.findIndex(r=>r.id===t.id),pt(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var r;return((r=Qf(e,n)[0])==null?void 0:r.id)===t.id},t.getIsLastColumn=n=>{var r;const i=Qf(e,n);return((r=i[i.length-1])==null?void 0:r.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=gt(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,r)=>i=>{let s=[];if(!(e!=null&&e.length))s=i;else{const a=[...e],u=[...i];for(;u.length&&a.length;){const f=a.shift(),d=u.findIndex(g=>g.id===f);d>-1&&s.push(u.splice(d,1)[0])}s=[...s,...u]}return O2(s,n,r)},pt(t.options,"debugTable"))}},X0=()=>({left:[],right:[]}),I2={getInitialState:t=>({columnPinning:X0(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Ni("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const r=t.getLeafColumns().map(i=>i.id).filter(Boolean);e.setColumnPinning(i=>{var s,a;if(n==="right"){var u,f;return{left:((u=i?.left)!=null?u:[]).filter(p=>!(r!=null&&r.includes(p))),right:[...((f=i?.right)!=null?f:[]).filter(p=>!(r!=null&&r.includes(p))),...r]}}if(n==="left"){var d,g;return{left:[...((d=i?.left)!=null?d:[]).filter(p=>!(r!=null&&r.includes(p))),...r],right:((g=i?.right)!=null?g:[]).filter(p=>!(r!=null&&r.includes(p)))}}return{left:((s=i?.left)!=null?s:[]).filter(p=>!(r!=null&&r.includes(p))),right:((a=i?.right)!=null?a:[]).filter(p=>!(r!=null&&r.includes(p)))}})},t.getCanPin=()=>t.getLeafColumns().some(r=>{var i,s,a;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((s=(a=e.options.enableColumnPinning)!=null?a:e.options.enablePinning)!=null?s:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(u=>u.id),{left:r,right:i}=e.getState().columnPinning,s=n.some(u=>r?.includes(u)),a=n.some(u=>i?.includes(u));return s?"left":a?"right":!1},t.getPinnedIndex=()=>{var n,r;const i=t.getIsPinned();return i?(n=(r=e.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=gt(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i)=>{const s=[...r??[],...i??[]];return n.filter(a=>!s.includes(a.column.id))},pt(e.options,"debugRows")),t.getLeftVisibleCells=gt(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(a=>a.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),pt(e.options,"debugRows")),t.getRightVisibleCells=gt(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(a=>a.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),pt(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,r;return t.setColumnPinning(e?X0():(n=(r=t.initialState)==null?void 0:r.columnPinning)!=null?n:X0())},t.getIsSomeColumnsPinned=e=>{var n;const r=t.getState().columnPinning;if(!e){var i,s;return!!((i=r.left)!=null&&i.length||(s=r.right)!=null&&s.length)}return!!((n=r[e])!=null&&n.length)},t.getLeftLeafColumns=gt(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(r=>e.find(i=>i.id===r)).filter(Boolean),pt(t.options,"debugColumns")),t.getRightLeafColumns=gt(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(r=>e.find(i=>i.id===r)).filter(Boolean),pt(t.options,"debugColumns")),t.getCenterLeafColumns=gt(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r)=>{const i=[...n??[],...r??[]];return e.filter(s=>!i.includes(s.id))},pt(t.options,"debugColumns"))}};function D2(t){return t||(typeof document<"u"?document:null)}const zg={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Q0=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),P2={getDefaultColumnDef:()=>zg,getInitialState:t=>({columnSizing:{},columnSizingInfo:Q0(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ni("columnSizing",t),onColumnSizingInfoChange:Ni("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,r,i;const s=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:zg.minSize,(r=s??t.columnDef.size)!=null?r:zg.size),(i=t.columnDef.maxSize)!=null?i:zg.maxSize)},t.getStart=gt(n=>[n,Qf(e,n),e.getState().columnSizing],(n,r)=>r.slice(0,t.getIndex(n)).reduce((i,s)=>i+s.getSize(),0),pt(e.options,"debugColumns")),t.getAfter=gt(n=>[n,Qf(e,n),e.getState().columnSizing],(n,r)=>r.slice(t.getIndex(n)+1).reduce((i,s)=>i+s.getSize(),0),pt(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:r,...i}=n;return i})},t.getCanResize=()=>{var n,r;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((r=e.options.enableColumnResizing)!=null?r:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var s;n+=(s=i.column.getSize())!=null?s:0}};return r(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const r=e.getColumn(t.column.id),i=r?.getCanResize();return s=>{if(!r||!i||(s.persist==null||s.persist(),Z0(s)&&s.touches&&s.touches.length>1))return;const a=t.getSize(),u=t?t.getLeafHeaders().map(C=>[C.column.id,C.column.getSize()]):[[r.id,r.getSize()]],f=Z0(s)?Math.round(s.touches[0].clientX):s.clientX,d={},g=(C,R)=>{typeof R=="number"&&(e.setColumnSizingInfo(T=>{var A,k;const P=e.options.columnResizeDirection==="rtl"?-1:1,M=(R-((A=T?.startOffset)!=null?A:0))*P,D=Math.max(M/((k=T?.startSize)!=null?k:0),-.999999);return T.columnSizingStart.forEach(L=>{let[H,N]=L;d[H]=Math.round(Math.max(N+N*D,0)*100)/100}),{...T,deltaOffset:M,deltaPercentage:D}}),(e.options.columnResizeMode==="onChange"||C==="end")&&e.setColumnSizing(T=>({...T,...d})))},p=C=>g("move",C),m=C=>{g("end",C),e.setColumnSizingInfo(R=>({...R,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},v=D2(n),b={moveHandler:C=>p(C.clientX),upHandler:C=>{v?.removeEventListener("mousemove",b.moveHandler),v?.removeEventListener("mouseup",b.upHandler),m(C.clientX)}},S={moveHandler:C=>(C.cancelable&&(C.preventDefault(),C.stopPropagation()),p(C.touches[0].clientX),!1),upHandler:C=>{var R;v?.removeEventListener("touchmove",S.moveHandler),v?.removeEventListener("touchend",S.upHandler),C.cancelable&&(C.preventDefault(),C.stopPropagation()),m((R=C.touches[0])==null?void 0:R.clientX)}},w=z2()?{passive:!1}:!1;Z0(s)?(v?.addEventListener("touchmove",S.moveHandler,w),v?.addEventListener("touchend",S.upHandler,w)):(v?.addEventListener("mousemove",b.moveHandler,w),v?.addEventListener("mouseup",b.upHandler,w)),e.setColumnSizingInfo(C=>({...C,startOffset:f,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:r.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?Q0():(n=t.initialState.columnSizingInfo)!=null?n:Q0())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0}}};let Ng=null;function z2(){if(typeof Ng=="boolean")return Ng;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return Ng=t,Ng}function Z0(t){return t.type==="touchstart"}const N2={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Ni("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(r=>({...r,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,r;const i=t.columns;return(n=i.length?i.some(s=>s.getIsVisible()):(r=e.getState().columnVisibility)==null?void 0:r[t.id])!=null?n:!0},t.getCanHide=()=>{var n,r;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((r=e.options.enableHiding)!=null?r:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=gt(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),pt(e.options,"debugRows")),t.getVisibleCells=gt(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],pt(e.options,"debugRows"))},createTable:t=>{const e=(n,r)=>gt(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),pt(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var r;t.setColumnVisibility(n?{}:(r=t.initialState.columnVisibility)!=null?r:{})},t.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((i,s)=>({...i,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;t.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Qf(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const L2={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},B2={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Ni("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const r=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,r,i,s;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=e.options.enableGlobalFilter)!=null?r:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&((s=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?s:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>Gs.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:r}=t.options;return Hm(r)?r:r==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[r])!=null?e:Gs[r]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},_2={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Ni("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var r,i;if(!e){t._queue(()=>{e=!0});return}if((r=(i=t.options.autoResetAll)!=null?i:t.options.autoResetExpanded)!=null?r:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=r=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(r),t.toggleAllRowsExpanded=r=>{r??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=r=>{var i,s;t.setExpanded(r?{}:(i=(s=t.initialState)==null?void 0:s.expanded)!=null?i:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const r=t.getState().expanded;return r===!0||Object.values(r).some(Boolean)},t.getIsAllRowsExpanded=()=>{const r=t.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||t.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},t.getExpandedDepth=()=>{let r=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(s=>{const a=s.split(".");r=Math.max(r,a.length)}),r},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(r=>{var i;const s=r===!0?!0:!!(r!=null&&r[t.id]);let a={};if(r===!0?Object.keys(e.getRowModel().rowsById).forEach(u=>{a[u]=!0}):a=r,n=(i=n)!=null?i:!s,!s&&n)return{...a,[t.id]:!0};if(s&&!n){const{[t.id]:u,...f}=a;return f}return r})},t.getIsExpanded=()=>{var n;const r=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:r===!0||r?.[t.id])},t.getCanExpand=()=>{var n,r,i;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((r=e.options.enableExpanding)!=null?r:!0)&&!!((i=t.subRows)!=null&&i.length)},t.getIsAllParentsExpanded=()=>{let n=!0,r=t;for(;n&&r.parentId;)r=e.getRow(r.parentId,!0),n=r.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},kx=0,Ix=10,J0=()=>({pageIndex:kx,pageSize:Ix}),H2={getInitialState:t=>({...t,pagination:{...J0(),...t?.pagination}}),getDefaultOptions:t=>({onPaginationChange:Ni("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var r,i;if(!e){t._queue(()=>{e=!0});return}if((r=(i=t.options.autoResetAll)!=null?i:t.options.autoResetPageIndex)!=null?r:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=r=>{const i=s=>Xl(r,s);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(i)},t.resetPagination=r=>{var i;t.setPagination(r?J0():(i=t.initialState.pagination)!=null?i:J0())},t.setPageIndex=r=>{t.setPagination(i=>{let s=Xl(r,i.pageIndex);const a=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return s=Math.max(0,Math.min(s,a)),{...i,pageIndex:s}})},t.resetPageIndex=r=>{var i,s;t.setPageIndex(r?kx:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?i:kx)},t.resetPageSize=r=>{var i,s;t.setPageSize(r?Ix:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?i:Ix)},t.setPageSize=r=>{t.setPagination(i=>{const s=Math.max(1,Xl(r,i.pageSize)),a=i.pageSize*i.pageIndex,u=Math.floor(a/s);return{...i,pageIndex:u,pageSize:s}})},t.setPageCount=r=>t.setPagination(i=>{var s;let a=Xl(r,(s=t.options.pageCount)!=null?s:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...i,pageCount:a}}),t.getPageOptions=gt(()=>[t.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((s,a)=>a)),i},pt(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:r}=t.getState().pagination,i=t.getPageCount();return i===-1?!0:i===0?!1:r<i-1},t.previousPage=()=>t.setPageIndex(r=>r-1),t.nextPage=()=>t.setPageIndex(r=>r+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var r;return(r=t.options.pageCount)!=null?r:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var r;return(r=t.options.rowCount)!=null?r:t.getPrePaginationRowModel().rows.length}}},eb=()=>({top:[],bottom:[]}),j2={getInitialState:t=>({rowPinning:eb(),...t}),getDefaultOptions:t=>({onRowPinningChange:Ni("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,r,i)=>{const s=r?t.getLeafRows().map(f=>{let{id:d}=f;return d}):[],a=i?t.getParentRows().map(f=>{let{id:d}=f;return d}):[],u=new Set([...a,t.id,...s]);e.setRowPinning(f=>{var d,g;if(n==="bottom"){var p,m;return{top:((p=f?.top)!=null?p:[]).filter(S=>!(u!=null&&u.has(S))),bottom:[...((m=f?.bottom)!=null?m:[]).filter(S=>!(u!=null&&u.has(S))),...Array.from(u)]}}if(n==="top"){var v,b;return{top:[...((v=f?.top)!=null?v:[]).filter(S=>!(u!=null&&u.has(S))),...Array.from(u)],bottom:((b=f?.bottom)!=null?b:[]).filter(S=>!(u!=null&&u.has(S)))}}return{top:((d=f?.top)!=null?d:[]).filter(S=>!(u!=null&&u.has(S))),bottom:((g=f?.bottom)!=null?g:[]).filter(S=>!(u!=null&&u.has(S)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=e.options;return typeof r=="function"?r(t):(n=r??i)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:r,bottom:i}=e.getState().rowPinning,s=n.some(u=>r?.includes(u)),a=n.some(u=>i?.includes(u));return s?"top":a?"bottom":!1},t.getPinnedIndex=()=>{var n,r;const i=t.getIsPinned();if(!i)return-1;const s=(n=i==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(a=>{let{id:u}=a;return u});return(r=s?.indexOf(t.id))!=null?r:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,r;return t.setRowPinning(e?eb():(n=(r=t.initialState)==null?void 0:r.rowPinning)!=null?n:eb())},t.getIsSomeRowsPinned=e=>{var n;const r=t.getState().rowPinning;if(!e){var i,s;return!!((i=r.top)!=null&&i.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[e])!=null&&n.length)},t._getPinnedRows=(e,n,r)=>{var i;return((i=t.options.keepPinnedRows)==null||i?(n??[]).map(a=>{const u=t.getRow(a,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(a=>e.find(u=>u.id===a))).filter(Boolean).map(a=>({...a,position:r}))},t.getTopRows=gt(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),pt(t.options,"debugRows")),t.getBottomRows=gt(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),pt(t.options,"debugRows")),t.getCenterRows=gt(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,r)=>{const i=new Set([...n??[],...r??[]]);return e.filter(s=>!i.has(s.id))},pt(t.options,"debugRows"))}},V2={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Ni("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const r={...n},i=t.getPreGroupedRowModel().flatRows;return e?i.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):i.forEach(s=>{delete r[s.id]}),r})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const r=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),i={...n};return t.getRowModel().rows.forEach(s=>{Dx(i,s.id,r,!0,t)}),i}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=gt(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?tb(t,n):{rows:[],flatRows:[],rowsById:{}},pt(t.options,"debugTable")),t.getFilteredSelectedRowModel=gt(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?tb(t,n):{rows:[],flatRows:[],rowsById:{}},pt(t.options,"debugTable")),t.getGroupedSelectedRowModel=gt(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?tb(t,n):{rows:[],flatRows:[],rowsById:{}},pt(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let r=!!(e.length&&Object.keys(n).length);return r&&e.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=t.getState();let r=!!e.length;return r&&e.some(i=>!n[i.id])&&(r=!1),r},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,r)=>{const i=t.getIsSelected();e.setRowSelection(s=>{var a;if(n=typeof n<"u"?n:!i,t.getCanSelect()&&i===n)return s;const u={...s};return Dx(u,t.id,n,(a=r?.selectChildren)!=null?a:!0,e),u})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return Fw(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return Px(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return Px(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return r=>{var i;n&&t.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},Dx=(t,e,n,r,i)=>{var s;const a=i.getRow(e,!0);n?(a.getCanMultiSelect()||Object.keys(t).forEach(u=>delete t[u]),a.getCanSelect()&&(t[e]=!0)):delete t[e],r&&(s=a.subRows)!=null&&s.length&&a.getCanSelectSubRows()&&a.subRows.forEach(u=>Dx(t,u.id,n,r,i))};function tb(t,e){const n=t.getState().rowSelection,r=[],i={},s=function(a,u){return a.map(f=>{var d;const g=Fw(f,n);if(g&&(r.push(f),i[f.id]=f),(d=f.subRows)!=null&&d.length&&(f={...f,subRows:s(f.subRows)}),g)return f}).filter(Boolean)};return{rows:s(e.rows),flatRows:r,rowsById:i}}function Fw(t,e){var n;return(n=e[t.id])!=null?n:!1}function Px(t,e,n){var r;if(!((r=t.subRows)!=null&&r.length))return!1;let i=!0,s=!1;return t.subRows.forEach(a=>{if(!(s&&!i)&&(a.getCanSelect()&&(Fw(a,e)?s=!0:i=!1),a.subRows&&a.subRows.length)){const u=Px(a,e);u==="all"?s=!0:(u==="some"&&(s=!0),i=!1)}}),i?"all":s?"some":!1}const zx=/([0-9]+)/gm,F2=(t,e,n)=>Iz(aa(t.getValue(n)).toLowerCase(),aa(e.getValue(n)).toLowerCase()),U2=(t,e,n)=>Iz(aa(t.getValue(n)),aa(e.getValue(n))),$2=(t,e,n)=>Uw(aa(t.getValue(n)).toLowerCase(),aa(e.getValue(n)).toLowerCase()),q2=(t,e,n)=>Uw(aa(t.getValue(n)),aa(e.getValue(n))),G2=(t,e,n)=>{const r=t.getValue(n),i=e.getValue(n);return r>i?1:r<i?-1:0},W2=(t,e,n)=>Uw(t.getValue(n),e.getValue(n));function Uw(t,e){return t===e?0:t>e?1:-1}function aa(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function Iz(t,e){const n=t.split(zx).filter(Boolean),r=e.split(zx).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),s=r.shift(),a=parseInt(i,10),u=parseInt(s,10),f=[a,u].sort();if(isNaN(f[0])){if(i>s)return 1;if(s>i)return-1;continue}if(isNaN(f[1]))return isNaN(a)?-1:1;if(a>u)return 1;if(u>a)return-1}return n.length-r.length}const Pf={alphanumeric:F2,alphanumericCaseSensitive:U2,text:$2,textCaseSensitive:q2,datetime:G2,basic:W2},K2={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Ni("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const s=i?.getValue(t.id);if(Object.prototype.toString.call(s)==="[object Date]")return Pf.datetime;if(typeof s=="string"&&(r=!0,s.split(zx).length>1))return Pf.alphanumeric}return r?Pf.text:Pf.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof n?.getValue(t.id)=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,r;if(!t)throw new Error;return Hm(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(r=e.options.sortingFns)==null?void 0:r[t.columnDef.sortingFn])!=null?n:Pf[t.columnDef.sortingFn]},t.toggleSorting=(n,r)=>{const i=t.getNextSortingOrder(),s=typeof n<"u"&&n!==null;e.setSorting(a=>{const u=a?.find(v=>v.id===t.id),f=a?.findIndex(v=>v.id===t.id);let d=[],g,p=s?n:i==="desc";if(a!=null&&a.length&&t.getCanMultiSort()&&r?u?g="toggle":g="add":a!=null&&a.length&&f!==a.length-1?g="replace":u?g="toggle":g="replace",g==="toggle"&&(s||i||(g="remove")),g==="add"){var m;d=[...a,{id:t.id,desc:p}],d.splice(0,d.length-((m=e.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else g==="toggle"?d=a.map(v=>v.id===t.id?{...v,desc:p}:v):g==="remove"?d=a.filter(v=>v.id!==t.id):d=[{id:t.id,desc:p}];return d})},t.getFirstSortDir=()=>{var n,r;return((n=(r=t.columnDef.sortDescFirst)!=null?r:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var r,i;const s=t.getFirstSortDir(),a=t.getIsSorted();return a?a!==s&&((r=e.options.enableSortingRemoval)==null||r)&&(!(n&&(i=e.options.enableMultiRemove)!=null)||i)?!1:a==="desc"?"asc":"desc":s},t.getCanSort=()=>{var n,r;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((r=e.options.enableSorting)!=null?r:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,r;return(n=(r=t.columnDef.enableMultiSort)!=null?r:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const r=(n=e.getState().sorting)==null?void 0:n.find(i=>i.id===t.id);return r?r.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,r;return(n=(r=e.getState().sorting)==null?void 0:r.findIndex(i=>i.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return r=>{n&&(r.persist==null||r.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(r):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,r;t.setSorting(e?[]:(n=(r=t.initialState)==null?void 0:r.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},Y2=[p2,N2,k2,I2,y2,v2,L2,B2,K2,M2,_2,H2,j2,V2,P2];function X2(t){var e,n;const r=[...Y2,...(e=t._features)!=null?e:[]];let i={_features:r};const s=i._features.reduce((m,v)=>Object.assign(m,v.getDefaultOptions==null?void 0:v.getDefaultOptions(i)),{}),a=m=>i.options.mergeOptions?i.options.mergeOptions(s,m):{...s,...m};let f={...{},...(n=t.initialState)!=null?n:{}};i._features.forEach(m=>{var v;f=(v=m.getInitialState==null?void 0:m.getInitialState(f))!=null?v:f});const d=[];let g=!1;const p={_features:r,options:{...s,...t},initialState:f,_queue:m=>{d.push(m),g||(g=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();g=!1}).catch(v=>setTimeout(()=>{throw v})))},reset:()=>{i.setState(i.initialState)},setOptions:m=>{const v=Xl(m,i.options);i.options=a(v)},getState:()=>i.options.state,setState:m=>{i.options.onStateChange==null||i.options.onStateChange(m)},_getRowId:(m,v,b)=>{var S;return(S=i.options.getRowId==null?void 0:i.options.getRowId(m,v,b))!=null?S:`${b?[b.id,v].join("."):v}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(m,v)=>{let b=(v?i.getPrePaginationRowModel():i.getRowModel()).rowsById[m];if(!b&&(b=i.getCoreRowModel().rowsById[m],!b))throw new Error;return b},_getDefaultColumnDef:gt(()=>[i.options.defaultColumn],m=>{var v;return m=(v=m)!=null?v:{},{header:b=>{const S=b.header.column.columnDef;return S.accessorKey?S.accessorKey:S.accessorFn?S.id:null},cell:b=>{var S,w;return(S=(w=b.renderValue())==null||w.toString==null?void 0:w.toString())!=null?S:null},...i._features.reduce((b,S)=>Object.assign(b,S.getDefaultColumnDef==null?void 0:S.getDefaultColumnDef()),{}),...m}},pt(t,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:gt(()=>[i._getColumnDefs()],m=>{const v=function(b,S,w){return w===void 0&&(w=0),b.map(C=>{const R=g2(i,C,w,S),T=C;return R.columns=T.columns?v(T.columns,R,w+1):[],R})};return v(m)},pt(t,"debugColumns")),getAllFlatColumns:gt(()=>[i.getAllColumns()],m=>m.flatMap(v=>v.getFlatColumns()),pt(t,"debugColumns")),_getAllFlatColumnsById:gt(()=>[i.getAllFlatColumns()],m=>m.reduce((v,b)=>(v[b.id]=b,v),{}),pt(t,"debugColumns")),getAllLeafColumns:gt(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(m,v)=>{let b=m.flatMap(S=>S.getLeafColumns());return v(b)},pt(t,"debugColumns")),getColumn:m=>i._getAllFlatColumnsById()[m]};Object.assign(i,p);for(let m=0;m<i._features.length;m++){const v=i._features[m];v==null||v.createTable==null||v.createTable(i)}return i}function Q2(){return t=>gt(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,s,a){s===void 0&&(s=0);const u=[];for(let d=0;d<i.length;d++){const g=m2(t,t._getRowId(i[d],d,a),i[d],d,s,void 0,a?.id);if(n.flatRows.push(g),n.rowsById[g.id]=g,u.push(g),t.options.getSubRows){var f;g.originalSubRows=t.options.getSubRows(i[d],d),(f=g.originalSubRows)!=null&&f.length&&(g.subRows=r(g.originalSubRows,s+1,g))}}return u};return n.rows=r(e),n},pt(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function Z2(){return t=>gt(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const r=t.getState().sorting,i=[],s=r.filter(f=>{var d;return(d=t.getColumn(f.id))==null?void 0:d.getCanSort()}),a={};s.forEach(f=>{const d=t.getColumn(f.id);d&&(a[f.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const u=f=>{const d=f.map(g=>({...g}));return d.sort((g,p)=>{for(let v=0;v<s.length;v+=1){var m;const b=s[v],S=a[b.id],w=S.sortUndefined,C=(m=b?.desc)!=null?m:!1;let R=0;if(w){const T=g.getValue(b.id),A=p.getValue(b.id),k=T===void 0,P=A===void 0;if(k||P){if(w==="first")return k?-1:1;if(w==="last")return k?1:-1;R=k&&P?0:k?w:-w}}if(R===0&&(R=S.sortingFn(g,p,b.id)),R!==0)return C&&(R*=-1),S.invertSorting&&(R*=-1),R}return g.index-p.index}),d.forEach(g=>{var p;i.push(g),(p=g.subRows)!=null&&p.length&&(g.subRows=u(g.subRows))}),d};return{rows:u(n.rows),flatRows:i,rowsById:n.rowsById}},pt(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}function nb(t,e){return t?J2(t)?E.createElement(t,e):t:null}function J2(t){return eG(t)||typeof t=="function"||tG(t)}function eG(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function tG(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function nG(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=E.useState(()=>({current:X2(e)})),[r,i]=E.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...t,state:{...r,...t.state},onStateChange:a=>{i(a),t.onStateChange==null||t.onStateChange(a)}})),n.current}const jm=0,pa=1,Nc=2,Dz=4;function QM(t){return()=>t}function rG(t){t()}function bd(t,e){return n=>t(e(n))}function ZM(t,e){return()=>t(e)}function iG(t,e){return n=>t(e,n)}function $w(t){return t!==void 0}function oG(...t){return()=>{t.map(rG)}}function Lc(){}function Vm(t,e){return e(t),t}function sG(t,e){return e(t)}function Nn(...t){return t}function ln(t,e){return t(pa,e)}function Rt(t,e){t(jm,e)}function qw(t){t(Nc)}function _n(t){return t(Dz)}function tt(t,e){return ln(t,iG(e,jm))}function Do(t,e){const n=t(pa,r=>{n(),e(r)});return n}function JM(t){let e,n;return r=>i=>{e=i,n&&clearTimeout(n),n=setTimeout(()=>{r(e)},t)}}function Pz(t,e){return t===e}function Dn(t=Pz){let e;return n=>r=>{t(e,r)||(e=r,n(r))}}function ft(t){return e=>n=>{t(n)&&e(n)}}function Fe(t){return e=>bd(e,t)}function os(t){return e=>()=>{e(t)}}function we(t,...e){const n=lG(...e);return((r,i)=>{switch(r){case Nc:qw(t);return;case pa:return ln(t,n(i))}})}function fs(t,e){return n=>r=>{n(e=t(e,r))}}function au(t){return e=>n=>{t>0?t--:e(n)}}function Ks(t){let e=null,n;return r=>i=>{e=i,!n&&(n=setTimeout(()=>{n=void 0,r(e)},t))}}function Mt(...t){const e=new Array(t.length);let n=0,r=null;const i=2**t.length-1;return t.forEach((s,a)=>{const u=2**a;ln(s,f=>{const d=n;n|=u,e[a]=f,d!==i&&n===i&&r&&(r(),r=null)})}),s=>a=>{const u=()=>{s([a].concat(e))};n===i?u():r=u}}function lG(...t){return e=>t.reduceRight(sG,e)}function aG(t){let e,n;const r=()=>e?.();return function(i,s){switch(i){case pa:return s?n===s?void 0:(r(),n=s,e=ln(t,s),e):(r(),Lc);case Nc:r(),n=null;return}}}function Ae(t){let e=t;const n=Ft();return((r,i)=>{switch(r){case jm:e=i;break;case pa:{i(e);break}case Dz:return e}return n(r,i)})}function Kr(t,e){return Vm(Ae(e),n=>tt(t,n))}function Ft(){const t=[];return((e,n)=>{switch(e){case jm:t.slice().forEach(r=>{r(n)});return;case Nc:t.splice(0,t.length);return;case pa:return t.push(n),()=>{const r=t.indexOf(n);r>-1&&t.splice(r,1)}}})}function zi(t){return Vm(Ft(),e=>tt(t,e))}function Xt(t,e=[],{singleton:n}={singleton:!0}){return{constructor:t,dependencies:e,id:uG(),singleton:n}}const uG=()=>Symbol();function cG(t){const e=new Map,n=({constructor:r,dependencies:i,id:s,singleton:a})=>{if(a&&e.has(s))return e.get(s);const u=r(i.map(f=>n(f)));return a&&e.set(s,u),u};return n(t)}function dr(...t){const e=Ft(),n=new Array(t.length);let r=0;const i=2**t.length-1;return t.forEach((s,a)=>{const u=2**a;ln(s,f=>{n[a]=f,r|=u,r===i&&Rt(e,n)})}),function(s,a){switch(s){case Nc:{qw(e);return}case pa:return r===i&&a(n),ln(e,a)}}}function ct(t,e=Pz){return we(t,Dn(e))}function Nx(...t){return function(e,n){switch(e){case Nc:return;case pa:return oG(...t.map(r=>ln(r,n)))}}}const br={DEBUG:0,INFO:1,WARN:2,ERROR:3},fG={[br.DEBUG]:"debug",[br.ERROR]:"error",[br.INFO]:"log",[br.WARN]:"warn"},dG=()=>typeof globalThis>"u"?window:globalThis,ma=Xt(()=>{const t=Ae(br.ERROR);return{log:Ae((e,n,r=br.INFO)=>{const i=dG().VIRTUOSO_LOG_LEVEL??_n(t);r>=i&&console[fG[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",e,n)}),logLevel:t}},[],{singleton:!0}),Lx=new WeakMap;function zz(t){return"self"in t?t.document.documentElement:t}function hG(t){const e=zz(t),n=Lx.get(e);if(n!==void 0)return n;const r=e.ownerDocument.defaultView.getComputedStyle(e).direction==="rtl";return Lx.set(e,r),r}function eO(t){Lx.delete(zz(t))}function Nz(t,e){return hG(t)?-e:e}const Ka=Nz;function tO(t,e){return Nz(t,e)}function ys(t,e,n){return Gw(t,e,n).callbackRef}function Gw(t,e,n){const r=Ne.useRef(null);let i=a=>{};const s=Ne.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(a=>{const u=()=>{const f=a[0].target;f.offsetParent!==null&&t(f)};n?u():requestAnimationFrame(u)}):null,[t,n]);return i=a=>{a&&e?(s?.observe(a),r.current=a):(r.current&&s?.unobserve(r.current),r.current=null)},{callbackRef:i,ref:r}}function Lz(t,e,n,r,i,s,a,u,f){const d=Ne.useCallback(g=>{const p=gG(g.children,e,u?"offsetWidth":"offsetHeight",i);let m=g.parentElement;for(;m.dataset.virtuosoScroller===void 0;)m=m.parentElement;const v=m.lastElementChild.dataset.viewportType==="window";let b;v&&(b=m.ownerDocument.defaultView);const S=a?u?a.scrollWidth:a.scrollHeight:v?u?b.document.documentElement.scrollWidth:b.document.documentElement.scrollHeight:u?m.scrollWidth:m.scrollHeight,w=a?u?a.offsetWidth:a.offsetHeight:v?u?b.innerWidth:b.innerHeight:u?m.offsetWidth:m.offsetHeight,C=a?u?Ka(a,a.scrollLeft):a.scrollTop:v?u?Ka(b,b.scrollX||b.document.documentElement.scrollLeft):b.scrollY||b.document.documentElement.scrollTop:u?Ka(m,m.scrollLeft):m.scrollTop;r({scrollHeight:S,scrollTop:Math.max(C,0),viewportHeight:w}),s?.(u?nO("column-gap",getComputedStyle(g).columnGap,i):nO("row-gap",getComputedStyle(g).rowGap,i)),p!==null&&t(p)},[t,e,i,s,a,r,u]);return Gw(d,n,f)}function gG(t,e,n,r){const i=t.length;if(i===0)return null;const s=[];for(let a=0;a<i;a++){const u=t.item(a);if(u.dataset.index===void 0)continue;const f=parseInt(u.dataset.index),d=parseFloat(u.dataset.knownSize),g=e(u,n);if(g===0&&r("Zero-sized element, this should not happen",{child:u},br.ERROR),g===d)continue;const p=s[s.length-1];s.length===0||p.size!==g||p.endIndex!==f-1?s.push({endIndex:f,size:g,startIndex:f}):s[s.length-1].endIndex++}return s}function nO(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,br.WARN),e==="normal"?0:parseInt(e??"0",10)}function Ww(t,e,n){const r=Ne.useRef(null),i=Ne.useCallback(f=>{if(!f?.offsetParent)return;const d=f.getBoundingClientRect(),g=d.width;let p,m;if(e){const v=e.getBoundingClientRect(),b=d.top-v.top;m=v.height-Math.max(0,b),p=b+e.scrollTop}else{const v=a.current.ownerDocument.defaultView;m=v.innerHeight-Math.max(0,d.top),p=d.top+v.scrollY}r.current={listHeight:d.height,offsetTop:p,visibleHeight:m,visibleWidth:g},t(r.current)},[t,e]),{callbackRef:s,ref:a}=Gw(i,!0,n),u=Ne.useCallback(()=>{i(a.current)},[i,a]);return Ne.useEffect(()=>{if(e){e.addEventListener("scroll",u);const d=new ResizeObserver(()=>{requestAnimationFrame(u)});return d.observe(e),()=>{e.removeEventListener("scroll",u),d.unobserve(e)}}const f=a.current?.ownerDocument.defaultView;return f?.addEventListener("scroll",u),f?.addEventListener("resize",u),()=>{f?.removeEventListener("scroll",u),f?.removeEventListener("resize",u)}},[u,e,a]),s}const si=Xt(()=>{const t=Ft(),e=Ft(),n=Ae(0),r=Ft(),i=Ae(0),s=Ft(),a=Ft(),u=Ae(0),f=Ae(0),d=Ae(0),g=Ae(0),p=Ft(),m=Ft(),v=Ae(!1),b=Ae(!1),S=Ae(!1);return tt(we(t,Fe(({scrollTop:w})=>w)),e),tt(we(t,Fe(({scrollHeight:w})=>w)),a),tt(e,i),{deviation:n,fixedFooterHeight:d,fixedHeaderHeight:f,footerHeight:g,headerHeight:u,horizontalDirection:b,scrollBy:m,scrollContainerState:t,scrollHeight:a,scrollingInProgress:v,scrollTo:p,scrollTop:e,skipAnimationFrameInResizeObserver:S,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:s}},[],{singleton:!0}),xd={lvl:0};function Bz(t,e){const n=t.length;if(n===0)return[];let{index:r,value:i}=e(t[0]);const s=[];for(let a=1;a<n;a++){const{index:u,value:f}=e(t[a]);s.push({end:u-1,start:r,value:i}),r=u,i=f}return s.push({end:1/0,start:r,value:i}),s}function vn(t){return t===xd}function Sd(t,e){if(!vn(t))return e===t.k?t.v:e<t.k?Sd(t.l,e):Sd(t.r,e)}function No(t,e,n="k"){if(vn(t))return[-1/0,void 0];if(Number(t[n])===e)return[t.k,t.v];if(Number(t[n])<e){const r=No(t.r,e,n);return r[0]===-1/0?[t.k,t.v]:r}return No(t.l,e,n)}function Ii(t,e,n){return vn(t)?jz(e,n,1):e===t.k?mr(t,{k:e,v:n}):e<t.k?rO(mr(t,{l:Ii(t.l,e,n)})):rO(mr(t,{r:Ii(t.r,e,n)}))}function uc(){return xd}function cc(t,e,n){if(vn(t))return[];const r=No(t,e)[0];return pG(_x(t,r,n))}function Bx(t,e){if(vn(t))return xd;const{k:n,l:r,r:i}=t;if(e===n){if(vn(r))return i;if(vn(i))return r;const[s,a]=Hz(r);return gp(mr(t,{k:s,l:_z(r),v:a}))}return e<n?gp(mr(t,{l:Bx(r,e)})):gp(mr(t,{r:Bx(i,e)}))}function Ya(t){return vn(t)?[]:[...Ya(t.l),{k:t.k,v:t.v},...Ya(t.r)]}function _x(t,e,n){if(vn(t))return[];const{k:r,l:i,r:s,v:a}=t;let u=[];return r>e&&(u=u.concat(_x(i,e,n))),r>=e&&r<=n&&u.push({k:r,v:a}),r<=n&&(u=u.concat(_x(s,e,n))),u}function gp(t){const{l:e,lvl:n,r}=t;if(r.lvl>=n-1&&e.lvl>=n-1)return t;if(n>r.lvl+1){if(rb(e))return Vz(mr(t,{lvl:n-1}));if(!vn(e)&&!vn(e.r))return mr(e.r,{l:mr(e,{r:e.r.l}),lvl:n,r:mr(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(rb(t))return Hx(mr(t,{lvl:n-1}));if(!vn(r)&&!vn(r.l)){const i=r.l,s=rb(i)?r.lvl-1:r.lvl;return mr(i,{l:mr(t,{lvl:n-1,r:i.l}),lvl:i.lvl+1,r:Hx(mr(r,{l:i.r,lvl:s}))})}throw new Error("Unexpected empty nodes")}function mr(t,e){return jz(e.k!==void 0?e.k:t.k,e.v!==void 0?e.v:t.v,e.lvl!==void 0?e.lvl:t.lvl,e.l!==void 0?e.l:t.l,e.r!==void 0?e.r:t.r)}function _z(t){return vn(t.r)?t.l:gp(mr(t,{r:_z(t.r)}))}function rb(t){return vn(t)||t.lvl>t.r.lvl}function Hz(t){return vn(t.r)?[t.k,t.v]:Hz(t.r)}function jz(t,e,n,r=xd,i=xd){return{k:t,l:r,lvl:n,r:i,v:e}}function rO(t){return Hx(Vz(t))}function Vz(t){const{l:e}=t;return!vn(e)&&e.lvl===t.lvl?mr(e,{r:mr(t,{l:e.r})}):t}function Hx(t){const{lvl:e,r:n}=t;return!vn(n)&&!vn(n.r)&&n.lvl===e&&n.r.lvl===e?mr(n,{l:mr(t,{r:n.l}),lvl:e+1}):t}function pG(t){return Bz(t,({k:e,v:n})=>({index:e,value:n}))}function Fz(t,e){return!!(t&&t.startIndex===e.startIndex&&t.endIndex===e.endIndex)}function wd(t,e){return!!(t&&t[0]===e[0]&&t[1]===e[1])}const Kw=Xt(()=>({recalcInProgress:Ae(!1)}),[],{singleton:!0});function Uz(t,e,n){return t[jp(t,e,n)]}function jp(t,e,n,r=0){let i=t.length-1;for(;r<=i;){const s=Math.floor((r+i)/2),a=t[s],u=n(a,e);if(u===0)return s;if(u===-1){if(i-r<2)return s-1;i=s-1}else{if(i===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`)}function mG(t,e,n,r){const i=jp(t,e,r),s=jp(t,n,r,i);return t.slice(i,s+1)}function Lo(t,e){return Math.round(t.getBoundingClientRect()[e])}function Fm(t){return!vn(t.groupOffsetTree)}function Yw({index:t},e){return e===t?0:e<t?-1:1}function yG(){return{groupIndices:[],groupOffsetTree:uc(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:uc()}}function vG(t,e){let n=vn(t)?0:1/0;for(const r of e){const{endIndex:i,size:s,startIndex:a}=r;if(n=Math.min(n,a),vn(t)){t=Ii(t,0,s);continue}const u=cc(t,a-1,i+1);if(u.some(EG(r)))continue;let f=!1,d=!1;for(const{end:g,start:p,value:m}of u)f?(i>=p||s===m)&&(t=Bx(t,p)):(d=m!==s,f=!0),g>i&&i>=p&&m!==s&&(t=Ii(t,i+1,m));d&&(t=Ii(t,a,s))}return[t,n]}function bG(t){return typeof t.groupIndex<"u"}function xG({offset:t},e){return e===t?0:e<t?-1:1}function Cd(t,e,n){if(e.length===0)return 0;const{index:r,offset:i,size:s}=Uz(e,t,Yw),a=t-r,u=s*a+(a-1)*n+i;return u>0?u+n:u}function $z(t,e){if(!Fm(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function qz(t,e,n){if(bG(t))return e.groupIndices[t.groupIndex]+1;const r=t.index==="LAST"?n:t.index;let i=$z(r,e);return i=Math.max(0,i,Math.min(n,i)),i}function SG(t,e,n,r=0){return r>0&&(e=Math.max(e,Uz(t,r,Yw).offset)),Bz(mG(t,e,n,xG),RG)}function wG(t,[e,n,r,i]){e.length>0&&r("received item sizes",e,br.DEBUG);const s=t.sizeTree;let a=s,u=0;if(n.length>0&&vn(s)&&e.length===2){const m=e[0].size,v=e[1].size;a=n.reduce((b,S)=>Ii(Ii(b,S,m),S+1,v),a)}else[a,u]=vG(a,e);if(a===s)return t;const{lastIndex:f,lastOffset:d,lastSize:g,offsetTree:p}=jx(t.offsetTree,u,a,i);return{groupIndices:n,groupOffsetTree:n.reduce((m,v)=>Ii(m,v,Cd(v,p,i)),uc()),lastIndex:f,lastOffset:d,lastSize:g,offsetTree:p,sizeTree:a}}function CG(t){return Ya(t).map(({k:e,v:n},r,i)=>{const s=i[r+1];return{endIndex:s!==void 0?s.k-1:1/0,size:n,startIndex:e}})}function iO(t,e){let n=0,r=0;for(;n<t;)n+=e[r+1]-e[r]-1,r++;return r-(n===t?0:1)}function jx(t,e,n,r){let i=t,s=0,a=0,u=0,f=0;if(e!==0){f=jp(i,e-1,Yw),u=i[f].offset;const d=No(n,e-1);s=d[0],a=d[1],i.length&&i[f].size===No(n,e)[1]&&(f-=1),i=i.slice(0,f+1)}else i=[];for(const{start:d,value:g}of cc(n,e,1/0)){const p=d-s,m=p*a+u+p*r;i.push({index:d,offset:m,size:g}),s=d,u=m,a=g}return{lastIndex:s,lastOffset:u,lastSize:a,offsetTree:i}}function RG(t){return{index:t.index,value:t}}function EG(t){const{endIndex:e,size:n,startIndex:r}=t;return i=>i.start===r&&(i.end===e||i.end===1/0)&&i.value===n}const TG={offsetHeight:"height",offsetWidth:"width"},bs=Xt(([{log:t},{recalcInProgress:e}])=>{const n=Ft(),r=Ft(),i=Kr(r,0),s=Ft(),a=Ft(),u=Ae(0),f=Ae([]),d=Ae(void 0),g=Ae(void 0),p=Ae(void 0),m=Ae(void 0),v=Ae((M,D)=>Lo(M,TG[D])),b=Ae(void 0),S=Ae(0),w=yG(),C=Kr(we(n,Mt(f,t,S),fs(wG,w),Dn()),w),R=Kr(we(f,Dn(),fs((M,D)=>({current:D,prev:M.current}),{current:[],prev:[]}),Fe(({prev:M})=>M)),[]);tt(we(f,ft(M=>M.length>0),Mt(C,S),Fe(([M,D,L])=>{const H=M.reduce((N,_,$)=>Ii(N,_,Cd(_,D.offsetTree,L)||$),uc());return{...D,groupIndices:M,groupOffsetTree:H}})),C),tt(we(r,Mt(C),ft(([M,{lastIndex:D}])=>M<D),Fe(([M,{lastIndex:D,lastSize:L}])=>[{endIndex:D,size:L,startIndex:M}])),n),tt(d,g);const T=Kr(we(d,Fe(M=>M===void 0)),!0);tt(we(g,ft(M=>M!==void 0&&vn(_n(C).sizeTree)),Fe(M=>{const D=_n(p),L=_n(f).length>0;return D!==void 0&&D!==0?L?[{endIndex:0,size:D,startIndex:0},{endIndex:1,size:M,startIndex:1}]:[]:[{endIndex:0,size:M,startIndex:0}]})),n),tt(we(m,ft(M=>M!==void 0&&M.length>0&&vn(_n(C).sizeTree)),Fe(M=>{const D=[];let L=M[0],H=0;for(let N=1;N<M.length;N++){const _=M[N];_!==L&&(D.push({endIndex:N-1,size:L,startIndex:H}),L=_,H=N)}return D.push({endIndex:M.length-1,size:L,startIndex:H}),D})),n),tt(we(f,Mt(p,g),ft(([,M,D])=>M!==void 0&&D!==void 0),Fe(([M,D,L])=>{const H=[];for(let N=0;N<M.length;N++){const _=M[N],$=M[N+1];H.push({startIndex:_,endIndex:_,size:D}),$!==void 0&&H.push({startIndex:_+1,endIndex:$-1,size:L})}return H})),n);const A=zi(we(n,Mt(C),fs(({sizes:M},[D,L])=>({changed:L!==M,sizes:L}),{changed:!1,sizes:w}),Fe(M=>M.changed)));ln(we(u,fs((M,D)=>({diff:M.prev-D,prev:D}),{diff:0,prev:0}),Fe(M=>M.diff)),M=>{const{groupIndices:D}=_n(C);if(M>0)Rt(e,!0),Rt(s,M+iO(M,D));else if(M<0){const L=_n(R);L.length>0&&(M-=iO(-M,L)),Rt(a,M)}}),ln(we(u,Mt(t)),([M,D])=>{M<0&&D("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:u},br.ERROR)});const k=zi(s);tt(we(s,Mt(C),Fe(([M,D])=>{const L=D.groupIndices.length>0,H=[],N=D.lastSize;if(L){const _=Sd(D.sizeTree,0);let $=0,F=0;for(;$<M;){const j=D.groupIndices[F],q=D.groupIndices.length===F+1?1/0:D.groupIndices[F+1]-j-1;H.push({endIndex:j,size:_,startIndex:j}),H.push({endIndex:j+1+q-1,size:N,startIndex:j+1}),F++,$+=q+1}const G=Ya(D.sizeTree);return $!==M&&G.shift(),G.reduce((j,{k:q,v:V})=>{let te=j.ranges;return j.prevSize!==0&&(te=[...j.ranges,{endIndex:q+M-1,size:j.prevSize,startIndex:j.prevIndex}]),{prevIndex:q+M,prevSize:V,ranges:te}},{prevIndex:M,prevSize:0,ranges:H}).ranges}return Ya(D.sizeTree).reduce((_,{k:$,v:F})=>({prevIndex:$+M,prevSize:F,ranges:[..._.ranges,{endIndex:$+M-1,size:_.prevSize,startIndex:_.prevIndex}]}),{prevIndex:0,prevSize:N,ranges:[]}).ranges})),n);const P=zi(we(a,Mt(C,S),Fe(([M,{offsetTree:D},L])=>{const H=-M;return Cd(H,D,L)})));return tt(we(a,Mt(C,S),Fe(([M,D,L])=>{if(D.groupIndices.length>0){if(vn(D.sizeTree))return D;let N=uc();const _=_n(R);let $=0,F=0,G=0;for(;$<-M;){G=_[F];const j=_[F+1]-G-1;F++,$+=j+1}if(N=Ya(D.sizeTree).reduce((j,{k:q,v:V})=>Ii(j,Math.max(0,q+M),V),N),$!==-M){const j=Sd(D.sizeTree,G);N=Ii(N,0,j);const q=No(D.sizeTree,-M+1)[1];N=Ii(N,1,q)}return{...D,sizeTree:N,...jx(D.offsetTree,0,N,L)}}const H=Ya(D.sizeTree).reduce((N,{k:_,v:$})=>Ii(N,Math.max(0,_+M),$),uc());return{...D,sizeTree:H,...jx(D.offsetTree,0,H,L)}})),C),{beforeUnshiftWith:k,data:b,defaultItemSize:g,firstItemIndex:u,fixedItemSize:d,fixedGroupSize:p,gap:S,groupIndices:f,heightEstimates:m,itemSize:v,listRefresh:A,shiftWith:a,shiftWithOffset:P,sizeRanges:n,sizes:C,statefulTotalCount:i,totalCount:r,trackItemSizes:T,unshiftWith:s}},Nn(ma,Kw),{singleton:!0});function AG(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const Gz=Xt(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:r,scrollTop:i}])=>{const s=Ft(),a=Ft(),u=zi(we(s,Fe(AG)));return tt(we(u,Fe(f=>f.totalCount)),n),tt(we(u,Fe(f=>f.groupIndices)),t),tt(we(dr(i,e,r),ft(([f,d])=>Fm(d)),Fe(([f,d,g])=>No(d.groupOffsetTree,Math.max(f-g,0),"v")[0]),Dn(),Fe(f=>[f])),a),{groupCounts:s,topItemsIndexes:a}},Nn(bs,si)),ya=Xt(([{log:t}])=>{const e=Ae(!1),n=zi(we(e,ft(r=>r),Dn()));return ln(e,r=>{r&&_n(t)("props updated",{},br.DEBUG)}),{didMount:n,propsReady:e}},Nn(ma),{singleton:!0}),MG=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Wz(t){const e=typeof t=="number"?{index:t}:t;return e.align||(e.align="start"),(!e.behavior||!MG)&&(e.behavior="auto"),e.offset===void 0&&(e.offset=0),e}const qd=Xt(([{gap:t,listRefresh:e,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:s,footerHeight:a,headerHeight:u,scrollingInProgress:f,scrollTo:d,smoothScrollTargetReached:g,viewportHeight:p},{log:m}])=>{const v=Ft(),b=Ft(),S=Ae(0);let w=null,C=null,R=null;function T(){w!==null&&(w(),w=null),R!==null&&(R(),R=null),C&&(clearTimeout(C),C=null),Rt(f,!1)}return tt(we(v,Mt(n,p,r,S,u,a,m),Mt(t,s,i),Fe(([[A,k,P,M,D,L,H,N],_,$,F])=>{const G=Wz(A),{align:j,behavior:q,offset:V}=G,te=M-1,J=qz(G,k,te);let z=Cd(J,k.offsetTree,_)+L;j==="end"?(z+=$+No(k.sizeTree,J)[1]-P+F,J===te&&(z+=H)):j==="center"?z+=($+No(k.sizeTree,J)[1]-P+F)/2:z-=D,V!==void 0&&V!==0&&(z+=V);const U=W=>{T(),W?(N("retrying to scroll to",{location:A},br.DEBUG),Rt(v,A)):(Rt(b,!0),N("list did not change, scroll successful",{},br.DEBUG))};if(T(),q==="smooth"){let W=!1;R=ln(e,X=>{W=W||X}),w=Do(g,()=>{U(W)})}else w=Do(we(e,OG(150)),U);return C=setTimeout(()=>{T()},1200),Rt(f,!0),N("scrolling from index to",{behavior:q,index:J,top:z},br.DEBUG),{behavior:q,top:z}})),d),{scrollTargetReached:b,scrollToIndex:v,topListHeight:S}},Nn(bs,si,ma),{singleton:!0});function OG(t){return e=>{const n=setTimeout(()=>{e(!1)},t);return r=>{r&&(e(!0),clearTimeout(n))}}}function Xw(t,e){t===0?e():requestAnimationFrame(()=>{Xw(t-1,e)})}function Qw(t,e){const n=e-1;return typeof t=="number"?t:t.index==="LAST"?n:t.index}const Gd=Xt(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:s},{didMount:a}])=>{const u=Ae(!0),f=Ae(0),d=Ae(!0);return tt(we(a,Mt(f),ft(([g,p])=>p!==0),os(!1)),u),tt(we(a,Mt(f),ft(([g,p])=>p!==0),os(!1)),d),ln(we(dr(e,a),Mt(u,n,t,d),ft(([[,g],p,{sizeTree:m},v,b])=>g&&(!vn(m)||$w(v))&&!p&&!b),Mt(f)),([,g])=>{Do(i,()=>{Rt(d,!0)}),Xw(4,()=>{Do(r,()=>{Rt(u,!0)}),Rt(s,g)})}),{initialItemFinalLocationReached:d,initialTopMostItemIndex:f,scrolledToInitialItem:u}},Nn(bs,si,qd,ya),{singleton:!0});function Kz(t,e){return Math.abs(t-e)<1.01}const Rd="up",Zf="down",kG="none",IG={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},DG=0,Wd=Xt(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:s}])=>{const a=Ae(!1),u=Ae(!0),f=Ft(),d=Ft(),g=Ae(4),p=Ae(DG),m=Kr(we(Nx(we(ct(i),au(1),os(!0)),we(ct(i),au(1),os(!1),JM(100))),Dn()),!1),v=Kr(we(Nx(we(n,os(!0)),we(n,os(!1),JM(200))),Dn()),!1);tt(we(dr(ct(i),ct(p)),Fe(([R,T])=>R<=T),Dn()),u),tt(we(u,Ks(50)),d);const b=zi(we(dr(r,ct(s),ct(e),ct(t),ct(g)),fs((R,[{scrollHeight:T,scrollTop:A},k,P,M,D])=>{const L=A+k-T>-D,H={scrollHeight:T,scrollTop:A,viewportHeight:k};if(L){let _,$;return A>R.state.scrollTop?(_="SCROLLED_DOWN",$=R.state.scrollTop-A):(_="SIZE_DECREASED",$=R.state.scrollTop-A||R.scrollTopDelta),{atBottom:!0,atBottomBecause:_,scrollTopDelta:$,state:H}}let N;return H.scrollHeight>R.state.scrollHeight?N="SIZE_INCREASED":k<R.state.viewportHeight?N="VIEWPORT_HEIGHT_DECREASING":A<R.state.scrollTop?N="SCROLLING_UPWARDS":N="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:N,state:H}},IG),Dn((R,T)=>R!==void 0&&R.atBottom===T.atBottom))),S=Kr(we(r,fs((R,{scrollHeight:T,scrollTop:A,viewportHeight:k})=>{if(!Kz(R.scrollHeight,T)){const P=T-(A+k)<1;return R.scrollTop!==A&&P?{changed:!0,jump:R.scrollTop-A,scrollHeight:T,scrollTop:A}:{changed:!0,jump:0,scrollHeight:T,scrollTop:A}}return{changed:!1,jump:0,scrollHeight:T,scrollTop:A}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),ft(R=>R.changed),Fe(R=>R.jump)),0);tt(we(b,Fe(R=>R.atBottom)),a),tt(we(a,Ks(50)),f);const w=Ae(Zf);tt(we(r,Fe(({scrollTop:R})=>R),Dn(),fs((R,T)=>_n(v)?{direction:R.direction,prevScrollTop:T}:{direction:T<R.prevScrollTop?Rd:Zf,prevScrollTop:T},{direction:Zf,prevScrollTop:0}),Fe(R=>R.direction)),w),tt(we(r,Ks(50),os(kG)),w);const C=Ae(0);return tt(we(m,ft(R=>!R),os(0)),C),tt(we(i,Ks(100),Mt(m),ft(([R,T])=>T),fs(([R,T],[A])=>[T,A],[0,0]),Fe(([R,T])=>T-R)),C),{atBottomState:b,atBottomStateChange:f,atBottomThreshold:g,atTopStateChange:d,atTopThreshold:p,isAtBottom:a,isAtTop:u,isScrolling:m,lastJumpDueToItemResize:S,scrollDirection:w,scrollVelocity:C}},Nn(si)),Ed="top",Td="bottom",oO="none";function sO(t,e,n){return typeof t=="number"?n===Rd&&e===Ed||n===Zf&&e===Td?t:0:n===Rd?e===Ed?t.main:t.reverse:e===Td?t.main:t.reverse}function lO(t,e){return typeof t=="number"?t:t[e]??0}const Zw=Xt(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{const s=Ft(),a=Ae(0),u=Ae(0),f=Ae(0),d=Kr(we(dr(ct(r),ct(i),ct(n),ct(s,wd),ct(f),ct(a),ct(e),ct(t),ct(u)),Fe(([g,p,m,[v,b],S,w,C,R,T])=>{const A=g-R,k=w+C,P=Math.max(m-A,0);let M=oO;const D=lO(T,Ed),L=lO(T,Td);return v-=R,v+=m+C,b+=m+C,b-=R,v>g+k-D&&(M=Rd),b<g-P+p+L&&(M=Zf),M!==oO?[Math.max(A-m-sO(S,Ed,M)-D,0),A-P-C+p+sO(S,Td,M)+L]:null}),ft(g=>g!==null),Dn(wd)),[0,0]);return{increaseViewportBy:u,listBoundary:s,overscan:f,topListHeight:a,visibleRange:d}},Nn(si),{singleton:!0});function PG(t,e,n){if(Fm(e)){const r=$z(t,e);return[{index:No(e.groupOffsetTree,r)[0],offset:0,size:0},{data:n?.[0],index:r,offset:0,size:0}]}return[{data:n?.[0],index:t,offset:0,size:0}]}const ib={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function pp(t,e,n,r,i,s){const{lastIndex:a,lastOffset:u,lastSize:f}=i;let d=0,g=0;if(t.length>0){d=t[0].offset;const S=t[t.length-1];g=S.offset+S.size}const p=n-a,m=u+p*f+(p-1)*r,v=d,b=m-g;return{bottom:g,firstItemIndex:s,items:aO(t,i,s),offsetBottom:b,offsetTop:d,top:v,topItems:aO(e,i,s),topListHeight:e.reduce((S,w)=>w.size+S,0),totalCount:n}}function Yz(t,e,n,r,i,s){let a=0;if(n.groupIndices.length>0)for(const g of n.groupIndices){if(g-a>=t)break;a++}const u=t+a,f=Qw(e,u),d=Array.from({length:u}).map((g,p)=>({data:s[p+f],index:p+f,offset:0,size:0}));return pp(d,[],u,i,n,r)}function aO(t,e,n){if(t.length===0)return[];if(!Fm(e))return t.map(d=>({...d,index:d.index+n,originalIndex:d.index}));const r=t[0].index,i=t[t.length-1].index,s=[],a=cc(e.groupOffsetTree,r,i);let u,f=0;for(const d of t){(!u||u.end<d.index)&&(u=a.shift(),f=e.groupIndices.indexOf(u.start));let g;d.index===u.start?g={index:f,type:"group"}:g={groupIndex:f,index:d.index-(f+1)+n},s.push({...g,data:d.data,offset:d.offset,originalIndex:d.index,size:d.size})}return s}function uO(t,e){return t===void 0?0:typeof t=="number"?t:t[e]??0}const vu=Xt(([{data:t,firstItemIndex:e,gap:n,sizes:r,totalCount:i},s,{listBoundary:a,topListHeight:u,visibleRange:f},{initialTopMostItemIndex:d,scrolledToInitialItem:g},{topListHeight:p},m,{didMount:v},{recalcInProgress:b}])=>{const S=Ae([]),w=Ae(0),C=Ft(),R=Ae(0);tt(s.topItemsIndexes,S);const T=Kr(we(dr(v,b,ct(f,wd),ct(i),ct(r),ct(d),g,ct(S),ct(e),ct(n),ct(R),t),ft(([M,D,,L,,,,,,,,H])=>{const N=H!==void 0&&H.length!==L;return M&&!D&&!N}),Fe(([,,[M,D],L,H,N,_,$,F,G,j,q])=>{const V=H,{offsetTree:te,sizeTree:J}=V,z=_n(w);if(L===0)return{...ib,totalCount:L};if(M===0&&D===0)return z===0?{...ib,totalCount:L}:Yz(z,N,H,F,G,q||[]);if(vn(J))return z>0?null:pp(PG(Qw(N,L),V,q),[],L,G,V,F);const U=[];if($.length>0){const le=$[0],xe=$[$.length-1];let ve=0;for(const de of cc(J,le,xe)){const me=de.value,Ce=Math.max(de.start,le),De=Math.min(de.end,xe);for(let Pe=Ce;Pe<=De;Pe++)U.push({data:q?.[Pe],index:Pe,offset:ve,size:me}),ve+=me}}if(!_)return pp([],U,L,G,V,F);const W=$.length>0?$[$.length-1]+1:0,X=SG(te,M,D,W);if(X.length===0)return null;const ie=L-1,ee=Vm([],le=>{for(const xe of X){const ve=xe.value;let de=ve.offset,me=xe.start;const Ce=ve.size;if(ve.offset<M){me+=Math.floor((M-ve.offset+G)/(Ce+G));const Pe=me-xe.start;de+=Pe*Ce+Pe*G}me<W&&(de+=(W-me)*Ce,me=W);const De=Math.min(xe.end,ie);for(let Pe=me;Pe<=De&&!(de>=D);Pe++)le.push({data:q?.[Pe],index:Pe,offset:de,size:Ce}),de+=Ce+G}}),ue=uO(j,Ed),Y=uO(j,Td);if(ee.length>0&&(ue>0||Y>0)){const le=ee[0],xe=ee[ee.length-1];if(ue>0&&le.index>W){const ve=Math.min(ue,le.index-W),de=[];let me=le.offset;for(let Ce=le.index-1;Ce>=le.index-ve;Ce--){const De=cc(J,Ce,Ce)[0]?.value??le.size;me-=De+G,de.unshift({data:q?.[Ce],index:Ce,offset:me,size:De})}ee.unshift(...de)}if(Y>0&&xe.index<ie){const ve=Math.min(Y,ie-xe.index);let de=xe.offset+xe.size+G;for(let me=xe.index+1;me<=xe.index+ve;me++){const Ce=cc(J,me,me)[0]?.value??xe.size;ee.push({data:q?.[me],index:me,offset:de,size:Ce}),de+=Ce+G}}}return pp(ee,U,L,G,V,F)}),ft(M=>M!==null),Dn()),ib);tt(we(t,ft($w),Fe(M=>M?.length)),i),tt(we(T,Fe(M=>M.topListHeight)),p),tt(p,u),tt(we(T,Fe(M=>[M.top,M.bottom])),a),tt(we(T,Fe(M=>M.items)),C);const A=zi(we(T,ft(({items:M})=>M.length>0),Mt(i,t),ft(([{items:M},D])=>M[M.length-1].originalIndex===D-1),Fe(([,M,D])=>[M-1,D]),Dn(wd),Fe(([M])=>M))),k=zi(we(T,Ks(200),ft(({items:M,topItems:D})=>M.length>0&&M[0].originalIndex===D.length),Fe(({items:M})=>M[0].index),Dn())),P=zi(we(T,ft(({items:M})=>M.length>0),Fe(({items:M})=>{let D=0,L=M.length-1;for(;M[D].type==="group"&&D<L;)D++;for(;M[L].type==="group"&&L>D;)L--;return{endIndex:M[L].index,startIndex:M[D].index}}),Dn(Fz)));return{endReached:A,initialItemCount:w,itemsRendered:C,listState:T,minOverscanItemCount:R,rangeChanged:P,startReached:k,topItemsIndexes:S,...m}},Nn(bs,Gz,Zw,Gd,qd,Wd,ya,Kw),{singleton:!0}),Xz=Xt(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:r},{listState:i}])=>{const s=Ft(),a=Kr(we(dr(n,t,r,e,i),Fe(([u,f,d,g,p])=>u+f+d+g+p.offsetBottom+p.bottom)),0);return tt(ct(a),s),{totalListHeight:a,totalListHeightChanged:s}},Nn(si,vu),{singleton:!0}),zG=Xt(([{viewportHeight:t},{totalListHeight:e}])=>{const n=Ae(!1),r=Kr(we(dr(n,t,e),ft(([i])=>i),Fe(([,i,s])=>Math.max(0,i-s)),Ks(0),Dn()),0);return{alignToBottom:n,paddingTopAddition:r}},Nn(si,Xz),{singleton:!0}),Qz=Xt(()=>({context:Ae(null)})),NG=({itemBottom:t,itemTop:e,locationParams:{align:n,behavior:r,...i},viewportBottom:s,viewportTop:a})=>e<a?{...i,align:n??"start",...r!==void 0?{behavior:r}:{}}:t>s?{...i,align:n??"end",...r!==void 0?{behavior:r}:{}}:null,Zz=Xt(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:s,scrollingInProgress:a,scrollTop:u,viewportHeight:f},{scrollToIndex:d}])=>{const g=Ft();return tt(we(g,Mt(e,f,n,s,i,r,u),Mt(t),Fe(([[p,m,v,b,S,w,C,R],T])=>{const{calculateViewLocation:A=NG,done:k,...P}=p,M=qz(p,m,b-1),D=Cd(M,m.offsetTree,T)+S+w,L=D+No(m.sizeTree,M)[1],H=R+w,N=R+v-C,_=A({itemBottom:L,itemTop:D,locationParams:P,viewportBottom:N,viewportTop:H});return _!==null?k&&Do(we(a,ft($=>!$),au(_n(a)?1:2)),k):k?.(),_}),ft(p=>p!==null)),d),{scrollIntoView:g}},Nn(bs,si,qd,vu,ma),{singleton:!0});function cO(t){return t===!1?!1:t==="smooth"?"smooth":"auto"}const LG=(t,e)=>typeof t=="function"?cO(t(e)):e&&cO(t),BG=Xt(([{listRefresh:t,totalCount:e,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:s},{scrollToIndex:a},{scrolledToInitialItem:u},{didMount:f,propsReady:d},{log:g},{scrollingInProgress:p},{context:m},{scrollIntoView:v}])=>{const b=Ae(!1),S=Ft();let w=null;function C(k){Rt(a,{align:"end",behavior:k,index:"LAST"})}ln(we(dr(we(ct(e),au(1)),f),Mt(ct(b),s,u,p),Fe(([[k,P],M,D,L,H])=>{let N=P&&L,_="auto";return N&&(_=LG(M,D||H),N=N&&_!==!1),{followOutputBehavior:_,shouldFollow:N,totalCount:k}}),ft(({shouldFollow:k})=>k)),({followOutputBehavior:k,totalCount:P})=>{w!==null&&(w(),w=null),_n(n)!==void 0?requestAnimationFrame(()=>{_n(g)("following output to ",{totalCount:P},br.DEBUG),C(k)}):w=Do(t,()=>{_n(g)("following output to ",{totalCount:P},br.DEBUG),C(k),w=null})});function R(k){const P=Do(i,M=>{k&&!M.atBottom&&M.notAtBottomBecause==="SIZE_INCREASED"&&w===null&&(_n(g)("scrolling to bottom due to increased size",{},br.DEBUG),C("auto"))});setTimeout(P,100)}ln(we(dr(ct(b),e,d),ft(([k,,P])=>k!==!1&&P),fs(({value:k},[,P])=>({refreshed:k===P,value:P}),{refreshed:!1,value:0}),ft(({refreshed:k})=>k),Mt(b,e)),([,k])=>{_n(u)&&R(k!==!1)}),ln(S,()=>{R(_n(b)!==!1)}),ln(dr(ct(b),i),([k,P])=>{k!==!1&&!P.atBottom&&P.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&C("auto")});const T=Ae(null),A=Ft();return tt(Nx(we(ct(r),Fe(k=>k?.length??0)),we(ct(e))),A),ln(we(dr(we(A,au(1)),f),Mt(ct(T),u,p,m),Fe(([[k,P],M,D,L,H])=>P&&D&&M?.({context:H,totalCount:k,scrollingInProgress:L})),ft(k=>!!k),Ks(0)),k=>{w!==null&&(w(),w=null),_n(n)!==void 0?requestAnimationFrame(()=>{_n(g)("scrolling into view",{}),Rt(v,k)}):w=Do(t,()=>{_n(g)("scrolling into view",{}),Rt(v,k),w=null})}),{autoscrollToBottom:S,followOutput:b,scrollIntoViewOnChange:T}},Nn(bs,Wd,qd,Gd,ya,ma,si,Qz,Zz)),_G=Xt(([{data:t,firstItemIndex:e,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:s,listState:a},{didMount:u}])=>(tt(we(u,Mt(s),ft(([,f])=>f!==0),Mt(i,r,e,n,t),Fe(([[,f],d,g,p,m,v=[]])=>Yz(f,d,g,p,m,v))),a),{}),Nn(bs,Gd,vu,ya),{singleton:!0}),HG=Xt(([{didMount:t},{scrollTo:e},{listState:n}])=>{const r=Ae(0);return ln(we(t,Mt(r),ft(([,i])=>i!==0),Fe(([,i])=>({top:i}))),i=>{Do(we(n,au(1),ft(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{Rt(e,i)})})}),{initialScrollTop:r}},Nn(ya,si,vu),{singleton:!0}),Jz=Xt(([{scrollVelocity:t}])=>{const e=Ae(!1),n=Ft(),r=Ae(!1);return tt(we(t,Mt(r,e,n),ft(([i,s])=>s!==!1&&s!==void 0),Fe(([i,s,a,u])=>{const{enter:f,exit:d}=s;if(a){if(d(i,u))return!1}else if(f(i,u))return!0;return a}),Dn()),e),ln(we(dr(e,t,n),Mt(r)),([[i,s,a],u])=>{i&&u!==!1&&u!==void 0&&u.change&&u.change(s,a)}),{isSeeking:e,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:t}},Nn(Wd),{singleton:!0}),Jw=Xt(([{scrollContainerState:t,scrollTo:e}])=>{const n=Ft(),r=Ft(),i=Ft(),s=Ae(!1),a=Ae(void 0);return tt(we(dr(n,r),Fe(([{scrollTop:u,viewportHeight:f},{offsetTop:d,listHeight:g}])=>({scrollHeight:g,scrollTop:Math.max(0,u-d),viewportHeight:f}))),t),tt(we(e,Mt(r),Fe(([u,{offsetTop:f}])=>({...u,top:u.top+f}))),i),{customScrollParent:a,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},Nn(si)),jG=Xt(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:s},{useWindowScroll:a,windowScrollContainerState:u,windowViewportRect:f}])=>{const d=Ft(),g=Ae(void 0),p=Ae(null),m=Ae(null);return tt(u,p),tt(f,m),ln(we(d,Mt(e,r,a,p,m,n)),([v,b,S,w,C,R,T])=>{const A=CG(b.sizeTree);w&&C!==null&&R!==null&&(S=C.scrollTop-R.offsetTop),S-=T,v({ranges:A,scrollTop:S})}),tt(we(g,ft($w),Fe(VG)),i),tt(we(s,Mt(g),ft(([,v])=>v!==void 0),Dn(),Fe(([,v])=>v.ranges)),t),{getState:d,restoreStateFrom:g}},Nn(bs,si,Gd,ya,Jw));function VG(t){return{align:"start",index:0,offset:t.scrollTop}}const FG=Xt(([{topItemsIndexes:t}])=>{const e=Ae(0);return tt(we(e,ft(n=>n>=0),Fe(n=>Array.from({length:n}).map((r,i)=>i))),t),{topItemCount:e}},Nn(vu));function eN(t){let e=!1,n;return(()=>(e||(e=!0,n=t()),n))}const UG=eN(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),$G=Xt(([{deviation:t,scrollBy:e,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:s,lastJumpDueToItemResize:a,scrollDirection:u},{listState:f},{beforeUnshiftWith:d,gap:g,shiftWithOffset:p,sizes:m},{log:v},{recalcInProgress:b}])=>{const S=zi(we(f,Mt(a),fs(([,C,R,T],[{bottom:A,items:k,offsetBottom:P,totalCount:M},D])=>{const L=A+P;let H=0;return R===M&&C.length>0&&k.length>0&&(k[0].originalIndex===0&&C[0].originalIndex===0||(H=L-T,H!==0&&(H+=D))),[H,k,M,L]},[0,[],0,0]),ft(([C])=>C!==0),Mt(r,u,n,i,v,b),ft(([,C,R,T,,,A])=>!A&&!T&&C!==0&&R===Rd),Fe(([[C],,,,,R])=>(R("Upward scrolling compensation",{amount:C},br.DEBUG),C))));function w(C){C>0?(Rt(e,{behavior:"auto",top:-C}),Rt(t,0)):(Rt(t,0),Rt(e,{behavior:"auto",top:-C}))}return ln(we(S,Mt(t,s)),([C,R,T])=>{T&&UG()?Rt(t,R-C):w(-C)}),ln(we(dr(Kr(s,!1),t,b),ft(([C,R,T])=>!C&&!T&&R!==0),Fe(([C,R])=>R),Ks(1)),w),tt(we(p,Fe(C=>({top:-C}))),e),ln(we(d,Mt(m,g),Fe(([C,{groupIndices:R,lastSize:T,sizeTree:A},k])=>{function P(N){return N*(T+k)}if(R.length===0)return P(C);let M=0;const D=Sd(A,0);let L=0,H=0;for(;L<C;){L++,M+=D;let N=R.length===H+1?1/0:R[H+1]-R[H]-1;L+N>C&&(M-=D,N=C-L+1),L+=N,M+=P(N),H++}return M})),C=>{Rt(t,C),requestAnimationFrame(()=>{Rt(e,{top:C}),requestAnimationFrame(()=>{Rt(t,0),Rt(b,!1)})})}),{deviation:t}},Nn(si,Wd,vu,bs,ma,Kw)),qG=Xt(([t,e,n,r,i,s,a,u,f,d,g])=>({...t,...e,...n,...r,...i,...s,...a,...u,...f,...d,...g}),Nn(Zw,_G,ya,Jz,Xz,HG,zG,Jw,Zz,ma,Qz)),tN=Xt(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:s,groupIndices:a,heightEstimates:u,itemSize:f,sizeRanges:d,sizes:g,statefulTotalCount:p,totalCount:m,trackItemSizes:v},{initialItemFinalLocationReached:b,initialTopMostItemIndex:S,scrolledToInitialItem:w},C,R,T,A,{scrollToIndex:k},P,{topItemCount:M},{groupCounts:D},L])=>{const{listState:H,minOverscanItemCount:N,topItemsIndexes:_,rangeChanged:$,...F}=A;return tt($,L.scrollSeekRangeChanged),tt(we(L.windowViewportRect,Fe(G=>G.visibleHeight)),C.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:s,groupCounts:D,heightEstimates:u,initialItemFinalLocationReached:b,initialTopMostItemIndex:S,scrolledToInitialItem:w,sizeRanges:d,topItemCount:M,topItemsIndexes:_,totalCount:m,...T,groupIndices:a,itemSize:f,listState:H,minOverscanItemCount:N,scrollToIndex:k,statefulTotalCount:p,trackItemSizes:v,rangeChanged:$,...F,...L,...C,sizes:g,...R}},Nn(bs,Gd,si,jG,BG,vu,qd,$G,FG,Gz,qG));function GG(t,e){const n={},r={};let i=0;const s=t.length;for(;i<s;)r[t[i]]=1,i+=1;for(const a in e)Object.hasOwn(r,a)||(n[a]=e[a]);return n}const Lg=typeof document<"u"?Ne.useLayoutEffect:Ne.useEffect;function e1(t,e,n){const r=Object.keys(e.required||{}),i=Object.keys(e.optional||{}),s=Object.keys(e.methods||{}),a=Object.keys(e.events||{}),u=Ne.createContext({});function f(w,C){w.propsReady!==void 0&&Rt(w.propsReady,!1);for(const R of r){const T=w[e.required[R]];Rt(T,C[R])}for(const R of i)if(R in C){const T=w[e.optional[R]];Rt(T,C[R])}w.propsReady!==void 0&&Rt(w.propsReady,!0)}function d(w){return s.reduce((C,R)=>(C[R]=T=>{const A=w[e.methods[R]];Rt(A,T)},C),{})}function g(w){return a.reduce((C,R)=>(C[R]=aG(w[e.events[R]]),C),{})}const p=Ne.forwardRef(function(w,C){const{children:R,...T}=w,[A]=Ne.useState(()=>Vm(cG(t),M=>{f(M,T)})),[k]=Ne.useState(ZM(g,A));Lg(()=>{for(const M of a)M in T&&ln(k[M],T[M]);return()=>{Object.values(k).map(qw)}},[T,k,A]),Lg(()=>{f(A,T)}),Ne.useImperativeHandle(C,QM(d(A)));const P=n;return O.jsx(u.Provider,{value:A,children:n!==void 0?O.jsx(P,{...GG([...r,...i,...a],T),children:R}):R})}),m=w=>{const C=Ne.useContext(u);return Ne.useCallback(R=>{Rt(C[w],R)},[C,w])},v=w=>{const C=Ne.useContext(u)[w],R=Ne.useCallback(T=>ln(C,T),[C]);return Ne.useSyncExternalStore(R,()=>_n(C),()=>_n(C))},b=w=>{const C=Ne.useContext(u)[w],[R,T]=Ne.useState(ZM(_n,C));return Lg(()=>ln(C,A=>{A!==R&&T(QM(A))}),[C,R]),R},S=parseInt(Ne.version)>=18?v:b;return{Component:p,useEmitter:(w,C)=>{const R=Ne.useContext(u)[w];Lg(()=>ln(R,C),[C,R])},useEmitterValue:S,usePublisher:m}}const Um=Ne.createContext(void 0),nN=Ne.createContext(void 0),ob="-webkit-sticky",fO="sticky",t1=eN(()=>{if(typeof document>"u")return fO;const t=document.createElement("div");return t.style.position=ob,t.style.position===ob?ob:fO}),rN=typeof document<"u"?Ne.useLayoutEffect:Ne.useEffect;function sb(t){return"self"in t}function WG(t){return"body"in t}function iN(t,e,n,r=Lc,i,s){const a=Ne.useRef(null),u=Ne.useRef(null),f=Ne.useRef(null),d=Ne.useCallback(m=>{let v,b,S;const w=m.target;if(WG(w)||sb(w)){const R=sb(w)?w:w.defaultView;S=s===!0?Ka(R,R.scrollX):R.scrollY,v=s===!0?R.document.documentElement.scrollWidth:R.document.documentElement.scrollHeight,b=s===!0?R.innerWidth:R.innerHeight}else S=s===!0?Ka(w,w.scrollLeft):w.scrollTop,v=s===!0?w.scrollWidth:w.scrollHeight,b=s===!0?w.offsetWidth:w.offsetHeight;const C=()=>{t({scrollHeight:v,scrollTop:Math.max(S,0),viewportHeight:b})};m.suppressFlushSync===!0?C():zF.flushSync(C),u.current!==null&&(S===u.current||S<=0||S===v-b)&&(u.current=null,e(!0),f.current&&(clearTimeout(f.current),f.current=null))},[t,e,s]);Ne.useEffect(()=>{const m=i||a.current;return eO(m),r(i||a.current),d({suppressFlushSync:!0,target:m}),m.addEventListener("scroll",d,{passive:!0}),()=>{eO(m),r(null),m.removeEventListener("scroll",d)}},[a,d,n,r,i]);function g(m){const v=a.current;if(!v||(s===!0?"offsetWidth"in v&&v.offsetWidth===0:"offsetHeight"in v&&v.offsetHeight===0))return;const b=m.behavior==="smooth";let S,w,C;sb(v)?(w=Math.max(Lo(v.document.documentElement,s===!0?"width":"height"),s===!0?v.document.documentElement.scrollWidth:v.document.documentElement.scrollHeight),S=s===!0?v.innerWidth:v.innerHeight,C=s===!0?Ka(v,v.scrollX):v.scrollY):(w=v[s===!0?"scrollWidth":"scrollHeight"],S=Lo(v,s===!0?"width":"height"),C=s===!0?Ka(v,v.scrollLeft):v.scrollTop);const R=w-S;if(m.top===void 0){v.scrollTo(m);return}const T=Math.ceil(Math.max(Math.min(R,m.top),0));if(m.top=T,Kz(S,w)||T===C){t({scrollHeight:w,scrollTop:C,viewportHeight:S}),b&&e(!0);return}b?(u.current=T,f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{f.current=null,u.current=null,e(!0)},1e3)):u.current=null,s===!0&&(m={...m.behavior!==void 0?{behavior:m.behavior}:{},left:tO(v,T)}),v.scrollTo(m)}function p(m){s===!0&&(m={...m.behavior!==void 0?{behavior:m.behavior}:{},...m.top!==void 0?{left:tO(a.current,m.top)}:{}}),a.current.scrollBy(m)}return{scrollByCallback:p,scrollerRef:a,scrollToCallback:g}}function n1(t){return t}const KG=Xt(()=>{const t=Ae(u=>`Item ${u}`),e=Ae(u=>`Group ${u}`),n=Ae({}),r=Ae(n1),i=Ae("div"),s=Ae(Lc),a=(u,f=null)=>Kr(we(n,Fe(d=>d[u]),Dn()),f);return{components:n,computeItemKey:r,EmptyPlaceholder:a("EmptyPlaceholder"),FooterComponent:a("Footer"),GroupComponent:a("Group","div"),groupContent:e,HeaderComponent:a("Header"),HeaderFooterTag:i,ItemComponent:a("Item","div"),itemContent:t,ListComponent:a("List","div"),ScrollerComponent:a("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TopItemListComponent:a("TopItemList")}}),YG=Xt(([t,e])=>({...t,...e}),Nn(tN,KG)),XG=({height:t})=>O.jsx("div",{style:{height:t}}),QG={overflowAnchor:"none",position:t1(),zIndex:1},oN={overflowAnchor:"none"},ZG={...oN,display:"inline-block",height:"100%"},dO=Ne.memo(function({showTopList:t=!1}){const e=mt("listState"),n=to("sizeRanges"),r=mt("useWindowScroll"),i=mt("customScrollParent"),s=to("windowScrollContainerState"),a=to("scrollContainerState"),u=i||r?s:a,f=mt("itemContent"),d=mt("context"),g=mt("groupContent"),p=mt("trackItemSizes"),m=mt("itemSize"),v=mt("log"),b=to("gap"),S=mt("horizontalDirection"),{callbackRef:w}=Lz(n,m,p,t?Lc:u,v,b,i,S,mt("skipAnimationFrameInResizeObserver")),[C,R]=Ne.useState(0);s1("deviation",F=>{C!==F&&R(F)});const T=mt("EmptyPlaceholder"),A=mt("ScrollSeekPlaceholder")??XG,k=mt("ListComponent"),P=mt("ItemComponent"),M=mt("GroupComponent"),D=mt("computeItemKey"),L=mt("isSeeking"),H=mt("groupIndices").length>0,N=mt("alignToBottom"),_=mt("initialItemFinalLocationReached"),$=t?{}:{boxSizing:"border-box",...S?{display:"inline-block",height:"100%",marginInlineStart:C!==0?C:N?"auto":0,paddingInlineEnd:e.offsetBottom,paddingInlineStart:e.offsetTop,whiteSpace:"nowrap"}:{marginTop:C!==0?C:N?"auto":0,paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},..._?{}:{visibility:"hidden"}};return!t&&e.totalCount===0&&T!==null&&T!==void 0?O.jsx(T,{...Pn(T,d)}):O.jsx(k,{...Pn(k,d),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:w,style:$,children:(t?e.topItems:e.items).map(F=>{const G=F.originalIndex,j=D(G+e.firstItemIndex,F.data,d);return L?E.createElement(A,{...Pn(A,d),height:F.size,index:F.index,key:j,type:F.type||"item",...F.type==="group"?{}:{groupIndex:F.groupIndex}}):F.type==="group"?E.createElement(M,{...Pn(M,d),"data-index":G,"data-item-index":F.index,"data-known-size":F.size,key:j,style:QG},g(F.index,d)):E.createElement(P,{...Pn(P,d),...sN(P,F.data),"data-index":G,"data-item-group-index":F.groupIndex,"data-item-index":F.index,"data-known-size":F.size,key:j,style:S?ZG:oN},H?f(F.index,F.groupIndex,F.data,d):f(F.index,F.data,d))})})}),JG={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},e7={outline:"none",overflowX:"auto",position:"relative"},$m=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:void 0}),r1=(t,e,n=0)=>({...$m(t),position:e?"relative":"absolute",top:e?-n:0}),t7={position:t1(),top:0,width:"100%",zIndex:1};function Pn(t,e){if(typeof t!="string")return{context:e}}function sN(t,e){return{item:typeof t=="string"?void 0:e}}const n7=Ne.memo(function(){const t=mt("HeaderComponent"),e=to("headerHeight"),n=mt("HeaderFooterTag"),r=ys(Ne.useMemo(()=>s=>{e(Lo(s,"height"))},[e]),!0,mt("skipAnimationFrameInResizeObserver")),i=mt("context");return t!=null?O.jsx(n,{ref:r,children:O.jsx(t,{...Pn(t,i)})}):null}),r7=Ne.memo(function(){const t=mt("FooterComponent"),e=to("footerHeight"),n=mt("HeaderFooterTag"),r=ys(Ne.useMemo(()=>s=>{e(Lo(s,"height"))},[e]),!0,mt("skipAnimationFrameInResizeObserver")),i=mt("context");return t!=null?O.jsx(n,{ref:r,children:O.jsx(t,{...Pn(t,i)})}):null});function i1({useEmitter:t,useEmitterValue:e,usePublisher:n}){return Ne.memo(function({children:r,style:i,context:s,...a}){const u=n("scrollContainerState"),f=e("ScrollerComponent"),d=n("smoothScrollTargetReached"),g=e("scrollerRef"),p=e("horizontalDirection")||!1,{scrollByCallback:m,scrollerRef:v,scrollToCallback:b}=iN(u,d,f,g,void 0,p);return t("scrollTo",b),t("scrollBy",m),O.jsx(f,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:v,style:{...p?e7:JG,...i},tabIndex:0,...a,...Pn(f,s),children:r})})}function o1({useEmitter:t,useEmitterValue:e,usePublisher:n}){return Ne.memo(function({children:r,style:i,context:s,...a}){const u=n("windowScrollContainerState"),f=e("ScrollerComponent"),d=n("smoothScrollTargetReached"),g=e("totalListHeight"),p=e("deviation"),m=e("customScrollParent"),v=Ne.useRef(null),b=e("scrollerRef"),{scrollByCallback:S,scrollerRef:w,scrollToCallback:C}=iN(u,d,f,b,m);return rN(()=>(w.current=m||v.current?.ownerDocument.defaultView,()=>{w.current=null}),[w,m]),t("windowScrollTo",C),t("scrollBy",S),O.jsx(f,{ref:v,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...g!==0?{height:g+p}:void 0},...a,...Pn(f,s),children:r})})}const i7=({children:t})=>{const e=Ne.useContext(Um),n=to("viewportHeight"),r=to("fixedItemHeight"),i=mt("alignToBottom"),s=mt("horizontalDirection"),a=Ne.useMemo(()=>bd(n,f=>Lo(f,s?"width":"height")),[n,s]),u=ys(a,!0,mt("skipAnimationFrameInResizeObserver"));return Ne.useEffect(()=>{e&&(n(e.viewportHeight),r(e.itemHeight))},[e,n,r]),O.jsx("div",{"data-viewport-type":"element",ref:u,style:$m(i),children:t})},o7=({children:t})=>{const e=Ne.useContext(Um),n=to("windowViewportRect"),r=to("fixedItemHeight"),i=mt("customScrollParent"),s=mt("useWindowScroll"),a=mt("topListHeight"),u=Ww(n,i,mt("skipAnimationFrameInResizeObserver")),f=mt("alignToBottom");return Ne.useEffect(()=>{e&&(r(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,r]),O.jsx("div",{"data-viewport-type":"window",ref:u,style:r1(f,s,a),children:t})},s7=({children:t})=>{const e=mt("TopItemListComponent")??"div",n=mt("headerHeight"),r={...t7,marginTop:`${n}px`},i=mt("context");return O.jsx(e,{style:r,...Pn(e,i),children:t})},l7=Ne.memo(function(t){const e=mt("useWindowScroll"),n=mt("topItemsIndexes").length>0,r=mt("customScrollParent"),i=mt("context");return O.jsxs(r||e?c7:u7,{...t,context:i,children:[n&&O.jsx(s7,{children:O.jsx(dO,{showTopList:!0})}),O.jsxs(r||e?o7:i7,{children:[O.jsx(n7,{}),O.jsx(dO,{}),O.jsx(r7,{})]})]})}),{Component:a7,useEmitter:s1,useEmitterValue:mt,usePublisher:to}=e1(YG,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},l7),u7=i1({useEmitter:s1,useEmitterValue:mt,usePublisher:to}),c7=o1({useEmitter:s1,useEmitterValue:mt,usePublisher:to}),lN=a7,f7=Xt(()=>{const t=Ae(d=>O.jsxs("td",{children:["Item $",d]})),e=Ae(null),n=Ae(d=>O.jsxs("td",{colSpan:1e3,children:["Group ",d]})),r=Ae(null),i=Ae(null),s=Ae({}),a=Ae(n1),u=Ae(Lc),f=(d,g=null)=>Kr(we(s,Fe(p=>p[d]),Dn()),g);return{components:s,computeItemKey:a,context:e,EmptyPlaceholder:f("EmptyPlaceholder"),FillerRow:f("FillerRow"),fixedFooterContent:i,fixedHeaderContent:r,itemContent:t,groupContent:n,ScrollerComponent:f("Scroller","div"),scrollerRef:u,ScrollSeekPlaceholder:f("ScrollSeekPlaceholder"),TableBodyComponent:f("TableBody","tbody"),TableComponent:f("Table","table"),TableFooterComponent:f("TableFoot","tfoot"),TableHeadComponent:f("TableHead","thead"),TableRowComponent:f("TableRow","tr"),GroupComponent:f("Group","tr")}}),d7=Xt(([t,e])=>({...t,...e}),Nn(tN,f7)),h7=({height:t})=>O.jsx("tr",{children:O.jsx("td",{style:{height:t}})}),g7=({height:t})=>O.jsx("tr",{children:O.jsx("td",{style:{border:0,height:t,padding:0}})}),p7={overflowAnchor:"none"},hO={position:t1(),zIndex:2,overflowAnchor:"none"},gO=Ne.memo(function({showTopList:t=!1}){const e=St("listState"),n=St("computeItemKey"),r=St("firstItemIndex"),i=St("context"),s=St("isSeeking"),a=St("fixedHeaderHeight"),u=St("groupIndices").length>0,f=St("itemContent"),d=St("groupContent"),g=St("ScrollSeekPlaceholder")??h7,p=St("GroupComponent"),m=St("TableRowComponent"),v=(t?e.topItems:[]).reduce((b,S,w)=>(w===0?b.push(S.size):b.push(b[w-1]+S.size),b),[]);return(t?e.topItems:e.items).map(b=>{const S=b.originalIndex,w=n(S+r,b.data,i),C=t?S===0?0:v[S-1]:0;return s?E.createElement(g,{...Pn(g,i),height:b.size,index:b.index,key:w,type:b.type||"item"}):b.type==="group"?E.createElement(p,{...Pn(p,i),"data-index":S,"data-item-index":b.index,"data-known-size":b.size,key:w,style:{...hO,top:a}},d(b.index,i)):E.createElement(m,{...Pn(m,i),...sN(m,b.data),"data-index":S,"data-item-index":b.index,"data-known-size":b.size,"data-item-group-index":b.groupIndex,key:w,style:t?{...hO,top:a+C}:p7},u?f(b.index,b.groupIndex,b.data,i):f(b.index,b.data,i))})}),m7=Ne.memo(function(){const t=St("listState"),e=St("topItemsIndexes").length>0,n=Po("sizeRanges"),r=St("useWindowScroll"),i=St("customScrollParent"),s=Po("windowScrollContainerState"),a=Po("scrollContainerState"),u=i||r?s:a,f=St("trackItemSizes"),d=St("itemSize"),g=St("log"),{callbackRef:p,ref:m}=Lz(n,d,f,u,g,void 0,i,!1,St("skipAnimationFrameInResizeObserver")),[v,b]=Ne.useState(0);l1("deviation",H=>{v!==H&&(m.current.style.marginTop=`${H}px`,b(H))});const S=St("EmptyPlaceholder"),w=St("FillerRow")??g7,C=St("TableBodyComponent"),R=St("paddingTopAddition"),T=St("statefulTotalCount"),A=St("context");if(T===0&&S!==null&&S!==void 0)return O.jsx(S,{...Pn(S,A)});const k=(e?t.topItems:[]).reduce((H,N)=>H+N.size,0),P=t.offsetTop+R+v-k,M=t.offsetBottom,D=P>0?O.jsx(w,{context:A,height:P},"padding-top"):null,L=M>0?O.jsx(w,{context:A,height:M},"padding-bottom"):null;return O.jsxs(C,{"data-testid":"virtuoso-item-list",ref:p,...Pn(C,A),children:[D,e&&O.jsx(gO,{showTopList:!0}),O.jsx(gO,{}),L]})}),y7=({children:t})=>{const e=Ne.useContext(Um),n=Po("viewportHeight"),r=Po("fixedItemHeight"),i=ys(Ne.useMemo(()=>bd(n,s=>Lo(s,"height")),[n]),!0,St("skipAnimationFrameInResizeObserver"));return Ne.useEffect(()=>{e&&(n(e.viewportHeight),r(e.itemHeight))},[e,n,r]),O.jsx("div",{"data-viewport-type":"element",ref:i,style:$m(!1),children:t})},v7=({children:t})=>{const e=Ne.useContext(Um),n=Po("windowViewportRect"),r=Po("fixedItemHeight"),i=St("customScrollParent"),s=St("useWindowScroll"),a=Ww(n,i,St("skipAnimationFrameInResizeObserver"));return Ne.useEffect(()=>{e&&(r(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,r]),O.jsx("div",{"data-viewport-type":"window",ref:a,style:r1(!1,s),children:t})},b7=Ne.memo(function(t){const e=St("useWindowScroll"),n=St("customScrollParent"),r=Po("fixedHeaderHeight"),i=Po("fixedFooterHeight"),s=St("fixedHeaderContent"),a=St("fixedFooterContent"),u=St("context"),f=ys(Ne.useMemo(()=>bd(r,C=>Lo(C,"height")),[r]),!0,St("skipAnimationFrameInResizeObserver")),d=ys(Ne.useMemo(()=>bd(i,C=>Lo(C,"height")),[i]),!0,St("skipAnimationFrameInResizeObserver")),g=n||e?w7:S7,p=n||e?v7:y7,m=St("TableComponent"),v=St("TableHeadComponent"),b=St("TableFooterComponent"),S=s?O.jsx(v,{ref:f,style:{position:"sticky",top:0,zIndex:2},...Pn(v,u),children:s()},"TableHead"):null,w=a?O.jsx(b,{ref:d,style:{bottom:0,position:"sticky",zIndex:1},...Pn(b,u),children:a()},"TableFoot"):null;return O.jsx(g,{...t,...Pn(g,u),children:O.jsx(p,{children:O.jsxs(m,{style:{borderSpacing:0,overflowAnchor:"none"},...Pn(m,u),children:[S,O.jsx(m7,{},"TableBody"),w]})})})}),{Component:x7,useEmitter:l1,useEmitterValue:St,usePublisher:Po}=e1(d7,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},b7),S7=i1({useEmitter:l1,useEmitterValue:St,usePublisher:Po}),w7=o1({useEmitter:l1,useEmitterValue:St,usePublisher:Po}),C7=x7,pO={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},R7={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:mO,floor:Vp,max:Jf,min:lb,round:yO}=Math;function vO(t,e,n){return Array.from({length:e-t+1}).map((r,i)=>({data:n===null?null:n[i+t],index:i+t}))}function E7(t){return{...R7,items:t}}function Bg(t,e){return t!==void 0&&t.width===e.width&&t.height===e.height}function T7(t,e){return t!==void 0&&t.column===e.column&&t.row===e.row}const A7=Xt(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:s,scrollBy:a,scrollContainerState:u,scrollTo:f,scrollTop:d,smoothScrollTargetReached:g,viewportHeight:p},m,v,{didMount:b,propsReady:S},{customScrollParent:w,useWindowScroll:C,windowScrollContainerState:R,windowScrollTo:T,windowViewportRect:A},k])=>{const P=Ae(0),M=Ae(0),D=Ae(pO),L=Ae({height:0,width:0}),H=Ae({height:0,width:0}),N=Ft(),_=Ft(),$=Ae(0),F=Ae(null),G=Ae({column:0,row:0}),j=Ft(),q=Ft(),V=Ae(!1),te=Ae(0),J=Ae(!0),z=Ae(!1),U=Ae(!1);ln(we(b,Mt(te),ft(([Y,le])=>le!==0)),()=>{Rt(J,!1)}),ln(we(dr(b,J,H,L,te,z),ft(([Y,le,xe,ve,,de])=>Y&&!le&&xe.height!==0&&ve.height!==0&&!de)),([,,,,Y])=>{Rt(z,!0),Xw(1,()=>{Rt(N,Y)}),Do(we(d),()=>{Rt(e,[0,0]),Rt(J,!0)})}),tt(we(q,ft(Y=>Y!=null&&Y.scrollTop>0),os(0)),M),ln(we(b,Mt(q),ft(([,Y])=>Y!=null)),([,Y])=>{Y&&(Rt(L,Y.viewport),Rt(H,Y.item),Rt(G,Y.gap),Y.scrollTop>0&&(Rt(V,!0),Do(we(d,au(1)),le=>{Rt(V,!1)}),Rt(f,{top:Y.scrollTop})))}),tt(we(L,Fe(({height:Y})=>Y)),p),tt(we(dr(ct(L,Bg),ct(H,Bg),ct(G,(Y,le)=>Y!==void 0&&Y.column===le.column&&Y.row===le.row),ct(d)),Fe(([Y,le,xe,ve])=>({gap:xe,item:le,scrollTop:ve,viewport:Y}))),j),tt(we(dr(ct(P),r,ct(G,T7),ct(H,Bg),ct(L,Bg),ct(F),ct(M),ct(V),ct(J),ct(te)),ft(([,,,,,,,Y])=>!Y),Fe(([Y,[le,xe],ve,de,me,Ce,De,,Pe,Ee])=>{const{column:je,row:ke}=ve,{height:_e,width:Ge}=de,{width:We}=me;if(De===0&&(Y===0||We===0))return pO;if(Ge===0){const Le=Qw(Ee,Y),it=Le+Math.max(De-1,0);return E7(vO(Le,it,Ce))}const fe=aN(We,Ge,je);let ne,Q;Pe?le===0&&xe===0&&De>0?(ne=0,Q=De-1):(ne=fe*Vp((le+ke)/(_e+ke)),Q=fe*mO((xe+ke)/(_e+ke))-1,Q=lb(Y-1,Jf(Q,fe-1)),ne=lb(Q,Jf(0,ne))):(ne=0,Q=-1);const Se=vO(ne,Q,Ce),{bottom:ge,top:Ie}=bO(me,ve,de,Se),Je=mO(Y/fe),nt=Je*_e+(Je-1)*ke-ge;return{bottom:ge,itemHeight:_e,items:Se,itemWidth:Ge,offsetBottom:nt,offsetTop:Ie,top:Ie}})),D),tt(we(F,ft(Y=>Y!==null),Fe(Y=>Y.length)),P),tt(we(dr(L,H,D,G),ft(([Y,le,{items:xe}])=>xe.length>0&&le.height!==0&&Y.height!==0),Fe(([Y,le,{items:xe},ve])=>{const{bottom:de,top:me}=bO(Y,ve,le,xe);return[me,de]}),Dn(wd)),e);const W=Ae(!1);tt(we(d,Mt(W),Fe(([Y,le])=>le||Y!==0)),W);const X=zi(we(dr(D,P),ft(([{items:Y}])=>Y.length>0),Mt(W),ft(([[Y,le],xe])=>{const ve=Y.items[Y.items.length-1].index===le-1;return(xe||Y.bottom>0&&Y.itemHeight>0&&Y.offsetBottom===0&&Y.items.length===le)&&ve}),Fe(([[,Y]])=>Y-1),Dn())),ie=zi(we(ct(D),ft(({items:Y})=>Y.length>0&&Y[0].index===0),os(0),Dn())),ee=zi(we(ct(D),Mt(V),ft(([{items:Y},le])=>Y.length>0&&!le),Fe(([{items:Y}])=>({endIndex:Y[Y.length-1].index,startIndex:Y[0].index})),Dn(Fz),Ks(0)));tt(ee,v.scrollSeekRangeChanged),tt(we(N,Mt(L,H,P,G),Fe(([Y,le,xe,ve,de])=>{const me=Wz(Y),{align:Ce,behavior:De,offset:Pe}=me;let Ee=me.index;Ee==="LAST"&&(Ee=ve-1),Ee=Jf(0,Ee,lb(ve-1,Ee));let je=Vx(le,de,xe,Ee);return Ce==="end"?je=yO(je-le.height+xe.height):Ce==="center"&&(je=yO(je-le.height/2+xe.height/2)),Pe!==void 0&&Pe!==0&&(je+=Pe),{behavior:De,top:je}})),f);const ue=Kr(we(D,Fe(Y=>Y.offsetBottom+Y.bottom)),0);return tt(we(A,Fe(Y=>({height:Y.visibleHeight,width:Y.visibleWidth}))),L),{customScrollParent:w,data:F,deviation:$,footerHeight:i,gap:G,headerHeight:s,increaseViewportBy:t,initialItemCount:M,itemDimensions:H,overscan:n,restoreStateFrom:q,scrollBy:a,scrollContainerState:u,scrollHeight:_,scrollTo:f,scrollToIndex:N,scrollTop:d,smoothScrollTargetReached:g,totalCount:P,useWindowScroll:C,viewportDimensions:L,windowScrollContainerState:R,windowScrollTo:T,windowViewportRect:A,...v,gridState:D,horizontalDirection:U,initialTopMostItemIndex:te,totalListHeight:ue,...m,endReached:X,propsReady:S,rangeChanged:ee,startReached:ie,stateChanged:j,stateRestoreInProgress:V,...k}},Nn(Zw,si,Wd,Jz,ya,Jw,ma));function aN(t,e,n){return Jf(1,Vp((t+n)/(Vp(e)+n)))}function bO(t,e,n,r){const{height:i}=n;if(i===void 0||r.length===0)return{bottom:0,top:0};const s=Vx(t,e,n,r[0].index);return{bottom:Vx(t,e,n,r[r.length-1].index)+i,top:s}}function Vx(t,e,n,r){const i=aN(t.width,n.width,e.column),s=Vp(r/i),a=s*n.height+Jf(0,s-1)*e.row;return a>0?a+e.row:a}const M7=Xt(()=>{const t=Ae(p=>`Item ${p}`),e=Ae({}),n=Ae(null),r=Ae("virtuoso-grid-item"),i=Ae("virtuoso-grid-list"),s=Ae(n1),a=Ae("div"),u=Ae(Lc),f=(p,m=null)=>Kr(we(e,Fe(v=>v[p]),Dn()),m),d=Ae(!1),g=Ae(!1);return tt(ct(g),d),{components:e,computeItemKey:s,context:n,FooterComponent:f("Footer"),HeaderComponent:f("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:f("Item","div"),itemContent:t,listClassName:i,ListComponent:f("List","div"),readyStateChanged:d,reportReadyState:g,ScrollerComponent:f("Scroller","div"),scrollerRef:u,ScrollSeekPlaceholder:f("ScrollSeekPlaceholder","div")}}),O7=Xt(([t,e])=>({...t,...e}),Nn(A7,M7)),k7=Ne.memo(function(){const t=In("gridState"),e=In("listClassName"),n=In("itemClassName"),r=In("itemContent"),i=In("computeItemKey"),s=In("isSeeking"),a=no("scrollHeight"),u=In("ItemComponent"),f=In("ListComponent"),d=In("ScrollSeekPlaceholder"),g=In("context"),p=no("itemDimensions"),m=no("gap"),v=In("log"),b=In("stateRestoreInProgress"),S=no("reportReadyState"),w=ys(Ne.useMemo(()=>C=>{const R=C.parentElement.parentElement.scrollHeight;a(R);const T=C.firstChild;if(T!==null){const{height:A,width:k}=T.getBoundingClientRect();p({height:A,width:k})}m({column:xO("column-gap",getComputedStyle(C).columnGap,v),row:xO("row-gap",getComputedStyle(C).rowGap,v)})},[a,p,m,v]),!0,!1);return rN(()=>{t.itemHeight>0&&t.itemWidth>0&&S(!0)},[t]),b?null:O.jsx(f,{className:e,ref:w,...Pn(f,g),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(C=>{const R=i(C.index,C.data,g);return s?O.jsx(d,{...Pn(d,g),height:t.itemHeight,index:C.index,width:t.itemWidth},R):E.createElement(u,{...Pn(u,g),className:n,"data-index":C.index,key:R},r(C.index,C.data,g))})})}),I7=Ne.memo(function(){const t=In("HeaderComponent"),e=no("headerHeight"),n=In("headerFooterTag"),r=ys(Ne.useMemo(()=>s=>{e(Lo(s,"height"))},[e]),!0,!1),i=In("context");return t!=null?O.jsx(n,{ref:r,children:O.jsx(t,{...Pn(t,i)})}):null}),D7=Ne.memo(function(){const t=In("FooterComponent"),e=no("footerHeight"),n=In("headerFooterTag"),r=ys(Ne.useMemo(()=>s=>{e(Lo(s,"height"))},[e]),!0,!1),i=In("context");return t!=null?O.jsx(n,{ref:r,children:O.jsx(t,{...Pn(t,i)})}):null}),P7=({children:t})=>{const e=Ne.useContext(nN),n=no("itemDimensions"),r=no("viewportDimensions"),i=ys(Ne.useMemo(()=>s=>{r(s.getBoundingClientRect())},[r]),!0,!1);return Ne.useEffect(()=>{e&&(r({height:e.viewportHeight,width:e.viewportWidth}),n({height:e.itemHeight,width:e.itemWidth}))},[e,r,n]),O.jsx("div",{ref:i,style:$m(!1),children:t})},z7=({children:t})=>{const e=Ne.useContext(nN),n=no("windowViewportRect"),r=no("itemDimensions"),i=In("customScrollParent"),s=In("useWindowScroll"),a=Ww(n,i,!1);return Ne.useEffect(()=>{e&&(r({height:e.itemHeight,width:e.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,r]),O.jsx("div",{ref:a,style:r1(!1,s),children:t})},N7=Ne.memo(function({...t}){const e=In("useWindowScroll"),n=In("customScrollParent"),r=n||e?B7:L7,i=n||e?z7:P7,s=In("context");return O.jsx(r,{...t,...Pn(r,s),children:O.jsxs(i,{children:[O.jsx(I7,{}),O.jsx(k7,{}),O.jsx(D7,{})]})})}),{useEmitter:uN,useEmitterValue:In,usePublisher:no}=e1(O7,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},N7),L7=i1({useEmitter:uN,useEmitterValue:In,usePublisher:no}),B7=o1({useEmitter:uN,useEmitterValue:In,usePublisher:no});function xO(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,br.WARN),e==="normal"?0:parseInt(e??"0",10)}function Ue(...t){return C5(MI(t))}function _7({direction:t="horizontal",autoSaveId:e,id:n,className:r,disableCursor:i=!0,...s}){return O.jsx(nD,{"data-slot":"split",orientation:t,id:n??e,disableCursor:i,className:Ue("flex h-full w-full",r),...s})}function _g(t){return typeof t=="number"?`${t}%`:t}function H7({className:t,defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...s}){return O.jsx(rD,{"data-slot":"split-pane",className:Ue("min-h-0 min-w-0",t),defaultSize:_g(e),minSize:_g(n),maxSize:_g(r),collapsedSize:_g(i),...s})}function j7({className:t,withHandle:e=!1,children:n,...r}){return O.jsxs(iD,{"data-slot":"split-handle",className:Ue("group/split-handle relative flex items-center justify-center bg-border","aria-[orientation=vertical]:w-px aria-[orientation=vertical]:cursor-col-resize","aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:cursor-row-resize","after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2","outline-none",t),...r,children:[e&&O.jsx("div",{className:Ue("z-10 flex items-center justify-center rounded-sm border border-border bg-background","group-aria-[orientation=vertical]/split-handle:h-4 group-aria-[orientation=vertical]/split-handle:w-3","group-aria-[orientation=horizontal]/split-handle:h-3 group-aria-[orientation=horizontal]/split-handle:w-4 group-aria-[orientation=horizontal]/split-handle:rotate-90"),children:O.jsx(f8,{className:"h-2.5 w-2.5 text-muted-foreground"})}),n]})}const Hg=Object.assign(_7,{Pane:H7,Handle:j7});function V7(t,e){return t==="light"||t==="dark"?t:e?"dark":"light"}const cN="@rozenite/ui:theme";function F7(){try{return localStorage.getItem(cN)}catch{return null}}function U7(t){try{localStorage.setItem(cN,t)}catch{}}function $7(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{return!1}}const fN=E.createContext(null);function q7({children:t}){const[e,n]=E.useState(()=>V7(F7(),$7())),r=E.useCallback(a=>{n(a),U7(a)},[]),i=E.useCallback(()=>{r(e==="dark"?"light":"dark")},[r,e]),s=E.useMemo(()=>({theme:e,setTheme:r,toggleTheme:i}),[e,r,i]);return O.jsx(fN.Provider,{value:s,children:t})}function dN(){const t=E.useContext(fN);if(!t)throw new Error("usePluginTheme must be used within a PluginShell");return t}const hN=E.createContext(null);function qm(){return E.useContext(hN)}function G7({unstyled:t=!1,className:e,children:n,...r}){return t?O.jsx("div",{"data-slot":"plugin-shell",className:Ue("flex h-screen min-h-0 flex-col",e),...r,children:n}):O.jsx(q7,{children:O.jsx(W7,{className:e,...r,children:n})})}function W7({className:t,children:e,...n}){const{theme:r}=dN(),[i,s]=E.useState(null);return O.jsx("div",{ref:s,"data-slot":"plugin-shell",className:Ue(r==="dark"&&"dark","flex h-screen min-h-0 flex-col bg-background text-foreground",t),...n,children:O.jsx(hN.Provider,{value:i,children:e})})}function K7({className:t,...e}){return O.jsx("div",{"data-slot":"plugin-shell-body",className:Ue("flex min-h-0 flex-1 flex-col overflow-auto",t),...e})}const SO=Object.assign(G7,{Body:K7});function Y7({className:t,...e}){return O.jsx("header",{"data-slot":"plugin-header",className:Ue("flex shrink-0 items-center gap-3 border-b border-border bg-card px-4 py-3",t),...e})}function X7({className:t,...e}){return O.jsx("h1",{"data-slot":"plugin-header-title",className:Ue("text-sm font-semibold text-foreground",t),...e})}function Q7({className:t,...e}){return O.jsx("p",{"data-slot":"plugin-header-subtitle",className:Ue("text-xs text-muted-foreground",t),...e})}function Z7({className:t,...e}){return O.jsx("div",{"data-slot":"plugin-header-actions",className:Ue("ml-auto flex items-center gap-2",t),...e})}function J7({className:t,...e}){const{theme:n,toggleTheme:r}=dN();return O.jsx("button",{type:"button","data-slot":"plugin-header-theme-switcher","aria-label":n==="dark"?"Switch to light theme":"Switch to dark theme",onClick:r,className:Ue("inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground","hover:bg-accent hover:text-accent-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring","transition-colors",t),...e,children:n==="dark"?O.jsx(v8,{className:"h-4 w-4"}):O.jsx(g8,{className:"h-4 w-4"})})}Object.assign(Y7,{Title:X7,Subtitle:Q7,Actions:Z7,ThemeSwitcher:J7});function eW(t){return O.jsx(y$,{...t})}function tW({className:t,children:e,...n}){return O.jsxs(N$,{"data-slot":"select-trigger",className:Ue("flex h-8 w-full items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 text-sm text-foreground shadow-xs","outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50","disabled:pointer-events-none disabled:opacity-50",t),...n,children:[e,O.jsx(_$,{children:O.jsx(QS,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})})]})}function nW({className:t,...e}){return O.jsx(B$,{"data-slot":"select-value",className:Ue("truncate",t),...e})}function rW({className:t,side:e="bottom",sideOffset:n=4,align:r="start",children:i,...s}){const a=qm();return O.jsx(H$,{container:a,children:O.jsx(sq,{side:e,sideOffset:n,align:r,className:"z-50",children:O.jsx(gq,{"data-slot":"select-content",className:Ue("max-h-64 min-w-[--anchor-width] overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md","origin-(--transform-origin) transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",t),...s,children:O.jsx(mq,{children:i})})})})}function iW({className:t,children:e,...n}){return O.jsxs(yq,{"data-slot":"select-item",className:Ue("flex cursor-default items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground select-none","data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[O.jsx(xq,{children:e}),O.jsx(vq,{children:O.jsx(oD,{className:"h-3.5 w-3.5"})})]})}const Ju=Object.assign(eW,{Trigger:tW,Value:nW,Content:rW,Item:iW});function oW(t){return O.jsx(Oq,{...t})}function sW({className:t,...e}){return O.jsxs(Lq,{"data-slot":"combobox-input-group",className:"relative flex items-center",children:[O.jsx(zq,{"data-slot":"combobox-input",className:Ue("h-8 w-full rounded-md border border-input bg-transparent px-3 pr-14 text-sm text-foreground shadow-xs","outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50","placeholder:text-muted-foreground disabled:pointer-events-none disabled:opacity-50",t),...e}),O.jsxs("div",{className:"absolute right-1.5 flex items-center gap-0.5",children:[O.jsx(o9,{"data-slot":"combobox-clear",className:"inline-flex h-5 w-5 items-center justify-center rounded-sm text-muted-foreground hover:text-foreground",children:O.jsx(ZS,{className:"h-3.5 w-3.5"})}),O.jsx(Xq,{"data-slot":"combobox-icon",children:O.jsx(QS,{className:"h-3.5 w-3.5 text-muted-foreground"})})]})]})}function lW({className:t,side:e="bottom",sideOffset:n=4,align:r="start",emptyMessage:i="No results found.",children:s,...a}){const u=qm();return O.jsx(Gq,{container:u,children:O.jsx(Wq,{side:e,sideOffset:n,align:r,className:"z-50",children:O.jsxs(Yq,{"data-slot":"combobox-content",className:Ue("max-h-64 min-w-[--anchor-width] overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md","origin-(--transform-origin) transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",t),...a,children:[O.jsx(r9,{"data-slot":"combobox-empty",className:"px-2 py-1.5 text-sm text-muted-foreground",children:i}),O.jsx(jq,{children:s})]})})})}function aW({className:t,children:e,...n}){return O.jsxs(e9,{"data-slot":"combobox-item",className:Ue("flex cursor-default items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground select-none","data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[e,O.jsx(t9,{children:O.jsx(oD,{className:"h-3.5 w-3.5"})})]})}Object.assign(oW,{Input:sW,Content:lW,Item:aW});const gN=E.createContext(null);function uW(t){const[e,n]=E.useState(t.defaultOpen??!1),r=t.open??e;return O.jsx(gN.Provider,{value:r,children:O.jsx(m9,{...t,onOpenChange:(i,s)=>{t.open===void 0&&n(i),t.onOpenChange?.(i,s)}})})}function cW(t){return O.jsx(b9,{"data-slot":"dialog-trigger",...t})}function fW(t){return O.jsx(sz,{"data-slot":"dialog-close",...t})}function dW({className:t,children:e,showCloseButton:n=!0,...r}){const i=qm(),s=E.useContext(gN),a=E.useRef(e);return O.jsxs(u9,{container:i,children:[O.jsx(s9,{"data-slot":"dialog-backdrop",className:Ue("fixed inset-0 z-50 bg-background/70","transition-opacity data-[ending-style]:opacity-0 data-[starting-style]:opacity-0")}),O.jsx(y9,{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:O.jsxs(a9,{"data-slot":"dialog-content",className:Ue("relative flex w-full max-w-md flex-col gap-4 rounded-lg border border-border bg-card p-6 text-card-foreground shadow-lg","transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",t),render:u=>{const{children:f,...d}=u;return s&&(a.current=f),O.jsx("div",{...d,children:a.current})},...r,children:[e,n&&O.jsx(sz,{"data-slot":"dialog-close","aria-label":"Close",className:Ue("absolute top-4 right-4 inline-flex h-6 w-6 items-center justify-center rounded-sm text-muted-foreground","hover:bg-accent hover:text-accent-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:O.jsx(ZS,{className:"h-4 w-4"})})]})})]})}function hW({className:t,...e}){return O.jsx("div",{"data-slot":"dialog-header",className:Ue("flex flex-col gap-1.5",t),...e})}function gW({className:t,...e}){return O.jsx("div",{"data-slot":"dialog-footer",className:Ue("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...e})}function pW({className:t,...e}){return O.jsx(v9,{"data-slot":"dialog-title",className:Ue("text-sm font-semibold text-foreground",t),...e})}function mW({className:t,...e}){return O.jsx(l9,{"data-slot":"dialog-description",className:Ue("text-sm text-muted-foreground",t),...e})}const sn=Object.assign(uW,{Trigger:cW,Close:fW,Content:dW,Header:hW,Footer:gW,Title:pW,Description:mW});function yW(t){return O.jsx(N9,{"data-slot":"tooltip-provider",...t})}function vW(t){return O.jsx(R9,{"data-slot":"tooltip",...t})}function bW(t){return O.jsx(M9,{"data-slot":"tooltip-trigger",...t})}function xW({className:t,side:e="top",sideOffset:n=6,align:r="center",alignOffset:i=0,children:s,...a}){const u=qm();return O.jsx(I9,{container:u,children:O.jsx(P9,{side:e,sideOffset:n,align:r,alignOffset:i,className:"z-50",children:O.jsx(z9,{"data-slot":"tooltip-content",className:Ue("z-50 w-fit max-w-xs rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background","origin-(--transform-origin) transition-[transform,scale,opacity] data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0",t),...a,children:s})})})}Object.assign(vW,{Provider:yW,Trigger:bW,Content:xW});function SW(t){return O.jsx(L9,{"data-slot":"tabs",...t})}function wW({className:t,...e}){return O.jsx($9,{"data-slot":"tabs-list",className:Ue("inline-flex h-8 items-center gap-1 rounded-md bg-muted p-1 text-muted-foreground",t),...e})}function CW({className:t,...e}){return O.jsx(_9,{"data-slot":"tabs-tab",className:Ue("inline-flex h-6 items-center justify-center rounded-sm px-2.5 text-sm font-medium whitespace-nowrap text-muted-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring","data-[selected]:bg-background data-[selected]:text-foreground data-[selected]:shadow-xs","disabled:pointer-events-none disabled:opacity-50",t),...e})}function RW({className:t,...e}){return O.jsx(j9,{"data-slot":"tabs-panel",className:Ue("flex-1 outline-none",t),...e})}Object.assign(SW,{List:wW,Tab:CW,Panel:RW});function EW({className:t,...e}){return O.jsx(Z9,{"data-slot":"field",className:Ue("flex flex-col gap-1.5",t),...e})}function TW({className:t,...e}){return O.jsx(e2,{"data-slot":"field-label",className:Ue("text-sm font-medium text-foreground",t),...e})}function AW({className:t,...e}){return O.jsx(i2,{"data-slot":"field-control",className:Ue("h-8 w-full rounded-md border border-input bg-transparent px-3 text-sm text-foreground shadow-xs","outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50","placeholder:text-muted-foreground disabled:pointer-events-none disabled:opacity-50",t),...e})}function MW({className:t,...e}){return O.jsx(r2,{"data-slot":"field-description",className:Ue("text-xs text-muted-foreground",t),...e})}function OW({className:t,...e}){return O.jsx(n2,{"data-slot":"field-error",className:Ue("text-xs text-destructive",t),...e})}const Eo=Object.assign(EW,{Label:TW,Control:AW,Description:MW,Error:OW});function kW({orientation:t="horizontal",className:e,...n}){return O.jsx(o2,{"data-slot":"separator",orientation:t,className:Ue("shrink-0 bg-border",t==="vertical"?"h-4 w-px":"h-px w-full",e),...n})}function IW({className:t,...e}){return O.jsx(s2,{"data-slot":"toolbar",className:Ue("flex items-center gap-1 border-b border-border bg-card px-2 py-1.5",t),...e})}function DW({className:t,...e}){return O.jsx(c2,{"data-slot":"toolbar-button",className:Ue("inline-flex h-7 items-center justify-center gap-1.5 rounded-md px-2 text-sm font-medium text-foreground","hover:bg-accent hover:text-accent-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",t),...e})}function PW({orientation:t="vertical",className:e,...n}){return O.jsx(kW,{"data-slot":"toolbar-separator",orientation:t,className:Ue("mx-1",e),...n})}function zW({className:t,...e}){return O.jsx(a2,{"data-slot":"toolbar-group",className:Ue("flex items-center gap-1",t),...e})}const Yi=Object.assign(IW,{Button:DW,Separator:PW,Group:zW});function NW({className:t,...e}){return O.jsx("div",{"data-slot":"description-list",className:Ue("grid grid-cols-[minmax(7rem,25%)_minmax(3rem,1fr)] gap-x-2 gap-y-2 text-sm",t),...e})}function LW({label:t,className:e,children:n,...r}){return O.jsxs("div",{"data-slot":"description-list-item",className:Ue("contents",e),...r,children:[O.jsx("span",{className:"text-muted-foreground",children:t}),O.jsx("span",{className:"min-w-0",children:n})]})}Object.assign(NW,{Item:LW});const a1=E.createContext(null);function BW({collapsible:t=!1,defaultOpen:e=!0,className:n,...r}){const[i,s]=E.useState(e);return O.jsx(a1.Provider,{value:{collapsible:t,open:i,toggle:()=>s(a=>!a)},children:O.jsx("div",{"data-slot":"card",className:Ue("rounded-lg border border-border bg-card text-card-foreground",n),...r})})}function _W({className:t,children:e,...n}){const r=E.useContext(a1);return O.jsxs("div",{"data-slot":"card-header",className:Ue("flex items-center gap-2 p-3",t),...n,children:[r?.collapsible&&O.jsx("button",{type:"button","data-slot":"card-collapse-toggle","aria-expanded":r.open,"aria-label":r.open?"Collapse":"Expand",className:Ue("flex size-5 shrink-0 items-center justify-center rounded outline-none","text-muted-foreground hover:bg-accent hover:text-accent-foreground","focus-visible:ring-2 focus-visible:ring-ring"),onClick:r.toggle,children:O.jsx(XS,{"aria-hidden":"true",className:Ue("size-4 transition-transform",r.open&&"rotate-90")})}),O.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:e})]})}function HW({className:t,...e}){const n=E.useContext(a1);return n?.collapsible&&!n.open?null:O.jsx("div",{"data-slot":"card-body",className:Ue("border-t border-border p-3",t),...e})}Object.assign(BW,{Header:_W,Body:HW});const jW=wz(Ue("relative inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md text-sm font-medium transition-colors","outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0"),{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground",ghost:"text-foreground hover:bg-accent hover:text-accent-foreground"},size:{default:"h-8 px-3 [&_svg]:size-4",compact:"h-6 px-2 text-xs [&_svg]:size-3.5",icon:"h-8 w-8 [&_svg]:size-4"}},defaultVariants:{variant:"default",size:"default"}});function Li({className:t,variant:e,size:n,type:r="button",adornment:i,children:s,...a}){return O.jsxs("button",{type:r,"data-slot":"button",className:Ue(jW({variant:e,size:n}),t),...a,children:[s,i]})}const VW=wz("inline-flex w-fit shrink-0 items-center justify-center rounded-sm px-2 py-0.5 text-xs font-medium whitespace-nowrap",{variants:{variant:{default:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",outline:"border border-border text-foreground"}},defaultVariants:{variant:"default"}});function Fp({className:t,variant:e,...n}){return O.jsx("span",{"data-slot":"badge",className:Ue(VW({variant:e}),t),...n})}function Fx({className:t,type:e="text",...n}){return O.jsx("input",{type:e,"data-slot":"input",className:Ue("h-8 w-full min-w-0 rounded-md border border-input bg-transparent px-3 text-sm text-foreground shadow-xs transition-colors","outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50","placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",t),...n})}function FW({className:t,value:e,onClear:n,...r}){const i=!!n&&!!e;return O.jsxs("div",{"data-slot":"search-field",className:"relative flex items-center",children:[O.jsx(y8,{className:"pointer-events-none absolute left-2.5 h-3.5 w-3.5 text-muted-foreground"}),O.jsx("input",{type:"search",value:e,className:Ue("h-8 w-full min-w-0 rounded-md border border-input bg-transparent pl-8 text-sm text-foreground shadow-xs transition-colors",i?"pr-8":"pr-3","outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50","placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50","[&::-webkit-search-cancel-button]:appearance-none",t),...r}),i&&O.jsx("button",{type:"button",onClick:n,"aria-label":"Clear search",className:"absolute right-2 inline-flex h-4 w-4 items-center justify-center rounded-sm text-muted-foreground hover:text-foreground",children:O.jsx(ZS,{className:"h-3.5 w-3.5"})})]})}const UW=({children:t,context:e,style:n})=>O.jsx("table",{"aria-label":e.ariaLabel,className:e.tableClassName,style:n,children:t}),$W=({children:t,context:e,item:n,...r})=>{const i=n,s=!!e.onRowClick,a=()=>{e.onRowClick?.(i.original)},u=f=>{!s||f.key!=="Enter"&&f.key!==" "||(f.preventDefault(),a())};return O.jsx("tr",{...r,"aria-label":e.getRowTextValue?.(i.original,i.index)??String(i.id),className:`border-b border-border last:border-0 transition-colors hover:bg-accent/50 ${s?"cursor-pointer":""}`,onClick:s?a:void 0,onKeyDown:u,tabIndex:s?0:void 0,children:t})},qW=({context:t})=>O.jsx("tr",{children:O.jsx("td",{colSpan:t.columnCount,children:t.renderEmptyState?.()??O.jsx("div",{className:"flex min-h-56 w-full items-center justify-center px-4 py-10 text-center",children:O.jsx("span",{className:"text-sm text-muted-foreground",children:t.isLoading?"Loading…":t.emptyMessage})})})}),GW={EmptyPlaceholder:qW,Table:UW,TableRow:$W},WW=({ariaLabel:t,data:e,columns:n,getRowId:r,getRowTextValue:i,onRowClick:s,onStartReached:a,onEndReached:u,sorting:f,onSortingChange:d,manualSorting:g=!1,loading:p=!1,emptyMessage:m="No data available",renderEmptyState:v,className:b="w-full border-collapse text-sm",scrollClassName:S="h-full w-full overflow-auto",style:w={height:400}})=>{const[C,R]=E.useState([]),T=f??C,A=E.useCallback(N=>{const _=typeof N=="function"?N(T):N;f===void 0&&R(_),d?.(_)},[f,d,T]),k=nG({columns:n,data:e,getCoreRowModel:Q2(),getRowId:r,getSortedRowModel:Z2(),manualSorting:g,onSortingChange:A,state:{sorting:T}}),P=k.getRowModel().rows,M=E.useMemo(()=>({ariaLabel:t,columnCount:k.getVisibleLeafColumns().length,emptyMessage:m,getRowTextValue:i,isLoading:p,onRowClick:s,renderEmptyState:v,tableClassName:b}),[t,b,m,i,p,s,v,k]),D=E.useCallback((N,_)=>_.getVisibleCells().map($=>O.jsx("td",{className:"px-3 py-1.5 text-foreground",children:nb($.column.columnDef.cell,$.getContext())},$.id)),[]),L=E.useCallback(()=>k.getHeaderGroups().map(N=>O.jsx("tr",{className:"border-b border-border",children:N.headers.map(_=>{const $=_.column.getCanSort(),F=_.column.getIsSorted();return O.jsx("th",{"aria-sort":F==="asc"?"ascending":F==="desc"?"descending":"none",colSpan:_.colSpan,className:"h-8 px-3 text-left text-xs font-medium text-muted-foreground",scope:"col",children:_.isPlaceholder?null:$?O.jsxs("button",{className:"inline-flex items-center gap-1 hover:text-foreground",onClick:_.column.getToggleSortingHandler(),type:"button",children:[nb(_.column.columnDef.header,_.getContext()),O.jsx("span",{"aria-hidden":"true",children:O.jsx(KW,{direction:F})})]}):nb(_.column.columnDef.header,_.getContext())},_.id)})},N.id)),[k]),H=E.useCallback((N,_)=>_.id,[]);return O.jsx(C7,{className:S,components:GW,computeItemKey:H,context:M,data:P,endReached:u,fixedHeaderContent:L,itemContent:D,startReached:a,style:w})};function KW({direction:t}){return t==="asc"?O.jsx(u8,{className:"h-3 w-3"}):t==="desc"?O.jsx(a8,{className:"h-3 w-3"}):O.jsx(QS,{className:"h-3 w-3 text-muted-foreground/60"})}function YW({className:t,...e}){return O.jsx("div",{"data-slot":"list",className:Ue("flex flex-col gap-4",t),...e})}function XW({className:t,label:e,children:n,...r}){return O.jsxs("div",{"data-slot":"list-group",className:Ue("flex flex-col gap-0.5",t),...r,children:[e&&O.jsx("div",{"data-slot":"list-group-label",className:"px-2 py-1 text-xs font-medium text-sidebar-foreground/60",children:e}),n]})}function QW({className:t,selected:e=!1,adornment:n,trailing:r,children:i,type:s="button",...a}){return O.jsxs("button",{type:s,"data-slot":"list-item","data-selected":e||void 0,"aria-current":e||void 0,className:Ue("flex h-7 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-sidebar-foreground","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring","data-[selected]:bg-sidebar-accent data-[selected]:text-sidebar-accent-foreground data-[selected]:font-medium",t),...a,children:[n&&O.jsx("span",{"data-slot":"list-item-adornment",className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center [&_svg]:h-3.5 [&_svg]:w-3.5",children:n}),O.jsx("span",{className:"min-w-0 flex-1 truncate",children:i}),r]})}const wO=Object.assign(YW,{Group:XW,Item:QW}),Ux=E.createContext(0),ZW=16,JW=8;function eK({className:t,children:e,...n}){return O.jsx("div",{"data-slot":"nested-list",className:Ue("flex flex-col gap-0.5",t),...n,children:O.jsx(Ux.Provider,{value:0,children:e})})}function tK({className:t,label:e,adornment:n,trailing:r,selected:i=!1,defaultExpanded:s=!1,expanded:a,onExpandedChange:u,children:f,onClick:d,type:g="button",...p}){const m=E.useContext(Ux),v=E.Children.count(f)>0,[b,S]=E.useState(s),w=a??b,C=R=>{const T=!w;S(T),u?.(T),d?.(R)};return O.jsxs("div",{"data-slot":"nested-list-item",children:[O.jsxs("button",{type:g,"data-slot":"nested-list-item-row","data-selected":i||void 0,"data-expanded":w||void 0,"aria-current":i||void 0,"aria-expanded":v?w:void 0,style:{paddingLeft:JW+m*ZW},className:Ue("flex h-7 min-w-full items-center gap-1.5 rounded-md pr-2 text-left text-sm text-sidebar-foreground","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring","data-[selected]:bg-sidebar-accent data-[selected]:text-sidebar-accent-foreground data-[selected]:font-medium",t),onClick:v?C:d,...p,children:[v?O.jsx(XS,{"data-slot":"nested-list-item-chevron",className:Ue("h-3.5 w-3.5 shrink-0 text-sidebar-foreground/60 transition-transform",w&&"rotate-90")}):O.jsx("span",{className:"h-3.5 w-3.5 shrink-0"}),n&&O.jsx("span",{"data-slot":"list-item-adornment",className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center [&_svg]:h-3.5 [&_svg]:w-3.5",children:n}),O.jsx("span",{className:"flex-1 whitespace-nowrap",children:e}),r]}),v&&w&&O.jsx(Ux.Provider,{value:m+1,children:O.jsx("div",{"data-slot":"nested-list-children",className:"flex flex-col gap-0.5",children:f})})]})}Object.assign(eK,{Item:tK});function nK({className:t,...e}){return O.jsx("nav",{"data-slot":"sidebar",className:Ue("flex h-full w-56 shrink-0 flex-col gap-4 overflow-y-auto border-r border-sidebar-border bg-sidebar p-2 text-sidebar-foreground",t),...e})}function rK({className:t,...e}){return O.jsx("header",{"data-slot":"sidebar-header",className:Ue("sticky top-0 z-10 flex h-12 shrink-0 items-center border-b border-sidebar-border bg-sidebar px-3",t),...e})}function iK({className:t,...e}){return O.jsx("footer",{"data-slot":"sidebar-footer",className:Ue("mt-auto flex shrink-0 gap-1 border-t border-sidebar-border p-2",t),...e})}const ab=Object.assign(nK,{Group:wO.Group,Item:wO.Item,Header:rK,Footer:iK});function oK({className:t,icon:e,title:n,description:r,action:i,...s}){return O.jsxs("div",{"data-slot":"empty-state",className:Ue("flex flex-1 flex-col items-center justify-center gap-1.5 p-8 text-center",t),...s,children:[e&&O.jsx(e,{className:"mb-2 h-8 w-8 text-muted-foreground"}),O.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),r&&O.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:r}),i&&O.jsx("div",{className:"mt-3",children:i})]})}function ed({open:t,onOpenChange:e,title:n,description:r,variant:i="confirm",destructive:s=!1,confirmLabel:a,cancelLabel:u="Cancel",onConfirm:f}){const d=i==="alert";return O.jsx(sn,{open:t,onOpenChange:e,children:O.jsxs(sn.Content,{showCloseButton:!1,children:[O.jsxs(sn.Header,{children:[O.jsx(sn.Title,{children:n}),r&&O.jsx(sn.Description,{children:r})]}),O.jsxs(sn.Footer,{children:[!d&&O.jsx(sn.Close,{render:O.jsx(Li,{variant:"outline"}),children:u}),O.jsx(sn.Close,{render:O.jsx(Li,{variant:s?"destructive":"default"}),onClick:f,children:a??(d?"OK":"Confirm")})]})]})})}const sK=new Set(["object","array"]);function u1(t){if(t===null)return"null";if(Array.isArray(t))return"array";const e=typeof t;return e==="object"?"object":e}function lK(t){return sK.has(u1(t))}function pN(t){if(Array.isArray(t))return t.map((e,n)=>String(n));if(u1(t)==="object")return Object.keys(t)}function aK(t){const e=pN(t)??[];return Array.isArray(t)?`[${e.length}]`:`{${e.length}}`}function uK({data:t,className:e,defaultExpandedDepth:n=1}){return O.jsx("div",{"data-slot":"json-inspector",className:Ue("font-mono text-xs",e),children:O.jsx(mN,{label:null,value:t,depth:0,defaultExpandedDepth:n})})}function mN({label:t,value:e,depth:n,defaultExpandedDepth:r}){const[i,s]=E.useState(n<r);if(!lK(e))return O.jsxs("div",{"data-slot":"json-inspector-leaf",className:"flex gap-1",children:[t!==null&&O.jsxs("span",{className:"text-muted-foreground",children:[t,":"]}),O.jsx(fK,{value:e})]});const a=pN(e)??[];return O.jsxs("div",{"data-slot":"json-inspector-node",children:[O.jsxs("button",{type:"button",onClick:()=>s(u=>!u),className:"inline-flex items-center gap-1 text-foreground hover:text-primary",children:[O.jsx(XS,{className:Ue("h-3 w-3 shrink-0 text-muted-foreground transition-transform",i&&"rotate-90")}),t!==null&&O.jsxs("span",{className:"text-muted-foreground",children:[t,":"]}),O.jsx("span",{className:"text-muted-foreground",children:aK(e)})]}),i&&O.jsx("div",{className:"ml-3.5 border-l border-border pl-2",children:a.map(u=>O.jsx(mN,{label:u,value:e[u],depth:n+1,defaultExpandedDepth:r},u))})]})}const cK={string:"text-primary",number:"text-accent-foreground",boolean:"text-secondary-foreground",null:"text-destructive",undefined:"text-destructive"};function fK({value:t}){const e=u1(t),n=e==="string"?`"${t}"`:String(t);return O.jsx("span",{className:cK[e]??"text-foreground",children:n})}const CO=["string","number","boolean","buffer"],jg=({adapterId:t,storageId:e})=>`${t}:${e}`,ub=1;class Ao extends Error{constructor(e,n){super(n),this.path=e}}const ls=t=>t===null?"null":Array.isArray(t)?"array":typeof t,dK=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),Gm=(t,e)=>{if(!dK(t))throw new Ao(e,`Expected object, got ${ls(t)}`);return t},Xa=(t,e)=>{if(typeof t!="string")throw new Ao(e,`Expected string, got ${ls(t)}`);return t},yN=(t,e)=>{if(!Array.isArray(t))throw new Ao(e,`Expected array, got ${ls(t)}`);return t},vN=(t,e)=>{if(typeof t!="string"||!CO.includes(t))throw new Ao(e,`Expected one of ${CO.join(", ")}, got ${ls(t)}`);return t},hK=(t,e)=>{const n=Gm(t,e);return{supportedTypes:yN(n.supportedTypes,`${e}.supportedTypes`).map((s,a)=>vN(s,`${e}.supportedTypes[${a}]`))}},gK=t=>{const e=Gm(t,"storage");return{adapterId:Xa(e.adapterId,"storage.adapterId"),storageId:Xa(e.storageId,"storage.storageId"),adapterName:Xa(e.adapterName,"storage.adapterName"),storageName:Xa(e.storageName,"storage.storageName"),capabilities:hK(e.capabilities,"storage.capabilities")}},pK=(t,e)=>{const n=Gm(t,e),r=Xa(n.key,`${e}.key`),i=vN(n.type,`${e}.type`),s=`${e}.value`;switch(i){case"string":{const a=n.value;if(typeof a!="string")throw new Ao(s,`Expected string for type "string", got ${ls(a)}`);return{key:r,type:"string",value:a}}case"number":{const a=n.value;if(typeof a!="number"||!Number.isFinite(a))throw new Ao(s,`Expected finite number for type "number", got ${ls(a)}`);return{key:r,type:"number",value:a}}case"boolean":{const a=n.value;if(typeof a!="boolean")throw new Ao(s,`Expected boolean for type "boolean", got ${ls(a)}`);return{key:r,type:"boolean",value:a}}case"buffer":{const a=n.value;if(!Array.isArray(a))throw new Ao(s,`Expected number[] for type "buffer", got ${ls(a)}`);const u=a.map((f,d)=>{if(typeof f!="number"||!Number.isInteger(f)||f<0||f>255)throw new Ao(`${s}[${d}]`,`Expected uint8 (integer 0-255), got ${ls(f)}`);return f});return{key:r,type:"buffer",value:u}}}},mK=t=>{try{const e=Gm(t,"$"),n=e.version;if(n!==ub)throw new Ao("version",`Unsupported snapshot version: ${ls(n)} (this build supports version ${ub})`);const r=Xa(e.plugin,"plugin"),i=Xa(e.createdAt,"createdAt"),s=gK(e.storage),u=yN(e.entries,"entries").map((f,d)=>pK(f,`entries[${d}]`));return{ok:!0,snapshot:{version:ub,plugin:r,createdAt:i,storage:s,entries:u}}}catch(e){if(e instanceof Ao)return{ok:!1,error:{path:e.path,message:e.message}};throw e}};let $x=[],bN=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?bN:$x).push(n=n+t[e])})();function yK(t){if(t<768)return!1;for(let e=0,n=$x.length;;){let r=e+n>>1;if(t<$x[r])n=r;else if(t>=bN[r])e=r+1;else return!0;if(e==n)return!1}}function RO(t){return t>=127462&&t<=127487}const EO=8205;function vK(t,e,n=!0,r=!0){return(n?xN:bK)(t,e,r)}function xN(t,e,n){if(e==t.length)return e;e&&SN(t.charCodeAt(e))&&wN(t.charCodeAt(e-1))&&e--;let r=cb(t,e);for(e+=TO(r);e<t.length;){let i=cb(t,e);if(r==EO||i==EO||n&&yK(i))e+=TO(i),r=i;else if(RO(i)){let s=0,a=e-2;for(;a>=0&&RO(cb(t,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function bK(t,e,n){for(;e>0;){let r=xN(t,e-2,n);if(r<e)return r;e--}return 0}function cb(t,e){let n=t.charCodeAt(e);if(!wN(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return SN(r)?(n-55296<<10)+(r-56320)+65536:n}function SN(t){return t>=56320&&t<57344}function wN(t){return t>=55296&&t<56320}function TO(t){return t<65536?1:2}class qt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Cc(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),as.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Cc(this,e,n);let r=[];return this.decompose(e,n,r,0),as.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new td(this),s=new td(e);for(let a=n,u=n;;){if(i.next(a),s.next(a),a=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(u+=i.value.length,i.done||u>=r)return!0}}iter(e=1){return new td(this,e)}iterRange(e,n=this.length){return new CN(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new RN(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?qt.empty:e.length<=32?new nr(e):as.from(nr.split(e,[]))}}class nr extends qt{constructor(e,n=xK(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let s=0;;s++){let a=this.text[s],u=i+a.length;if((n?r:u)>=e)return new SK(i,u,r,a);i=u+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new nr(AO(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),u=mp(s.text,a.text.slice(),0,s.length);if(u.length<=32)r.push(new nr(u,a.length+s.length));else{let f=u.length>>1;r.push(new nr(u.slice(0,f)),new nr(u.slice(f)))}}else r.push(s)}replace(e,n,r){if(!(r instanceof nr))return super.replace(e,n,r);[e,n]=Cc(this,e,n);let i=mp(this.text,mp(r.text,AO(this.text,0,e)),n),s=this.length+r.length-(n-e);return i.length<=32?new nr(i,s):as.from(nr.split(i,[]),s)}sliceString(e,n=this.length,r=`
|
|
22
|
-
`){[e,n]=Cc(this,e,n);let i="";for(let s=0,a=0;s<=n&&a<this.text.length;a++){let u=this.text[a],f=s+u.length;s>e&&a&&(i+=r),e<f&&n>s&&(i+=u.slice(Math.max(0,e-s),n-s)),s=f+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(n.push(new nr(r,i)),r=[],i=-1);return i>-1&&n.push(new nr(r,i)),n}}class as extends qt{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let s=0;;s++){let a=this.children[s],u=i+a.length,f=r+a.lines-1;if((n?f:u)>=e)return a.lineInner(e,n,r,i);i=u+1,r=f+1}}decompose(e,n,r,i){for(let s=0,a=0;a<=n&&s<this.children.length;s++){let u=this.children[s],f=a+u.length;if(e<=f&&n>=a){let d=i&((a<=e?1:0)|(f>=n?2:0));a>=e&&f<=n&&!d?r.push(u):u.decompose(e-a,n-a,r,d)}a=f+1}}replace(e,n,r){if([e,n]=Cc(this,e,n),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let a=this.children[i],u=s+a.length;if(e>=s&&n<=u){let f=a.replace(e-s,n-s,r),d=this.lines-a.lines+f.lines;if(f.lines<d>>4&&f.lines>d>>6){let g=this.children.slice();return g[i]=f,new as(g,this.length-(n-e)+r.length)}return super.replace(s,u,f)}s=u+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
|
|
23
|
-
`){[e,n]=Cc(this,e,n);let i="";for(let s=0,a=0;s<this.children.length&&a<=n;s++){let u=this.children[s],f=a+u.length;a>e&&s&&(i+=r),e<f&&n>a&&(i+=u.sliceString(e-a,n-a,r)),a=f+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof as))return 0;let r=0,[i,s,a,u]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,s+=n){if(i==a||s==u)return r;let f=this.children[i],d=e.children[s];if(f!=d)return r+f.scanIdentical(d,n);r+=f.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let v of e)r+=v.lines;if(r<32){let v=[];for(let b of e)b.flatten(v);return new nr(v,n)}let i=Math.max(32,r>>5),s=i<<1,a=i>>1,u=[],f=0,d=-1,g=[];function p(v){let b;if(v.lines>s&&v instanceof as)for(let S of v.children)p(S);else v.lines>a&&(f>a||!f)?(m(),u.push(v)):v instanceof nr&&f&&(b=g[g.length-1])instanceof nr&&v.lines+b.lines<=32?(f+=v.lines,d+=v.length+1,g[g.length-1]=new nr(b.text.concat(v.text),b.length+1+v.length)):(f+v.lines>i&&m(),f+=v.lines,d+=v.length+1,g.push(v))}function m(){f!=0&&(u.push(g.length==1?g[0]:as.from(g,d)),d=-1,f=g.length=0)}for(let v of e)p(v);return m(),u.length==1?u[0]:new as(u,n)}}qt.empty=new nr([""],0);function xK(t){let e=-1;for(let n of t)e+=n.length+1;return e}function mp(t,e,n=0,r=1e9){for(let i=0,s=0,a=!0;s<t.length&&i<=r;s++){let u=t[s],f=i+u.length;f>=n&&(f>r&&(u=u.slice(0,r-i)),i<n&&(u=u.slice(n-i)),a?(e[e.length-1]+=u,a=!1):e.push(u)),i=f+1}return e}function AO(t,e,n){return mp(t,[""],e,n)}class td{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof nr?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],a=s>>1,u=i instanceof nr?i.text.length:i.children.length;if(a==(n>0?u:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
24
|
-
`,this;e--}else if(i instanceof nr){let f=i.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,f.length>Math.max(0,e))return this.value=e==0?f:n>0?f.slice(e):f.slice(0,f.length-e),this;e-=f.length}else{let f=i.children[a+(n<0?-1:0)];e>f.length?(e-=f.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(f),this.offsets.push(n>0?1:(f instanceof nr?f.text.length:f.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class CN{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new td(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class RN{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(qt.prototype[Symbol.iterator]=function(){return this.iter()},td.prototype[Symbol.iterator]=CN.prototype[Symbol.iterator]=RN.prototype[Symbol.iterator]=function(){return this});class SK{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function Cc(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Yr(t,e,n=!0,r=!0){return vK(t,e,n,r)}function wK(t){return t>=56320&&t<57344}function CK(t){return t>=55296&&t<56320}function RK(t,e){let n=t.charCodeAt(e);if(!CK(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return wK(r)?(n-55296<<10)+(r-56320)+65536:n}function EK(t){return t<65536?1:2}const qx=/\r\n?|\n/;var Di=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Di||(Di={}));class ms{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let s=this.sections[n++],a=this.sections[n++];a<0?(e(r,i,s),i+=s):i+=a,r+=s}}iterChangedRanges(e,n=!1){Gx(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new ms(e)}composeDesc(e){return this.empty?e:e.empty?this:EN(this,e)}mapDesc(e,n=!1){return e.empty?this:Wx(this,e,n)}mapPos(e,n=-1,r=Di.Simple){let i=0,s=0;for(let a=0;a<this.sections.length;){let u=this.sections[a++],f=this.sections[a++],d=i+u;if(f<0){if(d>e)return s+(e-i);s+=u}else{if(r!=Di.Simple&&d>=e&&(r==Di.TrackDel&&i<e&&d>e||r==Di.TrackBefore&&i<e||r==Di.TrackAfter&&d>e))return null;if(d>e||d==e&&n<0&&!u)return e==i||n<0?s:s+f;s+=f}i=d}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let s=this.sections[r++],a=this.sections[r++],u=i+s;if(a>=0&&i<=n&&u>=e)return i<e&&u>n?"cover":!0;i=u}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ms(e)}static create(e){return new ms(e)}}class vr extends ms{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Gx(this,(n,r,i,s,a)=>e=e.replace(i,i+(r-n),a),!1),e}mapDesc(e,n=!1){return Wx(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,s=0;i<n.length;i+=2){let a=n[i],u=n[i+1];if(u>=0){n[i]=u,n[i+1]=a;let f=i>>1;for(;r.length<f;)r.push(qt.empty);r.push(a?e.slice(s,s+a):qt.empty)}s+=a}return new vr(n,r)}compose(e){return this.empty?e:e.empty?this:EN(this,e,!0)}map(e,n=!1){return e.empty?this:Wx(this,e,n,!0)}iterChanges(e,n=!1){Gx(this,e,n)}get desc(){return ms.create(this.sections)}filter(e){let n=[],r=[],i=[],s=new Ad(this);e:for(let a=0,u=0;;){let f=a==e.length?1e9:e[a++];for(;u<f||u==f&&s.len==0;){if(s.done)break e;let g=Math.min(s.len,f-u);Wr(i,g,-1);let p=s.ins==-1?-1:s.off==0?s.ins:0;Wr(n,g,p),p>0&&Ql(r,n,s.text),s.forward(g),u+=g}let d=e[a++];for(;u<d;){if(s.done)break e;let g=Math.min(s.len,d-u);Wr(n,g,-1),Wr(i,g,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(g),u+=g}}return{changes:new vr(n,r),filtered:ms.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],s=[],a=0,u=null;function f(g=!1){if(!g&&!i.length)return;a<n&&Wr(i,n-a,-1);let p=new vr(i,s);u=u?u.compose(p.map(u)):p,i=[],s=[],a=0}function d(g){if(Array.isArray(g))for(let p of g)d(p);else if(g instanceof vr){if(g.length!=n)throw new RangeError(`Mismatched change set length (got ${g.length}, expected ${n})`);f(),u=u?u.compose(g.map(u)):g}else{let{from:p,to:m=p,insert:v}=g;if(p>m||p<0||m>n)throw new RangeError(`Invalid change range ${p} to ${m} (in doc of length ${n})`);let b=v?typeof v=="string"?qt.of(v.split(r||qx)):v:qt.empty,S=b.length;if(p==m&&S==0)return;p<a&&f(),p>a&&Wr(i,p-a,-1),Wr(i,m-p,S),Ql(s,i,b),a=m}}return d(e),f(!u),u}static empty(e){return new vr(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((a,u)=>u&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length<i;)r.push(qt.empty);r[i]=qt.of(s.slice(1)),n.push(s[0],r[i].length)}}}return new vr(n,r)}static createSet(e,n){return new vr(e,n)}}function Wr(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function Ql(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(qt.empty);t.push(n)}}function Gx(t,e,n){let r=t.inserted;for(let i=0,s=0,a=0;a<t.sections.length;){let u=t.sections[a++],f=t.sections[a++];if(f<0)i+=u,s+=u;else{let d=i,g=s,p=qt.empty;for(;d+=u,g+=f,f&&r&&(p=p.append(r[a-2>>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)u=t.sections[a++],f=t.sections[a++];e(i,d,s,g,p),i=d,s=g}}}function Wx(t,e,n,r=!1){let i=[],s=r?[]:null,a=new Ad(t),u=new Ad(e);for(let f=-1;;){if(a.done&&u.len||u.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&u.ins==-1){let d=Math.min(a.len,u.len);Wr(i,d,-1),a.forward(d),u.forward(d)}else if(u.ins>=0&&(a.ins<0||f==a.i||a.off==0&&(u.len<a.len||u.len==a.len&&!n))){let d=u.len;for(Wr(i,u.ins,-1);d;){let g=Math.min(a.len,d);a.ins>=0&&f<a.i&&a.len<=g&&(Wr(i,0,a.ins),s&&Ql(s,i,a.text),f=a.i),a.forward(g),d-=g}u.next()}else if(a.ins>=0){let d=0,g=a.len;for(;g;)if(u.ins==-1){let p=Math.min(g,u.len);d+=p,g-=p,u.forward(p)}else if(u.ins==0&&u.len<g)g-=u.len,u.next();else break;Wr(i,d,f<a.i?a.ins:0),s&&f<a.i&&Ql(s,i,a.text),f=a.i,a.forward(a.len-g)}else{if(a.done&&u.done)return s?vr.createSet(i,s):ms.create(i);throw new Error("Mismatched change set lengths")}}}function EN(t,e,n=!1){let r=[],i=n?[]:null,s=new Ad(t),a=new Ad(e);for(let u=!1;;){if(s.done&&a.done)return i?vr.createSet(r,i):ms.create(r);if(s.ins==0)Wr(r,s.len,0,u),s.next();else if(a.len==0&&!a.done)Wr(r,0,a.ins,u),i&&Ql(i,r,a.text),a.next();else{if(s.done||a.done)throw new Error("Mismatched change set lengths");{let f=Math.min(s.len2,a.len),d=r.length;if(s.ins==-1){let g=a.ins==-1?-1:a.off?0:a.ins;Wr(r,f,g,u),i&&g&&Ql(i,r,a.text)}else a.ins==-1?(Wr(r,s.off?0:s.len,f,u),i&&Ql(i,r,s.textBit(f))):(Wr(r,s.off?0:s.len,a.off?0:a.ins,u),i&&!a.off&&Ql(i,r,a.text));u=(s.ins>f||a.ins>=0&&a.len>f)&&(u||r.length>d),s.forward2(f),a.forward(f)}}}}class Ad{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?qt.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?qt.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Qa{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Qa(r,i,this.flags)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return Te.range(e,n,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Te.range(this.anchor,i,void 0,void 0,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Te.range(e.anchor,e.head)}static create(e,n,r){return new Qa(e,n,r)}}class Te{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Te.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Te([this.main],0)}addRange(e,n=!0){return Te.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,Te.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Te(e.ranges.map(n=>Qa.fromJSON(n)),e.main)}static single(e,n=e){return new Te([Te.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return Te.normalized(e.slice(),n);r=s.to}return new Te(e,n)}static cursor(e,n=0,r,i){return Qa.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i,s){let a=(r??16777215)<<6|(i==null?7:Math.min(6,i));return!s&&e!=n&&(s=n<e?1:-1),n<e?Qa.create(n,e,48|a):Qa.create(e,n,(s?s<0?8:16:0)|a)}static normalized(e,n=0){let r=e[n];e.sort((i,s)=>i.from-s.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],a=e[i-1];if(s.empty?s.from<=a.to:s.from<a.to){let u=a.from,f=Math.max(s.to,a.to);i<=n&&n--,e.splice(--i,2,s.anchor>s.head?Te.range(f,u):Te.range(u,f))}}return new Te(e,n)}}function TN(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let c1=0;class vt{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=c1++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new vt(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:f1),!!e.static,e.enables)}of(e){return new yp([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new yp(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new yp(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function f1(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class yp{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=c1++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,s=this.id,a=e[s]>>1,u=this.type==2,f=!1,d=!1,g=[];for(let p of this.dependencies)p=="doc"?f=!0:p=="selection"?d=!0:(((n=e[p.id])!==null&&n!==void 0?n:1)&1)==0&&g.push(e[p.id]);return{create(p){return p.values[a]=r(p),1},update(p,m){if(f&&m.docChanged||d&&(m.docChanged||m.selection)||Kx(p,g)){let v=r(p);if(u?!MO(v,p.values[a],i):!i(v,p.values[a]))return p.values[a]=v,1}return 0},reconfigure:(p,m)=>{let v,b=m.config.address[s];if(b!=null){let S=$p(m,b);if(this.dependencies.every(w=>w instanceof vt?m.facet(w)===p.facet(w):w instanceof va?m.field(w,!1)==p.field(w,!1):!0)||(u?MO(v=r(p),S,i):i(v=r(p),S)))return p.values[a]=S,0}else v=r(p);return p.values[a]=v,1}}}}function MO(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function Kx(t,e){let n=!1;for(let r of e)nd(t,r)&1&&(n=!0);return n}function TK(t,e,n){let r=n.map(f=>t[f.id]),i=n.map(f=>f.type),s=r.filter(f=>!(f&1)),a=t[e.id]>>1;function u(f){let d=[];for(let g=0;g<r.length;g++){let p=$p(f,r[g]);if(i[g]==2)for(let m of p)d.push(m);else d.push(p)}return e.combine(d)}return{create(f){for(let d of r)nd(f,d);return f.values[a]=u(f),1},update(f,d){if(!Kx(f,s))return 0;let g=u(f);return e.compare(g,f.values[a])?0:(f.values[a]=g,1)},reconfigure(f,d){let g=Kx(f,r),p=d.config.facets[e.id],m=d.facet(e);if(p&&!g&&f1(n,p))return f.values[a]=m,0;let v=u(f);return e.compare(v,m)?(f.values[a]=m,0):(f.values[a]=v,1)}}}const Vg=vt.define({static:!0});class va{constructor(e,n,r,i,s){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let n=new va(c1++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Vg).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let s=r.values[n],a=this.updateF(s,i);return this.compareF(s,a)?0:(r.values[n]=a,1)},reconfigure:(r,i)=>{let s=r.facet(Vg),a=i.facet(Vg),u;return(u=s.find(f=>f.field==this))&&u!=a.find(f=>f.field==this)?(r.values[n]=u.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Vg.of({field:this,create:e})]}get extension(){return this}}const Ga={lowest:4,low:3,default:2,high:1,highest:0};function zf(t){return e=>new MN(e,t)}const AN={highest:zf(Ga.highest),high:zf(Ga.high),default:zf(Ga.default),low:zf(Ga.low),lowest:zf(Ga.lowest)};class MN{constructor(e,n){this.inner=e,this.prec=n}}class Wm{of(e){return new Yx(this,e)}reconfigure(e){return Wm.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Yx{constructor(e,n){this.compartment=e,this.inner=n}}class Up{constructor(e,n,r,i,s,a){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],s=Object.create(null),a=new Map;for(let m of AK(e,n,a))m instanceof va?i.push(m):(s[m.facet.id]||(s[m.facet.id]=[])).push(m);let u=Object.create(null),f=[],d=[];for(let m of i)u[m.id]=d.length<<1,d.push(v=>m.slot(v));let g=r?.config.facets;for(let m in s){let v=s[m],b=v[0].facet,S=g&&g[m]||[];if(v.every(w=>w.type==0))if(u[b.id]=f.length<<1|1,f1(S,v))f.push(r.facet(b));else{let w=b.combine(v.map(C=>C.value));f.push(r&&b.compare(w,r.facet(b))?r.facet(b):w)}else{for(let w of v)w.type==0?(u[w.id]=f.length<<1|1,f.push(w.value)):(u[w.id]=d.length<<1,d.push(C=>w.dynamicSlot(C)));u[b.id]=d.length<<1,d.push(w=>TK(w,b,v))}}let p=d.map(m=>m(u));return new Up(e,a,p,u,f,s)}}function AK(t,e,n){let r=[[],[],[],[],[]],i=new Map;function s(a,u){let f=i.get(a);if(f!=null){if(f<=u)return;let d=r[f].indexOf(a);d>-1&&r[f].splice(d,1),a instanceof Yx&&n.delete(a.compartment)}if(i.set(a,u),Array.isArray(a))for(let d of a)s(d,u);else if(a instanceof Yx){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(a.compartment)||a.inner;n.set(a.compartment,d),s(d,u)}else if(a instanceof MN)s(a.inner,a.prec);else if(a instanceof va)r[u].push(a),a.provides&&s(a.provides,u);else if(a instanceof yp)r[u].push(a),a.facet.extensions&&s(a.facet.extensions,Ga.default);else{let d=a.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(d,u)}}return s(t,Ga.default),r.reduce((a,u)=>a.concat(u))}function nd(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function $p(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const ON=vt.define(),Xx=vt.define({combine:t=>t.some(e=>e),static:!0}),kN=vt.define({combine:t=>t.length?t[0]:void 0,static:!0}),IN=vt.define(),DN=vt.define(),PN=vt.define(),zN=vt.define({combine:t=>t.length?t[0]:!1});class ba{constructor(e,n){this.type=e,this.value=n}static define(){return new MK}}class MK{of(e){return new ba(this,e)}}class OK{constructor(e){this.map=e}of(e){return new ir(this,e)}}class ir{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new ir(this.type,n)}is(e){return this.type==e}static define(e={}){return new OK(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(n);s&&r.push(s)}return r}}ir.reconfigure=ir.define();ir.appendConfig=ir.define();class xr{constructor(e,n,r,i,s,a){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,r&&TN(r,n.newLength),s.some(u=>u.type==xr.time)||(this.annotations=s.concat(xr.time.of(Date.now())))}static create(e,n,r,i,s,a){return new xr(e,n,r,i,s,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(xr.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}xr.time=ba.define();xr.userEvent=ba.define();xr.addToHistory=ba.define();xr.remote=ba.define();function kK(t,e){let n=[];for(let r=0,i=0;;){let s,a;if(r<t.length&&(i==e.length||e[i]>=t[r]))s=t[r++],a=t[r++];else if(i<e.length)s=e[i++],a=e[i++];else return n;!n.length||n[n.length-1]<s?n.push(s,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function NN(t,e,n){var r;let i,s,a;return n?(i=e.changes,s=vr.empty(e.changes.length),a=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),a=t.changes.compose(i)),{changes:a,selection:e.selection?e.selection.map(s):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:ir.mapEffects(t.effects,i).concat(ir.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function Qx(t,e,n){let r=e.selection,i=fc(e.annotations);return e.userEvent&&(i=i.concat(xr.userEvent.of(e.userEvent))),{changes:e.changes instanceof vr?e.changes:vr.of(e.changes||[],n,t.facet(kN)),selection:r&&(r instanceof Te?r:Te.single(r.anchor,r.head)),effects:fc(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function LN(t,e,n){let r=Qx(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let a=!!e[s].sequential;r=NN(r,Qx(t,e[s],a?r.changes.newLength:t.doc.length),a)}let i=xr.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return DK(n?IK(i):i)}function IK(t){let e=t.startState,n=!0;for(let i of e.facet(IN)){let s=i(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:kK(n,s))}if(n!==!0){let i,s;if(n===!1)s=t.changes.invertedDesc,i=vr.empty(e.doc.length);else{let a=t.changes.filter(n);i=a.changes,s=a.filtered.mapDesc(a.changes).invertedDesc}t=xr.create(e,i,t.selection&&t.selection.map(s),ir.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let r=e.facet(DN);for(let i=r.length-1;i>=0;i--){let s=r[i](t);s instanceof xr?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof xr?t=s[0]:t=LN(e,fc(s),!1)}return t}function DK(t){let e=t.startState,n=e.facet(PN),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=NN(r,Qx(e,s,t.changes.newLength),!0))}return r==t?t:xr.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const PK=[];function fc(t){return t==null?PK:Array.isArray(t)?t:[t]}var Ys=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Ys||(Ys={}));const zK=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Zx;try{Zx=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function NK(t){if(Zx)return Zx.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||zK.test(n)))return!0}return!1}function LK(t){return e=>{if(!/\S/.test(e))return Ys.Space;if(NK(e))return Ys.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Ys.Word;return Ys.Other}}class on{constructor(e,n,r,i,s,a){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let u=0;u<this.config.dynamicSlots.length;u++)nd(this,u<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return nd(this,r),$p(this,r)}update(...e){return LN(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let u of e.effects)u.is(Wm.reconfigure)?(n&&(i=new Map,n.compartments.forEach((f,d)=>i.set(d,f)),n=null),i.set(u.value.compartment,u.value.extension)):u.is(ir.reconfigure)?(n=null,r=u.value):u.is(ir.appendConfig)&&(n=null,r=fc(r).concat(u.value));let s;n?s=e.startState.values.slice():(n=Up.resolve(r,i,this),s=new on(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(f,d)=>d.reconfigure(f,this),null).values);let a=e.startState.facet(Xx)?e.newSelection:e.newSelection.asSingle();new on(n,e.newDoc,a,s,(u,f)=>f.update(u,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Te.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),s=[r.range],a=fc(r.effects);for(let u=1;u<n.ranges.length;u++){let f=e(n.ranges[u]),d=this.changes(f.changes),g=d.map(i);for(let m=0;m<u;m++)s[m]=s[m].map(g);let p=i.mapDesc(d,!0);s.push(f.range.map(p)),i=i.compose(g),a=ir.mapEffects(a,g).concat(ir.mapEffects(fc(f.effects),p))}return{changes:i,selection:Te.create(s,n.mainIndex),effects:a}}changes(e=[]){return e instanceof vr?e:vr.of(e,this.doc.length,this.facet(on.lineSeparator))}toText(e){return qt.of(e.split(this.facet(on.lineSeparator)||qx))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(nd(this,n),$p(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof va&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let a=r[s],u=e[s];i.push(a.init(f=>a.spec.fromJSON(u,f)))}}return on.create({doc:e.doc,selection:Te.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=Up.resolve(e.extensions||[],new Map),r=e.doc instanceof qt?e.doc:qt.of((e.doc||"").split(n.staticFacet(on.lineSeparator)||qx)),i=e.selection?e.selection instanceof Te?e.selection:Te.single(e.selection.anchor,e.selection.head):Te.single(0);return TN(i,r.length),n.staticFacet(Xx)||(i=i.asSingle()),new on(n,r,i,n.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(on.tabSize)}get lineBreak(){return this.facet(on.lineSeparator)||`
|
|
25
|
-
`}get readOnly(){return this.facet(zN)}phrase(e,...n){for(let r of this.facet(on.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>n.length?r:n[s-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let s of this.facet(ON))for(let a of s(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&i.push(a[e]);return i}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return LK(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),a=e-r,u=e-r;for(;a>0;){let f=Yr(n,a,!1);if(s(n.slice(f,a))!=Ys.Word)break;a=f}for(;u<i;){let f=Yr(n,u);if(s(n.slice(u,f))!=Ys.Word)break;u=f}return a==u?null:Te.range(a+r,u+r)}}on.allowMultipleSelections=Xx;on.tabSize=vt.define({combine:t=>t.length?t[0]:4});on.lineSeparator=kN;on.readOnly=zN;on.phrases=vt.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});on.languageData=ON;on.changeFilter=IN;on.transactionFilter=DN;on.transactionExtender=PN;Wm.reconfigure=ir.define();function BK(t,e,n={}){let r={};for(let i of t)for(let s of Object.keys(i)){let a=i[s],u=r[s];if(u===void 0)r[s]=a;else if(!(u===a||a===void 0))if(Object.hasOwnProperty.call(n,s))r[s]=n[s](u,a);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class uu{eq(e){return this==e}range(e,n=e){return Jx.create(e,n,this)}}uu.prototype.startSide=uu.prototype.endSide=0;uu.prototype.point=!1;uu.prototype.mapMode=Di.TrackDel;function d1(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let Jx=class BN{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new BN(e,n,r)}};function eS(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class h1{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let s=r?this.to:this.from;for(let a=i,u=s.length;;){if(a==u)return a;let f=a+u>>1,d=s[f]-e||(r?this.value[f].endSide:this.value[f].startSide)-n;if(f==a)return d>=0?a:u;d>=0?u=f:a=f+1}}between(e,n,r,i){for(let s=this.findIndex(n,-1e9,!0),a=this.findIndex(r,1e9,!1,s);s<a;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let r=[],i=[],s=[],a=-1,u=-1;for(let f=0;f<this.value.length;f++){let d=this.value[f],g=this.from[f]+e,p=this.to[f]+e,m,v;if(g==p){let b=n.mapPos(g,d.startSide,d.mapMode);if(b==null||(m=v=b,d.startSide!=d.endSide&&(v=n.mapPos(g,d.endSide),v<m)))continue}else if(m=n.mapPos(g,d.startSide),v=n.mapPos(p,d.endSide),m>v||m==v&&d.startSide>0&&d.endSide<=0)continue;(v-m||d.endSide-d.startSide)<0||(a<0&&(a=m),d.point&&(u=Math.max(u,v-m)),r.push(d),i.push(m-a),s.push(v-a))}return{mapped:r.length?new h1(i,s,r,u):null,pos:a}}}class cn{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new cn(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(r&&(n=n.slice().sort(eS)),this.isEmpty)return n.length?cn.of(n):this;let u=new _N(this,null,-1).goto(0),f=0,d=[],g=new qp;for(;u.value||f<n.length;)if(f<n.length&&(u.from-n[f].from||u.startSide-n[f].value.startSide)>=0){let p=n[f++];g.addInner(p.from,p.to,p.value)||d.push(p)}else u.rangeIndex==1&&u.chunkIndex<this.chunk.length&&(f==n.length||this.chunkEnd(u.chunkIndex)<n[f].from)&&(!a||i>this.chunkEnd(u.chunkIndex)||s<this.chunkPos[u.chunkIndex])&&g.addChunk(this.chunkPos[u.chunkIndex],this.chunk[u.chunkIndex])?u.nextChunk():((!a||i>u.to||s<u.from||a(u.from,u.to,u.value))&&(g.addInner(u.from,u.to,u.value)||d.push(Jx.create(u.from,u.to,u.value))),u.next());return g.finishInner(this.nextLayer.isEmpty&&!d.length?cn.empty:this.nextLayer.update({add:d,filter:a,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let a=0;a<this.chunk.length;a++){let u=this.chunkPos[a],f=this.chunk[a],d=e.touchesRange(u,u+f.length);if(d===!1)i=Math.max(i,f.maxPoint),n.push(f),r.push(e.mapPos(u));else if(d===!0){let{mapped:g,pos:p}=f.map(u,e);g&&(i=Math.max(i,g.maxPoint),n.push(g),r.push(p))}}let s=this.nextLayer.map(e);return n.length==0?s:new cn(r,n,s||cn.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],a=this.chunk[i];if(n>=s&&e<=s+a.length&&a.between(s,e-s,n-s,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Md.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Md.from(e).goto(n)}static compare(e,n,r,i,s=-1){let a=e.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),u=n.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),f=OO(a,u,r),d=new Nf(a,f,s),g=new Nf(u,f,s);r.iterGaps((p,m,v)=>kO(d,p,g,m,v,i)),r.empty&&r.length==0&&kO(d,0,g,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let s=e.filter(g=>!g.isEmpty&&n.indexOf(g)<0),a=n.filter(g=>!g.isEmpty&&e.indexOf(g)<0);if(s.length!=a.length)return!1;if(!s.length)return!0;let u=OO(s,a),f=new Nf(s,u,0).goto(r),d=new Nf(a,u,0).goto(r);for(;;){if(f.to!=d.to||!tS(f.active,d.active)||f.point&&(!d.point||!d1(f.point,d.point)))return!1;if(f.to>i)return!0;f.next(),d.next()}}static spans(e,n,r,i,s=-1){let a=new Nf(e,null,s).goto(n),u=n,f=a.openStart;for(;;){let d=Math.min(a.to,r);if(a.point){let g=a.activeForPoint(a.to),p=a.pointFrom<n?g.length+1:a.point.startSide<0?g.length:Math.min(g.length,f);i.point(u,d,a.point,g,p,a.pointRank),f=Math.min(a.openEnd(d),g.length)}else d>u&&(i.span(u,d,a.active,f),f=a.openEnd(d));if(a.to>r)return f+(a.point&&a.to>r?1:0);u=a.to,a.next()}}static of(e,n=!1){let r=new qp;for(let i of e instanceof Jx?[e]:n?_K(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return cn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=cn.empty;i=i.nextLayer)n=new cn(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}cn.empty=new cn([],[],null,-1);function _K(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(eS(e,r)>0)return t.slice().sort(eS);e=r}return t}cn.empty.nextLayer=cn.empty;class qp{finishChunk(e){this.chunks.push(new h1(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new qp)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(cn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=cn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function OO(t,e,n){let r=new Map;for(let s of t)for(let a=0;a<s.chunk.length;a++)s.chunk[a].maxPoint<=0&&r.set(s.chunk[a],s.chunkPos[a]);let i=new Set;for(let s of e)for(let a=0;a<s.chunk.length;a++){let u=r.get(s.chunk[a]);u!=null&&(n?n.mapPos(u):u)==s.chunkPos[a]&&!n?.touchesRange(u,u+s.chunk[a].length)&&i.add(s.chunk[a])}return i}class _N{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Md{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let a=e[s];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new _N(a,n,r,s));return i.length==1?i[0]:new Md(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)fb(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)fb(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),fb(this.heap,0)}}}function fb(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class Nf{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Md.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Fg(this.active,e),Fg(this.activeTo,e),Fg(this.activeRank,e),this.minActive=IO(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||i-this.activeTo[n])>0;)n++;Ug(this.active,n,r),Ug(this.activeTo,n,i),Ug(this.activeRank,n,s),e&&Ug(e,n,this.cursor.from),this.minActive=IO(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Fg(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function kO(t,e,n,r,i,s){t.goto(e),n.goto(r);let a=r+i,u=r,f=r-e,d=!!s.boundChange;for(let g=!1;;){let p=t.to+f-n.to,m=p||t.endSide-n.endSide,v=m<0?t.to+f:n.to,b=Math.min(v,a);if(t.point||n.point?(t.point&&n.point&&d1(t.point,n.point)&&tS(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(u,b,t.point,n.point),g=!1):(g&&s.boundChange(u),b>u&&!tS(t.active,n.active)&&s.compareRange(u,b,t.active,n.active),d&&b<a&&(p||t.openEnd(v)!=n.openEnd(v))&&(g=!0)),v>a)break;u=v,m<=0&&t.next(),m>=0&&n.next()}}function tS(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!d1(t[n],e[n]))return!1;return!0}function Fg(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function Ug(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function IO(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function Km(t,e,n=t.length){let r=0;for(let i=0;i<n&&i<t.length;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=Yr(t,i));return r}function HK(t,e,n,r){for(let i=0,s=0;;){if(s>=e)return i;if(i==t.length)break;s+=t.charCodeAt(i)==9?n-s%n:1,i=Yr(t,i)}return t.length}const nS="ͼ",DO=typeof Symbol>"u"?"__"+nS:Symbol.for(nS),rS=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),PO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Rc{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function s(a,u,f,d){let g=[],p=/^@(\w+)\b/.exec(a[0]),m=p&&p[1]=="keyframes";if(p&&u==null)return f.push(a[0]+";");for(let v in u){let b=u[v];if(/&/.test(v))s(v.split(/,\s*/).map(S=>a.map(w=>S.replace(/&/,w))).reduce((S,w)=>S.concat(w)),b,f);else if(b&&typeof b=="object"){if(!p)throw new RangeError("The value of a property ("+v+") should be a primitive value.");s(i(v),b,g,m)}else b!=null&&g.push(v.replace(/_.*/,"").replace(/[A-Z]/g,S=>"-"+S.toLowerCase())+": "+b+";")}(g.length||m)&&f.push((r&&!p&&!d?a.map(r):a).join(", ")+" {"+g.join(" ")+"}")}for(let a in e)s(i(a),e[a],this.rules)}getRules(){return this.rules.join(`
|
|
26
|
-
`)}static newName(){let e=PO[DO]||1;return PO[DO]=e+1,nS+e.toString(36)}static mount(e,n,r){let i=e[rS],s=r&&r.nonce;i?s&&i.setNonce(s):i=new jK(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let zO=new Map;class jK{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=zO.get(r);if(s)return e[rS]=s;this.sheet=new i.CSSStyleSheet,zO.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[rS]=this}mount(e,n){let r=this.sheet,i=0,s=0;for(let a=0;a<e.length;a++){let u=e[a],f=this.modules.indexOf(u);if(f<s&&f>-1&&(this.modules.splice(f,1),s--,f=-1),f==-1){if(this.modules.splice(s++,0,u),r)for(let d=0;d<u.rules.length;d++)r.insertRule(u.rules[d],i++)}else{for(;s<f;)i+=this.modules[s++].rules.length;i+=u.rules.length,s++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let a="";for(let f=0;f<this.modules.length;f++)a+=this.modules[f].getRules()+`
|
|
27
|
-
`;this.styleTag.textContent=a;let u=n.head||n;this.styleTag.parentNode!=u&&u.insertBefore(this.styleTag,u.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var ua={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Od={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},VK=typeof navigator<"u"&&/Mac/.test(navigator.platform),FK=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var zr=0;zr<10;zr++)ua[48+zr]=ua[96+zr]=String(zr);for(var zr=1;zr<=24;zr++)ua[zr+111]="F"+zr;for(var zr=65;zr<=90;zr++)ua[zr]=String.fromCharCode(zr+32),Od[zr]=String.fromCharCode(zr);for(var db in ua)Od.hasOwnProperty(db)||(Od[db]=ua[db]);function UK(t){var e=VK&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||FK&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Od:ua)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}let ti=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},iS=typeof document<"u"?document:{documentElement:{style:{}}};const oS=/Edge\/(\d+)/.exec(ti.userAgent),HN=/MSIE \d/.test(ti.userAgent),sS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ti.userAgent),Ym=!!(HN||sS||oS),NO=!Ym&&/gecko\/(\d+)/i.test(ti.userAgent),hb=!Ym&&/Chrome\/(\d+)/.exec(ti.userAgent),$K="webkitFontSmoothing"in iS.documentElement.style,lS=!Ym&&/Apple Computer/.test(ti.vendor),LO=lS&&(/Mobile\/\w+/.test(ti.userAgent)||ti.maxTouchPoints>2);var $e={mac:LO||/Mac/.test(ti.platform),windows:/Win/.test(ti.platform),linux:/Linux|X11/.test(ti.platform),ie:Ym,ie_version:HN?iS.documentMode||6:sS?+sS[1]:oS?+oS[1]:0,gecko:NO,gecko_version:NO?+(/Firefox\/(\d+)/.exec(ti.userAgent)||[0,0])[1]:0,chrome:!!hb,chrome_version:hb?+hb[1]:0,ios:LO,android:/Android\b/.test(ti.userAgent),webkit_version:$K?+(/\bAppleWebKit\/(\d+)/.exec(ti.userAgent)||[0,0])[1]:0,safari:lS,safari_version:lS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(ti.userAgent)||[0,0])[1]:0,tabSize:iS.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function g1(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const Gp=Object.create(null);function p1(t,e,n){if(t==e)return!0;t||(t=Gp),e||(e=Gp);let r=Object.keys(t),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=n&&(i.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function qK(t,e){for(let n=t.attributes.length-1;n>=0;n--){let r=t.attributes[n].name;e[r]==null&&t.removeAttribute(r)}for(let n in e){let r=e[n];n=="style"?t.style.cssText=r:t.getAttribute(n)!=r&&t.setAttribute(n,r)}}function BO(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function GK(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class Xm{eq(e){return!1}updateDOM(e,n,r){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var lo=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(lo||(lo={}));class Xr extends uu{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new Kd(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new cu(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:a}=jN(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(a?n?2e8:1:-6e8)+1}return new cu(e,r,i,n,e.widget||null,!0)}static line(e){return new Yd(e)}static set(e,n=!1){return cn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Xr.none=cn.empty;class Kd extends Xr{constructor(e){let{start:n,end:r}=jN(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?g1(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Gp}eq(e){return this==e||e instanceof Kd&&this.tagName==e.tagName&&p1(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Kd.prototype.point=!1;class Yd extends Xr{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Yd&&this.spec.class==e.spec.class&&p1(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Yd.prototype.mapMode=Di.TrackBefore;Yd.prototype.point=!0;class cu extends Xr{constructor(e,n,r,i,s,a){super(n,r,s,e),this.block=i,this.isReplace=a,this.mapMode=i?n<=0?Di.TrackBefore:Di.TrackAfter:Di.TrackDel}get type(){return this.startSide!=this.endSide?lo.WidgetRange:this.startSide<=0?lo.WidgetBefore:lo.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof cu&&WK(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}cu.prototype.point=!0;function jN(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function WK(t,e){return t==e||!!(t&&e&&t.compare(e))}function dc(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class kd extends uu{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof kd&&this.tagName==e.tagName&&p1(this.attributes,e.attributes)}static create(e){return new kd(e.tagName,e.attributes||Gp)}static set(e,n=!1){return cn.of(e,n)}}kd.prototype.startSide=kd.prototype.endSide=-1;function Id(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function aS(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function rd(t,e){if(!e.anchorNode)return!1;try{return aS(t,e.anchorNode)}catch{return!1}}function vp(t){return t.nodeType==3?Dd(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function id(t,e,n,r){return n?_O(t,e,n,r,-1)||_O(t,e,n,r,1):!1}function ca(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Wp(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function _O(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:nl(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=ca(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?nl(t):0}else return!1}}function nl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Kp(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function KK(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function VN(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function YK(t,e,n,r,i,s,a,u){let f=t.ownerDocument,d=f.defaultView||window;for(let g=t,p=!1;g&&!p;)if(g.nodeType==1){let m,v=g==f.body,b=1,S=1;if(v)m=KK(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(g).position)&&(p=!0),g.scrollHeight<=g.clientHeight&&g.scrollWidth<=g.clientWidth){g=g.assignedSlot||g.parentNode;continue}let R=g.getBoundingClientRect();({scaleX:b,scaleY:S}=VN(g,R)),m={left:R.left,right:R.left+g.clientWidth*b,top:R.top,bottom:R.top+g.clientHeight*S}}let w=0,C=0;if(i=="nearest")e.top<m.top?(C=e.top-(m.top+a),n>0&&e.bottom>m.bottom+C&&(C=e.bottom-m.bottom+a)):e.bottom>m.bottom&&(C=e.bottom-m.bottom+a,n<0&&e.top-C<m.top&&(C=e.top-(m.top+a)));else{let R=e.bottom-e.top,T=m.bottom-m.top;C=(i=="center"&&R<=T?e.top+R/2-T/2:i=="start"||i=="center"&&n<0?e.top-a:e.bottom-T+a)-m.top}if(r=="nearest"?e.left<m.left?(w=e.left-(m.left+s),n>0&&e.right>m.right+w&&(w=e.right-m.right+s)):e.right>m.right&&(w=e.right-m.right+s,n<0&&e.left<m.left+w&&(w=e.left-(m.left+s))):w=(r=="center"?e.left+(e.right-e.left)/2-(m.right-m.left)/2:r=="start"==u?e.left-s:e.right-(m.right-m.left)+s)-m.left,w||C)if(v)d.scrollBy(w,C);else{let R=0,T=0;if(C){let A=g.scrollTop;g.scrollTop+=C/S,T=(g.scrollTop-A)*S}if(w){let A=g.scrollLeft;g.scrollLeft+=w/b,R=(g.scrollLeft-A)*b}e={left:e.left-R,top:e.top-T,right:e.right-R,bottom:e.bottom-T},R&&Math.abs(R-w)<1&&(r="nearest"),T&&Math.abs(T-C)<1&&(i="nearest")}if(v)break;(e.top<m.top||e.bottom>m.bottom||e.left<m.left||e.right>m.right)&&(e={left:Math.max(e.left,m.left),right:Math.min(e.right,m.right),top:Math.max(e.top,m.top),bottom:Math.min(e.bottom,m.bottom)}),g=g.assignedSlot||g.parentNode}else if(g.nodeType==11)g=g.host;else break}function FN(t,e=!0){let n=t.ownerDocument,r=null,i=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||r)&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),e&&!r&&s.scrollWidth>s.clientWidth&&(r=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:r,y:i}}class XK{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?nl(n):0),r,Math.min(e.focusOffset,r?nl(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let qa=null;$e.safari&&$e.safari_version>=26&&(qa=!1);function UN(t){if(t.setActive)return t.setActive();if(qa)return t.focus(qa);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(qa==null?{get preventScroll(){return qa={preventScroll:!0},!0}}:void 0),!qa){qa=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],s=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let HO;function Dd(t,e,n=e){let r=HO||(HO=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function hc(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,t.dispatchEvent(s);let a=new KeyboardEvent("keyup",i);return a.synthetic=!0,t.dispatchEvent(a),s.defaultPrevented||a.defaultPrevented}function QK(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function ZK(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,nl(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=nl(n))}else{if(n==t)return!0;r=ca(n),n=n.parentNode}}function $N(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function qN(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=nl(n)}else if(n.parentNode&&!Wp(n))r=ca(n),n=n.parentNode;else return null}}function GN(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Wp(n))r=ca(n)+1,n=n.parentNode;else return null}}class Oo{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new Oo(e.parentNode,ca(e),n)}static after(e,n){return new Oo(e.parentNode,ca(e)+1,n)}}var hr=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(hr||(hr={}));const fu=hr.LTR,m1=hr.RTL;function WN(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const JK=WN("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),eY=WN("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),uS=Object.create(null),Xo=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);uS[e]=n,uS[n]=-e}function KN(t){return t<=247?JK[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?eY[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const tY=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ds{get dir(){return this.level%2?m1:fu}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let s=-1;for(let a=0;a<e.length;a++){let u=e[a];if(u.from<=n&&u.to>=n){if(u.level==r)return a;(s<0||(i!=0?i<0?u.from<n:u.to>n:e[s].level>u.level))&&(s=a)}}if(s<0)throw new RangeError("Index out of range");return s}}function YN(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!YN(r.inner,i.inner))return!1}return!0}const Cn=[];function nY(t,e,n,r,i){for(let s=0;s<=r.length;s++){let a=s?r[s-1].to:e,u=s<r.length?r[s].from:n,f=s?256:i;for(let d=a,g=f,p=f;d<u;d++){let m=KN(t.charCodeAt(d));m==512?m=g:m==8&&p==4&&(m=16),Cn[d]=m==4?2:m,m&7&&(p=m),g=m}for(let d=a,g=f,p=f;d<u;d++){let m=Cn[d];if(m==128)d<u-1&&g==Cn[d+1]&&g&24?m=Cn[d]=g:Cn[d]=256;else if(m==64){let v=d+1;for(;v<u&&Cn[v]==64;)v++;let b=d&&g==8||v<n&&Cn[v]==8?p==1?1:8:256;for(let S=d;S<v;S++)Cn[S]=b;d=v-1}else m==8&&p==1&&(Cn[d]=1);g=m,m&7&&(p=m)}}}function rY(t,e,n,r,i){let s=i==1?2:1;for(let a=0,u=0,f=0;a<=r.length;a++){let d=a?r[a-1].to:e,g=a<r.length?r[a].from:n;for(let p=d,m,v,b;p<g;p++)if(v=uS[m=t.charCodeAt(p)])if(v<0){for(let S=u-3;S>=0;S-=3)if(Xo[S+1]==-v){let w=Xo[S+2],C=w&2?i:w&4?w&1?s:i:0;C&&(Cn[p]=Cn[Xo[S]]=C),u=S;break}}else{if(Xo.length==189)break;Xo[u++]=p,Xo[u++]=m,Xo[u++]=f}else if((b=Cn[p])==2||b==1){let S=b==i;f=S?0:1;for(let w=u-3;w>=0;w-=3){let C=Xo[w+2];if(C&2)break;if(S)Xo[w+2]|=2;else{if(C&4)break;Xo[w+2]|=4}}}}}function iY(t,e,n,r){for(let i=0,s=r;i<=n.length;i++){let a=i?n[i-1].to:t,u=i<n.length?n[i].from:e;for(let f=a;f<u;){let d=Cn[f];if(d==256){let g=f+1;for(;;)if(g==u){if(i==n.length)break;g=n[i++].to,u=i<n.length?n[i].from:e}else if(Cn[g]==256)g++;else break;let p=s==1,m=(g<e?Cn[g]:r)==1,v=p==m?p?1:2:r;for(let b=g,S=i,w=S?n[S-1].to:t;b>f;)b==w&&(b=n[--S].from,w=S?n[S-1].to:t),Cn[--b]=v;f=g}else s=d,f++}}}function cS(t,e,n,r,i,s,a){let u=r%2?2:1;if(r%2==i%2)for(let f=e,d=0;f<n;){let g=!0,p=!1;if(d==s.length||f<s[d].from){let S=Cn[f];S!=u&&(g=!1,p=S==16)}let m=!g&&u==1?[]:null,v=g?r:r+1,b=f;e:for(;;)if(d<s.length&&b==s[d].from){if(p)break e;let S=s[d];if(!g)for(let w=S.to,C=d+1;;){if(w==n)break e;if(C<s.length&&s[C].from==w)w=s[C++].to;else{if(Cn[w]==u)break e;break}}if(d++,m)m.push(S);else{S.from>f&&a.push(new ds(f,S.from,v));let w=S.direction==fu!=!(v%2);fS(t,w?r+1:r,i,S.inner,S.from,S.to,a),f=S.to}b=S.to}else{if(b==n||(g?Cn[b]!=u:Cn[b]==u))break;b++}m?cS(t,f,b,r+1,i,m,a):f<b&&a.push(new ds(f,b,v)),f=b}else for(let f=n,d=s.length;f>e;){let g=!0,p=!1;if(!d||f>s[d-1].to){let S=Cn[f-1];S!=u&&(g=!1,p=S==16)}let m=!g&&u==1?[]:null,v=g?r:r+1,b=f;e:for(;;)if(d&&b==s[d-1].to){if(p)break e;let S=s[--d];if(!g)for(let w=S.from,C=d;;){if(w==e)break e;if(C&&s[C-1].to==w)w=s[--C].from;else{if(Cn[w-1]==u)break e;break}}if(m)m.push(S);else{S.to<f&&a.push(new ds(S.to,f,v));let w=S.direction==fu!=!(v%2);fS(t,w?r+1:r,i,S.inner,S.from,S.to,a),f=S.from}b=S.from}else{if(b==e||(g?Cn[b-1]!=u:Cn[b-1]==u))break;b--}m?cS(t,b,f,r+1,i,m,a):b<f&&a.push(new ds(b,f,v)),f=b}}function fS(t,e,n,r,i,s,a){let u=e%2?2:1;nY(t,i,s,r,u),rY(t,i,s,r,u),iY(i,s,r,u),cS(t,i,s,e,n,r,a)}function oY(t,e,n){if(!t)return[new ds(0,0,e==m1?1:0)];if(e==fu&&!n.length&&!tY.test(t))return XN(t.length);if(n.length)for(;t.length>Cn.length;)Cn[Cn.length]=256;let r=[],i=e==fu?0:1;return fS(t,i,i,n,0,t.length,r),r}function XN(t){return[new ds(0,t,0)]}let QN="";function sY(t,e,n,r,i){var s;let a=r.head-t.from,u=ds.find(e,a,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),f=e[u],d=f.side(i,n);if(a==d){let m=u+=i?1:-1;if(m<0||m>=e.length)return null;f=e[u=m],a=f.side(!i,n),d=f.side(i,n)}let g=Yr(t.text,a,f.forward(i,n));(g<f.from||g>f.to)&&(g=d),QN=t.text.slice(Math.min(a,g),Math.max(a,g));let p=u==(i?e.length-1:0)?null:e[u+(i?1:-1)];return p&&g==d&&p.level+(i?0:1)<f.level?Te.cursor(p.side(!i,n)+t.from,p.forward(i,n)?1:-1,p.level):Te.cursor(g+t.from,f.forward(i,n)?-1:1,f.level)}function lY(t,e,n){for(let r=e;r<n;r++){let i=KN(t.charCodeAt(r));if(i==1)return fu;if(i==2||i==4)return m1}return fu}const ZN=vt.define(),JN=vt.define(),eL=vt.define(),tL=vt.define(),dS=vt.define(),nL=vt.define(),rL=vt.define(),y1=vt.define(),v1=vt.define(),iL=vt.define({combine:t=>t.some(e=>e)}),aY=vt.define({combine:t=>t.some(e=>e)}),oL=vt.define();class gc{constructor(e,n="nearest",r="nearest",i=5,s=5,a=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=a}map(e){return e.empty?this:new gc(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new gc(Te.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const $g=ir.define({map:(t,e)=>t.map(e)}),sL=ir.define();function hs(t,e,n){let r=t.facet(tL);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Ws=vt.define({combine:t=>t.length?t[0]:!0});let uY=0;const rc=vt.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class Ec{constructor(e,n,r,i,s){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(rc.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(rc.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:s,decorations:a}=n||{};return new Ec(uY++,e,r,i,u=>{let f=[];return a&&f.push(Qm.of(d=>{let g=d.plugin(u);return g?a(g):Xr.none})),s&&f.push(s(u)),f})}static fromClass(e,n){return Ec.define((r,i)=>new e(r,i),n)}}class gb{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(hs(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){hs(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){hs(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const lL=vt.define(),b1=vt.define(),Qm=vt.define(),aL=vt.define(),x1=vt.define(),Xd=vt.define(),uL=vt.define();function jO(t,e){let n=t.state.facet(uL);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(t):s),i=[];return cn.spans(r,e.from,e.to,{point(){},span(s,a,u,f){let d=s-e.from,g=a-e.from,p=i;for(let m=u.length-1;m>=0;m--,f--){let v=u[m].spec.bidiIsolate,b;if(v==null&&(v=lY(e.text,d,g)),f>0&&p.length&&(b=p[p.length-1]).to==d&&b.direction==v)b.to=g,p=b.inner;else{let S={from:d,to:g,direction:v,inner:[]};p.push(S),p=S.inner}}}}),i}const cL=vt.define();function fL(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(cL)){let a=s(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(r=Math.max(r,a.top)),a.bottom!=null&&(i=Math.max(i,a.bottom)))}return{left:e,right:n,top:r,bottom:i}}const Uf=vt.define();class ro{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new ro(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,s=0,a=0;;){let u=i<e.length?e[i].fromB:1e9,f=s<n.length?n[s]:1e9,d=Math.min(u,f);if(d==1e9)break;let g=d+a,p=d,m=g;for(;;)if(s<n.length&&n[s]<=p){let v=n[s+1];s+=2,p=Math.max(p,v);for(let b=i;b<e.length&&e[b].fromB<=p;b++)a=e[b].toA-e[b].toB;m=Math.max(m,v+a)}else if(i<e.length&&e[i].fromB<=p){let v=e[i++];p=Math.max(p,v.toB),m=Math.max(m,v.toA),a=v.toA-v.toB}else break;r.push(new ro(g,m,d,p))}return r}}class Yp{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=vr.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,a,u,f)=>i.push(new ro(s,a,u,f))),this.changedRanges=i}static create(e,n,r){return new Yp(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const cY=[];class Xn{constructor(e,n,r=0){this.dom=e,this.length=n,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return cY}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&qK(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let r=n;for(let i of this.children){if(i==e)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let r=ca(this.dom),i=this.length?e>0:n>0;return new Oo(this.parent.dom,r+(i?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Jm)return e;return null}static get(e){return e.cmTile}}class Zm extends Xn{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,r=null,i,s=e?.node==n?e:null,a=0;for(let u of this.children){if(u.sync(e),a+=u.length+u.breakAfter,i=r?r.nextSibling:n.firstChild,s&&i!=u.dom&&(s.written=!0),u.dom.parentNode==n)for(;i&&i!=u.dom;)i=VO(i);else n.insertBefore(u.dom,i);r=u.dom}for(i=r?r.nextSibling:n.firstChild,s&&i&&(s.written=!0);i;)i=VO(i);this.length=a}}function VO(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Jm extends Zm{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Xn.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,i=0,s=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&s++,i=n.pop()}else{let a=r.children[i++];if(a instanceof Js)n.push(i),r=a,i=0;else{let u=s+a.length,f=e(a,s);if(f!==void 0)return f;s=u+a.breakAfter}}}resolveBlock(e,n){let r,i=-1,s,a=-1;if(this.blockTiles((u,f)=>{let d=f+u.length;if(e>=f&&e<=d){if(u.isWidget()&&n>=-1&&n<=1){if(u.flags&32)return!0;u.flags&16&&(r=void 0)}(f<e||e==d&&(n<-1?u.length:u.covers(1)))&&(!r||!u.isWidget()&&r.isWidget())&&(r=u,i=e-f),(d>e||e==f&&(n>1?u.length:u.covers(-1)))&&(!s||!u.isWidget()&&s.isWidget())&&(s=u,a=e-f)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&n<0||!s?{tile:r,offset:i}:{tile:s,offset:a}}}class Js extends Zm{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let r=new Js(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Tc extends Zm{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new Tc(n||document.createElement("div"),e);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,n,r){let i=null,s=-1,a=null,u=-1;function f(g,p){for(let m=0,v=0;m<g.children.length&&v<=p;m++){let b=g.children[m],S=v+b.length;S>=p&&(b.isComposite()?f(b,p-v):(!a||a.isHidden&&(n>0||r&&dY(a,b)))&&(S>p||b.flags&32)?(a=b,u=p-v):(v<p||b.flags&16&&!b.isHidden)&&(i=b,s=p-v)),v=S}}f(this,e);let d=(n<0?i:a)||i||a;return d?{tile:d,offset:d==i?s:u}:null}coordsIn(e,n){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):fY(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:i,offset:s}=r;if(this.dom.contains(i.dom))return i.isText()?new Oo(i.dom,Math.min(i.dom.nodeValue.length,s)):i.domPosFor(s,i.flags&16?1:i.flags&32?-1:n);let a=r.tile.parent,u=!1;for(let f of a.children){if(u)return new Oo(f.dom,0);f==r.tile&&(u=!0)}}return new Oo(this.dom,0)}}function fY(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=vp(e);return n[n.length-1]||null}function dY(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class yi extends Zm{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new yi(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Za extends Xn{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,s=e,a=0;e==0&&n<0||e==r&&n>=0?$e.chrome||$e.gecko||(e?(i--,a=1):s<r&&(s++,a=-1)):n<0?i--:s<r&&s++;let u=Dd(this.dom,i,s).getClientRects();if(!u.length)return null;let f=u[(a?a<0:n>=0)?0:u.length-1];return $e.safari&&!a&&f.width==0&&(f=Array.prototype.find.call(u,d=>d.width)||f),a?Kp(f,a<0):f||null}static of(e,n){let r=new Za(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class du extends Xn{constructor(e,n,r,i){super(e,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,r){let i=this.widget.coordsAt(this.dom,e,n);if(i)return i;if(r)return Kp(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),a=null;if(!s.length)return null;let u=this.flags&16?!0:this.flags&32?!1:e>0;for(let f=u?s.length-1:0;a=s[f],!(e>0?f==0:f==s.length-1||a.top<a.bottom);f+=u?-1:1);return Kp(a,!u)}}get overrideDOMText(){if(!this.length)return qt.empty;let{root:e}=this;if(!e)return qt.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,r,i,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new du(s,r,e,i)}}class Xp extends Xn{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return qt.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class hY{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:i,index:s,beforeBreak:a,parents:u}=this;for(;e||n>0;)if(i.isComposite())if(a){if(!e)break;r&&r.break(),e--,a=!1}else if(s==i.children.length){if(!e&&!u.length)break;r&&r.leave(i),a=!!i.breakAfter,{tile:i,index:s}=u.pop(),s++}else{let f=i.children[s],d=f.breakAfter;(n>0?f.length<=e:f.length<e)&&(!r||r.skip(f,0,f.length)!==!1||!f.isComposite)?(a=!!d,s++,e-=f.length):(u.push({tile:i,index:s}),i=f,s=0,r&&f.isComposite()&&r.enter(f))}else if(s==i.length)a=!!i.breakAfter,{tile:i,index:s}=u.pop(),s++;else if(e){let f=Math.min(e,i.length-s);r&&r.skip(i,s,s+f),e-=f,s+=f}else break;return this.tile=i,this.index=s,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class gY{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class pY{constructor(e,n,r){this.cache=e,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,r,i){var s;this.flushBuffer();let a=this.ensureMarks(n,r),u=a.lastChild;if(u&&u.isText()&&!(u.flags&8)&&u.length+e.length<512){this.cache.reused.set(u,2);let f=a.children[a.children.length-1]=new Za(u.dom,u.text+e);f.parent=a}else a.append(i||Za.of(e,(s=this.cache.find(Za))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?pb(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let u=n.marks.length-1;u>=0;u--){let f=n.marks[u],d=i.lastChild;if(d instanceof yi&&d.mark.eq(f.mark))d.dom!=f.dom&&d.setDOM(pb(f.dom)),i=d;else{if(this.cache.reused.get(f)){let p=Xn.get(f.dom);p&&p.setDOM(pb(f.dom))}let g=yi.of(f.mark,f.dom);i.append(g),i=g}this.cache.reused.set(f,2)}let s=Xn.get(e.text);s&&this.cache.reused.set(s,2);let a=new Za(e.text,e.text.nodeValue);a.flags|=8,i.append(a)}addInlineWidget(e,n,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let s=this.ensureMarks(n,r);!i&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var r;e||(e=dL);let i=Tc.start(e,n||((r=this.cache.find(Tc))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var r;let i=this.curLine;for(let s=e.length-1;s>=0;s--){let a=e[s],u;if(n>0&&(u=i.lastChild)&&u instanceof yi&&u.mark.eq(a))i=u,n--;else{let f=yi.of(a,(r=this.cache.find(yi,d=>d.mark.eq(a)))===null||r===void 0?void 0:r.dom);i.append(f),i=f,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!FO(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!($e.ios&&FO(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(mb,0,32)||new du(mb.toDOM(),0,mb,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=new gY(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof Js&&i.wrapper.eq(r.wrapper))n=i;else{let s=Js.of(r.wrapper,(e=this.cache.find(Js,a=>a.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),r=this.cache.find(Xp,void 0,1);return r&&(r.flags=n),r||new Xp(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class mY{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:i,lineBreak:s,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=i;let u=this.textOff=Math.min(e,i.length);return s?null:i.slice(0,u)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const Qp=[du,Tc,Za,yi,Xp,Js,Jm];for(let t=0;t<Qp.length;t++)Qp[t].bucket=t;class yY{constructor(e){this.view=e,this.buckets=Qp.map(()=>[]),this.index=Qp.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,r=this.buckets[n];r.length<6?r.push(e):r[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,r=2){let i=e.bucket,s=this.buckets[i],a=this.index[i];for(let u=s.length-1;u>=0;u--){let f=(u+a)%s.length,d=s[f];if((!n||n(d))&&!this.reused.has(d))return s.splice(f,1),f<a&&this.index[i]--,this.reused.set(d,r),d}return null}findWidget(e,n,r){let i=this.buckets[0];if(i.length)for(let s=0,a=0;;s++){if(s==i.length){if(a)return null;a=1,s=0}let u=i[s];if(!this.reused.has(u)&&(a==0?u.widget.compare(e):u.widget.constructor==e.constructor&&e.updateDOM(u.dom,this.view,u.widget)))return i.splice(s,1),s<this.index[0]&&this.index[0]--,u.widget==e&&u.length==n&&(u.flags&497)==r?(this.reused.set(u,1),u):(this.reused.set(u,2),new du(u.dom,n,e,u.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class vY{constructor(e,n,r,i,s){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new yY(e),this.text=new mY(e.state.doc),this.builder=new pY(this.cache,new Jm(e,e.contentDOM),cn.iter(r)),this.cache.reused.set(n,2),this.old=new hY(n),this.reuseWalker={skip:(a,u,f)=>{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,s=0,a=0;;){let u=a<e.length?e[a++]:null,f=u?u.fromA:this.old.root.length;if(f>i){let d=f-i;this.preserve(d,!a,!u),i=f,s+=d}if(!u)break;n&&u.fromA<=n.range.fromA&&u.toA>=n.range.toA?(this.forward(u.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,u.toA),this.emit(n.range.toB,u.toB)):(this.forward(u.fromA,u.toA),this.emit(s,u.toB)),s=u.toB,i=u.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let i=SY(this.old),s=this.openMarks;this.old.advance(e,r?1:-1,{skip:(a,u,f)=>{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(f-u);else{let d=f>0||u<a.length?du.of(a.widget,this.view,f-u,a.flags&496,this.cache.maybeReuse(a)):this.cache.reuse(a);d.flags&256?(d.flags&=-2,this.builder.addBlockWidget(d)):(this.builder.ensureLine(null),this.builder.addInlineWidget(d,i,s),s=i.length)}else if(a.isText())this.builder.ensureLine(null),!u&&f==a.length&&!this.cache.reused.has(a)?this.builder.addText(a.text,i,s,this.cache.reuse(a)):(this.cache.add(a),this.builder.addText(a.text.slice(u,f),i,s)),s=i.length;else if(a.isLine())a.flags&=-2,this.cache.reused.set(a,1),this.builder.addLine(a);else if(a instanceof Xp)this.cache.add(a);else if(a instanceof yi)this.builder.ensureLine(null),this.builder.addMark(a,i,s),this.cache.reused.set(a,1),s=i.length;else return!1;this.openWidget=!1},enter:a=>{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof yi&&i.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?i.length&&(i.length=s=0):a instanceof yi&&(i.shift(),s=Math.min(s,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,i=this.builder,s=0,a=cn.spans(this.decorations,e,n,{point:(u,f,d,g,p,m)=>{if(d instanceof cu){if(this.disallowBlockEffectsFor[m]){if(d.block)throw new RangeError("Block decorations may not be specified via plugins");if(f>this.view.state.doc.lineAt(u).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=g.length,p>g.length)i.continueWidget(f-u);else{let v=d.widget||(d.block?Ac.block:Ac.inline),b=bY(d),S=this.cache.findWidget(v,f-u,b)||du.of(v,this.view,f-u,b);d.block?(d.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(S)):(i.ensureLine(r),i.addInlineWidget(S,g,p))}r=null}else r=xY(r,d);f>u&&this.text.skip(f-u)},span:(u,f,d,g)=>{for(let p=u;p<f;){let m=this.text.next(Math.min(512,f-p));m==null?(i.addLineStartIfNotCovered(r),i.addBreak(),p++):(i.ensureLine(r),i.addText(m,d,p==u?g:d.length),p+=m.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=a>s,this.openMarks=a}forward(e,n,r=1){n-e<=10?this.old.advance(n-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let n=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let s=Xn.get(i);if(i==this.view.contentDOM)break;s instanceof yi?n.push(s):s?.isLine()?r=s:s instanceof Js||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new Tc(i,dL):r||n.push(yi.of(new Kd({tagName:i.nodeName.toLowerCase(),attributes:GK(i)}),i)))}return{line:r,marks:n}}}function FO(t,e){let n=r=>{for(let i of r.children)if((e?i.isText():i.length)||n(i))return!0;return!1};return n(t)}function bY(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const dL={class:"cm-line"};function xY(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&g1(n,t),r&&(t.class+=" "+r)),t}function SY(t){let e=[];for(let n=t.parents.length;n>1;n--){let r=n==t.parents.length?t.tile:t.parents[n].tile;r instanceof yi&&e.push(r.mark)}return e}function pb(t){let e=Xn.get(t);return e&&e.setDOM(t.cloneNode()),t}class Ac extends Xm{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ac.inline=new Ac("span");Ac.block=new Ac("div");const mb=new class extends Xm{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class UO{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Xr.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Jm(e,e.contentDOM),this.updateInner([new ro(0,0,0,e.state.doc.length)],null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:g,toA:p})=>p<this.minWidthFrom||g>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!kY(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?CY(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:g,to:p}=this.hasComposition;r=new ro(g,p,e.changes.mapPos(g,-1),e.changes.mapPos(p,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,($e.ie||$e.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,u=this.blockWrappers;this.updateDeco();let f=TY(a,this.decorations,e.changes);f.length&&(r=ro.extendWithRanges(r,f));let d=MY(u,this.blockWrappers,e.changes);return d.length&&(r=ro.extendWithRanges(r,d)),s&&!r.some(g=>g.fromA<=s.range.fromA&&g.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||e.length){let a=this.tile,u=new vY(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Xn.get(n.text)&&u.cache.reused.set(Xn.get(n.text),2),this.tile=u.run(e,n),hS(a,u.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=$e.chrome||$e.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof yb&&i.push(s.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(sL)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,s=i==r,a=!s&&!(this.view.state.facet(Ws)||r.tabIndex>-1)&&rd(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(s||n||a))return;let u=this.forceSelection;this.forceSelection=!1;let f=this.view.state.selection.main,d,g;if(f.empty?g=d=this.inlineDOMNearPos(f.anchor,f.assoc||1):(g=this.inlineDOMNearPos(f.head,f.head==f.from?1:-1),d=this.inlineDOMNearPos(f.anchor,f.anchor==f.from?1:-1)),$e.gecko&&f.empty&&!this.hasComposition&&wY(d)){let m=document.createTextNode("");this.view.observer.ignore(()=>d.node.insertBefore(m,d.node.childNodes[d.offset]||null)),d=g=new Oo(m,0),u=!0}let p=this.view.observer.selectionRange;(u||!p.focusNode||(!id(d.node,d.offset,p.anchorNode,p.anchorOffset)||!id(g.node,g.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,f))&&(this.view.observer.ignore(()=>{$e.android&&$e.chrome&&r.contains(p.focusNode)&&OY(p.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let m=Id(this.view.root);if(m)if(f.empty){if($e.gecko){let v=RY(d.node,d.offset);if(v&&v!=3){let b=(v==1?qN:GN)(d.node,d.offset);b&&(d=new Oo(b.node,b.offset))}}m.collapse(d.node,d.offset),f.bidiLevel!=null&&m.caretBidiLevel!==void 0&&(m.caretBidiLevel=f.bidiLevel)}else if(m.extend){m.collapse(d.node,d.offset);try{m.extend(g.node,g.offset)}catch{}}else{let v=document.createRange();f.anchor>f.head&&([d,g]=[g,d]),v.setEnd(g.node,g.offset),v.setStart(d.node,d.offset),m.removeAllRanges(),m.addRange(v)}a&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(d,g)),this.impreciseAnchor=d.precise?null:new Oo(p.anchorNode,p.anchorOffset),this.impreciseHead=g.precise?null:new Oo(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&id(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=Id(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=this.lineAt(n.head,n.assoc);if(!a)return;let u=a.posAtStart;if(n.head==u||n.head==u+a.length)return;let f=this.coordsAt(n.head,-1),d=this.coordsAt(n.head,1);if(!f||!d||f.bottom>d.top)return;let g=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(g.node,g.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let p=e.observer.selectionRange;e.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=n.from&&r.collapse(i,s)}posFromDOM(e,n){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[n];else{let a=nl(e)==0?0:n==0?-1:1;for(;;){let u=e.parentNode;if(u==r.dom)break;a==0&&u.firstChild!=u.lastChild&&(e==u.firstChild?a=-1:a=1),e=u}a<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return i;for(;s&&!Xn.get(s);)s=s.nextSibling;if(!s)return i+r.length;for(let a=0,u=i;;a++){let f=r.children[a];if(f.dom==s)return u;u+=f.length+f.breakAfter}}else return r.isText()?e==r.dom?i+n:i+(n?r.length:0):i}domAtPos(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(e,n):r.domIn(i,n)}inlineDOMNearPos(e,n){let r,i=-1,s=!1,a,u=-1,f=!1;return this.tile.blockTiles((d,g)=>{if(d.isWidget()){if(d.flags&32&&g>=e)return!0;d.flags&16&&(s=!0)}else{let p=g+d.length;if(g<=e&&(r=d,i=e-g,s=p<e),p>=e&&!a&&(a=d,u=e-g,f=g>e),g>e&&a)return!0}}),!r&&!a?this.domAtPos(e,n):(s&&a?r=null:f&&r&&(a=null),r&&n<0||!a?r.domIn(i,n):a.domIn(u,n))}coordsAt(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof yb?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(e,n){let{tile:r}=this.tile.resolveBlock(e,n);return r.isLine()?r:null}coordsForChar(e){let{tile:n,offset:r}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function i(s,a){if(s.isComposite())for(let u of s.children){if(u.length>=a){let f=i(u,a);if(f)return f}if(a-=u.length,a<0)break}else if(s.isText()&&a<s.length){let u=Yr(s.text,a);if(u==a)return null;let f=Dd(s.dom,a,u).getClientRects();for(let d=0;d<f.length;d++){let g=f[d];if(d==f.length-1||g.top<g.bottom&&g.left<g.right)return g}}return null}return i(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,a=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,u=-1,f=this.view.textDirection==hr.LTR,d=0,g=(p,m,v)=>{for(let b=0;b<p.children.length&&!(m>i);b++){let S=p.children[b],w=m+S.length,C=S.dom.getBoundingClientRect(),{height:R}=C;if(v&&!b&&(d+=C.top-v.top),S instanceof Js)w>r&&g(S,m,C);else if(m>=r&&(d>0&&n.push(-d),n.push(R+d),d=0,a)){let T=S.dom.lastChild,A=T?vp(T):[];if(A.length){let k=A[A.length-1],P=f?k.right-C.left:C.right-k.left;P>u&&(u=P,this.minWidth=s,this.minWidthFrom=m,this.minWidthTo=w)}}v&&b==p.children.length-1&&(d+=v.bottom-C.bottom),m=w+S.breakAfter}};return g(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?hr.RTL:hr.LTR}measureTextSize(){let e=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let u=0,f;for(let d of a.children){if(!d.isText()||/[^ -~]/.test(d.text))return;let g=vp(d.dom);if(g.length!=1)return;u+=g[0].width,f=g[0].height}if(u)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:u/a.length,textHeight:f}}});if(e)return e;let n=document.createElement("div"),r,i,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let a=vp(n.firstChild)[0];r=n.getBoundingClientRect().height,i=a&&a.width?a.width/27:7,s=a&&a.height?a.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let s=i==n.viewports.length?null:n.viewports[i],a=s?s.from-1:this.view.state.doc.length;if(a>r){let u=(n.lineBlockAt(a).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(Xr.replace({widget:new yb(u),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!s)break;r=s.to+1}return Xr.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Qm).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(x1).map((s,a)=>{let u=typeof s=="function";return u&&(r=!0),u?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(cn.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(aL).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){var n;if(e.isSnapshot){let g=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=g.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let g of this.view.state.facet(oL))try{if(g(this.view,e.range,e))return!0}catch(p){hs(this.view.state,p,"scroll handler")}let{range:r}=e,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),s;if(!i)return;!r.empty&&(s=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let a=fL(this.view),u={left:i.left-a.left,top:i.top-a.top,right:i.right+a.right,bottom:i.bottom+a.bottom},{offsetWidth:f,offsetHeight:d}=this.view.scrollDOM;if(YK(this.view.scrollDOM,u,r.head<r.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,f),-f),Math.max(Math.min(e.yMargin,d),-d),this.view.textDirection==hr.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let g=this.view.docView.lineAt(r.head,1);g&&g.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){hS(this.tile)}}function hS(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)hS(r,e)}}function wY(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function hL(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=qN(n.focusNode,n.focusOffset),i=GN(n.focusNode,n.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let u=Xn.get(i.node);if(!u||u.isText()&&u.text!=i.node.nodeValue)s=i;else if(t.docView.lastCompositionAfterCursor){let f=Xn.get(r.node);!f||f.isText()&&f.text!=r.node.nodeValue||(s=i)}}if(t.docView.lastCompositionAfterCursor=s!=r,!s)return null;let a=e-s.offset;return{from:a,to:a+s.node.nodeValue.length,node:s.node}}function CY(t,e,n){let r=hL(t,n);if(!r)return null;let{node:i,from:s,to:a}=r,u=i.nodeValue;if(/[\n\r]/.test(u)||t.state.doc.sliceString(r.from,r.to)!=u)return null;let f=e.invertedDesc;return{range:new ro(f.mapPos(s),f.mapPos(a),s,a),text:i}}function RY(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let EY=class{constructor(){this.changes=[]}compareRange(e,n){dc(e,n,this.changes)}comparePoint(e,n){dc(e,n,this.changes)}boundChange(e){dc(e,e,this.changes)}};function TY(t,e,n){let r=new EY;return cn.compare(t,e,n,r),r.changes}class AY{constructor(){this.changes=[]}compareRange(e,n){dc(e,n,this.changes)}comparePoint(){}boundChange(e){dc(e,e,this.changes)}}function MY(t,e,n){let r=new AY;return cn.compare(t,e,n,r),r.changes}function OY(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function kY(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}class yb extends Xm{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function IY(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return Te.cursor(e);s==0?n=1:s==i.length&&(n=-1);let a=s,u=s;n<0?a=Yr(i.text,s,!1):u=Yr(i.text,s);let f=r(i.text.slice(a,u));for(;a>0;){let d=Yr(i.text,a,!1);if(r(i.text.slice(d,a))!=f)break;a=d}for(;u<i.length;){let d=Yr(i.text,u);if(r(i.text.slice(u,d))!=f)break;u=d}return Te.range(a+i.from,u+i.from)}function DY(t,e,n,r,i){let s=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let u=t.viewState.heightOracle.textHeight,f=Math.floor((i-n.top-(t.defaultLineHeight-u)*.5)/u);s+=f*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+HK(a,s,t.state.tabSize)}function PY(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==lo.Text&&(i.type!=s.type||(n<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function zY(t,e,n,r){let i=PY(t,e.head,e.assoc||-1),s=!r||i.type!=lo.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let a=t.dom.getBoundingClientRect(),u=t.textDirectionAt(i.from),f=t.posAtCoords({x:n==(u==hr.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(f!=null)return Te.cursor(f,n?-1:1)}return Te.cursor(n?i.to:i.from,n?-1:1)}function $O(t,e,n,r){let i=t.state.doc.lineAt(e.head),s=t.bidiSpans(i),a=t.textDirectionAt(i.from);for(let u=e,f=null;;){let d=sY(i,s,a,u,n),g=QN;if(!d){if(i.number==(n?t.state.doc.lines:1))return u;g=`
|
|
28
|
-
`,i=t.state.doc.line(i.number+(n?1:-1)),s=t.bidiSpans(i),d=t.visualLineSide(i,!n)}if(f){if(!f(g))return u}else{if(!r)return d;f=r(g)}u=d}}function NY(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let a=r(s);return i==Ys.Space&&(i=a),i==a}}function LY(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return Te.cursor(i,e.assoc);let a=e.goalColumn,u,f=t.contentDOM.getBoundingClientRect(),d=t.coordsAtPos(i,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),g=t.documentTop;if(d)a==null&&(a=d.left-f.left),u=s<0?d.top:d.bottom;else{let b=t.viewState.lineBlockAt(i);a==null&&(a=Math.min(f.right-f.left,t.defaultCharacterWidth*(i-b.from))),u=(s<0?b.top:b.bottom)+g}let p=f.left+a,m=t.viewState.heightOracle.textHeight>>1,v=r??m;for(let b=0;;b+=m){let S=u+(v+b)*s,w=gS(t,{x:p,y:S},!1,s);if(n?S>f.bottom:S<f.top)return Te.cursor(w.pos,w.assoc);let C=t.coordsAtPos(w.pos,w.assoc),R=C?(C.top+C.bottom)/2:0;if(!C||(n?R>u:R<u))return Te.cursor(w.pos,w.assoc,void 0,a)}}function od(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(s,a,u)=>{if(e>s&&e<a){let f=r||n||(e-s<a-e?-1:1);e=f<0?s:a,r=f}});if(!r)return e}}function gL(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let a=od(t,i.from,0);a!=i.from&&(s=Te.cursor(a,-1))}else{let a=od(t,i.from,-1),u=od(t,i.to,1);(a!=i.from||u!=i.to)&&(s=Te.range(i.from==i.anchor?a:u,i.from==i.head?a:u))}s&&(n||(n=e.ranges.slice()),n[r]=s)}return n?Te.create(n,e.mainIndex):e}function vb(t,e,n){let r=od(t.state.facet(Xd).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Te.cursor(r,r<n.from?1:-1)}class us{constructor(e,n){this.pos=e,this.assoc=n}}function gS(t,e,n,r){let i=t.contentDOM.getBoundingClientRect(),s=i.top+t.viewState.paddingTop,{x:a,y:u}=e,f=u-s,d;for(;;){if(f<0)return new us(0,1);if(f>t.viewState.docHeight)return new us(t.state.doc.length,-1);if(d=t.elementAtHeight(f),r==null)break;if(d.type==lo.Text){if(r<0?d.to<t.viewport.from:d.from>t.viewport.to)break;let m=t.docView.coordsAt(r<0?d.from:d.to,r>0?-1:1);if(m&&(r<0?m.top<=f+s:m.bottom>=f+s))break}let p=t.viewState.heightOracle.textHeight/2;f=r>0?d.bottom+p:d.top-p}if(t.viewport.from>=d.to||t.viewport.to<=d.from){if(n)return null;if(d.type==lo.Text){let p=DY(t,i,d,a,u);return new us(p,p==d.from?1:-1)}}if(d.type!=lo.Text)return f<(d.top+d.bottom)/2?new us(d.from,1):new us(d.to,-1);let g=t.docView.lineAt(d.from,2);return(!g||g.length!=d.length)&&(g=t.docView.lineAt(d.from,-2)),new BY(t,a,u,t.textDirectionAt(d.from)).scanTile(g,d.from)}class BY{constructor(e,n,r,i){this.view=e,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[ds.find(i,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[ds.find(i,e-r.from,-1,n)].dir}bidiIn(e,n){let{spans:r,line:i}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(e,n){let r=0,i=e.length-1,s=new Set,a=this.bidiIn(e[0],e[i]),u,f,d=-1,g=1e9,p;e:for(;r<i;){let v=i-r,b=r+i>>1;t:if(s.has(b)){let w=r+Math.floor(Math.random()*v);for(let C=0;C<v;C++){if(!s.has(w)){b=w;break t}w++,w==i&&(w=r)}break e}s.add(b);let S=n(b);if(S)for(let w=0;w<S.length;w++){let C=S[w],R=0;if(!(C.width==0&&S.length>1)){if(C.bottom<this.y)(!u||u.bottom<C.bottom)&&(u=C),R=1;else if(C.top>this.y)(!f||f.top>C.top)&&(f=C),R=-1;else{let T=C.left>this.x?this.x-C.left:C.right<this.x?this.x-C.right:0,A=Math.abs(T);A<g&&(d=b,g=A,p=C),T&&(R=T<0==(this.baseDir==hr.LTR)?-1:1)}R==-1&&(!a||this.baseDirAt(e[b],1))?i=b:R==1&&(!a||this.baseDirAt(e[b+1],-1))&&(r=b+1)}}}if(!p){let v=u&&(!f||this.y-u.bottom<f.top-this.y)?u:f;return this.y=(v.top+v.bottom)/2,this.scan(e,n)}let m=(a?this.dirAt(e[d],1):this.baseDir)==hr.LTR;return{i:d,after:this.x>(p.left+p.right)/2==m}}scanText(e,n){let r=[];for(let s=0;s<e.length;s=Yr(e.text,s))r.push(n+s);r.push(n+e.length);let i=this.scan(r,s=>{let a=r[s]-n,u=r[s+1]-n;return Dd(e.dom,a,u).getClientRects()});return i.after?new us(r[i.i+1],-1):new us(r[i.i],1)}scanTile(e,n){if(!e.length)return new us(n,1);if(e.children.length==1){let u=e.children[0];if(u.isText())return this.scanText(u,n);if(u.isComposite())return this.scanTile(u,n)}let r=[n];for(let u=0,f=n;u<e.children.length;u++)r.push(f+=e.children[u].length);let i=this.scan(r,u=>{let f=e.children[u];return f.flags&48?null:(f.dom.nodeType==1?f.dom:Dd(f.dom,0,f.length)).getClientRects()}),s=e.children[i.i],a=r[i.i];return s.isText()?this.scanText(s,a):s.isComposite()?this.scanTile(s,a):i.after?new us(r[i.i+1],-1):new us(a,1)}}const ec="";class _Y{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(on.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=ec}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let a=Xn.get(i),u=i.nextSibling;if(u==n){a?.breakAfter&&!u&&r!=this.view.contentDOM&&this.lineBreak();break}let f=Xn.get(u);(a&&f?a.breakAfter:(a?a.breakAfter:Wp(i))||Wp(u)&&(i.nodeName!="BR"||a?.isWidget())&&this.text.length>s)&&!jY(u,n)&&this.lineBreak(),i=u}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,a=1,u;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(u=i.exec(n))&&(s=u.index,a=u[0].length),this.append(n.slice(r,s<0?n.length:s)),s<0)break;if(this.lineBreak(),a>1)for(let f of this.points)f.node==e&&f.pos>this.text.length&&(f.pos-=a-1);r=s+a}}readNode(e){let n=Xn.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(HY(e,r.node,r.offset)?n:0))}}function HY(t,e,n){for(;;){if(!e||n<nl(e))return!1;if(e==t)return!0;n=ca(e)+1,e=e.parentNode}}function jY(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=Xn.get(t);if(!r?.isWidget())return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i?.length)return!1}return!0}class qO{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class VY{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:a}=e.docView,u=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=pL(e.docView.tile,n,r,0))){let f=s||a?[]:UY(e),d=new _Y(f,e);d.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=d.text,this.newSel=$Y(f,this.bounds.from)}else{let f=e.observer.selectionRange,d=s&&s.node==f.focusNode&&s.offset==f.focusOffset||!aS(e.contentDOM,f.focusNode)?u.main.head:e.docView.posFromDOM(f.focusNode,f.focusOffset),g=a&&a.node==f.anchorNode&&a.offset==f.anchorOffset||!aS(e.contentDOM,f.anchorNode)?u.main.anchor:e.docView.posFromDOM(f.anchorNode,f.anchorOffset),p=e.viewport;if(($e.ios||$e.chrome)&&u.main.empty&&d!=g&&(p.from>0||p.to<e.state.doc.length)){let m=Math.min(d,g),v=Math.max(d,g),b=p.from-m,S=p.to-v;(b==0||b==1||m==0)&&(S==0||S==-1||v==e.state.doc.length)&&(d=0,g=e.state.doc.length)}if(e.inputState.composing>-1&&u.ranges.length>1)this.newSel=u.replaceRange(Te.range(g,d));else if(e.lineWrapping&&g==d&&!(u.main.empty&&u.main.head==d)&&e.inputState.lastTouchTime>Date.now()-100){let m=e.coordsAtPos(d,-1),v=0;m&&(v=e.inputState.lastTouchY<=m.bottom?-1:1),this.newSel=Te.create([Te.cursor(d,v)])}else this.newSel=Te.single(g,d)}}}function pL(t,e,n,r){if(t.isComposite()){let i=-1,s=-1,a=-1,u=-1;for(let f=0,d=r,g=r;f<t.children.length;f++){let p=t.children[f],m=d+p.length;if(d<e&&m>n)return pL(p,e,n,d);if(m>=e&&i==-1&&(i=f,s=d),d>n&&p.dom.parentNode==t.dom){a=f,u=g;break}g=m,d=m+p.breakAfter}return{from:s,to:u<0?r+t.length:u,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:a<t.children.length&&a>=0?t.children[a].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function mL(t,e){let n,{newSel:r}=e,{state:i}=t,s=i.selection.main,a=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:u,to:f}=e.bounds,d=s.from,g=null;(a===8||$e.android&&e.text.length<f-u)&&(d=s.to,g="end");let p=i.doc.sliceString(u,f,ec),m,v;!s.empty&&s.from>=u&&s.to<=f&&(e.typeOver||p!=e.text)&&p.slice(0,s.from-u)==e.text.slice(0,s.from-u)&&p.slice(s.to-u)==e.text.slice(m=e.text.length-(p.length-(s.to-u)))?n={from:s.from,to:s.to,insert:qt.of(e.text.slice(s.from-u,m).split(ec))}:(v=yL(p,e.text,d-u,g))&&($e.chrome&&a==13&&v.toB==v.from+2&&e.text.slice(v.from,v.toB)==ec+ec&&v.toB--,n={from:u+v.from,to:u+v.toA,insert:qt.of(e.text.slice(v.from,v.toB).split(ec))})}else r&&(!t.hasFocus&&i.facet(Ws)||Zp(r,s))&&(r=null);if(!n&&!r)return!1;if(($e.mac||$e.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=Te.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:qt.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:i.toText(t.inputState.insertingText)}:$e.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
|
|
29
|
-
`&&t.lineWrapping&&(r&&(r=Te.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:qt.of([" "])}),n)return S1(t,n,r,a);if(r&&!Zp(r,s)){let u=!1,f="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(u=!0),f=t.inputState.lastSelectionOrigin,f=="select.pointer"&&(r=gL(i.facet(Xd).map(d=>d(t)),r))),t.dispatch({selection:r,scrollIntoView:u,userEvent:f}),!0}else return!1}function S1(t,e,n,r=-1){if($e.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if($e.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&hc(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&hc(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&hc(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,u=()=>a||(a=FY(t,e,n));return t.state.facet(nL).some(f=>f(t,e.from,e.to,s,u))||t.dispatch(u()),!0}function FY(t,e,n){let r,i=t.state,s=i.selection.main,a=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let f=e.from<s.from?-1:1,d=f<0?s.from:s.to,g=od(i.facet(Xd).map(p=>p(t)),d,f);e.from==g&&(a=g)}if(a>-1)r={changes:e,selection:Te.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let f=s.from<e.from?i.sliceDoc(s.from,e.from):"",d=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(t.state.toText(f+e.insert.sliceString(0,void 0,t.state.lineBreak)+d))}else{let f=i.changes(e),d=n&&n.main.to<=f.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let g=t.state.sliceDoc(e.from,e.to),p,m=n&&hL(t,n.main.head);if(m){let b=e.insert.length-(e.to-e.from);p={from:m.from,to:m.to-b}}else p=t.state.doc.lineAt(s.head);let v=s.to-e.to;r=i.changeByRange(b=>{if(b.from==s.from&&b.to==s.to)return{changes:f,range:d||b.map(f)};let S=b.to-v,w=S-g.length;if(t.state.sliceDoc(w,S)!=g||S>=p.from&&w<=p.to)return{range:b};let C=i.changes({from:w,to:S,insert:e.insert}),R=b.to-s.to;return{changes:C,range:d?Te.range(Math.max(0,d.anchor+R),Math.max(0,d.head+R)):b.map(C)}})}else r={changes:f,selection:d&&i.selection.replaceRange(d)}}let u="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,u+=".compose",t.inputState.compositionFirstChange&&(u+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:u,scrollIntoView:!0})}function yL(t,e,n,r){let i=Math.min(t.length,e.length),s=0;for(;s<i&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&t.length==e.length)return null;let a=t.length,u=e.length;for(;a>0&&u>0&&t.charCodeAt(a-1)==e.charCodeAt(u-1);)a--,u--;if(r=="end"){let f=Math.max(0,s-Math.min(a,u));n-=a+f-s}if(a<s&&t.length<e.length){let f=n<=s&&n>=a?s-n:0;s-=f,u=s+(u-a),a=s}else if(u<s){let f=n<=s&&n>=u?s-n:0;s-=f,a=s+(a-u),u=s}return{from:s,toA:a,toB:u}}function UY(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new qO(n,r)),(i!=n||s!=r)&&e.push(new qO(i,s))),e}function $Y(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?Te.single(n+e,r+e):null}function Zp(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class qY{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,$e.safari&&e.contentDOM.addEventListener("input",()=>null),$e.gecko&&sX(e.contentDOM.ownerDocument)}handleEvent(e){!JY(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=GY(e),r=this.handlers,i=this.view.contentDOM;for(let s in n)if(s!="scroll"){let a=!n[s].handlers.length,u=r[s];u&&a!=!u.handlers.length&&(i.removeEventListener(s,this.handleEvent),u=null),u||i.addEventListener(s,this.handleEvent,{passive:a})}for(let s in r)s!="scroll"&&!n[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&bL.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),$e.android&&$e.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return $e.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((n=vL.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||WY.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,hc(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:$e.safari&&!$e.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function GO(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){hs(n.state,i)}}}function GY(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,s=i&&i.plugin.domEventHandlers,a=i&&i.plugin.domEventObservers;if(s)for(let u in s){let f=s[u];f&&n(u).handlers.push(GO(r.value,f))}if(a)for(let u in a){let f=a[u];f&&n(u).observers.push(GO(r.value,f))}}for(let r in Bo)n(r).handlers.push(Bo[r]);for(let r in xi)n(r).observers.push(xi[r]);return e}const vL=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],WY="dthko",bL=[16,17,18,20,91,92,224,225],qg=6;function Gg(t){return Math.max(0,t)*.7+8}function KY(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class YY{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=FN(e.contentDOM),this.atoms=e.state.facet(Xd).map(a=>a(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(on.allowMultipleSelections)&&XY(e,n),this.dragging=ZY(e,n)&&wL(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&KY(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,s=0,a=this.view.win.innerWidth,u=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:u}=this.scrollParents.y.getBoundingClientRect());let f=fL(this.view);e.clientX-f.left<=i+qg?n=-Gg(i-e.clientX):e.clientX+f.right>=a-qg&&(n=Gg(e.clientX-a)),e.clientY-f.top<=s+qg?r=-Gg(s-e.clientY):e.clientY+f.bottom>=u-qg&&(r=Gg(e.clientY-u)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=gL(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function XY(t,e){let n=t.state.facet(ZN);return n.length?n[0](e):$e.mac?e.metaKey:e.ctrlKey}function QY(t,e){let n=t.state.facet(JN);return n.length?n[0](e):$e.mac?!e.altKey:!e.ctrlKey}function ZY(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Id(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let a=i[s];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function JY(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Xn.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const Bo=Object.create(null),xi=Object.create(null),xL=$e.ie&&$e.ie_version<15||$e.ios&&$e.webkit_version<604;function eX(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),SL(t,n.value)},50)}function ey(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function SL(t,e){e=ey(t.state,y1,e);let{state:n}=t,r,i=1,s=n.toText(e),a=s.lines==n.selection.ranges.length;if(pS!=null&&n.selection.ranges.every(f=>f.empty)&&pS==s.toString()){let f=-1;r=n.changeByRange(d=>{let g=n.doc.lineAt(d.from);if(g.from==f)return{range:d};f=g.from;let p=n.toText((a?s.line(i++).text:e)+n.lineBreak);return{changes:{from:g.from,insert:p},range:Te.cursor(d.from+p.length)}})}else a?r=n.changeByRange(f=>{let d=s.line(i++);return{changes:{from:f.from,to:f.to,insert:d.text},range:Te.cursor(f.from+d.length)}}):r=n.replaceSelection(s);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}xi.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};xi.wheel=xi.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};Bo.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);xi.touchstart=(t,e)=>{let n=t.inputState,r=e.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};xi.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Bo.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(eL))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=nX(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new YY(t,e,n,r)),r&&t.observer.ignore(()=>{UN(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function WO(t,e,n,r){if(r==1)return Te.cursor(e,n);if(r==2)return IY(t.state,e,n);{let i=t.docView.lineAt(e,n),s=t.state.doc.lineAt(i?i.posAtEnd:e),a=i?i.posAtStart:s.from,u=i?i.posAtEnd:s.to;return u<t.state.doc.length&&u==s.to&&u++,Te.range(a,u)}}const tX=$e.ie&&$e.ie_version<=11;let KO=null,YO=0,XO=0;function wL(t){if(!tX)return t.detail;let e=KO,n=XO;return KO=t,XO=Date.now(),YO=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(YO+1)%3:1}function nX(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=wL(e),i=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),i=i.map(s.changes))},get(s,a,u){let f=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),d,g=WO(t,f.pos,f.assoc,r);if(n.pos!=f.pos&&!a){let p=WO(t,n.pos,n.assoc,r),m=Math.min(p.from,g.from),v=Math.max(p.to,g.to);g=m<g.from?Te.range(m,v,g.assoc):Te.range(v,m,g.assoc)}return a?i.replaceRange(i.main.extend(g.from,g.to,g.assoc)):u&&r==1&&i.ranges.length>1&&(d=rX(i,f.pos))?d:u?i.addRange(g):Te.create([g])}}}function rX(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return Te.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Bo.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let s=i.posAtStart,a=s+i.length;(s>=n.to||a<=n.from)&&(n=Te.range(s,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",ey(t.state,v1,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Bo.dragend=t=>(t.inputState.draggedContent=null,!1);function QO(t,e,n,r){if(n=ey(t.state,y1,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,a=r&&s&&QY(t,e)?{from:s.from,to:s.to}:null,u={from:i,insert:n},f=t.state.changes(a?[a,u]:u);t.focus(),t.dispatch({changes:f,selection:{anchor:f.mapPos(i,-1),head:f.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Bo.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,s=()=>{++i==n.length&&QO(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a<n.length;a++){let u=new FileReader;u.onerror=s,u.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(u.result)||(r[a]=u.result),s()},u.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return QO(t,e,r,!0),!0}return!1};Bo.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=xL?null:e.clipboardData;return n?(SL(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(eX(t),!1)};function iX(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function oX(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:s}of t.selection.ranges){let a=t.doc.lineAt(s);a.number>i&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),i=a.number}r=!0}return{text:ey(t,v1,e.join(t.lineBreak)),ranges:n,linewise:r}}let pS=null;Bo.copy=Bo.cut=(t,e)=>{if(!rd(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=oX(t.state);if(!n&&!i)return!1;pS=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=xL?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(iX(t,n),!1)};const CL=ba.define();function RL(t,e){let n=[];for(let r of t.facet(rL)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:CL.of(!0)}):null}function EL(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=RL(t.state,e);n?t.dispatch(n):t.update([])}},10)}xi.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),EL(t)};xi.blur=t=>{t.observer.clearSelectionRange(),EL(t)};xi.compositionstart=xi.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};xi.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,$e.chrome&&$e.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};xi.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Bo.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(s&&a.length){let u=a[0],f=t.posAtDOM(u.startContainer,u.startOffset),d=t.posAtDOM(u.endContainer,u.endOffset);return S1(t,{from:f,to:d,insert:t.state.toText(s)},null),!0}}let i;if($e.chrome&&$e.android&&(i=vL.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return $e.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),$e.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>xi.compositionend(t,e),20),!1};const ZO=new Set;function sX(t){ZO.has(t)||(ZO.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const JO=["pre-wrap","normal","pre-line","break-spaces"];let Mc=!1;function ek(){Mc=!1}class lX{constructor(e){this.lineWrapping=e,this.doc=qt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return JO.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,s,a){let u=JO.indexOf(e)>-1,f=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=u||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=u,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,f){this.heightSamples={};for(let d=0;d<a.length;d++){let g=a[d];g<0?d++:this.heightSamples[Math.floor(g*10)]=!0}}return f}}class aX{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Mo{constructor(e,n,r,i,s){this.from=e,this.length=n,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?lo.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof cu?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Mo(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var En=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(En||(En={}));const bp=.001;class oi{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>bp&&(Mc=!0),this.height=e)}replace(e,n,r){return oi.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let s=this,a=r.doc;for(let u=i.length-1;u>=0;u--){let{fromA:f,toA:d,fromB:g,toB:p}=i[u],m=s.lineAt(f,En.ByPosNoHeight,r.setDoc(n),0,0),v=m.to>=d?m:s.lineAt(d,En.ByPosNoHeight,r,0,0);for(p+=v.to-d,d=v.to;u>0&&m.from<=i[u-1].toA;)f=i[u-1].fromA,g=i[u-1].fromB,u--,f<m.from&&(m=s.lineAt(f,En.ByPosNoHeight,r,0,0));g+=m.from-f,f=m.from;let b=w1.build(r.setDoc(a),e,g,p);s=Jp(s,s.replace(f,d,b))}return s.updateHeight(r,0)}static empty(){return new ki(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,s=0;for(;;)if(n==r)if(i>s*2){let u=e[n-1];u.break?e.splice(--n,1,u.left,null,u.right):e.splice(--n,1,u.left,u.right),r+=1+u.break,i-=u.size}else if(s>i*2){let u=e[r];u.break?e.splice(r,1,u.left,null,u.right):e.splice(r,1,u.left,u.right),r+=2+u.break,s-=u.size}else break;else if(i<s){let u=e[n++];u&&(i+=u.size)}else{let u=e[--r];u&&(s+=u.size)}let a=0;return e[n-1]==null?(a=1,n--):e[n]==null&&(a=1,r++),new cX(oi.of(e.slice(0,n)),a,oi.of(e.slice(r)))}}function Jp(t,e){return t==e?t:(t.constructor!=e.constructor&&(Mc=!0),e)}oi.prototype.size=1;const uX=Xr.replace({});class TL extends oi{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new Mo(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new Mo(i,0,r,this.spaceAbove,uX):this.mainBlock(r,i)}lineAt(e,n,r,i,s){let a=this.mainBlock(i,s);return this.spaceAbove?this.blockAt(0,r,i,s).join(a):a}forEachLine(e,n,r,i,s,a){e<=s+this.length&&n>=s&&a(this.lineAt(0,En.ByPos,r,i,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class ki extends TL{constructor(e,n,r){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,n){return new Mo(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof ki||i instanceof Ir&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Ir?i=new ki(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):oi.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ir extends oi{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,s=i-r+1,a,u=0;if(e.lineWrapping){let f=Math.min(this.height,e.lineHeight*s);a=f/s,this.length>s+1&&(u=(this.height-f)/(this.length-s-1))}else a=this.height/s;return{firstLine:r,lastLine:i,perLine:a,perChar:u}}blockAt(e,n,r,i){let{firstLine:s,lastLine:a,perLine:u,perChar:f}=this.heightMetrics(n,i);if(n.lineWrapping){let d=i+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),g=n.doc.lineAt(d),p=u+g.length*f,m=Math.max(r,e-p/2);return new Mo(g.from,g.length,m,p,0)}else{let d=Math.max(0,Math.min(a-s,Math.floor((e-r)/u))),{from:g,length:p}=n.doc.line(s+d);return new Mo(g,p,r+u*d,u,0)}}lineAt(e,n,r,i,s){if(n==En.ByHeight)return this.blockAt(e,r,i,s);if(n==En.ByPosNoHeight){let{from:v,to:b}=r.doc.lineAt(e);return new Mo(v,b-v,0,0,0)}let{firstLine:a,perLine:u,perChar:f}=this.heightMetrics(r,s),d=r.doc.lineAt(e),g=u+d.length*f,p=d.number-a,m=i+u*p+f*(d.from-s-p);return new Mo(d.from,d.length,Math.max(i,Math.min(m,i+this.height-g)),g,0)}forEachLine(e,n,r,i,s,a){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:u,perLine:f,perChar:d}=this.heightMetrics(r,s);for(let g=e,p=i;g<=n;){let m=r.doc.lineAt(g);if(g==e){let b=m.number-u;p+=f*b+d*(e-s-b)}let v=f+d*m.length;a(new Mo(m.from,m.length,p,v,0)),p+=v,g=m.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let s=r[r.length-1];s instanceof Ir?r[r.length-1]=new Ir(s.length+i):r.push(null,new Ir(i-1))}if(e>0){let s=r[0];s instanceof Ir?r[0]=new Ir(e+s.length):r.unshift(new Ir(e-1),null)}return oi.of(r)}decomposeLeft(e,n){n.push(new Ir(e-1),null)}decomposeRight(e,n){n.push(null,new Ir(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let s=n+this.length;if(i&&i.from<=n+this.length&&i.more){let a=[],u=Math.max(n,i.from),f=-1;for(i.from>n&&a.push(new Ir(i.from-n-1).updateHeight(e,n));u<=s&&i.more;){let g=e.doc.lineAt(u).length;a.length&&a.push(null);let p=i.heights[i.index++],m=0;p<0&&(m=-p,p=i.heights[i.index++]),f==-1?f=p:Math.abs(p-f)>=bp&&(f=-2);let v=new ki(g,p,m);v.outdated=!1,a.push(v),u+=g+1}u<=s&&a.push(null,new Ir(s-u).updateHeight(e,u));let d=oi.of(a);return(f<0||Math.abs(d.height-this.height)>=bp||Math.abs(f-this.heightMetrics(e,n).perLine)>=bp)&&(Mc=!0),Jp(this,d)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class cX extends oi{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let s=r+this.left.height;return e<s?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,s,i+this.left.length+this.break)}lineAt(e,n,r,i,s){let a=i+this.left.height,u=s+this.left.length+this.break,f=n==En.ByHeight?e<a:e<u,d=f?this.left.lineAt(e,n,r,i,s):this.right.lineAt(e,n,r,a,u);if(this.break||(f?d.to<u:d.from>u))return d;let g=n==En.ByPosNoHeight?En.ByPosNoHeight:En.ByPos;return f?d.join(this.right.lineAt(u,g,r,a,u)):this.left.lineAt(u,g,r,i,s).join(d)}forEachLine(e,n,r,i,s,a){let u=i+this.left.height,f=s+this.left.length+this.break;if(this.break)e<f&&this.left.forEachLine(e,n,r,i,s,a),n>=f&&this.right.forEachLine(e,n,r,u,f,a);else{let d=this.lineAt(f,En.ByPos,r,i,s);e<d.from&&this.left.forEachLine(e,d.from-1,r,i,s,a),d.to>=e&&d.from<=n&&a(d),n>d.to&&this.right.forEachLine(d.to+1,n,r,u,f,a)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let a=s.length;for(let u of r)s.push(u);if(e>0&&tk(s,a-1),n<this.length){let u=s.length;this.decomposeRight(n,s),tk(s,u)}return oi.of(s)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?oi.of(this.break?[e,null,n]:[e,n]):(this.left=Jp(this.left,e),this.right=Jp(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:s,right:a}=this,u=n+s.length+this.break,f=null;return i&&i.from<=n+s.length&&i.more?f=s=s.updateHeight(e,n,r,i):s.updateHeight(e,n,r),i&&i.from<=u+a.length&&i.more?f=a=a.updateHeight(e,u,r,i):a.updateHeight(e,u,r),f?this.balanced(s,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function tk(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof Ir&&(r=t[e+1])instanceof Ir&&t.splice(e-1,3,new Ir(n.length+1+r.length))}const fX=5;class w1{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof ki?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new ki(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let a=n-e;r.block?this.addBlock(new TL(a,i,r)):(a||s||i>=fX)&&this.addLineDeco(i,s,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new ki(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new Ir(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ki)return e;let n=new ki(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof ki)&&!this.isCovered?this.nodes.push(new ki(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof ki&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let s=new w1(r,e);return cn.spans(n,r,i,s,0),s.finish(r)}}function dX(t,e,n){let r=new hX;return cn.compare(t,e,n,r,0),r.changes}class hX{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&dc(e,n,this.changes,5)}}function gX(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,s=Math.max(0,n.left),a=Math.min(i.innerWidth,n.right),u=Math.max(0,n.top),f=Math.min(i.innerHeight,n.bottom);for(let d=t.parentNode;d&&d!=r.body;)if(d.nodeType==1){let g=d,p=window.getComputedStyle(g);if((g.scrollHeight>g.clientHeight||g.scrollWidth>g.clientWidth)&&p.overflow!="visible"){let m=g.getBoundingClientRect();s=Math.max(s,m.left),a=Math.min(a,m.right),u=Math.max(u,m.top),f=Math.min(d==t.parentNode?i.innerHeight:f,m.bottom)}d=p.position=="absolute"||p.position=="fixed"?g.offsetParent:g.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:s-n.left,right:Math.max(s,a)-n.left,top:u-(n.top+e),bottom:Math.max(u,f)-(n.top+e)}}function pX(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function mX(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class bb{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],s=n[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,n){return Xr.replace({widget:new yX(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class yX extends Xm{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class nk{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=rk,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=hr.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(b1).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new lX(r),this.stateDeco=ik(n),this.heightMap=oi.empty().applyChanges(this.stateDeco,qt.empty,this.heightOracle.setDoc(n.doc),[new ro(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Xr.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:s,to:a})=>i>=s&&i<=a)){let{from:s,to:a}=this.lineBlockAt(i);e.push(new Wg(s,a))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?rk:new C1(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push($f(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=ik(this.state);let i=e.changedRanges,s=ro.extendWithRanges(i,dX(r,this.stateDeco,e?e.changes:vr.empty(this.state.doc.length))),a=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);ek(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||Mc)&&(e.flags|=2),u?(this.scrollAnchorPos=e.changes.mapPos(u.from,-1),this.scrollAnchorHeight=u.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let f=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<f.from||n.range.head>f.to)||!this.viewportIsAppropriate(f))&&(f=this.getViewport(0,n));let d=f.from!=this.viewport.from||f.to!=this.viewport.to;this.viewport=f,e.flags|=this.updateForViewport(),(d||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(aY)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?hr.RTL:hr.LTR;let a=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",u=n.getBoundingClientRect(),f=a||this.mustMeasureContent||this.contentDOMHeight!=u.height;this.contentDOMHeight=u.height,this.mustMeasureContent=!1;let d=0,g=0;if(u.width&&u.height){let{scaleX:k,scaleY:P}=VN(n,u);(k>.005&&Math.abs(this.scaleX-k)>.005||P>.005&&Math.abs(this.scaleY-P)>.005)&&(this.scaleX=k,this.scaleY=P,d|=16,a=f=!0)}let p=(parseInt(r.paddingTop)||0)*this.scaleY,m=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=m)&&(this.paddingTop=p,this.paddingBottom=m,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(f=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let v=FN(this.view.contentDOM,!1).y;v!=this.scrollParent&&(this.scrollParent=v,this.scrollAnchorHeight=-1,this.scrollOffset=0);let b=this.getScrollOffset();this.scrollOffset!=b&&(this.scrollAnchorHeight=-1,this.scrollOffset=b),this.scrolledToBottom=$N(this.scrollParent||e.win);let S=(this.printing?mX:gX)(n,this.paddingTop),w=S.top-this.pixelViewport.top,C=S.bottom-this.pixelViewport.bottom;this.pixelViewport=S;let R=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(R!=this.inView&&(this.inView=R,R&&(f=!0)),!this.inView&&!this.scrollTarget&&!pX(e.dom))return 0;let T=u.width;if((this.contentDOMWidth!=T||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=u.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),f){let k=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(k)&&(a=!0),a||i.lineWrapping&&Math.abs(T-this.contentDOMWidth)>i.charWidth){let{lineHeight:P,charWidth:M,textHeight:D}=e.docView.measureTextSize();a=P>0&&i.refresh(s,P,M,D,Math.max(5,T/M),k),a&&(e.docView.minWidth=0,d|=16)}w>0&&C>0?g=Math.max(w,C):w<0&&C<0&&(g=Math.min(w,C)),ek();for(let P of this.viewports){let M=P.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(P);this.heightMap=(a?oi.empty().applyChanges(this.stateDeco,qt.empty,this.heightOracle,[new ro(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new aX(P.from,M))}Mc&&(d|=2)}let A=!this.viewportIsAppropriate(this.viewport,g)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return A&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(g,this.scrollTarget),d|=this.updateForViewport()),(d&2||A)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:a,visibleBottom:u}=this,f=new Wg(i.lineAt(a-r*1e3,En.ByHeight,s,0,0).from,i.lineAt(u+(1-r)*1e3,En.ByHeight,s,0,0).to);if(n){let{head:d}=n.range;if(d<f.from||d>f.to){let g=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=i.lineAt(d,En.ByPos,s,0,0),m;n.y=="center"?m=(p.top+p.bottom)/2-g/2:n.y=="start"||n.y=="nearest"&&d<f.from?m=p.top:m=p.bottom-g,f=new Wg(i.lineAt(m-1e3/2,En.ByHeight,s,0,0).from,i.lineAt(m+g+1e3/2,En.ByHeight,s,0,0).to)}}return f}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new Wg(this.heightMap.lineAt(r,En.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,En.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,En.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,En.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:u}=this;return(e==0||i<=a-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=u+Math.max(10,Math.min(r,250)))&&i>a-2*1e3&&s<u+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new bb(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,a=i<<1;if(this.defaultTextDirection!=hr.LTR&&!r)return[];let u=[],f=(g,p,m,v)=>{if(p-g<s)return;let b=this.state.selection.main,S=[b.from];b.empty||S.push(b.to);for(let C of S)if(C>g&&C<p){f(g,C-10,m,v),f(C+10,p,m,v);return}let w=bX(e,C=>C.from>=m.from&&C.to<=m.to&&Math.abs(C.from-g)<s&&Math.abs(C.to-p)<s&&!S.some(R=>C.from<R&&C.to>R));if(!w){if(p<m.to&&n&&r&&n.visibleRanges.some(T=>T.from<=p&&T.to>=p)){let T=n.moveToLineBoundary(Te.cursor(p),!1,!0).head;T>g&&(p=T)}let C=this.gapSize(m,g,p,v),R=r||C<2e6?C:2e6;w=new bb(g,p,C,R)}u.push(w)},d=g=>{if(g.length<a||g.type!=lo.Text)return;let p=vX(g.from,g.to,this.stateDeco);if(p.total<a)return;let m=this.scrollTarget?this.scrollTarget.range.head:null,v,b;if(r){let S=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,w,C;if(m!=null){let R=Yg(p,m),T=((this.visibleBottom-this.visibleTop)/2+S)/g.height;w=R-T,C=R+T}else w=(this.visibleTop-g.top-S)/g.height,C=(this.visibleBottom-g.top+S)/g.height;v=Kg(p,w),b=Kg(p,C)}else{let S=p.total*this.heightOracle.charWidth,w=i*this.heightOracle.charWidth,C=0;if(S>2e6)for(let P of e)P.from>=g.from&&P.from<g.to&&P.size!=P.displaySize&&P.from*this.heightOracle.charWidth+C<this.pixelViewport.left&&(C=P.size-P.displaySize);let R=this.pixelViewport.left+C,T=this.pixelViewport.right+C,A,k;if(m!=null){let P=Yg(p,m),M=((T-R)/2+w)/S;A=P-M,k=P+M}else A=(R-w)/S,k=(T+w)/S;v=Kg(p,A),b=Kg(p,k)}v>g.from&&f(g.from,v,g,p),b<g.to&&f(b,g.to,g,p)};for(let g of this.viewportLines)Array.isArray(g.type)?g.type.forEach(d):d(g);return u}gapSize(e,n,r,i){let s=Yg(i,r)-Yg(i,n);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){bb.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Xr.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];cn.spans(n,this.viewport.from,this.viewport.to,{span(s,a){r.push({from:s,to:a})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let a=this.visibleRanges[s],u=r[s];(a.from!=u.from||a.to!=u.to)&&(i|=4,e&&e.mapPos(a.from,-1)==u.from&&e.mapPos(a.to,1)==u.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||$f(this.heightMap.lineAt(e,En.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||$f(this.heightMap.lineAt(this.scaler.fromDOM(e),En.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return $f(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Wg{constructor(e,n){this.from=e,this.to=n}}function vX(t,e,n){let r=[],i=t,s=0;return cn.spans(n,t,e,{span(){},point(a,u){a>i&&(r.push({from:i,to:a}),s+=a-i),i=u}},20),i<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function Kg({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:s,to:a}=e[i],u=a-s;if(r<=u)return s+r;r-=u}}function Yg(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function bX(t,e){for(let n of t)if(e(n))return n}const rk={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function ik(t){let e=t.facet(Qm).filter(r=>typeof r!="function"),n=t.facet(x1).filter(r=>typeof r!="function");return n.length&&e.push(cn.join(n)),e}class C1{constructor(e,n,r){let i=0,s=0,a=0;this.viewports=r.map(({from:u,to:f})=>{let d=n.lineAt(u,En.ByPos,e,0,0).top,g=n.lineAt(f,En.ByPos,e,0,0).bottom;return i+=g-d,{from:u,to:f,top:d,bottom:g,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let u of this.viewports)u.domTop=a+(u.top-s)*this.scale,a=u.domBottom=u.domTop+(u.bottom-u.top),s=u.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof C1?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function $f(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Mo(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>$f(i,e)):t._content)}const Xg=vt.define({combine:t=>t.join(" ")}),mS=vt.define({combine:t=>t.indexOf(!0)>-1}),yS=Rc.newName(),AL=Rc.newName(),ML=Rc.newName(),OL={"&light":"."+AL,"&dark":"."+ML};function vS(t,e,n){return new Rc(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const xX=vS("."+yS,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},OL),SX={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},xb=$e.ie&&$e.ie_version<=11;class wX{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new XK,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);($e.ie&&$e.ie_version<=11||$e.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&$e.android&&e.constructor.EDIT_CONTEXT!==!1&&!($e.chrome&&$e.chrome_version<126)&&(this.editContext=new RX(e),e.state.facet(Ws)&&(e.contentDOM.editContext=this.editContext.editContext)),xb&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Ws)?r.root.activeElement!=this.dom:!rd(this.dom,i))return;let s=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}($e.ie&&$e.ie_version<=11||$e.android&&$e.chrome)&&!r.state.selection.main.empty&&i.focusNode&&id(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Id(e.root);if(!n)return!1;let r=$e.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&CX(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=rd(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&ZK(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,SX),xb&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),xb&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&hc(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let s of e){let a=this.readMutation(s);a&&(a.typeOver&&(i=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&rd(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new VY(this.view,e,n,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=mL(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!Zp(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let r=ok(n,e.previousSibling||e.target.previousSibling,-1),i=ok(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ws)!=e.state.facet(Ws)&&(e.view.contentDOM.editContext=e.state.facet(Ws)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function ok(t,e,n){for(;e;){let r=Xn.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function sk(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor,1);return id(a.node,a.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function CX(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return sk(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?sk(t,n):null}class RX{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:a}=i,u=this.toEditorPos(r.updateRangeStart),f=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:u,drifted:!1});let d=f-u>r.text.length;u==this.from&&s<this.from?u=s:f==this.to&&s>this.to&&(f=s);let g=yL(e.state.sliceDoc(u,f),r.text,(d?i.from:i.to)-u,d?"end":null);if(!g){let m=Te.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));Zp(m,i)||e.dispatch({selection:m,userEvent:"select"});return}let p={from:g.from+u,to:g.toA+u,insert:qt.of(r.text.slice(g.from,g.toB).split(`
|
|
30
|
-
`))};if(($e.mac||$e.android)&&p.from==a-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:u,to:f,insert:qt.of([r.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let m=this.to-this.from+(p.to-p.from+p.insert.length);S1(e,p,Te.single(this.toEditorPos(r.selectionStart,m),this.toEditorPos(r.selectionEnd,m)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),p.from<p.to&&!p.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let a=this.toEditorPos(r.rangeStart),u=this.toEditorPos(r.rangeEnd);a<u;a++){let f=e.coordsForChar(a);s=f&&new DOMRect(f.left,f.top,f.right-f.left,f.bottom-f.top)||s||new DOMRect,i.push(s)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let a=s.underlineStyle,u=s.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(u)){let f=this.toEditorPos(s.rangeStart),d=this.toEditorPos(s.rangeEnd);if(f<d){let g=`text-decoration: underline ${/^[a-z]/.test(a)?a+" ":a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${/thin/i.test(u)?1:2}px`;i.push(Xr.mark({attributes:{style:g}}).range(f,d))}}}e.dispatch({effects:sL.of(Xr.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Id(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,a,u,f,d)=>{if(r)return;let g=d.length-(a-s);if(i&&a>=i.to)if(i.from==s&&i.to==a&&i.insert.eq(d)){i=this.pendingContextChange=null,n+=g,this.to+=g;return}else i=null,this.revertPending(e.state);if(s+=n,a+=n,a<=this.from)this.from+=g,this.to+=g;else if(s<this.to){if(s<this.from||a>this.to||this.to-this.from+d.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(a),d.toString()),this.to+=g}n+=g}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Et{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||QK(e.parent)||document,this.viewState=new nk(this,e.state||on.create(e)),e.scrollTo&&e.scrollTo.is($g)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(rc).map(i=>new gb(i));for(let i of this.plugins)i.update(this);this.observer=new wX(this),this.inputState=new qY(this),this.inputState.ensureHandlers(this.plugins),this.docView=new UO(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof xr?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,s=this.state;for(let m of e){if(m.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=m.state}if(this.destroyed){this.viewState.state=s;return}let a=this.hasFocus,u=0,f=null;e.some(m=>m.annotation(CL))?(this.inputState.notifiedFocused=a,u=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,f=RL(s,a),f||(u=1));let d=this.observer.delayedAndroidKey,g=null;if(d?(this.observer.clearDelayedAndroidKey(),g=this.observer.readChange(),(g&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(g=null)):this.observer.clear(),s.facet(on.phrases)!=this.state.facet(on.phrases))return this.setState(s);i=Yp.create(this,s,e),i.flags|=u;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let m of e){if(p&&(p=p.map(m.changes)),m.scrollIntoView){let{main:v}=m.state.selection;p=new gc(v.empty?v:Te.cursor(v.head,v.head>v.anchor?-1:1))}for(let v of m.effects)v.is($g)&&(p=v.value.clip(this.state))}this.viewState.update(i,p),this.bidiCache=em.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Uf)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(m=>m.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Xg)!=i.state.facet(Xg)&&(this.viewState.mustMeasureContent=!0),(n||r||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let m of this.state.facet(dS))try{m(i)}catch(v){hs(this.state,v,"update listener")}(f||g)&&Promise.resolve().then(()=>{f&&this.state==f.startState&&this.dispatch(f),g&&!mL(this,g)&&d.force&&hc(this.contentDOM,d.key,d.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new nk(this,e),this.plugins=e.facet(rc).map(r=>new gb(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new UO(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(rc),r=e.state.facet(rc);if(n!=r){let i=[];for(let s of r){let a=n.indexOf(s);if(a<0)i.push(new gb(s));else{let u=this.plugins[a];u.mustUpdate=e,i.push(u)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){hs(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:a}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let u=0;;u++){if(a<0)if($N(r||this.win))s=-1,a=this.viewState.heightMap.height;else{let v=this.viewState.scrollAnchorAt(i);s=v.from,a=v.top}this.updateState=1;let f=this.viewState.measure();if(!f&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(u>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];f&4||([this.measureRequests,d]=[d,this.measureRequests]);let g=d.map(v=>{try{return v.read(this)}catch(b){return hs(this.state,b),lk}}),p=Yp.create(this,this.state,[]),m=!1;p.flags|=f,n?n.flags|=f:n=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),m=this.docView.update(p),m&&this.docViewUpdate());for(let v=0;v<d.length;v++)if(g[v]!=lk)try{let b=d[v];b.write&&b.write(g[v],this)}catch(b){hs(this.state,b)}if(m&&this.docView.updateSelection(!0),!p.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let b=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-a)/this.scaleY;if((b>1||b<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+b,r?r.scrollTop+=b:this.win.scrollBy(0,b),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let u of this.state.facet(dS))u(n)}get themeClasses(){return yS+" "+(this.state.facet(mS)?ML:AL)+" "+this.state.facet(Xg)}updateAttrs(){let e=ak(this,lL,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ws)?"true":"false",class:"cm-content",style:`${$e.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),ak(this,b1,n);let r=this.observer.ignore(()=>{let i=BO(this.contentDOM,this.contentAttrs,n),s=BO(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(Et.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Uf);let e=this.state.facet(Et.cspNonce);Rc.mount(this.root,this.styleModules.concat(xX).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return vb(this,e,$O(this,e,n,r))}moveByGroup(e,n){return vb(this,e,$O(this,e,n,r=>NY(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[n?r.length-1:0];return Te.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return zY(this,e,n,r)}moveVertically(e,n,r){return vb(this,e,LY(this,e,n,r))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let r=gS(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),gS(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),a=s[ds.find(s,e-i.from,-1,n)];return Kp(r,a.dir==hr.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(iL)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>EX)return XN(e.length);let n=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||YN(s.isolates,r=jO(this,e))))return s.order;r||(r=jO(this,e));let i=oY(e.text,n,r);return this.bidiCache.push(new em(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||$e.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{UN(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return $g.of(new gc(typeof e=="number"?Te.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return $g.of(new gc(Te.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Ec.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ec.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Rc.newName(),i=[Xg.of(r),Uf.of(vS(`.${r}`,e))];return n&&n.dark&&i.push(mS.of(!0)),i}static baseTheme(e){return AN.lowest(Uf.of(vS("."+yS,e,OL)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Xn.get(r)||Xn.get(e);return((n=i?.root)===null||n===void 0?void 0:n.view)||null}}Et.styleModule=Uf;Et.inputHandler=nL;Et.clipboardInputFilter=y1;Et.clipboardOutputFilter=v1;Et.scrollHandler=oL;Et.focusChangeEffect=rL;Et.perLineTextDirection=iL;Et.exceptionSink=tL;Et.updateListener=dS;Et.editable=Ws;Et.mouseSelectionStyle=eL;Et.dragMovesSelection=JN;Et.clickAddsSelectionRange=ZN;Et.decorations=Qm;Et.blockWrappers=aL;Et.outerDecorations=x1;Et.atomicRanges=Xd;Et.bidiIsolatedRanges=uL;Et.scrollMargins=cL;Et.darkTheme=mS;Et.cspNonce=vt.define({combine:t=>t.length?t[0]:""});Et.contentAttributes=b1;Et.editorAttributes=lL;Et.lineWrapping=Et.contentAttributes.of({class:"cm-lineWrapping"});Et.announce=ir.define();const EX=4096,lk={};class em{constructor(e,n,r,i,s,a){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=s,this.order=a}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:hr.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let a=e[s];a.dir==i&&!n.touchesRange(a.from,a.to)&&r.push(new em(n.mapPos(a.from,1),n.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return r}}function ak(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let s=r[i],a=typeof s=="function"?s(t):s;a&&g1(a,n)}return n}const TX=$e.mac?"mac":$e.windows?"win":$e.linux?"linux":"key";function AX(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,a,u;for(let f=0;f<n.length-1;++f){const d=n[f];if(/^(cmd|meta|m)$/i.test(d))u=!0;else if(/^a(lt)?$/i.test(d))i=!0;else if(/^(c|ctrl|control)$/i.test(d))s=!0;else if(/^s(hift)?$/i.test(d))a=!0;else if(/^mod$/i.test(d))e=="mac"?u=!0:s=!0;else throw new Error("Unrecognized modifier name: "+d)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),u&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function Qg(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const MX=AN.default(Et.domEventHandlers({keydown(t,e){return DX(OX(e.state),t,e,"editor")}})),kL=vt.define({enables:MX}),uk=new WeakMap;function OX(t){let e=t.facet(kL),n=uk.get(e);return n||uk.set(e,n=IX(e.reduce((r,i)=>r.concat(i),[]))),n}let Kl=null;const kX=4e3;function IX(t,e=TX){let n=Object.create(null),r=Object.create(null),i=(a,u)=>{let f=r[a];if(f==null)r[a]=u;else if(f!=u)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},s=(a,u,f,d,g)=>{var p,m;let v=n[a]||(n[a]=Object.create(null)),b=u.split(/ (?!$)/).map(C=>AX(C,e));for(let C=1;C<b.length;C++){let R=b.slice(0,C).join(" ");i(R,!0),v[R]||(v[R]={preventDefault:!0,stopPropagation:!1,run:[T=>{let A=Kl={view:T,prefix:R,scope:a};return setTimeout(()=>{Kl==A&&(Kl=null)},kX),!0}]})}let S=b.join(" ");i(S,!1);let w=v[S]||(v[S]={preventDefault:!1,stopPropagation:!1,run:((m=(p=v._any)===null||p===void 0?void 0:p.run)===null||m===void 0?void 0:m.slice())||[]});f&&w.run.push(f),d&&(w.preventDefault=!0),g&&(w.stopPropagation=!0)};for(let a of t){let u=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let d of u){let g=n[d]||(n[d]=Object.create(null));g._any||(g._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=a;for(let m in g)g[m].run.push(v=>p(v,bS))}let f=a[e]||a.key;if(f)for(let d of u)s(d,f,a.run,a.preventDefault,a.stopPropagation),a.shift&&s(d,"Shift-"+f,a.shift,a.preventDefault,a.stopPropagation)}return n}let bS=null;function DX(t,e,n,r){bS=e;let i=UK(e),s=RK(i,0),a=EK(s)==i.length&&i!=" ",u="",f=!1,d=!1,g=!1;Kl&&Kl.view==n&&Kl.scope==r&&(u=Kl.prefix+" ",bL.indexOf(e.keyCode)<0&&(d=!0,Kl=null));let p=new Set,m=w=>{if(w){for(let C of w.run)if(!p.has(C)&&(p.add(C),C(n)))return w.stopPropagation&&(g=!0),!0;w.preventDefault&&(w.stopPropagation&&(g=!0),d=!0)}return!1},v=t[r],b,S;return v&&(m(v[u+Qg(i,e,!a)])?f=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!($e.windows&&e.ctrlKey&&e.altKey)&&!($e.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(b=ua[e.keyCode])&&b!=i?(m(v[u+Qg(b,e,!0)])||e.shiftKey&&(S=Od[e.keyCode])!=i&&S!=b&&m(v[u+Qg(S,e,!1)]))&&(f=!0):a&&e.shiftKey&&m(v[u+Qg(i,e,!0)])&&(f=!0),!f&&m(v._any)&&(f=!0)),d&&(f=!0),f&&g&&e.stopPropagation(),bS=null,f}class Oc extends uu{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Oc.prototype.elementClass="";Oc.prototype.toDOM=void 0;Oc.prototype.mapMode=Di.TrackBefore;Oc.prototype.startSide=Oc.prototype.endSide=-1;Oc.prototype.point=!0;const PX=1024;let zX=0;class Sb{constructor(e,n){this.from=e,this.to=n}}class Gt{constructor(e={}){this.id=zX++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=co.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Gt.closedBy=new Gt({deserialize:t=>t.split(" ")});Gt.openedBy=new Gt({deserialize:t=>t.split(" ")});Gt.group=new Gt({deserialize:t=>t.split(" ")});Gt.isolate=new Gt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Gt.contextHash=new Gt({perNode:!0});Gt.lookAhead=new Gt({perNode:!0});Gt.mounted=new Gt({perNode:!0});class sd{constructor(e,n,r,i=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[Gt.mounted.id]}}const NX=Object.create(null);class co{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):NX,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new co(e.name||"",n,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Gt.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Gt.group),s=-1;s<(i?i.length:0);s++){let a=n[s<0?r.name:i[s]];if(a)return a}}}}co.none=new co("",Object.create(null),0,8);const Zg=new WeakMap,ck=new WeakMap;var rr;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(rr||(rr={}));class Nr{constructor(e,n,r,i,s){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[a,u]of s)this.props[typeof a=="number"?a:a.id]=u}}toString(){let e=sd.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new SS(this.topNode,e)}cursorAt(e,n=0,r=0){let i=Zg.get(this)||this.topNode,s=new SS(i);return s.moveTo(e,n),Zg.set(this,s._tree),s}get topNode(){return new ao(this,0,0,null)}resolve(e,n=0){let r=Pd(Zg.get(this)||this.topNode,e,n,!1);return Zg.set(this,r),r}resolveInner(e,n=0){let r=Pd(ck.get(this)||this.topNode,e,n,!0);return ck.set(this,r),r}resolveStack(e,n=0){return _X(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:s=this.length}=e,a=e.mode||0,u=(a&rr.IncludeAnonymous)>0;for(let f=this.cursor(a|rr.IncludeAnonymous);;){let d=!1;if(f.from<=s&&f.to>=i&&(!u&&f.type.isAnonymous||n(f)!==!1)){if(f.firstChild())continue;d=!0}for(;d&&r&&(u||!f.type.isAnonymous)&&r(f),!f.nextSibling();){if(!f.parent())return;d=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:T1(co.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new Nr(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new Nr(co.none,n,r,i)))}static build(e){return HX(e)}}Nr.empty=new Nr(co.none,[],[],0);class R1{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new R1(this.buffer,this.index)}}class fa{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return co.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let a=[];for(;e<r;)a.push(this.childString(e)),e=this.buffer[e+3];return s+"("+a.join(",")+")"}findChild(e,n,r,i,s){let{buffer:a}=this,u=-1;for(let f=e;f!=n&&!(IL(s,i,a[f+1],a[f+2])&&(u=f,r>0));f=a[f+3]);return u}slice(e,n,r){let i=this.buffer,s=new Uint16Array(n-e),a=0;for(let u=e,f=0;u<n;){s[f++]=i[u++],s[f++]=i[u++]-r;let d=s[f++]=i[u++]-r;s[f++]=i[u++]-e,a=Math.max(a,d)}return new fa(s,a,this.set)}}function IL(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Pd(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let a=!r&&t instanceof ao&&t.index<0?null:t.parent;if(!a)return t;t=a}let s=r?0:rr.IgnoreOverlays;if(r)for(let a=t,u=a.parent;u;a=u,u=a.parent)a instanceof ao&&a.index<0&&((i=u.enter(e,n,s))===null||i===void 0?void 0:i.from)!=a.from&&(t=u);for(;;){let a=t.enter(e,n,s);if(!a)return t;t=a}}class DL{cursor(e=0){return new SS(this,e)}getChild(e,n=null,r=null){let i=fk(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return fk(this,e,n,r)}resolve(e,n=0){return Pd(this,e,n,!1)}resolveInner(e,n=0){return Pd(this,e,n,!0)}matchContext(e){return xS(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class ao extends DL{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,s=0){for(let a=this;;){for(let{children:u,positions:f}=a._tree,d=n>0?u.length:-1;e!=d;e+=n){let g=u[e],p=f[e]+a.from,m;if(!(!(s&rr.EnterBracketed&&g instanceof Nr&&(m=sd.get(g))&&!m.overlay&&m.bracketed&&r>=p&&r<=p+g.length)&&!IL(i,r,p,p+g.length))){if(g instanceof fa){if(s&rr.ExcludeBuffers)continue;let v=g.findChild(0,g.buffer.length,n,r-p,i);if(v>-1)return new Zl(new LX(a,g,e,p),null,v)}else if(s&rr.IncludeAnonymous||!g.type.isAnonymous||E1(g)){let v;if(!(s&rr.IgnoreMounts)&&(v=sd.get(g))&&!v.overlay)return new ao(v.tree,p,e,a);let b=new ao(g,p,e,a);return s&rr.IncludeAnonymous||!b.type.isAnonymous?b:b.nextChild(n<0?g.children.length-1:0,n,r,i,s)}}}if(s&rr.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,r=0){let i;if(!(r&rr.IgnoreOverlays)&&(i=sd.get(this._tree))&&i.overlay){let s=e-this.from,a=r&rr.EnterBracketed&&i.bracketed;for(let{from:u,to:f}of i.overlay)if((n>0||a?u<=s:u<s)&&(n<0||a?f>=s:f>s))return new ao(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function fk(t,e,n,r){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(n!=null){for(let a=!1;!a;)if(a=i.type.is(n),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function xS(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class LX{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class Zl extends DL{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return s<0?null:new Zl(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,r=0){if(r&rr.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new Zl(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Zl(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Zl(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let a=r.buffer[this.index+1];e.push(r.slice(i,s,a)),n.push(0)}return new Nr(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function PL(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let a=t[s];(a.from>n.from||a.to<n.to)&&(n=a,e=s)}let r=n instanceof ao&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new BX(i,n)}class BX{constructor(e,n){this.heads=e,this.node=n}get next(){return PL(this.heads)}}function _X(t,e,n){let r=t.resolveInner(e,n),i=null;for(let s=r instanceof ao?r:r.context.parent;s;s=s.parent)if(s.index<0){let a=s.parent;(i||(i=[r])).push(a.resolve(e,n)),s=a}else{let a=sd.get(s.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let u=new ao(a.tree,a.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Pd(u,e,n,!1))}}return i?PL(i):r}class SS{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~rr.EnterBracketed,e instanceof ao)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof ao?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&rr.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&rr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&rr.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let s=n+e,a=e<0?-1:r._tree.children.length;s!=a;s+=e){let u=r._tree.children[s];if(this.mode&rr.IncludeAnonymous||u instanceof fa||!u.type.isAnonymous||E1(u))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let a=e;a;a=a._parent)if(a.index==i){if(i==this.index)return a;n=a,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)n=new Zl(this.buffer,n,this.stack[i]);return this.bufferNode=new Zl(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return xS(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return xS(this._tree,e,i);let a=r[n.buffer[this.stack[s]]];if(!a.isAnonymous){if(e[i]&&e[i]!=a.name)return!1;i--}}return!0}}function E1(t){return t.children.some(e=>e instanceof fa||!e.type.isAnonymous||E1(e))}function HX(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=PX,reused:s=[],minRepeatType:a=r.types.length}=t,u=Array.isArray(n)?new R1(n,n.length):n,f=r.types,d=0,g=0;function p(k,P,M,D,L,H){let{id:N,start:_,end:$,size:F}=u,G=g,j=d;if(F<0)if(u.next(),F==-1){let z=s[N];M.push(z),D.push(_-k);return}else if(F==-3){d=N;return}else if(F==-4){g=N;return}else throw new RangeError(`Unrecognized record size: ${F}`);let q=f[N],V,te,J=_-k;if($-_<=i&&(te=w(u.pos-P,L))){let z=new Uint16Array(te.size-te.skip),U=u.pos-te.size,W=z.length;for(;u.pos>U;)W=C(te.start,z,W);V=new fa(z,$-te.start,r),J=te.start-k}else{let z=u.pos-F;u.next();let U=[],W=[],X=N>=a?N:-1,ie=0,ee=$;for(;u.pos>z;)X>=0&&u.id==X&&u.size>=0?(u.end<=ee-i&&(b(U,W,_,ie,u.end,ee,X,G,j),ie=U.length,ee=u.end),u.next()):H>2500?m(_,z,U,W):p(_,z,U,W,X,H+1);if(X>=0&&ie>0&&ie<U.length&&b(U,W,_,ie,_,ee,X,G,j),U.reverse(),W.reverse(),X>-1&&ie>0){let ue=v(q,j);V=T1(q,U,W,0,U.length,0,$-_,ue,ue)}else V=S(q,U,W,$-_,G-$,j)}M.push(V),D.push(J)}function m(k,P,M,D){let L=[],H=0,N=-1;for(;u.pos>P;){let{id:_,start:$,end:F,size:G}=u;if(G>4)u.next();else{if(N>-1&&$<N)break;N<0&&(N=F-i),L.push(_,$,F),H++,u.next()}}if(H){let _=new Uint16Array(H*4),$=L[L.length-2];for(let F=L.length-3,G=0;F>=0;F-=3)_[G++]=L[F],_[G++]=L[F+1]-$,_[G++]=L[F+2]-$,_[G++]=G;M.push(new fa(_,L[2]-$,r)),D.push($-k)}}function v(k,P){return(M,D,L)=>{let H=0,N=M.length-1,_,$;if(N>=0&&(_=M[N])instanceof Nr){if(!N&&_.type==k&&_.length==L)return _;($=_.prop(Gt.lookAhead))&&(H=D[N]+_.length+$)}return S(k,M,D,L,H,P)}}function b(k,P,M,D,L,H,N,_,$){let F=[],G=[];for(;k.length>D;)F.push(k.pop()),G.push(P.pop()+M-L);k.push(S(r.types[N],F,G,H-L,_-H,$)),P.push(L-M)}function S(k,P,M,D,L,H,N){if(H){let _=[Gt.contextHash,H];N=N?[_].concat(N):[_]}if(L>25){let _=[Gt.lookAhead,L];N=N?[_].concat(N):[_]}return new Nr(k,P,M,D,N)}function w(k,P){let M=u.fork(),D=0,L=0,H=0,N=M.end-i,_={size:0,start:0,skip:0};e:for(let $=M.pos-k;M.pos>$;){let F=M.size;if(M.id==P&&F>=0){_.size=D,_.start=L,_.skip=H,H+=4,D+=4,M.next();continue}let G=M.pos-F;if(F<0||G<$||M.start<N)break;let j=M.id>=a?4:0,q=M.start;for(M.next();M.pos>G;){if(M.size<0)if(M.size==-3||M.size==-4)j+=4;else break e;else M.id>=a&&(j+=4);M.next()}L=q,D+=F,H+=j}return(P<0||D==k)&&(_.size=D,_.start=L,_.skip=H),_.size>4?_:void 0}function C(k,P,M){let{id:D,start:L,end:H,size:N}=u;if(u.next(),N>=0&&D<a){let _=M;if(N>4){let $=u.pos-(N-4);for(;u.pos>$;)M=C(k,P,M)}P[--M]=_,P[--M]=H-k,P[--M]=L-k,P[--M]=D}else N==-3?d=D:N==-4&&(g=D);return M}let R=[],T=[];for(;u.pos>0;)p(t.start||0,t.bufferStart||0,R,T,-1,0);let A=(e=t.length)!==null&&e!==void 0?e:R.length?T[0]+R[0].length:0;return new Nr(f[t.topID],R.reverse(),T.reverse(),A)}const dk=new WeakMap;function xp(t,e){if(!t.isAnonymous||e instanceof fa||e.type!=t)return 1;let n=dk.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Nr)){n=1;break}n+=xp(t,r)}dk.set(e,n)}return n}function T1(t,e,n,r,i,s,a,u,f){let d=0;for(let b=r;b<i;b++)d+=xp(t,e[b]);let g=Math.ceil(d*1.5/8),p=[],m=[];function v(b,S,w,C,R){for(let T=w;T<C;){let A=T,k=S[T],P=xp(t,b[T]);for(T++;T<C;T++){let M=xp(t,b[T]);if(P+M>=g)break;P+=M}if(T==A+1){if(P>g){let M=b[A];v(M.children,M.positions,0,M.children.length,S[A]+R);continue}p.push(b[A])}else{let M=S[T-1]+b[T-1].length-k;p.push(T1(t,b,S,A,T,k,M,null,f))}m.push(k+R-s)}}return v(e,n,r,i,0),(u||f)(p,m,a)}class nu{constructor(e,n,r,i,s=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(s?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new nu(0,e.length,e,0,!1,r)];for(let s of n)s.to>e.length&&i.push(s);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],s=1,a=e.length?e[0]:null;for(let u=0,f=0,d=0;;u++){let g=u<n.length?n[u]:null,p=g?g.fromA:1e9;if(p-f>=r)for(;a&&a.from<p;){let m=a;if(f>=m.from||p<=m.to||d){let v=Math.max(m.from,f)-d,b=Math.min(m.to,p)-d;m=v>=b?null:new nu(v,b,m.tree,m.offset+d,u>0,!!g)}if(m&&i.push(m),a.to>p)break;a=s<e.length?e[s++]:null}if(!g)break;f=g.toA,d=g.toA-g.toB}return i}}class jX{startParse(e,n,r){return typeof e=="string"&&(e=new VX(e)),r=r?r.length?r.map(i=>new Sb(i.from,i.to)):[new Sb(0,0)]:[new Sb(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let s=i.advance();if(s)return s}}}class VX{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new Gt({perNode:!0});let FX=0;class Ji{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=FX++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof Ji&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let i=new Ji(r,[],null,[]);if(i.set.push(i),n)for(let s of n.set)i.set.push(s);return i}static defineModifier(e){let n=new tm(e);return r=>r.modified.indexOf(n)>-1?r:tm.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}}let UX=0;class tm{constructor(e){this.name=e,this.instances=[],this.id=UX++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(u=>u.base==e&&$X(n,u.modified));if(r)return r;let i=[],s=new Ji(e.name,i,e,n);for(let u of n)u.instances.push(s);let a=qX(n);for(let u of e.set)if(!u.modified.length)for(let f of a)i.push(tm.get(u,f));return s}}function $X(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function qX(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function GX(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let s=[],a=2,u=i;for(let p=0;;){if(u=="..."&&p>0&&p+3==i.length){a=1;break}let m=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(u);if(!m)throw new RangeError("Invalid path: "+i);if(s.push(m[0]=="*"?"":m[0][0]=='"'?JSON.parse(m[0]):m[0]),p+=m[0].length,p==i.length)break;let v=i[p++];if(p==i.length&&v=="!"){a=0;break}if(v!="/")throw new RangeError("Invalid path: "+i);u=i.slice(p)}let f=s.length-1,d=s[f];if(!d)throw new RangeError("Invalid path: "+i);let g=new nm(r,a,f>0?s.slice(0,f):null);e[d]=g.sort(e[d])}}return WX.add(e)}const WX=new Gt({combine(t,e){let n,r,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let s=new nm(i.tags,i.mode,i.context);n?n.next=s:r=s,n=s}return r}});class nm{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}nm.empty=new nm([],2,null);function KX(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let a of s.tag)n[a.id]=s.class;let{scope:r,all:i=null}={};return{style:s=>{let a=i;for(let u of s)for(let f of u.set){let d=n[f.id];if(d){a=a?a+" "+d:d;break}}return a},scope:r}}const Be=Ji.define,Jg=Be(),Gl=Be(),hk=Be(Gl),gk=Be(Gl),Wl=Be(),ep=Be(Wl),wb=Be(Wl),es=Be(),$a=Be(es),Qo=Be(),Zo=Be(),wS=Be(),Lf=Be(wS),tp=Be(),Tt={comment:Jg,lineComment:Be(Jg),blockComment:Be(Jg),docComment:Be(Jg),name:Gl,variableName:Be(Gl),typeName:hk,tagName:Be(hk),propertyName:gk,attributeName:Be(gk),className:Be(Gl),labelName:Be(Gl),namespace:Be(Gl),macroName:Be(Gl),literal:Wl,string:ep,docString:Be(ep),character:Be(ep),attributeValue:Be(ep),number:wb,integer:Be(wb),float:Be(wb),bool:Be(Wl),regexp:Be(Wl),escape:Be(Wl),color:Be(Wl),url:Be(Wl),keyword:Qo,self:Be(Qo),null:Be(Qo),atom:Be(Qo),unit:Be(Qo),modifier:Be(Qo),operatorKeyword:Be(Qo),controlKeyword:Be(Qo),definitionKeyword:Be(Qo),moduleKeyword:Be(Qo),operator:Zo,derefOperator:Be(Zo),arithmeticOperator:Be(Zo),logicOperator:Be(Zo),bitwiseOperator:Be(Zo),compareOperator:Be(Zo),updateOperator:Be(Zo),definitionOperator:Be(Zo),typeOperator:Be(Zo),controlOperator:Be(Zo),punctuation:wS,separator:Be(wS),bracket:Lf,angleBracket:Be(Lf),squareBracket:Be(Lf),paren:Be(Lf),brace:Be(Lf),content:es,heading:$a,heading1:Be($a),heading2:Be($a),heading3:Be($a),heading4:Be($a),heading5:Be($a),heading6:Be($a),contentSeparator:Be(es),list:Be(es),quote:Be(es),emphasis:Be(es),strong:Be(es),link:Be(es),monospace:Be(es),strikethrough:Be(es),inserted:Be(),deleted:Be(),changed:Be(),invalid:Be(),meta:tp,documentMeta:Be(tp),annotation:Be(tp),processingInstruction:Be(tp),definition:Ji.defineModifier("definition"),constant:Ji.defineModifier("constant"),function:Ji.defineModifier("function"),standard:Ji.defineModifier("standard"),local:Ji.defineModifier("local"),special:Ji.defineModifier("special")};for(let t in Tt){let e=Tt[t];e instanceof Ji&&(e.name=t)}KX([{tag:Tt.link,class:"tok-link"},{tag:Tt.heading,class:"tok-heading"},{tag:Tt.emphasis,class:"tok-emphasis"},{tag:Tt.strong,class:"tok-strong"},{tag:Tt.keyword,class:"tok-keyword"},{tag:Tt.atom,class:"tok-atom"},{tag:Tt.bool,class:"tok-bool"},{tag:Tt.url,class:"tok-url"},{tag:Tt.labelName,class:"tok-labelName"},{tag:Tt.inserted,class:"tok-inserted"},{tag:Tt.deleted,class:"tok-deleted"},{tag:Tt.literal,class:"tok-literal"},{tag:Tt.string,class:"tok-string"},{tag:Tt.number,class:"tok-number"},{tag:[Tt.regexp,Tt.escape,Tt.special(Tt.string)],class:"tok-string2"},{tag:Tt.variableName,class:"tok-variableName"},{tag:Tt.local(Tt.variableName),class:"tok-variableName tok-local"},{tag:Tt.definition(Tt.variableName),class:"tok-variableName tok-definition"},{tag:Tt.special(Tt.variableName),class:"tok-variableName2"},{tag:Tt.definition(Tt.propertyName),class:"tok-propertyName tok-definition"},{tag:Tt.typeName,class:"tok-typeName"},{tag:Tt.namespace,class:"tok-namespace"},{tag:Tt.className,class:"tok-className"},{tag:Tt.macroName,class:"tok-macroName"},{tag:Tt.propertyName,class:"tok-propertyName"},{tag:Tt.operator,class:"tok-operator"},{tag:Tt.comment,class:"tok-comment"},{tag:Tt.meta,class:"tok-meta"},{tag:Tt.invalid,class:"tok-invalid"},{tag:Tt.punctuation,class:"tok-punctuation"}]);var Cb;const np=new Gt,YX=new Gt;class Xs{constructor(e,n,r=[],i=""){this.data=e,this.name=i,on.prototype.hasOwnProperty("tree")||Object.defineProperty(on.prototype,"tree",{get(){return da(this)}}),this.parser=n,this.extension=[Ic.of(this),on.languageData.of((s,a,u)=>{let f=pk(s,a,u),d=f.type.prop(np);if(!d)return[];let g=s.facet(d),p=f.type.prop(YX);if(p){let m=f.resolve(a-f.from,u);for(let v of p)if(v.test(m,s)){let b=s.facet(v.facet);return v.type=="replace"?b:b.concat(g)}}return g})].concat(r)}isActiveAt(e,n,r=-1){return pk(e,n,r).type.prop(np)==this.data}findRegions(e){let n=e.facet(Ic);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(s,a)=>{if(s.prop(np)==this.data){r.push({from:a,to:a+s.length});return}let u=s.prop(Gt.mounted);if(u){if(u.tree.prop(np)==this.data){if(u.overlay)for(let f of u.overlay)r.push({from:f.from+a,to:f.to+a});else r.push({from:a,to:a+s.length});return}else if(u.overlay){let f=r.length;if(i(u.tree,u.overlay[0].from+a),r.length>f)return}}for(let f=0;f<s.children.length;f++){let d=s.children[f];d instanceof Nr&&i(d,s.positions[f]+a)}};return i(da(e),0),r}get allowsNesting(){return!0}}Xs.setState=ir.define();function pk(t,e,n){let r=t.facet(Ic),i=da(t).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,n,rr.ExcludeBuffers|rr.EnterBracketed))s.type.isTop&&(i=s);return i}function da(t){let e=t.field(Xs.state,!1);return e?e.tree:Nr.empty}class XX{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let Bf=null;class rm{constructor(e,n,r=[],i,s,a,u,f){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=a,this.skipped=u,this.scheduleOn=f,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new rm(e,n,[],Nr.empty,0,r,[],null)}startParse(){return this.parser.startParse(new XX(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Nr.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(nu.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(nu.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Bf;Bf=this;try{return e()}finally{Bf=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=mk(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:s,viewport:a,skipped:u}=this;if(this.takeTree(),!e.empty){let f=[];if(e.iterChangedRanges((d,g,p,m)=>f.push({fromA:d,toA:g,fromB:p,toB:m})),r=nu.applyChanges(r,f),i=Nr.empty,s=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){u=[];for(let d of this.skipped){let g=e.mapPos(d.from,1),p=e.mapPos(d.to,-1);g<p&&u.push({from:g,to:p})}}}return new rm(this.parser,n,r,i,s,a,u,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=mk(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends jX{createParse(n,r,i){let s=i[0].from,a=i[i.length-1].to;return{parsedPos:s,advance(){let f=Bf;if(f){for(let d of i)f.tempSkipped.push(d);e&&(f.scheduleOn=f.scheduleOn?Promise.all([f.scheduleOn,e]):e)}return this.parsedPos=a,new Nr(co.none,[],[],a-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return Bf}}function mk(t,e,n){return nu.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class kc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new kc(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=rm.create(e.facet(Ic).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new kc(r)}}Xs.state=va.define({create:kc.init,update(t,e){for(let n of e.effects)if(n.is(Xs.setState))return n.value;return e.startState.facet(Ic)!=e.state.facet(Ic)?kc.init(e.state):t.apply(e)}});let zL=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(zL=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Rb=typeof navigator<"u"&&(!((Cb=navigator.scheduling)===null||Cb===void 0)&&Cb.isInputPending)?()=>navigator.scheduling.isInputPending():null,QX=Ec.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Xs.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Xs.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=zL(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(Xs.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!Rb?Math.max(25,e.timeRemaining()-5):1e9),u=s.context.treeLen<i&&r.doc.length>i+1e3,f=s.context.work(()=>Rb&&Rb()||Date.now()>a,i+(u?0:1e5));this.chunkBudget-=Date.now()-n,(f||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Xs.setState.of(new kc(s.context))})),this.chunkBudget>0&&!(f&&!u)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>hs(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ic=vt.define({combine(t){return t.length?t[0]:null},enables:t=>[Xs.state,QX,Et.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),ZX=vt.define(),A1=vt.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function im(t){let e=t.facet(A1);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function om(t,e){let n="",r=t.tabSize,i=t.facet(A1)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let s=0;s<e;s++)n+=i;return n}function NL(t,e){t instanceof on&&(t=new ty(t));for(let r of t.state.facet(ZX)){let i=r(t,e);if(i!==void 0)return i}let n=da(t.state);return n.length>=e?eQ(t,n,e):null}class ty{constructor(e,n={}){this.state=e,this.options=n,this.unit=im(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.countColumn(r,e-i),a=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return a>-1&&(s+=a-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,n=e.length){return Km(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let a=s(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const JX=new Gt;function eQ(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let s=[];for(let a=i;a&&!(a.from<r.node.from||a.to>r.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)s.push(a);for(let a=s.length-1;a>=0;a--)r={node:s[a],next:r}}return LL(r,t,n)}function LL(t,e,n){for(let r=t;r;r=r.next){let i=nQ(r.node);if(i)return i(M1.create(e,n,r))}return 0}function tQ(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function nQ(t){let e=t.type.prop(JX);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Gt.closedBy))){let i=t.lastChild,s=i&&r.indexOf(i.name)>-1;return a=>sQ(a,!0,1,void 0,s&&!tQ(a)?i.from:void 0)}return t.parent==null?rQ:null}function rQ(){return 0}class M1 extends ty{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new M1(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(iQ(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return LL(this.context.next,this.base,this.pos)}}function iQ(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function oQ(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),a=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let u=n.to;;){let f=e.childAfter(u);if(!f||f==r)return null;if(!f.type.isSkipped){if(f.from>=a)return null;let d=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+d}}u=f.to}}function sQ(t,e,n,r,i){let s=t.textAfter,a=s.match(/^\s*/)[0].length,u=r&&s.slice(a,a+r.length)==r||i==t.pos+a,f=oQ(t);return f?u?t.column(f.from):t.column(f.to):t.baseIndent+(u?0:t.unit*n)}const lQ=1e4,aQ="()[]{}",uQ=new Gt;function CS(t,e,n){let r=t.prop(e<0?Gt.openedBy:Gt.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function RS(t){let e=t.type.prop(uQ);return e?e(t.node):t}function ic(t,e,n,r={}){let i=r.maxScanDistance||lQ,s=r.brackets||aQ,a=da(t),u=a.resolveInner(e,n);for(let f=u;f;f=f.parent){let d=CS(f.type,n,s);if(d&&f.from<f.to){let g=RS(f);if(g&&(n>0?e>=g.from&&e<g.to:e>g.from&&e<=g.to))return cQ(t,e,n,f,g,d,s)}}return fQ(t,e,n,a,u.type,i,s)}function cQ(t,e,n,r,i,s,a){let u=r.parent,f={from:i.from,to:i.to},d=0,g=u?.cursor();if(g&&(n<0?g.childBefore(r.from):g.childAfter(r.to)))do if(n<0?g.to<=r.from:g.from>=r.to){if(d==0&&s.indexOf(g.type.name)>-1&&g.from<g.to){let p=RS(g);return{start:f,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(CS(g.type,n,a))d++;else if(CS(g.type,-n,a)){if(d==0){let p=RS(g);return{start:f,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}d--}}while(n<0?g.prevSibling():g.nextSibling());return{start:f,matched:!1}}function fQ(t,e,n,r,i,s,a){if(n<0?!e:e==t.doc.length)return null;let u=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),f=a.indexOf(u);if(f<0||f%2==0!=n>0)return null;let d={from:n<0?e-1:e,to:n>0?e+1:e},g=t.doc.iterRange(e,n>0?t.doc.length:0),p=0;for(let m=0;!g.next().done&&m<=s;){let v=g.value;n<0&&(m+=v.length);let b=e+m*n;for(let S=n>0?0:v.length-1,w=n>0?v.length:-1;S!=w;S+=n){let C=a.indexOf(v[S]);if(!(C<0||r.resolveInner(b+S,1).type!=i))if(C%2==0==n>0)p++;else{if(p==1)return{start:d,end:{from:b+S,to:b+S+1},matched:C>>1==f>>1};p--}}n>0&&(m+=v.length)}return g.done?{start:d,matched:!1}:null}const dQ=Object.create(null),yk=[co.none],vk=[],bk=Object.create(null),hQ=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])hQ[t]=gQ(dQ,e);function Eb(t,e){vk.indexOf(t)>-1||(vk.push(t),console.warn(e))}function gQ(t,e){let n=[];for(let u of e.split(" ")){let f=[];for(let d of u.split(".")){let g=t[d]||Tt[d];g?typeof g=="function"?f.length?f=f.map(g):Eb(d,`Modifier ${d} used at start of tag`):f.length?Eb(d,`Tag ${d} used as modifier`):f=Array.isArray(g)?g:[g]:Eb(d,`Unknown highlighting tag ${d}`)}for(let d of f)n.push(d)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(u=>u.id),s=bk[i];if(s)return s.id;let a=bk[i]=co.define({id:yk.length,name:r,props:[GX({[r]:n})]});return yk.push(a),a.id}hr.RTL,hr.LTR;const pQ=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=k1(t.state,n.from);return r.line?mQ(t):r.block?vQ(t):!1};function O1(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const mQ=O1(SQ,0),yQ=O1(BL,0),vQ=O1((t,e)=>BL(t,e,xQ(e)),0);function k1(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const _f=50;function bQ(t,{open:e,close:n},r,i){let s=t.sliceDoc(r-_f,r),a=t.sliceDoc(i,i+_f),u=/\s*$/.exec(s)[0].length,f=/^\s*/.exec(a)[0].length,d=s.length-u;if(s.slice(d-e.length,d)==e&&a.slice(f,f+n.length)==n)return{open:{pos:r-u,margin:u&&1},close:{pos:i+f,margin:f&&1}};let g,p;i-r<=2*_f?g=p=t.sliceDoc(r,i):(g=t.sliceDoc(r,r+_f),p=t.sliceDoc(i-_f,i));let m=/^\s*/.exec(g)[0].length,v=/\s*$/.exec(p)[0].length,b=p.length-v-n.length;return g.slice(m,m+e.length)==e&&p.slice(b,b+n.length)==n?{open:{pos:r+m+e.length,margin:/\s/.test(g.charAt(m+e.length))?1:0},close:{pos:i-v-n.length,margin:/\s/.test(p.charAt(b-1))?1:0}}:null}function xQ(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function BL(t,e,n=e.selection.ranges){let r=n.map(s=>k1(e,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,a)=>bQ(e,r[a],s.from,s.to));if(t!=2&&!i.every(s=>s))return{changes:e.changes(n.map((s,a)=>i[a]?[]:[{from:s.from,insert:r[a].open+" "},{from:s.to,insert:" "+r[a].close}]))};if(t!=1&&i.some(s=>s)){let s=[];for(let a=0,u;a<i.length;a++)if(u=i[a]){let f=r[a],{open:d,close:g}=u;s.push({from:d.pos-f.open.length,to:d.pos+d.margin},{from:g.pos-g.margin,to:g.pos+f.close.length})}return{changes:s}}return null}function SQ(t,e,n=e.selection.ranges){let r=[],i=-1;e:for(let{from:s,to:a}of n){let u=r.length,f=1e9,d;for(let g=s;g<=a;){let p=e.doc.lineAt(g);if(d==null&&(d=k1(e,p.from).line,!d))continue e;if(p.from>i&&(s==a||a>p.from)){i=p.from;let m=/^\s*/.exec(p.text)[0].length,v=m==p.length,b=p.text.slice(m,m+d.length)==d?m:-1;m<p.text.length&&m<f&&(f=m),r.push({line:p,comment:b,token:d,indent:m,empty:v,single:!1})}g=p.to+1}if(f<1e9)for(let g=u;g<r.length;g++)r[g].indent<r[g].line.text.length&&(r[g].indent=f);r.length==u+1&&(r[u].single=!0)}if(t!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:u,token:f,indent:d,empty:g,single:p}of r)(p||!g)&&s.push({from:u.from+d,insert:f+" "});let a=e.changes(s);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:a,comment:u,token:f}of r)if(u>=0){let d=a.from+u,g=d+f.length;a.text[g-a.from]==" "&&g++,s.push({from:d,to:g})}return{changes:s}}return null}const ES=ba.define(),wQ=ba.define(),CQ=vt.define(),_L=vt.define({combine(t){return BK(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),HL=va.define({create(){return gs.empty},update(t,e){let n=e.state.facet(_L),r=e.annotation(ES);if(r){let f=vi.fromTransaction(e,r.selection),d=r.side,g=d==0?t.undone:t.done;return f?g=sm(g,g.length,n.minDepth,f):g=FL(g,e.startState.selection),new gs(d==0?r.rest:g,d==0?g:r.rest)}let i=e.annotation(wQ);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(xr.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=vi.fromTransaction(e),a=e.annotation(xr.time),u=e.annotation(xr.userEvent);return s?t=t.addChanges(s,a,u,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,u,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new gs(t.done.map(vi.fromJSON),t.undone.map(vi.fromJSON))}});function RQ(t={}){return[HL,_L.of(t),Et.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?jL:e.inputType=="historyRedo"?TS:null;return r?(e.preventDefault(),r(n)):!1}})]}function ny(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(HL,!1);if(!i)return!1;let s=i.pop(t,n,e);return s?(r(s),!0):!1}}const jL=ny(0,!1),TS=ny(1,!1),EQ=ny(0,!0),TQ=ny(1,!0);class vi{constructor(e,n,r,i,s){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new vi(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new vi(e.changes&&vr.fromJSON(e.changes),[],e.mapped&&ms.fromJSON(e.mapped),e.startSelection&&Te.fromJSON(e.startSelection),e.selectionsAfter.map(Te.fromJSON))}static fromTransaction(e,n){let r=io;for(let i of e.startState.facet(CQ)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new vi(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,io)}static selection(e){return new vi(void 0,io,void 0,void 0,e)}}function sm(t,e,n,r){let i=e+1>n+20?e-n-1:0,s=t.slice(i,e);return s.push(r),s}function AQ(t,e){let n=[],r=!1;return t.iterChangedRanges((i,s)=>n.push(i,s)),e.iterChangedRanges((i,s,a,u)=>{for(let f=0;f<n.length;){let d=n[f++],g=n[f++];u>=d&&a<=g&&(r=!0)}}),r}function MQ(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function VL(t,e){return t.length?e.length?t.concat(e):t:e}const io=[],OQ=200;function FL(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-OQ));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),sm(t,t.length-1,1e9,n.setSelAfter(r)))}else return[vi.selection([e])]}function kQ(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function Tb(t,e){if(!t.length)return t;let n=t.length,r=io;for(;n;){let i=IQ(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=t.slice(0,n);return s[n-1]=i,s}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[vi.selection(r)]:io}function IQ(t,e,n){let r=VL(t.selectionsAfter.length?t.selectionsAfter.map(u=>u.map(e)):io,n);if(!t.changes)return vi.selection(r);let i=t.changes.map(e),s=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(s):s;return new vi(i,ir.mapEffects(t.effects,e),a,t.startSelection.map(s),r)}const DQ=/^(input\.type|delete)($|\.)/;class gs{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new gs(this.done,this.undone):this}addChanges(e,n,r,i,s){let a=this.done,u=a[a.length-1];return u&&u.changes&&!u.changes.empty&&e.changes&&(!r||DQ.test(r))&&(!u.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,AQ(u.changes,e.changes))||r=="input.type.compose")?a=sm(a,a.length-1,i.minDepth,new vi(e.changes.compose(u.changes),VL(ir.mapEffects(e.effects,u.changes),u.effects),u.mapped,u.startSelection,io)):a=sm(a,a.length,i.minDepth,e),new gs(a,io,n,r)}addSelection(e,n,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:io;return s.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&MQ(s[s.length-1],e)?this:new gs(FL(this.done,e),this.undone,n,r)}addMapping(e){return new gs(Tb(this.done,e),Tb(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],a=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:ES.of({side:e,rest:kQ(i),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let u=i.length==1?io:i.slice(0,i.length-1);return s.mapped&&(u=Tb(u,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:ES.of({side:e,rest:u,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}gs.empty=new gs(io,io);const PQ=[{key:"Mod-z",run:jL,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:TS,preventDefault:!0},{linux:"Ctrl-Shift-z",run:TS,preventDefault:!0},{key:"Mod-u",run:EQ,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:TQ,preventDefault:!0}];function Bc(t,e){return Te.create(t.ranges.map(e),t.mainIndex)}function jo(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Vo({state:t,dispatch:e},n){let r=Bc(t.selection,n);return r.eq(t.selection,!0)?!1:(e(jo(t,r)),!0)}function ry(t,e){return Te.cursor(e?t.to:t.from)}function UL(t,e){return Vo(t,n=>n.empty?t.moveByChar(n,e):ry(n,e))}function Qr(t){return t.textDirectionAt(t.state.selection.main.head)==hr.LTR}const $L=t=>UL(t,!Qr(t)),qL=t=>UL(t,Qr(t));function GL(t,e){return Vo(t,n=>n.empty?t.moveByGroup(n,e):ry(n,e))}const zQ=t=>GL(t,!Qr(t)),NQ=t=>GL(t,Qr(t));function LQ(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function iy(t,e,n){let r=da(t).resolveInner(e.head),i=n?Gt.closedBy:Gt.openedBy;for(let f=e.head;;){let d=n?r.childAfter(f):r.childBefore(f);if(!d)break;LQ(t,d,i)?r=d:f=n?d.to:d.from}let s=r.type.prop(i),a,u;return s&&(a=n?ic(t,r.from,1):ic(t,r.to,-1))&&a.matched?u=n?a.end.to:a.end.from:u=n?r.to:r.from,Te.cursor(u,n?-1:1)}const BQ=t=>Vo(t,e=>iy(t.state,e,!Qr(t))),_Q=t=>Vo(t,e=>iy(t.state,e,Qr(t)));function WL(t,e){return Vo(t,n=>{if(!n.empty)return ry(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const KL=t=>WL(t,!1),YL=t=>WL(t,!0);function XL(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let s of t.state.facet(Et.scrollMargins)){let a=s(t);a?.top&&(n=Math.max(a?.top,n)),a?.bottom&&(r=Math.max(a?.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function QL(t,e){let n=XL(t),{state:r}=t,i=Bc(r.selection,a=>a.empty?t.moveVertically(a,e,n.height):ry(a,e));if(i.eq(r.selection))return!1;let s;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),u=t.scrollDOM.getBoundingClientRect(),f=u.top+n.marginTop,d=u.bottom-n.marginBottom;a&&a.top>f&&a.bottom<d&&(s=Et.scrollIntoView(i.main.head,{y:"start",yMargin:a.top-f}))}return t.dispatch(jo(r,i),{effects:s}),!0}const xk=t=>QL(t,!1),AS=t=>QL(t,!0);function xa(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let s=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=Te.cursor(r.from+s))}return i}const HQ=t=>Vo(t,e=>xa(t,e,!0)),jQ=t=>Vo(t,e=>xa(t,e,!1)),VQ=t=>Vo(t,e=>xa(t,e,!Qr(t))),FQ=t=>Vo(t,e=>xa(t,e,Qr(t))),UQ=t=>Vo(t,e=>Te.cursor(t.lineBlockAt(e.head).from,1)),$Q=t=>Vo(t,e=>Te.cursor(t.lineBlockAt(e.head).to,-1));function qQ(t,e,n){let r=!1,i=Bc(t.selection,s=>{let a=ic(t,s.head,-1)||ic(t,s.head,1)||s.head>0&&ic(t,s.head-1,1)||s.head<t.doc.length&&ic(t,s.head+1,-1);if(!a||!a.end)return s;r=!0;let u=a.start.from==s.head?a.end.to:a.end.from;return Te.cursor(u)});return r?(e(jo(t,i)),!0):!1}const GQ=({state:t,dispatch:e})=>qQ(t,e);function po(t,e){let n=Bc(t.state.selection,r=>{let i=e(r);return Te.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(jo(t.state,n)),!0)}function ZL(t,e){return po(t,n=>t.moveByChar(n,e))}const JL=t=>ZL(t,!Qr(t)),eB=t=>ZL(t,Qr(t));function tB(t,e){return po(t,n=>t.moveByGroup(n,e))}const WQ=t=>tB(t,!Qr(t)),KQ=t=>tB(t,Qr(t)),YQ=t=>po(t,e=>iy(t.state,e,!Qr(t))),XQ=t=>po(t,e=>iy(t.state,e,Qr(t)));function nB(t,e){return po(t,n=>t.moveVertically(n,e))}const rB=t=>nB(t,!1),iB=t=>nB(t,!0);function oB(t,e){return po(t,n=>t.moveVertically(n,e,XL(t).height))}const Sk=t=>oB(t,!1),wk=t=>oB(t,!0),QQ=t=>po(t,e=>xa(t,e,!0)),ZQ=t=>po(t,e=>xa(t,e,!1)),JQ=t=>po(t,e=>xa(t,e,!Qr(t))),eZ=t=>po(t,e=>xa(t,e,Qr(t))),tZ=t=>po(t,e=>Te.cursor(t.lineBlockAt(e.head).from)),nZ=t=>po(t,e=>Te.cursor(t.lineBlockAt(e.head).to)),Ck=({state:t,dispatch:e})=>(e(jo(t,{anchor:0})),!0),Rk=({state:t,dispatch:e})=>(e(jo(t,{anchor:t.doc.length})),!0),Ek=({state:t,dispatch:e})=>(e(jo(t,{anchor:t.selection.main.anchor,head:0})),!0),Tk=({state:t,dispatch:e})=>(e(jo(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),rZ=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),iZ=({state:t,dispatch:e})=>{let n=oy(t).map(({from:r,to:i})=>Te.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:Te.create(n),userEvent:"select"})),!0},oZ=({state:t,dispatch:e})=>{let n=Bc(t.selection,r=>{let i=da(t),s=i.resolveStack(r.from,1);if(r.empty){let a=i.resolveStack(r.from,-1);a.node.from>=s.node.from&&a.node.to<=s.node.to&&(s=a)}for(let a=s;a;a=a.next){let{node:u}=a;if((u.from<r.from&&u.to>=r.to||u.to>r.to&&u.from<=r.from)&&a.next)return Te.range(u.to,u.from)}return r});return n.eq(t.selection)?!1:(e(jo(t,n)),!0)};function sB(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let s of n.selection.ranges){let a=n.doc.lineAt(s.head);if(e?a.to<t.state.doc.length:a.from>0)for(let u=s;;){let f=t.moveVertically(u,e);if(f.head<a.from||f.head>a.to){i.some(d=>d.head==f.head)||i.push(f);break}else{if(f.head==u.head)break;u=f}}}return i.length==r.ranges.length?!1:(t.dispatch(jo(n,Te.create(i,i.length-1))),!0)}const sZ=t=>sB(t,!1),lZ=t=>sB(t,!0),aZ=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Te.create([n.main]):n.main.empty||(r=Te.create([Te.cursor(n.main.head)])),r?(e(jo(t,r)),!0):!1};function Qd(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(s=>{let{from:a,to:u}=s;if(a==u){let f=e(s);f<a?(n="delete.backward",f=rp(t,f,!1)):f>a&&(n="delete.forward",f=rp(t,f,!0)),a=Math.min(a,f),u=Math.max(u,f)}else a=rp(t,a,!1),u=rp(t,u,!0);return a==u?{range:s}:{changes:{from:a,to:u},range:Te.cursor(a,a<s.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Et.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function rp(t,e,n){if(t instanceof Et)for(let r of t.state.facet(Et.atomicRanges).map(i=>i(t)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=n?s:i)});return e}const lB=(t,e,n)=>Qd(t,r=>{let i=r.from,{state:s}=t,a=s.doc.lineAt(i),u,f;if(n&&!e&&i>a.from&&i<a.from+200&&!/[^ \t]/.test(u=a.text.slice(0,i-a.from))){if(u[u.length-1]==" ")return i-1;let d=Km(u,s.tabSize),g=d%im(s)||im(s);for(let p=0;p<g&&u[u.length-1-p]==" ";p++)i--;f=i}else f=Yr(a.text,i-a.from,e,e)+a.from,f==i&&a.number!=(e?s.doc.lines:1)?f+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(f-a.from,i-a.from))&&(f=Yr(a.text,f-a.from,!1,!1)+a.from);return f}),MS=t=>lB(t,!1,!0),aB=t=>lB(t,!0,!1),uB=(t,e)=>Qd(t,n=>{let r=n.head,{state:i}=t,s=i.doc.lineAt(r),a=i.charCategorizer(r);for(let u=null;;){if(r==(e?s.to:s.from)){r==n.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let f=Yr(s.text,r-s.from,e)+s.from,d=s.text.slice(Math.min(r,f)-s.from,Math.max(r,f)-s.from),g=a(d);if(u!=null&&g!=u)break;(d!=" "||r!=n.head)&&(u=g),r=f}return r}),cB=t=>uB(t,!1),uZ=t=>uB(t,!0),cZ=t=>Qd(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),fZ=t=>Qd(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),dZ=t=>Qd(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),hZ=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:qt.of(["",""])},range:Te.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},gZ=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,s=t.doc.lineAt(i),a=i==s.from?i-1:Yr(s.text,i-s.from,!1)+s.from,u=i==s.to?i+1:Yr(s.text,i-s.from,!0)+s.from;return{changes:{from:a,to:u,insert:t.doc.slice(i,u).append(t.doc.slice(a,i))},range:Te.cursor(u)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function oy(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),s=t.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=t.doc.lineAt(r.to-1)),n>=i.number){let a=e[e.length-1];a.to=s.to,a.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return e}function fB(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let s of oy(t)){if(n?s.to==t.doc.length:s.from==0)continue;let a=t.doc.lineAt(n?s.to+1:s.from-1),u=a.length+1;if(n){r.push({from:s.to,to:a.to},{from:s.from,insert:a.text+t.lineBreak});for(let f of s.ranges)i.push(Te.range(Math.min(t.doc.length,f.anchor+u),Math.min(t.doc.length,f.head+u)))}else{r.push({from:a.from,to:s.from},{from:s.to,insert:t.lineBreak+a.text});for(let f of s.ranges)i.push(Te.range(f.anchor-u,f.head-u))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Te.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const pZ=({state:t,dispatch:e})=>fB(t,e,!1),mZ=({state:t,dispatch:e})=>fB(t,e,!0);function dB(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of oy(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let i=t.changes(r);return e(t.update({changes:i,selection:t.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const yZ=({state:t,dispatch:e})=>dB(t,e,!1),vZ=({state:t,dispatch:e})=>dB(t,e,!0),bZ=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(oy(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=Bc(e.selection,i=>{let s;if(t.lineWrapping){let a=t.lineBlockAt(i.head),u=t.coordsAtPos(i.head,i.assoc||1);u&&(s=a.bottom+t.documentTop-u.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,s)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function xZ(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=da(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(Gt.closedBy))&&s.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const Ak=hB(!1),SZ=hB(!0);function hB(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:a}=i,u=e.doc.lineAt(s),f=!t&&s==a&&xZ(e,s);t&&(s=a=(a<=u.to?u:e.doc.lineAt(a)).to);let d=new ty(e,{simulateBreak:s,simulateDoubleBreak:!!f}),g=NL(d,s);for(g==null&&(g=Km(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));a<u.to&&/\s/.test(u.text[a-u.from]);)a++;f?{from:s,to:a}=f:s>u.from&&s<u.from+100&&!/\S/.test(u.text.slice(0,s))&&(s=u.from);let p=["",om(e,g)];return f&&p.push(om(e,d.lineIndent(u.from,-1))),{changes:{from:s,to:a,insert:qt.of(p)},range:Te.cursor(s+1+p[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function I1(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let u=t.doc.lineAt(a);u.number>n&&(r.empty||r.to>u.from)&&(e(u,i,r),n=u.number),a=u.to+1}let s=t.changes(i);return{changes:i,range:Te.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const wZ=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new ty(t,{overrideIndentation:s=>{let a=n[s];return a??-1}}),i=I1(t,(s,a,u)=>{let f=NL(r,s.from);if(f==null)return;/\S/.test(s.text)||(f=0);let d=/^\s*/.exec(s.text)[0],g=om(t,f);(d!=g||u.from<s.from+d.length)&&(n[s.from]=f,a.push({from:s.from,to:s.from+d.length,insert:g}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},CZ=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(I1(t,(n,r)=>{r.push({from:n.from,insert:t.facet(A1)})}),{userEvent:"input.indent"})),!0),RZ=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(I1(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=Km(i,t.tabSize),a=0,u=om(t,Math.max(0,s-im(t)));for(;a<i.length&&a<u.length&&i.charCodeAt(a)==u.charCodeAt(a);)a++;r.push({from:n.from+a,to:n.from+i.length,insert:u.slice(a)})}),{userEvent:"delete.dedent"})),!0),EZ=t=>(t.setTabFocusMode(),!0),TZ=[{key:"Ctrl-b",run:$L,shift:JL,preventDefault:!0},{key:"Ctrl-f",run:qL,shift:eB},{key:"Ctrl-p",run:KL,shift:rB},{key:"Ctrl-n",run:YL,shift:iB},{key:"Ctrl-a",run:UQ,shift:tZ},{key:"Ctrl-e",run:$Q,shift:nZ},{key:"Ctrl-d",run:aB},{key:"Ctrl-h",run:MS},{key:"Ctrl-k",run:cZ},{key:"Ctrl-Alt-h",run:cB},{key:"Ctrl-o",run:hZ},{key:"Ctrl-t",run:gZ},{key:"Ctrl-v",run:AS}],AZ=[{key:"ArrowLeft",run:$L,shift:JL,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:zQ,shift:WQ,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:VQ,shift:JQ,preventDefault:!0},{key:"ArrowRight",run:qL,shift:eB,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:NQ,shift:KQ,preventDefault:!0},{mac:"Cmd-ArrowRight",run:FQ,shift:eZ,preventDefault:!0},{key:"ArrowUp",run:KL,shift:rB,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Ck,shift:Ek},{mac:"Ctrl-ArrowUp",run:xk,shift:Sk},{key:"ArrowDown",run:YL,shift:iB,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Rk,shift:Tk},{mac:"Ctrl-ArrowDown",run:AS,shift:wk},{key:"PageUp",run:xk,shift:Sk},{key:"PageDown",run:AS,shift:wk},{key:"Home",run:jQ,shift:ZQ,preventDefault:!0},{key:"Mod-Home",run:Ck,shift:Ek},{key:"End",run:HQ,shift:QQ,preventDefault:!0},{key:"Mod-End",run:Rk,shift:Tk},{key:"Enter",run:Ak,shift:Ak},{key:"Mod-a",run:rZ},{key:"Backspace",run:MS,shift:MS,preventDefault:!0},{key:"Delete",run:aB,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:cB,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:uZ,preventDefault:!0},{mac:"Mod-Backspace",run:fZ,preventDefault:!0},{mac:"Mod-Delete",run:dZ,preventDefault:!0}].concat(TZ.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),MZ=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:BQ,shift:YQ},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:_Q,shift:XQ},{key:"Alt-ArrowUp",run:pZ},{key:"Shift-Alt-ArrowUp",run:yZ},{key:"Alt-ArrowDown",run:mZ},{key:"Shift-Alt-ArrowDown",run:vZ},{key:"Mod-Alt-ArrowUp",run:sZ},{key:"Mod-Alt-ArrowDown",run:lZ},{key:"Escape",run:aZ},{key:"Mod-Enter",run:SZ},{key:"Alt-l",mac:"Ctrl-l",run:iZ},{key:"Mod-i",run:oZ,preventDefault:!0},{key:"Mod-[",run:RZ},{key:"Mod-]",run:CZ},{key:"Mod-Alt-\\",run:wZ},{key:"Shift-Mod-k",run:bZ},{key:"Shift-Mod-\\",run:GQ},{key:"Mod-/",run:pQ},{key:"Alt-A",run:yQ},{key:"Ctrl-m",mac:"Shift-Alt-m",run:EZ}].concat(AZ),OS=16,lm=8,OZ=8,kZ=32,IZ=126,am=t=>t.toString(16).toUpperCase().padStart(2,"0"),gB=t=>t>=kZ&&t<=IZ?String.fromCharCode(t):".",DZ=t=>{const e=t.slice(0,lm).map(am).join(" "),n=t.slice(lm).map(am).join(" ");return n?`${e} ${n}`:e},PZ=(t,e)=>{let n="",r="",i="";const s=Math.min(e+OS,t.length);for(let a=e;a<s;a++){const u=am(t[a]);a<e+lm?n+=n?` ${u}`:u:r+=r?` ${u}`:u,i+=gB(t[a])}return{offset:e.toString(16).padStart(OZ,"0"),hex:r?`${n} ${r}`:n,ascii:i}},zZ=t=>{const e=[];for(let n=0;n<t.length;n+=OS)e.push(DZ(t.slice(n,n+OS)));return e.join(`
|
|
31
|
-
`)},NZ=(t,e=64)=>{let n="";const r=Math.min(t.length,e);for(let i=0;i<r;i++)n+=gB(t[i]);return t.length>e?`${n}…`:n},LZ=t=>{const e=[];for(let r=0;r<t.length;r+=8192){let i="";const s=Math.min(r+8192,t.length);for(let a=r;a<s;a++)i+=String.fromCharCode(t[a]);e.push(i)}return btoa(e.join(""))},BZ=(t,e={})=>{const n=e.maxBytes??lm,r=`${t.length} B`;if(t.length===0)return r;const i=t.slice(0,n).map(am).join(" ");return t.length<=n?`${i} ${r}`:`${i} … ${r}`},_Z=/^[0-9a-fA-F]{4,16}(?::\s+|\s{2,})/,HZ=/\|[^|]*\|\s*$/,jZ=t=>{const e=t.split(/\r?\n/).map(r=>r.replace(HZ,"").replace(_Z,"")).join("").replace(/0x/gi,"").replace(/\s+/g,"");if(e.length===0)return{ok:!1,error:"Enter at least one byte."};if(!/^[0-9a-fA-F]+$/.test(e))return{ok:!1,error:"Hex input contains invalid characters."};if(e.length%2!==0)return{ok:!1,error:"Hex input must contain complete bytes."};const n=[];for(let r=0;r<e.length;r+=2)n.push(parseInt(e.slice(r,r+2),16));return{ok:!0,value:n}},VZ=t=>{const e=t.replace(/\s+/g,"");if(e.length===0)return{ok:!1,error:"Enter at least one byte."};let n;try{n=atob(e)}catch{return{ok:!1,error:"Base64 input is invalid."}}const r=[];for(let i=0;i<n.length;i++)r.push(n.charCodeAt(i));return{ok:!0,value:r}},Sp=(t,e)=>e==="hex"?zZ(t):LZ(t),pB=(t,e)=>e==="hex"?jZ(t):VZ(t),FZ=(t,e)=>{const n=pB(t,e);return n.ok?{bytes:n.value,error:null}:{bytes:null,error:n.error}},UZ=t=>{const e=t.mode??"hex";return t.initialBytes&&t.initialBytes.length>0?{mode:e,text:Sp(t.initialBytes,e),bytes:t.initialBytes,error:null}:{mode:e,text:"",bytes:null,error:null}},$Z=(t,e)=>{switch(e.type){case"set-text":return{...t,text:e.text,...FZ(e.text,t.mode)};case"normalize-paste":{const n=pB(e.text,t.mode);return n.ok?{...t,text:Sp(n.value,t.mode),bytes:n.value,error:null}:{...t,text:e.text,bytes:null,error:n.error}}case"switch-mode":return t.mode===e.mode?t:t.bytes!==null?{mode:e.mode,text:Sp(t.bytes,e.mode),bytes:t.bytes,error:null}:{mode:e.mode,text:"",bytes:null,error:null};case"replace-bytes":return{mode:t.mode,text:Sp(e.bytes,t.mode),bytes:e.bytes,error:null}}},qZ=Et.theme({"&":{color:"var(--foreground)",backgroundColor:"transparent",fontSize:"12px"},".cm-content":{caretColor:"var(--ring)",fontFamily:'ui-monospace, "Cascadia Mono", "Fira Code", Menlo, monospace',padding:"8px"},".cm-focused":{outline:"none"},".cm-gutters":{display:"none"},".cm-scroller":{overflow:"auto"}}),Mk=({label:t,active:e,onClick:n})=>O.jsx("button",{type:"button",onClick:n,className:Ue("rounded-md px-2 py-1 text-xs font-medium transition-colors",e?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:t}),GZ=({initialBytes:t,onChange:e})=>{const[n,r]=E.useReducer($Z,void 0,()=>UZ({})),i=E.useRef(t),[s,a]=E.useState(!!(i.current&&i.current.length>0)),u=E.useRef(null),f=E.useRef(null),d=E.useRef(n);d.current=n;const g=E.useRef(e);g.current=e,E.useEffect(()=>{const b=i.current;if(!b?.length)return;const S=window.setTimeout(()=>{r({type:"replace-bytes",bytes:b}),a(!1)},0);return()=>window.clearTimeout(S)},[]),E.useEffect(()=>{if(!u.current)return;const b=new Et({state:on.create({doc:d.current.text,extensions:[RQ(),kL.of([...MZ,...PQ]),qZ,Et.lineWrapping,Et.updateListener.of(S=>{if(!S.docChanged)return;const w=S.state.doc.toString();if(w===d.current.text)return;const C=S.transactions.some(R=>R.isUserEvent("input.paste"));r({type:C?"normalize-paste":"set-text",text:w})})]}),parent:u.current});return f.current=b,()=>{b.destroy(),f.current=null}},[]),E.useEffect(()=>{const b=f.current;if(!b)return;const S=b.state.doc.toString();S!==n.text&&b.dispatch({changes:{from:0,to:S.length,insert:n.text}})},[n.text]),E.useEffect(()=>{g.current(n.bytes)},[n.bytes]);const p=n.bytes?.length??t?.length??0,m=n.bytes?NZ(n.bytes):"",v=b=>{n.mode!==b&&r({type:"switch-mode",mode:b})};return O.jsxs("div",{className:"flex flex-col gap-2",children:[O.jsxs("div",{className:"flex items-center gap-1",children:[O.jsx(Mk,{label:"Hex",active:n.mode==="hex",onClick:()=>v("hex")}),O.jsx(Mk,{label:"Base64",active:n.mode==="base64",onClick:()=>v("base64")})]}),O.jsx("div",{ref:u,className:"min-h-[120px] max-h-[300px] overflow-auto rounded-md border border-input bg-muted"}),s?O.jsxs("div",{className:"text-xs text-muted-foreground",children:["Preparing editor for ",t?.length??0," bytes…"]}):null,O.jsxs("div",{className:"flex flex-col gap-1 text-xs",children:[O.jsxs("div",{className:"text-muted-foreground",children:[p," bytes"]}),m&&O.jsxs("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-muted-foreground",children:["ASCII: ",O.jsx("span",{className:"font-mono text-foreground",children:m})]}),n.error&&O.jsx("div",{className:"text-destructive",children:n.error})]})]})},WZ={string:"Text",number:"Number",boolean:"Boolean",buffer:"Hex"},KZ=["string","number","boolean","buffer"],YZ=({supportedTypes:t,value:e,onChange:n})=>{const r=KZ.filter(i=>t.includes(i));return r.length<=1?null:O.jsx("div",{role:"tablist","aria-label":"Edit as",className:"inline-flex overflow-hidden rounded-md border border-border",children:r.map(i=>O.jsx("button",{type:"button",role:"tab","aria-selected":e===i,onClick:()=>n(i),className:Ue("px-3 py-1 text-xs font-medium transition-colors",e===i?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:WZ[i]},i))})},XZ=new TextEncoder,QZ=new TextDecoder("utf-8",{fatal:!0}),Ab=t=>{try{return QZ.decode(new Uint8Array(t))}catch{return""}},Mb=t=>Array.from(XZ.encode(t)),ZZ=(t,e,n)=>{if(t===e)return n;if(t==="string"){const r=n;switch(e){case"number":{const i=Number(r);return Number.isNaN(i)?0:i}case"boolean":return r==="true";case"buffer":return Mb(r)}}if(t==="number"){const r=n;switch(e){case"string":return String(r);case"boolean":return r!==0;case"buffer":return Mb(String(r))}}if(t==="boolean"){const r=n;switch(e){case"string":return String(r);case"number":return r?1:0;case"buffer":return Mb(String(r))}}if(t==="buffer"){const r=n;switch(e){case"string":return Ab(r);case"number":{const i=Ab(r),s=Number(i);return Number.isNaN(s)?0:s}case"boolean":return Ab(r)==="true"}}return n},pc=t=>{switch(t){case"string":return"";case"number":return 0;case"boolean":return!1;case"buffer":return[]}},mB=({supportedTypes:t,type:e,value:n,onChange:r,inputId:i,autoFocus:s})=>{const a=u=>{if(u!==e){if(n===null){r(u,pc(u));return}r(u,ZZ(e,u,n))}};return O.jsxs("div",{className:"flex flex-col gap-2",children:[O.jsx(YZ,{supportedTypes:t,value:e,onChange:a}),e==="buffer"?O.jsx(GZ,{initialBytes:Array.isArray(n)?n:void 0,onChange:u=>r("buffer",u)}):e==="boolean"?O.jsxs(Ju,{value:String(n??!1),onValueChange:u=>r("boolean",u==="true"),children:[O.jsx(Ju.Trigger,{id:i,autoFocus:s,children:O.jsx(Ju.Value,{})}),O.jsxs(Ju.Content,{children:[O.jsx(Ju.Item,{value:"true",children:"true"}),O.jsx(Ju.Item,{value:"false",children:"false"})]})]}):e==="number"?O.jsx(Fx,{id:i,type:"number",value:String(n??""),onChange:u=>{const f=u.target.value,d=f===""?0:Number(f);r("number",Number.isNaN(d)?0:d)},placeholder:"Enter number value",autoFocus:s}):O.jsx(Fx,{id:i,type:"text",value:String(n??""),onChange:u=>r("string",u.target.value),placeholder:"Enter string value",autoFocus:s})]})},JZ=(t,e,n)=>{switch(e){case"string":return{key:t,type:"string",value:n};case"number":return{key:t,type:"number",value:n};case"boolean":return{key:t,type:"boolean",value:n};case"buffer":return{key:t,type:"buffer",value:n}}},eJ=({isOpen:t,onClose:e,onAddEntry:n,existingKeys:r,supportedTypes:i})=>{const s=i.includes("string")?"string":i[0]??"string",[a,u]=E.useState(""),[f,d]=E.useState(s),[g,p]=E.useState(pc(s)),[m,v]=E.useState(null);E.useEffect(()=>{t&&(u(""),d(s),p(pc(s)))},[t,s]);const b=i.includes(f),S=()=>{u(""),d(s),p(pc(s)),e()},w=()=>{if(!(!a.trim()||g===null)){if(!b){v({title:"Unsupported Type",message:"Selected type is not supported by this storage."});return}if(r.includes(a)){v({title:"Key Already Exists",message:"An entry with this key already exists."});return}n(JZ(a,f,g)),S()}},C=T=>{T.key==="Enter"&&a.trim()&&f!=="buffer"&&w()},R=!a.trim()||!b||g===null;return O.jsxs(O.Fragment,{children:[O.jsx(sn,{open:t,onOpenChange:T=>{T||S()},children:O.jsxs(sn.Content,{onKeyDown:C,children:[O.jsx(sn.Header,{children:O.jsx(sn.Title,{children:"Add New Entry"})}),O.jsxs("div",{className:"flex flex-col gap-4",children:[O.jsxs(Eo,{children:[O.jsx(Eo.Label,{htmlFor:"new-entry-key",children:"Key"}),O.jsx(Fx,{id:"new-entry-key",value:a,onChange:T=>u(T.target.value),placeholder:"Enter key name",autoFocus:!0})]}),O.jsxs(Eo,{children:[O.jsx(Eo.Label,{htmlFor:"new-entry-value",children:"Value"}),O.jsx(mB,{supportedTypes:i,type:f,value:g,onChange:(T,A)=>{d(T),p(A)},inputId:"new-entry-value"}),!b&&O.jsx(Eo.Description,{className:"text-destructive",children:"Selected type is not supported by this storage."})]})]}),O.jsxs(sn.Footer,{children:[O.jsx(Li,{variant:"outline",onClick:S,children:"Cancel"}),O.jsx(Li,{onClick:w,disabled:R,children:"Add Entry"})]})]})}),O.jsx(ed,{open:m!==null,onOpenChange:T=>{T||v(null)},variant:"alert",title:m?.title??"",description:m?.message})]})},tJ=({isOpen:t,onClose:e,onEditEntry:n,entry:r,supportedTypes:i})=>{const s=E.useRef(r),[a,u]=E.useState("string"),[f,d]=E.useState(pc("string")),[g,p]=E.useState(null);E.useEffect(()=>{r&&t&&(s.current=r,u(r.type),d(r.value))},[r,t]);const m=r??s.current,v=i.includes(a),b=()=>{u("string"),d(pc("string")),e()},S=()=>{if(!(!r||f===null)){if(!v){p({title:"Unsupported Type",message:"This storage does not support the selected type."});return}n(r.key,f),b()}},w=R=>{R.key==="Enter"&&a!=="buffer"&&S()};if(!m)return null;const C=!v||f===null;return O.jsxs(O.Fragment,{children:[O.jsx(sn,{open:t,onOpenChange:R=>{R||b()},children:O.jsxs(sn.Content,{onKeyDown:w,children:[O.jsx(sn.Header,{children:O.jsx(sn.Title,{children:"Edit Entry"})}),O.jsxs("div",{className:"flex flex-col gap-4",children:[O.jsxs(Eo,{children:[O.jsx(Eo.Label,{children:"Key"}),O.jsx("div",{className:"h-8 w-full truncate rounded-md border border-input bg-muted px-3 py-1.5 font-mono text-sm text-foreground",children:m.key}),O.jsx(Eo.Description,{children:"Key cannot be changed during editing"})]}),O.jsxs(Eo,{children:[O.jsx(Eo.Label,{htmlFor:"edit-entry-value",children:"Value"}),O.jsx(mB,{supportedTypes:i,type:a,value:f,onChange:(R,T)=>{u(R),d(T)},inputId:"edit-entry-value",autoFocus:!0},m.key),!v&&O.jsxs(Eo.Description,{className:"text-destructive",children:["This storage does not support ",a," values."]})]})]}),O.jsxs(sn.Footer,{children:[O.jsx(Li,{variant:"outline",onClick:b,children:"Cancel"}),O.jsx(Li,{onClick:S,disabled:C,children:"Save Changes"})]})]})}),O.jsx(ed,{open:g!==null,onOpenChange:R=>{R||p(null)},variant:"alert",title:g?.title??"",description:g?.message})]})},nJ=t=>t.type==="string"?O.jsxs("span",{className:"font-mono text-foreground",children:['"',t.value,'"']}):t.type==="number"?O.jsx("span",{className:"font-mono text-foreground",children:t.value}):t.type==="boolean"?O.jsx("span",{className:Ue("font-mono",t.value?"text-primary":"text-destructive"),children:t.value?"true":"false"}):O.jsx("span",{className:"font-mono text-muted-foreground",children:BZ(t.value)}),rJ=5e4,Ok=2e3,iJ=t=>{const e=[];let n=0;for(;n<t.length;){const r=t.indexOf(`
|
|
32
|
-
`,n),i=r===-1?t.length:r+1;for(let s=n;s<i;s+=Ok)e.push([s,Math.min(s+Ok,i)]);n=i}return e.length===0?[[0,0]]:e},oJ=({value:t})=>{const e=E.useMemo(()=>t.length>rJ?iJ(t):null,[t]);return e?O.jsx(lN,{"aria-label":"Large string value",className:"font-mono text-sm text-success",style:{height:384},totalCount:e.length,itemContent:n=>{const[r,i]=e[n];return O.jsxs("div",{className:"whitespace-pre-wrap wrap-anywhere",children:[n===0?'"':"",t.slice(r,i),n===e.length-1?'"':""]})}}):O.jsxs("pre",{className:"font-mono text-sm text-success whitespace-pre-wrap wrap-anywhere",children:['"',t,'"']})},sJ=({bytes:t})=>{const e=Math.ceil(t.length/16);return e===0?O.jsx("div",{className:"text-xs text-muted italic",children:"No bytes to display."}):O.jsx(lN,{"aria-label":"Buffer hexdump",className:"font-mono text-xs text-accent",style:{height:384},totalCount:e,itemContent:n=>{const r=PZ(t,n*16);return O.jsxs("div",{className:"flex gap-4 leading-snug whitespace-pre",children:[O.jsx("span",{className:"text-muted",children:r.offset}),O.jsx("span",{children:r.hex}),O.jsxs("span",{className:"text-muted",children:["|",r.ascii,"|"]})]})}})},lJ=5e4,aJ=t=>{try{const e=JSON.parse(t);return Array.isArray(e)||e&&typeof e=="object"?e:null}catch{return null}},uJ=({open:t,onOpenChange:e,onEdit:n,entry:r})=>{const i=r?.type==="string",s=i?r.value:"",a=E.useMemo(()=>!i||s.length>lJ?null:aJ(s),[i,s]);return O.jsx(sn,{open:t,onOpenChange:e,children:O.jsxs(sn.Content,{className:"max-w-2xl",children:[O.jsx(sn.Header,{children:O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(d8,{className:"h-4 w-4 text-muted-foreground"}),O.jsx(sn.Title,{children:"Entry Details"})]})}),r&&O.jsxs("div",{className:"flex max-h-[70vh] flex-col gap-4 overflow-auto",children:[O.jsxs("div",{children:[O.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Key"}),O.jsx("div",{className:"w-full break-all rounded-md border border-input bg-muted px-3 py-2 font-mono text-sm text-foreground",children:r.key})]}),O.jsxs("div",{children:[O.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Type"}),O.jsx(Fp,{variant:"outline",children:r.type})]}),O.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[O.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Value"}),O.jsx("div",{className:"max-h-96 overflow-auto rounded-md border border-input bg-muted p-3",children:a?O.jsx(uK,{data:a}):r.type==="buffer"?O.jsxs("div",{className:"flex flex-col gap-2",children:[O.jsxs("div",{className:"text-xs text-muted-foreground",children:[r.value.length," ",r.value.length===1?"byte":"bytes"]}),O.jsx(sJ,{bytes:r.value})]}):r.type==="string"?O.jsx(oJ,{value:r.value}):O.jsx("div",{className:"text-sm",children:nJ(r)})})]})]}),O.jsxs(sn.Footer,{children:[r&&n&&O.jsxs(Li,{variant:"outline",onClick:()=>n(r),children:[O.jsx(sD,{className:"h-3.5 w-3.5"}),"Edit"]}),O.jsx(sn.Close,{render:O.jsx(Li,{}),children:"Close"})]})]})})},Ob=({title:t,items:e})=>e.length===0?null:O.jsxs("div",{children:[O.jsxs("div",{className:"text-xs font-medium text-foreground",children:[t," (",e.length,")"]}),O.jsxs("div",{className:"mt-1 max-h-24 overflow-auto rounded-md bg-muted px-2 py-1 font-mono text-xs text-muted-foreground",children:[e.slice(0,50).join(", "),e.length>50?`, +${e.length-50} more`:""]})]}),kb=({label:t,value:e})=>O.jsxs("div",{className:"rounded-md bg-muted p-2",children:[O.jsx("div",{className:"text-muted-foreground",children:t}),O.jsx("div",{className:"text-base font-semibold text-foreground",children:e})]}),cJ=({state:t,onApply:e,onCancel:n})=>{const{snapshot:r,preview:i,entriesToWrite:s,targetLabel:a}=t,u=i.unsupportedTypes.length>0,f=`${r.storage.adapterName} / ${r.storage.storageName}`;return O.jsxs(O.Fragment,{children:[O.jsxs("div",{className:"flex flex-col gap-3",children:[i.metadataMismatch&&O.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-2 text-xs text-foreground",children:[O.jsx(s8,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),O.jsxs("div",{children:["This file was exported from ",O.jsx("strong",{children:f}),". You are importing into"," ",O.jsx("strong",{children:a}),"."]})]}),u&&O.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 p-2 text-xs text-destructive",children:[O.jsx(lD,{className:"mt-0.5 h-4 w-4 shrink-0"}),O.jsxs("div",{children:[i.unsupportedTypes.length," ",i.unsupportedTypes.length===1?"entry has a type":"entries have types"," ","not supported by this storage. Remove them from the file and try again.",O.jsx("div",{className:"mt-1 max-h-20 overflow-auto rounded-md bg-muted px-2 py-1 font-mono text-xs",children:i.unsupportedTypes.map(d=>`${d.key} (${d.type})`).join(", ")})]})]}),O.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[O.jsx(kb,{label:"New",value:i.newKeys.length}),O.jsx(kb,{label:"Overwrite",value:i.overwriteKeys.length}),O.jsx(kb,{label:"Skipped",value:i.skippedKeys.length})]}),O.jsx(Ob,{title:"New keys",items:i.newKeys}),O.jsx(Ob,{title:"Overwrite keys",items:i.overwriteKeys}),O.jsx(Ob,{title:"Skipped (filtered by storage)",items:i.skippedKeys.map(d=>d.key)})]}),O.jsxs(sn.Footer,{children:[O.jsx(Li,{variant:"outline",onClick:n,children:"Cancel"}),O.jsxs(Li,{onClick:e,disabled:u,children:["Apply (",s.length,")"]})]})]})},fJ=({state:t})=>O.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[O.jsx(h8,{className:"h-6 w-6 animate-spin text-muted-foreground"}),O.jsxs("div",{className:"text-sm text-foreground",children:["Importing… ",t.written," / ",t.total]})]}),dJ=({state:t,onClose:e})=>O.jsxs(O.Fragment,{children:[t.ok?O.jsxs("div",{className:"flex flex-col items-center gap-3 py-4",children:[O.jsx(l8,{className:"h-8 w-8 text-primary"}),O.jsxs("div",{className:"text-sm text-foreground",children:["Imported ",t.written," ",t.written===1?"entry":"entries","."]})]}):O.jsxs("div",{className:"flex flex-col gap-2 py-2",children:[O.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[O.jsx(lD,{className:"h-5 w-5"}),O.jsxs("div",{className:"text-sm font-medium",children:["Import failed after ",t.written," of ",t.total,"."]})]}),t.failedKey&&O.jsxs("div",{className:"text-xs text-muted-foreground",children:["Failed at key:"," ",O.jsx(Fp,{variant:"outline",className:"font-mono",children:t.failedKey})]}),O.jsx("div",{className:"rounded-md bg-muted px-2 py-1 font-mono text-xs text-destructive",children:t.error})]}),O.jsx(sn.Footer,{children:O.jsx(Li,{onClick:e,autoFocus:!0,children:"Close"})})]}),hJ=({state:t,onApply:e,onCancel:n,onClose:r})=>{const i=t===null?"":t.phase==="preview"?"Import snapshot":t.phase==="importing"?"Importing…":t.ok?"Import complete":"Import failed",s=t!==null&&t.phase!=="importing";return O.jsx(sn,{open:t!==null,onOpenChange:a=>{!a&&s&&r()},children:O.jsxs(sn.Content,{showCloseButton:s,children:[O.jsx(sn.Header,{children:O.jsx(sn.Title,{children:i})}),t?.phase==="preview"&&O.jsx(cJ,{state:t,onApply:e,onCancel:n}),t?.phase==="importing"&&O.jsx(fJ,{state:t}),t?.phase==="result"&&O.jsx(dJ,{state:t,onClose:r})]})})},gJ={defaultOptions:{queries:{gcTime:0,refetchOnReconnect:!1,refetchOnWindowFocus:!1,retry:!1}}},pJ=()=>new n4(gJ),mJ=({children:t})=>{const[e]=E.useState(pJ);return E.useEffect(()=>()=>e.clear(),[e]),O.jsx(s4,{client:e,children:t})},yJ=t=>{const e=new Map;for(const[n,r]of t){const{adapterId:i}=r.target;let s=e.get(i);s||(s={adapterId:i,adapterName:r.adapterName,items:[]},e.set(i,s)),s.items.push({viewId:n,storageName:r.storageName,entryCount:r.entryCount})}return[...e.values()]},vJ=100,bJ=5,yB=t=>t.trim().toLowerCase(),D1=t=>["storage-entry-previews",t.adapterId,t.storageId],xJ=(t,e,n)=>[...D1(t),yB(e),n],P1=t=>["storage-full-entry",t.adapterId,t.storageId],vB=(t,e)=>[...P1(t),e],kk=async(t,e)=>{const n=D1(e),r=P1(e);await t.cancelQueries({queryKey:n}),await t.cancelQueries({queryKey:r}),t.removeQueries({queryKey:r}),await t.resetQueries({queryKey:n})},SJ=async(t,e)=>t.invalidateQueries({queryKey:D1(e)}),wJ=async(t,e,n)=>{const r=n==null?P1(e):vB(e,n);await t.cancelQueries({queryKey:r,exact:n!=null}),t.removeQueries({queryKey:r,exact:n!=null})},CJ=({client:t,target:e,search:n,keySortDirection:r,pageSize:i=vJ,maxPages:s=bJ})=>{const a=yB(n),u=E.useMemo(()=>e?xJ(e,a,r):["storage-entry-previews","no-target"],[r,a,e?.adapterId,e?.storageId]);return v4({queryKey:u,enabled:t!=null&&e!=null,initialPageParam:void 0,maxPages:Math.max(1,s),placeholderData:HF,queryFn:({pageParam:f,signal:d})=>{if(!t||!e)throw new Error("A storage target and request client are required.");return t.request({requestType:"list-entry-previews",responseType:"entry-previews",errorType:"storage-request-error",payload:{type:"list-entry-previews",target:e,search:a||void 0,keySortDirection:r,cursor:f,limit:i},signal:d})},getNextPageParam:f=>f.nextCursor,getPreviousPageParam:f=>f.previousCursor,refetchOnWindowFocus:!1})},RJ=t=>t?.pages.flatMap(e=>e.items)??[],EJ=({client:t,target:e,key:n,enabled:r=!0})=>{const i=HS(),s=E.useMemo(()=>e&&n!=null?vB(e,n):["storage-full-entry","no-entry"],[n,e?.adapterId,e?.storageId]),a=y4({queryKey:s,enabled:r&&t!=null&&e!=null&&n!=null,gcTime:0,queryFn:({signal:f})=>{if(!t||!e||n==null)throw new Error("A storage target, key, and request client are required.");return t.request({requestType:"get-entry",responseType:"entry",errorType:"storage-request-error",payload:{type:"get-entry",target:e,key:n},signal:f})},refetchOnWindowFocus:!1});E.useEffect(()=>()=>{i.cancelQueries({queryKey:s}),i.removeQueries({queryKey:s})},[i,s]);const u=E.useCallback(()=>{i.cancelQueries({queryKey:s}),i.removeQueries({queryKey:s})},[i,s]);return{...a,entry:a.data?.entry,reset:u}},TJ=(t,e)=>{const n=JSON.stringify(t,null,2),r=new Blob([n],{type:"application/json"}),i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)},Ik=t=>t.replace(/[^a-zA-Z0-9_-]/g,"-"),AJ=(t,e=new Date)=>{const n=e.getFullYear().toString().padStart(4,"0"),r=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0"),s=e.getHours().toString().padStart(2,"0"),a=e.getMinutes().toString().padStart(2,"0"),u=e.getSeconds().toString().padStart(2,"0"),f=`${n}${r}${i}-${s}${a}${u}`;return`rozenite-storage-${Ik(t.adapterId)}-${Ik(t.storageId)}-${f}.json`},Xi=(t,e)=>t.adapterId===e.adapterId&&t.storageId===e.storageId,Dk=t=>typeof t=="string"?"string":typeof t=="number"?"number":typeof t=="boolean"?"boolean":"buffer",MJ=(t,e=250)=>{const[n,r]=E.useState(t);return E.useEffect(()=>{const i=window.setTimeout(()=>r(t),e);return()=>window.clearTimeout(i)},[e,t]),n};function OJ(){const[t,e]=E.useState([]),[n,r]=E.useState(null),[i,s]=E.useState(""),[a,u]=E.useState("ascending"),[f,d]=E.useState(null),[g,p]=E.useState(!1),[m,v]=E.useState(null),[b,S]=E.useState(!1),[w,C]=E.useState(0),[R,T]=E.useState({status:"idle"}),[A,k]=E.useState(null),[P,M]=E.useState(null),D=E.useRef(null),L=E.useRef(null),H=E.useRef(0),N=E.useRef(null),_=E.useRef(null),$=E.useRef(0),F=E.useRef(null),G=E.useRef(!1),j=E.useRef(!1),q=E.useRef(new Set),V=N4({pluginId:"@rozenite/storage-plugin"}),te=HS(),J=MJ(i),z=t.find(Q=>n&&Xi(Q.target,n)),U=CJ({client:V,target:n,search:J,keySortDirection:a}),W=EJ({client:V,target:n,key:f?.key,enabled:f!==null}),X=RJ(U.data),ie=z?.capabilities.supportedTypes??[],ee=E.useMemo(()=>{const Q=new Map(t.map(Se=>[jg(Se.target),Se]));return yJ(Q)},[t]),ue=()=>{W.reset(),d(null)},Y=async()=>{n&&(ue(),C(Q=>Q+1),await kk(te,n))};E.useEffect(()=>{if(!V)return;const Q=()=>{H.current+=1,V.send("discover-storages",{type:"discover-storages",requestId:`discovery-${H.current}`})},Se=V.onMessage("storage-descriptors",Le=>{Le.requestId===`discovery-${H.current}`&&(e(Le.storages),r(it=>it&&Le.storages.some(ht=>Xi(ht.target,it))?it:Le.storages[0]?.target??null))}),ge=V.onMessage("import-progress",Le=>{k(it=>it?.phase==="importing"&&it.requestId===Le.requestId&&Xi(it.target,Le.target)?{...it,written:Le.written,total:Le.total}:it)}),Ie=V.onMessage("import-result",Le=>{F.current===Le.requestId&&L.current&&Xi(Le.target,L.current)&&(F.current=null,ue(),C(it=>it+1),kk(te,Le.target)),k(it=>it?.phase!=="importing"||it.requestId!==Le.requestId||!Xi(it.target,Le.target)?it:Le.ok?{phase:"result",ok:!0,written:Le.written}:{phase:"result",ok:!1,written:Le.written,total:Le.total,failedKey:Le.failedKey,error:Le.error??"Unknown error"})}),Je=V.onMessage("storage-invalidated",Le=>{wJ(te,Le.target,Le.key),e(ht=>ht.map(wt=>Xi(wt.target,Le.target)?{...wt,entryCount:Le.entryCount}:wt)),L.current&&Xi(Le.target,L.current)&&d(ht=>ht&&(Le.key==null||ht.key===Le.key)?null:ht);const it=jg(Le.target);q.current.has(it)||(q.current.add(it),queueMicrotask(()=>{q.current.delete(it),L.current&&Xi(Le.target,L.current)&&C(ht=>ht+1),SJ(te,Le.target)}))}),nt=V.onMessage("device-ready",()=>{te.resetQueries(),Q()});return Q(),()=>{Se.remove(),ge.remove(),Ie.remove(),Je.remove(),nt.remove()}},[V,te]),E.useEffect(()=>{L.current=n,N.current?.abort(),N.current=null,_.current?.abort(),_.current=null,F.current=null,T({status:"idle"}),v(null),S(!1),d(null),k(null)},[n]),E.useEffect(()=>()=>{N.current?.abort(),_.current?.abort()},[]);const le=Q=>{Q()},xe=(Q,Se)=>{if(!V||!n||!ie.includes(Dk(Se)))return;const ge=Dk(Se),Ie=ge==="string"?{key:Q,type:ge,value:Se}:ge==="number"?{key:Q,type:ge,value:Se}:ge==="boolean"?{key:Q,type:ge,value:Se}:{key:Q,type:ge,value:Se};le(()=>V.send("set-entry",{type:"set-entry",target:n,entry:Ie}))},ve=Q=>{!V||!n||le(()=>V.send("set-entry",{type:"set-entry",target:n,entry:Q}))},de=()=>{if(!V||!n||!m)return;const Q=m;v(null),le(()=>V.send("delete-entry",{type:"delete-entry",target:n,key:Q}))},me=()=>{!V||!n||(S(!1),V.send("purge-storage",{type:"purge-storage",target:n}))},Ce=(Q,Se)=>M({title:Q,message:Se}),De=()=>{D.current&&(D.current.value="",D.current.click())},Pe=async Q=>{const Se=Q.target.files?.[0];if(!Se||!V||!n)return;let ge;try{ge=JSON.parse(await Se.text())}catch(Le){Ce("Could not read file",Le instanceof Error?Le.message:String(Le));return}const Ie=mK(ge);if(!Ie.ok){Ce("Invalid snapshot",`${Ie.error.path}: ${Ie.error.message}`);return}_.current?.abort();const Je=new AbortController;_.current=Je;const nt=n;try{const Le=await V.request({requestType:"preview-import",responseType:"import-preview",errorType:"storage-request-error",payload:{type:"preview-import",target:nt,snapshot:Ie.snapshot},signal:Je.signal});if(Je.signal.aborted||!Xi(nt,L.current??nt))return;k({phase:"preview",target:nt,targetLabel:z?`${z.adapterName} / ${z.storageName}`:"selected storage",snapshot:Ie.snapshot,preview:Le.preview,entriesToWrite:Le.preview.acceptedEntryIndexes.map(it=>Ie.snapshot.entries[it])})}catch{!Je.signal.aborted&&Xi(nt,L.current??nt)&&Ce("Could not preview import","Could not inspect the selected storage. Please try again.")}finally{_.current===Je&&(_.current=null)}},Ee=()=>{if(!V||A?.phase!=="preview")return;const Q=`import-${++$.current}`;F.current=Q,V.send("import-entries",{type:"import-entries",requestId:Q,target:A.target,entries:A.entriesToWrite}),k({phase:"importing",requestId:Q,target:A.target,total:A.entriesToWrite.length,written:0})},je=async()=>{if(!V||!n||N.current)return;const Q=n,Se=new AbortController;N.current=Se,T({status:"loading"});try{const ge=await V.request({requestType:"export-snapshot",responseType:"export-snapshot-result",errorType:"storage-request-error",payload:{type:"export-snapshot",target:Q},signal:Se.signal});!Se.signal.aborted&&Xi(Q,L.current??Q)&&(TJ(ge.snapshot,AJ(Q)),T({status:"idle"}))}catch{!Se.signal.aborted&&Xi(Q,L.current??Q)&&T({status:"error",message:"Could not export the selected storage. Please try again."})}finally{N.current===Se&&(N.current=null)}},ke=E.useMemo(()=>[{id:"key",accessorKey:"key",header:"Key",enableSorting:!0,cell:({row:Q})=>O.jsx("span",{className:"font-mono text-sm text-foreground",children:Q.original.key})},{id:"type",accessorKey:"type",header:"Type",enableSorting:!1,cell:({row:Q})=>O.jsx(Fp,{variant:"outline",children:Q.original.type})},{id:"preview",accessorKey:"preview",header:"Value",enableSorting:!1,cell:({row:Q})=>O.jsxs("div",{className:"min-w-0",children:[O.jsx("span",{className:"break-all font-mono text-sm text-foreground",children:Q.original.preview}),O.jsx("span",{className:"ml-2 text-xs text-muted-foreground",title:Q.original.isTruncated?`Full value size: ${Q.original.valueSize}`:void 0,children:Q.original.isTruncated?`truncated · ${Q.original.valueSize}`:Q.original.valueSize})]})},{id:"actions",header:"",enableSorting:!1,cell:({row:Q})=>O.jsxs("div",{className:"flex items-center gap-1",onClick:Se=>Se.stopPropagation(),children:[O.jsx(Li,{variant:"ghost",size:"icon",onClick:()=>d({key:Q.original.key,mode:"edit"}),"aria-label":`Edit value for ${Q.original.key}`,children:O.jsx(sD,{className:"h-3.5 w-3.5"})}),O.jsx(Li,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive",onClick:()=>v(Q.original.key),"aria-label":`Delete entry ${Q.original.key}`,children:O.jsx(FA,{className:"h-3.5 w-3.5"})})]})}],[]),_e=[{id:"key",desc:a==="descending"}],Ge=Q=>{const ge=(typeof Q=="function"?Q(_e):Q).find(Ie=>Ie.id==="key");u(ge?.desc?"descending":"ascending")},We=()=>{!U.hasNextPage||U.isFetching||U.isFetchingNextPage||G.current||(G.current=!0,U.fetchNextPage().finally(()=>{G.current=!1}))},fe=()=>{!U.hasPreviousPage||U.isFetching||U.isFetchingPreviousPage||j.current||(j.current=!0,U.fetchPreviousPage().finally(()=>{j.current=!1}))},ne=n?jg(n):"";return O.jsxs(SO,{children:[O.jsx(SO.Body,{children:O.jsxs(Hg,{direction:"horizontal",autoSaveId:"storage",children:[O.jsx(Hg.Pane,{defaultSize:22,minSize:15,maxSize:40,children:O.jsx(ab,{className:"w-full border-r-0",children:ee.length===0?O.jsx("div",{className:"flex flex-1 items-center justify-center p-4 text-center text-xs text-sidebar-foreground/60",children:"Waiting for storages…"}):ee.map(Q=>O.jsx(ab.Group,{label:Q.adapterName,children:Q.items.map(Se=>O.jsx(ab.Item,{selected:Se.viewId===ne,adornment:O.jsx(VA,{}),trailing:O.jsx(Fp,{variant:"secondary",children:Se.entryCount}),onClick:()=>{const ge=t.find(Ie=>jg(Ie.target)===Se.viewId);ge&&r(ge.target)},children:Se.storageName},Se.viewId))},Q.adapterId))})}),O.jsx(Hg.Handle,{}),O.jsx(Hg.Pane,{children:O.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[O.jsxs(Yi,{children:[O.jsxs(Yi.Group,{children:[O.jsx(Yi.Button,{onClick:()=>p(!0),disabled:!z,"aria-label":"Add entry",title:"Add entry",className:"w-7 px-0",children:O.jsx(p8,{className:"h-3.5 w-3.5"})}),O.jsx(Yi.Button,{onClick:()=>S(!0),disabled:!V||!n||U.isFetching,"aria-label":"Purge storage",title:"Purge storage",className:"w-7 px-0 text-muted-foreground hover:text-destructive",children:O.jsx(FA,{className:"h-3.5 w-3.5"})})]}),O.jsx(Yi.Separator,{}),O.jsx(Yi.Group,{children:O.jsx(Yi.Button,{onClick:()=>{Y()},disabled:!n||U.isFetching,"aria-label":"Refresh storage",title:"Refresh storage",className:"w-7 px-0",children:O.jsx(m8,{className:"h-3.5 w-3.5"})})}),O.jsx(Yi.Separator,{}),O.jsxs(Yi.Group,{children:[O.jsx(Yi.Button,{onClick:De,disabled:!z,"aria-label":"Import storage",title:"Import storage",className:"w-7 px-0",children:O.jsx(b8,{className:"h-3.5 w-3.5"})}),O.jsx(Yi.Button,{onClick:je,disabled:!V||!n||R.status==="loading","aria-label":R.status==="loading"?"Exporting storage":"Export storage",title:R.status==="loading"?"Exporting storage":"Export storage",className:"w-7 px-0",children:O.jsx(c8,{className:"h-3.5 w-3.5"})})]}),O.jsx(Yi.Separator,{}),O.jsx("div",{className:"min-w-40 flex-1",children:O.jsx(FW,{placeholder:"Search keys…",value:i,onChange:Q=>s(Q.target.value),onClear:()=>s(""),disabled:!z})}),R.status==="error"?O.jsx("span",{role:"alert",className:"text-xs text-destructive",children:R.message}):null,O.jsx("input",{ref:D,type:"file",accept:"application/json,.json",className:"hidden",onChange:Pe})]}),O.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:z?O.jsx(WW,{ariaLabel:"Storage entries",columns:ke,data:X,getRowId:Q=>Q.key,getRowTextValue:Q=>Q.key,loading:U.isLoading,emptyMessage:J?"No entries match your search.":"This storage is empty.",manualSorting:!0,onEndReached:We,onRowClick:Q=>d({key:Q.key,mode:"detail"}),onSortingChange:Ge,onStartReached:fe,scrollClassName:"h-full w-full overflow-auto",style:{height:"100%"},sorting:_e},w):O.jsx(oK,{icon:VA,title:"No storage selected",description:"Choose a storage from the sidebar to inspect its entries."})})]})})]})}),O.jsx(eJ,{isOpen:g,onClose:()=>p(!1),onAddEntry:ve,existingKeys:X.map(Q=>Q.key),supportedTypes:ie}),O.jsx(uJ,{open:f?.mode==="detail"&&W.entry!=null,onOpenChange:Q=>{Q||ue()},onEdit:()=>d(Q=>Q&&{...Q,mode:"edit"}),entry:W.entry??null}),O.jsx(tJ,{isOpen:f?.mode==="edit"&&W.entry!=null,onClose:ue,onEditEntry:xe,entry:W.entry??null,supportedTypes:ie}),O.jsx(hJ,{state:A,onApply:Ee,onCancel:()=>k(null),onClose:()=>k(null)}),O.jsx(ed,{open:m!==null,onOpenChange:Q=>{Q||v(null)},variant:"confirm",destructive:!0,title:"Delete Entry",description:m?`Are you sure you want to delete the entry "${m}"?`:void 0,confirmLabel:"Delete",onConfirm:de}),O.jsx(ed,{open:b,onOpenChange:S,variant:"confirm",destructive:!0,title:"Purge Storage",description:z?`Are you sure you want to remove all entries from "${z.storageName}"? This action cannot be undone.`:"Are you sure you want to remove all entries from this storage? This action cannot be undone.",confirmLabel:"Purge",onConfirm:me}),O.jsx(ed,{open:P!==null,onOpenChange:Q=>{Q||M(null)},variant:"alert",title:P?.title??"",description:P?.message})]})}function kJ(){return O.jsx(mJ,{children:O.jsx(OJ,{})})}const bB="panel";fd.registerComponent(bB,()=>kJ);fd.runApplication(bB,{initialProps:{},rootTag:document.getElementById("root")});
|