@prauga/flexdoc-backend 2.9.9 → 3.0.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/README.md +36 -179
- package/dist/flexdoc.module.js.map +1 -1
- package/dist/flexdoc.service.js.map +1 -1
- package/dist/framework-adapters.d.ts +2 -0
- package/dist/framework-adapters.js +21 -0
- package/dist/framework-adapters.js.map +1 -1
- package/dist/framework-adapters.test.js +32 -0
- package/dist/framework-adapters.test.js.map +1 -1
- package/dist/hono-adapter.d.ts +4 -0
- package/dist/hono-adapter.js +22 -0
- package/dist/hono-adapter.js.map +1 -1
- package/dist/hono-adapter.test.js +30 -6
- package/dist/hono-adapter.test.js.map +1 -1
- package/dist/host-execution-route.js.map +1 -1
- package/dist/host-execution.js +1 -1
- package/dist/host-execution.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +9 -0
- package/dist/renderer/flexdoc.standalone.css +1 -1
- package/dist/renderer/flexdoc.standalone.js +81 -72
- package/dist/runtime-intelligence-setup.test.d.ts +1 -0
- package/dist/runtime-intelligence-setup.test.js +51 -0
- package/dist/runtime-intelligence-setup.test.js.map +1 -0
- package/dist/runtime-intelligence.d.ts +58 -0
- package/dist/runtime-intelligence.js +226 -0
- package/dist/runtime-intelligence.js.map +1 -0
- package/dist/runtime-intelligence.test.d.ts +1 -0
- package/dist/runtime-intelligence.test.js +117 -0
- package/dist/runtime-intelligence.test.js.map +1 -0
- package/dist/setup.js +26 -0
- package/dist/setup.js.map +1 -1
- package/dist/template.d.ts +1 -0
- package/dist/template.js +3 -1
- package/dist/template.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,76 +1,85 @@
|
|
|
1
|
-
var FlexDocStandaloneBundle=(function(Ja){"use strict";var Eu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cu(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var us={exports:{}},Ll={};var ku;function Gy(){if(ku)return Ll;ku=1;var a=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(u,f,p){var g=null;if(p!==void 0&&(g=""+p),f.key!==void 0&&(g=""+f.key),"key"in f){p={};for(var x in f)x!=="key"&&(p[x]=f[x])}else p=f;return f=p.ref,{$$typeof:a,type:u,key:g,ref:f!==void 0?f:null,props:p}}return Ll.Fragment=r,Ll.jsx=o,Ll.jsxs=o,Ll}var _u;function Fy(){return _u||(_u=1,us.exports=Gy()),us.exports}var s=Fy(),ds={exports:{}},Bl={},fs={exports:{}},ps={};var Ou;function Vy(){return Ou||(Ou=1,(function(a){function r(O,ee){var oe=O.length;O.push(ee);e:for(;0<oe;){var K=oe-1>>>1,ge=O[K];if(0<f(ge,ee))O[K]=ee,O[oe]=ge,oe=K;else break e}}function o(O){return O.length===0?null:O[0]}function u(O){if(O.length===0)return null;var ee=O[0],oe=O.pop();if(oe!==ee){O[0]=oe;e:for(var K=0,ge=O.length,C=ge>>>1;K<C;){var G=2*(K+1)-1,pe=O[G],de=G+1,be=O[de];if(0>f(pe,oe))de<ge&&0>f(be,pe)?(O[K]=be,O[de]=oe,K=de):(O[K]=pe,O[G]=oe,K=G);else if(de<ge&&0>f(be,oe))O[K]=be,O[de]=oe,K=de;else break e}}return ee}function f(O,ee){var oe=O.sortIndex-ee.sortIndex;return oe!==0?oe:O.id-ee.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;a.unstable_now=function(){return p.now()}}else{var g=Date,x=g.now();a.unstable_now=function(){return g.now()-x}}var b=[],m=[],v=1,S=null,N=3,_=!1,R=!1,z=!1,M=!1,B=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function w(O){for(var ee=o(m);ee!==null;){if(ee.callback===null)u(m);else if(ee.startTime<=O)u(m),ee.sortIndex=ee.expirationTime,r(b,ee);else break;ee=o(m)}}function U(O){if(z=!1,w(O),!R)if(o(b)!==null)R=!0,Y||(Y=!0,se());else{var ee=o(m);ee!==null&&Ne(U,ee.startTime-O)}}var Y=!1,$=-1,q=5,J=-1;function Se(){return M?!0:!(a.unstable_now()-J<q)}function Ae(){if(M=!1,Y){var O=a.unstable_now();J=O;var ee=!0;try{e:{R=!1,z&&(z=!1,T($),$=-1),_=!0;var oe=N;try{t:{for(w(O),S=o(b);S!==null&&!(S.expirationTime>O&&Se());){var K=S.callback;if(typeof K=="function"){S.callback=null,N=S.priorityLevel;var ge=K(S.expirationTime<=O);if(O=a.unstable_now(),typeof ge=="function"){S.callback=ge,w(O),ee=!0;break t}S===o(b)&&u(b),w(O)}else u(b);S=o(b)}if(S!==null)ee=!0;else{var C=o(m);C!==null&&Ne(U,C.startTime-O),ee=!1}}break e}finally{S=null,N=oe,_=!1}ee=void 0}}finally{ee?se():Y=!1}}}var se;if(typeof E=="function")se=function(){E(Ae)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,xe=he.port2;he.port1.onmessage=Ae,se=function(){xe.postMessage(null)}}else se=function(){B(Ae,0)};function Ne(O,ee){$=B(function(){O(a.unstable_now())},ee)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(O){O.callback=null},a.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<O?Math.floor(1e3/O):5},a.unstable_getCurrentPriorityLevel=function(){return N},a.unstable_next=function(O){switch(N){case 1:case 2:case 3:var ee=3;break;default:ee=N}var oe=N;N=ee;try{return O()}finally{N=oe}},a.unstable_requestPaint=function(){M=!0},a.unstable_runWithPriority=function(O,ee){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var oe=N;N=O;try{return ee()}finally{N=oe}},a.unstable_scheduleCallback=function(O,ee,oe){var K=a.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?K+oe:K):oe=K,O){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=oe+ge,O={id:v++,callback:ee,priorityLevel:O,startTime:oe,expirationTime:ge,sortIndex:-1},oe>K?(O.sortIndex=oe,r(m,O),o(b)===null&&O===o(m)&&(z?(T($),$=-1):z=!0,Ne(U,oe-K))):(O.sortIndex=ge,r(b,O),R||_||(R=!0,Y||(Y=!0,se()))),O},a.unstable_shouldYield=Se,a.unstable_wrapCallback=function(O){var ee=N;return function(){var oe=N;N=ee;try{return O.apply(this,arguments)}finally{N=oe}}}})(ps)),ps}var Ru;function Ky(){return Ru||(Ru=1,fs.exports=Vy()),fs.exports}var ms={exports:{}},Ie={};var $u;function Xy(){if($u)return Ie;$u=1;var a=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),g=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),N=Symbol.iterator;function _(C){return C===null||typeof C!="object"?null:(C=N&&C[N]||C["@@iterator"],typeof C=="function"?C:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,M={};function B(C,G,pe){this.props=C,this.context=G,this.refs=M,this.updater=pe||R}B.prototype.isReactComponent={},B.prototype.setState=function(C,G){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,G,"setState")},B.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function T(){}T.prototype=B.prototype;function E(C,G,pe){this.props=C,this.context=G,this.refs=M,this.updater=pe||R}var w=E.prototype=new T;w.constructor=E,z(w,B.prototype),w.isPureReactComponent=!0;var U=Array.isArray;function Y(){}var $={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function J(C,G,pe){var de=pe.ref;return{$$typeof:a,type:C,key:G,ref:de!==void 0?de:null,props:pe}}function Se(C,G){return J(C.type,G,C.props)}function Ae(C){return typeof C=="object"&&C!==null&&C.$$typeof===a}function se(C){var G={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(pe){return G[pe]})}var he=/\/+/g;function xe(C,G){return typeof C=="object"&&C!==null&&C.key!=null?se(""+C.key):G.toString(36)}function Ne(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(Y,Y):(C.status="pending",C.then(function(G){C.status==="pending"&&(C.status="fulfilled",C.value=G)},function(G){C.status==="pending"&&(C.status="rejected",C.reason=G)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function O(C,G,pe,de,be){var Ee=typeof C;(Ee==="undefined"||Ee==="boolean")&&(C=null);var ce=!1;if(C===null)ce=!0;else switch(Ee){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(C.$$typeof){case a:case r:ce=!0;break;case v:return ce=C._init,O(ce(C._payload),G,pe,de,be)}}if(ce)return be=be(C),ce=de===""?"."+xe(C,0):de,U(be)?(pe="",ce!=null&&(pe=ce.replace(he,"$&/")+"/"),O(be,G,pe,"",function(Be){return Be})):be!=null&&(Ae(be)&&(be=Se(be,pe+(be.key==null||C&&C.key===be.key?"":(""+be.key).replace(he,"$&/")+"/")+ce)),G.push(be)),1;ce=0;var Ce=de===""?".":de+":";if(U(C))for(var Le=0;Le<C.length;Le++)de=C[Le],Ee=Ce+xe(de,Le),ce+=O(de,G,pe,Ee,be);else if(Le=_(C),typeof Le=="function")for(C=Le.call(C),Le=0;!(de=C.next()).done;)de=de.value,Ee=Ce+xe(de,Le++),ce+=O(de,G,pe,Ee,be);else if(Ee==="object"){if(typeof C.then=="function")return O(Ne(C),G,pe,de,be);throw G=String(C),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return ce}function ee(C,G,pe){if(C==null)return C;var de=[],be=0;return O(C,de,"","",function(Ee){return G.call(pe,Ee,be++)}),de}function oe(C){if(C._status===-1){var G=C._result;G=G(),G.then(function(pe){(C._status===0||C._status===-1)&&(C._status=1,C._result=pe)},function(pe){(C._status===0||C._status===-1)&&(C._status=2,C._result=pe)}),C._status===-1&&(C._status=0,C._result=G)}if(C._status===1)return C._result.default;throw C._result}var K=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},ge={map:ee,forEach:function(C,G,pe){ee(C,function(){G.apply(this,arguments)},pe)},count:function(C){var G=0;return ee(C,function(){G++}),G},toArray:function(C){return ee(C,function(G){return G})||[]},only:function(C){if(!Ae(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return Ie.Activity=S,Ie.Children=ge,Ie.Component=B,Ie.Fragment=o,Ie.Profiler=f,Ie.PureComponent=E,Ie.StrictMode=u,Ie.Suspense=b,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(C){return $.H.useMemoCache(C)}},Ie.cache=function(C){return function(){return C.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(C,G,pe){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var de=z({},C.props),be=C.key;if(G!=null)for(Ee in G.key!==void 0&&(be=""+G.key),G)!q.call(G,Ee)||Ee==="key"||Ee==="__self"||Ee==="__source"||Ee==="ref"&&G.ref===void 0||(de[Ee]=G[Ee]);var Ee=arguments.length-2;if(Ee===1)de.children=pe;else if(1<Ee){for(var ce=Array(Ee),Ce=0;Ce<Ee;Ce++)ce[Ce]=arguments[Ce+2];de.children=ce}return J(C.type,be,de)},Ie.createContext=function(C){return C={$$typeof:g,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:p,_context:C},C},Ie.createElement=function(C,G,pe){var de,be={},Ee=null;if(G!=null)for(de in G.key!==void 0&&(Ee=""+G.key),G)q.call(G,de)&&de!=="key"&&de!=="__self"&&de!=="__source"&&(be[de]=G[de]);var ce=arguments.length-2;if(ce===1)be.children=pe;else if(1<ce){for(var Ce=Array(ce),Le=0;Le<ce;Le++)Ce[Le]=arguments[Le+2];be.children=Ce}if(C&&C.defaultProps)for(de in ce=C.defaultProps,ce)be[de]===void 0&&(be[de]=ce[de]);return J(C,Ee,be)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(C){return{$$typeof:x,render:C}},Ie.isValidElement=Ae,Ie.lazy=function(C){return{$$typeof:v,_payload:{_status:-1,_result:C},_init:oe}},Ie.memo=function(C,G){return{$$typeof:m,type:C,compare:G===void 0?null:G}},Ie.startTransition=function(C){var G=$.T,pe={};$.T=pe;try{var de=C(),be=$.S;be!==null&&be(pe,de),typeof de=="object"&&de!==null&&typeof de.then=="function"&&de.then(Y,K)}catch(Ee){K(Ee)}finally{G!==null&&pe.types!==null&&(G.types=pe.types),$.T=G}},Ie.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},Ie.use=function(C){return $.H.use(C)},Ie.useActionState=function(C,G,pe){return $.H.useActionState(C,G,pe)},Ie.useCallback=function(C,G){return $.H.useCallback(C,G)},Ie.useContext=function(C){return $.H.useContext(C)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(C,G){return $.H.useDeferredValue(C,G)},Ie.useEffect=function(C,G){return $.H.useEffect(C,G)},Ie.useEffectEvent=function(C){return $.H.useEffectEvent(C)},Ie.useId=function(){return $.H.useId()},Ie.useImperativeHandle=function(C,G,pe){return $.H.useImperativeHandle(C,G,pe)},Ie.useInsertionEffect=function(C,G){return $.H.useInsertionEffect(C,G)},Ie.useLayoutEffect=function(C,G){return $.H.useLayoutEffect(C,G)},Ie.useMemo=function(C,G){return $.H.useMemo(C,G)},Ie.useOptimistic=function(C,G){return $.H.useOptimistic(C,G)},Ie.useReducer=function(C,G,pe){return $.H.useReducer(C,G,pe)},Ie.useRef=function(C){return $.H.useRef(C)},Ie.useState=function(C){return $.H.useState(C)},Ie.useSyncExternalStore=function(C,G,pe){return $.H.useSyncExternalStore(C,G,pe)},Ie.useTransition=function(){return $.H.useTransition()},Ie.version="19.2.8",Ie}var Mu;function hs(){return Mu||(Mu=1,ms.exports=Xy()),ms.exports}var ys={exports:{}},Ut={};var qu;function Zy(){if(qu)return Ut;qu=1;var a=hs();function r(b){var m="https://react.dev/errors/"+b;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+b+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var u={d:{f:o,r:function(){throw Error(r(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},f=Symbol.for("react.portal");function p(b,m,v){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:S==null?null:""+S,children:b,containerInfo:m,implementation:v}}var g=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(b,m){if(b==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,Ut.createPortal=function(b,m){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(r(299));return p(b,m,null,v)},Ut.flushSync=function(b){var m=g.T,v=u.p;try{if(g.T=null,u.p=2,b)return b()}finally{g.T=m,u.p=v,u.d.f()}},Ut.preconnect=function(b,m){typeof b=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,u.d.C(b,m))},Ut.prefetchDNS=function(b){typeof b=="string"&&u.d.D(b)},Ut.preinit=function(b,m){if(typeof b=="string"&&m&&typeof m.as=="string"){var v=m.as,S=x(v,m.crossOrigin),N=typeof m.integrity=="string"?m.integrity:void 0,_=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;v==="style"?u.d.S(b,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:S,integrity:N,fetchPriority:_}):v==="script"&&u.d.X(b,{crossOrigin:S,integrity:N,fetchPriority:_,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Ut.preinitModule=function(b,m){if(typeof b=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var v=x(m.as,m.crossOrigin);u.d.M(b,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&u.d.M(b)},Ut.preload=function(b,m){if(typeof b=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var v=m.as,S=x(v,m.crossOrigin);u.d.L(b,v,{crossOrigin:S,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Ut.preloadModule=function(b,m){if(typeof b=="string")if(m){var v=x(m.as,m.crossOrigin);u.d.m(b,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else u.d.m(b)},Ut.requestFormReset=function(b){u.d.r(b)},Ut.unstable_batchedUpdates=function(b,m){return b(m)},Ut.useFormState=function(b,m,v){return g.H.useFormState(b,m,v)},Ut.useFormStatus=function(){return g.H.useHostTransitionStatus()},Ut.version="19.2.8",Ut}var Du;function Qy(){if(Du)return ys.exports;Du=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(r){console.error(r)}}return a(),ys.exports=Zy(),ys.exports}var zu;function Jy(){if(zu)return Bl;zu=1;var a=Ky(),r=hs(),o=Qy();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function p(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function g(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function x(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function b(e){if(p(e)!==e)throw Error(u(188))}function m(e){var t=e.alternate;if(!t){if(t=p(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,l=t;;){var i=n.return;if(i===null)break;var c=i.alternate;if(c===null){if(l=i.return,l!==null){n=l;continue}break}if(i.child===c.child){for(c=i.child;c;){if(c===n)return b(i),e;if(c===l)return b(i),t;c=c.sibling}throw Error(u(188))}if(n.return!==l.return)n=i,l=c;else{for(var y=!1,j=i.child;j;){if(j===n){y=!0,n=i,l=c;break}if(j===l){y=!0,l=i,n=c;break}j=j.sibling}if(!y){for(j=c.child;j;){if(j===n){y=!0,n=c,l=i;break}if(j===l){y=!0,l=c,n=i;break}j=j.sibling}if(!y)throw Error(u(189))}}if(n.alternate!==l)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var S=Object.assign,N=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),E=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),Se=Symbol.for("react.memo_cache_sentinel"),Ae=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=Ae&&e[Ae]||e["@@iterator"],typeof e=="function"?e:null)}var he=Symbol.for("react.client.reference");function xe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case z:return"Fragment";case B:return"Profiler";case M:return"StrictMode";case U:return"Suspense";case Y:return"SuspenseList";case J:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case E:return e.displayName||"Context";case T:return(e._context.displayName||"Context")+".Consumer";case w:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case q:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}var Ne=Array.isArray,O=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},K=[],ge=-1;function C(e){return{current:e}}function G(e){0>ge||(e.current=K[ge],K[ge]=null,ge--)}function pe(e,t){ge++,K[ge]=e.current,e.current=t}var de=C(null),be=C(null),Ee=C(null),ce=C(null);function Ce(e,t){switch(pe(Ee,t),pe(be,e),pe(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?fy(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=fy(t),e=py(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}G(de),pe(de,e)}function Le(){G(de),G(be),G(Ee)}function Be(e){e.memoizedState!==null&&pe(ce,e);var t=de.current,n=py(t,e.type);t!==n&&(pe(be,e),pe(de,n))}function rt(e){be.current===e&&(G(de),G(be)),ce.current===e&&(G(ce),Mr._currentValue=oe)}var P,ve;function je(e){if(P===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);P=t&&t[1]||"",ve=-1<n.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<
|
|
3
|
-
`+
|
|
4
|
-
`),
|
|
5
|
-
`);for(
|
|
6
|
-
`+
|
|
7
|
-
Error generating stack: `+
|
|
8
|
-
`+l.stack}}var He=Object.prototype.hasOwnProperty,Ft=a.unstable_scheduleCallback,Vt=a.unstable_cancelCallback,wn=a.unstable_shouldYield,Rn=a.unstable_requestPaint,Oe=a.unstable_now,it=a.unstable_getCurrentPriorityLevel,Rt=a.unstable_ImmediatePriority,Kt=a.unstable_UserBlockingPriority,Yt=a.unstable_NormalPriority,d=a.unstable_LowPriority,H=a.unstable_IdlePriority,te=a.log,le=a.unstable_setDisableYieldValue,Z=null,h=null;function A(e){if(typeof te=="function"&&le(e),h&&typeof h.setStrictMode=="function")try{h.setStrictMode(Z,e)}catch{}}var I=Math.clz32?Math.clz32:me,ue=Math.log,fe=Math.LN2;function me(e){return e>>>=0,e===0?32:31-(ue(e)/fe|0)|0}var ne=256,ye=262144,we=4194304;function Re(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function $e(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,c=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var j=l&134217727;return j!==0?(l=j&~c,l!==0?i=Re(l):(y&=j,y!==0?i=Re(y):n||(n=j&~e,n!==0&&(i=Re(n))))):(j=l&~c,j!==0?i=Re(j):y!==0?i=Re(y):n||(n=l&~e,n!==0&&(i=Re(n)))),i===0?0:t!==0&&t!==i&&(t&c)===0&&(c=i&-i,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:i}function Ue(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Fe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Tn(){var e=we;return we<<=1,(we&62914560)===0&&(we=4194304),e}function Un(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function En(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _b(e,t,n,l,i,c){var y=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var j=e.entanglements,k=e.expirationTimes,V=e.hiddenUpdates;for(n=y&~n;0<n;){var ae=31-I(n),ie=1<<ae;j[ae]=0,k[ae]=-1;var X=V[ae];if(X!==null)for(V[ae]=null,ae=0;ae<X.length;ae++){var Q=X[ae];Q!==null&&(Q.lane&=-536870913)}n&=~ie}l!==0&&Xf(e,l,0),c!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=c&~(y&~t))}function Xf(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-I(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Zf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-I(n),i=1<<l;i&t|e[l]&t&&(e[l]|=t),n&=~i}}function Qf(e,t){var n=t&-t;return n=(n&42)!==0?1:yo(n),(n&(e.suspendedLanes|t))!==0?0:n}function yo(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function go(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Jf(){var e=ee.p;return e!==0?e:(e=window.event,e===void 0?32:Dy(e.type))}function Pf(e,t){var n=ee.p;try{return ee.p=e,t()}finally{ee.p=n}}var oa=Math.random().toString(36).slice(2),$t="__reactFiber$"+oa,Xt="__reactProps$"+oa,nl="__reactContainer$"+oa,xo="__reactEvents$"+oa,Ob="__reactListeners$"+oa,Rb="__reactHandles$"+oa,Wf="__reactResources$"+oa,Zl="__reactMarker$"+oa;function bo(e){delete e[$t],delete e[Xt],delete e[xo],delete e[Ob],delete e[Rb]}function al(e){var t=e[$t];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nl]||n[$t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vy(e);e!==null;){if(n=e[$t])return n;e=vy(e)}return t}e=n,n=e.parentNode}return null}function ll(e){if(e=e[$t]||e[nl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ql(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function rl(e){var t=e[Wf];return t||(t=e[Wf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Et(e){e[Zl]=!0}var ep=new Set,tp={};function Ma(e,t){il(e,t),il(e+"Capture",t)}function il(e,t){for(tp[e]=t,e=0;e<t.length;e++)ep.add(t[e])}var $b=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]*$"),np={},ap={};function Mb(e){return He.call(ap,e)?!0:He.call(np,e)?!1:$b.test(e)?ap[e]=!0:(np[e]=!0,!1)}function Pr(e,t,n){if(Mb(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Wr(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Hn(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function mn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qb(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var i=l.get,c=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(y){n=""+y,c.call(this,y)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(y){n=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function vo(e){if(!e._valueTracker){var t=lp(e)?"checked":"value";e._valueTracker=qb(e,t,""+e[t])}}function rp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=lp(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function ei(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Db=/[\n"\\]/g;function hn(e){return e.replace(Db,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function So(e,t,n,l,i,c,y,j){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+mn(t)):e.value!==""+mn(t)&&(e.value=""+mn(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?jo(e,y,mn(t)):n!=null?jo(e,y,mn(n)):l!=null&&e.removeAttribute("value"),i==null&&c!=null&&(e.defaultChecked=!!c),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+mn(j):e.removeAttribute("name")}function ip(e,t,n,l,i,c,y,j){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){vo(e);return}n=n!=null?""+mn(n):"",t=t!=null?""+mn(t):n,j||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=j?e.checked:!!l,e.defaultChecked=!!l,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),vo(e)}function jo(e,t,n){t==="number"&&ei(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function sl(e,t,n,l){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&l&&(e[n].defaultSelected=!0)}else{for(n=""+mn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,l&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function sp(e,t,n){if(t!=null&&(t=""+mn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+mn(n):""}function op(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(u(92));if(Ne(l)){if(1<l.length)throw Error(u(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=mn(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),vo(e)}function ol(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zb=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 cp(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||zb.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function up(e,t,n){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var i in t)l=t[i],t.hasOwnProperty(i)&&n[i]!==l&&cp(e,i,l)}else for(var c in t)t.hasOwnProperty(c)&&cp(e,c,t[c])}function Ao(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Ub=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"]]),Hb=/^[\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 ti(e){return Hb.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ln(){}var No=null;function wo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cl=null,ul=null;function dp(e){var t=ll(e);if(t&&(e=t.stateNode)){var n=e[Xt]||null;e:switch(e=t.stateNode,t.type){case"input":if(So(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+hn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var i=l[Xt]||null;if(!i)throw Error(u(90));So(l,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&rp(l)}break e;case"textarea":sp(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&sl(e,!!n.multiple,t,!1)}}}var To=!1;function fp(e,t,n){if(To)return e(t,n);To=!0;try{var l=e(t);return l}finally{if(To=!1,(cl!==null||ul!==null)&&(Ii(),cl&&(t=cl,e=ul,ul=cl=null,dp(t),e)))for(t=0;t<e.length;t++)dp(e[t])}}function Jl(e,t){var n=e.stateNode;if(n===null)return null;var l=n[Xt]||null;if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var Bn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Eo=!1;if(Bn)try{var Pl={};Object.defineProperty(Pl,"passive",{get:function(){Eo=!0}}),window.addEventListener("test",Pl,Pl),window.removeEventListener("test",Pl,Pl)}catch{Eo=!1}var ca=null,Co=null,ni=null;function pp(){if(ni)return ni;var e,t=Co,n=t.length,l,i="value"in ca?ca.value:ca.textContent,c=i.length;for(e=0;e<n&&t[e]===i[e];e++);var y=n-e;for(l=1;l<=y&&t[n-l]===i[c-l];l++);return ni=i.slice(e,1<l?1-l:void 0)}function ai(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function li(){return!0}function mp(){return!1}function Zt(e){function t(n,l,i,c,y){this._reactName=n,this._targetInst=i,this.type=l,this.nativeEvent=c,this.target=y,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(n=e[j],this[j]=n?n(c):c[j]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?li:mp,this.isPropagationStopped=mp,this}return S(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=li)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=li)},persist:function(){},isPersistent:li}),t}var qa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ri=Zt(qa),Wl=S({},qa,{view:0,detail:0}),Lb=Zt(Wl),ko,_o,er,ii=S({},Wl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ro,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==er&&(er&&e.type==="mousemove"?(ko=e.screenX-er.screenX,_o=e.screenY-er.screenY):_o=ko=0,er=e),ko)},movementY:function(e){return"movementY"in e?e.movementY:_o}}),hp=Zt(ii),Bb=S({},ii,{dataTransfer:0}),Ib=Zt(Bb),Yb=S({},Wl,{relatedTarget:0}),Oo=Zt(Yb),Gb=S({},qa,{animationName:0,elapsedTime:0,pseudoElement:0}),Fb=Zt(Gb),Vb=S({},qa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Kb=Zt(Vb),Xb=S({},qa,{data:0}),yp=Zt(Xb),Zb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qb={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"},Jb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Jb[e])?!!t[e]:!1}function Ro(){return Pb}var Wb=S({},Wl,{key:function(e){if(e.key){var t=Zb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ai(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Qb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ro,charCode:function(e){return e.type==="keypress"?ai(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ai(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ev=Zt(Wb),tv=S({},ii,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gp=Zt(tv),nv=S({},Wl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ro}),av=Zt(nv),lv=S({},qa,{propertyName:0,elapsedTime:0,pseudoElement:0}),rv=Zt(lv),iv=S({},ii,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),sv=Zt(iv),ov=S({},qa,{newState:0,oldState:0}),cv=Zt(ov),uv=[9,13,27,32],$o=Bn&&"CompositionEvent"in window,tr=null;Bn&&"documentMode"in document&&(tr=document.documentMode);var dv=Bn&&"TextEvent"in window&&!tr,xp=Bn&&(!$o||tr&&8<tr&&11>=tr),bp=" ",vp=!1;function Sp(e,t){switch(e){case"keyup":return uv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var dl=!1;function fv(e,t){switch(e){case"compositionend":return jp(t);case"keypress":return t.which!==32?null:(vp=!0,bp);case"textInput":return e=t.data,e===bp&&vp?null:e;default:return null}}function pv(e,t){if(dl)return e==="compositionend"||!$o&&Sp(e,t)?(e=pp(),ni=Co=ca=null,dl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return xp&&t.locale!=="ko"?null:t.data;default:return null}}var mv={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 Ap(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!mv[e.type]:t==="textarea"}function Np(e,t,n,l){cl?ul?ul.push(l):ul=[l]:cl=l,t=Zi(t,"onChange"),0<t.length&&(n=new ri("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var nr=null,ar=null;function hv(e){iy(e,0)}function si(e){var t=Ql(e);if(rp(t))return e}function wp(e,t){if(e==="change")return t}var Tp=!1;if(Bn){var Mo;if(Bn){var qo="oninput"in document;if(!qo){var Ep=document.createElement("div");Ep.setAttribute("oninput","return;"),qo=typeof Ep.oninput=="function"}Mo=qo}else Mo=!1;Tp=Mo&&(!document.documentMode||9<document.documentMode)}function Cp(){nr&&(nr.detachEvent("onpropertychange",kp),ar=nr=null)}function kp(e){if(e.propertyName==="value"&&si(ar)){var t=[];Np(t,ar,e,wo(e)),fp(hv,t)}}function yv(e,t,n){e==="focusin"?(Cp(),nr=t,ar=n,nr.attachEvent("onpropertychange",kp)):e==="focusout"&&Cp()}function gv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return si(ar)}function xv(e,t){if(e==="click")return si(t)}function bv(e,t){if(e==="input"||e==="change")return si(t)}function vv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var an=typeof Object.is=="function"?Object.is:vv;function lr(e,t){if(an(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var i=n[l];if(!He.call(t,i)||!an(e[i],t[i]))return!1}return!0}function _p(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Op(e,t){var n=_p(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_p(n)}}function Rp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $p(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ei(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ei(e.document)}return t}function Do(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Sv=Bn&&"documentMode"in document&&11>=document.documentMode,fl=null,zo=null,rr=null,Uo=!1;function Mp(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Uo||fl==null||fl!==ei(l)||(l=fl,"selectionStart"in l&&Do(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),rr&&lr(rr,l)||(rr=l,l=Zi(zo,"onSelect"),0<l.length&&(t=new ri("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=fl)))}function Da(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var pl={animationend:Da("Animation","AnimationEnd"),animationiteration:Da("Animation","AnimationIteration"),animationstart:Da("Animation","AnimationStart"),transitionrun:Da("Transition","TransitionRun"),transitionstart:Da("Transition","TransitionStart"),transitioncancel:Da("Transition","TransitionCancel"),transitionend:Da("Transition","TransitionEnd")},Ho={},qp={};Bn&&(qp=document.createElement("div").style,"AnimationEvent"in window||(delete pl.animationend.animation,delete pl.animationiteration.animation,delete pl.animationstart.animation),"TransitionEvent"in window||delete pl.transitionend.transition);function za(e){if(Ho[e])return Ho[e];if(!pl[e])return e;var t=pl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in qp)return Ho[e]=t[n];return e}var Dp=za("animationend"),zp=za("animationiteration"),Up=za("animationstart"),jv=za("transitionrun"),Av=za("transitionstart"),Nv=za("transitioncancel"),Hp=za("transitionend"),Lp=new Map,Lo="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(" ");Lo.push("scrollEnd");function Cn(e,t){Lp.set(e,t),Ma(t,[e])}var oi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},yn=[],ml=0,Bo=0;function ci(){for(var e=ml,t=Bo=ml=0;t<e;){var n=yn[t];yn[t++]=null;var l=yn[t];yn[t++]=null;var i=yn[t];yn[t++]=null;var c=yn[t];if(yn[t++]=null,l!==null&&i!==null){var y=l.pending;y===null?i.next=i:(i.next=y.next,y.next=i),l.pending=i}c!==0&&Bp(n,i,c)}}function ui(e,t,n,l){yn[ml++]=e,yn[ml++]=t,yn[ml++]=n,yn[ml++]=l,Bo|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Io(e,t,n,l){return ui(e,t,n,l),di(e)}function Ua(e,t){return ui(e,null,null,t),di(e)}function Bp(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var i=!1,c=e.return;c!==null;)c.childLanes|=n,l=c.alternate,l!==null&&(l.childLanes|=n),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(i=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,i&&t!==null&&(i=31-I(n),e=c.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=n|536870912),c):null}function di(e){if(50<Er)throw Er=0,Jc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var hl={};function wv(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ln(e,t,n,l){return new wv(e,t,n,l)}function Yo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function In(e,t){var n=e.alternate;return n===null?(n=ln(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ip(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function fi(e,t,n,l,i,c){var y=0;if(l=e,typeof e=="function")Yo(e)&&(y=1);else if(typeof e=="string")y=_1(e,n,de.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case J:return e=ln(31,n,t,i),e.elementType=J,e.lanes=c,e;case z:return Ha(n.children,i,c,t);case M:y=8,i|=24;break;case B:return e=ln(12,n,t,i|2),e.elementType=B,e.lanes=c,e;case U:return e=ln(13,n,t,i),e.elementType=U,e.lanes=c,e;case Y:return e=ln(19,n,t,i),e.elementType=Y,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case E:y=10;break e;case T:y=9;break e;case w:y=11;break e;case $:y=14;break e;case q:y=16,l=null;break e}y=29,n=Error(u(130,e===null?"null":typeof e,"")),l=null}return t=ln(y,n,t,i),t.elementType=e,t.type=l,t.lanes=c,t}function Ha(e,t,n,l){return e=ln(7,e,l,t),e.lanes=n,e}function Go(e,t,n){return e=ln(6,e,null,t),e.lanes=n,e}function Yp(e){var t=ln(18,null,null,0);return t.stateNode=e,t}function Fo(e,t,n){return t=ln(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Gp=new WeakMap;function gn(e,t){if(typeof e=="object"&&e!==null){var n=Gp.get(e);return n!==void 0?n:(t={value:e,source:t,stack:yt(t)},Gp.set(e,t),t)}return{value:e,source:t,stack:yt(t)}}var yl=[],gl=0,pi=null,ir=0,xn=[],bn=0,ua=null,$n=1,Mn="";function Yn(e,t){yl[gl++]=ir,yl[gl++]=pi,pi=e,ir=t}function Fp(e,t,n){xn[bn++]=$n,xn[bn++]=Mn,xn[bn++]=ua,ua=e;var l=$n;e=Mn;var i=32-I(l)-1;l&=~(1<<i),n+=1;var c=32-I(t)+i;if(30<c){var y=i-i%5;c=(l&(1<<y)-1).toString(32),l>>=y,i-=y,$n=1<<32-I(t)+i|n<<i|l,Mn=c+e}else $n=1<<c|n<<i|l,Mn=e}function Vo(e){e.return!==null&&(Yn(e,1),Fp(e,1,0))}function Ko(e){for(;e===pi;)pi=yl[--gl],yl[gl]=null,ir=yl[--gl],yl[gl]=null;for(;e===ua;)ua=xn[--bn],xn[bn]=null,Mn=xn[--bn],xn[bn]=null,$n=xn[--bn],xn[bn]=null}function Vp(e,t){xn[bn++]=$n,xn[bn++]=Mn,xn[bn++]=ua,$n=t.id,Mn=t.overflow,ua=e}var Mt=null,pt=null,We=!1,da=null,vn=!1,Xo=Error(u(519));function fa(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw sr(gn(t,e)),Xo}function Kp(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[$t]=e,t[Xt]=l,n){case"dialog":Ze("cancel",t),Ze("close",t);break;case"iframe":case"object":case"embed":Ze("load",t);break;case"video":case"audio":for(n=0;n<kr.length;n++)Ze(kr[n],t);break;case"source":Ze("error",t);break;case"img":case"image":case"link":Ze("error",t),Ze("load",t);break;case"details":Ze("toggle",t);break;case"input":Ze("invalid",t),ip(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ze("invalid",t);break;case"textarea":Ze("invalid",t),op(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||uy(t.textContent,n)?(l.popover!=null&&(Ze("beforetoggle",t),Ze("toggle",t)),l.onScroll!=null&&Ze("scroll",t),l.onScrollEnd!=null&&Ze("scrollend",t),l.onClick!=null&&(t.onclick=Ln),t=!0):t=!1,t||fa(e,!0)}function Xp(e){for(Mt=e.return;Mt;)switch(Mt.tag){case 5:case 31:case 13:vn=!1;return;case 27:case 3:vn=!0;return;default:Mt=Mt.return}}function xl(e){if(e!==Mt)return!1;if(!We)return Xp(e),We=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||fu(e.type,e.memoizedProps)),n=!n),n&&pt&&fa(e),Xp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));pt=by(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));pt=by(e)}else t===27?(t=pt,Ta(e.type)?(e=gu,gu=null,pt=e):pt=t):pt=Mt?jn(e.stateNode.nextSibling):null;return!0}function La(){pt=Mt=null,We=!1}function Zo(){var e=da;return e!==null&&(Wt===null?Wt=e:Wt.push.apply(Wt,e),da=null),e}function sr(e){da===null?da=[e]:da.push(e)}var Qo=C(null),Ba=null,Gn=null;function pa(e,t,n){pe(Qo,t._currentValue),t._currentValue=n}function Fn(e){e._currentValue=Qo.current,G(Qo)}function Jo(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function Po(e,t,n,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var c=i.dependencies;if(c!==null){var y=i.child;c=c.firstContext;e:for(;c!==null;){var j=c;c=i;for(var k=0;k<t.length;k++)if(j.context===t[k]){c.lanes|=n,j=c.alternate,j!==null&&(j.lanes|=n),Jo(c.return,n,e),l||(y=null);break e}c=j.next}}else if(i.tag===18){if(y=i.return,y===null)throw Error(u(341));y.lanes|=n,c=y.alternate,c!==null&&(c.lanes|=n),Jo(y,n,e),y=null}else y=i.child;if(y!==null)y.return=i;else for(y=i;y!==null;){if(y===e){y=null;break}if(i=y.sibling,i!==null){i.return=y.return,y=i;break}y=y.return}i=y}}function bl(e,t,n,l){e=null;for(var i=t,c=!1;i!==null;){if(!c){if((i.flags&524288)!==0)c=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var y=i.alternate;if(y===null)throw Error(u(387));if(y=y.memoizedProps,y!==null){var j=i.type;an(i.pendingProps.value,y.value)||(e!==null?e.push(j):e=[j])}}else if(i===ce.current){if(y=i.alternate,y===null)throw Error(u(387));y.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Mr):e=[Mr])}i=i.return}e!==null&&Po(t,e,n,l),t.flags|=262144}function mi(e){for(e=e.firstContext;e!==null;){if(!an(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ia(e){Ba=e,Gn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function qt(e){return Zp(Ba,e)}function hi(e,t){return Ba===null&&Ia(e),Zp(e,t)}function Zp(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Gn===null){if(e===null)throw Error(u(308));Gn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gn=Gn.next=t;return n}var Tv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Ev=a.unstable_scheduleCallback,Cv=a.unstable_NormalPriority,St={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Wo(){return{controller:new Tv,data:new Map,refCount:0}}function or(e){e.refCount--,e.refCount===0&&Ev(Cv,function(){e.controller.abort()})}var cr=null,ec=0,vl=0,Sl=null;function kv(e,t){if(cr===null){var n=cr=[];ec=0,vl=au(),Sl={status:"pending",value:void 0,then:function(l){n.push(l)}}}return ec++,t.then(Qp,Qp),t}function Qp(){if(--ec===0&&cr!==null){Sl!==null&&(Sl.status="fulfilled");var e=cr;cr=null,vl=0,Sl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _v(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(l.status="rejected",l.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),l}var Jp=O.S;O.S=function(e,t){Mh=Oe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&kv(e,t),Jp!==null&&Jp(e,t)};var Ya=C(null);function tc(){var e=Ya.current;return e!==null?e:ft.pooledCache}function yi(e,t){t===null?pe(Ya,Ya.current):pe(Ya,t.pool)}function Pp(){var e=tc();return e===null?null:{parent:St._currentValue,pool:e}}var jl=Error(u(460)),nc=Error(u(474)),gi=Error(u(542)),xi={then:function(){}};function Wp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function em(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ln,Ln),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,nm(e),e;default:if(typeof t.status=="string")t.then(Ln,Ln);else{if(e=ft,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=l}},function(l){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,nm(e),e}throw Fa=t,jl}}function Ga(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Fa=n,jl):n}}var Fa=null;function tm(){if(Fa===null)throw Error(u(459));var e=Fa;return Fa=null,e}function nm(e){if(e===jl||e===gi)throw Error(u(483))}var Al=null,ur=0;function bi(e){var t=ur;return ur+=1,Al===null&&(Al=[]),em(Al,e,t)}function dr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function vi(e,t){throw t.$$typeof===N?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function am(e){function t(L,D){if(e){var F=L.deletions;F===null?(L.deletions=[D],L.flags|=16):F.push(D)}}function n(L,D){if(!e)return null;for(;D!==null;)t(L,D),D=D.sibling;return null}function l(L){for(var D=new Map;L!==null;)L.key!==null?D.set(L.key,L):D.set(L.index,L),L=L.sibling;return D}function i(L,D){return L=In(L,D),L.index=0,L.sibling=null,L}function c(L,D,F){return L.index=F,e?(F=L.alternate,F!==null?(F=F.index,F<D?(L.flags|=67108866,D):F):(L.flags|=67108866,D)):(L.flags|=1048576,D)}function y(L){return e&&L.alternate===null&&(L.flags|=67108866),L}function j(L,D,F,re){return D===null||D.tag!==6?(D=Go(F,L.mode,re),D.return=L,D):(D=i(D,F),D.return=L,D)}function k(L,D,F,re){var Me=F.type;return Me===z?ae(L,D,F.props.children,re,F.key):D!==null&&(D.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===q&&Ga(Me)===D.type)?(D=i(D,F.props),dr(D,F),D.return=L,D):(D=fi(F.type,F.key,F.props,null,L.mode,re),dr(D,F),D.return=L,D)}function V(L,D,F,re){return D===null||D.tag!==4||D.stateNode.containerInfo!==F.containerInfo||D.stateNode.implementation!==F.implementation?(D=Fo(F,L.mode,re),D.return=L,D):(D=i(D,F.children||[]),D.return=L,D)}function ae(L,D,F,re,Me){return D===null||D.tag!==7?(D=Ha(F,L.mode,re,Me),D.return=L,D):(D=i(D,F),D.return=L,D)}function ie(L,D,F){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=Go(""+D,L.mode,F),D.return=L,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case _:return F=fi(D.type,D.key,D.props,null,L.mode,F),dr(F,D),F.return=L,F;case R:return D=Fo(D,L.mode,F),D.return=L,D;case q:return D=Ga(D),ie(L,D,F)}if(Ne(D)||se(D))return D=Ha(D,L.mode,F,null),D.return=L,D;if(typeof D.then=="function")return ie(L,bi(D),F);if(D.$$typeof===E)return ie(L,hi(L,D),F);vi(L,D)}return null}function X(L,D,F,re){var Me=D!==null?D.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return Me!==null?null:j(L,D,""+F,re);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case _:return F.key===Me?k(L,D,F,re):null;case R:return F.key===Me?V(L,D,F,re):null;case q:return F=Ga(F),X(L,D,F,re)}if(Ne(F)||se(F))return Me!==null?null:ae(L,D,F,re,null);if(typeof F.then=="function")return X(L,D,bi(F),re);if(F.$$typeof===E)return X(L,D,hi(L,F),re);vi(L,F)}return null}function Q(L,D,F,re,Me){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return L=L.get(F)||null,j(D,L,""+re,Me);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case _:return L=L.get(re.key===null?F:re.key)||null,k(D,L,re,Me);case R:return L=L.get(re.key===null?F:re.key)||null,V(D,L,re,Me);case q:return re=Ga(re),Q(L,D,F,re,Me)}if(Ne(re)||se(re))return L=L.get(F)||null,ae(D,L,re,Me,null);if(typeof re.then=="function")return Q(L,D,F,bi(re),Me);if(re.$$typeof===E)return Q(L,D,F,hi(D,re),Me);vi(D,re)}return null}function Te(L,D,F,re){for(var Me=null,tt=null,_e=D,Ve=D=0,Je=null;_e!==null&&Ve<F.length;Ve++){_e.index>Ve?(Je=_e,_e=null):Je=_e.sibling;var nt=X(L,_e,F[Ve],re);if(nt===null){_e===null&&(_e=Je);break}e&&_e&&nt.alternate===null&&t(L,_e),D=c(nt,D,Ve),tt===null?Me=nt:tt.sibling=nt,tt=nt,_e=Je}if(Ve===F.length)return n(L,_e),We&&Yn(L,Ve),Me;if(_e===null){for(;Ve<F.length;Ve++)_e=ie(L,F[Ve],re),_e!==null&&(D=c(_e,D,Ve),tt===null?Me=_e:tt.sibling=_e,tt=_e);return We&&Yn(L,Ve),Me}for(_e=l(_e);Ve<F.length;Ve++)Je=Q(_e,L,Ve,F[Ve],re),Je!==null&&(e&&Je.alternate!==null&&_e.delete(Je.key===null?Ve:Je.key),D=c(Je,D,Ve),tt===null?Me=Je:tt.sibling=Je,tt=Je);return e&&_e.forEach(function(Oa){return t(L,Oa)}),We&&Yn(L,Ve),Me}function De(L,D,F,re){if(F==null)throw Error(u(151));for(var Me=null,tt=null,_e=D,Ve=D=0,Je=null,nt=F.next();_e!==null&&!nt.done;Ve++,nt=F.next()){_e.index>Ve?(Je=_e,_e=null):Je=_e.sibling;var Oa=X(L,_e,nt.value,re);if(Oa===null){_e===null&&(_e=Je);break}e&&_e&&Oa.alternate===null&&t(L,_e),D=c(Oa,D,Ve),tt===null?Me=Oa:tt.sibling=Oa,tt=Oa,_e=Je}if(nt.done)return n(L,_e),We&&Yn(L,Ve),Me;if(_e===null){for(;!nt.done;Ve++,nt=F.next())nt=ie(L,nt.value,re),nt!==null&&(D=c(nt,D,Ve),tt===null?Me=nt:tt.sibling=nt,tt=nt);return We&&Yn(L,Ve),Me}for(_e=l(_e);!nt.done;Ve++,nt=F.next())nt=Q(_e,L,Ve,nt.value,re),nt!==null&&(e&&nt.alternate!==null&&_e.delete(nt.key===null?Ve:nt.key),D=c(nt,D,Ve),tt===null?Me=nt:tt.sibling=nt,tt=nt);return e&&_e.forEach(function(B1){return t(L,B1)}),We&&Yn(L,Ve),Me}function dt(L,D,F,re){if(typeof F=="object"&&F!==null&&F.type===z&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case _:e:{for(var Me=F.key;D!==null;){if(D.key===Me){if(Me=F.type,Me===z){if(D.tag===7){n(L,D.sibling),re=i(D,F.props.children),re.return=L,L=re;break e}}else if(D.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===q&&Ga(Me)===D.type){n(L,D.sibling),re=i(D,F.props),dr(re,F),re.return=L,L=re;break e}n(L,D);break}else t(L,D);D=D.sibling}F.type===z?(re=Ha(F.props.children,L.mode,re,F.key),re.return=L,L=re):(re=fi(F.type,F.key,F.props,null,L.mode,re),dr(re,F),re.return=L,L=re)}return y(L);case R:e:{for(Me=F.key;D!==null;){if(D.key===Me)if(D.tag===4&&D.stateNode.containerInfo===F.containerInfo&&D.stateNode.implementation===F.implementation){n(L,D.sibling),re=i(D,F.children||[]),re.return=L,L=re;break e}else{n(L,D);break}else t(L,D);D=D.sibling}re=Fo(F,L.mode,re),re.return=L,L=re}return y(L);case q:return F=Ga(F),dt(L,D,F,re)}if(Ne(F))return Te(L,D,F,re);if(se(F)){if(Me=se(F),typeof Me!="function")throw Error(u(150));return F=Me.call(F),De(L,D,F,re)}if(typeof F.then=="function")return dt(L,D,bi(F),re);if(F.$$typeof===E)return dt(L,D,hi(L,F),re);vi(L,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,D!==null&&D.tag===6?(n(L,D.sibling),re=i(D,F),re.return=L,L=re):(n(L,D),re=Go(F,L.mode,re),re.return=L,L=re),y(L)):n(L,D)}return function(L,D,F,re){try{ur=0;var Me=dt(L,D,F,re);return Al=null,Me}catch(_e){if(_e===jl||_e===gi)throw _e;var tt=ln(29,_e,null,L.mode);return tt.lanes=re,tt.return=L,tt}}}var Va=am(!0),lm=am(!1),ma=!1;function ac(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ya(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(lt&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=di(e),Bp(e,null,n),t}return ui(e,l,t,n),di(e)}function fr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Zf(e,n)}}function rc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var y={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?i=c=y:c=c.next=y,n=n.next}while(n!==null);c===null?i=c=t:c=c.next=t}else i=c=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:c,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var ic=!1;function pr(){if(ic){var e=Sl;if(e!==null)throw e}}function mr(e,t,n,l){ic=!1;var i=e.updateQueue;ma=!1;var c=i.firstBaseUpdate,y=i.lastBaseUpdate,j=i.shared.pending;if(j!==null){i.shared.pending=null;var k=j,V=k.next;k.next=null,y===null?c=V:y.next=V,y=k;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,j=ae.lastBaseUpdate,j!==y&&(j===null?ae.firstBaseUpdate=V:j.next=V,ae.lastBaseUpdate=k))}if(c!==null){var ie=i.baseState;y=0,ae=V=k=null,j=c;do{var X=j.lane&-536870913,Q=X!==j.lane;if(Q?(Qe&X)===X:(l&X)===X){X!==0&&X===vl&&(ic=!0),ae!==null&&(ae=ae.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var Te=e,De=j;X=t;var dt=n;switch(De.tag){case 1:if(Te=De.payload,typeof Te=="function"){ie=Te.call(dt,ie,X);break e}ie=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=De.payload,X=typeof Te=="function"?Te.call(dt,ie,X):Te,X==null)break e;ie=S({},ie,X);break e;case 2:ma=!0}}X=j.callback,X!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=i.callbacks,Q===null?i.callbacks=[X]:Q.push(X))}else Q={lane:X,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ae===null?(V=ae=Q,k=ie):ae=ae.next=Q,y|=X;if(j=j.next,j===null){if(j=i.shared.pending,j===null)break;Q=j,j=Q.next,Q.next=null,i.lastBaseUpdate=Q,i.shared.pending=null}}while(!0);ae===null&&(k=ie),i.baseState=k,i.firstBaseUpdate=V,i.lastBaseUpdate=ae,c===null&&(i.shared.lanes=0),Sa|=y,e.lanes=y,e.memoizedState=ie}}function rm(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function im(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)rm(n[e],t)}var Nl=C(null),Si=C(0);function sm(e,t){e=ea,pe(Si,e),pe(Nl,t),ea=e|t.baseLanes}function sc(){pe(Si,ea),pe(Nl,Nl.current)}function oc(){ea=Si.current,G(Nl),G(Si)}var rn=C(null),Sn=null;function ga(e){var t=e.alternate;pe(bt,bt.current&1),pe(rn,e),Sn===null&&(t===null||Nl.current!==null||t.memoizedState!==null)&&(Sn=e)}function cc(e){pe(bt,bt.current),pe(rn,e),Sn===null&&(Sn=e)}function om(e){e.tag===22?(pe(bt,bt.current),pe(rn,e),Sn===null&&(Sn=e)):xa()}function xa(){pe(bt,bt.current),pe(rn,rn.current)}function sn(e){G(rn),Sn===e&&(Sn=null),G(bt)}var bt=C(0);function ji(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||hu(n)||yu(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vn=0,Ge=null,ct=null,jt=null,Ai=!1,wl=!1,Ka=!1,Ni=0,hr=0,Tl=null,Ov=0;function gt(){throw Error(u(321))}function uc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!an(e[n],t[n]))return!1;return!0}function dc(e,t,n,l,i,c){return Vn=c,Ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Fm:Tc,Ka=!1,c=n(l,i),Ka=!1,wl&&(c=um(t,n,l,i)),cm(e),c}function cm(e){O.H=xr;var t=ct!==null&&ct.next!==null;if(Vn=0,jt=ct=Ge=null,Ai=!1,hr=0,Tl=null,t)throw Error(u(300));e===null||At||(e=e.dependencies,e!==null&&mi(e)&&(At=!0))}function um(e,t,n,l){Ge=e;var i=0;do{if(wl&&(Tl=null),hr=0,wl=!1,25<=i)throw Error(u(301));if(i+=1,jt=ct=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}O.H=Vm,c=t(n,l)}while(wl);return c}function Rv(){var e=O.H,t=e.useState()[0];return t=typeof t.then=="function"?yr(t):t,e=e.useState()[0],(ct!==null?ct.memoizedState:null)!==e&&(Ge.flags|=1024),t}function fc(){var e=Ni!==0;return Ni=0,e}function pc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function mc(e){if(Ai){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ai=!1}Vn=0,jt=ct=Ge=null,wl=!1,hr=Ni=0,Tl=null}function Gt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?Ge.memoizedState=jt=e:jt=jt.next=e,jt}function vt(){if(ct===null){var e=Ge.alternate;e=e!==null?e.memoizedState:null}else e=ct.next;var t=jt===null?Ge.memoizedState:jt.next;if(t!==null)jt=t,ct=e;else{if(e===null)throw Ge.alternate===null?Error(u(467)):Error(u(310));ct=e,e={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},jt===null?Ge.memoizedState=jt=e:jt=jt.next=e}return jt}function wi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yr(e){var t=hr;return hr+=1,Tl===null&&(Tl=[]),e=em(Tl,e,t),t=Ge,(jt===null?t.memoizedState:jt.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Fm:Tc),e}function Ti(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return yr(e);if(e.$$typeof===E)return qt(e)}throw Error(u(438,String(e)))}function hc(e){var t=null,n=Ge.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=Ge.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=wi(),Ge.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=Se;return t.index++,n}function Kn(e,t){return typeof t=="function"?t(e):t}function Ei(e){var t=vt();return yc(t,ct,e)}function yc(e,t,n){var l=e.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=n;var i=e.baseQueue,c=l.pending;if(c!==null){if(i!==null){var y=i.next;i.next=c.next,c.next=y}t.baseQueue=i=c,l.pending=null}if(c=e.baseState,i===null)e.memoizedState=c;else{t=i.next;var j=y=null,k=null,V=t,ae=!1;do{var ie=V.lane&-536870913;if(ie!==V.lane?(Qe&ie)===ie:(Vn&ie)===ie){var X=V.revertLane;if(X===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),ie===vl&&(ae=!0);else if((Vn&X)===X){V=V.next,X===vl&&(ae=!0);continue}else ie={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},k===null?(j=k=ie,y=c):k=k.next=ie,Ge.lanes|=X,Sa|=X;ie=V.action,Ka&&n(c,ie),c=V.hasEagerState?V.eagerState:n(c,ie)}else X={lane:ie,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},k===null?(j=k=X,y=c):k=k.next=X,Ge.lanes|=ie,Sa|=ie;V=V.next}while(V!==null&&V!==t);if(k===null?y=c:k.next=j,!an(c,e.memoizedState)&&(At=!0,ae&&(n=Sl,n!==null)))throw n;e.memoizedState=c,e.baseState=y,e.baseQueue=k,l.lastRenderedState=c}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function gc(e){var t=vt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,c=t.memoizedState;if(i!==null){n.pending=null;var y=i=i.next;do c=e(c,y.action),y=y.next;while(y!==i);an(c,t.memoizedState)||(At=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,l]}function dm(e,t,n){var l=Ge,i=vt(),c=We;if(c){if(n===void 0)throw Error(u(407));n=n()}else n=t();var y=!an((ct||i).memoizedState,n);if(y&&(i.memoizedState=n,At=!0),i=i.queue,vc(mm.bind(null,l,i,e),[e]),i.getSnapshot!==t||y||jt!==null&&jt.memoizedState.tag&1){if(l.flags|=2048,El(9,{destroy:void 0},pm.bind(null,l,i,n,t),null),ft===null)throw Error(u(349));c||(Vn&127)!==0||fm(l,t,n)}return n}function fm(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ge.updateQueue,t===null?(t=wi(),Ge.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function pm(e,t,n,l){t.value=n,t.getSnapshot=l,hm(t)&&ym(e)}function mm(e,t,n){return n(function(){hm(t)&&ym(e)})}function hm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!an(e,n)}catch{return!0}}function ym(e){var t=Ua(e,2);t!==null&&en(t,e,2)}function xc(e){var t=Gt();if(typeof e=="function"){var n=e;if(e=n(),Ka){A(!0);try{n()}finally{A(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:e},t}function gm(e,t,n,l){return e.baseState=n,yc(e,ct,typeof l=="function"?l:Kn)}function $v(e,t,n,l,i){if(_i(e))throw Error(u(485));if(e=t.action,e!==null){var c={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){c.listeners.push(y)}};O.T!==null?n(!0):c.isTransition=!1,l(c),n=t.pending,n===null?(c.next=t.pending=c,xm(t,c)):(c.next=n.next,t.pending=n.next=c)}}function xm(e,t){var n=t.action,l=t.payload,i=e.state;if(t.isTransition){var c=O.T,y={};O.T=y;try{var j=n(i,l),k=O.S;k!==null&&k(y,j),bm(e,t,j)}catch(V){bc(e,t,V)}finally{c!==null&&y.types!==null&&(c.types=y.types),O.T=c}}else try{c=n(i,l),bm(e,t,c)}catch(V){bc(e,t,V)}}function bm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){vm(e,t,l)},function(l){return bc(e,t,l)}):vm(e,t,n)}function vm(e,t,n){t.status="fulfilled",t.value=n,Sm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,xm(e,n)))}function bc(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Sm(t),t=t.next;while(t!==l)}e.action=null}function Sm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function jm(e,t){return t}function Am(e,t){if(We){var n=ft.formState;if(n!==null){e:{var l=Ge;if(We){if(pt){t:{for(var i=pt,c=vn;i.nodeType!==8;){if(!c){i=null;break t}if(i=jn(i.nextSibling),i===null){i=null;break t}}c=i.data,i=c==="F!"||c==="F"?i:null}if(i){pt=jn(i.nextSibling),l=i.data==="F!";break e}}fa(l)}l=!1}l&&(t=n[0])}}return n=Gt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jm,lastRenderedState:t},n.queue=l,n=Im.bind(null,Ge,l),l.dispatch=n,l=xc(!1),c=wc.bind(null,Ge,!1,l.queue),l=Gt(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,n=$v.bind(null,Ge,i,c,n),i.dispatch=n,l.memoizedState=e,[t,n,!1]}function Nm(e){var t=vt();return wm(t,ct,e)}function wm(e,t,n){if(t=yc(e,t,jm)[0],e=Ei(Kn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=yr(t)}catch(y){throw y===jl?gi:y}else l=t;t=vt();var i=t.queue,c=i.dispatch;return n!==t.memoizedState&&(Ge.flags|=2048,El(9,{destroy:void 0},Mv.bind(null,i,n),null)),[l,c,e]}function Mv(e,t){e.action=t}function Tm(e){var t=vt(),n=ct;if(n!==null)return wm(t,n,e);vt(),t=t.memoizedState,n=vt();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function El(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Ge.updateQueue,t===null&&(t=wi(),Ge.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function Em(){return vt().memoizedState}function Ci(e,t,n,l){var i=Gt();Ge.flags|=e,i.memoizedState=El(1|t,{destroy:void 0},n,l===void 0?null:l)}function ki(e,t,n,l){var i=vt();l=l===void 0?null:l;var c=i.memoizedState.inst;ct!==null&&l!==null&&uc(l,ct.memoizedState.deps)?i.memoizedState=El(t,c,n,l):(Ge.flags|=e,i.memoizedState=El(1|t,c,n,l))}function Cm(e,t){Ci(8390656,8,e,t)}function vc(e,t){ki(2048,8,e,t)}function qv(e){Ge.flags|=4;var t=Ge.updateQueue;if(t===null)t=wi(),Ge.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function km(e){var t=vt().memoizedState;return qv({ref:t,nextImpl:e}),function(){if((lt&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function _m(e,t){return ki(4,2,e,t)}function Om(e,t){return ki(4,4,e,t)}function Rm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function $m(e,t,n){n=n!=null?n.concat([e]):null,ki(4,4,Rm.bind(null,t,e),n)}function Sc(){}function Mm(e,t){var n=vt();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&uc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function qm(e,t){var n=vt();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&uc(t,l[1]))return l[0];if(l=e(),Ka){A(!0);try{e()}finally{A(!1)}}return n.memoizedState=[l,t],l}function jc(e,t,n){return n===void 0||(Vn&1073741824)!==0&&(Qe&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Dh(),Ge.lanes|=e,Sa|=e,n)}function Dm(e,t,n,l){return an(n,t)?n:Nl.current!==null?(e=jc(e,n,l),an(e,t)||(At=!0),e):(Vn&42)===0||(Vn&1073741824)!==0&&(Qe&261930)===0?(At=!0,e.memoizedState=n):(e=Dh(),Ge.lanes|=e,Sa|=e,t)}function zm(e,t,n,l,i){var c=ee.p;ee.p=c!==0&&8>c?c:8;var y=O.T,j={};O.T=j,wc(e,!1,t,n);try{var k=i(),V=O.S;if(V!==null&&V(j,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var ae=_v(k,l);gr(e,t,ae,un(e))}else gr(e,t,l,un(e))}catch(ie){gr(e,t,{then:function(){},status:"rejected",reason:ie},un())}finally{ee.p=c,y!==null&&j.types!==null&&(y.types=j.types),O.T=y}}function Dv(){}function Ac(e,t,n,l){if(e.tag!==5)throw Error(u(476));var i=Um(e).queue;zm(e,i,t,oe,n===null?Dv:function(){return Hm(e),n(l)})}function Um(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:oe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Hm(e){var t=Um(e);t.next===null&&(t=e.alternate.memoizedState),gr(e,t.next.queue,{},un())}function Nc(){return qt(Mr)}function Lm(){return vt().memoizedState}function Bm(){return vt().memoizedState}function zv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=un();e=ha(n);var l=ya(t,e,n);l!==null&&(en(l,t,n),fr(l,t,n)),t={cache:Wo()},e.payload=t;return}t=t.return}}function Uv(e,t,n){var l=un();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},_i(e)?Ym(t,n):(n=Io(e,t,n,l),n!==null&&(en(n,e,l),Gm(n,t,l)))}function Im(e,t,n){var l=un();gr(e,t,n,l)}function gr(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(_i(e))Ym(t,i);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var y=t.lastRenderedState,j=c(y,n);if(i.hasEagerState=!0,i.eagerState=j,an(j,y))return ui(e,t,i,0),ft===null&&ci(),!1}catch{}if(n=Io(e,t,i,l),n!==null)return en(n,e,l),Gm(n,t,l),!0}return!1}function wc(e,t,n,l){if(l={lane:2,revertLane:au(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},_i(e)){if(t)throw Error(u(479))}else t=Io(e,n,l,2),t!==null&&en(t,e,2)}function _i(e){var t=e.alternate;return e===Ge||t!==null&&t===Ge}function Ym(e,t){wl=Ai=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Gm(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Zf(e,n)}}var xr={readContext:qt,use:Ti,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};xr.useEffectEvent=gt;var Fm={readContext:qt,use:Ti,useCallback:function(e,t){return Gt().memoizedState=[e,t===void 0?null:t],e},useContext:qt,useEffect:Cm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ci(4194308,4,Rm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ci(4194308,4,e,t)},useInsertionEffect:function(e,t){Ci(4,2,e,t)},useMemo:function(e,t){var n=Gt();t=t===void 0?null:t;var l=e();if(Ka){A(!0);try{e()}finally{A(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Gt();if(n!==void 0){var i=n(t);if(Ka){A(!0);try{n(t)}finally{A(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=Uv.bind(null,Ge,e),[l.memoizedState,e]},useRef:function(e){var t=Gt();return e={current:e},t.memoizedState=e},useState:function(e){e=xc(e);var t=e.queue,n=Im.bind(null,Ge,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Sc,useDeferredValue:function(e,t){var n=Gt();return jc(n,e,t)},useTransition:function(){var e=xc(!1);return e=zm.bind(null,Ge,e.queue,!0,!1),Gt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Ge,i=Gt();if(We){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),ft===null)throw Error(u(349));(Qe&127)!==0||fm(l,t,n)}i.memoizedState=n;var c={value:n,getSnapshot:t};return i.queue=c,Cm(mm.bind(null,l,c,e),[e]),l.flags|=2048,El(9,{destroy:void 0},pm.bind(null,l,c,n,t),null),n},useId:function(){var e=Gt(),t=ft.identifierPrefix;if(We){var n=Mn,l=$n;n=(l&~(1<<32-I(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Ni++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Ov++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Nc,useFormState:Am,useActionState:Am,useOptimistic:function(e){var t=Gt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=wc.bind(null,Ge,!0,n),n.dispatch=t,[e,t]},useMemoCache:hc,useCacheRefresh:function(){return Gt().memoizedState=zv.bind(null,Ge)},useEffectEvent:function(e){var t=Gt(),n={impl:e};return t.memoizedState=n,function(){if((lt&2)!==0)throw Error(u(440));return n.impl.apply(void 0,arguments)}}},Tc={readContext:qt,use:Ti,useCallback:Mm,useContext:qt,useEffect:vc,useImperativeHandle:$m,useInsertionEffect:_m,useLayoutEffect:Om,useMemo:qm,useReducer:Ei,useRef:Em,useState:function(){return Ei(Kn)},useDebugValue:Sc,useDeferredValue:function(e,t){var n=vt();return Dm(n,ct.memoizedState,e,t)},useTransition:function(){var e=Ei(Kn)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:yr(e),t]},useSyncExternalStore:dm,useId:Lm,useHostTransitionStatus:Nc,useFormState:Nm,useActionState:Nm,useOptimistic:function(e,t){var n=vt();return gm(n,ct,e,t)},useMemoCache:hc,useCacheRefresh:Bm};Tc.useEffectEvent=km;var Vm={readContext:qt,use:Ti,useCallback:Mm,useContext:qt,useEffect:vc,useImperativeHandle:$m,useInsertionEffect:_m,useLayoutEffect:Om,useMemo:qm,useReducer:gc,useRef:Em,useState:function(){return gc(Kn)},useDebugValue:Sc,useDeferredValue:function(e,t){var n=vt();return ct===null?jc(n,e,t):Dm(n,ct.memoizedState,e,t)},useTransition:function(){var e=gc(Kn)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:yr(e),t]},useSyncExternalStore:dm,useId:Lm,useHostTransitionStatus:Nc,useFormState:Tm,useActionState:Tm,useOptimistic:function(e,t){var n=vt();return ct!==null?gm(n,ct,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:hc,useCacheRefresh:Bm};Vm.useEffectEvent=km;function Ec(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:S({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Cc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=un(),i=ha(l);i.payload=t,n!=null&&(i.callback=n),t=ya(e,i,l),t!==null&&(en(t,e,l),fr(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=un(),i=ha(l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ya(e,i,l),t!==null&&(en(t,e,l),fr(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=un(),l=ha(n);l.tag=2,t!=null&&(l.callback=t),t=ya(e,l,n),t!==null&&(en(t,e,n),fr(t,e,n))}};function Km(e,t,n,l,i,c,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,y):t.prototype&&t.prototype.isPureReactComponent?!lr(n,l)||!lr(i,c):!0}function Xm(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Cc.enqueueReplaceState(t,t.state,null)}function Xa(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=S({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function Zm(e){oi(e)}function Qm(e){console.error(e)}function Jm(e){oi(e)}function Oi(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Pm(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function kc(e,t,n){return n=ha(n),n.tag=3,n.payload={element:null},n.callback=function(){Oi(e,t)},n}function Wm(e){return e=ha(e),e.tag=3,e}function eh(e,t,n,l){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var c=l.value;e.payload=function(){return i(c)},e.callback=function(){Pm(t,n,l)}}var y=n.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){Pm(t,n,l),typeof i!="function"&&(ja===null?ja=new Set([this]):ja.add(this));var j=l.stack;this.componentDidCatch(l.value,{componentStack:j!==null?j:""})})}function Hv(e,t,n,l,i){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&bl(t,n,i,!0),n=rn.current,n!==null){switch(n.tag){case 31:case 13:return Sn===null?Yi():n.alternate===null&&xt===0&&(xt=3),n.flags&=-257,n.flags|=65536,n.lanes=i,l===xi?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),eu(e,l,i)),!1;case 22:return n.flags|=65536,l===xi?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),eu(e,l,i)),!1}throw Error(u(435,n.tag))}return eu(e,l,i),Yi(),!1}if(We)return t=rn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==Xo&&(e=Error(u(422),{cause:l}),sr(gn(e,n)))):(l!==Xo&&(t=Error(u(423),{cause:l}),sr(gn(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=gn(l,n),i=kc(e.stateNode,l,i),rc(e,i),xt!==4&&(xt=2)),!1;var c=Error(u(520),{cause:l});if(c=gn(c,n),Tr===null?Tr=[c]:Tr.push(c),xt!==4&&(xt=2),t===null)return!0;l=gn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=kc(n.stateNode,l,e),rc(n,e),!1;case 1:if(t=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(ja===null||!ja.has(c))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Wm(i),eh(i,e,n,l),rc(n,i),!1}n=n.return}while(n!==null);return!1}var _c=Error(u(461)),At=!1;function Dt(e,t,n,l){t.child=e===null?lm(t,null,n,l):Va(t,e.child,n,l)}function th(e,t,n,l,i){n=n.render;var c=t.ref;if("ref"in l){var y={};for(var j in l)j!=="ref"&&(y[j]=l[j])}else y=l;return Ia(t),l=dc(e,t,n,y,c,i),j=fc(),e!==null&&!At?(pc(e,t,i),Xn(e,t,i)):(We&&j&&Vo(t),t.flags|=1,Dt(e,t,l,i),t.child)}function nh(e,t,n,l,i){if(e===null){var c=n.type;return typeof c=="function"&&!Yo(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,ah(e,t,c,l,i)):(e=fi(n.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Uc(e,i)){var y=c.memoizedProps;if(n=n.compare,n=n!==null?n:lr,n(y,l)&&e.ref===t.ref)return Xn(e,t,i)}return t.flags|=1,e=In(c,l),e.ref=t.ref,e.return=t,t.child=e}function ah(e,t,n,l,i){if(e!==null){var c=e.memoizedProps;if(lr(c,l)&&e.ref===t.ref)if(At=!1,t.pendingProps=l=c,Uc(e,i))(e.flags&131072)!==0&&(At=!0);else return t.lanes=e.lanes,Xn(e,t,i)}return Oc(e,t,n,l,i)}function lh(e,t,n,l){var i=l.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|n:n,e!==null){for(l=t.child=e.child,i=0;l!==null;)i=i|l.lanes|l.childLanes,l=l.sibling;l=i&~c}else l=0,t.child=null;return rh(e,t,c,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&yi(t,c!==null?c.cachePool:null),c!==null?sm(t,c):sc(),om(t);else return l=t.lanes=536870912,rh(e,t,c!==null?c.baseLanes|n:n,n,l)}else c!==null?(yi(t,c.cachePool),sm(t,c),xa(),t.memoizedState=null):(e!==null&&yi(t,null),sc(),xa());return Dt(e,t,i,n),t.child}function br(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rh(e,t,n,l,i){var c=tc();return c=c===null?null:{parent:St._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&yi(t,null),sc(),om(t),e!==null&&bl(e,t,l,!0),t.childLanes=i,null}function Ri(e,t){return t=Mi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ih(e,t,n){return Va(t,e.child,null,n),e=Ri(t,t.pendingProps),e.flags|=2,sn(t),t.memoizedState=null,e}function Lv(e,t,n){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(We){if(l.mode==="hidden")return e=Ri(t,l),t.lanes=536870912,br(null,e);if(cc(t),(e=pt)?(e=xy(e,vn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ua!==null?{id:$n,overflow:Mn}:null,retryLane:536870912,hydrationErrors:null},n=Yp(e),n.return=t,t.child=n,Mt=t,pt=null)):e=null,e===null)throw fa(t);return t.lanes=536870912,null}return Ri(t,l)}var c=e.memoizedState;if(c!==null){var y=c.dehydrated;if(cc(t),i)if(t.flags&256)t.flags&=-257,t=ih(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(At||bl(e,t,n,!1),i=(n&e.childLanes)!==0,At||i){if(l=ft,l!==null&&(y=Qf(l,n),y!==0&&y!==c.retryLane))throw c.retryLane=y,Ua(e,y),en(l,e,y),_c;Yi(),t=ih(e,t,n)}else e=c.treeContext,pt=jn(y.nextSibling),Mt=t,We=!0,da=null,vn=!1,e!==null&&Vp(t,e),t=Ri(t,l),t.flags|=4096;return t}return e=In(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function $i(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(u(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Oc(e,t,n,l,i){return Ia(t),n=dc(e,t,n,l,void 0,i),l=fc(),e!==null&&!At?(pc(e,t,i),Xn(e,t,i)):(We&&l&&Vo(t),t.flags|=1,Dt(e,t,n,i),t.child)}function sh(e,t,n,l,i,c){return Ia(t),t.updateQueue=null,n=um(t,l,n,i),cm(e),l=fc(),e!==null&&!At?(pc(e,t,c),Xn(e,t,c)):(We&&l&&Vo(t),t.flags|=1,Dt(e,t,n,c),t.child)}function oh(e,t,n,l,i){if(Ia(t),t.stateNode===null){var c=hl,y=n.contextType;typeof y=="object"&&y!==null&&(c=qt(y)),c=new n(l,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Cc,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=l,c.state=t.memoizedState,c.refs={},ac(t),y=n.contextType,c.context=typeof y=="object"&&y!==null?qt(y):hl,c.state=t.memoizedState,y=n.getDerivedStateFromProps,typeof y=="function"&&(Ec(t,n,y,l),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(y=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),y!==c.state&&Cc.enqueueReplaceState(c,c.state,null),mr(t,l,c,i),pr(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){c=t.stateNode;var j=t.memoizedProps,k=Xa(n,j);c.props=k;var V=c.context,ae=n.contextType;y=hl,typeof ae=="object"&&ae!==null&&(y=qt(ae));var ie=n.getDerivedStateFromProps;ae=typeof ie=="function"||typeof c.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,ae||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(j||V!==y)&&Xm(t,c,l,y),ma=!1;var X=t.memoizedState;c.state=X,mr(t,l,c,i),pr(),V=t.memoizedState,j||X!==V||ma?(typeof ie=="function"&&(Ec(t,n,ie,l),V=t.memoizedState),(k=ma||Km(t,n,k,l,X,V,y))?(ae||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=V),c.props=l,c.state=V,c.context=y,l=k):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{c=t.stateNode,lc(e,t),y=t.memoizedProps,ae=Xa(n,y),c.props=ae,ie=t.pendingProps,X=c.context,V=n.contextType,k=hl,typeof V=="object"&&V!==null&&(k=qt(V)),j=n.getDerivedStateFromProps,(V=typeof j=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(y!==ie||X!==k)&&Xm(t,c,l,k),ma=!1,X=t.memoizedState,c.state=X,mr(t,l,c,i),pr();var Q=t.memoizedState;y!==ie||X!==Q||ma||e!==null&&e.dependencies!==null&&mi(e.dependencies)?(typeof j=="function"&&(Ec(t,n,j,l),Q=t.memoizedState),(ae=ma||Km(t,n,ae,l,X,Q,k)||e!==null&&e.dependencies!==null&&mi(e.dependencies))?(V||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(l,Q,k),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(l,Q,k)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||y===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=Q),c.props=l,c.state=Q,c.context=k,l=ae):(typeof c.componentDidUpdate!="function"||y===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),l=!1)}return c=l,$i(e,t),l=(t.flags&128)!==0,c||l?(c=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&l?(t.child=Va(t,e.child,null,i),t.child=Va(t,null,n,i)):Dt(e,t,n,i),t.memoizedState=c.state,e=t.child):e=Xn(e,t,i),e}function ch(e,t,n,l){return La(),t.flags|=256,Dt(e,t,n,l),t.child}var Rc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $c(e){return{baseLanes:e,cachePool:Pp()}}function Mc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=cn),e}function uh(e,t,n){var l=t.pendingProps,i=!1,c=(t.flags&128)!==0,y;if((y=c)||(y=e!==null&&e.memoizedState===null?!1:(bt.current&2)!==0),y&&(i=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(We){if(i?ga(t):xa(),(e=pt)?(e=xy(e,vn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ua!==null?{id:$n,overflow:Mn}:null,retryLane:536870912,hydrationErrors:null},n=Yp(e),n.return=t,t.child=n,Mt=t,pt=null)):e=null,e===null)throw fa(t);return yu(e)?t.lanes=32:t.lanes=536870912,null}var j=l.children;return l=l.fallback,i?(xa(),i=t.mode,j=Mi({mode:"hidden",children:j},i),l=Ha(l,i,n,null),j.return=t,l.return=t,j.sibling=l,t.child=j,l=t.child,l.memoizedState=$c(n),l.childLanes=Mc(e,y,n),t.memoizedState=Rc,br(null,l)):(ga(t),qc(t,j))}var k=e.memoizedState;if(k!==null&&(j=k.dehydrated,j!==null)){if(c)t.flags&256?(ga(t),t.flags&=-257,t=Dc(e,t,n)):t.memoizedState!==null?(xa(),t.child=e.child,t.flags|=128,t=null):(xa(),j=l.fallback,i=t.mode,l=Mi({mode:"visible",children:l.children},i),j=Ha(j,i,n,null),j.flags|=2,l.return=t,j.return=t,l.sibling=j,t.child=l,Va(t,e.child,null,n),l=t.child,l.memoizedState=$c(n),l.childLanes=Mc(e,y,n),t.memoizedState=Rc,t=br(null,l));else if(ga(t),yu(j)){if(y=j.nextSibling&&j.nextSibling.dataset,y)var V=y.dgst;y=V,l=Error(u(419)),l.stack="",l.digest=y,sr({value:l,source:null,stack:null}),t=Dc(e,t,n)}else if(At||bl(e,t,n,!1),y=(n&e.childLanes)!==0,At||y){if(y=ft,y!==null&&(l=Qf(y,n),l!==0&&l!==k.retryLane))throw k.retryLane=l,Ua(e,l),en(y,e,l),_c;hu(j)||Yi(),t=Dc(e,t,n)}else hu(j)?(t.flags|=192,t.child=e.child,t=null):(e=k.treeContext,pt=jn(j.nextSibling),Mt=t,We=!0,da=null,vn=!1,e!==null&&Vp(t,e),t=qc(t,l.children),t.flags|=4096);return t}return i?(xa(),j=l.fallback,i=t.mode,k=e.child,V=k.sibling,l=In(k,{mode:"hidden",children:l.children}),l.subtreeFlags=k.subtreeFlags&65011712,V!==null?j=In(V,j):(j=Ha(j,i,n,null),j.flags|=2),j.return=t,l.return=t,l.sibling=j,t.child=l,br(null,l),l=t.child,j=e.child.memoizedState,j===null?j=$c(n):(i=j.cachePool,i!==null?(k=St._currentValue,i=i.parent!==k?{parent:k,pool:k}:i):i=Pp(),j={baseLanes:j.baseLanes|n,cachePool:i}),l.memoizedState=j,l.childLanes=Mc(e,y,n),t.memoizedState=Rc,br(e.child,l)):(ga(t),n=e.child,e=n.sibling,n=In(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=n,t.memoizedState=null,n)}function qc(e,t){return t=Mi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Mi(e,t){return e=ln(22,e,null,t),e.lanes=0,e}function Dc(e,t,n){return Va(t,e.child,null,n),e=qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dh(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Jo(e.return,t,n)}function zc(e,t,n,l,i,c){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:i,treeForkCount:c}:(y.isBackwards=t,y.rendering=null,y.renderingStartTime=0,y.last=l,y.tail=n,y.tailMode=i,y.treeForkCount=c)}function fh(e,t,n){var l=t.pendingProps,i=l.revealOrder,c=l.tail;l=l.children;var y=bt.current,j=(y&2)!==0;if(j?(y=y&1|2,t.flags|=128):y&=1,pe(bt,y),Dt(e,t,l,n),l=We?ir:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dh(e,n,t);else if(e.tag===19)dh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ji(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),zc(t,!1,i,n,c,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ji(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}zc(t,!0,n,null,c,l);break;case"together":zc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function Xn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Sa|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(bl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=In(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=In(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Uc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&mi(e)))}function Bv(e,t,n){switch(t.tag){case 3:Ce(t,t.stateNode.containerInfo),pa(t,St,e.memoizedState.cache),La();break;case 27:case 5:Be(t);break;case 4:Ce(t,t.stateNode.containerInfo);break;case 10:pa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,cc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(ga(t),t.flags|=128,null):(n&t.child.childLanes)!==0?uh(e,t,n):(ga(t),e=Xn(e,t,n),e!==null?e.sibling:null);ga(t);break;case 19:var i=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(bl(e,t,n,!1),l=(n&t.childLanes)!==0),i){if(l)return fh(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),pe(bt,bt.current),l)break;return null;case 22:return t.lanes=0,lh(e,t,n,t.pendingProps);case 24:pa(t,St,e.memoizedState.cache)}return Xn(e,t,n)}function ph(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)At=!0;else{if(!Uc(e,n)&&(t.flags&128)===0)return At=!1,Bv(e,t,n);At=(e.flags&131072)!==0}else At=!1,We&&(t.flags&1048576)!==0&&Fp(t,ir,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Ga(t.elementType),t.type=e,typeof e=="function")Yo(e)?(l=Xa(e,l),t.tag=1,t=oh(null,t,e,l,n)):(t.tag=0,t=Oc(null,t,e,l,n));else{if(e!=null){var i=e.$$typeof;if(i===w){t.tag=11,t=th(null,t,e,l,n);break e}else if(i===$){t.tag=14,t=nh(null,t,e,l,n);break e}}throw t=xe(e)||e,Error(u(306,t,""))}}return t;case 0:return Oc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,i=Xa(l,t.pendingProps),oh(e,t,l,i,n);case 3:e:{if(Ce(t,t.stateNode.containerInfo),e===null)throw Error(u(387));l=t.pendingProps;var c=t.memoizedState;i=c.element,lc(e,t),mr(t,l,null,n);var y=t.memoizedState;if(l=y.cache,pa(t,St,l),l!==c.cache&&Po(t,[St],n,!0),pr(),l=y.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=ch(e,t,l,n);break e}else if(l!==i){i=gn(Error(u(424)),t),sr(i),t=ch(e,t,l,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,pt=jn(e.firstChild),Mt=t,We=!0,da=null,vn=!0,n=lm(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(La(),l===i){t=Xn(e,t,n);break e}Dt(e,t,l,n)}t=t.child}return t;case 26:return $i(e,t),e===null?(n=Ny(t.type,null,t.pendingProps,null))?t.memoizedState=n:We||(n=t.type,e=t.pendingProps,l=Qi(Ee.current).createElement(n),l[$t]=t,l[Xt]=e,zt(l,n,e),Et(l),t.stateNode=l):t.memoizedState=Ny(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Be(t),e===null&&We&&(l=t.stateNode=Sy(t.type,t.pendingProps,Ee.current),Mt=t,vn=!0,i=pt,Ta(t.type)?(gu=i,pt=jn(l.firstChild)):pt=i),Dt(e,t,t.pendingProps.children,n),$i(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&We&&((i=l=pt)&&(l=g1(l,t.type,t.pendingProps,vn),l!==null?(t.stateNode=l,Mt=t,pt=jn(l.firstChild),vn=!1,i=!0):i=!1),i||fa(t)),Be(t),i=t.type,c=t.pendingProps,y=e!==null?e.memoizedProps:null,l=c.children,fu(i,c)?l=null:y!==null&&fu(i,y)&&(t.flags|=32),t.memoizedState!==null&&(i=dc(e,t,Rv,null,null,n),Mr._currentValue=i),$i(e,t),Dt(e,t,l,n),t.child;case 6:return e===null&&We&&((e=n=pt)&&(n=x1(n,t.pendingProps,vn),n!==null?(t.stateNode=n,Mt=t,pt=null,e=!0):e=!1),e||fa(t)),null;case 13:return uh(e,t,n);case 4:return Ce(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Va(t,null,l,n):Dt(e,t,l,n),t.child;case 11:return th(e,t,t.type,t.pendingProps,n);case 7:return Dt(e,t,t.pendingProps,n),t.child;case 8:return Dt(e,t,t.pendingProps.children,n),t.child;case 12:return Dt(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,pa(t,t.type,l.value),Dt(e,t,l.children,n),t.child;case 9:return i=t.type._context,l=t.pendingProps.children,Ia(t),i=qt(i),l=l(i),t.flags|=1,Dt(e,t,l,n),t.child;case 14:return nh(e,t,t.type,t.pendingProps,n);case 15:return ah(e,t,t.type,t.pendingProps,n);case 19:return fh(e,t,n);case 31:return Lv(e,t,n);case 22:return lh(e,t,n,t.pendingProps);case 24:return Ia(t),l=qt(St),e===null?(i=tc(),i===null&&(i=ft,c=Wo(),i.pooledCache=c,c.refCount++,c!==null&&(i.pooledCacheLanes|=n),i=c),t.memoizedState={parent:l,cache:i},ac(t),pa(t,St,i)):((e.lanes&n)!==0&&(lc(e,t),mr(t,null,null,n),pr()),i=e.memoizedState,c=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),pa(t,St,l)):(l=c.cache,pa(t,St,l),l!==i.cache&&Po(t,[St],n,!0))),Dt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function Zn(e){e.flags|=4}function Hc(e,t,n,l,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Lh())e.flags|=8192;else throw Fa=xi,nc}else e.flags&=-16777217}function mh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ky(t))if(Lh())e.flags|=8192;else throw Fa=xi,nc}function qi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Tn():536870912,e.lanes|=t,Ol|=t)}function vr(e,t){if(!We)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags&65011712,l|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags,l|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Iv(e,t,n){var l=t.pendingProps;switch(Ko(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(t),null;case 1:return mt(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Fn(St),Le(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(xl(t)?Zn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Zo())),mt(t),null;case 26:var i=t.type,c=t.memoizedState;return e===null?(Zn(t),c!==null?(mt(t),mh(t,c)):(mt(t),Hc(t,i,null,l,n))):c?c!==e.memoizedState?(Zn(t),mt(t),mh(t,c)):(mt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Zn(t),mt(t),Hc(t,i,e,l,n)),null;case 27:if(rt(t),n=Ee.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Zn(t);else{if(!l){if(t.stateNode===null)throw Error(u(166));return mt(t),null}e=de.current,xl(t)?Kp(t):(e=Sy(i,l,n),t.stateNode=e,Zn(t))}return mt(t),null;case 5:if(rt(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Zn(t);else{if(!l){if(t.stateNode===null)throw Error(u(166));return mt(t),null}if(c=de.current,xl(t))Kp(t);else{var y=Qi(Ee.current);switch(c){case 1:c=y.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:c=y.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":c=y.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":c=y.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":c=y.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof l.is=="string"?y.createElement("select",{is:l.is}):y.createElement("select"),l.multiple?c.multiple=!0:l.size&&(c.size=l.size);break;default:c=typeof l.is=="string"?y.createElement(i,{is:l.is}):y.createElement(i)}}c[$t]=t,c[Xt]=l;e:for(y=t.child;y!==null;){if(y.tag===5||y.tag===6)c.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===t)break e;for(;y.sibling===null;){if(y.return===null||y.return===t)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}t.stateNode=c;e:switch(zt(c,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Zn(t)}}return mt(t),Hc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Zn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(u(166));if(e=Ee.current,xl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=Mt,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[$t]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||uy(e.nodeValue,n)),e||fa(t,!0)}else e=Qi(e).createTextNode(l),e[$t]=t,t.stateNode=e}return mt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=xl(t),n!==null){if(e===null){if(!l)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[$t]=t}else La(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),e=!1}else n=Zo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(sn(t),t):(sn(t),null);if((t.flags&128)!==0)throw Error(u(558))}return mt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=xl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(u(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(u(317));i[$t]=t}else La(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),i=!1}else i=Zo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(sn(t),t):(sn(t),null)}return sn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),c=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(c=l.memoizedState.cachePool.pool),c!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),qi(t,t.updateQueue),mt(t),null);case 4:return Le(),e===null&&su(t.stateNode.containerInfo),mt(t),null;case 10:return Fn(t.type),mt(t),null;case 19:if(G(bt),l=t.memoizedState,l===null)return mt(t),null;if(i=(t.flags&128)!==0,c=l.rendering,c===null)if(i)vr(l,!1);else{if(xt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=ji(e),c!==null){for(t.flags|=128,vr(l,!1),e=c.updateQueue,t.updateQueue=e,qi(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ip(n,e),n=n.sibling;return pe(bt,bt.current&1|2),We&&Yn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Oe()>Li&&(t.flags|=128,i=!0,vr(l,!1),t.lanes=4194304)}else{if(!i)if(e=ji(c),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,qi(t,e),vr(l,!0),l.tail===null&&l.tailMode==="hidden"&&!c.alternate&&!We)return mt(t),null}else 2*Oe()-l.renderingStartTime>Li&&n!==536870912&&(t.flags|=128,i=!0,vr(l,!1),t.lanes=4194304);l.isBackwards?(c.sibling=t.child,t.child=c):(e=l.last,e!==null?e.sibling=c:t.child=c,l.last=c)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Oe(),e.sibling=null,n=bt.current,pe(bt,i?n&1|2:n&1),We&&Yn(t,l.treeForkCount),e):(mt(t),null);case 22:case 23:return sn(t),oc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),n=t.updateQueue,n!==null&&qi(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&G(Ya),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Fn(St),mt(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Yv(e,t){switch(Ko(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fn(St),Le(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return rt(t),null;case 31:if(t.memoizedState!==null){if(sn(t),t.alternate===null)throw Error(u(340));La()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(sn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));La()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(bt),null;case 4:return Le(),null;case 10:return Fn(t.type),null;case 22:case 23:return sn(t),oc(),e!==null&&G(Ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Fn(St),null;case 25:return null;default:return null}}function hh(e,t){switch(Ko(t),t.tag){case 3:Fn(St),Le();break;case 26:case 27:case 5:rt(t);break;case 4:Le();break;case 31:t.memoizedState!==null&&sn(t);break;case 13:sn(t);break;case 19:G(bt);break;case 10:Fn(t.type);break;case 22:case 23:sn(t),oc(),e!==null&&G(Ya);break;case 24:Fn(St)}}function Sr(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){l=void 0;var c=n.create,y=n.inst;l=c(),y.destroy=l}n=n.next}while(n!==i)}}catch(j){ot(t,t.return,j)}}function ba(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var c=i.next;l=c;do{if((l.tag&e)===e){var y=l.inst,j=y.destroy;if(j!==void 0){y.destroy=void 0,i=t;var k=n,V=j;try{V()}catch(ae){ot(i,k,ae)}}}l=l.next}while(l!==c)}}catch(ae){ot(t,t.return,ae)}}function yh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{im(t,n)}catch(l){ot(e,e.return,l)}}}function gh(e,t,n){n.props=Xa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){ot(e,t,l)}}function jr(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(i){ot(e,t,i)}}function qn(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){ot(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){ot(e,t,i)}else n.current=null}function xh(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(i){ot(e,e.return,i)}}function Lc(e,t,n){try{var l=e.stateNode;d1(l,e.type,n,t),l[Xt]=t}catch(i){ot(e,e.return,i)}}function bh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ta(e.type)||e.tag===4}function Bc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ta(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ic(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ln));else if(l!==4&&(l===27&&Ta(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Ic(e,t,n),e=e.sibling;e!==null;)Ic(e,t,n),e=e.sibling}function Di(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&Ta(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Di(e,t,n),e=e.sibling;e!==null;)Di(e,t,n),e=e.sibling}function vh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zt(t,l,n),t[$t]=e,t[Xt]=n}catch(c){ot(e,e.return,c)}}var Qn=!1,Nt=!1,Yc=!1,Sh=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function Gv(e,t){if(e=e.containerInfo,uu=as,e=$p(e),Do(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var i=l.anchorOffset,c=l.focusNode;l=l.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var y=0,j=-1,k=-1,V=0,ae=0,ie=e,X=null;t:for(;;){for(var Q;ie!==n||i!==0&&ie.nodeType!==3||(j=y+i),ie!==c||l!==0&&ie.nodeType!==3||(k=y+l),ie.nodeType===3&&(y+=ie.nodeValue.length),(Q=ie.firstChild)!==null;)X=ie,ie=Q;for(;;){if(ie===e)break t;if(X===n&&++V===i&&(j=y),X===c&&++ae===l&&(k=y),(Q=ie.nextSibling)!==null)break;ie=X,X=ie.parentNode}ie=Q}n=j===-1||k===-1?null:{start:j,end:k}}else n=null}n=n||{start:0,end:0}}else n=null;for(du={focusedElem:e,selectionRange:n},as=!1,Ct=t;Ct!==null;)if(t=Ct,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ct=e;else for(;Ct!==null;){switch(t=Ct,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,n=t,i=c.memoizedProps,c=c.memoizedState,l=n.stateNode;try{var Te=Xa(n.type,i);e=l.getSnapshotBeforeUpdate(Te,c),l.__reactInternalSnapshotBeforeUpdate=e}catch(De){ot(n,n.return,De)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)mu(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":mu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,Ct=e;break}Ct=t.return}}function jh(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:Pn(e,n),l&4&&Sr(5,n);break;case 1:if(Pn(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(y){ot(n,n.return,y)}else{var i=Xa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){ot(n,n.return,y)}}l&64&&yh(n),l&512&&jr(n,n.return);break;case 3:if(Pn(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{im(e,t)}catch(y){ot(n,n.return,y)}}break;case 27:t===null&&l&4&&vh(n);case 26:case 5:Pn(e,n),t===null&&l&4&&xh(n),l&512&&jr(n,n.return);break;case 12:Pn(e,n);break;case 31:Pn(e,n),l&4&&wh(e,n);break;case 13:Pn(e,n),l&4&&Th(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Wv.bind(null,n),b1(e,n))));break;case 22:if(l=n.memoizedState!==null||Qn,!l){t=t!==null&&t.memoizedState!==null||Nt,i=Qn;var c=Nt;Qn=l,(Nt=t)&&!c?Wn(e,n,(n.subtreeFlags&8772)!==0):Pn(e,n),Qn=i,Nt=c}break;case 30:break;default:Pn(e,n)}}function Ah(e){var t=e.alternate;t!==null&&(e.alternate=null,Ah(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&bo(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ht=null,Qt=!1;function Jn(e,t,n){for(n=n.child;n!==null;)Nh(e,t,n),n=n.sibling}function Nh(e,t,n){if(h&&typeof h.onCommitFiberUnmount=="function")try{h.onCommitFiberUnmount(Z,n)}catch{}switch(n.tag){case 26:Nt||qn(n,t),Jn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Nt||qn(n,t);var l=ht,i=Qt;Ta(n.type)&&(ht=n.stateNode,Qt=!1),Jn(e,t,n),Or(n.stateNode),ht=l,Qt=i;break;case 5:Nt||qn(n,t);case 6:if(l=ht,i=Qt,ht=null,Jn(e,t,n),ht=l,Qt=i,ht!==null)if(Qt)try{(ht.nodeType===9?ht.body:ht.nodeName==="HTML"?ht.ownerDocument.body:ht).removeChild(n.stateNode)}catch(c){ot(n,t,c)}else try{ht.removeChild(n.stateNode)}catch(c){ot(n,t,c)}break;case 18:ht!==null&&(Qt?(e=ht,yy(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Hl(e)):yy(ht,n.stateNode));break;case 4:l=ht,i=Qt,ht=n.stateNode.containerInfo,Qt=!0,Jn(e,t,n),ht=l,Qt=i;break;case 0:case 11:case 14:case 15:ba(2,n,t),Nt||ba(4,n,t),Jn(e,t,n);break;case 1:Nt||(qn(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&gh(n,t,l)),Jn(e,t,n);break;case 21:Jn(e,t,n);break;case 22:Nt=(l=Nt)||n.memoizedState!==null,Jn(e,t,n),Nt=l;break;default:Jn(e,t,n)}}function wh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hl(e)}catch(n){ot(t,t.return,n)}}}function Th(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hl(e)}catch(n){ot(t,t.return,n)}}function Fv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Sh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Sh),t;default:throw Error(u(435,e.tag))}}function zi(e,t){var n=Fv(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var i=e1.bind(null,e,l);l.then(i,i)}})}function Jt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var i=n[l],c=e,y=t,j=y;e:for(;j!==null;){switch(j.tag){case 27:if(Ta(j.type)){ht=j.stateNode,Qt=!1;break e}break;case 5:ht=j.stateNode,Qt=!1;break e;case 3:case 4:ht=j.stateNode.containerInfo,Qt=!0;break e}j=j.return}if(ht===null)throw Error(u(160));Nh(c,y,i),ht=null,Qt=!1,c=i.alternate,c!==null&&(c.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Eh(t,e),t=t.sibling}var kn=null;function Eh(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Jt(t,e),Pt(e),l&4&&(ba(3,e,e.return),Sr(3,e),ba(5,e,e.return));break;case 1:Jt(t,e),Pt(e),l&512&&(Nt||n===null||qn(n,n.return)),l&64&&Qn&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var i=kn;if(Jt(t,e),Pt(e),l&512&&(Nt||n===null||qn(n,n.return)),l&4){var c=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(l){case"title":c=i.getElementsByTagName("title")[0],(!c||c[Zl]||c[$t]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=i.createElement(l),i.head.insertBefore(c,i.querySelector("head > title"))),zt(c,l,n),c[$t]=e,Et(c),l=c;break e;case"link":var y=Ey("link","href",i).get(l+(n.href||""));if(y){for(var j=0;j<y.length;j++)if(c=y[j],c.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&c.getAttribute("rel")===(n.rel==null?null:n.rel)&&c.getAttribute("title")===(n.title==null?null:n.title)&&c.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){y.splice(j,1);break t}}c=i.createElement(l),zt(c,l,n),i.head.appendChild(c);break;case"meta":if(y=Ey("meta","content",i).get(l+(n.content||""))){for(j=0;j<y.length;j++)if(c=y[j],c.getAttribute("content")===(n.content==null?null:""+n.content)&&c.getAttribute("name")===(n.name==null?null:n.name)&&c.getAttribute("property")===(n.property==null?null:n.property)&&c.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&c.getAttribute("charset")===(n.charSet==null?null:n.charSet)){y.splice(j,1);break t}}c=i.createElement(l),zt(c,l,n),i.head.appendChild(c);break;default:throw Error(u(468,l))}c[$t]=e,Et(c),l=c}e.stateNode=l}else Cy(i,e.type,e.stateNode);else e.stateNode=Ty(i,l,e.memoizedProps);else c!==l?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,l===null?Cy(i,e.type,e.stateNode):Ty(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Lc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Jt(t,e),Pt(e),l&512&&(Nt||n===null||qn(n,n.return)),n!==null&&l&4&&Lc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Jt(t,e),Pt(e),l&512&&(Nt||n===null||qn(n,n.return)),e.flags&32){i=e.stateNode;try{ol(i,"")}catch(Te){ot(e,e.return,Te)}}l&4&&e.stateNode!=null&&(i=e.memoizedProps,Lc(e,i,n!==null?n.memoizedProps:i)),l&1024&&(Yc=!0);break;case 6:if(Jt(t,e),Pt(e),l&4){if(e.stateNode===null)throw Error(u(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(Te){ot(e,e.return,Te)}}break;case 3:if(Wi=null,i=kn,kn=Ji(t.containerInfo),Jt(t,e),kn=i,Pt(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Hl(t.containerInfo)}catch(Te){ot(e,e.return,Te)}Yc&&(Yc=!1,Ch(e));break;case 4:l=kn,kn=Ji(e.stateNode.containerInfo),Jt(t,e),Pt(e),kn=l;break;case 12:Jt(t,e),Pt(e);break;case 31:Jt(t,e),Pt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,zi(e,l)));break;case 13:Jt(t,e),Pt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Hi=Oe()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,zi(e,l)));break;case 22:i=e.memoizedState!==null;var k=n!==null&&n.memoizedState!==null,V=Qn,ae=Nt;if(Qn=V||i,Nt=ae||k,Jt(t,e),Nt=ae,Qn=V,Pt(e),l&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||k||Qn||Nt||Za(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){k=n=t;try{if(c=k.stateNode,i)y=c.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{j=k.stateNode;var ie=k.memoizedProps.style,X=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;j.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(Te){ot(k,k.return,Te)}}}else if(t.tag===6){if(n===null){k=t;try{k.stateNode.nodeValue=i?"":k.memoizedProps}catch(Te){ot(k,k.return,Te)}}}else if(t.tag===18){if(n===null){k=t;try{var Q=k.stateNode;i?gy(Q,!0):gy(k.stateNode,!1)}catch(Te){ot(k,k.return,Te)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,zi(e,n))));break;case 19:Jt(t,e),Pt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,zi(e,l)));break;case 30:break;case 21:break;default:Jt(t,e),Pt(e)}}function Pt(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(bh(l)){n=l;break}l=l.return}if(n==null)throw Error(u(160));switch(n.tag){case 27:var i=n.stateNode,c=Bc(e);Di(e,c,i);break;case 5:var y=n.stateNode;n.flags&32&&(ol(y,""),n.flags&=-33);var j=Bc(e);Di(e,j,y);break;case 3:case 4:var k=n.stateNode.containerInfo,V=Bc(e);Ic(e,V,k);break;default:throw Error(u(161))}}catch(ae){ot(e,e.return,ae)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ch(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ch(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Pn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)jh(e,t.alternate,t),t=t.sibling}function Za(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ba(4,t,t.return),Za(t);break;case 1:qn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&gh(t,t.return,n),Za(t);break;case 27:Or(t.stateNode);case 26:case 5:qn(t,t.return),Za(t);break;case 22:t.memoizedState===null&&Za(t);break;case 30:Za(t);break;default:Za(t)}e=e.sibling}}function Wn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,i=e,c=t,y=c.flags;switch(c.tag){case 0:case 11:case 15:Wn(i,c,n),Sr(4,c);break;case 1:if(Wn(i,c,n),l=c,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(V){ot(l,l.return,V)}if(l=c,i=l.updateQueue,i!==null){var j=l.stateNode;try{var k=i.shared.hiddenCallbacks;if(k!==null)for(i.shared.hiddenCallbacks=null,i=0;i<k.length;i++)rm(k[i],j)}catch(V){ot(l,l.return,V)}}n&&y&64&&yh(c),jr(c,c.return);break;case 27:vh(c);case 26:case 5:Wn(i,c,n),n&&l===null&&y&4&&xh(c),jr(c,c.return);break;case 12:Wn(i,c,n);break;case 31:Wn(i,c,n),n&&y&4&&wh(i,c);break;case 13:Wn(i,c,n),n&&y&4&&Th(i,c);break;case 22:c.memoizedState===null&&Wn(i,c,n),jr(c,c.return);break;case 30:break;default:Wn(i,c,n)}t=t.sibling}}function Gc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&or(n))}function Fc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&or(e))}function _n(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)kh(e,t,n,l),t=t.sibling}function kh(e,t,n,l){var i=t.flags;switch(t.tag){case 0:case 11:case 15:_n(e,t,n,l),i&2048&&Sr(9,t);break;case 1:_n(e,t,n,l);break;case 3:_n(e,t,n,l),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&or(e)));break;case 12:if(i&2048){_n(e,t,n,l),e=t.stateNode;try{var c=t.memoizedProps,y=c.id,j=c.onPostCommit;typeof j=="function"&&j(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){ot(t,t.return,k)}}else _n(e,t,n,l);break;case 31:_n(e,t,n,l);break;case 13:_n(e,t,n,l);break;case 23:break;case 22:c=t.stateNode,y=t.alternate,t.memoizedState!==null?c._visibility&2?_n(e,t,n,l):Ar(e,t):c._visibility&2?_n(e,t,n,l):(c._visibility|=2,Cl(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Gc(y,t);break;case 24:_n(e,t,n,l),i&2048&&Fc(t.alternate,t);break;default:_n(e,t,n,l)}}function Cl(e,t,n,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,y=t,j=n,k=l,V=y.flags;switch(y.tag){case 0:case 11:case 15:Cl(c,y,j,k,i),Sr(8,y);break;case 23:break;case 22:var ae=y.stateNode;y.memoizedState!==null?ae._visibility&2?Cl(c,y,j,k,i):Ar(c,y):(ae._visibility|=2,Cl(c,y,j,k,i)),i&&V&2048&&Gc(y.alternate,y);break;case 24:Cl(c,y,j,k,i),i&&V&2048&&Fc(y.alternate,y);break;default:Cl(c,y,j,k,i)}t=t.sibling}}function Ar(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,i=l.flags;switch(l.tag){case 22:Ar(n,l),i&2048&&Gc(l.alternate,l);break;case 24:Ar(n,l),i&2048&&Fc(l.alternate,l);break;default:Ar(n,l)}t=t.sibling}}var Nr=8192;function kl(e,t,n){if(e.subtreeFlags&Nr)for(e=e.child;e!==null;)_h(e,t,n),e=e.sibling}function _h(e,t,n){switch(e.tag){case 26:kl(e,t,n),e.flags&Nr&&e.memoizedState!==null&&O1(n,kn,e.memoizedState,e.memoizedProps);break;case 5:kl(e,t,n);break;case 3:case 4:var l=kn;kn=Ji(e.stateNode.containerInfo),kl(e,t,n),kn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Nr,Nr=16777216,kl(e,t,n),Nr=l):kl(e,t,n));break;default:kl(e,t,n)}}function Oh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function wr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Ct=l,$h(l,e)}Oh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Rh(e),e=e.sibling}function Rh(e){switch(e.tag){case 0:case 11:case 15:wr(e),e.flags&2048&&ba(9,e,e.return);break;case 3:wr(e);break;case 12:wr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ui(e)):wr(e);break;default:wr(e)}}function Ui(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Ct=l,$h(l,e)}Oh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ba(8,t,t.return),Ui(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ui(t));break;default:Ui(t)}e=e.sibling}}function $h(e,t){for(;Ct!==null;){var n=Ct;switch(n.tag){case 0:case 11:case 15:ba(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:or(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Ct=l;else e:for(n=e;Ct!==null;){l=Ct;var i=l.sibling,c=l.return;if(Ah(l),l===n){Ct=null;break e}if(i!==null){i.return=c,Ct=i;break e}Ct=c}}}var Vv={getCacheForType:function(e){var t=qt(St),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return qt(St).controller.signal}},Kv=typeof WeakMap=="function"?WeakMap:Map,lt=0,ft=null,Xe=null,Qe=0,st=0,on=null,va=!1,_l=!1,Vc=!1,ea=0,xt=0,Sa=0,Qa=0,Kc=0,cn=0,Ol=0,Tr=null,Wt=null,Xc=!1,Hi=0,Mh=0,Li=1/0,Bi=null,ja=null,Tt=0,Aa=null,Rl=null,ta=0,Zc=0,Qc=null,qh=null,Er=0,Jc=null;function un(){return(lt&2)!==0&&Qe!==0?Qe&-Qe:O.T!==null?au():Jf()}function Dh(){if(cn===0)if((Qe&536870912)===0||We){var e=ye;ye<<=1,(ye&3932160)===0&&(ye=262144),cn=e}else cn=536870912;return e=rn.current,e!==null&&(e.flags|=32),cn}function en(e,t,n){(e===ft&&(st===2||st===9)||e.cancelPendingCommit!==null)&&($l(e,0),Na(e,Qe,cn,!1)),En(e,n),((lt&2)===0||e!==ft)&&(e===ft&&((lt&2)===0&&(Qa|=n),xt===4&&Na(e,Qe,cn,!1)),Dn(e))}function zh(e,t,n){if((lt&6)!==0)throw Error(u(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ue(e,t),i=l?Qv(e,t):Wc(e,t,!0),c=l;do{if(i===0){_l&&!l&&Na(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!Xv(n)){i=Wc(e,t,!1),c=!1;continue}if(i===2){if(c=t,e.errorRecoveryDisabledLanes&c)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var j=e;i=Tr;var k=j.current.memoizedState.isDehydrated;if(k&&($l(j,y).flags|=256),y=Wc(j,y,!1),y!==2){if(Vc&&!k){j.errorRecoveryDisabledLanes|=c,Qa|=c,i=4;break e}c=Wt,Wt=i,c!==null&&(Wt===null?Wt=c:Wt.push.apply(Wt,c))}i=y}if(c=!1,i!==2)continue}}if(i===1){$l(e,0),Na(e,t,0,!0);break}e:{switch(l=e,c=i,c){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Na(l,t,cn,!va);break e;case 2:Wt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(i=Hi+300-Oe(),10<i)){if(Na(l,t,cn,!va),$e(l,0,!0)!==0)break e;ta=t,l.timeoutHandle=my(Uh.bind(null,l,n,Wt,Bi,Xc,t,cn,Qa,Ol,va,c,"Throttled",-0,0),i);break e}Uh(l,n,Wt,Bi,Xc,t,cn,Qa,Ol,va,c,null,-0,0)}}break}while(!0);Dn(e)}function Uh(e,t,n,l,i,c,y,j,k,V,ae,ie,X,Q){if(e.timeoutHandle=-1,ie=t.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ln},_h(t,c,ie);var Te=(c&62914560)===c?Hi-Oe():(c&4194048)===c?Mh-Oe():0;if(Te=R1(ie,Te),Te!==null){ta=c,e.cancelPendingCommit=Te(Vh.bind(null,e,t,c,n,l,i,y,j,k,ae,ie,null,X,Q)),Na(e,c,y,!V);return}}Vh(e,t,c,n,l,i,y,j,k)}function Xv(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var i=n[l],c=i.getSnapshot;i=i.value;try{if(!an(c(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Na(e,t,n,l){t&=~Kc,t&=~Qa,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var c=31-I(i),y=1<<c;l[c]=-1,i&=~y}n!==0&&Xf(e,n,t)}function Ii(){return(lt&6)===0?(Cr(0),!1):!0}function Pc(){if(Xe!==null){if(st===0)var e=Xe.return;else e=Xe,Gn=Ba=null,mc(e),Al=null,ur=0,e=Xe;for(;e!==null;)hh(e.alternate,e),e=e.return;Xe=null}}function $l(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,m1(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ta=0,Pc(),ft=e,Xe=n=In(e.current,null),Qe=t,st=0,on=null,va=!1,_l=Ue(e,t),Vc=!1,Ol=cn=Kc=Qa=Sa=xt=0,Wt=Tr=null,Xc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var i=31-I(l),c=1<<i;t|=e[i],l&=~c}return ea=t,ci(),n}function Hh(e,t){Ge=null,O.H=xr,t===jl||t===gi?(t=tm(),st=3):t===nc?(t=tm(),st=4):st=t===_c?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,on=t,Xe===null&&(xt=1,Oi(e,gn(t,e.current)))}function Lh(){var e=rn.current;return e===null?!0:(Qe&4194048)===Qe?Sn===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?e===Sn:!1}function Bh(){var e=O.H;return O.H=xr,e===null?xr:e}function Ih(){var e=O.A;return O.A=Vv,e}function Yi(){xt=4,va||(Qe&4194048)!==Qe&&rn.current!==null||(_l=!0),(Sa&134217727)===0&&(Qa&134217727)===0||ft===null||Na(ft,Qe,cn,!1)}function Wc(e,t,n){var l=lt;lt|=2;var i=Bh(),c=Ih();(ft!==e||Qe!==t)&&(Bi=null,$l(e,t)),t=!1;var y=xt;e:do try{if(st!==0&&Xe!==null){var j=Xe,k=on;switch(st){case 8:Pc(),y=6;break e;case 3:case 2:case 9:case 6:rn.current===null&&(t=!0);var V=st;if(st=0,on=null,Ml(e,j,k,V),n&&_l){y=0;break e}break;default:V=st,st=0,on=null,Ml(e,j,k,V)}}Zv(),y=xt;break}catch(ae){Hh(e,ae)}while(!0);return t&&e.shellSuspendCounter++,Gn=Ba=null,lt=l,O.H=i,O.A=c,Xe===null&&(ft=null,Qe=0,ci()),y}function Zv(){for(;Xe!==null;)Yh(Xe)}function Qv(e,t){var n=lt;lt|=2;var l=Bh(),i=Ih();ft!==e||Qe!==t?(Bi=null,Li=Oe()+500,$l(e,t)):_l=Ue(e,t);e:do try{if(st!==0&&Xe!==null){t=Xe;var c=on;t:switch(st){case 1:st=0,on=null,Ml(e,t,c,1);break;case 2:case 9:if(Wp(c)){st=0,on=null,Gh(t);break}t=function(){st!==2&&st!==9||ft!==e||(st=7),Dn(e)},c.then(t,t);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:Wp(c)?(st=0,on=null,Gh(t)):(st=0,on=null,Ml(e,t,c,7));break;case 5:var y=null;switch(Xe.tag){case 26:y=Xe.memoizedState;case 5:case 27:var j=Xe;if(y?ky(y):j.stateNode.complete){st=0,on=null;var k=j.sibling;if(k!==null)Xe=k;else{var V=j.return;V!==null?(Xe=V,Gi(V)):Xe=null}break t}}st=0,on=null,Ml(e,t,c,5);break;case 6:st=0,on=null,Ml(e,t,c,6);break;case 8:Pc(),xt=6;break e;default:throw Error(u(462))}}Jv();break}catch(ae){Hh(e,ae)}while(!0);return Gn=Ba=null,O.H=l,O.A=i,lt=n,Xe!==null?0:(ft=null,Qe=0,ci(),xt)}function Jv(){for(;Xe!==null&&!wn();)Yh(Xe)}function Yh(e){var t=ph(e.alternate,e,ea);e.memoizedProps=e.pendingProps,t===null?Gi(e):Xe=t}function Gh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=sh(n,t,t.pendingProps,t.type,void 0,Qe);break;case 11:t=sh(n,t,t.pendingProps,t.type.render,t.ref,Qe);break;case 5:mc(t);default:hh(n,t),t=Xe=Ip(t,ea),t=ph(n,t,ea)}e.memoizedProps=e.pendingProps,t===null?Gi(e):Xe=t}function Ml(e,t,n,l){Gn=Ba=null,mc(t),Al=null,ur=0;var i=t.return;try{if(Hv(e,i,t,n,Qe)){xt=1,Oi(e,gn(n,e.current)),Xe=null;return}}catch(c){if(i!==null)throw Xe=i,c;xt=1,Oi(e,gn(n,e.current)),Xe=null;return}t.flags&32768?(We||l===1?e=!0:_l||(Qe&536870912)!==0?e=!1:(va=e=!0,(l===2||l===9||l===3||l===6)&&(l=rn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Fh(t,e)):Gi(t)}function Gi(e){var t=e;do{if((t.flags&32768)!==0){Fh(t,va);return}e=t.return;var n=Iv(t.alternate,t,ea);if(n!==null){Xe=n;return}if(t=t.sibling,t!==null){Xe=t;return}Xe=t=e}while(t!==null);xt===0&&(xt=5)}function Fh(e,t){do{var n=Yv(e.alternate,e);if(n!==null){n.flags&=32767,Xe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Xe=e;return}Xe=e=n}while(e!==null);xt=6,Xe=null}function Vh(e,t,n,l,i,c,y,j,k){e.cancelPendingCommit=null;do Fi();while(Tt!==0);if((lt&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(c=t.lanes|t.childLanes,c|=Bo,_b(e,n,c,y,j,k),e===ft&&(Xe=ft=null,Qe=0),Rl=t,Aa=e,ta=n,Zc=c,Qc=i,qh=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,t1(Yt,function(){return Jh(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=O.T,O.T=null,i=ee.p,ee.p=2,y=lt,lt|=4;try{Gv(e,t,n)}finally{lt=y,ee.p=i,O.T=l}}Tt=1,Kh(),Xh(),Zh()}}function Kh(){if(Tt===1){Tt=0;var e=Aa,t=Rl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=O.T,O.T=null;var l=ee.p;ee.p=2;var i=lt;lt|=4;try{Eh(t,e);var c=du,y=$p(e.containerInfo),j=c.focusedElem,k=c.selectionRange;if(y!==j&&j&&j.ownerDocument&&Rp(j.ownerDocument.documentElement,j)){if(k!==null&&Do(j)){var V=k.start,ae=k.end;if(ae===void 0&&(ae=V),"selectionStart"in j)j.selectionStart=V,j.selectionEnd=Math.min(ae,j.value.length);else{var ie=j.ownerDocument||document,X=ie&&ie.defaultView||window;if(X.getSelection){var Q=X.getSelection(),Te=j.textContent.length,De=Math.min(k.start,Te),dt=k.end===void 0?De:Math.min(k.end,Te);!Q.extend&&De>dt&&(y=dt,dt=De,De=y);var L=Op(j,De),D=Op(j,dt);if(L&&D&&(Q.rangeCount!==1||Q.anchorNode!==L.node||Q.anchorOffset!==L.offset||Q.focusNode!==D.node||Q.focusOffset!==D.offset)){var F=ie.createRange();F.setStart(L.node,L.offset),Q.removeAllRanges(),De>dt?(Q.addRange(F),Q.extend(D.node,D.offset)):(F.setEnd(D.node,D.offset),Q.addRange(F))}}}}for(ie=[],Q=j;Q=Q.parentNode;)Q.nodeType===1&&ie.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<ie.length;j++){var re=ie[j];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}as=!!uu,du=uu=null}finally{lt=i,ee.p=l,O.T=n}}e.current=t,Tt=2}}function Xh(){if(Tt===2){Tt=0;var e=Aa,t=Rl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=O.T,O.T=null;var l=ee.p;ee.p=2;var i=lt;lt|=4;try{jh(e,t.alternate,t)}finally{lt=i,ee.p=l,O.T=n}}Tt=3}}function Zh(){if(Tt===4||Tt===3){Tt=0,Rn();var e=Aa,t=Rl,n=ta,l=qh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Tt=5:(Tt=0,Rl=Aa=null,Qh(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ja=null),go(n),t=t.stateNode,h&&typeof h.onCommitFiberRoot=="function")try{h.onCommitFiberRoot(Z,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=O.T,i=ee.p,ee.p=2,O.T=null;try{for(var c=e.onRecoverableError,y=0;y<l.length;y++){var j=l[y];c(j.value,{componentStack:j.stack})}}finally{O.T=t,ee.p=i}}(ta&3)!==0&&Fi(),Dn(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===Jc?Er++:(Er=0,Jc=e):Er=0,Cr(0)}}function Qh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,or(t)))}function Fi(){return Kh(),Xh(),Zh(),Jh()}function Jh(){if(Tt!==5)return!1;var e=Aa,t=Zc;Zc=0;var n=go(ta),l=O.T,i=ee.p;try{ee.p=32>n?32:n,O.T=null,n=Qc,Qc=null;var c=Aa,y=ta;if(Tt=0,Rl=Aa=null,ta=0,(lt&6)!==0)throw Error(u(331));var j=lt;if(lt|=4,Rh(c.current),kh(c,c.current,y,n),lt=j,Cr(0,!1),h&&typeof h.onPostCommitFiberRoot=="function")try{h.onPostCommitFiberRoot(Z,c)}catch{}return!0}finally{ee.p=i,O.T=l,Qh(e,t)}}function Ph(e,t,n){t=gn(n,t),t=kc(e.stateNode,t,2),e=ya(e,t,2),e!==null&&(En(e,2),Dn(e))}function ot(e,t,n){if(e.tag===3)Ph(e,e,n);else for(;t!==null;){if(t.tag===3){Ph(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ja===null||!ja.has(l))){e=gn(n,e),n=Wm(2),l=ya(t,n,2),l!==null&&(eh(n,l,t,e),En(l,2),Dn(l));break}}t=t.return}}function eu(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Kv;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(n)||(Vc=!0,i.add(n),e=Pv.bind(null,e,t,n),t.then(e,e))}function Pv(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ft===e&&(Qe&n)===n&&(xt===4||xt===3&&(Qe&62914560)===Qe&&300>Oe()-Hi?(lt&2)===0&&$l(e,0):Kc|=n,Ol===Qe&&(Ol=0)),Dn(e)}function Wh(e,t){t===0&&(t=Tn()),e=Ua(e,t),e!==null&&(En(e,t),Dn(e))}function Wv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Wh(e,n)}function e1(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(u(314))}l!==null&&l.delete(t),Wh(e,n)}function t1(e,t){return Ft(e,t)}var Vi=null,ql=null,tu=!1,Ki=!1,nu=!1,wa=0;function Dn(e){e!==ql&&e.next===null&&(ql===null?Vi=ql=e:ql=ql.next=e),Ki=!0,tu||(tu=!0,a1())}function Cr(e,t){if(!nu&&Ki){nu=!0;do for(var n=!1,l=Vi;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var c=0;else{var y=l.suspendedLanes,j=l.pingedLanes;c=(1<<31-I(42|e)+1)-1,c&=i&~(y&~j),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,ay(l,c))}else c=Qe,c=$e(l,l===ft?c:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(c&3)===0||Ue(l,c)||(n=!0,ay(l,c));l=l.next}while(n);nu=!1}}function n1(){ey()}function ey(){Ki=tu=!1;var e=0;wa!==0&&p1()&&(e=wa);for(var t=Oe(),n=null,l=Vi;l!==null;){var i=l.next,c=ty(l,t);c===0?(l.next=null,n===null?Vi=i:n.next=i,i===null&&(ql=n)):(n=l,(e!==0||(c&3)!==0)&&(Ki=!0)),l=i}Tt!==0&&Tt!==5||Cr(e),wa!==0&&(wa=0)}function ty(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var y=31-I(c),j=1<<y,k=i[y];k===-1?((j&n)===0||(j&l)!==0)&&(i[y]=Fe(j,t)):k<=t&&(e.expiredLanes|=j),c&=~j}if(t=ft,n=Qe,n=$e(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(st===2||st===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Vt(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Ue(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Vt(l),go(n)){case 2:case 8:n=Kt;break;case 32:n=Yt;break;case 268435456:n=H;break;default:n=Yt}return l=ny.bind(null,e),n=Ft(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Vt(l),e.callbackPriority=2,e.callbackNode=null,2}function ny(e,t){if(Tt!==0&&Tt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Fi()&&e.callbackNode!==n)return null;var l=Qe;return l=$e(e,e===ft?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(zh(e,l,t),ty(e,Oe()),e.callbackNode!=null&&e.callbackNode===n?ny.bind(null,e):null)}function ay(e,t){if(Fi())return null;zh(e,t,!0)}function a1(){h1(function(){(lt&6)!==0?Ft(Rt,n1):ey()})}function au(){if(wa===0){var e=vl;e===0&&(e=ne,ne<<=1,(ne&261888)===0&&(ne=256)),wa=e}return wa}function ly(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ti(""+e)}function ry(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function l1(e,t,n,l,i){if(t==="submit"&&n&&n.stateNode===i){var c=ly((i[Xt]||null).action),y=l.submitter;y&&(t=(t=y[Xt]||null)?ly(t.formAction):y.getAttribute("formAction"),t!==null&&(c=t,y=null));var j=new ri("action","action",null,l,i);e.push({event:j,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(wa!==0){var k=y?ry(i,y):new FormData(i);Ac(n,{pending:!0,data:k,method:i.method,action:c},null,k)}}else typeof c=="function"&&(j.preventDefault(),k=y?ry(i,y):new FormData(i),Ac(n,{pending:!0,data:k,method:i.method,action:c},c,k))},currentTarget:i}]})}}for(var lu=0;lu<Lo.length;lu++){var ru=Lo[lu],r1=ru.toLowerCase(),i1=ru[0].toUpperCase()+ru.slice(1);Cn(r1,"on"+i1)}Cn(Dp,"onAnimationEnd"),Cn(zp,"onAnimationIteration"),Cn(Up,"onAnimationStart"),Cn("dblclick","onDoubleClick"),Cn("focusin","onFocus"),Cn("focusout","onBlur"),Cn(jv,"onTransitionRun"),Cn(Av,"onTransitionStart"),Cn(Nv,"onTransitionCancel"),Cn(Hp,"onTransitionEnd"),il("onMouseEnter",["mouseout","mouseover"]),il("onMouseLeave",["mouseout","mouseover"]),il("onPointerEnter",["pointerout","pointerover"]),il("onPointerLeave",["pointerout","pointerover"]),Ma("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ma("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ma("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ma("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var kr="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(" "),s1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(kr));function iy(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],i=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var y=l.length-1;0<=y;y--){var j=l[y],k=j.instance,V=j.currentTarget;if(j=j.listener,k!==c&&i.isPropagationStopped())break e;c=j,i.currentTarget=V;try{c(i)}catch(ae){oi(ae)}i.currentTarget=null,c=k}else for(y=0;y<l.length;y++){if(j=l[y],k=j.instance,V=j.currentTarget,j=j.listener,k!==c&&i.isPropagationStopped())break e;c=j,i.currentTarget=V;try{c(i)}catch(ae){oi(ae)}i.currentTarget=null,c=k}}}}function Ze(e,t){var n=t[xo];n===void 0&&(n=t[xo]=new Set);var l=e+"__bubble";n.has(l)||(sy(t,e,2,!1),n.add(l))}function iu(e,t,n){var l=0;t&&(l|=4),sy(n,e,l,t)}var Xi="_reactListening"+Math.random().toString(36).slice(2);function su(e){if(!e[Xi]){e[Xi]=!0,ep.forEach(function(n){n!=="selectionchange"&&(s1.has(n)||iu(n,!1,e),iu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xi]||(t[Xi]=!0,iu("selectionchange",!1,t))}}function sy(e,t,n,l){switch(Dy(t)){case 2:var i=q1;break;case 8:i=D1;break;default:i=ju}n=i.bind(null,t,n,e),i=void 0,!Eo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),l?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function ou(e,t,n,l,i){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var y=l.tag;if(y===3||y===4){var j=l.stateNode.containerInfo;if(j===i)break;if(y===4)for(y=l.return;y!==null;){var k=y.tag;if((k===3||k===4)&&y.stateNode.containerInfo===i)return;y=y.return}for(;j!==null;){if(y=al(j),y===null)return;if(k=y.tag,k===5||k===6||k===26||k===27){l=c=y;continue e}j=j.parentNode}}l=l.return}fp(function(){var V=c,ae=wo(n),ie=[];e:{var X=Lp.get(e);if(X!==void 0){var Q=ri,Te=e;switch(e){case"keypress":if(ai(n)===0)break e;case"keydown":case"keyup":Q=ev;break;case"focusin":Te="focus",Q=Oo;break;case"focusout":Te="blur",Q=Oo;break;case"beforeblur":case"afterblur":Q=Oo;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=hp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=Ib;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=av;break;case Dp:case zp:case Up:Q=Fb;break;case Hp:Q=rv;break;case"scroll":case"scrollend":Q=Lb;break;case"wheel":Q=sv;break;case"copy":case"cut":case"paste":Q=Kb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=gp;break;case"toggle":case"beforetoggle":Q=cv}var De=(t&4)!==0,dt=!De&&(e==="scroll"||e==="scrollend"),L=De?X!==null?X+"Capture":null:X;De=[];for(var D=V,F;D!==null;){var re=D;if(F=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||F===null||L===null||(re=Jl(D,L),re!=null&&De.push(_r(D,re,F))),dt)break;D=D.return}0<De.length&&(X=new Q(X,Te,null,n,ae),ie.push({event:X,listeners:De}))}}if((t&7)===0){e:{if(X=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",X&&n!==No&&(Te=n.relatedTarget||n.fromElement)&&(al(Te)||Te[nl]))break e;if((Q||X)&&(X=ae.window===ae?ae:(X=ae.ownerDocument)?X.defaultView||X.parentWindow:window,Q?(Te=n.relatedTarget||n.toElement,Q=V,Te=Te?al(Te):null,Te!==null&&(dt=p(Te),De=Te.tag,Te!==dt||De!==5&&De!==27&&De!==6)&&(Te=null)):(Q=null,Te=V),Q!==Te)){if(De=hp,re="onMouseLeave",L="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(De=gp,re="onPointerLeave",L="onPointerEnter",D="pointer"),dt=Q==null?X:Ql(Q),F=Te==null?X:Ql(Te),X=new De(re,D+"leave",Q,n,ae),X.target=dt,X.relatedTarget=F,re=null,al(ae)===V&&(De=new De(L,D+"enter",Te,n,ae),De.target=F,De.relatedTarget=dt,re=De),dt=re,Q&&Te)t:{for(De=o1,L=Q,D=Te,F=0,re=L;re;re=De(re))F++;re=0;for(var Me=D;Me;Me=De(Me))re++;for(;0<F-re;)L=De(L),F--;for(;0<re-F;)D=De(D),re--;for(;F--;){if(L===D||D!==null&&L===D.alternate){De=L;break t}L=De(L),D=De(D)}De=null}else De=null;Q!==null&&oy(ie,X,Q,De,!1),Te!==null&&dt!==null&&oy(ie,dt,Te,De,!0)}}e:{if(X=V?Ql(V):window,Q=X.nodeName&&X.nodeName.toLowerCase(),Q==="select"||Q==="input"&&X.type==="file")var tt=wp;else if(Ap(X))if(Tp)tt=bv;else{tt=gv;var _e=yv}else Q=X.nodeName,!Q||Q.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?V&&Ao(V.elementType)&&(tt=wp):tt=xv;if(tt&&(tt=tt(e,V))){Np(ie,tt,n,ae);break e}_e&&_e(e,X,V),e==="focusout"&&V&&X.type==="number"&&V.memoizedProps.value!=null&&jo(X,"number",X.value)}switch(_e=V?Ql(V):window,e){case"focusin":(Ap(_e)||_e.contentEditable==="true")&&(fl=_e,zo=V,rr=null);break;case"focusout":rr=zo=fl=null;break;case"mousedown":Uo=!0;break;case"contextmenu":case"mouseup":case"dragend":Uo=!1,Mp(ie,n,ae);break;case"selectionchange":if(Sv)break;case"keydown":case"keyup":Mp(ie,n,ae)}var Ve;if($o)e:{switch(e){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else dl?Sp(e,n)&&(Je="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Je="onCompositionStart");Je&&(xp&&n.locale!=="ko"&&(dl||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&dl&&(Ve=pp()):(ca=ae,Co="value"in ca?ca.value:ca.textContent,dl=!0)),_e=Zi(V,Je),0<_e.length&&(Je=new yp(Je,e,null,n,ae),ie.push({event:Je,listeners:_e}),Ve?Je.data=Ve:(Ve=jp(n),Ve!==null&&(Je.data=Ve)))),(Ve=dv?fv(e,n):pv(e,n))&&(Je=Zi(V,"onBeforeInput"),0<Je.length&&(_e=new yp("onBeforeInput","beforeinput",null,n,ae),ie.push({event:_e,listeners:Je}),_e.data=Ve)),l1(ie,e,V,n,ae)}iy(ie,t)})}function _r(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zi(e,t){for(var n=t+"Capture",l=[];e!==null;){var i=e,c=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||c===null||(i=Jl(e,n),i!=null&&l.unshift(_r(e,i,c)),i=Jl(e,t),i!=null&&l.push(_r(e,i,c))),e.tag===3)return l;e=e.return}return[]}function o1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function oy(e,t,n,l,i){for(var c=t._reactName,y=[];n!==null&&n!==l;){var j=n,k=j.alternate,V=j.stateNode;if(j=j.tag,k!==null&&k===l)break;j!==5&&j!==26&&j!==27||V===null||(k=V,i?(V=Jl(n,c),V!=null&&y.unshift(_r(n,V,k))):i||(V=Jl(n,c),V!=null&&y.push(_r(n,V,k)))),n=n.return}y.length!==0&&e.push({event:t,listeners:y})}var c1=/\r\n?/g,u1=/\u0000|\uFFFD/g;function cy(e){return(typeof e=="string"?e:""+e).replace(c1,`
|
|
9
|
-
`).replace(u1,"")}function uy(e,t){return t=cy(t),cy(e)===t}function ut(e,t,n,l,i,c){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||ol(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&ol(e,""+l);break;case"className":Wr(e,"class",l);break;case"tabIndex":Wr(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Wr(e,n,l);break;case"style":up(e,l,c);break;case"data":if(t!=="object"){Wr(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=ti(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"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 c=="function"&&(n==="formAction"?(t!=="input"&&ut(e,t,"name",i.name,i,null),ut(e,t,"formEncType",i.formEncType,i,null),ut(e,t,"formMethod",i.formMethod,i,null),ut(e,t,"formTarget",i.formTarget,i,null)):(ut(e,t,"encType",i.encType,i,null),ut(e,t,"method",i.method,i,null),ut(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=ti(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Ln);break;case"onScroll":l!=null&&Ze("scroll",e);break;case"onScrollEnd":l!=null&&Ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=ti(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":Ze("beforetoggle",e),Ze("toggle",e),Pr(e,"popover",l);break;case"xlinkActuate":Hn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Hn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Hn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Hn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Hn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Hn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Pr(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Ub.get(n)||n,Pr(e,n,l))}}function cu(e,t,n,l,i,c){switch(n){case"style":up(e,l,c);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"children":typeof l=="string"?ol(e,l):(typeof l=="number"||typeof l=="bigint")&&ol(e,""+l);break;case"onScroll":l!=null&&Ze("scroll",e);break;case"onScrollEnd":l!=null&&Ze("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Ln);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!tp.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),c=e[Xt]||null,c=c!=null?c[n]:null,typeof c=="function"&&e.removeEventListener(t,c,i),typeof l=="function")){typeof c!="function"&&c!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,i);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):Pr(e,n,l)}}}function zt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",e),Ze("load",e);var l=!1,i=!1,c;for(c in n)if(n.hasOwnProperty(c)){var y=n[c];if(y!=null)switch(c){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:ut(e,t,c,y,n,null)}}i&&ut(e,t,"srcSet",n.srcSet,n,null),l&&ut(e,t,"src",n.src,n,null);return;case"input":Ze("invalid",e);var j=c=y=i=null,k=null,V=null;for(l in n)if(n.hasOwnProperty(l)){var ae=n[l];if(ae!=null)switch(l){case"name":i=ae;break;case"type":y=ae;break;case"checked":k=ae;break;case"defaultChecked":V=ae;break;case"value":c=ae;break;case"defaultValue":j=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(u(137,t));break;default:ut(e,t,l,ae,n,null)}}ip(e,c,j,k,V,y,i,!1);return;case"select":Ze("invalid",e),l=y=c=null;for(i in n)if(n.hasOwnProperty(i)&&(j=n[i],j!=null))switch(i){case"value":c=j;break;case"defaultValue":y=j;break;case"multiple":l=j;default:ut(e,t,i,j,n,null)}t=c,n=y,e.multiple=!!l,t!=null?sl(e,!!l,t,!1):n!=null&&sl(e,!!l,n,!0);return;case"textarea":Ze("invalid",e),c=i=l=null;for(y in n)if(n.hasOwnProperty(y)&&(j=n[y],j!=null))switch(y){case"value":l=j;break;case"defaultValue":i=j;break;case"children":c=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(u(91));break;default:ut(e,t,y,j,n,null)}op(e,l,i,c);return;case"option":for(k in n)n.hasOwnProperty(k)&&(l=n[k],l!=null)&&(k==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":ut(e,t,k,l,n,null));return;case"dialog":Ze("beforetoggle",e),Ze("toggle",e),Ze("cancel",e),Ze("close",e);break;case"iframe":case"object":Ze("load",e);break;case"video":case"audio":for(l=0;l<kr.length;l++)Ze(kr[l],e);break;case"image":Ze("error",e),Ze("load",e);break;case"details":Ze("toggle",e);break;case"embed":case"source":case"link":Ze("error",e),Ze("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(V in n)if(n.hasOwnProperty(V)&&(l=n[V],l!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:ut(e,t,V,l,n,null)}return;default:if(Ao(t)){for(ae in n)n.hasOwnProperty(ae)&&(l=n[ae],l!==void 0&&cu(e,t,ae,l,n,void 0));return}}for(j in n)n.hasOwnProperty(j)&&(l=n[j],l!=null&&ut(e,t,j,l,n,null))}function d1(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,c=null,y=null,j=null,k=null,V=null,ae=null;for(Q in n){var ie=n[Q];if(n.hasOwnProperty(Q)&&ie!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":k=ie;default:l.hasOwnProperty(Q)||ut(e,t,Q,null,l,ie)}}for(var X in l){var Q=l[X];if(ie=n[X],l.hasOwnProperty(X)&&(Q!=null||ie!=null))switch(X){case"type":c=Q;break;case"name":i=Q;break;case"checked":V=Q;break;case"defaultChecked":ae=Q;break;case"value":y=Q;break;case"defaultValue":j=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(u(137,t));break;default:Q!==ie&&ut(e,t,X,Q,l,ie)}}So(e,y,j,k,V,ae,c,i);return;case"select":Q=y=j=X=null;for(c in n)if(k=n[c],n.hasOwnProperty(c)&&k!=null)switch(c){case"value":break;case"multiple":Q=k;default:l.hasOwnProperty(c)||ut(e,t,c,null,l,k)}for(i in l)if(c=l[i],k=n[i],l.hasOwnProperty(i)&&(c!=null||k!=null))switch(i){case"value":X=c;break;case"defaultValue":j=c;break;case"multiple":y=c;default:c!==k&&ut(e,t,i,c,l,k)}t=j,n=y,l=Q,X!=null?sl(e,!!n,X,!1):!!l!=!!n&&(t!=null?sl(e,!!n,t,!0):sl(e,!!n,n?[]:"",!1));return;case"textarea":Q=X=null;for(j in n)if(i=n[j],n.hasOwnProperty(j)&&i!=null&&!l.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:ut(e,t,j,null,l,i)}for(y in l)if(i=l[y],c=n[y],l.hasOwnProperty(y)&&(i!=null||c!=null))switch(y){case"value":X=i;break;case"defaultValue":Q=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(u(91));break;default:i!==c&&ut(e,t,y,i,l,c)}sp(e,X,Q);return;case"option":for(var Te in n)X=n[Te],n.hasOwnProperty(Te)&&X!=null&&!l.hasOwnProperty(Te)&&(Te==="selected"?e.selected=!1:ut(e,t,Te,null,l,X));for(k in l)X=l[k],Q=n[k],l.hasOwnProperty(k)&&X!==Q&&(X!=null||Q!=null)&&(k==="selected"?e.selected=X&&typeof X!="function"&&typeof X!="symbol":ut(e,t,k,X,l,Q));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 De in n)X=n[De],n.hasOwnProperty(De)&&X!=null&&!l.hasOwnProperty(De)&&ut(e,t,De,null,l,X);for(V in l)if(X=l[V],Q=n[V],l.hasOwnProperty(V)&&X!==Q&&(X!=null||Q!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(u(137,t));break;default:ut(e,t,V,X,l,Q)}return;default:if(Ao(t)){for(var dt in n)X=n[dt],n.hasOwnProperty(dt)&&X!==void 0&&!l.hasOwnProperty(dt)&&cu(e,t,dt,void 0,l,X);for(ae in l)X=l[ae],Q=n[ae],!l.hasOwnProperty(ae)||X===Q||X===void 0&&Q===void 0||cu(e,t,ae,X,l,Q);return}}for(var L in n)X=n[L],n.hasOwnProperty(L)&&X!=null&&!l.hasOwnProperty(L)&&ut(e,t,L,null,l,X);for(ie in l)X=l[ie],Q=n[ie],!l.hasOwnProperty(ie)||X===Q||X==null&&Q==null||ut(e,t,ie,X,l,Q)}function dy(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function f1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var i=n[l],c=i.transferSize,y=i.initiatorType,j=i.duration;if(c&&j&&dy(y)){for(y=0,j=i.responseEnd,l+=1;l<n.length;l++){var k=n[l],V=k.startTime;if(V>j)break;var ae=k.transferSize,ie=k.initiatorType;ae&&dy(ie)&&(k=k.responseEnd,y+=ae*(k<j?1:(j-V)/(k-V)))}if(--l,t+=8*(c+y)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var uu=null,du=null;function Qi(e){return e.nodeType===9?e:e.ownerDocument}function fy(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function py(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function fu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var pu=null;function p1(){var e=window.event;return e&&e.type==="popstate"?e===pu?!1:(pu=e,!0):(pu=null,!1)}var my=typeof setTimeout=="function"?setTimeout:void 0,m1=typeof clearTimeout=="function"?clearTimeout:void 0,hy=typeof Promise=="function"?Promise:void 0,h1=typeof queueMicrotask=="function"?queueMicrotask:typeof hy<"u"?function(e){return hy.resolve(null).then(e).catch(y1)}:my;function y1(e){setTimeout(function(){throw e})}function Ta(e){return e==="head"}function yy(e,t){var n=t,l=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(i),Hl(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Or(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Or(n);for(var c=n.firstChild;c;){var y=c.nextSibling,j=c.nodeName;c[Zl]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=y}}else n==="body"&&Or(e.ownerDocument.body);n=i}while(n);Hl(t)}function gy(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function mu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":mu(n),bo(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function g1(e,t,n,l){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Zl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=jn(e.nextSibling),e===null)break}return null}function x1(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=jn(e.nextSibling),e===null))return null;return e}function xy(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=jn(e.nextSibling),e===null))return null;return e}function hu(e){return e.data==="$?"||e.data==="$~"}function yu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function b1(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function jn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var gu=null;function by(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return jn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function vy(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Sy(e,t,n){switch(t=Qi(n),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Or(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);bo(e)}var An=new Map,jy=new Set;function Ji(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var na=ee.d;ee.d={f:v1,r:S1,D:j1,C:A1,L:N1,m:w1,X:E1,S:T1,M:C1};function v1(){var e=na.f(),t=Ii();return e||t}function S1(e){var t=ll(e);t!==null&&t.tag===5&&t.type==="form"?Hm(t):na.r(e)}var Dl=typeof document>"u"?null:document;function Ay(e,t,n){var l=Dl;if(l&&typeof t=="string"&&t){var i=hn(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),jy.has(i)||(jy.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),zt(t,"link",e),Et(t),l.head.appendChild(t)))}}function j1(e){na.D(e),Ay("dns-prefetch",e,null)}function A1(e,t){na.C(e,t),Ay("preconnect",e,t)}function N1(e,t,n){na.L(e,t,n);var l=Dl;if(l&&e&&t){var i='link[rel="preload"][as="'+hn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+hn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+hn(n.imageSizes)+'"]')):i+='[href="'+hn(e)+'"]';var c=i;switch(t){case"style":c=zl(e);break;case"script":c=Ul(e)}An.has(c)||(e=S({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),An.set(c,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(Rr(c))||t==="script"&&l.querySelector($r(c))||(t=l.createElement("link"),zt(t,"link",e),Et(t),l.head.appendChild(t)))}}function w1(e,t){na.m(e,t);var n=Dl;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+hn(l)+'"][href="'+hn(e)+'"]',c=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Ul(e)}if(!An.has(c)&&(e=S({rel:"modulepreload",href:e},t),An.set(c,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector($r(c)))return}l=n.createElement("link"),zt(l,"link",e),Et(l),n.head.appendChild(l)}}}function T1(e,t,n){na.S(e,t,n);var l=Dl;if(l&&e){var i=rl(l).hoistableStyles,c=zl(e);t=t||"default";var y=i.get(c);if(!y){var j={loading:0,preload:null};if(y=l.querySelector(Rr(c)))j.loading=5;else{e=S({rel:"stylesheet",href:e,"data-precedence":t},n),(n=An.get(c))&&xu(e,n);var k=y=l.createElement("link");Et(k),zt(k,"link",e),k._p=new Promise(function(V,ae){k.onload=V,k.onerror=ae}),k.addEventListener("load",function(){j.loading|=1}),k.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Pi(y,t,l)}y={type:"stylesheet",instance:y,count:1,state:j},i.set(c,y)}}}function E1(e,t){na.X(e,t);var n=Dl;if(n&&e){var l=rl(n).hoistableScripts,i=Ul(e),c=l.get(i);c||(c=n.querySelector($r(i)),c||(e=S({src:e,async:!0},t),(t=An.get(i))&&bu(e,t),c=n.createElement("script"),Et(c),zt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(i,c))}}function C1(e,t){na.M(e,t);var n=Dl;if(n&&e){var l=rl(n).hoistableScripts,i=Ul(e),c=l.get(i);c||(c=n.querySelector($r(i)),c||(e=S({src:e,async:!0,type:"module"},t),(t=An.get(i))&&bu(e,t),c=n.createElement("script"),Et(c),zt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(i,c))}}function Ny(e,t,n,l){var i=(i=Ee.current)?Ji(i):null;if(!i)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=zl(n.href),n=rl(i).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=zl(n.href);var c=rl(i).hoistableStyles,y=c.get(e);if(y||(i=i.ownerDocument||i,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,y),(c=i.querySelector(Rr(e)))&&!c._p&&(y.instance=c,y.state.loading=5),An.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},An.set(e,n),c||k1(i,e,n,y.state))),t&&l===null)throw Error(u(528,""));return y}if(t&&l!==null)throw Error(u(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ul(n),n=rl(i).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function zl(e){return'href="'+hn(e)+'"'}function Rr(e){return'link[rel="stylesheet"]['+e+"]"}function wy(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function k1(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),zt(t,"link",n),Et(t),e.head.appendChild(t))}function Ul(e){return'[src="'+hn(e)+'"]'}function $r(e){return"script[async]"+e}function Ty(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+hn(n.href)+'"]');if(l)return t.instance=l,Et(l),l;var i=S({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Et(l),zt(l,"style",i),Pi(l,n.precedence,e),t.instance=l;case"stylesheet":i=zl(n.href);var c=e.querySelector(Rr(i));if(c)return t.state.loading|=4,t.instance=c,Et(c),c;l=wy(n),(i=An.get(i))&&xu(l,i),c=(e.ownerDocument||e).createElement("link"),Et(c);var y=c;return y._p=new Promise(function(j,k){y.onload=j,y.onerror=k}),zt(c,"link",l),t.state.loading|=4,Pi(c,n.precedence,e),t.instance=c;case"script":return c=Ul(n.src),(i=e.querySelector($r(c)))?(t.instance=i,Et(i),i):(l=n,(i=An.get(c))&&(l=S({},n),bu(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),Et(i),zt(i,"link",l),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Pi(l,n.precedence,e));return t.instance}function Pi(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,c=i,y=0;y<l.length;y++){var j=l[y];if(j.dataset.precedence===t)c=j;else if(c!==i)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function xu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function bu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Wi=null;function Ey(e,t,n){if(Wi===null){var l=new Map,i=Wi=new Map;i.set(n,l)}else i=Wi,l=i.get(n),l||(l=new Map,i.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var c=n[i];if(!(c[Zl]||c[$t]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var y=c.getAttribute(t)||"";y=e+y;var j=l.get(y);j?j.push(c):l.set(y,[c])}}return l}function Cy(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function _1(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function ky(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function O1(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=zl(l.href),c=t.querySelector(Rr(i));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=es.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,Et(c);return}c=t.ownerDocument||t,l=wy(l),(i=An.get(i))&&xu(l,i),c=c.createElement("link"),Et(c);var y=c;y._p=new Promise(function(j,k){y.onload=j,y.onerror=k}),zt(c,"link",l),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=es.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var vu=0;function R1(e,t){return e.stylesheets&&e.count===0&&ns(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&ns(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&vu===0&&(vu=62500*f1());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ns(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>vu?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function es(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ns(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ts=null;function ns(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ts=new Map,t.forEach($1,e),ts=null,es.call(e))}function $1(e,t){if(!(t.state.loading&4)){var n=ts.get(e);if(n)var l=n.get(null);else{n=new Map,ts.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<i.length;c++){var y=i[c];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(n.set(y.dataset.precedence,y),l=y)}l&&n.set(null,l)}i=t.instance,y=i.getAttribute("data-precedence"),c=n.get(y)||l,c===l&&n.set(null,i),n.set(y,i),this.count++,l=es.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),c?c.parentNode.insertBefore(i,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Mr={$$typeof:E,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function M1(e,t,n,l,i,c,y,j,k){this.tag=1,this.containerInfo=e,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=Un(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Un(0),this.hiddenUpdates=Un(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=c,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function _y(e,t,n,l,i,c,y,j,k,V,ae,ie){return e=new M1(e,t,n,y,k,V,ae,ie,j),t=1,c===!0&&(t|=24),c=ln(3,null,null,t),e.current=c,c.stateNode=e,t=Wo(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:l,isDehydrated:n,cache:t},ac(c),e}function Oy(e){return e?(e=hl,e):hl}function Ry(e,t,n,l,i,c){i=Oy(i),l.context===null?l.context=i:l.pendingContext=i,l=ha(t),l.payload={element:n},c=c===void 0?null:c,c!==null&&(l.callback=c),n=ya(e,l,t),n!==null&&(en(n,e,t),fr(n,e,t))}function $y(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Su(e,t){$y(e,t),(e=e.alternate)&&$y(e,t)}function My(e){if(e.tag===13||e.tag===31){var t=Ua(e,67108864);t!==null&&en(t,e,67108864),Su(e,67108864)}}function qy(e){if(e.tag===13||e.tag===31){var t=un();t=yo(t);var n=Ua(e,t);n!==null&&en(n,e,t),Su(e,t)}}var as=!0;function q1(e,t,n,l){var i=O.T;O.T=null;var c=ee.p;try{ee.p=2,ju(e,t,n,l)}finally{ee.p=c,O.T=i}}function D1(e,t,n,l){var i=O.T;O.T=null;var c=ee.p;try{ee.p=8,ju(e,t,n,l)}finally{ee.p=c,O.T=i}}function ju(e,t,n,l){if(as){var i=Au(l);if(i===null)ou(e,t,l,ls,n),zy(e,l);else if(U1(i,e,t,n,l))l.stopPropagation();else if(zy(e,l),t&4&&-1<z1.indexOf(e)){for(;i!==null;){var c=ll(i);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var y=Re(c.pendingLanes);if(y!==0){var j=c;for(j.pendingLanes|=2,j.entangledLanes|=2;y;){var k=1<<31-I(y);j.entanglements[1]|=k,y&=~k}Dn(c),(lt&6)===0&&(Li=Oe()+500,Cr(0))}}break;case 31:case 13:j=Ua(c,2),j!==null&&en(j,c,2),Ii(),Su(c,2)}if(c=Au(l),c===null&&ou(e,t,l,ls,n),c===i)break;i=c}i!==null&&l.stopPropagation()}else ou(e,t,l,null,n)}}function Au(e){return e=wo(e),Nu(e)}var ls=null;function Nu(e){if(ls=null,e=al(e),e!==null){var t=p(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=g(t),e!==null)return e;e=null}else if(n===31){if(e=x(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ls=e,null}function Dy(e){switch(e){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(it()){case Rt:return 2;case Kt:return 8;case Yt:case d:return 32;case H:return 268435456;default:return 32}default:return 32}}var wu=!1,Ea=null,Ca=null,ka=null,qr=new Map,Dr=new Map,_a=[],z1="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 zy(e,t){switch(e){case"focusin":case"focusout":Ea=null;break;case"dragenter":case"dragleave":Ca=null;break;case"mouseover":case"mouseout":ka=null;break;case"pointerover":case"pointerout":qr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dr.delete(t.pointerId)}}function zr(e,t,n,l,i,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:c,targetContainers:[i]},t!==null&&(t=ll(t),t!==null&&My(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function U1(e,t,n,l,i){switch(t){case"focusin":return Ea=zr(Ea,e,t,n,l,i),!0;case"dragenter":return Ca=zr(Ca,e,t,n,l,i),!0;case"mouseover":return ka=zr(ka,e,t,n,l,i),!0;case"pointerover":var c=i.pointerId;return qr.set(c,zr(qr.get(c)||null,e,t,n,l,i)),!0;case"gotpointercapture":return c=i.pointerId,Dr.set(c,zr(Dr.get(c)||null,e,t,n,l,i)),!0}return!1}function Uy(e){var t=al(e.target);if(t!==null){var n=p(t);if(n!==null){if(t=n.tag,t===13){if(t=g(n),t!==null){e.blockedOn=t,Pf(e.priority,function(){qy(n)});return}}else if(t===31){if(t=x(n),t!==null){e.blockedOn=t,Pf(e.priority,function(){qy(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function rs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Au(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);No=l,n.target.dispatchEvent(l),No=null}else return t=ll(n),t!==null&&My(t),e.blockedOn=n,!1;t.shift()}return!0}function Hy(e,t,n){rs(e)&&n.delete(t)}function H1(){wu=!1,Ea!==null&&rs(Ea)&&(Ea=null),Ca!==null&&rs(Ca)&&(Ca=null),ka!==null&&rs(ka)&&(ka=null),qr.forEach(Hy),Dr.forEach(Hy)}function is(e,t){e.blockedOn===t&&(e.blockedOn=null,wu||(wu=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,H1)))}var ss=null;function Ly(e){ss!==e&&(ss=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){ss===e&&(ss=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],i=e[t+2];if(typeof l!="function"){if(Nu(l||n)===null)continue;break}var c=ll(n);c!==null&&(e.splice(t,3),t-=3,Ac(c,{pending:!0,data:i,method:n.method,action:l},l,i))}}))}function Hl(e){function t(k){return is(k,e)}Ea!==null&&is(Ea,e),Ca!==null&&is(Ca,e),ka!==null&&is(ka,e),qr.forEach(t),Dr.forEach(t);for(var n=0;n<_a.length;n++){var l=_a[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<_a.length&&(n=_a[0],n.blockedOn===null);)Uy(n),n.blockedOn===null&&_a.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var i=n[l],c=n[l+1],y=i[Xt]||null;if(typeof c=="function")y||Ly(n);else if(y){var j=null;if(c&&c.hasAttribute("formAction")){if(i=c,y=c[Xt]||null)j=y.formAction;else if(Nu(i)!==null)continue}else j=y.action;typeof j=="function"?n[l+1]=j:(n.splice(l,3),l-=3),Ly(n)}}}function By(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(y){return i=y})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function Tu(e){this._internalRoot=e}os.prototype.render=Tu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,l=un();Ry(n,l,e,t,null,null)},os.prototype.unmount=Tu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ry(e.current,2,null,e,null,null),Ii(),t[nl]=null}};function os(e){this._internalRoot=e}os.prototype.unstable_scheduleHydration=function(e){if(e){var t=Jf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<_a.length&&t!==0&&t<_a[n].priority;n++);_a.splice(n,0,e),n===0&&Uy(e)}};var Iy=r.version;if(Iy!=="19.2.8")throw Error(u(527,Iy,"19.2.8"));ee.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=m(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var L1={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var cs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cs.isDisabled&&cs.supportsFiber)try{Z=cs.inject(L1),h=cs}catch{}}return Bl.createRoot=function(e,t){if(!f(e))throw Error(u(299));var n=!1,l="",i=Zm,c=Qm,y=Jm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError)),t=_y(e,1,!1,null,null,n,l,null,i,c,y,By),e[nl]=t.current,su(e),new Tu(t)},Bl.hydrateRoot=function(e,t,n){if(!f(e))throw Error(u(299));var l=!1,i="",c=Zm,y=Qm,j=Jm,k=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(y=n.onCaughtError),n.onRecoverableError!==void 0&&(j=n.onRecoverableError),n.formState!==void 0&&(k=n.formState)),t=_y(e,1,!0,t,n??null,l,i,k,c,y,j,By),t.context=Oy(null),n=t.current,l=un(),l=yo(l),i=ha(l),i.callback=null,ya(n,i,l),n=l,t.current.lanes=n,En(t,n),Dn(t),e[nl]=t.current,su(e),new os(t)},Bl.version="19.2.8",Bl}var Uu;function Py(){if(Uu)return ds.exports;Uu=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(r){console.error(r)}}return a(),ds.exports=Jy(),ds.exports}var Wy=Py(),W=hs();const gs=Cu(W);const eg=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tg=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,o,u)=>u?u.toUpperCase():o.toLowerCase()),Hu=a=>{const r=tg(a);return r.charAt(0).toUpperCase()+r.slice(1)},Lu=(...a)=>a.filter((r,o,u)=>!!r&&r.trim()!==""&&u.indexOf(r)===o).join(" ").trim(),ng=a=>{for(const r in a)if(r.startsWith("aria-")||r==="role"||r==="title")return!0};var ag={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 lg=W.forwardRef(({color:a="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:u,className:f="",children:p,iconNode:g,...x},b)=>W.createElement("svg",{ref:b,...ag,width:r,height:r,stroke:a,strokeWidth:u?Number(o)*24/Number(r):o,className:Lu("lucide",f),...!p&&!ng(x)&&{"aria-hidden":"true"},...x},[...g.map(([m,v])=>W.createElement(m,v)),...Array.isArray(p)?p:[p]]));const et=(a,r)=>{const o=W.forwardRef(({className:u,...f},p)=>W.createElement(lg,{ref:p,iconNode:r,className:Lu(`lucide-${eg(Hu(a))}`,`lucide-${a}`,u),...f}));return o.displayName=Hu(a),o};const Bu=et("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const rg=et("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Iu=et("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Yu=et("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const Ur=et("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const Gu=et("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const ig=et("circle-x",[["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"}]]);const xs=et("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const sg=et("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const bs=et("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const vs=et("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const og=et("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);const cg=et("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);const ug=et("library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);const Ss=et("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const dg=et("lock-open",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);const fg=et("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const pg=et("menu",[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]]);const Pa=et("play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const Ra=et("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const mg=et("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const hg=et("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const Fu=et("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const Vu=et("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);const yg=et("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const gg=et("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);const xg=et("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const Ku=et("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);const dn=et("trash-2",[["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"}]]);const bg=et("triangle-alert",[["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-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Xu=et("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);const Zu=et("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function vg(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Ht={},Hr={},aa={},Qu;function Il(){if(Qu)return aa;Qu=1;function a(g){return typeof g>"u"||g===null}function r(g){return typeof g=="object"&&g!==null}function o(g){return Array.isArray(g)?g:a(g)?[]:[g]}function u(g,x){if(x){const b=Object.keys(x);for(let m=0,v=b.length;m<v;m+=1){const S=b[m];g[S]=x[S]}}return g}function f(g,x){let b="";for(let m=0;m<x;m+=1)b+=g;return b}function p(g){return g===0&&Number.NEGATIVE_INFINITY===1/g}return aa.isNothing=a,aa.isObject=r,aa.toArray=o,aa.repeat=f,aa.isNegativeZero=p,aa.extend=u,aa}var js,Ju;function Yl(){if(Ju)return js;Ju=1;function a(o,u){let f="";const p=o.reason||"(unknown reason)";return o.mark?(o.mark.name&&(f+='in "'+o.mark.name+'" '),f+="("+(o.mark.line+1)+":"+(o.mark.column+1)+")",!u&&o.mark.snippet&&(f+=`
|
|
1
|
+
var FlexDocStandaloneBundle=(function(As){"use strict";var Xm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var id={exports:{}},ra={};var Qm;function I2(){if(Qm)return ra;Qm=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,s,a){var c=null;if(a!==void 0&&(c=""+a),s.key!==void 0&&(c=""+s.key),"key"in s){a={};for(var d in s)d!=="key"&&(a[d]=s[d])}else a=s;return s=a.ref,{$$typeof:t,type:r,key:c,ref:s!==void 0?s:null,props:a}}return ra.Fragment=e,ra.jsx=n,ra.jsxs=n,ra}var Wm;function U2(){return Wm||(Wm=1,id.exports=I2()),id.exports}var p=U2(),rd={exports:{}},sa={},sd={exports:{}},ld={};var Zm;function F2(){return Zm||(Zm=1,(function(t){function e(_,ee){var he=_.length;_.push(ee);e:for(;0<he;){var $=he-1>>>1,te=_[$];if(0<s(te,ee))_[$]=ee,_[he]=te,he=$;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var ee=_[0],he=_.pop();if(he!==ee){_[0]=he;e:for(var $=0,te=_.length,L=te>>>1;$<L;){var P=2*($+1)-1,ue=_[P],Se=P+1,Ne=_[Se];if(0>s(ue,he))Se<te&&0>s(Ne,ue)?(_[$]=Ne,_[Se]=he,$=Se):(_[$]=ue,_[P]=he,$=P);else if(Se<te&&0>s(Ne,he))_[$]=Ne,_[Se]=he,$=Se;else break e}}return ee}function s(_,ee){var he=_.sortIndex-ee.sortIndex;return he!==0?he:_.id-ee.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var c=Date,d=c.now();t.unstable_now=function(){return c.now()-d}}var f=[],h=[],g=1,b=null,v=3,S=!1,A=!1,C=!1,T=!1,D=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function O(_){for(var ee=n(h);ee!==null;){if(ee.callback===null)r(h);else if(ee.startTime<=_)r(h),ee.sortIndex=ee.expirationTime,e(f,ee);else break;ee=n(h)}}function R(_){if(C=!1,O(_),!A)if(n(f)!==null)A=!0,B||(B=!0,G());else{var ee=n(h);ee!==null&&xe(R,ee.startTime-_)}}var B=!1,M=-1,z=5,F=-1;function X(){return T?!0:!(t.unstable_now()-F<z)}function W(){if(T=!1,B){var _=t.unstable_now();F=_;var ee=!0;try{e:{A=!1,C&&(C=!1,j(M),M=-1),S=!0;var he=v;try{t:{for(O(_),b=n(f);b!==null&&!(b.expirationTime>_&&X());){var $=b.callback;if(typeof $=="function"){b.callback=null,v=b.priorityLevel;var te=$(b.expirationTime<=_);if(_=t.unstable_now(),typeof te=="function"){b.callback=te,O(_),ee=!0;break t}b===n(f)&&r(f),O(_)}else r(f);b=n(f)}if(b!==null)ee=!0;else{var L=n(h);L!==null&&xe(R,L.startTime-_),ee=!1}}break e}finally{b=null,v=he,S=!1}ee=void 0}}finally{ee?G():B=!1}}}var G;if(typeof E=="function")G=function(){E(W)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,ye=we.port2;we.port1.onmessage=W,G=function(){ye.postMessage(null)}}else G=function(){D(W,0)};function xe(_,ee){M=D(function(){_(t.unstable_now())},ee)}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(_){_.callback=null},t.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<_?Math.floor(1e3/_):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(_){switch(v){case 1:case 2:case 3:var ee=3;break;default:ee=v}var he=v;v=ee;try{return _()}finally{v=he}},t.unstable_requestPaint=function(){T=!0},t.unstable_runWithPriority=function(_,ee){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var he=v;v=_;try{return ee()}finally{v=he}},t.unstable_scheduleCallback=function(_,ee,he){var $=t.unstable_now();switch(typeof he=="object"&&he!==null?(he=he.delay,he=typeof he=="number"&&0<he?$+he:$):he=$,_){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=he+te,_={id:g++,callback:ee,priorityLevel:_,startTime:he,expirationTime:te,sortIndex:-1},he>$?(_.sortIndex=he,e(h,_),n(f)===null&&_===n(h)&&(C?(j(M),M=-1):C=!0,xe(R,he-$))):(_.sortIndex=te,e(f,_),A||S||(A=!0,B||(B=!0,G()))),_},t.unstable_shouldYield=X,t.unstable_wrapCallback=function(_){var ee=v;return function(){var he=v;v=ee;try{return _.apply(this,arguments)}finally{v=he}}}})(ld)),ld}var eg;function V2(){return eg||(eg=1,sd.exports=F2()),sd.exports}var ad={exports:{}},We={};var tg;function P2(){if(tg)return We;tg=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),v=Symbol.iterator;function S(L){return L===null||typeof L!="object"?null:(L=v&&L[v]||L["@@iterator"],typeof L=="function"?L:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,T={};function D(L,P,ue){this.props=L,this.context=P,this.refs=T,this.updater=ue||A}D.prototype.isReactComponent={},D.prototype.setState=function(L,P){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,P,"setState")},D.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function j(){}j.prototype=D.prototype;function E(L,P,ue){this.props=L,this.context=P,this.refs=T,this.updater=ue||A}var O=E.prototype=new j;O.constructor=E,C(O,D.prototype),O.isPureReactComponent=!0;var R=Array.isArray;function B(){}var M={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function F(L,P,ue){var Se=ue.ref;return{$$typeof:t,type:L,key:P,ref:Se!==void 0?Se:null,props:ue}}function X(L,P){return F(L.type,P,L.props)}function W(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function G(L){var P={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(ue){return P[ue]})}var we=/\/+/g;function ye(L,P){return typeof L=="object"&&L!==null&&L.key!=null?G(""+L.key):P.toString(36)}function xe(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(B,B):(L.status="pending",L.then(function(P){L.status==="pending"&&(L.status="fulfilled",L.value=P)},function(P){L.status==="pending"&&(L.status="rejected",L.reason=P)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function _(L,P,ue,Se,Ne){var Re=typeof L;(Re==="undefined"||Re==="boolean")&&(L=null);var Be=!1;if(L===null)Be=!0;else switch(Re){case"bigint":case"string":case"number":Be=!0;break;case"object":switch(L.$$typeof){case t:case e:Be=!0;break;case g:return Be=L._init,_(Be(L._payload),P,ue,Se,Ne)}}if(Be)return Ne=Ne(L),Be=Se===""?"."+ye(L,0):Se,R(Ne)?(ue="",Be!=null&&(ue=Be.replace(we,"$&/")+"/"),_(Ne,P,ue,"",function(Ke){return Ke})):Ne!=null&&(W(Ne)&&(Ne=X(Ne,ue+(Ne.key==null||L&&L.key===Ne.key?"":(""+Ne.key).replace(we,"$&/")+"/")+Be)),P.push(Ne)),1;Be=0;var Ze=Se===""?".":Se+":";if(R(L))for(var _e=0;_e<L.length;_e++)Se=L[_e],Re=Ze+ye(Se,_e),Be+=_(Se,P,ue,Re,Ne);else if(_e=S(L),typeof _e=="function")for(L=_e.call(L),_e=0;!(Se=L.next()).done;)Se=Se.value,Re=Ze+ye(Se,_e++),Be+=_(Se,P,ue,Re,Ne);else if(Re==="object"){if(typeof L.then=="function")return _(xe(L),P,ue,Se,Ne);throw P=String(L),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return Be}function ee(L,P,ue){if(L==null)return L;var Se=[],Ne=0;return _(L,Se,"","",function(Re){return P.call(ue,Re,Ne++)}),Se}function he(L){if(L._status===-1){var P=L._result;P=P(),P.then(function(ue){(L._status===0||L._status===-1)&&(L._status=1,L._result=ue)},function(ue){(L._status===0||L._status===-1)&&(L._status=2,L._result=ue)}),L._status===-1&&(L._status=0,L._result=P)}if(L._status===1)return L._result.default;throw L._result}var $=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},te={map:ee,forEach:function(L,P,ue){ee(L,function(){P.apply(this,arguments)},ue)},count:function(L){var P=0;return ee(L,function(){P++}),P},toArray:function(L){return ee(L,function(P){return P})||[]},only:function(L){if(!W(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return We.Activity=b,We.Children=te,We.Component=D,We.Fragment=n,We.Profiler=s,We.PureComponent=E,We.StrictMode=r,We.Suspense=f,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,We.__COMPILER_RUNTIME={__proto__:null,c:function(L){return M.H.useMemoCache(L)}},We.cache=function(L){return function(){return L.apply(null,arguments)}},We.cacheSignal=function(){return null},We.cloneElement=function(L,P,ue){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var Se=C({},L.props),Ne=L.key;if(P!=null)for(Re in P.key!==void 0&&(Ne=""+P.key),P)!z.call(P,Re)||Re==="key"||Re==="__self"||Re==="__source"||Re==="ref"&&P.ref===void 0||(Se[Re]=P[Re]);var Re=arguments.length-2;if(Re===1)Se.children=ue;else if(1<Re){for(var Be=Array(Re),Ze=0;Ze<Re;Ze++)Be[Ze]=arguments[Ze+2];Se.children=Be}return F(L.type,Ne,Se)},We.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:a,_context:L},L},We.createElement=function(L,P,ue){var Se,Ne={},Re=null;if(P!=null)for(Se in P.key!==void 0&&(Re=""+P.key),P)z.call(P,Se)&&Se!=="key"&&Se!=="__self"&&Se!=="__source"&&(Ne[Se]=P[Se]);var Be=arguments.length-2;if(Be===1)Ne.children=ue;else if(1<Be){for(var Ze=Array(Be),_e=0;_e<Be;_e++)Ze[_e]=arguments[_e+2];Ne.children=Ze}if(L&&L.defaultProps)for(Se in Be=L.defaultProps,Be)Ne[Se]===void 0&&(Ne[Se]=Be[Se]);return F(L,Re,Ne)},We.createRef=function(){return{current:null}},We.forwardRef=function(L){return{$$typeof:d,render:L}},We.isValidElement=W,We.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:he}},We.memo=function(L,P){return{$$typeof:h,type:L,compare:P===void 0?null:P}},We.startTransition=function(L){var P=M.T,ue={};M.T=ue;try{var Se=L(),Ne=M.S;Ne!==null&&Ne(ue,Se),typeof Se=="object"&&Se!==null&&typeof Se.then=="function"&&Se.then(B,$)}catch(Re){$(Re)}finally{P!==null&&ue.types!==null&&(P.types=ue.types),M.T=P}},We.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},We.use=function(L){return M.H.use(L)},We.useActionState=function(L,P,ue){return M.H.useActionState(L,P,ue)},We.useCallback=function(L,P){return M.H.useCallback(L,P)},We.useContext=function(L){return M.H.useContext(L)},We.useDebugValue=function(){},We.useDeferredValue=function(L,P){return M.H.useDeferredValue(L,P)},We.useEffect=function(L,P){return M.H.useEffect(L,P)},We.useEffectEvent=function(L){return M.H.useEffectEvent(L)},We.useId=function(){return M.H.useId()},We.useImperativeHandle=function(L,P,ue){return M.H.useImperativeHandle(L,P,ue)},We.useInsertionEffect=function(L,P){return M.H.useInsertionEffect(L,P)},We.useLayoutEffect=function(L,P){return M.H.useLayoutEffect(L,P)},We.useMemo=function(L,P){return M.H.useMemo(L,P)},We.useOptimistic=function(L,P){return M.H.useOptimistic(L,P)},We.useReducer=function(L,P,ue){return M.H.useReducer(L,P,ue)},We.useRef=function(L){return M.H.useRef(L)},We.useState=function(L){return M.H.useState(L)},We.useSyncExternalStore=function(L,P,ue){return M.H.useSyncExternalStore(L,P,ue)},We.useTransition=function(){return M.H.useTransition()},We.version="19.2.8",We}var ng;function od(){return ng||(ng=1,ad.exports=P2()),ad.exports}var cd={exports:{}},xn={};var ig;function K2(){if(ig)return xn;ig=1;var t=od();function e(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+h+" 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},s=Symbol.for("react.portal");function a(f,h,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:b==null?null:""+b,children:f,containerInfo:h,implementation:g}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return xn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,xn.createPortal=function(f,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return a(f,h,null,g)},xn.flushSync=function(f){var h=c.T,g=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=h,r.p=g,r.d.f()}},xn.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},xn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},xn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var g=h.as,b=d(g,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,S=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:b,integrity:v,fetchPriority:S}):g==="script"&&r.d.X(f,{crossOrigin:b,integrity:v,fetchPriority:S,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},xn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=d(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},xn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,b=d(g,h.crossOrigin);r.d.L(f,g,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},xn.preloadModule=function(f,h){if(typeof f=="string")if(h){var g=d(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},xn.requestFormReset=function(f){r.d.r(f)},xn.unstable_batchedUpdates=function(f,h){return f(h)},xn.useFormState=function(f,h,g){return c.H.useFormState(f,h,g)},xn.useFormStatus=function(){return c.H.useHostTransitionStatus()},xn.version="19.2.8",xn}var rg;function Y2(){if(rg)return cd.exports;rg=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(),cd.exports=K2(),cd.exports}var sg;function G2(){if(sg)return sa;sg=1;var t=V2(),e=od(),n=Y2();function r(i){var l="https://react.dev/errors/"+i;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)l+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function a(i){var l=i,o=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(o=l.return),i=l.return;while(i)}return l.tag===3?o:null}function c(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function d(i){if(i.tag===31){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function f(i){if(a(i)!==i)throw Error(r(188))}function h(i){var l=i.alternate;if(!l){if(l=a(i),l===null)throw Error(r(188));return l!==i?null:i}for(var o=i,u=l;;){var m=o.return;if(m===null)break;var y=m.alternate;if(y===null){if(u=m.return,u!==null){o=u;continue}break}if(m.child===y.child){for(y=m.child;y;){if(y===o)return f(m),i;if(y===u)return f(m),l;y=y.sibling}throw Error(r(188))}if(o.return!==u.return)o=m,u=y;else{for(var w=!1,N=m.child;N;){if(N===o){w=!0,o=m,u=y;break}if(N===u){w=!0,u=m,o=y;break}N=N.sibling}if(!w){for(N=y.child;N;){if(N===o){w=!0,o=y,u=m;break}if(N===u){w=!0,u=y,o=m;break}N=N.sibling}if(!w)throw Error(r(189))}}if(o.alternate!==u)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?i:l}function g(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i;for(i=i.child;i!==null;){if(l=g(i),l!==null)return l;i=i.sibling}return null}var b=Object.assign,v=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),E=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function G(i){return i===null||typeof i!="object"?null:(i=W&&i[W]||i["@@iterator"],typeof i=="function"?i:null)}var we=Symbol.for("react.client.reference");function ye(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===we?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case D:return"Profiler";case T:return"StrictMode";case R:return"Suspense";case B:return"SuspenseList";case F:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case A:return"Portal";case E:return i.displayName||"Context";case j:return(i._context.displayName||"Context")+".Consumer";case O:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case M:return l=i.displayName||null,l!==null?l:ye(i.type)||"Memo";case z:l=i._payload,i=i._init;try{return ye(i(l))}catch{}}return null}var xe=Array.isArray,_=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he={pending:!1,data:null,method:null,action:null},$=[],te=-1;function L(i){return{current:i}}function P(i){0>te||(i.current=$[te],$[te]=null,te--)}function ue(i,l){te++,$[te]=i.current,i.current=l}var Se=L(null),Ne=L(null),Re=L(null),Be=L(null);function Ze(i,l){switch(ue(Re,l),ue(Ne,i),ue(Se,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?o2(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=o2(l),i=c2(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}P(Se),ue(Se,i)}function _e(){P(Se),P(Ne),P(Re)}function Ke(i){i.memoizedState!==null&&ue(Be,i);var l=Se.current,o=c2(l,i.type);l!==o&&(ue(Ne,i),ue(Se,o))}function gt(i){Ne.current===i&&(P(Se),P(Ne)),Be.current===i&&(P(Be),Co._currentValue=he)}var se,de;function ge(i){if(se===void 0)try{throw Error()}catch(o){var l=o.stack.trim().match(/\n( *(at )?)/);se=l&&l[1]||"",de=-1<o.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+se+i+de}var Te=!1;function Ie(i,l){if(!i||Te)return"";Te=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(l){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(ce){var re=ce}Reflect.construct(i,[],ve)}else{try{ve.call()}catch(ce){re=ce}i.call(ve.prototype)}}else{try{throw Error()}catch(ce){re=ce}(ve=i())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(ce){if(ce&&re&&typeof ce.stack=="string")return[ce.stack,re.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=u.DetermineComponentFrameRoot(),w=y[0],N=y[1];if(w&&N){var q=w.split(`
|
|
4
|
+
`),ie=N.split(`
|
|
5
|
+
`);for(m=u=0;u<q.length&&!q[u].includes("DetermineComponentFrameRoot");)u++;for(;m<ie.length&&!ie[m].includes("DetermineComponentFrameRoot");)m++;if(u===q.length||m===ie.length)for(u=q.length-1,m=ie.length-1;1<=u&&0<=m&&q[u]!==ie[m];)m--;for(;1<=u&&0<=m;u--,m--)if(q[u]!==ie[m]){if(u!==1||m!==1)do if(u--,m--,0>m||q[u]!==ie[m]){var me=`
|
|
6
|
+
`+q[u].replace(" at new "," at ");return i.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",i.displayName)),me}while(1<=u&&0<=m);break}}}finally{Te=!1,Error.prepareStackTrace=o}return(o=i?i.displayName||i.name:"")?ge(o):""}function Xe(i,l){switch(i.tag){case 26:case 27:case 5:return ge(i.type);case 16:return ge("Lazy");case 13:return i.child!==l&&l!==null?ge("Suspense Fallback"):ge("Suspense");case 19:return ge("SuspenseList");case 0:case 15:return Ie(i.type,!1);case 11:return Ie(i.type.render,!1);case 1:return Ie(i.type,!0);case 31:return ge("Activity");default:return""}}function ht(i){try{var l="",o=null;do l+=Xe(i,o),o=i,i=i.return;while(i);return l}catch(u){return`
|
|
7
|
+
Error generating stack: `+u.message+`
|
|
8
|
+
`+u.stack}}var Pt=Object.prototype.hasOwnProperty,rn=t.unstable_scheduleCallback,sn=t.unstable_cancelCallback,qn=t.unstable_shouldYield,Cn=t.unstable_requestPaint,lt=t.unstable_now,pi=t.unstable_getCurrentPriorityLevel,Mn=t.unstable_ImmediatePriority,Jn=t.unstable_UserBlockingPriority,Tt=t.unstable_NormalPriority,x=t.unstable_LowPriority,V=t.unstable_IdlePriority,pe=t.log,le=t.unstable_setDisableYieldValue,oe=null,k=null;function J(i){if(typeof pe=="function"&&le(i),k&&typeof k.setStrictMode=="function")try{k.setStrictMode(oe,i)}catch{}}var Z=Math.clz32?Math.clz32:Ae,K=Math.log,Q=Math.LN2;function Ae(i){return i>>>=0,i===0?32:31-(K(i)/Q|0)|0}var fe=256,ke=262144,je=4194304;function De(i){var l=i&42;if(l!==0)return l;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function $e(i,l,o){var u=i.pendingLanes;if(u===0)return 0;var m=0,y=i.suspendedLanes,w=i.pingedLanes;i=i.warmLanes;var N=u&134217727;return N!==0?(u=N&~y,u!==0?m=De(u):(w&=N,w!==0?m=De(w):o||(o=N&~i,o!==0&&(m=De(o))))):(N=u&~y,N!==0?m=De(N):w!==0?m=De(w):o||(o=u&~i,o!==0&&(m=De(o)))),m===0?0:l!==0&&l!==m&&(l&y)===0&&(y=m&-m,o=l&-l,y>=o||y===32&&(o&4194048)!==0)?l:m}function ze(i,l){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&l)===0}function Je(i,l){switch(i){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 Rn(){var i=je;return je<<=1,(je&62914560)===0&&(je=4194304),i}function Dn(i){for(var l=[],o=0;31>o;o++)l.push(i);return l}function Kt(i,l){i.pendingLanes|=l,l!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function _i(i,l,o,u,m,y){var w=i.pendingLanes;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=o,i.entangledLanes&=o,i.errorRecoveryDisabledLanes&=o,i.shellSuspendCounter=0;var N=i.entanglements,q=i.expirationTimes,ie=i.hiddenUpdates;for(o=w&~o;0<o;){var me=31-Z(o),ve=1<<me;N[me]=0,q[me]=-1;var re=ie[me];if(re!==null)for(ie[me]=null,me=0;me<re.length;me++){var ce=re[me];ce!==null&&(ce.lane&=-536870913)}o&=~ve}u!==0&&or(i,u,0),y!==0&&m===0&&i.tag!==0&&(i.suspendedLanes|=y&~(w&~l))}function or(i,l,o){i.pendingLanes|=l,i.suspendedLanes&=~l;var u=31-Z(l);i.entangledLanes|=l,i.entanglements[u]=i.entanglements[u]|1073741824|o&261930}function Me(i,l){var o=i.entangledLanes|=l;for(i=i.entanglements;o;){var u=31-Z(o),m=1<<u;m&l|i[u]&l&&(i[u]|=l),o&=~m}}function Qe(i,l){var o=l&-l;return o=(o&42)!==0?1:Yt(o),(o&(i.suspendedLanes|l))!==0?0:o}function Yt(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function mi(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Li(){var i=ee.p;return i!==0?i:(i=window.event,i===void 0?32:R2(i.type))}function Wr(i,l){var o=ee.p;try{return ee.p=i,l()}finally{ee.p=o}}var Qn=Math.random().toString(36).slice(2),_t="__reactFiber$"+Qn,It="__reactProps$"+Qn,gi="__reactContainer$"+Qn,cr="__reactEvents$"+Qn,yi="__reactListeners$"+Qn,Vc="__reactHandles$"+Qn,Ha="__reactResources$"+Qn,Ji="__reactMarker$"+Qn;function Al(i){delete i[_t],delete i[It],delete i[cr],delete i[yi],delete i[Vc]}function zn(i){var l=i[_t];if(l)return l;for(var o=i.parentNode;o;){if(l=o[gi]||o[_t]){if(o=l.alternate,l.child!==null||o!==null&&o.child!==null)for(i=g2(i);i!==null;){if(o=i[_t])return o;i=g2(i)}return l}i=o,o=i.parentNode}return null}function ur(i){if(i=i[_t]||i[gi]){var l=i.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return i}return null}function Bs(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i.stateNode;throw Error(r(33))}function Zr(i){var l=i[Ha];return l||(l=i[Ha]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Ut(i){i[Ji]=!0}var H=new Set,ae={};function Ge(i,l){Hn(i,l),Hn(i+"Capture",l)}function Hn(i,l){for(ae[i]=l,i=0;i<l.length;i++)H.add(l[i])}var $s=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]*$"),kl={},Zv={};function C3(i){return Pt.call(Zv,i)?!0:Pt.call(kl,i)?!1:$s.test(i)?Zv[i]=!0:(kl[i]=!0,!1)}function Pc(i,l,o){if(C3(l))if(o===null)i.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":i.removeAttribute(l);return;case"boolean":var u=l.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){i.removeAttribute(l);return}}i.setAttribute(l,""+o)}}function Kc(i,l,o){if(o===null)i.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttribute(l,""+o)}}function dr(i,l,o,u){if(u===null)i.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttributeNS(l,o,""+u)}}function bi(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function e1(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function N3(i,l,o){var u=Object.getOwnPropertyDescriptor(i.constructor.prototype,l);if(!i.hasOwnProperty(l)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var m=u.get,y=u.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return m.call(this)},set:function(w){o=""+w,y.call(this,w)}}),Object.defineProperty(i,l,{enumerable:u.enumerable}),{getValue:function(){return o},setValue:function(w){o=""+w},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function Uh(i){if(!i._valueTracker){var l=e1(i)?"checked":"value";i._valueTracker=N3(i,l,""+i[l])}}function t1(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var o=l.getValue(),u="";return i&&(u=e1(i)?i.checked?"true":"false":i.value),i=u,i!==o?(l.setValue(i),!0):!1}function Yc(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var T3=/[\n"\\]/g;function xi(i){return i.replace(T3,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Fh(i,l,o,u,m,y,w,N){i.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?i.type=w:i.removeAttribute("type"),l!=null?w==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+bi(l)):i.value!==""+bi(l)&&(i.value=""+bi(l)):w!=="submit"&&w!=="reset"||i.removeAttribute("value"),l!=null?Vh(i,w,bi(l)):o!=null?Vh(i,w,bi(o)):u!=null&&i.removeAttribute("value"),m==null&&y!=null&&(i.defaultChecked=!!y),m!=null&&(i.checked=m&&typeof m!="function"&&typeof m!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.name=""+bi(N):i.removeAttribute("name")}function n1(i,l,o,u,m,y,w,N){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(i.type=y),l!=null||o!=null){if(!(y!=="submit"&&y!=="reset"||l!=null)){Uh(i);return}o=o!=null?""+bi(o):"",l=l!=null?""+bi(l):o,N||l===i.value||(i.value=l),i.defaultValue=l}u=u??m,u=typeof u!="function"&&typeof u!="symbol"&&!!u,i.checked=N?i.checked:!!u,i.defaultChecked=!!u,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(i.name=w),Uh(i)}function Vh(i,l,o){l==="number"&&Yc(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function Cl(i,l,o,u){if(i=i.options,l){l={};for(var m=0;m<o.length;m++)l["$"+o[m]]=!0;for(o=0;o<i.length;o++)m=l.hasOwnProperty("$"+i[o].value),i[o].selected!==m&&(i[o].selected=m),m&&u&&(i[o].defaultSelected=!0)}else{for(o=""+bi(o),l=null,m=0;m<i.length;m++){if(i[m].value===o){i[m].selected=!0,u&&(i[m].defaultSelected=!0);return}l!==null||i[m].disabled||(l=i[m])}l!==null&&(l.selected=!0)}}function i1(i,l,o){if(l!=null&&(l=""+bi(l),l!==i.value&&(i.value=l),o==null)){i.defaultValue!==l&&(i.defaultValue=l);return}i.defaultValue=o!=null?""+bi(o):""}function r1(i,l,o,u){if(l==null){if(u!=null){if(o!=null)throw Error(r(92));if(xe(u)){if(1<u.length)throw Error(r(93));u=u[0]}o=u}o==null&&(o=""),l=o}o=bi(l),i.defaultValue=o,u=i.textContent,u===o&&u!==""&&u!==null&&(i.value=u),Uh(i)}function Nl(i,l){if(l){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=l;return}}i.textContent=l}var j3=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 s1(i,l,o){var u=l.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="":u?i.setProperty(l,o):typeof o!="number"||o===0||j3.has(l)?l==="float"?i.cssFloat=o:i[l]=(""+o).trim():i[l]=o+"px"}function l1(i,l,o){if(l!=null&&typeof l!="object")throw Error(r(62));if(i=i.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||l!=null&&l.hasOwnProperty(u)||(u.indexOf("--")===0?i.setProperty(u,""):u==="float"?i.cssFloat="":i[u]="");for(var m in l)u=l[m],l.hasOwnProperty(m)&&o[m]!==u&&s1(i,m,u)}else for(var y in l)l.hasOwnProperty(y)&&s1(i,y,l[y])}function Ph(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var E3=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"]]),O3=/^[\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 Gc(i){return O3.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function fr(){}var Kh=null;function Yh(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Tl=null,jl=null;function a1(i){var l=ur(i);if(l&&(i=l.stateNode)){var o=i[It]||null;e:switch(i=l.stateNode,l.type){case"input":if(Fh(i,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),l=o.name,o.type==="radio"&&l!=null){for(o=i;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+xi(""+l)+'"][type="radio"]'),l=0;l<o.length;l++){var u=o[l];if(u!==i&&u.form===i.form){var m=u[It]||null;if(!m)throw Error(r(90));Fh(u,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(l=0;l<o.length;l++)u=o[l],u.form===i.form&&t1(u)}break e;case"textarea":i1(i,o.value,o.defaultValue);break e;case"select":l=o.value,l!=null&&Cl(i,!!o.multiple,l,!1)}}}var Gh=!1;function o1(i,l,o){if(Gh)return i(l,o);Gh=!0;try{var u=i(l);return u}finally{if(Gh=!1,(Tl!==null||jl!==null)&&(Lu(),Tl&&(l=Tl,i=jl,jl=Tl=null,a1(l),i)))for(l=0;l<i.length;l++)a1(i[l])}}function Ia(i,l){var o=i.stateNode;if(o===null)return null;var u=o[It]||null;if(u===null)return null;o=u[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":(u=!u.disabled)||(i=i.type,u=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!u;break e;default:i=!1}if(i)return null;if(o&&typeof o!="function")throw Error(r(231,l,typeof o));return o}var hr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xh=!1;if(hr)try{var Ua={};Object.defineProperty(Ua,"passive",{get:function(){Xh=!0}}),window.addEventListener("test",Ua,Ua),window.removeEventListener("test",Ua,Ua)}catch{Xh=!1}var es=null,Jh=null,Xc=null;function c1(){if(Xc)return Xc;var i,l=Jh,o=l.length,u,m="value"in es?es.value:es.textContent,y=m.length;for(i=0;i<o&&l[i]===m[i];i++);var w=o-i;for(u=1;u<=w&&l[o-u]===m[y-u];u++);return Xc=m.slice(i,1<u?1-u:void 0)}function Jc(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function Qc(){return!0}function u1(){return!1}function In(i){function l(o,u,m,y,w){this._reactName=o,this._targetInst=m,this.type=u,this.nativeEvent=y,this.target=w,this.currentTarget=null;for(var N in i)i.hasOwnProperty(N)&&(o=i[N],this[N]=o?o(y):y[N]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Qc:u1,this.isPropagationStopped=u1,this}return b(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Qc)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Qc)},persist:function(){},isPersistent:Qc}),l}var qs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wc=In(qs),Fa=b({},qs,{view:0,detail:0}),M3=In(Fa),Qh,Wh,Va,Zc=b({},Fa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ep,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Va&&(Va&&i.type==="mousemove"?(Qh=i.screenX-Va.screenX,Wh=i.screenY-Va.screenY):Wh=Qh=0,Va=i),Qh)},movementY:function(i){return"movementY"in i?i.movementY:Wh}}),d1=In(Zc),R3=b({},Zc,{dataTransfer:0}),D3=In(R3),_3=b({},Fa,{relatedTarget:0}),Zh=In(_3),L3=b({},qs,{animationName:0,elapsedTime:0,pseudoElement:0}),B3=In(L3),$3=b({},qs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),q3=In($3),z3=b({},qs,{data:0}),f1=In(z3),H3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},I3={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"},U3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function F3(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=U3[i])?!!l[i]:!1}function ep(){return F3}var V3=b({},Fa,{key:function(i){if(i.key){var l=H3[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=Jc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?I3[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ep,charCode:function(i){return i.type==="keypress"?Jc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Jc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),P3=In(V3),K3=b({},Zc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),h1=In(K3),Y3=b({},Fa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ep}),G3=In(Y3),X3=b({},qs,{propertyName:0,elapsedTime:0,pseudoElement:0}),J3=In(X3),Q3=b({},Zc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),W3=In(Q3),Z3=b({},qs,{newState:0,oldState:0}),eM=In(Z3),tM=[9,13,27,32],tp=hr&&"CompositionEvent"in window,Pa=null;hr&&"documentMode"in document&&(Pa=document.documentMode);var nM=hr&&"TextEvent"in window&&!Pa,p1=hr&&(!tp||Pa&&8<Pa&&11>=Pa),m1=" ",g1=!1;function y1(i,l){switch(i){case"keyup":return tM.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function b1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var El=!1;function iM(i,l){switch(i){case"compositionend":return b1(l);case"keypress":return l.which!==32?null:(g1=!0,m1);case"textInput":return i=l.data,i===m1&&g1?null:i;default:return null}}function rM(i,l){if(El)return i==="compositionend"||!tp&&y1(i,l)?(i=c1(),Xc=Jh=es=null,El=!1,i):null;switch(i){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 p1&&l.locale!=="ko"?null:l.data;default:return null}}var sM={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 x1(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!sM[i.type]:l==="textarea"}function v1(i,l,o,u){Tl?jl?jl.push(u):jl=[u]:Tl=u,l=Uu(l,"onChange"),0<l.length&&(o=new Wc("onChange","change",null,o,u),i.push({event:o,listeners:l}))}var Ka=null,Ya=null;function lM(i){n2(i,0)}function eu(i){var l=Bs(i);if(t1(l))return i}function w1(i,l){if(i==="change")return l}var S1=!1;if(hr){var np;if(hr){var ip="oninput"in document;if(!ip){var A1=document.createElement("div");A1.setAttribute("oninput","return;"),ip=typeof A1.oninput=="function"}np=ip}else np=!1;S1=np&&(!document.documentMode||9<document.documentMode)}function k1(){Ka&&(Ka.detachEvent("onpropertychange",C1),Ya=Ka=null)}function C1(i){if(i.propertyName==="value"&&eu(Ya)){var l=[];v1(l,Ya,i,Yh(i)),o1(lM,l)}}function aM(i,l,o){i==="focusin"?(k1(),Ka=l,Ya=o,Ka.attachEvent("onpropertychange",C1)):i==="focusout"&&k1()}function oM(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return eu(Ya)}function cM(i,l){if(i==="click")return eu(l)}function uM(i,l){if(i==="input"||i==="change")return eu(l)}function dM(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var Wn=typeof Object.is=="function"?Object.is:dM;function Ga(i,l){if(Wn(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var o=Object.keys(i),u=Object.keys(l);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var m=o[u];if(!Pt.call(l,m)||!Wn(i[m],l[m]))return!1}return!0}function N1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function T1(i,l){var o=N1(i);i=0;for(var u;o;){if(o.nodeType===3){if(u=i+o.textContent.length,i<=l&&u>=l)return{node:o,offset:l-i};i=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=N1(o)}}function j1(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?j1(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function E1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var l=Yc(i.document);l instanceof i.HTMLIFrameElement;){try{var o=typeof l.contentWindow.location.href=="string"}catch{o=!1}if(o)i=l.contentWindow;else break;l=Yc(i.document)}return l}function rp(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}var fM=hr&&"documentMode"in document&&11>=document.documentMode,Ol=null,sp=null,Xa=null,lp=!1;function O1(i,l,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;lp||Ol==null||Ol!==Yc(u)||(u=Ol,"selectionStart"in u&&rp(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Xa&&Ga(Xa,u)||(Xa=u,u=Uu(sp,"onSelect"),0<u.length&&(l=new Wc("onSelect","select",null,l,o),i.push({event:l,listeners:u}),l.target=Ol)))}function zs(i,l){var o={};return o[i.toLowerCase()]=l.toLowerCase(),o["Webkit"+i]="webkit"+l,o["Moz"+i]="moz"+l,o}var Ml={animationend:zs("Animation","AnimationEnd"),animationiteration:zs("Animation","AnimationIteration"),animationstart:zs("Animation","AnimationStart"),transitionrun:zs("Transition","TransitionRun"),transitionstart:zs("Transition","TransitionStart"),transitioncancel:zs("Transition","TransitionCancel"),transitionend:zs("Transition","TransitionEnd")},ap={},M1={};hr&&(M1=document.createElement("div").style,"AnimationEvent"in window||(delete Ml.animationend.animation,delete Ml.animationiteration.animation,delete Ml.animationstart.animation),"TransitionEvent"in window||delete Ml.transitionend.transition);function Hs(i){if(ap[i])return ap[i];if(!Ml[i])return i;var l=Ml[i],o;for(o in l)if(l.hasOwnProperty(o)&&o in M1)return ap[i]=l[o];return i}var R1=Hs("animationend"),D1=Hs("animationiteration"),_1=Hs("animationstart"),hM=Hs("transitionrun"),pM=Hs("transitionstart"),mM=Hs("transitioncancel"),L1=Hs("transitionend"),B1=new Map,op="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(" ");op.push("scrollEnd");function Bi(i,l){B1.set(i,l),Ge(l,[i])}var tu=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},vi=[],Rl=0,cp=0;function nu(){for(var i=Rl,l=cp=Rl=0;l<i;){var o=vi[l];vi[l++]=null;var u=vi[l];vi[l++]=null;var m=vi[l];vi[l++]=null;var y=vi[l];if(vi[l++]=null,u!==null&&m!==null){var w=u.pending;w===null?m.next=m:(m.next=w.next,w.next=m),u.pending=m}y!==0&&$1(o,m,y)}}function iu(i,l,o,u){vi[Rl++]=i,vi[Rl++]=l,vi[Rl++]=o,vi[Rl++]=u,cp|=u,i.lanes|=u,i=i.alternate,i!==null&&(i.lanes|=u)}function up(i,l,o,u){return iu(i,l,o,u),ru(i)}function Is(i,l){return iu(i,null,null,l),ru(i)}function $1(i,l,o){i.lanes|=o;var u=i.alternate;u!==null&&(u.lanes|=o);for(var m=!1,y=i.return;y!==null;)y.childLanes|=o,u=y.alternate,u!==null&&(u.childLanes|=o),y.tag===22&&(i=y.stateNode,i===null||i._visibility&1||(m=!0)),i=y,y=y.return;return i.tag===3?(y=i.stateNode,m&&l!==null&&(m=31-Z(o),i=y.hiddenUpdates,u=i[m],u===null?i[m]=[l]:u.push(l),l.lane=o|536870912),y):null}function ru(i){if(50<bo)throw bo=0,xm=null,Error(r(185));for(var l=i.return;l!==null;)i=l,l=i.return;return i.tag===3?i.stateNode:null}var Dl={};function gM(i,l,o,u){this.tag=i,this.key=o,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=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zn(i,l,o,u){return new gM(i,l,o,u)}function dp(i){return i=i.prototype,!(!i||!i.isReactComponent)}function pr(i,l){var o=i.alternate;return o===null?(o=Zn(i.tag,l,i.key,i.mode),o.elementType=i.elementType,o.type=i.type,o.stateNode=i.stateNode,o.alternate=i,i.alternate=o):(o.pendingProps=l,o.type=i.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=i.flags&65011712,o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,l=i.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},o.sibling=i.sibling,o.index=i.index,o.ref=i.ref,o.refCleanup=i.refCleanup,o}function q1(i,l){i.flags&=65011714;var o=i.alternate;return o===null?(i.childLanes=0,i.lanes=l,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,l=o.dependencies,i.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),i}function su(i,l,o,u,m,y){var w=0;if(u=i,typeof i=="function")dp(i)&&(w=1);else if(typeof i=="string")w=wR(i,o,Se.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case F:return i=Zn(31,o,l,m),i.elementType=F,i.lanes=y,i;case C:return Us(o.children,m,y,l);case T:w=8,m|=24;break;case D:return i=Zn(12,o,l,m|2),i.elementType=D,i.lanes=y,i;case R:return i=Zn(13,o,l,m),i.elementType=R,i.lanes=y,i;case B:return i=Zn(19,o,l,m),i.elementType=B,i.lanes=y,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case E:w=10;break e;case j:w=9;break e;case O:w=11;break e;case M:w=14;break e;case z:w=16,u=null;break e}w=29,o=Error(r(130,i===null?"null":typeof i,"")),u=null}return l=Zn(w,o,l,m),l.elementType=i,l.type=u,l.lanes=y,l}function Us(i,l,o,u){return i=Zn(7,i,u,l),i.lanes=o,i}function fp(i,l,o){return i=Zn(6,i,null,l),i.lanes=o,i}function z1(i){var l=Zn(18,null,null,0);return l.stateNode=i,l}function hp(i,l,o){return l=Zn(4,i.children!==null?i.children:[],i.key,l),l.lanes=o,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}var H1=new WeakMap;function wi(i,l){if(typeof i=="object"&&i!==null){var o=H1.get(i);return o!==void 0?o:(l={value:i,source:l,stack:ht(l)},H1.set(i,l),l)}return{value:i,source:l,stack:ht(l)}}var _l=[],Ll=0,lu=null,Ja=0,Si=[],Ai=0,ts=null,Qi=1,Wi="";function mr(i,l){_l[Ll++]=Ja,_l[Ll++]=lu,lu=i,Ja=l}function I1(i,l,o){Si[Ai++]=Qi,Si[Ai++]=Wi,Si[Ai++]=ts,ts=i;var u=Qi;i=Wi;var m=32-Z(u)-1;u&=~(1<<m),o+=1;var y=32-Z(l)+m;if(30<y){var w=m-m%5;y=(u&(1<<w)-1).toString(32),u>>=w,m-=w,Qi=1<<32-Z(l)+m|o<<m|u,Wi=y+i}else Qi=1<<y|o<<m|u,Wi=i}function pp(i){i.return!==null&&(mr(i,1),I1(i,1,0))}function mp(i){for(;i===lu;)lu=_l[--Ll],_l[Ll]=null,Ja=_l[--Ll],_l[Ll]=null;for(;i===ts;)ts=Si[--Ai],Si[Ai]=null,Wi=Si[--Ai],Si[Ai]=null,Qi=Si[--Ai],Si[Ai]=null}function U1(i,l){Si[Ai++]=Qi,Si[Ai++]=Wi,Si[Ai++]=ts,Qi=l.id,Wi=l.overflow,ts=i}var mn=null,Ot=null,dt=!1,ns=null,ki=!1,gp=Error(r(519));function is(i){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qa(wi(l,i)),gp}function F1(i){var l=i.stateNode,o=i.type,u=i.memoizedProps;switch(l[_t]=i,l[It]=u,o){case"dialog":ot("cancel",l),ot("close",l);break;case"iframe":case"object":case"embed":ot("load",l);break;case"video":case"audio":for(o=0;o<vo.length;o++)ot(vo[o],l);break;case"source":ot("error",l);break;case"img":case"image":case"link":ot("error",l),ot("load",l);break;case"details":ot("toggle",l);break;case"input":ot("invalid",l),n1(l,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":ot("invalid",l);break;case"textarea":ot("invalid",l),r1(l,u.value,u.defaultValue,u.children)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||l.textContent===""+o||u.suppressHydrationWarning===!0||l2(l.textContent,o)?(u.popover!=null&&(ot("beforetoggle",l),ot("toggle",l)),u.onScroll!=null&&ot("scroll",l),u.onScrollEnd!=null&&ot("scrollend",l),u.onClick!=null&&(l.onclick=fr),l=!0):l=!1,l||is(i,!0)}function V1(i){for(mn=i.return;mn;)switch(mn.tag){case 5:case 31:case 13:ki=!1;return;case 27:case 3:ki=!0;return;default:mn=mn.return}}function Bl(i){if(i!==mn)return!1;if(!dt)return V1(i),dt=!0,!1;var l=i.tag,o;if((o=l!==3&&l!==27)&&((o=l===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||_m(i.type,i.memoizedProps)),o=!o),o&&Ot&&is(i),V1(i),l===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ot=m2(i)}else if(l===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ot=m2(i)}else l===27?(l=Ot,ys(i.type)?(i=zm,zm=null,Ot=i):Ot=l):Ot=mn?Ni(i.stateNode.nextSibling):null;return!0}function Fs(){Ot=mn=null,dt=!1}function yp(){var i=ns;return i!==null&&(Pn===null?Pn=i:Pn.push.apply(Pn,i),ns=null),i}function Qa(i){ns===null?ns=[i]:ns.push(i)}var bp=L(null),Vs=null,gr=null;function rs(i,l,o){ue(bp,l._currentValue),l._currentValue=o}function yr(i){i._currentValue=bp.current,P(bp)}function xp(i,l,o){for(;i!==null;){var u=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,u!==null&&(u.childLanes|=l)):u!==null&&(u.childLanes&l)!==l&&(u.childLanes|=l),i===o)break;i=i.return}}function vp(i,l,o,u){var m=i.child;for(m!==null&&(m.return=i);m!==null;){var y=m.dependencies;if(y!==null){var w=m.child;y=y.firstContext;e:for(;y!==null;){var N=y;y=m;for(var q=0;q<l.length;q++)if(N.context===l[q]){y.lanes|=o,N=y.alternate,N!==null&&(N.lanes|=o),xp(y.return,o,i),u||(w=null);break e}y=N.next}}else if(m.tag===18){if(w=m.return,w===null)throw Error(r(341));w.lanes|=o,y=w.alternate,y!==null&&(y.lanes|=o),xp(w,o,i),w=null}else w=m.child;if(w!==null)w.return=m;else for(w=m;w!==null;){if(w===i){w=null;break}if(m=w.sibling,m!==null){m.return=w.return,w=m;break}w=w.return}m=w}}function $l(i,l,o,u){i=null;for(var m=l,y=!1;m!==null;){if(!y){if((m.flags&524288)!==0)y=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var w=m.alternate;if(w===null)throw Error(r(387));if(w=w.memoizedProps,w!==null){var N=m.type;Wn(m.pendingProps.value,w.value)||(i!==null?i.push(N):i=[N])}}else if(m===Be.current){if(w=m.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(i!==null?i.push(Co):i=[Co])}m=m.return}i!==null&&vp(l,i,o,u),l.flags|=262144}function au(i){for(i=i.firstContext;i!==null;){if(!Wn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ps(i){Vs=i,gr=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function gn(i){return P1(Vs,i)}function ou(i,l){return Vs===null&&Ps(i),P1(i,l)}function P1(i,l){var o=l._currentValue;if(l={context:l,memoizedValue:o,next:null},gr===null){if(i===null)throw Error(r(308));gr=l,i.dependencies={lanes:0,firstContext:l},i.flags|=524288}else gr=gr.next=l;return o}var yM=typeof AbortController<"u"?AbortController:function(){var i=[],l=this.signal={aborted:!1,addEventListener:function(o,u){i.push(u)}};this.abort=function(){l.aborted=!0,i.forEach(function(o){return o()})}},bM=t.unstable_scheduleCallback,xM=t.unstable_NormalPriority,Gt={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wp(){return{controller:new yM,data:new Map,refCount:0}}function Wa(i){i.refCount--,i.refCount===0&&bM(xM,function(){i.controller.abort()})}var Za=null,Sp=0,ql=0,zl=null;function vM(i,l){if(Za===null){var o=Za=[];Sp=0,ql=Cm(),zl={status:"pending",value:void 0,then:function(u){o.push(u)}}}return Sp++,l.then(K1,K1),l}function K1(){if(--Sp===0&&Za!==null){zl!==null&&(zl.status="fulfilled");var i=Za;Za=null,ql=0,zl=null;for(var l=0;l<i.length;l++)(0,i[l])()}}function wM(i,l){var o=[],u={status:"pending",value:null,reason:null,then:function(m){o.push(m)}};return i.then(function(){u.status="fulfilled",u.value=l;for(var m=0;m<o.length;m++)(0,o[m])(l)},function(m){for(u.status="rejected",u.reason=m,m=0;m<o.length;m++)(0,o[m])(void 0)}),u}var Y1=_.S;_.S=function(i,l){OS=lt(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&vM(i,l),Y1!==null&&Y1(i,l)};var Ks=L(null);function Ap(){var i=Ks.current;return i!==null?i:jt.pooledCache}function cu(i,l){l===null?ue(Ks,Ks.current):ue(Ks,l.pool)}function G1(){var i=Ap();return i===null?null:{parent:Gt._currentValue,pool:i}}var Hl=Error(r(460)),kp=Error(r(474)),uu=Error(r(542)),du={then:function(){}};function X1(i){return i=i.status,i==="fulfilled"||i==="rejected"}function J1(i,l,o){switch(o=i[o],o===void 0?i.push(l):o!==l&&(l.then(fr,fr),l=o),l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,W1(i),i;default:if(typeof l.status=="string")l.then(fr,fr);else{if(i=jt,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=l,i.status="pending",i.then(function(u){if(l.status==="pending"){var m=l;m.status="fulfilled",m.value=u}},function(u){if(l.status==="pending"){var m=l;m.status="rejected",m.reason=u}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,W1(i),i}throw Gs=l,Hl}}function Ys(i){try{var l=i._init;return l(i._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Gs=o,Hl):o}}var Gs=null;function Q1(){if(Gs===null)throw Error(r(459));var i=Gs;return Gs=null,i}function W1(i){if(i===Hl||i===uu)throw Error(r(483))}var Il=null,eo=0;function fu(i){var l=eo;return eo+=1,Il===null&&(Il=[]),J1(Il,i,l)}function to(i,l){l=l.props.ref,i.ref=l!==void 0?l:null}function hu(i,l){throw l.$$typeof===v?Error(r(525)):(i=Object.prototype.toString.call(l),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i)))}function Z1(i){function l(Y,U){if(i){var ne=Y.deletions;ne===null?(Y.deletions=[U],Y.flags|=16):ne.push(U)}}function o(Y,U){if(!i)return null;for(;U!==null;)l(Y,U),U=U.sibling;return null}function u(Y){for(var U=new Map;Y!==null;)Y.key!==null?U.set(Y.key,Y):U.set(Y.index,Y),Y=Y.sibling;return U}function m(Y,U){return Y=pr(Y,U),Y.index=0,Y.sibling=null,Y}function y(Y,U,ne){return Y.index=ne,i?(ne=Y.alternate,ne!==null?(ne=ne.index,ne<U?(Y.flags|=67108866,U):ne):(Y.flags|=67108866,U)):(Y.flags|=1048576,U)}function w(Y){return i&&Y.alternate===null&&(Y.flags|=67108866),Y}function N(Y,U,ne,be){return U===null||U.tag!==6?(U=fp(ne,Y.mode,be),U.return=Y,U):(U=m(U,ne),U.return=Y,U)}function q(Y,U,ne,be){var Ue=ne.type;return Ue===C?me(Y,U,ne.props.children,be,ne.key):U!==null&&(U.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===z&&Ys(Ue)===U.type)?(U=m(U,ne.props),to(U,ne),U.return=Y,U):(U=su(ne.type,ne.key,ne.props,null,Y.mode,be),to(U,ne),U.return=Y,U)}function ie(Y,U,ne,be){return U===null||U.tag!==4||U.stateNode.containerInfo!==ne.containerInfo||U.stateNode.implementation!==ne.implementation?(U=hp(ne,Y.mode,be),U.return=Y,U):(U=m(U,ne.children||[]),U.return=Y,U)}function me(Y,U,ne,be,Ue){return U===null||U.tag!==7?(U=Us(ne,Y.mode,be,Ue),U.return=Y,U):(U=m(U,ne),U.return=Y,U)}function ve(Y,U,ne){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=fp(""+U,Y.mode,ne),U.return=Y,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case S:return ne=su(U.type,U.key,U.props,null,Y.mode,ne),to(ne,U),ne.return=Y,ne;case A:return U=hp(U,Y.mode,ne),U.return=Y,U;case z:return U=Ys(U),ve(Y,U,ne)}if(xe(U)||G(U))return U=Us(U,Y.mode,ne,null),U.return=Y,U;if(typeof U.then=="function")return ve(Y,fu(U),ne);if(U.$$typeof===E)return ve(Y,ou(Y,U),ne);hu(Y,U)}return null}function re(Y,U,ne,be){var Ue=U!==null?U.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Ue!==null?null:N(Y,U,""+ne,be);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case S:return ne.key===Ue?q(Y,U,ne,be):null;case A:return ne.key===Ue?ie(Y,U,ne,be):null;case z:return ne=Ys(ne),re(Y,U,ne,be)}if(xe(ne)||G(ne))return Ue!==null?null:me(Y,U,ne,be,null);if(typeof ne.then=="function")return re(Y,U,fu(ne),be);if(ne.$$typeof===E)return re(Y,U,ou(Y,ne),be);hu(Y,ne)}return null}function ce(Y,U,ne,be,Ue){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return Y=Y.get(ne)||null,N(U,Y,""+be,Ue);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case S:return Y=Y.get(be.key===null?ne:be.key)||null,q(U,Y,be,Ue);case A:return Y=Y.get(be.key===null?ne:be.key)||null,ie(U,Y,be,Ue);case z:return be=Ys(be),ce(Y,U,ne,be,Ue)}if(xe(be)||G(be))return Y=Y.get(ne)||null,me(U,Y,be,Ue,null);if(typeof be.then=="function")return ce(Y,U,ne,fu(be),Ue);if(be.$$typeof===E)return ce(Y,U,ne,ou(U,be),Ue);hu(U,be)}return null}function Le(Y,U,ne,be){for(var Ue=null,yt=null,qe=U,nt=U=0,ut=null;qe!==null&&nt<ne.length;nt++){qe.index>nt?(ut=qe,qe=null):ut=qe.sibling;var bt=re(Y,qe,ne[nt],be);if(bt===null){qe===null&&(qe=ut);break}i&&qe&&bt.alternate===null&&l(Y,qe),U=y(bt,U,nt),yt===null?Ue=bt:yt.sibling=bt,yt=bt,qe=ut}if(nt===ne.length)return o(Y,qe),dt&&mr(Y,nt),Ue;if(qe===null){for(;nt<ne.length;nt++)qe=ve(Y,ne[nt],be),qe!==null&&(U=y(qe,U,nt),yt===null?Ue=qe:yt.sibling=qe,yt=qe);return dt&&mr(Y,nt),Ue}for(qe=u(qe);nt<ne.length;nt++)ut=ce(qe,Y,nt,ne[nt],be),ut!==null&&(i&&ut.alternate!==null&&qe.delete(ut.key===null?nt:ut.key),U=y(ut,U,nt),yt===null?Ue=ut:yt.sibling=ut,yt=ut);return i&&qe.forEach(function(Ss){return l(Y,Ss)}),dt&&mr(Y,nt),Ue}function Ve(Y,U,ne,be){if(ne==null)throw Error(r(151));for(var Ue=null,yt=null,qe=U,nt=U=0,ut=null,bt=ne.next();qe!==null&&!bt.done;nt++,bt=ne.next()){qe.index>nt?(ut=qe,qe=null):ut=qe.sibling;var Ss=re(Y,qe,bt.value,be);if(Ss===null){qe===null&&(qe=ut);break}i&&qe&&Ss.alternate===null&&l(Y,qe),U=y(Ss,U,nt),yt===null?Ue=Ss:yt.sibling=Ss,yt=Ss,qe=ut}if(bt.done)return o(Y,qe),dt&&mr(Y,nt),Ue;if(qe===null){for(;!bt.done;nt++,bt=ne.next())bt=ve(Y,bt.value,be),bt!==null&&(U=y(bt,U,nt),yt===null?Ue=bt:yt.sibling=bt,yt=bt);return dt&&mr(Y,nt),Ue}for(qe=u(qe);!bt.done;nt++,bt=ne.next())bt=ce(qe,Y,nt,bt.value,be),bt!==null&&(i&&bt.alternate!==null&&qe.delete(bt.key===null?nt:bt.key),U=y(bt,U,nt),yt===null?Ue=bt:yt.sibling=bt,yt=bt);return i&&qe.forEach(function(RR){return l(Y,RR)}),dt&&mr(Y,nt),Ue}function Ct(Y,U,ne,be){if(typeof ne=="object"&&ne!==null&&ne.type===C&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case S:e:{for(var Ue=ne.key;U!==null;){if(U.key===Ue){if(Ue=ne.type,Ue===C){if(U.tag===7){o(Y,U.sibling),be=m(U,ne.props.children),be.return=Y,Y=be;break e}}else if(U.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===z&&Ys(Ue)===U.type){o(Y,U.sibling),be=m(U,ne.props),to(be,ne),be.return=Y,Y=be;break e}o(Y,U);break}else l(Y,U);U=U.sibling}ne.type===C?(be=Us(ne.props.children,Y.mode,be,ne.key),be.return=Y,Y=be):(be=su(ne.type,ne.key,ne.props,null,Y.mode,be),to(be,ne),be.return=Y,Y=be)}return w(Y);case A:e:{for(Ue=ne.key;U!==null;){if(U.key===Ue)if(U.tag===4&&U.stateNode.containerInfo===ne.containerInfo&&U.stateNode.implementation===ne.implementation){o(Y,U.sibling),be=m(U,ne.children||[]),be.return=Y,Y=be;break e}else{o(Y,U);break}else l(Y,U);U=U.sibling}be=hp(ne,Y.mode,be),be.return=Y,Y=be}return w(Y);case z:return ne=Ys(ne),Ct(Y,U,ne,be)}if(xe(ne))return Le(Y,U,ne,be);if(G(ne)){if(Ue=G(ne),typeof Ue!="function")throw Error(r(150));return ne=Ue.call(ne),Ve(Y,U,ne,be)}if(typeof ne.then=="function")return Ct(Y,U,fu(ne),be);if(ne.$$typeof===E)return Ct(Y,U,ou(Y,ne),be);hu(Y,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,U!==null&&U.tag===6?(o(Y,U.sibling),be=m(U,ne),be.return=Y,Y=be):(o(Y,U),be=fp(ne,Y.mode,be),be.return=Y,Y=be),w(Y)):o(Y,U)}return function(Y,U,ne,be){try{eo=0;var Ue=Ct(Y,U,ne,be);return Il=null,Ue}catch(qe){if(qe===Hl||qe===uu)throw qe;var yt=Zn(29,qe,null,Y.mode);return yt.lanes=be,yt.return=Y,yt}}}var Xs=Z1(!0),ew=Z1(!1),ss=!1;function Cp(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Np(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function ls(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function as(i,l,o){var u=i.updateQueue;if(u===null)return null;if(u=u.shared,(xt&2)!==0){var m=u.pending;return m===null?l.next=l:(l.next=m.next,m.next=l),u.pending=l,l=ru(i),$1(i,null,o),l}return iu(i,u,l,o),ru(i)}function no(i,l,o){if(l=l.updateQueue,l!==null&&(l=l.shared,(o&4194048)!==0)){var u=l.lanes;u&=i.pendingLanes,o|=u,l.lanes=o,Me(i,o)}}function Tp(i,l){var o=i.updateQueue,u=i.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var m=null,y=null;if(o=o.firstBaseUpdate,o!==null){do{var w={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};y===null?m=y=w:y=y.next=w,o=o.next}while(o!==null);y===null?m=y=l:y=y.next=l}else m=y=l;o={baseState:u.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:u.shared,callbacks:u.callbacks},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=l:i.next=l,o.lastBaseUpdate=l}var jp=!1;function io(){if(jp){var i=zl;if(i!==null)throw i}}function ro(i,l,o,u){jp=!1;var m=i.updateQueue;ss=!1;var y=m.firstBaseUpdate,w=m.lastBaseUpdate,N=m.shared.pending;if(N!==null){m.shared.pending=null;var q=N,ie=q.next;q.next=null,w===null?y=ie:w.next=ie,w=q;var me=i.alternate;me!==null&&(me=me.updateQueue,N=me.lastBaseUpdate,N!==w&&(N===null?me.firstBaseUpdate=ie:N.next=ie,me.lastBaseUpdate=q))}if(y!==null){var ve=m.baseState;w=0,me=ie=q=null,N=y;do{var re=N.lane&-536870913,ce=re!==N.lane;if(ce?(ct&re)===re:(u&re)===re){re!==0&&re===ql&&(jp=!0),me!==null&&(me=me.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Le=i,Ve=N;re=l;var Ct=o;switch(Ve.tag){case 1:if(Le=Ve.payload,typeof Le=="function"){ve=Le.call(Ct,ve,re);break e}ve=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=Ve.payload,re=typeof Le=="function"?Le.call(Ct,ve,re):Le,re==null)break e;ve=b({},ve,re);break e;case 2:ss=!0}}re=N.callback,re!==null&&(i.flags|=64,ce&&(i.flags|=8192),ce=m.callbacks,ce===null?m.callbacks=[re]:ce.push(re))}else ce={lane:re,tag:N.tag,payload:N.payload,callback:N.callback,next:null},me===null?(ie=me=ce,q=ve):me=me.next=ce,w|=re;if(N=N.next,N===null){if(N=m.shared.pending,N===null)break;ce=N,N=ce.next,ce.next=null,m.lastBaseUpdate=ce,m.shared.pending=null}}while(!0);me===null&&(q=ve),m.baseState=q,m.firstBaseUpdate=ie,m.lastBaseUpdate=me,y===null&&(m.shared.lanes=0),fs|=w,i.lanes=w,i.memoizedState=ve}}function tw(i,l){if(typeof i!="function")throw Error(r(191,i));i.call(l)}function nw(i,l){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)tw(o[i],l)}var Ul=L(null),pu=L(0);function iw(i,l){i=Nr,ue(pu,i),ue(Ul,l),Nr=i|l.baseLanes}function Ep(){ue(pu,Nr),ue(Ul,Ul.current)}function Op(){Nr=pu.current,P(Ul),P(pu)}var ei=L(null),Ci=null;function os(i){var l=i.alternate;ue(Ft,Ft.current&1),ue(ei,i),Ci===null&&(l===null||Ul.current!==null||l.memoizedState!==null)&&(Ci=i)}function Mp(i){ue(Ft,Ft.current),ue(ei,i),Ci===null&&(Ci=i)}function rw(i){i.tag===22?(ue(Ft,Ft.current),ue(ei,i),Ci===null&&(Ci=i)):cs()}function cs(){ue(Ft,Ft.current),ue(ei,ei.current)}function ti(i){P(ei),Ci===i&&(Ci=null),P(Ft)}var Ft=L(0);function mu(i){for(var l=i;l!==null;){if(l.tag===13){var o=l.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||$m(o)||qm(o)))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===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var br=0,tt=null,At=null,Xt=null,gu=!1,Fl=!1,Js=!1,yu=0,so=0,Vl=null,SM=0;function Bt(){throw Error(r(321))}function Rp(i,l){if(l===null)return!1;for(var o=0;o<l.length&&o<i.length;o++)if(!Wn(i[o],l[o]))return!1;return!0}function Dp(i,l,o,u,m,y){return br=y,tt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,_.H=i===null||i.memoizedState===null?Iw:Gp,Js=!1,y=o(u,m),Js=!1,Fl&&(y=lw(l,o,u,m)),sw(i),y}function sw(i){_.H=oo;var l=At!==null&&At.next!==null;if(br=0,Xt=At=tt=null,gu=!1,so=0,Vl=null,l)throw Error(r(300));i===null||Jt||(i=i.dependencies,i!==null&&au(i)&&(Jt=!0))}function lw(i,l,o,u){tt=i;var m=0;do{if(Fl&&(Vl=null),so=0,Fl=!1,25<=m)throw Error(r(301));if(m+=1,Xt=At=null,i.updateQueue!=null){var y=i.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}_.H=Uw,y=l(o,u)}while(Fl);return y}function AM(){var i=_.H,l=i.useState()[0];return l=typeof l.then=="function"?lo(l):l,i=i.useState()[0],(At!==null?At.memoizedState:null)!==i&&(tt.flags|=1024),l}function _p(){var i=yu!==0;return yu=0,i}function Lp(i,l,o){l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~o}function Bp(i){if(gu){for(i=i.memoizedState;i!==null;){var l=i.queue;l!==null&&(l.pending=null),i=i.next}gu=!1}br=0,Xt=At=tt=null,Fl=!1,so=yu=0,Vl=null}function _n(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?tt.memoizedState=Xt=i:Xt=Xt.next=i,Xt}function Vt(){if(At===null){var i=tt.alternate;i=i!==null?i.memoizedState:null}else i=At.next;var l=Xt===null?tt.memoizedState:Xt.next;if(l!==null)Xt=l,At=i;else{if(i===null)throw tt.alternate===null?Error(r(467)):Error(r(310));At=i,i={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},Xt===null?tt.memoizedState=Xt=i:Xt=Xt.next=i}return Xt}function bu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function lo(i){var l=so;return so+=1,Vl===null&&(Vl=[]),i=J1(Vl,i,l),l=tt,(Xt===null?l.memoizedState:Xt.next)===null&&(l=l.alternate,_.H=l===null||l.memoizedState===null?Iw:Gp),i}function xu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return lo(i);if(i.$$typeof===E)return gn(i)}throw Error(r(438,String(i)))}function $p(i){var l=null,o=tt.updateQueue;if(o!==null&&(l=o.memoCache),l==null){var u=tt.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(l={data:u.data.map(function(m){return m.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),o===null&&(o=bu(),tt.updateQueue=o),o.memoCache=l,o=l.data[l.index],o===void 0)for(o=l.data[l.index]=Array(i),u=0;u<i;u++)o[u]=X;return l.index++,o}function xr(i,l){return typeof l=="function"?l(i):l}function vu(i){var l=Vt();return qp(l,At,i)}function qp(i,l,o){var u=i.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=o;var m=i.baseQueue,y=u.pending;if(y!==null){if(m!==null){var w=m.next;m.next=y.next,y.next=w}l.baseQueue=m=y,u.pending=null}if(y=i.baseState,m===null)i.memoizedState=y;else{l=m.next;var N=w=null,q=null,ie=l,me=!1;do{var ve=ie.lane&-536870913;if(ve!==ie.lane?(ct&ve)===ve:(br&ve)===ve){var re=ie.revertLane;if(re===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),ve===ql&&(me=!0);else if((br&re)===re){ie=ie.next,re===ql&&(me=!0);continue}else ve={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},q===null?(N=q=ve,w=y):q=q.next=ve,tt.lanes|=re,fs|=re;ve=ie.action,Js&&o(y,ve),y=ie.hasEagerState?ie.eagerState:o(y,ve)}else re={lane:ve,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},q===null?(N=q=re,w=y):q=q.next=re,tt.lanes|=ve,fs|=ve;ie=ie.next}while(ie!==null&&ie!==l);if(q===null?w=y:q.next=N,!Wn(y,i.memoizedState)&&(Jt=!0,me&&(o=zl,o!==null)))throw o;i.memoizedState=y,i.baseState=w,i.baseQueue=q,u.lastRenderedState=y}return m===null&&(u.lanes=0),[i.memoizedState,u.dispatch]}function zp(i){var l=Vt(),o=l.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=i;var u=o.dispatch,m=o.pending,y=l.memoizedState;if(m!==null){o.pending=null;var w=m=m.next;do y=i(y,w.action),w=w.next;while(w!==m);Wn(y,l.memoizedState)||(Jt=!0),l.memoizedState=y,l.baseQueue===null&&(l.baseState=y),o.lastRenderedState=y}return[y,u]}function aw(i,l,o){var u=tt,m=Vt(),y=dt;if(y){if(o===void 0)throw Error(r(407));o=o()}else o=l();var w=!Wn((At||m).memoizedState,o);if(w&&(m.memoizedState=o,Jt=!0),m=m.queue,Up(uw.bind(null,u,m,i),[i]),m.getSnapshot!==l||w||Xt!==null&&Xt.memoizedState.tag&1){if(u.flags|=2048,Pl(9,{destroy:void 0},cw.bind(null,u,m,o,l),null),jt===null)throw Error(r(349));y||(br&127)!==0||ow(u,l,o)}return o}function ow(i,l,o){i.flags|=16384,i={getSnapshot:l,value:o},l=tt.updateQueue,l===null?(l=bu(),tt.updateQueue=l,l.stores=[i]):(o=l.stores,o===null?l.stores=[i]:o.push(i))}function cw(i,l,o,u){l.value=o,l.getSnapshot=u,dw(l)&&fw(i)}function uw(i,l,o){return o(function(){dw(l)&&fw(i)})}function dw(i){var l=i.getSnapshot;i=i.value;try{var o=l();return!Wn(i,o)}catch{return!0}}function fw(i){var l=Is(i,2);l!==null&&Kn(l,i,2)}function Hp(i){var l=_n();if(typeof i=="function"){var o=i;if(i=o(),Js){J(!0);try{o()}finally{J(!1)}}}return l.memoizedState=l.baseState=i,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:i},l}function hw(i,l,o,u){return i.baseState=o,qp(i,At,typeof u=="function"?u:xr)}function kM(i,l,o,u,m){if(Au(i))throw Error(r(485));if(i=l.action,i!==null){var y={payload:m,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){y.listeners.push(w)}};_.T!==null?o(!0):y.isTransition=!1,u(y),o=l.pending,o===null?(y.next=l.pending=y,pw(l,y)):(y.next=o.next,l.pending=o.next=y)}}function pw(i,l){var o=l.action,u=l.payload,m=i.state;if(l.isTransition){var y=_.T,w={};_.T=w;try{var N=o(m,u),q=_.S;q!==null&&q(w,N),mw(i,l,N)}catch(ie){Ip(i,l,ie)}finally{y!==null&&w.types!==null&&(y.types=w.types),_.T=y}}else try{y=o(m,u),mw(i,l,y)}catch(ie){Ip(i,l,ie)}}function mw(i,l,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){gw(i,l,u)},function(u){return Ip(i,l,u)}):gw(i,l,o)}function gw(i,l,o){l.status="fulfilled",l.value=o,yw(l),i.state=o,l=i.pending,l!==null&&(o=l.next,o===l?i.pending=null:(o=o.next,l.next=o,pw(i,o)))}function Ip(i,l,o){var u=i.pending;if(i.pending=null,u!==null){u=u.next;do l.status="rejected",l.reason=o,yw(l),l=l.next;while(l!==u)}i.action=null}function yw(i){i=i.listeners;for(var l=0;l<i.length;l++)(0,i[l])()}function bw(i,l){return l}function xw(i,l){if(dt){var o=jt.formState;if(o!==null){e:{var u=tt;if(dt){if(Ot){t:{for(var m=Ot,y=ki;m.nodeType!==8;){if(!y){m=null;break t}if(m=Ni(m.nextSibling),m===null){m=null;break t}}y=m.data,m=y==="F!"||y==="F"?m:null}if(m){Ot=Ni(m.nextSibling),u=m.data==="F!";break e}}is(u)}u=!1}u&&(l=o[0])}}return o=_n(),o.memoizedState=o.baseState=l,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bw,lastRenderedState:l},o.queue=u,o=qw.bind(null,tt,u),u.dispatch=o,u=Hp(!1),y=Yp.bind(null,tt,!1,u.queue),u=_n(),m={state:l,dispatch:null,action:i,pending:null},u.queue=m,o=kM.bind(null,tt,m,y,o),m.dispatch=o,u.memoizedState=i,[l,o,!1]}function vw(i){var l=Vt();return ww(l,At,i)}function ww(i,l,o){if(l=qp(i,l,bw)[0],i=vu(xr)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var u=lo(l)}catch(w){throw w===Hl?uu:w}else u=l;l=Vt();var m=l.queue,y=m.dispatch;return o!==l.memoizedState&&(tt.flags|=2048,Pl(9,{destroy:void 0},CM.bind(null,m,o),null)),[u,y,i]}function CM(i,l){i.action=l}function Sw(i){var l=Vt(),o=At;if(o!==null)return ww(l,o,i);Vt(),l=l.memoizedState,o=Vt();var u=o.queue.dispatch;return o.memoizedState=i,[l,u,!1]}function Pl(i,l,o,u){return i={tag:i,create:o,deps:u,inst:l,next:null},l=tt.updateQueue,l===null&&(l=bu(),tt.updateQueue=l),o=l.lastEffect,o===null?l.lastEffect=i.next=i:(u=o.next,o.next=i,i.next=u,l.lastEffect=i),i}function Aw(){return Vt().memoizedState}function wu(i,l,o,u){var m=_n();tt.flags|=i,m.memoizedState=Pl(1|l,{destroy:void 0},o,u===void 0?null:u)}function Su(i,l,o,u){var m=Vt();u=u===void 0?null:u;var y=m.memoizedState.inst;At!==null&&u!==null&&Rp(u,At.memoizedState.deps)?m.memoizedState=Pl(l,y,o,u):(tt.flags|=i,m.memoizedState=Pl(1|l,y,o,u))}function kw(i,l){wu(8390656,8,i,l)}function Up(i,l){Su(2048,8,i,l)}function NM(i){tt.flags|=4;var l=tt.updateQueue;if(l===null)l=bu(),tt.updateQueue=l,l.events=[i];else{var o=l.events;o===null?l.events=[i]:o.push(i)}}function Cw(i){var l=Vt().memoizedState;return NM({ref:l,nextImpl:i}),function(){if((xt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function Nw(i,l){return Su(4,2,i,l)}function Tw(i,l){return Su(4,4,i,l)}function jw(i,l){if(typeof l=="function"){i=i();var o=l(i);return function(){typeof o=="function"?o():l(null)}}if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function Ew(i,l,o){o=o!=null?o.concat([i]):null,Su(4,4,jw.bind(null,l,i),o)}function Fp(){}function Ow(i,l){var o=Vt();l=l===void 0?null:l;var u=o.memoizedState;return l!==null&&Rp(l,u[1])?u[0]:(o.memoizedState=[i,l],i)}function Mw(i,l){var o=Vt();l=l===void 0?null:l;var u=o.memoizedState;if(l!==null&&Rp(l,u[1]))return u[0];if(u=i(),Js){J(!0);try{i()}finally{J(!1)}}return o.memoizedState=[u,l],u}function Vp(i,l,o){return o===void 0||(br&1073741824)!==0&&(ct&261930)===0?i.memoizedState=l:(i.memoizedState=o,i=RS(),tt.lanes|=i,fs|=i,o)}function Rw(i,l,o,u){return Wn(o,l)?o:Ul.current!==null?(i=Vp(i,o,u),Wn(i,l)||(Jt=!0),i):(br&42)===0||(br&1073741824)!==0&&(ct&261930)===0?(Jt=!0,i.memoizedState=o):(i=RS(),tt.lanes|=i,fs|=i,l)}function Dw(i,l,o,u,m){var y=ee.p;ee.p=y!==0&&8>y?y:8;var w=_.T,N={};_.T=N,Yp(i,!1,l,o);try{var q=m(),ie=_.S;if(ie!==null&&ie(N,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var me=wM(q,u);ao(i,l,me,ri(i))}else ao(i,l,u,ri(i))}catch(ve){ao(i,l,{then:function(){},status:"rejected",reason:ve},ri())}finally{ee.p=y,w!==null&&N.types!==null&&(w.types=N.types),_.T=w}}function TM(){}function Pp(i,l,o,u){if(i.tag!==5)throw Error(r(476));var m=_w(i).queue;Dw(i,m,l,he,o===null?TM:function(){return Lw(i),o(u)})}function _w(i){var l=i.memoizedState;if(l!==null)return l;l={memoizedState:he,baseState:he,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:he},next:null};var o={};return l.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:o},next:null},i.memoizedState=l,i=i.alternate,i!==null&&(i.memoizedState=l),l}function Lw(i){var l=_w(i);l.next===null&&(l=i.alternate.memoizedState),ao(i,l.next.queue,{},ri())}function Kp(){return gn(Co)}function Bw(){return Vt().memoizedState}function $w(){return Vt().memoizedState}function jM(i){for(var l=i.return;l!==null;){switch(l.tag){case 24:case 3:var o=ri();i=ls(o);var u=as(l,i,o);u!==null&&(Kn(u,l,o),no(u,l,o)),l={cache:wp()},i.payload=l;return}l=l.return}}function EM(i,l,o){var u=ri();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Au(i)?zw(l,o):(o=up(i,l,o,u),o!==null&&(Kn(o,i,u),Hw(o,l,u)))}function qw(i,l,o){var u=ri();ao(i,l,o,u)}function ao(i,l,o,u){var m={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Au(i))zw(l,m);else{var y=i.alternate;if(i.lanes===0&&(y===null||y.lanes===0)&&(y=l.lastRenderedReducer,y!==null))try{var w=l.lastRenderedState,N=y(w,o);if(m.hasEagerState=!0,m.eagerState=N,Wn(N,w))return iu(i,l,m,0),jt===null&&nu(),!1}catch{}if(o=up(i,l,m,u),o!==null)return Kn(o,i,u),Hw(o,l,u),!0}return!1}function Yp(i,l,o,u){if(u={lane:2,revertLane:Cm(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Au(i)){if(l)throw Error(r(479))}else l=up(i,o,u,2),l!==null&&Kn(l,i,2)}function Au(i){var l=i.alternate;return i===tt||l!==null&&l===tt}function zw(i,l){Fl=gu=!0;var o=i.pending;o===null?l.next=l:(l.next=o.next,o.next=l),i.pending=l}function Hw(i,l,o){if((o&4194048)!==0){var u=l.lanes;u&=i.pendingLanes,o|=u,l.lanes=o,Me(i,o)}}var oo={readContext:gn,use:xu,useCallback:Bt,useContext:Bt,useEffect:Bt,useImperativeHandle:Bt,useLayoutEffect:Bt,useInsertionEffect:Bt,useMemo:Bt,useReducer:Bt,useRef:Bt,useState:Bt,useDebugValue:Bt,useDeferredValue:Bt,useTransition:Bt,useSyncExternalStore:Bt,useId:Bt,useHostTransitionStatus:Bt,useFormState:Bt,useActionState:Bt,useOptimistic:Bt,useMemoCache:Bt,useCacheRefresh:Bt};oo.useEffectEvent=Bt;var Iw={readContext:gn,use:xu,useCallback:function(i,l){return _n().memoizedState=[i,l===void 0?null:l],i},useContext:gn,useEffect:kw,useImperativeHandle:function(i,l,o){o=o!=null?o.concat([i]):null,wu(4194308,4,jw.bind(null,l,i),o)},useLayoutEffect:function(i,l){return wu(4194308,4,i,l)},useInsertionEffect:function(i,l){wu(4,2,i,l)},useMemo:function(i,l){var o=_n();l=l===void 0?null:l;var u=i();if(Js){J(!0);try{i()}finally{J(!1)}}return o.memoizedState=[u,l],u},useReducer:function(i,l,o){var u=_n();if(o!==void 0){var m=o(l);if(Js){J(!0);try{o(l)}finally{J(!1)}}}else m=l;return u.memoizedState=u.baseState=m,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:m},u.queue=i,i=i.dispatch=EM.bind(null,tt,i),[u.memoizedState,i]},useRef:function(i){var l=_n();return i={current:i},l.memoizedState=i},useState:function(i){i=Hp(i);var l=i.queue,o=qw.bind(null,tt,l);return l.dispatch=o,[i.memoizedState,o]},useDebugValue:Fp,useDeferredValue:function(i,l){var o=_n();return Vp(o,i,l)},useTransition:function(){var i=Hp(!1);return i=Dw.bind(null,tt,i.queue,!0,!1),_n().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,l,o){var u=tt,m=_n();if(dt){if(o===void 0)throw Error(r(407));o=o()}else{if(o=l(),jt===null)throw Error(r(349));(ct&127)!==0||ow(u,l,o)}m.memoizedState=o;var y={value:o,getSnapshot:l};return m.queue=y,kw(uw.bind(null,u,y,i),[i]),u.flags|=2048,Pl(9,{destroy:void 0},cw.bind(null,u,y,o,l),null),o},useId:function(){var i=_n(),l=jt.identifierPrefix;if(dt){var o=Wi,u=Qi;o=(u&~(1<<32-Z(u)-1)).toString(32)+o,l="_"+l+"R_"+o,o=yu++,0<o&&(l+="H"+o.toString(32)),l+="_"}else o=SM++,l="_"+l+"r_"+o.toString(32)+"_";return i.memoizedState=l},useHostTransitionStatus:Kp,useFormState:xw,useActionState:xw,useOptimistic:function(i){var l=_n();l.memoizedState=l.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=o,l=Yp.bind(null,tt,!0,o),o.dispatch=l,[i,l]},useMemoCache:$p,useCacheRefresh:function(){return _n().memoizedState=jM.bind(null,tt)},useEffectEvent:function(i){var l=_n(),o={impl:i};return l.memoizedState=o,function(){if((xt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}},Gp={readContext:gn,use:xu,useCallback:Ow,useContext:gn,useEffect:Up,useImperativeHandle:Ew,useInsertionEffect:Nw,useLayoutEffect:Tw,useMemo:Mw,useReducer:vu,useRef:Aw,useState:function(){return vu(xr)},useDebugValue:Fp,useDeferredValue:function(i,l){var o=Vt();return Rw(o,At.memoizedState,i,l)},useTransition:function(){var i=vu(xr)[0],l=Vt().memoizedState;return[typeof i=="boolean"?i:lo(i),l]},useSyncExternalStore:aw,useId:Bw,useHostTransitionStatus:Kp,useFormState:vw,useActionState:vw,useOptimistic:function(i,l){var o=Vt();return hw(o,At,i,l)},useMemoCache:$p,useCacheRefresh:$w};Gp.useEffectEvent=Cw;var Uw={readContext:gn,use:xu,useCallback:Ow,useContext:gn,useEffect:Up,useImperativeHandle:Ew,useInsertionEffect:Nw,useLayoutEffect:Tw,useMemo:Mw,useReducer:zp,useRef:Aw,useState:function(){return zp(xr)},useDebugValue:Fp,useDeferredValue:function(i,l){var o=Vt();return At===null?Vp(o,i,l):Rw(o,At.memoizedState,i,l)},useTransition:function(){var i=zp(xr)[0],l=Vt().memoizedState;return[typeof i=="boolean"?i:lo(i),l]},useSyncExternalStore:aw,useId:Bw,useHostTransitionStatus:Kp,useFormState:Sw,useActionState:Sw,useOptimistic:function(i,l){var o=Vt();return At!==null?hw(o,At,i,l):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:$p,useCacheRefresh:$w};Uw.useEffectEvent=Cw;function Xp(i,l,o,u){l=i.memoizedState,o=o(u,l),o=o==null?l:b({},l,o),i.memoizedState=o,i.lanes===0&&(i.updateQueue.baseState=o)}var Jp={enqueueSetState:function(i,l,o){i=i._reactInternals;var u=ri(),m=ls(u);m.payload=l,o!=null&&(m.callback=o),l=as(i,m,u),l!==null&&(Kn(l,i,u),no(l,i,u))},enqueueReplaceState:function(i,l,o){i=i._reactInternals;var u=ri(),m=ls(u);m.tag=1,m.payload=l,o!=null&&(m.callback=o),l=as(i,m,u),l!==null&&(Kn(l,i,u),no(l,i,u))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var o=ri(),u=ls(o);u.tag=2,l!=null&&(u.callback=l),l=as(i,u,o),l!==null&&(Kn(l,i,o),no(l,i,o))}};function Fw(i,l,o,u,m,y,w){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(u,y,w):l.prototype&&l.prototype.isPureReactComponent?!Ga(o,u)||!Ga(m,y):!0}function Vw(i,l,o,u){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(o,u),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(o,u),l.state!==i&&Jp.enqueueReplaceState(l,l.state,null)}function Qs(i,l){var o=l;if("ref"in l){o={};for(var u in l)u!=="ref"&&(o[u]=l[u])}if(i=i.defaultProps){o===l&&(o=b({},o));for(var m in i)o[m]===void 0&&(o[m]=i[m])}return o}function Pw(i){tu(i)}function Kw(i){console.error(i)}function Yw(i){tu(i)}function ku(i,l){try{var o=i.onUncaughtError;o(l.value,{componentStack:l.stack})}catch(u){setTimeout(function(){throw u})}}function Gw(i,l,o){try{var u=i.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Qp(i,l,o){return o=ls(o),o.tag=3,o.payload={element:null},o.callback=function(){ku(i,l)},o}function Xw(i){return i=ls(i),i.tag=3,i}function Jw(i,l,o,u){var m=o.type.getDerivedStateFromError;if(typeof m=="function"){var y=u.value;i.payload=function(){return m(y)},i.callback=function(){Gw(l,o,u)}}var w=o.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(i.callback=function(){Gw(l,o,u),typeof m!="function"&&(hs===null?hs=new Set([this]):hs.add(this));var N=u.stack;this.componentDidCatch(u.value,{componentStack:N!==null?N:""})})}function OM(i,l,o,u,m){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(l=o.alternate,l!==null&&$l(l,o,m,!0),o=ei.current,o!==null){switch(o.tag){case 31:case 13:return Ci===null?Bu():o.alternate===null&&$t===0&&($t=3),o.flags&=-257,o.flags|=65536,o.lanes=m,u===du?o.flags|=16384:(l=o.updateQueue,l===null?o.updateQueue=new Set([u]):l.add(u),Sm(i,u,m)),!1;case 22:return o.flags|=65536,u===du?o.flags|=16384:(l=o.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=l):(o=l.retryQueue,o===null?l.retryQueue=new Set([u]):o.add(u)),Sm(i,u,m)),!1}throw Error(r(435,o.tag))}return Sm(i,u,m),Bu(),!1}if(dt)return l=ei.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=m,u!==gp&&(i=Error(r(422),{cause:u}),Qa(wi(i,o)))):(u!==gp&&(l=Error(r(423),{cause:u}),Qa(wi(l,o))),i=i.current.alternate,i.flags|=65536,m&=-m,i.lanes|=m,u=wi(u,o),m=Qp(i.stateNode,u,m),Tp(i,m),$t!==4&&($t=2)),!1;var y=Error(r(520),{cause:u});if(y=wi(y,o),yo===null?yo=[y]:yo.push(y),$t!==4&&($t=2),l===null)return!0;u=wi(u,o),o=l;do{switch(o.tag){case 3:return o.flags|=65536,i=m&-m,o.lanes|=i,i=Qp(o.stateNode,u,i),Tp(o,i),!1;case 1:if(l=o.type,y=o.stateNode,(o.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(hs===null||!hs.has(y))))return o.flags|=65536,m&=-m,o.lanes|=m,m=Xw(m),Jw(m,i,o,u),Tp(o,m),!1}o=o.return}while(o!==null);return!1}var Wp=Error(r(461)),Jt=!1;function yn(i,l,o,u){l.child=i===null?ew(l,null,o,u):Xs(l,i.child,o,u)}function Qw(i,l,o,u,m){o=o.render;var y=l.ref;if("ref"in u){var w={};for(var N in u)N!=="ref"&&(w[N]=u[N])}else w=u;return Ps(l),u=Dp(i,l,o,w,y,m),N=_p(),i!==null&&!Jt?(Lp(i,l,m),vr(i,l,m)):(dt&&N&&pp(l),l.flags|=1,yn(i,l,u,m),l.child)}function Ww(i,l,o,u,m){if(i===null){var y=o.type;return typeof y=="function"&&!dp(y)&&y.defaultProps===void 0&&o.compare===null?(l.tag=15,l.type=y,Zw(i,l,y,u,m)):(i=su(o.type,null,u,l,l.mode,m),i.ref=l.ref,i.return=l,l.child=i)}if(y=i.child,!lm(i,m)){var w=y.memoizedProps;if(o=o.compare,o=o!==null?o:Ga,o(w,u)&&i.ref===l.ref)return vr(i,l,m)}return l.flags|=1,i=pr(y,u),i.ref=l.ref,i.return=l,l.child=i}function Zw(i,l,o,u,m){if(i!==null){var y=i.memoizedProps;if(Ga(y,u)&&i.ref===l.ref)if(Jt=!1,l.pendingProps=u=y,lm(i,m))(i.flags&131072)!==0&&(Jt=!0);else return l.lanes=i.lanes,vr(i,l,m)}return Zp(i,l,o,u,m)}function eS(i,l,o,u){var m=u.children,y=i!==null?i.memoizedState:null;if(i===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((l.flags&128)!==0){if(y=y!==null?y.baseLanes|o:o,i!==null){for(u=l.child=i.child,m=0;u!==null;)m=m|u.lanes|u.childLanes,u=u.sibling;u=m&~y}else u=0,l.child=null;return tS(i,l,y,o,u)}if((o&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},i!==null&&cu(l,y!==null?y.cachePool:null),y!==null?iw(l,y):Ep(),rw(l);else return u=l.lanes=536870912,tS(i,l,y!==null?y.baseLanes|o:o,o,u)}else y!==null?(cu(l,y.cachePool),iw(l,y),cs(),l.memoizedState=null):(i!==null&&cu(l,null),Ep(),cs());return yn(i,l,m,o),l.child}function co(i,l){return i!==null&&i.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function tS(i,l,o,u,m){var y=Ap();return y=y===null?null:{parent:Gt._currentValue,pool:y},l.memoizedState={baseLanes:o,cachePool:y},i!==null&&cu(l,null),Ep(),rw(l),i!==null&&$l(i,l,u,!0),l.childLanes=m,null}function Cu(i,l){return l=Tu({mode:l.mode,children:l.children},i.mode),l.ref=i.ref,i.child=l,l.return=i,l}function nS(i,l,o){return Xs(l,i.child,null,o),i=Cu(l,l.pendingProps),i.flags|=2,ti(l),l.memoizedState=null,i}function MM(i,l,o){var u=l.pendingProps,m=(l.flags&128)!==0;if(l.flags&=-129,i===null){if(dt){if(u.mode==="hidden")return i=Cu(l,u),l.lanes=536870912,co(null,i);if(Mp(l),(i=Ot)?(i=p2(i,ki),i=i!==null&&i.data==="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:ts!==null?{id:Qi,overflow:Wi}:null,retryLane:536870912,hydrationErrors:null},o=z1(i),o.return=l,l.child=o,mn=l,Ot=null)):i=null,i===null)throw is(l);return l.lanes=536870912,null}return Cu(l,u)}var y=i.memoizedState;if(y!==null){var w=y.dehydrated;if(Mp(l),m)if(l.flags&256)l.flags&=-257,l=nS(i,l,o);else if(l.memoizedState!==null)l.child=i.child,l.flags|=128,l=null;else throw Error(r(558));else if(Jt||$l(i,l,o,!1),m=(o&i.childLanes)!==0,Jt||m){if(u=jt,u!==null&&(w=Qe(u,o),w!==0&&w!==y.retryLane))throw y.retryLane=w,Is(i,w),Kn(u,i,w),Wp;Bu(),l=nS(i,l,o)}else i=y.treeContext,Ot=Ni(w.nextSibling),mn=l,dt=!0,ns=null,ki=!1,i!==null&&U1(l,i),l=Cu(l,u),l.flags|=4096;return l}return i=pr(i.child,{mode:u.mode,children:u.children}),i.ref=l.ref,l.child=i,i.return=l,i}function Nu(i,l){var o=l.ref;if(o===null)i!==null&&i.ref!==null&&(l.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(r(284));(i===null||i.ref!==o)&&(l.flags|=4194816)}}function Zp(i,l,o,u,m){return Ps(l),o=Dp(i,l,o,u,void 0,m),u=_p(),i!==null&&!Jt?(Lp(i,l,m),vr(i,l,m)):(dt&&u&&pp(l),l.flags|=1,yn(i,l,o,m),l.child)}function iS(i,l,o,u,m,y){return Ps(l),l.updateQueue=null,o=lw(l,u,o,m),sw(i),u=_p(),i!==null&&!Jt?(Lp(i,l,y),vr(i,l,y)):(dt&&u&&pp(l),l.flags|=1,yn(i,l,o,y),l.child)}function rS(i,l,o,u,m){if(Ps(l),l.stateNode===null){var y=Dl,w=o.contextType;typeof w=="object"&&w!==null&&(y=gn(w)),y=new o(u,y),l.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Jp,l.stateNode=y,y._reactInternals=l,y=l.stateNode,y.props=u,y.state=l.memoizedState,y.refs={},Cp(l),w=o.contextType,y.context=typeof w=="object"&&w!==null?gn(w):Dl,y.state=l.memoizedState,w=o.getDerivedStateFromProps,typeof w=="function"&&(Xp(l,o,w,u),y.state=l.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(w=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),w!==y.state&&Jp.enqueueReplaceState(y,y.state,null),ro(l,u,y,m),io(),y.state=l.memoizedState),typeof y.componentDidMount=="function"&&(l.flags|=4194308),u=!0}else if(i===null){y=l.stateNode;var N=l.memoizedProps,q=Qs(o,N);y.props=q;var ie=y.context,me=o.contextType;w=Dl,typeof me=="object"&&me!==null&&(w=gn(me));var ve=o.getDerivedStateFromProps;me=typeof ve=="function"||typeof y.getSnapshotBeforeUpdate=="function",N=l.pendingProps!==N,me||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N||ie!==w)&&Vw(l,y,u,w),ss=!1;var re=l.memoizedState;y.state=re,ro(l,u,y,m),io(),ie=l.memoizedState,N||re!==ie||ss?(typeof ve=="function"&&(Xp(l,o,ve,u),ie=l.memoizedState),(q=ss||Fw(l,o,q,u,re,ie,w))?(me||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(l.flags|=4194308)):(typeof y.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=u,l.memoizedState=ie),y.props=u,y.state=ie,y.context=w,u=q):(typeof y.componentDidMount=="function"&&(l.flags|=4194308),u=!1)}else{y=l.stateNode,Np(i,l),w=l.memoizedProps,me=Qs(o,w),y.props=me,ve=l.pendingProps,re=y.context,ie=o.contextType,q=Dl,typeof ie=="object"&&ie!==null&&(q=gn(ie)),N=o.getDerivedStateFromProps,(ie=typeof N=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(w!==ve||re!==q)&&Vw(l,y,u,q),ss=!1,re=l.memoizedState,y.state=re,ro(l,u,y,m),io();var ce=l.memoizedState;w!==ve||re!==ce||ss||i!==null&&i.dependencies!==null&&au(i.dependencies)?(typeof N=="function"&&(Xp(l,o,N,u),ce=l.memoizedState),(me=ss||Fw(l,o,me,u,re,ce,q)||i!==null&&i.dependencies!==null&&au(i.dependencies))?(ie||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(u,ce,q),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(u,ce,q)),typeof y.componentDidUpdate=="function"&&(l.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof y.componentDidUpdate!="function"||w===i.memoizedProps&&re===i.memoizedState||(l.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||w===i.memoizedProps&&re===i.memoizedState||(l.flags|=1024),l.memoizedProps=u,l.memoizedState=ce),y.props=u,y.state=ce,y.context=q,u=me):(typeof y.componentDidUpdate!="function"||w===i.memoizedProps&&re===i.memoizedState||(l.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||w===i.memoizedProps&&re===i.memoizedState||(l.flags|=1024),u=!1)}return y=u,Nu(i,l),u=(l.flags&128)!==0,y||u?(y=l.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:y.render(),l.flags|=1,i!==null&&u?(l.child=Xs(l,i.child,null,m),l.child=Xs(l,null,o,m)):yn(i,l,o,m),l.memoizedState=y.state,i=l.child):i=vr(i,l,m),i}function sS(i,l,o,u){return Fs(),l.flags|=256,yn(i,l,o,u),l.child}var em={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tm(i){return{baseLanes:i,cachePool:G1()}}function nm(i,l,o){return i=i!==null?i.childLanes&~o:0,l&&(i|=ii),i}function lS(i,l,o){var u=l.pendingProps,m=!1,y=(l.flags&128)!==0,w;if((w=y)||(w=i!==null&&i.memoizedState===null?!1:(Ft.current&2)!==0),w&&(m=!0,l.flags&=-129),w=(l.flags&32)!==0,l.flags&=-33,i===null){if(dt){if(m?os(l):cs(),(i=Ot)?(i=p2(i,ki),i=i!==null&&i.data!=="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:ts!==null?{id:Qi,overflow:Wi}:null,retryLane:536870912,hydrationErrors:null},o=z1(i),o.return=l,l.child=o,mn=l,Ot=null)):i=null,i===null)throw is(l);return qm(i)?l.lanes=32:l.lanes=536870912,null}var N=u.children;return u=u.fallback,m?(cs(),m=l.mode,N=Tu({mode:"hidden",children:N},m),u=Us(u,m,o,null),N.return=l,u.return=l,N.sibling=u,l.child=N,u=l.child,u.memoizedState=tm(o),u.childLanes=nm(i,w,o),l.memoizedState=em,co(null,u)):(os(l),im(l,N))}var q=i.memoizedState;if(q!==null&&(N=q.dehydrated,N!==null)){if(y)l.flags&256?(os(l),l.flags&=-257,l=rm(i,l,o)):l.memoizedState!==null?(cs(),l.child=i.child,l.flags|=128,l=null):(cs(),N=u.fallback,m=l.mode,u=Tu({mode:"visible",children:u.children},m),N=Us(N,m,o,null),N.flags|=2,u.return=l,N.return=l,u.sibling=N,l.child=u,Xs(l,i.child,null,o),u=l.child,u.memoizedState=tm(o),u.childLanes=nm(i,w,o),l.memoizedState=em,l=co(null,u));else if(os(l),qm(N)){if(w=N.nextSibling&&N.nextSibling.dataset,w)var ie=w.dgst;w=ie,u=Error(r(419)),u.stack="",u.digest=w,Qa({value:u,source:null,stack:null}),l=rm(i,l,o)}else if(Jt||$l(i,l,o,!1),w=(o&i.childLanes)!==0,Jt||w){if(w=jt,w!==null&&(u=Qe(w,o),u!==0&&u!==q.retryLane))throw q.retryLane=u,Is(i,u),Kn(w,i,u),Wp;$m(N)||Bu(),l=rm(i,l,o)}else $m(N)?(l.flags|=192,l.child=i.child,l=null):(i=q.treeContext,Ot=Ni(N.nextSibling),mn=l,dt=!0,ns=null,ki=!1,i!==null&&U1(l,i),l=im(l,u.children),l.flags|=4096);return l}return m?(cs(),N=u.fallback,m=l.mode,q=i.child,ie=q.sibling,u=pr(q,{mode:"hidden",children:u.children}),u.subtreeFlags=q.subtreeFlags&65011712,ie!==null?N=pr(ie,N):(N=Us(N,m,o,null),N.flags|=2),N.return=l,u.return=l,u.sibling=N,l.child=u,co(null,u),u=l.child,N=i.child.memoizedState,N===null?N=tm(o):(m=N.cachePool,m!==null?(q=Gt._currentValue,m=m.parent!==q?{parent:q,pool:q}:m):m=G1(),N={baseLanes:N.baseLanes|o,cachePool:m}),u.memoizedState=N,u.childLanes=nm(i,w,o),l.memoizedState=em,co(i.child,u)):(os(l),o=i.child,i=o.sibling,o=pr(o,{mode:"visible",children:u.children}),o.return=l,o.sibling=null,i!==null&&(w=l.deletions,w===null?(l.deletions=[i],l.flags|=16):w.push(i)),l.child=o,l.memoizedState=null,o)}function im(i,l){return l=Tu({mode:"visible",children:l},i.mode),l.return=i,i.child=l}function Tu(i,l){return i=Zn(22,i,null,l),i.lanes=0,i}function rm(i,l,o){return Xs(l,i.child,null,o),i=im(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function aS(i,l,o){i.lanes|=l;var u=i.alternate;u!==null&&(u.lanes|=l),xp(i.return,l,o)}function sm(i,l,o,u,m,y){var w=i.memoizedState;w===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:m,treeForkCount:y}:(w.isBackwards=l,w.rendering=null,w.renderingStartTime=0,w.last=u,w.tail=o,w.tailMode=m,w.treeForkCount=y)}function oS(i,l,o){var u=l.pendingProps,m=u.revealOrder,y=u.tail;u=u.children;var w=Ft.current,N=(w&2)!==0;if(N?(w=w&1|2,l.flags|=128):w&=1,ue(Ft,w),yn(i,l,u,o),u=dt?Ja:0,!N&&i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&aS(i,o,l);else if(i.tag===19)aS(i,o,l);else if(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}switch(m){case"forwards":for(o=l.child,m=null;o!==null;)i=o.alternate,i!==null&&mu(i)===null&&(m=o),o=o.sibling;o=m,o===null?(m=l.child,l.child=null):(m=o.sibling,o.sibling=null),sm(l,!1,m,o,y,u);break;case"backwards":case"unstable_legacy-backwards":for(o=null,m=l.child,l.child=null;m!==null;){if(i=m.alternate,i!==null&&mu(i)===null){l.child=m;break}i=m.sibling,m.sibling=o,o=m,m=i}sm(l,!0,o,null,y,u);break;case"together":sm(l,!1,null,null,void 0,u);break;default:l.memoizedState=null}return l.child}function vr(i,l,o){if(i!==null&&(l.dependencies=i.dependencies),fs|=l.lanes,(o&l.childLanes)===0)if(i!==null){if($l(i,l,o,!1),(o&l.childLanes)===0)return null}else return null;if(i!==null&&l.child!==i.child)throw Error(r(153));if(l.child!==null){for(i=l.child,o=pr(i,i.pendingProps),l.child=o,o.return=l;i.sibling!==null;)i=i.sibling,o=o.sibling=pr(i,i.pendingProps),o.return=l;o.sibling=null}return l.child}function lm(i,l){return(i.lanes&l)!==0?!0:(i=i.dependencies,!!(i!==null&&au(i)))}function RM(i,l,o){switch(l.tag){case 3:Ze(l,l.stateNode.containerInfo),rs(l,Gt,i.memoizedState.cache),Fs();break;case 27:case 5:Ke(l);break;case 4:Ze(l,l.stateNode.containerInfo);break;case 10:rs(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Mp(l),null;break;case 13:var u=l.memoizedState;if(u!==null)return u.dehydrated!==null?(os(l),l.flags|=128,null):(o&l.child.childLanes)!==0?lS(i,l,o):(os(l),i=vr(i,l,o),i!==null?i.sibling:null);os(l);break;case 19:var m=(i.flags&128)!==0;if(u=(o&l.childLanes)!==0,u||($l(i,l,o,!1),u=(o&l.childLanes)!==0),m){if(u)return oS(i,l,o);l.flags|=128}if(m=l.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),ue(Ft,Ft.current),u)break;return null;case 22:return l.lanes=0,eS(i,l,o,l.pendingProps);case 24:rs(l,Gt,i.memoizedState.cache)}return vr(i,l,o)}function cS(i,l,o){if(i!==null)if(i.memoizedProps!==l.pendingProps)Jt=!0;else{if(!lm(i,o)&&(l.flags&128)===0)return Jt=!1,RM(i,l,o);Jt=(i.flags&131072)!==0}else Jt=!1,dt&&(l.flags&1048576)!==0&&I1(l,Ja,l.index);switch(l.lanes=0,l.tag){case 16:e:{var u=l.pendingProps;if(i=Ys(l.elementType),l.type=i,typeof i=="function")dp(i)?(u=Qs(i,u),l.tag=1,l=rS(null,l,i,u,o)):(l.tag=0,l=Zp(null,l,i,u,o));else{if(i!=null){var m=i.$$typeof;if(m===O){l.tag=11,l=Qw(null,l,i,u,o);break e}else if(m===M){l.tag=14,l=Ww(null,l,i,u,o);break e}}throw l=ye(i)||i,Error(r(306,l,""))}}return l;case 0:return Zp(i,l,l.type,l.pendingProps,o);case 1:return u=l.type,m=Qs(u,l.pendingProps),rS(i,l,u,m,o);case 3:e:{if(Ze(l,l.stateNode.containerInfo),i===null)throw Error(r(387));u=l.pendingProps;var y=l.memoizedState;m=y.element,Np(i,l),ro(l,u,null,o);var w=l.memoizedState;if(u=w.cache,rs(l,Gt,u),u!==y.cache&&vp(l,[Gt],o,!0),io(),u=w.element,y.isDehydrated)if(y={element:u,isDehydrated:!1,cache:w.cache},l.updateQueue.baseState=y,l.memoizedState=y,l.flags&256){l=sS(i,l,u,o);break e}else if(u!==m){m=wi(Error(r(424)),l),Qa(m),l=sS(i,l,u,o);break e}else for(i=l.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,Ot=Ni(i.firstChild),mn=l,dt=!0,ns=null,ki=!0,o=ew(l,null,u,o),l.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Fs(),u===m){l=vr(i,l,o);break e}yn(i,l,u,o)}l=l.child}return l;case 26:return Nu(i,l),i===null?(o=v2(l.type,null,l.pendingProps,null))?l.memoizedState=o:dt||(o=l.type,i=l.pendingProps,u=Fu(Re.current).createElement(o),u[_t]=l,u[It]=i,bn(u,o,i),Ut(u),l.stateNode=u):l.memoizedState=v2(l.type,i.memoizedProps,l.pendingProps,i.memoizedState),null;case 27:return Ke(l),i===null&&dt&&(u=l.stateNode=y2(l.type,l.pendingProps,Re.current),mn=l,ki=!0,m=Ot,ys(l.type)?(zm=m,Ot=Ni(u.firstChild)):Ot=m),yn(i,l,l.pendingProps.children,o),Nu(i,l),i===null&&(l.flags|=4194304),l.child;case 5:return i===null&&dt&&((m=u=Ot)&&(u=oR(u,l.type,l.pendingProps,ki),u!==null?(l.stateNode=u,mn=l,Ot=Ni(u.firstChild),ki=!1,m=!0):m=!1),m||is(l)),Ke(l),m=l.type,y=l.pendingProps,w=i!==null?i.memoizedProps:null,u=y.children,_m(m,y)?u=null:w!==null&&_m(m,w)&&(l.flags|=32),l.memoizedState!==null&&(m=Dp(i,l,AM,null,null,o),Co._currentValue=m),Nu(i,l),yn(i,l,u,o),l.child;case 6:return i===null&&dt&&((i=o=Ot)&&(o=cR(o,l.pendingProps,ki),o!==null?(l.stateNode=o,mn=l,Ot=null,i=!0):i=!1),i||is(l)),null;case 13:return lS(i,l,o);case 4:return Ze(l,l.stateNode.containerInfo),u=l.pendingProps,i===null?l.child=Xs(l,null,u,o):yn(i,l,u,o),l.child;case 11:return Qw(i,l,l.type,l.pendingProps,o);case 7:return yn(i,l,l.pendingProps,o),l.child;case 8:return yn(i,l,l.pendingProps.children,o),l.child;case 12:return yn(i,l,l.pendingProps.children,o),l.child;case 10:return u=l.pendingProps,rs(l,l.type,u.value),yn(i,l,u.children,o),l.child;case 9:return m=l.type._context,u=l.pendingProps.children,Ps(l),m=gn(m),u=u(m),l.flags|=1,yn(i,l,u,o),l.child;case 14:return Ww(i,l,l.type,l.pendingProps,o);case 15:return Zw(i,l,l.type,l.pendingProps,o);case 19:return oS(i,l,o);case 31:return MM(i,l,o);case 22:return eS(i,l,o,l.pendingProps);case 24:return Ps(l),u=gn(Gt),i===null?(m=Ap(),m===null&&(m=jt,y=wp(),m.pooledCache=y,y.refCount++,y!==null&&(m.pooledCacheLanes|=o),m=y),l.memoizedState={parent:u,cache:m},Cp(l),rs(l,Gt,m)):((i.lanes&o)!==0&&(Np(i,l),ro(l,null,null,o),io()),m=i.memoizedState,y=l.memoizedState,m.parent!==u?(m={parent:u,cache:u},l.memoizedState=m,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=m),rs(l,Gt,u)):(u=y.cache,rs(l,Gt,u),u!==m.cache&&vp(l,[Gt],o,!0))),yn(i,l,l.pendingProps.children,o),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function wr(i){i.flags|=4}function am(i,l,o,u,m){if((l=(i.mode&32)!==0)&&(l=!1),l){if(i.flags|=16777216,(m&335544128)===m)if(i.stateNode.complete)i.flags|=8192;else if(BS())i.flags|=8192;else throw Gs=du,kp}else i.flags&=-16777217}function uS(i,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!C2(l))if(BS())i.flags|=8192;else throw Gs=du,kp}function ju(i,l){l!==null&&(i.flags|=4),i.flags&16384&&(l=i.tag!==22?Rn():536870912,i.lanes|=l,Xl|=l)}function uo(i,l){if(!dt)switch(i.tailMode){case"hidden":l=i.tail;for(var o=null;l!==null;)l.alternate!==null&&(o=l),l=l.sibling;o===null?i.tail=null:o.sibling=null;break;case"collapsed":o=i.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:u.sibling=null}}function Mt(i){var l=i.alternate!==null&&i.alternate.child===i.child,o=0,u=0;if(l)for(var m=i.child;m!==null;)o|=m.lanes|m.childLanes,u|=m.subtreeFlags&65011712,u|=m.flags&65011712,m.return=i,m=m.sibling;else for(m=i.child;m!==null;)o|=m.lanes|m.childLanes,u|=m.subtreeFlags,u|=m.flags,m.return=i,m=m.sibling;return i.subtreeFlags|=u,i.childLanes=o,l}function DM(i,l,o){var u=l.pendingProps;switch(mp(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(l),null;case 1:return Mt(l),null;case 3:return o=l.stateNode,u=null,i!==null&&(u=i.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),yr(Gt),_e(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&(Bl(l)?wr(l):i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,yp())),Mt(l),null;case 26:var m=l.type,y=l.memoizedState;return i===null?(wr(l),y!==null?(Mt(l),uS(l,y)):(Mt(l),am(l,m,null,u,o))):y?y!==i.memoizedState?(wr(l),Mt(l),uS(l,y)):(Mt(l),l.flags&=-16777217):(i=i.memoizedProps,i!==u&&wr(l),Mt(l),am(l,m,i,u,o)),null;case 27:if(gt(l),o=Re.current,m=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==u&&wr(l);else{if(!u){if(l.stateNode===null)throw Error(r(166));return Mt(l),null}i=Se.current,Bl(l)?F1(l):(i=y2(m,u,o),l.stateNode=i,wr(l))}return Mt(l),null;case 5:if(gt(l),m=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==u&&wr(l);else{if(!u){if(l.stateNode===null)throw Error(r(166));return Mt(l),null}if(y=Se.current,Bl(l))F1(l);else{var w=Fu(Re.current);switch(y){case 1:y=w.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:y=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":y=w.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":y=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":y=w.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof u.is=="string"?w.createElement("select",{is:u.is}):w.createElement("select"),u.multiple?y.multiple=!0:u.size&&(y.size=u.size);break;default:y=typeof u.is=="string"?w.createElement(m,{is:u.is}):w.createElement(m)}}y[_t]=l,y[It]=u;e:for(w=l.child;w!==null;){if(w.tag===5||w.tag===6)y.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===l)break e;for(;w.sibling===null;){if(w.return===null||w.return===l)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}l.stateNode=y;e:switch(bn(y,m,u),m){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&wr(l)}}return Mt(l),am(l,l.type,i===null?null:i.memoizedProps,l.pendingProps,o),null;case 6:if(i&&l.stateNode!=null)i.memoizedProps!==u&&wr(l);else{if(typeof u!="string"&&l.stateNode===null)throw Error(r(166));if(i=Re.current,Bl(l)){if(i=l.stateNode,o=l.memoizedProps,u=null,m=mn,m!==null)switch(m.tag){case 27:case 5:u=m.memoizedProps}i[_t]=l,i=!!(i.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||l2(i.nodeValue,o)),i||is(l,!0)}else i=Fu(i).createTextNode(u),i[_t]=l,l.stateNode=i}return Mt(l),null;case 31:if(o=l.memoizedState,i===null||i.memoizedState!==null){if(u=Bl(l),o!==null){if(i===null){if(!u)throw Error(r(318));if(i=l.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[_t]=l}else Fs(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Mt(l),i=!1}else o=yp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=o),i=!0;if(!i)return l.flags&256?(ti(l),l):(ti(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Mt(l),null;case 13:if(u=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(m=Bl(l),u!==null&&u.dehydrated!==null){if(i===null){if(!m)throw Error(r(318));if(m=l.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(r(317));m[_t]=l}else Fs(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Mt(l),m=!1}else m=yp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=m),m=!0;if(!m)return l.flags&256?(ti(l),l):(ti(l),null)}return ti(l),(l.flags&128)!==0?(l.lanes=o,l):(o=u!==null,i=i!==null&&i.memoizedState!==null,o&&(u=l.child,m=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(m=u.alternate.memoizedState.cachePool.pool),y=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),y!==m&&(u.flags|=2048)),o!==i&&o&&(l.child.flags|=8192),ju(l,l.updateQueue),Mt(l),null);case 4:return _e(),i===null&&Em(l.stateNode.containerInfo),Mt(l),null;case 10:return yr(l.type),Mt(l),null;case 19:if(P(Ft),u=l.memoizedState,u===null)return Mt(l),null;if(m=(l.flags&128)!==0,y=u.rendering,y===null)if(m)uo(u,!1);else{if($t!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(y=mu(i),y!==null){for(l.flags|=128,uo(u,!1),i=y.updateQueue,l.updateQueue=i,ju(l,i),l.subtreeFlags=0,i=o,o=l.child;o!==null;)q1(o,i),o=o.sibling;return ue(Ft,Ft.current&1|2),dt&&mr(l,u.treeForkCount),l.child}i=i.sibling}u.tail!==null&<()>Du&&(l.flags|=128,m=!0,uo(u,!1),l.lanes=4194304)}else{if(!m)if(i=mu(y),i!==null){if(l.flags|=128,m=!0,i=i.updateQueue,l.updateQueue=i,ju(l,i),uo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!y.alternate&&!dt)return Mt(l),null}else 2*lt()-u.renderingStartTime>Du&&o!==536870912&&(l.flags|=128,m=!0,uo(u,!1),l.lanes=4194304);u.isBackwards?(y.sibling=l.child,l.child=y):(i=u.last,i!==null?i.sibling=y:l.child=y,u.last=y)}return u.tail!==null?(i=u.tail,u.rendering=i,u.tail=i.sibling,u.renderingStartTime=lt(),i.sibling=null,o=Ft.current,ue(Ft,m?o&1|2:o&1),dt&&mr(l,u.treeForkCount),i):(Mt(l),null);case 22:case 23:return ti(l),Op(),u=l.memoizedState!==null,i!==null?i.memoizedState!==null!==u&&(l.flags|=8192):u&&(l.flags|=8192),u?(o&536870912)!==0&&(l.flags&128)===0&&(Mt(l),l.subtreeFlags&6&&(l.flags|=8192)):Mt(l),o=l.updateQueue,o!==null&&ju(l,o.retryQueue),o=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==o&&(l.flags|=2048),i!==null&&P(Ks),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),l.memoizedState.cache!==o&&(l.flags|=2048),yr(Gt),Mt(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function _M(i,l){switch(mp(l),l.tag){case 1:return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return yr(Gt),_e(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 26:case 27:case 5:return gt(l),null;case 31:if(l.memoizedState!==null){if(ti(l),l.alternate===null)throw Error(r(340));Fs()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 13:if(ti(l),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Fs()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return P(Ft),null;case 4:return _e(),null;case 10:return yr(l.type),null;case 22:case 23:return ti(l),Op(),i!==null&&P(Ks),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 24:return yr(Gt),null;case 25:return null;default:return null}}function dS(i,l){switch(mp(l),l.tag){case 3:yr(Gt),_e();break;case 26:case 27:case 5:gt(l);break;case 4:_e();break;case 31:l.memoizedState!==null&&ti(l);break;case 13:ti(l);break;case 19:P(Ft);break;case 10:yr(l.type);break;case 22:case 23:ti(l),Op(),i!==null&&P(Ks);break;case 24:yr(Gt)}}function fo(i,l){try{var o=l.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var m=u.next;o=m;do{if((o.tag&i)===i){u=void 0;var y=o.create,w=o.inst;u=y(),w.destroy=u}o=o.next}while(o!==m)}}catch(N){St(l,l.return,N)}}function us(i,l,o){try{var u=l.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var y=m.next;u=y;do{if((u.tag&i)===i){var w=u.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,m=l;var q=o,ie=N;try{ie()}catch(me){St(m,q,me)}}}u=u.next}while(u!==y)}}catch(me){St(l,l.return,me)}}function fS(i){var l=i.updateQueue;if(l!==null){var o=i.stateNode;try{nw(l,o)}catch(u){St(i,i.return,u)}}}function hS(i,l,o){o.props=Qs(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(u){St(i,l,u)}}function ho(i,l){try{var o=i.ref;if(o!==null){switch(i.tag){case 26:case 27:case 5:var u=i.stateNode;break;case 30:u=i.stateNode;break;default:u=i.stateNode}typeof o=="function"?i.refCleanup=o(u):o.current=u}}catch(m){St(i,l,m)}}function Zi(i,l){var o=i.ref,u=i.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(m){St(i,l,m)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(m){St(i,l,m)}else o.current=null}function pS(i){var l=i.type,o=i.memoizedProps,u=i.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(m){St(i,i.return,m)}}function om(i,l,o){try{var u=i.stateNode;nR(u,i.type,o,l),u[It]=l}catch(m){St(i,i.return,m)}}function mS(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ys(i.type)||i.tag===4}function cm(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||mS(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&ys(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function um(i,l,o){var u=i.tag;if(u===5||u===6)i=i.stateNode,l?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(i,l):(l=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,l.appendChild(i),o=o._reactRootContainer,o!=null||l.onclick!==null||(l.onclick=fr));else if(u!==4&&(u===27&&ys(i.type)&&(o=i.stateNode,l=null),i=i.child,i!==null))for(um(i,l,o),i=i.sibling;i!==null;)um(i,l,o),i=i.sibling}function Eu(i,l,o){var u=i.tag;if(u===5||u===6)i=i.stateNode,l?o.insertBefore(i,l):o.appendChild(i);else if(u!==4&&(u===27&&ys(i.type)&&(o=i.stateNode),i=i.child,i!==null))for(Eu(i,l,o),i=i.sibling;i!==null;)Eu(i,l,o),i=i.sibling}function gS(i){var l=i.stateNode,o=i.memoizedProps;try{for(var u=i.type,m=l.attributes;m.length;)l.removeAttributeNode(m[0]);bn(l,u,o),l[_t]=i,l[It]=o}catch(y){St(i,i.return,y)}}var Sr=!1,Qt=!1,dm=!1,yS=typeof WeakSet=="function"?WeakSet:Set,ln=null;function LM(i,l){if(i=i.containerInfo,Rm=Ju,i=E1(i),rp(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var m=u.anchorOffset,y=u.focusNode;u=u.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var w=0,N=-1,q=-1,ie=0,me=0,ve=i,re=null;t:for(;;){for(var ce;ve!==o||m!==0&&ve.nodeType!==3||(N=w+m),ve!==y||u!==0&&ve.nodeType!==3||(q=w+u),ve.nodeType===3&&(w+=ve.nodeValue.length),(ce=ve.firstChild)!==null;)re=ve,ve=ce;for(;;){if(ve===i)break t;if(re===o&&++ie===m&&(N=w),re===y&&++me===u&&(q=w),(ce=ve.nextSibling)!==null)break;ve=re,re=ve.parentNode}ve=ce}o=N===-1||q===-1?null:{start:N,end:q}}else o=null}o=o||{start:0,end:0}}else o=null;for(Dm={focusedElem:i,selectionRange:o},Ju=!1,ln=l;ln!==null;)if(l=ln,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,ln=i;else for(;ln!==null;){switch(l=ln,y=l.alternate,i=l.flags,l.tag){case 0:if((i&4)!==0&&(i=l.updateQueue,i=i!==null?i.events:null,i!==null))for(o=0;o<i.length;o++)m=i[o],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&y!==null){i=void 0,o=l,m=y.memoizedProps,y=y.memoizedState,u=o.stateNode;try{var Le=Qs(o.type,m);i=u.getSnapshotBeforeUpdate(Le,y),u.__reactInternalSnapshotBeforeUpdate=i}catch(Ve){St(o,o.return,Ve)}}break;case 3:if((i&1024)!==0){if(i=l.stateNode.containerInfo,o=i.nodeType,o===9)Bm(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Bm(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=l.sibling,i!==null){i.return=l.return,ln=i;break}ln=l.return}}function bS(i,l,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:kr(i,o),u&4&&fo(5,o);break;case 1:if(kr(i,o),u&4)if(i=o.stateNode,l===null)try{i.componentDidMount()}catch(w){St(o,o.return,w)}else{var m=Qs(o.type,l.memoizedProps);l=l.memoizedState;try{i.componentDidUpdate(m,l,i.__reactInternalSnapshotBeforeUpdate)}catch(w){St(o,o.return,w)}}u&64&&fS(o),u&512&&ho(o,o.return);break;case 3:if(kr(i,o),u&64&&(i=o.updateQueue,i!==null)){if(l=null,o.child!==null)switch(o.child.tag){case 27:case 5:l=o.child.stateNode;break;case 1:l=o.child.stateNode}try{nw(i,l)}catch(w){St(o,o.return,w)}}break;case 27:l===null&&u&4&&gS(o);case 26:case 5:kr(i,o),l===null&&u&4&&pS(o),u&512&&ho(o,o.return);break;case 12:kr(i,o);break;case 31:kr(i,o),u&4&&wS(i,o);break;case 13:kr(i,o),u&4&&SS(i,o),u&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=VM.bind(null,o),uR(i,o))));break;case 22:if(u=o.memoizedState!==null||Sr,!u){l=l!==null&&l.memoizedState!==null||Qt,m=Sr;var y=Qt;Sr=u,(Qt=l)&&!y?Cr(i,o,(o.subtreeFlags&8772)!==0):kr(i,o),Sr=m,Qt=y}break;case 30:break;default:kr(i,o)}}function xS(i){var l=i.alternate;l!==null&&(i.alternate=null,xS(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&Al(l)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Dt=null,Un=!1;function Ar(i,l,o){for(o=o.child;o!==null;)vS(i,l,o),o=o.sibling}function vS(i,l,o){if(k&&typeof k.onCommitFiberUnmount=="function")try{k.onCommitFiberUnmount(oe,o)}catch{}switch(o.tag){case 26:Qt||Zi(o,l),Ar(i,l,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Qt||Zi(o,l);var u=Dt,m=Un;ys(o.type)&&(Dt=o.stateNode,Un=!1),Ar(i,l,o),So(o.stateNode),Dt=u,Un=m;break;case 5:Qt||Zi(o,l);case 6:if(u=Dt,m=Un,Dt=null,Ar(i,l,o),Dt=u,Un=m,Dt!==null)if(Un)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(o.stateNode)}catch(y){St(o,l,y)}else try{Dt.removeChild(o.stateNode)}catch(y){St(o,l,y)}break;case 18:Dt!==null&&(Un?(i=Dt,f2(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),ia(i)):f2(Dt,o.stateNode));break;case 4:u=Dt,m=Un,Dt=o.stateNode.containerInfo,Un=!0,Ar(i,l,o),Dt=u,Un=m;break;case 0:case 11:case 14:case 15:us(2,o,l),Qt||us(4,o,l),Ar(i,l,o);break;case 1:Qt||(Zi(o,l),u=o.stateNode,typeof u.componentWillUnmount=="function"&&hS(o,l,u)),Ar(i,l,o);break;case 21:Ar(i,l,o);break;case 22:Qt=(u=Qt)||o.memoizedState!==null,Ar(i,l,o),Qt=u;break;default:Ar(i,l,o)}}function wS(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{ia(i)}catch(o){St(l,l.return,o)}}}function SS(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{ia(i)}catch(o){St(l,l.return,o)}}function BM(i){switch(i.tag){case 31:case 13:case 19:var l=i.stateNode;return l===null&&(l=i.stateNode=new yS),l;case 22:return i=i.stateNode,l=i._retryCache,l===null&&(l=i._retryCache=new yS),l;default:throw Error(r(435,i.tag))}}function Ou(i,l){var o=BM(i);l.forEach(function(u){if(!o.has(u)){o.add(u);var m=PM.bind(null,i,u);u.then(m,m)}})}function Fn(i,l){var o=l.deletions;if(o!==null)for(var u=0;u<o.length;u++){var m=o[u],y=i,w=l,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(ys(N.type)){Dt=N.stateNode,Un=!1;break e}break;case 5:Dt=N.stateNode,Un=!1;break e;case 3:case 4:Dt=N.stateNode.containerInfo,Un=!0;break e}N=N.return}if(Dt===null)throw Error(r(160));vS(y,w,m),Dt=null,Un=!1,y=m.alternate,y!==null&&(y.return=null),m.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)AS(l,i),l=l.sibling}var $i=null;function AS(i,l){var o=i.alternate,u=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Fn(l,i),Vn(i),u&4&&(us(3,i,i.return),fo(3,i),us(5,i,i.return));break;case 1:Fn(l,i),Vn(i),u&512&&(Qt||o===null||Zi(o,o.return)),u&64&&Sr&&(i=i.updateQueue,i!==null&&(u=i.callbacks,u!==null&&(o=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=o===null?u:o.concat(u))));break;case 26:var m=$i;if(Fn(l,i),Vn(i),u&512&&(Qt||o===null||Zi(o,o.return)),u&4){var y=o!==null?o.memoizedState:null;if(u=i.memoizedState,o===null)if(u===null)if(i.stateNode===null){e:{u=i.type,o=i.memoizedProps,m=m.ownerDocument||m;t:switch(u){case"title":y=m.getElementsByTagName("title")[0],(!y||y[Ji]||y[_t]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=m.createElement(u),m.head.insertBefore(y,m.querySelector("head > title"))),bn(y,u,o),y[_t]=i,Ut(y),u=y;break e;case"link":var w=A2("link","href",m).get(u+(o.href||""));if(w){for(var N=0;N<w.length;N++)if(y=w[N],y.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&y.getAttribute("rel")===(o.rel==null?null:o.rel)&&y.getAttribute("title")===(o.title==null?null:o.title)&&y.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){w.splice(N,1);break t}}y=m.createElement(u),bn(y,u,o),m.head.appendChild(y);break;case"meta":if(w=A2("meta","content",m).get(u+(o.content||""))){for(N=0;N<w.length;N++)if(y=w[N],y.getAttribute("content")===(o.content==null?null:""+o.content)&&y.getAttribute("name")===(o.name==null?null:o.name)&&y.getAttribute("property")===(o.property==null?null:o.property)&&y.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&y.getAttribute("charset")===(o.charSet==null?null:o.charSet)){w.splice(N,1);break t}}y=m.createElement(u),bn(y,u,o),m.head.appendChild(y);break;default:throw Error(r(468,u))}y[_t]=i,Ut(y),u=y}i.stateNode=u}else k2(m,i.type,i.stateNode);else i.stateNode=S2(m,u,i.memoizedProps);else y!==u?(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,u===null?k2(m,i.type,i.stateNode):S2(m,u,i.memoizedProps)):u===null&&i.stateNode!==null&&om(i,i.memoizedProps,o.memoizedProps)}break;case 27:Fn(l,i),Vn(i),u&512&&(Qt||o===null||Zi(o,o.return)),o!==null&&u&4&&om(i,i.memoizedProps,o.memoizedProps);break;case 5:if(Fn(l,i),Vn(i),u&512&&(Qt||o===null||Zi(o,o.return)),i.flags&32){m=i.stateNode;try{Nl(m,"")}catch(Le){St(i,i.return,Le)}}u&4&&i.stateNode!=null&&(m=i.memoizedProps,om(i,m,o!==null?o.memoizedProps:m)),u&1024&&(dm=!0);break;case 6:if(Fn(l,i),Vn(i),u&4){if(i.stateNode===null)throw Error(r(162));u=i.memoizedProps,o=i.stateNode;try{o.nodeValue=u}catch(Le){St(i,i.return,Le)}}break;case 3:if(Ku=null,m=$i,$i=Vu(l.containerInfo),Fn(l,i),$i=m,Vn(i),u&4&&o!==null&&o.memoizedState.isDehydrated)try{ia(l.containerInfo)}catch(Le){St(i,i.return,Le)}dm&&(dm=!1,kS(i));break;case 4:u=$i,$i=Vu(i.stateNode.containerInfo),Fn(l,i),Vn(i),$i=u;break;case 12:Fn(l,i),Vn(i);break;case 31:Fn(l,i),Vn(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,Ou(i,u)));break;case 13:Fn(l,i),Vn(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Ru=lt()),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,Ou(i,u)));break;case 22:m=i.memoizedState!==null;var q=o!==null&&o.memoizedState!==null,ie=Sr,me=Qt;if(Sr=ie||m,Qt=me||q,Fn(l,i),Qt=me,Sr=ie,Vn(i),u&8192)e:for(l=i.stateNode,l._visibility=m?l._visibility&-2:l._visibility|1,m&&(o===null||q||Sr||Qt||Ws(i)),o=null,l=i;;){if(l.tag===5||l.tag===26){if(o===null){q=o=l;try{if(y=q.stateNode,m)w=y.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{N=q.stateNode;var ve=q.memoizedProps.style,re=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;N.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(Le){St(q,q.return,Le)}}}else if(l.tag===6){if(o===null){q=l;try{q.stateNode.nodeValue=m?"":q.memoizedProps}catch(Le){St(q,q.return,Le)}}}else if(l.tag===18){if(o===null){q=l;try{var ce=q.stateNode;m?h2(ce,!0):h2(q.stateNode,!1)}catch(Le){St(q,q.return,Le)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===i)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break e;for(;l.sibling===null;){if(l.return===null||l.return===i)break e;o===l&&(o=null),l=l.return}o===l&&(o=null),l.sibling.return=l.return,l=l.sibling}u&4&&(u=i.updateQueue,u!==null&&(o=u.retryQueue,o!==null&&(u.retryQueue=null,Ou(i,o))));break;case 19:Fn(l,i),Vn(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,Ou(i,u)));break;case 30:break;case 21:break;default:Fn(l,i),Vn(i)}}function Vn(i){var l=i.flags;if(l&2){try{for(var o,u=i.return;u!==null;){if(mS(u)){o=u;break}u=u.return}if(o==null)throw Error(r(160));switch(o.tag){case 27:var m=o.stateNode,y=cm(i);Eu(i,y,m);break;case 5:var w=o.stateNode;o.flags&32&&(Nl(w,""),o.flags&=-33);var N=cm(i);Eu(i,N,w);break;case 3:case 4:var q=o.stateNode.containerInfo,ie=cm(i);um(i,ie,q);break;default:throw Error(r(161))}}catch(me){St(i,i.return,me)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function kS(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var l=i;kS(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),i=i.sibling}}function kr(i,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)bS(i,l.alternate,l),l=l.sibling}function Ws(i){for(i=i.child;i!==null;){var l=i;switch(l.tag){case 0:case 11:case 14:case 15:us(4,l,l.return),Ws(l);break;case 1:Zi(l,l.return);var o=l.stateNode;typeof o.componentWillUnmount=="function"&&hS(l,l.return,o),Ws(l);break;case 27:So(l.stateNode);case 26:case 5:Zi(l,l.return),Ws(l);break;case 22:l.memoizedState===null&&Ws(l);break;case 30:Ws(l);break;default:Ws(l)}i=i.sibling}}function Cr(i,l,o){for(o=o&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var u=l.alternate,m=i,y=l,w=y.flags;switch(y.tag){case 0:case 11:case 15:Cr(m,y,o),fo(4,y);break;case 1:if(Cr(m,y,o),u=y,m=u.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ie){St(u,u.return,ie)}if(u=y,m=u.updateQueue,m!==null){var N=u.stateNode;try{var q=m.shared.hiddenCallbacks;if(q!==null)for(m.shared.hiddenCallbacks=null,m=0;m<q.length;m++)tw(q[m],N)}catch(ie){St(u,u.return,ie)}}o&&w&64&&fS(y),ho(y,y.return);break;case 27:gS(y);case 26:case 5:Cr(m,y,o),o&&u===null&&w&4&&pS(y),ho(y,y.return);break;case 12:Cr(m,y,o);break;case 31:Cr(m,y,o),o&&w&4&&wS(m,y);break;case 13:Cr(m,y,o),o&&w&4&&SS(m,y);break;case 22:y.memoizedState===null&&Cr(m,y,o),ho(y,y.return);break;case 30:break;default:Cr(m,y,o)}l=l.sibling}}function fm(i,l){var o=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==o&&(i!=null&&i.refCount++,o!=null&&Wa(o))}function hm(i,l){i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Wa(i))}function qi(i,l,o,u){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)CS(i,l,o,u),l=l.sibling}function CS(i,l,o,u){var m=l.flags;switch(l.tag){case 0:case 11:case 15:qi(i,l,o,u),m&2048&&fo(9,l);break;case 1:qi(i,l,o,u);break;case 3:qi(i,l,o,u),m&2048&&(i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Wa(i)));break;case 12:if(m&2048){qi(i,l,o,u),i=l.stateNode;try{var y=l.memoizedProps,w=y.id,N=y.onPostCommit;typeof N=="function"&&N(w,l.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(q){St(l,l.return,q)}}else qi(i,l,o,u);break;case 31:qi(i,l,o,u);break;case 13:qi(i,l,o,u);break;case 23:break;case 22:y=l.stateNode,w=l.alternate,l.memoizedState!==null?y._visibility&2?qi(i,l,o,u):po(i,l):y._visibility&2?qi(i,l,o,u):(y._visibility|=2,Kl(i,l,o,u,(l.subtreeFlags&10256)!==0||!1)),m&2048&&fm(w,l);break;case 24:qi(i,l,o,u),m&2048&&hm(l.alternate,l);break;default:qi(i,l,o,u)}}function Kl(i,l,o,u,m){for(m=m&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var y=i,w=l,N=o,q=u,ie=w.flags;switch(w.tag){case 0:case 11:case 15:Kl(y,w,N,q,m),fo(8,w);break;case 23:break;case 22:var me=w.stateNode;w.memoizedState!==null?me._visibility&2?Kl(y,w,N,q,m):po(y,w):(me._visibility|=2,Kl(y,w,N,q,m)),m&&ie&2048&&fm(w.alternate,w);break;case 24:Kl(y,w,N,q,m),m&&ie&2048&&hm(w.alternate,w);break;default:Kl(y,w,N,q,m)}l=l.sibling}}function po(i,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var o=i,u=l,m=u.flags;switch(u.tag){case 22:po(o,u),m&2048&&fm(u.alternate,u);break;case 24:po(o,u),m&2048&&hm(u.alternate,u);break;default:po(o,u)}l=l.sibling}}var mo=8192;function Yl(i,l,o){if(i.subtreeFlags&mo)for(i=i.child;i!==null;)NS(i,l,o),i=i.sibling}function NS(i,l,o){switch(i.tag){case 26:Yl(i,l,o),i.flags&mo&&i.memoizedState!==null&&SR(o,$i,i.memoizedState,i.memoizedProps);break;case 5:Yl(i,l,o);break;case 3:case 4:var u=$i;$i=Vu(i.stateNode.containerInfo),Yl(i,l,o),$i=u;break;case 22:i.memoizedState===null&&(u=i.alternate,u!==null&&u.memoizedState!==null?(u=mo,mo=16777216,Yl(i,l,o),mo=u):Yl(i,l,o));break;default:Yl(i,l,o)}}function TS(i){var l=i.alternate;if(l!==null&&(i=l.child,i!==null)){l.child=null;do l=i.sibling,i.sibling=null,i=l;while(i!==null)}}function go(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var o=0;o<l.length;o++){var u=l[o];ln=u,ES(u,i)}TS(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)jS(i),i=i.sibling}function jS(i){switch(i.tag){case 0:case 11:case 15:go(i),i.flags&2048&&us(9,i,i.return);break;case 3:go(i);break;case 12:go(i);break;case 22:var l=i.stateNode;i.memoizedState!==null&&l._visibility&2&&(i.return===null||i.return.tag!==13)?(l._visibility&=-3,Mu(i)):go(i);break;default:go(i)}}function Mu(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var o=0;o<l.length;o++){var u=l[o];ln=u,ES(u,i)}TS(i)}for(i=i.child;i!==null;){switch(l=i,l.tag){case 0:case 11:case 15:us(8,l,l.return),Mu(l);break;case 22:o=l.stateNode,o._visibility&2&&(o._visibility&=-3,Mu(l));break;default:Mu(l)}i=i.sibling}}function ES(i,l){for(;ln!==null;){var o=ln;switch(o.tag){case 0:case 11:case 15:us(8,o,l);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Wa(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,ln=u;else e:for(o=i;ln!==null;){u=ln;var m=u.sibling,y=u.return;if(xS(u),u===o){ln=null;break e}if(m!==null){m.return=y,ln=m;break e}ln=y}}}var $M={getCacheForType:function(i){var l=gn(Gt),o=l.data.get(i);return o===void 0&&(o=i(),l.data.set(i,o)),o},cacheSignal:function(){return gn(Gt).controller.signal}},qM=typeof WeakMap=="function"?WeakMap:Map,xt=0,jt=null,at=null,ct=0,wt=0,ni=null,ds=!1,Gl=!1,pm=!1,Nr=0,$t=0,fs=0,Zs=0,mm=0,ii=0,Xl=0,yo=null,Pn=null,gm=!1,Ru=0,OS=0,Du=1/0,_u=null,hs=null,tn=0,ps=null,Jl=null,Tr=0,ym=0,bm=null,MS=null,bo=0,xm=null;function ri(){return(xt&2)!==0&&ct!==0?ct&-ct:_.T!==null?Cm():Li()}function RS(){if(ii===0)if((ct&536870912)===0||dt){var i=ke;ke<<=1,(ke&3932160)===0&&(ke=262144),ii=i}else ii=536870912;return i=ei.current,i!==null&&(i.flags|=32),ii}function Kn(i,l,o){(i===jt&&(wt===2||wt===9)||i.cancelPendingCommit!==null)&&(Ql(i,0),ms(i,ct,ii,!1)),Kt(i,o),((xt&2)===0||i!==jt)&&(i===jt&&((xt&2)===0&&(Zs|=o),$t===4&&ms(i,ct,ii,!1)),er(i))}function DS(i,l,o){if((xt&6)!==0)throw Error(r(327));var u=!o&&(l&127)===0&&(l&i.expiredLanes)===0||ze(i,l),m=u?IM(i,l):wm(i,l,!0),y=u;do{if(m===0){Gl&&!u&&ms(i,l,0,!1);break}else{if(o=i.current.alternate,y&&!zM(o)){m=wm(i,l,!1),y=!1;continue}if(m===2){if(y=l,i.errorRecoveryDisabledLanes&y)var w=0;else w=i.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){l=w;e:{var N=i;m=yo;var q=N.current.memoizedState.isDehydrated;if(q&&(Ql(N,w).flags|=256),w=wm(N,w,!1),w!==2){if(pm&&!q){N.errorRecoveryDisabledLanes|=y,Zs|=y,m=4;break e}y=Pn,Pn=m,y!==null&&(Pn===null?Pn=y:Pn.push.apply(Pn,y))}m=w}if(y=!1,m!==2)continue}}if(m===1){Ql(i,0),ms(i,l,0,!0);break}e:{switch(u=i,y=m,y){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:ms(u,l,ii,!ds);break e;case 2:Pn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(m=Ru+300-lt(),10<m)){if(ms(u,l,ii,!ds),$e(u,0,!0)!==0)break e;Tr=l,u.timeoutHandle=u2(_S.bind(null,u,o,Pn,_u,gm,l,ii,Zs,Xl,ds,y,"Throttled",-0,0),m);break e}_S(u,o,Pn,_u,gm,l,ii,Zs,Xl,ds,y,null,-0,0)}}break}while(!0);er(i)}function _S(i,l,o,u,m,y,w,N,q,ie,me,ve,re,ce){if(i.timeoutHandle=-1,ve=l.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:fr},NS(l,y,ve);var Le=(y&62914560)===y?Ru-lt():(y&4194048)===y?OS-lt():0;if(Le=AR(ve,Le),Le!==null){Tr=y,i.cancelPendingCommit=Le(US.bind(null,i,l,y,o,u,m,w,N,q,me,ve,null,re,ce)),ms(i,y,w,!ie);return}}US(i,l,y,o,u,m,w,N,q)}function zM(i){for(var l=i;;){var o=l.tag;if((o===0||o===11||o===15)&&l.flags&16384&&(o=l.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var u=0;u<o.length;u++){var m=o[u],y=m.getSnapshot;m=m.value;try{if(!Wn(y(),m))return!1}catch{return!1}}if(o=l.child,l.subtreeFlags&16384&&o!==null)o.return=l,l=o;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function ms(i,l,o,u){l&=~mm,l&=~Zs,i.suspendedLanes|=l,i.pingedLanes&=~l,u&&(i.warmLanes|=l),u=i.expirationTimes;for(var m=l;0<m;){var y=31-Z(m),w=1<<y;u[y]=-1,m&=~w}o!==0&&or(i,o,l)}function Lu(){return(xt&6)===0?(xo(0),!1):!0}function vm(){if(at!==null){if(wt===0)var i=at.return;else i=at,gr=Vs=null,Bp(i),Il=null,eo=0,i=at;for(;i!==null;)dS(i.alternate,i),i=i.return;at=null}}function Ql(i,l){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,sR(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),Tr=0,vm(),jt=i,at=o=pr(i.current,null),ct=l,wt=0,ni=null,ds=!1,Gl=ze(i,l),pm=!1,Xl=ii=mm=Zs=fs=$t=0,Pn=yo=null,gm=!1,(l&8)!==0&&(l|=l&32);var u=i.entangledLanes;if(u!==0)for(i=i.entanglements,u&=l;0<u;){var m=31-Z(u),y=1<<m;l|=i[m],u&=~y}return Nr=l,nu(),o}function LS(i,l){tt=null,_.H=oo,l===Hl||l===uu?(l=Q1(),wt=3):l===kp?(l=Q1(),wt=4):wt=l===Wp?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,ni=l,at===null&&($t=1,ku(i,wi(l,i.current)))}function BS(){var i=ei.current;return i===null?!0:(ct&4194048)===ct?Ci===null:(ct&62914560)===ct||(ct&536870912)!==0?i===Ci:!1}function $S(){var i=_.H;return _.H=oo,i===null?oo:i}function qS(){var i=_.A;return _.A=$M,i}function Bu(){$t=4,ds||(ct&4194048)!==ct&&ei.current!==null||(Gl=!0),(fs&134217727)===0&&(Zs&134217727)===0||jt===null||ms(jt,ct,ii,!1)}function wm(i,l,o){var u=xt;xt|=2;var m=$S(),y=qS();(jt!==i||ct!==l)&&(_u=null,Ql(i,l)),l=!1;var w=$t;e:do try{if(wt!==0&&at!==null){var N=at,q=ni;switch(wt){case 8:vm(),w=6;break e;case 3:case 2:case 9:case 6:ei.current===null&&(l=!0);var ie=wt;if(wt=0,ni=null,Wl(i,N,q,ie),o&&Gl){w=0;break e}break;default:ie=wt,wt=0,ni=null,Wl(i,N,q,ie)}}HM(),w=$t;break}catch(me){LS(i,me)}while(!0);return l&&i.shellSuspendCounter++,gr=Vs=null,xt=u,_.H=m,_.A=y,at===null&&(jt=null,ct=0,nu()),w}function HM(){for(;at!==null;)zS(at)}function IM(i,l){var o=xt;xt|=2;var u=$S(),m=qS();jt!==i||ct!==l?(_u=null,Du=lt()+500,Ql(i,l)):Gl=ze(i,l);e:do try{if(wt!==0&&at!==null){l=at;var y=ni;t:switch(wt){case 1:wt=0,ni=null,Wl(i,l,y,1);break;case 2:case 9:if(X1(y)){wt=0,ni=null,HS(l);break}l=function(){wt!==2&&wt!==9||jt!==i||(wt=7),er(i)},y.then(l,l);break e;case 3:wt=7;break e;case 4:wt=5;break e;case 7:X1(y)?(wt=0,ni=null,HS(l)):(wt=0,ni=null,Wl(i,l,y,7));break;case 5:var w=null;switch(at.tag){case 26:w=at.memoizedState;case 5:case 27:var N=at;if(w?C2(w):N.stateNode.complete){wt=0,ni=null;var q=N.sibling;if(q!==null)at=q;else{var ie=N.return;ie!==null?(at=ie,$u(ie)):at=null}break t}}wt=0,ni=null,Wl(i,l,y,5);break;case 6:wt=0,ni=null,Wl(i,l,y,6);break;case 8:vm(),$t=6;break e;default:throw Error(r(462))}}UM();break}catch(me){LS(i,me)}while(!0);return gr=Vs=null,_.H=u,_.A=m,xt=o,at!==null?0:(jt=null,ct=0,nu(),$t)}function UM(){for(;at!==null&&!qn();)zS(at)}function zS(i){var l=cS(i.alternate,i,Nr);i.memoizedProps=i.pendingProps,l===null?$u(i):at=l}function HS(i){var l=i,o=l.alternate;switch(l.tag){case 15:case 0:l=iS(o,l,l.pendingProps,l.type,void 0,ct);break;case 11:l=iS(o,l,l.pendingProps,l.type.render,l.ref,ct);break;case 5:Bp(l);default:dS(o,l),l=at=q1(l,Nr),l=cS(o,l,Nr)}i.memoizedProps=i.pendingProps,l===null?$u(i):at=l}function Wl(i,l,o,u){gr=Vs=null,Bp(l),Il=null,eo=0;var m=l.return;try{if(OM(i,m,l,o,ct)){$t=1,ku(i,wi(o,i.current)),at=null;return}}catch(y){if(m!==null)throw at=m,y;$t=1,ku(i,wi(o,i.current)),at=null;return}l.flags&32768?(dt||u===1?i=!0:Gl||(ct&536870912)!==0?i=!1:(ds=i=!0,(u===2||u===9||u===3||u===6)&&(u=ei.current,u!==null&&u.tag===13&&(u.flags|=16384))),IS(l,i)):$u(l)}function $u(i){var l=i;do{if((l.flags&32768)!==0){IS(l,ds);return}i=l.return;var o=DM(l.alternate,l,Nr);if(o!==null){at=o;return}if(l=l.sibling,l!==null){at=l;return}at=l=i}while(l!==null);$t===0&&($t=5)}function IS(i,l){do{var o=_M(i.alternate,i);if(o!==null){o.flags&=32767,at=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!l&&(i=i.sibling,i!==null)){at=i;return}at=i=o}while(i!==null);$t=6,at=null}function US(i,l,o,u,m,y,w,N,q){i.cancelPendingCommit=null;do qu();while(tn!==0);if((xt&6)!==0)throw Error(r(327));if(l!==null){if(l===i.current)throw Error(r(177));if(y=l.lanes|l.childLanes,y|=cp,_i(i,o,y,w,N,q),i===jt&&(at=jt=null,ct=0),Jl=l,ps=i,Tr=o,ym=y,bm=m,MS=u,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,KM(Tt,function(){return YS(),null})):(i.callbackNode=null,i.callbackPriority=0),u=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||u){u=_.T,_.T=null,m=ee.p,ee.p=2,w=xt,xt|=4;try{LM(i,l,o)}finally{xt=w,ee.p=m,_.T=u}}tn=1,FS(),VS(),PS()}}function FS(){if(tn===1){tn=0;var i=ps,l=Jl,o=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||o){o=_.T,_.T=null;var u=ee.p;ee.p=2;var m=xt;xt|=4;try{AS(l,i);var y=Dm,w=E1(i.containerInfo),N=y.focusedElem,q=y.selectionRange;if(w!==N&&N&&N.ownerDocument&&j1(N.ownerDocument.documentElement,N)){if(q!==null&&rp(N)){var ie=q.start,me=q.end;if(me===void 0&&(me=ie),"selectionStart"in N)N.selectionStart=ie,N.selectionEnd=Math.min(me,N.value.length);else{var ve=N.ownerDocument||document,re=ve&&ve.defaultView||window;if(re.getSelection){var ce=re.getSelection(),Le=N.textContent.length,Ve=Math.min(q.start,Le),Ct=q.end===void 0?Ve:Math.min(q.end,Le);!ce.extend&&Ve>Ct&&(w=Ct,Ct=Ve,Ve=w);var Y=T1(N,Ve),U=T1(N,Ct);if(Y&&U&&(ce.rangeCount!==1||ce.anchorNode!==Y.node||ce.anchorOffset!==Y.offset||ce.focusNode!==U.node||ce.focusOffset!==U.offset)){var ne=ve.createRange();ne.setStart(Y.node,Y.offset),ce.removeAllRanges(),Ve>Ct?(ce.addRange(ne),ce.extend(U.node,U.offset)):(ne.setEnd(U.node,U.offset),ce.addRange(ne))}}}}for(ve=[],ce=N;ce=ce.parentNode;)ce.nodeType===1&&ve.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ve.length;N++){var be=ve[N];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}Ju=!!Rm,Dm=Rm=null}finally{xt=m,ee.p=u,_.T=o}}i.current=l,tn=2}}function VS(){if(tn===2){tn=0;var i=ps,l=Jl,o=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||o){o=_.T,_.T=null;var u=ee.p;ee.p=2;var m=xt;xt|=4;try{bS(i,l.alternate,l)}finally{xt=m,ee.p=u,_.T=o}}tn=3}}function PS(){if(tn===4||tn===3){tn=0,Cn();var i=ps,l=Jl,o=Tr,u=MS;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?tn=5:(tn=0,Jl=ps=null,KS(i,i.pendingLanes));var m=i.pendingLanes;if(m===0&&(hs=null),mi(o),l=l.stateNode,k&&typeof k.onCommitFiberRoot=="function")try{k.onCommitFiberRoot(oe,l,void 0,(l.current.flags&128)===128)}catch{}if(u!==null){l=_.T,m=ee.p,ee.p=2,_.T=null;try{for(var y=i.onRecoverableError,w=0;w<u.length;w++){var N=u[w];y(N.value,{componentStack:N.stack})}}finally{_.T=l,ee.p=m}}(Tr&3)!==0&&qu(),er(i),m=i.pendingLanes,(o&261930)!==0&&(m&42)!==0?i===xm?bo++:(bo=0,xm=i):bo=0,xo(0)}}function KS(i,l){(i.pooledCacheLanes&=l)===0&&(l=i.pooledCache,l!=null&&(i.pooledCache=null,Wa(l)))}function qu(){return FS(),VS(),PS(),YS()}function YS(){if(tn!==5)return!1;var i=ps,l=ym;ym=0;var o=mi(Tr),u=_.T,m=ee.p;try{ee.p=32>o?32:o,_.T=null,o=bm,bm=null;var y=ps,w=Tr;if(tn=0,Jl=ps=null,Tr=0,(xt&6)!==0)throw Error(r(331));var N=xt;if(xt|=4,jS(y.current),CS(y,y.current,w,o),xt=N,xo(0,!1),k&&typeof k.onPostCommitFiberRoot=="function")try{k.onPostCommitFiberRoot(oe,y)}catch{}return!0}finally{ee.p=m,_.T=u,KS(i,l)}}function GS(i,l,o){l=wi(o,l),l=Qp(i.stateNode,l,2),i=as(i,l,2),i!==null&&(Kt(i,2),er(i))}function St(i,l,o){if(i.tag===3)GS(i,i,o);else for(;l!==null;){if(l.tag===3){GS(l,i,o);break}else if(l.tag===1){var u=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(hs===null||!hs.has(u))){i=wi(o,i),o=Xw(2),u=as(l,o,2),u!==null&&(Jw(o,u,l,i),Kt(u,2),er(u));break}}l=l.return}}function Sm(i,l,o){var u=i.pingCache;if(u===null){u=i.pingCache=new qM;var m=new Set;u.set(l,m)}else m=u.get(l),m===void 0&&(m=new Set,u.set(l,m));m.has(o)||(pm=!0,m.add(o),i=FM.bind(null,i,l,o),l.then(i,i))}function FM(i,l,o){var u=i.pingCache;u!==null&&u.delete(l),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,jt===i&&(ct&o)===o&&($t===4||$t===3&&(ct&62914560)===ct&&300>lt()-Ru?(xt&2)===0&&Ql(i,0):mm|=o,Xl===ct&&(Xl=0)),er(i)}function XS(i,l){l===0&&(l=Rn()),i=Is(i,l),i!==null&&(Kt(i,l),er(i))}function VM(i){var l=i.memoizedState,o=0;l!==null&&(o=l.retryLane),XS(i,o)}function PM(i,l){var o=0;switch(i.tag){case 31:case 13:var u=i.stateNode,m=i.memoizedState;m!==null&&(o=m.retryLane);break;case 19:u=i.stateNode;break;case 22:u=i.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(l),XS(i,o)}function KM(i,l){return rn(i,l)}var zu=null,Zl=null,Am=!1,Hu=!1,km=!1,gs=0;function er(i){i!==Zl&&i.next===null&&(Zl===null?zu=Zl=i:Zl=Zl.next=i),Hu=!0,Am||(Am=!0,GM())}function xo(i,l){if(!km&&Hu){km=!0;do for(var o=!1,u=zu;u!==null;){if(i!==0){var m=u.pendingLanes;if(m===0)var y=0;else{var w=u.suspendedLanes,N=u.pingedLanes;y=(1<<31-Z(42|i)+1)-1,y&=m&~(w&~N),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(o=!0,ZS(u,y))}else y=ct,y=$e(u,u===jt?y:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(y&3)===0||ze(u,y)||(o=!0,ZS(u,y));u=u.next}while(o);km=!1}}function YM(){JS()}function JS(){Hu=Am=!1;var i=0;gs!==0&&rR()&&(i=gs);for(var l=lt(),o=null,u=zu;u!==null;){var m=u.next,y=QS(u,l);y===0?(u.next=null,o===null?zu=m:o.next=m,m===null&&(Zl=o)):(o=u,(i!==0||(y&3)!==0)&&(Hu=!0)),u=m}tn!==0&&tn!==5||xo(i),gs!==0&&(gs=0)}function QS(i,l){for(var o=i.suspendedLanes,u=i.pingedLanes,m=i.expirationTimes,y=i.pendingLanes&-62914561;0<y;){var w=31-Z(y),N=1<<w,q=m[w];q===-1?((N&o)===0||(N&u)!==0)&&(m[w]=Je(N,l)):q<=l&&(i.expiredLanes|=N),y&=~N}if(l=jt,o=ct,o=$e(i,i===l?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u=i.callbackNode,o===0||i===l&&(wt===2||wt===9)||i.cancelPendingCommit!==null)return u!==null&&u!==null&&sn(u),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||ze(i,o)){if(l=o&-o,l===i.callbackPriority)return l;switch(u!==null&&sn(u),mi(o)){case 2:case 8:o=Jn;break;case 32:o=Tt;break;case 268435456:o=V;break;default:o=Tt}return u=WS.bind(null,i),o=rn(o,u),i.callbackPriority=l,i.callbackNode=o,l}return u!==null&&u!==null&&sn(u),i.callbackPriority=2,i.callbackNode=null,2}function WS(i,l){if(tn!==0&&tn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(qu()&&i.callbackNode!==o)return null;var u=ct;return u=$e(i,i===jt?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u===0?null:(DS(i,u,l),QS(i,lt()),i.callbackNode!=null&&i.callbackNode===o?WS.bind(null,i):null)}function ZS(i,l){if(qu())return null;DS(i,l,!0)}function GM(){lR(function(){(xt&6)!==0?rn(Mn,YM):JS()})}function Cm(){if(gs===0){var i=ql;i===0&&(i=fe,fe<<=1,(fe&261888)===0&&(fe=256)),gs=i}return gs}function e2(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Gc(""+i)}function t2(i,l){var o=l.ownerDocument.createElement("input");return o.name=l.name,o.value=l.value,i.id&&o.setAttribute("form",i.id),l.parentNode.insertBefore(o,l),i=new FormData(i),o.parentNode.removeChild(o),i}function XM(i,l,o,u,m){if(l==="submit"&&o&&o.stateNode===m){var y=e2((m[It]||null).action),w=u.submitter;w&&(l=(l=w[It]||null)?e2(l.formAction):w.getAttribute("formAction"),l!==null&&(y=l,w=null));var N=new Wc("action","action",null,u,m);i.push({event:N,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(gs!==0){var q=w?t2(m,w):new FormData(m);Pp(o,{pending:!0,data:q,method:m.method,action:y},null,q)}}else typeof y=="function"&&(N.preventDefault(),q=w?t2(m,w):new FormData(m),Pp(o,{pending:!0,data:q,method:m.method,action:y},y,q))},currentTarget:m}]})}}for(var Nm=0;Nm<op.length;Nm++){var Tm=op[Nm],JM=Tm.toLowerCase(),QM=Tm[0].toUpperCase()+Tm.slice(1);Bi(JM,"on"+QM)}Bi(R1,"onAnimationEnd"),Bi(D1,"onAnimationIteration"),Bi(_1,"onAnimationStart"),Bi("dblclick","onDoubleClick"),Bi("focusin","onFocus"),Bi("focusout","onBlur"),Bi(hM,"onTransitionRun"),Bi(pM,"onTransitionStart"),Bi(mM,"onTransitionCancel"),Bi(L1,"onTransitionEnd"),Hn("onMouseEnter",["mouseout","mouseover"]),Hn("onMouseLeave",["mouseout","mouseover"]),Hn("onPointerEnter",["pointerout","pointerover"]),Hn("onPointerLeave",["pointerout","pointerover"]),Ge("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ge("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ge("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ge("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ge("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ge("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vo="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(" "),WM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vo));function n2(i,l){l=(l&4)!==0;for(var o=0;o<i.length;o++){var u=i[o],m=u.event;u=u.listeners;e:{var y=void 0;if(l)for(var w=u.length-1;0<=w;w--){var N=u[w],q=N.instance,ie=N.currentTarget;if(N=N.listener,q!==y&&m.isPropagationStopped())break e;y=N,m.currentTarget=ie;try{y(m)}catch(me){tu(me)}m.currentTarget=null,y=q}else for(w=0;w<u.length;w++){if(N=u[w],q=N.instance,ie=N.currentTarget,N=N.listener,q!==y&&m.isPropagationStopped())break e;y=N,m.currentTarget=ie;try{y(m)}catch(me){tu(me)}m.currentTarget=null,y=q}}}}function ot(i,l){var o=l[cr];o===void 0&&(o=l[cr]=new Set);var u=i+"__bubble";o.has(u)||(i2(l,i,2,!1),o.add(u))}function jm(i,l,o){var u=0;l&&(u|=4),i2(o,i,u,l)}var Iu="_reactListening"+Math.random().toString(36).slice(2);function Em(i){if(!i[Iu]){i[Iu]=!0,H.forEach(function(o){o!=="selectionchange"&&(WM.has(o)||jm(o,!1,i),jm(o,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[Iu]||(l[Iu]=!0,jm("selectionchange",!1,l))}}function i2(i,l,o,u){switch(R2(l)){case 2:var m=NR;break;case 8:m=TR;break;default:m=Vm}o=m.bind(null,l,o,i),m=void 0,!Xh||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(m=!0),u?m!==void 0?i.addEventListener(l,o,{capture:!0,passive:m}):i.addEventListener(l,o,!0):m!==void 0?i.addEventListener(l,o,{passive:m}):i.addEventListener(l,o,!1)}function Om(i,l,o,u,m){var y=u;if((l&1)===0&&(l&2)===0&&u!==null)e:for(;;){if(u===null)return;var w=u.tag;if(w===3||w===4){var N=u.stateNode.containerInfo;if(N===m)break;if(w===4)for(w=u.return;w!==null;){var q=w.tag;if((q===3||q===4)&&w.stateNode.containerInfo===m)return;w=w.return}for(;N!==null;){if(w=zn(N),w===null)return;if(q=w.tag,q===5||q===6||q===26||q===27){u=y=w;continue e}N=N.parentNode}}u=u.return}o1(function(){var ie=y,me=Yh(o),ve=[];e:{var re=B1.get(i);if(re!==void 0){var ce=Wc,Le=i;switch(i){case"keypress":if(Jc(o)===0)break e;case"keydown":case"keyup":ce=P3;break;case"focusin":Le="focus",ce=Zh;break;case"focusout":Le="blur",ce=Zh;break;case"beforeblur":case"afterblur":ce=Zh;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=d1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=D3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=G3;break;case R1:case D1:case _1:ce=B3;break;case L1:ce=J3;break;case"scroll":case"scrollend":ce=M3;break;case"wheel":ce=W3;break;case"copy":case"cut":case"paste":ce=q3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=h1;break;case"toggle":case"beforetoggle":ce=eM}var Ve=(l&4)!==0,Ct=!Ve&&(i==="scroll"||i==="scrollend"),Y=Ve?re!==null?re+"Capture":null:re;Ve=[];for(var U=ie,ne;U!==null;){var be=U;if(ne=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||ne===null||Y===null||(be=Ia(U,Y),be!=null&&Ve.push(wo(U,be,ne))),Ct)break;U=U.return}0<Ve.length&&(re=new ce(re,Le,null,o,me),ve.push({event:re,listeners:Ve}))}}if((l&7)===0){e:{if(re=i==="mouseover"||i==="pointerover",ce=i==="mouseout"||i==="pointerout",re&&o!==Kh&&(Le=o.relatedTarget||o.fromElement)&&(zn(Le)||Le[gi]))break e;if((ce||re)&&(re=me.window===me?me:(re=me.ownerDocument)?re.defaultView||re.parentWindow:window,ce?(Le=o.relatedTarget||o.toElement,ce=ie,Le=Le?zn(Le):null,Le!==null&&(Ct=a(Le),Ve=Le.tag,Le!==Ct||Ve!==5&&Ve!==27&&Ve!==6)&&(Le=null)):(ce=null,Le=ie),ce!==Le)){if(Ve=d1,be="onMouseLeave",Y="onMouseEnter",U="mouse",(i==="pointerout"||i==="pointerover")&&(Ve=h1,be="onPointerLeave",Y="onPointerEnter",U="pointer"),Ct=ce==null?re:Bs(ce),ne=Le==null?re:Bs(Le),re=new Ve(be,U+"leave",ce,o,me),re.target=Ct,re.relatedTarget=ne,be=null,zn(me)===ie&&(Ve=new Ve(Y,U+"enter",Le,o,me),Ve.target=ne,Ve.relatedTarget=Ct,be=Ve),Ct=be,ce&&Le)t:{for(Ve=ZM,Y=ce,U=Le,ne=0,be=Y;be;be=Ve(be))ne++;be=0;for(var Ue=U;Ue;Ue=Ve(Ue))be++;for(;0<ne-be;)Y=Ve(Y),ne--;for(;0<be-ne;)U=Ve(U),be--;for(;ne--;){if(Y===U||U!==null&&Y===U.alternate){Ve=Y;break t}Y=Ve(Y),U=Ve(U)}Ve=null}else Ve=null;ce!==null&&r2(ve,re,ce,Ve,!1),Le!==null&&Ct!==null&&r2(ve,Ct,Le,Ve,!0)}}e:{if(re=ie?Bs(ie):window,ce=re.nodeName&&re.nodeName.toLowerCase(),ce==="select"||ce==="input"&&re.type==="file")var yt=w1;else if(x1(re))if(S1)yt=uM;else{yt=oM;var qe=aM}else ce=re.nodeName,!ce||ce.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?ie&&Ph(ie.elementType)&&(yt=w1):yt=cM;if(yt&&(yt=yt(i,ie))){v1(ve,yt,o,me);break e}qe&&qe(i,re,ie),i==="focusout"&&ie&&re.type==="number"&&ie.memoizedProps.value!=null&&Vh(re,"number",re.value)}switch(qe=ie?Bs(ie):window,i){case"focusin":(x1(qe)||qe.contentEditable==="true")&&(Ol=qe,sp=ie,Xa=null);break;case"focusout":Xa=sp=Ol=null;break;case"mousedown":lp=!0;break;case"contextmenu":case"mouseup":case"dragend":lp=!1,O1(ve,o,me);break;case"selectionchange":if(fM)break;case"keydown":case"keyup":O1(ve,o,me)}var nt;if(tp)e:{switch(i){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else El?y1(i,o)&&(ut="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(ut="onCompositionStart");ut&&(p1&&o.locale!=="ko"&&(El||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&El&&(nt=c1()):(es=me,Jh="value"in es?es.value:es.textContent,El=!0)),qe=Uu(ie,ut),0<qe.length&&(ut=new f1(ut,i,null,o,me),ve.push({event:ut,listeners:qe}),nt?ut.data=nt:(nt=b1(o),nt!==null&&(ut.data=nt)))),(nt=nM?iM(i,o):rM(i,o))&&(ut=Uu(ie,"onBeforeInput"),0<ut.length&&(qe=new f1("onBeforeInput","beforeinput",null,o,me),ve.push({event:qe,listeners:ut}),qe.data=nt)),XM(ve,i,ie,o,me)}n2(ve,l)})}function wo(i,l,o){return{instance:i,listener:l,currentTarget:o}}function Uu(i,l){for(var o=l+"Capture",u=[];i!==null;){var m=i,y=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||y===null||(m=Ia(i,o),m!=null&&u.unshift(wo(i,m,y)),m=Ia(i,l),m!=null&&u.push(wo(i,m,y))),i.tag===3)return u;i=i.return}return[]}function ZM(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function r2(i,l,o,u,m){for(var y=l._reactName,w=[];o!==null&&o!==u;){var N=o,q=N.alternate,ie=N.stateNode;if(N=N.tag,q!==null&&q===u)break;N!==5&&N!==26&&N!==27||ie===null||(q=ie,m?(ie=Ia(o,y),ie!=null&&w.unshift(wo(o,ie,q))):m||(ie=Ia(o,y),ie!=null&&w.push(wo(o,ie,q)))),o=o.return}w.length!==0&&i.push({event:l,listeners:w})}var eR=/\r\n?/g,tR=/\u0000|\uFFFD/g;function s2(i){return(typeof i=="string"?i:""+i).replace(eR,`
|
|
9
|
+
`).replace(tR,"")}function l2(i,l){return l=s2(l),s2(i)===l}function kt(i,l,o,u,m,y){switch(o){case"children":typeof u=="string"?l==="body"||l==="textarea"&&u===""||Nl(i,u):(typeof u=="number"||typeof u=="bigint")&&l!=="body"&&Nl(i,""+u);break;case"className":Kc(i,"class",u);break;case"tabIndex":Kc(i,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Kc(i,o,u);break;case"style":l1(i,u,y);break;case"data":if(l!=="object"){Kc(i,"data",u);break}case"src":case"href":if(u===""&&(l!=="a"||o!=="href")){i.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(o);break}u=Gc(""+u),i.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){i.setAttribute(o,"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 y=="function"&&(o==="formAction"?(l!=="input"&&kt(i,l,"name",m.name,m,null),kt(i,l,"formEncType",m.formEncType,m,null),kt(i,l,"formMethod",m.formMethod,m,null),kt(i,l,"formTarget",m.formTarget,m,null)):(kt(i,l,"encType",m.encType,m,null),kt(i,l,"method",m.method,m,null),kt(i,l,"target",m.target,m,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(o);break}u=Gc(""+u),i.setAttribute(o,u);break;case"onClick":u!=null&&(i.onclick=fr);break;case"onScroll":u!=null&&ot("scroll",i);break;case"onScrollEnd":u!=null&&ot("scrollend",i);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(o=u.__html,o!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"multiple":i.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":i.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){i.removeAttribute("xlink:href");break}o=Gc(""+u),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(o,""+u):i.removeAttribute(o);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":u&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(o,""):i.removeAttribute(o);break;case"capture":case"download":u===!0?i.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(o,u):i.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?i.setAttribute(o,u):i.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?i.removeAttribute(o):i.setAttribute(o,u);break;case"popover":ot("beforetoggle",i),ot("toggle",i),Pc(i,"popover",u);break;case"xlinkActuate":dr(i,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":dr(i,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":dr(i,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":dr(i,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":dr(i,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":dr(i,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":dr(i,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":dr(i,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":dr(i,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Pc(i,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=E3.get(o)||o,Pc(i,o,u))}}function Mm(i,l,o,u,m,y){switch(o){case"style":l1(i,u,y);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(o=u.__html,o!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"children":typeof u=="string"?Nl(i,u):(typeof u=="number"||typeof u=="bigint")&&Nl(i,""+u);break;case"onScroll":u!=null&&ot("scroll",i);break;case"onScrollEnd":u!=null&&ot("scrollend",i);break;case"onClick":u!=null&&(i.onclick=fr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ae.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(m=o.endsWith("Capture"),l=o.slice(2,m?o.length-7:void 0),y=i[It]||null,y=y!=null?y[o]:null,typeof y=="function"&&i.removeEventListener(l,y,m),typeof u=="function")){typeof y!="function"&&y!==null&&(o in i?i[o]=null:i.hasAttribute(o)&&i.removeAttribute(o)),i.addEventListener(l,u,m);break e}o in i?i[o]=u:u===!0?i.setAttribute(o,""):Pc(i,o,u)}}}function bn(i,l,o){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ot("error",i),ot("load",i);var u=!1,m=!1,y;for(y in o)if(o.hasOwnProperty(y)){var w=o[y];if(w!=null)switch(y){case"src":u=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:kt(i,l,y,w,o,null)}}m&&kt(i,l,"srcSet",o.srcSet,o,null),u&&kt(i,l,"src",o.src,o,null);return;case"input":ot("invalid",i);var N=y=w=m=null,q=null,ie=null;for(u in o)if(o.hasOwnProperty(u)){var me=o[u];if(me!=null)switch(u){case"name":m=me;break;case"type":w=me;break;case"checked":q=me;break;case"defaultChecked":ie=me;break;case"value":y=me;break;case"defaultValue":N=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,l));break;default:kt(i,l,u,me,o,null)}}n1(i,y,N,q,ie,w,m,!1);return;case"select":ot("invalid",i),u=w=y=null;for(m in o)if(o.hasOwnProperty(m)&&(N=o[m],N!=null))switch(m){case"value":y=N;break;case"defaultValue":w=N;break;case"multiple":u=N;default:kt(i,l,m,N,o,null)}l=y,o=w,i.multiple=!!u,l!=null?Cl(i,!!u,l,!1):o!=null&&Cl(i,!!u,o,!0);return;case"textarea":ot("invalid",i),y=m=u=null;for(w in o)if(o.hasOwnProperty(w)&&(N=o[w],N!=null))switch(w){case"value":u=N;break;case"defaultValue":m=N;break;case"children":y=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:kt(i,l,w,N,o,null)}r1(i,u,m,y);return;case"option":for(q in o)o.hasOwnProperty(q)&&(u=o[q],u!=null)&&(q==="selected"?i.selected=u&&typeof u!="function"&&typeof u!="symbol":kt(i,l,q,u,o,null));return;case"dialog":ot("beforetoggle",i),ot("toggle",i),ot("cancel",i),ot("close",i);break;case"iframe":case"object":ot("load",i);break;case"video":case"audio":for(u=0;u<vo.length;u++)ot(vo[u],i);break;case"image":ot("error",i),ot("load",i);break;case"details":ot("toggle",i);break;case"embed":case"source":case"link":ot("error",i),ot("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in o)if(o.hasOwnProperty(ie)&&(u=o[ie],u!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:kt(i,l,ie,u,o,null)}return;default:if(Ph(l)){for(me in o)o.hasOwnProperty(me)&&(u=o[me],u!==void 0&&Mm(i,l,me,u,o,void 0));return}}for(N in o)o.hasOwnProperty(N)&&(u=o[N],u!=null&&kt(i,l,N,u,o,null))}function nR(i,l,o,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,y=null,w=null,N=null,q=null,ie=null,me=null;for(ce in o){var ve=o[ce];if(o.hasOwnProperty(ce)&&ve!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":q=ve;default:u.hasOwnProperty(ce)||kt(i,l,ce,null,u,ve)}}for(var re in u){var ce=u[re];if(ve=o[re],u.hasOwnProperty(re)&&(ce!=null||ve!=null))switch(re){case"type":y=ce;break;case"name":m=ce;break;case"checked":ie=ce;break;case"defaultChecked":me=ce;break;case"value":w=ce;break;case"defaultValue":N=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,l));break;default:ce!==ve&&kt(i,l,re,ce,u,ve)}}Fh(i,w,N,q,ie,me,y,m);return;case"select":ce=w=N=re=null;for(y in o)if(q=o[y],o.hasOwnProperty(y)&&q!=null)switch(y){case"value":break;case"multiple":ce=q;default:u.hasOwnProperty(y)||kt(i,l,y,null,u,q)}for(m in u)if(y=u[m],q=o[m],u.hasOwnProperty(m)&&(y!=null||q!=null))switch(m){case"value":re=y;break;case"defaultValue":N=y;break;case"multiple":w=y;default:y!==q&&kt(i,l,m,y,u,q)}l=N,o=w,u=ce,re!=null?Cl(i,!!o,re,!1):!!u!=!!o&&(l!=null?Cl(i,!!o,l,!0):Cl(i,!!o,o?[]:"",!1));return;case"textarea":ce=re=null;for(N in o)if(m=o[N],o.hasOwnProperty(N)&&m!=null&&!u.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:kt(i,l,N,null,u,m)}for(w in u)if(m=u[w],y=o[w],u.hasOwnProperty(w)&&(m!=null||y!=null))switch(w){case"value":re=m;break;case"defaultValue":ce=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(r(91));break;default:m!==y&&kt(i,l,w,m,u,y)}i1(i,re,ce);return;case"option":for(var Le in o)re=o[Le],o.hasOwnProperty(Le)&&re!=null&&!u.hasOwnProperty(Le)&&(Le==="selected"?i.selected=!1:kt(i,l,Le,null,u,re));for(q in u)re=u[q],ce=o[q],u.hasOwnProperty(q)&&re!==ce&&(re!=null||ce!=null)&&(q==="selected"?i.selected=re&&typeof re!="function"&&typeof re!="symbol":kt(i,l,q,re,u,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 Ve in o)re=o[Ve],o.hasOwnProperty(Ve)&&re!=null&&!u.hasOwnProperty(Ve)&&kt(i,l,Ve,null,u,re);for(ie in u)if(re=u[ie],ce=o[ie],u.hasOwnProperty(ie)&&re!==ce&&(re!=null||ce!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,l));break;default:kt(i,l,ie,re,u,ce)}return;default:if(Ph(l)){for(var Ct in o)re=o[Ct],o.hasOwnProperty(Ct)&&re!==void 0&&!u.hasOwnProperty(Ct)&&Mm(i,l,Ct,void 0,u,re);for(me in u)re=u[me],ce=o[me],!u.hasOwnProperty(me)||re===ce||re===void 0&&ce===void 0||Mm(i,l,me,re,u,ce);return}}for(var Y in o)re=o[Y],o.hasOwnProperty(Y)&&re!=null&&!u.hasOwnProperty(Y)&&kt(i,l,Y,null,u,re);for(ve in u)re=u[ve],ce=o[ve],!u.hasOwnProperty(ve)||re===ce||re==null&&ce==null||kt(i,l,ve,re,u,ce)}function a2(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iR(){if(typeof performance.getEntriesByType=="function"){for(var i=0,l=0,o=performance.getEntriesByType("resource"),u=0;u<o.length;u++){var m=o[u],y=m.transferSize,w=m.initiatorType,N=m.duration;if(y&&N&&a2(w)){for(w=0,N=m.responseEnd,u+=1;u<o.length;u++){var q=o[u],ie=q.startTime;if(ie>N)break;var me=q.transferSize,ve=q.initiatorType;me&&a2(ve)&&(q=q.responseEnd,w+=me*(q<N?1:(N-ie)/(q-ie)))}if(--u,l+=8*(y+w)/(m.duration/1e3),i++,10<i)break}}if(0<i)return l/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Rm=null,Dm=null;function Fu(i){return i.nodeType===9?i:i.ownerDocument}function o2(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function c2(i,l){if(i===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&l==="foreignObject"?0:i}function _m(i,l){return i==="textarea"||i==="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 Lm=null;function rR(){var i=window.event;return i&&i.type==="popstate"?i===Lm?!1:(Lm=i,!0):(Lm=null,!1)}var u2=typeof setTimeout=="function"?setTimeout:void 0,sR=typeof clearTimeout=="function"?clearTimeout:void 0,d2=typeof Promise=="function"?Promise:void 0,lR=typeof queueMicrotask=="function"?queueMicrotask:typeof d2<"u"?function(i){return d2.resolve(null).then(i).catch(aR)}:u2;function aR(i){setTimeout(function(){throw i})}function ys(i){return i==="head"}function f2(i,l){var o=l,u=0;do{var m=o.nextSibling;if(i.removeChild(o),m&&m.nodeType===8)if(o=m.data,o==="/$"||o==="/&"){if(u===0){i.removeChild(m),ia(l);return}u--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")u++;else if(o==="html")So(i.ownerDocument.documentElement);else if(o==="head"){o=i.ownerDocument.head,So(o);for(var y=o.firstChild;y;){var w=y.nextSibling,N=y.nodeName;y[Ji]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&y.rel.toLowerCase()==="stylesheet"||o.removeChild(y),y=w}}else o==="body"&&So(i.ownerDocument.body);o=m}while(o);ia(l)}function h2(i,l){var o=i;i=0;do{var u=o.nextSibling;if(o.nodeType===1?l?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(l?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),u&&u.nodeType===8)if(o=u.data,o==="/$"){if(i===0)break;i--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||i++;o=u}while(o)}function Bm(i){var l=i.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var o=l;switch(l=l.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Bm(o),Al(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function oR(i,l,o,u){for(;i.nodeType===1;){var m=o;if(i.nodeName.toLowerCase()!==l.toLowerCase()){if(!u&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(u){if(!i[Ji])switch(l){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(y=i.getAttribute("rel"),y==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(y!==m.rel||i.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||i.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||i.getAttribute("title")!==(m.title==null?null:m.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(y=i.getAttribute("src"),(y!==(m.src==null?null:m.src)||i.getAttribute("type")!==(m.type==null?null:m.type)||i.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&y&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(l==="input"&&i.type==="hidden"){var y=m.name==null?null:""+m.name;if(m.type==="hidden"&&i.getAttribute("name")===y)return i}else return i;if(i=Ni(i.nextSibling),i===null)break}return null}function cR(i,l,o){if(l==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=Ni(i.nextSibling),i===null))return null;return i}function p2(i,l){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=Ni(i.nextSibling),i===null))return null;return i}function $m(i){return i.data==="$?"||i.data==="$~"}function qm(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function uR(i,l){var o=i.ownerDocument;if(i.data==="$~")i._reactRetry=l;else if(i.data!=="$?"||o.readyState!=="loading")l();else{var u=function(){l(),o.removeEventListener("DOMContentLoaded",u)};o.addEventListener("DOMContentLoaded",u),i._reactRetry=u}}function Ni(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return i}var zm=null;function m2(i){i=i.nextSibling;for(var l=0;i;){if(i.nodeType===8){var o=i.data;if(o==="/$"||o==="/&"){if(l===0)return Ni(i.nextSibling);l--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||l++}i=i.nextSibling}return null}function g2(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var o=i.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(l===0)return i;l--}else o!=="/$"&&o!=="/&"||l++}i=i.previousSibling}return null}function y2(i,l,o){switch(l=Fu(o),i){case"html":if(i=l.documentElement,!i)throw Error(r(452));return i;case"head":if(i=l.head,!i)throw Error(r(453));return i;case"body":if(i=l.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function So(i){for(var l=i.attributes;l.length;)i.removeAttributeNode(l[0]);Al(i)}var Ti=new Map,b2=new Set;function Vu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var jr=ee.d;ee.d={f:dR,r:fR,D:hR,C:pR,L:mR,m:gR,X:bR,S:yR,M:xR};function dR(){var i=jr.f(),l=Lu();return i||l}function fR(i){var l=ur(i);l!==null&&l.tag===5&&l.type==="form"?Lw(l):jr.r(i)}var ea=typeof document>"u"?null:document;function x2(i,l,o){var u=ea;if(u&&typeof l=="string"&&l){var m=xi(l);m='link[rel="'+i+'"][href="'+m+'"]',typeof o=="string"&&(m+='[crossorigin="'+o+'"]'),b2.has(m)||(b2.add(m),i={rel:i,crossOrigin:o,href:l},u.querySelector(m)===null&&(l=u.createElement("link"),bn(l,"link",i),Ut(l),u.head.appendChild(l)))}}function hR(i){jr.D(i),x2("dns-prefetch",i,null)}function pR(i,l){jr.C(i,l),x2("preconnect",i,l)}function mR(i,l,o){jr.L(i,l,o);var u=ea;if(u&&i&&l){var m='link[rel="preload"][as="'+xi(l)+'"]';l==="image"&&o&&o.imageSrcSet?(m+='[imagesrcset="'+xi(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(m+='[imagesizes="'+xi(o.imageSizes)+'"]')):m+='[href="'+xi(i)+'"]';var y=m;switch(l){case"style":y=ta(i);break;case"script":y=na(i)}Ti.has(y)||(i=b({rel:"preload",href:l==="image"&&o&&o.imageSrcSet?void 0:i,as:l},o),Ti.set(y,i),u.querySelector(m)!==null||l==="style"&&u.querySelector(Ao(y))||l==="script"&&u.querySelector(ko(y))||(l=u.createElement("link"),bn(l,"link",i),Ut(l),u.head.appendChild(l)))}}function gR(i,l){jr.m(i,l);var o=ea;if(o&&i){var u=l&&typeof l.as=="string"?l.as:"script",m='link[rel="modulepreload"][as="'+xi(u)+'"][href="'+xi(i)+'"]',y=m;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=na(i)}if(!Ti.has(y)&&(i=b({rel:"modulepreload",href:i},l),Ti.set(y,i),o.querySelector(m)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(ko(y)))return}u=o.createElement("link"),bn(u,"link",i),Ut(u),o.head.appendChild(u)}}}function yR(i,l,o){jr.S(i,l,o);var u=ea;if(u&&i){var m=Zr(u).hoistableStyles,y=ta(i);l=l||"default";var w=m.get(y);if(!w){var N={loading:0,preload:null};if(w=u.querySelector(Ao(y)))N.loading=5;else{i=b({rel:"stylesheet",href:i,"data-precedence":l},o),(o=Ti.get(y))&&Hm(i,o);var q=w=u.createElement("link");Ut(q),bn(q,"link",i),q._p=new Promise(function(ie,me){q.onload=ie,q.onerror=me}),q.addEventListener("load",function(){N.loading|=1}),q.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Pu(w,l,u)}w={type:"stylesheet",instance:w,count:1,state:N},m.set(y,w)}}}function bR(i,l){jr.X(i,l);var o=ea;if(o&&i){var u=Zr(o).hoistableScripts,m=na(i),y=u.get(m);y||(y=o.querySelector(ko(m)),y||(i=b({src:i,async:!0},l),(l=Ti.get(m))&&Im(i,l),y=o.createElement("script"),Ut(y),bn(y,"link",i),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(m,y))}}function xR(i,l){jr.M(i,l);var o=ea;if(o&&i){var u=Zr(o).hoistableScripts,m=na(i),y=u.get(m);y||(y=o.querySelector(ko(m)),y||(i=b({src:i,async:!0,type:"module"},l),(l=Ti.get(m))&&Im(i,l),y=o.createElement("script"),Ut(y),bn(y,"link",i),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(m,y))}}function v2(i,l,o,u){var m=(m=Re.current)?Vu(m):null;if(!m)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(l=ta(o.href),o=Zr(m).hoistableStyles,u=o.get(l),u||(u={type:"style",instance:null,count:0,state:null},o.set(l,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){i=ta(o.href);var y=Zr(m).hoistableStyles,w=y.get(i);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(i,w),(y=m.querySelector(Ao(i)))&&!y._p&&(w.instance=y,w.state.loading=5),Ti.has(i)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Ti.set(i,o),y||vR(m,i,o,w.state))),l&&u===null)throw Error(r(528,""));return w}if(l&&u!==null)throw Error(r(529,""));return null;case"script":return l=o.async,o=o.src,typeof o=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=na(o),o=Zr(m).hoistableScripts,u=o.get(l),u||(u={type:"script",instance:null,count:0,state:null},o.set(l,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function ta(i){return'href="'+xi(i)+'"'}function Ao(i){return'link[rel="stylesheet"]['+i+"]"}function w2(i){return b({},i,{"data-precedence":i.precedence,precedence:null})}function vR(i,l,o,u){i.querySelector('link[rel="preload"][as="style"]['+l+"]")?u.loading=1:(l=i.createElement("link"),u.preload=l,l.addEventListener("load",function(){return u.loading|=1}),l.addEventListener("error",function(){return u.loading|=2}),bn(l,"link",o),Ut(l),i.head.appendChild(l))}function na(i){return'[src="'+xi(i)+'"]'}function ko(i){return"script[async]"+i}function S2(i,l,o){if(l.count++,l.instance===null)switch(l.type){case"style":var u=i.querySelector('style[data-href~="'+xi(o.href)+'"]');if(u)return l.instance=u,Ut(u),u;var m=b({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(i.ownerDocument||i).createElement("style"),Ut(u),bn(u,"style",m),Pu(u,o.precedence,i),l.instance=u;case"stylesheet":m=ta(o.href);var y=i.querySelector(Ao(m));if(y)return l.state.loading|=4,l.instance=y,Ut(y),y;u=w2(o),(m=Ti.get(m))&&Hm(u,m),y=(i.ownerDocument||i).createElement("link"),Ut(y);var w=y;return w._p=new Promise(function(N,q){w.onload=N,w.onerror=q}),bn(y,"link",u),l.state.loading|=4,Pu(y,o.precedence,i),l.instance=y;case"script":return y=na(o.src),(m=i.querySelector(ko(y)))?(l.instance=m,Ut(m),m):(u=o,(m=Ti.get(y))&&(u=b({},o),Im(u,m)),i=i.ownerDocument||i,m=i.createElement("script"),Ut(m),bn(m,"link",u),i.head.appendChild(m),l.instance=m);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(u=l.instance,l.state.loading|=4,Pu(u,o.precedence,i));return l.instance}function Pu(i,l,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=u.length?u[u.length-1]:null,y=m,w=0;w<u.length;w++){var N=u[w];if(N.dataset.precedence===l)y=N;else if(y!==m)break}y?y.parentNode.insertBefore(i,y.nextSibling):(l=o.nodeType===9?o.head:o,l.insertBefore(i,l.firstChild))}function Hm(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.title==null&&(i.title=l.title)}function Im(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.integrity==null&&(i.integrity=l.integrity)}var Ku=null;function A2(i,l,o){if(Ku===null){var u=new Map,m=Ku=new Map;m.set(o,u)}else m=Ku,u=m.get(o),u||(u=new Map,m.set(o,u));if(u.has(i))return u;for(u.set(i,null),o=o.getElementsByTagName(i),m=0;m<o.length;m++){var y=o[m];if(!(y[Ji]||y[_t]||i==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var w=y.getAttribute(l)||"";w=i+w;var N=u.get(w);N?N.push(y):u.set(w,[y])}}return u}function k2(i,l,o){i=i.ownerDocument||i,i.head.insertBefore(o,l==="title"?i.querySelector("head > title"):null)}function wR(i,l,o){if(o===1||l.itemProp!=null)return!1;switch(i){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"?(i=l.disabled,typeof l.precedence=="string"&&i==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 C2(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function SR(i,l,o,u){if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var m=ta(u.href),y=l.querySelector(Ao(m));if(y){l=y._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(i.count++,i=Yu.bind(i),l.then(i,i)),o.state.loading|=4,o.instance=y,Ut(y);return}y=l.ownerDocument||l,u=w2(u),(m=Ti.get(m))&&Hm(u,m),y=y.createElement("link"),Ut(y);var w=y;w._p=new Promise(function(N,q){w.onload=N,w.onerror=q}),bn(y,"link",u),o.instance=y}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(o,l),(l=o.state.preload)&&(o.state.loading&3)===0&&(i.count++,o=Yu.bind(i),l.addEventListener("load",o),l.addEventListener("error",o))}}var Um=0;function AR(i,l){return i.stylesheets&&i.count===0&&Xu(i,i.stylesheets),0<i.count||0<i.imgCount?function(o){var u=setTimeout(function(){if(i.stylesheets&&Xu(i,i.stylesheets),i.unsuspend){var y=i.unsuspend;i.unsuspend=null,y()}},6e4+l);0<i.imgBytes&&Um===0&&(Um=62500*iR());var m=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Xu(i,i.stylesheets),i.unsuspend)){var y=i.unsuspend;i.unsuspend=null,y()}},(i.imgBytes>Um?50:800)+l);return i.unsuspend=o,function(){i.unsuspend=null,clearTimeout(u),clearTimeout(m)}}:null}function Yu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Gu=null;function Xu(i,l){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Gu=new Map,l.forEach(kR,i),Gu=null,Yu.call(i))}function kR(i,l){if(!(l.state.loading&4)){var o=Gu.get(i);if(o)var u=o.get(null);else{o=new Map,Gu.set(i,o);for(var m=i.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<m.length;y++){var w=m[y];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(o.set(w.dataset.precedence,w),u=w)}u&&o.set(null,u)}m=l.instance,w=m.getAttribute("data-precedence"),y=o.get(w)||u,y===u&&o.set(null,m),o.set(w,m),this.count++,u=Yu.bind(this),m.addEventListener("load",u),m.addEventListener("error",u),y?y.parentNode.insertBefore(m,y.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(m,i.firstChild)),l.state.loading|=4}}var Co={$$typeof:E,Provider:null,Consumer:null,_currentValue:he,_currentValue2:he,_threadCount:0};function CR(i,l,o,u,m,y,w,N,q){this.tag=1,this.containerInfo=i,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=Dn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dn(0),this.hiddenUpdates=Dn(null),this.identifierPrefix=u,this.onUncaughtError=m,this.onCaughtError=y,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function N2(i,l,o,u,m,y,w,N,q,ie,me,ve){return i=new CR(i,l,o,w,q,ie,me,ve,N),l=1,y===!0&&(l|=24),y=Zn(3,null,null,l),i.current=y,y.stateNode=i,l=wp(),l.refCount++,i.pooledCache=l,l.refCount++,y.memoizedState={element:u,isDehydrated:o,cache:l},Cp(y),i}function T2(i){return i?(i=Dl,i):Dl}function j2(i,l,o,u,m,y){m=T2(m),u.context===null?u.context=m:u.pendingContext=m,u=ls(l),u.payload={element:o},y=y===void 0?null:y,y!==null&&(u.callback=y),o=as(i,u,l),o!==null&&(Kn(o,i,l),no(o,i,l))}function E2(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<l?o:l}}function Fm(i,l){E2(i,l),(i=i.alternate)&&E2(i,l)}function O2(i){if(i.tag===13||i.tag===31){var l=Is(i,67108864);l!==null&&Kn(l,i,67108864),Fm(i,67108864)}}function M2(i){if(i.tag===13||i.tag===31){var l=ri();l=Yt(l);var o=Is(i,l);o!==null&&Kn(o,i,l),Fm(i,l)}}var Ju=!0;function NR(i,l,o,u){var m=_.T;_.T=null;var y=ee.p;try{ee.p=2,Vm(i,l,o,u)}finally{ee.p=y,_.T=m}}function TR(i,l,o,u){var m=_.T;_.T=null;var y=ee.p;try{ee.p=8,Vm(i,l,o,u)}finally{ee.p=y,_.T=m}}function Vm(i,l,o,u){if(Ju){var m=Pm(u);if(m===null)Om(i,l,u,Qu,o),D2(i,u);else if(ER(m,i,l,o,u))u.stopPropagation();else if(D2(i,u),l&4&&-1<jR.indexOf(i)){for(;m!==null;){var y=ur(m);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var w=De(y.pendingLanes);if(w!==0){var N=y;for(N.pendingLanes|=2,N.entangledLanes|=2;w;){var q=1<<31-Z(w);N.entanglements[1]|=q,w&=~q}er(y),(xt&6)===0&&(Du=lt()+500,xo(0))}}break;case 31:case 13:N=Is(y,2),N!==null&&Kn(N,y,2),Lu(),Fm(y,2)}if(y=Pm(u),y===null&&Om(i,l,u,Qu,o),y===m)break;m=y}m!==null&&u.stopPropagation()}else Om(i,l,u,null,o)}}function Pm(i){return i=Yh(i),Km(i)}var Qu=null;function Km(i){if(Qu=null,i=zn(i),i!==null){var l=a(i);if(l===null)i=null;else{var o=l.tag;if(o===13){if(i=c(l),i!==null)return i;i=null}else if(o===31){if(i=d(l),i!==null)return i;i=null}else if(o===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null)}}return Qu=i,null}function R2(i){switch(i){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(pi()){case Mn:return 2;case Jn:return 8;case Tt:case x:return 32;case V:return 268435456;default:return 32}default:return 32}}var Ym=!1,bs=null,xs=null,vs=null,No=new Map,To=new Map,ws=[],jR="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 D2(i,l){switch(i){case"focusin":case"focusout":bs=null;break;case"dragenter":case"dragleave":xs=null;break;case"mouseover":case"mouseout":vs=null;break;case"pointerover":case"pointerout":No.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":To.delete(l.pointerId)}}function jo(i,l,o,u,m,y){return i===null||i.nativeEvent!==y?(i={blockedOn:l,domEventName:o,eventSystemFlags:u,nativeEvent:y,targetContainers:[m]},l!==null&&(l=ur(l),l!==null&&O2(l)),i):(i.eventSystemFlags|=u,l=i.targetContainers,m!==null&&l.indexOf(m)===-1&&l.push(m),i)}function ER(i,l,o,u,m){switch(l){case"focusin":return bs=jo(bs,i,l,o,u,m),!0;case"dragenter":return xs=jo(xs,i,l,o,u,m),!0;case"mouseover":return vs=jo(vs,i,l,o,u,m),!0;case"pointerover":var y=m.pointerId;return No.set(y,jo(No.get(y)||null,i,l,o,u,m)),!0;case"gotpointercapture":return y=m.pointerId,To.set(y,jo(To.get(y)||null,i,l,o,u,m)),!0}return!1}function _2(i){var l=zn(i.target);if(l!==null){var o=a(l);if(o!==null){if(l=o.tag,l===13){if(l=c(o),l!==null){i.blockedOn=l,Wr(i.priority,function(){M2(o)});return}}else if(l===31){if(l=d(o),l!==null){i.blockedOn=l,Wr(i.priority,function(){M2(o)});return}}else if(l===3&&o.stateNode.current.memoizedState.isDehydrated){i.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Wu(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var o=Pm(i.nativeEvent);if(o===null){o=i.nativeEvent;var u=new o.constructor(o.type,o);Kh=u,o.target.dispatchEvent(u),Kh=null}else return l=ur(o),l!==null&&O2(l),i.blockedOn=o,!1;l.shift()}return!0}function L2(i,l,o){Wu(i)&&o.delete(l)}function OR(){Ym=!1,bs!==null&&Wu(bs)&&(bs=null),xs!==null&&Wu(xs)&&(xs=null),vs!==null&&Wu(vs)&&(vs=null),No.forEach(L2),To.forEach(L2)}function Zu(i,l){i.blockedOn===l&&(i.blockedOn=null,Ym||(Ym=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,OR)))}var ed=null;function B2(i){ed!==i&&(ed=i,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ed===i&&(ed=null);for(var l=0;l<i.length;l+=3){var o=i[l],u=i[l+1],m=i[l+2];if(typeof u!="function"){if(Km(u||o)===null)continue;break}var y=ur(o);y!==null&&(i.splice(l,3),l-=3,Pp(y,{pending:!0,data:m,method:o.method,action:u},u,m))}}))}function ia(i){function l(q){return Zu(q,i)}bs!==null&&Zu(bs,i),xs!==null&&Zu(xs,i),vs!==null&&Zu(vs,i),No.forEach(l),To.forEach(l);for(var o=0;o<ws.length;o++){var u=ws[o];u.blockedOn===i&&(u.blockedOn=null)}for(;0<ws.length&&(o=ws[0],o.blockedOn===null);)_2(o),o.blockedOn===null&&ws.shift();if(o=(i.ownerDocument||i).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var m=o[u],y=o[u+1],w=m[It]||null;if(typeof y=="function")w||B2(o);else if(w){var N=null;if(y&&y.hasAttribute("formAction")){if(m=y,w=y[It]||null)N=w.formAction;else if(Km(m)!==null)continue}else N=w.action;typeof N=="function"?o[u+1]=N:(o.splice(u,3),u-=3),B2(o)}}}function $2(){function i(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(w){return m=w})},focusReset:"manual",scroll:"manual"})}function l(){m!==null&&(m(),m=null),u||setTimeout(o,20)}function o(){if(!u&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,m=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(o,100),function(){u=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),m!==null&&(m(),m=null)}}}function Gm(i){this._internalRoot=i}td.prototype.render=Gm.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(r(409));var o=l.current,u=ri();j2(o,u,i,l,null,null)},td.prototype.unmount=Gm.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;j2(i.current,2,null,i,null,null),Lu(),l[gi]=null}};function td(i){this._internalRoot=i}td.prototype.unstable_scheduleHydration=function(i){if(i){var l=Li();i={blockedOn:null,target:i,priority:l};for(var o=0;o<ws.length&&l!==0&&l<ws[o].priority;o++);ws.splice(o,0,i),o===0&&_2(i)}};var q2=e.version;if(q2!=="19.2.8")throw Error(r(527,q2,"19.2.8"));ee.findDOMNode=function(i){var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(l),i=i!==null?g(i):null,i=i===null?null:i.stateNode,i};var MR={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nd.isDisabled&&nd.supportsFiber)try{oe=nd.inject(MR),k=nd}catch{}}return sa.createRoot=function(i,l){if(!s(i))throw Error(r(299));var o=!1,u="",m=Pw,y=Kw,w=Yw;return l!=null&&(l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(u=l.identifierPrefix),l.onUncaughtError!==void 0&&(m=l.onUncaughtError),l.onCaughtError!==void 0&&(y=l.onCaughtError),l.onRecoverableError!==void 0&&(w=l.onRecoverableError)),l=N2(i,1,!1,null,null,o,u,null,m,y,w,$2),i[gi]=l.current,Em(i),new Gm(l)},sa.hydrateRoot=function(i,l,o){if(!s(i))throw Error(r(299));var u=!1,m="",y=Pw,w=Kw,N=Yw,q=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(m=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(w=o.onCaughtError),o.onRecoverableError!==void 0&&(N=o.onRecoverableError),o.formState!==void 0&&(q=o.formState)),l=N2(i,1,!0,l,o??null,u,m,q,y,w,N,$2),l.context=T2(null),o=l.current,u=ri(),u=Yt(u),m=ls(u),m.callback=null,as(o,m,u),o=u,l.current.lanes=o,Kt(l,o),er(l),i[gi]=l.current,Em(i),new td(l)},sa.version="19.2.8",sa}var lg;function X2(){if(lg)return rd.exports;lg=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(),rd.exports=G2(),rd.exports}var ag=X2(),I=od();const og=Jm(I);const J2=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Q2=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),cg=t=>{const e=Q2(t);return e.charAt(0).toUpperCase()+e.slice(1)},ug=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),W2=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var Z2={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 eA=I.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:c,...d},f)=>I.createElement("svg",{ref:f,...Z2,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:ug("lucide",s),...!a&&!W2(d)&&{"aria-hidden":"true"},...d},[...c.map(([h,g])=>I.createElement(h,g)),...Array.isArray(a)?a:[a]]));const rt=(t,e)=>{const n=I.forwardRef(({className:r,...s},a)=>I.createElement(eA,{ref:a,iconNode:e,className:ug(`lucide-${J2(cg(t))}`,`lucide-${t}`,r),...s}));return n.displayName=cg(t),n};const dg=rt("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);const Eo=rt("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const fg=rt("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const hg=rt("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const pg=rt("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const ud=rt("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const Oo=rt("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const tA=rt("circle-x",[["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"}]]);const dd=rt("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const nA=rt("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const fd=rt("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const mg=rt("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const iA=rt("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);const rA=rt("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);const sA=rt("library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);const lA=rt("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const aA=rt("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const oA=rt("lock-open",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);const cA=rt("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const uA=rt("menu",[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]]);const hd=rt("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);const pd=rt("panel-left-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);const la=rt("play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const ks=rt("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const dA=rt("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const fA=rt("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const gg=rt("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const yg=rt("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);const hA=rt("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const pA=rt("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);const bg=rt("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const xg=rt("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);const si=rt("trash-2",[["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"}]]);const md=rt("triangle-alert",[["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-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const vg=rt("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);const mA=rt("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);const gd=rt("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function gA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vn={},Mo={},Er={},wg;function aa(){if(wg)return Er;wg=1;function t(c){return typeof c>"u"||c===null}function e(c){return typeof c=="object"&&c!==null}function n(c){return Array.isArray(c)?c:t(c)?[]:[c]}function r(c,d){if(d){const f=Object.keys(d);for(let h=0,g=f.length;h<g;h+=1){const b=f[h];c[b]=d[b]}}return c}function s(c,d){let f="";for(let h=0;h<d;h+=1)f+=c;return f}function a(c){return c===0&&Number.NEGATIVE_INFINITY===1/c}return Er.isNothing=t,Er.isObject=e,Er.toArray=n,Er.repeat=s,Er.isNegativeZero=a,Er.extend=r,Er}var yd,Sg;function oa(){if(Sg)return yd;Sg=1;function t(n,r){let s="";const a=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(s+='in "'+n.mark.name+'" '),s+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!r&&n.mark.snippet&&(s+=`
|
|
10
10
|
|
|
11
|
-
`+
|
|
12
|
-
`+
|
|
13
|
-
`,
|
|
14
|
-
`;for(let
|
|
15
|
-
`}return
|
|
16
|
-
\r`;function
|
|
17
|
-
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"
";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function
|
|
18
|
-
`,
|
|
19
|
-
`,
|
|
20
|
-
`);break}
|
|
21
|
-
`,
|
|
22
|
-
`,
|
|
23
|
-
`,
|
|
24
|
-
`,
|
|
25
|
-
`),
|
|
26
|
-
`,
|
|
27
|
-
`&&(
|
|
28
|
-
`+
|
|
29
|
-
`,
|
|
30
|
-
`||
|
|
31
|
-
`)?"+":
|
|
32
|
-
`}function
|
|
33
|
-
`?
|
|
34
|
-
`);return
|
|
35
|
-
`||
|
|
36
|
-
`:"")+
|
|
37
|
-
`+
|
|
38
|
-
`,
|
|
39
|
-
`+
|
|
40
|
-
`:""}return Gs.dump=Z,Gs}var zd;function Ng(){if(zd)return Ht;zd=1;const a=jg(),r=Ag();function o(u,f){return function(){throw new Error("Function yaml."+u+" is removed in js-yaml 4. Use yaml."+f+" instead, which is now safe by default.")}}return Ht.Type=Bt(),Ht.Schema=td(),Ht.FAILSAFE_SCHEMA=cd(),Ht.JSON_SCHEMA=bd(),Ht.CORE_SCHEMA=Sd(),Ht.DEFAULT_SCHEMA=Ys(),Ht.load=a.load,Ht.loadAll=a.loadAll,Ht.dump=r.dump,Ht.YAMLException=Yl(),Ht.types={binary:Ed(),float:gd(),map:sd(),null:dd(),pairs:Od(),set:$d(),timestamp:Ad(),bool:pd(),int:hd(),merge:wd(),omap:kd(),seq:rd(),str:ad()},Ht.safeLoad=o("safeLoad","load"),Ht.safeLoadAll=o("safeLoadAll","loadAll"),Ht.safeDump=o("safeDump","dump"),Ht}var wg=Ng();const Tg=vg(wg),{Type:v2,Schema:S2,FAILSAFE_SCHEMA:j2,JSON_SCHEMA:A2,CORE_SCHEMA:N2,DEFAULT_SCHEMA:w2,load:Eg,loadAll:T2,dump:E2,YAMLException:C2,types:k2,safeLoad:_2,safeLoadAll:O2,safeDump:R2}=Tg;let On=class Yy{static async parseSpec(r){let o;if(typeof r=="string"){const u=r.trim();try{o=JSON.parse(u)}catch{try{o=Eg(u)}catch{throw new Error("Invalid OpenAPI specification format")}}}else o=r;if(!o.openapi||!o.info||!o.paths)throw new Error("Invalid OpenAPI specification: missing required fields");return o}static getHttpMethods(r){return["get","post","put","delete","patch","options","head","trace"].filter(u=>r[u])}static decodePointerToken(r){return decodeURIComponent(r).replace(/~1/g,"/").replace(/~0/g,"~")}static encodePointerToken(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}static resolveReference(r,o){if(!o.startsWith("#/"))throw new Error(`Only local references are supported synchronously; bundle external references first: ${o}`);const u=o.substring(2).split("/").map(Yy.decodePointerToken);let f=r;for(const p of u){if(f===null||typeof f!="object"||!(p in f))throw new Error(`Reference not found: ${o}`);f=f[p]}return f}static isReference(r){return!!r&&typeof r=="object"&&"$ref"in r&&typeof r.$ref=="string"}};class tn{static async parseSpec(r){return On.parseSpec(r)}static getHttpMethods(r){return On.getHttpMethods(r)}static getMethodColor(r,o){const p=o==="dark"?{get:"text-blue-300 bg-blue-900/30 border-blue-700",post:"text-green-300 bg-green-900/30 border-green-700",put:"text-orange-300 bg-orange-900/30 border-orange-700",delete:"text-red-300 bg-red-900/30 border-red-700",patch:"text-purple-300 bg-purple-900/30 border-purple-700",options:"text-cyan-100 bg-cyan-800/50 border-cyan-500",head:"text-gray-300 bg-gray-700/50 border-gray-600",trace:"text-gray-300 bg-gray-700/50 border-gray-600"}:{get:"text-blue-600 bg-blue-50 border-blue-200",post:"text-green-600 bg-green-50 border-green-200",put:"text-orange-600 bg-orange-50 border-orange-200",delete:"text-red-600 bg-red-50 border-red-200",patch:"text-purple-600 bg-purple-50 border-purple-200",options:"text-gray-600 bg-gray-50 border-gray-200",head:"text-gray-600 bg-gray-50 border-gray-200",trace:"text-gray-600 bg-gray-50 border-gray-200"},g=o==="dark"?"text-gray-300 bg-gray-700/50 border-gray-600":"text-gray-600 bg-gray-50 border-gray-200";return p[r.toLowerCase()]||g}static decodePointerToken(r){return On.decodePointerToken(r)}static encodePointerToken(r){return On.encodePointerToken(r)}static resolveReference(r,o){return On.resolveReference(r,o)}static isReference(r){return On.isReference(r)}}const Ud=({spec:a,onEndpointSelect:r,selectedEndpoint:o=null,theme:u="light"})=>{const[f,p]=W.useState(""),[g,x]=W.useState(new Set(["default"])),b=u==="dark"?"bg-gray-900 border-r border-gray-800 text-white":"bg-white border-r border-gray-200 text-gray-700",m=u==="dark"?"bg-gray-800 border-gray-700 text-white placeholder-gray-400 focus:ring-blue-500 focus:border-blue-500 focus:ring-1":"border-gray-300 text-gray-700 placeholder-gray-400 focus:ring-blue-500 focus:border-blue-500 focus:ring-1",v=u==="dark"?"text-gray-300":"text-gray-500",S=u==="dark"?"bg-gray-800/50 border-gray-700 text-white":"bg-gray-50 border-gray-100 text-gray-700",N=M=>{const B="text-xs font-bold px-2 py-0.5 rounded border",T={dark:{get:"bg-blue-900/30 border-blue-700 text-blue-200",post:"bg-green-900/30 border-green-700 text-green-200",put:"bg-yellow-900/30 border-yellow-700 text-yellow-200",patch:"bg-purple-900/30 border-purple-700 text-purple-200",delete:"bg-red-900/30 border-red-700 text-red-200",default:"bg-gray-800/50 border-gray-700 text-gray-200"},light:{get:"bg-blue-50 border-blue-200 text-blue-700",post:"bg-green-50 border-green-200 text-green-700",put:"bg-yellow-50 border-yellow-200 text-yellow-700",patch:"bg-purple-50 border-purple-200 text-purple-700",delete:"bg-red-50 border-red-200 text-red-700",default:"bg-gray-100 border-gray-200 text-gray-600"}},E=u==="dark"?T.dark:T.light;return`${B} ${E[M.toLowerCase()]||E.default}`},_=Object.entries(a.paths).reduce((M,[B,T])=>(tn.getHttpMethods(T).forEach(E=>{const w=T[E];(w?.tags||["default"]).forEach(Y=>{M[Y]||(M[Y]=[]),M[Y].push({path:B,method:E,operation:w})})}),M),{}),R=Object.entries(_).reduce((M,[B,T])=>{const E=f.toLowerCase(),w=T.filter(U=>`${U.method} ${U.path} ${U.operation?.summary||""} ${B}`.toLowerCase().includes(E));return w.length&&(M[B]=w),M},{}),z=M=>x(B=>{const T=new Set(B);return T.has(M)?T.delete(M):T.add(M),T});return s.jsxs("div",{className:`flex h-full w-full min-w-0 flex-col ${b}`,style:{backgroundColor:"var(--flexdoc-sidebar-bg)",color:"var(--flexdoc-sidebar-text)"},children:[s.jsxs("div",{className:`border-b p-4 ${u==="dark"?"border-gray-800":"border-gray-100"}`,children:[s.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[s.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-blue-500 to-blue-600",children:s.jsx(vs,{className:"h-4 w-4 text-white"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h1",{className:`truncate text-lg font-semibold ${u==="dark"?"text-white":"text-gray-900"}`,children:"FlexDoc"}),s.jsx("p",{className:`truncate text-sm ${u==="dark"?"text-gray-300":"text-gray-500"}`,children:"API Documentation"})]})]}),s.jsx("label",{className:"sr-only",htmlFor:"flexdoc-endpoint-search",children:"Search endpoints"}),s.jsxs("div",{className:"relative",children:[s.jsx(Fu,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),s.jsx("input",{id:"flexdoc-endpoint-search",type:"search",placeholder:"Search endpoints...",value:f,onChange:M=>p(M.target.value),className:`w-full rounded-lg border py-2 pl-10 pr-4 text-sm transition-colors ${m}`})]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain",children:s.jsxs("div",{className:"p-4",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("h3",{className:`mb-2 text-xs font-semibold uppercase tracking-wider ${v}`,children:"API Information"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:`rounded-lg border p-3 ${S}`,children:[s.jsx("h4",{className:`truncate font-medium ${u==="dark"?"text-white":"text-gray-900"}`,children:a.info.title}),s.jsxs("p",{className:`text-sm ${u==="dark"?"text-gray-300":"text-gray-600"}`,children:["Version ",a.info.version]})]}),a.servers&&a.servers.length>0&&s.jsxs("div",{className:`rounded-lg border p-3 ${S}`,children:[s.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[s.jsx(Vu,{className:"h-4 w-4 text-gray-400"}),s.jsx("span",{className:"text-sm font-medium",children:"Servers"})]}),s.jsx("div",{className:"space-y-2",children:a.servers.map((M,B)=>s.jsxs("div",{className:"min-w-0 text-sm",children:[s.jsx("code",{className:`block max-w-full overflow-x-auto rounded px-1.5 py-0.5 text-xs ${u==="dark"?"bg-gray-700/50 text-blue-200":"bg-gray-100 text-blue-600"}`,children:M.url}),M.description&&s.jsx("p",{className:`mt-1.5 ${u==="dark"?"text-gray-300":"text-gray-600"}`,children:M.description})]},`${M.url}:${B}`))})]})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:`mb-3 text-xs font-semibold uppercase tracking-wider ${v}`,children:"Endpoints"}),Object.keys(R).length===0&&s.jsx("p",{className:`px-2 py-4 text-sm ${v}`,children:"No endpoints match your search."}),Object.entries(R).map(([M,B])=>s.jsxs("div",{className:"mb-4",children:[s.jsxs("button",{onClick:()=>z(M),className:`flex min-h-11 w-full items-center gap-2 rounded-lg p-2 text-left transition-colors ${u==="dark"?"hover:bg-gray-800/50 text-white":"hover:bg-gray-50 text-gray-700"}`,children:[g.has(M)?s.jsx(Iu,{className:"h-4 w-4 shrink-0 text-gray-400"}):s.jsx(Yu,{className:"h-4 w-4 shrink-0 text-gray-400"}),s.jsx(Ku,{className:"h-4 w-4 shrink-0 text-gray-400"}),s.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:M==="default"?"General":M}),s.jsx("span",{className:`ml-auto shrink-0 rounded-full px-2 py-0.5 text-xs ${u==="dark"?"bg-gray-800 text-white":"bg-gray-100 text-gray-500"}`,children:B.length})]}),g.has(M)&&s.jsx("div",{className:"ml-4 mt-1.5 space-y-1.5 sm:ml-6",children:B.map(({path:T,method:E,operation:w})=>{const U=o?.path===T&&o?.method===E;return s.jsxs("button",{onClick:()=>r(T,E),className:`mb-2 min-h-11 w-full rounded-lg border p-2 text-left transition-all ${U?u==="dark"?"bg-blue-900/20 border-blue-800/50 shadow-sm":"bg-blue-50 border-blue-100 shadow-sm":u==="dark"?"hover:bg-gray-800/50 border-transparent hover:border-gray-700":"hover:bg-gray-50 border-transparent hover:border-gray-100"}`,style:U?{color:"var(--flexdoc-sidebar-active-text)"}:void 0,children:[s.jsx("div",{className:"mb-1 flex items-center gap-2",children:s.jsx("span",{className:N(E),children:E.toUpperCase()})}),s.jsx("div",{className:`break-all font-mono text-sm ${U?u==="dark"?"text-blue-300":"text-blue-600":u==="dark"?"text-gray-300":"text-gray-800"}`,children:T}),w?.summary&&s.jsx("div",{className:`mt-1 text-xs ${u==="dark"?"text-gray-400":"text-gray-600"}`,children:w.summary})]},`${E}-${T}`)})})]},M))]})]})})]})},$a=["parameters","requestBody","responses","tryIt","codeSamples"],Fs={all:$a,none:[],minimal:[],documentation:["parameters","requestBody","responses"],interactive:["parameters","requestBody","tryIt","codeSamples"]},Cg=new Set(["minimal","documentation","interactive"]),Hd=new Set($a),kg=new Set(Object.keys(Fs));function _g(a){return typeof a=="string"?kg.has(a):Array.isArray(a)&&a.every(r=>typeof r=="string"&&(Hd.has(r)||Cg.has(r)))}function Og(a,r){for(const o of Fs[r])a.add(o)}function Vs(a,r){if(a===void 0&&r!==void 0){const u=new Set(["parameters","requestBody","tryIt","codeSamples"]);return r!=="none"&&u.add("responses"),$a.filter(f=>u.has(f))}if(a===void 0)return[];if(typeof a=="string")return[...Fs[a]];const o=new Set;for(const u of a)Hd.has(u)?o.add(u):Og(o,u);return $a.filter(u=>o.has(u))}function Rg(a,r){return`flexdoc:viewer:${encodeURIComponent(r?.trim()||"unknown-host")}:${encodeURIComponent(a?.trim()||"untitled")}`}function Ld(a,r){const o=typeof window<"u"?window.localStorage:void 0;if(!o)return{version:1};try{const u=o.getItem(a);if(!u)return{version:1};const f=JSON.parse(u);return f.version!==1||f.expand!==void 0&&!_g(f.expand)?{version:1}:{version:1,...f.expand!==void 0?{expand:f.expand}:{}}}catch{return{version:1}}}function $g(a,r,o){const u=typeof window<"u"?window.localStorage:void 0;if(u)try{r===void 0?u.removeItem(a):u.setItem(a,JSON.stringify({version:1,expand:r}))}catch{}}function la(a,r){if(r)return On.isReference(r)?On.resolveReference(a,r.$ref):r}function Mg(a,r){const o=a.paths[r];if(!o)throw new Error(`Path not found: ${r}`);return la(a,o)}function qg(a,r={}){return a.url.replace(/\{([^}]+)\}/g,(o,u)=>{const f=a.variables?.[u],p=r[u]??f?.default;if(p===void 0)throw new Error(`Missing server variable: ${u}`);if(f?.enum?.length&&!f.enum.includes(p))throw new Error(`Invalid value for server variable ${u}: ${p}`);return p})}function Ks(a,r,o){const u=Mg(a,r),f=u[o.toLowerCase()];if(!f||typeof f!="object"||!("responses"in f))throw new Error(`Operation not found: ${o.toUpperCase()} ${r}`);const p=[...u.parameters||[],...f.parameters||[]].map(b=>la(a,b)).filter(b=>!!b),g=new Map;for(const b of p)g.set(`${b.in}:${b.name}`,b);const x={};for(const[b,m]of Object.entries(f.responses||{})){const v=la(a,m);v&&(x[b]=v)}return{path:r,method:o.toUpperCase(),pathItem:u,operation:f,parameters:[...g.values()],requestBody:la(a,f.requestBody),responses:x,servers:f.servers||u.servers||a.servers||[],security:f.security!==void 0?f.security:a.security||[]}}function Dg(a,r,o){return Ks(a,r,o).parameters}function zg(a,r){return la(a,r.schema)}function Ug(a,r){if(r.example!==void 0)return r.example;const o=zg(a,r);return o?.example!==void 0?o.example:o?.examples?.length?o.examples[0]:o?.default!==void 0?o.default:o?.enum?.length?o.enum[0]:o?.type==="array"?[]:o?.type==="object"?{}:o?.type==="integer"||o?.type==="number"?1:o?.type==="boolean"?!0:""}function Hg(a,r,o){const u=Ks(a,r,o),f={parameters:{},headers:{},cookies:{},auth:{}};for(const x of u.parameters){const b=x.in==="header"?f.headers:x.in==="cookie"?f.cookies:f.parameters;b[x.name]=Ug(a,x)}const p=u.requestBody,g=p?Object.keys(p.content||{})[0]:void 0;if(g){f.contentType=g;const x=p.content[g],b=la(a,x.schema),m=x.examples?Object.values(x.examples)[0]:void 0,v=la(a,m),S=x.example??v?.value??b?.example??b?.examples?.[0]??b?.default;f.body=S!==void 0?JSON.stringify(S,null,2):""}return f}function kt(a){return a===null?"null":typeof a=="object"?JSON.stringify(a):String(a)}function Xs(a){if(typeof a!="string")return a;const r=a.trim();if(!r||!r.startsWith("[")&&!r.startsWith("{"))return a;try{return JSON.parse(r)}catch{return a}}function Bd(a,r=!1){const o=kt(a);return r?encodeURI(o).replace(/%5B/g,"[").replace(/%5D/g,"]"):encodeURIComponent(o)}function Id(a,r=!1){const o=Xs(a);if(Array.isArray(o))return o.map(kt).join(",");if(o&&typeof o=="object"){const u=Object.entries(o);return r?u.map(([f,p])=>`${f}=${kt(p)}`).join(","):u.flatMap(([f,p])=>[f,kt(p)]).join(",")}return kt(o)}function Lg(a,r){const o=a.style||"simple",u=a.explode??!1,f=Xs(r),p=x=>Bd(x,a.allowReserved);if(Array.isArray(f)){const x=f.map(p);return o==="label"?`.${x.join(u?".":",")}`:o==="matrix"?u?x.map(b=>`;${a.name}=${b}`).join(""):`;${a.name}=${x.join(",")}`:x.join(",")}if(f&&typeof f=="object"){const x=Object.entries(f).map(([b,m])=>[p(b),p(m)]);return o==="label"?u?`.${x.map(([b,m])=>`${b}=${m}`).join(".")}`:`.${x.flatMap(([b,m])=>[b,m]).join(",")}`:o==="matrix"?u?x.map(([b,m])=>`;${b}=${m}`).join(""):`;${a.name}=${x.flatMap(([b,m])=>[b,m]).join(",")}`:u?x.map(([b,m])=>`${b}=${m}`).join(","):x.flatMap(([b,m])=>[b,m]).join(",")}const g=p(f);return o==="label"?`.${g}`:o==="matrix"?`;${a.name}=${g}`:g}function Bg(a,r){const o=a.style||"form",u=a.explode??o==="form",f=Xs(r);if(o==="deepObject"&&f&&typeof f=="object"&&!Array.isArray(f))return Object.entries(f).map(([p,g])=>[`${a.name}[${p}]`,kt(g)]);if(Array.isArray(f))return o==="spaceDelimited"?[[a.name,f.map(kt).join(" ")]]:o==="pipeDelimited"?[[a.name,f.map(kt).join("|")]]:u?f.map(p=>[a.name,kt(p)]):[[a.name,f.map(kt).join(",")]];if(f&&typeof f=="object"){const p=Object.entries(f);return u?p.map(([g,x])=>[g,kt(x)]):[[a.name,p.flatMap(([g,x])=>[g,kt(x)]).join(",")]]}return[[a.name,kt(f)]]}function Ig(a){return typeof globalThis.btoa=="function"?globalThis.btoa(unescape(encodeURIComponent(a))):a}function Yg(a,r){return Object.keys(a).every(o=>!!r[o])}function Gg(a,r,o,u,f,p){if(!r.length||!a.components?.securitySchemes)return;const g=r.find(x=>Object.keys(x).length===0||Yg(x,p))||r[0];for(const x of Object.keys(g)){const b=la(a,a.components.securitySchemes[x]),m=p[x];!b||!m||(b.type==="http"&&b.scheme?.toLowerCase()==="bearer"?o.Authorization=`Bearer ${m}`:b.type==="http"&&b.scheme?.toLowerCase()==="basic"?o.Authorization=`Basic ${Ig(m)}`:b.type==="apiKey"&&b.in==="header"&&b.name?o[b.name]=m:b.type==="apiKey"&&b.in==="query"&&b.name?u.push(`${encodeURIComponent(b.name)}=${encodeURIComponent(m)}`):b.type==="apiKey"&&b.in==="cookie"&&b.name?f.push(`${b.name}=${encodeURIComponent(m)}`):(b.type==="oauth2"||b.type==="openIdConnect")&&(o.Authorization=`Bearer ${m}`))}}function Yd(a){try{const r=JSON.parse(a);return r&&typeof r=="object"&&!Array.isArray(r)?r:void 0}catch{return}}function Fg(a,r,o,u={}){const f=Ks(a,r,o),p=f.servers[0],g=u.serverUrl||(p?qg(p,u.serverVariables):"");let x=r;const b=[],m={...u.headers||{}},v=[];for(const M of f.parameters){const B=M.in==="header"?u.headers?.[M.name]:M.in==="cookie"?u.cookies?.[M.name]:u.parameters?.[M.name];if(!(B===void 0||B===""))if(M.in==="path")x=x.replace(`{${M.name}}`,Lg(M,B));else if(M.in==="query")for(const[T,E]of Bg(M,B))b.push(`${encodeURIComponent(T)}=${Bd(E,M.allowReserved)}`);else M.in==="header"?m[M.name]=Id(B,M.explode):M.in==="cookie"&&v.push(`${M.name}=${encodeURIComponent(Id(B,M.explode))}`)}Gg(a,f.security,m,b,v,u.auth||{}),v.length&&(m.Cookie=v.join("; "));let S,N,_;if(u.body&&!["GET","HEAD"].includes(f.method)){const M=u.contentType||"application/json";if(S=u.body,M==="application/x-www-form-urlencoded"){const B=Yd(u.body);S=B?Object.entries(B).flatMap(([T,E])=>Array.isArray(E)?E.map(w=>`${encodeURIComponent(T)}=${encodeURIComponent(kt(w))}`):[`${encodeURIComponent(T)}=${encodeURIComponent(kt(E))}`]).join("&"):u.body,_=S,N="form",m["Content-Type"]=M}else if(M.startsWith("multipart/form-data")){const B=Yd(u.body);if(B&&typeof FormData<"u"){const T=new FormData;for(const[E,w]of Object.entries(B))Array.isArray(w)?w.forEach(U=>T.append(E,kt(U))):T.append(E,kt(w));_=T}else _=u.body;N="multipart"}else _=u.body,N=M.includes("json")?"json":"text",m["Content-Type"]=M}const R=b.join("&");return{url:`${g.replace(/\/$/,"")}${x}${R?`?${R}`:""}`,method:f.method,headers:m,body:S,bodyKind:N,init:{method:f.method,headers:m,body:_}}}function Gd(a,r,o){return Dg(a,r,o)}function Zs(a,r,o){return Hg(a,r,o)}function Gl(a,r,o,u={}){return Fg(a,r,o,u)}const _t=a=>JSON.stringify(a);function Vg(a,r){const o=Object.entries(a.headers);if(r==="curl"){const p=[`curl -X ${a.method} ${_t(a.url)}`];for(const[g,x]of o)p.push(` -H ${_t(`${g}: ${x}`)}`);return a.body&&p.push(` --data-raw ${_t(a.body)}`),p.join(` \\
|
|
41
|
-
`)}if(
|
|
42
|
-
const data = await response.json();`}if(
|
|
43
|
-
`)}if(
|
|
44
|
-
`)}const
|
|
45
|
-
`)}function Kg(a){return{curl:"cURL",javascript:"JavaScript",python:"Python",go:"Go",java:"Java"}[a]}function Xg(a,r){return Vg(a,r)}function Fd(a){return Kg(a)}var Qs={exports:{}},Vd;function Zg(){return Vd||(Vd=1,(function(a){var r=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var o=(function(u){var f=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,p=0,g={},x={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function T(E){return E instanceof b?new b(E.type,T(E.content),E.alias):Array.isArray(E)?E.map(T):E.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(T){return Object.prototype.toString.call(T).slice(8,-1)},objId:function(T){return T.__id||Object.defineProperty(T,"__id",{value:++p}),T.__id},clone:function T(E,w){w=w||{};var U,Y;switch(x.util.type(E)){case"Object":if(Y=x.util.objId(E),w[Y])return w[Y];U={},w[Y]=U;for(var $ in E)E.hasOwnProperty($)&&(U[$]=T(E[$],w));return U;case"Array":return Y=x.util.objId(E),w[Y]?w[Y]:(U=[],w[Y]=U,E.forEach(function(q,J){U[J]=T(q,w)}),U);default:return E}},getLanguage:function(T){for(;T;){var E=f.exec(T.className);if(E)return E[1].toLowerCase();T=T.parentElement}return"none"},setLanguage:function(T,E){T.className=T.className.replace(RegExp(f,"gi"),""),T.classList.add("language-"+E)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(U){var T=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(U.stack)||[])[1];if(T){var E=document.getElementsByTagName("script");for(var w in E)if(E[w].src==T)return E[w]}return null}},isActive:function(T,E,w){for(var U="no-"+E;T;){var Y=T.classList;if(Y.contains(E))return!0;if(Y.contains(U))return!1;T=T.parentElement}return!!w}},languages:{plain:g,plaintext:g,text:g,txt:g,extend:function(T,E){var w=x.util.clone(x.languages[T]);for(var U in E)w[U]=E[U];return w},insertBefore:function(T,E,w,U){U=U||x.languages;var Y=U[T],$={};for(var q in Y)if(Y.hasOwnProperty(q)){if(q==E)for(var J in w)w.hasOwnProperty(J)&&($[J]=w[J]);w.hasOwnProperty(q)||($[q]=Y[q])}var Se=U[T];return U[T]=$,x.languages.DFS(x.languages,function(Ae,se){se===Se&&Ae!=T&&(this[Ae]=$)}),$},DFS:function T(E,w,U,Y){Y=Y||{};var $=x.util.objId;for(var q in E)if(E.hasOwnProperty(q)){w.call(E,q,E[q],U||q);var J=E[q],Se=x.util.type(J);Se==="Object"&&!Y[$(J)]?(Y[$(J)]=!0,T(J,w,null,Y)):Se==="Array"&&!Y[$(J)]&&(Y[$(J)]=!0,T(J,w,q,Y))}}},plugins:{},highlightAll:function(T,E){x.highlightAllUnder(document,T,E)},highlightAllUnder:function(T,E,w){var U={callback:w,container:T,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};x.hooks.run("before-highlightall",U),U.elements=Array.prototype.slice.apply(U.container.querySelectorAll(U.selector)),x.hooks.run("before-all-elements-highlight",U);for(var Y=0,$;$=U.elements[Y++];)x.highlightElement($,E===!0,U.callback)},highlightElement:function(T,E,w){var U=x.util.getLanguage(T),Y=x.languages[U];x.util.setLanguage(T,U);var $=T.parentElement;$&&$.nodeName.toLowerCase()==="pre"&&x.util.setLanguage($,U);var q=T.textContent,J={element:T,language:U,grammar:Y,code:q};function Se(se){J.highlightedCode=se,x.hooks.run("before-insert",J),J.element.innerHTML=J.highlightedCode,x.hooks.run("after-highlight",J),x.hooks.run("complete",J),w&&w.call(J.element)}if(x.hooks.run("before-sanity-check",J),$=J.element.parentElement,$&&$.nodeName.toLowerCase()==="pre"&&!$.hasAttribute("tabindex")&&$.setAttribute("tabindex","0"),!J.code){x.hooks.run("complete",J),w&&w.call(J.element);return}if(x.hooks.run("before-highlight",J),!J.grammar){Se(x.util.encode(J.code));return}if(E&&u.Worker){var Ae=new Worker(x.filename);Ae.onmessage=function(se){Se(se.data)},Ae.postMessage(JSON.stringify({language:J.language,code:J.code,immediateClose:!0}))}else Se(x.highlight(J.code,J.grammar,J.language))},highlight:function(T,E,w){var U={code:T,grammar:E,language:w};if(x.hooks.run("before-tokenize",U),!U.grammar)throw new Error('The language "'+U.language+'" has no grammar.');return U.tokens=x.tokenize(U.code,U.grammar),x.hooks.run("after-tokenize",U),b.stringify(x.util.encode(U.tokens),U.language)},tokenize:function(T,E){var w=E.rest;if(w){for(var U in w)E[U]=w[U];delete E.rest}var Y=new S;return N(Y,Y.head,T),v(T,Y,E,Y.head,0),R(Y)},hooks:{all:{},add:function(T,E){var w=x.hooks.all;w[T]=w[T]||[],w[T].push(E)},run:function(T,E){var w=x.hooks.all[T];if(!(!w||!w.length))for(var U=0,Y;Y=w[U++];)Y(E)}},Token:b};u.Prism=x;function b(T,E,w,U){this.type=T,this.content=E,this.alias=w,this.length=(U||"").length|0}b.stringify=function T(E,w){if(typeof E=="string")return E;if(Array.isArray(E)){var U="";return E.forEach(function(Se){U+=T(Se,w)}),U}var Y={type:E.type,content:T(E.content,w),tag:"span",classes:["token",E.type],attributes:{},language:w},$=E.alias;$&&(Array.isArray($)?Array.prototype.push.apply(Y.classes,$):Y.classes.push($)),x.hooks.run("wrap",Y);var q="";for(var J in Y.attributes)q+=" "+J+'="'+(Y.attributes[J]||"").replace(/"/g,""")+'"';return"<"+Y.tag+' class="'+Y.classes.join(" ")+'"'+q+">"+Y.content+"</"+Y.tag+">"};function m(T,E,w,U){T.lastIndex=E;var Y=T.exec(w);if(Y&&U&&Y[1]){var $=Y[1].length;Y.index+=$,Y[0]=Y[0].slice($)}return Y}function v(T,E,w,U,Y,$){for(var q in w)if(!(!w.hasOwnProperty(q)||!w[q])){var J=w[q];J=Array.isArray(J)?J:[J];for(var Se=0;Se<J.length;++Se){if($&&$.cause==q+","+Se)return;var Ae=J[Se],se=Ae.inside,he=!!Ae.lookbehind,xe=!!Ae.greedy,Ne=Ae.alias;if(xe&&!Ae.pattern.global){var O=Ae.pattern.toString().match(/[imsuy]*$/)[0];Ae.pattern=RegExp(Ae.pattern.source,O+"g")}for(var ee=Ae.pattern||Ae,oe=U.next,K=Y;oe!==E.tail&&!($&&K>=$.reach);K+=oe.value.length,oe=oe.next){var ge=oe.value;if(E.length>T.length)return;if(!(ge instanceof b)){var C=1,G;if(xe){if(G=m(ee,K,T,he),!G||G.index>=T.length)break;var Ee=G.index,pe=G.index+G[0].length,de=K;for(de+=oe.value.length;Ee>=de;)oe=oe.next,de+=oe.value.length;if(de-=oe.value.length,K=de,oe.value instanceof b)continue;for(var be=oe;be!==E.tail&&(de<pe||typeof be.value=="string");be=be.next)C++,de+=be.value.length;C--,ge=T.slice(K,de),G.index-=K}else if(G=m(ee,0,ge,he),!G)continue;var Ee=G.index,ce=G[0],Ce=ge.slice(0,Ee),Le=ge.slice(Ee+ce.length),Be=K+ge.length;$&&Be>$.reach&&($.reach=Be);var rt=oe.prev;Ce&&(rt=N(E,rt,Ce),K+=Ce.length),_(E,rt,C);var P=new b(q,se?x.tokenize(ce,se):ce,Ne,ce);if(oe=N(E,rt,P),Le&&N(E,oe,Le),C>1){var ve={cause:q+","+Se,reach:Be};v(T,E,w,oe.prev,K,ve),$&&ve.reach>$.reach&&($.reach=ve.reach)}}}}}}function S(){var T={value:null,prev:null,next:null},E={value:null,prev:T,next:null};T.next=E,this.head=T,this.tail=E,this.length=0}function N(T,E,w){var U=E.next,Y={value:w,prev:E,next:U};return E.next=Y,U.prev=Y,T.length++,Y}function _(T,E,w){for(var U=E.next,Y=0;Y<w&&U!==T.tail;Y++)U=U.next;E.next=U,U.prev=E,T.length-=Y}function R(T){for(var E=[],w=T.head.next;w!==T.tail;)E.push(w.value),w=w.next;return E}if(!u.document)return u.addEventListener&&(x.disableWorkerMessageHandler||u.addEventListener("message",function(T){var E=JSON.parse(T.data),w=E.language,U=E.code,Y=E.immediateClose;u.postMessage(x.highlight(U,x.languages[w],w)),Y&&u.close()},!1)),x;var z=x.util.currentScript();z&&(x.filename=z.src,z.hasAttribute("data-manual")&&(x.manual=!0));function M(){x.manual||x.highlightAll()}if(!x.manual){var B=document.readyState;B==="loading"||B==="interactive"&&z&&z.defer?document.addEventListener("DOMContentLoaded",M):window.requestAnimationFrame?window.requestAnimationFrame(M):window.setTimeout(M,16)}return x})(r);a.exports&&(a.exports=o),typeof Eu<"u"&&(Eu.Prism=o),o.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},o.languages.markup.tag.inside["attr-value"].inside.entity=o.languages.markup.entity,o.languages.markup.doctype.inside["internal-subset"].inside=o.languages.markup,o.hooks.add("wrap",function(u){u.type==="entity"&&(u.attributes.title=u.content.replace(/&/,"&"))}),Object.defineProperty(o.languages.markup.tag,"addInlined",{value:function(f,p){var g={};g["language-"+p]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:o.languages[p]},g.cdata=/^<!\[CDATA\[|\]\]>$/i;var x={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:g}};x["language-"+p]={pattern:/[\s\S]+/,inside:o.languages[p]};var b={};b[f]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return f}),"i"),lookbehind:!0,greedy:!0,inside:x},o.languages.insertBefore("markup","cdata",b)}}),Object.defineProperty(o.languages.markup.tag,"addAttribute",{value:function(u,f){o.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+u+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[f,"language-"+f],inside:o.languages[f]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),o.languages.html=o.languages.markup,o.languages.mathml=o.languages.markup,o.languages.svg=o.languages.markup,o.languages.xml=o.languages.extend("markup",{}),o.languages.ssml=o.languages.xml,o.languages.atom=o.languages.xml,o.languages.rss=o.languages.xml,(function(u){var f=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;u.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+f.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+f.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+f.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+f.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:f,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},u.languages.css.atrule.inside.rest=u.languages.css;var p=u.languages.markup;p&&(p.tag.addInlined("style","css"),p.tag.addAttribute("style","css"))})(o),o.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},o.languages.javascript=o.languages.extend("clike",{"class-name":[o.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),o.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,o.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:o.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:o.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:o.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:o.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:o.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),o.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:o.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),o.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),o.languages.markup&&(o.languages.markup.tag.addInlined("script","javascript"),o.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),o.languages.js=o.languages.javascript,(function(){if(typeof o>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var u="Loading…",f=function(z,M){return"✖ Error "+z+" while fetching file: "+M},p="✖ Error: File does not exist or is empty",g={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},x="data-src-status",b="loading",m="loaded",v="failed",S="pre[data-src]:not(["+x+'="'+m+'"]):not(['+x+'="'+b+'"])';function N(z,M,B){var T=new XMLHttpRequest;T.open("GET",z,!0),T.onreadystatechange=function(){T.readyState==4&&(T.status<400&&T.responseText?M(T.responseText):T.status>=400?B(f(T.status,T.statusText)):B(p))},T.send(null)}function _(z){var M=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(z||"");if(M){var B=Number(M[1]),T=M[2],E=M[3];return T?E?[B,Number(E)]:[B,void 0]:[B,B]}}o.hooks.add("before-highlightall",function(z){z.selector+=", "+S}),o.hooks.add("before-sanity-check",function(z){var M=z.element;if(M.matches(S)){z.code="",M.setAttribute(x,b);var B=M.appendChild(document.createElement("CODE"));B.textContent=u;var T=M.getAttribute("data-src"),E=z.language;if(E==="none"){var w=(/\.(\w+)$/.exec(T)||[,"none"])[1];E=g[w]||w}o.util.setLanguage(B,E),o.util.setLanguage(M,E);var U=o.plugins.autoloader;U&&U.loadLanguages(E),N(T,function(Y){M.setAttribute(x,m);var $=_(M.getAttribute("data-range"));if($){var q=Y.split(/\r\n?|\n/g),J=$[0],Se=$[1]==null?q.length:$[1];J<0&&(J+=q.length),J=Math.max(0,Math.min(J-1,q.length)),Se<0&&(Se+=q.length),Se=Math.max(0,Math.min(Se,q.length)),Y=q.slice(J,Se).join(`
|
|
46
|
-
`),M.hasAttribute("data-start")||M.setAttribute("data-start",String(J+1))}B.textContent=Y,o.highlightElement(B)},function(Y){M.setAttribute(x,v),B.textContent=Y})}}),o.plugins.fileHighlight={highlight:function(M){for(var B=(M||document).querySelectorAll(S),T=0,E;E=B[T++];)o.highlightElement(E)}};var R=!1;o.fileHighlight=function(){R||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),R=!0),o.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(Qs)),Qs.exports}var Qg=Zg();const Lr=Cu(Qg);Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json,(function(a){var r=/[*&][^\s[\]{},]+/,o=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,u="(?:"+o.source+"(?:[ ]+"+r.source+")?|"+r.source+"(?:[ ]+"+o.source+")?)",f=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),p=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function g(x,b){b=(b||"").replace(/m/g,"")+"m";var m=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return u}).replace(/<<value>>/g,function(){return x});return RegExp(m,b)}a.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return u})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return u}).replace(/<<key>>/g,function(){return"(?:"+f+"|"+p+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:g(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:g(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:g(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:g(p),lookbehind:!0,greedy:!0},number:{pattern:g(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:o,important:r,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},a.languages.yml=a.languages.yaml})(Prism),Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,(function(a){var r="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",o={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},u={bash:o,environment:{pattern:RegExp("\\$"+r),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+r),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};a.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+r),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:u},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:o}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:u},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:u.entity}}],environment:{pattern:RegExp("\\$?"+r),alias:"constant"},variable:u.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},o.inside=a.languages.bash;for(var f=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],p=u.variable[1].inside,g=0;g<f.length;g++)p[f[g]]=a.languages.bash[f[g]];a.languages.sh=a.languages.bash,a.languages.shell=a.languages.bash})(Prism);var Kd={},Xd;function Jg(){return Xd||(Xd=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Kd}Jg(),Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"];var Zd={},Qd;function Pg(){return Qd||(Qd=1,(function(a){var r=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,o=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,u={pattern:RegExp(/(^|[^\w.])/.source+o+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};a.languages.java=a.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[u,{pattern:RegExp(/(^|[^\w.])/.source+o+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:u.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+o+/[A-Z]\w*\b/.source),lookbehind:!0,inside:u.inside}],keyword:r,function:[a.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),a.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),a.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":u,keyword:r,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+o+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:u.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+o+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:u.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return r.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),Zd}Pg();const zn=({code:a,language:r,title:o,showCopy:u=!0,theme:f="dark",wrap:p=!1})=>{const[g,x]=gs.useState(!1);W.useEffect(()=>{Lr.highlightAll()},[a,f]);const b=async()=>{try{await navigator.clipboard.writeText(a),x(!0),setTimeout(()=>x(!1),2e3)}catch(N){console.error("Failed to copy text: ",N)}},m=f==="dark"?"bg-gray-900 border-gray-700":"bg-gray-50 border-gray-200",v=f==="dark"?"bg-gray-800 border-gray-700 text-gray-300":"bg-gray-100 border-gray-200 text-gray-700",S=f==="dark"?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-900";return s.jsxs("div",{className:`min-w-0 rounded-lg overflow-hidden border ${m}`,children:[(o||u)&&s.jsxs("div",{className:`flex items-center justify-between gap-3 px-3 sm:px-4 py-2 border-b ${v}`,children:[o&&s.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:o}),u&&s.jsx("button",{onClick:b,className:`shrink-0 flex items-center gap-1 text-xs transition-colors ${S}`,"aria-label":"Copy code to clipboard",children:g?s.jsxs(s.Fragment,{children:[s.jsx(rg,{className:"w-3 h-3"}),s.jsx("span",{children:"Copied"})]}):s.jsxs(s.Fragment,{children:[s.jsx(sg,{className:"w-3 h-3"}),s.jsx("span",{children:"Copy"})]})})]}),s.jsx("div",{className:`p-3 sm:p-4 overflow-x-auto ${f==="dark"?"bg-gray-800":"bg-white"}`,children:s.jsx("pre",{className:`m-0 text-xs sm:text-sm ${p?"whitespace-pre-wrap break-words":""} ${f==="dark"?"text-gray-100":"text-gray-800"}`,children:s.jsx("code",{className:`language-${r} bg-transparent`,children:a})})})]})};function Wg(a){const r=Array.isArray(a.type)?a.type.join(" | "):a.type;return r?a.format?`${r} (${a.format})`:r:a.oneOf?"oneOf":a.anyOf?"anyOf":a.allOf?"allOf":a.const!==void 0?"const":"any"}const ra=({spec:a,schema:r,theme:o,required:u=!1,level:f=0,seen:p=new Set,requiredPropsFirst:g=!1,sortPropsAlphabetically:x=!1})=>{const b={spec:a,theme:o,requiredPropsFirst:g,sortPropsAlphabetically:x};if(tn.isReference(r)){if(p.has(r.$ref))return s.jsxs("div",{className:"py-1 text-sm opacity-70",children:["↳ ",s.jsx("code",{children:r.$ref.replace("#/components/schemas/","")})," (recursive reference)"]});const R=new Set(p);R.add(r.$ref);let z;try{z=tn.resolveReference(a,r.$ref)}catch{return s.jsxs("div",{className:"py-1 text-sm text-red-500",children:["Unresolved reference: ",s.jsx("code",{children:r.$ref})]})}return s.jsx(ra,{...b,schema:z,required:u,level:f,seen:R})}const m=o==="dark"?"text-gray-400":"text-gray-600",v=o==="dark"?"border-gray-700":"border-gray-200",S=[["All of",r.allOf],["One of",r.oneOf],["Any of",r.anyOf]],N=new Set(r.required||[]),_=Object.entries(r.properties||{}).sort(([R],[z])=>{if(g){const M=Number(N.has(z))-Number(N.has(R));if(M)return M}return x?R.localeCompare(z):0});return s.jsxs("div",{className:f?`border-l-2 ${v} pl-3`:"",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 py-1",children:[s.jsx("span",{className:o==="dark"?"text-blue-300":"text-blue-600",children:Wg(r)}),u&&s.jsx("span",{className:"rounded bg-red-100 px-2 py-0.5 text-xs text-red-700 dark:bg-red-900/30 dark:text-red-300",children:"required"}),(r.nullable||Array.isArray(r.type)&&r.type.includes("null"))&&s.jsx("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-700 dark:bg-gray-700 dark:text-gray-300",children:"nullable"}),r.deprecated&&s.jsx("span",{className:"rounded bg-orange-100 px-2 py-0.5 text-xs text-orange-700",children:"deprecated"}),r.readOnly&&s.jsx("span",{className:"text-xs opacity-60",children:"readOnly"}),r.writeOnly&&s.jsx("span",{className:"text-xs opacity-60",children:"writeOnly"})]}),r.description&&s.jsx("p",{className:`mt-1 text-sm leading-relaxed ${m}`,children:r.description}),r.enum&&s.jsxs("p",{className:`mt-1 text-xs ${m}`,children:["Allowed: ",r.enum.map(String).join(", ")]}),r.const!==void 0&&s.jsxs("p",{className:`mt-1 text-xs ${m}`,children:["Constant: ",JSON.stringify(r.const)]}),r.default!==void 0&&s.jsxs("p",{className:`mt-1 text-xs ${m}`,children:["Default: ",JSON.stringify(r.default)]}),(r.example!==void 0||r.examples?.length)&&s.jsx("div",{className:"mt-2",children:s.jsx(zn,{code:JSON.stringify(r.example??r.examples?.[0],null,2),language:"json",title:"Example",showCopy:!1,theme:o,wrap:!0})}),r.items&&s.jsxs("div",{className:"mt-3",children:[s.jsx("div",{className:"mb-1 text-xs font-semibold uppercase tracking-wide opacity-60",children:"Items"}),s.jsx(ra,{...b,schema:r.items,level:f+1,seen:p})]}),S.map(([R,z])=>z?.length?s.jsxs("div",{className:"mt-3",children:[s.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-wide opacity-60",children:R}),s.jsx("div",{className:"space-y-3",children:z.map((M,B)=>s.jsx(ra,{...b,schema:M,level:f+1,seen:p},B))})]},R):null),_.length>0&&s.jsx("div",{className:"mt-3 space-y-3",children:_.map(([R,z])=>s.jsxs("div",{children:[s.jsx("div",{className:"font-mono text-sm font-medium",children:R}),s.jsx(ra,{...b,schema:z,required:N.has(R),level:f+1,seen:p})]},R))}),r.additionalProperties&&typeof r.additionalProperties=="object"&&s.jsxs("div",{className:"mt-3",children:[s.jsx("div",{className:"mb-1 text-xs font-semibold uppercase tracking-wide opacity-60",children:"Additional properties"}),s.jsx(ra,{...b,schema:r.additionalProperties,level:f+1,seen:p})]})]})};function fn(a){return{preRequest:a?.preRequest||"",tests:a?.tests||""}}function e0(a){return{...a,query:a.query?.map(r=>({...r})),headers:a.headers?.map(r=>({...r})),urlencoded:a.urlencoded?.map(r=>({...r})),formData:a.formData?.map(r=>({...r})),binary:a.binary?{...a.binary}:void 0,graphql:a.graphql?{...a.graphql}:void 0,auth:a.auth?{...a.auth}:void 0}}function Br(a){return Object.assign(Object.create(null),a)}function wt(a){if(typeof a=="string")return a;if(a instanceof Error)return a.message;try{return JSON.stringify(a)}catch{return String(a)}}function Wa(a,r){if(Object.is(a,r))return!0;if(typeof a!=typeof r||a===null||r===null)return!1;if(Array.isArray(a))return Array.isArray(r)&&a.length===r.length&&a.every((o,u)=>Wa(o,r[u]));if(typeof a=="object"&&typeof r=="object"){const o=a,u=r,f=Object.keys(o),p=Object.keys(u);return f.length===p.length&&f.every(g=>Object.prototype.hasOwnProperty.call(u,g)&&Wa(o[g],u[g]))}return!1}function pn(a){throw new Error(a)}function t0(a){const r=m=>{Object.is(a,m)||pn(`expected ${wt(a)} to equal ${wt(m)}`)},o=m=>{Wa(a,m)||pn(`expected ${wt(a)} to deeply equal ${wt(m)}`)},u=m=>{(typeof a=="string"?a.includes(String(m)):Array.isArray(a)&&a.some(S=>Wa(S,m)))||pn(`expected ${wt(a)} to include ${wt(m)}`)},f=(m,...v)=>{(!a||typeof a!="object"||!Object.prototype.hasOwnProperty.call(a,m))&&pn(`expected value to have property ${m}`),v.length>0&&!Wa(a[m],v[0])&&pn(`expected property ${m} to equal ${wt(v[0])}`)},b={above:m=>{(typeof a!="number"||a<=m)&&pn(`expected ${wt(a)} to be above ${m}`)},below:m=>{(typeof a!="number"||a>=m)&&pn(`expected ${wt(a)} to be below ${m}`)},oneOf:m=>{m.some(v=>Wa(a,v))||pn(`expected ${wt(a)} to be one of ${wt(m)}`)}};return Object.defineProperties(b,{ok:{get:()=>(a||pn(`expected ${wt(a)} to be truthy`),!0)},true:{get:()=>(a!==!0&&pn(`expected ${wt(a)} to be true`),!0)},false:{get:()=>(a!==!1&&pn(`expected ${wt(a)} to be false`),!0)}}),{to:{equal:r,eql:o,include:u,match:m=>{(typeof a!="string"||!m.test(a))&&pn(`expected ${wt(a)} to match ${m}`)},have:{property:f},be:b}}}function Js(a,r){return a.findIndex(o=>o.key.toLowerCase()===r.toLowerCase())}function n0(a){const r=()=>a.headers||(a.headers=[]),o=(u,f)=>{const p=r(),g=Js(p,u),x={key:u,value:String(f),enabled:!0};g>=0?p[g]=x:p.push(x)};return{get(u){const f=Js(r(),u);return f>=0?r()[f].value:void 0},has(u){return Js(r(),u)>=0},set:o,upsert({key:u,value:f}){o(u,f)},remove(u){a.headers=r().filter(f=>f.key.toLowerCase()!==u.toLowerCase())},toObject(){const u={};for(const f of r())f.enabled!==!1&&(u[f.key]=f.value);return u}}}function a0(a){return{get(r){return a.find(([o])=>o.toLowerCase()===r.toLowerCase())?.[1]},has(r){return a.some(([o])=>o.toLowerCase()===r.toLowerCase())},toObject(){const r={};for(const[o,u]of a)r[o]=u;return r}}}async function Jd(a){const r=e0(a.draft),o=Br(a.variables||{}),u=Br(a.collectionVariables||{}),f=Br(a.externalVariables||{}),p=Br(a.environmentVariables||{}),g=[],x=[],b=[],m=[],v=[],S=w=>{Object.prototype.hasOwnProperty.call(p,w)?o[w]=p[w]:Object.prototype.hasOwnProperty.call(f,w)?o[w]=f[w]:Object.prototype.hasOwnProperty.call(u,w)?o[w]=u[w]:delete o[w]},N={get(w){return p[w]},has(w){return Object.prototype.hasOwnProperty.call(p,w)},set(w,U){const Y=String(U);p[w]=Y,o[w]=Y,x.push({action:"set",key:w,value:Y})},unset(w){delete p[w],S(w),x.push({action:"unset",key:w})},replaceIn(w){return w.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(U,Y)=>{const $=Y.trim();return Object.prototype.hasOwnProperty.call(p,$)?p[$]:U})}},_={get(w){return u[w]},has(w){return Object.prototype.hasOwnProperty.call(u,w)},set(w,U){const Y=String(U);u[w]=Y,S(w),g.push({action:"set",key:w,value:Y})},unset(w){delete u[w],S(w),g.push({action:"unset",key:w})},replaceIn(w){return w.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(U,Y)=>{const $=Y.trim();return Object.prototype.hasOwnProperty.call(u,$)?u[$]:U})}},R={get(w){return o[w]},has(w){return Object.prototype.hasOwnProperty.call(o,w)},set(w,U){o[w]=String(U)},unset(w){delete o[w]},replaceIn(w){return w.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(U,Y)=>{const $=Y.trim();return Object.prototype.hasOwnProperty.call(o,$)?o[$]:U})}},z={get raw(){return r.body||""},set raw(w){r.body=String(w),r.bodyMode="raw"}},M={get method(){return r.method},set method(w){r.method=String(w)},get url(){return r.url},set url(w){r.url=String(w)},headers:n0(r),body:z},B=a.response?{code:a.response.status,status:a.response.statusText,responseTime:a.response.responseTime,headers:a0(a.response.headers),text:()=>a.response?.body||"",json:()=>JSON.parse(a.response?.body||"")}:void 0,T={request:M,response:B,environment:N,collection:_,variables:R,expect:t0,test(w,U){if(a.phase!=="tests")throw new Error("flex.test is only available in post-response test scripts.");const Y=Promise.resolve().then(U).then(()=>{b.push({name:w,passed:!0})}).catch($=>{b.push({name:w,passed:!1,error:$ instanceof Error?$.message:String($)})});v.push(Y)}},E={log:(...w)=>m.push(w.map(wt).join(" ")),info:(...w)=>m.push(w.map(wt).join(" ")),warn:(...w)=>m.push(`WARN ${w.map(wt).join(" ")}`),error:(...w)=>m.push(`ERROR ${w.map(wt).join(" ")}`)};try{return await new Function("flex","console",`"use strict"; return (async () => {
|
|
47
|
-
${
|
|
48
|
-
})();`)(T,E),await Promise.all(v),{draft:r,variables:o,collectionVariables:u,externalVariables:f,environmentVariables:p,collectionChanges:g,environmentChanges:x,tests:b,logs:m}}catch(w){return await Promise.all(v),{draft:r,variables:o,collectionVariables:u,externalVariables:f,environmentVariables:p,collectionChanges:g,environmentChanges:x,tests:b,logs:m,error:w instanceof Error?w.message:String(w)}}}const l0="flexdoc-api-client",r0=1,el="workspaces",i0="My Collection",Pd=100,Wd=256*1024;function Fl(){return new Date().toISOString()}function It(a){return!!a&&typeof a=="object"&&!Array.isArray(a)}function ze(a,r){return typeof a[r]=="string"}function Ir(a,r){const o=a[r];return o===void 0||typeof o=="number"&&Number.isFinite(o)}function Yr(a){return!It(a)||!ze(a,"key")||!ze(a,"value")?!1:a.enabled===void 0||typeof a.enabled=="boolean"}function s0(a){if(!Yr(a))return!1;const r=a;return!(r.type!==void 0&&r.type!=="text"&&r.type!=="file"||r.fileName!==void 0&&typeof r.fileName!="string"||r.contentType!==void 0&&typeof r.contentType!="string"||r.file!==void 0&&typeof File<"u"&&!(r.file instanceof File))}function o0(a){return!(!It(a)||a.fileName!==void 0&&typeof a.fileName!="string"||a.contentType!==void 0&&typeof a.contentType!="string"||a.file!==void 0&&typeof File<"u"&&!(a.file instanceof File))}function Ps(a){if(!It(a)||typeof a.type!="string")return!1;if(a.type==="none"||a.type==="inherit")return!0;if(a.type==="bearer")return ze(a,"token");if(a.type==="oauth2"){if(!ze(a,"accessToken"))return!1;const r=new Set(["accessToken","authorizationCode","clientCredentials","password","implicit"]);if(a.grantType!==void 0&&(typeof a.grantType!="string"||!r.has(a.grantType))||a.clientAuthentication!==void 0&&a.clientAuthentication!=="body"&&a.clientAuthentication!=="basic")return!1;for(const o of["authorizationUrl","tokenUrl","clientId","clientSecret","redirectUri","username","password","refreshToken"])if(a[o]!==void 0&&typeof a[o]!="string")return!1;return a.scopes===void 0||Array.isArray(a.scopes)&&a.scopes.every(o=>typeof o=="string")}return a.type==="basic"||a.type==="digest"?ze(a,"username")&&ze(a,"password"):a.type==="apiKey"?ze(a,"key")&&ze(a,"value")&&(a.in==="header"||a.in==="query"||a.in==="cookie"):a.type==="hawk"?ze(a,"id")&&ze(a,"key")&&(a.algorithm===void 0||a.algorithm==="sha1"||a.algorithm==="sha256")&&(a.ext===void 0||typeof a.ext=="string"):a.type==="ntlm"?ze(a,"username")&&ze(a,"password")&&(a.domain===void 0||typeof a.domain=="string")&&(a.workstation===void 0||typeof a.workstation=="string"):a.type==="oauth1"?ze(a,"consumerKey")&&ze(a,"consumerSecret")&&(a.token===void 0||typeof a.token=="string")&&(a.tokenSecret===void 0||typeof a.tokenSecret=="string")&&(a.realm===void 0||typeof a.realm=="string")&&(a.signatureMethod===void 0||["HMAC-SHA1","HMAC-SHA256","PLAINTEXT"].includes(String(a.signatureMethod))):a.type==="awsv4"?ze(a,"accessKey")&&ze(a,"secretKey")&&ze(a,"region")&&ze(a,"service")&&(a.sessionToken===void 0||typeof a.sessionToken=="string"):!1}function ef(a){return!It(a)||!ze(a,"method")||!ze(a,"url")||a.query!==void 0&&(!Array.isArray(a.query)||!a.query.every(Yr))||a.headers!==void 0&&(!Array.isArray(a.headers)||!a.headers.every(Yr))||a.body!==void 0&&typeof a.body!="string"||a.contentType!==void 0&&typeof a.contentType!="string"||a.bodyMode!==void 0&&!["none","raw","json","urlencoded","formdata","binary","graphql"].includes(String(a.bodyMode))||a.urlencoded!==void 0&&(!Array.isArray(a.urlencoded)||!a.urlencoded.every(Yr))||a.formData!==void 0&&(!Array.isArray(a.formData)||!a.formData.every(s0))||a.binary!==void 0&&!o0(a.binary)||a.graphql!==void 0&&(!It(a.graphql)||!ze(a.graphql,"query")||!ze(a.graphql,"variables"))||a.hostExecution!==void 0&&(!It(a.hostExecution)||a.hostExecution.certificateId!==void 0&&typeof a.hostExecution.certificateId!="string"||a.hostExecution.cookieJar!==void 0&&a.hostExecution.cookieJar!=="session")?!1:a.auth===void 0||Ps(a.auth)}function tf(a){return It(a)&&ze(a,"id")&&ze(a,"key")&&ze(a,"value")&&(a.enabled===void 0||typeof a.enabled=="boolean")}function c0(a){return!It(a)||!ze(a,"id")||!ze(a,"name")||!ze(a,"createdAt")||!ze(a,"updatedAt")?null:{id:a.id,name:a.name,auth:Ps(a.auth)?a.auth:{type:"none"},variables:Array.isArray(a.variables)?a.variables.filter(tf):[],createdAt:a.createdAt,updatedAt:a.updatedAt}}function u0(a){return!It(a)||!ze(a,"id")||!ze(a,"collectionId")||a.parentFolderId!==void 0&&typeof a.parentFolderId!="string"||!ze(a,"name")||!ze(a,"createdAt")||!ze(a,"updatedAt")?null:{id:a.id,collectionId:a.collectionId,parentFolderId:a.parentFolderId,name:a.name,auth:Ps(a.auth)?a.auth:{type:"inherit"},createdAt:a.createdAt,updatedAt:a.updatedAt}}function d0(a,r){const o=a.map(u0).filter(f=>f!==null).filter(f=>r.has(f.collectionId)),u=new Map(o.map(f=>[f.id,f]));for(const f of o){if(!f.parentFolderId)continue;const p=u.get(f.parentFolderId);(!p||p.collectionId!==f.collectionId||p.id===f.id)&&(f.parentFolderId=void 0)}for(const f of o){if(!f.parentFolderId)continue;const p=new Set([f.id]);let g=f.parentFolderId;for(;g;){if(p.has(g)){f.parentFolderId=void 0;break}p.add(g),g=u.get(g)?.parentFolderId}}return o}function nf(a){if(!(!It(a)||!ze(a,"preRequest")||!ze(a,"tests")))return{preRequest:a.preRequest,tests:a.tests}}function f0(a){if(!It(a)||!ze(a,"id")||!ze(a,"collectionId")||a.folderId!==void 0&&typeof a.folderId!="string"||!ze(a,"name")||!ef(a.request)||!ze(a,"createdAt")||!ze(a,"updatedAt"))return null;const r=nf(a.scripts);return{id:a.id,collectionId:a.collectionId,folderId:a.folderId,name:a.name,request:Nn(a.request),...r?{scripts:r}:{},createdAt:a.createdAt,updatedAt:a.updatedAt}}function p0(a){return!It(a)||!ze(a,"id")||!ze(a,"name")||!Array.isArray(a.variables)||!ze(a,"createdAt")||!ze(a,"updatedAt")?null:{id:a.id,name:a.name,variables:a.variables.filter(tf),createdAt:a.createdAt,updatedAt:a.updatedAt}}function m0(a){return Array.isArray(a)&&a.length===2&&typeof a[0]=="string"&&typeof a[1]=="string"}function h0(a){return!It(a)||!ze(a,"name")||typeof a.passed!="boolean"||a.error!==void 0&&typeof a.error!="string"?null:{name:a.name,passed:a.passed,error:a.error}}function y0(a){if(!It(a)||!ze(a,"id")||!ef(a.request)||!ze(a,"executedMethod")||!ze(a,"resolvedUrl")||!Ir(a,"status")||a.statusText!==void 0&&typeof a.statusText!="string"||!Ir(a,"responseTime")||a.responseHeaders!==void 0&&(!Array.isArray(a.responseHeaders)||!a.responseHeaders.every(m0))||a.responseBody!==void 0&&typeof a.responseBody!="string"||a.responseBodyTruncated!==void 0&&typeof a.responseBodyTruncated!="boolean"||a.runId!==void 0&&typeof a.runId!="string"||a.runName!==void 0&&typeof a.runName!="string"||!Ir(a,"runIndex")||!Ir(a,"runTotal")||a.runPassed!==void 0&&typeof a.runPassed!="boolean"||a.runCancelled!==void 0&&typeof a.runCancelled!="boolean"||a.error!==void 0&&typeof a.error!="string"||a.scriptError!==void 0&&typeof a.scriptError!="string"||!ze(a,"createdAt"))return null;const r=nf(a.scripts),o=Array.isArray(a.scriptTests)?a.scriptTests.map(h0).filter(f=>f!==null):[],u=Array.isArray(a.scriptLogs)?a.scriptLogs.filter(f=>typeof f=="string"):[];return{id:a.id,collectionId:typeof a.collectionId=="string"?a.collectionId:void 0,folderId:typeof a.folderId=="string"?a.folderId:void 0,request:Nn(a.request),...r?{scripts:r}:{},executedMethod:a.executedMethod,resolvedUrl:a.resolvedUrl,status:a.status,statusText:a.statusText,responseTime:a.responseTime,responseHeaders:Array.isArray(a.responseHeaders)?a.responseHeaders.map(([f,p])=>[f,p]):void 0,responseBody:typeof a.responseBody=="string"?a.responseBody:void 0,responseBodyTruncated:a.responseBodyTruncated===!0?!0:void 0,runId:typeof a.runId=="string"?a.runId:void 0,runName:typeof a.runName=="string"?a.runName:void 0,runIndex:typeof a.runIndex=="number"?a.runIndex:void 0,runTotal:typeof a.runTotal=="number"?a.runTotal:void 0,runPassed:typeof a.runPassed=="boolean"?a.runPassed:void 0,runCancelled:a.runCancelled===!0?!0:void 0,error:a.error,...o.length?{scriptTests:o}:{},...u.length?{scriptLogs:u}:{},scriptError:a.scriptError,createdAt:a.createdAt}}function af(a){const r=Object.create(null);for(const o of a){const u=o.key.trim();o.enabled===!1||!u||(r[u]=o.value)}return r}function Lt(a){const r=globalThis.crypto?.randomUUID?.();return r?`${a}-${r}`:`${a}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function g0(a,r){const o=r?.trim()||"unknown-host",u=a?.trim()||"untitled";return`flexdoc:${encodeURIComponent(o)}:${encodeURIComponent(u)}`}function Nn(a){const r=a.auth?a.auth.type==="oauth2"?{...a.auth,scopes:a.auth.scopes?[...a.auth.scopes]:void 0}:{...a.auth}:void 0;return{...a,query:a.query?.map(o=>({...o})),headers:a.headers?.map(o=>({...o})),urlencoded:a.urlencoded?.map(o=>({...o})),formData:a.formData?.map(o=>({...o,file:void 0})),binary:a.binary?{...a.binary,file:void 0}:void 0,graphql:a.graphql?{...a.graphql}:void 0,auth:r,hostExecution:a.hostExecution?{...a.hostExecution}:void 0}}function Vl(){const a=Fl();return{version:6,collections:[{id:Lt("collection"),name:i0,auth:{type:"none"},variables:[],createdAt:a,updatedAt:a}],folders:[],requests:[],environments:[],history:[]}}function x0(a){if(!It(a)||![1,2,3,4,5,6].includes(a.version))return Vl();const r=(Array.isArray(a.collections)?a.collections:[]).map(c0).filter(m=>m!==null);if(r.length===0)return Vl();const o=new Set(r.map(m=>m.id)),u=d0(Array.isArray(a.folders)?a.folders:[],o),f=new Map(u.map(m=>[m.id,m])),p=(Array.isArray(a.requests)?a.requests:[]).map(f0).filter(m=>m!==null).filter(m=>o.has(m.collectionId)).map(m=>m.folderId?f.get(m.folderId)?.collectionId===m.collectionId?m:{...m,folderId:void 0}:m);if(a.version===1)return{version:6,collections:r,folders:u,requests:p,environments:[],history:[]};const g=(Array.isArray(a.environments)?a.environments:[]).map(p0).filter(m=>m!==null),x=typeof a.activeEnvironmentId=="string"&&g.some(m=>m.id===a.activeEnvironmentId)?a.activeEnvironmentId:void 0,b=(a.version===4||a.version===5||a.version===6)&&Array.isArray(a.history)?a.history.map(y0).filter(m=>m!==null).slice(0,Pd):[];return{version:6,collections:r,folders:u,requests:p,environments:g,activeEnvironmentId:x,history:b}}function lf(a,r){const o=r.responseBody===void 0?void 0:r.responseBody.slice(0,Wd),u=r.responseBodyTruncated===!0||(r.responseBody?.length||0)>Wd,f={id:Lt("history"),collectionId:r.collectionId,folderId:r.folderId,request:Nn(r.request),...r.scripts?{scripts:fn(r.scripts)}:{},executedMethod:r.executedMethod,resolvedUrl:r.resolvedUrl,status:r.status,statusText:r.statusText,responseTime:r.responseTime,...r.responseHeaders?.length?{responseHeaders:r.responseHeaders.map(([p,g])=>[p,g])}:{},...o!==void 0?{responseBody:o,...u?{responseBodyTruncated:!0}:{}}:{},runId:r.runId,runName:r.runName,runIndex:r.runIndex,runTotal:r.runTotal,runPassed:r.runPassed,...r.runCancelled?{runCancelled:!0}:{},error:r.error,...r.scriptTests?.length?{scriptTests:r.scriptTests.map(p=>({...p}))}:{},...r.scriptLogs?.length?{scriptLogs:[...r.scriptLogs]}:{},scriptError:r.scriptError,createdAt:Fl()};return{...a,history:[f,...a.history].slice(0,Pd)}}function rf(a,r,o,u={type:"none"}){if(u.type!=="inherit")return{...u};const f=new Map(a.folders.map(b=>[b.id,b])),p=new Set;let g=o?f.get(o):void 0;for(;g&&g.collectionId===r&&!p.has(g.id);){if(p.add(g.id),g.auth.type!=="inherit")return{...g.auth};g=g.parentFolderId?f.get(g.parentFolderId):void 0}const x=a.collections.find(b=>b.id===r);return x&&x.auth.type!=="inherit"?{...x.auth}:{type:"none"}}function sf(a,r){const o=a.collections.find(u=>u.id===r);return af(o?.variables||[])}function of(a){const r=a.environments.find(o=>o.id===a.activeEnvironmentId);return af(r?.variables||[])}function cf(a,r){if(!a.activeEnvironmentId||r.length===0)return a;const o=a.environments.findIndex(x=>x.id===a.activeEnvironmentId);if(o<0)return a;let f=a.environments[o].variables.map(x=>({...x})),p=!1;for(const x of r){const b=x.key.trim();if(!b)continue;if(x.action==="unset"){const S=f.filter(N=>N.key.trim()!==b);S.length!==f.length&&(f=S,p=!0);continue}const m=f.map((S,N)=>S.key.trim()===b?N:-1).filter(S=>S>=0),v=x.value||"";if(m.length>0){const S=m[0];f[S]={...f[S],key:b,value:v,enabled:!0},m.length>1&&(f=f.filter((N,_)=>_===S||N.key.trim()!==b))}else f.push({id:Lt("variable"),key:b,value:v,enabled:!0});p=!0}if(!p)return a;const g=a.environments.map((x,b)=>b===o?{...x,variables:f,updatedAt:Fl()}:x);return{...a,environments:g}}function uf(a,r,o){if(!r||o.length===0)return a;const u=a.collections.findIndex(b=>b.id===r);if(u<0)return a;let p=a.collections[u].variables.map(b=>({...b})),g=!1;for(const b of o){const m=b.key.trim();if(!m)continue;if(b.action==="unset"){const N=p.filter(_=>_.key.trim()!==m);N.length!==p.length&&(p=N,g=!0);continue}const v=p.map((N,_)=>N.key.trim()===m?_:-1).filter(N=>N>=0),S=b.value||"";if(v.length>0){const N=v[0];p[N]={...p[N],key:m,value:S,enabled:!0},v.length>1&&(p=p.filter((_,R)=>R===N||_.key.trim()!==m))}else p.push({id:Lt("variable"),key:m,value:S,enabled:!0});g=!0}if(!g)return a;const x=a.collections.map((b,m)=>m===u?{...b,variables:p,updatedAt:Fl()}:b);return{...a,collections:x}}function b0(a,r){return{...a,environments:a.environments.filter(o=>o.id!==r),activeEnvironmentId:a.activeEnvironmentId===r?void 0:a.activeEnvironmentId}}function v0(a,r){const o=a.folders.find(f=>f.id===r);if(!o)return a;const u=Fl();return{...a,folders:a.folders.filter(f=>f.id!==r).map(f=>f.parentFolderId===r?{...f,parentFolderId:o.parentFolderId,updatedAt:u}:f),requests:a.requests.map(f=>f.folderId===r?{...f,folderId:o.parentFolderId,updatedAt:u}:f)}}function S0(a,r){const o=a.collections.filter(u=>u.id!==r);return o.length===0?{...Vl(),environments:a.environments,activeEnvironmentId:a.activeEnvironmentId,history:a.history}:{...a,collections:o,folders:a.folders.filter(u=>u.collectionId!==r),requests:a.requests.filter(u=>u.collectionId!==r)}}function df(){return typeof indexedDB>"u"?Promise.resolve(null):new Promise((a,r)=>{const o=indexedDB.open(l0,r0);o.onupgradeneeded=()=>{const u=o.result;u.objectStoreNames.contains(el)||u.createObjectStore(el)},o.onsuccess=()=>a(o.result),o.onerror=()=>r(o.error||new Error("Unable to open FlexDoc API Client storage"))})}async function j0(a){const r=await df();if(!r)return Vl();try{return await new Promise((o,u)=>{const p=r.transaction(el,"readonly").objectStore(el).get(a);p.onsuccess=()=>o(x0(p.result)),p.onerror=()=>u(p.error||new Error("Unable to load FlexDoc API Client workspace"))})}finally{r.close()}}async function A0(a,r){const o=await df();if(o)try{await new Promise((u,f)=>{const p=o.transaction(el,"readwrite");p.objectStore(el).put(r,a),p.oncomplete=()=>u(),p.onerror=()=>f(p.error||new Error("Unable to save FlexDoc API Client workspace")),p.onabort=()=>f(p.error||new Error("Unable to save FlexDoc API Client workspace"))})}finally{o.close()}}function tl(a,r){const o=a?.trim();if(!o)throw new Error(`${r} is required for this OAuth flow.`);return o}function Gr(a){return(a.scopes||[]).map(r=>r.trim()).filter(Boolean).join(" ")}function N0(a){if(typeof TextEncoder>"u")throw new Error("OAuth Basic client authentication requires UTF-8 encoding support.");const r=new TextEncoder().encode(a);let o="";for(const p of r)o+=String.fromCharCode(p);const u=globalThis.Buffer,f=typeof btoa=="function"?btoa(o):u?.from(o,"binary").toString("base64");if(!f)throw new Error("OAuth Basic client authentication requires Base64 support in this runtime.");return f}function ff(a){let r="";for(const f of a)r+=String.fromCharCode(f);const o=globalThis.Buffer,u=typeof btoa=="function"?btoa(r):o?.from(r,"binary").toString("base64");if(!u)throw new Error("OAuth PKCE requires Base64 support in this runtime.");return u.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function pf(a=32){if(!globalThis.crypto?.getRandomValues)throw new Error("OAuth requires cryptographic random-number support.");const r=new Uint8Array(a);return globalThis.crypto.getRandomValues(r),ff(r)}async function w0(a){if(!globalThis.crypto?.subtle||typeof TextEncoder>"u")throw new Error("OAuth authorization-code flow requires Web Crypto PKCE support.");const r=await globalThis.crypto.subtle.digest("SHA-256",new TextEncoder().encode(a));return ff(new Uint8Array(r))}function mf(a,r,o,u){const f=tl(a.authorizationUrl,"Authorization URL"),p=tl(a.clientId,"Client ID"),g=new URL(f),x=a.grantType||"accessToken";g.searchParams.set("response_type",x==="implicit"?"token":"code"),g.searchParams.set("client_id",p),g.searchParams.set("redirect_uri",o),g.searchParams.set("state",r);const b=Gr(a);return b&&g.searchParams.set("scope",b),u&&(g.searchParams.set("code_challenge",u),g.searchParams.set("code_challenge_method","S256")),g.toString()}function T0(a){const r=new URL(a.location.href);return r.search="",r.hash="",r.toString()}async function E0(a,r){const o=r??(typeof window>"u"?void 0:window);if(!o)throw new Error("Interactive OAuth requires a browser window.");const u=a.redirectUri?.trim()||T0(o);if(new URL(u).origin!==o.location.origin)throw new Error("Interactive OAuth redirect URI must use the same origin as the FlexDoc page so the popup result can be read.");const f=pf(24);if((a.grantType||"accessToken")==="implicit")return{url:mf(a,f,u),state:f,redirectUri:u};const p=pf(48),g=await w0(p);return{url:mf(a,f,u,g),state:f,redirectUri:u,codeVerifier:p}}async function C0(a){const r=await a.text();let o;try{o=r?JSON.parse(r):{}}catch{o=Object.fromEntries(new URLSearchParams(r))}if(!a.ok){const g=String(o.error_description||o.error||`OAuth token endpoint returned ${a.status}`);throw new Error(g)}const u=typeof o.access_token=="string"?o.access_token:"";if(!u)throw new Error("OAuth token endpoint did not return access_token.");const f=o.expires_in,p=typeof f=="number"?f:typeof f=="string"&&f.trim()!==""&&Number.isFinite(Number(f))?Number(f):void 0;return{accessToken:u,refreshToken:typeof o.refresh_token=="string"?o.refresh_token:void 0,tokenType:typeof o.token_type=="string"?o.token_type:void 0,expiresIn:p,scope:typeof o.scope=="string"?o.scope:void 0}}async function Fr(a,r,o){const u=tl(a.tokenUrl,"Token URL"),f={"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},p=a.clientId?.trim();(a.clientAuthentication||"body")==="basic"&&p?f.Authorization=`Basic ${N0(`${p}:${a.clientSecret||""}`)}`:(p&&r.set("client_id",p),a.clientSecret&&r.set("client_secret",a.clientSecret));const g=await o(u,{method:"POST",headers:f,body:r.toString()});return C0(g)}async function k0(a,r){const o=r.windowObject??(typeof window>"u"?void 0:window);if(!o)throw new Error("Interactive OAuth requires a browser window.");const u=o.open(a.url,"flexdoc-oauth","popup,width=640,height=760");if(!u)throw new Error("OAuth popup was blocked. Allow popups for this documentation origin and try again.");const f=new URL(a.redirectUri),p=Date.now(),g=r.popupTimeoutMs??12e4,x=r.pollIntervalMs??200;for(;Date.now()-p<g;){if(u.closed)throw new Error("OAuth popup was closed before authorization completed.");try{const b=new URL(u.location.href);if(b.origin===f.origin&&b.pathname===f.pathname)return u.close(),b}catch{}await new Promise(b=>setTimeout(b,x))}throw u.close(),new Error("OAuth authorization timed out.")}async function _0(a,r={}){const o=a.grantType||"accessToken",u=r.fetchImpl??fetch;if(o==="accessToken")return{accessToken:tl(a.accessToken,"Access token")};if(o==="clientCredentials"){const S=new URLSearchParams({grant_type:"client_credentials"}),N=Gr(a);return N&&S.set("scope",N),Fr(a,S,u)}if(o==="password"){const S=new URLSearchParams({grant_type:"password",username:tl(a.username,"Username"),password:a.password||""}),N=Gr(a);return N&&S.set("scope",N),Fr(a,S,u)}const f=await E0(a,r.windowObject),p=await k0(f,r);if((p.searchParams.get("state")||new URLSearchParams(p.hash.replace(/^#/,"")).get("state"))!==f.state)throw new Error("OAuth state mismatch; authorization response was rejected.");const x=new URLSearchParams(p.hash.replace(/^#/,"")),b=p.searchParams.get("error")||x.get("error");if(b){const S=p.searchParams.get("error_description")||x.get("error_description");throw new Error(S||b)}if(o==="implicit"){const S=x.get("access_token")||"";if(!S)throw new Error("OAuth implicit response did not include access_token.");return{accessToken:S,tokenType:x.get("token_type")||void 0,expiresIn:x.get("expires_in")?Number(x.get("expires_in")):void 0,scope:x.get("scope")||void 0}}const m=p.searchParams.get("code");if(!m)throw new Error("OAuth authorization response did not include code.");const v=new URLSearchParams({grant_type:"authorization_code",code:m,redirect_uri:f.redirectUri});return f.codeVerifier&&v.set("code_verifier",f.codeVerifier),Fr(a,v,u)}async function O0(a,r={}){const o=tl(a.refreshToken,"Refresh token"),u=new URLSearchParams({grant_type:"refresh_token",refresh_token:o}),f=Gr(a);return f&&u.set("scope",f),Fr(a,u,r.fetchImpl??fetch)}function R0(a){return a==="inherit"?{type:"inherit"}:a==="bearer"?{type:"bearer",token:""}:a==="oauth2"?{type:"oauth2",accessToken:"",grantType:"accessToken",scopes:[]}:a==="basic"?{type:"basic",username:"",password:""}:a==="apiKey"?{type:"apiKey",key:"",value:"",in:"header"}:a==="digest"?{type:"digest",username:"",password:""}:a==="hawk"?{type:"hawk",id:"",key:"",algorithm:"sha256"}:a==="ntlm"?{type:"ntlm",username:"",password:""}:a==="oauth1"?{type:"oauth1",consumerKey:"",consumerSecret:"",signatureMethod:"HMAC-SHA1"}:a==="awsv4"?{type:"awsv4",accessKey:"",secretKey:"",region:"",service:""}:{type:"none"}}function $0(a){return a.split(/\s+/).map(r=>r.trim()).filter(Boolean)}const hf=({auth:a,fieldClass:r,label:o,onChange:u})=>{const[f,p]=W.useState(!1),[g,x]=W.useState(null),b=a.grantType||"accessToken",m=b==="authorizationCode"||b==="implicit",v=b==="authorizationCode"||b==="clientCredentials"||b==="password",S=b!=="accessToken",N=async()=>{p(!0),x(null);try{const R=await _0(a);u({...a,accessToken:R.accessToken,refreshToken:R.refreshToken??a.refreshToken}),x(R.expiresIn?`Access token acquired; expires in ${R.expiresIn}s.`:"Access token acquired.")}catch(R){x(R instanceof Error?R.message:"OAuth authorization failed.")}finally{p(!1)}},_=async()=>{p(!0),x(null);try{const R=await O0(a);u({...a,accessToken:R.accessToken,refreshToken:R.refreshToken??a.refreshToken}),x("Access token refreshed.")}catch(R){x(R instanceof Error?R.message:"OAuth token refresh failed.")}finally{p(!1)}};return s.jsxs("div",{className:"space-y-2",children:[s.jsxs("select",{"aria-label":o?`${o} OAuth grant type`:"OAuth grant type",className:r,value:b,onChange:R=>u({...a,grantType:R.target.value}),children:[s.jsx("option",{value:"accessToken",children:"Manual access token"}),s.jsx("option",{value:"authorizationCode",children:"Authorization Code + PKCE"}),s.jsx("option",{value:"clientCredentials",children:"Client Credentials"}),s.jsx("option",{value:"password",children:"Password grant (legacy)"}),s.jsx("option",{value:"implicit",children:"Implicit grant (legacy)"})]}),m&&s.jsx("input",{"aria-label":o?`${o} OAuth authorization URL`:"OAuth authorization URL",className:r,placeholder:"Authorization URL",value:a.authorizationUrl||"",onChange:R=>u({...a,authorizationUrl:R.target.value})}),v&&s.jsx("input",{"aria-label":o?`${o} OAuth token URL`:"OAuth token URL",className:r,placeholder:"Token URL",value:a.tokenUrl||"",onChange:R=>u({...a,tokenUrl:R.target.value})}),S&&s.jsx("input",{"aria-label":o?`${o} OAuth client ID`:"OAuth client ID",className:r,placeholder:"Client ID",value:a.clientId||"",onChange:R=>u({...a,clientId:R.target.value})}),(b==="authorizationCode"||b==="clientCredentials"||b==="password")&&s.jsx("input",{"aria-label":o?`${o} OAuth client secret`:"OAuth client secret",type:"password",autoComplete:"off",className:r,placeholder:b==="authorizationCode"?"Client secret (optional for PKCE/public clients)":"Client secret (optional)",value:a.clientSecret||"",onChange:R=>u({...a,clientSecret:R.target.value})}),v&&s.jsxs("select",{"aria-label":o?`${o} OAuth client authentication`:"OAuth client authentication",className:r,value:a.clientAuthentication||"body",onChange:R=>u({...a,clientAuthentication:R.target.value}),children:[s.jsx("option",{value:"body",children:"Send client credentials in body"}),s.jsx("option",{value:"basic",children:"Send as Basic Auth header"})]}),m&&s.jsx("input",{"aria-label":o?`${o} OAuth redirect URI`:"OAuth redirect URI",className:r,placeholder:"Redirect URI (defaults to this page)",value:a.redirectUri||"",onChange:R=>u({...a,redirectUri:R.target.value})}),S&&s.jsx("input",{"aria-label":o?`${o} OAuth scopes`:"OAuth scopes",className:r,placeholder:"Scopes separated by spaces",value:(a.scopes||[]).join(" "),onChange:R=>u({...a,scopes:$0(R.target.value)})}),b==="password"&&s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsx("input",{"aria-label":o?`${o} OAuth username`:"OAuth username",className:r,placeholder:"Resource owner username",value:a.username||"",onChange:R=>u({...a,username:R.target.value})}),s.jsx("input",{"aria-label":o?`${o} OAuth password`:"OAuth password",type:"password",autoComplete:"off",className:r,placeholder:"Resource owner password",value:a.password||"",onChange:R=>u({...a,password:R.target.value})})]}),s.jsx("input",{"aria-label":o?`${o} OAuth access token`:"OAuth access token",type:"password",autoComplete:"off",className:r,placeholder:"Access token",value:a.accessToken,onChange:R=>u({...a,accessToken:R.target.value})}),b!=="accessToken"&&s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{type:"button",disabled:f,onClick:N,className:"rounded-md border px-2.5 py-1.5 text-xs font-medium disabled:opacity-60",children:f?"Authorizing…":"Get access token"}),a.refreshToken&&a.tokenUrl&&s.jsx("button",{type:"button",disabled:f,onClick:_,className:"rounded-md border px-2.5 py-1.5 text-xs font-medium disabled:opacity-60",children:"Refresh access token"})]}),b!=="accessToken"&&s.jsx("p",{className:"text-[11px] opacity-70",children:"Authorization Code uses PKCE. Popup callbacks must return to this page origin; token endpoints must allow browser CORS. Client secrets entered here are browser-visible and should only be used when the OAuth provider permits it."}),g&&s.jsx("p",{role:"status",className:"text-xs",children:g})]})},yf=({auth:a,label:r,allowInherit:o=!1,hostExecution:u,onChange:f,theme:p})=>{const x=`w-full rounded-md border px-2 py-1.5 text-xs ${p==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900"}`,b=new Set(u?.capabilities||[]),m=S=>u?.available===!0&&b.has(S),v=a.type==="digest"?"digest":a.type==="hawk"?"hawk":a.type==="ntlm"?"ntlm":a.type==="oauth1"?"oauth1":a.type==="awsv4"?"awsv4":a.type==="apiKey"&&a.in==="cookie"?"cookies":void 0;return s.jsxs("div",{className:"space-y-2",children:[s.jsxs("select",{"aria-label":`${r} authorization type`,className:x,value:a.type==="inherit"&&!o?"none":a.type,onChange:S=>f(R0(S.target.value)),children:[o&&s.jsx("option",{value:"inherit",children:"Inherit from parent"}),s.jsx("option",{value:"none",children:"No auth"}),s.jsx("option",{value:"bearer",children:"Bearer token"}),s.jsx("option",{value:"oauth2",children:"OAuth 2.0"}),s.jsx("option",{value:"basic",children:"Basic auth"}),s.jsx("option",{value:"apiKey",children:"API key"}),s.jsx("option",{value:"digest",disabled:!m("digest"),children:"Digest (API host)"}),s.jsx("option",{value:"hawk",disabled:!m("hawk"),children:"Hawk (API host)"}),s.jsx("option",{value:"ntlm",disabled:!m("ntlm"),children:"NTLM / Negotiate (API host)"}),s.jsx("option",{value:"oauth1",disabled:!m("oauth1"),children:"OAuth 1.0 (API host)"}),s.jsx("option",{value:"awsv4",disabled:!m("awsv4"),children:"AWS Signature v4 (API host)"})]}),a.type==="bearer"&&s.jsx("input",{"aria-label":`${r} bearer token`,type:"password",autoComplete:"off",className:x,value:a.token,onChange:S=>f({...a,token:S.target.value})}),a.type==="oauth2"&&s.jsx(hf,{auth:a,fieldClass:x,label:r,onChange:f}),(a.type==="basic"||a.type==="digest")&&s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsx("input",{"aria-label":`${r} ${a.type} username`,className:x,placeholder:"Username",value:a.username,onChange:S=>f({...a,username:S.target.value})}),s.jsx("input",{"aria-label":`${r} ${a.type} password`,type:"password",autoComplete:"off",className:x,placeholder:"Password",value:a.password,onChange:S=>f({...a,password:S.target.value})})]}),a.type==="apiKey"&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("input",{"aria-label":`${r} API key name`,className:x,placeholder:"Key name",value:a.key,onChange:S=>f({...a,key:S.target.value})}),s.jsx("input",{"aria-label":`${r} API key value`,type:"password",autoComplete:"off",className:x,placeholder:"Value",value:a.value,onChange:S=>f({...a,value:S.target.value})}),s.jsxs("select",{"aria-label":`${r} API key location`,className:x,value:a.in,onChange:S=>f({...a,in:S.target.value}),children:[s.jsx("option",{value:"header",children:"Header"}),s.jsx("option",{value:"query",children:"Query"}),s.jsx("option",{value:"cookie",disabled:!m("cookies"),children:"Cookie (API host)"})]})]}),a.type==="hawk"&&s.jsxs("div",{className:"grid gap-2",children:[s.jsx("input",{"aria-label":`${r} Hawk id`,className:x,placeholder:"ID",value:a.id,onChange:S=>f({...a,id:S.target.value})}),s.jsx("input",{"aria-label":`${r} Hawk key`,type:"password",autoComplete:"off",className:x,placeholder:"Key",value:a.key,onChange:S=>f({...a,key:S.target.value})}),s.jsxs("select",{"aria-label":`${r} Hawk algorithm`,className:x,value:a.algorithm||"sha256",onChange:S=>f({...a,algorithm:S.target.value}),children:[s.jsx("option",{value:"sha256",children:"SHA-256"}),s.jsx("option",{value:"sha1",children:"SHA-1"})]}),s.jsx("input",{"aria-label":`${r} Hawk ext`,className:x,placeholder:"ext (optional)",value:a.ext||"",onChange:S=>f({...a,ext:S.target.value})})]}),a.type==="ntlm"&&s.jsxs("div",{className:"grid gap-2",children:[s.jsx("input",{"aria-label":`${r} NTLM username`,className:x,placeholder:"Username",value:a.username,onChange:S=>f({...a,username:S.target.value})}),s.jsx("input",{"aria-label":`${r} NTLM password`,type:"password",autoComplete:"off",className:x,placeholder:"Password",value:a.password,onChange:S=>f({...a,password:S.target.value})}),s.jsx("input",{"aria-label":`${r} NTLM domain`,className:x,placeholder:"Domain (optional)",value:a.domain||"",onChange:S=>f({...a,domain:S.target.value})}),s.jsx("input",{"aria-label":`${r} NTLM workstation`,className:x,placeholder:"Workstation (optional)",value:a.workstation||"",onChange:S=>f({...a,workstation:S.target.value})})]}),a.type==="oauth1"&&s.jsxs("div",{className:"grid gap-2",children:[s.jsx("input",{"aria-label":`${r} OAuth1 consumer key`,className:x,placeholder:"Consumer key",value:a.consumerKey,onChange:S=>f({...a,consumerKey:S.target.value})}),s.jsx("input",{"aria-label":`${r} OAuth1 consumer secret`,type:"password",autoComplete:"off",className:x,placeholder:"Consumer secret",value:a.consumerSecret,onChange:S=>f({...a,consumerSecret:S.target.value})}),s.jsx("input",{"aria-label":`${r} OAuth1 token`,className:x,placeholder:"Token (optional)",value:a.token||"",onChange:S=>f({...a,token:S.target.value})}),s.jsx("input",{"aria-label":`${r} OAuth1 token secret`,type:"password",autoComplete:"off",className:x,placeholder:"Token secret (optional)",value:a.tokenSecret||"",onChange:S=>f({...a,tokenSecret:S.target.value})}),s.jsxs("select",{"aria-label":`${r} OAuth1 signature method`,className:x,value:a.signatureMethod||"HMAC-SHA1",onChange:S=>f({...a,signatureMethod:S.target.value}),children:[s.jsx("option",{children:"HMAC-SHA1"}),s.jsx("option",{children:"HMAC-SHA256"}),s.jsx("option",{children:"PLAINTEXT"})]}),s.jsx("input",{"aria-label":`${r} OAuth1 realm`,className:x,placeholder:"Realm (optional)",value:a.realm||"",onChange:S=>f({...a,realm:S.target.value})})]}),a.type==="awsv4"&&s.jsxs("div",{className:"grid gap-2",children:[s.jsx("input",{"aria-label":`${r} AWS access key`,className:x,placeholder:"Access key",value:a.accessKey,onChange:S=>f({...a,accessKey:S.target.value})}),s.jsx("input",{"aria-label":`${r} AWS secret key`,type:"password",autoComplete:"off",className:x,placeholder:"Secret key",value:a.secretKey,onChange:S=>f({...a,secretKey:S.target.value})}),s.jsx("input",{"aria-label":`${r} AWS session token`,type:"password",autoComplete:"off",className:x,placeholder:"Session token (optional)",value:a.sessionToken||"",onChange:S=>f({...a,sessionToken:S.target.value})}),s.jsx("input",{"aria-label":`${r} AWS region`,className:x,placeholder:"Region",value:a.region,onChange:S=>f({...a,region:S.target.value})}),s.jsx("input",{"aria-label":`${r} AWS service`,className:x,placeholder:"Service",value:a.service,onChange:S=>f({...a,service:S.target.value})})]}),v&&s.jsx("p",{role:m(v)?"status":"alert",className:"text-[11px] opacity-75",children:m(v)?"This authorization mode is executed by the FlexDoc API host.":"Host execution is disabled or this documentation host does not support the selected authorization mode."})]})};Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(a){a.type==="entity"&&(a.attributes.title=a.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(r,o){var u={};u["language-"+o]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[o]},u.cdata=/^<!\[CDATA\[|\]\]>$/i;var f={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:u}};f["language-"+o]={pattern:/[\s\S]+/,inside:Prism.languages[o]};var p={};p[r]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return r}),"i"),lookbehind:!0,greedy:!0,inside:f},Prism.languages.insertBefore("markup","cdata",p)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(a,r){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+a+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[r,"language-"+r],inside:Prism.languages[r]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,Prism.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:Prism.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},Prism.hooks.add("after-tokenize",function(r){if(r.language!=="graphql")return;var o=r.tokens.filter(function(z){return typeof z!="string"&&z.type!=="comment"&&z.type!=="scalar"}),u=0;function f(z){return o[u+z]}function p(z,M){M=M||0;for(var B=0;B<z.length;B++){var T=f(B+M);if(!T||T.type!==z[B])return!1}return!0}function g(z,M){for(var B=1,T=u;T<o.length;T++){var E=o[T],w=E.content;if(E.type==="punctuation"&&typeof w=="string"){if(z.test(w))B++;else if(M.test(w)&&(B--,B===0))return T}}return-1}function x(z,M){var B=z.alias;B?Array.isArray(B)||(z.alias=B=[B]):z.alias=B=[],B.push(M)}for(;u<o.length;){var b=o[u++];if(b.type==="keyword"&&b.content==="mutation"){var m=[];if(p(["definition-mutation","punctuation"])&&f(1).content==="("){u+=2;var v=g(/^\($/,/^\)$/);if(v===-1)continue;for(;u<v;u++){var S=f(0);S.type==="variable"&&(x(S,"variable-input"),m.push(S.content))}u=v+1}if(p(["punctuation","property-query"])&&f(0).content==="{"&&(u++,x(f(0),"property-mutation"),m.length>0)){var N=g(/^\{$/,/^\}$/);if(N===-1)continue;for(var _=u;_<N;_++){var R=o[_];R.type==="variable"&&m.indexOf(R.content)>=0&&x(R,"variable-input")}}}}});const M0=`
|
|
49
|
-
.api-client-code-editor .token.comment,.api-client-code-editor .token.prolog,.api-client-code-editor .token.doctype,.api-client-code-editor .token.cdata{color:#6b7280}
|
|
50
|
-
.
|
|
51
|
-
.
|
|
52
|
-
.api-client-code-editor.dark .token.property,.api-client-code-editor.dark .token.tag,.api-client-code-editor.dark .token.boolean,.api-client-code-editor.dark .token.number,.api-client-code-editor.dark .token.constant,.api-client-code-editor.dark .token.symbol{color:#fca5a5}
|
|
53
|
-
.api-client-code-editor.light .token.selector,.api-client-code-editor.light .token.attr-name,.api-client-code-editor.light .token.string,.api-client-code-editor.light .token.char,.api-client-code-editor.light .token.builtin,.api-client-code-editor.light .token.inserted{color:#047857}
|
|
54
|
-
.
|
|
55
|
-
.api-client-code-editor.light .token.operator,.api-client-code-editor.light .token.entity,.api-client-code-editor.light .token.url,.api-client-code-editor.light .token.variable{color:#92400e}
|
|
56
|
-
.api-client-code-editor.dark .token.operator,.api-client-code-editor.dark .token.entity,.api-client-code-editor.dark .token.url,.api-client-code-editor.dark .token.variable{color:#fcd34d}
|
|
57
|
-
.api-client-code-editor.light .token.atrule,.api-client-code-editor.light .token.attr-value,.api-client-code-editor.light .token.function,.api-client-code-editor.light .token.class-name{color:#1d4ed8}
|
|
58
|
-
.api-client-code-editor.dark .token.atrule,.api-client-code-editor.dark .token.attr-value,.api-client-code-editor.dark .token.function,.api-client-code-editor.dark .token.class-name{color:#93c5fd}
|
|
59
|
-
.
|
|
60
|
-
.api-client-code-editor.light .token.regex,.api-client-code-editor.light .token.important{color:#c2410c}.api-client-code-editor.dark .token.regex,.api-client-code-editor.dark .token.important{color:#fdba74}
|
|
61
|
-
|
|
62
|
-
`).
|
|
63
|
-
|
|
64
|
-
`)?
|
|
65
|
-
`
|
|
66
|
-
`),v=M,m="multipart"}else if(S==="binary"){const M=o.binary;if(!M?.file)throw new Error("Binary body needs a file selection.");b=`[file: ${M.fileName||M.file.name}]`,v=M.file,R||x.push(["Content-Type",z||M.contentType||M.file.type||"application/octet-stream"]),m="binary"}else if(S==="graphql"){const M=o.graphql?.query||"",B=o.graphql?.variables?.trim()||"";let T={};if(B)try{T=JSON.parse(B)}catch{throw new Error("GraphQL variables must be valid JSON.")}b=JSON.stringify({query:M,variables:T}),v=b,R||x.push(["Content-Type",z||"application/json"]),m="json"}else{b=o.body||"",v=b;const M=S==="json"?"application/json":void 0;!R&&(z||M)&&x.push(["Content-Type",z||M]),m=S==="json"||(R||z||M)?.includes("json")?"json":"text"}}const N=H0(x);return{url:z0(f,g),method:u,headers:N,headerEntries:x,body:b,bodyKind:m,init:{method:u,headers:x,body:v}}}function F0(a){const r=L0(a),o=U0(a.url),u=a.bodyKind==="binary"&&typeof File<"u"&&a.init.body instanceof File?a.init.body:void 0;return{method:a.method,url:o.url,query:o.query,headers:r.map(([f,p])=>({key:f,value:p})),body:a.body,contentType:eo(r,"Content-Type"),bodyMode:a.bodyKind==="json"?"json":a.bodyKind==="form"?"urlencoded":a.bodyKind==="multipart"?"formdata":a.bodyKind==="binary"?"binary":a.body?"raw":"none",binary:a.bodyKind==="binary"?{file:u,fileName:u?.name,contentType:eo(r,"Content-Type")}:void 0,urlencoded:a.bodyKind==="form"&&a.body?[...new URLSearchParams(a.body).entries()].map(([f,p])=>({key:f,value:p,enabled:!0})):void 0,auth:{type:"none"}}}function vf(a,r={}){return G0(a,r)}function Sf(a){return gf(a)}function to(a){return xf(a)}function V0(a,r){return bf(a,r)}function no(a){return F0(a)}const jf=()=>({key:"",value:"",enabled:!0}),ao=()=>({key:"",value:"",enabled:!0,type:"text"}),Af=[["application/json","JSON — application/json"],["application/problem+json","Problem JSON — application/problem+json"],["application/ld+json","JSON-LD — application/ld+json"],["text/plain","Text — text/plain"],["application/xml","XML — application/xml"],["text/html","HTML — text/html"],["application/javascript","JavaScript — application/javascript"],["application/octet-stream","Binary — application/octet-stream"]];function K0(a){const r=(a||"").toLowerCase();return r.includes("json")?"json":r.includes("xml")?"xml":r.includes("html")?"html":r.includes("javascript")?"javascript":"text"}function X0({label:a,entries:r,onChange:o,inputClass:u}){const f=(p,g)=>o(r.map((x,b)=>b===p?{...x,...g}:x));return s.jsxs("div",{className:"space-y-2",children:[r.map((p,g)=>s.jsxs("div",{className:"grid grid-cols-[auto_1fr_1fr_auto] items-center gap-2",children:[s.jsx("input",{"aria-label":`${a} ${g+1} enabled`,type:"checkbox",checked:p.enabled!==!1,onChange:x=>f(g,{enabled:x.target.checked})}),s.jsx("input",{"aria-label":`${a} ${g+1} key`,className:`min-w-0 rounded-md border px-3 py-2 text-sm ${u}`,placeholder:"Key",value:p.key,onChange:x=>f(g,{key:x.target.value})}),s.jsx("input",{"aria-label":`${a} ${g+1} value`,className:`min-w-0 rounded-md border px-3 py-2 text-sm ${u}`,placeholder:"Value",value:p.value,onChange:x=>f(g,{value:x.target.value})}),s.jsx("button",{type:"button","aria-label":`Remove ${a.toLowerCase()} ${g+1}`,className:"rounded-md border p-2",onClick:()=>o(r.filter((x,b)=>b!==g)),children:s.jsx(dn,{className:"h-4 w-4"})})]},g)),s.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 rounded-md border px-3 py-2 text-xs",onClick:()=>o([...r,jf()]),children:[s.jsx(Ra,{className:"h-3.5 w-3.5"})," Add field"]})]})}const Z0=({draft:a,onChange:r,theme:o="light"})=>{const u=a.bodyMode||Sf(a),f=o==="dark",p=f?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",x=Af.some(([N])=>N===a.contentType)?a.contentType||"application/json":"__custom__",b=W.useMemo(()=>{if(u!=="json"||!(a.body||"").trim())return null;try{return JSON.parse(a.body||""),""}catch(N){return N instanceof Error?N.message:"Invalid JSON"}},[a.body,u]),m=W.useMemo(()=>{const N=a.graphql?.variables?.trim();if(u!=="graphql"||!N)return null;try{return JSON.parse(N),""}catch(_){return _ instanceof Error?_.message:"Invalid JSON"}},[a.graphql?.variables,u]),v=N=>{const _={bodyMode:N};N==="json"&&(!a.contentType||!a.contentType.includes("json"))&&(_.contentType="application/json"),N==="raw"&&!a.contentType&&(_.contentType="text/plain"),N==="urlencoded"&&(_.contentType="application/x-www-form-urlencoded"),N==="formdata"&&(_.contentType=void 0),N==="binary"&&!a.contentType&&(_.contentType="application/octet-stream"),N==="graphql"&&(_.contentType="application/json"),r({...a,..._})},S=(N,_)=>{const R=a.formData||[ao()];r({...a,formData:R.map((z,M)=>M===N?{...z,..._}:z)})};return s.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-body-heading",children:[s.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[s.jsxs("label",{className:"text-sm font-medium",children:["Body type",s.jsxs("select",{"aria-label":"Request body type",className:`ml-2 rounded-md border px-3 py-2 text-sm ${p}`,value:u,onChange:N=>v(N.target.value),children:[s.jsx("option",{value:"none",children:"None"}),s.jsx("option",{value:"json",children:"JSON"}),s.jsx("option",{value:"raw",children:"Raw"}),s.jsx("option",{value:"urlencoded",children:"x-www-form-urlencoded"}),s.jsx("option",{value:"formdata",children:"form-data"}),s.jsx("option",{value:"binary",children:"Binary"}),s.jsx("option",{value:"graphql",children:"GraphQL"})]})]}),(u==="json"||u==="raw"||u==="binary")&&s.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[s.jsxs("label",{className:"text-sm font-medium",children:["Content type",s.jsxs("select",{"aria-label":"Content type",className:`ml-2 rounded-md border px-3 py-2 text-sm ${p}`,value:x,onChange:N=>{const _=N.target.value==="__custom__"?"":N.target.value;r({...a,contentType:_})},children:[Af.map(([N,_])=>s.jsx("option",{value:N,children:_},N)),s.jsx("option",{value:"__custom__",children:"Custom…"})]})]}),x==="__custom__"&&s.jsx("input",{"aria-label":"Custom content type",className:`rounded-md border px-3 py-2 text-sm ${p}`,placeholder:"application/vnd.example+json",value:a.contentType||"",onChange:N=>r({...a,contentType:N.target.value})})]})]}),u==="none"&&s.jsx("div",{className:`rounded-md border border-dashed p-4 text-sm ${f?"border-gray-700 text-gray-400":"border-gray-300 text-gray-500"}`,children:"This request has no body."}),(u==="json"||u==="raw")&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(Kl,{ariaLabel:"Request body",language:u==="json"?"json":K0(a.contentType),theme:o,value:a.body||"",onChange:N=>r({...a,body:N}),minLines:9,maxLines:20}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsx("span",{className:`text-xs ${b?"text-red-600":u==="json"&&b===""?"text-green-600":f?"text-gray-400":"text-gray-500"}`,children:u==="json"?b?`Invalid JSON: ${b}`:(a.body||"").trim()?"Valid JSON":"Enter a JSON object, array, or value.":"Raw body is sent exactly as entered."}),u==="json"&&s.jsx("button",{type:"button",className:"rounded-md border px-3 py-1.5 text-xs",disabled:!!b||!(a.body||"").trim(),onClick:()=>{try{r({...a,body:JSON.stringify(JSON.parse(a.body||""),null,2)})}catch{}},children:"Beautify JSON"})]})]}),u==="urlencoded"&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(X0,{label:"Form field",entries:a.urlencoded?.length?a.urlencoded:[jf()],inputClass:p,onChange:N=>r({...a,urlencoded:N,contentType:"application/x-www-form-urlencoded"})}),s.jsx("p",{className:`text-xs ${f?"text-gray-400":"text-gray-500"}`,children:"Enabled fields are URL-encoded at send time. Variable substitution still applies to keys and values."})]}),u==="formdata"&&s.jsxs("div",{className:"space-y-2",children:[(a.formData?.length?a.formData:[ao()]).map((N,_)=>s.jsxs("div",{className:"grid gap-2 md:grid-cols-[auto_7rem_1fr_1fr_auto]",children:[s.jsx("input",{"aria-label":`Form data ${_+1} enabled`,type:"checkbox",checked:N.enabled!==!1,onChange:R=>S(_,{enabled:R.target.checked})}),s.jsxs("select",{"aria-label":`Form data ${_+1} type`,className:`rounded-md border px-2 py-2 text-sm ${p}`,value:N.type||"text",onChange:R=>S(_,{type:R.target.value,file:void 0,fileName:void 0}),children:[s.jsx("option",{value:"text",children:"Text"}),s.jsx("option",{value:"file",children:"File"})]}),s.jsx("input",{"aria-label":`Form data ${_+1} key`,className:`min-w-0 rounded-md border px-3 py-2 text-sm ${p}`,placeholder:"Key",value:N.key,onChange:R=>S(_,{key:R.target.value})}),N.type==="file"?s.jsxs("label",{className:`flex min-w-0 cursor-pointer items-center rounded-md border px-3 py-2 text-sm ${p}`,children:[s.jsx("span",{className:"truncate",children:N.file?.name||N.fileName||"Choose file…"}),s.jsx("input",{"aria-label":`Form data ${_+1} file`,className:"sr-only",type:"file",onChange:R=>{const z=R.target.files?.[0];S(_,{file:z,fileName:z?.name,contentType:z?.type||void 0})}})]}):s.jsx("input",{"aria-label":`Form data ${_+1} value`,className:`min-w-0 rounded-md border px-3 py-2 text-sm ${p}`,placeholder:"Value",value:N.value,onChange:R=>S(_,{value:R.target.value})}),s.jsx("button",{type:"button","aria-label":`Remove form data ${_+1}`,className:"rounded-md border p-2",onClick:()=>r({...a,formData:(a.formData||[]).filter((R,z)=>z!==_)}),children:s.jsx(dn,{className:"h-4 w-4"})})]},_)),s.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 rounded-md border px-3 py-2 text-xs",onClick:()=>r({...a,formData:[...a.formData||[],ao()]}),children:[s.jsx(Ra,{className:"h-3.5 w-3.5"})," Add form-data field"]}),s.jsx("p",{className:`text-xs ${f?"text-gray-400":"text-gray-500"}`,children:"The browser supplies the multipart boundary automatically. Imported Postman file paths must be re-selected from this browser."})]}),u==="binary"&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("label",{className:`flex cursor-pointer items-center justify-between gap-3 rounded-md border px-3 py-3 text-sm ${p}`,children:[s.jsx("span",{className:"min-w-0 truncate",children:a.binary?.file?.name||a.binary?.fileName||"Choose binary file…"}),s.jsx("span",{className:"shrink-0 text-xs font-medium",children:"Browse"}),s.jsx("input",{"aria-label":"Binary file",className:"sr-only",type:"file",onChange:N=>{const _=N.target.files?.[0];r({...a,contentType:_?.type||a.contentType||"application/octet-stream",binary:{file:_,fileName:_?.name||a.binary?.fileName,contentType:_?.type||a.binary?.contentType}})}})]}),s.jsx("p",{className:`text-xs ${f?"text-gray-400":"text-gray-500"}`,children:"The selected file is sent as the request body without text conversion. Saved requests retain only file metadata, so the browser asks you to re-select the file before a later send or collection run."})]}),u==="graphql"&&s.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Query"}),s.jsx(Kl,{ariaLabel:"GraphQL query",language:"graphql",theme:o,value:a.graphql?.query||"",onChange:N=>r({...a,graphql:{query:N,variables:a.graphql?.variables||""}}),minLines:9,maxLines:20})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Variables (JSON)"}),s.jsx(Kl,{ariaLabel:"GraphQL variables",language:"json",theme:o,value:a.graphql?.variables||"",onChange:N=>r({...a,graphql:{query:a.graphql?.query||"",variables:N}}),minLines:9,maxLines:20}),s.jsx("div",{className:`text-xs ${m?"text-red-600":f?"text-gray-400":"text-gray-500"}`,children:m?`Invalid variables JSON: ${m}`:"Variables are serialized with the query as application/json."})]})]})]})};function Q0(a,r){return a.find(([o])=>o.toLowerCase()===r.toLowerCase())?.[1]||""}function J0(a,r){const o=r.toLowerCase();if(o.includes("json"))try{return{body:JSON.stringify(JSON.parse(a),null,2),language:"json"}}catch{return{body:a,language:"json",invalidJson:!0}}return o.includes("html")?{body:a,language:"markup"}:o.includes("xml")?{body:a,language:"markup"}:o.includes("javascript")?{body:a,language:"javascript"}:{body:a,language:"text"}}const Nf=({response:a,theme:r="light"})=>{const[o,u]=W.useState("pretty"),f=Q0(a.headers,"content-type"),p=W.useMemo(()=>J0(a.body,f),[f,a.body]),g=/(?:text\/html|application\/xhtml\+xml)/i.test(f),x=W.useMemo(()=>new TextEncoder().encode(a.body).byteLength,[a.body]),b=r==="dark";return s.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-response-heading",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{id:"api-client-response-heading",className:"font-semibold",children:["Response ",s.jsxs("span",{className:a.status>=400?"text-red-600":"text-green-600",children:[a.status," ",a.statusText]})]}),s.jsxs("div",{className:`flex flex-wrap gap-3 text-xs ${b?"text-gray-400":"text-gray-500"}`,children:[s.jsxs("span",{children:[a.responseTime," ms"]}),s.jsxs("span",{children:[x.toLocaleString()," B"]}),f&&s.jsx("span",{className:"font-mono",children:f.split(";")[0]})]})]}),s.jsxs("div",{className:`flex w-fit overflow-hidden rounded-md border ${b?"border-gray-700":"border-gray-300"}`,role:"group","aria-label":"Response body view",children:[["pretty","raw"].map(m=>{const v=m==="pretty"?"Pretty":"Raw";return s.jsx("button",{type:"button","aria-label":v,"aria-pressed":o===m,className:`px-3 py-1.5 text-xs font-medium ${o===m?"bg-blue-600 text-white":b?"bg-gray-900 text-gray-300":"bg-white text-gray-700"}`,onClick:()=>u(m),children:v},m)}),s.jsx("button",{type:"button",disabled:!g,"aria-pressed":o==="preview",className:`px-3 py-1.5 text-xs font-medium ${o==="preview"?"bg-blue-600 text-white":b?"bg-gray-900 text-gray-300":"bg-white text-gray-700"} disabled:cursor-not-allowed disabled:opacity-40`,onClick:()=>u("preview"),children:"Preview"})]}),o==="pretty"&&s.jsxs("div",{className:"space-y-2",children:[p.invalidJson&&s.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:"Response declares JSON but could not be parsed. Showing the exact payload."}),s.jsx(zn,{code:p.body||"(empty response)",language:p.language,title:"Body — Pretty",theme:r,wrap:!0})]}),o==="raw"&&s.jsx("div",{"data-testid":"api-client-response-raw-body",children:s.jsx(zn,{code:a.body||"(empty response)",language:"text",title:"Body — Raw",theme:r,wrap:!0})}),o==="preview"&&g&&s.jsx("iframe",{title:"Response preview",sandbox:"",srcDoc:a.body,className:`min-h-80 w-full rounded-md border bg-white ${b?"border-gray-700":"border-gray-300"}`}),a.headers.length>0&&s.jsxs("details",{className:`rounded-md border ${b?"border-gray-700":"border-gray-200"}`,children:[s.jsxs("summary",{className:"cursor-pointer px-3 py-2 text-sm font-medium",children:["Response headers (",a.headers.length,")"]}),s.jsx("div",{className:"border-t p-3",children:s.jsx(zn,{code:a.headers.map(([m,v])=>`${m}: ${v}`).join(`
|
|
67
|
-
`),language:"text",theme:r,wrap:!0})})]})]})};function P0(a,r){const o=window.getComputedStyle(a),u=a.getBoundingClientRect(),f=document.createElement("div");f.style.position="fixed",f.style.visibility="hidden",f.style.pointerEvents="none",f.style.left=`${u.left}px`,f.style.top=`${u.top}px`,f.style.width=`${a.clientWidth}px`,f.style.height=`${a.clientHeight}px`,f.style.overflow="hidden",f.style.whiteSpace="pre",f.style.fontFamily=o.fontFamily,f.style.fontSize=o.fontSize,f.style.fontWeight=o.fontWeight,f.style.fontStyle=o.fontStyle,f.style.letterSpacing=o.letterSpacing,f.style.lineHeight=o.lineHeight,f.style.padding=o.padding,f.style.border=o.border,f.style.boxSizing=o.boxSizing,f.style.tabSize=o.tabSize;const p=document.createTextNode(a.value.slice(0,r)),g=document.createElement("span");g.textContent="",f.append(p,g),document.body.appendChild(f);const x=g.getBoundingClientRect(),b=Number.parseFloat(o.lineHeight)||24,m={left:x.left-a.scrollLeft,top:x.top-a.scrollTop,bottom:x.top-a.scrollTop+b};return f.remove(),m}const lo=[{label:"get",kind:"method",signature:"get(key: string): string | undefined",documentation:"Read a variable by key."},{label:"has",kind:"method",signature:"has(key: string): boolean",documentation:"Check whether a variable is defined."},{label:"set",kind:"method",signature:"set(key: string, value: unknown): void",documentation:"Set a variable. Collection and environment stores persist the change in the workspace."},{label:"unset",kind:"method",signature:"unset(key: string): void",documentation:"Remove a variable by key."},{label:"replaceIn",kind:"method",signature:"replaceIn(value: string): string",documentation:"Replace {{variable}} placeholders using this variable scope."}],W0={flex:[{label:"request",kind:"property",documentation:"The mutable request draft available to pre-request and test scripts."},{label:"response",kind:"property",documentation:"The response from the executed request.",testsOnly:!0},{label:"environment",kind:"property",documentation:"Read and mutate variables in the active environment."},{label:"collection",kind:"property",documentation:"Read and mutate variables on the current collection."},{label:"variables",kind:"property",documentation:"Read and mutate the effective variables for this execution."},{label:"expect",kind:"function",signature:"expect(actual: unknown): FlexExpectation",documentation:"Create an assertion chain for a value."},{label:"test",kind:"function",signature:"test(name: string, callback: () => unknown | Promise<unknown>): void",documentation:"Register a post-response test.",testsOnly:!0}],"flex.request":[{label:"method",kind:"property",signature:"method: string",documentation:"Read or replace the HTTP method."},{label:"url",kind:"property",signature:"url: string",documentation:"Read or replace the request URL before variable resolution."},{label:"headers",kind:"property",documentation:"Mutable request-header helpers."},{label:"body",kind:"property",documentation:"Mutable raw request-body helpers."}],"flex.request.headers":[{label:"get",kind:"method",signature:"get(name: string): string | undefined",documentation:"Read a request header case-insensitively."},{label:"has",kind:"method",signature:"has(name: string): boolean",documentation:"Check whether a request header exists."},{label:"set",kind:"method",signature:"set(name: string, value: unknown): void",documentation:"Set or replace a request header."},{label:"upsert",kind:"method",signature:"upsert({ key, value }: { key: string; value: unknown }): void",documentation:"Set or replace a request header from a key/value object."},{label:"remove",kind:"method",signature:"remove(name: string): void",documentation:"Remove a request header case-insensitively."},{label:"toObject",kind:"method",signature:"toObject(): Record<string, string>",documentation:"Return enabled request headers as an object."}],"flex.request.body":[{label:"raw",kind:"property",signature:"raw: string",documentation:"Read or replace the raw request body."}],"flex.response":[{label:"code",kind:"property",signature:"code: number",documentation:"HTTP response status code.",testsOnly:!0},{label:"status",kind:"property",signature:"status: string",documentation:"HTTP response status text.",testsOnly:!0},{label:"responseTime",kind:"property",signature:"responseTime: number",documentation:"Measured response time in milliseconds.",testsOnly:!0},{label:"headers",kind:"property",documentation:"Read-only response-header helpers.",testsOnly:!0},{label:"text",kind:"method",signature:"text(): string",documentation:"Return the response body as text.",testsOnly:!0},{label:"json",kind:"method",signature:"json(): unknown",documentation:"Parse and return the response body as JSON.",testsOnly:!0}],"flex.response.headers":[{label:"get",kind:"method",signature:"get(name: string): string | undefined",documentation:"Read a response header case-insensitively.",testsOnly:!0},{label:"has",kind:"method",signature:"has(name: string): boolean",documentation:"Check whether a response header exists.",testsOnly:!0},{label:"toObject",kind:"method",signature:"toObject(): Record<string, string>",documentation:"Return response headers as an object.",testsOnly:!0}],"flex.environment":lo,"flex.collection":lo,"flex.variables":lo.map(a=>({...a,documentation:a.label==="set"||a.label==="unset"?`${a.documentation} Local effective-variable changes apply only to the current request execution.`:a.documentation})),"flex.expect.to":[{label:"equal",kind:"method",signature:"equal(expected: unknown): void",documentation:"Assert strict equality with Object.is."},{label:"eql",kind:"method",signature:"eql(expected: unknown): void",documentation:"Assert deep structural equality."},{label:"include",kind:"method",signature:"include(expected: unknown): void",documentation:"Assert that a string or array contains the expected value."},{label:"match",kind:"method",signature:"match(pattern: RegExp): void",documentation:"Assert that a string matches a regular expression."},{label:"have",kind:"property",documentation:"Property assertions."},{label:"be",kind:"property",documentation:"Boolean, range, and membership assertions."}],"flex.expect.to.have":[{label:"property",kind:"method",signature:"property(name: string, expected?: unknown): void",documentation:"Assert that an object has a property, optionally with an expected value."}],"flex.expect.to.be":[{label:"above",kind:"method",signature:"above(expected: number): void",documentation:"Assert that a number is greater than expected."},{label:"below",kind:"method",signature:"below(expected: number): void",documentation:"Assert that a number is less than expected."},{label:"oneOf",kind:"method",signature:"oneOf(expected: unknown[]): void",documentation:"Assert deep equality with one value from a list."},{label:"ok",kind:"property",signature:"ok: true",documentation:"Assert that the value is truthy."},{label:"true",kind:"property",signature:"true: true",documentation:"Assert that the value is exactly true."},{label:"false",kind:"property",signature:"false: true",documentation:"Assert that the value is exactly false."}],console:[{label:"log",kind:"method",signature:"log(...values: unknown[]): void",documentation:"Write a line to the API Client script console."},{label:"info",kind:"method",signature:"info(...values: unknown[]): void",documentation:"Write an informational line to the API Client script console."},{label:"warn",kind:"method",signature:"warn(...values: unknown[]): void",documentation:"Write a warning line to the API Client script console."},{label:"error",kind:"method",signature:"error(...values: unknown[]): void",documentation:"Write an error line to the API Client script console."}]};function wf(a,r){return[...W0[a]||[]].filter(o=>r==="tests"||!o.testsOnly).map(o=>({...o}))}function ex(a,r,o={}){const u=r.toLowerCase();return[...new Set(o[a]||[])].filter(Boolean).filter(f=>f.toLowerCase().startsWith(u)).sort((f,p)=>f.localeCompare(p)).map(f=>({label:f,kind:"variable",signature:f,documentation:`Known ${a==="variables"?"effective":a} variable.`}))}const tx=[{label:"flex",kind:"namespace",documentation:"FlexDoc request, response, variables, assertions, and test scripting API."},{label:"console",kind:"namespace",documentation:"Captured script console with log, info, warn, and error methods."}];function nx(a){const r=a.lastIndexOf("flex.expect(");if(r<0)return null;const o=a.slice(r),u=[[/\.to\.have\.([A-Za-z_$][\w$]*)?$/,"flex.expect.to.have"],[/\.to\.be\.([A-Za-z_$][\w$]*)?$/,"flex.expect.to.be"],[/\.to\.([A-Za-z_$][\w$]*)?$/,"flex.expect.to"]];for(const[f,p]of u){const g=o.match(f);if(g)return{path:p,prefix:g[1]||""}}return null}function ax(a){const r=a.match(/flex\.(environment|collection|variables)\.(?:get|has|set|unset)\(\s*['"]([^'"]*)$/);return r?{scope:r[1],prefix:r[2]||""}:null}function lx(a){const r=a.match(/(?:^|[^\w$])((?:flex|console)(?:\.[A-Za-z_$][\w$]*)*)\.([A-Za-z_$][\w$]*)?$/);return r?{path:r[1],prefix:r[2]||""}:null}function rx(a,r,o,u={},f=!1){const p=Math.max(0,Math.min(r,a.length)),g=a.slice(0,p),x=ax(g);if(x){const N=ex(x.scope,x.prefix,u);return N.length>0?{from:p-x.prefix.length,to:p,items:N}:null}const b=nx(g);if(b){const N=wf(b.path,o).filter(_=>_.label.toLowerCase().startsWith(b.prefix.toLowerCase()));return N.length>0?{from:p-b.prefix.length,to:p,items:N}:null}const m=lx(g);if(m){const N=wf(m.path,o).filter(_=>_.label.toLowerCase().startsWith(m.prefix.toLowerCase()));return N.length>0?{from:p-m.prefix.length,to:p,items:N}:null}const v=g.match(/([A-Za-z_$][\w$]*)$/)?.[1]||"";if(!f&&!v)return null;const S=tx.filter(N=>!v||N.label.startsWith(v));return!f&&S.length===0?null:S.length>0?{from:p-v.length,to:p,items:S.map(N=>({...N}))}:null}const Tf=({ariaLabel:a,value:r,onChange:o,phase:u,theme:f="light",variableKeys:p={}})=>{const g=W.useRef(null),x=W.useRef(null),b=W.useRef([]),[m,v]=W.useState(null),[S,N]=W.useState(0),[_,R]=W.useState({left:12,top:36}),z=W.useMemo(()=>`api-client-script-completions-${a.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,[a]),M=f==="dark",B=$=>{const q=x.current,J=g.current;if(!q||!J)return;const Se=P0(q,$),Ae=J.getBoundingClientRect(),se=Se.left-Ae.left,he=Math.max(8,Ae.width-430);R({left:Math.max(8,Math.min(se,he)),top:Math.max(8,Se.bottom-Ae.top+2)})},T=($,q,J=!1)=>{const Se=rx($,q,u,p,J);v(Se),N(0),Se&&requestAnimationFrame(()=>B(q))},E=$=>{if(!m)return;const q=`${r.slice(0,m.from)}${$.label}${r.slice(m.to)}`,J=m.from+$.label.length;o(q),v(null),requestAnimationFrame(()=>{const Se=x.current;Se&&(Se.focus(),Se.setSelectionRange(J,J))})};W.useEffect(()=>{b.current[S]?.scrollIntoView({block:"nearest"})},[S]);const w=$=>{const q=$.currentTarget;if(($.ctrlKey||$.metaKey)&&$.code==="Space"){$.preventDefault(),T(r,q.selectionStart,!0);return}if(!(!m||m.items.length===0)){if($.key==="ArrowDown"){$.preventDefault(),N(J=>(J+1)%m.items.length);return}if($.key==="ArrowUp"){$.preventDefault(),N(J=>(J-1+m.items.length)%m.items.length);return}if($.key==="Enter"||$.key==="Tab"){$.preventDefault(),E(m.items[S]);return}$.key==="Escape"&&($.preventDefault(),v(null))}},U=m?.items[S],Y=M?"border-gray-700 bg-gray-900 text-gray-100 shadow-2xl":"border-gray-200 bg-white text-gray-900 shadow-2xl";return s.jsxs("div",{ref:g,className:"relative",onBlur:$=>{$.currentTarget.contains($.relatedTarget)||v(null)},children:[s.jsx(Kl,{ref:x,ariaLabel:a,dataTestId:`${a}-editor`,language:"javascript",onChange:$=>{const J=x.current?.selectionStart??$.length;o($),requestAnimationFrame(()=>{const Se=x.current;T($,Se?.selectionStart??J)})},onCursorChange:$=>{m&&B($)},onEditorKeyDown:w,theme:f,value:r}),m&&m.items.length>0&&s.jsxs("div",{className:`absolute z-[70] w-[min(26rem,calc(100%-1rem))] overflow-hidden rounded-md border ${Y}`,"data-testid":`${a}-completion-popup`,style:{left:_.left,top:_.top},children:[s.jsx("div",{id:z,role:"listbox",className:"max-h-56 overflow-y-auto py-1",children:m.items.map(($,q)=>s.jsxs("button",{ref:J=>{b.current[q]=J},"aria-label":$.label,"aria-selected":q===S,className:`flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-xs ${q===S?M?"bg-blue-700 text-white":"bg-blue-50 text-gray-900":M?"hover:bg-gray-800":"hover:bg-gray-50"}`,id:`${z}-${q}`,onMouseEnter:()=>N(q),onMouseDown:J=>{J.preventDefault(),E($)},role:"option",type:"button",children:[s.jsx("span",{"aria-hidden":"true",className:"shrink-0 rounded bg-black/5 px-1 font-mono text-[10px] uppercase opacity-60 dark:bg-white/10",children:$.kind}),s.jsx("span",{className:"font-mono font-semibold",children:$.label}),s.jsx("span",{"aria-hidden":"true",className:`min-w-0 truncate ${q===S&&M?"text-blue-100":M?"text-gray-400":"text-gray-500"}`,children:$.signature||""})]},`${$.kind}-${$.label}`))}),U&&s.jsxs("div",{className:`border-t px-3 py-2 text-[11px] ${M?"border-gray-700 text-gray-300":"border-gray-200 text-gray-600"}`,children:[U.signature&&s.jsx("div",{className:"mb-1 overflow-x-auto whitespace-nowrap font-mono text-xs",children:U.signature}),s.jsx("div",{children:U.documentation})]})]}),s.jsxs("div",{className:`mt-1 flex flex-wrap gap-x-3 text-[11px] ${M?"text-gray-400":"text-gray-500"}`,children:[s.jsxs("span",{children:[s.jsx("code",{children:"flex."})," or Ctrl+Space"]}),s.jsx("span",{children:"↑/↓ choose"}),s.jsx("span",{children:"Enter/Tab complete"}),s.jsx("span",{children:"Esc dismiss"}),s.jsx("span",{children:"Tab indents when suggestions are closed"})]})]})};function ro(a){const r=a.auth?a.auth.type==="oauth2"?{...a.auth,scopes:a.auth.scopes?[...a.auth.scopes]:void 0}:{...a.auth}:void 0;return{...a,query:a.query?.map(o=>({...o})),headers:a.headers?.map(o=>({...o})),urlencoded:a.urlencoded?.map(o=>({...o})),formData:a.formData?.map(o=>({...o})),binary:a.binary?{...a.binary}:void 0,graphql:a.graphql?{...a.graphql}:void 0,auth:r,hostExecution:a.hostExecution?{...a.hostExecution}:void 0}}function ix(a){const r=ro(a);return r.binary&&(r.binary={fileName:r.binary.fileName,contentType:r.binary.contentType}),r.formData&&(r.formData=r.formData.map(o=>{const u={...o};return delete u.file,u})),r}function Kr(a){return Object.assign(Object.create(null),a||{})}function sx(a){return a instanceof Error?a.message:"Request failed"}function ox(a,r){return r?.available?`The API host does not support the required capability${a.length===1?"":"ies"}: ${a.join(", ")}.`:"Host execution is disabled on this documentation server."}function cx(a){if(typeof globalThis.btoa!="function")throw new Error("Host execution binary uploads require a Base64 encoder.");let r="";const o=32768;for(let u=0;u<a.length;u+=o)r+=String.fromCharCode(...a.subarray(u,Math.min(u+o,a.length)));return globalThis.btoa(r)}async function ux(a){const r={request:ix(a),...a.hostExecution?.certificateId?{certificateId:a.hostExecution.certificateId}:{},...a.hostExecution?.cookieJar?{cookieJar:a.hostExecution.cookieJar}:{}};a.bodyMode==="binary"&&a.binary?.file&&(r.bodyBase64=cx(new Uint8Array(await a.binary.file.arrayBuffer())));const o=(a.formData||[]).map((u,f)=>({entry:u,index:f})).filter(({entry:u})=>u.enabled!==!1&&u.type==="file"&&!!u.file);if(o.length>0){if(typeof FormData>"u")throw new Error("Host multipart execution requires FormData support.");const u=new FormData;u.append("descriptor",JSON.stringify(r));for(const{entry:f,index:p}of o){const g=f.file;u.append(`formData[${p}]`,g,f.fileName||g.name)}return{body:u,headers:{"X-FlexDoc-Execute":"1"}}}return{body:JSON.stringify(r),headers:{"X-FlexDoc-Execute":"1","Content-Type":"application/json"}}}async function io(a){const r=ro(a.request),o=fn(a.scripts),u=a.fetcher||globalThis.fetch,f=a.now||Date.now;let p=ro(a.request),g=Kr(a.variables),x=Kr(a.collectionVariables);const b=Kr(a.externalVariables);let m=Kr(a.environmentVariables),v=[],S=[],N,_="",R="",z=0,M=!1;try{if(o.preRequest.trim()){const w=await Jd({script:o.preRequest,phase:"pre-request",draft:p,variables:g,collectionVariables:x,externalVariables:b,environmentVariables:m});if(p=w.draft,g=w.variables,x=w.collectionVariables,m=w.environmentVariables,v=[...v,...w.logs],w.collectionChanges.length>0&&a.onCollectionChanges?.(w.collectionChanges),w.environmentChanges.length>0&&a.onEnvironmentChanges?.(w.environmentChanges),w.error)return{scriptTests:S,scriptLogs:v,scriptError:`Pre-request script: ${w.error}`}}a.resolveAuth&&(p={...p,auth:a.resolveAuth(p.auth)}),p=V0(p,g),_=(p.method||"GET").toUpperCase(),R=p.url;const B=to(p);let T;if(B.length>0){const w=new Set(a.hostExecution?.capabilities||[]),U=B.filter(he=>!w.has(he));if(!a.hostExecution?.available||U.length>0){const he=ox(U,a.hostExecution);return{error:he,result:{request:r,scripts:o,executedMethod:_,resolvedUrl:R,error:he,...v.length?{scriptLogs:[...v]}:{}},scriptTests:S,scriptLogs:v}}if(!u)throw new Error("Fetch API is not available");const Y=await ux(p);z=f(),M=!0;const $=await u(a.hostExecution.endpoint,{method:"POST",credentials:"same-origin",headers:Y.headers,body:Y.body,...a.signal?{signal:a.signal}:{}}),q=await $.text();let J;try{const he=q?JSON.parse(q):{};if(!he||typeof he!="object"||Array.isArray(he))throw new Error("invalid");J=he}catch{throw new Error("API host returned an invalid execution response.")}const Se=typeof J.error=="string"?J.error:void 0;if(!$.ok)throw new Error(Se||`API host execution failed with HTTP ${$.status}.`);if(typeof J.status!="number"||!Array.isArray(J.headers))throw new Error("API host returned an invalid execution response.");const Ae=J.headers.map(he=>Array.isArray(he)?[String(he[0]),String(he[1])]:["",""]).filter(([he])=>!!he),se=Array.isArray(J.cookies)?J.cookies:void 0;T={status:J.status,statusText:String(J.statusText||""),headers:Ae,body:String(J.body||""),responseTime:typeof J.responseTime=="number"?J.responseTime:f()-z,...se?{cookies:se}:{}}}else{const w=vf(p);_=w.method,R=w.url,a.onRequestBuilt?.(w);let U={...w.init,url:w.url,credentials:a.credentials||"same-origin",...a.signal?{signal:a.signal}:{}};a.requestInterceptor&&(U=await a.requestInterceptor(U)),a.signal&&(U.signal=a.signal);const{url:Y,...$}=U;if(R=Y,z=f(),M=!0,!u)throw new Error("Fetch API is not available");const q=await u(Y,$),J=await q.text();T={status:q.status,statusText:q.statusText,headers:[...q.headers.entries()],body:J,responseTime:f()-z}}if(o.tests.trim()){const w=await Jd({script:o.tests,phase:"tests",draft:p,variables:g,collectionVariables:x,externalVariables:b,environmentVariables:m,response:T});v=[...v,...w.logs],S=w.tests.map(U=>({...U})),w.collectionChanges.length>0&&a.onCollectionChanges?.(w.collectionChanges),w.environmentChanges.length>0&&a.onEnvironmentChanges?.(w.environmentChanges),w.error&&(N=`Test script: ${w.error}`)}return{result:{request:r,scripts:o,executedMethod:_,resolvedUrl:R,status:T.status,statusText:T.statusText,responseTime:T.responseTime,responseHeaders:T.headers.map(([w,U])=>[w,U]),responseBody:T.body,...S.length?{scriptTests:S}:{},...v.length?{scriptLogs:[...v]}:{},...N?{scriptError:N}:{}},response:T,scriptTests:S,scriptLogs:v,...N?{scriptError:N}:{}}}catch(B){const T=sx(B),E={error:T,scriptTests:S,scriptLogs:v};return M&&(E.result={request:r,scripts:o,executedMethod:_,resolvedUrl:R,responseTime:z?f()-z:void 0,error:T,...v.length?{scriptLogs:[...v]}:{}}),E}}function so(a){let r=a.url;for(const[o,u]of Object.entries(a.variables||{}))r=r.split(`{${o}}`).join(u.default);return r}function oo(a){return a.replace(/\/+$/,"")}function Ef(a,r){const o=oo(r);return o?a===o||a.startsWith(`${o}/`)||a.startsWith(`${o}?`):!1}function dx(a,r,o){const u=oo(o);if(!u)return a;const f=oo(r);if(f&&Ef(a,f))return`${u}${a.slice(f.length)}`;try{const p=new URL(a),g=`${p.pathname==="/"?"":p.pathname}${p.search}${p.hash}`;return`${u}${g}`}catch{return u}}const co=()=>({key:"",value:"",enabled:!0});function fx(a){return{method:a?.method||"GET",url:a?.url||"",query:a?.query?.length?a.query:[co()],headers:a?.headers?.length?a.headers:[co()],body:a?.body||"",contentType:a?.contentType||"application/json",bodyMode:a?.bodyMode||Sf(a||{}),urlencoded:a?.urlencoded?.length?a.urlencoded.map(r=>({...r})):void 0,formData:a?.formData?.length?a.formData.map(r=>({...r})):void 0,binary:a?.binary?{...a.binary}:void 0,graphql:a?.graphql?{...a.graphql}:void 0,auth:a?.auth||{type:"none"},hostExecution:a?.hostExecution?{...a.hostExecution}:void 0}}function px(a){const r=a.auth?a.auth.type==="oauth2"?{...a.auth,scopes:a.auth.scopes?[...a.auth.scopes]:void 0}:{...a.auth}:void 0;return{...a,query:a.query?.map(o=>({...o})),headers:a.headers?.map(o=>({...o})),urlencoded:a.urlencoded?.map(o=>({...o})),formData:a.formData?.map(o=>({...o})),binary:a.binary?{...a.binary}:void 0,graphql:a.graphql?{...a.graphql}:void 0,auth:r,hostExecution:a.hostExecution?{...a.hostExecution}:void 0}}function mx(a){try{return new URL(a).origin}catch{return""}}function Cf({label:a,entries:r,onChange:o,inputClass:u}){const f=(p,g)=>o(r.map((x,b)=>b===p?{...x,...g}:x));return s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium",children:a}),s.jsxs("button",{type:"button",className:"inline-flex min-h-11 items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:()=>o([...r,co()]),children:[s.jsx(Ra,{className:"h-4 w-4"})," Add"]})]}),r.map((p,g)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{"aria-label":`${a} ${g+1} enabled`,type:"checkbox",checked:p.enabled!==!1,onChange:x=>f(g,{enabled:x.target.checked})}),s.jsx("input",{"aria-label":`${a} ${g+1} key`,className:`w-full rounded-md border px-3 py-2 text-sm ${u}`,placeholder:"Key",value:p.key,onChange:x=>f(g,{key:x.target.value})}),s.jsx("input",{"aria-label":`${a} ${g+1} value`,className:`w-full rounded-md border px-3 py-2 text-sm ${u}`,placeholder:"Value",value:p.value,onChange:x=>f(g,{value:x.target.value})}),s.jsx("button",{type:"button","aria-label":`Remove ${a.toLowerCase()} ${g+1}`,className:"inline-flex min-h-11 items-center justify-center rounded-md border px-3 py-2",onClick:()=>o(r.filter((x,b)=>b!==g)),children:s.jsx(dn,{className:"h-4 w-4"})})]},g))]})}const hx=({initialRequest:a,initialScripts:r,theme:o="light",credentials:u="same-origin",requestInterceptor:f,onRequestChange:p,onDraftChange:g,onScriptsChange:x,onExecutionStart:b,onExecutionComplete:m,resolveAuth:v,variables:S={},collectionVariables:N={},externalVariables:_={},environmentVariables:R={},onCollectionChanges:z,onEnvironmentChanges:M,serverOptions:B=[],initialServerUrl:T,hostExecution:E})=>{const w=fx(a),U=fn(r),Y=B.map(h=>({server:h,url:so(h)})),$=Y.map(h=>h.url),q=T||$.find(h=>Ef(w.url,h))||"",J=$.includes(q)?q:$[0]||"",Se=q&&!$.includes(q)?q:"",Ae=q||J||mx(w.url),[se,he]=W.useState(w),[xe,Ne]=W.useState(U),[O,ee]=W.useState(J),[oe,K]=W.useState(Se),ge=W.useRef(Ae),C=W.useRef(Ae),[G,pe]=W.useState(null),[de,be]=W.useState(null),[Ee,ce]=W.useState(null),[Ce,Le]=W.useState([]),[Be,rt]=W.useState([]),[P,ve]=W.useState(!1),je=W.useRef(p),ke=W.useRef(g),Pe=W.useRef(x),at=W.useRef(null);W.useEffect(()=>{je.current=p},[p]),W.useEffect(()=>{ke.current=g},[g]),W.useEffect(()=>{Pe.current=x},[x]),W.useEffect(()=>{ke.current?.(px(se))},[se]),W.useEffect(()=>{Pe.current?.(fn(xe))},[xe]),W.useEffect(()=>{try{const h=v?{...se,auth:v(se.auth)}:se,A=vf(h,{variables:S}),I=JSON.stringify([A.method,A.url,A.headerEntries,A.body,A.bodyKind]);if(I===at.current)return;at.current=I,je.current?.(A)}catch{}},[se,v,S]);const yt=(se.method||"GET").toUpperCase(),He=o==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900",Ft=o==="dark"?"border-gray-700 bg-gray-800/60 text-gray-100":"border-gray-200 bg-gray-50 text-gray-900",Vt=o==="dark"?"text-gray-400":"text-gray-600",wn=h=>{if(!h)return;const A=ge.current;ge.current=h,he(I=>({...I,url:dx(I.url,A,h)}))},Rn=h=>{const A=h==="inherit"?{type:"inherit"}:h==="bearer"?{type:h,token:""}:h==="oauth2"?{type:h,accessToken:""}:h==="basic"?{type:h,username:"",password:""}:h==="apiKey"?{type:h,key:"",value:"",in:"header"}:h==="digest"?{type:h,username:"",password:""}:h==="hawk"?{type:h,id:"",key:"",algorithm:"sha256"}:h==="ntlm"?{type:h,username:"",password:""}:h==="oauth1"?{type:h,consumerKey:"",consumerSecret:"",signatureMethod:"HMAC-SHA1"}:h==="awsv4"?{type:h,accessKey:"",secretKey:"",region:"",service:""}:{type:"none"};he(I=>({...I,auth:A}))},Oe=v?v(se.auth):se.auth,it=to({...se,auth:Oe}),Rt=new Set(E?.capabilities||[]),Kt=it.filter(h=>!Rt.has(h)),Yt=it.length>0,d=E?.available===!0&&Kt.length===0,H=Yt?d?"The browser cannot send this request. FlexDoc will execute it from the API host.":E?.available?`The API host does not support the required capability${Kt.length===1?"":"ies"}: ${Kt.join(", ")}.`:"Host execution is disabled on this documentation server.":null,te=h=>E?.available===!0&&Rt.has(h),le=async()=>{b?.(),ve(!0),be(null),ce(null),Le([]),rt([]),pe(null);try{const h=await io({request:se,scripts:xe,credentials:u,requestInterceptor:f,resolveAuth:v,variables:S,collectionVariables:N,externalVariables:_,environmentVariables:R,hostExecution:E,onRequestBuilt:A=>je.current?.(A),onCollectionChanges:z,onEnvironmentChanges:M});be(h.error||null),ce(h.scriptError||null),Le(h.scriptTests),rt(h.scriptLogs),h.response&&pe({status:h.response.status,statusText:h.response.statusText,headers:h.response.headers.map(([A,I])=>[A,I]),body:h.response.body,responseTime:h.response.responseTime}),h.result&&m?.(h.result)}finally{ve(!1)}},Z=Ce.filter(h=>h.passed).length;return s.jsx("div",{className:`rounded-xl border p-4 md:p-5 ${Ft}`,children:s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[B.length>0&&s.jsxs("label",{className:"text-sm font-medium",children:["Server",s.jsx("select",{"aria-label":"API Client server",className:`mt-1 w-full rounded-md border px-3 py-2 text-sm ${He}`,value:O,onChange:h=>{ee(h.target.value),K(""),wn(h.target.value)},children:Y.map(({server:h,url:A})=>s.jsxs("option",{value:A,children:[h.description?`${h.description} — `:"",h.url]},`${h.url}:${A}`))})]}),s.jsxs("label",{className:"text-sm font-medium",children:["Custom server URL ",s.jsx("span",{className:"text-xs font-normal opacity-70",children:"(optional override)"}),s.jsx("input",{"aria-label":"API Client custom server URL",className:`mt-1 w-full rounded-md border px-3 py-2 font-mono text-sm ${He}`,value:oe,onChange:h=>{const A=h.target.value;K(A);const I=O||C.current;(A.trim()||I)&&wn(A.trim()||I)},placeholder:"http://localhost:8080"})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("select",{"aria-label":"HTTP method",className:`rounded-md border px-3 py-2 font-medium ${He}`,value:yt,onChange:h=>{const A=h.target.value;he(I=>({...I,method:A}))},children:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map(h=>s.jsx("option",{children:h},h))}),s.jsx("input",{"aria-label":"Request URL",className:`w-full rounded-md border px-3 py-2 font-mono text-sm ${He}`,placeholder:"https://api.example.com/resource or {{baseUrl}}/resource",value:se.url,onChange:h=>{const A=h.target.value;he(I=>({...I,url:A}))}})]}),s.jsx(Cf,{label:"Query parameters",entries:se.query||[],onChange:h=>he(A=>({...A,query:h})),inputClass:He}),s.jsx(Cf,{label:"Headers",entries:se.headers||[],onChange:h=>he(A=>({...A,headers:h})),inputClass:He}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("label",{className:"text-sm font-medium",children:["Authorization",s.jsxs("select",{"aria-label":"Authorization type",className:`rounded-md border px-3 py-2 text-sm ${He}`,value:se.auth?.type||"none",onChange:h=>Rn(h.target.value),children:[v&&s.jsx("option",{value:"inherit",children:"Inherit from parent"}),s.jsx("option",{value:"none",children:"None"}),s.jsx("option",{value:"bearer",children:"Bearer token"}),s.jsx("option",{value:"oauth2",children:"OAuth 2.0 access token"}),s.jsx("option",{value:"basic",children:"Basic auth"}),s.jsx("option",{value:"apiKey",children:"API key"}),s.jsx("option",{value:"digest",disabled:!te("digest"),children:"Digest (API host)"}),s.jsx("option",{value:"hawk",disabled:!te("hawk"),children:"Hawk (API host)"}),s.jsx("option",{value:"ntlm",disabled:!te("ntlm"),children:"NTLM / Negotiate (API host)"}),s.jsx("option",{value:"oauth1",disabled:!te("oauth1"),children:"OAuth 1.0 (API host)"}),s.jsx("option",{value:"awsv4",disabled:!te("awsv4"),children:"AWS Signature v4 (API host)"})]})]}),se.auth?.type==="bearer"&&s.jsx("input",{"aria-label":"Bearer token",type:"password",autoComplete:"off",className:`w-full rounded-md border px-3 py-2 ${He}`,value:se.auth.token,onChange:h=>{const A=h.target.value;he(I=>({...I,auth:{type:"bearer",token:A}}))}}),se.auth?.type==="oauth2"&&s.jsx(hf,{auth:se.auth,fieldClass:`w-full rounded-md border px-3 py-2 text-sm ${He}`,label:"",onChange:h=>he(A=>({...A,auth:h}))}),se.auth?.type==="basic"&&s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{"aria-label":"Basic auth username",className:`w-full rounded-md border px-3 py-2 ${He}`,placeholder:"Username",value:se.auth.username,onChange:h=>he(A=>({...A,auth:{...A.auth,username:h.target.value}}))}),s.jsx("input",{"aria-label":"Basic auth password",type:"password",autoComplete:"off",className:`w-full rounded-md border px-3 py-2 ${He}`,placeholder:"Password",value:se.auth.password,onChange:h=>he(A=>({...A,auth:{...A.auth,password:h.target.value}}))})]}),se.auth?.type==="apiKey"&&s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{"aria-label":"API key name",className:`w-full rounded-md border px-3 py-2 ${He}`,placeholder:"Key name",value:se.auth.key,onChange:h=>he(A=>({...A,auth:{...A.auth,key:h.target.value}}))}),s.jsx("input",{"aria-label":"API key value",type:"password",autoComplete:"off",className:`w-full rounded-md border px-3 py-2 ${He}`,placeholder:"Value",value:se.auth.value,onChange:h=>he(A=>({...A,auth:{...A.auth,value:h.target.value}}))}),s.jsxs("select",{"aria-label":"API key location",className:`rounded-md border px-3 py-2 text-sm ${He}`,value:se.auth.in,onChange:h=>he(A=>({...A,auth:{...A.auth,in:h.target.value}})),children:[s.jsx("option",{value:"header",children:"Header"}),s.jsx("option",{value:"query",children:"Query"}),s.jsx("option",{value:"cookie",disabled:!te("cookies"),children:"Cookie (API host)"})]})]}),se.auth?.type==="digest"&&s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsx("input",{"aria-label":"Digest username",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Username",value:se.auth.username,onChange:h=>he(A=>({...A,auth:{...A.auth,username:h.target.value}}))}),s.jsx("input",{"aria-label":"Digest password",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Password",value:se.auth.password,onChange:h=>he(A=>({...A,auth:{...A.auth,password:h.target.value}}))})]}),se.auth?.type==="hawk"&&s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsx("input",{"aria-label":"Hawk id",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"ID",value:se.auth.id,onChange:h=>he(A=>({...A,auth:{...A.auth,id:h.target.value}}))}),s.jsx("input",{"aria-label":"Hawk key",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Key",value:se.auth.key,onChange:h=>he(A=>({...A,auth:{...A.auth,key:h.target.value}}))}),s.jsxs("select",{"aria-label":"Hawk algorithm",className:`rounded-md border px-3 py-2 ${He}`,value:se.auth.algorithm||"sha256",onChange:h=>he(A=>({...A,auth:{...A.auth,algorithm:h.target.value}})),children:[s.jsx("option",{value:"sha256",children:"SHA-256"}),s.jsx("option",{value:"sha1",children:"SHA-1"})]}),s.jsx("input",{"aria-label":"Hawk ext",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"ext (optional)",value:se.auth.ext||"",onChange:h=>he(A=>({...A,auth:{...A.auth,ext:h.target.value}}))})]}),se.auth?.type==="ntlm"&&s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsx("input",{"aria-label":"NTLM username",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Username",value:se.auth.username,onChange:h=>he(A=>({...A,auth:{...A.auth,username:h.target.value}}))}),s.jsx("input",{"aria-label":"NTLM password",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Password",value:se.auth.password,onChange:h=>he(A=>({...A,auth:{...A.auth,password:h.target.value}}))}),s.jsx("input",{"aria-label":"NTLM domain",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Domain (optional)",value:se.auth.domain||"",onChange:h=>he(A=>({...A,auth:{...A.auth,domain:h.target.value}}))}),s.jsx("input",{"aria-label":"NTLM workstation",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Workstation (optional)",value:se.auth.workstation||"",onChange:h=>he(A=>({...A,auth:{...A.auth,workstation:h.target.value}}))})]}),se.auth?.type==="oauth1"&&s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsx("input",{"aria-label":"OAuth1 consumer key",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Consumer key",value:se.auth.consumerKey,onChange:h=>he(A=>({...A,auth:{...A.auth,consumerKey:h.target.value}}))}),s.jsx("input",{"aria-label":"OAuth1 consumer secret",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Consumer secret",value:se.auth.consumerSecret,onChange:h=>he(A=>({...A,auth:{...A.auth,consumerSecret:h.target.value}}))}),s.jsx("input",{"aria-label":"OAuth1 token",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Token (optional)",value:se.auth.token||"",onChange:h=>he(A=>({...A,auth:{...A.auth,token:h.target.value}}))}),s.jsx("input",{"aria-label":"OAuth1 token secret",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Token secret (optional)",value:se.auth.tokenSecret||"",onChange:h=>he(A=>({...A,auth:{...A.auth,tokenSecret:h.target.value}}))}),s.jsxs("select",{"aria-label":"OAuth1 signature method",className:`rounded-md border px-3 py-2 ${He}`,value:se.auth.signatureMethod||"HMAC-SHA1",onChange:h=>he(A=>({...A,auth:{...A.auth,signatureMethod:h.target.value}})),children:[s.jsx("option",{children:"HMAC-SHA1"}),s.jsx("option",{children:"HMAC-SHA256"}),s.jsx("option",{children:"PLAINTEXT"})]}),s.jsx("input",{"aria-label":"OAuth1 realm",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Realm (optional)",value:se.auth.realm||"",onChange:h=>he(A=>({...A,auth:{...A.auth,realm:h.target.value}}))})]}),se.auth?.type==="awsv4"&&s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsx("input",{"aria-label":"AWS access key",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Access key",value:se.auth.accessKey,onChange:h=>he(A=>({...A,auth:{...A.auth,accessKey:h.target.value}}))}),s.jsx("input",{"aria-label":"AWS secret key",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Secret key",value:se.auth.secretKey,onChange:h=>he(A=>({...A,auth:{...A.auth,secretKey:h.target.value}}))}),s.jsx("input",{"aria-label":"AWS session token",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Session token (optional)",value:se.auth.sessionToken||"",onChange:h=>he(A=>({...A,auth:{...A.auth,sessionToken:h.target.value}}))}),s.jsx("input",{"aria-label":"AWS region",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Region",value:se.auth.region,onChange:h=>he(A=>({...A,auth:{...A.auth,region:h.target.value}}))}),s.jsx("input",{"aria-label":"AWS service",className:`rounded-md border px-3 py-2 ${He}`,placeholder:"Service",value:se.auth.service,onChange:h=>he(A=>({...A,auth:{...A.auth,service:h.target.value}}))})]}),E?.available&&s.jsxs("div",{className:"grid gap-2 rounded-md border p-3 sm:grid-cols-2",children:[E.clientCertificates?.length?s.jsxs("label",{className:"text-xs font-medium",children:["Client certificate",s.jsxs("select",{"aria-label":"Client certificate",className:`mt-1 w-full rounded-md border px-2 py-1.5 ${He}`,value:se.hostExecution?.certificateId||"",onChange:h=>he(A=>({...A,hostExecution:{...A.hostExecution||{},certificateId:h.target.value||void 0}})),children:[s.jsx("option",{value:"",children:"None"}),E.clientCertificates.map(h=>s.jsx("option",{value:h.id,children:h.name},h.id))]})]}):null,te("cookies")&&s.jsxs("label",{className:"inline-flex items-center gap-2 text-xs font-medium",children:[s.jsx("input",{"aria-label":"Use API host cookie jar",type:"checkbox",checked:se.hostExecution?.cookieJar==="session",onChange:h=>he(A=>({...A,hostExecution:{...A.hostExecution||{},cookieJar:h.target.checked?"session":void 0}}))}),"Use API host cookie jar"]})]}),H&&s.jsx("div",{role:d?"status":"alert",className:`rounded-md border p-3 text-sm ${d?"border-blue-300 bg-blue-50 text-blue-800":"border-amber-300 bg-amber-50 text-amber-800"}`,children:H})]}),!["GET","HEAD"].includes(yt)&&s.jsx(Z0,{draft:se,onChange:he,theme:o}),s.jsxs("section",{className:"space-y-3 border-t pt-4","aria-labelledby":"api-client-scripts-heading",children:[s.jsxs("div",{children:[s.jsx("h3",{id:"api-client-scripts-heading",className:"font-semibold",children:"Scripts"}),s.jsx("p",{className:`text-xs ${Vt}`,children:"Trusted local JavaScript. Scripts are not sandboxed; only run code you trust."})]}),s.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[s.jsxs("label",{className:"text-sm font-medium",children:["Pre-request script",s.jsx("div",{className:"mt-1",children:s.jsx(Tf,{ariaLabel:"Pre-request script",phase:"pre-request",theme:o,value:xe.preRequest,onChange:h=>Ne(A=>({...A,preRequest:h})),variableKeys:{environment:Object.keys(R),collection:Object.keys(N),variables:Object.keys(S)}})})]}),s.jsxs("label",{className:"text-sm font-medium",children:["Tests",s.jsx("div",{className:"mt-1",children:s.jsx(Tf,{ariaLabel:"Tests script",phase:"tests",theme:o,value:xe.tests,onChange:h=>Ne(A=>({...A,tests:h})),variableKeys:{environment:Object.keys(R),collection:Object.keys(N),variables:Object.keys(S)}})})]})]})]}),s.jsxs("button",{onClick:le,disabled:P||Yt&&!d,className:"inline-flex min-h-11 items-center justify-center gap-2 rounded-md bg-blue-600 px-4 py-2 font-medium text-white hover:bg-blue-700 disabled:opacity-60",children:[P?s.jsx(Ss,{className:"h-4 w-4 animate-spin"}):s.jsx(Pa,{className:"h-4 w-4"})," ",P?"Sending…":"Send request"]}),de&&s.jsxs("div",{role:"alert",className:"flex gap-2 rounded-md border border-red-300 bg-red-50 p-3 text-sm text-red-700",children:[s.jsx(Ur,{className:"mt-0.5 h-4 w-4 shrink-0"}),de]}),Ee&&s.jsxs("div",{role:"alert",className:"flex gap-2 rounded-md border border-amber-300 bg-amber-50 p-3 text-sm text-amber-800",children:[s.jsx(Ur,{className:"mt-0.5 h-4 w-4 shrink-0"}),Ee]}),G&&s.jsx(Nf,{response:G,theme:o}),Ce.length>0&&s.jsxs("section",{className:"space-y-2","aria-labelledby":"api-client-test-results-heading",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{id:"api-client-test-results-heading",className:"font-semibold",children:"Test results"}),s.jsxs("span",{className:`text-xs ${Vt}`,children:[Z,"/",Ce.length," passed"]})]}),s.jsx("div",{className:"space-y-2",children:Ce.map((h,A)=>s.jsxs("div",{className:`rounded-md border px-3 py-2 text-sm ${h.passed?"border-green-300 bg-green-50 text-green-800":"border-red-300 bg-red-50 text-red-800"}`,children:[s.jsxs("div",{className:"font-medium",children:[h.passed?"PASS":"FAIL"," — ",h.name]}),h.error&&s.jsx("div",{className:"mt-1 text-xs",children:h.error})]},`${h.name}:${A}`))})]}),Be.length>0&&s.jsx(zn,{code:Be.join(`
|
|
68
|
-
`),language:"text",title:"Script console",theme:o,wrap:!0})]})})};function yx(a,r,o){if(!o)return null;const u=a.folders.find(g=>g.id===o&&g.collectionId===r);if(!u)return new Set;const f=new Set([u.id]);let p=!0;for(;p;){p=!1;for(const g of a.folders)g.collectionId!==r||!g.parentFolderId||f.has(g.id)||f.has(g.parentFolderId)&&(f.add(g.id),p=!0)}return f}function Xr(a,r,o){const u=yx(a,r,o);return a.requests.filter(f=>f.collectionId!==r?!1:u?!!f.folderId&&u.has(f.folderId):!0)}function gx(a,r){const o=new Map(a.map(g=>[g.id,g])),u=[],f=new Set;let p=o.get(r);for(;p&&!f.has(p.id);)f.add(p.id),u.unshift(p.name),p=p.parentFolderId?o.get(p.parentFolderId):void 0;return u.join(" / ")}function kf(a,r,o){const u=a.collections.find(p=>p.id===r)?.name||"Deleted collection";if(!o)return u;const f=gx(a.folders.filter(p=>p.collectionId===r),o);return f?`${u} / ${f}`:`${u} / Deleted folder`}function xx(a){return!a.error&&!a.scriptError&&a.scriptTests.every(r=>r.passed)}async function bx(a){const r=Xr(a.workspace,a.collectionId,a.folderId),o=a.runId||Lt("run"),u=a.runName||kf(a.workspace,a.collectionId,a.folderId);let f=a.workspace;const p=[];let g=a.signal?.aborted===!0;for(let v=0;v<r.length&&!g;v+=1){if(a.signal?.aborted){g=!0;break}const S=r[v];a.onRequestStart?.(S,v,r.length);const N=sf(f,a.collectionId),_=of(f),R={...a.externalEnvironmentVariables||{},..._},z={...N,...a.externalVariables||{},...R},M=await io({request:S.request,scripts:S.scripts,credentials:a.credentials,requestInterceptor:a.requestInterceptor,hostExecution:a.hostExecution,resolveAuth:U=>rf(f,S.collectionId,S.folderId,U||{type:"none"}),variables:z,collectionVariables:N,externalVariables:a.externalVariables,environmentVariables:R,signal:a.signal,fetcher:a.fetcher,now:a.now,onCollectionChanges:U=>{f=uf(f,S.collectionId,U),a.onCollectionChanges?.(U)},onEnvironmentChanges:U=>{f=cf(f,U),a.onEnvironmentChanges?.(U)}}),B=a.signal?.aborted===!0,T=!B&&xx(M);let E;M.result&&!B&&(f=lf(f,{...M.result,collectionId:S.collectionId,folderId:S.folderId,runId:o,runName:u,runIndex:v+1,runTotal:r.length,runPassed:T}),E=f.history[0]?.id);const w={requestId:S.id,requestName:S.name,collectionId:S.collectionId,folderId:S.folderId,passed:T,cancelled:B,historyEntryId:E,outcome:M};if(p.push(w),a.onRequestComplete?.(w,v,r.length),B){g=!0;break}if(!w.passed&&a.stopOnFailure&&v<r.length-1){g=!0;break}}const x=p.filter(v=>v.passed).length,b=p.filter(v=>v.cancelled).length,m=p.filter(v=>!v.passed&&!v.cancelled).length;return{runId:o,runName:u,collectionId:a.collectionId,folderId:a.folderId,total:r.length,completed:p.length,passed:x,failed:m,cancelled:b,stopped:g,items:p,workspace:f}}function ia(){return new Date().toISOString()}const vx=({request:a,scripts:r,onLoadRequest:o,onSelectedCollectionChange:u,onSelectedFolderChange:f,onRunCollection:p,onRunFolder:g,selectedCollectionId:x,selectedFolderId:b="",workspace:m,onWorkspaceChange:v,hostExecution:S,theme:N})=>{const[_,R]=W.useState(""),[z,M]=W.useState(""),[B,T]=W.useState(""),[E,w]=W.useState(null),U=m.collections.find(P=>P.id===x)||m.collections[0],Y=W.useMemo(()=>m.folders.filter(P=>P.collectionId===U?.id),[U?.id,m.folders]),$=W.useMemo(()=>m.requests.filter(P=>P.collectionId===U?.id),[U?.id,m.requests]),q=Y.find(P=>P.id===b),J=W.useMemo(()=>new Map(Y.map(P=>[P.id,P])),[Y]),Se=W.useMemo(()=>{const P=[],ve=new Set,je=(ke,Pe)=>{Y.filter(at=>at.parentFolderId===ke).forEach(at=>{ve.has(at.id)||(ve.add(at.id),P.push({folder:at,depth:Pe}),je(at.id,Pe+1))})};return je(void 0,0),Y.forEach(ke=>{ve.has(ke.id)||(ve.add(ke.id),P.push({folder:ke,depth:0}),je(ke.id,1))}),P},[Y]),Ae=P=>{const ve=[],je=new Set;let ke=J.get(P);for(;ke&&!je.has(ke.id);)je.add(ke.id),ve.unshift(ke.name),ke=ke.parentFolderId?J.get(ke.parentFolderId):void 0;return ve.join(" / ")};W.useEffect(()=>{u?.(U?.id)},[u,U?.id]);const se=()=>{const P=_.trim();if(!P)return;const ve=ia(),je=Lt("collection");v(ke=>({...ke,collections:[...ke.collections,{id:je,name:P,auth:{type:"none"},variables:[],createdAt:ve,updatedAt:ve}]})),u?.(je),f?.(""),R(""),w(null)},he=P=>{if(!U)return;const ve=ia();v(je=>({...je,collections:je.collections.map(ke=>ke.id===U.id?{...ke,auth:P,updatedAt:ve}:ke)}))},xe=P=>{if(!q)return;const ve=ia();v(je=>({...je,folders:je.folders.map(ke=>ke.id===q.id?{...ke,auth:P,updatedAt:ve}:ke)}))},Ne=()=>{if(!U)return;const P=ia();v(ve=>({...ve,collections:ve.collections.map(je=>je.id===U.id?{...je,variables:[...je.variables,{id:Lt("variable"),key:"",value:"",enabled:!0}],updatedAt:P}:je)}))},O=(P,ve)=>{if(!U)return;const je=ia();v(ke=>({...ke,collections:ke.collections.map(Pe=>Pe.id===U.id?{...Pe,variables:Pe.variables.map(at=>at.id===P?{...at,...ve}:at),updatedAt:je}:Pe)}))},ee=P=>{if(!U)return;const ve=ia();v(je=>({...je,collections:je.collections.map(ke=>ke.id===U.id?{...ke,variables:ke.variables.filter(Pe=>Pe.id!==P),updatedAt:ve}:ke)}))},oe=()=>{const P=z.trim();if(!P||!U)return;const ve=ia(),je=Lt("folder");v(ke=>({...ke,folders:[...ke.folders,{id:je,collectionId:U.id,parentFolderId:b||void 0,name:P,auth:{type:"inherit"},createdAt:ve,updatedAt:ve}]})),f?.(je),M("")},K=()=>{if(!U)return;const P=B.trim()||a.url||"Untitled request",ve=ia();if(E){v(ke=>({...ke,requests:ke.requests.map(Pe=>Pe.id===E?{...Pe,collectionId:U.id,folderId:b||void 0,name:P,request:Nn(a),scripts:fn(r),updatedAt:ve}:Pe)}));return}const je={id:Lt("request"),collectionId:U.id,folderId:b||void 0,name:P,request:Nn(a),scripts:fn(r),createdAt:ve,updatedAt:ve};v(ke=>({...ke,requests:[...ke.requests,je]})),w(je.id),T(P)},ge=P=>{const ve=m.requests.find(je=>je.id===P);ve&&(w(ve.id),u?.(ve.collectionId),f?.(ve.folderId||""),T(ve.name),o(Nn(ve.request),ve.scripts?fn(ve.scripts):void 0,ve.collectionId,ve.folderId))},C=P=>{v(ve=>({...ve,requests:ve.requests.filter(je=>je.id!==P)})),E===P&&(w(null),T(""))},G=P=>{const ve=m.folders.find(je=>je.id===P);v(je=>v0(je,P)),b===P&&f?.(ve?.parentFolderId||"")},pe=P=>{const ve=S0(m,P);v(ve),x===P&&(u?.(ve.collections[0]?.id||""),f?.(""),w(null),T(""))},de=N==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900",be=N==="dark"?"text-gray-400":"text-gray-500",Ee=N==="dark"?"bg-blue-500/10 text-blue-300":"bg-blue-500/10 text-blue-700",ce=P=>s.jsxs("div",{className:`group flex items-center gap-1 rounded-md ${E===P.id?"bg-blue-500/10":""}`,children:[s.jsxs("button",{type:"button",className:"min-w-0 flex-1 rounded-md px-2 py-2 text-left text-sm hover:bg-blue-500/10","aria-label":`Load saved request ${P.name}`,onClick:()=>ge(P.id),children:[s.jsx("span",{className:"mr-2 font-mono text-xs font-semibold text-blue-600",children:P.request.method.toUpperCase()}),s.jsx("span",{className:"truncate",children:P.name})]}),s.jsx("button",{type:"button",className:"rounded-md p-2 opacity-70 hover:opacity-100","aria-label":`Delete saved request ${P.name}`,onClick:()=>C(P.id),children:s.jsx(dn,{className:"h-4 w-4"})})]},P.id),Ce=(P,ve,je=new Set)=>{if(je.has(P.id))return null;const ke=new Set(je);ke.add(P.id);const Pe=Ae(P.id),at=Y.filter(yt=>yt.parentFolderId===P.id);return s.jsxs(gs.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{type:"button","aria-label":`Select folder ${Pe}`,className:`min-w-0 flex-1 rounded-md py-2 pr-2 text-left text-sm ${b===P.id?"bg-blue-500/10":""}`,style:{paddingLeft:`${8+ve*16}px`},onClick:()=>f?.(P.id),children:P.name}),s.jsx("button",{type:"button",disabled:Xr(m,P.collectionId,P.id).length===0,"aria-label":`Run folder ${Pe}`,className:"rounded-md p-2 opacity-70 hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-30",onClick:()=>g?.(P.collectionId,P.id),children:s.jsx(Pa,{className:"h-4 w-4"})}),s.jsx("button",{type:"button","aria-label":`Delete folder ${Pe}`,className:"rounded-md p-2 opacity-70 hover:opacity-100",onClick:()=>G(P.id),children:s.jsx(dn,{className:"h-4 w-4"})})]}),at.map(yt=>Ce(yt,ve+1,ke))]},P.id)},Le=(P,ve,je=new Set)=>{if(je.has(P.id))return null;const ke=new Set(je);ke.add(P.id);const Pe=$.filter(yt=>yt.folderId===P.id),at=Y.filter(yt=>yt.parentFolderId===P.id);return Pe.length===0&&at.length===0?null:s.jsxs("div",{className:"space-y-1",children:[Pe.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:`mb-1 text-xs font-semibold uppercase tracking-wide ${be}`,style:{paddingLeft:`${8+ve*12}px`},children:P.name}),s.jsx("div",{style:{paddingLeft:`${ve*12}px`},children:Pe.map(ce)})]}),at.map(yt=>Le(yt,ve+1,ke))]},P.id)},Be=Y.filter(P=>!P.parentFolderId),rt=b?Ae(b):"";return s.jsxs("section",{className:"space-y-4","aria-labelledby":"api-client-collections-heading",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ug,{className:"h-4 w-4"}),s.jsx("h3",{id:"api-client-collections-heading",className:"font-semibold",children:"Collections"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{"aria-label":"New collection name",className:`min-w-0 flex-1 rounded-md border px-2 py-2 text-sm ${de}`,value:_,onChange:P=>R(P.target.value),placeholder:"New collection"}),s.jsx("button",{type:"button","aria-label":"Add collection",className:"rounded-md border px-3 py-2",onClick:se,children:s.jsx(Ra,{className:"h-4 w-4"})})]}),s.jsx("div",{className:"space-y-2",children:m.collections.map(P=>s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{type:"button",className:`min-w-0 flex-1 rounded-md px-2 py-2 text-left text-sm font-medium ${P.id===U?.id?Ee:""}`,onClick:()=>{u?.(P.id),f?.(""),w(null),T("")},children:P.name}),s.jsx("button",{type:"button",disabled:Xr(m,P.id).length===0,"aria-label":`Run collection ${P.name}`,className:"rounded-md p-2 opacity-70 hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-30",onClick:()=>p?.(P.id),children:s.jsx(Pa,{className:"h-4 w-4"})}),m.collections.length>1&&s.jsx("button",{type:"button","aria-label":`Delete collection ${P.name}`,className:"rounded-md p-2 opacity-70 hover:opacity-100",onClick:()=>pe(P.id),children:s.jsx(dn,{className:"h-4 w-4"})})]},P.id))}),U&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-2 border-t pt-3",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide",children:"Collection authorization"}),s.jsx(yf,{auth:U.auth,label:"Collection",hostExecution:S,onChange:he,theme:N}),s.jsx("p",{className:`text-xs ${be}`,children:"Requests set to inherit use the nearest folder override, then this collection authorization."})]}),s.jsxs("div",{className:"space-y-2 border-t pt-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:"Collection variables"}),s.jsxs("button",{type:"button","aria-label":"Add collection variable",className:"inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs",onClick:Ne,children:[s.jsx(Ra,{className:"h-3.5 w-3.5"})," Add"]})]}),s.jsxs("div",{className:"space-y-2",children:[U.variables.map((P,ve)=>s.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-1",children:[s.jsx("input",{"aria-label":`Collection variable ${ve+1} enabled`,type:"checkbox",checked:P.enabled!==!1,onChange:je=>O(P.id,{enabled:je.target.checked})}),s.jsx("input",{"aria-label":`Collection variable ${ve+1} key`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${de}`,placeholder:"baseUrl",value:P.key,onChange:je=>O(P.id,{key:je.target.value})}),s.jsx("input",{"aria-label":`Collection variable ${ve+1} value`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${de}`,placeholder:"https://api.example.com",value:P.value,onChange:je=>O(P.id,{value:je.target.value})}),s.jsx("button",{type:"button","aria-label":`Remove collection variable ${ve+1}`,className:"rounded-md p-1.5 opacity-70 hover:opacity-100",onClick:()=>ee(P.id),children:s.jsx(dn,{className:"h-3.5 w-3.5"})})]},P.id)),U.variables.length===0&&s.jsxs("p",{className:`text-xs ${be}`,children:["Collection variables provide reusable defaults such as ",s.jsx("code",{children:"{{baseUrl}}"}),". Active environment values override matching collection keys."]})]})]}),s.jsxs("div",{className:"space-y-1 border-t pt-3",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{"aria-label":"New folder name",className:`min-w-0 flex-1 rounded-md border px-2 py-2 text-sm ${de}`,value:z,onChange:P=>M(P.target.value),placeholder:"Folder"}),s.jsx("button",{type:"button","aria-label":"Add folder",className:"rounded-md border px-3 py-2",onClick:oe,children:s.jsx(og,{className:"h-4 w-4"})})]}),s.jsx("p",{className:`text-xs ${be}`,children:rt?`New folders are created inside ${rt}.`:"New folders are created at the collection root."})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("button",{type:"button","aria-label":"Select collection root",className:`w-full rounded-md px-2 py-2 text-left text-sm ${b===""?"bg-blue-500/10":""}`,onClick:()=>f?.(""),children:"Unfiled / collection root"}),Be.map(P=>Ce(P,0))]}),q&&s.jsxs("div",{className:"space-y-2 border-t pt-3",children:[s.jsxs("div",{className:"text-xs font-semibold uppercase tracking-wide",children:["Folder authorization — ",rt]}),s.jsx(yf,{auth:q.auth,label:"Folder",allowInherit:!0,hostExecution:S,onChange:xe,theme:N})]}),s.jsxs("div",{className:"space-y-2 border-t pt-3",children:[s.jsx("input",{"aria-label":"Saved request name",className:`w-full rounded-md border px-2 py-2 text-sm ${de}`,value:B,onChange:P=>T(P.target.value),placeholder:"Request name"}),s.jsxs("select",{"aria-label":"Saved request folder",className:`w-full rounded-md border px-2 py-2 text-sm ${de}`,value:b,onChange:P=>f?.(P.target.value),children:[s.jsx("option",{value:"",children:"Unfiled"}),Se.map(({folder:P,depth:ve})=>s.jsx("option",{value:P.id,children:`${"— ".repeat(ve)}${P.name}`},P.id))]}),s.jsxs("button",{type:"button",className:"inline-flex w-full items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm font-medium",onClick:K,children:[s.jsx(hg,{className:"h-4 w-4"})," ",E?"Update request":"Save request"]})]}),s.jsxs("div",{className:"space-y-3 border-t pt-3",children:[$.filter(P=>!P.folderId).map(ce),Be.map(P=>Le(P,0)),$.length===0&&s.jsx("p",{className:`px-2 text-xs ${be}`,children:"Save the current request to build a reusable collection."})]})]})]})};function Xl(){return new Date().toISOString()}const Sx=({workspace:a,onWorkspaceChange:r,theme:o})=>{const[u,f]=W.useState(""),p=a.environments.find(_=>_.id===a.activeEnvironmentId),g=o==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900",x=o==="dark"?"text-gray-400":"text-gray-500",b=()=>{const _=u.trim();if(!_)return;const R=Xl(),z=Lt("environment");r(M=>({...M,environments:[...M.environments,{id:z,name:_,variables:[],createdAt:R,updatedAt:R}],activeEnvironmentId:z})),f("")},m=_=>{if(!p)return;const R=Xl();r(z=>({...z,environments:z.environments.map(M=>M.id===p.id?{...M,name:_,updatedAt:R}:M)}))},v=()=>{if(!p)return;const _=Xl();r(R=>({...R,environments:R.environments.map(z=>z.id===p.id?{...z,variables:[...z.variables,{id:Lt("variable"),key:"",value:"",enabled:!0}],updatedAt:_}:z)}))},S=(_,R)=>{if(!p)return;const z=Xl();r(M=>({...M,environments:M.environments.map(B=>B.id===p.id?{...B,variables:B.variables.map(T=>T.id===_?{...T,...R}:T),updatedAt:z}:B)}))},N=_=>{if(!p)return;const R=Xl();r(z=>({...z,environments:z.environments.map(M=>M.id===p.id?{...M,variables:M.variables.filter(B=>B.id!==_),updatedAt:R}:M)}))};return s.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-environment-heading",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("h3",{id:"api-client-environment-heading",className:"font-semibold",children:"Environment"}),p&&s.jsx("button",{type:"button","aria-label":`Delete environment ${p.name}`,className:"rounded-md p-2 opacity-70 hover:opacity-100",onClick:()=>r(_=>b0(_,p.id)),children:s.jsx(dn,{className:"h-4 w-4"})})]}),s.jsxs("select",{"aria-label":"Active environment",className:`w-full rounded-md border px-2 py-2 text-sm ${g}`,value:a.activeEnvironmentId||"",onChange:_=>r(R=>({...R,activeEnvironmentId:_.target.value||void 0})),children:[s.jsx("option",{value:"",children:"No environment"}),a.environments.map(_=>s.jsx("option",{value:_.id,children:_.name},_.id))]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{"aria-label":"New environment name",className:`min-w-0 flex-1 rounded-md border px-2 py-2 text-sm ${g}`,value:u,onChange:_=>f(_.target.value),placeholder:"New environment"}),s.jsx("button",{type:"button","aria-label":"Add environment",className:"rounded-md border px-3 py-2",onClick:b,children:s.jsx(Ra,{className:"h-4 w-4"})})]}),p&&s.jsxs("div",{className:"space-y-3",children:[s.jsx("input",{"aria-label":"Environment name",className:`w-full rounded-md border px-2 py-2 text-sm font-medium ${g}`,value:p.name,onChange:_=>m(_.target.value)}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:"Variables"}),s.jsxs("button",{type:"button","aria-label":"Add environment variable",className:"inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs",onClick:v,children:[s.jsx(Ra,{className:"h-3.5 w-3.5"})," Add"]})]}),s.jsxs("div",{className:"space-y-2",children:[p.variables.map((_,R)=>s.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-1",children:[s.jsx("input",{"aria-label":`Environment variable ${R+1} enabled`,type:"checkbox",checked:_.enabled!==!1,onChange:z=>S(_.id,{enabled:z.target.checked})}),s.jsx("input",{"aria-label":`Environment variable ${R+1} key`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${g}`,placeholder:"baseUrl",value:_.key,onChange:z=>S(_.id,{key:z.target.value})}),s.jsx("input",{"aria-label":`Environment variable ${R+1} value`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${g}`,placeholder:"https://api.example.com",value:_.value,onChange:z=>S(_.id,{value:z.target.value})}),s.jsx("button",{type:"button","aria-label":`Remove environment variable ${R+1}`,className:"rounded-md p-1.5 opacity-70 hover:opacity-100",onClick:()=>N(_.id),children:s.jsx(dn,{className:"h-3.5 w-3.5"})})]},_.id)),p.variables.length===0&&s.jsxs("p",{className:`text-xs ${x}`,children:["Add variables such as ",s.jsx("code",{children:"{{baseUrl}}"})," or ",s.jsx("code",{children:"{{token}}"}),"."]})]})]})]})};function jx(a){const r=new Date(a);return Number.isNaN(r.getTime())?a:r.toLocaleString()}const Ax=({workspace:a,onWorkspaceChange:r,onLoadRequest:o,onViewAll:u,theme:f})=>{const p=f==="dark"?"text-gray-400":"text-gray-500",g=b=>{const m=a.history.find(v=>v.id===b);m&&o(Nn(m.request),m.scripts?fn(m.scripts):void 0,m.collectionId,m.folderId)},x=b=>{r(m=>({...m,history:m.history.filter(v=>v.id!==b)}))};return s.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-history-heading",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xs,{className:"h-4 w-4"}),s.jsx("h3",{id:"api-client-history-heading",className:"font-semibold",children:"Recent history"})]}),a.history.length>0&&u&&s.jsx("button",{type:"button",className:`text-xs underline underline-offset-2 ${p}`,onClick:u,children:"View all"})]}),s.jsxs("div",{className:"space-y-1",children:[a.history.slice(0,5).map(b=>{const m=b.status!==void 0?`${b.status}${b.statusText?` ${b.statusText}`:""}`:b.error?"Error":"Sent",v=b.responseTime!==void 0?` · ${b.responseTime} ms`:"",S=b.scriptTests?.filter(_=>_.passed).length||0,N=b.scriptTests?.length?`${S}/${b.scriptTests.length} tests passed`:b.scriptError?"Script error":void 0;return s.jsxs("div",{className:"group flex items-start gap-1 rounded-md",children:[s.jsxs("button",{type:"button",className:"min-w-0 flex-1 rounded-md px-2 py-2 text-left hover:bg-blue-500/10","aria-label":`Load history request ${b.executedMethod.toUpperCase()} ${b.resolvedUrl}`,onClick:()=>g(b.id),children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsx("span",{className:"font-mono font-semibold text-blue-600",children:b.executedMethod.toUpperCase()}),s.jsxs("span",{className:b.error?"text-red-600":p,children:[m,v]})]}),s.jsx("div",{className:"truncate font-mono text-xs",title:b.resolvedUrl,children:b.resolvedUrl}),N&&s.jsx("div",{className:`mt-1 text-[11px] ${b.scriptError?"text-red-600":p}`,children:N}),s.jsx("div",{className:`mt-1 text-[11px] ${p}`,children:jx(b.createdAt)})]}),s.jsx("button",{type:"button",className:"rounded-md p-2 opacity-70 hover:opacity-100","aria-label":`Delete history request ${b.executedMethod.toUpperCase()} ${b.resolvedUrl}`,onClick:()=>x(b.id),children:s.jsx(dn,{className:"h-4 w-4"})})]},b.id)}),a.history.length===0&&s.jsx("p",{className:`px-2 text-xs ${p}`,children:"Sent requests appear here for quick replay."})]}),a.history.length>0&&u&&s.jsxs("button",{type:"button",className:"w-full rounded-md border px-3 py-2 text-xs font-medium hover:bg-blue-500/10",onClick:u,children:["Open full history · ",a.history.length]})]})};function Nx(a){return!!a.error||!!a.scriptError||a.status!==void 0&&a.status>=400||!!a.scriptTests?.some(r=>!r.passed)}function wx(a,r){const o=r.query.trim().toLowerCase();return a.history.filter(u=>{const f=u.collectionId?a.collections.find(v=>v.id===u.collectionId)?.name||"Deleted collection":"",p=u.folderId?a.folders.find(v=>v.id===u.folderId)?.name||"Deleted folder":"",g=!o||[u.executedMethod,u.resolvedUrl,u.status,u.statusText,f,p,u.runName].filter(v=>v!==void 0).some(v=>String(v).toLowerCase().includes(o)),x=r.method==="all"||u.executedMethod.toUpperCase()===r.method,b=Nx(u),m=r.outcome==="all"||r.outcome==="success"&&!b||r.outcome==="failed"&&b||r.outcome==="tests"&&!!u.scriptTests?.length;return g&&x&&m})}function Tx(a){const r=new Set,o=[];for(const u of a){if(!u.runId){o.push({kind:"entry",entry:u});continue}if(r.has(u.runId))continue;r.add(u.runId);const f=a.filter(g=>g.runId===u.runId).sort((g,x)=>(g.runIndex||Number.MAX_SAFE_INTEGER)-(x.runIndex||Number.MAX_SAFE_INTEGER)),p=Math.max(f.length,...f.map(g=>g.runTotal||0));o.push({kind:"run",group:{runId:u.runId,runName:u.runName||"Collection run",entries:f,total:p,captured:f.length,passed:f.filter(g=>g.runPassed===!0).length,failed:f.filter(g=>g.runPassed===!1).length,cancelled:0}})}return o}function _f(a){const r=new Date(a);return Number.isNaN(r.getTime())?a:r.toLocaleString()}function uo(a){return!!a.error||!!a.scriptError||a.status!==void 0&&a.status>=400||!!a.scriptTests?.some(r=>!r.passed)}function fo(a){return a.error?"Request failed":a.status!==void 0?`${a.status}${a.statusText?` ${a.statusText}`:""}`:"Sent"}function Ex(a){return(a||[]).filter(r=>r.enabled!==!1&&(r.key.trim()||r.value.trim()))}function Of({title:a,values:r,mutedClass:o}){const u=Ex(r);return u.length===0?null:s.jsxs("section",{className:"space-y-2",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:a}),s.jsx("div",{className:"overflow-hidden rounded-md border",children:u.map((f,p)=>s.jsxs("div",{className:"grid grid-cols-[minmax(8rem,0.35fr)_minmax(0,1fr)] gap-3 border-b px-3 py-2 text-xs last:border-b-0",children:[s.jsx("span",{className:"break-all font-mono font-medium",children:f.key||"—"}),s.jsx("span",{className:`break-all font-mono ${o}`,children:f.value})]},`${f.key}:${p}`))})]})}function Rf(a){const r=[`${a.passed} runner passed`,`${a.failed} runner failed`];return a.cancelled&&r.push(`${a.cancelled} cancelled`),r.join(" · ")}const Cx=({workspace:a,onWorkspaceChange:r,onLoadRequest:o,onBack:u,theme:f,initialEntryId:p,initialRunId:g})=>{const[x,b]=W.useState(""),[m,v]=W.useState("all"),[S,N]=W.useState("all"),[_,R]=W.useState(g?void 0:p||a.history[0]?.id),[z,M]=W.useState(g),B=f==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",T=f==="dark"?"border-gray-700 bg-gray-800/60 text-gray-100":"border-gray-200 bg-gray-50 text-gray-900",E=f==="dark"?"text-gray-400":"text-gray-500",w=f==="dark"?"border-gray-700 bg-gray-950 text-gray-100":"border-gray-200 bg-white text-gray-900",U=W.useMemo(()=>wx(a,{query:x,method:m,outcome:S}),[m,S,x,a]),Y=W.useMemo(()=>Tx(U),[U]),$=z&&Y.find(K=>K.kind==="run"&&K.group.runId===z)?.kind==="run"?Y.find(K=>K.kind==="run"&&K.group.runId===z).group:void 0,q=$?void 0:U.find(K=>K.id===_)||U[0],J=q?.collectionId?a.collections.find(K=>K.id===q.collectionId):void 0,Se=q?.folderId?a.folders.find(K=>K.id===q.folderId):void 0,Ae=()=>{R(void 0),M(void 0)},se=K=>{R(K),M(void 0)},he=K=>{M(K),R(void 0)},xe=K=>{o(Nn(K.request),K.scripts?fn(K.scripts):void 0,K.collectionId,K.folderId),u()},Ne=K=>{r(ge=>({...ge,history:ge.history.filter(C=>C.id!==K)})),_===K&&R(void 0)},O=()=>{r(K=>({...K,history:[]})),Ae()},ee=q?.responseHeaders||[],oe=q?.scriptTests?.filter(K=>K.passed).length||0;return s.jsx("section",{className:`rounded-xl border p-4 md:p-5 ${T}`,"aria-labelledby":"api-client-history-page-heading",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("header",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:u,children:[s.jsx(Bu,{className:"h-4 w-4"})," Client"]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xs,{className:"h-5 w-5"}),s.jsx("h2",{id:"api-client-history-page-heading",className:"text-lg font-semibold",children:"Request history"})]}),s.jsxs("p",{className:`text-xs ${E}`,children:[a.history.length," persisted request",a.history.length===1?"":"s"," · newest first"]})]})]}),a.history.length>0&&s.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 self-start rounded-md border px-3 py-2 text-sm text-red-600",onClick:O,children:[s.jsx(dn,{className:"h-4 w-4"})," Clear history"]})]}),s.jsxs("div",{className:"grid gap-2 md:grid-cols-[minmax(0,1fr)_10rem_12rem]",children:[s.jsxs("label",{className:"relative",children:[s.jsx("span",{className:"sr-only",children:"Search history"}),s.jsx(Fu,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 ${E}`}),s.jsx("input",{"aria-label":"Search history",className:`w-full rounded-md border py-2 pl-9 pr-3 text-sm ${B}`,value:x,onChange:K=>{b(K.target.value),Ae()},placeholder:"Search URL, status, collection or run…"})]}),s.jsxs("select",{"aria-label":"History method filter",className:`rounded-md border px-3 py-2 text-sm ${B}`,value:m,onChange:K=>{v(K.target.value),Ae()},children:[s.jsx("option",{value:"all",children:"All methods"}),["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map(K=>s.jsx("option",{value:K,children:K},K))]}),s.jsxs("select",{"aria-label":"History outcome filter",className:`rounded-md border px-3 py-2 text-sm ${B}`,value:S,onChange:K=>{N(K.target.value),Ae()},children:[s.jsx("option",{value:"all",children:"All outcomes"}),s.jsx("option",{value:"success",children:"Successful HTTP"}),s.jsx("option",{value:"failed",children:"HTTP / script failures"}),s.jsx("option",{value:"tests",children:"With tests"})]})]}),s.jsxs("div",{className:"grid min-h-[32rem] gap-4 lg:grid-cols-[minmax(18rem,0.85fr)_minmax(0,1.35fr)]",children:[s.jsxs("div",{className:"max-h-[48rem] space-y-2 overflow-auto rounded-lg border p-2",children:[Y.map(K=>{if(K.kind==="entry"){const G=K.entry,pe=q?.id===G.id,de=uo(G),be=G.collectionId?a.collections.find(Ee=>Ee.id===G.collectionId)?.name||"Deleted collection":void 0;return s.jsxs("button",{type:"button",className:`w-full rounded-md border px-3 py-3 text-left transition ${pe?"border-blue-500 bg-blue-500/10":"border-transparent hover:bg-blue-500/5"}`,onClick:()=>se(G.id),children:[s.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[s.jsx("span",{className:"font-mono font-semibold text-blue-600",children:G.executedMethod.toUpperCase()}),s.jsxs("span",{className:de?"text-red-600":E,children:[fo(G),G.responseTime!==void 0?` · ${G.responseTime} ms`:""]})]}),s.jsx("div",{className:"mt-1 truncate font-mono text-xs",title:G.resolvedUrl,children:G.resolvedUrl}),s.jsxs("div",{className:`mt-1 flex items-center justify-between gap-2 text-[11px] ${E}`,children:[s.jsx("span",{className:"truncate",children:be||"Unsaved request"}),s.jsx("span",{children:_f(G.createdAt)})]})]},G.id)}const ge=K.group,C=$?.runId===ge.runId;return s.jsxs("div",{className:`rounded-lg border ${C?"border-blue-500 bg-blue-500/5":""}`,children:[s.jsxs("button",{type:"button","aria-label":`Open collection run ${ge.runName}`,className:"w-full px-3 py-3 text-left",onClick:()=>he(ge.runId),children:[s.jsx("div",{className:"text-xs font-semibold text-blue-600",children:"Collection run"}),s.jsx("div",{className:"mt-1 truncate text-sm font-medium",children:ge.runName}),s.jsxs("div",{className:`mt-1 text-[11px] ${E}`,children:[ge.captured,"/",ge.total," history entries · ",Rf(ge)]})]}),s.jsx("div",{className:"border-t px-2 py-1",children:ge.entries.map(G=>s.jsxs("button",{type:"button",className:`w-full rounded-md px-2 py-2 text-left text-xs hover:bg-blue-500/10 ${q?.id===G.id?"bg-blue-500/10":""}`,onClick:()=>se(G.id),children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("span",{children:[s.jsx("span",{className:"mr-2 text-[10px] text-gray-500",children:G.runIndex||"–"}),s.jsx("span",{className:"font-mono font-semibold text-blue-600",children:G.executedMethod.toUpperCase()})]}),s.jsx("span",{className:uo(G)?"text-red-600":E,children:fo(G)})]}),s.jsx("div",{className:"mt-1 truncate font-mono",title:G.resolvedUrl,children:G.resolvedUrl})]},G.id))})]},ge.runId)}),U.length===0&&s.jsx("div",{className:`px-3 py-8 text-center text-sm ${E}`,children:a.history.length===0?"Send a request to start building history.":"No history entries match these filters."})]}),s.jsxs("div",{className:"min-w-0 rounded-lg border p-4",children:[$&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"border-b pb-4",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-blue-600",children:"Collection run"}),s.jsx("h3",{className:"mt-1 text-lg font-semibold",children:$.runName}),s.jsxs("p",{className:`mt-1 text-sm ${E}`,children:[$.captured," / ",$.total," history entries captured · ",Rf($)]}),s.jsx("p",{className:`mt-2 text-xs ${E}`,children:"Runner pass/fail is based on transport, scripts, and tests. An HTTP 4xx/5xx can therefore be a runner pass while still appearing as an HTTP failure in the request inspector."})]}),s.jsx("div",{className:"space-y-2",children:$.entries.map(K=>s.jsxs("button",{type:"button","aria-label":`Inspect history ${K.runIndex||""}`,className:"w-full rounded-md border px-3 py-3 text-left hover:bg-blue-500/5",onClick:()=>se(K.id),children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[s.jsxs("span",{children:[s.jsx("span",{className:`mr-2 text-xs ${E}`,children:K.runIndex||"–"}),s.jsx("span",{className:"font-mono font-bold text-blue-600",children:K.executedMethod.toUpperCase()})]}),s.jsxs("span",{className:K.runPassed===!1?"text-red-600":K.runPassed===!0?"text-green-600":E,children:[K.runPassed===!0?"Runner pass":K.runPassed===!1?"Runner fail":"Recorded",K.status!==void 0?` · HTTP ${K.status}`:""]})]}),s.jsx("div",{className:"mt-1 truncate font-mono text-xs",children:K.resolvedUrl})]},K.id))})]}),!$&&!q&&s.jsx("div",{className:`flex min-h-[20rem] items-center justify-center text-sm ${E}`,children:"Select a history entry or collection run to inspect it."}),q&&s.jsxs("div",{className:"space-y-5",children:[s.jsxs("div",{className:"space-y-2 border-b pb-4",children:[s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[s.jsx("span",{className:"font-mono font-bold text-blue-600",children:q.executedMethod.toUpperCase()}),s.jsx("span",{className:uo(q)?"text-red-600":E,children:fo(q)}),q.responseTime!==void 0&&s.jsxs("span",{className:E,children:[q.responseTime," ms"]}),q.runPassed!==void 0&&s.jsx("span",{className:q.runPassed?"text-green-600":"text-red-600",children:q.runPassed?"Runner pass":"Runner fail"})]}),s.jsx("div",{className:"mt-1 break-all font-mono text-sm",children:q.resolvedUrl}),s.jsxs("div",{className:`mt-1 text-xs ${E}`,children:[_f(q.createdAt),q.collectionId?` · ${J?.name||"Deleted collection"}`:"",q.folderId?` / ${Se?.name||"Deleted folder"}`:"",q.runName?` · Run: ${q.runName}`:""]})]}),s.jsxs("div",{className:"flex shrink-0 gap-2",children:[s.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium hover:bg-blue-500/10",onClick:()=>xe(q),children:[s.jsx(mg,{className:"h-4 w-4"})," Open in client"]}),s.jsx("button",{type:"button","aria-label":"Delete selected history entry",className:"inline-flex min-h-10 items-center rounded-md border px-3 py-2 text-red-600",onClick:()=>Ne(q.id),children:s.jsx(dn,{className:"h-4 w-4"})})]})]}),q.error&&s.jsx("div",{className:"rounded-md border border-red-300 bg-red-500/10 px-3 py-2 text-sm text-red-700",children:q.error})]}),s.jsxs("section",{className:"space-y-3",children:[s.jsx("h3",{className:"font-semibold",children:"Request"}),s.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx("span",{className:E,children:"Original URL"}),s.jsx("div",{className:"mt-1 break-all font-mono",children:q.request.url})]}),s.jsxs("div",{children:[s.jsx("span",{className:E,children:"Content type"}),s.jsx("div",{className:"mt-1 font-mono",children:q.request.contentType||"—"})]})]}),s.jsx(Of,{title:"Query parameters",values:q.request.query,mutedClass:E}),s.jsx(Of,{title:"Headers",values:q.request.headers,mutedClass:E}),q.request.body&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Body"}),s.jsx("pre",{className:`max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md border p-3 text-xs ${w}`,children:q.request.body})]})]}),s.jsxs("section",{className:"space-y-3 border-t pt-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("h3",{className:"font-semibold",children:"Response"}),q.responseBodyTruncated&&s.jsx("span",{className:"text-xs text-amber-600",children:"Body truncated in history"})]}),ee.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Headers"}),s.jsx("div",{className:"overflow-hidden rounded-md border",children:ee.map(([K,ge],C)=>s.jsxs("div",{className:"grid grid-cols-[minmax(8rem,0.35fr)_minmax(0,1fr)] gap-3 border-b px-3 py-2 text-xs last:border-b-0",children:[s.jsx("span",{className:"break-all font-mono font-medium",children:K}),s.jsx("span",{className:`break-all font-mono ${E}`,children:ge})]},`${K}:${C}`))})]}),q.responseBody!==void 0?s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Body"}),s.jsx("pre",{className:`max-h-96 overflow-auto whitespace-pre-wrap break-words rounded-md border p-3 text-xs ${w}`,children:q.responseBody||"(empty response body)"})]}):s.jsx("p",{className:`text-sm ${E}`,children:"Response payload was not captured for this older history entry."})]}),(q.scriptTests?.length||q.scriptError||q.scriptLogs?.length)&&s.jsxs("section",{className:"space-y-3 border-t pt-4",children:[s.jsx("h3",{className:"font-semibold",children:"Tests & console"}),q.scriptTests?.length?s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:`text-xs ${E}`,children:[oe,"/",q.scriptTests.length," tests passed"]}),q.scriptTests.map((K,ge)=>s.jsxs("div",{className:`rounded-md border px-3 py-2 text-sm ${K.passed?"":"border-red-300 bg-red-500/10 text-red-700"}`,children:[s.jsxs("span",{className:"font-medium",children:[K.passed?"✓":"✕"," ",K.name]}),K.error&&s.jsx("div",{className:"mt-1 text-xs",children:K.error})]},`${K.name}:${ge}`))]}):null,q.scriptError&&s.jsx("div",{className:"rounded-md border border-red-300 bg-red-500/10 px-3 py-2 text-sm text-red-700",children:q.scriptError}),q.scriptLogs?.length?s.jsx("pre",{className:`max-h-56 overflow-auto whitespace-pre-wrap rounded-md border p-3 text-xs ${w}`,children:q.scriptLogs.join(`
|
|
69
|
-
`)
|
|
70
|
-
|
|
71
|
-
`)
|
|
11
|
+
`+n.mark.snippet),a+" "+s):a}function e(n,r){Error.call(this),this.name="YAMLException",this.reason=n,this.mark=r,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e.prototype.toString=function(r){return this.name+": "+t(this,r)},yd=e,yd}var bd,Ag;function yA(){if(Ag)return bd;Ag=1;const t=aa();function e(s,a,c,d,f){let h="",g="";const b=Math.floor(f/2)-1;return d-a>b&&(h=" ... ",a=d-b+h.length),c-d>b&&(g=" ...",c=d+b-g.length),{str:h+s.slice(a,c).replace(/\t/g,"→")+g,pos:d-a+h.length}}function n(s,a){return t.repeat(" ",a-s.length)+s}function r(s,a){if(a=Object.create(a||null),!s.buffer)return null;a.maxLength||(a.maxLength=79),typeof a.indent!="number"&&(a.indent=1),typeof a.linesBefore!="number"&&(a.linesBefore=3),typeof a.linesAfter!="number"&&(a.linesAfter=2);const c=/\r?\n|\r|\0/g,d=[0],f=[];let h,g=-1;for(;h=c.exec(s.buffer);)f.push(h.index),d.push(h.index+h[0].length),s.position<=h.index&&g<0&&(g=d.length-2);g<0&&(g=d.length-1);let b="";const v=Math.min(s.line+a.linesAfter,f.length).toString().length,S=a.maxLength-(a.indent+v+3);for(let C=1;C<=a.linesBefore&&!(g-C<0);C++){const T=e(s.buffer,d[g-C],f[g-C],s.position-(d[g]-d[g-C]),S);b=t.repeat(" ",a.indent)+n((s.line-C+1).toString(),v)+" | "+T.str+`
|
|
12
|
+
`+b}const A=e(s.buffer,d[g],f[g],s.position,S);b+=t.repeat(" ",a.indent)+n((s.line+1).toString(),v)+" | "+A.str+`
|
|
13
|
+
`,b+=t.repeat("-",a.indent+v+3+A.pos)+`^
|
|
14
|
+
`;for(let C=1;C<=a.linesAfter&&!(g+C>=f.length);C++){const T=e(s.buffer,d[g+C],f[g+C],s.position-(d[g]-d[g+C]),S);b+=t.repeat(" ",a.indent)+n((s.line+C+1).toString(),v)+" | "+T.str+`
|
|
15
|
+
`}return b.replace(/\n$/,"")}return bd=r,bd}var xd,kg;function Nn(){if(kg)return xd;kg=1;const t=oa(),e=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],n=["scalar","sequence","mapping"];function r(a){const c={};return a!==null&&Object.keys(a).forEach(function(d){a[d].forEach(function(f){c[String(f)]=d})}),c}function s(a,c){if(c=c||{},Object.keys(c).forEach(function(d){if(e.indexOf(d)===-1)throw new t('Unknown option "'+d+'" is met in definition of "'+a+'" YAML type.')}),this.options=c,this.tag=a,this.kind=c.kind||null,this.resolve=c.resolve||function(){return!0},this.construct=c.construct||function(d){return d},this.instanceOf=c.instanceOf||null,this.predicate=c.predicate||null,this.represent=c.represent||null,this.representName=c.representName||null,this.defaultStyle=c.defaultStyle||null,this.multi=c.multi||!1,this.styleAliases=r(c.styleAliases||null),n.indexOf(this.kind)===-1)throw new t('Unknown kind "'+this.kind+'" is specified for "'+a+'" YAML type.')}return xd=s,xd}var vd,Cg;function Ng(){if(Cg)return vd;Cg=1;const t=oa(),e=Nn();function n(a,c){const d=[];return a[c].forEach(function(f){let h=d.length;d.forEach(function(g,b){g.tag===f.tag&&g.kind===f.kind&&g.multi===f.multi&&(h=b)}),d[h]=f}),d}function r(){const a={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function c(d){d.multi?(a.multi[d.kind].push(d),a.multi.fallback.push(d)):a[d.kind][d.tag]=a.fallback[d.tag]=d}for(let d=0,f=arguments.length;d<f;d+=1)arguments[d].forEach(c);return a}function s(a){return this.extend(a)}return s.prototype.extend=function(c){let d=[],f=[];if(c instanceof e)f.push(c);else if(Array.isArray(c))f=f.concat(c);else if(c&&(Array.isArray(c.implicit)||Array.isArray(c.explicit)))c.implicit&&(d=d.concat(c.implicit)),c.explicit&&(f=f.concat(c.explicit));else throw new t("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");d.forEach(function(g){if(!(g instanceof e))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(g.loadKind&&g.loadKind!=="scalar")throw new t("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(g.multi)throw new t("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),f.forEach(function(g){if(!(g instanceof e))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const h=Object.create(s.prototype);return h.implicit=(this.implicit||[]).concat(d),h.explicit=(this.explicit||[]).concat(f),h.compiledImplicit=n(h,"implicit"),h.compiledExplicit=n(h,"explicit"),h.compiledTypeMap=r(h.compiledImplicit,h.compiledExplicit),h},vd=s,vd}var wd,Tg;function jg(){if(Tg)return wd;Tg=1;const t=Nn();return wd=new t("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),wd}var Sd,Eg;function Og(){if(Eg)return Sd;Eg=1;const t=Nn();return Sd=new t("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Sd}var Ad,Mg;function Rg(){if(Mg)return Ad;Mg=1;const t=Nn();return Ad=new t("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Ad}var kd,Dg;function _g(){if(Dg)return kd;Dg=1;const t=Ng();return kd=new t({explicit:[jg(),Og(),Rg()]}),kd}var Cd,Lg;function Bg(){if(Lg)return Cd;Lg=1;const t=Nn();function e(s){if(s===null)return!0;const a=s.length;return a===1&&s==="~"||a===4&&(s==="null"||s==="Null"||s==="NULL")}function n(){return null}function r(s){return s===null}return Cd=new t("tag:yaml.org,2002:null",{kind:"scalar",resolve:e,construct:n,predicate:r,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Cd}var Nd,$g;function qg(){if($g)return Nd;$g=1;const t=Nn();function e(s){if(s===null)return!1;const a=s.length;return a===4&&(s==="true"||s==="True"||s==="TRUE")||a===5&&(s==="false"||s==="False"||s==="FALSE")}function n(s){return s==="true"||s==="True"||s==="TRUE"}function r(s){return Object.prototype.toString.call(s)==="[object Boolean]"}return Nd=new t("tag:yaml.org,2002:bool",{kind:"scalar",resolve:e,construct:n,predicate:r,represent:{lowercase:function(s){return s?"true":"false"},uppercase:function(s){return s?"TRUE":"FALSE"},camelcase:function(s){return s?"True":"False"}},defaultStyle:"lowercase"}),Nd}var Td,zg;function Hg(){if(zg)return Td;zg=1;const t=aa(),e=Nn();function n(h){return h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102}function r(h){return h>=48&&h<=55}function s(h){return h>=48&&h<=57}function a(h){if(h===null)return!1;const g=h.length;let b=0,v=!1;if(!g)return!1;let S=h[b];if((S==="-"||S==="+")&&(S=h[++b]),S==="0"){if(b+1===g)return!0;if(S=h[++b],S==="b"){for(b++;b<g;b++){if(S=h[b],S!=="0"&&S!=="1")return!1;v=!0}return v&&isFinite(c(h))}if(S==="x"){for(b++;b<g;b++){if(!n(h.charCodeAt(b)))return!1;v=!0}return v&&isFinite(c(h))}if(S==="o"){for(b++;b<g;b++){if(!r(h.charCodeAt(b)))return!1;v=!0}return v&&isFinite(c(h))}}for(;b<g;b++){if(!s(h.charCodeAt(b)))return!1;v=!0}return v?isFinite(c(h)):!1}function c(h){let g=h,b=1,v=g[0];if((v==="-"||v==="+")&&(v==="-"&&(b=-1),g=g.slice(1),v=g[0]),g==="0")return 0;if(v==="0"){if(g[1]==="b")return b*parseInt(g.slice(2),2);if(g[1]==="x")return b*parseInt(g.slice(2),16);if(g[1]==="o")return b*parseInt(g.slice(2),8)}return b*parseInt(g,10)}function d(h){return c(h)}function f(h){return Object.prototype.toString.call(h)==="[object Number]"&&h%1===0&&!t.isNegativeZero(h)}return Td=new e("tag:yaml.org,2002:int",{kind:"scalar",resolve:a,construct:d,predicate:f,represent:{binary:function(h){return h>=0?"0b"+h.toString(2):"-0b"+h.toString(2).slice(1)},octal:function(h){return h>=0?"0o"+h.toString(8):"-0o"+h.toString(8).slice(1)},decimal:function(h){return h.toString(10)},hexadecimal:function(h){return h>=0?"0x"+h.toString(16).toUpperCase():"-0x"+h.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Td}var jd,Ig;function Ug(){if(Ig)return jd;Ig=1;const t=aa(),e=Nn(),n=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),r=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function s(h){return h===null||!n.test(h)?!1:isFinite(parseFloat(h,10))?!0:r.test(h)}function a(h){let g=h.toLowerCase();const b=g[0]==="-"?-1:1;return"+-".indexOf(g[0])>=0&&(g=g.slice(1)),g===".inf"?b===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:g===".nan"?NaN:b*parseFloat(g,10)}const c=/^[-+]?[0-9]+e/;function d(h,g){if(isNaN(h))switch(g){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===h)switch(g){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===h)switch(g){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(t.isNegativeZero(h))return"-0.0";const b=h.toString(10);return c.test(b)?b.replace("e",".e"):b}function f(h){return Object.prototype.toString.call(h)==="[object Number]"&&(h%1!==0||t.isNegativeZero(h))}return jd=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:s,construct:a,predicate:f,represent:d,defaultStyle:"lowercase"}),jd}var Ed,Fg;function Vg(){return Fg||(Fg=1,Ed=_g().extend({implicit:[Bg(),qg(),Hg(),Ug()]})),Ed}var Od,Pg;function Kg(){return Pg||(Pg=1,Od=Vg()),Od}var Md,Yg;function Gg(){if(Yg)return Md;Yg=1;const t=Nn(),e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),n=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function r(c){return c===null?!1:e.exec(c)!==null||n.exec(c)!==null}function s(c){let d=0,f=null,h=e.exec(c);if(h===null&&(h=n.exec(c)),h===null)throw new Error("Date resolve error");const g=+h[1],b=+h[2]-1,v=+h[3];if(!h[4])return new Date(Date.UTC(g,b,v));const S=+h[4],A=+h[5],C=+h[6];if(h[7]){for(d=h[7].slice(0,3);d.length<3;)d+="0";d=+d}if(h[9]){const D=+h[10],j=+(h[11]||0);f=(D*60+j)*6e4,h[9]==="-"&&(f=-f)}const T=new Date(Date.UTC(g,b,v,S,A,C,d));return f&&T.setTime(T.getTime()-f),T}function a(c){return c.toISOString()}return Md=new t("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r,construct:s,instanceOf:Date,represent:a}),Md}var Rd,Xg;function Jg(){if(Xg)return Rd;Xg=1;const t=Nn();function e(n){return n==="<<"||n===null}return Rd=new t("tag:yaml.org,2002:merge",{kind:"scalar",resolve:e}),Rd}var Dd,Qg;function Wg(){if(Qg)return Dd;Qg=1;const t=Nn(),e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
16
|
+
\r`;function n(c){if(c===null)return!1;let d=0;const f=c.length,h=e;for(let g=0;g<f;g++){const b=h.indexOf(c.charAt(g));if(!(b>64)){if(b<0)return!1;d+=6}}return d%8===0}function r(c){const d=c.replace(/[\r\n=]/g,""),f=d.length,h=e;let g=0;const b=[];for(let S=0;S<f;S++)S%4===0&&S&&(b.push(g>>16&255),b.push(g>>8&255),b.push(g&255)),g=g<<6|h.indexOf(d.charAt(S));const v=f%4*6;return v===0?(b.push(g>>16&255),b.push(g>>8&255),b.push(g&255)):v===18?(b.push(g>>10&255),b.push(g>>2&255)):v===12&&b.push(g>>4&255),new Uint8Array(b)}function s(c){let d="",f=0;const h=c.length,g=e;for(let v=0;v<h;v++)v%3===0&&v&&(d+=g[f>>18&63],d+=g[f>>12&63],d+=g[f>>6&63],d+=g[f&63]),f=(f<<8)+c[v];const b=h%3;return b===0?(d+=g[f>>18&63],d+=g[f>>12&63],d+=g[f>>6&63],d+=g[f&63]):b===2?(d+=g[f>>10&63],d+=g[f>>4&63],d+=g[f<<2&63],d+=g[64]):b===1&&(d+=g[f>>2&63],d+=g[f<<4&63],d+=g[64],d+=g[64]),d}function a(c){return Object.prototype.toString.call(c)==="[object Uint8Array]"}return Dd=new t("tag:yaml.org,2002:binary",{kind:"scalar",resolve:n,construct:r,predicate:a,represent:s}),Dd}var _d,Zg;function e0(){if(Zg)return _d;Zg=1;const t=Nn(),e=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function r(a){if(a===null)return!0;const c={},d=a;for(let f=0,h=d.length;f<h;f+=1){const g=d[f];let b=!1;if(n.call(g)!=="[object Object]")return!1;let v;for(v in g)if(e.call(g,v))if(!b)b=!0;else return!1;if(!b||e.call(c,v))return!1;Object.defineProperty(c,v,{value:!0})}return!0}function s(a){return a!==null?a:[]}return _d=new t("tag:yaml.org,2002:omap",{kind:"sequence",resolve:r,construct:s}),_d}var Ld,t0;function n0(){if(t0)return Ld;t0=1;const t=Nn(),e=Object.prototype.toString;function n(s){if(s===null)return!0;const a=s,c=new Array(a.length);for(let d=0,f=a.length;d<f;d+=1){const h=a[d];if(e.call(h)!=="[object Object]")return!1;const g=Object.keys(h);if(g.length!==1)return!1;c[d]=[g[0],h[g[0]]]}return!0}function r(s){if(s===null)return[];const a=s,c=new Array(a.length);for(let d=0,f=a.length;d<f;d+=1){const h=a[d],g=Object.keys(h);c[d]=[g[0],h[g[0]]]}return c}return Ld=new t("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:n,construct:r}),Ld}var Bd,i0;function r0(){if(i0)return Bd;i0=1;const t=Nn(),e=Object.prototype.hasOwnProperty;function n(s){if(s===null)return!0;const a=s;for(const c in a)if(e.call(a,c)&&a[c]!==null)return!1;return!0}function r(s){return s!==null?s:{}}return Bd=new t("tag:yaml.org,2002:set",{kind:"mapping",resolve:n,construct:r}),Bd}var $d,s0;function qd(){return s0||(s0=1,$d=Kg().extend({implicit:[Gg(),Jg()],explicit:[Wg(),e0(),n0(),r0()]})),$d}var l0;function bA(){if(l0)return Mo;l0=1;const t=aa(),e=oa(),n=yA(),r=qd(),s=Object.prototype.hasOwnProperty,a=1,c=2,d=3,f=4,h=1,g=2,b=3,v=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,S=/[\x85\u2028\u2029]/,A=/[,\[\]{}]/,C=/^(?:!|!!|![0-9A-Za-z-]+!)$/,T=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function D(x){return Object.prototype.toString.call(x)}function j(x){return x===10||x===13}function E(x){return x===9||x===32}function O(x){return x===9||x===32||x===10||x===13}function R(x){return x===44||x===91||x===93||x===123||x===125}function B(x){if(x>=48&&x<=57)return x-48;const V=x|32;return V>=97&&V<=102?V-97+10:-1}function M(x){return x===120?2:x===117?4:x===85?8:0}function z(x){return x>=48&&x<=57?x-48:-1}function F(x){switch(x){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
17
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"
";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function X(x){return x<=65535?String.fromCharCode(x):String.fromCharCode((x-65536>>10)+55296,(x-65536&1023)+56320)}function W(x,V,pe){V==="__proto__"?Object.defineProperty(x,V,{configurable:!0,enumerable:!0,writable:!0,value:pe}):x[V]=pe}const G=new Array(256),we=new Array(256);for(let x=0;x<256;x++)G[x]=F(x)?1:0,we[x]=F(x);function ye(x,V){this.input=x,this.filename=V.filename||null,this.schema=V.schema||r,this.onWarning=V.onWarning||null,this.legacy=V.legacy||!1,this.json=V.json||!1,this.listener=V.listener||null,this.maxDepth=typeof V.maxDepth=="number"?V.maxDepth:100,this.maxTotalMergeKeys=typeof V.maxTotalMergeKeys=="number"?V.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=x.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function xe(x,V){const pe={name:x.filename,buffer:x.input.slice(0,-1),position:x.position,line:x.line,column:x.position-x.lineStart};return pe.snippet=n(pe),new e(V,pe)}function _(x,V){throw xe(x,V)}function ee(x,V){x.onWarning&&x.onWarning.call(null,xe(x,V))}function he(x,V,pe){const le=x.anchorMapTransactions;if(le.length!==0){const oe=le[le.length-1];s.call(oe,V)||(oe[V]={existed:s.call(x.anchorMap,V),value:x.anchorMap[V]})}x.anchorMap[V]=pe}function $(x){x.anchorMapTransactions.push(Object.create(null))}function te(x){const V=x.anchorMapTransactions.pop(),pe=x.anchorMapTransactions;if(pe.length===0)return;const le=pe[pe.length-1],oe=Object.keys(V);for(let k=0,J=oe.length;k<J;k+=1){const Z=oe[k];s.call(le,Z)||(le[Z]=V[Z])}}function L(x){const V=x.anchorMapTransactions.pop(),pe=Object.keys(V);for(let le=pe.length-1;le>=0;le-=1){const oe=V[pe[le]];oe.existed?x.anchorMap[pe[le]]=oe.value:delete x.anchorMap[pe[le]]}}function P(x){return{position:x.position,line:x.line,lineStart:x.lineStart,lineIndent:x.lineIndent,firstTabInLine:x.firstTabInLine,tag:x.tag,anchor:x.anchor,kind:x.kind,result:x.result}}function ue(x,V){x.position=V.position,x.line=V.line,x.lineStart=V.lineStart,x.lineIndent=V.lineIndent,x.firstTabInLine=V.firstTabInLine,x.tag=V.tag,x.anchor=V.anchor,x.kind=V.kind,x.result=V.result}const Se={YAML:function(V,pe,le){V.version!==null&&_(V,"duplication of %YAML directive"),le.length!==1&&_(V,"YAML directive accepts exactly one argument");const oe=/^([0-9]+)\.([0-9]+)$/.exec(le[0]);oe===null&&_(V,"ill-formed argument of the YAML directive");const k=parseInt(oe[1],10),J=parseInt(oe[2],10);k!==1&&_(V,"unacceptable YAML version of the document"),V.version=le[0],V.checkLineBreaks=J<2,J!==1&&J!==2&&ee(V,"unsupported YAML version of the document")},TAG:function(V,pe,le){let oe;le.length!==2&&_(V,"TAG directive accepts exactly two arguments");const k=le[0];oe=le[1],C.test(k)||_(V,"ill-formed tag handle (first argument) of the TAG directive"),s.call(V.tagMap,k)&&_(V,'there is a previously declared suffix for "'+k+'" tag handle'),T.test(oe)||_(V,"ill-formed tag prefix (second argument) of the TAG directive");try{oe=decodeURIComponent(oe)}catch{_(V,"tag prefix is malformed: "+oe)}V.tagMap[k]=oe}};function Ne(x,V,pe,le){if(V<pe){const oe=x.input.slice(V,pe);if(le)for(let k=0,J=oe.length;k<J;k+=1){const Z=oe.charCodeAt(k);Z===9||Z>=32&&Z<=1114111||_(x,"expected valid JSON character")}else v.test(oe)&&_(x,"the stream contains non-printable characters");x.result+=oe}}function Re(x){x.totalMergeKeys++,x.maxTotalMergeKeys!==-1&&x.totalMergeKeys>x.maxTotalMergeKeys&&_(x,"merge keys exceeded maxTotalMergeKeys ("+x.maxTotalMergeKeys+")")}function Be(x,V,pe,le){t.isObject(pe)||_(x,"cannot merge mappings; the provided source object is unacceptable"),Re(x);const oe=Object.keys(pe);for(let k=0,J=oe.length;k<J;k+=1){const Z=oe[k];Re(x),s.call(V,Z)||(W(V,Z,pe[Z]),le[Z]=!0)}}function Ze(x,V,pe,le,oe,k,J,Z,K){if(Array.isArray(oe)){oe=Array.prototype.slice.call(oe);for(let Q=0,Ae=oe.length;Q<Ae;Q+=1)Array.isArray(oe[Q])&&_(x,"nested arrays are not supported inside keys"),typeof oe=="object"&&D(oe[Q])==="[object Object]"&&(oe[Q]="[object Object]")}if(typeof oe=="object"&&D(oe)==="[object Object]"&&(oe="[object Object]"),oe=String(oe),V===null&&(V={}),le==="tag:yaml.org,2002:merge")if(Array.isArray(k)){k.length>100&&_(x,"abnormal merge sequence size");for(let Q=0,Ae=k.length;Q<Ae;Q+=1)Be(x,V,k[Q],pe)}else Be(x,V,k,pe);else!x.json&&!s.call(pe,oe)&&s.call(V,oe)&&(x.line=J||x.line,x.lineStart=Z||x.lineStart,x.position=K||x.position,_(x,"duplicated mapping key")),W(V,oe,k),delete pe[oe];return V}function _e(x){const V=x.input.charCodeAt(x.position);V===10?x.position++:V===13?(x.position++,x.input.charCodeAt(x.position)===10&&x.position++):_(x,"a line break is expected"),x.line+=1,x.lineStart=x.position,x.firstTabInLine=-1}function Ke(x,V,pe){let le=0,oe=x.input.charCodeAt(x.position);for(;oe!==0;){for(;E(oe);)oe===9&&x.firstTabInLine===-1&&(x.firstTabInLine=x.position),oe=x.input.charCodeAt(++x.position);if(V&&oe===35)do oe=x.input.charCodeAt(++x.position);while(oe!==10&&oe!==13&&oe!==0);if(j(oe))for(_e(x),oe=x.input.charCodeAt(x.position),le++,x.lineIndent=0;oe===32;)x.lineIndent++,oe=x.input.charCodeAt(++x.position);else break}return pe!==-1&&le!==0&&x.lineIndent<pe&&ee(x,"deficient indentation"),le}function gt(x){let V=x.position,pe=x.input.charCodeAt(V);return!!((pe===45||pe===46)&&pe===x.input.charCodeAt(V+1)&&pe===x.input.charCodeAt(V+2)&&(V+=3,pe=x.input.charCodeAt(V),pe===0||O(pe)))}function se(x,V){V===1?x.result+=" ":V>1&&(x.result+=t.repeat(`
|
|
18
|
+
`,V-1))}function de(x,V,pe){let le,oe,k,J,Z,K;const Q=x.kind,Ae=x.result;let fe=x.input.charCodeAt(x.position);if(O(fe)||R(fe)||fe===35||fe===38||fe===42||fe===33||fe===124||fe===62||fe===39||fe===34||fe===37||fe===64||fe===96)return!1;if(fe===63||fe===45){const ke=x.input.charCodeAt(x.position+1);if(O(ke)||pe&&R(ke))return!1}for(x.kind="scalar",x.result="",le=oe=x.position,k=!1;fe!==0;){if(fe===58){const ke=x.input.charCodeAt(x.position+1);if(O(ke)||pe&&R(ke))break}else if(fe===35){const ke=x.input.charCodeAt(x.position-1);if(O(ke))break}else{if(x.position===x.lineStart&>(x)||pe&&R(fe))break;if(j(fe))if(J=x.line,Z=x.lineStart,K=x.lineIndent,Ke(x,!1,-1),x.lineIndent>=V){k=!0,fe=x.input.charCodeAt(x.position);continue}else{x.position=oe,x.line=J,x.lineStart=Z,x.lineIndent=K;break}}k&&(Ne(x,le,oe,!1),se(x,x.line-J),le=oe=x.position,k=!1),E(fe)||(oe=x.position+1),fe=x.input.charCodeAt(++x.position)}return Ne(x,le,oe,!1),x.result?!0:(x.kind=Q,x.result=Ae,!1)}function ge(x,V){let pe,le,oe=x.input.charCodeAt(x.position);if(oe!==39)return!1;for(x.kind="scalar",x.result="",x.position++,pe=le=x.position;(oe=x.input.charCodeAt(x.position))!==0;)if(oe===39)if(Ne(x,pe,x.position,!0),oe=x.input.charCodeAt(++x.position),oe===39)pe=x.position,x.position++,le=x.position;else return!0;else j(oe)?(Ne(x,pe,le,!0),se(x,Ke(x,!1,V)),pe=le=x.position):x.position===x.lineStart&>(x)?_(x,"unexpected end of the document within a single quoted scalar"):(x.position++,E(oe)||(le=x.position));_(x,"unexpected end of the stream within a single quoted scalar")}function Te(x,V){let pe,le,oe,k=x.input.charCodeAt(x.position);if(k!==34)return!1;for(x.kind="scalar",x.result="",x.position++,pe=le=x.position;(k=x.input.charCodeAt(x.position))!==0;){if(k===34)return Ne(x,pe,x.position,!0),x.position++,!0;if(k===92){if(Ne(x,pe,x.position,!0),k=x.input.charCodeAt(++x.position),j(k))Ke(x,!1,V);else if(k<256&&G[k])x.result+=we[k],x.position++;else if((oe=M(k))>0){let J=oe,Z=0;for(;J>0;J--)k=x.input.charCodeAt(++x.position),(oe=B(k))>=0?Z=(Z<<4)+oe:_(x,"expected hexadecimal character");x.result+=X(Z),x.position++}else _(x,"unknown escape sequence");pe=le=x.position}else j(k)?(Ne(x,pe,le,!0),se(x,Ke(x,!1,V)),pe=le=x.position):x.position===x.lineStart&>(x)?_(x,"unexpected end of the document within a double quoted scalar"):(x.position++,E(k)||(le=x.position))}_(x,"unexpected end of the stream within a double quoted scalar")}function Ie(x,V){let pe=!0,le,oe,k;const J=x.tag;let Z;const K=x.anchor;let Q,Ae,fe,ke;const je=Object.create(null);let De,$e,ze,Je=x.input.charCodeAt(x.position);if(Je===91)Q=93,ke=!1,Z=[];else if(Je===123)Q=125,ke=!0,Z={};else return!1;for(x.anchor!==null&&he(x,x.anchor,Z),Je=x.input.charCodeAt(++x.position);Je!==0;){if(Ke(x,!0,V),Je=x.input.charCodeAt(x.position),Je===Q)return x.position++,x.tag=J,x.anchor=K,x.kind=ke?"mapping":"sequence",x.result=Z,!0;if(pe?Je===44&&_(x,"expected the node content, but found ','"):_(x,"missed comma between flow collection entries"),$e=De=ze=null,Ae=fe=!1,Je===63){const Rn=x.input.charCodeAt(x.position+1);O(Rn)&&(Ae=fe=!0,x.position++,Ke(x,!0,V))}le=x.line,oe=x.lineStart,k=x.position,lt(x,V,a,!1,!0),$e=x.tag,De=x.result,Ke(x,!0,V),Je=x.input.charCodeAt(x.position),(fe||x.line===le)&&Je===58&&(Ae=!0,Je=x.input.charCodeAt(++x.position),Ke(x,!0,V),lt(x,V,a,!1,!0),ze=x.result),ke?Ze(x,Z,je,$e,De,ze,le,oe,k):Ae?Z.push(Ze(x,null,je,$e,De,ze,le,oe,k)):Z.push(De),Ke(x,!0,V),Je=x.input.charCodeAt(x.position),Je===44?(pe=!0,Je=x.input.charCodeAt(++x.position)):pe=!1}_(x,"unexpected end of the stream within a flow collection")}function Xe(x,V){let pe,le=h,oe=!1,k=!1,J=V,Z=0,K=!1,Q,Ae=x.input.charCodeAt(x.position);if(Ae===124)pe=!1;else if(Ae===62)pe=!0;else return!1;for(x.kind="scalar",x.result="";Ae!==0;)if(Ae=x.input.charCodeAt(++x.position),Ae===43||Ae===45)h===le?le=Ae===43?b:g:_(x,"repeat of a chomping mode identifier");else if((Q=z(Ae))>=0)Q===0?_(x,"bad explicit indentation width of a block scalar; it cannot be less than one"):k?_(x,"repeat of an indentation width identifier"):(J=V+Q-1,k=!0);else break;if(E(Ae)){do Ae=x.input.charCodeAt(++x.position);while(E(Ae));if(Ae===35)do Ae=x.input.charCodeAt(++x.position);while(!j(Ae)&&Ae!==0)}for(;Ae!==0;){for(_e(x),x.lineIndent=0,Ae=x.input.charCodeAt(x.position);(!k||x.lineIndent<J)&&Ae===32;)x.lineIndent++,Ae=x.input.charCodeAt(++x.position);if(!k&&x.lineIndent>J&&(J=x.lineIndent),j(Ae)){Z++;continue}if(!k&&J===0&&_(x,"missing indentation for block scalar"),x.lineIndent<J){le===b?x.result+=t.repeat(`
|
|
19
|
+
`,oe?1+Z:Z):le===h&&oe&&(x.result+=`
|
|
20
|
+
`);break}pe?E(Ae)?(K=!0,x.result+=t.repeat(`
|
|
21
|
+
`,oe?1+Z:Z)):K?(K=!1,x.result+=t.repeat(`
|
|
22
|
+
`,Z+1)):Z===0?oe&&(x.result+=" "):x.result+=t.repeat(`
|
|
23
|
+
`,Z):x.result+=t.repeat(`
|
|
24
|
+
`,oe?1+Z:Z),oe=!0,k=!0,Z=0;const fe=x.position;for(;!j(Ae)&&Ae!==0;)Ae=x.input.charCodeAt(++x.position);Ne(x,fe,x.position,!1)}return!0}function ht(x,V){const pe=x.tag,le=x.anchor,oe=[];let k=!1;if(x.firstTabInLine!==-1)return!1;x.anchor!==null&&he(x,x.anchor,oe);let J=x.input.charCodeAt(x.position);for(;J!==0&&(x.firstTabInLine!==-1&&(x.position=x.firstTabInLine,_(x,"tab characters must not be used in indentation")),J===45);){const Z=x.input.charCodeAt(x.position+1);if(!O(Z))break;if(k=!0,x.position++,Ke(x,!0,-1)&&x.lineIndent<=V){oe.push(null),J=x.input.charCodeAt(x.position);continue}const K=x.line;if(lt(x,V,d,!1,!0),oe.push(x.result),Ke(x,!0,-1),J=x.input.charCodeAt(x.position),(x.line===K||x.lineIndent>V)&&J!==0)_(x,"bad indentation of a sequence entry");else if(x.lineIndent<V)break}return k?(x.tag=pe,x.anchor=le,x.kind="sequence",x.result=oe,!0):!1}function Pt(x,V,pe){let le,oe,k,J;const Z=x.tag,K=x.anchor,Q={},Ae=Object.create(null);let fe=null,ke=null,je=null,De=!1,$e=!1;if(x.firstTabInLine!==-1)return!1;x.anchor!==null&&he(x,x.anchor,Q);let ze=x.input.charCodeAt(x.position);for(;ze!==0;){!De&&x.firstTabInLine!==-1&&(x.position=x.firstTabInLine,_(x,"tab characters must not be used in indentation"));const Je=x.input.charCodeAt(x.position+1),Rn=x.line;if((ze===63||ze===58)&&O(Je))ze===63?(De&&(Ze(x,Q,Ae,fe,ke,null,oe,k,J),fe=ke=je=null),$e=!0,De=!0,le=!0):De?(De=!1,le=!0):_(x,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),x.position+=1,ze=Je;else{if(oe=x.line,k=x.lineStart,J=x.position,!lt(x,pe,c,!1,!0))break;if(x.line===Rn){for(ze=x.input.charCodeAt(x.position);E(ze);)ze=x.input.charCodeAt(++x.position);if(ze===58)ze=x.input.charCodeAt(++x.position),O(ze)||_(x,"a whitespace character is expected after the key-value separator within a block mapping"),De&&(Ze(x,Q,Ae,fe,ke,null,oe,k,J),fe=ke=je=null),$e=!0,De=!1,le=!1,fe=x.tag,ke=x.result;else if($e)_(x,"can not read an implicit mapping pair; a colon is missed");else return x.tag=Z,x.anchor=K,!0}else if($e)_(x,"can not read a block mapping entry; a multiline key may not be an implicit key");else return x.tag=Z,x.anchor=K,!0}if((x.line===Rn||x.lineIndent>V)&&(De&&(oe=x.line,k=x.lineStart,J=x.position),lt(x,V,f,!0,le)&&(De?ke=x.result:je=x.result),De||(Ze(x,Q,Ae,fe,ke,je,oe,k,J),fe=ke=je=null),Ke(x,!0,-1),ze=x.input.charCodeAt(x.position)),(x.line===Rn||x.lineIndent>V)&&ze!==0)_(x,"bad indentation of a mapping entry");else if(x.lineIndent<V)break}return De&&Ze(x,Q,Ae,fe,ke,null,oe,k,J),$e&&(x.tag=Z,x.anchor=K,x.kind="mapping",x.result=Q),$e}function rn(x){let V=!1,pe=!1,le,oe,k=x.input.charCodeAt(x.position);if(k!==33)return!1;x.tag!==null&&_(x,"duplication of a tag property"),k=x.input.charCodeAt(++x.position),k===60?(V=!0,k=x.input.charCodeAt(++x.position)):k===33?(pe=!0,le="!!",k=x.input.charCodeAt(++x.position)):le="!";let J=x.position;if(V){do k=x.input.charCodeAt(++x.position);while(k!==0&&k!==62);x.position<x.length?(oe=x.input.slice(J,x.position),k=x.input.charCodeAt(++x.position)):_(x,"unexpected end of the stream within a verbatim tag")}else{for(;k!==0&&!O(k);)k===33&&(pe?_(x,"tag suffix cannot contain exclamation marks"):(le=x.input.slice(J-1,x.position+1),C.test(le)||_(x,"named tag handle cannot contain such characters"),pe=!0,J=x.position+1)),k=x.input.charCodeAt(++x.position);oe=x.input.slice(J,x.position),A.test(oe)&&_(x,"tag suffix cannot contain flow indicator characters")}oe&&!T.test(oe)&&_(x,"tag name cannot contain such characters: "+oe);try{oe=decodeURIComponent(oe)}catch{_(x,"tag name is malformed: "+oe)}return V?x.tag=oe:s.call(x.tagMap,le)?x.tag=x.tagMap[le]+oe:le==="!"?x.tag="!"+oe:le==="!!"?x.tag="tag:yaml.org,2002:"+oe:_(x,'undeclared tag handle "'+le+'"'),!0}function sn(x){let V=x.input.charCodeAt(x.position);if(V!==38)return!1;x.anchor!==null&&_(x,"duplication of an anchor property"),V=x.input.charCodeAt(++x.position);const pe=x.position;for(;V!==0&&!O(V)&&!R(V);)V=x.input.charCodeAt(++x.position);return x.position===pe&&_(x,"name of an anchor node must contain at least one character"),x.anchor=x.input.slice(pe,x.position),!0}function qn(x){let V=x.input.charCodeAt(x.position);if(V!==42)return!1;V=x.input.charCodeAt(++x.position);const pe=x.position;for(;V!==0&&!O(V)&&!R(V);)V=x.input.charCodeAt(++x.position);x.position===pe&&_(x,"name of an alias node must contain at least one character");const le=x.input.slice(pe,x.position);return s.call(x.anchorMap,le)||_(x,'unidentified alias "'+le+'"'),x.result=x.anchorMap[le],Ke(x,!0,-1),!0}function Cn(x,V,pe,le){const oe=P(x);return $(x),ue(x,V),x.tag=null,x.anchor=null,x.kind=null,x.result=null,Pt(x,pe,le)&&x.kind==="mapping"?(te(x),!0):(L(x),ue(x,oe),!1)}function lt(x,V,pe,le,oe){let k,J,Z=1,K=!1,Q=!1,Ae=null,fe,ke,je;x.depth>=x.maxDepth&&_(x,"nesting exceeded maxDepth ("+x.maxDepth+")"),x.depth+=1,x.listener!==null&&x.listener("open",x),x.tag=null,x.anchor=null,x.kind=null,x.result=null;const De=k=J=f===pe||d===pe;if(le&&Ke(x,!0,-1)&&(K=!0,x.lineIndent>V?Z=1:x.lineIndent===V?Z=0:x.lineIndent<V&&(Z=-1)),Z===1)for(;;){const $e=x.input.charCodeAt(x.position),ze=P(x);if(K&&($e===33&&x.tag!==null||$e===38&&x.anchor!==null)||!rn(x)&&!sn(x))break;Ae===null&&(Ae=ze),Ke(x,!0,-1)?(K=!0,J=De,x.lineIndent>V?Z=1:x.lineIndent===V?Z=0:x.lineIndent<V&&(Z=-1)):J=!1}if(J&&(J=K||oe),Z===1||f===pe)if(a===pe||c===pe?ke=V:ke=V+1,je=x.position-x.lineStart,Z===1)if(J&&(ht(x,je)||Pt(x,je,ke))||Ie(x,ke))Q=!0;else{const $e=x.input.charCodeAt(x.position);Ae!==null&&De&&!J&&$e!==124&&$e!==62&&Cn(x,Ae,Ae.position-Ae.lineStart,ke)||k&&Xe(x,ke)||ge(x,ke)||Te(x,ke)?Q=!0:qn(x)?(Q=!0,(x.tag!==null||x.anchor!==null)&&_(x,"alias node should not have any properties")):de(x,ke,a===pe)&&(Q=!0,x.tag===null&&(x.tag="?")),x.anchor!==null&&he(x,x.anchor,x.result)}else Z===0&&(Q=J&&ht(x,je));if(x.tag===null)x.anchor!==null&&he(x,x.anchor,x.result);else if(x.tag==="?"){x.result!==null&&x.kind!=="scalar"&&_(x,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+x.kind+'"');for(let $e=0,ze=x.implicitTypes.length;$e<ze;$e+=1)if(fe=x.implicitTypes[$e],fe.resolve(x.result)){x.result=fe.construct(x.result),x.tag=fe.tag,x.anchor!==null&&he(x,x.anchor,x.result);break}}else if(x.tag!=="!"){if(s.call(x.typeMap[x.kind||"fallback"],x.tag))fe=x.typeMap[x.kind||"fallback"][x.tag];else{fe=null;const $e=x.typeMap.multi[x.kind||"fallback"];for(let ze=0,Je=$e.length;ze<Je;ze+=1)if(x.tag.slice(0,$e[ze].tag.length)===$e[ze].tag){fe=$e[ze];break}}fe||_(x,"unknown tag !<"+x.tag+">"),x.result!==null&&fe.kind!==x.kind&&_(x,"unacceptable node kind for !<"+x.tag+'> tag; it should be "'+fe.kind+'", not "'+x.kind+'"'),fe.resolve(x.result,x.tag)?(x.result=fe.construct(x.result,x.tag),x.anchor!==null&&he(x,x.anchor,x.result)):_(x,"cannot resolve a node with !<"+x.tag+"> explicit tag")}return x.listener!==null&&x.listener("close",x),x.depth-=1,x.tag!==null||x.anchor!==null||Q}function pi(x){const V=x.position;let pe=!1,le;for(x.version=null,x.checkLineBreaks=x.legacy,x.tagMap=Object.create(null),x.anchorMap=Object.create(null);(le=x.input.charCodeAt(x.position))!==0&&(Ke(x,!0,-1),le=x.input.charCodeAt(x.position),!(x.lineIndent>0||le!==37));){pe=!0,le=x.input.charCodeAt(++x.position);let oe=x.position;for(;le!==0&&!O(le);)le=x.input.charCodeAt(++x.position);const k=x.input.slice(oe,x.position),J=[];for(k.length<1&&_(x,"directive name must not be less than one character in length");le!==0;){for(;E(le);)le=x.input.charCodeAt(++x.position);if(le===35){do le=x.input.charCodeAt(++x.position);while(le!==0&&!j(le));break}if(j(le))break;for(oe=x.position;le!==0&&!O(le);)le=x.input.charCodeAt(++x.position);J.push(x.input.slice(oe,x.position))}le!==0&&_e(x),s.call(Se,k)?Se[k](x,k,J):ee(x,'unknown document directive "'+k+'"')}if(Ke(x,!0,-1),x.lineIndent===0&&x.input.charCodeAt(x.position)===45&&x.input.charCodeAt(x.position+1)===45&&x.input.charCodeAt(x.position+2)===45?(x.position+=3,Ke(x,!0,-1)):pe&&_(x,"directives end mark is expected"),lt(x,x.lineIndent-1,f,!1,!0),Ke(x,!0,-1),x.checkLineBreaks&&S.test(x.input.slice(V,x.position))&&ee(x,"non-ASCII line breaks are interpreted as content"),x.documents.push(x.result),x.position===x.lineStart&>(x)){x.input.charCodeAt(x.position)===46&&(x.position+=3,Ke(x,!0,-1));return}x.position<x.length-1&&_(x,"end of the stream or a document separator is expected")}function Mn(x,V){x=String(x),V=V||{},x.length!==0&&(x.charCodeAt(x.length-1)!==10&&x.charCodeAt(x.length-1)!==13&&(x+=`
|
|
25
|
+
`),x.charCodeAt(0)===65279&&(x=x.slice(1)));const pe=new ye(x,V),le=x.indexOf("\0");for(le!==-1&&(pe.position=le,_(pe,"null byte is not allowed in input")),pe.input+="\0";pe.input.charCodeAt(pe.position)===32;)pe.lineIndent+=1,pe.position+=1;for(;pe.position<pe.length-1;)pi(pe);return pe.documents}function Jn(x,V,pe){V!==null&&typeof V=="object"&&typeof pe>"u"&&(pe=V,V=null);const le=Mn(x,pe);if(typeof V!="function")return le;for(let oe=0,k=le.length;oe<k;oe+=1)V(le[oe])}function Tt(x,V){const pe=Mn(x,V);if(pe.length!==0){if(pe.length===1)return pe[0];throw new e("expected a single document in the stream, but found more")}}return Mo.loadAll=Jn,Mo.load=Tt,Mo}var zd={},a0;function xA(){if(a0)return zd;a0=1;const t=aa(),e=oa(),n=qd(),r=Object.prototype.toString,s=Object.prototype.hasOwnProperty,a=65279,c=9,d=10,f=13,h=32,g=33,b=34,v=35,S=37,A=38,C=39,T=42,D=44,j=45,E=58,O=61,R=62,B=63,M=64,z=91,F=93,X=96,W=123,G=124,we=125,ye={};ye[0]="\\0",ye[7]="\\a",ye[8]="\\b",ye[9]="\\t",ye[10]="\\n",ye[11]="\\v",ye[12]="\\f",ye[13]="\\r",ye[27]="\\e",ye[34]='\\"',ye[92]="\\\\",ye[133]="\\N",ye[160]="\\_",ye[8232]="\\L",ye[8233]="\\P";const xe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],_=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ee(k,J){if(J===null)return{};const Z={},K=Object.keys(J);for(let Q=0,Ae=K.length;Q<Ae;Q+=1){let fe=K[Q],ke=String(J[fe]);fe.slice(0,2)==="!!"&&(fe="tag:yaml.org,2002:"+fe.slice(2));const je=k.compiledTypeMap.fallback[fe];je&&s.call(je.styleAliases,ke)&&(ke=je.styleAliases[ke]),Z[fe]=ke}return Z}function he(k){let J,Z;const K=k.toString(16).toUpperCase();if(k<=255)J="x",Z=2;else if(k<=65535)J="u",Z=4;else if(k<=4294967295)J="U",Z=8;else throw new e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+J+t.repeat("0",Z-K.length)+K}const $=1,te=2;function L(k){this.schema=k.schema||n,this.indent=Math.max(1,k.indent||2),this.noArrayIndent=k.noArrayIndent||!1,this.skipInvalid=k.skipInvalid||!1,this.flowLevel=t.isNothing(k.flowLevel)?-1:k.flowLevel,this.styleMap=ee(this.schema,k.styles||null),this.sortKeys=k.sortKeys||!1,this.lineWidth=k.lineWidth||80,this.noRefs=k.noRefs||!1,this.noCompatMode=k.noCompatMode||!1,this.condenseFlow=k.condenseFlow||!1,this.quotingType=k.quotingType==='"'?te:$,this.forceQuotes=k.forceQuotes||!1,this.replacer=typeof k.replacer=="function"?k.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function P(k,J){const Z=t.repeat(" ",J);let K=0,Q="";const Ae=k.length;for(;K<Ae;){let fe;const ke=k.indexOf(`
|
|
26
|
+
`,K);ke===-1?(fe=k.slice(K),K=Ae):(fe=k.slice(K,ke+1),K=ke+1),fe.length&&fe!==`
|
|
27
|
+
`&&(Q+=Z),Q+=fe}return Q}function ue(k,J){return`
|
|
28
|
+
`+t.repeat(" ",k.indent*J)}function Se(k,J){for(let Z=0,K=k.implicitTypes.length;Z<K;Z+=1)if(k.implicitTypes[Z].resolve(J))return!0;return!1}function Ne(k){return k===h||k===c}function Re(k){return k>=32&&k<=126||k>=161&&k<=55295&&k!==8232&&k!==8233||k>=57344&&k<=65533&&k!==a||k>=65536&&k<=1114111}function Be(k){return Re(k)&&k!==a&&k!==f&&k!==d}function Ze(k,J,Z){const K=Be(k),Q=K&&!Ne(k);return(Z?K:K&&k!==D&&k!==z&&k!==F&&k!==W&&k!==we)&&k!==v&&!(J===E&&!Q)||Be(J)&&!Ne(J)&&k===v||J===E&&Q}function _e(k){return Re(k)&&k!==a&&!Ne(k)&&k!==j&&k!==B&&k!==E&&k!==D&&k!==z&&k!==F&&k!==W&&k!==we&&k!==v&&k!==A&&k!==T&&k!==g&&k!==G&&k!==O&&k!==R&&k!==C&&k!==b&&k!==S&&k!==M&&k!==X}function Ke(k){return!Ne(k)&&k!==E}function gt(k,J){const Z=k.charCodeAt(J);let K;return Z>=55296&&Z<=56319&&J+1<k.length&&(K=k.charCodeAt(J+1),K>=56320&&K<=57343)?(Z-55296)*1024+K-56320+65536:Z}function se(k){return/^\n* /.test(k)}const de=1,ge=2,Te=3,Ie=4,Xe=5;function ht(k,J,Z,K,Q,Ae,fe,ke){let je,De=0,$e=null,ze=!1,Je=!1;const Rn=K!==-1;let Dn=-1,Kt=_e(gt(k,0))&&Ke(gt(k,k.length-1));if(J||fe)for(je=0;je<k.length;De>=65536?je+=2:je++){if(De=gt(k,je),!Re(De))return Xe;Kt=Kt&&Ze(De,$e,ke),$e=De}else{for(je=0;je<k.length;De>=65536?je+=2:je++){if(De=gt(k,je),De===d)ze=!0,Rn&&(Je=Je||je-Dn-1>K&&k[Dn+1]!==" ",Dn=je);else if(!Re(De))return Xe;Kt=Kt&&Ze(De,$e,ke),$e=De}Je=Je||Rn&&je-Dn-1>K&&k[Dn+1]!==" "}return!ze&&!Je?Kt&&!fe&&!Q(k)?de:Ae===te?Xe:ge:Z>9&&se(k)?Xe:fe?Ae===te?Xe:ge:Je?Ie:Te}function Pt(k,J,Z,K,Q){k.dump=(function(){if(J.length===0)return k.quotingType===te?'""':"''";if(!k.noCompatMode&&(xe.indexOf(J)!==-1||_.test(J)))return k.quotingType===te?'"'+J+'"':"'"+J+"'";const Ae=k.indent*Math.max(1,Z),fe=k.lineWidth===-1?-1:Math.max(Math.min(k.lineWidth,40),k.lineWidth-Ae),ke=K||k.flowLevel>-1&&Z>=k.flowLevel;function je(De){return Se(k,De)}switch(ht(J,ke,k.indent,fe,je,k.quotingType,k.forceQuotes&&!K,Q)){case de:return J;case ge:return"'"+J.replace(/'/g,"''")+"'";case Te:return"|"+rn(J,k.indent)+sn(P(J,Ae));case Ie:return">"+rn(J,k.indent)+sn(P(qn(J,fe),Ae));case Xe:return'"'+lt(J)+'"';default:throw new e("impossible error: invalid scalar style")}})()}function rn(k,J){const Z=se(k)?String(J):"",K=k[k.length-1]===`
|
|
29
|
+
`,Ae=K&&(k[k.length-2]===`
|
|
30
|
+
`||k===`
|
|
31
|
+
`)?"+":K?"":"-";return Z+Ae+`
|
|
32
|
+
`}function sn(k){return k[k.length-1]===`
|
|
33
|
+
`?k.slice(0,-1):k}function qn(k,J){const Z=/(\n+)([^\n]*)/g;let K=(function(){let ke=k.indexOf(`
|
|
34
|
+
`);return ke=ke!==-1?ke:k.length,Z.lastIndex=ke,Cn(k.slice(0,ke),J)})(),Q=k[0]===`
|
|
35
|
+
`||k[0]===" ",Ae,fe;for(;fe=Z.exec(k);){const ke=fe[1],je=fe[2];Ae=je[0]===" ",K+=ke+(!Q&&!Ae&&je!==""?`
|
|
36
|
+
`:"")+Cn(je,J),Q=Ae}return K}function Cn(k,J){if(k===""||k[0]===" ")return k;const Z=/ [^ ]/g;let K,Q=0,Ae,fe=0,ke=0,je="";for(;K=Z.exec(k);)ke=K.index,ke-Q>J&&(Ae=fe>Q?fe:ke,je+=`
|
|
37
|
+
`+k.slice(Q,Ae),Q=Ae+1),fe=ke;return je+=`
|
|
38
|
+
`,k.length-Q>J&&fe>Q?je+=k.slice(Q,fe)+`
|
|
39
|
+
`+k.slice(fe+1):je+=k.slice(Q),je.slice(1)}function lt(k){let J="",Z=0;for(let K=0;K<k.length;Z>=65536?K+=2:K++){Z=gt(k,K);const Q=ye[Z];!Q&&Re(Z)?(J+=k[K],Z>=65536&&(J+=k[K+1])):J+=Q||he(Z)}return J}function pi(k,J,Z){let K="";const Q=k.tag;for(let Ae=0,fe=Z.length;Ae<fe;Ae+=1){let ke=Z[Ae];k.replacer&&(ke=k.replacer.call(Z,String(Ae),ke)),(V(k,J,ke,!1,!1)||typeof ke>"u"&&V(k,J,null,!1,!1))&&(K!==""&&(K+=","+(k.condenseFlow?"":" ")),K+=k.dump)}k.tag=Q,k.dump="["+K+"]"}function Mn(k,J,Z,K){let Q="";const Ae=k.tag;for(let fe=0,ke=Z.length;fe<ke;fe+=1){let je=Z[fe];k.replacer&&(je=k.replacer.call(Z,String(fe),je)),(V(k,J+1,je,!0,!0,!1,!0)||typeof je>"u"&&V(k,J+1,null,!0,!0,!1,!0))&&((!K||Q!=="")&&(Q+=ue(k,J)),k.dump&&d===k.dump.charCodeAt(0)?Q+="-":Q+="- ",Q+=k.dump)}k.tag=Ae,k.dump=Q||"[]"}function Jn(k,J,Z){let K="";const Q=k.tag,Ae=Object.keys(Z);for(let fe=0,ke=Ae.length;fe<ke;fe+=1){let je="";K!==""&&(je+=", "),k.condenseFlow&&(je+='"');const De=Ae[fe];let $e=Z[De];k.replacer&&($e=k.replacer.call(Z,De,$e)),V(k,J,De,!1,!1)&&(k.dump.length>1024&&(je+="? "),je+=k.dump+(k.condenseFlow?'"':"")+":"+(k.condenseFlow?"":" "),V(k,J,$e,!1,!1)&&(je+=k.dump,K+=je))}k.tag=Q,k.dump="{"+K+"}"}function Tt(k,J,Z,K){let Q="";const Ae=k.tag,fe=Object.keys(Z);if(k.sortKeys===!0)fe.sort();else if(typeof k.sortKeys=="function")fe.sort(k.sortKeys);else if(k.sortKeys)throw new e("sortKeys must be a boolean or a function");for(let ke=0,je=fe.length;ke<je;ke+=1){let De="";(!K||Q!=="")&&(De+=ue(k,J));const $e=fe[ke];let ze=Z[$e];if(k.replacer&&(ze=k.replacer.call(Z,$e,ze)),!V(k,J+1,$e,!0,!0,!0))continue;const Je=k.tag!==null&&k.tag!=="?"||k.dump&&k.dump.length>1024;Je&&(k.dump&&d===k.dump.charCodeAt(0)?De+="?":De+="? "),De+=k.dump,Je&&(De+=ue(k,J)),V(k,J+1,ze,!0,Je)&&(k.dump&&d===k.dump.charCodeAt(0)?De+=":":De+=": ",De+=k.dump,Q+=De)}k.tag=Ae,k.dump=Q||"{}"}function x(k,J,Z){const K=Z?k.explicitTypes:k.implicitTypes;for(let Q=0,Ae=K.length;Q<Ae;Q+=1){const fe=K[Q];if((fe.instanceOf||fe.predicate)&&(!fe.instanceOf||typeof J=="object"&&J instanceof fe.instanceOf)&&(!fe.predicate||fe.predicate(J))){if(Z?fe.multi&&fe.representName?k.tag=fe.representName(J):k.tag=fe.tag:k.tag="?",fe.represent){const ke=k.styleMap[fe.tag]||fe.defaultStyle;let je;if(r.call(fe.represent)==="[object Function]")je=fe.represent(J,ke);else if(s.call(fe.represent,ke))je=fe.represent[ke](J,ke);else throw new e("!<"+fe.tag+'> tag resolver accepts not "'+ke+'" style');k.dump=je}return!0}}return!1}function V(k,J,Z,K,Q,Ae,fe){k.tag=null,k.dump=Z,x(k,Z,!1)||x(k,Z,!0);const ke=r.call(k.dump),je=K;K&&(K=k.flowLevel<0||k.flowLevel>J);const De=ke==="[object Object]"||ke==="[object Array]";let $e,ze;if(De&&($e=k.duplicates.indexOf(Z),ze=$e!==-1),(k.tag!==null&&k.tag!=="?"||ze||k.indent!==2&&J>0)&&(Q=!1),ze&&k.usedDuplicates[$e])k.dump="*ref_"+$e;else{if(De&&ze&&!k.usedDuplicates[$e]&&(k.usedDuplicates[$e]=!0),ke==="[object Object]")K&&Object.keys(k.dump).length!==0?(Tt(k,J,k.dump,Q),ze&&(k.dump="&ref_"+$e+k.dump)):(Jn(k,J,k.dump),ze&&(k.dump="&ref_"+$e+" "+k.dump));else if(ke==="[object Array]")K&&k.dump.length!==0?(k.noArrayIndent&&!fe&&J>0?Mn(k,J-1,k.dump,Q):Mn(k,J,k.dump,Q),ze&&(k.dump="&ref_"+$e+k.dump)):(pi(k,J,k.dump),ze&&(k.dump="&ref_"+$e+" "+k.dump));else if(ke==="[object String]")k.tag!=="?"&&Pt(k,k.dump,J,Ae,je);else{if(ke==="[object Undefined]")return!1;if(k.skipInvalid)return!1;throw new e("unacceptable kind of an object to dump "+ke)}if(k.tag!==null&&k.tag!=="?"){let Je=encodeURI(k.tag[0]==="!"?k.tag.slice(1):k.tag).replace(/!/g,"%21");k.tag[0]==="!"?Je="!"+Je:Je.slice(0,18)==="tag:yaml.org,2002:"?Je="!!"+Je.slice(18):Je="!<"+Je+">",k.dump=Je+" "+k.dump}}return!0}function pe(k,J){const Z=[],K=[];le(k,Z,K);const Q=K.length;for(let Ae=0;Ae<Q;Ae+=1)J.duplicates.push(Z[K[Ae]]);J.usedDuplicates=new Array(Q)}function le(k,J,Z){if(k!==null&&typeof k=="object"){const K=J.indexOf(k);if(K!==-1)Z.indexOf(K)===-1&&Z.push(K);else if(J.push(k),Array.isArray(k))for(let Q=0,Ae=k.length;Q<Ae;Q+=1)le(k[Q],J,Z);else{const Q=Object.keys(k);for(let Ae=0,fe=Q.length;Ae<fe;Ae+=1)le(k[Q[Ae]],J,Z)}}}function oe(k,J){J=J||{};const Z=new L(J);Z.noRefs||pe(k,Z);let K=k;return Z.replacer&&(K=Z.replacer.call({"":K},"",K)),V(Z,0,K,!0,!0)?Z.dump+`
|
|
40
|
+
`:""}return zd.dump=oe,zd}var o0;function vA(){if(o0)return vn;o0=1;const t=bA(),e=xA();function n(r,s){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+s+" instead, which is now safe by default.")}}return vn.Type=Nn(),vn.Schema=Ng(),vn.FAILSAFE_SCHEMA=_g(),vn.JSON_SCHEMA=Vg(),vn.CORE_SCHEMA=Kg(),vn.DEFAULT_SCHEMA=qd(),vn.load=t.load,vn.loadAll=t.loadAll,vn.dump=e.dump,vn.YAMLException=oa(),vn.types={binary:Wg(),float:Ug(),map:Rg(),null:Bg(),pairs:n0(),set:r0(),timestamp:Gg(),bool:qg(),int:Hg(),merge:Jg(),omap:e0(),seq:Og(),str:jg()},vn.safeLoad=n("safeLoad","load"),vn.safeLoadAll=n("safeLoadAll","loadAll"),vn.safeDump=n("safeDump","dump"),vn}var wA=vA();const SA=gA(wA),{Type:gD,Schema:yD,FAILSAFE_SCHEMA:bD,JSON_SCHEMA:xD,CORE_SCHEMA:vD,DEFAULT_SCHEMA:wD,load:AA,loadAll:SD,dump:kA,YAMLException:AD,types:kD,safeLoad:CD,safeLoadAll:ND,safeDump:TD}=SA;let zi=class z2{static async parseSpec(e){let n;if(typeof e=="string"){const r=e.trim();try{n=JSON.parse(r)}catch{try{n=AA(r)}catch{throw new Error("Invalid OpenAPI specification format")}}}else n=e;if(!n.openapi||!n.info||!n.paths)throw new Error("Invalid OpenAPI specification: missing required fields");return n}static getHttpMethods(e){return["get","post","put","delete","patch","options","head","trace"].filter(r=>e[r])}static decodePointerToken(e){return decodeURIComponent(e).replace(/~1/g,"/").replace(/~0/g,"~")}static encodePointerToken(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}static resolveReference(e,n){if(!n.startsWith("#/"))throw new Error(`Only local references are supported synchronously; bundle external references first: ${n}`);const r=n.substring(2).split("/").map(z2.decodePointerToken);let s=e;for(const a of r){if(s===null||typeof s!="object"||!(a in s))throw new Error(`Reference not found: ${n}`);s=s[a]}return s}static isReference(e){return!!e&&typeof e=="object"&&"$ref"in e&&typeof e.$ref=="string"}};class Ln{static async parseSpec(e){return zi.parseSpec(e)}static getHttpMethods(e){return zi.getHttpMethods(e)}static getMethodColor(e,n){const a=n==="dark"?{get:"text-blue-300 bg-blue-900/30 border-blue-700",post:"text-green-300 bg-green-900/30 border-green-700",put:"text-orange-300 bg-orange-900/30 border-orange-700",delete:"text-red-300 bg-red-900/30 border-red-700",patch:"text-purple-300 bg-purple-900/30 border-purple-700",options:"text-cyan-100 bg-cyan-800/50 border-cyan-500",head:"text-gray-300 bg-gray-700/50 border-gray-600",trace:"text-gray-300 bg-gray-700/50 border-gray-600"}:{get:"text-blue-600 bg-blue-50 border-blue-200",post:"text-green-600 bg-green-50 border-green-200",put:"text-orange-600 bg-orange-50 border-orange-200",delete:"text-red-600 bg-red-50 border-red-200",patch:"text-purple-600 bg-purple-50 border-purple-200",options:"text-gray-600 bg-gray-50 border-gray-200",head:"text-gray-600 bg-gray-50 border-gray-200",trace:"text-gray-600 bg-gray-50 border-gray-200"},c=n==="dark"?"text-gray-300 bg-gray-700/50 border-gray-600":"text-gray-600 bg-gray-50 border-gray-200";return a[e.toLowerCase()]||c}static decodePointerToken(e){return zi.decodePointerToken(e)}static encodePointerToken(e){return zi.encodePointerToken(e)}static resolveReference(e,n){return zi.resolveReference(e,n)}static isReference(e){return zi.isReference(e)}}const CA=({spec:t,onEndpointSelect:e,selectedEndpoint:n=null,theme:r="light",expandedTags:s,onExpandedTagsChange:a,messages:c})=>{const[d,f]=I.useState(""),[h,g]=I.useState(new Set(s?.length?s:["default"])),b=I.useId(),v=I.useRef(null),S=s?new Set(s):h;I.useEffect(()=>{n&&requestAnimationFrame(()=>{v.current?.querySelector('[data-selected-endpoint="true"]')?.scrollIntoView({block:"nearest"})})},[n]);const A=r==="dark"?"bg-gray-900 border-r border-gray-800 text-white":"bg-white border-r border-gray-200 text-gray-700",C=r==="dark"?"bg-gray-800 border-gray-700 text-white placeholder-gray-400 focus:ring-blue-500 focus:border-blue-500 focus:ring-1":"border-gray-300 text-gray-700 placeholder-gray-400 focus:ring-blue-500 focus:border-blue-500 focus:ring-1",T=r==="dark"?"text-gray-300":"text-gray-500",D=r==="dark"?"bg-gray-800/50 border-gray-700 text-white":"bg-gray-50 border-gray-100 text-gray-700",j=z=>{const F="text-xs font-bold px-2 py-0.5 rounded border",X={dark:{get:"bg-blue-900/30 border-blue-700 text-blue-200",post:"bg-green-900/30 border-green-700 text-green-200",put:"bg-yellow-900/30 border-yellow-700 text-yellow-200",patch:"bg-purple-900/30 border-purple-700 text-purple-200",delete:"bg-red-900/30 border-red-700 text-red-200",default:"bg-gray-800/50 border-gray-700 text-gray-200"},light:{get:"bg-blue-50 border-blue-200 text-blue-700",post:"bg-green-50 border-green-200 text-green-700",put:"bg-yellow-50 border-yellow-200 text-yellow-700",patch:"bg-purple-50 border-purple-200 text-purple-700",delete:"bg-red-50 border-red-200 text-red-700",default:"bg-gray-100 border-gray-200 text-gray-600"}},W=r==="dark"?X.dark:X.light;return`${F} ${W[z.toLowerCase()]||W.default}`},E=Object.entries(t.paths).reduce((z,[F,X])=>(Ln.getHttpMethods(X).forEach(W=>{const G=X[W];(G?.tags||["default"]).forEach(ye=>{z[ye]||(z[ye]=[]),z[ye].push({path:F,method:W,operation:G})})}),z),{}),O=d.trim().toLowerCase(),R=O.length>0,B=Object.entries(E).reduce((z,[F,X])=>{const W=X.filter(G=>`${G.method} ${G.path} ${G.operation?.summary||""} ${F}`.toLowerCase().includes(O));return W.length&&(z[F]=W),z},{}),M=z=>{const F=new Set(S);F.has(z)?F.delete(z):F.add(z),s||g(F),a?.([...F])};return p.jsxs("div",{ref:v,className:`flex h-full w-full min-w-0 flex-col ${A}`,style:{backgroundColor:"var(--flexdoc-sidebar-bg)",color:"var(--flexdoc-sidebar-text)"},children:[p.jsxs("div",{className:`border-b p-4 ${r==="dark"?"border-gray-800":"border-gray-100"}`,children:[p.jsx("label",{className:"sr-only",htmlFor:b,children:c?.searchEndpoints||"Search endpoints"}),p.jsxs("div",{className:"relative",children:[p.jsx(gg,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),p.jsx("input",{id:b,type:"search",placeholder:c?.searchEndpointsPlaceholder||"Search endpoints...",value:d,onChange:z=>f(z.target.value),className:`w-full rounded-lg border py-2 pl-10 pr-4 text-sm transition-colors ${C}`})]})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain",children:p.jsxs("div",{className:"p-4",children:[p.jsxs("div",{className:"mb-6",children:[p.jsx("h3",{className:`mb-2 text-xs font-semibold uppercase tracking-wider ${T}`,children:c?.apiInformation||"API Information"}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:`rounded-lg border p-3 ${D}`,children:[p.jsx("h4",{className:`truncate font-medium ${r==="dark"?"text-white":"text-gray-900"}`,children:t.info.title}),p.jsxs("p",{className:`text-sm ${r==="dark"?"text-gray-300":"text-gray-600"}`,children:[c?.versionLabel||"Version"," ",t.info.version]})]}),t.servers&&t.servers.length>0&&p.jsxs("div",{className:`rounded-lg border p-3 ${D}`,children:[p.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[p.jsx(yg,{className:"h-4 w-4 text-gray-400"}),p.jsx("span",{className:"text-sm font-medium",children:c?.servers||"Servers"})]}),p.jsx("div",{className:"space-y-2",children:t.servers.map((z,F)=>p.jsxs("div",{className:"min-w-0 text-sm",children:[p.jsx("code",{className:`block max-w-full overflow-x-auto rounded px-1.5 py-0.5 text-xs ${r==="dark"?"bg-gray-700/50 text-blue-200":"bg-gray-100 text-blue-600"}`,children:z.url}),z.description&&p.jsx("p",{className:`mt-1.5 ${r==="dark"?"text-gray-300":"text-gray-600"}`,children:z.description})]},`${z.url}:${F}`))})]})]})]}),p.jsxs("div",{children:[p.jsx("h3",{className:`mb-3 text-xs font-semibold uppercase tracking-wider ${T}`,children:c?.endpoints||"Endpoints"}),Object.keys(B).length===0&&p.jsx("p",{className:`px-2 py-4 text-sm ${T}`,children:c?.noEndpointsMatch||"No endpoints match your search."}),Object.entries(B).map(([z,F])=>{const X=R||S.has(z);return p.jsxs("div",{className:"mb-4",children:[p.jsxs("button",{type:"button","aria-expanded":X,onClick:()=>M(z),className:`flex min-h-11 w-full items-center gap-2 rounded-lg p-2 text-left transition-colors ${r==="dark"?"hover:bg-gray-800/50 text-white":"hover:bg-gray-50 text-gray-700"}`,children:[X?p.jsx(hg,{className:"h-4 w-4 shrink-0 text-gray-400"}):p.jsx(pg,{className:"h-4 w-4 shrink-0 text-gray-400"}),p.jsx(xg,{className:"h-4 w-4 shrink-0 text-gray-400"}),p.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:z==="default"?c?.generalTag||"General":z}),p.jsx("span",{className:`ml-auto shrink-0 rounded-full px-2 py-0.5 text-xs ${r==="dark"?"bg-gray-800 text-white":"bg-gray-100 text-gray-500"}`,children:F.length})]}),X&&p.jsx("div",{className:"ml-4 mt-1.5 space-y-1.5 sm:ml-6",children:F.map(({path:W,method:G,operation:we})=>{const ye=n?.path===W&&n?.method===G;return p.jsxs("button",{type:"button","data-selected-endpoint":ye?"true":void 0,onClick:()=>e(W,G),className:`mb-2 min-h-11 w-full rounded-lg border p-2 text-left transition-all ${ye?r==="dark"?"bg-blue-900/20 border-blue-800/50 shadow-sm":"bg-blue-50 border-blue-100 shadow-sm":r==="dark"?"hover:bg-gray-800/50 border-transparent hover:border-gray-700":"hover:bg-gray-50 border-transparent hover:border-gray-100"}`,style:ye?{color:"var(--flexdoc-sidebar-active-text)"}:void 0,children:[p.jsx("div",{className:"mb-1 flex items-center gap-2",children:p.jsx("span",{className:j(G),children:G.toUpperCase()})}),p.jsx("div",{className:`break-all font-mono text-sm ${ye?r==="dark"?"text-blue-300":"text-blue-600":r==="dark"?"text-gray-300":"text-gray-800"}`,children:W}),we?.summary&&p.jsx("div",{className:`mt-1 text-xs ${r==="dark"?"text-gray-400":"text-gray-600"}`,children:we.summary})]},`${G}-${W}`)})})]},z)})]})]})})]})},Cs=["parameters","requestBody","responses","tryIt","codeSamples"],Hd={all:Cs,none:[],minimal:[],documentation:["parameters","requestBody","responses"],interactive:["parameters","requestBody","tryIt","codeSamples"]},NA=new Set(["minimal","documentation","interactive"]),c0=new Set(Cs),TA=new Set(Object.keys(Hd)),jA=new Set(["light","dark","high-contrast"]);function EA(t){return typeof t=="string"?TA.has(t):Array.isArray(t)&&t.every(e=>typeof e=="string"&&(c0.has(e)||NA.has(e)))}function OA(t,e){for(const n of Hd[e])t.add(n)}function Id(t,e){if(t===void 0&&e!==void 0){const r=new Set(["parameters","requestBody","tryIt","codeSamples"]);return e!=="none"&&r.add("responses"),Cs.filter(s=>r.has(s))}if(t===void 0)return[];if(typeof t=="string")return[...Hd[t]];const n=new Set;for(const r of t)c0.has(r)?n.add(r):OA(n,r);return Cs.filter(r=>n.has(r))}function MA(t,e){return`flexdoc:viewer:${encodeURIComponent(e?.trim()||"unknown-host")}:${encodeURIComponent(t?.trim()||"untitled")}`}function Or(t,e){const n=typeof window<"u"?window.localStorage:void 0;if(!n)return{version:1};try{const r=n.getItem(t);if(!r)return{version:1};const s=JSON.parse(r);return s.version!==1?{version:1}:s.expand!==void 0&&!EA(s.expand)?{version:1}:s.sidebarCollapsed!==void 0&&typeof s.sidebarCollapsed!="boolean"?{version:1}:s.theme!==void 0&&(typeof s.theme!="string"||!jA.has(s.theme))?{version:1}:s.expandedTags!==void 0&&(!Array.isArray(s.expandedTags)||!s.expandedTags.every(a=>typeof a=="string"))?{version:1}:{version:1,...s.expand!==void 0?{expand:s.expand}:{},...s.sidebarCollapsed!==void 0?{sidebarCollapsed:s.sidebarCollapsed}:{},...s.theme!==void 0?{theme:s.theme}:{},...s.expandedTags!==void 0?{expandedTags:[...new Set(s.expandedTags)]}:{}}}catch{return{version:1}}}function Ro(t,e,n){const r=typeof window<"u"?window.localStorage:void 0;if(r)try{e.expand===void 0&&e.sidebarCollapsed===void 0&&e.theme===void 0&&e.expandedTags===void 0?r.removeItem(t):r.setItem(t,JSON.stringify(e))}catch{}}function RA(t,e,n){const s={...Or(t)};e===void 0?delete s.expand:s.expand=e,Ro(t,s)}function DA(t,e,n){const s={...Or(t)};e===void 0?delete s.sidebarCollapsed:s.sidebarCollapsed=e,Ro(t,s)}function _A(t,e,n){const s={...Or(t)};e===void 0?delete s.theme:s.theme=e,Ro(t,s)}function LA(t,e,n){const s={...Or(t)};e===void 0?delete s.expandedTags:s.expandedTags=[...new Set(e)],Ro(t,s)}function Mr(t,e){if(e)return zi.isReference(e)?zi.resolveReference(t,e.$ref):e}function BA(t,e){const n=t.paths[e];if(!n)throw new Error(`Path not found: ${e}`);return Mr(t,n)}function $A(t,e={}){return t.url.replace(/\{([^}]+)\}/g,(n,r)=>{const s=t.variables?.[r],a=e[r]??s?.default;if(a===void 0)throw new Error(`Missing server variable: ${r}`);if(s?.enum?.length&&!s.enum.includes(a))throw new Error(`Invalid value for server variable ${r}: ${a}`);return a})}function Ud(t,e,n){const r=BA(t,e),s=r[n.toLowerCase()];if(!s||typeof s!="object"||!("responses"in s))throw new Error(`Operation not found: ${n.toUpperCase()} ${e}`);const a=[...r.parameters||[],...s.parameters||[]].map(f=>Mr(t,f)).filter(f=>!!f),c=new Map;for(const f of a)c.set(`${f.in}:${f.name}`,f);const d={};for(const[f,h]of Object.entries(s.responses||{})){const g=Mr(t,h);g&&(d[f]=g)}return{path:e,method:n.toUpperCase(),pathItem:r,operation:s,parameters:[...c.values()],requestBody:Mr(t,s.requestBody),responses:d,servers:s.servers||r.servers||t.servers||[],security:s.security!==void 0?s.security:t.security||[]}}function qA(t,e,n){return Ud(t,e,n).parameters}function zA(t,e){return Mr(t,e.schema)}function HA(t,e){if(e.example!==void 0)return e.example;const n=zA(t,e);return n?.example!==void 0?n.example:n?.examples?.length?n.examples[0]:n?.default!==void 0?n.default:n?.enum?.length?n.enum[0]:n?.type==="array"?[]:n?.type==="object"?{}:n?.type==="integer"||n?.type==="number"?1:n?.type==="boolean"?!0:""}function IA(t,e,n){const r=Ud(t,e,n),s={parameters:{},headers:{},cookies:{},auth:{}};for(const d of r.parameters){const f=d.in==="header"?s.headers:d.in==="cookie"?s.cookies:s.parameters;f[d.name]=HA(t,d)}const a=r.requestBody,c=a?Object.keys(a.content||{})[0]:void 0;if(c){s.contentType=c;const d=a.content[c],f=Mr(t,d.schema),h=d.examples?Object.values(d.examples)[0]:void 0,g=Mr(t,h),b=d.example??g?.value??f?.example??f?.examples?.[0]??f?.default;s.body=b!==void 0?JSON.stringify(b,null,2):""}return s}function an(t){return t===null?"null":typeof t=="object"?JSON.stringify(t):String(t)}function Fd(t){if(typeof t!="string")return t;const e=t.trim();if(!e||!e.startsWith("[")&&!e.startsWith("{"))return t;try{return JSON.parse(e)}catch{return t}}function u0(t,e=!1){const n=an(t);return e?encodeURI(n).replace(/%5B/g,"[").replace(/%5D/g,"]"):encodeURIComponent(n)}function d0(t,e=!1){const n=Fd(t);if(Array.isArray(n))return n.map(an).join(",");if(n&&typeof n=="object"){const r=Object.entries(n);return e?r.map(([s,a])=>`${s}=${an(a)}`).join(","):r.flatMap(([s,a])=>[s,an(a)]).join(",")}return an(n)}function UA(t,e){const n=t.style||"simple",r=t.explode??!1,s=Fd(e),a=d=>u0(d,t.allowReserved);if(Array.isArray(s)){const d=s.map(a);return n==="label"?`.${d.join(r?".":",")}`:n==="matrix"?r?d.map(f=>`;${t.name}=${f}`).join(""):`;${t.name}=${d.join(",")}`:d.join(",")}if(s&&typeof s=="object"){const d=Object.entries(s).map(([f,h])=>[a(f),a(h)]);return n==="label"?r?`.${d.map(([f,h])=>`${f}=${h}`).join(".")}`:`.${d.flatMap(([f,h])=>[f,h]).join(",")}`:n==="matrix"?r?d.map(([f,h])=>`;${f}=${h}`).join(""):`;${t.name}=${d.flatMap(([f,h])=>[f,h]).join(",")}`:r?d.map(([f,h])=>`${f}=${h}`).join(","):d.flatMap(([f,h])=>[f,h]).join(",")}const c=a(s);return n==="label"?`.${c}`:n==="matrix"?`;${t.name}=${c}`:c}function FA(t,e){const n=t.style||"form",r=t.explode??n==="form",s=Fd(e);if(n==="deepObject"&&s&&typeof s=="object"&&!Array.isArray(s))return Object.entries(s).map(([a,c])=>[`${t.name}[${a}]`,an(c)]);if(Array.isArray(s))return n==="spaceDelimited"?[[t.name,s.map(an).join(" ")]]:n==="pipeDelimited"?[[t.name,s.map(an).join("|")]]:r?s.map(a=>[t.name,an(a)]):[[t.name,s.map(an).join(",")]];if(s&&typeof s=="object"){const a=Object.entries(s);return r?a.map(([c,d])=>[c,an(d)]):[[t.name,a.flatMap(([c,d])=>[c,an(d)]).join(",")]]}return[[t.name,an(s)]]}function VA(t){return typeof globalThis.btoa=="function"?globalThis.btoa(unescape(encodeURIComponent(t))):t}function PA(t,e){return Object.keys(t).every(n=>!!e[n])}function KA(t,e,n,r,s,a){if(!e.length||!t.components?.securitySchemes)return;const c=e.find(d=>Object.keys(d).length===0||PA(d,a))||e[0];for(const d of Object.keys(c)){const f=Mr(t,t.components.securitySchemes[d]),h=a[d];!f||!h||(f.type==="http"&&f.scheme?.toLowerCase()==="bearer"?n.Authorization=`Bearer ${h}`:f.type==="http"&&f.scheme?.toLowerCase()==="basic"?n.Authorization=`Basic ${VA(h)}`:f.type==="apiKey"&&f.in==="header"&&f.name?n[f.name]=h:f.type==="apiKey"&&f.in==="query"&&f.name?r.push(`${encodeURIComponent(f.name)}=${encodeURIComponent(h)}`):f.type==="apiKey"&&f.in==="cookie"&&f.name?s.push(`${f.name}=${encodeURIComponent(h)}`):(f.type==="oauth2"||f.type==="openIdConnect")&&(n.Authorization=`Bearer ${h}`))}}function f0(t){try{const e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}catch{return}}function YA(t,e,n,r={}){const s=Ud(t,e,n),a=s.servers[0],c=r.serverUrl||(a?$A(a,r.serverVariables):"");let d=e;const f=[],h={...r.headers||{}},g=[];for(const T of s.parameters){const D=T.in==="header"?r.headers?.[T.name]:T.in==="cookie"?r.cookies?.[T.name]:r.parameters?.[T.name];if(!(D===void 0||D===""))if(T.in==="path")d=d.replace(`{${T.name}}`,UA(T,D));else if(T.in==="query")for(const[j,E]of FA(T,D))f.push(`${encodeURIComponent(j)}=${u0(E,T.allowReserved)}`);else T.in==="header"?h[T.name]=d0(D,T.explode):T.in==="cookie"&&g.push(`${T.name}=${encodeURIComponent(d0(D,T.explode))}`)}KA(t,s.security,h,f,g,r.auth||{}),g.length&&(h.Cookie=g.join("; "));let b,v,S;if(r.body){const T=r.contentType||"application/json";if(b=r.body,T==="application/x-www-form-urlencoded"){const D=f0(r.body);b=D?Object.entries(D).flatMap(([j,E])=>Array.isArray(E)?E.map(O=>`${encodeURIComponent(j)}=${encodeURIComponent(an(O))}`):[`${encodeURIComponent(j)}=${encodeURIComponent(an(E))}`]).join("&"):r.body,S=b,v="form",h["Content-Type"]=T}else if(T.startsWith("multipart/form-data")){const D=f0(r.body);if(D&&typeof FormData<"u"){const j=new FormData;for(const[E,O]of Object.entries(D))Array.isArray(O)?O.forEach(R=>j.append(E,an(R))):j.append(E,an(O));S=j}else S=r.body;v="multipart"}else S=r.body,v=T.includes("json")?"json":"text",h["Content-Type"]=T}const A=f.join("&");return{url:`${c.replace(/\/$/,"")}${d}${A?`?${A}`:""}`,method:s.method,headers:h,body:b,bodyKind:v,init:{method:s.method,headers:h,body:S}}}function GA(t,e,n){return qA(t,e,n)}function h0(t,e,n){return IA(t,e,n)}function p0(t,e,n,r={}){return YA(t,e,n,r)}const on=t=>JSON.stringify(t);function XA(t,e){const n=Object.entries(t.headers);if(e==="curl"){const a=[`curl -X ${t.method} ${on(t.url)}`];for(const[c,d]of n)a.push(` -H ${on(`${c}: ${d}`)}`);return t.body&&a.push(` --data-raw ${on(t.body)}`),a.join(` \\
|
|
41
|
+
`)}if(e==="javascript"){const a={method:t.method};return n.length&&(a.headers=t.headers),t.body&&(a.body=t.body),`const response = await fetch(${on(t.url)}, ${JSON.stringify(a,null,2)});
|
|
42
|
+
const data = await response.json();`}if(e==="python"){const a=["import requests","",`url = ${on(t.url)}`];return n.length&&a.push(`headers = ${JSON.stringify(t.headers,null,2)}`),t.body&&a.push(`body = ${on(t.body)}`),a.push(`response = requests.request(${on(t.method)}, url${n.length?", headers=headers":""}${t.body?", data=body":""})`,"print(response.text)"),a.join(`
|
|
43
|
+
`)}if(e==="go"){const a=t.body?`strings.NewReader(${on(t.body)})`:"nil",c=["package main","","import (",' "fmt"',' "io"',' "net/http"'];t.body&&c.push(' "strings"'),c.push(")","","func main() {",` req, _ := http.NewRequest(${on(t.method)}, ${on(t.url)}, ${a})`);for(const[d,f]of n)c.push(` req.Header.Set(${on(d)}, ${on(f)})`);return c.push(" res, err := http.DefaultClient.Do(req)"," if err != nil { panic(err) }"," defer res.Body.Close()"," data, _ := io.ReadAll(res.Body)"," fmt.Println(string(data))","}"),c.join(`
|
|
44
|
+
`)}const r=["import java.net.URI;","import java.net.http.*;","","var client = HttpClient.newHttpClient();","var builder = HttpRequest.newBuilder()",` .uri(URI.create(${on(t.url)}))`];for(const[a,c]of n)r.push(` .header(${on(a)}, ${on(c)})`);const s=t.body?`HttpRequest.BodyPublishers.ofString(${on(t.body)})`:"HttpRequest.BodyPublishers.noBody()";return r.push(` .method(${on(t.method)}, ${s});`,"var response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());","System.out.println(response.body());"),r.join(`
|
|
45
|
+
`)}function JA(t){return{curl:"cURL",javascript:"JavaScript",python:"Python",go:"Go",java:"Java"}[t]}function QA(t,e){return XA(t,e)}function m0(t){return JA(t)}var Vd={exports:{}},g0;function WA(){return g0||(g0=1,(function(t){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var n=(function(r){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,a=0,c={},d={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function j(E){return E instanceof f?new f(E.type,j(E.content),E.alias):Array.isArray(E)?E.map(j):E.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(j){return Object.prototype.toString.call(j).slice(8,-1)},objId:function(j){return j.__id||Object.defineProperty(j,"__id",{value:++a}),j.__id},clone:function j(E,O){O=O||{};var R,B;switch(d.util.type(E)){case"Object":if(B=d.util.objId(E),O[B])return O[B];R={},O[B]=R;for(var M in E)E.hasOwnProperty(M)&&(R[M]=j(E[M],O));return R;case"Array":return B=d.util.objId(E),O[B]?O[B]:(R=[],O[B]=R,E.forEach(function(z,F){R[F]=j(z,O)}),R);default:return E}},getLanguage:function(j){for(;j;){var E=s.exec(j.className);if(E)return E[1].toLowerCase();j=j.parentElement}return"none"},setLanguage:function(j,E){j.className=j.className.replace(RegExp(s,"gi"),""),j.classList.add("language-"+E)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(R){var j=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(R.stack)||[])[1];if(j){var E=document.getElementsByTagName("script");for(var O in E)if(E[O].src==j)return E[O]}return null}},isActive:function(j,E,O){for(var R="no-"+E;j;){var B=j.classList;if(B.contains(E))return!0;if(B.contains(R))return!1;j=j.parentElement}return!!O}},languages:{plain:c,plaintext:c,text:c,txt:c,extend:function(j,E){var O=d.util.clone(d.languages[j]);for(var R in E)O[R]=E[R];return O},insertBefore:function(j,E,O,R){R=R||d.languages;var B=R[j],M={};for(var z in B)if(B.hasOwnProperty(z)){if(z==E)for(var F in O)O.hasOwnProperty(F)&&(M[F]=O[F]);O.hasOwnProperty(z)||(M[z]=B[z])}var X=R[j];return R[j]=M,d.languages.DFS(d.languages,function(W,G){G===X&&W!=j&&(this[W]=M)}),M},DFS:function j(E,O,R,B){B=B||{};var M=d.util.objId;for(var z in E)if(E.hasOwnProperty(z)){O.call(E,z,E[z],R||z);var F=E[z],X=d.util.type(F);X==="Object"&&!B[M(F)]?(B[M(F)]=!0,j(F,O,null,B)):X==="Array"&&!B[M(F)]&&(B[M(F)]=!0,j(F,O,z,B))}}},plugins:{},highlightAll:function(j,E){d.highlightAllUnder(document,j,E)},highlightAllUnder:function(j,E,O){var R={callback:O,container:j,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};d.hooks.run("before-highlightall",R),R.elements=Array.prototype.slice.apply(R.container.querySelectorAll(R.selector)),d.hooks.run("before-all-elements-highlight",R);for(var B=0,M;M=R.elements[B++];)d.highlightElement(M,E===!0,R.callback)},highlightElement:function(j,E,O){var R=d.util.getLanguage(j),B=d.languages[R];d.util.setLanguage(j,R);var M=j.parentElement;M&&M.nodeName.toLowerCase()==="pre"&&d.util.setLanguage(M,R);var z=j.textContent,F={element:j,language:R,grammar:B,code:z};function X(G){F.highlightedCode=G,d.hooks.run("before-insert",F),F.element.innerHTML=F.highlightedCode,d.hooks.run("after-highlight",F),d.hooks.run("complete",F),O&&O.call(F.element)}if(d.hooks.run("before-sanity-check",F),M=F.element.parentElement,M&&M.nodeName.toLowerCase()==="pre"&&!M.hasAttribute("tabindex")&&M.setAttribute("tabindex","0"),!F.code){d.hooks.run("complete",F),O&&O.call(F.element);return}if(d.hooks.run("before-highlight",F),!F.grammar){X(d.util.encode(F.code));return}if(E&&r.Worker){var W=new Worker(d.filename);W.onmessage=function(G){X(G.data)},W.postMessage(JSON.stringify({language:F.language,code:F.code,immediateClose:!0}))}else X(d.highlight(F.code,F.grammar,F.language))},highlight:function(j,E,O){var R={code:j,grammar:E,language:O};if(d.hooks.run("before-tokenize",R),!R.grammar)throw new Error('The language "'+R.language+'" has no grammar.');return R.tokens=d.tokenize(R.code,R.grammar),d.hooks.run("after-tokenize",R),f.stringify(d.util.encode(R.tokens),R.language)},tokenize:function(j,E){var O=E.rest;if(O){for(var R in O)E[R]=O[R];delete E.rest}var B=new b;return v(B,B.head,j),g(j,B,E,B.head,0),A(B)},hooks:{all:{},add:function(j,E){var O=d.hooks.all;O[j]=O[j]||[],O[j].push(E)},run:function(j,E){var O=d.hooks.all[j];if(!(!O||!O.length))for(var R=0,B;B=O[R++];)B(E)}},Token:f};r.Prism=d;function f(j,E,O,R){this.type=j,this.content=E,this.alias=O,this.length=(R||"").length|0}f.stringify=function j(E,O){if(typeof E=="string")return E;if(Array.isArray(E)){var R="";return E.forEach(function(X){R+=j(X,O)}),R}var B={type:E.type,content:j(E.content,O),tag:"span",classes:["token",E.type],attributes:{},language:O},M=E.alias;M&&(Array.isArray(M)?Array.prototype.push.apply(B.classes,M):B.classes.push(M)),d.hooks.run("wrap",B);var z="";for(var F in B.attributes)z+=" "+F+'="'+(B.attributes[F]||"").replace(/"/g,""")+'"';return"<"+B.tag+' class="'+B.classes.join(" ")+'"'+z+">"+B.content+"</"+B.tag+">"};function h(j,E,O,R){j.lastIndex=E;var B=j.exec(O);if(B&&R&&B[1]){var M=B[1].length;B.index+=M,B[0]=B[0].slice(M)}return B}function g(j,E,O,R,B,M){for(var z in O)if(!(!O.hasOwnProperty(z)||!O[z])){var F=O[z];F=Array.isArray(F)?F:[F];for(var X=0;X<F.length;++X){if(M&&M.cause==z+","+X)return;var W=F[X],G=W.inside,we=!!W.lookbehind,ye=!!W.greedy,xe=W.alias;if(ye&&!W.pattern.global){var _=W.pattern.toString().match(/[imsuy]*$/)[0];W.pattern=RegExp(W.pattern.source,_+"g")}for(var ee=W.pattern||W,he=R.next,$=B;he!==E.tail&&!(M&&$>=M.reach);$+=he.value.length,he=he.next){var te=he.value;if(E.length>j.length)return;if(!(te instanceof f)){var L=1,P;if(ye){if(P=h(ee,$,j,we),!P||P.index>=j.length)break;var Re=P.index,ue=P.index+P[0].length,Se=$;for(Se+=he.value.length;Re>=Se;)he=he.next,Se+=he.value.length;if(Se-=he.value.length,$=Se,he.value instanceof f)continue;for(var Ne=he;Ne!==E.tail&&(Se<ue||typeof Ne.value=="string");Ne=Ne.next)L++,Se+=Ne.value.length;L--,te=j.slice($,Se),P.index-=$}else if(P=h(ee,0,te,we),!P)continue;var Re=P.index,Be=P[0],Ze=te.slice(0,Re),_e=te.slice(Re+Be.length),Ke=$+te.length;M&&Ke>M.reach&&(M.reach=Ke);var gt=he.prev;Ze&&(gt=v(E,gt,Ze),$+=Ze.length),S(E,gt,L);var se=new f(z,G?d.tokenize(Be,G):Be,xe,Be);if(he=v(E,gt,se),_e&&v(E,he,_e),L>1){var de={cause:z+","+X,reach:Ke};g(j,E,O,he.prev,$,de),M&&de.reach>M.reach&&(M.reach=de.reach)}}}}}}function b(){var j={value:null,prev:null,next:null},E={value:null,prev:j,next:null};j.next=E,this.head=j,this.tail=E,this.length=0}function v(j,E,O){var R=E.next,B={value:O,prev:E,next:R};return E.next=B,R.prev=B,j.length++,B}function S(j,E,O){for(var R=E.next,B=0;B<O&&R!==j.tail;B++)R=R.next;E.next=R,R.prev=E,j.length-=B}function A(j){for(var E=[],O=j.head.next;O!==j.tail;)E.push(O.value),O=O.next;return E}if(!r.document)return r.addEventListener&&(d.disableWorkerMessageHandler||r.addEventListener("message",function(j){var E=JSON.parse(j.data),O=E.language,R=E.code,B=E.immediateClose;r.postMessage(d.highlight(R,d.languages[O],O)),B&&r.close()},!1)),d;var C=d.util.currentScript();C&&(d.filename=C.src,C.hasAttribute("data-manual")&&(d.manual=!0));function T(){d.manual||d.highlightAll()}if(!d.manual){var D=document.readyState;D==="loading"||D==="interactive"&&C&&C.defer?document.addEventListener("DOMContentLoaded",T):window.requestAnimationFrame?window.requestAnimationFrame(T):window.setTimeout(T,16)}return d})(e);t.exports&&(t.exports=n),typeof Xm<"u"&&(Xm.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(s,a){var c={};c["language-"+a]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[a]},c.cdata=/^<!\[CDATA\[|\]\]>$/i;var d={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:c}};d["language-"+a]={pattern:/[\s\S]+/,inside:n.languages[a]};var f={};f[s]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:d},n.languages.insertBefore("markup","cdata",f)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,s){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:n.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(r){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+s.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var a=r.languages.markup;a&&(a.tag.addInlined("style","css"),a.tag.addAttribute("style","css"))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,(function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",s=function(C,T){return"✖ Error "+C+" while fetching file: "+T},a="✖ Error: File does not exist or is empty",c={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},d="data-src-status",f="loading",h="loaded",g="failed",b="pre[data-src]:not(["+d+'="'+h+'"]):not(['+d+'="'+f+'"])';function v(C,T,D){var j=new XMLHttpRequest;j.open("GET",C,!0),j.onreadystatechange=function(){j.readyState==4&&(j.status<400&&j.responseText?T(j.responseText):j.status>=400?D(s(j.status,j.statusText)):D(a))},j.send(null)}function S(C){var T=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(C||"");if(T){var D=Number(T[1]),j=T[2],E=T[3];return j?E?[D,Number(E)]:[D,void 0]:[D,D]}}n.hooks.add("before-highlightall",function(C){C.selector+=", "+b}),n.hooks.add("before-sanity-check",function(C){var T=C.element;if(T.matches(b)){C.code="",T.setAttribute(d,f);var D=T.appendChild(document.createElement("CODE"));D.textContent=r;var j=T.getAttribute("data-src"),E=C.language;if(E==="none"){var O=(/\.(\w+)$/.exec(j)||[,"none"])[1];E=c[O]||O}n.util.setLanguage(D,E),n.util.setLanguage(T,E);var R=n.plugins.autoloader;R&&R.loadLanguages(E),v(j,function(B){T.setAttribute(d,h);var M=S(T.getAttribute("data-range"));if(M){var z=B.split(/\r\n?|\n/g),F=M[0],X=M[1]==null?z.length:M[1];F<0&&(F+=z.length),F=Math.max(0,Math.min(F-1,z.length)),X<0&&(X+=z.length),X=Math.max(0,Math.min(X,z.length)),B=z.slice(F,X).join(`
|
|
46
|
+
`),T.hasAttribute("data-start")||T.setAttribute("data-start",String(F+1))}D.textContent=B,n.highlightElement(D)},function(B){T.setAttribute(d,g),D.textContent=B})}}),n.plugins.fileHighlight={highlight:function(T){for(var D=(T||document).querySelectorAll(b),j=0,E;E=D[j++];)n.highlightElement(E)}};var A=!1;n.fileHighlight=function(){A||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),A=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(Vd)),Vd.exports}var ZA=WA();const ek=Jm(ZA);Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json,(function(t){var e=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+e.source+")?|"+e.source+"(?:[ ]+"+n.source+")?)",s=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function c(d,f){f=(f||"").replace(/m/g,"")+"m";var h=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return d});return RegExp(h,f)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+s+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:c(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:c(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:c(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:c(a),lookbehind:!0,greedy:!0},number:{pattern:c(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:e,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(Prism),Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,(function(t){var e="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+e),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+e),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+e),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+e),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=t.languages.bash;for(var s=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=r.variable[1].inside,c=0;c<s.length;c++)a[s[c]]=t.languages.bash[s[c]];t.languages.sh=t.languages.bash,t.languages.shell=t.languages.bash})(Prism);var y0={},b0;function tk(){return b0||(b0=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),y0}tk(),Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"];var x0={},v0;function nk(){return v0||(v0=1,(function(t){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:e,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),x0}nk();const Rr=({code:t,language:e,title:n,showCopy:r=!0,theme:s="dark",wrap:a=!1})=>{const[c,d]=og.useState(!1);I.useEffect(()=>{ek.highlightAll()},[t,s]);const f=async()=>{try{await navigator.clipboard.writeText(t),d(!0),setTimeout(()=>d(!1),2e3)}catch(S){console.error("Failed to copy text: ",S)}},h=s==="dark"?"bg-gray-900 border-gray-700":"bg-gray-50 border-gray-200",g=s==="dark"?"bg-gray-800 border-gray-700 text-gray-300":"bg-gray-100 border-gray-200 text-gray-700",b=s==="dark"?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-900",v={"--fd-code-muted":s==="dark"?"#9ca3af":"#64748b","--fd-code-string":s==="dark"?"#86efac":"#15803d","--fd-code-keyword":s==="dark"?"#c4b5fd":"#6d28d9","--fd-code-number":s==="dark"?"#fb923c":"#c2410c","--fd-code-accent":s==="dark"?"#93c5fd":"#1d4ed8"};return p.jsxs("div",{className:`flexdoc-code min-w-0 rounded-lg overflow-hidden border ${h}`,"data-code-theme":s,style:v,children:[(n||r)&&p.jsxs("div",{className:`flex items-center justify-between gap-3 px-3 sm:px-4 py-2 border-b ${g}`,children:[n&&p.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:n}),r&&p.jsx("button",{onClick:f,className:`shrink-0 flex items-center gap-1 text-xs transition-colors ${b}`,"aria-label":"Copy code to clipboard",children:c?p.jsxs(p.Fragment,{children:[p.jsx(fg,{className:"w-3 h-3"}),p.jsx("span",{children:"Copied"})]}):p.jsxs(p.Fragment,{children:[p.jsx(nA,{className:"w-3 h-3"}),p.jsx("span",{children:"Copy"})]})})]}),p.jsx("div",{className:`p-3 sm:p-4 overflow-x-auto ${s==="dark"?"bg-gray-800":"bg-white"}`,children:p.jsx("pre",{className:`m-0 text-xs sm:text-sm ${a?"whitespace-pre-wrap break-words":""} ${s==="dark"?"text-gray-100":"text-gray-800"}`,children:p.jsx("code",{className:`language-${e} bg-transparent`,children:t})})})]})};function ik(t){const e=Array.isArray(t.type)?t.type.join(" | "):t.type;return e?t.format?`${e} (${t.format})`:e:t.oneOf?"oneOf":t.anyOf?"anyOf":t.allOf?"allOf":t.const!==void 0?"const":"any"}const Dr=({spec:t,schema:e,theme:n,required:r=!1,level:s=0,seen:a=new Set,requiredPropsFirst:c=!1,sortPropsAlphabetically:d=!1})=>{const f={spec:t,theme:n,requiredPropsFirst:c,sortPropsAlphabetically:d};if(Ln.isReference(e)){if(a.has(e.$ref))return p.jsxs("div",{className:"py-1 text-sm opacity-70",children:["↳ ",p.jsx("code",{children:e.$ref.replace("#/components/schemas/","")})," (recursive reference)"]});const A=new Set(a);A.add(e.$ref);let C;try{C=Ln.resolveReference(t,e.$ref)}catch{return p.jsxs("div",{className:"py-1 text-sm text-red-500",children:["Unresolved reference: ",p.jsx("code",{children:e.$ref})]})}return p.jsx(Dr,{...f,schema:C,required:r,level:s,seen:A})}const h=n==="dark"?"text-gray-400":"text-gray-600",g=n==="dark"?"border-gray-700":"border-gray-200",b=[["All of",e.allOf],["One of",e.oneOf],["Any of",e.anyOf]],v=new Set(e.required||[]),S=Object.entries(e.properties||{}).sort(([A],[C])=>{if(c){const T=Number(v.has(C))-Number(v.has(A));if(T)return T}return d?A.localeCompare(C):0});return p.jsxs("div",{className:s?`border-l-2 ${g} pl-3`:"",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-2 py-1",children:[p.jsx("span",{className:n==="dark"?"text-blue-300":"text-blue-600",children:ik(e)}),r&&p.jsx("span",{className:"rounded bg-red-100 px-2 py-0.5 text-xs text-red-700 dark:bg-red-900/30 dark:text-red-300",children:"required"}),(e.nullable||Array.isArray(e.type)&&e.type.includes("null"))&&p.jsx("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-700 dark:bg-gray-700 dark:text-gray-300",children:"nullable"}),e.deprecated&&p.jsx("span",{className:"rounded bg-orange-100 px-2 py-0.5 text-xs text-orange-700",children:"deprecated"}),e.readOnly&&p.jsx("span",{className:"text-xs opacity-60",children:"readOnly"}),e.writeOnly&&p.jsx("span",{className:"text-xs opacity-60",children:"writeOnly"})]}),e.description&&p.jsx("p",{className:`mt-1 text-sm leading-relaxed ${h}`,children:e.description}),e.enum&&p.jsxs("p",{className:`mt-1 text-xs ${h}`,children:["Allowed: ",e.enum.map(String).join(", ")]}),e.const!==void 0&&p.jsxs("p",{className:`mt-1 text-xs ${h}`,children:["Constant: ",JSON.stringify(e.const)]}),e.default!==void 0&&p.jsxs("p",{className:`mt-1 text-xs ${h}`,children:["Default: ",JSON.stringify(e.default)]}),(e.example!==void 0||e.examples?.length)&&p.jsx("div",{className:"mt-2",children:p.jsx(Rr,{code:JSON.stringify(e.example??e.examples?.[0],null,2),language:"json",title:"Example",showCopy:!1,theme:n,wrap:!0})}),e.items&&p.jsxs("div",{className:"mt-3",children:[p.jsx("div",{className:"mb-1 text-xs font-semibold uppercase tracking-wide opacity-60",children:"Items"}),p.jsx(Dr,{...f,schema:e.items,level:s+1,seen:a})]}),b.map(([A,C])=>C?.length?p.jsxs("div",{className:"mt-3",children:[p.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-wide opacity-60",children:A}),p.jsx("div",{className:"space-y-3",children:C.map((T,D)=>p.jsx(Dr,{...f,schema:T,level:s+1,seen:a},D))})]},A):null),S.length>0&&p.jsx("div",{className:"mt-3 space-y-3",children:S.map(([A,C])=>p.jsxs("div",{children:[p.jsx("div",{className:"font-mono text-sm font-medium",children:A}),p.jsx(Dr,{...f,schema:C,required:v.has(A),level:s+1,seen:a})]},A))}),e.additionalProperties&&typeof e.additionalProperties=="object"&&p.jsxs("div",{className:"mt-3",children:[p.jsx("div",{className:"mb-1 text-xs font-semibold uppercase tracking-wide opacity-60",children:"Additional properties"}),p.jsx(Dr,{...f,schema:e.additionalProperties,level:s+1,seen:a})]})]})};function cn(t){return{preRequest:t?.preRequest||"",tests:t?.tests||""}}function rk(t){return{...t,query:t.query?.map(e=>({...e})),headers:t.headers?.map(e=>({...e})),urlencoded:t.urlencoded?.map(e=>({...e})),formData:t.formData?.map(e=>({...e})),binary:t.binary?{...t.binary}:void 0,graphql:t.graphql?{...t.graphql}:void 0,auth:t.auth?{...t.auth}:void 0}}function Do(t){return Object.assign(Object.create(null),t)}function Wt(t){if(typeof t=="string")return t;if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch{return String(t)}}function el(t,e){if(Object.is(t,e))return!0;if(typeof t!=typeof e||t===null||e===null)return!1;if(Array.isArray(t))return Array.isArray(e)&&t.length===e.length&&t.every((n,r)=>el(n,e[r]));if(typeof t=="object"&&typeof e=="object"){const n=t,r=e,s=Object.keys(n),a=Object.keys(r);return s.length===a.length&&s.every(c=>Object.prototype.hasOwnProperty.call(r,c)&&el(n[c],r[c]))}return!1}function li(t){throw new Error(t)}function sk(t){const e=h=>{Object.is(t,h)||li(`expected ${Wt(t)} to equal ${Wt(h)}`)},n=h=>{el(t,h)||li(`expected ${Wt(t)} to deeply equal ${Wt(h)}`)},r=h=>{(typeof t=="string"?t.includes(String(h)):Array.isArray(t)&&t.some(b=>el(b,h)))||li(`expected ${Wt(t)} to include ${Wt(h)}`)},s=(h,...g)=>{(!t||typeof t!="object"||!Object.prototype.hasOwnProperty.call(t,h))&&li(`expected value to have property ${h}`),g.length>0&&!el(t[h],g[0])&&li(`expected property ${h} to equal ${Wt(g[0])}`)},f={above:h=>{(typeof t!="number"||t<=h)&&li(`expected ${Wt(t)} to be above ${h}`)},below:h=>{(typeof t!="number"||t>=h)&&li(`expected ${Wt(t)} to be below ${h}`)},oneOf:h=>{h.some(g=>el(t,g))||li(`expected ${Wt(t)} to be one of ${Wt(h)}`)}};return Object.defineProperties(f,{ok:{get:()=>(t||li(`expected ${Wt(t)} to be truthy`),!0)},true:{get:()=>(t!==!0&&li(`expected ${Wt(t)} to be true`),!0)},false:{get:()=>(t!==!1&&li(`expected ${Wt(t)} to be false`),!0)}}),{to:{equal:e,eql:n,include:r,match:h=>{(typeof t!="string"||!h.test(t))&&li(`expected ${Wt(t)} to match ${h}`)},have:{property:s},be:f}}}function Pd(t,e){return t.findIndex(n=>n.key.toLowerCase()===e.toLowerCase())}function lk(t){const e=()=>t.headers||(t.headers=[]),n=(r,s)=>{const a=e(),c=Pd(a,r),d={key:r,value:String(s),enabled:!0};c>=0?a[c]=d:a.push(d)};return{get(r){const s=Pd(e(),r);return s>=0?e()[s].value:void 0},has(r){return Pd(e(),r)>=0},set:n,upsert({key:r,value:s}){n(r,s)},remove(r){t.headers=e().filter(s=>s.key.toLowerCase()!==r.toLowerCase())},toObject(){const r={};for(const s of e())s.enabled!==!1&&(r[s.key]=s.value);return r}}}function ak(t){return{get(e){return t.find(([n])=>n.toLowerCase()===e.toLowerCase())?.[1]},has(e){return t.some(([n])=>n.toLowerCase()===e.toLowerCase())},toObject(){const e={};for(const[n,r]of t)e[n]=r;return e}}}async function w0(t){const e=rk(t.draft),n=Do(t.variables||{}),r=Do(t.collectionVariables||{}),s=Do(t.externalVariables||{}),a=Do(t.environmentVariables||{}),c=[],d=[],f=[],h=[],g=[],b=O=>{Object.prototype.hasOwnProperty.call(a,O)?n[O]=a[O]:Object.prototype.hasOwnProperty.call(s,O)?n[O]=s[O]:Object.prototype.hasOwnProperty.call(r,O)?n[O]=r[O]:delete n[O]},v={get(O){return a[O]},has(O){return Object.prototype.hasOwnProperty.call(a,O)},set(O,R){const B=String(R);a[O]=B,n[O]=B,d.push({action:"set",key:O,value:B})},unset(O){delete a[O],b(O),d.push({action:"unset",key:O})},replaceIn(O){return O.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(R,B)=>{const M=B.trim();return Object.prototype.hasOwnProperty.call(a,M)?a[M]:R})}},S={get(O){return r[O]},has(O){return Object.prototype.hasOwnProperty.call(r,O)},set(O,R){const B=String(R);r[O]=B,b(O),c.push({action:"set",key:O,value:B})},unset(O){delete r[O],b(O),c.push({action:"unset",key:O})},replaceIn(O){return O.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(R,B)=>{const M=B.trim();return Object.prototype.hasOwnProperty.call(r,M)?r[M]:R})}},A={get(O){return n[O]},has(O){return Object.prototype.hasOwnProperty.call(n,O)},set(O,R){n[O]=String(R)},unset(O){delete n[O]},replaceIn(O){return O.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(R,B)=>{const M=B.trim();return Object.prototype.hasOwnProperty.call(n,M)?n[M]:R})}},C={get raw(){return e.body||""},set raw(O){e.body=String(O),e.bodyMode="raw"}},T={get method(){return e.method},set method(O){e.method=String(O)},get url(){return e.url},set url(O){e.url=String(O)},headers:lk(e),body:C},D=t.response?{code:t.response.status,status:t.response.statusText,responseTime:t.response.responseTime,headers:ak(t.response.headers),text:()=>t.response?.body||"",json:()=>JSON.parse(t.response?.body||"")}:void 0,j={request:T,response:D,environment:v,collection:S,variables:A,expect:sk,test(O,R){if(t.phase!=="tests")throw new Error("flex.test is only available in post-response test scripts.");const B=Promise.resolve().then(R).then(()=>{f.push({name:O,passed:!0})}).catch(M=>{f.push({name:O,passed:!1,error:M instanceof Error?M.message:String(M)})});g.push(B)}},E={log:(...O)=>h.push(O.map(Wt).join(" ")),info:(...O)=>h.push(O.map(Wt).join(" ")),warn:(...O)=>h.push(`WARN ${O.map(Wt).join(" ")}`),error:(...O)=>h.push(`ERROR ${O.map(Wt).join(" ")}`)};try{return await new Function("flex","console",`"use strict"; return (async () => {
|
|
47
|
+
${t.script}
|
|
48
|
+
})();`)(j,E),await Promise.all(g),{draft:e,variables:n,collectionVariables:r,externalVariables:s,environmentVariables:a,collectionChanges:c,environmentChanges:d,tests:f,logs:h}}catch(O){return await Promise.all(g),{draft:e,variables:n,collectionVariables:r,externalVariables:s,environmentVariables:a,collectionChanges:c,environmentChanges:d,tests:f,logs:h,error:O instanceof Error?O.message:String(O)}}}function Kd(t){return(t||[]).filter(e=>e.enabled!==!1&&e.key.trim()!=="")}function S0(t){if(t.bodyMode)return t.bodyMode;if(t.binary?.file||t.binary?.fileName)return"binary";if(t.formData?.length)return"formdata";if(t.urlencoded?.length)return"urlencoded";if(t.graphql&&(t.graphql.query||t.graphql.variables))return"graphql";if(!t.body)return"none";const e=(t.contentType||"").toLowerCase();return e.includes("application/x-www-form-urlencoded")?"urlencoded":e.includes("multipart/form-data")?"formdata":e.includes("json")?"json":"raw"}function A0(t){const e=new Set,n=t.auth;return n?.type==="apiKey"&&n.in==="cookie"?e.add("cookies"):n?.type==="digest"?e.add("digest"):n?.type==="hawk"?e.add("hawk"):n?.type==="ntlm"?e.add("ntlm"):n?.type==="oauth1"?e.add("oauth1"):n?.type==="awsv4"&&e.add("awsv4"),t.headers?.some(r=>r.enabled!==!1&&r.key.trim().toLowerCase()==="cookie")&&e.add("cookies"),t.hostExecution?.cookieJar==="session"&&e.add("cookies"),t.hostExecution?.certificateId&&e.add("clientCertificates"),[...e]}function ok(t,e){if(!e.length)return t;const n=t.indexOf("#"),r=n>=0?t.slice(0,n):t,s=n>=0?t.slice(n):"",a=e.map(({key:d,value:f})=>`${encodeURIComponent(d)}=${encodeURIComponent(f)}`).join("&"),c=r.includes("?")?r.endsWith("?")||r.endsWith("&")?"":"&":"?";return`${r}${c}${a}${s}`}function ck(t){const e=t.indexOf("#"),n=e>=0?t.slice(0,e):t,r=e>=0?t.slice(e):"",s=n.indexOf("?");if(s<0)return{url:t,query:[]};const a=[];return new URLSearchParams(n.slice(s+1)).forEach((d,f)=>a.push({key:f,value:d})),{url:`${n.slice(0,s)}${r}`,query:a}}function Yd(t,e){return t.find(([n])=>n.toLowerCase()===e.toLowerCase())?.[1]}function _o(t,e,n){for(let r=t.length-1;r>=0;r-=1)t[r][0].toLowerCase()===e.toLowerCase()&&t.splice(r,1);t.push([e,n])}function uk(t){const e={};for(const[n,r]of t)e[n]=r;return e}function dk(t){const e=t.headerEntries;if(!Array.isArray(e))return Object.entries(t.headers||{});const n=[];for(const r of e){if(Array.isArray(r)&&r.length>=2){n.push([String(r[0]),String(r[1])]);continue}if(r&&typeof r=="object"&&"key"in r&&"value"in r){const s=r;s.enabled!==!1&&n.push([String(s.key),String(s.value)])}}return n.length||e.length===0?n:Object.entries(t.headers||{})}function fk(t){if(typeof globalThis.btoa=="function"){if(typeof TextEncoder>"u")throw new Error("Basic auth requires UTF-8 encoding support.");const n=new TextEncoder().encode(t);let r="";for(const s of n)r+=String.fromCharCode(s);return globalThis.btoa(r)}const e=globalThis.Buffer;if(e?.from)return e.from(t,"utf8").toString("base64");throw new Error("Basic auth requires a Base64 encoder in this runtime.")}function Fe(t,e){return t===void 0||t===""?t:t.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(n,r)=>{const s=r.trim();return Object.prototype.hasOwnProperty.call(e,s)?e[s]:n})}function hk(t,e){if(!t||t.type==="none"||t.type==="inherit")return t;if(t.type==="bearer")return{type:"bearer",token:Fe(t.token,e)||""};if(t.type==="oauth2"){const n={...t,accessToken:Fe(t.accessToken,e)||""};return t.authorizationUrl!==void 0&&(n.authorizationUrl=Fe(t.authorizationUrl,e)),t.tokenUrl!==void 0&&(n.tokenUrl=Fe(t.tokenUrl,e)),t.clientId!==void 0&&(n.clientId=Fe(t.clientId,e)),t.clientSecret!==void 0&&(n.clientSecret=Fe(t.clientSecret,e)),t.redirectUri!==void 0&&(n.redirectUri=Fe(t.redirectUri,e)),t.scopes!==void 0&&(n.scopes=t.scopes.map(r=>Fe(r,e)||"")),t.username!==void 0&&(n.username=Fe(t.username,e)),t.password!==void 0&&(n.password=Fe(t.password,e)),t.refreshToken!==void 0&&(n.refreshToken=Fe(t.refreshToken,e)),n}return t.type==="basic"?{type:"basic",username:Fe(t.username,e)||"",password:Fe(t.password,e)||""}:t.type==="apiKey"?{type:"apiKey",key:Fe(t.key,e)||"",value:Fe(t.value,e)||"",in:t.in}:t.type==="digest"?{type:"digest",username:Fe(t.username,e)||"",password:Fe(t.password,e)||""}:t.type==="hawk"?{...t,id:Fe(t.id,e)||"",key:Fe(t.key,e)||"",ext:Fe(t.ext,e)}:t.type==="ntlm"?{...t,username:Fe(t.username,e)||"",password:Fe(t.password,e)||"",domain:Fe(t.domain,e),workstation:Fe(t.workstation,e)}:t.type==="oauth1"?{...t,consumerKey:Fe(t.consumerKey,e)||"",consumerSecret:Fe(t.consumerSecret,e)||"",token:Fe(t.token,e),tokenSecret:Fe(t.tokenSecret,e),realm:Fe(t.realm,e)}:{...t,accessKey:Fe(t.accessKey,e)||"",secretKey:Fe(t.secretKey,e)||"",sessionToken:Fe(t.sessionToken,e),region:Fe(t.region,e)||"",service:Fe(t.service,e)||""}}function k0(t,e){return{method:Fe(t.method,e)??t.method,url:Fe(t.url,e)??t.url,query:t.query?.map(n=>({...n,key:Fe(n.key,e)||"",value:Fe(n.value,e)||""})),headers:t.headers?.map(n=>({...n,key:Fe(n.key,e)||"",value:Fe(n.value,e)||""})),body:Fe(t.body,e),contentType:Fe(t.contentType,e),bodyMode:t.bodyMode,urlencoded:t.urlencoded?.map(n=>({...n,key:Fe(n.key,e)||"",value:Fe(n.value,e)||""})),formData:t.formData?.map(n=>({...n,key:Fe(n.key,e)||"",value:Fe(n.value,e)||"",fileName:Fe(n.fileName,e),contentType:Fe(n.contentType,e)})),binary:t.binary?{...t.binary,fileName:Fe(t.binary.fileName,e),contentType:Fe(t.binary.contentType,e)}:void 0,graphql:t.graphql?{query:Fe(t.graphql.query,e)||"",variables:Fe(t.graphql.variables,e)||""}:void 0,auth:hk(t.auth,e),hostExecution:t.hostExecution?{...t.hostExecution}:void 0}}function pk(t,e,n){const r=t.auth;if(!(!r||r.type==="none"||r.type==="inherit")){if(r.type==="bearer"){r.token&&_o(e,"Authorization",`Bearer ${r.token}`);return}if(r.type==="oauth2"){r.accessToken&&_o(e,"Authorization",`Bearer ${r.accessToken}`);return}if(r.type==="basic"){(r.username||r.password)&&_o(e,"Authorization",`Basic ${fk(`${r.username}:${r.password}`)}`);return}r.type!=="apiKey"||!r.key||(r.in==="query"?n.push({key:r.key,value:r.value}):r.in==="header"&&_o(e,r.key,r.value))}}function mk(t,e={}){const n=e.variables?k0(t,e.variables):t,r=(n.method||"GET").trim().toUpperCase(),s=n.url.trim();if(!s)throw new Error("Request URL is required.");const a=A0(n);if(a.length>0)throw new Error(`This request requires API host execution (${a.join(", ")}).`);const c=Kd(n.query),d=Kd(n.headers).map(({key:A,value:C})=>[A,C]);pk(n,d,c);let f,h,g;const b=S0(n);if(b!=="none"){if(b==="formdata")for(let T=d.length-1;T>=0;T-=1)d[T][0].toLowerCase()==="content-type"&&d.splice(T,1);const A=Yd(d,"Content-Type"),C=n.contentType?.trim();if(b==="urlencoded")f=Kd(n.urlencoded).map(({key:D,value:j})=>`${encodeURIComponent(D)}=${encodeURIComponent(j)}`).join("&"),g=f,A||d.push(["Content-Type",C||"application/x-www-form-urlencoded"]),h="form";else if(b==="formdata"){const T=new FormData,D=[];for(const j of(n.formData||[]).filter(E=>E.enabled!==!1&&E.key.trim()!==""))if(j.type==="file"){if(!j.file)throw new Error(`File field "${j.key}" needs a file selection.`);T.append(j.key,j.file,j.fileName||j.file.name),D.push(`${j.key}=[file: ${j.fileName||j.file.name}]`)}else T.append(j.key,j.value),D.push(`${j.key}=${j.value}`);f=D.join(`
|
|
49
|
+
`),g=T,h="multipart"}else if(b==="binary"){const T=n.binary;if(!T?.file)throw new Error("Binary body needs a file selection.");f=`[file: ${T.fileName||T.file.name}]`,g=T.file,A||d.push(["Content-Type",C||T.contentType||T.file.type||"application/octet-stream"]),h="binary"}else if(b==="graphql"){const T=n.graphql?.query||"",D=n.graphql?.variables?.trim()||"";let j={};if(D)try{j=JSON.parse(D)}catch{throw new Error("GraphQL variables must be valid JSON.")}f=JSON.stringify({query:T,variables:j}),g=f,A||d.push(["Content-Type",C||"application/json"]),h="json"}else{f=n.body||"",g=f;const T=b==="json"?"application/json":void 0;!A&&(C||T)&&d.push(["Content-Type",C||T]),h=b==="json"||(A||C||T)?.includes("json")?"json":"text"}}const v=uk(d);return{url:ok(s,c),method:r,headers:v,headerEntries:d,body:f,bodyKind:h,init:{method:r,headers:d,body:g}}}function gk(t){const e=dk(t),n=ck(t.url),r=t.bodyKind==="binary"&&typeof File<"u"&&t.init.body instanceof File?t.init.body:void 0;return{method:t.method,url:n.url,query:n.query,headers:e.map(([s,a])=>({key:s,value:a})),body:t.body,contentType:Yd(e,"Content-Type"),bodyMode:t.bodyKind==="json"?"json":t.bodyKind==="form"?"urlencoded":t.bodyKind==="multipart"?"formdata":t.bodyKind==="binary"?"binary":t.body?"raw":"none",binary:t.bodyKind==="binary"?{file:r,fileName:r?.name,contentType:Yd(e,"Content-Type")}:void 0,urlencoded:t.bodyKind==="form"&&t.body?[...new URLSearchParams(t.body).entries()].map(([s,a])=>({key:s,value:a,enabled:!0})):void 0,auth:{type:"none"}}}function C0(t,e={}){return mk(t,e)}function ca(t){return S0(t)}function N0(t){return A0(t)}function yk(t,e){return k0(t,e)}function bk(t){return gk(t)}function xk(t,e,n){return t.paths[e]?.[n.toLowerCase()]}function vk(t,e){const n=t.components?.securitySchemes?.[e];if(!n)return;if(!("$ref"in n))return n;const r=n.$ref,s="#/components/securitySchemes/";if(!r.startsWith(s))return;const a=t.components?.securitySchemes?.[decodeURIComponent(r.slice(s.length))];return a&&!("$ref"in a)?a:void 0}function wk(t,e,n,r){const a=xk(t,e,n)?.security??t.security??[];if(!a.length)return;const c=a.find(f=>{const h=Object.keys(f);return h.length===1&&!!r[h[0]]});if(c)return c;const d=a.find(f=>{const h=Object.keys(f);return h.length>0&&h.every(g=>!!r[g])});return d||(a.find(f=>Object.keys(f).length===0)??a[0])}function Sk(t,e,n=[]){if(e){if(t.type==="http"&&t.scheme?.toLowerCase()==="bearer")return{type:"bearer",token:e};if(t.type==="http"&&t.scheme?.toLowerCase()==="basic"){const r=e.indexOf(":");return r>=0?{type:"basic",username:e.slice(0,r),password:e.slice(r+1)}:{type:"basic",username:e,password:""}}if(t.type==="apiKey"&&(t.in==="header"||t.in==="query")&&t.name)return{type:"apiKey",key:t.name,value:e,in:t.in};if(t.type==="openIdConnect")return{type:"oauth2",accessToken:e,grantType:"accessToken",scopes:n};if(t.type==="oauth2"){const r=t.flows,s=r?.authorizationCode?["authorizationCode",r.authorizationCode]:r?.clientCredentials?["clientCredentials",r.clientCredentials]:r?.password?["password",r.password]:r?.implicit?["implicit",r.implicit]:void 0,a=s?.[1];return{type:"oauth2",accessToken:e,grantType:s?.[0]||"accessToken",authorizationUrl:a?.authorizationUrl,tokenUrl:a?.tokenUrl,scopes:n.length?n:Object.keys(a?.scopes||{})}}}}function T0(t,e){return{...t,headers:t.headers?.filter(n=>n.key.toLowerCase()!==e.toLowerCase())}}function Ak(t,e){return{...t,query:t.query?.filter(n=>n.key!==e)}}function kk(t,e,n,r,s){let a=bk(s);const c=wk(t,e,n,r.auth||{});if(!c||Object.keys(c).length!==1)return a;const d=Object.keys(c)[0],f=vk(t,d),h=r.auth?.[d]||"";if(!f)return a;if(!h)return{...a,auth:{type:"inherit"}};const g=Sk(f,h,c[d]||[]);return g?(g.type==="bearer"||g.type==="oauth2"||g.type==="basic"?a=T0(a,"Authorization"):g.type==="apiKey"&&g.in==="header"?a=T0(a,g.key):g.type==="apiKey"&&g.in==="query"&&(a=Ak(a,g.key)),{...a,auth:g}):a}function Ck(t,e,n,r,s){const a=p0(t,e,n,r);return{request:kk(t,e,n,r,a),serverUrl:r.serverUrl||s}}const Nk="flexdoc-api-client",Tk=1,tl="workspaces",jk="My Collection",j0=100,E0=256*1024;function ua(){return new Date().toISOString()}function Tn(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function Pe(t,e){return typeof t[e]=="string"}function Lo(t,e){const n=t[e];return n===void 0||typeof n=="number"&&Number.isFinite(n)}function Bo(t){return!Tn(t)||!Pe(t,"key")||!Pe(t,"value")?!1:t.enabled===void 0||typeof t.enabled=="boolean"}function Ek(t){if(!Bo(t))return!1;const e=t;return!(e.type!==void 0&&e.type!=="text"&&e.type!=="file"||e.fileName!==void 0&&typeof e.fileName!="string"||e.contentType!==void 0&&typeof e.contentType!="string"||e.file!==void 0&&typeof File<"u"&&!(e.file instanceof File))}function Ok(t){return!(!Tn(t)||t.fileName!==void 0&&typeof t.fileName!="string"||t.contentType!==void 0&&typeof t.contentType!="string"||t.file!==void 0&&typeof File<"u"&&!(t.file instanceof File))}function Gd(t){if(!Tn(t)||typeof t.type!="string")return!1;if(t.type==="none"||t.type==="inherit")return!0;if(t.type==="bearer")return Pe(t,"token");if(t.type==="oauth2"){if(!Pe(t,"accessToken"))return!1;const e=new Set(["accessToken","authorizationCode","clientCredentials","password","implicit"]);if(t.grantType!==void 0&&(typeof t.grantType!="string"||!e.has(t.grantType))||t.clientAuthentication!==void 0&&t.clientAuthentication!=="body"&&t.clientAuthentication!=="basic")return!1;for(const n of["authorizationUrl","tokenUrl","clientId","clientSecret","redirectUri","username","password","refreshToken"])if(t[n]!==void 0&&typeof t[n]!="string")return!1;return t.scopes===void 0||Array.isArray(t.scopes)&&t.scopes.every(n=>typeof n=="string")}return t.type==="basic"||t.type==="digest"?Pe(t,"username")&&Pe(t,"password"):t.type==="apiKey"?Pe(t,"key")&&Pe(t,"value")&&(t.in==="header"||t.in==="query"||t.in==="cookie"):t.type==="hawk"?Pe(t,"id")&&Pe(t,"key")&&(t.algorithm===void 0||t.algorithm==="sha1"||t.algorithm==="sha256")&&(t.ext===void 0||typeof t.ext=="string"):t.type==="ntlm"?Pe(t,"username")&&Pe(t,"password")&&(t.domain===void 0||typeof t.domain=="string")&&(t.workstation===void 0||typeof t.workstation=="string"):t.type==="oauth1"?Pe(t,"consumerKey")&&Pe(t,"consumerSecret")&&(t.token===void 0||typeof t.token=="string")&&(t.tokenSecret===void 0||typeof t.tokenSecret=="string")&&(t.realm===void 0||typeof t.realm=="string")&&(t.signatureMethod===void 0||["HMAC-SHA1","HMAC-SHA256","PLAINTEXT"].includes(String(t.signatureMethod))):t.type==="awsv4"?Pe(t,"accessKey")&&Pe(t,"secretKey")&&Pe(t,"region")&&Pe(t,"service")&&(t.sessionToken===void 0||typeof t.sessionToken=="string"):!1}function O0(t){return!Tn(t)||!Pe(t,"method")||!Pe(t,"url")||t.query!==void 0&&(!Array.isArray(t.query)||!t.query.every(Bo))||t.headers!==void 0&&(!Array.isArray(t.headers)||!t.headers.every(Bo))||t.body!==void 0&&typeof t.body!="string"||t.contentType!==void 0&&typeof t.contentType!="string"||t.bodyMode!==void 0&&!["none","raw","json","urlencoded","formdata","binary","graphql"].includes(String(t.bodyMode))||t.urlencoded!==void 0&&(!Array.isArray(t.urlencoded)||!t.urlencoded.every(Bo))||t.formData!==void 0&&(!Array.isArray(t.formData)||!t.formData.every(Ek))||t.binary!==void 0&&!Ok(t.binary)||t.graphql!==void 0&&(!Tn(t.graphql)||!Pe(t.graphql,"query")||!Pe(t.graphql,"variables"))||t.hostExecution!==void 0&&(!Tn(t.hostExecution)||t.hostExecution.certificateId!==void 0&&typeof t.hostExecution.certificateId!="string"||t.hostExecution.cookieJar!==void 0&&t.hostExecution.cookieJar!=="session")?!1:t.auth===void 0||Gd(t.auth)}function M0(t){return Tn(t)&&Pe(t,"id")&&Pe(t,"key")&&Pe(t,"value")&&(t.enabled===void 0||typeof t.enabled=="boolean")}function Mk(t){return!Tn(t)||!Pe(t,"id")||!Pe(t,"name")||!Pe(t,"createdAt")||!Pe(t,"updatedAt")?null:{id:t.id,name:t.name,auth:Gd(t.auth)?t.auth:{type:"none"},variables:Array.isArray(t.variables)?t.variables.filter(M0):[],createdAt:t.createdAt,updatedAt:t.updatedAt}}function Rk(t){return!Tn(t)||!Pe(t,"id")||!Pe(t,"collectionId")||t.parentFolderId!==void 0&&typeof t.parentFolderId!="string"||!Pe(t,"name")||!Pe(t,"createdAt")||!Pe(t,"updatedAt")?null:{id:t.id,collectionId:t.collectionId,parentFolderId:t.parentFolderId,name:t.name,auth:Gd(t.auth)?t.auth:{type:"inherit"},createdAt:t.createdAt,updatedAt:t.updatedAt}}function Dk(t,e){const n=t.map(Rk).filter(s=>s!==null).filter(s=>e.has(s.collectionId)),r=new Map(n.map(s=>[s.id,s]));for(const s of n){if(!s.parentFolderId)continue;const a=r.get(s.parentFolderId);(!a||a.collectionId!==s.collectionId||a.id===s.id)&&(s.parentFolderId=void 0)}for(const s of n){if(!s.parentFolderId)continue;const a=new Set([s.id]);let c=s.parentFolderId;for(;c;){if(a.has(c)){s.parentFolderId=void 0;break}a.add(c),c=r.get(c)?.parentFolderId}}return n}function R0(t){if(!(!Tn(t)||!Pe(t,"preRequest")||!Pe(t,"tests")))return{preRequest:t.preRequest,tests:t.tests}}function _k(t){if(!Tn(t)||!Pe(t,"id")||!Pe(t,"collectionId")||t.folderId!==void 0&&typeof t.folderId!="string"||!Pe(t,"name")||!O0(t.request)||!Pe(t,"createdAt")||!Pe(t,"updatedAt"))return null;const e=R0(t.scripts);return{id:t.id,collectionId:t.collectionId,folderId:t.folderId,name:t.name,request:ai(t.request),...e?{scripts:e}:{},createdAt:t.createdAt,updatedAt:t.updatedAt}}function Lk(t){return!Tn(t)||!Pe(t,"id")||!Pe(t,"name")||!Array.isArray(t.variables)||!Pe(t,"createdAt")||!Pe(t,"updatedAt")?null:{id:t.id,name:t.name,variables:t.variables.filter(M0),createdAt:t.createdAt,updatedAt:t.updatedAt}}function Bk(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&typeof t[1]=="string"}function $k(t){return!Tn(t)||!Pe(t,"name")||typeof t.passed!="boolean"||t.error!==void 0&&typeof t.error!="string"?null:{name:t.name,passed:t.passed,error:t.error}}function qk(t){if(!Tn(t)||!Pe(t,"id")||!O0(t.request)||!Pe(t,"executedMethod")||!Pe(t,"resolvedUrl")||!Lo(t,"status")||t.statusText!==void 0&&typeof t.statusText!="string"||!Lo(t,"responseTime")||t.responseHeaders!==void 0&&(!Array.isArray(t.responseHeaders)||!t.responseHeaders.every(Bk))||t.responseBody!==void 0&&typeof t.responseBody!="string"||t.responseBodyTruncated!==void 0&&typeof t.responseBodyTruncated!="boolean"||t.runId!==void 0&&typeof t.runId!="string"||t.runName!==void 0&&typeof t.runName!="string"||!Lo(t,"runIndex")||!Lo(t,"runTotal")||t.runPassed!==void 0&&typeof t.runPassed!="boolean"||t.runCancelled!==void 0&&typeof t.runCancelled!="boolean"||t.error!==void 0&&typeof t.error!="string"||t.scriptError!==void 0&&typeof t.scriptError!="string"||!Pe(t,"createdAt"))return null;const e=R0(t.scripts),n=Array.isArray(t.scriptTests)?t.scriptTests.map($k).filter(s=>s!==null):[],r=Array.isArray(t.scriptLogs)?t.scriptLogs.filter(s=>typeof s=="string"):[];return{id:t.id,collectionId:typeof t.collectionId=="string"?t.collectionId:void 0,folderId:typeof t.folderId=="string"?t.folderId:void 0,request:ai(t.request),...e?{scripts:e}:{},executedMethod:t.executedMethod,resolvedUrl:t.resolvedUrl,status:t.status,statusText:t.statusText,responseTime:t.responseTime,responseHeaders:Array.isArray(t.responseHeaders)?t.responseHeaders.map(([s,a])=>[s,a]):void 0,responseBody:typeof t.responseBody=="string"?t.responseBody:void 0,responseBodyTruncated:t.responseBodyTruncated===!0?!0:void 0,runId:typeof t.runId=="string"?t.runId:void 0,runName:typeof t.runName=="string"?t.runName:void 0,runIndex:typeof t.runIndex=="number"?t.runIndex:void 0,runTotal:typeof t.runTotal=="number"?t.runTotal:void 0,runPassed:typeof t.runPassed=="boolean"?t.runPassed:void 0,runCancelled:t.runCancelled===!0?!0:void 0,error:t.error,...n.length?{scriptTests:n}:{},...r.length?{scriptLogs:r}:{},scriptError:t.scriptError,createdAt:t.createdAt}}function D0(t){const e=Object.create(null);for(const n of t){const r=n.key.trim();n.enabled===!1||!r||(e[r]=n.value)}return e}function wn(t){const e=globalThis.crypto?.randomUUID?.();return e?`${t}-${e}`:`${t}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function _0(t,e){const n=e?.trim()||"unknown-host",r=t?.trim()||"untitled";return`flexdoc:${encodeURIComponent(n)}:${encodeURIComponent(r)}`}function ai(t){const e=t.auth?t.auth.type==="oauth2"?{...t.auth,scopes:t.auth.scopes?[...t.auth.scopes]:void 0}:{...t.auth}:void 0;return{...t,query:t.query?.map(n=>({...n})),headers:t.headers?.map(n=>({...n})),urlencoded:t.urlencoded?.map(n=>({...n})),formData:t.formData?.map(n=>({...n,file:void 0})),binary:t.binary?{...t.binary,file:void 0}:void 0,graphql:t.graphql?{...t.graphql}:void 0,auth:e,hostExecution:t.hostExecution?{...t.hostExecution}:void 0}}function nl(){const t=ua();return{version:6,collections:[{id:wn("collection"),name:jk,auth:{type:"none"},variables:[],createdAt:t,updatedAt:t}],folders:[],requests:[],environments:[],history:[]}}function zk(t){if(!Tn(t)||![1,2,3,4,5,6].includes(t.version))return nl();const e=(Array.isArray(t.collections)?t.collections:[]).map(Mk).filter(h=>h!==null);if(e.length===0)return nl();const n=new Set(e.map(h=>h.id)),r=Dk(Array.isArray(t.folders)?t.folders:[],n),s=new Map(r.map(h=>[h.id,h])),a=(Array.isArray(t.requests)?t.requests:[]).map(_k).filter(h=>h!==null).filter(h=>n.has(h.collectionId)).map(h=>h.folderId?s.get(h.folderId)?.collectionId===h.collectionId?h:{...h,folderId:void 0}:h);if(t.version===1)return{version:6,collections:e,folders:r,requests:a,environments:[],history:[]};const c=(Array.isArray(t.environments)?t.environments:[]).map(Lk).filter(h=>h!==null),d=typeof t.activeEnvironmentId=="string"&&c.some(h=>h.id===t.activeEnvironmentId)?t.activeEnvironmentId:void 0,f=(t.version===4||t.version===5||t.version===6)&&Array.isArray(t.history)?t.history.map(qk).filter(h=>h!==null).slice(0,j0):[];return{version:6,collections:e,folders:r,requests:a,environments:c,activeEnvironmentId:d,history:f}}function L0(t,e){const n=e.responseBody===void 0?void 0:e.responseBody.slice(0,E0),r=e.responseBodyTruncated===!0||(e.responseBody?.length||0)>E0,s={id:wn("history"),collectionId:e.collectionId,folderId:e.folderId,request:ai(e.request),...e.scripts?{scripts:cn(e.scripts)}:{},executedMethod:e.executedMethod,resolvedUrl:e.resolvedUrl,status:e.status,statusText:e.statusText,responseTime:e.responseTime,...e.responseHeaders?.length?{responseHeaders:e.responseHeaders.map(([a,c])=>[a,c])}:{},...n!==void 0?{responseBody:n,...r?{responseBodyTruncated:!0}:{}}:{},runId:e.runId,runName:e.runName,runIndex:e.runIndex,runTotal:e.runTotal,runPassed:e.runPassed,...e.runCancelled?{runCancelled:!0}:{},error:e.error,...e.scriptTests?.length?{scriptTests:e.scriptTests.map(a=>({...a}))}:{},...e.scriptLogs?.length?{scriptLogs:[...e.scriptLogs]}:{},scriptError:e.scriptError,createdAt:ua()};return{...t,history:[s,...t.history].slice(0,j0)}}function B0(t,e,n,r={type:"none"}){if(r.type!=="inherit")return{...r};const s=new Map(t.folders.map(f=>[f.id,f])),a=new Set;let c=n?s.get(n):void 0;for(;c&&c.collectionId===e&&!a.has(c.id);){if(a.add(c.id),c.auth.type!=="inherit")return{...c.auth};c=c.parentFolderId?s.get(c.parentFolderId):void 0}const d=t.collections.find(f=>f.id===e);return d&&d.auth.type!=="inherit"?{...d.auth}:{type:"none"}}function $0(t,e){const n=t.collections.find(r=>r.id===e);return D0(n?.variables||[])}function Xd(t){const e=t.environments.find(n=>n.id===t.activeEnvironmentId);return D0(e?.variables||[])}function Jd(t,e){if(!t.activeEnvironmentId||e.length===0)return t;const n=t.environments.findIndex(d=>d.id===t.activeEnvironmentId);if(n<0)return t;let s=t.environments[n].variables.map(d=>({...d})),a=!1;for(const d of e){const f=d.key.trim();if(!f)continue;if(d.action==="unset"){const b=s.filter(v=>v.key.trim()!==f);b.length!==s.length&&(s=b,a=!0);continue}const h=s.map((b,v)=>b.key.trim()===f?v:-1).filter(b=>b>=0),g=d.value||"";if(h.length>0){const b=h[0];s[b]={...s[b],key:f,value:g,enabled:!0},h.length>1&&(s=s.filter((v,S)=>S===b||v.key.trim()!==f))}else s.push({id:wn("variable"),key:f,value:g,enabled:!0});a=!0}if(!a)return t;const c=t.environments.map((d,f)=>f===n?{...d,variables:s,updatedAt:ua()}:d);return{...t,environments:c}}function q0(t,e,n){if(!e||n.length===0)return t;const r=t.collections.findIndex(f=>f.id===e);if(r<0)return t;let a=t.collections[r].variables.map(f=>({...f})),c=!1;for(const f of n){const h=f.key.trim();if(!h)continue;if(f.action==="unset"){const v=a.filter(S=>S.key.trim()!==h);v.length!==a.length&&(a=v,c=!0);continue}const g=a.map((v,S)=>v.key.trim()===h?S:-1).filter(v=>v>=0),b=f.value||"";if(g.length>0){const v=g[0];a[v]={...a[v],key:h,value:b,enabled:!0},g.length>1&&(a=a.filter((S,A)=>A===v||S.key.trim()!==h))}else a.push({id:wn("variable"),key:h,value:b,enabled:!0});c=!0}if(!c)return t;const d=t.collections.map((f,h)=>h===r?{...f,variables:a,updatedAt:ua()}:f);return{...t,collections:d}}function Hk(t,e){return{...t,environments:t.environments.filter(n=>n.id!==e),activeEnvironmentId:t.activeEnvironmentId===e?void 0:t.activeEnvironmentId}}function Ik(t,e){const n=t.folders.find(s=>s.id===e);if(!n)return t;const r=ua();return{...t,folders:t.folders.filter(s=>s.id!==e).map(s=>s.parentFolderId===e?{...s,parentFolderId:n.parentFolderId,updatedAt:r}:s),requests:t.requests.map(s=>s.folderId===e?{...s,folderId:n.parentFolderId,updatedAt:r}:s)}}function Uk(t,e){const n=t.collections.filter(r=>r.id!==e);return n.length===0?{...nl(),environments:t.environments,activeEnvironmentId:t.activeEnvironmentId,history:t.history}:{...t,collections:n,folders:t.folders.filter(r=>r.collectionId!==e),requests:t.requests.filter(r=>r.collectionId!==e)}}function z0(){return typeof indexedDB>"u"?Promise.resolve(null):new Promise((t,e)=>{const n=indexedDB.open(Nk,Tk);n.onupgradeneeded=()=>{const r=n.result;r.objectStoreNames.contains(tl)||r.createObjectStore(tl)},n.onsuccess=()=>t(n.result),n.onerror=()=>e(n.error||new Error("Unable to open FlexDoc API Client storage"))})}async function H0(t){const e=await z0();if(!e)return nl();try{return await new Promise((n,r)=>{const a=e.transaction(tl,"readonly").objectStore(tl).get(t);a.onsuccess=()=>n(zk(a.result)),a.onerror=()=>r(a.error||new Error("Unable to load FlexDoc API Client workspace"))})}finally{e.close()}}async function I0(t,e){const n=await z0();if(n)try{await new Promise((r,s)=>{const a=n.transaction(tl,"readwrite");a.objectStore(tl).put(e,t),a.oncomplete=()=>r(),a.onerror=()=>s(a.error||new Error("Unable to save FlexDoc API Client workspace")),a.onabort=()=>s(a.error||new Error("Unable to save FlexDoc API Client workspace"))})}finally{n.close()}}function il(t,e){const n=t?.trim();if(!n)throw new Error(`${e} is required for this OAuth flow.`);return n}function $o(t){return(t.scopes||[]).map(e=>e.trim()).filter(Boolean).join(" ")}function Fk(t){if(typeof TextEncoder>"u")throw new Error("OAuth Basic client authentication requires UTF-8 encoding support.");const e=new TextEncoder().encode(t);let n="";for(const a of e)n+=String.fromCharCode(a);const r=globalThis.Buffer,s=typeof btoa=="function"?btoa(n):r?.from(n,"binary").toString("base64");if(!s)throw new Error("OAuth Basic client authentication requires Base64 support in this runtime.");return s}function U0(t){let e="";for(const s of t)e+=String.fromCharCode(s);const n=globalThis.Buffer,r=typeof btoa=="function"?btoa(e):n?.from(e,"binary").toString("base64");if(!r)throw new Error("OAuth PKCE requires Base64 support in this runtime.");return r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function F0(t=32){if(!globalThis.crypto?.getRandomValues)throw new Error("OAuth requires cryptographic random-number support.");const e=new Uint8Array(t);return globalThis.crypto.getRandomValues(e),U0(e)}async function Vk(t){if(!globalThis.crypto?.subtle||typeof TextEncoder>"u")throw new Error("OAuth authorization-code flow requires Web Crypto PKCE support.");const e=await globalThis.crypto.subtle.digest("SHA-256",new TextEncoder().encode(t));return U0(new Uint8Array(e))}function V0(t,e,n,r){const s=il(t.authorizationUrl,"Authorization URL"),a=il(t.clientId,"Client ID"),c=new URL(s),d=t.grantType||"accessToken";c.searchParams.set("response_type",d==="implicit"?"token":"code"),c.searchParams.set("client_id",a),c.searchParams.set("redirect_uri",n),c.searchParams.set("state",e);const f=$o(t);return f&&c.searchParams.set("scope",f),r&&(c.searchParams.set("code_challenge",r),c.searchParams.set("code_challenge_method","S256")),c.toString()}function Pk(t){const e=new URL(t.location.href);return e.search="",e.hash="",e.toString()}async function Kk(t,e){const n=e??(typeof window>"u"?void 0:window);if(!n)throw new Error("Interactive OAuth requires a browser window.");const r=t.redirectUri?.trim()||Pk(n);if(new URL(r).origin!==n.location.origin)throw new Error("Interactive OAuth redirect URI must use the same origin as the FlexDoc page so the popup result can be read.");const s=F0(24);if((t.grantType||"accessToken")==="implicit")return{url:V0(t,s,r),state:s,redirectUri:r};const a=F0(48),c=await Vk(a);return{url:V0(t,s,r,c),state:s,redirectUri:r,codeVerifier:a}}async function Yk(t){const e=await t.text();let n;try{n=e?JSON.parse(e):{}}catch{n=Object.fromEntries(new URLSearchParams(e))}if(!t.ok){const c=String(n.error_description||n.error||`OAuth token endpoint returned ${t.status}`);throw new Error(c)}const r=typeof n.access_token=="string"?n.access_token:"";if(!r)throw new Error("OAuth token endpoint did not return access_token.");const s=n.expires_in,a=typeof s=="number"?s:typeof s=="string"&&s.trim()!==""&&Number.isFinite(Number(s))?Number(s):void 0;return{accessToken:r,refreshToken:typeof n.refresh_token=="string"?n.refresh_token:void 0,tokenType:typeof n.token_type=="string"?n.token_type:void 0,expiresIn:a,scope:typeof n.scope=="string"?n.scope:void 0}}async function qo(t,e,n){const r=il(t.tokenUrl,"Token URL"),s={"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},a=t.clientId?.trim();(t.clientAuthentication||"body")==="basic"&&a?s.Authorization=`Basic ${Fk(`${a}:${t.clientSecret||""}`)}`:(a&&e.set("client_id",a),t.clientSecret&&e.set("client_secret",t.clientSecret));const c=await n(r,{method:"POST",headers:s,body:e.toString()});return Yk(c)}async function Gk(t,e){const n=e.windowObject??(typeof window>"u"?void 0:window);if(!n)throw new Error("Interactive OAuth requires a browser window.");const r=n.open(t.url,"flexdoc-oauth","popup,width=640,height=760");if(!r)throw new Error("OAuth popup was blocked. Allow popups for this documentation origin and try again.");const s=new URL(t.redirectUri),a=Date.now(),c=e.popupTimeoutMs??12e4,d=e.pollIntervalMs??200;for(;Date.now()-a<c;){if(r.closed)throw new Error("OAuth popup was closed before authorization completed.");try{const f=new URL(r.location.href);if(f.origin===s.origin&&f.pathname===s.pathname)return r.close(),f}catch{}await new Promise(f=>setTimeout(f,d))}throw r.close(),new Error("OAuth authorization timed out.")}async function Xk(t,e={}){const n=t.grantType||"accessToken",r=e.fetchImpl??fetch;if(n==="accessToken")return{accessToken:il(t.accessToken,"Access token")};if(n==="clientCredentials"){const b=new URLSearchParams({grant_type:"client_credentials"}),v=$o(t);return v&&b.set("scope",v),qo(t,b,r)}if(n==="password"){const b=new URLSearchParams({grant_type:"password",username:il(t.username,"Username"),password:t.password||""}),v=$o(t);return v&&b.set("scope",v),qo(t,b,r)}const s=await Kk(t,e.windowObject),a=await Gk(s,e);if((a.searchParams.get("state")||new URLSearchParams(a.hash.replace(/^#/,"")).get("state"))!==s.state)throw new Error("OAuth state mismatch; authorization response was rejected.");const d=new URLSearchParams(a.hash.replace(/^#/,"")),f=a.searchParams.get("error")||d.get("error");if(f){const b=a.searchParams.get("error_description")||d.get("error_description");throw new Error(b||f)}if(n==="implicit"){const b=d.get("access_token")||"";if(!b)throw new Error("OAuth implicit response did not include access_token.");return{accessToken:b,tokenType:d.get("token_type")||void 0,expiresIn:d.get("expires_in")?Number(d.get("expires_in")):void 0,scope:d.get("scope")||void 0}}const h=a.searchParams.get("code");if(!h)throw new Error("OAuth authorization response did not include code.");const g=new URLSearchParams({grant_type:"authorization_code",code:h,redirect_uri:s.redirectUri});return s.codeVerifier&&g.set("code_verifier",s.codeVerifier),qo(t,g,r)}async function Jk(t,e={}){const n=il(t.refreshToken,"Refresh token"),r=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),s=$o(t);return s&&r.set("scope",s),qo(t,r,e.fetchImpl??fetch)}function Qk(t){return t==="inherit"?{type:"inherit"}:t==="bearer"?{type:"bearer",token:""}:t==="oauth2"?{type:"oauth2",accessToken:"",grantType:"accessToken",scopes:[]}:t==="basic"?{type:"basic",username:"",password:""}:t==="apiKey"?{type:"apiKey",key:"",value:"",in:"header"}:t==="digest"?{type:"digest",username:"",password:""}:t==="hawk"?{type:"hawk",id:"",key:"",algorithm:"sha256"}:t==="ntlm"?{type:"ntlm",username:"",password:""}:t==="oauth1"?{type:"oauth1",consumerKey:"",consumerSecret:"",signatureMethod:"HMAC-SHA1"}:t==="awsv4"?{type:"awsv4",accessKey:"",secretKey:"",region:"",service:""}:{type:"none"}}function Wk(t){return t.split(/\s+/).map(e=>e.trim()).filter(Boolean)}const P0=({auth:t,fieldClass:e,label:n,onChange:r})=>{const[s,a]=I.useState(!1),[c,d]=I.useState(null),f=t.grantType||"accessToken",h=f==="authorizationCode"||f==="implicit",g=f==="authorizationCode"||f==="clientCredentials"||f==="password",b=f!=="accessToken",v=async()=>{a(!0),d(null);try{const A=await Xk(t);r({...t,accessToken:A.accessToken,refreshToken:A.refreshToken??t.refreshToken}),d(A.expiresIn?`Access token acquired; expires in ${A.expiresIn}s.`:"Access token acquired.")}catch(A){d(A instanceof Error?A.message:"OAuth authorization failed.")}finally{a(!1)}},S=async()=>{a(!0),d(null);try{const A=await Jk(t);r({...t,accessToken:A.accessToken,refreshToken:A.refreshToken??t.refreshToken}),d("Access token refreshed.")}catch(A){d(A instanceof Error?A.message:"OAuth token refresh failed.")}finally{a(!1)}};return p.jsxs("div",{className:"space-y-2",children:[p.jsxs("select",{"aria-label":n?`${n} OAuth grant type`:"OAuth grant type",className:e,value:f,onChange:A=>r({...t,grantType:A.target.value}),children:[p.jsx("option",{value:"accessToken",children:"Manual access token"}),p.jsx("option",{value:"authorizationCode",children:"Authorization Code + PKCE"}),p.jsx("option",{value:"clientCredentials",children:"Client Credentials"}),p.jsx("option",{value:"password",children:"Password grant (legacy)"}),p.jsx("option",{value:"implicit",children:"Implicit grant (legacy)"})]}),h&&p.jsx("input",{"aria-label":n?`${n} OAuth authorization URL`:"OAuth authorization URL",className:e,placeholder:"Authorization URL",value:t.authorizationUrl||"",onChange:A=>r({...t,authorizationUrl:A.target.value})}),g&&p.jsx("input",{"aria-label":n?`${n} OAuth token URL`:"OAuth token URL",className:e,placeholder:"Token URL",value:t.tokenUrl||"",onChange:A=>r({...t,tokenUrl:A.target.value})}),b&&p.jsx("input",{"aria-label":n?`${n} OAuth client ID`:"OAuth client ID",className:e,placeholder:"Client ID",value:t.clientId||"",onChange:A=>r({...t,clientId:A.target.value})}),(f==="authorizationCode"||f==="clientCredentials"||f==="password")&&p.jsx("input",{"aria-label":n?`${n} OAuth client secret`:"OAuth client secret",type:"password",autoComplete:"off",className:e,placeholder:f==="authorizationCode"?"Client secret (optional for PKCE/public clients)":"Client secret (optional)",value:t.clientSecret||"",onChange:A=>r({...t,clientSecret:A.target.value})}),g&&p.jsxs("select",{"aria-label":n?`${n} OAuth client authentication`:"OAuth client authentication",className:e,value:t.clientAuthentication||"body",onChange:A=>r({...t,clientAuthentication:A.target.value}),children:[p.jsx("option",{value:"body",children:"Send client credentials in body"}),p.jsx("option",{value:"basic",children:"Send as Basic Auth header"})]}),h&&p.jsx("input",{"aria-label":n?`${n} OAuth redirect URI`:"OAuth redirect URI",className:e,placeholder:"Redirect URI (defaults to this page)",value:t.redirectUri||"",onChange:A=>r({...t,redirectUri:A.target.value})}),b&&p.jsx("input",{"aria-label":n?`${n} OAuth scopes`:"OAuth scopes",className:e,placeholder:"Scopes separated by spaces",value:(t.scopes||[]).join(" "),onChange:A=>r({...t,scopes:Wk(A.target.value)})}),f==="password"&&p.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[p.jsx("input",{"aria-label":n?`${n} OAuth username`:"OAuth username",className:e,placeholder:"Resource owner username",value:t.username||"",onChange:A=>r({...t,username:A.target.value})}),p.jsx("input",{"aria-label":n?`${n} OAuth password`:"OAuth password",type:"password",autoComplete:"off",className:e,placeholder:"Resource owner password",value:t.password||"",onChange:A=>r({...t,password:A.target.value})})]}),p.jsx("input",{"aria-label":n?`${n} OAuth access token`:"OAuth access token",type:"password",autoComplete:"off",className:e,placeholder:"Access token",value:t.accessToken,onChange:A=>r({...t,accessToken:A.target.value})}),f!=="accessToken"&&p.jsxs("div",{className:"flex flex-wrap gap-2",children:[p.jsx("button",{type:"button",disabled:s,onClick:v,className:"rounded-md border px-2.5 py-1.5 text-xs font-medium disabled:opacity-60",children:s?"Authorizing…":"Get access token"}),t.refreshToken&&t.tokenUrl&&p.jsx("button",{type:"button",disabled:s,onClick:S,className:"rounded-md border px-2.5 py-1.5 text-xs font-medium disabled:opacity-60",children:"Refresh access token"})]}),f!=="accessToken"&&p.jsx("p",{className:"text-[11px] opacity-70",children:"Authorization Code uses PKCE. Popup callbacks must return to this page origin; token endpoints must allow browser CORS. Client secrets entered here are browser-visible and should only be used when the OAuth provider permits it."}),c&&p.jsx("p",{role:"status",className:"text-xs",children:c})]})},K0=({auth:t,label:e,allowInherit:n=!1,hostExecution:r,onChange:s,theme:a})=>{const d=`w-full rounded-md border px-2 py-1.5 text-xs ${a==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900"}`,f=new Set(r?.capabilities||[]),h=b=>r?.available===!0&&f.has(b),g=t.type==="digest"?"digest":t.type==="hawk"?"hawk":t.type==="ntlm"?"ntlm":t.type==="oauth1"?"oauth1":t.type==="awsv4"?"awsv4":t.type==="apiKey"&&t.in==="cookie"?"cookies":void 0;return p.jsxs("div",{className:"space-y-2",children:[p.jsxs("select",{"aria-label":`${e} authorization type`,className:d,value:t.type==="inherit"&&!n?"none":t.type,onChange:b=>s(Qk(b.target.value)),children:[n&&p.jsx("option",{value:"inherit",children:"Inherit from parent"}),p.jsx("option",{value:"none",children:"No auth"}),p.jsx("option",{value:"bearer",children:"Bearer token"}),p.jsx("option",{value:"oauth2",children:"OAuth 2.0"}),p.jsx("option",{value:"basic",children:"Basic auth"}),p.jsx("option",{value:"apiKey",children:"API key"}),p.jsx("option",{value:"digest",disabled:!h("digest"),children:"Digest (API host)"}),p.jsx("option",{value:"hawk",disabled:!h("hawk"),children:"Hawk (API host)"}),p.jsx("option",{value:"ntlm",disabled:!h("ntlm"),children:"NTLM / Negotiate (API host)"}),p.jsx("option",{value:"oauth1",disabled:!h("oauth1"),children:"OAuth 1.0 (API host)"}),p.jsx("option",{value:"awsv4",disabled:!h("awsv4"),children:"AWS Signature v4 (API host)"})]}),t.type==="bearer"&&p.jsx("input",{"aria-label":`${e} bearer token`,type:"password",autoComplete:"off",className:d,value:t.token,onChange:b=>s({...t,token:b.target.value})}),t.type==="oauth2"&&p.jsx(P0,{auth:t,fieldClass:d,label:e,onChange:s}),(t.type==="basic"||t.type==="digest")&&p.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[p.jsx("input",{"aria-label":`${e} ${t.type} username`,className:d,placeholder:"Username",value:t.username,onChange:b=>s({...t,username:b.target.value})}),p.jsx("input",{"aria-label":`${e} ${t.type} password`,type:"password",autoComplete:"off",className:d,placeholder:"Password",value:t.password,onChange:b=>s({...t,password:b.target.value})})]}),t.type==="apiKey"&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("input",{"aria-label":`${e} API key name`,className:d,placeholder:"Key name",value:t.key,onChange:b=>s({...t,key:b.target.value})}),p.jsx("input",{"aria-label":`${e} API key value`,type:"password",autoComplete:"off",className:d,placeholder:"Value",value:t.value,onChange:b=>s({...t,value:b.target.value})}),p.jsxs("select",{"aria-label":`${e} API key location`,className:d,value:t.in,onChange:b=>s({...t,in:b.target.value}),children:[p.jsx("option",{value:"header",children:"Header"}),p.jsx("option",{value:"query",children:"Query"}),p.jsx("option",{value:"cookie",disabled:!h("cookies"),children:"Cookie (API host)"})]})]}),t.type==="hawk"&&p.jsxs("div",{className:"grid gap-2",children:[p.jsx("input",{"aria-label":`${e} Hawk id`,className:d,placeholder:"ID",value:t.id,onChange:b=>s({...t,id:b.target.value})}),p.jsx("input",{"aria-label":`${e} Hawk key`,type:"password",autoComplete:"off",className:d,placeholder:"Key",value:t.key,onChange:b=>s({...t,key:b.target.value})}),p.jsxs("select",{"aria-label":`${e} Hawk algorithm`,className:d,value:t.algorithm||"sha256",onChange:b=>s({...t,algorithm:b.target.value}),children:[p.jsx("option",{value:"sha256",children:"SHA-256"}),p.jsx("option",{value:"sha1",children:"SHA-1"})]}),p.jsx("input",{"aria-label":`${e} Hawk ext`,className:d,placeholder:"ext (optional)",value:t.ext||"",onChange:b=>s({...t,ext:b.target.value})})]}),t.type==="ntlm"&&p.jsxs("div",{className:"grid gap-2",children:[p.jsx("input",{"aria-label":`${e} NTLM username`,className:d,placeholder:"Username",value:t.username,onChange:b=>s({...t,username:b.target.value})}),p.jsx("input",{"aria-label":`${e} NTLM password`,type:"password",autoComplete:"off",className:d,placeholder:"Password",value:t.password,onChange:b=>s({...t,password:b.target.value})}),p.jsx("input",{"aria-label":`${e} NTLM domain`,className:d,placeholder:"Domain (optional)",value:t.domain||"",onChange:b=>s({...t,domain:b.target.value})}),p.jsx("input",{"aria-label":`${e} NTLM workstation`,className:d,placeholder:"Workstation (optional)",value:t.workstation||"",onChange:b=>s({...t,workstation:b.target.value})})]}),t.type==="oauth1"&&p.jsxs("div",{className:"grid gap-2",children:[p.jsx("input",{"aria-label":`${e} OAuth1 consumer key`,className:d,placeholder:"Consumer key",value:t.consumerKey,onChange:b=>s({...t,consumerKey:b.target.value})}),p.jsx("input",{"aria-label":`${e} OAuth1 consumer secret`,type:"password",autoComplete:"off",className:d,placeholder:"Consumer secret",value:t.consumerSecret,onChange:b=>s({...t,consumerSecret:b.target.value})}),p.jsx("input",{"aria-label":`${e} OAuth1 token`,className:d,placeholder:"Token (optional)",value:t.token||"",onChange:b=>s({...t,token:b.target.value})}),p.jsx("input",{"aria-label":`${e} OAuth1 token secret`,type:"password",autoComplete:"off",className:d,placeholder:"Token secret (optional)",value:t.tokenSecret||"",onChange:b=>s({...t,tokenSecret:b.target.value})}),p.jsxs("select",{"aria-label":`${e} OAuth1 signature method`,className:d,value:t.signatureMethod||"HMAC-SHA1",onChange:b=>s({...t,signatureMethod:b.target.value}),children:[p.jsx("option",{children:"HMAC-SHA1"}),p.jsx("option",{children:"HMAC-SHA256"}),p.jsx("option",{children:"PLAINTEXT"})]}),p.jsx("input",{"aria-label":`${e} OAuth1 realm`,className:d,placeholder:"Realm (optional)",value:t.realm||"",onChange:b=>s({...t,realm:b.target.value})})]}),t.type==="awsv4"&&p.jsxs("div",{className:"grid gap-2",children:[p.jsx("input",{"aria-label":`${e} AWS access key`,className:d,placeholder:"Access key",value:t.accessKey,onChange:b=>s({...t,accessKey:b.target.value})}),p.jsx("input",{"aria-label":`${e} AWS secret key`,type:"password",autoComplete:"off",className:d,placeholder:"Secret key",value:t.secretKey,onChange:b=>s({...t,secretKey:b.target.value})}),p.jsx("input",{"aria-label":`${e} AWS session token`,type:"password",autoComplete:"off",className:d,placeholder:"Session token (optional)",value:t.sessionToken||"",onChange:b=>s({...t,sessionToken:b.target.value})}),p.jsx("input",{"aria-label":`${e} AWS region`,className:d,placeholder:"Region",value:t.region,onChange:b=>s({...t,region:b.target.value})}),p.jsx("input",{"aria-label":`${e} AWS service`,className:d,placeholder:"Service",value:t.service,onChange:b=>s({...t,service:b.target.value})})]}),g&&p.jsx("p",{role:h(g)?"status":"alert",className:"text-[11px] opacity-75",children:h(g)?"This authorization mode is executed by the FlexDoc API host.":"Host execution is disabled or this documentation host does not support the selected authorization mode."})]})};let Qd=[],Y0=[];(()=>{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,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?Y0:Qd).push(n=n+t[e])})();function Zk(t){if(t<768)return!1;for(let e=0,n=Qd.length;;){let r=e+n>>1;if(t<Qd[r])n=r;else if(t>=Y0[r])e=r+1;else return!0;if(e==n)return!1}}function G0(t){return t>=127462&&t<=127487}const X0=8205;function eC(t,e,n=!0,r=!0){return(n?J0:tC)(t,e,r)}function J0(t,e,n){if(e==t.length)return e;e&&Q0(t.charCodeAt(e))&&W0(t.charCodeAt(e-1))&&e--;let r=Wd(t,e);for(e+=Z0(r);e<t.length;){let s=Wd(t,e);if(r==X0||s==X0||n&&Zk(s))e+=Z0(s),r=s;else if(G0(s)){let a=0,c=e-2;for(;c>=0&&G0(Wd(t,c));)a++,c-=2;if(a%2==0)break;e+=2}else break}return e}function tC(t,e,n){for(;e>1;){let r=J0(t,e-2,n);if(r<e)return r;e--}return 0}function Wd(t,e){let n=t.charCodeAt(e);if(!W0(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Q0(r)?(n-55296<<10)+(r-56320)+65536:n}function Q0(t){return t>=56320&&t<57344}function W0(t){return t>=55296&&t<56320}function Z0(t){return t<65536?1:2}class pt{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]=rl(this,e,n);let s=[];return this.decompose(0,e,s,2),r.length&&r.decompose(0,r.length,s,3),this.decompose(n,this.length,s,1),Hi.from(s,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=rl(this,e,n);let r=[];return this.decompose(e,n,r,0),Hi.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),s=new da(this),a=new da(e);for(let c=n,d=n;;){if(s.next(c),a.next(c),c=0,s.lineBreak!=a.lineBreak||s.done!=a.done||s.value!=a.value)return!1;if(d+=s.value.length,s.done||d>=r)return!0}}iter(e=1){return new da(this,e)}iterRange(e,n=this.length){return new ty(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let s=this.line(e).from;r=this.iterRange(s,Math.max(s,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new ny(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]?pt.empty:e.length<=32?new qt(e):Hi.from(qt.split(e,[]))}}class qt extends pt{constructor(e,n=nC(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,s){for(let a=0;;a++){let c=this.text[a],d=s+c.length;if((n?r:d)>=e)return new iC(s,d,r,c);s=d+1,r++}}decompose(e,n,r,s){let a=e<=0&&n>=this.length?this:new qt(ey(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(s&1){let c=r.pop(),d=zo(a.text,c.text.slice(),0,a.length);if(d.length<=32)r.push(new qt(d,c.length+a.length));else{let f=d.length>>1;r.push(new qt(d.slice(0,f)),new qt(d.slice(f)))}}else r.push(a)}replace(e,n,r){if(!(r instanceof qt))return super.replace(e,n,r);[e,n]=rl(this,e,n);let s=zo(this.text,zo(r.text,ey(this.text,0,e)),n),a=this.length+r.length-(n-e);return s.length<=32?new qt(s,a):Hi.from(qt.split(s,[]),a)}sliceString(e,n=this.length,r=`
|
|
50
|
+
`){[e,n]=rl(this,e,n);let s="";for(let a=0,c=0;a<=n&&c<this.text.length;c++){let d=this.text[c],f=a+d.length;a>e&&c&&(s+=r),e<f&&n>a&&(s+=d.slice(Math.max(0,e-a),n-a)),a=f+1}return s}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],s=-1;for(let a of e)r.push(a),s+=a.length+1,r.length==32&&(n.push(new qt(r,s)),r=[],s=-1);return s>-1&&n.push(new qt(r,s)),n}}class Hi extends pt{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,s){for(let a=0;;a++){let c=this.children[a],d=s+c.length,f=r+c.lines-1;if((n?f:d)>=e)return c.lineInner(e,n,r,s);s=d+1,r=f+1}}decompose(e,n,r,s){for(let a=0,c=0;c<=n&&a<this.children.length;a++){let d=this.children[a],f=c+d.length;if(e<=f&&n>=c){let h=s&((c<=e?1:0)|(f>=n?2:0));c>=e&&f<=n&&!h?r.push(d):d.decompose(e-c,n-c,r,h)}c=f+1}}replace(e,n,r){if([e,n]=rl(this,e,n),r.lines<this.lines)for(let s=0,a=0;s<this.children.length;s++){let c=this.children[s],d=a+c.length;if(e>=a&&n<=d){let f=c.replace(e-a,n-a,r),h=this.lines-c.lines+f.lines;if(f.lines<h>>4&&f.lines>h>>6){let g=this.children.slice();return g[s]=f,new Hi(g,this.length-(n-e)+r.length)}return super.replace(a,d,f)}a=d+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
|
|
51
|
+
`){[e,n]=rl(this,e,n);let s="";for(let a=0,c=0;a<this.children.length&&c<=n;a++){let d=this.children[a],f=c+d.length;c>e&&a&&(s+=r),e<f&&n>c&&(s+=d.sliceString(e-c,n-c,r)),c=f+1}return s}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Hi))return 0;let r=0,[s,a,c,d]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=n,a+=n){if(s==c||a==d)return r;let f=this.children[s],h=e.children[a];if(f!=h)return r+f.scanIdentical(h,n);r+=f.length+1}}static from(e,n=e.reduce((r,s)=>r+s.length+1,-1)){let r=0;for(let S of e)r+=S.lines;if(r<32){let S=[];for(let A of e)A.flatten(S);return new qt(S,n)}let s=Math.max(32,r>>5),a=s<<1,c=s>>1,d=[],f=0,h=-1,g=[];function b(S){let A;if(S.lines>a&&S instanceof Hi)for(let C of S.children)b(C);else S.lines>c&&(f>c||!f)?(v(),d.push(S)):S instanceof qt&&f&&(A=g[g.length-1])instanceof qt&&S.lines+A.lines<=32?(f+=S.lines,h+=S.length+1,g[g.length-1]=new qt(A.text.concat(S.text),A.length+1+S.length)):(f+S.lines>s&&v(),f+=S.lines,h+=S.length+1,g.push(S))}function v(){f!=0&&(d.push(g.length==1?g[0]:Hi.from(g,h)),h=-1,f=g.length=0)}for(let S of e)b(S);return v(),d.length==1?d[0]:new Hi(d,n)}}pt.empty=new qt([""],0);function nC(t){let e=-1;for(let n of t)e+=n.length+1;return e}function zo(t,e,n=0,r=1e9){for(let s=0,a=0,c=!0;a<t.length&&s<=r;a++){let d=t[a],f=s+d.length;f>=n&&(f>r&&(d=d.slice(0,r-s)),s<n&&(d=d.slice(n-s)),c?(e[e.length-1]+=d,c=!1):e.push(d)),s=f+1}return e}function ey(t,e,n){return zo(t,[""],e,n)}class da{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 qt?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,s=this.nodes[r],a=this.offsets[r],c=a>>1,d=s instanceof qt?s.text.length:s.children.length;if(c==(n>0?d: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((a&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
52
|
+
`,this;e--}else if(s instanceof qt){let f=s.text[c+(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=s.children[c+(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 qt?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 ty{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new da(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:s}=this.cursor.next(e);return this.pos+=(s.length+e)*n,this.value=s.length<=r?s:n<0?s.slice(s.length-r):s.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 ny{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:s}=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=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(pt.prototype[Symbol.iterator]=function(){return this.iter()},da.prototype[Symbol.iterator]=ty.prototype[Symbol.iterator]=ny.prototype[Symbol.iterator]=function(){return this});class iC{constructor(e,n,r,s){this.from=e,this.to=n,this.number=r,this.text=s}get length(){return this.to-this.from}}function rl(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Sn(t,e,n=!0,r=!0){return eC(t,e,n,r)}function rC(t){return t>=56320&&t<57344}function sC(t){return t>=55296&&t<56320}function lC(t,e){let n=t.charCodeAt(e);if(!sC(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return rC(r)?(n-55296<<10)+(r-56320)+65536:n}function aC(t){return t<65536?1:2}const Zd=/\r\n?|\n/;var Yn=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Yn||(Yn={}));class Ii{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,s=0;n<this.sections.length;){let a=this.sections[n++],c=this.sections[n++];c<0?(e(r,s,a),s+=a):s+=c,r+=a}}iterChangedRanges(e,n=!1){ef(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],s=this.sections[n++];s<0?e.push(r,s):e.push(s,r)}return new Ii(e)}composeDesc(e){return this.empty?e:e.empty?this:iy(this,e)}mapDesc(e,n=!1){return e.empty?this:tf(this,e,n)}mapPos(e,n=-1,r=Yn.Simple){let s=0,a=0;for(let c=0;c<this.sections.length;){let d=this.sections[c++],f=this.sections[c++],h=s+d;if(f<0){if(h>e)return a+(e-s);a+=d}else{if(r!=Yn.Simple&&h>=e&&(r==Yn.TrackDel&&s<e&&h>e||r==Yn.TrackBefore&&s<e||r==Yn.TrackAfter&&h>e))return null;if(h>e||h==e&&n<0&&!d)return e==s||n<0?a:a+f;a+=f}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return a}touchesRange(e,n=e){for(let r=0,s=0;r<this.sections.length&&s<=n;){let a=this.sections[r++],c=this.sections[r++],d=s+a;if(c>=0&&s<=n&&d>=e)return s<e&&d>n?"cover":!0;s=d}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],s=this.sections[n++];e+=(e?" ":"")+r+(s>=0?":"+s:"")}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 Ii(e)}static create(e){return new Ii(e)}}class Zt extends Ii{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 ef(this,(n,r,s,a,c)=>e=e.replace(s,s+(r-n),c),!1),e}mapDesc(e,n=!1){return tf(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let s=0,a=0;s<n.length;s+=2){let c=n[s],d=n[s+1];if(d>=0){n[s]=d,n[s+1]=c;let f=s>>1;for(;r.length<f;)r.push(pt.empty);r.push(c?e.slice(a,a+c):pt.empty)}a+=c}return new Zt(n,r)}compose(e){return this.empty?e:e.empty?this:iy(this,e,!0)}map(e,n=!1){return e.empty?this:tf(this,e,n,!0)}iterChanges(e,n=!1){ef(this,e,n)}get desc(){return Ii.create(this.sections)}filter(e){let n=[],r=[],s=[],a=new fa(this);e:for(let c=0,d=0;;){let f=c==e.length?1e9:e[c++];for(;d<f||d==f&&a.len==0;){if(a.done)break e;let g=Math.min(a.len,f-d);An(s,g,-1);let b=a.ins==-1?-1:a.off==0?a.ins:0;An(n,g,b),b>0&&_r(r,n,a.text),a.forward(g),d+=g}let h=e[c++];for(;d<h;){if(a.done)break e;let g=Math.min(a.len,h-d);An(n,g,-1),An(s,g,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(g),d+=g}}return{changes:new Zt(n,r),filtered:Ii.create(s)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],s=this.sections[n+1];s<0?e.push(r):s==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let s=[],a=[],c=0,d=null;function f(g=!1){if(!g&&!s.length)return;c<n&&An(s,n-c,-1);let b=new Zt(s,a);d=d?d.compose(b.map(d)):b,s=[],a=[],c=0}function h(g){if(Array.isArray(g))for(let b of g)h(b);else if(g instanceof Zt){if(g.length!=n)throw new RangeError(`Mismatched change set length (got ${g.length}, expected ${n})`);f(),d=d?d.compose(g.map(d)):g}else{let{from:b,to:v=b,insert:S}=g;if(b>v||b<0||v>n)throw new RangeError(`Invalid change range ${b} to ${v} (in doc of length ${n})`);let A=S?typeof S=="string"?pt.of(S.split(r||Zd)):S:pt.empty,C=A.length;if(b==v&&C==0)return;b<c&&f(),b>c&&An(s,b-c,-1),An(s,v-b,C),_r(a,s,A),c=v}}return h(e),f(!d),d}static empty(e){return new Zt(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let s=0;s<e.length;s++){let a=e[s];if(typeof a=="number")n.push(a,-1);else{if(!Array.isArray(a)||typeof a[0]!="number"||a.some((c,d)=>d&&typeof c!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(a.length==1)n.push(a[0],0);else{for(;r.length<s;)r.push(pt.empty);r[s]=pt.of(a.slice(1)),n.push(a[0],r[s].length)}}}return new Zt(n,r)}static createSet(e,n){return new Zt(e,n)}}function An(t,e,n,r=!1){if(e==0&&n<=0)return;let s=t.length-2;s>=0&&n<=0&&n==t[s+1]?t[s]+=e:s>=0&&e==0&&t[s]==0?t[s+1]+=n:r?(t[s]+=e,t[s+1]+=n):t.push(e,n)}function _r(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(pt.empty);t.push(n)}}function ef(t,e,n){let r=t.inserted;for(let s=0,a=0,c=0;c<t.sections.length;){let d=t.sections[c++],f=t.sections[c++];if(f<0)s+=d,a+=d;else{let h=s,g=a,b=pt.empty;for(;h+=d,g+=f,f&&r&&(b=b.append(r[c-2>>1])),!(n||c==t.sections.length||t.sections[c+1]<0);)d=t.sections[c++],f=t.sections[c++];e(s,h,a,g,b),s=h,a=g}}}function tf(t,e,n,r=!1){let s=[],a=r?[]:null,c=new fa(t),d=new fa(e);for(let f=-1;;){if(c.done&&d.len||d.done&&c.len)throw new Error("Mismatched change set lengths");if(c.ins==-1&&d.ins==-1){let h=Math.min(c.len,d.len);An(s,h,-1),c.forward(h),d.forward(h)}else if(d.ins>=0&&(c.ins<0||f==c.i||c.off==0&&(d.len<c.len||d.len==c.len&&!n))){let h=d.len;for(An(s,d.ins,-1);h;){let g=Math.min(c.len,h);c.ins>=0&&f<c.i&&c.len<=g&&(An(s,0,c.ins),a&&_r(a,s,c.text),f=c.i),c.forward(g),h-=g}d.next()}else if(c.ins>=0){let h=0,g=c.len;for(;g;)if(d.ins==-1){let b=Math.min(g,d.len);h+=b,g-=b,d.forward(b)}else if(d.ins==0&&d.len<g)g-=d.len,d.next();else break;An(s,h,f<c.i?c.ins:0),a&&f<c.i&&_r(a,s,c.text),f=c.i,c.forward(c.len-g)}else{if(c.done&&d.done)return a?Zt.createSet(s,a):Ii.create(s);throw new Error("Mismatched change set lengths")}}}function iy(t,e,n=!1){let r=[],s=n?[]:null,a=new fa(t),c=new fa(e);for(let d=!1;;){if(a.done&&c.done)return s?Zt.createSet(r,s):Ii.create(r);if(a.ins==0)An(r,a.len,0,d),a.next();else if(c.len==0&&!c.done)An(r,0,c.ins,d),s&&_r(s,r,c.text),c.next();else{if(a.done||c.done)throw new Error("Mismatched change set lengths");{let f=Math.min(a.len2,c.len),h=r.length;if(a.ins==-1){let g=c.ins==-1?-1:c.off?0:c.ins;An(r,f,g,d),s&&g&&_r(s,r,c.text)}else c.ins==-1?(An(r,a.off?0:a.len,f,d),s&&_r(s,r,a.textBit(f))):(An(r,a.off?0:a.len,c.off?0:c.ins,d),s&&!c.off&&_r(s,r,c.text));d=(a.ins>f||c.ins>=0&&c.len>f)&&(d||r.length>h),a.forward2(f),c.forward(f)}}}}class fa{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?pt.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?pt.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 Lr{constructor(e,n,r,s){this.from=e,this.to=n,this.flags=r,this.goalColumn=s}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 undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,n=-1){let r,s;return this.empty?r=s=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),r==this.from&&s==this.to?this:new Lr(r,s,this.flags,this.goalColumn)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return Ce.range(e,n,void 0,void 0,r);let s=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Ce.range(this.anchor,s,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 Ce.range(e.anchor,e.head)}static create(e,n,r,s){return new Lr(e,n,r,s)}}class Ce{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Ce.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 Ce([this.main],0)}addRange(e,n=!0){return Ce.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,Ce.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 Ce(e.ranges.map(n=>Lr.fromJSON(n)),e.main)}static single(e,n=e){return new Ce([Ce.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,s=0;s<e.length;s++){let a=e[s];if(a.empty?a.from<=r:a.from<r)return Ce.normalized(e.slice(),n);r=a.to}return new Ce(e,n)}static cursor(e,n=0,r,s){return Lr.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r)),s)}static range(e,n,r,s,a){let c=s==null?7:Math.min(6,s);return!a&&e!=n&&(a=n<e?1:-1),a&&(c|=a<0?8:16),n<e?Lr.create(n,e,c|32,r):Lr.create(e,n,c,r)}static undirectionalRange(e,n){return Lr.create(e,n,64,void 0)}static normalized(e,n=0){let r=e[n];e.sort((s,a)=>s.from-a.from),n=e.indexOf(r);for(let s=1;s<e.length;s++){let a=e[s],c=e[s-1];if(a.empty?a.from<=c.to:a.from<c.to){let d=c.from,f=Math.max(a.to,c.to);s<=n&&n--,e.splice(--s,2,a.anchor>a.head?Ce.range(f,d):Ce.range(d,f))}}return new Ce(e,n)}}function ry(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let nf=0;class He{constructor(e,n,r,s,a){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=s,this.id=nf++,this.default=e([]),this.extensions=typeof a=="function"?a(this):a}get reader(){return this}static define(e={}){return new He(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:rf),!!e.static,e.enables)}of(e){return new Ho([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ho(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ho(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function rf(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class Ho{constructor(e,n,r,s){this.dependencies=e,this.facet=n,this.type=r,this.value=s,this.id=nf++}dynamicSlot(e){var n;let r=this.value,s=this.facet.compareInput,a=this.id,c=e[a]>>1,d=this.type==2,f=!1,h=!1,g=[];for(let b of this.dependencies)b=="doc"?f=!0:b=="selection"?h=!0:(((n=e[b.id])!==null&&n!==void 0?n:1)&1)==0&&g.push(e[b.id]);return{create(b){return b.values[c]=r(b),1},update(b,v){if(f&&v.docChanged||h&&(v.docChanged||v.selection)||sf(b,g)){let S=r(b);if(d?!sy(S,b.values[c],s):!s(S,b.values[c]))return b.values[c]=S,1}return 0},reconfigure:(b,v)=>{let S,A=v.config.address[a];if(A!=null){let C=Vo(v,A);if(this.dependencies.every(T=>T instanceof He?v.facet(T)===b.facet(T):T instanceof Br?v.field(T,!1)==b.field(T,!1):!0)||(d?sy(S=r(b),C,s):s(S=r(b),C)))return b.values[c]=C,0}else S=r(b);return b.values[c]=S,1}}}get extension(){return this}}function sy(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 sf(t,e){let n=!1;for(let r of e)pa(t,r)&1&&(n=!0);return n}function oC(t,e,n){let r=n.map(f=>t[f.id]),s=n.map(f=>f.type),a=r.filter(f=>!(f&1)),c=t[e.id]>>1;function d(f){let h=[];for(let g=0;g<r.length;g++){let b=Vo(f,r[g]);if(s[g]==2)for(let v of b)h.push(v);else h.push(b)}return e.combine(h)}return{create(f){for(let h of r)pa(f,h);return f.values[c]=d(f),1},update(f,h){if(!sf(f,a))return 0;let g=d(f);return e.compare(g,f.values[c])?0:(f.values[c]=g,1)},reconfigure(f,h){let g=sf(f,r),b=h.config.facets[e.id],v=h.facet(e);if(b&&!g&&rf(n,b))return f.values[c]=v,0;let S=d(f);return e.compare(S,v)?(f.values[c]=v,0):(f.values[c]=S,1)}}}const Io=He.define({static:!0});class Br{constructor(e,n,r,s,a){this.id=e,this.createF=n,this.updateF=r,this.compareF=s,this.spec=a,this.provides=void 0}static define(e){let n=new Br(nf++,e.create,e.update,e.compare||((r,s)=>r===s),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Io).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,s)=>{let a=r.values[n],c=this.updateF(a,s);return this.compareF(a,c)?0:(r.values[n]=c,1)},reconfigure:(r,s)=>{let a=r.facet(Io),c=s.facet(Io),d;return(d=a.find(f=>f.field==this))&&d!=c.find(f=>f.field==this)?(r.values[n]=d.create(r),1):s.config.address[this.id]!=null?(r.values[n]=s.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Io.of({field:this,create:e})]}get extension(){return this}}const Ns={lowest:4,low:3,default:2,high:1,highest:0};function ha(t){return e=>new ly(e,t)}const Uo={highest:ha(Ns.highest),high:ha(Ns.high),default:ha(Ns.default),low:ha(Ns.low),lowest:ha(Ns.lowest)};class ly{constructor(e,n){this.inner=e,this.prec=n}get extension(){return this}}class tr{of(e){return new lf(this,e)}reconfigure(e){return tr.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class lf{constructor(e,n){this.compartment=e,this.inner=n}get extension(){return this}}class Fo{constructor(e,n,r,s,a,c){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=s,this.staticValues=a,this.facets=c,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 s=[],a=Object.create(null),c=new Map;for(let v of cC(e,n,c))v instanceof Br?s.push(v):(a[v.facet.id]||(a[v.facet.id]=[])).push(v);let d=Object.create(null),f=[],h=[];for(let v of s)d[v.id]=h.length<<1,h.push(S=>v.slot(S));let g=r?.config.facets;for(let v in a){let S=a[v],A=S[0].facet,C=g&&g[v]||[];if(S.every(T=>T.type==0))if(d[A.id]=f.length<<1|1,rf(C,S))f.push(r.facet(A));else{let T=A.combine(S.map(D=>D.value));f.push(r&&A.compare(T,r.facet(A))?r.facet(A):T)}else{for(let T of S)T.type==0?(d[T.id]=f.length<<1|1,f.push(T.value)):(d[T.id]=h.length<<1,h.push(D=>T.dynamicSlot(D)));d[A.id]=h.length<<1,h.push(T=>oC(T,A,S))}}let b=h.map(v=>v(d));return new Fo(e,c,b,d,f,a)}}function cC(t,e,n){let r=[[],[],[],[],[]],s=new Map;function a(c,d){let f=s.get(c);if(f!=null){if(f<=d)return;let h=r[f].indexOf(c);h>-1&&r[f].splice(h,1),c instanceof lf&&n.delete(c.compartment)}if(s.set(c,d),Array.isArray(c))for(let h of c)a(h,d);else if(c instanceof lf){if(n.has(c.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(c.compartment)||c.inner;n.set(c.compartment,h),a(h,d)}else if(c instanceof ly)a(c.inner,c.prec);else if(c instanceof Br)r[d].push(c),c.provides&&a(c.provides,d);else if(c instanceof Ho)r[d].push(c),c.facet.extensions&&a(c.facet.extensions,Ns.default);else{let h=c.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${c}).`);if(h==c)throw new Error(`Unrecognized extension value in extension set (${c}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(h,d)}}return a(t,Ns.default),r.reduce((c,d)=>c.concat(d))}function pa(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 s=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|s}function Vo(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const ay=He.define(),af=He.define({combine:t=>t.some(e=>e),static:!0}),oy=He.define({combine:t=>t.length?t[0]:void 0,static:!0}),cy=He.define(),uy=He.define(),dy=He.define(),fy=He.define({combine:t=>t.length?t[0]:!1});class $r{constructor(e,n){this.type=e,this.value=n}static define(){return new uC}}class uC{of(e){return new $r(this,e)}}class dC{constructor(e){this.map=e}of(e){return new zt(this,e)}}class zt{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 zt(this.type,n)}is(e){return this.type==e}static define(e={}){return new dC(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let s of e){let a=s.map(n);a&&r.push(a)}return r}}zt.reconfigure=zt.define(),zt.appendConfig=zt.define();class en{constructor(e,n,r,s,a,c){this.startState=e,this.changes=n,this.selection=r,this.effects=s,this.annotations=a,this.scrollIntoView=c,this._doc=null,this._state=null,r&&ry(r,n.newLength),a.some(d=>d.type==en.time)||(this.annotations=a.concat(en.time.of(Date.now())))}static create(e,n,r,s,a,c){return new en(e,n,r,s,a,c)}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(en.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}en.time=$r.define(),en.userEvent=$r.define(),en.addToHistory=$r.define(),en.remote=$r.define();function fC(t,e){let n=[];for(let r=0,s=0;;){let a,c;if(r<t.length&&(s==e.length||e[s]>=t[r]))a=t[r++],c=t[r++];else if(s<e.length)a=e[s++],c=e[s++];else return n;!n.length||n[n.length-1]<a?n.push(a,c):n[n.length-1]<c&&(n[n.length-1]=c)}}function hy(t,e,n){var r;let s,a,c;return n?(s=e.changes,a=Zt.empty(e.changes.length),c=t.changes.compose(e.changes)):(s=e.changes.map(t.changes),a=t.changes.mapDesc(e.changes,!0),c=t.changes.compose(s)),{changes:c,selection:e.selection?e.selection.map(a):(r=t.selection)===null||r===void 0?void 0:r.map(s),effects:zt.mapEffects(t.effects,s).concat(zt.mapEffects(e.effects,a)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function of(t,e,n){let r=e.selection,s=sl(e.annotations);return e.userEvent&&(s=s.concat(en.userEvent.of(e.userEvent))),{changes:e.changes instanceof Zt?e.changes:Zt.of(e.changes||[],n,t.facet(oy)),selection:r&&(r instanceof Ce?r:Ce.single(r.anchor,r.head)),effects:sl(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function py(t,e,n){let r=of(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let a=1;a<e.length;a++){e[a].filter===!1&&(n=!1);let c=!!e[a].sequential;r=hy(r,of(t,e[a],c?r.changes.newLength:t.doc.length),c)}let s=en.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return pC(n?hC(s):s)}function hC(t){let e=t.startState,n=!0;for(let s of e.facet(cy)){let a=s(t);if(a===!1){n=!1;break}Array.isArray(a)&&(n=n===!0?a:fC(n,a))}if(n!==!0){let s,a;if(n===!1)a=t.changes.invertedDesc,s=Zt.empty(e.doc.length);else{let c=t.changes.filter(n);s=c.changes,a=c.filtered.mapDesc(c.changes).invertedDesc}t=en.create(e,s,t.selection&&t.selection.map(a),zt.mapEffects(t.effects,a),t.annotations,t.scrollIntoView)}let r=e.facet(uy);for(let s=r.length-1;s>=0;s--){let a=r[s](t);a instanceof en?t=a:Array.isArray(a)&&a.length==1&&a[0]instanceof en?t=a[0]:t=py(e,sl(a),!1)}return t}function pC(t){let e=t.startState,n=e.facet(dy),r=t;for(let s=n.length-1;s>=0;s--){let a=n[s](t);a&&Object.keys(a).length&&(r=hy(r,of(e,a,t.changes.newLength),!0))}return r==t?t:en.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const mC=[];function sl(t){return t==null?mC:Array.isArray(t)?t:[t]}var nr=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(nr||(nr={}));const gC=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let cf;try{cf=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function yC(t){if(cf)return cf.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||gC.test(n)))return!0}return!1}function bC(t){return e=>{if(!/\S/.test(e))return nr.Space;if(yC(e))return nr.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return nr.Word;return nr.Other}}class vt{constructor(e,n,r,s,a,c){this.config=e,this.doc=n,this.selection=r,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=a,c&&(c._state=this);for(let d=0;d<this.config.dynamicSlots.length;d++)pa(this,d<<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 pa(this,r),Vo(this,r)}update(...e){return py(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:s}=n;for(let d of e.effects)d.is(tr.reconfigure)?(n&&(s=new Map,n.compartments.forEach((f,h)=>s.set(h,f)),n=null),s.set(d.value.compartment,d.value.extension)):d.is(zt.reconfigure)?(n=null,r=d.value):d.is(zt.appendConfig)&&(n=null,r=sl(r).concat(d.value));let a;n?a=e.startState.values.slice():(n=Fo.resolve(r,s,this),a=new vt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(f,h)=>h.reconfigure(f,this),null).values);let c=e.startState.facet(af)?e.newSelection:e.newSelection.asSingle();new vt(n,e.newDoc,c,a,(d,f)=>f.update(d,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:Ce.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),s=this.changes(r.changes),a=[r.range],c=sl(r.effects);for(let d=1;d<n.ranges.length;d++){let f=e(n.ranges[d]),h=this.changes(f.changes),g=h.map(s);for(let v=0;v<d;v++)a[v]=a[v].map(g);let b=s.mapDesc(h,!0);a.push(f.range.map(b)),s=s.compose(g),c=zt.mapEffects(c,g).concat(zt.mapEffects(sl(f.effects),b))}return{changes:s,selection:Ce.create(a,n.mainIndex),effects:c}}changes(e=[]){return e instanceof Zt?e:Zt.of(e,this.doc.length,this.facet(vt.lineSeparator))}toText(e){return pt.of(e.split(this.facet(vt.lineSeparator)||Zd))}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:(pa(this,n),Vo(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let s=e[r];s instanceof Br&&this.config.address[s.id]!=null&&(n[r]=s.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 s=[];if(r){for(let a in r)if(Object.prototype.hasOwnProperty.call(e,a)){let c=r[a],d=e[a];s.push(c.init(f=>c.spec.fromJSON(d,f)))}}return vt.create({doc:e.doc,selection:Ce.fromJSON(e.selection),extensions:n.extensions?s.concat([n.extensions]):s})}static create(e={}){let n=Fo.resolve(e.extensions||[],new Map),r=e.doc instanceof pt?e.doc:pt.of((e.doc||"").split(n.staticFacet(vt.lineSeparator)||Zd)),s=e.selection?e.selection instanceof Ce?e.selection:Ce.single(e.selection.anchor,e.selection.head):Ce.single(0);return ry(s,r.length),n.staticFacet(af)||(s=s.asSingle()),new vt(n,r,s,n.dynamicSlots.map(()=>null),(a,c)=>c.create(a),null)}get tabSize(){return this.facet(vt.tabSize)}get lineBreak(){return this.facet(vt.lineSeparator)||`
|
|
53
|
+
`}get readOnly(){return this.facet(fy)}phrase(e,...n){for(let r of this.facet(vt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,s)=>{if(s=="$")return"$";let a=+(s||1);return!a||a>n.length?r:n[a-1]})),e}languageDataAt(e,n,r=-1){let s=[];for(let a of this.facet(ay))for(let c of a(this,n,r))Object.prototype.hasOwnProperty.call(c,e)&&s.push(c[e]);return s}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return bC(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:s}=this.doc.lineAt(e),a=this.charCategorizer(e),c=e-r,d=e-r;for(;c>0;){let f=Sn(n,c,!1);if(a(n.slice(f,c))!=nr.Word)break;c=f}for(;d<s;){let f=Sn(n,d);if(a(n.slice(d,f))!=nr.Word)break;d=f}return c==d?null:Ce.range(c+r,d+r)}}vt.allowMultipleSelections=af,vt.tabSize=He.define({combine:t=>t.length?t[0]:4}),vt.lineSeparator=oy,vt.readOnly=fy,vt.phrases=He.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(s=>t[s]==e[s])}}),vt.languageData=ay,vt.changeFilter=cy,vt.transactionFilter=uy,vt.transactionExtender=dy,tr.reconfigure=zt.define();function uf(t,e,n={}){let r={};for(let s of t)for(let a of Object.keys(s)){let c=s[a],d=r[a];if(d===void 0)r[a]=c;else if(!(d===c||c===void 0))if(Object.hasOwnProperty.call(n,a))r[a]=n[a](d,c);else throw new Error("Config merge conflict for field "+a)}for(let s in e)r[s]===void 0&&(r[s]=e[s]);return r}class Ts{eq(e){return this==e}range(e,n=e){return ff.create(e,n,this)}}Ts.prototype.startSide=Ts.prototype.endSide=0,Ts.prototype.point=!1,Ts.prototype.mapMode=Yn.TrackDel;function df(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let ff=class H2{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new H2(e,n,r)}};function hf(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class pf{constructor(e,n,r,s){this.from=e,this.to=n,this.value=r,this.maxPoint=s}get length(){return ll(this.to)}findIndex(e,n,r,s=0){let a=r?this.to:this.from;for(let c=s,d=a.length;;){if(c==d)return c;let f=c+d>>1,h=a[f]-e||(r?this.value[f].endSide:this.value[f].startSide)-n;if(f==c)return h>=0?c:d;h>=0?d=f:c=f+1}}between(e,n,r,s){for(let a=this.findIndex(n,-1e9,!0),c=this.findIndex(r,1e9,!1,a);a<c;a++)if(s(this.from[a]+e,this.to[a]+e,this.value[a])===!1)return!1}map(e,n,r,s,a){let c=[],d=[],f=[],h=-1,g=-1;e:for(let b=0;b<this.value.length;b++){let v=this.value[b],S=this.from[b]+e,A=this.to[b]+e,C,T;if(S==A){let D=n.mapPos(S,v.startSide,v.mapMode);if(D==null||(C=T=D,v.startSide!=v.endSide&&(T=n.mapPos(S,v.endSide),T<C)))continue}else if(C=n.mapPos(S,v.startSide),T=n.mapPos(A,v.endSide),C>T||C==T&&v.startSide>0&&v.endSide<=0)continue;if(!((T-C||v.endSide-v.startSide)<0))if(h<0&&(h=C),v.point&&(g=Math.max(g,T-C)),(C-r||v.startSide-s)>=0)c.push(v),d.push(C-h),f.push(T-h),r=T,s=v.endSide;else{if(C==T)for(let D=c.length;D>0;D--){if((C-(f[D-1]+h)||v.startSide-c[D-1].endSide)>=0){c.splice(D,0,v),d.splice(D,0,C-h),f.splice(D,0,T-h);continue e}if((C-(d[D-1]+h)||v.endSide-c[D-1].startSide)>0)break}a(C,T,v)}}return{mapped:c.length?new pf(d,f,c,g):null,pos:h}}}class ft{constructor(e,n,r,s){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=s}static create(e,n,r,s){return new ft(e,n,r,s)}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:s=0,filterTo:a=this.length}=e,c=e.filter;if(n.length==0&&!c)return this;if(r&&(n=n.slice().sort(hf)),this.isEmpty)return n.length?ft.of(n):this;let d=new gy(this,null,-1).goto(0),f=0,h=[],g=new ma;for(;d.value||f<n.length;)if(f<n.length&&(d.from-n[f].from||d.startSide-n[f].value.startSide)>=0){let b=n[f++];g.addInner(b.from,b.to,b.value,!1)||h.push(b)}else d.rangeIndex==1&&d.chunkIndex<this.chunk.length&&(f==n.length||this.chunkEnd(d.chunkIndex)<n[f].from)&&(!c||s>this.chunkEnd(d.chunkIndex)||a<this.chunkPos[d.chunkIndex])&&g.addChunk(this.chunkPos[d.chunkIndex],this.chunk[d.chunkIndex])?d.nextChunk():((!c||s>d.to||a<d.from||c(d.from,d.to,d.value))&&(g.addInner(d.from,d.to,d.value,!1)||h.push(ff.create(d.from,d.to,d.value))),d.next());return g.finishInner(this.nextLayer.isEmpty&&!h.length?ft.empty:this.nextLayer.update({add:h,filter:c,filterFrom:s,filterTo:a}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],s=-1,a,c=(f,h,g)=>{a||(a=new ma),a.addRange(f,h,g,!1)};for(let f=0;f<this.chunk.length;f++){let h=this.chunkPos[f],g=this.chunk[f],b=e.touchesRange(h,h+g.length);if(b===!1)s=Math.max(s,g.maxPoint),n.push(g),r.push(e.mapPos(h));else if(b===!0){let[v,S]=n.length?[ll(r)+ll(n).length,ll(ll(n).value).endSide]:[-1,-1],{mapped:A,pos:C}=g.map(h,e,v,S,c);A&&(s=Math.max(s,A.maxPoint),n.push(A),r.push(C))}}let d=this.nextLayer.map(e);return a&&(d=a.finishInner(d)),n.length==0?d:new ft(r,n,d||ft.empty,s)}between(e,n,r){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let a=this.chunkPos[s],c=this.chunk[s];if(n>=a&&e<=a+c.length&&c.between(a,e-a,n-a,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return ga.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return ga.from(e).goto(n)}static compare(e,n,r,s,a=-1){let c=e.filter(b=>b.maxPoint>0||!b.isEmpty&&b.maxPoint>=a),d=n.filter(b=>b.maxPoint>0||!b.isEmpty&&b.maxPoint>=a),f=my(c,d,r),h=new ya(c,f,a),g=new ya(d,f,a);r.iterGaps((b,v,S)=>yy(h,b,g,v,S,s)),r.empty&&r.length==0&&yy(h,0,g,0,0,s)}static eq(e,n,r=0,s){s==null&&(s=999999999);let a=e.filter(g=>!g.isEmpty&&n.indexOf(g)<0),c=n.filter(g=>!g.isEmpty&&e.indexOf(g)<0);if(a.length!=c.length)return!1;if(!a.length)return!0;let d=my(a,c),f=new ya(a,d,0).goto(r),h=new ya(c,d,0).goto(r);for(;;){if(f.to!=h.to||!gf(f.active,h.active)||f.point&&(!h.point||!df(f.point,h.point)))return!1;if(f.to>s)return!0;f.next(),h.next()}}static spans(e,n,r,s,a=-1){let c=new ya(e,null,a).goto(n),d=n,f=c.openStart;for(;;){let h=Math.min(c.to,r);if(c.point){let g=c.activeForPoint(c.to),b=c.pointFrom<n?g.length+1:c.point.startSide<0?g.length:Math.min(g.length,f);s.point(d,h,c.point,g,b,c.pointRank),f=Math.min(c.openEnd(h),g.length)}else h>d&&(s.span(d,h,c.active,f),f=c.openEnd(h));if(c.to>r)return f+(c.point&&c.to>r?1:0);d=c.to,c.next()}}static of(e,n=!1){let r=new ma;for(let s of e instanceof ff?[e]:n?xC(e):e)r.add(s.from,s.to,s.value);return r.finish()}static join(e){if(!e.length)return ft.empty;let n=ll(e);for(let r=e.length-2;r>=0;r--)for(let s=e[r];s!=ft.empty;s=s.nextLayer)n=new ft(s.chunkPos,s.chunk,n,Math.max(s.maxPoint,n.maxPoint));return n}}ft.empty=new ft([],[],null,-1);function ll(t){return t[t.length-1]}function xC(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(hf(e,r)>0)return t.slice().sort(hf);e=r}return t}ft.empty.nextLayer=ft.empty;class ma{finishChunk(e){this.chunks.push(new pf(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.addRange(e,n,r,!0)}addRange(e,n,r,s){this.addInner(e,n,r,s)||(this.nextLayer||(this.nextLayer=new ma)).addRange(e,n,r,s)}addInner(e,n,r,s){let a=e-this.lastTo||r.startSide-this.last.endSide;if(s&&a<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return a<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(ft.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=ft.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function my(t,e,n){let r=new Map;for(let a of t)for(let c=0;c<a.chunk.length;c++)a.chunk[c].maxPoint<=0&&r.set(a.chunk[c],a.chunkPos[c]);let s=new Set;for(let a of e)for(let c=0;c<a.chunk.length;c++){let d=r.get(a.chunk[c]);d!=null&&(n?n.mapPos(d):d)==a.chunkPos[c]&&!n?.touchesRange(d,d+a.chunk[c].length)&&s.add(a.chunk[c])}return s}class gy{constructor(e,n,r,s=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=s}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 s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<e||s.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<s)&&this.setRangeIndex(s)}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 ga{constructor(e){this.heap=e}static from(e,n=null,r=-1){let s=[];for(let a=0;a<e.length;a++)for(let c=e[a];!c.isEmpty;c=c.nextLayer)c.maxPoint>=r&&s.push(new gy(c,n,r,a));return s.length==1?s[0]:new ga(s)}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--)mf(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--)mf(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(),mf(this.heap,0)}}}function mf(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let s=t[r];if(r+1<t.length&&s.compare(t[r+1])>=0&&(s=t[r+1],r++),n.compare(s)<0)break;t[r]=n,t[e]=s,e=r}}class ya{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=ga.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){Po(this.active,e),Po(this.activeTo,e),Po(this.activeRank,e),this.minActive=by(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:s,rank:a}=this.cursor;for(;n<this.activeRank.length&&(a-this.activeRank[n]||s-this.activeTo[n])>0;)n++;Ko(this.active,n,r),Ko(this.activeTo,n,s),Ko(this.activeRank,n,a),e&&Ko(e,n,this.cursor.from),this.minActive=by(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),r&&Po(r,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let a=this.cursor.value;if(!a.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=a,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=a.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 s=r.length-1;s>=0&&r[s]<e;s--)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 yy(t,e,n,r,s,a){t.goto(e),n.goto(r);let c=r+s,d=r,f=r-e,h=!!a.boundChange;for(let g=!1;;){let b=t.to+f-n.to,v=b||t.endSide-n.endSide,S=v<0?t.to+f:n.to,A=Math.min(S,c);if(t.point||n.point?(t.point&&n.point&&df(t.point,n.point)&&gf(t.activeForPoint(t.to),n.activeForPoint(n.to))||a.comparePoint(d,A,t.point,n.point),g=!1):(g&&a.boundChange(d),A>d&&!gf(t.active,n.active)&&a.compareRange(d,A,t.active,n.active),h&&A<c&&(b||t.openEnd(S)!=n.openEnd(S))&&(g=!0)),S>c)break;d=S,v<=0&&t.next(),v>=0&&n.next()}}function gf(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!df(t[n],e[n]))return!1;return!0}function Po(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function Ko(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function by(t,e){let n=-1,r=1e9;for(let s=0;s<e.length;s++)(e[s]-r||t[s].endSide-t[n].endSide)<0&&(n=s,r=e[s]);return n}function Yo(t,e,n=t.length){let r=0;for(let s=0;s<n&&s<t.length;)t.charCodeAt(s)==9?(r+=e-r%e,s++):(r++,s=Sn(t,s));return r}function vC(t,e,n,r){for(let s=0,a=0;;){if(a>=e)return s;if(s==t.length)break;a+=t.charCodeAt(s)==9?n-a%n:1,s=Sn(t,s)}return t.length}const yf="ͼ",xy=typeof Symbol>"u"?"__"+yf:Symbol.for(yf),bf=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),vy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class al{constructor(e,n){this.rules=[];let{finish:r}=n||{};function s(c){return/^@/.test(c)?[c]:c.split(/,\s*/)}function a(c,d,f,h){let g=[],b=/^@(\w+)\b/.exec(c[0]),v=b&&b[1]=="keyframes";if(b&&d==null)return f.push(c[0]+";");for(let S in d){let A=d[S];if(/&/.test(S))a(S.split(/,\s*/).map(C=>c.map(T=>C.replace(/&/,T))).reduce((C,T)=>C.concat(T)),A,f);else if(A&&typeof A=="object"){if(!b)throw new RangeError("The value of a property ("+S+") should be a primitive value.");a(s(S),A,g,v)}else A!=null&&g.push(S.replace(/_.*/,"").replace(/[A-Z]/g,C=>"-"+C.toLowerCase())+": "+A+";")}(g.length||v)&&f.push((r&&!b&&!h?c.map(r):c).join(", ")+" {"+g.join(" ")+"}")}for(let c in e)a(s(c),e[c],this.rules)}getRules(){return this.rules.join(`
|
|
54
|
+
`)}static newName(){let e=vy[xy]||1;return vy[xy]=e+1,yf+e.toString(36)}static mount(e,n,r){let s=e[bf],a=r&&r.nonce;s?a&&s.setNonce(a):s=new wC(e,a),s.mount(Array.isArray(n)?n:[n],e)}}let wy=new Map;class wC{constructor(e,n){let r=e.ownerDocument||e,s=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let a=wy.get(r);if(a)return e[bf]=a;this.sheet=new s.CSSStyleSheet,wy.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[bf]=this}mount(e,n){let r=this.sheet,s=0,a=0;for(let c=0;c<e.length;c++){let d=e[c],f=this.modules.indexOf(d);if(f<a&&f>-1&&(this.modules.splice(f,1),a--,f=-1),f==-1){if(this.modules.splice(a++,0,d),r)for(let h=0;h<d.rules.length;h++)r.insertRule(d.rules[h],s++)}else{for(;a<f;)s+=this.modules[a++].rules.length;s+=d.rules.length,a++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let c="";for(let f=0;f<this.modules.length;f++)c+=this.modules[f].getRules()+`
|
|
55
|
+
`;this.styleTag.textContent=c;let d=n.head||n;this.styleTag.parentNode!=d&&d.insertBefore(this.styleTag,d.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var qr={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:"'"},ba={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},SC=typeof navigator<"u"&&/Mac/.test(navigator.platform),AC=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),un=0;un<10;un++)qr[48+un]=qr[96+un]=String(un);for(var un=1;un<=24;un++)qr[un+111]="F"+un;for(var un=65;un<=90;un++)qr[un]=String.fromCharCode(un+32),ba[un]=String.fromCharCode(un);for(var xf in qr)ba.hasOwnProperty(xf)||(ba[xf]=qr[xf]);function kC(t){var e=SC&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||AC&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ba:qr)[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 jn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},vf=typeof document<"u"?document:{documentElement:{style:{}}};const wf=/Edge\/(\d+)/.exec(jn.userAgent),Sy=/MSIE \d/.test(jn.userAgent),Sf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(jn.userAgent),Go=!!(Sy||Sf||wf),Ay=!Go&&/gecko\/(\d+)/i.test(jn.userAgent),Af=!Go&&/Chrome\/(\d+)/.exec(jn.userAgent),ky="webkitFontSmoothing"in vf.documentElement.style,kf=!Go&&/Apple Computer/.test(jn.vendor),Cy=kf&&(/Mobile\/\w+/.test(jn.userAgent)||jn.maxTouchPoints>2);var Oe={mac:Cy||/Mac/.test(jn.platform),windows:/Win/.test(jn.platform),linux:/Linux|X11/.test(jn.platform),ie:Go,ie_version:Sy?vf.documentMode||6:Sf?+Sf[1]:wf?+wf[1]:0,gecko:Ay,gecko_version:Ay?+(/Firefox\/(\d+)/.exec(jn.userAgent)||[0,0])[1]:0,chrome:!!Af,chrome_version:Af?+Af[1]:0,ios:Cy,android:/Android\b/.test(jn.userAgent),webkit:ky,webkit_version:ky?+(/\bAppleWebKit\/(\d+)/.exec(jn.userAgent)||[0,0])[1]:0,safari:kf,safari_version:kf?+(/\bVersion\/(\d+(\.\d+)?)/.exec(jn.userAgent)||[0,0])[1]:0,tabSize:vf.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Cf(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 Xo=Object.create(null);function Nf(t,e,n){if(t==e)return!0;t||(t=Xo),e||(e=Xo);let r=Object.keys(t),s=Object.keys(e);if(r.length-0!=s.length-0)return!1;for(let a of r)if(a!=n&&(s.indexOf(a)==-1||t[a]!==e[a]))return!1;return!0}function CC(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 Ny(t,e,n){let r=!1;if(e)for(let s in e)n&&s in n||(r=!0,s=="style"?t.style.cssText="":t.removeAttribute(s));if(n)for(let s in n)e&&e[s]==n[s]||(r=!0,s=="style"?t.style.cssText=n[s]:t.setAttribute(s,n[s]));return r}function NC(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 Jo{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 dn=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(dn||(dn={}));class nn extends Ts{constructor(e,n,r,s){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=s}get heightRelevant(){return!1}static mark(e){return new xa(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 js(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,s;if(e.isBlockGap)r=-5e8,s=4e8;else{let{start:a,end:c}=Ty(e,n);r=(a?n?-3e8:-1:5e8)-1,s=(c?n?2e8:1:-6e8)+1}return new js(e,r,s,n,e.widget||null,!0)}static line(e){return new va(e)}static set(e,n=!1){return ft.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}nn.none=ft.empty;class xa extends nn{constructor(e){let{start:n,end:r}=Ty(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Cf(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Xo}eq(e){return this==e||e instanceof xa&&this.tagName==e.tagName&&Nf(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)}}xa.prototype.point=!1;class va extends nn{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof va&&this.spec.class==e.spec.class&&Nf(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)}}va.prototype.mapMode=Yn.TrackBefore,va.prototype.point=!0;class js extends nn{constructor(e,n,r,s,a,c){super(n,r,a,e),this.block=s,this.isReplace=c,this.mapMode=s?n<=0?Yn.TrackBefore:Yn.TrackAfter:Yn.TrackDel}get type(){return this.startSide!=this.endSide?dn.WidgetRange:this.startSide<=0?dn.WidgetBefore:dn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof js&&TC(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)}}js.prototype.point=!0;function Ty(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 TC(t,e){return t==e||!!(t&&e&&t.compare(e))}function ol(t,e,n,r=0){let s=n.length-1;s>=0&&n[s]+r>=t?n[s]=Math.max(n[s],e):n.push(t,e)}class wa extends Ts{constructor(e,n,r){super(),this.tagName=e,this.attributes=n,this.rank=r}eq(e){return e==this||e instanceof wa&&this.tagName==e.tagName&&Nf(this.attributes,e.attributes)}static create(e){return new wa(e.tagName,e.attributes||Xo,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,n=!1){return ft.of(e,n)}}wa.prototype.startSide=wa.prototype.endSide=-1;function Sa(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Tf(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Aa(t,e){if(!e.anchorNode)return!1;try{return Tf(t,e.anchorNode)}catch{return!1}}function Qo(t){return t.nodeType==3?Ca(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function ka(t,e,n,r){return n?jy(t,e,n,r,-1)||jy(t,e,n,r,1):!1}function zr(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Wo(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function jy(t,e,n,r,s){for(;;){if(t==n&&e==r)return!0;if(e==(s<0?0:ir(t))){if(t.nodeName=="DIV")return!1;let a=t.parentNode;if(!a||a.nodeType!=1)return!1;e=zr(t)+(s<0?0:1),t=a}else if(t.nodeType==1){if(t=t.childNodes[e+(s<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=s<0?ir(t):0}else return!1}}function ir(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Zo(t,e){let{left:n,right:r}=t;if(n==r)return t;let s=e?n:r;return{left:s,right:s,top:t.top,bottom:t.bottom}}function jC(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 Ey(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 EC(t,e,n,r,s,a,c,d){let f=t.ownerDocument,h=f.defaultView||window;for(let g=t,b=!1;g&&!b;)if(g.nodeType==1){let v,S=g==f.body,A=1,C=1;if(S)v=jC(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(g).position)&&(b=!0),g.scrollHeight<=g.clientHeight&&g.scrollWidth<=g.clientWidth){g=g.assignedSlot||g.parentNode;continue}let j=g.getBoundingClientRect();({scaleX:A,scaleY:C}=Ey(g,j)),v={left:j.left,right:j.left+g.clientWidth*A,top:j.top,bottom:j.top+g.clientHeight*C}}let T=0,D=0;if(s=="nearest")e.top<v.top+c?(D=e.top-(v.top+c),n>0&&e.bottom>v.bottom+D&&(D=e.bottom-v.bottom+c)):e.bottom>v.bottom-c&&(D=e.bottom-v.bottom+c,n<0&&e.top-D<v.top&&(D=e.top-(v.top+c)));else{let j=e.bottom-e.top,E=v.bottom-v.top;D=(s=="center"&&j<=E?e.top+j/2-E/2:s=="start"||s=="center"&&n<0?e.top-c:e.bottom-E+c)-v.top}if(r=="nearest"?e.left<v.left+a?(T=e.left-(v.left+a),n>0&&e.right>v.right+T&&(T=e.right-v.right+a)):e.right>v.right-a&&(T=e.right-v.right+a,n<0&&e.left<v.left+T&&(T=e.left-(v.left+a))):T=(r=="center"?e.left+(e.right-e.left)/2-(v.right-v.left)/2:r=="start"==d?e.left-a:e.right-(v.right-v.left)+a)-v.left,T||D)if(S)h.scrollBy(T,D);else{let j=0,E=0;if(D){let O=g.scrollTop;g.scrollTop+=D/C,E=(g.scrollTop-O)*C}if(T){let O=g.scrollLeft;g.scrollLeft+=T/A,j=(g.scrollLeft-O)*A}e={left:e.left-j,top:e.top-E,right:e.right-j,bottom:e.bottom-E},j&&Math.abs(j-T)<1&&(r="nearest"),E&&Math.abs(E-D)<1&&(s="nearest")}if(S)break;(e.top<v.top||e.bottom>v.bottom||e.left<v.left||e.right>v.right)&&(e={left:Math.max(e.left,v.left),right:Math.min(e.right,v.right),top:Math.max(e.top,v.top),bottom:Math.min(e.bottom,v.bottom)}),g=g.assignedSlot||g.parentNode}else if(g.nodeType==11)g=g.host;else break}function Oy(t,e=!0){let n=t.ownerDocument,r=null,s=null;for(let a=t.parentNode;a&&!(a==n.body||(!e||r)&&s);)if(a.nodeType==1)!s&&a.scrollHeight>a.clientHeight&&(s=a),e&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:s}}class OC{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?ir(n):0),r,Math.min(e.focusOffset,r?ir(r):0))}set(e,n,r,s){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=s}}function My(t){let e=[];for(let n=t;n;n=n.nodeType==11?n.host:n.parentNode)n.nodeType==1&&e.push({node:n,left:n.scrollLeft,top:n.scrollTop});return e}function Ry(t,e=!0){for(let{node:n,left:r,top:s}of t)e&&n.scrollTop!=s&&(n.scrollTop=s),n.scrollLeft!=r&&(n.scrollLeft=r)}let Es=null;Oe.safari&&Oe.safari_version>=26&&(Es=!1);function Dy(t){if(t.setActive)return t.setActive();if(Es)return t.focus(Es);let e=My(t);t.focus(Es==null?{get preventScroll(){return Es={preventScroll:!0},!0}}:void 0),Es||(Es=!1,Ry(e))}let _y;function Ca(t,e,n=e){let r=_y||(_y=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function cl(t,e,n,r){let s={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=r);let a=new KeyboardEvent("keydown",s);a.synthetic=!0,t.dispatchEvent(a);let c=new KeyboardEvent("keyup",s);return c.synthetic=!0,t.dispatchEvent(c),a.defaultPrevented||c.defaultPrevented}function MC(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function RC(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,ir(n));;)if(r){if(n.nodeType!=1)return!1;let s=n.childNodes[r-1];s.contentEditable=="false"?r--:(n=s,r=ir(n))}else{if(n==t)return!0;r=zr(n),n=n.parentNode}}function Ly(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 By(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=ir(n)}else if(n.parentNode&&!Wo(n))r=zr(n),n=n.parentNode;else return null}}function $y(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&&!Wo(n))r=zr(n)+1,n=n.parentNode;else return null}}class ji{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new ji(e.parentNode,zr(e),n)}static after(e,n){return new ji(e.parentNode,zr(e)+1,n)}}var Rt=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Rt||(Rt={}));const Os=Rt.LTR,jf=Rt.RTL;function qy(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const DC=qy("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),_C=qy("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Ef=Object.create(null),Ui=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);Ef[e]=n,Ef[n]=-e}function zy(t){return t<=247?DC[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?_C[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const LC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Fi{get dir(){return this.level%2?jf:Os}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,s){let a=-1;for(let c=0;c<e.length;c++){let d=e[c];if(d.from<=n&&d.to>=n){if(d.level==r)return c;(a<0||(s!=0?s<0?d.from<n:d.to>n:e[a].level>d.level))&&(a=c)}}if(a<0)throw new RangeError("Index out of range");return a}}function Hy(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],s=e[n];if(r.from!=s.from||r.to!=s.to||r.direction!=s.direction||!Hy(r.inner,s.inner))return!1}return!0}const Nt=[];function BC(t,e,n,r,s){for(let a=0;a<=r.length;a++){let c=a?r[a-1].to:e,d=a<r.length?r[a].from:n,f=a?256:s;for(let h=c,g=f,b=f;h<d;h++){let v=zy(t.charCodeAt(h));v==512?v=g:v==8&&b==4&&(v=16),Nt[h]=v==4?2:v,v&7&&(b=v),g=v}for(let h=c,g=f,b=f;h<d;h++){let v=Nt[h];if(v==128)h<d-1&&g==Nt[h+1]&&g&24?v=Nt[h]=g:Nt[h]=256;else if(v==64){let S=h+1;for(;S<d&&Nt[S]==64;)S++;let A=h&&g==8||S<n&&Nt[S]==8?b==1?1:8:256;for(let C=h;C<S;C++)Nt[C]=A;h=S-1}else v==8&&b==1&&(Nt[h]=1);g=v,v&7&&(b=v)}}}function $C(t,e,n,r,s){let a=s==1?2:1;for(let c=0,d=0,f=0;c<=r.length;c++){let h=c?r[c-1].to:e,g=c<r.length?r[c].from:n;for(let b=h,v,S,A;b<g;b++)if(S=Ef[v=t.charCodeAt(b)])if(S<0){for(let C=d-3;C>=0;C-=3)if(Ui[C+1]==-S){let T=Ui[C+2],D=T&2?s:T&4?T&1?a:s:0;D&&(Nt[b]=Nt[Ui[C]]=D),d=C;break}}else{if(Ui.length==189)break;Ui[d++]=b,Ui[d++]=v,Ui[d++]=f}else if((A=Nt[b])==2||A==1){let C=A==s;f=C?0:1;for(let T=d-3;T>=0;T-=3){let D=Ui[T+2];if(D&2)break;if(C)Ui[T+2]|=2;else{if(D&4)break;Ui[T+2]|=4}}}}}function qC(t,e,n,r){for(let s=0,a=r;s<=n.length;s++){let c=s?n[s-1].to:t,d=s<n.length?n[s].from:e;for(let f=c;f<d;){let h=Nt[f];if(h==256){let g=f+1;for(;;)if(g==d){if(s==n.length)break;g=n[s++].to,d=s<n.length?n[s].from:e}else if(Nt[g]==256)g++;else break;let b=a==1,v=(g<e?Nt[g]:r)==1,S=b==v?b?1:2:r;for(let A=g,C=s,T=C?n[C-1].to:t;A>f;)A==T&&(A=n[--C].from,T=C?n[C-1].to:t),Nt[--A]=S;f=g}else a=h,f++}}}function Of(t,e,n,r,s,a,c){let d=r%2?2:1;if(r%2==s%2)for(let f=e,h=0;f<n;){let g=!0,b=!1;if(h==a.length||f<a[h].from){let C=Nt[f];C!=d&&(g=!1,b=C==16)}let v=!g&&d==1?[]:null,S=g?r:r+1,A=f;e:for(;;)if(h<a.length&&A==a[h].from){if(b)break e;let C=a[h];if(!g)for(let T=C.to,D=h+1;;){if(T==n)break e;if(D<a.length&&a[D].from==T)T=a[D++].to;else{if(Nt[T]==d)break e;break}}if(h++,v)v.push(C);else{C.from>f&&c.push(new Fi(f,C.from,S));let T=C.direction==Os!=!(S%2);Mf(t,T?r+1:r,s,C.inner,C.from,C.to,c),f=C.to}A=C.to}else{if(A==n||(g?Nt[A]!=d:Nt[A]==d))break;A++}v?Of(t,f,A,r+1,s,v,c):f<A&&c.push(new Fi(f,A,S)),f=A}else for(let f=n,h=a.length;f>e;){let g=!0,b=!1;if(!h||f>a[h-1].to){let C=Nt[f-1];C!=d&&(g=!1,b=C==16)}let v=!g&&d==1?[]:null,S=g?r:r+1,A=f;e:for(;;)if(h&&A==a[h-1].to){if(b)break e;let C=a[--h];if(!g)for(let T=C.from,D=h;;){if(T==e)break e;if(D&&a[D-1].to==T)T=a[--D].from;else{if(Nt[T-1]==d)break e;break}}if(v)v.push(C);else{C.to<f&&c.push(new Fi(C.to,f,S));let T=C.direction==Os!=!(S%2);Mf(t,T?r+1:r,s,C.inner,C.from,C.to,c),f=C.from}A=C.from}else{if(A==e||(g?Nt[A-1]!=d:Nt[A-1]==d))break;A--}v?Of(t,A,f,r+1,s,v,c):A<f&&c.push(new Fi(A,f,S)),f=A}}function Mf(t,e,n,r,s,a,c){let d=e%2?2:1;BC(t,s,a,r,d),$C(t,s,a,r,d),qC(s,a,r,d),Of(t,s,a,e,n,r,c)}function zC(t,e,n){if(!t)return[new Fi(0,0,e==jf?1:0)];if(e==Os&&!n.length&&!LC.test(t))return Iy(t.length);if(n.length)for(;t.length>Nt.length;)Nt[Nt.length]=256;let r=[],s=e==Os?0:1;return Mf(t,s,s,n,0,t.length,r),r}function Iy(t){return[new Fi(0,t,0)]}let Uy="";function HC(t,e,n,r,s){var a;let c=r.head-t.from,d=Fi.find(e,c,(a=r.bidiLevel)!==null&&a!==void 0?a:-1,r.assoc),f=e[d],h=f.side(s,n);if(c==h){let v=d+=s?1:-1;if(v<0||v>=e.length)return null;f=e[d=v],c=f.side(!s,n),h=f.side(s,n)}let g=Sn(t.text,c,f.forward(s,n));(g<f.from||g>f.to)&&(g=h),Uy=t.text.slice(Math.min(c,g),Math.max(c,g));let b=d==(s?e.length-1:0)?null:e[d+(s?1:-1)];return b&&g==h&&b.level+(s?0:1)<f.level?Ce.cursor(b.side(!s,n)+t.from,b.forward(s,n)?1:-1,b.level):Ce.cursor(g+t.from,f.forward(s,n)?-1:1,f.level)}function IC(t,e,n){for(let r=e;r<n;r++){let s=zy(t.charCodeAt(r));if(s==1)return Os;if(s==2||s==4)return jf}return Os}const Fy=He.define(),Vy=He.define(),Py=He.define(),Ky=He.define(),Rf=He.define(),Yy=He.define(),Gy=He.define(),Df=He.define(),_f=He.define(),Xy=He.define({combine:t=>t.some(e=>e)}),Jy=He.define({combine:t=>t.some(e=>e)}),Qy=He.define();class ul{constructor(e,n,r,s,a,c=!1){this.range=e,this.y=n,this.x=r,this.yMargin=s,this.xMargin=a,this.isSnapshot=c}map(e){return e.empty?this:new ul(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 ul(Ce.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const ec=zt.define({map:(t,e)=>t.map(e)}),Wy=zt.define();function Vi(t,e,n){let r=t.facet(Ky);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 rr=He.define({combine:t=>t.length?t[0]:!0});let UC=0;const dl=He.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 sr{constructor(e,n,r,s,a){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=s,this.baseExtensions=a(this),this.extension=this.baseExtensions.concat(dl.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(dl.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:s,provide:a,decorations:c}=n||{};return new sr(UC++,e,r,s,d=>{let f=[];return c&&f.push(tc.of(h=>{let g=h.plugin(d);return g?c(g):nn.none})),a&&f.push(a(d)),f})}static fromClass(e,n){return sr.define((r,s)=>new e(r,s),n)}}class Lf{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(Vi(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){Vi(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){Vi(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Zy=He.define(),Bf=He.define(),tc=He.define(),eb=He.define(),$f=He.define(),Na=He.define(),tb=He.define();function nb(t,e){let n=t.state.facet(tb);if(!n.length)return n;let r=n.map(a=>a instanceof Function?a(t):a),s=[];return ft.spans(r,e.from,e.to,{point(){},span(a,c,d,f){let h=a-e.from,g=c-e.from,b=s;for(let v=d.length-1;v>=0;v--,f--){let S=d[v].spec.bidiIsolate,A;if(S==null&&(S=IC(e.text,h,g)),f>0&&b.length&&(A=b[b.length-1]).to==h&&A.direction==S)A.to=g,b=A.inner;else{let C={from:h,to:g,direction:S,inner:[]};b.push(C),b=C.inner}}}}),s}const ib=He.define();function rb(t){let e=0,n=0,r=0,s=0;for(let a of t.state.facet(ib)){let c=a(t);c&&(c.left!=null&&(e=Math.max(e,c.left)),c.right!=null&&(n=Math.max(n,c.right)),c.top!=null&&(r=Math.max(r,c.top)),c.bottom!=null&&(s=Math.max(s,c.bottom)))}return{left:e,right:n,top:r,bottom:s}}const Ta=He.define();class oi{constructor(e,n,r,s){this.fromA=e,this.toA=n,this.fromB=r,this.toB=s}join(e){return new oi(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 s=e[n-1];if(!(s.fromA>r.toA)){if(s.toA<r.fromA)break;r=r.join(s),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 s=0,a=0,c=0;;){let d=s<e.length?e[s].fromB:1e9,f=a<n.length?n[a]:1e9,h=Math.min(d,f);if(h==1e9)break;let g=h+c,b=h,v=g;for(;;)if(a<n.length&&n[a]<=b){let S=n[a+1];a+=2,b=Math.max(b,S);for(let A=s;A<e.length&&e[A].fromB<=b;A++)c=e[A].toA-e[A].toB;v=Math.max(v,S+c)}else if(s<e.length&&e[s].fromB<=b){let S=e[s++];b=Math.max(b,S.toB),v=Math.max(v,S.toA),c=S.toA-S.toB}else break;r.push(new oi(g,v,h,b))}return r}}class nc{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Zt.empty(this.startState.doc.length);for(let a of r)this.changes=this.changes.compose(a.changes);let s=[];this.changes.iterChangedRanges((a,c,d,f)=>s.push(new oi(a,c,d,f))),this.changedRanges=s}static create(e,n,r){return new nc(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 FC=[];class Lt{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 FC}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&&CC(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 s of this.children){if(s==e)return r;r+=s.length+s.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n,r){return null}domPosFor(e,n){let r=zr(this.dom),s=this.length?e>0:n>0;return new ji(this.parent.dom,r+(s?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 rc)return e;return null}static get(e){return e.cmTile}}class ic extends Lt{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,s,a=e?.node==n?e:null,c=0;for(let d of this.children){if(d.sync(e),c+=d.length+d.breakAfter,s=r?r.nextSibling:n.firstChild,a&&s!=d.dom&&(a.written=!0),d.dom.parentNode==n)for(;s&&s!=d.dom;)s=sb(s);else n.insertBefore(d.dom,s);r=d.dom}for(s=r?r.nextSibling:n.firstChild,a&&s&&(a.written=!0);s;)s=sb(s);this.length=c}}function sb(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class rc extends ic{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=Lt.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,s=0,a=0;;)if(s==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&a++,s=n.pop()}else{let c=r.children[s++];if(c instanceof lr)n.push(s),r=c,s=0;else{let d=a+c.length,f=e(c,a);if(f!==void 0)return f;a=d+c.breakAfter}}}resolveBlock(e,n){let r,s=-1,a,c=-1;if(this.blockTiles((d,f)=>{let h=f+d.length;if(e>=f&&e<=h){if(d.isWidget()&&n>=-1&&n<=1){if(d.flags&32)return!0;d.flags&16&&(r=void 0)}(f<e||e==h&&(n<-1?d.length:d.covers(1)))&&(!r||!d.isWidget()&&r.isWidget())&&(r=d,s=e-f),(h>e||e==f&&(n>1?d.length:d.covers(-1)))&&(!a||!d.isWidget()&&a.isWidget())&&(a=d,c=e-f)}}),!r&&!a)throw new Error("No tile at position "+e);return r&&n<0||!a?{tile:r,offset:s}:{tile:a,offset:c}}}class lr extends ic{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 lr(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class fl extends ic{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let s=new fl(n||document.createElement("div"),e);return(!n||!r)&&(s.flags|=4),s}get domAttrs(){return this.attrs}resolveInline(e,n,r){let s=null,a=-1,c=null,d=-1;function f(g,b){for(let v=0,S=0;v<g.children.length&&S<=b;v++){let A=g.children[v],C=S+A.length;C>=b&&(A.isComposite()?f(A,b-S):(!c||c.isHidden&&(n>0&&!(c.flags&32)||r&&PC(c,A)))&&(C>b||A.flags&32&&n<=1)?(c=A,d=b-S):(S<b||A.flags&16&&!A.isHidden&&n>=-1)&&(s=A,a=b-S)),S=C}}f(this,e);let h=(n<0?s:c)||s||c;return h?{tile:h,offset:h==s?a:d}:null}coordsIn(e,n,r){let s=this.resolveInline(e,n,!0);return s?s.tile.coordsIn(Math.max(0,s.offset),n,r):VC(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:s,offset:a}=r;if(this.dom.contains(s.dom))return s.isText()?new ji(s.dom,Math.min(s.dom.nodeValue.length,a)):s.domPosFor(a,s.flags&16?1:s.flags&32?-1:n);let c=r.tile.parent,d=!1;for(let f of c.children){if(d)return new ji(f.dom,0);f==r.tile&&(d=!0)}}return new ji(this.dom,0)}}function VC(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Qo(e);return n[n.length-1]||null}function PC(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class Bn extends ic{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new Bn(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Ms extends Lt{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,r){let s=this.dom.nodeValue.length;e>s&&(e=s);let a=e,c=e,d=0;e==0&&n<0||e==s&&n>=0?Oe.chrome||Oe.gecko||(e?(a--,d=1):c<s&&(c++,d=-1)):n<0?a--:c<s&&c++;let f=Ca(this.dom,a,c).getClientRects();if(!f.length)return null;let h=f[(d?d<0:n>=0)?0:f.length-1];return Oe.safari&&!d&&h.width==0&&(h=Array.prototype.find.call(f,g=>g.width)||h),r==null?h:Zo(h,(d?d>0:n<0)==r)}static of(e,n){let r=new Ms(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class Rs extends Lt{constructor(e,n,r,s){super(e,n,s),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 s=this.widget.coordsAt(this.dom,e,n);if(s)return s;if(r)return Zo(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let a=this.dom.getClientRects(),c=null;if(!a.length)return null;let d=this.flags&16?!0:this.flags&32?!1:e>0;for(let f=d?a.length-1:0;c=a[f],!(e>0?f==0:f==a.length-1||c.top<c.bottom);f+=d?-1:1);return Zo(c,!d)}}get overrideDOMText(){if(!this.length)return pt.empty;let{root:e}=this;if(!e)return pt.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,s,a){return a||(a=e.toDOM(n),e.editable||(a.contentEditable="false")),new Rs(a,r,e,s)}}class sc extends Lt{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 pt.empty}coordsIn(e,n,r){let s=this.dom.getBoundingClientRect();return r==null?s:Zo(s,n>0==r)}}class KC{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:s,index:a,beforeBreak:c,parents:d}=this;for(;e||n>0;)if(s.isComposite())if(c){if(!e)break;r&&r.break(),e--,c=!1}else if(a==s.children.length){if(!e&&!d.length)break;r&&r.leave(s),c=!!s.breakAfter,{tile:s,index:a}=d.pop(),a++}else{let f=s.children[a],h=f.breakAfter;(n>0?f.length<=e:f.length<e)&&(!r||r.skip(f,0,f.length)!==!1||!f.isComposite)?(c=!!h,a++,e-=f.length):(d.push({tile:s,index:a}),s=f,a=0,r&&f.isComposite()&&r.enter(f))}else{let f=s.length;if(a<f&&e){let h=Math.min(e,f-a);r&&r.skip(s,a,a+h),e-=h,a+=h}if(a==f)c=!!s.breakAfter,{tile:s,index:a}=d.pop(),a++;else if(!e)break}return this.tile=s,this.index=a,this.beforeBreak=c,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class YC{constructor(e,n,r,s){this.from=e,this.to=n,this.wrapper=r,this.rank=s}}class GC{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,s){var a;this.flushBuffer();let c=this.ensureMarks(n,r),d=c.lastChild;if(d&&d.isText()&&!(d.flags&8)&&d.length+e.length<512){this.cache.reused.set(d,2);let f=c.children[c.children.length-1]=new Ms(d.dom,d.text+e);f.parent=c}else c.append(s||Ms.of(e,(a=this.cache.find(Ms))===null||a===void 0?void 0:a.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)?qf(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let s=r;for(let d=n.marks.length-1;d>=0;d--){let f=n.marks[d],h=s.lastChild;if(h instanceof Bn&&h.mark.eq(f.mark))h.dom!=f.dom&&h.setDOM(qf(f.dom)),s=h;else{if(this.cache.reused.get(f)){let b=Lt.get(f.dom);b&&b.setDOM(qf(f.dom))}let g=Bn.of(f.mark,f.dom);s.append(g),s=g}this.cache.reused.set(f,2)}let a=Lt.get(e.text);a&&this.cache.reused.set(a,2);let c=new Ms(e.text,e.text.nodeValue);c.flags|=8,this.pos=e.range.toB,s.append(c)}addInlineWidget(e,n,r){let s=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);s||this.flushBuffer();let a=this.ensureMarks(n,r);!s&&!(e.flags&16)&&a.append(this.getBuffer(1)),a.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=ab);let s=fl.start(e,n||((r=this.cache.find(fl))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=s)}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 s=this.curLine;for(let a=e.length-1;a>=0;a--){let c=e[a],d;if(n>0&&(d=s.lastChild)&&d instanceof Bn&&d.mark.eq(c))s=d,n--;else{let f=Bn.of(c,(r=this.cache.find(Bn,h=>h.mark.eq(c)))===null||r===void 0?void 0:r.dom);s.append(f),s=f,n=0}}return s}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!lb(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Oe.ios&&lb(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(zf,0,32)||new Rs(zf.toDOM(),0,zf,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=e.rank*102+e.value.rank,r=new YC(e.from,e.to,e.value,n),s=this.wrappers.length;for(;s>0&&(this.wrappers[s-1].rank-r.rank||this.wrappers[s-1].to-r.to)<0;)s--;this.wrappers.splice(s,0,r)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let s=n.lastChild;if(r.from<this.pos&&s instanceof lr&&s.wrapper.eq(r.wrapper))n=s;else{let a=lr.of(r.wrapper,(e=this.cache.find(lr,c=>c.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);n.append(a),n=a}}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(sc,void 0,1);return r&&(r.flags=n),r||new sc(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class XC{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:s,lineBreak:a,done:c}=this.cursor.next(this.skipCount);if(this.skipCount=0,c)throw new Error("Ran out of text content when drawing inline views");this.text=s;let d=this.textOff=Math.min(e,s.length);return a?null:s.slice(0,d)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const lc=[Rs,fl,Ms,Bn,sc,lr,rc];for(let t=0;t<lc.length;t++)lc[t].bucket=t;class JC{constructor(e){this.view=e,this.buckets=lc.map(()=>[]),this.index=lc.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 s=e.bucket,a=this.buckets[s],c=this.index[s];for(let d=0;d<a.length;d++){let f=(d+c)%a.length,h=a[f];if((!n||n(h))&&!this.reused.has(h))return a.splice(f,1),f<c&&this.index[s]--,this.reused.set(h,r),h}return null}findWidget(e,n,r){let s=this.buckets[0];if(s.length)for(let a=0,c=0;;a++){if(a==s.length){if(c)return null;c=1,a=0}let d=s[a];if(!this.reused.has(d)&&(c==0?d.widget.compare(e):d.widget.constructor==e.constructor&&e.updateDOM(d.dom,this.view,d.widget)))return s.splice(a,1),a<this.index[0]&&this.index[0]--,d.widget==e&&d.length==n&&(d.flags&497)==r?(this.reused.set(d,1),d):(this.reused.set(d,2),new Rs(d.dom,n,e,d.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 QC{constructor(e,n,r,s,a){this.view=e,this.decorations=s,this.disallowBlockEffectsFor=a,this.openWidget=!1,this.openMarks=0,this.cache=new JC(e),this.text=new XC(e.state.doc),this.builder=new GC(this.cache,new rc(e,e.contentDOM),ft.iter(r)),this.cache.reused.set(n,2),this.old=new KC(n),this.reuseWalker={skip:(c,d,f)=>{if(this.cache.add(c),c.isComposite())return!1},enter:c=>this.cache.add(c),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let s=0,a=0,c=0;;){let d=c<e.length?e[c++]:null,f=d?d.fromA:this.old.root.length;if(f>s){let h=f-s;this.preserve(h,!c,!d),s=f,a+=h}if(!d)break;n&&d.fromA<=n.range.fromA&&d.toA>=n.range.toA?(this.forward(d.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(a,n.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,d.toA),this.emit(n.range.toB,d.toB)):(this.forward(d.fromA,d.toA),this.emit(a,d.toB)),a=d.toB,s=d.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let s=eN(this.old),a=this.openMarks;this.old.advance(e,r?1:-1,{skip:(c,d,f)=>{if(c.isWidget())if(this.openWidget)this.builder.continueWidget(f-d);else{let h=f>0||d<c.length?Rs.of(c.widget,this.view,f-d,c.flags&496,this.cache.maybeReuse(c)):this.cache.reuse(c);h.flags&256?(h.flags&=-2,this.builder.addBlockWidget(h)):(this.builder.ensureLine(null),this.builder.addInlineWidget(h,s,a),a=s.length)}else if(c.isText())this.builder.ensureLine(null),!d&&f==c.length&&!this.cache.reused.has(c)?this.builder.addText(c.text,s,a,this.cache.reuse(c)):(this.cache.add(c),this.builder.addText(c.text.slice(d,f),s,a)),a=s.length;else if(c.isLine())c.flags&=-2,this.cache.reused.set(c,1),this.builder.addLine(c);else if(c instanceof sc)this.cache.add(c);else if(c instanceof Bn)this.builder.ensureLine(null),this.builder.addMark(c,s,a),this.cache.reused.set(c,1),a=s.length;else return!1;this.openWidget=!1},enter:c=>{c.isLine()?this.builder.addLineStart(c.attrs,this.cache.maybeReuse(c)):(this.cache.add(c),c instanceof Bn&&s.unshift(c.mark)),this.openWidget=!1},leave:c=>{c.isLine()?s.length&&(s.length=a=0):c instanceof Bn&&(s.shift(),a=Math.min(a,s.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,s=this.builder,a=-1,c=ft.spans(this.decorations,e,n,{point:(d,f,h,g,b,v)=>{if(h instanceof js){if(this.disallowBlockEffectsFor[v]){if(h.block)throw new RangeError("Block decorations may not be specified via plugins");if(f>this.view.state.doc.lineAt(d).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(a=g.length,b>g.length)s.continueWidget(f-d);else{let S=h.widget||(h.block?hl.block:hl.inline),A=WC(h),C=this.cache.findWidget(S,f-d,A)||Rs.of(S,this.view,f-d,A);h.block?(h.startSide>0&&s.addLineStartIfNotCovered(r),s.addBlockWidget(C)):(s.ensureLine(r),s.addInlineWidget(C,g,b))}r=null}else r=ZC(r,h);f>d&&this.text.skip(f-d)},span:(d,f,h,g)=>{for(let b=d;b<f;){let v=this.text.next(Math.min(512,f-b));v==null?(s.addLineStartIfNotCovered(r),s.addBreak(),b++):(s.ensureLine(r),s.addText(v,h,b==d?g:h.length),b+=v.length),r=null}a=h.length}});a>-1&&(this.openWidget=c>a),this.openWidget||s.addLineStartIfNotCovered(r),this.openMarks=c}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 s=e.parentNode;;s=s.parentNode){let a=Lt.get(s);if(s==this.view.contentDOM)break;a instanceof Bn?n.push(a):a?.isLine()?r=a:a instanceof lr||(s.nodeName=="DIV"&&!r&&s!=this.view.contentDOM?r=new fl(s,ab):r||n.push(Bn.of(new xa({tagName:s.nodeName.toLowerCase(),attributes:NC(s)}),s)))}return{line:r,marks:n}}}function lb(t,e){let n=r=>{for(let s of r.children)if((e?s.isText():s.length)||n(s))return!0;return!1};return n(t)}function WC(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 ab={class:"cm-line"};function ZC(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&Cf(n,t),r&&(t.class+=" "+r)),t}function eN(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 Bn&&e.push(r.mark)}return e}function qf(t){let e=Lt.get(t);return e&&e.setDOM(t.cloneNode()),t}class hl extends Jo{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}}hl.inline=new hl("span"),hl.block=new hl("div");const zf=new class extends Jo{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class ob{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=nn.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 rc(e,e.contentDOM),this.updateInner([new oi(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:b})=>b<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 s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?s=this.domChanged.newSel.head:!cN(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let a=s>-1?nN(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){let{from:g,to:b}=this.hasComposition;r=new oi(g,b,e.changes.mapPos(g,-1),e.changes.mapPos(b,1)).addToSet(r.slice())}this.hasComposition=a?{from:a.range.fromB,to:a.range.toB}:null,(Oe.ie||Oe.chrome)&&!a&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let c=this.decorations,d=this.blockWrappers;this.updateDeco();let f=sN(c,this.decorations,e.changes);f.length&&(r=oi.extendWithRanges(r,f));let h=aN(d,this.blockWrappers,e.changes);return h.length&&(r=oi.extendWithRanges(r,h)),a&&!r.some(g=>g.fromA<=a.range.fromA&&g.toA>=a.range.toA)&&(r=a.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,a),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 c=this.tile,d=new QC(this.view,c,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Lt.get(n.text)&&d.cache.reused.set(Lt.get(n.text),2),this.tile=d.run(e,n),Hf(c,d.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 a=Oe.chrome||Oe.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(a),a&&(a.written||r.selectionRange.focusNode!=a.node||!this.tile.dom.contains(a.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let a of this.tile.children)a.isWidget()&&a.widget instanceof If&&s.push(a.dom);r.updateGaps(s)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(Wy)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,s=this.view.root.activeElement,a=s==r,c=!a&&!(this.view.state.facet(rr)||r.tabIndex>-1)&&Aa(r,this.view.observer.selectionRange)&&!(s&&r.contains(s));if(!(a||n||c))return;let d=this.forceSelection;this.forceSelection=!1;let f=this.view.state.selection.main,h,g;if(f.empty?g=h=this.inlineDOMNearPos(f.anchor,f.assoc||1):(g=this.inlineDOMNearPos(f.head,f.head==f.from?1:-1),h=this.inlineDOMNearPos(f.anchor,f.anchor==f.from?1:-1)),Oe.gecko&&f.empty&&!this.hasComposition&&tN(h)){let v=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(v,h.node.childNodes[h.offset]||null)),h=g=new ji(v,0),d=!0}let b=this.view.observer.selectionRange;(d||!b.focusNode||(!ka(h.node,h.offset,b.anchorNode,b.anchorOffset)||!ka(g.node,g.offset,b.focusNode,b.focusOffset))&&!this.suppressWidgetCursorChange(b,f))&&(this.view.observer.ignore(()=>{Oe.android&&Oe.chrome&&r.contains(b.focusNode)&&oN(b.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let v=Sa(this.view.root);if(v)if(f.empty){if(Oe.gecko){let S=iN(h.node,h.offset);if(S&&S!=3){let A=(S==1?By:$y)(h.node,h.offset);A&&(h=new ji(A.node,A.offset))}}v.collapse(h.node,h.offset),f.bidiLevel!=null&&v.caretBidiLevel!==void 0&&(v.caretBidiLevel=f.bidiLevel)}else if(v.extend){v.collapse(h.node,h.offset);try{v.extend(g.node,g.offset)}catch{}}else{let S=document.createRange();f.anchor>f.head&&([h,g]=[g,h]),S.setEnd(g.node,g.offset),S.setStart(h.node,h.offset),v.removeAllRanges(),v.addRange(S)}c&&this.view.root.activeElement==r&&(r.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(h,g)),this.impreciseAnchor=h.precise?null:new ji(b.anchorNode,b.anchorOffset),this.impreciseHead=g.precise?null:new ji(b.focusNode,b.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&ka(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=Sa(e.root),{anchorNode:s,anchorOffset:a}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let c=this.lineAt(n.head,n.assoc);if(!c)return;let d=c.posAtStart;if(n.head==d||n.head==d+c.length)return;let f=this.coordsAt(n.head,-1),h=this.coordsAt(n.head,1);if(!f||!h||f.bottom>h.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 b=e.observer.selectionRange;e.docView.posFromDOM(b.anchorNode,b.anchorOffset)!=n.from&&r.collapse(s,a)}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 s=r.posAtStart;if(r.isComposite()){let a;if(e==r.dom)a=r.dom.childNodes[n];else{let c=ir(e)==0?0:n==0?-1:1;for(;;){let d=e.parentNode;if(d==r.dom)break;c==0&&d.firstChild!=d.lastChild&&(e==d.firstChild?c=-1:c=1),e=d}c<0?a=e:a=e.nextSibling}if(a==r.dom.firstChild)return s;for(;a&&!Lt.get(a);)a=a.nextSibling;if(!a)return s+r.length;for(let c=0,d=s;;c++){let f=r.children[c];if(f.dom==a)return d;d+=f.length+f.breakAfter}}else return r.isText()?e==r.dom?s+n:s+(n?r.length:0):s}domAtPos(e,n){let{tile:r,offset:s}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(s,n):r.domIn(s,n)}inlineDOMNearPos(e,n){let r,s=-1,a=!1,c,d=-1,f=!1;return this.tile.blockTiles((h,g)=>{if(h.isWidget()){if(h.flags&32&&g>=e)return!0;h.flags&16&&(a=!0)}else{let b=g+h.length;if(g<=e&&(r=h,s=e-g,a=b<e),b>=e&&!c&&(c=h,d=e-g,f=g>e),g>e&&c)return!0}}),!r&&!c?this.domAtPos(e,n):(a&&c?r=null:f&&r&&(c=null),r&&n<0||!c?r.domIn(s,n):c.domIn(d,n))}coordsAt(e,n,r){let{tile:s,offset:a}=this.tile.resolveBlock(e,n);return s.isWidget()?s.widget instanceof If?null:s.coordsInWidget(a,n,!0):s.coordsIn(a,n,r)}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 s(a,c){if(a.isComposite())for(let d of a.children){if(d.length>=c){let f=s(d,c);if(f)return f}if(c-=d.length,c<0)break}else if(a.isText()&&c<a.length){let d=Sn(a.text,c);if(d==c)return null;let f=Ca(a.dom,c,d).getClientRects();for(let h=0;h<f.length;h++){let g=f[h];if(h==f.length-1||g.top<g.bottom&&g.left<g.right)return g}}return null}return s(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:s}=e,a=this.view.contentDOM.clientWidth,c=a>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,d=-1,f=this.view.textDirection==Rt.LTR,h=0,g=(b,v,S)=>{for(let A=0;A<b.children.length&&!(v>s);A++){let C=b.children[A],T=v+C.length,D=C.dom.getBoundingClientRect(),{height:j}=D;if(S&&!A&&(h+=D.top-S.top),C instanceof lr)T>r&&g(C,v,D);else if(v>=r&&(h>0&&n.push(-h),n.push(j+h),h=0,c)){let E=C.dom.lastChild,O=E?Qo(E):[];if(O.length){let R=O[O.length-1],B=f?R.right-D.left:D.right-R.left;B>d&&(d=B,this.minWidth=a,this.minWidthFrom=v,this.minWidthTo=T)}}S&&A==b.children.length-1&&(h+=S.bottom-D.bottom),v=T+C.breakAfter}};return g(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?Rt.RTL:Rt.LTR}measureTextSize(){let e=this.tile.blockTiles(c=>{if(c.isLine()&&c.children.length&&c.length<=20){let d=0,f;for(let h of c.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let g=Qo(h.dom);if(g.length!=1)return;d+=g[0].width,f=g[0].height}if(d)return{lineHeight:c.dom.getBoundingClientRect().height,charWidth:d/c.length,textHeight:f}}});if(e)return e;let n=document.createElement("div"),r,s,a;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 c=Qo(n.firstChild)[0];r=n.getBoundingClientRect().height,s=c&&c.width?c.width/27:7,a=c&&c.height?c.height:r,n.remove()}),{lineHeight:r,charWidth:s,textHeight:a}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,s=0;;s++){let a=s==n.viewports.length?null:n.viewports[s],c=a?a.from-1:this.view.state.doc.length;if(c>r){let d=(n.lineBlockAt(c).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(nn.replace({widget:new If(d),block:!0,inclusive:!0,isBlockGap:!0}).range(r,c))}if(!a)break;r=a.to+1}return nn.set(e)}updateDeco(){let e=1,n=this.view.state.facet(tc).map(a=>(this.dynamicDecorationMap[e++]=typeof a=="function")?a(this.view):a),r=!1,s=this.view.state.facet($f).map((a,c)=>{let d=typeof a=="function";return d&&(r=!0),d?a(this.view):a});for(s.length&&(this.dynamicDecorationMap[e++]=r,n.push(ft.join(s))),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(eb).map(a=>typeof a=="function"?a(this.view):a)}scrollIntoView(e){if(e.isSnapshot){let h=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=h.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let h of this.view.state.facet(Qy))try{if(h(this.view,e.range,e))return!0}catch(g){Vi(this.view.state,g,"scroll handler")}let{range:n}=e,r=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),s;if(!r)return;!n.empty&&(s=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,s.left),top:Math.min(r.top,s.top),right:Math.max(r.right,s.right),bottom:Math.max(r.bottom,s.bottom)});let a=rb(this.view),c={left:r.left-a.left,top:r.top-a.top,right:r.right+a.right,bottom:r.bottom+a.bottom},{offsetWidth:d,offsetHeight:f}=this.view.scrollDOM;if(EC(this.view.scrollDOM,c,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,d),-d),Math.max(Math.min(e.yMargin,f),-f),this.view.textDirection==Rt.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.visualViewport.offsetTop)){let h=this.view.docView.lineAt(n.head,1);if(h){let g=My(h.dom);h.dom.scrollIntoView({block:"nearest"}),Ry(g,!1)}}}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){Hf(this.tile)}}function Hf(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)Hf(r,e)}}function tN(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 cb(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=By(n.focusNode,n.focusOffset),s=$y(n.focusNode,n.focusOffset),a=r||s;if(s&&r&&s.node!=r.node){let d=Lt.get(s.node);if(!d||d.isText()&&d.text!=s.node.nodeValue)a=s;else if(t.docView.lastCompositionAfterCursor){let f=Lt.get(r.node);!f||f.isText()&&f.text!=r.node.nodeValue||(a=s)}}if(t.docView.lastCompositionAfterCursor=a!=r,!a)return null;let c=e-a.offset;return{from:c,to:c+a.node.nodeValue.length,node:a.node}}function nN(t,e,n){let r=cb(t,n);if(!r)return null;let{node:s,from:a,to:c}=r,d=s.nodeValue;if(/[\n\r]/.test(d)||t.state.doc.sliceString(r.from,r.to)!=d)return null;let f=e.invertedDesc;return{range:new oi(f.mapPos(a),f.mapPos(c),a,c),text:s}}function iN(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 rN=class{constructor(){this.changes=[]}compareRange(e,n){ol(e,n,this.changes)}comparePoint(e,n){ol(e,n,this.changes)}boundChange(e){ol(e,e,this.changes)}};function sN(t,e,n){let r=new rN;return ft.compare(t,e,n,r),r.changes}class lN{constructor(){this.changes=[]}compareRange(e,n){ol(e,n,this.changes)}comparePoint(){}boundChange(e){ol(e,e,this.changes)}}function aN(t,e,n){let r=new lN;return ft.compare(t,e,n,r),r.changes}function oN(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 cN(t,e){let n=!1;return e&&t.iterChangedRanges((r,s)=>{r<e.to&&s>e.from&&(n=!0)}),n}class If extends Jo{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 uN(t,e,n=1){let r=t.charCategorizer(e),s=t.doc.lineAt(e),a=e-s.from;if(s.length==0)return Ce.cursor(e);a==0?n=1:a==s.length&&(n=-1);let c=a,d=a;n<0?c=Sn(s.text,a,!1):d=Sn(s.text,a);let f=r(s.text.slice(c,d));for(;c>0;){let h=Sn(s.text,c,!1);if(r(s.text.slice(h,c))!=f)break;c=h}for(;d<s.length;){let h=Sn(s.text,d);if(r(s.text.slice(d,h))!=f)break;d=h}return Ce.undirectionalRange(c+s.from,d+s.from)}function dN(t,e,n,r,s){let a=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let d=t.viewState.heightOracle.textHeight,f=Math.floor((s-n.top-(t.defaultLineHeight-d)*.5)/d);a+=f*t.viewState.heightOracle.lineLength}let c=t.state.sliceDoc(n.from,n.to);return n.from+vC(c,a,t.state.tabSize)}function Uf(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let s;for(let a of r.type){if(a.from>e)break;if(!(a.to<e)){if(a.from<e&&a.to>e)return a;(!s||a.type==dn.Text&&(s.type!=a.type||(n<0?a.from<e:a.to>e)))&&(s=a)}}return s||r}return r}function fN(t,e,n,r){let s=Uf(t,e.head,e.assoc||-1),a=!r||s.type!=dn.Text||!(t.lineWrapping||s.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(a){let c=t.dom.getBoundingClientRect(),d=t.textDirectionAt(s.from),f=t.posAtCoords({x:n==(d==Rt.LTR)?c.right-1:c.left+1,y:(a.top+a.bottom)/2});if(f!=null)return Ce.cursor(f,n?-1:1)}return Ce.cursor(n?s.to:s.from,n?-1:1)}function ub(t,e,n,r){let s=t.state.doc.lineAt(e.head),a=t.bidiSpans(s),c=t.textDirectionAt(s.from);for(let d=e,f=null;;){let h=HC(s,a,c,d,n),g=Uy;if(!h){if(s.number==(n?t.state.doc.lines:1))return d;g=`
|
|
56
|
+
`,s=t.state.doc.line(s.number+(n?1:-1)),a=t.bidiSpans(s),h=t.visualLineSide(s,!n)}if(f){if(!f(g))return d}else{if(!r)return h;f=r(g)}d=h}}function hN(t,e,n){let r=t.state.charCategorizer(e),s=r(n);return a=>{let c=r(a);return s==nr.Space&&(s=c),s==c}}function pN(t,e,n,r){let s=e.head,a=n?1:-1;if(s==(n?t.state.doc.length:0))return Ce.cursor(s,e.assoc);let c=e.goalColumn,d,f=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(s,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),g=t.documentTop;if(h)c==null&&(c=h.left-f.left),d=a<0?h.top:h.bottom;else{let A=t.viewState.lineBlockAt(s);c==null&&(c=Math.min(f.right-f.left,t.defaultCharacterWidth*(s-A.from))),d=(a<0?A.top:A.bottom)+g}let b=f.left+c,v=t.viewState.heightOracle.textHeight>>1,S=r??v;for(let A=0;;A+=v){let C=d+(S+A)*a,T=Vf(t,{x:b,y:C},!1,a);if(n?C>f.bottom:C<f.top)return Ce.cursor(T.pos,T.assoc);let D=t.coordsAtPos(T.pos,T.assoc),j=D?(D.top+D.bottom)/2:0;if(!D||(n?j>d:j<d))return Ce.cursor(T.pos,T.assoc,void 0,c)}}function ja(t,e,n){for(;;){let r=0;for(let s of t)s.between(e-1,e+1,(a,c,d)=>{if(e>a&&e<c){let f=r||n||(e-a<c-e?-1:1);e=f<0?a:c,r=f}});if(!r)return e}}function db(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let s=e.ranges[r],a=null;if(s.empty){let c=ja(t,s.from,0);c!=s.from&&(a=Ce.cursor(c,-1))}else{let c=ja(t,s.from,-1),d=ja(t,s.to,1);(c!=s.from||d!=s.to)&&(s.undirectional?a=Ce.undirectionalRange(s.from,s.to):a=Ce.range(s.from==s.anchor?c:d,s.from==s.head?c:d))}a&&(n||(n=e.ranges.slice()),n[r]=a)}return n?Ce.create(n,e.mainIndex):e}function Ff(t,e,n){let r=ja(t.state.facet(Na).map(s=>s(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Ce.cursor(r,r<n.from?1:-1)}class Pi{constructor(e,n){this.pos=e,this.assoc=n}}function Vf(t,e,n,r){let s=t.contentDOM.getBoundingClientRect(),a=s.top+t.viewState.paddingTop,{x:c,y:d}=e,f=d-a,h;for(;;){if(f<0)return new Pi(0,1);if(f>t.viewState.docHeight)return new Pi(t.state.doc.length,-1);if(h=t.elementAtHeight(f),r==null)break;if(h.type==dn.Text){if(r<0?h.to<t.viewport.from:h.from>t.viewport.to)break;let v=t.docView.coordsAt(r<0?h.from:h.to,r>0?-1:1);if(v&&(r<0?v.top<=f+a:v.bottom>=f+a))break}let b=t.viewState.heightOracle.textHeight/2;f=r>0?h.bottom+b:h.top-b}if(t.viewport.from>=h.to||t.viewport.to<=h.from){if(n)return null;if(h.type==dn.Text){let b=dN(t,s,h,c,d);return new Pi(b,b==h.from?1:-1)}}if(h.type!=dn.Text)return f<(h.top+h.bottom)/2?new Pi(h.from,1):new Pi(h.to,-1);let g=t.docView.lineAt(h.from,2);return(!g||g.length!=h.length)&&(g=t.docView.lineAt(h.from,-2)),new mN(t,c,d,t.textDirectionAt(h.from)).scanTile(g,h.from)}class mN{constructor(e,n,r,s){this.view=e,this.x=n,this.y=r,this.baseDir=s,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:s}=this.bidiSpansAt(e);return s[Fi.find(s,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:s}=this.bidiSpansAt(e);return s[Fi.find(s,e-r.from,-1,n)].dir}bidiIn(e,n){let{spans:r,line:s}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+s.from<n)}scan(e,n,r=!1){let s=0,a=e.length-1,c=new Set,d=this.bidiIn(e[0],e[a]),f,h,g=-1,b=1e9,v;e:for(;s<a;){let A=a-s,C=s+a>>1;t:if(c.has(C)){for(let j=1;j<A;j++){let E=C+j;if(E>=a&&(E-=A),!c.has(E)){C=E;break t}}break e}c.add(C);let T=n(C),D=0;if(T)for(let j=0;j<T.length;j++){let E=T[j];if(!(E.width==0&&T.length>1))if(E.bottom<this.y)(!f||f.bottom<E.bottom)&&(f=E),D=1;else if(E.top>this.y)(!h||h.top>E.top)&&(h=E),D=-1;else{let O=E.left>this.x?this.x-E.left:E.right<this.x?this.x-E.right:0,R=Math.abs(O);R<b&&(g=C,b=R,v=E),O&&(D=O<0==(this.baseDir==Rt.LTR)?-1:1)}}D==-1&&(!d||this.baseDirAt(e[C],1))?a=C:D==1&&(!d||this.baseDirAt(e[C+1],-1))&&(s=C+1)}if(!v){if(!h&&!f)return{i:0,after:!1};let A=f&&(!h||this.y-f.bottom<h.top-this.y)?f:h;return this.y=(A.top+A.bottom)/2,this.scan(e,n,!0)}if(b&&!r){let{top:A,bottom:C}=v;if(f&&f.bottom>(A+A+C)/3)return this.y=f.bottom-1,this.scan(e,n,!0);if(h&&h.top<(A+C+C)/3)return this.y=h.top+1,this.scan(e,n,!0)}let S=(d?this.dirAt(e[g],1):this.baseDir)==Rt.LTR;return{i:g,after:this.x>(v.left+v.right)/2==S}}scanText(e,n){let r=[];for(let a=0;a<e.length;a=Sn(e.text,a))r.push(n+a);r.push(n+e.length);let s=this.scan(r,a=>{let c=r[a]-n,d=r[a+1]-n;return Ca(e.dom,c,d).getClientRects()});return s.after?new Pi(r[s.i+1],-1):new Pi(r[s.i],1)}scanTile(e,n){if(!e.length)return new Pi(n,1);if(e.children.length==1){let d=e.children[0];if(d.isText())return this.scanText(d,n);if(d.isComposite())return this.scanTile(d,n)}let r=[n];for(let d=0,f=n;d<e.children.length;d++)r.push(f+=e.children[d].length);let s=this.scan(r,d=>{let f=e.children[d];return f.flags&48?null:(f.dom.nodeType==1?f.dom:Ca(f.dom,0,f.length)).getClientRects()}),a=e.children[s.i],c=r[s.i];return a.isText()?this.scanText(a,c):a.isComposite()?this.scanTile(a,c):s.after?new Pi(r[s.i+1],-1):new Pi(c,1)}}const pl="";class gN{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(vt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=pl}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let s=e;;){this.findPointBefore(r,s);let a=this.text.length;this.readNode(s);let c=Lt.get(s),d=s.nextSibling;if(d==n){c?.breakAfter&&!d&&r!=this.view.contentDOM&&this.lineBreak();break}let f=Lt.get(d);(c&&f?c.breakAfter:(c?c.breakAfter:Wo(s))||Wo(d)&&(s.nodeName!="BR"||c?.isWidget())&&this.text.length>a)&&!bN(d,n)&&this.lineBreak(),s=d}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,s=this.lineSeparator?null:/\r\n?|\n/g;;){let a=-1,c=1,d;if(this.lineSeparator?(a=n.indexOf(this.lineSeparator,r),c=this.lineSeparator.length):(d=s.exec(n))&&(a=d.index,c=d[0].length),this.append(n.slice(r,a<0?n.length:a)),a<0)break;if(this.lineBreak(),c>1)for(let f of this.points)f.node==e&&f.pos>this.text.length&&(f.pos-=c-1);r=a+c}}readNode(e){let n=Lt.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let s=r.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.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+(yN(e,r.node,r.offset)?n:0))}}function yN(t,e,n){for(;;){if(!e||n<ir(e))return!1;if(e==t)return!0;n=zr(e)+1,e=e.parentNode}}function bN(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=Lt.get(t);if(!r?.isWidget())return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let s=r.overrideDOMText;if(s?.length)return!1}return!0}class fb{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class xN{constructor(e,n,r,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:a,impreciseAnchor:c}=e.docView,d=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=hb(e.docView.tile,n,r,0))){let f=a||c?[]:wN(e),h=new gN(f,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=SN(f,this.bounds.from)}else{let f=e.observer.selectionRange,h=a&&a.node==f.focusNode&&a.offset==f.focusOffset||!Tf(e.contentDOM,f.focusNode)?d.main.head:e.docView.posFromDOM(f.focusNode,f.focusOffset),g=c&&c.node==f.anchorNode&&c.offset==f.anchorOffset||!Tf(e.contentDOM,f.anchorNode)?d.main.anchor:e.docView.posFromDOM(f.anchorNode,f.anchorOffset),b=e.viewport;if((Oe.ios||Oe.chrome)&&h!=g&&Math.min(h,g)<=d.main.from&&Math.max(h,g)>=d.main.to&&(b.from>0||b.to<e.state.doc.length)){let v=Math.min(h,g),S=Math.max(h,g),A=b.from-v,C=b.to-S;(A==0||A==1||v==0)&&(C==0||C==-1||S==e.state.doc.length)&&(h=0,g=e.state.doc.length)}if(e.inputState.composing>-1&&d.ranges.length>1)this.newSel=d.replaceRange(Ce.range(g,h));else if(e.lineWrapping&&g==h&&!(d.main.empty&&d.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let v=e.coordsAtPos(h,-1),S=0;v&&(S=e.inputState.lastTouchY<=v.bottom?-1:1),this.newSel=Ce.create([Ce.cursor(h,S)])}else this.newSel=Ce.single(g,h)}}}function hb(t,e,n,r){if(t.isComposite()){let s=-1,a=-1,c=-1,d=-1;for(let f=0,h=r,g=r;f<t.children.length;f++){let b=t.children[f],v=h+b.length;if(h<e&&v>n)return hb(b,e,n,h);if(v>=e&&s==-1&&(s=f,a=h),h>n&&b.dom.parentNode==t.dom){c=f,d=g;break}g=v,h=v+b.breakAfter}return{from:a,to:d<0?r+t.length:d,startDOM:(s?t.children[s-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:c<t.children.length&&c>=0?t.children[c].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function pb(t,e){let n,{newSel:r}=e,{state:s}=t,a=s.selection.main,c=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:d,to:f}=e.bounds,h=a.from,g=null;(c===8||Oe.android&&e.text.length<f-d)&&(h=a.to,g="end");let b=s.doc.sliceString(d,f,pl),v,S;!a.empty&&a.from>=d&&a.to<=f&&(e.typeOver||b!=e.text)&&b.slice(0,a.from-d)==e.text.slice(0,a.from-d)&&b.slice(a.to-d)==e.text.slice(v=e.text.length-(b.length-(a.to-d)))?n={from:a.from,to:a.to,insert:pt.of(e.text.slice(a.from-d,v).split(pl))}:(S=mb(b,e.text,h-d,g))&&(Oe.chrome&&c==13&&S.toB==S.from+2&&e.text.slice(S.from,S.toB)==pl+pl&&S.toB--,n={from:d+S.from,to:d+S.toA,insert:pt.of(e.text.slice(S.from,S.toB).split(pl))})}else r&&(!t.hasFocus&&s.facet(rr)||ac(r,a))&&(r=null);if(!n&&!r)return!1;if((Oe.mac||Oe.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=Ce.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:pt.of([n.insert.toString().replace("."," ")])}):s.doc.lineAt(a.from).to<a.to&&t.docView.lineHasWidget(a.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:s.toText(t.inputState.insertingText)}:Oe.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`
|
|
57
|
+
`&&t.lineWrapping&&(r&&(r=Ce.single(r.main.anchor-1,r.main.head-1)),n={from:a.from,to:a.to,insert:pt.of([" "])}),n)return Pf(t,n,r,c);if(r&&!ac(r,a)){let d=!1,f="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(d=!0),f=t.inputState.lastSelectionOrigin,f=="select.pointer"&&(r=db(s.facet(Na).map(h=>h(t)),r))),t.dispatch({selection:r,scrollIntoView:d,userEvent:f}),!0}else return!1}function Pf(t,e,n,r=-1){if(Oe.ios&&t.inputState.flushIOSKey(e))return!0;let s=t.state.selection.main;if(Oe.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&t.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&cl(t.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>s.head)&&cl(t.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&cl(t.contentDOM,"Delete",46)))return!0;let a=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let c,d=()=>c||(c=vN(t,e,n));return t.state.facet(Yy).some(f=>f(t,e.from,e.to,a,d))||t.dispatch(d()),!0}function vN(t,e,n){let r,s=t.state,a=s.selection.main,c=-1;if(e.from==e.to&&e.from<a.from||e.from>a.to){let f=e.from<a.from?-1:1,h=f<0?a.from:a.to,g=ja(s.facet(Na).map(b=>b(t)),h,f);e.from==g&&(c=g)}if(c>-1)r={changes:e,selection:Ce.cursor(e.from+e.insert.length,-1)};else if(e.from>=a.from&&e.to<=a.to&&e.to-e.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let f=a.from<e.from?s.sliceDoc(a.from,e.from):"",h=a.to>e.to?s.sliceDoc(e.to,a.to):"";r=s.replaceSelection(t.state.toText(f+e.insert.sliceString(0,void 0,t.state.lineBreak)+h))}else{let f=s.changes(e),h=n&&n.main.to<=f.newLength?n.main:void 0;if(s.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=a.to+10&&e.to>=a.to-10){let g=t.state.sliceDoc(e.from,e.to),b,v=n&&cb(t,n.main.head);if(v){let A=e.insert.length-(e.to-e.from);b={from:v.from,to:v.to-A}}else b=t.state.doc.lineAt(a.head);let S=a.to-e.to;r=s.changeByRange(A=>{if(A.from==a.from&&A.to==a.to)return{changes:f,range:h||A.map(f)};let C=A.to-S,T=C-g.length;if(t.state.sliceDoc(T,C)!=g||C>=b.from&&T<=b.to)return{range:A};let D=s.changes({from:T,to:C,insert:e.insert}),j=A.to-a.to;return{changes:D,range:h?Ce.range(Math.max(0,h.anchor+j),Math.max(0,h.head+j)):A.map(D)}})}else r={changes:f,selection:h&&s.selection.replaceRange(h)}}let d="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,d+=".compose",t.inputState.compositionFirstChange&&(d+=".start",t.inputState.compositionFirstChange=!1)),s.update(r,{userEvent:d,scrollIntoView:!0})}function mb(t,e,n,r){let s=Math.min(t.length,e.length),a=0;for(;a<s&&t.charCodeAt(a)==e.charCodeAt(a);)a++;if(a==s&&t.length==e.length)return null;let c=t.length,d=e.length;for(;c>0&&d>0&&t.charCodeAt(c-1)==e.charCodeAt(d-1);)c--,d--;if(r=="end"){let f=Math.max(0,a-Math.min(c,d));n-=c+f-a}if(c<a&&t.length<e.length){let f=n<=a&&n>=c?a-n:0;a-=f,d=a+(d-c),c=a}else if(d<a){let f=n<=a&&n>=d?a-n:0;a-=f,c=a+(c-d),d=a}return{from:a,toA:c,toB:d}}function wN(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:a}=t.observer.selectionRange;return n&&(e.push(new fb(n,r)),(s!=n||a!=r)&&e.push(new fb(s,a))),e}function SN(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?Ce.single(n+e,r+e):null}function ac(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class AN{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,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.lastIOSMomentumScroll=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,Oe.safari&&e.contentDOM.addEventListener("input",()=>null),Oe.gecko&&zN(e.contentDOM.ownerDocument)}handleEvent(e){!RN(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 s of r.observers)s(this.view,n);for(let s of r.handlers){if(n.defaultPrevented)break;if(s(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=CN(e),r=this.handlers,s=this.view.contentDOM;for(let a in n)if(a!="scroll"){let c=!n[a].handlers.length,d=r[a];d&&c!=!d.handlers.length&&(s.removeEventListener(a,this.handleEvent),d=null),d||s.addEventListener(a,this.handleEvent,{passive:c})}for(let a in r)a!="scroll"&&!n[a]&&s.removeEventListener(a,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&&bb.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Oe.android&&Oe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(Oe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(yb.some(n=>n.keyCode==e.keyCode)&&!e.ctrlKey||NN.indexOf(e.key)>-1&&e.ctrlKey)){let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return n.shiftKey&&Oe.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&kN(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),50),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let n=this.pendingIOSKey;return!n||this.view.observer.pendingRecords().length||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,cl(this.view.contentDOM,n.key,n.keyCode,n.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Oe.safari&&!Oe.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 kN(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function gb(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(s){Vi(n.state,s)}}}function CN(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let s=r.spec,a=s&&s.plugin.domEventHandlers,c=s&&s.plugin.domEventObservers;if(a)for(let d in a){let f=a[d];f&&n(d).handlers.push(gb(r.value,f))}if(c)for(let d in c){let f=c[d];f&&n(d).observers.push(gb(r.value,f))}}for(let r in Ei)n(r).handlers.push(Ei[r]);for(let r in En)n(r).observers.push(En[r]);return e}const yb=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],NN="dthko",bb=[16,17,18,20,91,92,224,225],oc=6;function cc(t){return Math.max(0,t)*.7+8}function TN(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class jN{constructor(e,n,r,s){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=Oy(e.contentDOM),this.atoms=e.state.facet(Na).map(c=>c(e));let a=e.contentDOM.ownerDocument;a.addEventListener("mousemove",this.move=this.move.bind(this)),a.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(vt.allowMultipleSelections)&&EN(e,n),this.dragging=MN(e,n)&&Cb(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&&TN(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,s=0,a=0,c=this.view.win.innerWidth,d=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:c}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:a,bottom:d}=this.scrollParents.y.getBoundingClientRect());let f=rb(this.view);e.clientX-f.left<=s+oc?n=-cc(s-e.clientX):e.clientX+f.right>=c-oc&&(n=cc(e.clientX-c)),e.clientY-f.top<=a+oc?r=-cc(a-e.clientY):e.clientY+f.bottom>=d-oc&&(r=cc(e.clientY-d)),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=db(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 EN(t,e){let n=t.state.facet(Fy);return n.length?n[0](e):Oe.mac?e.metaKey:e.ctrlKey}function ON(t,e){let n=t.state.facet(Vy);return n.length?n[0](e):Oe.mac?!e.altKey:!e.ctrlKey}function MN(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Sa(t.root);if(!r||r.rangeCount==0)return!0;let s=r.getRangeAt(0).getClientRects();for(let a=0;a<s.length;a++){let c=s[a];if(c.left<=e.clientX&&c.right>=e.clientX&&c.top<=e.clientY&&c.bottom>=e.clientY)return!0}return!1}function RN(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=Lt.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const Ei=Object.create(null),En=Object.create(null),xb=Oe.ie&&Oe.ie_version<15||Oe.ios&&Oe.webkit_version<604;function DN(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(),vb(t,n.value)},50)}function uc(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function vb(t,e){e=uc(t.state,Df,e);let{state:n}=t,r,s=1,a=n.toText(e),c=a.lines==n.selection.ranges.length;if(Kf!=null&&n.selection.ranges.every(f=>f.empty)&&Kf==a.toString()){let f=-1;r=n.changeByRange(h=>{let g=n.doc.lineAt(h.from);if(g.from==f)return{range:h};f=g.from;let b=n.toText((c?a.line(s++).text:e)+n.lineBreak);return{changes:{from:g.from,insert:b},range:Ce.cursor(h.from+b.length)}})}else c?r=n.changeByRange(f=>{let h=a.line(s++);return{changes:{from:f.from,to:f.to,insert:h.text},range:Ce.cursor(f.from+h.length)}}):r=n.replaceSelection(a);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}En.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,Oe.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())},En.wheel=En.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()},Ei.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),En.touchstart=(t,e)=>{let n=t.inputState,r=e.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")},En.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},En.touchend=(t,e)=>{t.inputState.touchActive=!1},Ei.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(Py))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=LN(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new jN(t,e,n,r)),r&&t.observer.ignore(()=>{Dy(t.contentDOM);let a=t.root.activeElement;a&&!a.contains(t.contentDOM)&&a.blur()});let s=t.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function wb(t,e,n,r){if(r==1)return Ce.cursor(e,n);if(r==2)return uN(t.state,e,n);{let s=t.docView.lineAt(e,n),a=t.state.doc.lineAt(s?s.posAtEnd:e),c=s?s.posAtStart:a.from,d=s?s.posAtEnd:a.to;return d<t.state.doc.length&&d==a.to&&d++,Ce.undirectionalRange(c,d)}}const _N=Oe.ie&&Oe.ie_version<=11;let Sb=null,Ab=0,kb=0;function Cb(t){if(!_N)return t.detail;let e=Sb,n=kb;return Sb=t,kb=Date.now(),Ab=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Ab+1)%3:1}function LN(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=Cb(e),s=t.state.selection;return{update(a){a.docChanged&&(n.pos=a.changes.mapPos(n.pos),s=s.map(a.changes))},get(a,c,d){let f=t.posAndSideAtCoords({x:a.clientX,y:a.clientY},!1),h,g=wb(t,f.pos,f.assoc,r);if(n.pos!=f.pos&&!c){let b=wb(t,n.pos,n.assoc,r),v=Math.min(b.from,g.from),S=Math.max(b.to,g.to);g=v<g.from?Ce.range(v,S,g.assoc):Ce.range(S,v,g.assoc)}return c?s.replaceRange(s.main.extend(g.from,g.to,g.assoc)):d&&r==1&&s.ranges.length>1&&(h=BN(s,f.pos))?h:d?s.addRange(g):Ce.create([g])}}}function BN(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:s}=t.ranges[n];if(r<=e&&s>=e)return Ce.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}Ei.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let s=t.docView.tile.nearest(e.target);if(s&&s.isWidget()){let a=s.posAtStart,c=a+s.length;(a>=n.to||c<=n.from)&&(n=Ce.undirectionalRange(a,c))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",uc(t.state,_f,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1},Ei.dragend=t=>(t.inputState.draggedContent=null,!1);function Nb(t,e,n,r){if(n=uc(t.state,Df,n),!n)return;let s=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:a}=t.inputState,c=r&&a&&ON(t,e)?{from:a.from,to:a.to}:null,d={from:s,insert:n},f=t.state.changes(c?[c,d]:d);t.focus(),t.dispatch({changes:f,selection:{anchor:f.mapPos(s,-1),head:f.mapPos(s,1)},userEvent:c?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Ei.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),s=0,a=()=>{++s==n.length&&Nb(t,e,r.filter(c=>c!=null).join(t.state.lineBreak),!1)};for(let c=0;c<n.length;c++){let d=new FileReader;d.onerror=a,d.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(d.result)||(r[c]=d.result),a()},d.readAsText(n[c])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Nb(t,e,r,!0),!0}return!1},Ei.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=xb?null:e.clipboardData;return n?(vb(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(DN(t),!1)};function $N(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 qN(t){let e=[],n=[],r=!1;for(let s of t.selection.ranges)s.empty||(e.push(t.sliceDoc(s.from,s.to)),n.push(s));if(!e.length){let s=-1;for(let{from:a}of t.selection.ranges){let c=t.doc.lineAt(a);c.number>s&&(e.push(c.text),n.push({from:c.from,to:Math.min(t.doc.length,c.to+1)})),s=c.number}r=!0}return{text:uc(t,_f,e.join(t.lineBreak)),ranges:n,linewise:r}}let Kf=null;Ei.copy=Ei.cut=(t,e)=>{if(!Aa(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:s}=qN(t.state);if(!n&&!s)return!1;Kf=s?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let a=xb?null:e.clipboardData;return a?(a.clearData(),a.setData("text/plain",n),!0):($N(t,n),!1)};const Tb=$r.define();function jb(t,e){let n=[];for(let r of t.facet(Gy)){let s=r(t,e);s&&n.push(s)}return n.length?t.update({effects:n,annotations:Tb.of(!0)}):null}function Eb(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=jb(t.state,e);n?t.dispatch(n):t.update([])}},10)}En.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),Eb(t)},En.blur=t=>{t.observer.clearSelectionRange(),Eb(t)},En.compositionstart=En.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},En.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,Oe.chrome&&Oe.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))},En.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},Ei.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 a=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),c=e.getTargetRanges();if(a&&c.length){let d=c[0],f=t.posAtDOM(d.startContainer,d.startOffset),h=t.posAtDOM(d.endContainer,d.endOffset);return Pf(t,{from:f,to:h,insert:t.state.toText(a)},null),!0}}let s;if(Oe.chrome&&Oe.android&&(s=yb.find(a=>a.inputType==e.inputType))&&(t.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let a=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var c;(((c=window.visualViewport)===null||c===void 0?void 0:c.height)||0)>a+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Oe.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Oe.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>En.compositionend(t,e),20),!1};const Ob=new Set;function zN(t){Ob.has(t)||(Ob.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const Mb=["pre-wrap","normal","pre-line","break-spaces"];let ml=!1;function Rb(){ml=!1}class HN{constructor(e){this.lineWrapping=e,this.doc=pt.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 Mb.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let s=e[r];s<0?r++:this.heightSamples[Math.floor(s*10)]||(n=!0,this.heightSamples[Math.floor(s*10)]=!0)}return n}refresh(e,n,r,s,a,c){let d=Mb.indexOf(e)>-1,f=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=d;if(this.lineWrapping=d,this.lineHeight=n,this.charWidth=r,this.textHeight=s,this.lineLength=a,f){this.heightSamples={};for(let h=0;h<c.length;h++){let g=c[h];g<0?h++:this.heightSamples[Math.floor(g*10)]=!0}}return f}}class IN{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Oi{constructor(e,n,r,s,a){this.from=e,this.length=n,this.top=r,this.height=s,this._content=a}get type(){return typeof this._content=="number"?dn.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 js?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 Oi(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var Et=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Et||(Et={}));const dc=.001;class On{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)>dc&&(ml=!0),this.height=e)}replace(e,n,r){return On.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,s){let a=this,c=r.doc;for(let d=s.length-1;d>=0;d--){let{fromA:f,toA:h,fromB:g,toB:b}=s[d],v=a.lineAt(f,Et.ByPosNoHeight,r.setDoc(n),0,0),S=v.to>=h?v:a.lineAt(h,Et.ByPosNoHeight,r,0,0);for(b+=S.to-h,h=S.to;d>0&&v.from<=s[d-1].toA;)f=s[d-1].fromA,g=s[d-1].fromB,d--,f<v.from&&(v=a.lineAt(f,Et.ByPosNoHeight,r,0,0));g+=v.from-f,f=v.from;let A=Yf.build(r.setDoc(c),e,g,b);a=fc(a,a.replace(f,h,A))}return a.updateHeight(r,0)}static empty(){return new Gn(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,s=0,a=0;for(;;)if(n==r)if(s>a*2){let d=e[n-1];d.break?e.splice(--n,1,d.left,null,d.right):e.splice(--n,1,d.left,d.right),r+=1+d.break,s-=d.size}else if(a>s*2){let d=e[r];d.break?e.splice(r,1,d.left,null,d.right):e.splice(r,1,d.left,d.right),r+=2+d.break,a-=d.size}else break;else if(s<a){let d=e[n++];d&&(s+=d.size)}else{let d=e[--r];d&&(a+=d.size)}let c=0;return e[n-1]==null?(c=1,n--):e[n]==null&&(c=1,r++),new FN(On.of(e.slice(0,n)),c,On.of(e.slice(r)))}}function fc(t,e){return t==e?t:(t.constructor!=e.constructor&&(ml=!0),e)}On.prototype.size=1;const UN=nn.replace({});class Db extends On{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new Oi(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,s){return this.spaceAbove&&e<r+this.spaceAbove?new Oi(s,0,r,this.spaceAbove,UN):this.mainBlock(r,s)}lineAt(e,n,r,s,a){let c=this.mainBlock(s,a);return this.spaceAbove?this.blockAt(0,r,s,a).join(c):c}forEachLine(e,n,r,s,a,c){e<=a+this.length&&n>=a&&c(this.lineAt(0,Et.ByPos,r,s,a))}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,s){return s&&s.from<=n&&s.more&&this.setMeasuredHeight(s),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Gn extends Db{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 Oi(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let s=r[0];return r.length==1&&(s instanceof Gn||s instanceof fn&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof fn?s=new Gn(s.length,this.height,this.spaceAbove):s.height=this.height,this.outdated||(s.outdated=!1),s):On.of(r)}updateHeight(e,n=0,r=!1,s){return s&&s.from<=n&&s.more?this.setMeasuredHeight(s):(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 fn extends On{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,s=e.doc.lineAt(n+this.length).number,a=s-r+1,c,d=0;if(e.lineWrapping){let f=Math.min(this.height,e.lineHeight*a);c=f/a,this.length>a+1&&(d=(this.height-f)/(this.length-a-1))}else c=this.height/a;return{firstLine:r,lastLine:s,perLine:c,perChar:d}}blockAt(e,n,r,s){let{firstLine:a,lastLine:c,perLine:d,perChar:f}=this.heightMetrics(n,s);if(n.lineWrapping){let h=s+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),g=n.doc.lineAt(h),b=d+g.length*f,v=Math.max(r,e-b/2);return new Oi(g.from,g.length,v,b,0)}else{let h=Math.max(0,Math.min(c-a,Math.floor((e-r)/d))),{from:g,length:b}=n.doc.line(a+h);return new Oi(g,b,r+d*h,d,0)}}lineAt(e,n,r,s,a){if(n==Et.ByHeight)return this.blockAt(e,r,s,a);if(n==Et.ByPosNoHeight){let{from:S,to:A}=r.doc.lineAt(e);return new Oi(S,A-S,0,0,0)}let{firstLine:c,perLine:d,perChar:f}=this.heightMetrics(r,a),h=r.doc.lineAt(e),g=d+h.length*f,b=h.number-c,v=s+d*b+f*(h.from-a-b);return new Oi(h.from,h.length,Math.max(s,Math.min(v,s+this.height-g)),g,0)}forEachLine(e,n,r,s,a,c){e=Math.max(e,a),n=Math.min(n,a+this.length);let{firstLine:d,perLine:f,perChar:h}=this.heightMetrics(r,a);for(let g=e,b=s;g<=n;){let v=r.doc.lineAt(g);if(g==e){let A=v.number-d;b+=f*A+h*(e-a-A)}let S=f+h*v.length;c(new Oi(v.from,v.length,b,S,0)),b+=S,g=v.to+1}}replace(e,n,r){let s=this.length-n;if(s>0){let a=r[r.length-1];a instanceof fn?r[r.length-1]=new fn(a.length+s):r.push(null,new fn(s-1))}if(e>0){let a=r[0];a instanceof fn?r[0]=new fn(e+a.length):r.unshift(new fn(e-1),null)}return On.of(r)}decomposeLeft(e,n){n.push(new fn(e-1),null)}decomposeRight(e,n){n.push(null,new fn(this.length-e-1))}updateHeight(e,n=0,r=!1,s){let a=n+this.length;if(s&&s.from<=n+this.length&&s.more){let c=[],d=Math.max(n,s.from),f=-1;for(s.from>n&&c.push(new fn(s.from-n-1).updateHeight(e,n));d<=a&&s.more;){let g=e.doc.lineAt(d).length;c.length&&c.push(null);let b=s.heights[s.index++],v=0;b<0&&(v=-b,b=s.heights[s.index++]),f==-1?f=b:Math.abs(b-f)>=dc&&(f=-2);let S=new Gn(g,b,v);S.outdated=!1,c.push(S),d+=g+1}d<=a&&c.push(null,new fn(a-d).updateHeight(e,d));let h=On.of(c);return(f<0||Math.abs(h.height-this.height)>=dc||Math.abs(f-this.heightMetrics(e,n).perLine)>=dc)&&(ml=!0),fc(this,h)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class FN extends On{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,s){let a=r+this.left.height;return e<a?this.left.blockAt(e,n,r,s):this.right.blockAt(e,n,a,s+this.left.length+this.break)}lineAt(e,n,r,s,a){let c=s+this.left.height,d=a+this.left.length+this.break,f=n==Et.ByHeight?e<c:e<d,h=f?this.left.lineAt(e,n,r,s,a):this.right.lineAt(e,n,r,c,d);if(this.break||(f?h.to<d:h.from>d))return h;let g=n==Et.ByPosNoHeight?Et.ByPosNoHeight:Et.ByPos;return f?h.join(this.right.lineAt(d,g,r,c,d)):this.left.lineAt(d,g,r,s,a).join(h)}forEachLine(e,n,r,s,a,c){let d=s+this.left.height,f=a+this.left.length+this.break;if(this.break)e<f&&this.left.forEachLine(e,n,r,s,a,c),n>=f&&this.right.forEachLine(e,n,r,d,f,c);else{let h=this.lineAt(f,Et.ByPos,r,s,a);e<h.from&&this.left.forEachLine(e,h.from-1,r,s,a,c),h.to>=e&&h.from<=n&&c(h),n>h.to&&this.right.forEachLine(h.to+1,n,r,d,f,c)}}replace(e,n,r){let s=this.left.length+this.break;if(n<s)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-s,n-s,r));let a=[];e>0&&this.decomposeLeft(e,a);let c=a.length;for(let d of r)a.push(d);if(e>0&&_b(a,c-1),n<this.length){let d=a.length;this.decomposeRight(n,a),_b(a,d)}return On.of(a)}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,s=r+this.break;if(e>=s)return this.right.decomposeRight(e-s,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<s&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?On.of(this.break?[e,null,n]:[e,n]):(this.left=fc(this.left,e),this.right=fc(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,s){let{left:a,right:c}=this,d=n+a.length+this.break,f=null;return s&&s.from<=n+a.length&&s.more?f=a=a.updateHeight(e,n,r,s):a.updateHeight(e,n,r),s&&s.from<=d+c.length&&s.more?f=c=c.updateHeight(e,d,r,s):c.updateHeight(e,d,r),f?this.balanced(a,c):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function _b(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof fn&&(r=t[e+1])instanceof fn&&t.splice(e-1,3,new fn(n.length+1+r.length))}const VN=5;class Yf{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),s=this.nodes[this.nodes.length-1];s instanceof Gn?s.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Gn(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 s=r.widget?r.widget.estimatedHeight:0,a=r.widget?r.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let c=n-e;r.block?this.addBlock(new Db(c,s,r)):(c||a||s>=VN)&&this.addLineDeco(s,a,c)}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 Gn(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new fn(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 Gn)return e;let n=new Gn(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 s=this.ensureLine();s.length+=r,s.collapsed+=r,s.widgetHeight=Math.max(s.widgetHeight,e),s.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 Gn)&&!this.isCovered?this.nodes.push(new Gn(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let s of this.nodes)s instanceof Gn&&s.updateHeight(this.oracle,r),r+=s?s.length:1;return this.nodes}static build(e,n,r,s){let a=new Yf(r,e);return ft.spans(n,r,s,a,0),a.finish(r)}}function PN(t,e,n){let r=new KN;return ft.compare(t,e,n,r,0),r.changes}class KN{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,s){(e<n||r&&r.heightRelevant||s&&s.heightRelevant)&&ol(e,n,this.changes,5)}}function YN(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,s=r.defaultView||window,a=Math.max(0,n.left),c=Math.min(s.innerWidth,n.right),d=Math.max(0,n.top),f=Math.min(s.innerHeight,n.bottom);for(let h=t.parentNode;h&&h!=r.body;)if(h.nodeType==1){let g=h,b=window.getComputedStyle(g);if((g.scrollHeight>g.clientHeight||g.scrollWidth>g.clientWidth)&&b.overflow!="visible"){let v=g.getBoundingClientRect();a=Math.max(a,v.left),c=Math.min(c,v.right),d=Math.max(d,v.top),f=Math.min(h==t.parentNode?s.innerHeight:f,v.bottom)}h=b.position=="absolute"||b.position=="fixed"?g.offsetParent:g.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:a-n.left,right:Math.max(a,c)-n.left,top:d-(n.top+e),bottom:Math.max(d,f)-(n.top+e)}}function GN(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 XN(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Gf{constructor(e,n,r,s){this.from=e,this.to=n,this.size=r,this.displaySize=s}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let s=e[r],a=n[r];if(s.from!=a.from||s.to!=a.to||s.size!=a.size)return!1}return!0}draw(e,n){return nn.replace({widget:new JN(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class JN extends Jo{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 Lb{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=Bb,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Rt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(Bf).some(s=>typeof s!="function"&&s.class=="cm-lineWrapping");this.heightOracle=new HN(r),this.stateDeco=$b(n),this.heightMap=On.empty().applyChanges(this.stateDeco,pt.empty,this.heightOracle.setDoc(n.doc),[new oi(0,0,0,n.doc.length)]);for(let s=0;s<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());s++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=nn.set(this.lineGaps.map(s=>s.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 s=r?n.head:n.anchor;if(!e.some(({from:a,to:c})=>s>=a&&s<=c)){let{from:a,to:c}=this.lineBlockAt(s);e.push(new hc(a,c))}}return this.viewports=e.sort((r,s)=>r.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Bb:new Xf(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(Ea(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=$b(this.state);let s=e.changedRanges,a=oi.extendWithRanges(s,PN(r,this.stateDeco,e?e.changes:Zt.empty(this.state.doc.length))),c=this.heightMap.height,d=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Rb(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=c||ml)&&(e.flags|=2),d?(this.scrollAnchorPos=e.changes.mapPos(d.from,-1),this.scrollAnchorHeight=d.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=c);let f=a.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 h=f.from!=this.viewport.from||f.to!=this.viewport.to;this.viewport=f,e.flags|=this.updateForViewport(),(h||!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(Jy)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,r=window.getComputedStyle(n),s=this.heightOracle,a=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Rt.RTL:Rt.LTR;let c=this.heightOracle.mustRefreshForWrapping(a)||this.mustMeasureContent==="refresh",d=n.getBoundingClientRect(),f=c||this.mustMeasureContent||this.contentDOMHeight!=d.height;this.contentDOMHeight=d.height,this.mustMeasureContent=!1;let h=0,g=0;if(d.width&&d.height){let{scaleX:R,scaleY:B}=Ey(n,d);(R>.005&&Math.abs(this.scaleX-R)>.005||B>.005&&Math.abs(this.scaleY-B)>.005)&&(this.scaleX=R,this.scaleY=B,h|=16,c=f=!0)}let b=(parseInt(r.paddingTop)||0)*this.scaleY,v=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=b||this.paddingBottom!=v)&&(this.paddingTop=b,this.paddingBottom=v,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(f=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let S=Oy(this.view.contentDOM,!1).y;S!=this.scrollParent&&(this.scrollParent=S,this.scrollAnchorHeight=-1,this.scrollOffset=0);let A=this.getScrollOffset();this.scrollOffset!=A&&(this.scrollAnchorHeight=-1,this.scrollOffset=A),this.scrolledToBottom=Ly(this.scrollParent||e.win);let C=(this.printing?XN:YN)(n,this.paddingTop),T=C.top-this.pixelViewport.top,D=C.bottom-this.pixelViewport.bottom;this.pixelViewport=C;let j=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(j!=this.inView&&(this.inView=j,j&&(f=!0)),!this.inView&&!this.scrollTarget&&!GN(e.dom))return 0;let E=d.width;if((this.contentDOMWidth!=E||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=d.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),f){let R=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(R)&&(c=!0),c||s.lineWrapping&&Math.abs(E-this.contentDOMWidth)>s.charWidth){let{lineHeight:B,charWidth:M,textHeight:z}=e.docView.measureTextSize();c=B>0&&s.refresh(a,B,M,z,Math.max(5,E/M),R),c&&(e.docView.minWidth=0,h|=16)}T>0&&D>0?g=Math.max(T,D):T<0&&D<0&&(g=Math.min(T,D)),Rb();for(let B of this.viewports){let M=B.from==this.viewport.from?R:e.docView.measureVisibleLineHeights(B);this.heightMap=(c?On.empty().applyChanges(this.stateDeco,pt.empty,this.heightOracle,[new oi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,c,new IN(B.from,M))}ml&&(h|=2)}let O=!this.viewportIsAppropriate(this.viewport,g)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return O&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(g,this.scrollTarget),h|=this.updateForViewport()),(h&2||O)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(c?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}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)),s=this.heightMap,a=this.heightOracle,{visibleTop:c,visibleBottom:d}=this,f=new hc(s.lineAt(c-r*1e3,Et.ByHeight,a,0,0).from,s.lineAt(d+(1-r)*1e3,Et.ByHeight,a,0,0).to);if(n){let{head:h}=n.range;if(h<f.from||h>f.to){let g=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),b=s.lineAt(h,Et.ByPos,a,0,0),v;n.y=="center"?v=(b.top+b.bottom)/2-g/2:n.y=="start"||n.y=="nearest"&&h<f.from?v=b.top:v=b.bottom-g,f=new hc(s.lineAt(v-500,Et.ByHeight,a,0,0).from,s.lineAt(v+g+500,Et.ByHeight,a,0,0).to)}}return f}mapViewport(e,n){let r=n.mapPos(e.from,-1),s=n.mapPos(e.to,1);return new hc(this.heightMap.lineAt(r,Et.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,Et.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(e,Et.ByPos,this.heightOracle,0,0),{bottom:a}=this.heightMap.lineAt(n,Et.ByPos,this.heightOracle,0,0),{visibleTop:c,visibleBottom:d}=this;return(e==0||s<=c-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||a>=d+Math.max(10,Math.min(r,250)))&&s>c-2e3&&a<d+2e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let s of e)n.touchesRange(s.from,s.to)||r.push(new Gf(n.mapPos(s.from),n.mapPos(s.to),s.size,s.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,s=r?1e4:2e3,a=s>>1,c=s<<1;if(this.defaultTextDirection!=Rt.LTR&&!r)return[];let d=[],f=(g,b,v,S)=>{if(b-g<a)return;let A=this.state.selection.main,C=[A.from];A.empty||C.push(A.to);for(let D of C)if(D>g&&D<b){f(g,D-10,v,S),f(D+10,b,v,S);return}let T=WN(e,D=>D.from>=v.from&&D.to<=v.to&&Math.abs(D.from-g)<a&&Math.abs(D.to-b)<a&&!C.some(j=>D.from<j&&D.to>j));if(!T){if(b<v.to&&n&&r&&n.visibleRanges.some(E=>E.from<=b&&E.to>=b)){let E=n.moveToLineBoundary(Ce.cursor(b),!1,!0).head;E>g&&(b=E)}let D=this.gapSize(v,g,b,S),j=r||D<2e6?D:2e6;T=new Gf(g,b,D,j)}d.push(T)},h=g=>{if(g.length<c||g.type!=dn.Text)return;let b=QN(g.from,g.to,this.stateDeco);if(b.total<c)return;let v=this.scrollTarget?this.scrollTarget.range.head:null,S,A;if(r){let C=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,T,D;if(v!=null){let j=mc(b,v),E=((this.visibleBottom-this.visibleTop)/2+C)/g.height;T=j-E,D=j+E}else T=(this.visibleTop-g.top-C)/g.height,D=(this.visibleBottom-g.top+C)/g.height;S=pc(b,T),A=pc(b,D)}else{let C=b.total*this.heightOracle.charWidth,T=s*this.heightOracle.charWidth,D=0;if(C>2e6)for(let B of e)B.from>=g.from&&B.from<g.to&&B.size!=B.displaySize&&B.from*this.heightOracle.charWidth+D<this.pixelViewport.left&&(D=B.size-B.displaySize);let j=this.pixelViewport.left+D,E=this.pixelViewport.right+D,O,R;if(v!=null){let B=mc(b,v),M=((E-j)/2+T)/C;O=B-M,R=B+M}else O=(j-T)/C,R=(E+T)/C;S=pc(b,O),A=pc(b,R)}S>g.from&&f(g.from,S,g,b),A<g.to&&f(A,g.to,g,b)};for(let g of this.viewportLines)Array.isArray(g.type)?g.type.forEach(h):h(g);return d}gapSize(e,n,r,s){let a=mc(s,r)-mc(s,n);return this.heightOracle.lineWrapping?e.height*a:s.total*this.heightOracle.charWidth*a}updateLineGaps(e){Gf.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=nn.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=[];ft.spans(n,this.viewport.from,this.viewport.to,{span(a,c){r.push({from:a,to:c})},point(){}},20);let s=0;if(r.length!=this.visibleRanges.length)s=12;else for(let a=0;a<r.length&&!(s&8);a++){let c=this.visibleRanges[a],d=r[a];(c.from!=d.from||c.to!=d.to)&&(s|=4,e&&e.mapPos(c.from,-1)==d.from&&e.mapPos(c.to,1)==d.to||(s|=8))}return this.visibleRanges=r,s}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Ea(this.heightMap.lineAt(e,Et.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)||Ea(this.heightMap.lineAt(this.scaler.fromDOM(e),Et.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop*this.scaleY:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top}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 Ea(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 hc{constructor(e,n){this.from=e,this.to=n}}function QN(t,e,n){let r=[],s=t,a=0;return ft.spans(n,t,e,{span(){},point(c,d){c>s&&(r.push({from:s,to:c}),a+=c-s),s=d}},20),s<e&&(r.push({from:s,to:e}),a+=e-s),{total:a,ranges:r}}function pc({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 s=0;;s++){let{from:a,to:c}=e[s],d=c-a;if(r<=d)return a+r;r-=d}}function mc(t,e){let n=0;for(let{from:r,to:s}of t.ranges){if(e<=s){n+=e-r;break}n+=s-r}return n/t.total}function WN(t,e){for(let n of t)if(e(n))return n}const Bb={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function $b(t){let e=t.facet(tc).filter(r=>typeof r!="function"),n=t.facet($f).filter(r=>typeof r!="function");return n.length&&e.push(ft.join(n)),e}class Xf{constructor(e,n,r){let s=0,a=0,c=0;this.viewports=r.map(({from:d,to:f})=>{let h=n.lineAt(d,Et.ByPos,e,0,0).top,g=n.lineAt(f,Et.ByPos,e,0,0).bottom;return s+=g-h,{from:d,to:f,top:h,bottom:g,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(n.height-s);for(let d of this.viewports)d.domTop=c+(d.top-a)*this.scale,c=d.domBottom=d.domTop+(d.bottom-d.top),a=d.bottom}toDOM(e){for(let n=0,r=0,s=0;;n++){let a=n<this.viewports.length?this.viewports[n]:null;if(!a||e<a.top)return s+(e-r)*this.scale;if(e<=a.bottom)return a.domTop+(e-a.top);r=a.bottom,s=a.domBottom}}fromDOM(e){for(let n=0,r=0,s=0;;n++){let a=n<this.viewports.length?this.viewports[n]:null;if(!a||e<a.domTop)return r+(e-s)/this.scale;if(e<=a.domBottom)return a.top+(e-a.domTop);r=a.bottom,s=a.domBottom}}eq(e){return e instanceof Xf?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 Ea(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Oi(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(s=>Ea(s,e)):t._content)}const gc=He.define({combine:t=>t.join(" ")}),Jf=He.define({combine:t=>t.indexOf(!0)>-1}),Qf=al.newName(),qb=al.newName(),zb=al.newName(),Hb={"&light":"."+qb,"&dark":"."+zb};function Wf(t,e,n){return new al(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,s=>{if(s=="&")return t;if(!n||!n[s])throw new RangeError(`Unsupported selector: ${s}`);return n[s]}):t+" "+r}})}const ZN=Wf("."+Qf,{"&":{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":{userSelect:"none",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"},".cm-panels-top":{top:"0"},".cm-panels-bottom":{bottom:"0"},"&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":{background:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 0) no-repeat",backgroundSize:".4em",backgroundPosition:"calc(min(50%, 0px)) 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"}},Hb),eT={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Zf=Oe.ie&&Oe.ie_version<=11;class tT{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new OC,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);(Oe.ie&&Oe.ie_version<=11||Oe.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&&Oe.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Oe.chrome&&Oe.chrome_version<126)&&(this.editContext=new iT(e),e.state.facet(rr)&&(e.contentDOM.editContext=this.editContext.editContext)),Zf&&(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,s=this.selectionRange;if(r.state.facet(rr)?r.root.activeElement!=this.dom:!Aa(this.dom,s))return;let a=s.anchorNode&&r.docView.tile.nearest(s.anchorNode);if(a&&a.isWidget()&&a.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Oe.ie&&Oe.ie_version<=11||Oe.android&&Oe.chrome)&&!r.state.selection.main.empty&&s.focusNode&&ka(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Sa(e.root);if(!n)return!1;let r=Oe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&nT(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let s=Aa(this.dom,r);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&RC(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),s&&(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,eT),Zf&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Zf&&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 s=()=>{let a=this.delayedAndroidKey;a&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=a.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&a.force&&cl(this.dom,a.key,a.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!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,s=!1;for(let a of e){let c=this.readMutation(a);c&&(c.typeOver&&(s=!0),n==-1?{from:n,to:r}=c:(n=Math.min(c.from,n),r=Math.max(c.to,r)))}return{from:n,to:r,typeOver:s}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),s=this.selectionChanged&&Aa(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let a=new xN(this.view,e,n,r);return this.view.docView.domChanged={newSel:a.newSel?a.newSel.main:null},a}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,s=pb(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!ac(this.view.state.selection,n.newSel.main))&&this.view.update([]),s}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=Ib(n,e.previousSibling||e.target.previousSibling,-1),s=Ib(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:s?n.posBefore(s):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(rr)!=e.state.facet(rr)&&(e.view.contentDOM.editContext=e.state.facet(rr)?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 s of this.scrollTargets)s.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 Ib(t,e,n){for(;e;){let r=Lt.get(e);if(r&&r.parent==t)return r;let s=e.parentNode;e=s!=t.dom?s:n>0?e.nextSibling:e.previousSibling}return null}function Ub(t,e){let n=e.startContainer,r=e.startOffset,s=e.endContainer,a=e.endOffset,c=t.docView.domAtPos(t.state.selection.main.anchor,1);return ka(c.node,c.offset,s,a)&&([n,r,s,a]=[s,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:a}}function nT(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return Ub(t,s)}let n=null;function r(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?Ub(t,n):null}class iT{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 s=e.state.selection.main,{anchor:a,head:c}=s,d=this.toEditorPos(r.updateRangeStart),f=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:d,drifted:!1});let h=f-d>r.text.length;d==this.from&&a<this.from?d=a:f==this.to&&a>this.to&&(f=a);let g=mb(e.state.sliceDoc(d,f),r.text,(h?s.from:s.to)-d,h?"end":null);if(!g){let v=Ce.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));ac(v,s)||e.dispatch({selection:v,userEvent:"select"});return}let b={from:g.from+d,to:g.toA+d,insert:pt.of(r.text.slice(g.from,g.toB).split(`
|
|
58
|
+
`))};if((Oe.mac||Oe.android)&&b.from==c-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(b={from:d,to:f,insert:pt.of([r.text.replace("."," ")])}),this.pendingContextChange=b,!e.state.readOnly){let v=this.to-this.from+(b.to-b.from+b.insert.length);Pf(e,b,Ce.single(this.toEditorPos(r.selectionStart,v),this.toEditorPos(r.selectionEnd,v)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),b.from<b.to&&!b.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 s=[],a=null;for(let c=this.toEditorPos(r.rangeStart),d=this.toEditorPos(r.rangeEnd);c<d;c++){let f=e.coordsForChar(c);a=f&&new DOMRect(f.left,f.top,f.right-f.left,f.bottom-f.top)||a||new DOMRect,s.push(a)}n.updateCharacterBounds(r.rangeStart,s)},this.handlers.textformatupdate=r=>{let s=[];for(let a of r.getTextFormats()){let c=a.underlineStyle,d=a.underlineThickness;if(!/none/i.test(c)&&!/none/i.test(d)){let f=this.toEditorPos(a.rangeStart),h=this.toEditorPos(a.rangeEnd);if(f<h){let g=`text-decoration: underline ${/^[a-z]/.test(c)?c+" ":c=="Dashed"?"dashed ":c=="Squiggle"?"wavy ":""}${/thin/i.test(d)?1:2}px`;s.push(nn.mark({attributes:{style:g}}).range(f,h))}}}e.dispatch({effects:Wy.of(nn.set(s))})},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=>{let s=Sa(r.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,s=this.pendingContextChange;return e.changes.iterChanges((a,c,d,f,h)=>{if(r)return;let g=h.length-(c-a);if(s&&c>=s.to)if(s.from==a&&s.to==c&&s.insert.eq(h)){s=this.pendingContextChange=null,n+=g,this.to+=g;return}else s=null,this.revertPending(e.state);if(a+=n,c+=n,c<=this.from)this.from+=g,this.to+=g;else if(a<this.to){if(a<this.from||c>this.to||this.to-this.from+h.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(a),this.toContextPos(c),h.toString()),this.to+=g}n+=g}),s&&!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(s=>!s.isUserEvent("input.type")&&s.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))),s=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(r,s)}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>3e4)}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 Ye{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&&(s=>s.forEach(a=>r(a,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||MC(e.parent)||document,this.viewState=new Lb(this,e.state||vt.create(e)),e.scrollTo&&e.scrollTo.is(ec)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(dl).map(s=>new Lf(s));for(let s of this.plugins)s.update(this);this.observer=new tT(this),this.inputState=new AN(this),this.inputState.ensureHandlers(this.plugins),this.docView=new ob(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 en?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,s,a=this.state;for(let v of e){if(v.startState!=a)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");a=v.state}if(this.destroyed){this.viewState.state=a;return}let c=this.hasFocus,d=0,f=null;e.some(v=>v.annotation(Tb))?(this.inputState.notifiedFocused=c,d=1):c!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=c,f=jb(a,c),f||(d=1));let h=this.observer.delayedAndroidKey,g=null;if(h?(this.observer.clearDelayedAndroidKey(),g=this.observer.readChange(),(g&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(g=null)):this.observer.clear(),a.facet(vt.phrases)!=this.state.facet(vt.phrases))return this.setState(a);s=nc.create(this,a,e),s.flags|=d;let b=this.viewState.scrollTarget;try{this.updateState=2;for(let v of e){if(b&&(b=b.map(v.changes)),v.scrollIntoView){let{main:S}=v.state.selection,{x:A,y:C}=this.state.facet(Ye.cursorScrollMargin);b=new ul(S.empty?S:Ce.cursor(S.head,S.head>S.anchor?-1:1),"nearest","nearest",C,A)}for(let S of v.effects)S.is(ec)&&(b=S.value.clip(this.state))}this.viewState.update(s,b),this.bidiCache=yc.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),n=this.docView.update(s),this.state.facet(Ta)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(v=>v.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(gc)!=s.state.facet(gc)&&(this.viewState.mustMeasureContent=!0),(n||r||b||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!s.empty)for(let v of this.state.facet(Rf))try{v(s)}catch(S){Vi(this.state,S,"update listener")}(f||g)&&Promise.resolve().then(()=>{f&&this.state==f.startState&&this.dispatch(f),g&&!pb(this,g)&&h.force&&cl(this.contentDOM,h.key,h.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 Lb(this,e),this.plugins=e.facet(dl).map(r=>new Lf(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new ob(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(dl),r=e.state.facet(dl);if(n!=r){let s=[];for(let a of r){let c=n.indexOf(a);if(c<0)s.push(new Lf(a));else{let d=this.plugins[c];d.mustUpdate=e,s.push(d)}}for(let a of this.plugins)a.mustUpdate!=e&&a.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s<this.plugins.length;s++)this.plugins[s].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){Vi(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,s=this.viewState.getScrollOffset(),{scrollAnchorPos:a,scrollAnchorHeight:c,scaleY:d}=this.viewState;Math.abs(s-this.viewState.scrollOffset)>1&&(c=-1),this.viewState.scrollAnchorHeight=-1;try{for(let f=0;;f++){if(c<0){if(Ly(r||this.win))a=-1,c=this.viewState.heightMap.height/this.viewState.scaleY;else{let A=this.viewState.scrollAnchorAt(s);a=A.from,c=A.top}d=this.viewState.scaleY}this.updateState=1;let h=this.viewState.measure();if(!h&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(f>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let g=[];h&4||([this.measureRequests,g]=[g,this.measureRequests]);let b=g.map(A=>{try{return A.read(this)}catch(C){return Vi(this.state,C),Fb}}),v=nc.create(this,this.state,[]),S=!1;v.flags|=h,n?n.flags|=h:n=v,this.updateState=2,v.empty||(this.updatePlugins(v),this.inputState.update(v),this.updateAttrs(),S=this.docView.update(v),S&&this.docViewUpdate());for(let A=0;A<g.length;A++)if(b[A]!=Fb)try{let C=g[A];C.write&&C.write(b[A],this)}catch(C){Vi(this.state,C)}if(S&&this.docView.updateSelection(!0),!v.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,c=-1;continue}else{let C=(a<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(a).top)/this.viewState.scaleY-c/d;if((C>1||C<-1)&&!(Oe.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){s=s+C,r?a<0?r.scrollTop=r.scrollHeight:r.scrollTop+=C:this.win.scrollBy(0,C),c=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let f of this.state.facet(Rf))f(n)}get themeClasses(){return Qf+" "+(this.state.facet(Jf)?zb:qb)+" "+this.state.facet(gc)}updateAttrs(){let e=Vb(this,Zy,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(rr)?"true":"false",class:"cm-content",style:`${Oe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),Vb(this,Bf,n);let r=this.observer.ignore(()=>{let s=Ny(this.contentDOM,this.contentAttrs,n),a=Ny(this.dom,this.editorAttrs,e);return s||a});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let s of r.effects)if(s.is(Ye.announce)){n&&(this.announceDOM.textContent=""),n=!1;let a=this.announceDOM.appendChild(document.createElement("div"));a.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Ta);let e=this.state.facet(Ye.cspNonce);al.mount(this.root,this.styleModules.concat(ZN).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 Ff(this,e,ub(this,e,n,r))}moveByGroup(e,n){return Ff(this,e,ub(this,e,n,r=>hN(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),s=this.textDirectionAt(e.from),a=r[n?r.length-1:0];return Ce.cursor(a.side(n,s)+e.from,a.forward(!n,s)?1:-1)}moveToLineBoundary(e,n,r=!0){return fN(this,e,n,r)}moveVertically(e,n,r){return Ff(this,e,pN(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=Vf(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),Vf(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),a=s[Fi.find(s,e-r.from,-1,n)];return this.docView.coordsAt(e,n,a.dir==Rt.RTL)}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(Xy)||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>rT)return Iy(e.length);let n=this.textDirectionAt(e.from),r;for(let a of this.bidiCache)if(a.from==e.from&&a.dir==n&&(a.fresh||Hy(a.isolates,r=nb(this,e))))return a.order;r||(r=nb(this,e));let s=zC(e.text,n,r);return this.bidiCache.push(new yc(e.from,e.to,n,r,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Oe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Dy(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={}){var r,s,a,c;return ec.of(new ul(typeof e=="number"?Ce.cursor(e):e,(r=n.y)!==null&&r!==void 0?r:"nearest",(s=n.x)!==null&&s!==void 0?s:"nearest",(a=n.yMargin)!==null&&a!==void 0?a:5,(c=n.xMargin)!==null&&c!==void 0?c:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return ec.of(new ul(Ce.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 sr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return sr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=al.newName(),s=[gc.of(r),Ta.of(Wf(`.${r}`,e))];return n&&n.dark&&s.push(Jf.of(!0)),s}static baseTheme(e){return Uo.lowest(Ta.of(Wf("."+Qf,e,Hb)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),s=r&&Lt.get(r)||Lt.get(e);return((n=s?.root)===null||n===void 0?void 0:n.view)||null}}Ye.styleModule=Ta,Ye.inputHandler=Yy,Ye.clipboardInputFilter=Df,Ye.clipboardOutputFilter=_f,Ye.scrollHandler=Qy,Ye.focusChangeEffect=Gy,Ye.perLineTextDirection=Xy,Ye.exceptionSink=Ky,Ye.updateListener=Rf,Ye.editable=rr,Ye.mouseSelectionStyle=Py,Ye.dragMovesSelection=Vy,Ye.clickAddsSelectionRange=Fy,Ye.decorations=tc,Ye.blockWrappers=eb,Ye.outerDecorations=$f,Ye.atomicRanges=Na,Ye.bidiIsolatedRanges=tb,Ye.cursorScrollMargin=He.define({combine:t=>{let e=5,n=5;for(let r of t)typeof r=="number"?e=n=r:{x:e,y:n}=r;return{x:e,y:n}}}),Ye.scrollMargins=ib,Ye.darkTheme=Jf,Ye.cspNonce=He.define({combine:t=>t.length?t[0]:""}),Ye.contentAttributes=Bf,Ye.editorAttributes=Zy,Ye.lineWrapping=Ye.contentAttributes.of({class:"cm-lineWrapping"}),Ye.announce=zt.define();const rT=4096,Fb={};class yc{constructor(e,n,r,s,a,c){this.from=e,this.to=n,this.dir=r,this.isolates=s,this.fresh=a,this.order=c}static update(e,n){if(n.empty&&!e.some(a=>a.fresh))return e;let r=[],s=e.length?e[e.length-1].dir:Rt.LTR;for(let a=Math.max(0,e.length-10);a<e.length;a++){let c=e[a];c.dir==s&&!n.touchesRange(c.from,c.to)&&r.push(new yc(n.mapPos(c.from,1),n.mapPos(c.to,-1),c.dir,c.isolates,!1,c.order))}return r}}function Vb(t,e,n){for(let r=t.state.facet(e),s=r.length-1;s>=0;s--){let a=r[s],c=typeof a=="function"?a(t):a;c&&Cf(c,n)}return n}const sT=Oe.mac?"mac":Oe.windows?"win":Oe.linux?"linux":"key";function lT(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let s,a,c,d;for(let f=0;f<n.length-1;++f){const h=n[f];if(/^(cmd|meta|m)$/i.test(h))d=!0;else if(/^a(lt)?$/i.test(h))s=!0;else if(/^(c|ctrl|control)$/i.test(h))a=!0;else if(/^s(hift)?$/i.test(h))c=!0;else if(/^mod$/i.test(h))e=="mac"?d=!0:a=!0;else throw new Error("Unrecognized modifier name: "+h)}return s&&(r="Alt-"+r),a&&(r="Ctrl-"+r),d&&(r="Meta-"+r),c&&(r="Shift-"+r),r}function bc(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 aT=Uo.default(Ye.domEventHandlers({keydown(t,e){return dT(oT(e.state),t,e,"editor")}})),Pb=He.define({enables:aT}),Kb=new WeakMap;function oT(t){let e=t.facet(Pb),n=Kb.get(e);return n||Kb.set(e,n=uT(e.reduce((r,s)=>r.concat(s),[]))),n}let Hr=null;const cT=4e3;function uT(t,e=sT){let n=Object.create(null),r=Object.create(null),s=(c,d)=>{let f=r[c];if(f==null)r[c]=d;else if(f!=d)throw new Error("Key binding "+c+" is used both as a regular binding and as a multi-stroke prefix")},a=(c,d,f,h,g)=>{var b,v;let S=n[c]||(n[c]=Object.create(null)),A=d.split(/ (?!$)/).map(D=>lT(D,e));for(let D=1;D<A.length;D++){let j=A.slice(0,D).join(" ");s(j,!0),S[j]||(S[j]={preventDefault:!0,stopPropagation:!1,run:[E=>{let O=Hr={view:E,prefix:j,scope:c};return setTimeout(()=>{Hr==O&&(Hr=null)},cT),!0}]})}let C=A.join(" ");s(C,!1);let T=S[C]||(S[C]={preventDefault:!1,stopPropagation:!1,run:((v=(b=S._any)===null||b===void 0?void 0:b.run)===null||v===void 0?void 0:v.slice())||[]});f&&T.run.push(f),h&&(T.preventDefault=!0),g&&(T.stopPropagation=!0)};for(let c of t){let d=c.scope?c.scope.split(" "):["editor"];if(c.any)for(let h of d){let g=n[h]||(n[h]=Object.create(null));g._any||(g._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:b}=c;for(let v in g)g[v].run.push(S=>b(S,eh))}let f=c[e]||c.key;if(f)for(let h of d)a(h,f,c.run,c.preventDefault,c.stopPropagation),c.shift&&a(h,"Shift-"+f,c.shift,c.preventDefault,c.stopPropagation)}return n}let eh=null;function dT(t,e,n,r){eh=e;let s=kC(e),a=lC(s,0),c=aC(a)==s.length&&s!=" ",d="",f=!1,h=!1,g=!1;Hr&&Hr.view==n&&Hr.scope==r&&(d=Hr.prefix+" ",bb.indexOf(e.keyCode)<0&&(h=!0,Hr=null));let b=new Set,v=T=>{if(T){for(let D of T.run)if(!b.has(D)&&(b.add(D),D(n)))return T.stopPropagation&&(g=!0),!0;T.preventDefault&&(T.stopPropagation&&(g=!0),h=!0)}return!1},S=t[r],A,C;return S&&(v(S[d+bc(s,e,!c)])?f=!0:c&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Oe.windows&&e.ctrlKey&&e.altKey)&&!(Oe.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(A=qr[e.keyCode])&&A!=s?(v(S[d+bc(A,e,!0)])||e.shiftKey&&(C=ba[e.keyCode])!=s&&C!=A&&v(S[d+bc(C,e,!1)]))&&(f=!0):c&&e.shiftKey&&v(S[d+bc(s,e,!0)])&&(f=!0),!f&&v(S._any)&&(f=!0)),h&&(f=!0),f&&g&&e.stopPropagation(),eh=null,f}class Ds{constructor(e,n,r,s,a){this.className=e,this.left=n,this.top=r,this.width=s,this.height=a}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let s=e.coordsAtPos(r.head,r.assoc||1);if(!s)return[];let a=Yb(e);return[new Ds(n,s.left-a.left,s.top-a.top,null,s.bottom-s.top)]}else return fT(e,n,r)}}function Yb(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Rt.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function Gb(t,e,n,r){let s=t.coordsAtPos(e,n*2);if(!s)return r;let a=t.dom.getBoundingClientRect(),c=(s.top+s.bottom)/2,d=t.posAtCoords({x:a.left+1,y:c}),f=t.posAtCoords({x:a.right-1,y:c});return d==null||f==null?r:{from:Math.max(r.from,Math.min(d,f)),to:Math.min(r.to,Math.max(d,f))}}function fT(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),s=Math.min(n.to,t.viewport.to),a=t.textDirection==Rt.LTR,c=t.contentDOM,d=c.getBoundingClientRect(),f=Yb(t),h=c.querySelector(".cm-line"),g=h&&window.getComputedStyle(h),b=d.left+(g?parseInt(g.paddingLeft)+Math.min(0,parseInt(g.textIndent)):0),v=d.right-(g?parseInt(g.paddingRight):0),S=Uf(t,r,1),A=Uf(t,s,-1),C=S.type==dn.Text?S:null,T=A.type==dn.Text?A:null;if(C&&(t.lineWrapping||S.widgetLineBreaks)&&(C=Gb(t,r,1,C)),T&&(t.lineWrapping||A.widgetLineBreaks)&&(T=Gb(t,s,-1,T)),C&&T&&C.from==T.from&&C.to==T.to)return j(E(n.from,n.to,C));{let R=C?E(n.from,null,C):O(S,!1),B=T?E(null,n.to,T):O(A,!0),M=[];return(C||S).to<(T||A).from-(C&&T?1:0)||S.widgetLineBreaks>1&&R.bottom+t.defaultLineHeight/2<B.top?M.push(D(b,R.bottom,v,B.top)):R.bottom<B.top&&t.elementAtHeight((R.bottom+B.top)/2).type==dn.Text&&(R.bottom=B.top=(R.bottom+B.top)/2),j(R).concat(M).concat(j(B))}function D(R,B,M,z){return new Ds(e,R-f.left,B-f.top,Math.max(0,M-R),z-B)}function j({top:R,bottom:B,horizontal:M}){let z=[];for(let F=0;F<M.length;F+=2)z.push(D(M[F],R,M[F+1],B));return z}function E(R,B,M){let z=1e9,F=-1e9,X=[];function W(ye,xe,_,ee,he){let $=t.coordsAtPos(ye,ye==M.to?-2:2),te=t.coordsAtPos(_,_==M.from?2:-2);!$||!te||(z=Math.min($.top,te.top,z),F=Math.max($.bottom,te.bottom,F),he==Rt.LTR?X.push(a&&xe?b:$.left,a&&ee?v:te.right):X.push(!a&&ee?b:te.left,!a&&xe?v:$.right))}let G=R??M.from,we=B??M.to;for(let ye of t.visibleRanges)if(ye.to>G&&ye.from<we)for(let xe=Math.max(ye.from,G),_=Math.min(ye.to,we);;){let ee=t.state.doc.lineAt(xe);for(let he of t.bidiSpans(ee)){let $=he.from+ee.from,te=he.to+ee.from;if($>=_)break;te>xe&&W(Math.max($,xe),R==null&&$<=G,Math.min(te,_),B==null&&te>=we,he.dir)}if(xe=ee.to+1,xe>=_)break}return X.length==0&&W(G,R==null,we,B==null,t.textDirection),{top:z,bottom:F,horizontal:X}}function O(R,B){let M=d.top+(B?R.top:R.bottom);return{top:M,bottom:M,horizontal:[]}}}function hT(t,e){return t.constructor==e.constructor&&t.eq(e)}class pT{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(xc)!=e.state.facet(xc)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(xc);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,r)=>!hT(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let s of e)s.update&&n&&s.constructor&&this.drawn[r].constructor&&s.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(s.draw(),n);for(;n;){let s=n.nextSibling;n.remove(),n=s}this.drawn=e,Oe.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const xc=He.define();function Xb(t){return[sr.define(e=>new pT(e,t)),xc.of(t)]}const gl=He.define({combine(t){return uf(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function mT(t={}){return[gl.of(t),gT,yT,xT,Jy.of(!0)]}function Jb(t){return t.startState.facet(gl)!=t.state.facet(gl)}const gT=Xb({above:!0,markers(t){let{state:e}=t,n=e.facet(gl),r=[];for(let s of e.selection.ranges){let a=s==e.selection.main;if(s.empty||n.drawRangeCursor&&!(a&&Oe.ios&&n.iosSelectionHandles)){let c=a?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",d=s.empty?s:Ce.cursor(s.head,s.assoc);for(let f of Ds.forRange(t,c,d))r.push(f)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=Jb(t);return n&&Qb(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){Qb(e.state,t)},class:"cm-cursorLayer"});function Qb(t,e){e.style.animationDuration=t.facet(gl).cursorBlinkRate+"ms"}const yT=Xb({above:!1,markers(t){let e=[],{main:n,ranges:r}=t.state.selection;for(let s of r)if(!s.empty)for(let a of Ds.forRange(t,"cm-selectionBackground",s))e.push(a);if(Oe.ios&&!n.empty&&t.state.facet(gl).iosSelectionHandles){for(let s of Ds.forRange(t,"cm-selectionHandle cm-selectionHandle-start",Ce.cursor(n.from,1)))e.push(s);for(let s of Ds.forRange(t,"cm-selectionHandle cm-selectionHandle-end",Ce.cursor(n.to,1)))e.push(s)}return e},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||Jb(t)},class:"cm-selectionLayer"}),bT=Oe.gecko&&Oe.gecko_version==153?"#ffffff01":"transparent",xT=Uo.highest(Ye.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:`${bT} !important`},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));function Wb(){return wT}const vT=nn.line({class:"cm-activeLine"}),wT=sr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let s=t.lineBlockAt(r.head);s.from>e&&(n.push(vT.range(s.from)),e=s.from)}return nn.set(n)}},{decorations:t=>t.decorations});class Ir extends Ts{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ir.prototype.elementClass="",Ir.prototype.toDOM=void 0,Ir.prototype.mapMode=Yn.TrackBefore,Ir.prototype.startSide=Ir.prototype.endSide=-1,Ir.prototype.point=!0;const vc=He.define(),ST=He.define(),wc=He.define(),Zb=He.define({combine:t=>t.some(e=>e)});function AT(t){return[kT]}const kT=sr.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(wc).map(e=>new tx(t,e)),this.fixed=!t.state.facet(Zb);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Zb)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=ft.iter(this.view.state.facet(vc),this.view.viewport.from),r=[],s=this.gutters.map(a=>new CT(a,this.view.viewport,-this.view.documentPadding.top));for(let a of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(a.type)){let c=!0;for(let d of a.type)if(d.type==dn.Text&&c){th(n,r,d.from);for(let f of s)f.line(this.view,d,r);c=!1}else if(d.widget)for(let f of s)f.widget(this.view,d)}else if(a.type==dn.Text){th(n,r,a.from);for(let c of s)c.line(this.view,a,r)}else if(a.widget)for(let c of s)c.widget(this.view,a);for(let a of s)a.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(wc),n=t.state.facet(wc),r=t.docChanged||t.heightChanged||t.viewportChanged||!ft.eq(t.startState.facet(vc),t.state.facet(vc),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let s of this.gutters)s.update(t)&&(r=!0);else{r=!0;let s=[];for(let a of n){let c=e.indexOf(a);c<0?s.push(new tx(this.view,a)):(this.gutters[c].update(t),s.push(this.gutters[c]))}for(let a of this.gutters)a.dom.remove(),s.indexOf(a)<0&&a.destroy();for(let a of s)a.config.side=="after"?this.getDOMAfter().appendChild(a.dom):this.dom.appendChild(a.dom);this.gutters=s}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>Ye.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,s=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Rt.LTR?{left:r,right:s}:{right:r,left:s}})});function ex(t){return Array.isArray(t)?t:[t]}function th(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class CT{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=ft.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:s}=this,a=(n.top-this.height)/e.scaleY,c=n.height/e.scaleY;if(this.i==s.elements.length){let d=new nx(e,c,a,r);s.elements.push(d),s.dom.appendChild(d.dom)}else s.elements[this.i].update(e,c,a,r);this.height=n.bottom,this.i++}line(e,n,r){let s=[];th(this.cursor,s,n.from),r.length&&(s=s.concat(r));let a=this.gutter.config.lineMarker(e,n,s);a&&s.unshift(a);let c=this.gutter;s.length==0&&!c.config.renderEmptyElements||this.addElement(e,n,s)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),s=r?[r]:null;for(let a of e.state.facet(ST)){let c=a(e,n.widget,n);c&&(s||(s=[])).push(c)}s&&this.addElement(e,n,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class tx{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,s=>{let a=s.target,c;if(a!=this.dom&&this.dom.contains(a)){for(;a.parentNode!=this.dom;)a=a.parentNode;let f=a.getBoundingClientRect();c=(f.top+f.bottom)/2}else c=s.clientY;let d=e.lineBlockAtHeight(c-e.documentTop);n.domEventHandlers[r](e,d,s)&&s.preventDefault()});this.markers=ex(n.markers(e)),n.initialSpacer&&(this.spacer=new nx(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=ex(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let r=e.view.viewport;return!ft.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class nx{constructor(e,n,r,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,s)}update(e,n,r,s){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),NT(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,n){let r="cm-gutterElement",s=this.dom.firstChild;for(let a=0,c=0;;){let d=c,f=a<n.length?n[a++]:null,h=!1;if(f){let g=f.elementClass;g&&(r+=" "+g);for(let b=c;b<this.markers.length;b++)if(this.markers[b].compare(f)){d=b,h=!0;break}}else d=this.markers.length;for(;c<d;){let g=this.markers[c++];if(g.toDOM){g.destroy(s);let b=s.nextSibling;s.remove(),s=b}}if(!f)break;f.toDOM&&(h?s=s.nextSibling:this.dom.insertBefore(f.toDOM(e),s)),h&&c++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function NT(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const TT=He.define(),jT=He.define(),yl=He.define({combine(t){return uf(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let s in n){let a=r[s],c=n[s];r[s]=a?(d,f,h)=>a(d,f,h)||c(d,f,h):c}return r}})}});class nh extends Ir{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function ih(t,e){return t.state.facet(yl).formatNumber(e,t.state)}const ET=wc.compute([yl],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(TT)},lineMarker(e,n,r){return r.some(s=>s.toDOM)?null:new nh(ih(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let s of e.state.facet(jT)){let a=s(e,n,r);if(a)return a}return null},lineMarkerChange:e=>e.startState.facet(yl)!=e.state.facet(yl),initialSpacer(e){return new nh(ih(e,rx(e.state.doc.lines)))},updateSpacer(e,n){let r=ih(n.view,rx(n.view.state.doc.lines));return r==e.number?e:new nh(r)},domEventHandlers:t.facet(yl).domEventHandlers,side:"before"}));function ix(t={}){return[yl.of(t),AT(),ET]}function rx(t){let e=9;for(;e<t;)e=e*10+9;return e}const OT=new class extends Ir{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},MT=vc.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.head).from;s>n&&(n=s,e.push(OT.range(s)))}return ft.of(e)});function sx(){return MT}const RT=1024;let DT=0;class rh{constructor(e,n){this.from=e,this.to=n}}class mt{constructor(e={}){this.id=DT++,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=ci.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}mt.closedBy=new mt({deserialize:t=>t.split(" ")}),mt.openedBy=new mt({deserialize:t=>t.split(" ")}),mt.group=new mt({deserialize:t=>t.split(" ")}),mt.isolate=new mt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),mt.contextHash=new mt({perNode:!0}),mt.lookAhead=new mt({perNode:!0}),mt.mounted=new mt({perNode:!0});class Oa{constructor(e,n,r,s=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=s}static get(e){return e&&e.props&&e.props[mt.mounted.id]}}const _T=Object.create(null);class ci{constructor(e,n,r,s=0){this.name=e,this.props=n,this.id=r,this.flags=s}static define(e){let n=e.props&&e.props.length?Object.create(null):_T,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new ci(e.name||"",n,e.id,r);if(e.props){for(let a of e.props)if(Array.isArray(a)||(a=a(s)),a){if(a[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[a[0].id]=a[1]}}return s}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(mt.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 s of r.split(" "))n[s]=e[r];return r=>{for(let s=r.prop(mt.group),a=-1;a<(s?s.length:0);a++){let c=n[a<0?r.name:s[a]];if(c)return c}}}}ci.none=new ci("",Object.create(null),0,8);const Sc=new WeakMap,lx=new WeakMap;var Ht;(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"})(Ht||(Ht={}));class hn{constructor(e,n,r,s,a){if(this.type=e,this.children=n,this.positions=r,this.length=s,this.props=null,a&&a.length){this.props=Object.create(null);for(let[c,d]of a)this.props[typeof c=="number"?c:c.id]=d}}toString(){let e=Oa.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let s=r.toString();s&&(n&&(n+=","),n+=s)}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 ah(this.topNode,e)}cursorAt(e,n=0,r=0){let s=Sc.get(this)||this.topNode,a=new ah(s);return a.moveTo(e,n),Sc.set(this,a._tree),a}get topNode(){return new ui(this,0,0,null)}resolve(e,n=0){let r=Ma(Sc.get(this)||this.topNode,e,n,!1);return Sc.set(this,r),r}resolveInner(e,n=0){let r=Ma(lx.get(this)||this.topNode,e,n,!0);return lx.set(this,r),r}resolveStack(e,n=0){return $T(this,e,n)}iterate(e){let{enter:n,leave:r,from:s=0,to:a=this.length}=e,c=e.mode||0,d=(c&Ht.IncludeAnonymous)>0;for(let f=this.cursor(c|Ht.IncludeAnonymous);;){let h=!1;if(f.from<=a&&f.to>=s&&(!d&&f.type.isAnonymous||n(f)!==!1)){if(f.firstChild())continue;h=!0}for(;h&&r&&(d||!f.type.isAnonymous)&&r(f),!f.nextSibling();){if(!f.parent())return;h=!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:ch(ci.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,s)=>new hn(this.type,n,r,s,this.propValues),e.makeTree||((n,r,s)=>new hn(ci.none,n,r,s)))}static build(e){return qT(e)}}hn.empty=new hn(ci.none,[],[],0);class sh{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 sh(this.buffer,this.index)}}class Ur{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return ci.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],s=this.set.types[n],a=s.name;if(/\W/.test(a)&&!s.isError&&(a=JSON.stringify(a)),e+=4,r==e)return a;let c=[];for(;e<r;)c.push(this.childString(e)),e=this.buffer[e+3];return a+"("+c.join(",")+")"}findChild(e,n,r,s,a){let{buffer:c}=this,d=-1;for(let f=e;f!=n&&!(ax(a,s,c[f+1],c[f+2])&&(d=f,r>0));f=c[f+3]);return d}slice(e,n,r){let s=this.buffer,a=new Uint16Array(n-e),c=0;for(let d=e,f=0;d<n;){a[f++]=s[d++],a[f++]=s[d++]-r;let h=a[f++]=s[d++]-r;a[f++]=s[d++]-e,c=Math.max(c,h)}return new Ur(a,c,this.set)}}function ax(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 Ma(t,e,n,r){for(var s;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let c=!r&&t instanceof ui&&t.index<0?null:t.parent;if(!c)return t;t=c}let a=r?0:Ht.IgnoreOverlays;if(r)for(let c=t,d=c.parent;d;c=d,d=c.parent)c instanceof ui&&c.index<0&&((s=d.enter(e,n,a))===null||s===void 0?void 0:s.from)!=c.from&&(t=d);for(;;){let c=t.enter(e,n,a);if(!c)return t;t=c}}class ox{cursor(e=0){return new ah(this,e)}getChild(e,n=null,r=null){let s=cx(this,e,n,r);return s.length?s[0]:null}getChildren(e,n=null,r=null){return cx(this,e,n,r)}resolve(e,n=0){return Ma(this,e,n,!1)}resolveInner(e,n=0){return Ma(this,e,n,!0)}matchContext(e){return lh(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let s=n.lastChild;if(!s||s.to!=n.to)break;s.type.isError&&s.from==s.to?(r=n,n=s.prevSibling):n=s}return r}get node(){return this}get next(){return this.parent}}class ui extends ox{constructor(e,n,r,s){super(),this._tree=e,this.from=n,this.index=r,this._parent=s}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,s,a=0){for(let c=this;;){for(let{children:d,positions:f}=c._tree,h=n>0?d.length:-1;e!=h;e+=n){let g=d[e],b=f[e]+c.from,v;if(!(!(a&Ht.EnterBracketed&&g instanceof hn&&(v=Oa.get(g))&&!v.overlay&&v.bracketed&&r>=b&&r<=b+g.length)&&!ax(s,r,b,b+g.length))){if(g instanceof Ur){if(a&Ht.ExcludeBuffers)continue;let S=g.findChild(0,g.buffer.length,n,r-b,s);if(S>-1)return new Fr(new LT(c,g,e,b),null,S)}else if(a&Ht.IncludeAnonymous||!g.type.isAnonymous||oh(g)){let S;if(!(a&Ht.IgnoreMounts)&&(S=Oa.get(g))&&!S.overlay)return new ui(S.tree,b,e,c);let A=new ui(g,b,e,c);return a&Ht.IncludeAnonymous||!A.type.isAnonymous?A:A.nextChild(n<0?g.children.length-1:0,n,r,s,a)}}}if(a&Ht.IncludeAnonymous||!c.type.isAnonymous||(c.index>=0?e=c.index+n:e=n<0?-1:c._parent._tree.children.length,c=c._parent,!c))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 s;if(!(r&Ht.IgnoreOverlays)&&(s=Oa.get(this._tree))&&s.overlay){let a=e-this.from,c=r&Ht.EnterBracketed&&s.bracketed;for(let{from:d,to:f}of s.overlay)if((n>0||c?d<=a:d<a)&&(n<0||c?f>=a:f>a))return new ui(s.tree,s.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 cx(t,e,n,r){let s=t.cursor(),a=[];if(!s.firstChild())return a;if(n!=null){for(let c=!1;!c;)if(c=s.type.is(n),!s.nextSibling())return a}for(;;){if(r!=null&&s.type.is(r))return a;if(s.type.is(e)&&a.push(s.node),!s.nextSibling())return r==null?a:[]}}function lh(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 LT{constructor(e,n,r,s){this.parent=e,this.buffer=n,this.index=r,this.start=s}}class Fr extends ox{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:s}=this.context,a=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.context.start,r);return a<0?null:new Fr(this.context,this,a)}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&Ht.ExcludeBuffers)return null;let{buffer:s}=this.context,a=s.findChild(this.index+4,s.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return a<0?null:new Fr(this.context,this,a)}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 Fr(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 Fr(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,s=this.index+4,a=r.buffer[this.index+3];if(a>s){let c=r.buffer[this.index+1];e.push(r.slice(s,a,c)),n.push(0)}return new hn(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function ux(t){if(!t.length)return null;let e=0,n=t[0];for(let a=1;a<t.length;a++){let c=t[a];(c.from>n.from||c.to<n.to)&&(n=c,e=a)}let r=n instanceof ui&&n.index<0?null:n.parent,s=t.slice();return r?s[e]=r:s.splice(e,1),new BT(s,n)}class BT{constructor(e,n){this.heads=e,this.node=n}get next(){return ux(this.heads)}}function $T(t,e,n){let r=t.resolveInner(e,n),s=null;for(let a=r instanceof ui?r:r.context.parent;a;a=a.parent)if(a.index<0){let c=a.parent;(s||(s=[r])).push(c.resolve(e,n)),a=c}else{let c=Oa.get(a.tree);if(c&&c.overlay&&c.overlay[0].from<=e&&c.overlay[c.overlay.length-1].to>=e){let d=new ui(c.tree,c.overlay[0].from+a.from,-1,a);(s||(s=[r])).push(Ma(d,e,n,!1))}}return s?ux(s):r}class ah{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&~Ht.EnterBracketed,e instanceof ui)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:s}=this.buffer;return this.type=n||s.set.types[s.buffer[e]],this.from=r+s.buffer[e+1],this.to=r+s.buffer[e+2],!0}yield(e){return e?e instanceof ui?(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:s}=this.buffer,a=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.buffer.start,r);return a<0?!1:(this.stack.push(this.index),this.yieldBuf(a))}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&Ht.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ht.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ht.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 s=r<0?0:this.stack[r]+4;if(this.index!=s)return this.yieldBuf(n.findChild(s,this.index,-1,0,4))}else{let s=n.buffer[this.index+3];if(s<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(s)}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:s}=this;if(s){if(e>0){if(this.index<s.buffer.buffer.length)return!1}else for(let a=0;a<this.index;a++)if(s.buffer.buffer[a+3]<this.index)return!1;({index:n,parent:r}=s)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let a=n+e,c=e<0?-1:r._tree.children.length;a!=c;a+=e){let d=r._tree.children[a];if(this.mode&Ht.IncludeAnonymous||d instanceof Ur||!d.type.isAnonymous||oh(d))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 s=this.index,a=this.stack.length;a>=0;){for(let c=e;c;c=c._parent)if(c.index==s){if(s==this.index)return c;n=c,r=a+1;break e}s=this.stack[--a]}for(let s=r;s<this.stack.length;s++)n=new Fr(this.buffer,n,this.stack[s]);return this.bufferNode=new Fr(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let s=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&n&&n(this),s=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,s=!0}}}matchContext(e){if(!this.buffer)return lh(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let s=e.length-1,a=this.stack.length-1;s>=0;a--){if(a<0)return lh(this._tree,e,s);let c=r[n.buffer[this.stack[a]]];if(!c.isAnonymous){if(e[s]&&e[s]!=c.name)return!1;s--}}return!0}}function oh(t){return t.children.some(e=>e instanceof Ur||!e.type.isAnonymous||oh(e))}function qT(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:s=RT,reused:a=[],minRepeatType:c=r.types.length}=t,d=Array.isArray(n)?new sh(n,n.length):n,f=r.types,h=0,g=0;function b(R,B,M,z,F,X){let{id:W,start:G,end:we,size:ye}=d,xe=g,_=h;if(ye<0)if(d.next(),ye==-1){let L=a[W];M.push(L),z.push(G-R);return}else if(ye==-3){h=W;return}else if(ye==-4){g=W;return}else throw new RangeError(`Unrecognized record size: ${ye}`);let ee=f[W],he,$,te=G-R;if(we-G<=s&&($=T(d.pos-B,F))){let L=new Uint16Array($.size-$.skip),P=d.pos-$.size,ue=L.length;for(;d.pos>P;)ue=D($.start,L,ue);he=new Ur(L,we-$.start,r),te=$.start-R}else{let L=d.pos-ye;d.next();let P=[],ue=[],Se=W>=c?W:-1,Ne=0,Re=we;for(;d.pos>L;)Se>=0&&d.id==Se&&d.size>=0?(d.end<=Re-s&&(A(P,ue,G,Ne,d.end,Re,Se,xe,_),Ne=P.length,Re=d.end),d.next()):X>2500?v(G,L,P,ue):b(G,L,P,ue,Se,X+1);if(Se>=0&&Ne>0&&Ne<P.length&&A(P,ue,G,Ne,G,Re,Se,xe,_),P.reverse(),ue.reverse(),Se>-1&&Ne>0){let Be=S(ee,_);he=ch(ee,P,ue,0,P.length,0,we-G,Be,Be)}else he=C(ee,P,ue,we-G,xe-we,_)}M.push(he),z.push(te)}function v(R,B,M,z){let F=[],X=0,W=-1;for(;d.pos>B;){let{id:G,start:we,end:ye,size:xe}=d;if(xe>4)d.next();else{if(W>-1&&we<W)break;W<0&&(W=ye-s),F.push(G,we,ye),X++,d.next()}}if(X){let G=new Uint16Array(X*4),we=F[F.length-2];for(let ye=F.length-3,xe=0;ye>=0;ye-=3)G[xe++]=F[ye],G[xe++]=F[ye+1]-we,G[xe++]=F[ye+2]-we,G[xe++]=xe;M.push(new Ur(G,F[2]-we,r)),z.push(we-R)}}function S(R,B){return(M,z,F)=>{let X=0,W=M.length-1,G,we;if(W>=0&&(G=M[W])instanceof hn){if(!W&&G.type==R&&G.length==F)return G;(we=G.prop(mt.lookAhead))&&(X=z[W]+G.length+we)}return C(R,M,z,F,X,B)}}function A(R,B,M,z,F,X,W,G,we){let ye=[],xe=[];for(;R.length>z;)ye.push(R.pop()),xe.push(B.pop()+M-F);R.push(C(r.types[W],ye,xe,X-F,G-X,we)),B.push(F-M)}function C(R,B,M,z,F,X,W){if(X){let G=[mt.contextHash,X];W=W?[G].concat(W):[G]}if(F>25){let G=[mt.lookAhead,F];W=W?[G].concat(W):[G]}return new hn(R,B,M,z,W)}function T(R,B){let M=d.fork(),z=0,F=0,X=0,W=M.end-s,G={size:0,start:0,skip:0};e:for(let we=M.pos-R;M.pos>we;){let ye=M.size;if(M.id==B&&ye>=0){G.size=z,G.start=F,G.skip=X,X+=4,z+=4,M.next();continue}let xe=M.pos-ye;if(ye<0||xe<we||M.start<W)break;let _=M.id>=c?4:0,ee=M.start;for(M.next();M.pos>xe;){if(M.size<0)if(M.size==-3||M.size==-4)_+=4;else break e;else M.id>=c&&(_+=4);M.next()}F=ee,z+=ye,X+=_}return(B<0||z==R)&&(G.size=z,G.start=F,G.skip=X),G.size>4?G:void 0}function D(R,B,M){let{id:z,start:F,end:X,size:W}=d;if(d.next(),W>=0&&z<c){let G=M;if(W>4){let we=d.pos-(W-4);for(;d.pos>we;)M=D(R,B,M)}B[--M]=G,B[--M]=X-R,B[--M]=F-R,B[--M]=z}else W==-3?h=z:W==-4&&(g=z);return M}let j=[],E=[];for(;d.pos>0;)b(t.start||0,t.bufferStart||0,j,E,-1,0);let O=(e=t.length)!==null&&e!==void 0?e:j.length?E[0]+j[0].length:0;return new hn(f[t.topID],j.reverse(),E.reverse(),O)}const dx=new WeakMap;function Ac(t,e){if(!t.isAnonymous||e instanceof Ur||e.type!=t)return 1;let n=dx.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof hn)){n=1;break}n+=Ac(t,r)}dx.set(e,n)}return n}function ch(t,e,n,r,s,a,c,d,f){let h=0;for(let A=r;A<s;A++)h+=Ac(t,e[A]);let g=Math.ceil(h*1.5/8),b=[],v=[];function S(A,C,T,D,j){for(let E=T;E<D;){let O=E,R=C[E],B=Ac(t,A[E]);for(E++;E<D;E++){let M=Ac(t,A[E]);if(B+M>=g)break;B+=M}if(E==O+1){if(B>g){let M=A[O];S(M.children,M.positions,0,M.children.length,C[O]+j);continue}b.push(A[O])}else{let M=C[E-1]+A[E-1].length-R;b.push(ch(t,A,C,O,E,R,M,null,f))}v.push(R+j-a)}}return S(e,n,r,s,0),(d||f)(b,v,c)}class _s{constructor(e,n,r,s,a=!1,c=!1){this.from=e,this.to=n,this.tree=r,this.offset=s,this.open=(a?1:0)|(c?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let s=[new _s(0,e.length,e,0,!1,r)];for(let a of n)a.to>e.length&&s.push(a);return s}static applyChanges(e,n,r=128){if(!n.length)return e;let s=[],a=1,c=e.length?e[0]:null;for(let d=0,f=0,h=0;;d++){let g=d<n.length?n[d]:null,b=g?g.fromA:1e9;if(b-f>=r)for(;c&&c.from<b;){let v=c;if(f>=v.from||b<=v.to||h){let S=Math.max(v.from,f)-h,A=Math.min(v.to,b)-h;v=S>=A?null:new _s(S,A,v.tree,v.offset+h,d>0,!!g)}if(v&&s.push(v),c.to>b)break;c=a<e.length?e[a++]:null}if(!g)break;f=g.toA,h=g.toA-g.toB}return s}}class zT{startParse(e,n,r){return typeof e=="string"&&(e=new HT(e)),r=r?r.length?r.map(s=>new rh(s.from,s.to)):[new rh(0,0)]:[new rh(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let s=this.startParse(e,n,r);for(;;){let a=s.advance();if(a)return a}}}class HT{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 mt({perNode:!0});let IT=0;class di{constructor(e,n,r,s){this.name=e,this.set=n,this.base=r,this.modified=s,this.id=IT++}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 di&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let s=new di(r,[],null,[]);if(s.set.push(s),n)for(let a of n.set)s.set.push(a);return s}static defineModifier(e){let n=new kc(e);return r=>r.modified.indexOf(n)>-1?r:kc.get(r.base||r,r.modified.concat(n).sort((s,a)=>s.id-a.id))}}let UT=0;class kc{constructor(e){this.name=e,this.instances=[],this.id=UT++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(d=>d.base==e&&FT(n,d.modified));if(r)return r;let s=[],a=new di(e.name,s,e,n);for(let d of n)d.instances.push(a);let c=VT(n);for(let d of e.set)if(!d.modified.length)for(let f of c)s.push(kc.get(d,f));return a}}function FT(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function VT(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,s=e.length;r<s;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function PT(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let s of n.split(" "))if(s){let a=[],c=2,d=s;for(let b=0;;){if(d=="..."&&b>0&&b+3==s.length){c=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(d);if(!v)throw new RangeError("Invalid path: "+s);if(a.push(v[0]=="*"?"":v[0][0]=='"'?JSON.parse(v[0]):v[0]),b+=v[0].length,b==s.length)break;let S=s[b++];if(b==s.length&&S=="!"){c=0;break}if(S!="/")throw new RangeError("Invalid path: "+s);d=s.slice(b)}let f=a.length-1,h=a[f];if(!h)throw new RangeError("Invalid path: "+s);let g=new Cc(r,c,f>0?a.slice(0,f):null);e[h]=g.sort(e[h])}}return KT.add(e)}const KT=new mt({combine(t,e){let n,r,s;for(;t||e;){if(!t||e&&t.depth>=e.depth?(s=e,e=e.next):(s=t,t=t.next),n&&n.mode==s.mode&&!s.context&&!n.context)continue;let a=new Cc(s.tags,s.mode,s.context);n?n.next=a:r=a,n=a}return r}});class Cc{constructor(e,n,r,s){this.tags=e,this.mode=n,this.context=r,this.next=s}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}}Cc.empty=new Cc([],2,null);function YT(t,e){let n=Object.create(null);for(let a of t)if(!Array.isArray(a.tag))n[a.tag.id]=a.class;else for(let c of a.tag)n[c.id]=a.class;let{scope:r,all:s=null}={};return{style:a=>{let c=s;for(let d of a)for(let f of d.set){let h=n[f.id];if(h){c=c?c+" "+h:h;break}}return c},scope:r}}const Ee=di.define,Nc=Ee(),Vr=Ee(),fx=Ee(Vr),hx=Ee(Vr),Pr=Ee(),Tc=Ee(Pr),uh=Ee(Pr),Ki=Ee(),Ls=Ee(Ki),Yi=Ee(),Gi=Ee(),dh=Ee(),Ra=Ee(dh),jc=Ee(),it={comment:Nc,lineComment:Ee(Nc),blockComment:Ee(Nc),docComment:Ee(Nc),name:Vr,variableName:Ee(Vr),typeName:fx,tagName:Ee(fx),propertyName:hx,attributeName:Ee(hx),className:Ee(Vr),labelName:Ee(Vr),namespace:Ee(Vr),macroName:Ee(Vr),literal:Pr,string:Tc,docString:Ee(Tc),character:Ee(Tc),attributeValue:Ee(Tc),number:uh,integer:Ee(uh),float:Ee(uh),bool:Ee(Pr),regexp:Ee(Pr),escape:Ee(Pr),color:Ee(Pr),url:Ee(Pr),keyword:Yi,self:Ee(Yi),null:Ee(Yi),atom:Ee(Yi),unit:Ee(Yi),modifier:Ee(Yi),operatorKeyword:Ee(Yi),controlKeyword:Ee(Yi),definitionKeyword:Ee(Yi),moduleKeyword:Ee(Yi),operator:Gi,derefOperator:Ee(Gi),arithmeticOperator:Ee(Gi),logicOperator:Ee(Gi),bitwiseOperator:Ee(Gi),compareOperator:Ee(Gi),updateOperator:Ee(Gi),definitionOperator:Ee(Gi),typeOperator:Ee(Gi),controlOperator:Ee(Gi),punctuation:dh,separator:Ee(dh),bracket:Ra,angleBracket:Ee(Ra),squareBracket:Ee(Ra),paren:Ee(Ra),brace:Ee(Ra),content:Ki,heading:Ls,heading1:Ee(Ls),heading2:Ee(Ls),heading3:Ee(Ls),heading4:Ee(Ls),heading5:Ee(Ls),heading6:Ee(Ls),contentSeparator:Ee(Ki),list:Ee(Ki),quote:Ee(Ki),emphasis:Ee(Ki),strong:Ee(Ki),link:Ee(Ki),monospace:Ee(Ki),strikethrough:Ee(Ki),inserted:Ee(),deleted:Ee(),changed:Ee(),invalid:Ee(),meta:jc,documentMeta:Ee(jc),annotation:Ee(jc),processingInstruction:Ee(jc),definition:di.defineModifier("definition"),constant:di.defineModifier("constant"),function:di.defineModifier("function"),standard:di.defineModifier("standard"),local:di.defineModifier("local"),special:di.defineModifier("special")};for(let t in it){let e=it[t];e instanceof di&&(e.name=t)}YT([{tag:it.link,class:"tok-link"},{tag:it.heading,class:"tok-heading"},{tag:it.emphasis,class:"tok-emphasis"},{tag:it.strong,class:"tok-strong"},{tag:it.keyword,class:"tok-keyword"},{tag:it.atom,class:"tok-atom"},{tag:it.bool,class:"tok-bool"},{tag:it.url,class:"tok-url"},{tag:it.labelName,class:"tok-labelName"},{tag:it.inserted,class:"tok-inserted"},{tag:it.deleted,class:"tok-deleted"},{tag:it.literal,class:"tok-literal"},{tag:it.string,class:"tok-string"},{tag:it.number,class:"tok-number"},{tag:[it.regexp,it.escape,it.special(it.string)],class:"tok-string2"},{tag:it.variableName,class:"tok-variableName"},{tag:it.local(it.variableName),class:"tok-variableName tok-local"},{tag:it.definition(it.variableName),class:"tok-variableName tok-definition"},{tag:it.special(it.variableName),class:"tok-variableName2"},{tag:it.definition(it.propertyName),class:"tok-propertyName tok-definition"},{tag:it.typeName,class:"tok-typeName"},{tag:it.namespace,class:"tok-namespace"},{tag:it.className,class:"tok-className"},{tag:it.macroName,class:"tok-macroName"},{tag:it.propertyName,class:"tok-propertyName"},{tag:it.operator,class:"tok-operator"},{tag:it.comment,class:"tok-comment"},{tag:it.meta,class:"tok-meta"},{tag:it.invalid,class:"tok-invalid"},{tag:it.punctuation,class:"tok-punctuation"}]);var fh;const Ec=new mt,GT=new mt;class ar{constructor(e,n,r=[],s=""){this.data=e,this.name=s,vt.prototype.hasOwnProperty("tree")||Object.defineProperty(vt.prototype,"tree",{get(){return Kr(this)}}),this.parser=n,this.extension=[xl.of(this),vt.languageData.of((a,c,d)=>{let f=px(a,c,d),h=f.type.prop(Ec);if(!h)return[];let g=a.facet(h),b=f.type.prop(GT);if(b){let v=f.resolve(c-f.from,d);for(let S of b)if(S.test(v,a)){let A=a.facet(S.facet);return S.type=="replace"?A:A.concat(g)}}return g})].concat(r)}isActiveAt(e,n,r=-1){return px(e,n,r).type.prop(Ec)==this.data}findRegions(e){let n=e.facet(xl);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],s=(a,c)=>{if(a.prop(Ec)==this.data){r.push({from:c,to:c+a.length});return}let d=a.prop(mt.mounted);if(d){if(d.tree.prop(Ec)==this.data){if(d.overlay)for(let f of d.overlay)r.push({from:f.from+c,to:f.to+c});else r.push({from:c,to:c+a.length});return}else if(d.overlay){let f=r.length;if(s(d.tree,d.overlay[0].from+c),r.length>f)return}}for(let f=0;f<a.children.length;f++){let h=a.children[f];h instanceof hn&&s(h,a.positions[f]+c)}};return s(Kr(e),0),r}get allowsNesting(){return!0}}ar.setState=zt.define();function px(t,e,n){let r=t.facet(xl),s=Kr(t).topNode;if(!r||r.allowsNesting)for(let a=s;a;a=a.enter(e,n,Ht.ExcludeBuffers|Ht.EnterBracketed))a.type.isTop&&(s=a);return s}function Kr(t){let e=t.field(ar.state,!1);return e?e.tree:hn.empty}class XT{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 Da=null;class Oc{constructor(e,n,r=[],s,a,c,d,f){this.parser=e,this.state=n,this.fragments=r,this.tree=s,this.treeLen=a,this.viewport=c,this.skipped=d,this.scheduleOn=f,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Oc(e,n,[],hn.empty,0,r,[],null)}startParse(){return this.parser.startParse(new XT(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=hn.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}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 s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(_s.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=s,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(_s.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Da;Da=this;try{return e()}finally{Da=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=mx(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:s,treeLen:a,viewport:c,skipped:d}=this;if(this.takeTree(),!e.empty){let f=[];if(e.iterChangedRanges((h,g,b,v)=>f.push({fromA:h,toA:g,fromB:b,toB:v})),r=_s.applyChanges(r,f),s=hn.empty,a=0,c={from:e.mapPos(c.from,-1),to:e.mapPos(c.to,1)},this.skipped.length){d=[];for(let h of this.skipped){let g=e.mapPos(h.from,1),b=e.mapPos(h.to,-1);g<b&&d.push({from:g,to:b})}}}return new Oc(this.parser,n,r,s,a,c,d,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:s,to:a}=this.skipped[r];s<e.to&&a>e.from&&(this.fragments=mx(this.fragments,s,a),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 zT{createParse(n,r,s){let a=s[0].from,c=s[s.length-1].to;return{parsedPos:a,advance(){let f=Da;if(f){for(let h of s)f.tempSkipped.push(h);e&&(f.scheduleOn=f.scheduleOn?Promise.all([f.scheduleOn,e]):e)}return this.parsedPos=c,new hn(ci.none,[],[],c-a)},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 Da}}function mx(t,e,n){return _s.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class bl{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 bl(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=Oc.create(e.facet(xl).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new bl(r)}}ar.state=Br.define({create:bl.init,update(t,e){for(let n of e.effects)if(n.is(ar.setState))return n.value;return e.startState.facet(xl)!=e.state.facet(xl)?bl.init(e.state):t.apply(e)}});let gx=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(gx=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const hh=typeof navigator<"u"&&(!((fh=navigator.scheduling)===null||fh===void 0)&&fh.isInputPending)?()=>navigator.scheduling.isInputPending():null,JT=sr.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(ar.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(ar.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=gx(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:s}}=this.view,a=r.field(ar.state);if(a.tree==a.context.tree&&a.context.isDone(s+1e5))return;let c=Date.now()+Math.min(this.chunkBudget,100,e&&!hh?Math.max(25,e.timeRemaining()-5):1e9),d=a.context.treeLen<s&&r.doc.length>s+1e3,f=a.context.work(()=>hh&&hh()||Date.now()>c,s+(d?0:1e5));this.chunkBudget-=Date.now()-n,(f||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:ar.setState.of(new bl(a.context))})),this.chunkBudget>0&&!(f&&!d)&&this.scheduleWork(),this.checkAsyncSchedule(a.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Vi(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()}}}),xl=He.define({combine(t){return t.length?t[0]:null},enables:t=>[ar.state,JT,Ye.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),QT=He.define(),ph=He.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 Mc(t){let e=t.facet(ph);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Rc(t,e){let n="",r=t.tabSize,s=t.facet(ph)[0];if(s==" "){for(;e>=r;)n+=" ",e-=r;s=" "}for(let a=0;a<e;a++)n+=s;return n}function yx(t,e){t instanceof vt&&(t=new Dc(t));for(let r of t.state.facet(QT)){let s=r(t,e);if(s!==void 0)return s}let n=Kr(t.state);return n.length>=e?ZT(t,n,e):null}class Dc{constructor(e,n={}){this.state=e,this.options=n,this.unit=Mc(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:a}=this.options;return s!=null&&s>=r.from&&s<=r.to?a&&s==e?{text:"",from:e}:(n<0?s<e:s<=e)?{text:r.text.slice(s-r.from),from:s}:{text:r.text.slice(0,s-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:s}=this.lineAt(e,n);return r.slice(e-s,Math.min(r.length,e+100-s))}column(e,n=1){let{text:r,from:s}=this.lineAt(e,n),a=this.countColumn(r,e-s),c=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return c>-1&&(a+=c-this.countColumn(r,r.search(/\S|$/))),a}countColumn(e,n=e.length){return Yo(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:s}=this.lineAt(e,n),a=this.options.overrideIndentation;if(a){let c=a(s);if(c>-1)return c}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const WT=new mt;function ZT(t,e,n){let r=e.resolveStack(n),s=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(s!=r.node){let a=[];for(let c=s;c&&!(c.from<r.node.from||c.to>r.node.to||c.from==r.node.from&&c.type==r.node.type);c=c.parent)a.push(c);for(let c=a.length-1;c>=0;c--)r={node:a[c],next:r}}return bx(r,t,n)}function bx(t,e,n){for(let r=t;r;r=r.next){let s=tj(r.node);if(s)return s(mh.create(e,n,r))}return 0}function ej(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function tj(t){let e=t.type.prop(WT);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(mt.closedBy))){let s=t.lastChild,a=s&&r.indexOf(s.name)>-1;return c=>sj(c,!0,1,void 0,a&&!ej(c)?s.from:void 0)}return t.parent==null?nj:null}function nj(){return 0}class mh extends Dc{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 mh(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(ij(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return bx(this.context.next,this.base,this.pos)}}function ij(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function rj(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let s=t.options.simulateBreak,a=t.state.doc.lineAt(n.from),c=s==null||s<=a.from?a.to:Math.min(a.to,s);for(let d=n.to;;){let f=e.childAfter(d);if(!f||f==r)return null;if(!f.type.isSkipped){if(f.from>=c)return null;let h=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+h}}d=f.to}}function sj(t,e,n,r,s){let a=t.textAfter,c=a.match(/^\s*/)[0].length,d=r&&a.slice(c,c+r.length)==r||s==t.pos+c,f=rj(t);return f?d?t.column(f.from):t.column(f.to):t.baseIndent+(d?0:t.unit*n)}const lj=1e4,aj="()[]{}",oj=new mt;function gh(t,e,n){let r=t.prop(e<0?mt.openedBy:mt.closedBy);if(r)return r;if(t.name.length==1){let s=n.indexOf(t.name);if(s>-1&&s%2==(e<0?1:0))return[n[s+e]]}return null}function yh(t){let e=t.type.prop(oj);return e?e(t.node):t}function vl(t,e,n,r={}){let s=r.maxScanDistance||lj,a=r.brackets||aj,c=Kr(t),d=c.resolveInner(e,n);for(let f=d;f;f=f.parent){let h=gh(f.type,n,a);if(h&&f.from<f.to){let g=yh(f);if(g&&(n>0?e>=g.from&&e<g.to:e>g.from&&e<=g.to))return cj(t,e,n,f,g,h,a)}}return uj(t,e,n,c,d.type,s,a)}function cj(t,e,n,r,s,a,c){let d=r.parent,f={from:s.from,to:s.to},h=0,g=d?.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(h==0&&a.indexOf(g.type.name)>-1&&g.from<g.to){let b=yh(g);return{start:f,end:b?{from:b.from,to:b.to}:void 0,matched:!0}}else if(gh(g.type,n,c))h++;else if(gh(g.type,-n,c)){if(h==0){let b=yh(g);return{start:f,end:b&&b.from<b.to?{from:b.from,to:b.to}:void 0,matched:!1}}h--}}while(n<0?g.prevSibling():g.nextSibling());return{start:f,matched:!1}}function uj(t,e,n,r,s,a,c){if(n<0?!e:e==t.doc.length)return null;let d=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),f=c.indexOf(d);if(f<0||f%2==0!=n>0)return null;let h={from:n<0?e-1:e,to:n>0?e+1:e},g=t.doc.iterRange(e,n>0?t.doc.length:0),b=0;for(let v=0;!g.next().done&&v<=a;){let S=g.value;n<0&&(v+=S.length);let A=e+v*n;for(let C=n>0?0:S.length-1,T=n>0?S.length:-1;C!=T;C+=n){let D=c.indexOf(S[C]);if(!(D<0||r.resolveInner(A+C,1).type!=s))if(D%2==0==n>0)b++;else{if(b==1)return{start:h,end:{from:A+C,to:A+C+1},matched:D>>1==f>>1};b--}}n>0&&(v+=S.length)}return g.done?{start:h,matched:!1}:null}const dj=Object.create(null),xx=[ci.none],vx=[],wx=Object.create(null),fj=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"]])fj[t]=hj(dj,e);function bh(t,e){vx.indexOf(t)>-1||(vx.push(t),console.warn(e))}function hj(t,e){let n=[];for(let d of e.split(" ")){let f=[];for(let h of d.split(".")){let g=t[h]||it[h];g?typeof g=="function"?f.length?f=f.map(g):bh(h,`Modifier ${h} used at start of tag`):f.length?bh(h,`Tag ${h} used as modifier`):f=Array.isArray(g)?g:[g]:bh(h,`Unknown highlighting tag ${h}`)}for(let h of f)n.push(h)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),s=r+" "+n.map(d=>d.id),a=wx[s];if(a)return a.id;let c=wx[s]=ci.define({id:xx.length,name:r,props:[PT({[r]:n})]});return xx.push(c),c.id}Rt.RTL,Rt.LTR;const pj=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=vh(t.state,n.from);return r.line?mj(t):r.block?yj(t):!1};function xh(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let s=t(e,n);return s?(r(n.update(s)),!0):!1}}const mj=xh(vj,0),gj=xh(Sx,0),yj=xh((t,e)=>Sx(t,e,xj(e)),0);function vh(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const _a=50;function bj(t,{open:e,close:n},r,s){let a=t.sliceDoc(r-_a,r),c=t.sliceDoc(s,s+_a),d=/\s*$/.exec(a)[0].length,f=/^\s*/.exec(c)[0].length,h=a.length-d;if(a.slice(h-e.length,h)==e&&c.slice(f,f+n.length)==n)return{open:{pos:r-d,margin:d&&1},close:{pos:s+f,margin:f&&1}};let g,b;s-r<=2*_a?g=b=t.sliceDoc(r,s):(g=t.sliceDoc(r,r+_a),b=t.sliceDoc(s-_a,s));let v=/^\s*/.exec(g)[0].length,S=/\s*$/.exec(b)[0].length,A=b.length-S-n.length;return g.slice(v,v+e.length)==e&&b.slice(A,A+n.length)==n?{open:{pos:r+v+e.length,margin:/\s/.test(g.charAt(v+e.length))?1:0},close:{pos:s-S-n.length,margin:/\s/.test(b.charAt(A-1))?1:0}}:null}function xj(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),s=n.to<=r.to?r:t.doc.lineAt(n.to);s.from>r.from&&s.from==n.to&&(s=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let a=e.length-1;a>=0&&e[a].to>r.from?e[a].to=s.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:s.to})}return e}function Sx(t,e,n=e.selection.ranges){let r=n.map(a=>vh(e,a.from).block);if(!r.every(a=>a))return null;let s=n.map((a,c)=>bj(e,r[c],a.from,a.to));if(t!=2&&!s.every(a=>a))return{changes:e.changes(n.map((a,c)=>s[c]?[]:[{from:a.from,insert:r[c].open+" "},{from:a.to,insert:" "+r[c].close}]))};if(t!=1&&s.some(a=>a)){let a=[];for(let c=0,d;c<s.length;c++)if(d=s[c]){let f=r[c],{open:h,close:g}=d;a.push({from:h.pos-f.open.length,to:h.pos+h.margin},{from:g.pos-g.margin,to:g.pos+f.close.length})}return{changes:a}}return null}function vj(t,e,n=e.selection.ranges){let r=[],s=-1;e:for(let{from:a,to:c}of n){let d=r.length,f=1e9,h;for(let g=a;g<=c;){let b=e.doc.lineAt(g);if(h==null&&(h=vh(e,b.from).line,!h))continue e;if(b.from>s&&(a==c||c>b.from)){s=b.from;let v=/^\s*/.exec(b.text)[0].length,S=v==b.length,A=b.text.slice(v,v+h.length)==h?v:-1;v<b.text.length&&v<f&&(f=v),r.push({line:b,comment:A,token:h,indent:v,empty:S,single:!1})}g=b.to+1}if(f<1e9)for(let g=d;g<r.length;g++)r[g].indent<r[g].line.text.length&&(r[g].indent=f);r.length==d+1&&(r[d].single=!0)}if(t!=2&&r.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:d,token:f,indent:h,empty:g,single:b}of r)(b||!g)&&a.push({from:d.from+h,insert:f+" "});let c=e.changes(a);return{changes:c,selection:e.selection.map(c,1)}}else if(t!=1&&r.some(a=>a.comment>=0)){let a=[];for(let{line:c,comment:d,token:f}of r)if(d>=0){let h=c.from+d,g=h+f.length;c.text[g-c.from]==" "&&g++,a.push({from:h,to:g})}return{changes:a}}return null}const wh=$r.define(),wj=$r.define(),Sj=He.define(),Ax=He.define({combine(t){return uf(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,s)=>e(r,s)||n(r,s)})}}),kx=Br.define({create(){return Xi.empty},update(t,e){let n=e.state.facet(Ax),r=e.annotation(wh);if(r){let f=$n.fromTransaction(e,r.selection),h=r.side,g=h==0?t.undone:t.done;return f?g=Lc(g,g.length,n.minDepth,f):g=Tx(g,e.startState.selection),new Xi(h==0?r.rest:g,h==0?g:r.rest)}let s=e.annotation(wj);if((s=="full"||s=="before")&&(t=t.isolate()),e.annotation(en.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let a=$n.fromTransaction(e),c=e.annotation(en.time),d=e.annotation(en.userEvent);return a?t=t.addChanges(a,c,d,n,e):e.selection&&(t=t.addSelection(e.startState.selection,c,d,n.newGroupDelay)),(s=="full"||s=="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 Xi(t.done.map($n.fromJSON),t.undone.map($n.fromJSON))}});function Aj(t={}){return[kx,Ax.of(t),Ye.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?Cx:e.inputType=="historyRedo"?Sh:null;return r?(e.preventDefault(),r(n)):!1}})]}function _c(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let s=n.field(kx,!1);if(!s)return!1;let a=s.pop(t,n,e);return a?(r(a),!0):!1}}const Cx=_c(0,!1),Sh=_c(1,!1),kj=_c(0,!0),Cj=_c(1,!0);class $n{constructor(e,n,r,s,a){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=s,this.selectionsAfter=a}setSelAfter(e){return new $n(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(s=>s.toJSON())}}static fromJSON(e){return new $n(e.changes&&Zt.fromJSON(e.changes),[],e.mapped&&Ii.fromJSON(e.mapped),e.startSelection&&Ce.fromJSON(e.startSelection),e.selectionsAfter.map(Ce.fromJSON))}static fromTransaction(e,n){let r=fi;for(let s of e.startState.facet(Sj)){let a=s(e);a.length&&(r=r.concat(a))}return!r.length&&e.changes.empty?null:new $n(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,fi)}static selection(e){return new $n(void 0,fi,void 0,void 0,e)}}function Lc(t,e,n,r){let s=e+1>n+20?e-n-1:0,a=t.slice(s,e);return a.push(r),a}function Nj(t,e){let n=[],r=!1;return t.iterChangedRanges((s,a)=>n.push(s,a)),e.iterChangedRanges((s,a,c,d)=>{for(let f=0;f<n.length;){let h=n[f++],g=n[f++];d>=h&&c<=g&&(r=!0)}}),r}function Tj(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function Nx(t,e){return t.length?e.length?t.concat(e):t:e}const fi=[],jj=200;function Tx(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-jj));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),Lc(t,t.length-1,1e9,n.setSelAfter(r)))}else return[$n.selection([e])]}function Ej(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 Ah(t,e){if(!t.length)return t;let n=t.length,r=fi;for(;n;){let s=Oj(t[n-1],e,r);if(s.changes&&!s.changes.empty||s.effects.length){let a=t.slice(0,n);return a[n-1]=s,a}else e=s.mapped,n--,r=s.selectionsAfter}return r.length?[$n.selection(r)]:fi}function Oj(t,e,n){let r=Nx(t.selectionsAfter.length?t.selectionsAfter.map(d=>d.map(e)):fi,n);if(!t.changes)return $n.selection(r);let s=t.changes.map(e),a=e.mapDesc(t.changes,!0),c=t.mapped?t.mapped.composeDesc(a):a;return new $n(s,zt.mapEffects(t.effects,e),c,t.startSelection.map(a),r)}const Mj=/^(input\.type|delete)($|\.)/;class Xi{constructor(e,n,r=0,s=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new Xi(this.done,this.undone):this}addChanges(e,n,r,s,a){let c=this.done,d=c[c.length-1];return d&&d.changes&&!d.changes.empty&&e.changes&&(!r||Mj.test(r))&&(!d.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,Nj(d.changes,e.changes))||r=="input.type.compose")?c=Lc(c,c.length-1,s.minDepth,new $n(e.changes.compose(d.changes),Nx(zt.mapEffects(e.effects,d.changes),d.effects),d.mapped,d.startSelection,fi)):c=Lc(c,c.length,s.minDepth,e),new Xi(c,fi,n,r)}addSelection(e,n,r,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:fi;return a.length>0&&n-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Tj(a[a.length-1],e)?this:new Xi(Tx(this.done,e),this.undone,n,r)}addMapping(e){return new Xi(Ah(this.done,e),Ah(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let s=e==0?this.done:this.undone;if(s.length==0)return null;let a=s[s.length-1],c=a.selectionsAfter[0]||(a.startSelection?a.startSelection.map(a.changes.invertedDesc,1):n.selection);if(r&&a.selectionsAfter.length)return n.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:wh.of({side:e,rest:Ej(s),selection:c}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let d=s.length==1?fi:s.slice(0,s.length-1);return a.mapped&&(d=Ah(d,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:wh.of({side:e,rest:d,selection:c}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Xi.empty=new Xi(fi,fi);const jx=[{key:"Mod-z",run:Cx,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Sh,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Sh,preventDefault:!0},{key:"Mod-u",run:kj,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Cj,preventDefault:!0}];function wl(t,e){return Ce.create(t.ranges.map(e),t.mainIndex)}function Mi(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Ri({state:t,dispatch:e},n){let r=wl(t.selection,n);return r.eq(t.selection,!0)?!1:(e(Mi(t,r)),!0)}function Bc(t,e){return Ce.cursor(e?t.to:t.from)}function Ex(t,e){return Ri(t,n=>n.empty?t.moveByChar(n,e):Bc(n,e))}function kn(t){return t.textDirectionAt(t.state.selection.main.head)==Rt.LTR}const Ox=t=>Ex(t,!kn(t)),Mx=t=>Ex(t,kn(t));function Rx(t,e){return Ri(t,n=>n.empty?t.moveByGroup(n,e):Bc(n,e))}const Rj=t=>Rx(t,!kn(t)),Dj=t=>Rx(t,kn(t));function _j(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 $c(t,e,n){let r=Kr(t).resolveInner(e.head),s=n?mt.closedBy:mt.openedBy;for(let f=e.head;;){let h=n?r.childAfter(f):r.childBefore(f);if(!h)break;_j(t,h,s)?r=h:f=n?h.to:h.from}let a=r.type.prop(s),c,d;return a&&(c=n?vl(t,r.from,1):vl(t,r.to,-1))&&c.matched?d=n?c.end.to:c.end.from:d=n?r.to:r.from,Ce.cursor(d,n?-1:1)}const Lj=t=>Ri(t,e=>$c(t.state,e,!kn(t))),Bj=t=>Ri(t,e=>$c(t.state,e,kn(t)));function Dx(t,e){return Ri(t,n=>{if(!n.empty)return Bc(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const _x=t=>Dx(t,!1),Lx=t=>Dx(t,!0);function Bx(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,s;if(e){for(let a of t.state.facet(Ye.scrollMargins)){let c=a(t);c?.top&&(n=Math.max(c?.top,n)),c?.bottom&&(r=Math.max(c?.bottom,r))}s=t.scrollDOM.clientHeight-n-r}else s=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,s-5)}}function $x(t,e){let n=Bx(t),{state:r}=t,s=wl(r.selection,c=>c.empty?t.moveVertically(c,e,n.height):Bc(c,e));if(s.eq(r.selection))return!1;let a;if(n.selfScroll){let c=t.coordsAtPos(r.selection.main.head),d=t.scrollDOM.getBoundingClientRect(),f=d.top+n.marginTop,h=d.bottom-n.marginBottom;c&&c.top>f&&c.bottom<h&&(a=Ye.scrollIntoView(s.main.head,{y:"start",yMargin:c.top-f}))}return t.dispatch(Mi(r,s),{effects:a}),!0}const qx=t=>$x(t,!1),kh=t=>$x(t,!0);function Yr(t,e,n){let r=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,n);if(s.head==e.head&&s.head!=(n?r.to:r.from)&&(s=t.moveToLineBoundary(e,n,!1)),!n&&s.head==r.from&&r.length){let a=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;a&&e.head!=r.from+a&&(s=Ce.cursor(r.from+a))}return s}const $j=t=>Ri(t,e=>Yr(t,e,!0)),qj=t=>Ri(t,e=>Yr(t,e,!1)),zj=t=>Ri(t,e=>Yr(t,e,!kn(t))),Hj=t=>Ri(t,e=>Yr(t,e,kn(t))),Ij=t=>Ri(t,e=>Ce.cursor(t.lineBlockAt(e.head).from,1)),Uj=t=>Ri(t,e=>Ce.cursor(t.lineBlockAt(e.head).to,-1));function Fj(t,e,n){let r=!1,s=wl(t.selection,a=>{let c=vl(t,a.head,-1)||vl(t,a.head,1)||a.head>0&&vl(t,a.head-1,1)||a.head<t.doc.length&&vl(t,a.head+1,-1);if(!c||!c.end)return a;r=!0;let d=c.start.from==a.head?c.end.to:c.end.from;return Ce.cursor(d)});return r?(e(Mi(t,s)),!0):!1}const Vj=({state:t,dispatch:e})=>Fj(t,e);function hi(t,e,n){let r=wl(t.state.selection,s=>{s.undirectional&&s.head>=s.anchor!=e&&(s=Ce.range(s.head,s.anchor));let a=n(s);return Ce.range(s.anchor,a.head,a.goalColumn,a.bidiLevel||void 0,a.assoc)});return r.eq(t.state.selection)?!1:(t.dispatch(Mi(t.state,r)),!0)}function zx(t,e){return hi(t,e,n=>t.moveByChar(n,e))}const Hx=t=>zx(t,!kn(t)),Ix=t=>zx(t,kn(t));function Ux(t,e){return hi(t,e,n=>t.moveByGroup(n,e))}const Pj=t=>Ux(t,!kn(t)),Kj=t=>Ux(t,kn(t)),Yj=t=>{let e=!kn(t);return hi(t,e,n=>$c(t.state,n,e))},Gj=t=>{let e=kn(t);return hi(t,e,n=>$c(t.state,n,e))};function Fx(t,e){return hi(t,e,n=>t.moveVertically(n,e))}const Vx=t=>Fx(t,!1),Px=t=>Fx(t,!0);function Kx(t,e){return hi(t,e,n=>t.moveVertically(n,e,Bx(t).height))}const Yx=t=>Kx(t,!1),Gx=t=>Kx(t,!0),Xj=t=>hi(t,!0,e=>Yr(t,e,!0)),Jj=t=>hi(t,!1,e=>Yr(t,e,!1)),Qj=t=>{let e=!kn(t);return hi(t,e,n=>Yr(t,n,e))},Wj=t=>{let e=kn(t);return hi(t,e,n=>Yr(t,n,e))},Zj=t=>hi(t,!1,e=>Ce.cursor(t.lineBlockAt(e.head).from)),eE=t=>hi(t,!0,e=>Ce.cursor(t.lineBlockAt(e.head).to)),Xx=({state:t,dispatch:e})=>(e(Mi(t,{anchor:0})),!0),Jx=({state:t,dispatch:e})=>(e(Mi(t,{anchor:t.doc.length})),!0),Qx=({state:t,dispatch:e})=>(e(Mi(t,{anchor:t.selection.main.anchor,head:0})),!0),Wx=({state:t,dispatch:e})=>(e(Mi(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),tE=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),nE=({state:t,dispatch:e})=>{let n=zc(t).map(({from:r,to:s})=>Ce.undirectionalRange(r,Math.min(s+1,t.doc.length)));return e(t.update({selection:Ce.create(n),userEvent:"select"})),!0},iE=({state:t,dispatch:e})=>{let n=wl(t.selection,r=>{let s=Kr(t),a=s.resolveStack(r.from,1);if(r.empty){let c=s.resolveStack(r.from,-1);c.node.from>=a.node.from&&c.node.to<=a.node.to&&(a=c)}for(let c=a;c;c=c.next){let{node:d}=c;if((d.from<r.from&&d.to>=r.to||d.to>r.to&&d.from<=r.from)&&c.next)return Ce.undirectionalRange(d.from,d.to)}return r});return n.eq(t.selection)?!1:(e(Mi(t,n)),!0)};function Zx(t,e){let{state:n}=t,r=n.selection,s=n.selection.ranges.slice();for(let a of n.selection.ranges){let c=n.doc.lineAt(a.head);if(e?c.to<t.state.doc.length:c.from>0)for(let d=a;;){let f=t.moveVertically(d,e);if(f.head<c.from||f.head>c.to){s.some(h=>h.head==f.head)||s.push(f);break}else{if(f.head==d.head)break;d=f}}}return s.length==r.ranges.length?!1:(t.dispatch(Mi(n,Ce.create(s,s.length-1))),!0)}const rE=t=>Zx(t,!1),sE=t=>Zx(t,!0),lE=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Ce.create([n.main]):n.main.empty||(r=Ce.create([Ce.cursor(n.main.head)])),r?(e(Mi(t,r)),!0):!1};function La(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,s=r.changeByRange(a=>{let{from:c,to:d}=a;if(c==d){let f=e(a);f<c?(n="delete.backward",f=qc(t,f,!1)):f>c&&(n="delete.forward",f=qc(t,f,!0)),c=Math.min(c,f),d=Math.max(d,f)}else c=qc(t,c,!1),d=qc(t,d,!0);return c==d?{range:a}:{changes:{from:c,to:d},range:Ce.cursor(c,c<a.head?-1:1)}});return s.changes.empty?!1:(t.dispatch(r.update(s,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Ye.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function qc(t,e,n){if(t instanceof Ye)for(let r of t.state.facet(Ye.atomicRanges).map(s=>s(t)))r.between(e,e,(s,a)=>{s<e&&a>e&&(e=n?a:s)});return e}const ev=(t,e,n)=>La(t,r=>{let s=r.from,{state:a}=t,c=a.doc.lineAt(s),d,f;if(n&&!e&&s>c.from&&s<c.from+200&&!/[^ \t]/.test(d=c.text.slice(0,s-c.from))){if(d[d.length-1]==" ")return s-1;let h=Yo(d,a.tabSize),g=h%Mc(a)||Mc(a);for(let b=0;b<g&&d[d.length-1-b]==" ";b++)s--;f=s}else f=Sn(c.text,s-c.from,e,e)+c.from,f==s&&c.number!=(e?a.doc.lines:1)?f+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(c.text.slice(f-c.from,s-c.from))&&(f=Sn(c.text,f-c.from,!1,!1)+c.from);return f}),Ch=t=>ev(t,!1,!0),tv=t=>ev(t,!0,!1),nv=(t,e)=>La(t,n=>{let r=n.head,{state:s}=t,a=s.doc.lineAt(r),c=s.charCategorizer(r);for(let d=null;;){if(r==(e?a.to:a.from)){r==n.head&&a.number!=(e?s.doc.lines:1)&&(r+=e?1:-1);break}let f=Sn(a.text,r-a.from,e)+a.from,h=a.text.slice(Math.min(r,f)-a.from,Math.max(r,f)-a.from),g=c(h);if(d!=null&&g!=d)break;(h!=" "||r!=n.head)&&(d=g),r=f}return r}),iv=t=>nv(t,!1),aE=t=>nv(t,!0),oE=t=>La(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),cE=t=>La(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),uE=t=>La(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),dE=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:pt.of(["",""])},range:Ce.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},fE=({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 s=r.from,a=t.doc.lineAt(s),c=s==a.from?s-1:Sn(a.text,s-a.from,!1)+a.from,d=s==a.to?s+1:Sn(a.text,s-a.from,!0)+a.from;return{changes:{from:c,to:d,insert:t.doc.slice(s,d).append(t.doc.slice(c,s))},range:Ce.cursor(d)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function zc(t){let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.from),a=t.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=t.doc.lineAt(r.to-1)),n>=s.number){let c=e[e.length-1];c.to=a.to,c.ranges.push(r)}else e.push({from:s.from,to:a.to,ranges:[r]});n=a.number+1}return e}function rv(t,e,n){if(t.readOnly)return!1;let r=[],s=[];for(let a of zc(t)){if(n?a.to==t.doc.length:a.from==0)continue;let c=t.doc.lineAt(n?a.to+1:a.from-1),d=c.length+1;if(n){r.push({from:a.to,to:c.to},{from:a.from,insert:c.text+t.lineBreak});for(let f of a.ranges)s.push(Ce.range(Math.min(t.doc.length,f.anchor+d),Math.min(t.doc.length,f.head+d)))}else{r.push({from:c.from,to:a.from},{from:a.to,insert:t.lineBreak+c.text});for(let f of a.ranges)s.push(Ce.range(f.anchor-d,f.head-d))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Ce.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const hE=({state:t,dispatch:e})=>rv(t,e,!1),pE=({state:t,dispatch:e})=>rv(t,e,!0);function sv(t,e,n){if(t.readOnly)return!1;let r=[];for(let a of zc(t))n?r.push({from:a.from,insert:t.doc.slice(a.from,a.to)+t.lineBreak}):r.push({from:a.to,insert:t.lineBreak+t.doc.slice(a.from,a.to)});let s=t.changes(r);return e(t.update({changes:s,selection:t.selection.map(s,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const mE=({state:t,dispatch:e})=>sv(t,e,!1),gE=({state:t,dispatch:e})=>sv(t,e,!0),yE=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(zc(e).map(({from:s,to:a})=>(s>0?s--:a<e.doc.length&&a++,{from:s,to:a}))),r=wl(e.selection,s=>{let a;if(t.lineWrapping){let c=t.lineBlockAt(s.head),d=t.coordsAtPos(s.head,s.assoc||1);d&&(a=c.bottom+t.documentTop-d.bottom+t.defaultLineHeight/2)}return t.moveVertically(s,!0,a)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function bE(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Kr(t).resolveInner(e),r=n.childBefore(e),s=n.childAfter(e),a;return r&&s&&r.to<=e&&s.from>=e&&(a=r.type.prop(mt.closedBy))&&a.indexOf(s.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(s.from).from&&!/\S/.test(t.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const lv=av(!1),xE=av(!0);function av(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(s=>{let{from:a,to:c}=s,d=e.doc.lineAt(a),f=!t&&a==c&&bE(e,a);t&&(a=c=(c<=d.to?d:e.doc.lineAt(c)).to);let h=new Dc(e,{simulateBreak:a,simulateDoubleBreak:!!f}),g=yx(h,a);for(g==null&&(g=Yo(/^\s*/.exec(e.doc.lineAt(a).text)[0],e.tabSize));c<d.to&&/\s/.test(d.text[c-d.from]);)c++;f?{from:a,to:c}=f:a>d.from&&a<d.from+100&&!/\S/.test(d.text.slice(0,a))&&(a=d.from);let b=["",Rc(e,g)];return f&&b.push(Rc(e,h.lineIndent(d.from,-1))),{changes:{from:a,to:c,insert:pt.of(b)},range:Ce.cursor(a+1+b[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Nh(t,e){let n=-1;return t.changeByRange(r=>{let s=[];for(let c=r.from;c<=r.to;){let d=t.doc.lineAt(c);d.number>n&&(r.empty||r.to>d.from)&&(e(d,s,r),n=d.number),c=d.to+1}let a=t.changes(s);return{changes:s,range:Ce.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const vE=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Dc(t,{overrideIndentation:a=>{let c=n[a];return c??-1}}),s=Nh(t,(a,c,d)=>{let f=yx(r,a.from);if(f==null)return;/\S/.test(a.text)||(f=0);let h=/^\s*/.exec(a.text)[0],g=Rc(t,f);(h!=g||d.from<a.from+h.length)&&(n[a.from]=f,c.push({from:a.from,to:a.from+h.length,insert:g}))});return s.changes.empty||e(t.update(s,{userEvent:"indent"})),!0},ov=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Nh(t,(n,r)=>{r.push({from:n.from,insert:t.facet(ph)})}),{userEvent:"input.indent"})),!0),cv=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Nh(t,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let a=Yo(s,t.tabSize),c=0,d=Rc(t,Math.max(0,a-Mc(t)));for(;c<s.length&&c<d.length&&s.charCodeAt(c)==d.charCodeAt(c);)c++;r.push({from:n.from+c,to:n.from+s.length,insert:d.slice(c)})}),{userEvent:"delete.dedent"})),!0),wE=t=>(t.setTabFocusMode(),!0),SE=[{key:"Ctrl-b",run:Ox,shift:Hx,preventDefault:!0},{key:"Ctrl-f",run:Mx,shift:Ix},{key:"Ctrl-p",run:_x,shift:Vx},{key:"Ctrl-n",run:Lx,shift:Px},{key:"Ctrl-a",run:Ij,shift:Zj},{key:"Ctrl-e",run:Uj,shift:eE},{key:"Ctrl-d",run:tv},{key:"Ctrl-h",run:Ch},{key:"Ctrl-k",run:oE},{key:"Ctrl-Alt-h",run:iv},{key:"Ctrl-o",run:dE},{key:"Ctrl-t",run:fE},{key:"Ctrl-v",run:kh}],AE=[{key:"ArrowLeft",run:Ox,shift:Hx,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Rj,shift:Pj,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:zj,shift:Qj,preventDefault:!0},{key:"ArrowRight",run:Mx,shift:Ix,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Dj,shift:Kj,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Hj,shift:Wj,preventDefault:!0},{key:"ArrowUp",run:_x,shift:Vx,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Xx,shift:Qx},{mac:"Ctrl-ArrowUp",run:qx,shift:Yx},{key:"ArrowDown",run:Lx,shift:Px,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Jx,shift:Wx},{mac:"Ctrl-ArrowDown",run:kh,shift:Gx},{key:"PageUp",run:qx,shift:Yx},{key:"PageDown",run:kh,shift:Gx},{key:"Home",run:qj,shift:Jj,preventDefault:!0},{key:"Mod-Home",run:Xx,shift:Qx},{key:"End",run:$j,shift:Xj,preventDefault:!0},{key:"Mod-End",run:Jx,shift:Wx},{key:"Enter",run:lv,shift:lv},{key:"Mod-a",run:tE},{key:"Backspace",run:Ch,shift:Ch,preventDefault:!0},{key:"Delete",run:tv,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:iv,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:aE,preventDefault:!0},{mac:"Mod-Backspace",run:cE,preventDefault:!0},{mac:"Mod-Delete",run:uE,preventDefault:!0}].concat(SE.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),uv=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Lj,shift:Yj},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Bj,shift:Gj},{key:"Alt-ArrowUp",run:hE},{key:"Shift-Alt-ArrowUp",run:mE},{key:"Alt-ArrowDown",run:pE},{key:"Shift-Alt-ArrowDown",run:gE},{key:"Mod-Alt-ArrowUp",run:rE},{key:"Mod-Alt-ArrowDown",run:sE},{key:"Escape",run:lE},{key:"Mod-Enter",run:xE},{key:"Alt-l",mac:"Ctrl-l",run:nE},{key:"Mod-i",run:iE,preventDefault:!0},{key:"Mod-[",run:cv},{key:"Mod-]",run:ov},{key:"Mod-Alt-\\",run:vE},{key:"Shift-Mod-k",run:yE},{key:"Shift-Mod-\\",run:Vj},{key:"Mod-/",run:pj},{key:"Alt-A",mac:"Ctrl-A",run:gj},{key:"Ctrl-m",mac:"Shift-Alt-m",run:wE}].concat(AE),kE={key:"Tab",run:ov,shift:cv};function dv({ariaLabel:t,dataTestId:e,ariaControls:n,ariaActiveDescendant:r,ariaAutocomplete:s,ariaExpanded:a}){const c={"aria-label":t,"aria-multiline":"true",role:"textbox",spellcheck:"false"};return e&&(c["data-testid"]=e),n&&(c["aria-controls"]=n),r&&(c["aria-activedescendant"]=r),s&&(c["aria-autocomplete"]=s),a!==void 0&&(c["aria-expanded"]=String(a)),c}function fv(t){const e=t==="dark";return Ye.theme({"&":{height:"100%",backgroundColor:e?"#030712":"#ffffff",color:e?"#f3f4f6":"#111827"},"&.cm-focused":{outline:"none"},".cm-scroller":{fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',fontSize:"12px",lineHeight:"24px",overflow:"auto"},".cm-content":{minHeight:"100%",padding:"8px 12px",caretColor:e?"#f9fafb":"#111827"},".cm-line":{padding:"0"},".cm-cursor, .cm-dropCursor":{borderLeftColor:e?"#f9fafb":"#111827"},".cm-gutters":{backgroundColor:e?"#111827":"#f9fafb",color:e?"#6b7280":"#9ca3af",borderRight:`1px solid ${e?"#1f2937":"#e5e7eb"}`},".cm-activeLine":{backgroundColor:e?"#11182780":"#f3f4f680"},".cm-activeLineGutter":{backgroundColor:e?"#1f2937":"#f3f4f6"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, ::selection":{backgroundColor:e?"#1d4ed880":"#bfdbfe"}},{dark:e})}const CE={key:"Enter",run:t=>(t.dispatch(t.state.replaceSelection(`
|
|
59
|
+
`)),!0)};function hv(t){const e=uv.filter(n=>n.key!=="Enter");return Pb.of(t?[...uv,...jx,kE]:[CE,...e,...jx])}const Ba=I.forwardRef(({ariaLabel:t,value:e,onChange:n,language:r="text",theme:s="light",minLines:a=7,maxLines:c=16,dataTestId:d,wrap:f=!1,autoIndent:h=!1,ariaControls:g,ariaActiveDescendant:b,ariaAutocomplete:v,ariaExpanded:S,onEditorKeyDown:A,onCursorChange:C},T)=>{const D=I.useRef(null),j=I.useRef(null),E=I.useRef(n),O=I.useRef(C),R=I.useRef(A),B=I.useRef(!1),M=I.useRef({value:e,theme:s,wrap:f,autoIndent:h,ariaLabel:t,dataTestId:d,ariaControls:g,ariaActiveDescendant:b,ariaAutocomplete:v,ariaExpanded:S}),z=I.useMemo(()=>new tr,[]),F=I.useMemo(()=>new tr,[]),X=I.useMemo(()=>new tr,[]),W=I.useMemo(()=>new tr,[]),G=I.useMemo(()=>new tr,[]);E.current=n,O.current=C,R.current=A,I.useImperativeHandle(T,()=>({focus:()=>j.current?.focus(),getSelection:()=>{const ee=j.current?.state.selection.main;return ee?{from:ee.from,to:ee.to}:{from:0,to:0}},setSelection:(ee,he=ee)=>{const $=j.current;if(!$)return;const te=$.state.doc.length,L=Math.max(0,Math.min(ee,te)),P=Math.max(0,Math.min(he,te));$.dispatch({selection:{anchor:L,head:P},scrollIntoView:!0}),$.focus(),O.current?.(L)},coordsAtPos:ee=>{const he=j.current;if(!he)return null;const $=Math.max(0,Math.min(ee,he.state.doc.length)),te=he.coordsAtPos($);return te?{left:te.left,right:te.right,top:te.top,bottom:te.bottom}:null}}),[]),I.useEffect(()=>{if(!D.current||j.current)return;const ee=M.current,he=vt.create({doc:ee.value,extensions:[Aj(),mT(),z.of(fv(ee.theme)),F.of(ee.wrap?Ye.lineWrapping:[]),X.of(ee.wrap?[]:[ix(),sx(),Wb()]),W.of(hv(ee.autoIndent)),G.of(Ye.contentAttributes.of(dv(ee))),Uo.highest(Ye.domEventHandlers({keydown:te=>(R.current?.(te),te.defaultPrevented)})),Ye.updateListener.of(te=>{te.docChanged&&!B.current&&E.current(te.state.doc.toString()),(te.selectionSet||te.docChanged)&&O.current?.(te.state.selection.main.head)})]}),$=new Ye({state:he,parent:D.current});return j.current=$,()=>{$.destroy(),j.current=null}},[G,X,W,z,F]),I.useEffect(()=>{const ee=j.current;if(!ee||ee.state.doc.toString()===e)return;const he=ee.state.selection.main;B.current=!0,ee.dispatch({changes:{from:0,to:ee.state.doc.length,insert:e},selection:{anchor:Math.min(he.anchor,e.length),head:Math.min(he.head,e.length)}}),B.current=!1},[e]),I.useEffect(()=>{j.current?.dispatch({effects:z.reconfigure(fv(s))})},[s,z]),I.useEffect(()=>{j.current?.dispatch({effects:F.reconfigure(f?Ye.lineWrapping:[])}),j.current?.dispatch({effects:X.reconfigure(f?[]:[ix(),sx(),Wb()])})},[X,f,F]),I.useEffect(()=>{j.current?.dispatch({effects:W.reconfigure(hv(h))})},[h,W]),I.useEffect(()=>{j.current?.dispatch({effects:G.reconfigure(Ye.contentAttributes.of(dv({ariaLabel:t,dataTestId:d,ariaControls:g,ariaActiveDescendant:b,ariaAutocomplete:v,ariaExpanded:S})))})},[b,v,g,S,t,G,d]);const we=Math.max(1,e.split(`
|
|
60
|
+
`).length),xe=Math.min(c,Math.max(a,we))*24+16,_=s==="dark";return p.jsx("div",{className:`api-client-code-editor min-w-0 overflow-hidden rounded-md border focus-within:ring-2 focus-within:ring-inset focus-within:ring-blue-500 ${_?"border-gray-700 bg-gray-950":"border-gray-300 bg-white"}`,"data-editor":"codemirror","data-language":r,"data-wrap":f?"soft":"off",style:{height:xe},children:p.jsx("div",{ref:D,className:"h-full min-w-0"})})});Ba.displayName="ApiClientCodeEditor";const pv=()=>({key:"",value:"",enabled:!0}),Th=()=>({key:"",value:"",enabled:!0,type:"text"}),mv=[["application/json","JSON — application/json"],["application/problem+json","Problem JSON — application/problem+json"],["application/ld+json","JSON-LD — application/ld+json"],["text/plain","Text — text/plain"],["application/xml","XML — application/xml"],["text/html","HTML — text/html"],["application/javascript","JavaScript — application/javascript"],["application/octet-stream","Binary — application/octet-stream"]];function NE(t){const e=(t||"").toLowerCase();return e.includes("json")?"json":e.includes("xml")?"xml":e.includes("html")?"html":e.includes("javascript")?"javascript":"text"}function TE({label:t,entries:e,onChange:n,inputClass:r}){const s=(a,c)=>n(e.map((d,f)=>f===a?{...d,...c}:d));return p.jsxs("div",{className:"space-y-2",children:[e.map((a,c)=>p.jsxs("div",{className:"grid grid-cols-[auto_1fr_1fr_auto] items-center gap-2",children:[p.jsx("input",{"aria-label":`${t} ${c+1} enabled`,type:"checkbox",checked:a.enabled!==!1,onChange:d=>s(c,{enabled:d.target.checked})}),p.jsx("input",{"aria-label":`${t} ${c+1} key`,className:`min-w-0 rounded-md border px-3 py-2 text-sm ${r}`,placeholder:"Key",value:a.key,onChange:d=>s(c,{key:d.target.value})}),p.jsx("input",{"aria-label":`${t} ${c+1} value`,className:`min-w-0 rounded-md border px-3 py-2 text-sm ${r}`,placeholder:"Value",value:a.value,onChange:d=>s(c,{value:d.target.value})}),p.jsx("button",{type:"button","aria-label":`Remove ${t.toLowerCase()} ${c+1}`,className:"rounded-md border p-2",onClick:()=>n(e.filter((d,f)=>f!==c)),children:p.jsx(si,{className:"h-4 w-4"})})]},c)),p.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 rounded-md border px-3 py-2 text-xs",onClick:()=>n([...e,pv()]),children:[p.jsx(ks,{className:"h-3.5 w-3.5"})," Add field"]})]})}const jE=({draft:t,onChange:e,theme:n="light"})=>{const r=t.bodyMode||ca(t),s=n==="dark",a=s?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",d=mv.some(([v])=>v===t.contentType)?t.contentType||"application/json":"__custom__",f=I.useMemo(()=>{if(r!=="json"||!(t.body||"").trim())return null;try{return JSON.parse(t.body||""),""}catch(v){return v instanceof Error?v.message:"Invalid JSON"}},[t.body,r]),h=I.useMemo(()=>{const v=t.graphql?.variables?.trim();if(r!=="graphql"||!v)return null;try{return JSON.parse(v),""}catch(S){return S instanceof Error?S.message:"Invalid JSON"}},[t.graphql?.variables,r]),g=v=>{const S={bodyMode:v};v==="json"&&(!t.contentType||!t.contentType.includes("json"))&&(S.contentType="application/json"),v==="raw"&&!t.contentType&&(S.contentType="text/plain"),v==="urlencoded"&&(S.contentType="application/x-www-form-urlencoded"),v==="formdata"&&(S.contentType=void 0),v==="binary"&&!t.contentType&&(S.contentType="application/octet-stream"),v==="graphql"&&(S.contentType="application/json"),e({...t,...S})},b=(v,S)=>{const A=t.formData||[Th()];e({...t,formData:A.map((C,T)=>T===v?{...C,...S}:C)})};return p.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-body-heading",children:[p.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[p.jsxs("label",{className:"text-sm font-medium",children:["Body type",p.jsxs("select",{"aria-label":"Request body type",className:`ml-2 rounded-md border px-3 py-2 text-sm ${a}`,value:r,onChange:v=>g(v.target.value),children:[p.jsx("option",{value:"none",children:"None"}),p.jsx("option",{value:"json",children:"JSON"}),p.jsx("option",{value:"raw",children:"Raw"}),p.jsx("option",{value:"urlencoded",children:"x-www-form-urlencoded"}),p.jsx("option",{value:"formdata",children:"form-data"}),p.jsx("option",{value:"binary",children:"Binary"}),p.jsx("option",{value:"graphql",children:"GraphQL"})]})]}),(r==="json"||r==="raw"||r==="binary")&&p.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[p.jsxs("label",{className:"text-sm font-medium",children:["Content type",p.jsxs("select",{"aria-label":"Content type",className:`ml-2 rounded-md border px-3 py-2 text-sm ${a}`,value:d,onChange:v=>{const S=v.target.value==="__custom__"?"":v.target.value;e({...t,contentType:S})},children:[mv.map(([v,S])=>p.jsx("option",{value:v,children:S},v)),p.jsx("option",{value:"__custom__",children:"Custom…"})]})]}),d==="__custom__"&&p.jsx("input",{"aria-label":"Custom content type",className:`rounded-md border px-3 py-2 text-sm ${a}`,placeholder:"application/vnd.example+json",value:t.contentType||"",onChange:v=>e({...t,contentType:v.target.value})})]})]}),r==="none"&&p.jsx("div",{className:`rounded-md border border-dashed p-4 text-sm ${s?"border-gray-700 text-gray-400":"border-gray-300 text-gray-500"}`,children:"This request has no body."}),(r==="json"||r==="raw")&&p.jsxs("div",{className:"space-y-2",children:[p.jsx(Ba,{ariaLabel:"Request body",language:r==="json"?"json":NE(t.contentType),theme:n,value:t.body||"",onChange:v=>e({...t,body:v}),minLines:9,maxLines:20}),p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[p.jsx("span",{className:`text-xs ${f?"text-red-600":r==="json"&&f===""?"text-green-600":s?"text-gray-400":"text-gray-500"}`,children:r==="json"?f?`Invalid JSON: ${f}`:(t.body||"").trim()?"Valid JSON":"Enter a JSON object, array, or value.":"Raw body is sent exactly as entered."}),r==="json"&&p.jsx("button",{type:"button",className:"rounded-md border px-3 py-1.5 text-xs",disabled:!!f||!(t.body||"").trim(),onClick:()=>{try{e({...t,body:JSON.stringify(JSON.parse(t.body||""),null,2)})}catch{}},children:"Beautify JSON"})]})]}),r==="urlencoded"&&p.jsxs("div",{className:"space-y-2",children:[p.jsx(TE,{label:"Form field",entries:t.urlencoded?.length?t.urlencoded:[pv()],inputClass:a,onChange:v=>e({...t,urlencoded:v,contentType:"application/x-www-form-urlencoded"})}),p.jsx("p",{className:`text-xs ${s?"text-gray-400":"text-gray-500"}`,children:"Enabled fields are URL-encoded at send time. Variable substitution still applies to keys and values."})]}),r==="formdata"&&p.jsxs("div",{className:"space-y-2",children:[(t.formData?.length?t.formData:[Th()]).map((v,S)=>p.jsxs("div",{className:"grid gap-2 md:grid-cols-[auto_7rem_1fr_1fr_auto]",children:[p.jsx("input",{"aria-label":`Form data ${S+1} enabled`,type:"checkbox",checked:v.enabled!==!1,onChange:A=>b(S,{enabled:A.target.checked})}),p.jsxs("select",{"aria-label":`Form data ${S+1} type`,className:`rounded-md border px-2 py-2 text-sm ${a}`,value:v.type||"text",onChange:A=>b(S,{type:A.target.value,file:void 0,fileName:void 0}),children:[p.jsx("option",{value:"text",children:"Text"}),p.jsx("option",{value:"file",children:"File"})]}),p.jsx("input",{"aria-label":`Form data ${S+1} key`,className:`min-w-0 rounded-md border px-3 py-2 text-sm ${a}`,placeholder:"Key",value:v.key,onChange:A=>b(S,{key:A.target.value})}),v.type==="file"?p.jsxs("label",{className:`flex min-w-0 cursor-pointer items-center rounded-md border px-3 py-2 text-sm ${a}`,children:[p.jsx("span",{className:"truncate",children:v.file?.name||v.fileName||"Choose file…"}),p.jsx("input",{"aria-label":`Form data ${S+1} file`,className:"sr-only",type:"file",onChange:A=>{const C=A.target.files?.[0];b(S,{file:C,fileName:C?.name,contentType:C?.type||void 0})}})]}):p.jsx("input",{"aria-label":`Form data ${S+1} value`,className:`min-w-0 rounded-md border px-3 py-2 text-sm ${a}`,placeholder:"Value",value:v.value,onChange:A=>b(S,{value:A.target.value})}),p.jsx("button",{type:"button","aria-label":`Remove form data ${S+1}`,className:"rounded-md border p-2",onClick:()=>e({...t,formData:(t.formData||[]).filter((A,C)=>C!==S)}),children:p.jsx(si,{className:"h-4 w-4"})})]},S)),p.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 rounded-md border px-3 py-2 text-xs",onClick:()=>e({...t,formData:[...t.formData||[],Th()]}),children:[p.jsx(ks,{className:"h-3.5 w-3.5"})," Add form-data field"]}),p.jsx("p",{className:`text-xs ${s?"text-gray-400":"text-gray-500"}`,children:"The browser supplies the multipart boundary automatically. Imported Postman file paths must be re-selected from this browser."})]}),r==="binary"&&p.jsxs("div",{className:"space-y-2",children:[p.jsxs("label",{className:`flex cursor-pointer items-center justify-between gap-3 rounded-md border px-3 py-3 text-sm ${a}`,children:[p.jsx("span",{className:"min-w-0 truncate",children:t.binary?.file?.name||t.binary?.fileName||"Choose binary file…"}),p.jsx("span",{className:"shrink-0 text-xs font-medium",children:"Browse"}),p.jsx("input",{"aria-label":"Binary file",className:"sr-only",type:"file",onChange:v=>{const S=v.target.files?.[0];e({...t,contentType:S?.type||t.contentType||"application/octet-stream",binary:{file:S,fileName:S?.name||t.binary?.fileName,contentType:S?.type||t.binary?.contentType}})}})]}),p.jsx("p",{className:`text-xs ${s?"text-gray-400":"text-gray-500"}`,children:"The selected file is sent as the request body without text conversion. Saved requests retain only file metadata, so the browser asks you to re-select the file before a later send or collection run."})]}),r==="graphql"&&p.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx("div",{className:"text-xs font-medium",children:"Query"}),p.jsx(Ba,{ariaLabel:"GraphQL query",language:"graphql",theme:n,value:t.graphql?.query||"",onChange:v=>e({...t,graphql:{query:v,variables:t.graphql?.variables||""}}),minLines:9,maxLines:20})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("div",{className:"text-xs font-medium",children:"Variables (JSON)"}),p.jsx(Ba,{ariaLabel:"GraphQL variables",language:"json",theme:n,value:t.graphql?.variables||"",onChange:v=>e({...t,graphql:{query:t.graphql?.query||"",variables:v}}),minLines:9,maxLines:20}),p.jsx("div",{className:`text-xs ${h?"text-red-600":s?"text-gray-400":"text-gray-500"}`,children:h?`Invalid variables JSON: ${h}`:"Variables are serialized with the query as application/json."})]})]})]})};function EE(t,e){return t.find(([n])=>n.toLowerCase()===e.toLowerCase())?.[1]||""}function OE(t,e){const n=e.toLowerCase();if(n.includes("json"))try{return{body:JSON.stringify(JSON.parse(t),null,2),language:"json"}}catch{return{body:t,language:"json",invalidJson:!0}}return n.includes("html")?{body:t,language:"markup"}:n.includes("xml")?{body:t,language:"markup"}:n.includes("javascript")?{body:t,language:"javascript"}:{body:t,language:"text"}}function ME(t,e){const n=e.trim().toLowerCase();if(!n)return 0;let r=0,s=0;const a=t.toLowerCase();for(;s<a.length;){const c=a.indexOf(n,s);if(c<0)break;r+=1,s=c+Math.max(1,n.length)}return r}function RE(t,e){const n=e.trim().toLowerCase();return n?t.split(`
|
|
61
|
+
`).filter(s=>s.toLowerCase().includes(n)).join(`
|
|
62
|
+
`):t}const DE=({response:t,theme:e="light",curlCommand:n,advanced:r=!0})=>{const[s,a]=I.useState("pretty"),[c,d]=I.useState(""),[f,h]=I.useState(!1),[g,b]=I.useState(""),[v,S]=I.useState(!1),A=EE(t.headers,"content-type"),C=I.useMemo(()=>OE(t.body,A),[A,t.body]),T=/(?:text\/html|application\/xhtml\+xml)/i.test(A),D=I.useMemo(()=>new TextEncoder().encode(t.body).byteLength,[t.body]),j=e==="dark",E=r?s:"pretty",O=E==="pretty"?C.body:t.body,R=I.useMemo(()=>ME(O,c),[c,O]),B=I.useMemo(()=>f?RE(O,c):O,[c,O,f]),M=g.trim().toLowerCase(),z=t.headers.filter(([G,we])=>!M||`${G}: ${we}`.toLowerCase().includes(M)),F=j?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",X=j?"text-gray-400":"text-gray-500",W=async()=>{if(!(!n||typeof navigator>"u"||!navigator.clipboard?.writeText))try{await navigator.clipboard.writeText(n),S(!0),window.setTimeout(()=>S(!1),1500)}catch{S(!1)}};return p.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-response-heading",children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[p.jsxs("div",{id:"api-client-response-heading",className:"font-semibold",children:["Response ",p.jsxs("span",{className:t.status>=400?j?"text-red-300":"text-red-600":j?"text-green-300":"text-green-600",children:[t.status," ",t.statusText]})]}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsxs("div",{className:`flex flex-wrap gap-3 text-xs ${X}`,children:[p.jsxs("span",{children:[t.responseTime," ms"]}),p.jsxs("span",{children:[D.toLocaleString()," B"]}),A&&p.jsx("span",{className:"font-mono",children:A.split(";")[0]})]}),n&&p.jsx("button",{type:"button",className:`rounded-md border px-2.5 py-1.5 text-xs font-medium ${j?"border-gray-700 bg-gray-900 text-gray-200 hover:bg-gray-800":"border-gray-300 bg-white text-gray-700 hover:bg-gray-50"}`,onClick:()=>{W()},"aria-label":"Copy request as cURL",children:v?"Copied cURL":"Copy as cURL"})]})]}),r&&p.jsxs("div",{className:`flex w-fit overflow-hidden rounded-md border ${j?"border-gray-700":"border-gray-300"}`,role:"group","aria-label":"Response body view",children:[["pretty","raw"].map(G=>{const we=G==="pretty"?"Pretty":"Raw";return p.jsx("button",{type:"button","aria-label":we,"aria-pressed":s===G,className:`px-3 py-1.5 text-xs font-medium ${s===G?"bg-blue-600 text-white":j?"bg-gray-900 text-gray-300":"bg-white text-gray-700"}`,onClick:()=>a(G),children:we},G)}),p.jsx("button",{type:"button",disabled:!T,"aria-pressed":s==="preview",className:`px-3 py-1.5 text-xs font-medium ${s==="preview"?"bg-blue-600 text-white":j?"bg-gray-900 text-gray-300":"bg-white text-gray-700"} disabled:cursor-not-allowed disabled:opacity-40`,onClick:()=>a("preview"),children:"Preview"})]}),r&&E!=="preview"&&p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx("input",{"aria-label":"Search response body",type:"search",className:`min-w-0 flex-1 rounded-md border px-3 py-2 text-sm ${F}`,placeholder:"Search response body…",value:c,onChange:G=>d(G.target.value)}),p.jsx("span",{className:`text-xs ${X}`,children:c.trim()?`${R} match${R===1?"":"es"}`:"Search exact response text"}),p.jsxs("label",{className:`inline-flex items-center gap-2 text-xs ${X}`,children:[p.jsx("input",{type:"checkbox",checked:f,disabled:!c.trim(),onChange:G=>h(G.target.checked)}),"Only matching lines"]})]}),E==="pretty"&&p.jsxs("div",{className:"space-y-2",children:[C.invalidJson&&p.jsx("div",{className:`rounded-md border px-3 py-2 text-xs ${j?"border-amber-800 bg-amber-950/40 text-amber-200":"border-amber-300 bg-amber-50 text-amber-800"}`,children:"Response declares JSON but could not be parsed. Showing the exact payload."}),p.jsx(Rr,{code:B||"(empty response)",language:C.language,title:r?"Body — Pretty":"Response body",theme:e,wrap:!0})]}),r&&E==="raw"&&p.jsx("div",{"data-testid":"api-client-response-raw-body",children:p.jsx(Rr,{code:B||"(empty response)",language:"text",title:"Body — Raw",theme:e,wrap:!0})}),r&&E==="preview"&&T&&p.jsx("iframe",{title:"Response preview",sandbox:"",srcDoc:t.body,className:`min-h-80 w-full rounded-md border bg-white ${j?"border-gray-700":"border-gray-300"}`}),r&&t.headers.length>0&&p.jsxs("section",{className:`overflow-hidden rounded-md border ${j?"border-gray-700":"border-gray-200"}`,"aria-labelledby":"api-client-response-headers-heading",children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2",children:[p.jsxs("h4",{id:"api-client-response-headers-heading",className:"text-sm font-medium",children:["Response headers (",t.headers.length,")"]}),p.jsx("input",{"aria-label":"Filter response headers",type:"search",className:`rounded-md border px-2 py-1.5 text-xs ${F}`,placeholder:"Filter headers…",value:g,onChange:G=>b(G.target.value)})]}),p.jsx("div",{className:"overflow-x-auto border-t",children:p.jsxs("table",{className:"w-full min-w-[28rem] text-left text-xs",children:[p.jsx("thead",{className:j?"bg-gray-900 text-gray-300":"bg-gray-50 text-gray-600",children:p.jsxs("tr",{children:[p.jsx("th",{className:"px-3 py-2 font-medium",children:"Header"}),p.jsx("th",{className:"px-3 py-2 font-medium",children:"Value"})]})}),p.jsxs("tbody",{children:[z.map(([G,we],ye)=>p.jsxs("tr",{className:j?"border-t border-gray-800":"border-t border-gray-100",children:[p.jsx("th",{scope:"row",className:"whitespace-nowrap px-3 py-2 font-mono font-medium",children:G}),p.jsx("td",{className:"break-all px-3 py-2 font-mono",children:we})]},`${G}:${ye}`)),z.length===0&&p.jsx("tr",{children:p.jsx("td",{colSpan:2,className:`px-3 py-4 text-center ${X}`,children:"No response headers match this filter."})})]})]})})]})]})};function _E(t){if(!t.trim())return{valid:!0,message:"Ready"};try{return new Function("flex","console",`"use strict"; return (async () => {
|
|
63
|
+
${t}
|
|
64
|
+
});`),{valid:!0,message:"Syntax OK"}}catch(e){return{valid:!1,message:e instanceof Error?e.message:String(e)}}}function LE(t,e){let n=0,r=0;const s={...e};for(let a=0;a<t.length;a+=1){const c=t[a],d=t[a+1];if(s.blockComment){c==="*"&&d==="/"&&(s.blockComment=!1,a+=1);continue}if(s.quote){if(s.escaped){s.escaped=!1;continue}if(c==="\\"){s.escaped=!0;continue}c===s.quote&&(s.quote=void 0);continue}if(c==="/"&&d==="/")break;if(c==="/"&&d==="*"){s.blockComment=!0,a+=1;continue}if(c==="'"||c==='"'||c==="`"){s.quote=c,s.escaped=!1;continue}c==="{"?n+=1:c==="}"&&(r+=1)}return{opens:n,closes:r,state:s}}function BE(t){const e=t.replace(/\r\n?/g,`
|
|
65
|
+
`);if(!e.trim())return e;let n=0,r={escaped:!1,blockComment:!1};return e.split(`
|
|
66
|
+
`).map(a=>{const d=a.replace(/[ \t]+$/g,"").trimStart();if(!d)return"";const f=d.match(/^}+/)?.[0].length||0,h=Math.max(0,n-f),g=LE(d,r);return r=g.state,n=Math.max(0,n+g.opens-g.closes),`${" ".repeat(h)}${d}`}).join(`
|
|
67
|
+
`)}function gv(t,e){return t.slice(0,Math.max(0,Math.min(e,t.length))).replace(/\r\n?/g,`
|
|
68
|
+
`).length}function yv(t,e,n){const r=t.split(`
|
|
69
|
+
`),s=e.split(`
|
|
70
|
+
`),a=t.slice(0,Math.max(0,Math.min(n,t.length))),c=a.split(`
|
|
71
|
+
`).length-1,d=a.lastIndexOf(`
|
|
72
|
+
`),f=a.length-(d+1),h=r[c]||"",g=s[c]||"",b=h.length-h.trimStart().length,v=g.length-g.trimStart().length,S=g.length-v,A=f<=b?Math.min(f,v):v+Math.min(f-b,S);return s.slice(0,c).reduce((T,D)=>T+D.length+1,0)+A}function $E(t,e,n=e){const r=t.replace(/\r\n?/g,`
|
|
73
|
+
`),s=BE(t),a=yv(r,s,gv(t,e)),c=yv(r,s,gv(t,n));return{value:s,selectionStart:Math.min(a,s.length),selectionEnd:Math.min(Math.max(a,c),s.length)}}const jh=[{label:"get",kind:"method",signature:"get(key: string): string | undefined",documentation:"Read a variable by key."},{label:"has",kind:"method",signature:"has(key: string): boolean",documentation:"Check whether a variable is defined."},{label:"set",kind:"method",signature:"set(key: string, value: unknown): void",documentation:"Set a variable. Collection and environment stores persist the change in the workspace."},{label:"unset",kind:"method",signature:"unset(key: string): void",documentation:"Remove a variable by key."},{label:"replaceIn",kind:"method",signature:"replaceIn(value: string): string",documentation:"Replace {{variable}} placeholders using this variable scope."}],qE={flex:[{label:"request",kind:"property",documentation:"The mutable request draft available to pre-request and test scripts."},{label:"response",kind:"property",documentation:"The response from the executed request.",testsOnly:!0},{label:"environment",kind:"property",documentation:"Read and mutate variables in the active environment."},{label:"collection",kind:"property",documentation:"Read and mutate variables on the current collection."},{label:"variables",kind:"property",documentation:"Read and mutate the effective variables for this execution."},{label:"expect",kind:"function",signature:"expect(actual: unknown): FlexExpectation",documentation:"Create an assertion chain for a value."},{label:"test",kind:"function",signature:"test(name: string, callback: () => unknown | Promise<unknown>): void",documentation:"Register a post-response test.",testsOnly:!0}],"flex.request":[{label:"method",kind:"property",signature:"method: string",documentation:"Read or replace the HTTP method."},{label:"url",kind:"property",signature:"url: string",documentation:"Read or replace the request URL before variable resolution."},{label:"headers",kind:"property",documentation:"Mutable request-header helpers."},{label:"body",kind:"property",documentation:"Mutable raw request-body helpers."}],"flex.request.headers":[{label:"get",kind:"method",signature:"get(name: string): string | undefined",documentation:"Read a request header case-insensitively."},{label:"has",kind:"method",signature:"has(name: string): boolean",documentation:"Check whether a request header exists."},{label:"set",kind:"method",signature:"set(name: string, value: unknown): void",documentation:"Set or replace a request header."},{label:"upsert",kind:"method",signature:"upsert({ key, value }: { key: string; value: unknown }): void",documentation:"Set or replace a request header from a key/value object."},{label:"remove",kind:"method",signature:"remove(name: string): void",documentation:"Remove a request header case-insensitively."},{label:"toObject",kind:"method",signature:"toObject(): Record<string, string>",documentation:"Return enabled request headers as an object."}],"flex.request.body":[{label:"raw",kind:"property",signature:"raw: string",documentation:"Read or replace the raw request body."}],"flex.response":[{label:"code",kind:"property",signature:"code: number",documentation:"HTTP response status code.",testsOnly:!0},{label:"status",kind:"property",signature:"status: string",documentation:"HTTP response status text.",testsOnly:!0},{label:"responseTime",kind:"property",signature:"responseTime: number",documentation:"Measured response time in milliseconds.",testsOnly:!0},{label:"headers",kind:"property",documentation:"Read-only response-header helpers.",testsOnly:!0},{label:"text",kind:"method",signature:"text(): string",documentation:"Return the response body as text.",testsOnly:!0},{label:"json",kind:"method",signature:"json(): unknown",documentation:"Parse and return the response body as JSON.",testsOnly:!0}],"flex.response.headers":[{label:"get",kind:"method",signature:"get(name: string): string | undefined",documentation:"Read a response header case-insensitively.",testsOnly:!0},{label:"has",kind:"method",signature:"has(name: string): boolean",documentation:"Check whether a response header exists.",testsOnly:!0},{label:"toObject",kind:"method",signature:"toObject(): Record<string, string>",documentation:"Return response headers as an object.",testsOnly:!0}],"flex.environment":jh,"flex.collection":jh,"flex.variables":jh.map(t=>({...t,documentation:t.label==="set"||t.label==="unset"?`${t.documentation} Local effective-variable changes apply only to the current request execution.`:t.documentation})),"flex.expect.to":[{label:"equal",kind:"method",signature:"equal(expected: unknown): void",documentation:"Assert strict equality with Object.is."},{label:"eql",kind:"method",signature:"eql(expected: unknown): void",documentation:"Assert deep structural equality."},{label:"include",kind:"method",signature:"include(expected: unknown): void",documentation:"Assert that a string or array contains the expected value."},{label:"match",kind:"method",signature:"match(pattern: RegExp): void",documentation:"Assert that a string matches a regular expression."},{label:"have",kind:"property",documentation:"Property assertions."},{label:"be",kind:"property",documentation:"Boolean, range, and membership assertions."}],"flex.expect.to.have":[{label:"property",kind:"method",signature:"property(name: string, expected?: unknown): void",documentation:"Assert that an object has a property, optionally with an expected value."}],"flex.expect.to.be":[{label:"above",kind:"method",signature:"above(expected: number): void",documentation:"Assert that a number is greater than expected."},{label:"below",kind:"method",signature:"below(expected: number): void",documentation:"Assert that a number is less than expected."},{label:"oneOf",kind:"method",signature:"oneOf(expected: unknown[]): void",documentation:"Assert deep equality with one value from a list."},{label:"ok",kind:"property",signature:"ok: true",documentation:"Assert that the value is truthy."},{label:"true",kind:"property",signature:"true: true",documentation:"Assert that the value is exactly true."},{label:"false",kind:"property",signature:"false: true",documentation:"Assert that the value is exactly false."}],console:[{label:"log",kind:"method",signature:"log(...values: unknown[]): void",documentation:"Write a line to the API Client script console."},{label:"info",kind:"method",signature:"info(...values: unknown[]): void",documentation:"Write an informational line to the API Client script console."},{label:"warn",kind:"method",signature:"warn(...values: unknown[]): void",documentation:"Write a warning line to the API Client script console."},{label:"error",kind:"method",signature:"error(...values: unknown[]): void",documentation:"Write an error line to the API Client script console."}]};function bv(t,e){return[...qE[t]||[]].filter(n=>e==="tests"||!n.testsOnly).map(n=>({...n}))}function zE(t,e,n={}){const r=e.toLowerCase();return[...new Set(n[t]||[])].filter(Boolean).filter(s=>s.toLowerCase().startsWith(r)).sort((s,a)=>s.localeCompare(a)).map(s=>({label:s,kind:"variable",signature:s,documentation:`Known ${t==="variables"?"effective":t} variable.`}))}const HE=[{label:"flex",kind:"namespace",documentation:"FlexDoc request, response, variables, assertions, and test scripting API."},{label:"console",kind:"namespace",documentation:"Captured script console with log, info, warn, and error methods."}];function IE(t){const e=t.lastIndexOf("flex.expect(");if(e<0)return null;const n=t.slice(e),r=[[/\.to\.have\.([A-Za-z_$][\w$]*)?$/,"flex.expect.to.have"],[/\.to\.be\.([A-Za-z_$][\w$]*)?$/,"flex.expect.to.be"],[/\.to\.([A-Za-z_$][\w$]*)?$/,"flex.expect.to"]];for(const[s,a]of r){const c=n.match(s);if(c)return{path:a,prefix:c[1]||""}}return null}function UE(t){const e=t.match(/flex\.(environment|collection|variables)\.(?:get|has|set|unset)\(\s*['"]([^'"]*)$/);return e?{scope:e[1],prefix:e[2]||""}:null}function FE(t){const e=t.match(/(?:^|[^\w$])((?:flex|console)(?:\.[A-Za-z_$][\w$]*)*)\.([A-Za-z_$][\w$]*)?$/);return e?{path:e[1],prefix:e[2]||""}:null}function VE(t,e,n,r={},s=!1){const a=Math.max(0,Math.min(e,t.length)),c=t.slice(0,a),d=UE(c);if(d){const v=zE(d.scope,d.prefix,r);return v.length>0?{from:a-d.prefix.length,to:a,items:v}:null}const f=IE(c);if(f){const v=bv(f.path,n).filter(S=>S.label.toLowerCase().startsWith(f.prefix.toLowerCase()));return v.length>0?{from:a-f.prefix.length,to:a,items:v}:null}const h=FE(c);if(h){const v=bv(h.path,n).filter(S=>S.label.toLowerCase().startsWith(h.prefix.toLowerCase()));return v.length>0?{from:a-h.prefix.length,to:a,items:v}:null}const g=c.match(/([A-Za-z_$][\w$]*)$/)?.[1]||"";if(!s&&!g)return null;const b=HE.filter(v=>!g||v.label.startsWith(g));return!s&&b.length===0?null:b.length>0?{from:a-g.length,to:a,items:b.map(v=>({...v}))}:null}const xv=({ariaLabel:t,value:e,onChange:n,phase:r,theme:s="light",variableKeys:a={}})=>{const c=I.useRef(null),d=I.useRef(null),f=I.useRef([]),[h,g]=I.useState(null),[b,v]=I.useState(0),[S,A]=I.useState({left:12,top:36}),C=I.useMemo(()=>`api-client-script-completions-${t.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,[t]),T=I.useMemo(()=>_E(e),[e]),D=s==="dark",j=X=>{const W=d.current,G=c.current;if(!W||!G)return;const we=W.coordsAtPos(X);if(!we)return;const ye=G.getBoundingClientRect(),xe=we.left-ye.left,_=Math.max(8,ye.width-430),ee=we.bottom-ye.top+2,he=Math.max(8,ye.height-96);A({left:Math.max(8,Math.min(xe,_)),top:Math.max(8,Math.min(ee,he))})},E=(X,W,G=!1)=>{const we=VE(X,W,r,a,G);g(we),v(0),we&&requestAnimationFrame(()=>j(W))},O=X=>{if(!h)return;const W=`${e.slice(0,h.from)}${X.label}${e.slice(h.to)}`,G=h.from+X.label.length;n(W),g(null),requestAnimationFrame(()=>{d.current?.setSelection(G)})},R=()=>{if(!T.valid)return;const X=d.current?.getSelection()??{from:e.length,to:e.length},W=$E(e,X.from,X.to);W.value!==e&&n(W.value),g(null),requestAnimationFrame(()=>{d.current?.setSelection(W.selectionStart,W.selectionEnd)})};I.useEffect(()=>{f.current[b]?.scrollIntoView({block:"nearest"})},[b]);const B=X=>{const W=d.current?.getSelection().from??e.length;if((X.ctrlKey||X.metaKey)&&X.code==="Space"){X.preventDefault(),E(e,W,!0);return}if(X.shiftKey&&X.altKey&&X.code==="KeyF"){X.preventDefault(),R();return}if(!(!h||h.items.length===0)){if(X.key==="ArrowDown"){X.preventDefault(),v(G=>(G+1)%h.items.length);return}if(X.key==="ArrowUp"){X.preventDefault(),v(G=>(G-1+h.items.length)%h.items.length);return}if(X.key==="Enter"||X.key==="Tab"){X.preventDefault(),O(h.items[b]);return}X.key==="Escape"&&(X.preventDefault(),g(null))}},M=h?.items[b],z=!!h&&h.items.length>0,F=D?"border-gray-700 bg-gray-900 text-gray-100 shadow-2xl":"border-gray-200 bg-white text-gray-900 shadow-2xl";return p.jsxs("div",{ref:c,className:"relative min-w-0",onBlur:X=>{X.currentTarget.contains(X.relatedTarget)||g(null)},children:[p.jsxs("div",{className:"mb-1 flex flex-wrap items-center justify-between gap-2",children:[p.jsxs("span",{role:T.valid?"status":"alert",className:`inline-flex items-center gap-1 text-[11px] ${T.valid?D?"text-emerald-300":"text-emerald-700":D?"text-amber-300":"text-amber-700"}`,children:[T.valid?p.jsx(Oo,{className:"h-3.5 w-3.5"}):p.jsx(md,{className:"h-3.5 w-3.5"}),p.jsx("span",{className:"max-w-[24rem] truncate",children:T.message})]}),p.jsxs("button",{type:"button",className:"inline-flex min-h-9 items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs disabled:cursor-not-allowed disabled:opacity-50",disabled:!T.valid||!e.trim(),onMouseDown:X=>X.preventDefault(),onClick:R,"aria-label":"Format current script",children:[p.jsx(mA,{className:"h-3.5 w-3.5"}),"Format"]})]}),p.jsx(Ba,{ref:d,ariaActiveDescendant:z?`${C}-${b}`:void 0,ariaAutocomplete:"list",ariaControls:z?C:void 0,ariaExpanded:z,ariaLabel:t,autoIndent:!0,dataTestId:`${t}-editor`,language:"javascript",onChange:X=>{const W=d.current?.getSelection().from??X.length;n(X),requestAnimationFrame(()=>{const G=d.current?.getSelection().from??W;E(X,G)})},onCursorChange:X=>{h&&j(X)},onEditorKeyDown:B,theme:s,value:e,wrap:!0}),z&&p.jsxs("div",{className:`absolute z-[70] w-[min(26rem,calc(100%-1rem))] overflow-hidden rounded-md border ${F}`,"data-testid":`${t}-completion-popup`,style:{left:S.left,top:S.top},children:[p.jsx("div",{id:C,role:"listbox","aria-label":"Script suggestions",className:"max-h-56 overflow-y-auto py-1",children:h.items.map((X,W)=>p.jsxs("button",{ref:G=>{f.current[W]=G},"aria-label":X.label,"aria-selected":W===b,className:`flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-xs ${W===b?D?"bg-blue-700 text-white":"bg-blue-50 text-gray-900":D?"hover:bg-gray-800":"hover:bg-gray-50"}`,id:`${C}-${W}`,onMouseEnter:()=>v(W),onMouseDown:G=>{G.preventDefault(),O(X)},role:"option",type:"button",children:[p.jsx("span",{"aria-hidden":"true",className:"shrink-0 rounded bg-black/5 px-1 font-mono text-[10px] uppercase opacity-60 dark:bg-white/10",children:X.kind}),p.jsx("span",{className:"font-mono font-semibold",children:X.label}),p.jsx("span",{"aria-hidden":"true",className:`min-w-0 truncate ${W===b&&D?"text-blue-100":D?"text-gray-400":"text-gray-500"}`,children:X.signature||""})]},`${X.kind}-${X.label}`))}),M&&p.jsxs("div",{className:`border-t px-3 py-2 text-[11px] ${D?"border-gray-700 text-gray-300":"border-gray-200 text-gray-600"}`,children:[M.signature&&p.jsx("div",{className:"mb-1 overflow-x-auto whitespace-nowrap font-mono text-xs",children:M.signature}),p.jsx("div",{children:M.documentation})]})]}),p.jsxs("div",{className:`mt-1 flex flex-wrap gap-x-3 text-[11px] ${D?"text-gray-400":"text-gray-500"}`,children:[p.jsxs("span",{children:[p.jsx("code",{children:"flex."})," or Ctrl+Space"]}),p.jsx("span",{children:"Enter keeps indentation"}),p.jsx("span",{children:"↑/↓ choose"}),p.jsx("span",{children:"Enter/Tab complete"}),p.jsx("span",{children:"Shift+Alt+F format"})]})]})};function Eh(t){const e=t.auth?t.auth.type==="oauth2"?{...t.auth,scopes:t.auth.scopes?[...t.auth.scopes]:void 0}:{...t.auth}:void 0;return{...t,query:t.query?.map(n=>({...n})),headers:t.headers?.map(n=>({...n})),urlencoded:t.urlencoded?.map(n=>({...n})),formData:t.formData?.map(n=>({...n})),binary:t.binary?{...t.binary}:void 0,graphql:t.graphql?{...t.graphql}:void 0,auth:e,hostExecution:t.hostExecution?{...t.hostExecution}:void 0}}function PE(t){const e=Eh(t);return e.binary&&(e.binary={fileName:e.binary.fileName,contentType:e.binary.contentType}),e.formData&&(e.formData=e.formData.map(n=>{const r={...n};return delete r.file,r})),e}function Hc(t){return Object.assign(Object.create(null),t||{})}function KE(t){return t instanceof Error?t.message:"Request failed"}function YE(t){return t?Array.isArray(t)?t.map(([e,n])=>[String(e),String(n)]):[...new Headers(t).entries()]:[]}function GE(t,e){if(e.body!=null&&typeof e.body!="string")return;const r=[`curl -X ${String(e.method||"GET").toUpperCase()} ${JSON.stringify(t)}`];for(const[s,a]of YE(e.headers))r.push(` -H ${JSON.stringify(`${s}: ${a}`)}`);return typeof e.body=="string"&&e.body.length>0&&r.push(` --data-raw ${JSON.stringify(e.body)}`),r.join(" \\n")}function XE(t,e){return e?.available?`The API host does not support the required capability${t.length===1?"":"ies"}: ${t.join(", ")}.`:"Host execution is disabled on this documentation server."}function JE(t){if(typeof globalThis.btoa!="function")throw new Error("Host execution binary uploads require a Base64 encoder.");let e="";const n=32768;for(let r=0;r<t.length;r+=n)e+=String.fromCharCode(...t.subarray(r,Math.min(r+n,t.length)));return globalThis.btoa(e)}async function QE(t){const e={request:PE(t),...t.hostExecution?.certificateId?{certificateId:t.hostExecution.certificateId}:{},...t.hostExecution?.cookieJar?{cookieJar:t.hostExecution.cookieJar}:{}};t.bodyMode==="binary"&&t.binary?.file&&(e.bodyBase64=JE(new Uint8Array(await t.binary.file.arrayBuffer())));const n=(t.formData||[]).map((r,s)=>({entry:r,index:s})).filter(({entry:r})=>r.enabled!==!1&&r.type==="file"&&!!r.file);if(n.length>0){if(typeof FormData>"u")throw new Error("Host multipart execution requires FormData support.");const r=new FormData;r.append("descriptor",JSON.stringify(e));for(const{entry:s,index:a}of n){const c=s.file;r.append(`formData[${a}]`,c,s.fileName||c.name)}return{body:r,headers:{"X-FlexDoc-Execute":"1"}}}return{body:JSON.stringify(e),headers:{"X-FlexDoc-Execute":"1","Content-Type":"application/json"}}}async function vv(t){const e=Eh(t.request),n=cn(t.scripts),r=t.fetcher||globalThis.fetch,s=t.now||Date.now;let a=Eh(t.request),c=Hc(t.variables),d=Hc(t.collectionVariables);const f=Hc(t.externalVariables);let h=Hc(t.environmentVariables),g=[],b=[],v,S="",A="",C=0,T=!1,D;try{if(n.preRequest.trim()){const M=await w0({script:n.preRequest,phase:"pre-request",draft:a,variables:c,collectionVariables:d,externalVariables:f,environmentVariables:h});if(a=M.draft,c=M.variables,d=M.collectionVariables,h=M.environmentVariables,g=[...g,...M.logs],M.collectionChanges.length>0&&t.onCollectionChanges?.(M.collectionChanges),M.environmentChanges.length>0&&t.onEnvironmentChanges?.(M.environmentChanges),M.error)return{scriptTests:b,scriptLogs:g,scriptError:`Pre-request script: ${M.error}`}}t.resolveAuth&&(a={...a,auth:t.resolveAuth(a.auth)}),a=yk(a,c),S=(a.method||"GET").toUpperCase(),A=a.url;const j=N0(a),E=["GET","HEAD"].includes(S)&&ca(a)!=="none",O=j.length>0||E&&t.hostExecution?.available===!0;let R;if(O){const M=new Set(t.hostExecution?.capabilities||[]),z=j.filter(_=>!M.has(_));if(!t.hostExecution?.available||z.length>0){const _=XE(z,t.hostExecution);return{error:_,result:{request:e,scripts:n,executedMethod:S,resolvedUrl:A,error:_,...g.length?{scriptLogs:[...g]}:{}},scriptTests:b,scriptLogs:g}}if(!r)throw new Error("Fetch API is not available");const F=await QE(a);C=s(),T=!0;const X=await r(t.hostExecution.endpoint,{method:"POST",credentials:"same-origin",headers:F.headers,body:F.body,...t.signal?{signal:t.signal}:{}}),W=await X.text();let G;try{const _=W?JSON.parse(W):{};if(!_||typeof _!="object"||Array.isArray(_))throw new Error("invalid");G=_}catch{throw new Error("API host returned an invalid execution response.")}const we=typeof G.error=="string"?G.error:void 0;if(!X.ok)throw new Error(we||`API host execution failed with HTTP ${X.status}.`);if(typeof G.status!="number"||!Array.isArray(G.headers))throw new Error("API host returned an invalid execution response.");const ye=G.headers.map(_=>Array.isArray(_)?[String(_[0]),String(_[1])]:["",""]).filter(([_])=>!!_),xe=Array.isArray(G.cookies)?G.cookies:void 0;R={status:G.status,statusText:String(G.statusText||""),headers:ye,body:String(G.body||""),responseTime:typeof G.responseTime=="number"?G.responseTime:s()-C,...xe?{cookies:xe}:{}}}else{const M=C0(a);S=M.method,A=M.url,t.onRequestBuilt?.(M);let z={...M.init,url:M.url,credentials:t.credentials||"same-origin",...t.signal?{signal:t.signal}:{}};t.requestInterceptor&&(z=await t.requestInterceptor(z)),t.signal&&(z.signal=t.signal);const{url:F,...X}=z;if(A=F,D=GE(F,X),C=s(),T=!0,!r)throw new Error("Fetch API is not available");const W=await r(F,X),G=await W.text();R={status:W.status,statusText:W.statusText,headers:[...W.headers.entries()],body:G,responseTime:s()-C}}if(n.tests.trim()){const M=await w0({script:n.tests,phase:"tests",draft:a,variables:c,collectionVariables:d,externalVariables:f,environmentVariables:h,response:R});g=[...g,...M.logs],b=M.tests.map(z=>({...z})),M.collectionChanges.length>0&&t.onCollectionChanges?.(M.collectionChanges),M.environmentChanges.length>0&&t.onEnvironmentChanges?.(M.environmentChanges),M.error&&(v=`Test script: ${M.error}`)}return{result:{request:e,scripts:n,executedMethod:S,resolvedUrl:A,status:R.status,statusText:R.statusText,responseTime:R.responseTime,responseHeaders:R.headers.map(([M,z])=>[M,z]),responseBody:R.body,...b.length?{scriptTests:b}:{},...g.length?{scriptLogs:[...g]}:{},...v?{scriptError:v}:{}},response:R,scriptTests:b,scriptLogs:g,...D?{curlCommand:D}:{},...v?{scriptError:v}:{}}}catch(j){const E=KE(j),O={error:E,scriptTests:b,scriptLogs:g};return T&&(O.result={request:e,scripts:n,executedMethod:S,resolvedUrl:A,responseTime:C?s()-C:void 0,error:E,...g.length?{scriptLogs:[...g]}:{}}),O}}function WE(t){let e=t.url;for(const[n,r]of Object.entries(t.variables||{}))e=e.split(`{${n}}`).join(r.default);return e}function Oh(t){return t.replace(/\/+$/,"")}function wv(t,e){const n=Oh(e);return n?t===n||t.startsWith(`${n}/`)||t.startsWith(`${n}?`):!1}function ZE(t,e,n){const r=Oh(n);if(!r)return t;const s=Oh(e);if(s&&wv(t,s))return`${r}${t.slice(s.length)}`;try{const a=new URL(t),c=`${a.pathname==="/"?"":a.pathname}${a.search}${a.hash}`;return`${r}${c}`}catch{return r}}const eO=()=>({key:"",value:"",enabled:!0});function tO(t){return{method:t?.method||"GET",url:t?.url||"",query:t?.query?.map(e=>({...e}))||[],headers:t?.headers?.map(e=>({...e}))||[],body:t?.body||"",contentType:t?.contentType||"application/json",bodyMode:t?.bodyMode||ca(t||{}),urlencoded:t?.urlencoded?.length?t.urlencoded.map(e=>({...e})):void 0,formData:t?.formData?.length?t.formData.map(e=>({...e})):void 0,binary:t?.binary?{...t.binary}:void 0,graphql:t?.graphql?{...t.graphql}:void 0,auth:t?.auth||{type:"none"},hostExecution:t?.hostExecution?{...t.hostExecution}:void 0}}function nO(t){const e=t.auth?t.auth.type==="oauth2"?{...t.auth,scopes:t.auth.scopes?[...t.auth.scopes]:void 0}:{...t.auth}:void 0;return{...t,query:t.query?.map(n=>({...n})),headers:t.headers?.map(n=>({...n})),urlencoded:t.urlencoded?.map(n=>({...n})),formData:t.formData?.map(n=>({...n})),binary:t.binary?{...t.binary}:void 0,graphql:t.graphql?{...t.graphql}:void 0,auth:e,hostExecution:t.hostExecution?{...t.hostExecution}:void 0}}function iO(t){try{return new URL(t).origin}catch{return""}}function rO(t,e){if(t==="query"){const n=e.trim().replace(/^\?/,"").replace(/\r?\n/g,"&");return n?[...new URLSearchParams(n).entries()].map(([r,s])=>({key:r,value:s,enabled:!0})):[]}return e.split(/\r?\n/).map(n=>n.trim()).filter(Boolean).flatMap(n=>{const r=n.indexOf(":");return r<=0?[]:[{key:n.slice(0,r).trim(),value:n.slice(r+1).trim(),enabled:!0}]})}function Sv({kind:t,label:e,entries:n,onChange:r,inputClass:s,mutedClass:a}){const[c,d]=I.useState(""),f=(g,b)=>r(n.map((v,S)=>S===g?{...v,...b}:v)),h=()=>{const g=rO(t,c);g.length&&(r(g),d(""))};return p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[p.jsx("span",{className:"text-sm font-medium",children:e}),p.jsxs("button",{type:"button",className:"inline-flex min-h-11 items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:()=>r([...n,eO()]),children:[p.jsx(ks,{className:"h-4 w-4"})," Add"]})]}),n.length===0&&p.jsxs("div",{className:`rounded-md border border-dashed p-3 text-sm ${a}`,children:["No ",t==="query"?"query parameters":"headers"," configured."]}),n.map((g,b)=>p.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-2 sm:grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto]",children:[p.jsx("input",{className:"mt-3","aria-label":`${e} ${b+1} enabled`,type:"checkbox",checked:g.enabled!==!1,onChange:v=>f(b,{enabled:v.target.checked})}),p.jsx("input",{"aria-label":`${e} ${b+1} key`,className:`min-w-0 w-full rounded-md border px-3 py-2 text-sm ${s}`,placeholder:"Key",value:g.key,onChange:v=>f(b,{key:v.target.value})}),p.jsx("input",{"aria-label":`${e} ${b+1} value`,className:`col-start-2 min-w-0 w-full rounded-md border px-3 py-2 text-sm sm:col-start-auto ${s}`,placeholder:"Value",value:g.value,onChange:v=>f(b,{value:v.target.value})}),p.jsx("button",{type:"button","aria-label":`Remove ${e.toLowerCase()} ${b+1}`,className:"col-start-3 row-start-1 inline-flex min-h-11 items-center justify-center rounded-md border px-3 py-2 sm:col-start-auto sm:row-start-auto",onClick:()=>r(n.filter((v,S)=>S!==b)),children:p.jsx(si,{className:"h-4 w-4"})})]},b)),p.jsxs("details",{className:"rounded-md border p-3",children:[p.jsx("summary",{className:"cursor-pointer text-xs font-medium",children:"Bulk edit"}),p.jsxs("div",{className:"mt-2 space-y-2",children:[p.jsx("textarea",{"aria-label":`${e} bulk editor`,className:`min-h-24 w-full rounded-md border px-3 py-2 font-mono text-xs ${s}`,placeholder:t==="query"?"a=1&b=2":`Accept: application/json
|
|
74
|
+
X-Trace: abc123`,value:c,onChange:g=>d(g.target.value)}),p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx("span",{className:`text-xs ${a}`,children:t==="query"?"Paste query-string pairs; applying replaces the current rows.":"Paste raw Header: value lines; applying replaces the current rows."}),p.jsx("button",{type:"button",className:"rounded-md border px-3 py-1.5 text-xs",disabled:!c.trim(),onClick:h,children:"Apply"})]})]})]})]})}function Av(t){return(t||[]).filter(e=>e.enabled!==!1&&e.key.trim()).length}function sO(t,e){const n=[...t.matchAll(/\{\{\s*([^{}]+?)\s*\}\}/g)].map(c=>c[1].trim()),r=[...new Set(n)],s=r.filter(c=>!Object.prototype.hasOwnProperty.call(e,c)),a=t.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(c,d)=>{const f=d.trim();return Object.prototype.hasOwnProperty.call(e,f)?e[f]:c});return{names:r,missing:s,resolved:a}}const kv=({initialRequest:t,initialScripts:e,initialRequestTab:n="params",initialScriptTab:r,theme:s="light",density:a="advanced",messages:c,credentials:d="same-origin",requestInterceptor:f,onRequestChange:h,onDraftChange:g,onScriptsChange:b,onRequestTabChange:v,onScriptTabChange:S,onExecutionStart:A,onExecutionComplete:C,resolveAuth:T,variables:D={},collectionVariables:j={},externalVariables:E={},environmentVariables:O={},onCollectionChanges:R,onEnvironmentChanges:B,serverOptions:M=[],initialServerUrl:z,onServerUrlChange:F,hostExecution:X})=>{const W=tO(t),G=cn(e),we=M.map(H=>({server:H,url:WE(H)})),ye=we.map(H=>H.url),xe=z||ye.find(H=>wv(W.url,H))||"",_=ye.includes(xe)?xe:ye[0]||"",ee=xe&&!ye.includes(xe)?xe:"",he=xe||_||iO(W.url),[$,te]=I.useState(W),[L,P]=I.useState(G),[ue,Se]=I.useState(_),[Ne,Re]=I.useState(ee),Be=I.useRef(he),Ze=I.useRef(he),[_e,Ke]=I.useState(null),[gt,se]=I.useState(),[de,ge]=I.useState(null),[Te,Ie]=I.useState(null),[Xe,ht]=I.useState([]),[Pt,rn]=I.useState([]),[sn,qn]=I.useState(!1),Cn=I.useRef(null),lt=I.useRef(h),pi=I.useRef(g),Mn=I.useRef(b),Jn=I.useRef(null),[Tt,x]=I.useState(n),[V,pe]=I.useState(()=>r||(G.tests.trim()&&!G.preRequest.trim()?"tests":"pre-request")),le=I.useRef({}),oe=I.useRef({}),k=I.useId().replace(/:/g,""),J=I.useId().replace(/:/g,"");I.useEffect(()=>{lt.current=h},[h]),I.useEffect(()=>{pi.current=g},[g]),I.useEffect(()=>{Mn.current=b},[b]),I.useEffect(()=>{pi.current?.(nO($))},[$]),I.useEffect(()=>{Mn.current?.(cn(L))},[L]),I.useEffect(()=>{try{const H=T?{...$,auth:T($.auth)}:$,ae=C0(H,{variables:D}),Ge=JSON.stringify([ae.method,ae.url,ae.headerEntries,ae.body,ae.bodyKind]);if(Ge===Jn.current)return;Jn.current=Ge,lt.current?.(ae)}catch{}},[$,T,D]);const Z=($.method||"GET").toUpperCase(),K=["GET","HEAD"].includes(Z),Q=s==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900",Ae=s==="dark"?"border-gray-700 bg-gray-800/60 text-gray-100":"border-gray-200 bg-gray-50 text-gray-900",fe=s==="dark"?"text-gray-400":"text-gray-600",ke=Tt==="scripts"&&a!=="advanced"?"params":Tt,je=Av($.query),De=Av($.headers),$e=!!$.auth&&$.auth.type!=="none"&&$.auth.type!=="inherit",ze=ca($)!=="none",Je=!!(L.preRequest.trim()||L.tests.trim()),Dn=[{id:"params",label:"Params",count:je},{id:"headers",label:"Headers",count:De},{id:"authorization",label:"Authorization",active:$e},{id:"body",label:"Body",active:ze},{id:"scripts",label:"Scripts",active:Je}].filter(H=>a==="advanced"||H.id!=="scripts"),Kt=H=>`${k}-request-tab-${H}`,_i=H=>`${k}-request-panel-${H}`,or=H=>`${J}-script-tab-${H}`,Me=H=>`${J}-script-panel-${H}`,Qe=sO($.url,D),Yt=H=>{H==="scripts"&&a!=="advanced"||(x(H),v?.(H))},mi=H=>{pe(H),S?.(H)},Li=(H,ae)=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(H.key))return;H.preventDefault();const Ge=Dn.filter(kl=>!kl.disabled).map(kl=>kl.id),Hn=Math.max(0,Ge.indexOf(ae)),$s=H.key==="Home"?Ge[0]:H.key==="End"?Ge[Ge.length-1]:H.key==="ArrowRight"?Ge[(Hn+1)%Ge.length]:Ge[(Hn-1+Ge.length)%Ge.length];Yt($s),le.current[$s]?.focus()},Wr=(H,ae)=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(H.key))return;H.preventDefault();const Ge=["pre-request","tests"],Hn=Ge.indexOf(ae),$s=H.key==="Home"?Ge[0]:H.key==="End"?Ge[Ge.length-1]:H.key==="ArrowRight"?Ge[(Hn+1)%Ge.length]:Ge[(Hn-1+Ge.length)%Ge.length];mi($s),oe.current[$s]?.focus()},Qn=H=>{if(!H)return;const ae=Be.current;Be.current=H,F?.(H),te(Ge=>({...Ge,url:ZE(Ge.url,ae,H)}))},_t=H=>{const ae=H==="inherit"?{type:"inherit"}:H==="bearer"?{type:H,token:""}:H==="oauth2"?{type:H,accessToken:""}:H==="basic"?{type:H,username:"",password:""}:H==="apiKey"?{type:H,key:"",value:"",in:"header"}:H==="digest"?{type:H,username:"",password:""}:H==="hawk"?{type:H,id:"",key:"",algorithm:"sha256"}:H==="ntlm"?{type:H,username:"",password:""}:H==="oauth1"?{type:H,consumerKey:"",consumerSecret:"",signatureMethod:"HMAC-SHA1"}:H==="awsv4"?{type:H,accessKey:"",secretKey:"",region:"",service:""}:{type:"none"};te(Ge=>({...Ge,auth:ae}))},It=T?T($.auth):$.auth,gi=N0({...$,auth:It}),cr=new Set(X?.capabilities||[]),yi=gi.filter(H=>!cr.has(H)),Vc=K&&ze,Ha=gi.length>0,Ji=X?.available===!0&&yi.length===0,Al=Vc?X?.available?c?.unusualBodyHostExecution||`${Z} request bodies are unusual. FlexDoc will use API-host execution so the body can be sent.`:c?.unusualBodyBrowserWarning||`${Z} request bodies are unusual. Browser fetch may reject this request; enable API-host execution to send it reliably.`:Ha?Ji?c?.hostBrowserUnsupported||"The browser cannot send this request. FlexDoc will execute it from the API host.":X?.available?`The API host does not support the required capability${yi.length===1?"":"ies"}: ${yi.join(", ")}.`:c?.hostExecutionDisabled||"Host execution is disabled on this documentation server.":null,zn=H=>X?.available===!0&&cr.has(H),ur=async()=>{if(sn)return;const H=new AbortController;Cn.current=H,A?.(),qn(!0),ge(null),Ie(null),ht([]),rn([]),Ke(null),se(void 0);try{const ae=await vv({request:$,scripts:L,credentials:d,requestInterceptor:f,resolveAuth:T,variables:D,collectionVariables:j,externalVariables:E,environmentVariables:O,hostExecution:X,signal:H.signal,onRequestBuilt:Ge=>lt.current?.(Ge),onCollectionChanges:R,onEnvironmentChanges:B});if(H.signal.aborted){ge(c?.requestCancelled||"Request cancelled.");return}ge(ae.error||null),Ie(ae.scriptError||null),ht(ae.scriptTests),rn(ae.scriptLogs),ae.response&&(se(ae.curlCommand),Ke({status:ae.response.status,statusText:ae.response.statusText,headers:ae.response.headers.map(([Ge,Hn])=>[Ge,Hn]),body:ae.response.body,responseTime:ae.response.responseTime})),ae.result&&C?.(ae.result)}finally{Cn.current===H&&(Cn.current=null),qn(!1)}},Bs=()=>Cn.current?.abort(),Zr=Xe.filter(H=>H.passed).length,Ut=!sn&&!(Ha&&!Ji);return p.jsx("div",{className:`min-w-0 rounded-xl border p-4 md:p-5 ${Ae}`,"data-api-client-editor":!0,onKeyDown:H=>{(H.ctrlKey||H.metaKey)&&H.key==="Enter"&&Ut&&(H.preventDefault(),ur())},children:p.jsxs("div",{className:"flex flex-col gap-4",children:[p.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[M.length>0&&p.jsxs("label",{className:"text-sm font-medium",children:["Server",p.jsx("select",{"aria-label":"API Client server",className:`mt-1 w-full rounded-md border px-3 py-2 text-sm ${Q}`,value:ue,onChange:H=>{Se(H.target.value),Re(""),Qn(H.target.value)},children:we.map(({server:H,url:ae})=>p.jsxs("option",{value:ae,children:[H.description?`${H.description} — `:"",H.url]},`${H.url}:${ae}`))})]}),p.jsxs("label",{className:"text-sm font-medium",children:["Custom server URL ",p.jsx("span",{className:"text-xs font-normal opacity-70",children:"(optional override)"}),p.jsx("input",{"aria-label":"API Client custom server URL",className:`mt-1 w-full rounded-md border px-3 py-2 font-mono text-sm ${Q}`,value:Ne,onChange:H=>{const ae=H.target.value;Re(ae);const Ge=ue||Ze.current;(ae.trim()||Ge)&&Qn(ae.trim()||Ge)},placeholder:"http://localhost:8080"})]})]}),p.jsxs("div",{className:"grid min-w-0 gap-2 sm:grid-cols-[auto_minmax(0,1fr)]",children:[p.jsx("select",{"aria-label":"HTTP method",className:`rounded-md border px-3 py-2 font-medium ${Q}`,value:Z,onChange:H=>{const ae=H.target.value;te(Ge=>({...Ge,method:ae}))},children:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map(H=>p.jsx("option",{children:H},H))}),p.jsx("input",{"aria-label":"Request URL",className:`w-full rounded-md border px-3 py-2 font-mono text-sm ${Q}`,placeholder:"https://api.example.com/resource or {{baseUrl}}/resource",value:$.url,onChange:H=>{const ae=H.target.value;te(Ge=>({...Ge,url:ae}))}})]}),Qe.names.length>0&&p.jsx("div",{className:`rounded-md border px-3 py-2 text-xs ${Qe.missing.length?s==="dark"?"border-amber-800 bg-amber-950/40 text-amber-200":"border-amber-300 bg-amber-50 text-amber-800":s==="dark"?"border-gray-700 bg-gray-900 text-gray-300":"border-gray-200 bg-white text-gray-600"}`,children:Qe.missing.length>0?p.jsxs(p.Fragment,{children:["Missing URL variable",Qe.missing.length===1?"":"s",": ",p.jsx("strong",{children:Qe.missing.join(", ")}),"."]}):p.jsxs(p.Fragment,{children:["Resolved URL: ",p.jsx("code",{className:"break-all",children:Qe.resolved})]})}),p.jsx("div",{className:"-mx-1 overflow-x-auto px-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden","data-api-client-request-tabs":!0,children:p.jsx("div",{className:`flex min-w-max gap-1 rounded-lg border p-1 ${s==="dark"?"border-gray-700 bg-gray-900/70":"border-gray-200 bg-white"}`,role:"tablist","aria-label":"Request configuration",children:Dn.map(H=>p.jsxs("button",{ref:ae=>{le.current[H.id]=ae},id:Kt(H.id),type:"button",role:"tab","aria-controls":_i(H.id),"aria-label":H.label,"aria-selected":ke===H.id,tabIndex:ke===H.id?0:-1,className:`inline-flex items-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition ${ke===H.id?"bg-blue-600 text-white shadow-sm":s==="dark"?"text-gray-300 hover:bg-gray-800":"text-gray-600 hover:bg-gray-100"}`,onClick:()=>Yt(H.id),onKeyDown:ae=>Li(ae,H.id),children:[p.jsx("span",{children:H.label}),H.count!==void 0&&H.count>0&&p.jsx("span",{className:`rounded-full px-1.5 text-[10px] leading-5 ${ke===H.id?"bg-white/20 text-white":s==="dark"?"bg-gray-700 text-gray-200":"bg-gray-200 text-gray-700"}`,children:H.count}),H.active&&H.count===void 0&&p.jsx("span",{"aria-label":"Configured",className:`h-1.5 w-1.5 rounded-full ${ke===H.id?"bg-white":"bg-blue-500"}`})]},H.id))})}),K&&p.jsx("p",{className:`-mt-2 text-xs ${fe}`,children:c?.unusualBodyAdvisory||`${Z} request bodies are unusual and may be ignored or rejected by servers or intermediaries. FlexDoc keeps the body; API-host execution can send it when available, while browser fetch may reject it.`}),ke==="params"&&p.jsx("div",{role:"tabpanel",id:_i("params"),"aria-labelledby":Kt("params"),children:p.jsx(Sv,{kind:"query",label:"Query parameters",entries:$.query||[],onChange:H=>te(ae=>({...ae,query:H})),inputClass:Q,mutedClass:fe})}),ke==="headers"&&p.jsx("div",{role:"tabpanel",id:_i("headers"),"aria-labelledby":Kt("headers"),children:p.jsx(Sv,{kind:"headers",label:"Headers",entries:$.headers||[],onChange:H=>te(ae=>({...ae,headers:H})),inputClass:Q,mutedClass:fe})}),ke==="authorization"&&p.jsxs("div",{role:"tabpanel",id:_i("authorization"),"aria-labelledby":Kt("authorization"),className:"space-y-3",children:[p.jsxs("label",{className:"text-sm font-medium",children:["Authorization",p.jsxs("select",{"aria-label":"Authorization type",className:`rounded-md border px-3 py-2 text-sm ${Q}`,value:$.auth?.type||"none",onChange:H=>_t(H.target.value),children:[T&&p.jsx("option",{value:"inherit",children:"Inherit from parent"}),p.jsx("option",{value:"none",children:"None"}),p.jsx("option",{value:"bearer",children:"Bearer token"}),p.jsx("option",{value:"basic",children:"Basic auth"}),p.jsx("option",{value:"apiKey",children:"API key"}),(a==="advanced"||$.auth?.type==="oauth2")&&p.jsx("option",{value:"oauth2",children:"OAuth 2.0 access token"}),a==="advanced"&&p.jsxs(p.Fragment,{children:[p.jsx("option",{value:"digest",disabled:!zn("digest"),children:"Digest (API host)"}),p.jsx("option",{value:"hawk",disabled:!zn("hawk"),children:"Hawk (API host)"}),p.jsx("option",{value:"ntlm",disabled:!zn("ntlm"),children:"NTLM / Negotiate (API host)"}),p.jsx("option",{value:"oauth1",disabled:!zn("oauth1"),children:"OAuth 1.0 (API host)"}),p.jsx("option",{value:"awsv4",disabled:!zn("awsv4"),children:"AWS Signature v4 (API host)"})]})]})]}),$.auth?.type==="bearer"&&p.jsx("input",{"aria-label":"Bearer token",type:"password",autoComplete:"off",className:`w-full rounded-md border px-3 py-2 ${Q}`,value:$.auth.token,onChange:H=>{const ae=H.target.value;te(Ge=>({...Ge,auth:{type:"bearer",token:ae}}))}}),(a==="advanced"||$.auth?.type==="oauth2")&&$.auth?.type==="oauth2"&&p.jsx(P0,{auth:$.auth,fieldClass:`w-full rounded-md border px-3 py-2 text-sm ${Q}`,label:"",onChange:H=>te(ae=>({...ae,auth:H}))}),$.auth?.type==="basic"&&p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{"aria-label":"Basic auth username",className:`w-full rounded-md border px-3 py-2 ${Q}`,placeholder:"Username",value:$.auth.username,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,username:H.target.value}}))}),p.jsx("input",{"aria-label":"Basic auth password",type:"password",autoComplete:"off",className:`w-full rounded-md border px-3 py-2 ${Q}`,placeholder:"Password",value:$.auth.password,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,password:H.target.value}}))})]}),$.auth?.type==="apiKey"&&p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{"aria-label":"API key name",className:`w-full rounded-md border px-3 py-2 ${Q}`,placeholder:"Key name",value:$.auth.key,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,key:H.target.value}}))}),p.jsx("input",{"aria-label":"API key value",type:"password",autoComplete:"off",className:`w-full rounded-md border px-3 py-2 ${Q}`,placeholder:"Value",value:$.auth.value,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,value:H.target.value}}))}),p.jsxs("select",{"aria-label":"API key location",className:`rounded-md border px-3 py-2 text-sm ${Q}`,value:$.auth.in,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,in:H.target.value}})),children:[p.jsx("option",{value:"header",children:"Header"}),p.jsx("option",{value:"query",children:"Query"}),p.jsx("option",{value:"cookie",disabled:!zn("cookies"),children:"Cookie (API host)"})]})]}),$.auth?.type==="digest"&&p.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[p.jsx("input",{"aria-label":"Digest username",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Username",value:$.auth.username,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,username:H.target.value}}))}),p.jsx("input",{"aria-label":"Digest password",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Password",value:$.auth.password,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,password:H.target.value}}))})]}),$.auth?.type==="hawk"&&p.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[p.jsx("input",{"aria-label":"Hawk id",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"ID",value:$.auth.id,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,id:H.target.value}}))}),p.jsx("input",{"aria-label":"Hawk key",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Key",value:$.auth.key,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,key:H.target.value}}))}),p.jsxs("select",{"aria-label":"Hawk algorithm",className:`rounded-md border px-3 py-2 ${Q}`,value:$.auth.algorithm||"sha256",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,algorithm:H.target.value}})),children:[p.jsx("option",{value:"sha256",children:"SHA-256"}),p.jsx("option",{value:"sha1",children:"SHA-1"})]}),p.jsx("input",{"aria-label":"Hawk ext",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"ext (optional)",value:$.auth.ext||"",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,ext:H.target.value}}))})]}),$.auth?.type==="ntlm"&&p.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[p.jsx("input",{"aria-label":"NTLM username",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Username",value:$.auth.username,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,username:H.target.value}}))}),p.jsx("input",{"aria-label":"NTLM password",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Password",value:$.auth.password,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,password:H.target.value}}))}),p.jsx("input",{"aria-label":"NTLM domain",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Domain (optional)",value:$.auth.domain||"",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,domain:H.target.value}}))}),p.jsx("input",{"aria-label":"NTLM workstation",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Workstation (optional)",value:$.auth.workstation||"",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,workstation:H.target.value}}))})]}),$.auth?.type==="oauth1"&&p.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[p.jsx("input",{"aria-label":"OAuth1 consumer key",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Consumer key",value:$.auth.consumerKey,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,consumerKey:H.target.value}}))}),p.jsx("input",{"aria-label":"OAuth1 consumer secret",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Consumer secret",value:$.auth.consumerSecret,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,consumerSecret:H.target.value}}))}),p.jsx("input",{"aria-label":"OAuth1 token",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Token (optional)",value:$.auth.token||"",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,token:H.target.value}}))}),p.jsx("input",{"aria-label":"OAuth1 token secret",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Token secret (optional)",value:$.auth.tokenSecret||"",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,tokenSecret:H.target.value}}))}),p.jsxs("select",{"aria-label":"OAuth1 signature method",className:`rounded-md border px-3 py-2 ${Q}`,value:$.auth.signatureMethod||"HMAC-SHA1",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,signatureMethod:H.target.value}})),children:[p.jsx("option",{children:"HMAC-SHA1"}),p.jsx("option",{children:"HMAC-SHA256"}),p.jsx("option",{children:"PLAINTEXT"})]}),p.jsx("input",{"aria-label":"OAuth1 realm",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Realm (optional)",value:$.auth.realm||"",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,realm:H.target.value}}))})]}),$.auth?.type==="awsv4"&&p.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[p.jsx("input",{"aria-label":"AWS access key",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Access key",value:$.auth.accessKey,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,accessKey:H.target.value}}))}),p.jsx("input",{"aria-label":"AWS secret key",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Secret key",value:$.auth.secretKey,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,secretKey:H.target.value}}))}),p.jsx("input",{"aria-label":"AWS session token",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Session token (optional)",value:$.auth.sessionToken||"",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,sessionToken:H.target.value}}))}),p.jsx("input",{"aria-label":"AWS region",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Region",value:$.auth.region,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,region:H.target.value}}))}),p.jsx("input",{"aria-label":"AWS service",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Service",value:$.auth.service,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,service:H.target.value}}))})]}),a==="advanced"&&X?.available&&p.jsxs("div",{className:"grid gap-2 rounded-md border p-3 sm:grid-cols-2",children:[X.clientCertificates?.length?p.jsxs("label",{className:"text-xs font-medium",children:["Client certificate",p.jsxs("select",{"aria-label":"Client certificate",className:`mt-1 w-full rounded-md border px-2 py-1.5 ${Q}`,value:$.hostExecution?.certificateId||"",onChange:H=>te(ae=>({...ae,hostExecution:{...ae.hostExecution||{},certificateId:H.target.value||void 0}})),children:[p.jsx("option",{value:"",children:"None"}),X.clientCertificates.map(H=>p.jsx("option",{value:H.id,children:H.name},H.id))]})]}):null,zn("cookies")&&p.jsxs("label",{className:"inline-flex items-center gap-2 text-xs font-medium",children:[p.jsx("input",{"aria-label":"Use API host cookie jar",type:"checkbox",checked:$.hostExecution?.cookieJar==="session",onChange:H=>te(ae=>({...ae,hostExecution:{...ae.hostExecution||{},cookieJar:H.target.checked?"session":void 0}}))}),"Use API host cookie jar"]})]})]}),ke==="body"&&p.jsx("div",{role:"tabpanel",id:_i("body"),"aria-labelledby":Kt("body"),children:p.jsx(jE,{draft:$,onChange:te,theme:s})}),a==="advanced"&&ke==="scripts"&&p.jsxs("section",{role:"tabpanel",id:_i("scripts"),"aria-labelledby":Kt("scripts"),className:"min-w-0 space-y-3",children:[p.jsxs("div",{children:[p.jsx("h3",{id:"api-client-scripts-heading",className:"font-semibold",children:"Scripts"}),p.jsx("p",{className:`text-xs ${fe}`,children:"Trusted local JavaScript. Editors soft-wrap, keep indentation, format only when you choose Format or Shift+Alt+F, and show lightweight syntax diagnostics."})]}),p.jsx("div",{className:`inline-flex max-w-full gap-1 rounded-lg border p-1 ${s==="dark"?"border-gray-700 bg-gray-900/70":"border-gray-200 bg-white"}`,role:"tablist","aria-label":"Script phase",children:["pre-request","tests"].map(H=>p.jsxs("button",{ref:ae=>{oe.current[H]=ae},id:or(H),type:"button",role:"tab","aria-controls":Me(H),"aria-selected":V===H,tabIndex:V===H?0:-1,className:`rounded-md px-3 py-1.5 text-sm ${V===H?"bg-blue-600 text-white":""}`,onClick:()=>mi(H),onKeyDown:ae=>Wr(ae,H),children:[H==="pre-request"?"Pre-request":"Tests",(H==="pre-request"?L.preRequest:L.tests).trim()&&p.jsx("span",{"aria-label":"Configured",className:`ml-1.5 inline-block h-1.5 w-1.5 rounded-full ${V===H?"bg-white":"bg-blue-500"}`})]},H))}),V==="pre-request"?p.jsx("div",{role:"tabpanel",id:Me("pre-request"),"aria-labelledby":or("pre-request"),className:"min-w-0",children:p.jsx(xv,{ariaLabel:"Pre-request script",phase:"pre-request",theme:s,value:L.preRequest,onChange:H=>P(ae=>({...ae,preRequest:H})),variableKeys:{environment:Object.keys(O),collection:Object.keys(j),variables:Object.keys(D)}})}):p.jsx("div",{role:"tabpanel",id:Me("tests"),"aria-labelledby":or("tests"),className:"min-w-0",children:p.jsx(xv,{ariaLabel:"Tests script",phase:"tests",theme:s,value:L.tests,onChange:H=>P(ae=>({...ae,tests:H})),variableKeys:{environment:Object.keys(O),collection:Object.keys(j),variables:Object.keys(D)}})})]}),Al&&p.jsx("div",{role:Vc||Ji?"status":"alert","aria-label":c?.hostExecutionStatus||"Host execution status",className:`rounded-md border p-3 text-sm ${Ji?s==="dark"?"border-blue-800 bg-blue-950/40 text-blue-200":"border-blue-300 bg-blue-50 text-blue-800":s==="dark"?"border-amber-800 bg-amber-950/40 text-amber-200":"border-amber-300 bg-amber-50 text-amber-800"}`,children:Al}),sn?p.jsxs("button",{type:"button",onClick:Bs,className:"inline-flex min-h-11 w-full items-center justify-center gap-2 rounded-md border border-red-500 px-4 py-2 font-medium text-red-600 sm:w-auto",children:[p.jsx(bg,{className:"h-4 w-4"}),c?.cancelRequest||"Cancel request"]}):p.jsxs("button",{type:"button","data-api-client-send":"true",onClick:()=>{ur()},disabled:!Ut,"aria-keyshortcuts":"Control+Enter Meta+Enter",title:`${c?.sendRequest||"Send request"} (Ctrl/Cmd+Enter)`,className:"inline-flex min-h-11 w-full items-center justify-center gap-2 rounded-md bg-blue-600 px-4 py-2 font-medium text-white hover:bg-blue-700 disabled:opacity-60 sm:w-auto",children:[p.jsx(la,{className:"h-4 w-4"})," ",c?.sendRequest||"Send request"," ",p.jsx("span",{className:"text-xs font-normal opacity-80",children:"Ctrl/Cmd+Enter"})]}),de&&p.jsxs("div",{role:"alert",className:`flex gap-2 rounded-md border p-3 text-sm ${s==="dark"?"border-red-800 bg-red-950/40 text-red-200":"border-red-300 bg-red-50 text-red-700"}`,children:[p.jsx(ud,{className:"mt-0.5 h-4 w-4 shrink-0"}),de]}),Te&&p.jsxs("div",{role:"alert",className:`flex gap-2 rounded-md border p-3 text-sm ${s==="dark"?"border-amber-800 bg-amber-950/40 text-amber-200":"border-amber-300 bg-amber-50 text-amber-800"}`,children:[p.jsx(ud,{className:"mt-0.5 h-4 w-4 shrink-0"}),Te]}),_e&&p.jsx(DE,{response:_e,theme:s,curlCommand:gt,advanced:a==="advanced"}),Xe.length>0&&p.jsxs("section",{className:"space-y-2","aria-labelledby":"api-client-test-results-heading",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h3",{id:"api-client-test-results-heading",className:"font-semibold",children:"Test results"}),p.jsxs("span",{className:`text-xs ${fe}`,children:[Zr,"/",Xe.length," passed"]})]}),p.jsx("div",{className:"space-y-2",children:Xe.map((H,ae)=>p.jsxs("div",{className:`rounded-md border px-3 py-2 text-sm ${H.passed?s==="dark"?"border-green-800 bg-green-950/40 text-green-200":"border-green-300 bg-green-50 text-green-800":s==="dark"?"border-red-800 bg-red-950/40 text-red-200":"border-red-300 bg-red-50 text-red-800"}`,children:[p.jsxs("div",{className:"font-medium",children:[H.passed?"PASS":"FAIL"," — ",H.name]}),H.error&&p.jsx("div",{className:"mt-1 text-xs",children:H.error})]},`${H.name}:${ae}`))})]}),Pt.length>0&&p.jsx(Rr,{code:Pt.join(`
|
|
75
|
+
`),language:"text",title:"Script console",theme:s,wrap:!0})]})})};function Mh(t,e){if(typeof window>"u")return;const n=new URL(window.location.href);e?n.searchParams.set(t,e):n.searchParams.delete(t),window.history.replaceState(null,"",`${n.pathname}${n.search}${n.hash}`)}function lO(t,e){return t==="scripts"||e?"advanced":typeof window>"u"?"basic":new URLSearchParams(window.location.search).get("density")==="advanced"?"advanced":"basic"}function Cv(t,e){return JSON.stringify({request:t,scripts:e},(n,r)=>typeof File<"u"&&r instanceof File?{name:r.name,size:r.size,type:r.type,lastModified:r.lastModified}:r)}const aO=({spec:t,path:e,method:n,theme:r,options:s,initialRequestTab:a,initialScriptTab:c,onRequestChange:d,onOpenInApiClient:f})=>{const h=t.paths[e],b=h?.[n.toLowerCase()]?.servers||h?.servers||t.servers||[],v=s?.tryIt?.apiClientPersistenceKey??_0(t.info?.title,typeof window>"u"?void 0:window.location.host),S=I.useMemo(()=>{const ue={...h0(t,e,n),serverUrl:s?.tryIt?.defaultServer};return Ck(t,e,n,ue,s?.tryIt?.defaultServer)},[n,s?.tryIt?.defaultServer,e,t]),A=I.useMemo(()=>cn(),[]),[C,T]=I.useState(()=>lO(a,c)),[D,j]=I.useState(S.request),[E,O]=I.useState(S.serverUrl),[R,B]=I.useState(A),[M,z]=I.useState(a||"params"),[F,X]=I.useState(c||"pre-request"),[W,G]=I.useState(()=>nl()),[we,ye]=I.useState(v===!1),xe=s?.messages;I.useEffect(()=>{if(v===!1)return;let ue=!1;return H0(v).then(Se=>{ue||(G(Se),ye(!0))}).catch(()=>{ue||ye(!0)}),()=>{ue=!0}},[v]),I.useEffect(()=>{!we||v===!1||I0(v,W).catch(()=>{})},[we,W,v]);const _=I.useMemo(()=>Xd(W),[W]),ee=Cv(D,R)!==Cv(S.request,A),he=C==="advanced",$=r==="dark"?"border-gray-700 bg-gray-900/40 text-gray-100":"border-gray-200 bg-white text-gray-900",te=r==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",L=ue=>{T(ue),Mh("density",ue==="advanced"?"advanced":void 0)},P=()=>f?.({request:D,scripts:cn(R),serverUrl:E,requestTab:M,scriptTab:F});return p.jsxs("div",{className:"space-y-3","data-try-it-session":!0,children:[p.jsxs("div",{className:`flex flex-wrap items-center justify-between gap-3 rounded-lg border p-2 ${$}`,children:[p.jsxs("div",{className:"flex rounded-md border p-1",role:"group","aria-label":"Try It density",children:[p.jsx("button",{type:"button","aria-pressed":!he,className:`rounded px-3 py-1.5 text-sm ${he?"":"bg-blue-600 text-white"}`,onClick:()=>L("basic"),children:xe?.tryItBasic||"Basic"}),p.jsx("button",{type:"button","aria-pressed":he,className:`rounded px-3 py-1.5 text-sm ${he?"bg-blue-600 text-white":""}`,onClick:()=>L("advanced"),children:xe?.tryItAdvanced||"Advanced"})]}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[he&&ee&&p.jsx("span",{"aria-label":"Unsaved Try It changes",className:"text-xs font-medium",children:xe?.unsavedChanges||"Unsaved changes"}),f&&p.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-1.5 text-sm",onClick:P,children:[p.jsx(fd,{className:"h-4 w-4"}),xe?.openApiClient||"Open in API Client"]})]})]}),he&&p.jsx("div",{className:`rounded-lg border p-3 ${$}`,children:p.jsxs("label",{className:"flex flex-wrap items-center gap-2 text-sm font-medium",children:[p.jsx("span",{children:xe?.environment||"Environment"}),p.jsxs("select",{"aria-label":xe?.environment||"Try It environment",className:`min-w-48 rounded-md border px-2 py-1.5 text-sm ${te}`,value:W.activeEnvironmentId||"",onChange:ue=>G(Se=>({...Se,activeEnvironmentId:ue.target.value||void 0})),children:[p.jsx("option",{value:"",children:xe?.noEnvironment||"No environment"}),W.environments.map(ue=>p.jsx("option",{value:ue.id,children:ue.name},ue.id))]})]})}),p.jsx(kv,{initialRequest:S.request,initialScripts:A,initialRequestTab:M,initialScriptTab:F,density:C,theme:r,messages:xe,credentials:s?.tryIt?.credentials||"same-origin",requestInterceptor:s?.tryIt?.requestInterceptor,hostExecution:s?.tryIt?.hostExecution,environmentVariables:_,serverOptions:b,initialServerUrl:S.serverUrl,onServerUrlChange:O,onRequestChange:d,onDraftChange:j,onScriptsChange:ue=>B(cn(ue)),onRequestTabChange:ue=>{z(ue),Mh("tab",ue)},onScriptTabChange:ue=>{X(ue),Mh("script",ue)},onEnvironmentChanges:ue=>G(Se=>Jd(Se,ue))})]})};function Rh(t,e){const n=encodeURIComponent(t).replace(/%/g,"~");return`${e.trim().toLowerCase()}-${n}`}function oO(t,e){return`${e.trim().toLowerCase()}-${t.replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"")}`}const cO=["curl","javascript","python","go","java"];function uO(){if(typeof window>"u")return{tryIt:!1};const t=new URLSearchParams(window.location.search),e=t.get("tab"),n=t.get("script");return{tryIt:t.get("tryIt")==="1",requestTab:e&&/^(params|headers|authorization|body|scripts)$/.test(e)?e:void 0,scriptTab:n&&/^(pre-request|tests)$/.test(n)?n:void 0}}function dO(t,e){if(typeof window>"u")return;const n=new URL(window.location.href);e?n.searchParams.set(t,e):n.searchParams.delete(t),window.history.replaceState(null,"",`${n.pathname}${n.search}${n.hash}`)}const fO=({spec:t,path:e,method:n,theme:r="light",options:s={},defaultExpandedSections:a,runtimeSnapshot:c,onOpenInApiClient:d})=>{const f=uO(),h=a??Id(s.expand,s.expand===void 0?s.expandResponses:void 0),g=f.tryIt&&!h.includes("tryIt")?[...h,"tryIt"]:h,b=`${n}:${e}:${g.join("|")}`,[v,S]=I.useState(()=>({key:b,sections:new Set(g)})),A=v.key===b?v.sections:new Set(g),[C,T]=I.useState(s.codeSamples?.languages?.[0]||"curl"),[D,j]=I.useState(!1),E=I.useId().replace(/:/g,""),O=I.useRef({}),R=I.useMemo(()=>p0(t,e,n,h0(t,e,n)),[t,e,n]),[B,M]=I.useState(R),F=t.paths[e]?.[n.toLowerCase()],X=I.useMemo(()=>GA(t,e,n),[t,e,n]),W=s.messages;if(I.useEffect(()=>{!f.tryIt||typeof document>"u"||requestAnimationFrame(()=>document.getElementById("tryIt-heading")?.scrollIntoView({block:"start"}))},[f.tryIt,n,e]),!F)return p.jsx("div",{className:"p-6",children:"Operation not found."});const G=r==="dark"?"text-gray-400":"text-gray-600",we=r==="dark"?"border-gray-700 bg-gray-800/60":"border-gray-200 bg-white",ye=r==="dark"?"bg-gray-900 text-gray-100":"bg-white text-gray-900",xe=s.codeSamples?.languages?.length?s.codeSamples.languages:cO,_=F.security??t.security,ee={requiredPropsFirst:s.requiredPropsFirst,sortPropsAlphabetically:s.sortPropsAlphabetically},he=r==="dark"?"bg-blue-950/60 text-blue-200":"bg-blue-100 text-blue-700",$=r==="dark"?"bg-red-950/60 text-red-200":"bg-red-100 text-red-700",te=r==="dark"?"bg-orange-950/60 text-orange-200":"bg-orange-100 text-orange-700",L=r==="dark"?"bg-gray-800 text-gray-200":"bg-gray-100 text-gray-700",P=de=>`${E}-code-tab-${de}`,ue=`${E}-code-panel`,Se=de=>{const ge=!A.has(de);S(Te=>{const Ie=new Set(Te.key===b?Te.sections:g);return Ie.has(de)?Ie.delete(de):Ie.add(de),{key:b,sections:Ie}}),de==="tryIt"&&dO("tryIt",ge?"1":void 0)},Ne=(de,ge,Te)=>p.jsxs("section",{className:"mb-8","aria-labelledby":`${ge}-heading`,children:[p.jsxs("button",{type:"button",id:`${ge}-heading`,"aria-expanded":A.has(ge),onClick:()=>Se(ge),className:"mb-4 flex min-h-10 w-full items-center gap-2 text-left text-base font-semibold sm:text-lg",children:[A.has(ge)?p.jsx(hg,{className:"h-5 w-5 shrink-0"}):p.jsx(pg,{className:"h-5 w-5 shrink-0"}),de]}),A.has(ge)&&Te]}),Re=de=>{T(de),O.current[de]?.focus()},Be=(de,ge)=>{if(!/^(ArrowLeft|ArrowRight|Home|End)$/.test(de.key))return;de.preventDefault();const Te=xe.indexOf(ge),Ie=de.key==="Home"?xe[0]:de.key==="End"?xe[xe.length-1]:de.key==="ArrowRight"?xe[(Te+1)%xe.length]:xe[(Te-1+xe.length)%xe.length];Re(Ie)},Ze=async()=>{if(typeof window>"u"||typeof navigator>"u"||!navigator.clipboard)return;const de=new URL(window.location.href);de.hash=Rh(e,n),await navigator.clipboard.writeText(de.toString()),j(!0),window.setTimeout(()=>j(!1),1400)},_e=F.requestBody?Ln.isReference(F.requestBody)?Ln.resolveReference(t,F.requestBody.$ref):F.requestBody:void 0,Ke=Object.entries(F).filter(([de])=>de.startsWith("x-")),gt=typeof s.theme=="object"?s.theme.methodColors?.[n.toLowerCase()]:void 0,se=c?.routes.some(de=>de.method===n.toUpperCase()&&de.path===e);return p.jsx("div",{lang:s.locale,className:`min-h-full ${ye}`,children:p.jsxs("article",{className:"mx-auto w-full max-w-6xl p-4 sm:p-6 lg:p-8",children:[p.jsxs("header",{className:"mb-8",children:[p.jsxs("div",{className:"mb-4 flex min-w-0 flex-wrap items-center gap-2 sm:gap-3",children:[p.jsx("span",{className:`shrink-0 rounded border px-2.5 py-1 text-xs font-bold sm:text-sm ${Ln.getMethodColor(n,r)}`,style:{background:gt?.bg,borderColor:gt?.border},children:n.toUpperCase()}),p.jsx("code",{className:`min-w-0 max-w-full overflow-x-auto rounded px-2.5 py-1 font-mono text-sm sm:text-base ${r==="dark"?"bg-gray-800 text-blue-300":"bg-gray-100 text-gray-900"}`,children:e}),p.jsxs("button",{type:"button",className:"inline-flex min-h-9 items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs","aria-label":"Copy endpoint link",onClick:()=>{Ze()},children:[D?p.jsx(fg,{className:"h-3.5 w-3.5"}):p.jsx(lA,{className:"h-3.5 w-3.5"}),D?"Copied":"Copy link"]})]}),F.summary&&p.jsx("h1",{className:"mb-2 text-2xl font-bold tracking-tight sm:text-3xl",children:F.summary}),F.description&&p.jsx("p",{className:`max-w-3xl whitespace-pre-wrap leading-relaxed ${G}`,children:F.description}),p.jsxs("div",{className:"mt-4 flex flex-wrap gap-3 text-sm",children:[F.deprecated&&p.jsxs("span",{className:r==="dark"?"inline-flex items-center gap-1 text-orange-300":"inline-flex items-center gap-1 text-orange-600",children:[p.jsx(ud,{className:"h-4 w-4"}),"Deprecated"]}),_?.length?p.jsxs("span",{className:r==="dark"?"inline-flex items-center gap-1 text-red-300":"inline-flex items-center gap-1 text-red-600",children:[p.jsx(cA,{className:"h-4 w-4"}),"Authentication required"]}):p.jsxs("span",{className:r==="dark"?"inline-flex items-center gap-1 text-green-300":"inline-flex items-center gap-1 text-green-600",children:[p.jsx(oA,{className:"h-4 w-4"}),"No authentication required"]}),c&&(se?p.jsx("span",{className:r==="dark"?"text-green-300":"text-green-600",children:"Observed at runtime"}):p.jsx("span",{className:c.discoveryComplete?r==="dark"?"text-amber-300":"text-amber-600":G,children:c.discoveryComplete?"Not found at runtime":"Not observed in partial runtime discovery"})),F.operationId&&p.jsxs("span",{className:G,children:["operationId: ",p.jsx("code",{children:F.operationId})]})]}),(s.showExtensions||s.showCommonExtensions)&&Ke.length>0&&p.jsx("div",{className:`mt-4 rounded-lg border p-3 text-xs ${we}`,children:Ke.map(([de,ge])=>p.jsxs("div",{children:[p.jsx("code",{children:de}),": ",typeof ge=="string"?ge:JSON.stringify(ge)]},de))})]}),X.length>0&&Ne(W?.parameters||"Parameters","parameters",p.jsx("div",{className:"space-y-3",children:X.map(de=>p.jsxs("div",{className:`rounded-lg border p-4 ${we}`,children:[p.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[p.jsx("code",{className:"font-medium",children:de.name}),p.jsx("span",{className:`rounded px-2 py-0.5 text-xs ${he}`,children:de.in}),de.required&&p.jsx("span",{className:`rounded px-2 py-0.5 text-xs ${$}`,children:"required"}),de.deprecated&&p.jsx("span",{className:`rounded px-2 py-0.5 text-xs ${te}`,children:"deprecated"})]}),de.description&&p.jsx("p",{className:`mb-3 text-sm ${G}`,children:de.description}),de.schema&&p.jsx(Dr,{spec:t,schema:de.schema,theme:r,required:de.required,...ee})]},`${de.in}:${de.name}`))})),_e&&Ne(W?.requestBody||"Request Body","requestBody",p.jsxs("div",{className:"space-y-4",children:[_e.description&&p.jsx("p",{className:G,children:_e.description}),Object.entries(_e.content||{}).map(([de,ge])=>p.jsxs("div",{className:`rounded-lg border p-4 ${we}`,children:[p.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[p.jsx("code",{className:`rounded px-2 py-1 text-xs ${L}`,children:de}),_e.required&&p.jsx("span",{className:`rounded px-2 py-0.5 text-xs ${$}`,children:"required"})]}),ge.schema&&p.jsx(Dr,{spec:t,schema:ge.schema,theme:r,...ee}),ge.example!==void 0&&p.jsx("div",{className:"mt-3",children:p.jsx(Rr,{code:JSON.stringify(ge.example,null,2),language:"json",title:"Example payload",theme:r,wrap:!0})})]},de))]})),Ne(W?.responses||"Responses","responses",p.jsx("div",{className:"space-y-4",children:Object.entries(F.responses||{}).map(([de,ge])=>{const Te=Ln.isReference(ge)?Ln.resolveReference(t,ge.$ref):ge;return p.jsxs("div",{className:`rounded-lg border p-4 ${we}`,children:[p.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[p.jsx("span",{className:"rounded border px-2.5 py-1 text-sm font-bold",children:de}),p.jsx("span",{className:`text-sm ${G}`,children:Te.description})]}),Te.headers&&s.showRequestHeaders&&p.jsxs("div",{className:"mb-3 text-sm",children:[p.jsx("span",{className:"font-medium",children:"Headers:"})," ",Object.keys(Te.headers).join(", ")]}),Te.content&&Object.entries(Te.content).map(([Ie,Xe])=>{const ht=Xe.examples&&Object.values(Xe.examples)[s.payloadSampleIdx||0];return p.jsxs("div",{className:"mt-3",children:[p.jsx("code",{className:`rounded px-1.5 py-0.5 text-xs ${L}`,children:Ie}),Xe.schema&&p.jsx("div",{className:"mt-2",children:p.jsx(Dr,{spec:t,schema:Xe.schema,theme:r,...ee})}),Xe.example!==void 0&&p.jsx("div",{className:"mt-3",children:p.jsx(Rr,{code:JSON.stringify(Xe.example,null,2),language:"json",title:"Example response",theme:r,wrap:!0})}),ht&&p.jsx("div",{className:"mt-3",children:p.jsx(Rr,{code:JSON.stringify(ht.value??ht,null,2),language:"json",title:"Example response",theme:r,wrap:!0})})]},Ie)})]},de)})})),s.tryIt?.enabled!==!1&&Ne(W?.tryIt||"Try It","tryIt",p.jsx(aO,{spec:t,path:e,method:n,theme:r,options:s,initialRequestTab:f.requestTab,initialScriptTab:f.scriptTab,onRequestChange:M,onOpenInApiClient:d},`${n}:${e}:${s.tryIt?.defaultServer||""}`)),s.codeSamples?.enabled!==!1&&Ne(W?.codeExamples||"Code Examples","codeSamples",p.jsxs("div",{className:"min-w-0",children:[p.jsx("div",{className:"mb-3 flex max-w-full gap-1 overflow-x-auto pb-1",role:"tablist","aria-label":"Code example language",children:xe.map(de=>p.jsx("button",{ref:ge=>{O.current[de]=ge},id:P(de),type:"button",role:"tab","aria-controls":ue,"aria-selected":C===de,tabIndex:C===de?0:-1,onClick:()=>Re(de),onKeyDown:ge=>Be(ge,de),className:`shrink-0 rounded-md px-3 py-2 text-sm ${C===de?"bg-blue-600 text-white":r==="dark"?"bg-gray-800 text-gray-200":"bg-gray-100 text-gray-700"}`,children:m0(de)},de))}),p.jsx("div",{role:"tabpanel",id:ue,"aria-labelledby":P(C),children:p.jsx(Rr,{code:QA(B,C),language:C==="curl"?"bash":C,title:m0(C),theme:r,wrap:!!(typeof s.theme=="object"&&s.theme.typography?.code?.wrap)})})]})),F.externalDocs&&p.jsx("p",{className:"pb-4 text-sm",children:p.jsx("a",{className:"text-blue-600 underline",href:F.externalDocs.url,target:"_blank",rel:"noopener noreferrer",children:F.externalDocs.description||"External documentation"})})]})})};function hO(t){const e=t?.["x-flexdoc-priority"]??t?.["x-flexdoc-weight"];return typeof e=="number"&&Number.isFinite(e)?e:0}function pO(t,e){let n=hO(t)*1e3;return t?.["x-flexdoc-highlight"]===!0&&(n+=1e5),t?.deprecated||(n+=100),t?.summary&&(n+=40),t?.description&&(n+=20),t?.operationId&&(n+=10),Array.isArray(t?.tags)&&t.tags.length>0&&(n+=5),e.toLowerCase()==="get"?n+=3:e.toLowerCase()==="post"&&(n+=2),n}function mO(t){let e=0;const n=[];for(const[r,s]of Object.entries(t.paths))for(const a of Ln.getHttpMethods(s)){const c=s[a];n.push({path:r,method:a,operation:c,score:pO(c,a),order:e++})}return n.sort((r,s)=>s.score-r.score||r.order-s.order).slice(0,6)}const gO=({spec:t,onEndpointSelect:e,theme:n="light"})=>{const r=n==="dark",s=r?"border-gray-700 bg-gray-800 text-white shadow-lg":"border-gray-200 bg-white text-gray-900 shadow-sm",a=r?"text-gray-300":"text-gray-600",c=r?"hover:border-gray-600 hover:bg-gray-700":"hover:border-blue-300 hover:bg-blue-50",d=Object.values(t.paths).reduce((g,b)=>{for(const v of Ln.getHttpMethods(b))g[v]=(g[v]||0)+1,g.total+=1;return g},{total:0}),f=mO(t),h=[{icon:mg,title:"Total endpoints",value:d.total,surface:r?"bg-blue-900":"bg-blue-100",iconClass:r?"text-blue-300":"text-blue-600"},{icon:yg,title:"Servers",value:t.servers?.length||0,surface:r?"bg-green-900":"bg-green-100",iconClass:r?"text-green-300":"text-green-600"},{icon:xg,title:"Tags",value:t.tags?.length||0,surface:r?"bg-purple-900":"bg-purple-100",iconClass:r?"text-purple-300":"text-purple-600"},{icon:pA,title:"Security schemes",value:t.components?.securitySchemes?Object.keys(t.components.securitySchemes).length:0,surface:r?"bg-orange-900":"bg-orange-100",iconClass:r?"text-orange-300":"text-orange-600"}];return p.jsx("div",{className:`flex-1 overflow-y-auto ${r?"bg-gray-900":"bg-gray-50"}`,children:p.jsxs("div",{className:"p-4 md:p-8",children:[p.jsxs("header",{className:"mb-8",children:[p.jsxs("div",{className:"mb-4 flex items-center gap-4",children:[p.jsx("div",{className:`flex h-12 w-12 items-center justify-center rounded-xl ${r?"bg-blue-700":"bg-gradient-to-br from-blue-500 to-blue-600"}`,children:p.jsx(mg,{className:"h-6 w-6 text-white"})}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("h1",{className:`truncate text-2xl font-bold md:text-3xl ${r?"text-white":"text-gray-900"}`,children:t.info.title}),p.jsxs("p",{className:a,children:["Version ",t.info.version]})]})]}),t.info.description&&p.jsx("p",{className:`max-w-4xl text-lg leading-relaxed ${a}`,children:t.info.description})]}),p.jsx("div",{className:"mb-8 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:h.map(({icon:g,title:b,value:v,surface:S,iconClass:A})=>p.jsx("div",{className:`rounded-xl border p-4 ${s}`,children:p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-lg ${S}`,children:p.jsx(g,{className:`h-5 w-5 ${A}`})}),p.jsxs("div",{children:[p.jsx("p",{className:`text-sm font-medium ${a}`,children:b}),p.jsx("p",{className:"text-xl font-bold",children:v})]})]})},b))}),p.jsxs("section",{className:`mb-8 rounded-xl border p-4 md:p-6 ${s}`,"aria-labelledby":"method-distribution-heading",children:[p.jsx("h2",{id:"method-distribution-heading",className:"mb-4 text-lg font-semibold md:text-xl",children:"HTTP method distribution"}),p.jsx("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4 lg:grid-cols-6",children:["get","post","put","delete","patch","options"].map(g=>p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:`mx-auto mb-2 flex items-center justify-center rounded-lg px-3 py-1.5 ${Ln.getMethodColor(g,n)}`,children:p.jsx("span",{className:"text-sm font-medium",children:g.toUpperCase()})}),p.jsx("p",{className:"font-bold",children:d[g]||0})]},g))})]}),p.jsxs("section",{className:`mb-8 rounded-xl border p-4 md:p-6 ${s}`,"aria-labelledby":"endpoint-highlights-heading",children:[p.jsxs("div",{className:"mb-4",children:[p.jsx("h2",{id:"endpoint-highlights-heading",className:"text-lg font-semibold md:text-xl",children:"Endpoint highlights"}),p.jsx("p",{className:`mt-1 text-xs ${a}`,children:"Prioritized by explicit FlexDoc metadata when supplied, then by documentation completeness. This is not usage analytics."})]}),p.jsxs("div",{className:"space-y-3",children:[f.map(({path:g,method:b,operation:v})=>p.jsxs("button",{type:"button",onClick:()=>e(g,b),className:`w-full rounded-lg border p-3 text-left transition-colors ${c} ${r?"border-gray-700":"border-gray-200"}`,children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("span",{className:`rounded border px-2 py-1 text-xs font-bold ${Ln.getMethodColor(b,n)}`,children:b.toUpperCase()}),p.jsx("code",{className:`break-all font-mono text-sm ${r?"text-blue-300":"text-blue-600"}`,children:g})]}),v?.summary&&p.jsx("p",{className:`ml-14 mt-2 text-sm ${a}`,children:v.summary})]},`${b}-${g}`)),f.length===0&&p.jsx("p",{className:`py-4 text-sm ${a}`,children:"No operations are defined in this specification."})]})]}),p.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[(t.info.contact||t.info.license)&&p.jsxs("section",{className:`rounded-xl border p-4 md:p-6 ${s}`,"aria-labelledby":"api-information-heading",children:[p.jsx("h2",{id:"api-information-heading",className:"mb-4 text-lg font-semibold md:text-xl",children:"Information"}),p.jsxs("div",{className:"space-y-4",children:[t.info.contact&&p.jsxs("div",{children:[p.jsx("h3",{className:"mb-2 font-medium",children:"Contact"}),t.info.contact.name&&p.jsx("p",{className:`text-sm ${a}`,children:t.info.contact.name}),t.info.contact.email&&p.jsx("a",{className:`block text-sm underline ${r?"text-blue-300":"text-blue-600"}`,href:`mailto:${t.info.contact.email}`,children:t.info.contact.email}),t.info.contact.url&&p.jsxs("a",{href:t.info.contact.url,target:"_blank",rel:"noopener noreferrer",className:`inline-flex items-center gap-1 text-sm ${r?"text-blue-300":"text-blue-600"}`,children:["Website ",p.jsx(fd,{className:"h-3 w-3"})]})]}),t.info.license&&p.jsxs("div",{children:[p.jsx("h3",{className:"mb-2 font-medium",children:"License"}),t.info.license.url?p.jsxs("a",{href:t.info.license.url,target:"_blank",rel:"noopener noreferrer",className:`inline-flex items-center gap-1 text-sm ${r?"text-blue-300":"text-blue-600"}`,children:[t.info.license.name,p.jsx(fd,{className:"h-3 w-3"})]}):p.jsx("p",{className:`text-sm ${a}`,children:t.info.license.name})]})]})]}),t.servers&&t.servers.length>0&&p.jsxs("section",{className:`rounded-xl border p-4 md:p-6 ${s}`,"aria-labelledby":"api-servers-heading",children:[p.jsx("h2",{id:"api-servers-heading",className:"mb-4 text-lg font-semibold md:text-xl",children:"Servers"}),p.jsx("div",{className:"space-y-3",children:t.servers.map((g,b)=>p.jsxs("div",{className:`rounded-lg p-3 ${r?"bg-gray-700/50":"bg-gray-50"}`,children:[p.jsx("code",{className:`break-all font-mono text-sm ${r?"text-blue-300":"text-blue-600"}`,children:g.url}),g.description&&p.jsx("p",{className:`mt-1 text-sm ${a}`,children:g.description})]},`${g.url}:${b}`))})]})]})]})})},yO=({footerClasses:t,footer:e})=>{const n=e?.copyright,r=e?.link||[];return p.jsx("footer",{className:`${t} w-full border-t`,children:p.jsxs("div",{className:"mx-auto flex min-h-12 w-full max-w-[1600px] flex-col gap-2 px-4 py-3 text-xs sm:flex-row sm:items-center sm:justify-between sm:px-6 sm:text-sm",children:[p.jsx("p",{children:n||p.jsxs(p.Fragment,{children:["Powered by ",p.jsx("a",{href:"https://prauga.github.io/flexdoc",target:"_blank",rel:"noopener noreferrer",className:"font-semibold hover:opacity-80 transition-opacity",children:"FlexDoc"})]})}),r.length>0&&p.jsx("nav",{"aria-label":"Footer links",className:"flex flex-wrap gap-x-4 gap-y-2",children:r.map(s=>p.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-80",children:s.text},`${s.text}:${s.url}`))})]})})},bO=(t,e,n)=>t==="dark"?n:e,xO="Runtime intelligence returned an invalid snapshot.";function Di(){throw new Error(xO)}function Sl(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Gr(t,e){const n=t[e];return(typeof n!="string"||n.trim()==="")&&Di(),n}function Nv(t,e){const n=t[e];if(n!==void 0)return(typeof n!="string"||n.trim()==="")&&Di(),n}function $a(t,e){const n=t[e];return(typeof n!="number"||!Number.isInteger(n)||n<0)&&Di(),n}function vO(t){return Sl(t)||Di(),{method:Gr(t,"method"),path:Gr(t,"path")}}function Dh(t){return Array.isArray(t)||Di(),t.map(vO)}function wO(t){Sl(t)||Di(),(!Sl(t.runtime)||!Sl(t.summary))&&Di(),typeof t.discoveryComplete!="boolean"&&Di();const e={name:Gr(t.runtime,"name"),version:Gr(t.runtime,"version"),platform:Gr(t.runtime,"platform"),arch:Gr(t.runtime,"arch")},n={documented:$a(t.summary,"documented"),runtime:$a(t.summary,"runtime"),matched:$a(t.summary,"matched"),runtimeOnly:$a(t.summary,"runtimeOnly"),documentedOnly:$a(t.summary,"documentedOnly")},r={framework:Gr(t,"framework"),runtime:e,discoveryComplete:t.discoveryComplete,routes:Dh(t.routes),runtimeOnly:Dh(t.runtimeOnly),documentedOnly:Dh(t.documentedOnly),summary:n},s=Nv(t,"frameworkVersion");s&&(r.frameworkVersion=s);const a=Nv(t,"serverOrigin");if(a&&(r.serverOrigin=a),t.server!==void 0){Sl(t.server)||Di();const c=t.server.localPort;c!==void 0&&(typeof c!="number"||!Number.isInteger(c)||c<=0||c>65535)&&Di(),r.server=c===void 0?{}:{localPort:c}}return t.environment!==void 0&&(Sl(t.environment)||Di(),r.environment={name:Gr(t.environment,"name")}),r}const SO=60;function AO(t,e,n=SO){const r=Math.max(0,Math.min(Math.max(0,e-20),Math.max(0,t-n)));return{start:r,end:Math.min(t,r+n)}}const _h=44;function kO(t){return Array.from(t.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])'))}const CO=({spec:t,theme:e,onEndpointSelect:n,onHome:r,onOpenSettings:s,onOpenApiClient:a,onOpenRuntime:c,onSendCurrent:d,messages:f})=>{const[h,g]=I.useState(!1),[b,v]=I.useState(""),[S,A]=I.useState(0),C=I.useRef(null),T=I.useRef(null),D=I.useRef([]),j=h&&typeof document<"u"&&Array.from(document.querySelectorAll('[data-api-client-send="true"]')).some(we=>!we.closest(".hidden")),E=I.useMemo(()=>{const we=[{id:"overview",label:f?.openOverview||"Open Overview",action:r},{id:"api-client",label:f?.openApiClient||"Open API Client",action:a},...c?[{id:"runtime",label:f?.openRuntime||"Open Runtime Intelligence",action:c}]:[],{id:"settings",label:f?.openSettings||"Open Viewer Settings",action:s},...d&&j?[{id:"send-current",label:f?.sendCurrentRequest||"Send current request",action:d}]:[]];for(const[ye,xe]of Object.entries(t.paths))for(const _ of Ln.getHttpMethods(xe))we.push({id:`operation:${_}:${ye}`,label:`${_.toUpperCase()} ${ye}`,action:()=>n(ye,_)});return we},[j,f?.openApiClient,f?.openOverview,f?.openRuntime,f?.openSettings,f?.sendCurrentRequest,n,r,a,c,s,d,t]),O=b.trim().toLowerCase(),R=I.useMemo(()=>O?E.filter(we=>we.label.toLowerCase().includes(O)):E,[E,O]),{start:B,end:M}=AO(R.length,S),z=R.slice(B,M),F=I.useCallback(()=>{g(!1),v(""),A(0)},[]),X=I.useCallback(we=>{we&&(F(),we.action())},[F]);if(I.useEffect(()=>{const we=ye=>{!(ye.ctrlKey||ye.metaKey)||ye.key.toLowerCase()!=="k"||(ye.preventDefault(),g(xe=>!xe))};return document.addEventListener("keydown",we),()=>document.removeEventListener("keydown",we)},[]),I.useEffect(()=>{if(!h||typeof document>"u")return;const we=document.activeElement instanceof HTMLElement?document.activeElement:null,ye=document.body.style.overflow;document.body.style.overflow="hidden",requestAnimationFrame(()=>T.current?.focus());const xe=_=>{if(_.key==="Escape"){_.preventDefault(),F();return}if(_.key==="ArrowDown"||_.key==="ArrowUp"||_.key==="Home"||_.key==="End"){_.preventDefault(),A(L=>!R.length||_.key==="Home"?0:_.key==="End"?R.length-1:_.key==="ArrowDown"?(L+1)%R.length:(L-1+R.length)%R.length);return}if(_.key==="Enter"){_.preventDefault(),X(R[S]);return}if(_.key!=="Tab"||!C.current)return;const ee=kO(C.current);if(!ee.length)return;const he=ee[0],$=ee[ee.length-1],te=document.activeElement;_.shiftKey&&(te===he||!C.current.contains(te))?(_.preventDefault(),$.focus()):!_.shiftKey&&(te===$||!C.current.contains(te))&&(_.preventDefault(),he.focus())};return document.addEventListener("keydown",xe),()=>{document.body.style.overflow=ye,document.removeEventListener("keydown",xe),we?.isConnected&&we.focus()}},[S,X,F,h,R]),I.useEffect(()=>{D.current[S]?.scrollIntoView({block:"nearest"})},[S]),!h)return null;const W=e==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900",G=e==="dark"?"bg-blue-950/70 text-blue-100":"bg-blue-50 text-blue-900";return p.jsxs("div",{className:"fixed inset-0 z-[80]",children:[p.jsx("button",{type:"button","aria-label":f?.closeCommandPalette||"Close command palette",className:"absolute inset-0 bg-black/40",onClick:F}),p.jsxs("div",{ref:C,role:"dialog","aria-modal":"true","aria-label":f?.commandPalette||"Command palette",className:`relative mx-auto mt-[10vh] w-[min(94vw,56rem)] overflow-hidden rounded-xl border shadow-2xl ${W}`,children:[p.jsx("input",{ref:T,"aria-label":f?.searchCommands||"Search commands",className:"w-full border-b bg-transparent p-3 text-sm outline-none",placeholder:f?.searchCommandsPlaceholder||"Search operations and commands…",value:b,onChange:we=>{v(we.target.value),A(0)}}),p.jsxs("div",{className:"max-h-[60vh] overflow-y-auto p-2",role:"listbox","aria-label":f?.commandResults||"Command results",children:[B>0&&p.jsx("div",{"aria-hidden":"true",style:{height:B*_h}}),z.map((we,ye)=>{const xe=B+ye;return p.jsx("button",{ref:_=>{D.current[xe]=_},type:"button",role:"option","aria-selected":xe===S,"aria-posinset":xe+1,"aria-setsize":R.length,className:`w-full rounded-md p-2 text-left text-sm ${xe===S?G:""}`,style:{height:_h,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},onMouseEnter:()=>A(xe),onClick:()=>X(we),children:we.label},we.id)}),M<R.length&&p.jsx("div",{"aria-hidden":"true",style:{height:(R.length-M)*_h}}),!R.length&&p.jsx("div",{className:"p-3 text-sm opacity-65",children:f?.noCommandResults||"No matching commands."})]})]})]})},NO={parameters:"Parameters",requestBody:"Request body",responses:"Responses",tryIt:"Try It",codeSamples:"Code examples"};function TO(t){return t===void 0?"host":Array.isArray(t)?"custom":t==="none"?"minimal":t}function jO(t){return Array.from(t.querySelectorAll('button:not([disabled]), select:not([disabled]), input:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')).filter(e=>e.getAttribute("aria-hidden")!=="true")}const EO=({open:t,theme:e,hostTheme:n,viewerTheme:r,viewerExpand:s,effectiveExpandedSections:a,messages:c,onThemeChange:d,onExpandChange:f,onClose:h})=>{const g=I.useRef(null),b=I.useRef(null);if(I.useEffect(()=>{if(!t||typeof document>"u")return;const T=document.activeElement instanceof HTMLElement?document.activeElement:null;b.current?.focus();const D=j=>{if(j.key==="Escape"){j.preventDefault(),h();return}if(j.key!=="Tab"||!g.current)return;const E=jO(g.current);if(E.length===0){j.preventDefault(),g.current.focus();return}const O=E[0],R=E[E.length-1],B=document.activeElement;j.shiftKey&&(B===O||!g.current.contains(B))?(j.preventDefault(),R.focus()):!j.shiftKey&&(B===R||!g.current.contains(B))&&(j.preventDefault(),O.focus())};return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D),T?.isConnected&&T.focus()}},[t,h]),!t)return null;const v=e==="dark",S=v?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900",A=v?"border-gray-700 bg-gray-800 text-gray-100":"border-gray-300 bg-white text-gray-900",C=Array.isArray(s)?s.filter(T=>Cs.includes(T)):[];return p.jsxs("div",{className:"fixed inset-0 z-[70]",children:[p.jsx("button",{type:"button","aria-label":"Close settings backdrop",className:"absolute inset-0 bg-black/40",onClick:h}),p.jsxs("aside",{ref:g,role:"dialog","aria-modal":"true","aria-label":"Viewer settings",tabIndex:-1,className:`absolute inset-y-0 right-0 flex w-[min(92vw,24rem)] flex-col border-l shadow-2xl ${S}`,children:[p.jsxs("div",{className:"flex min-h-14 items-center justify-between border-b px-4",children:[p.jsxs("div",{children:[p.jsx("div",{className:"font-semibold",children:"Settings"}),p.jsx("div",{className:"text-xs opacity-65",children:"Preferences are saved for this documentation."})]}),p.jsx("button",{type:"button","aria-label":"Close settings",className:"inline-flex h-11 w-11 items-center justify-center rounded-md",onClick:h,children:p.jsx(gd,{className:"h-5 w-5"})})]}),p.jsxs("div",{className:"flex-1 space-y-6 overflow-y-auto p-4",children:[p.jsxs("section",{"aria-labelledby":"appearance-settings-heading",children:[p.jsx("h2",{id:"appearance-settings-heading",className:"mb-1 text-sm font-semibold",children:c?.viewerTheme||"Appearance"}),p.jsx("p",{className:"mb-3 text-xs opacity-65",children:"Override the documentation host theme on this device."}),p.jsxs("select",{"aria-label":c?.viewerTheme||"Viewer theme",className:`w-full rounded-md border px-3 py-2 text-sm ${A}`,value:r||"host",onChange:T=>d(T.target.value==="host"?void 0:T.target.value),children:[p.jsxs("option",{value:"host",children:["Use documentation default (",n,")"]}),p.jsx("option",{value:"light",children:c?.lightTheme||"Light"}),p.jsx("option",{value:"dark",children:c?.darkTheme||"Dark"}),p.jsx("option",{value:"high-contrast",children:c?.highContrast||"High contrast"})]})]}),p.jsxs("section",{"aria-labelledby":"expansion-settings-heading",children:[p.jsx("h2",{id:"expansion-settings-heading",className:"mb-1 text-sm font-semibold",children:"Default expanded sections"}),p.jsx("p",{className:"mb-3 text-xs opacity-65",children:"This preference overrides the documentation author's default. Opening or closing a section manually remains temporary."}),p.jsxs("select",{ref:b,"aria-label":"Default expanded sections",className:`w-full rounded-md border px-3 py-2 text-sm ${A}`,value:TO(s),onChange:T=>{const D=T.target.value;f(D==="host"?void 0:D==="custom"?[...a]:D)},children:[p.jsx("option",{value:"host",children:"Use documentation default"}),p.jsx("option",{value:"minimal",children:"Minimal"}),p.jsx("option",{value:"documentation",children:"Documentation"}),p.jsx("option",{value:"interactive",children:"Interactive"}),p.jsx("option",{value:"all",children:"All sections"}),p.jsx("option",{value:"custom",children:"Custom sections"})]}),Array.isArray(s)&&p.jsxs("fieldset",{className:"mt-4 space-y-2",children:[p.jsx("legend",{className:"mb-2 text-xs font-medium uppercase tracking-wide opacity-65",children:"Custom sections"}),Cs.map(T=>p.jsxs("label",{className:"flex min-h-9 items-center gap-2 text-sm",children:[p.jsx("input",{type:"checkbox",checked:C.includes(T),onChange:D=>{const j=new Set(C);D.target.checked?j.add(T):j.delete(T),f(Cs.filter(E=>j.has(E)))}}),NO[T]]},T))]}),s!==void 0&&p.jsx("button",{type:"button",className:"mt-5 rounded-md border px-3 py-2 text-sm",onClick:()=>f(void 0),children:"Reset to documentation defaults"})]})]})]})]})};function OO(t){return Array.from(t.querySelectorAll('button:not([disabled]), select:not([disabled]), input:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')).filter(e=>e.getAttribute("aria-hidden")!=="true")}const MO=({open:t,theme:e,loading:n,error:r,snapshot:s,onClose:a,onEndpointSelect:c,messages:d})=>{const f=I.useRef(null),h=I.useRef(null);if(I.useEffect(()=>{if(!t||typeof document>"u")return;const T=document.activeElement instanceof HTMLElement?document.activeElement:null,D=document.body.style.overflow;document.body.style.overflow="hidden",h.current?.focus();const j=E=>{if(E.key==="Escape"){E.preventDefault(),a();return}if(E.key!=="Tab"||!f.current)return;const O=OO(f.current);if(O.length===0){E.preventDefault(),f.current.focus();return}const R=O[0],B=O[O.length-1],M=document.activeElement;E.shiftKey&&(M===R||!f.current.contains(M))?(E.preventDefault(),B.focus()):!E.shiftKey&&(M===B||!f.current.contains(M))&&(E.preventDefault(),R.focus())};return document.addEventListener("keydown",j),()=>{document.body.style.overflow=D,document.removeEventListener("keydown",j),T?.isConnected&&T.focus()}},[t,a]),!t)return null;const g=e==="dark",b=g?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900",v=g?"text-gray-400":"text-gray-600",S=g?"border-red-800 bg-red-950/50 text-red-200":"border-red-300 bg-red-50 text-red-800",A=g?"border-amber-700 bg-amber-950/50 text-amber-200":"border-amber-300 bg-amber-50 text-amber-900",C=g?"text-green-300":"text-green-700";return p.jsxs("div",{className:"fixed inset-0 z-50",children:[p.jsx("button",{tabIndex:-1,className:"absolute inset-0 bg-black/40","aria-label":d?.closeRuntimeIntelligence||"Close runtime intelligence",onClick:a}),p.jsxs("section",{ref:f,role:"dialog","aria-modal":"true","aria-labelledby":"runtime-intelligence-heading",tabIndex:-1,className:`absolute inset-y-0 right-0 w-[min(92vw,32rem)] overflow-y-auto border-l p-5 shadow-2xl ${b}`,children:[p.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4",children:[p.jsxs("div",{children:[p.jsxs("div",{id:"runtime-intelligence-heading",className:"flex items-center gap-2 text-lg font-semibold",children:[p.jsx(dg,{className:"h-5 w-5"}),d?.runtimeIntelligence||"Runtime intelligence"]}),p.jsx("p",{className:`mt-1 text-sm ${v}`,children:d?.runtimeIntelligenceDescription||"Live route presence from the backend hosting this documentation."})]}),p.jsx("button",{ref:h,className:"inline-flex h-10 w-10 items-center justify-center rounded-md border","aria-label":d?.closeRuntimeIntelligencePanel||"Close runtime intelligence panel",onClick:a,children:p.jsx(gd,{className:"h-4 w-4"})})]}),n&&p.jsx("p",{className:v,children:d?.inspectingRuntimeRoutes||"Inspecting runtime routes…"}),r&&p.jsx("div",{role:"alert",className:`rounded-lg border p-3 text-sm ${S}`,children:r}),s&&p.jsxs("div",{className:"space-y-5",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[p.jsxs("div",{className:"rounded-lg border p-3",children:[p.jsx("div",{className:v,children:d?.framework||"Framework"}),p.jsxs("div",{className:"font-semibold",children:[s.framework,s.frameworkVersion?` ${s.frameworkVersion}`:""]})]}),p.jsxs("div",{className:"rounded-lg border p-3",children:[p.jsx("div",{className:v,children:d?.matched||"Matched"}),p.jsxs("div",{className:"font-semibold",children:[s.summary.matched," / ",s.summary.documented]})]}),p.jsxs("div",{className:"col-span-2 rounded-lg border p-3",children:[p.jsx("div",{className:v,children:d?.runtime||"Runtime"}),p.jsxs("div",{className:"font-semibold",children:[s.runtime.name," ",s.runtime.version]}),p.jsxs("div",{className:`mt-1 text-xs ${v}`,children:[s.runtime.platform," · ",s.runtime.arch]})]}),(s.serverOrigin||s.server?.localPort)&&p.jsxs("div",{className:"col-span-2 rounded-lg border p-3",children:[p.jsx("div",{className:v,children:d?.runtimeServer||"Runtime server"}),s.serverOrigin&&p.jsx("code",{className:"block break-all text-xs",children:s.serverOrigin}),s.server?.localPort&&p.jsxs("div",{className:`mt-1 text-xs ${v}`,children:[d?.backendListenerPort||"Backend listener port"," ",s.server.localPort]})]}),s.environment?.name&&p.jsxs("div",{className:"col-span-2 rounded-lg border p-3",children:[p.jsx("div",{className:v,children:d?.environment||"Environment"}),p.jsx("div",{className:"font-semibold",children:s.environment.name})]})]}),!s.discoveryComplete&&p.jsxs("div",{className:`flex gap-2 rounded-lg border p-3 text-sm ${A}`,children:[p.jsx(md,{className:"mt-0.5 h-4 w-4 shrink-0"}),d?.routeDiscoveryPartial||"Route discovery is partial; documented routes not observed at runtime may be false positives."]}),p.jsx(Tv,{title:d?.implementedButUndocumented||"Implemented but undocumented",routes:s.runtimeOnly,empty:d?.noUndocumentedRuntimeRoutes||"No undocumented runtime routes discovered.",theme:e,warning:!0,openLabel:d?.openRuntimeRoute||"Open runtime route"}),p.jsx(Tv,{title:d?.documentedButNotObserved||"Documented but not observed",routes:s.documentedOnly,empty:d?.everyDocumentedRouteObserved||"Every documented route was observed.",theme:e,openLabel:d?.openRuntimeRoute||"Open runtime route",onSelect:c?T=>{c(T.path,T.method),a()}:void 0}),s.summary.runtimeOnly===0&&s.summary.documentedOnly===0&&s.discoveryComplete&&p.jsxs("div",{className:`flex items-center gap-2 text-sm ${C}`,children:[p.jsx(Oo,{className:"h-4 w-4"}),d?.runtimeAligned||"Runtime routes and OpenAPI paths are aligned."]})]})]})]})};function Tv({title:t,routes:e,empty:n,theme:r,warning:s=!1,onSelect:a,openLabel:c="Open runtime route"}){const d=r==="dark",f=d?"text-gray-400":"text-gray-600",h=s?d?"border-amber-700":"border-amber-300":"";return p.jsxs("section",{children:[p.jsxs("h3",{className:"mb-2 font-semibold",children:[t," ",p.jsxs("span",{className:f,children:["(",e.length,")"]})]}),e.length?p.jsx("div",{className:"space-y-2",children:e.map(g=>a?p.jsxs("button",{type:"button","aria-label":`${c} ${g.method} ${g.path}`,className:`flex w-full gap-2 rounded border p-2 text-left text-sm transition hover:border-blue-500 hover:bg-blue-500/10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 ${h}`,onClick:()=>a(g),children:[p.jsx("span",{className:"w-14 shrink-0 font-semibold",children:g.method}),p.jsx("code",{className:"break-all",children:g.path})]},`${g.method}:${g.path}`):p.jsxs("div",{className:`flex gap-2 rounded border p-2 text-sm ${h}`,children:[p.jsx("span",{className:"w-14 shrink-0 font-semibold",children:g.method}),p.jsx("code",{className:"break-all",children:g.path})]},`${g.method}:${g.path}`))}):p.jsx("p",{className:`text-sm ${f}`,children:n})]})}function RO(t,e,n){if(!n)return null;const r=t.folders.find(c=>c.id===n&&c.collectionId===e);if(!r)return new Set;const s=new Set([r.id]);let a=!0;for(;a;){a=!1;for(const c of t.folders)c.collectionId!==e||!c.parentFolderId||s.has(c.id)||s.has(c.parentFolderId)&&(s.add(c.id),a=!0)}return s}function Ic(t,e,n){const r=RO(t,e,n);return t.requests.filter(s=>s.collectionId!==e?!1:r?!!s.folderId&&r.has(s.folderId):!0)}function DO(t,e){const n=new Map(t.map(c=>[c.id,c])),r=[],s=new Set;let a=n.get(e);for(;a&&!s.has(a.id);)s.add(a.id),r.unshift(a.name),a=a.parentFolderId?n.get(a.parentFolderId):void 0;return r.join(" / ")}function jv(t,e,n){const r=t.collections.find(a=>a.id===e)?.name||"Deleted collection";if(!n)return r;const s=DO(t.folders.filter(a=>a.collectionId===e),n);return s?`${r} / ${s}`:`${r} / Deleted folder`}function _O(t){return!t.error&&!t.scriptError&&t.scriptTests.every(e=>e.passed)}async function LO(t){const e=Ic(t.workspace,t.collectionId,t.folderId),n=t.runId||wn("run"),r=t.runName||jv(t.workspace,t.collectionId,t.folderId);let s=t.workspace;const a=[];let c=t.signal?.aborted===!0;for(let g=0;g<e.length&&!c;g+=1){if(t.signal?.aborted){c=!0;break}const b=e[g];t.onRequestStart?.(b,g,e.length);const v=$0(s,t.collectionId),S=Xd(s),A={...t.externalEnvironmentVariables||{},...S},C={...v,...t.externalVariables||{},...A},T=await vv({request:b.request,scripts:b.scripts,credentials:t.credentials,requestInterceptor:t.requestInterceptor,hostExecution:t.hostExecution,resolveAuth:R=>B0(s,b.collectionId,b.folderId,R||{type:"none"}),variables:C,collectionVariables:v,externalVariables:t.externalVariables,environmentVariables:A,signal:t.signal,fetcher:t.fetcher,now:t.now,onCollectionChanges:R=>{s=q0(s,b.collectionId,R),t.onCollectionChanges?.(R)},onEnvironmentChanges:R=>{s=Jd(s,R),t.onEnvironmentChanges?.(R)}}),D=t.signal?.aborted===!0,j=!D&&_O(T);let E;T.result&&!D&&(s=L0(s,{...T.result,collectionId:b.collectionId,folderId:b.folderId,runId:n,runName:r,runIndex:g+1,runTotal:e.length,runPassed:j}),E=s.history[0]?.id);const O={requestId:b.id,requestName:b.name,collectionId:b.collectionId,folderId:b.folderId,passed:j,cancelled:D,historyEntryId:E,outcome:T};if(a.push(O),t.onRequestComplete?.(O,g,e.length),D){c=!0;break}if(!O.passed&&t.stopOnFailure&&g<e.length-1){c=!0;break}}const d=a.filter(g=>g.passed).length,f=a.filter(g=>g.cancelled).length,h=a.filter(g=>!g.passed&&!g.cancelled).length;return{runId:n,runName:r,collectionId:t.collectionId,folderId:t.folderId,total:e.length,completed:a.length,passed:d,failed:h,cancelled:f,stopped:c,items:a,workspace:s}}function Xr(){return new Date().toISOString()}const BO=({request:t,scripts:e,onLoadRequest:n,onSelectedCollectionChange:r,onSelectedFolderChange:s,onRunCollection:a,onRunFolder:c,selectedCollectionId:d,selectedFolderId:f="",workspace:h,onWorkspaceChange:g,hostExecution:b,theme:v})=>{const[S,A]=I.useState(""),[C,T]=I.useState(""),[D,j]=I.useState(""),[E,O]=I.useState(null),R=h.collections.find(se=>se.id===d)||h.collections[0],B=I.useMemo(()=>h.folders.filter(se=>se.collectionId===R?.id),[R?.id,h.folders]),M=I.useMemo(()=>h.requests.filter(se=>se.collectionId===R?.id),[R?.id,h.requests]),z=B.find(se=>se.id===f),F=I.useMemo(()=>new Map(B.map(se=>[se.id,se])),[B]),X=I.useMemo(()=>{const se=[],de=new Set,ge=(Te,Ie)=>{B.filter(Xe=>Xe.parentFolderId===Te).forEach(Xe=>{de.has(Xe.id)||(de.add(Xe.id),se.push({folder:Xe,depth:Ie}),ge(Xe.id,Ie+1))})};return ge(void 0,0),B.forEach(Te=>{de.has(Te.id)||(de.add(Te.id),se.push({folder:Te,depth:0}),ge(Te.id,1))}),se},[B]),W=se=>{const de=[],ge=new Set;let Te=F.get(se);for(;Te&&!ge.has(Te.id);)ge.add(Te.id),de.unshift(Te.name),Te=Te.parentFolderId?F.get(Te.parentFolderId):void 0;return de.join(" / ")};I.useEffect(()=>{r?.(R?.id)},[r,R?.id]);const G=()=>{const se=S.trim();if(!se)return;const de=Xr(),ge=wn("collection");g(Te=>({...Te,collections:[...Te.collections,{id:ge,name:se,auth:{type:"none"},variables:[],createdAt:de,updatedAt:de}]})),r?.(ge),s?.(""),A(""),O(null)},we=se=>{if(!R)return;const de=Xr();g(ge=>({...ge,collections:ge.collections.map(Te=>Te.id===R.id?{...Te,auth:se,updatedAt:de}:Te)}))},ye=se=>{if(!z)return;const de=Xr();g(ge=>({...ge,folders:ge.folders.map(Te=>Te.id===z.id?{...Te,auth:se,updatedAt:de}:Te)}))},xe=()=>{if(!R)return;const se=Xr();g(de=>({...de,collections:de.collections.map(ge=>ge.id===R.id?{...ge,variables:[...ge.variables,{id:wn("variable"),key:"",value:"",enabled:!0}],updatedAt:se}:ge)}))},_=(se,de)=>{if(!R)return;const ge=Xr();g(Te=>({...Te,collections:Te.collections.map(Ie=>Ie.id===R.id?{...Ie,variables:Ie.variables.map(Xe=>Xe.id===se?{...Xe,...de}:Xe),updatedAt:ge}:Ie)}))},ee=se=>{if(!R)return;const de=Xr();g(ge=>({...ge,collections:ge.collections.map(Te=>Te.id===R.id?{...Te,variables:Te.variables.filter(Ie=>Ie.id!==se),updatedAt:de}:Te)}))},he=()=>{const se=C.trim();if(!se||!R)return;const de=Xr(),ge=wn("folder");g(Te=>({...Te,folders:[...Te.folders,{id:ge,collectionId:R.id,parentFolderId:f||void 0,name:se,auth:{type:"inherit"},createdAt:de,updatedAt:de}]})),s?.(ge),T("")},$=()=>{if(!R)return;const se=D.trim()||t.url||"Untitled request",de=Xr();if(E){g(Te=>({...Te,requests:Te.requests.map(Ie=>Ie.id===E?{...Ie,collectionId:R.id,folderId:f||void 0,name:se,request:ai(t),scripts:cn(e),updatedAt:de}:Ie)}));return}const ge={id:wn("request"),collectionId:R.id,folderId:f||void 0,name:se,request:ai(t),scripts:cn(e),createdAt:de,updatedAt:de};g(Te=>({...Te,requests:[...Te.requests,ge]})),O(ge.id),j(se)},te=se=>{const de=h.requests.find(ge=>ge.id===se);de&&(O(de.id),r?.(de.collectionId),s?.(de.folderId||""),j(de.name),n(ai(de.request),de.scripts?cn(de.scripts):void 0,de.collectionId,de.folderId))},L=se=>{g(de=>({...de,requests:de.requests.filter(ge=>ge.id!==se)})),E===se&&(O(null),j(""))},P=se=>{const de=h.folders.find(ge=>ge.id===se);g(ge=>Ik(ge,se)),f===se&&s?.(de?.parentFolderId||"")},ue=se=>{const de=Uk(h,se);g(de),d===se&&(r?.(de.collections[0]?.id||""),s?.(""),O(null),j(""))},Se=v==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900",Ne=v==="dark"?"text-gray-400":"text-gray-500",Re=v==="dark"?"bg-blue-500/10 text-blue-300":"bg-blue-500/10 text-blue-700",Be=se=>p.jsxs("div",{className:`group flex items-center gap-1 rounded-md ${E===se.id?"bg-blue-500/10":""}`,children:[p.jsxs("button",{type:"button",className:"min-w-0 flex-1 rounded-md px-2 py-2 text-left text-sm hover:bg-blue-500/10","aria-label":`Load saved request ${se.name}`,onClick:()=>te(se.id),children:[p.jsx("span",{className:"mr-2 font-mono text-xs font-semibold text-blue-600",children:se.request.method.toUpperCase()}),p.jsx("span",{className:"truncate",children:se.name})]}),p.jsx("button",{type:"button",className:"rounded-md p-2 opacity-70 hover:opacity-100","aria-label":`Delete saved request ${se.name}`,onClick:()=>L(se.id),children:p.jsx(si,{className:"h-4 w-4"})})]},se.id),Ze=(se,de,ge=new Set)=>{if(ge.has(se.id))return null;const Te=new Set(ge);Te.add(se.id);const Ie=W(se.id),Xe=B.filter(ht=>ht.parentFolderId===se.id);return p.jsxs(og.Fragment,{children:[p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("button",{type:"button","aria-label":`Select folder ${Ie}`,className:`min-w-0 flex-1 rounded-md py-2 pr-2 text-left text-sm ${f===se.id?"bg-blue-500/10":""}`,style:{paddingLeft:`${8+de*16}px`},onClick:()=>s?.(se.id),children:se.name}),p.jsx("button",{type:"button",disabled:Ic(h,se.collectionId,se.id).length===0,"aria-label":`Run folder ${Ie}`,className:"rounded-md p-2 opacity-70 hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-30",onClick:()=>c?.(se.collectionId,se.id),children:p.jsx(la,{className:"h-4 w-4"})}),p.jsx("button",{type:"button","aria-label":`Delete folder ${Ie}`,className:"rounded-md p-2 opacity-70 hover:opacity-100",onClick:()=>P(se.id),children:p.jsx(si,{className:"h-4 w-4"})})]}),Xe.map(ht=>Ze(ht,de+1,Te))]},se.id)},_e=(se,de,ge=new Set)=>{if(ge.has(se.id))return null;const Te=new Set(ge);Te.add(se.id);const Ie=M.filter(ht=>ht.folderId===se.id),Xe=B.filter(ht=>ht.parentFolderId===se.id);return Ie.length===0&&Xe.length===0?null:p.jsxs("div",{className:"space-y-1",children:[Ie.length>0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:`mb-1 text-xs font-semibold uppercase tracking-wide ${Ne}`,style:{paddingLeft:`${8+de*12}px`},children:se.name}),p.jsx("div",{style:{paddingLeft:`${de*12}px`},children:Ie.map(Be)})]}),Xe.map(ht=>_e(ht,de+1,Te))]},se.id)},Ke=B.filter(se=>!se.parentFolderId),gt=f?W(f):"";return p.jsxs("section",{className:"space-y-4","aria-labelledby":"api-client-collections-heading",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(sA,{className:"h-4 w-4"}),p.jsx("h3",{id:"api-client-collections-heading",className:"font-semibold",children:"Collections"})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{"aria-label":"New collection name",className:`min-w-0 flex-1 rounded-md border px-2 py-2 text-sm ${Se}`,value:S,onChange:se=>A(se.target.value),placeholder:"New collection"}),p.jsx("button",{type:"button","aria-label":"Add collection",className:"rounded-md border px-3 py-2",onClick:G,children:p.jsx(ks,{className:"h-4 w-4"})})]}),p.jsx("div",{className:"space-y-2",children:h.collections.map(se=>p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("button",{type:"button",className:`min-w-0 flex-1 rounded-md px-2 py-2 text-left text-sm font-medium ${se.id===R?.id?Re:""}`,onClick:()=>{r?.(se.id),s?.(""),O(null),j("")},children:se.name}),p.jsx("button",{type:"button",disabled:Ic(h,se.id).length===0,"aria-label":`Run collection ${se.name}`,className:"rounded-md p-2 opacity-70 hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-30",onClick:()=>a?.(se.id),children:p.jsx(la,{className:"h-4 w-4"})}),h.collections.length>1&&p.jsx("button",{type:"button","aria-label":`Delete collection ${se.name}`,className:"rounded-md p-2 opacity-70 hover:opacity-100",onClick:()=>ue(se.id),children:p.jsx(si,{className:"h-4 w-4"})})]},se.id))}),R&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"space-y-2 border-t pt-3",children:[p.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide",children:"Collection authorization"}),p.jsx(K0,{auth:R.auth,label:"Collection",hostExecution:b,onChange:we,theme:v}),p.jsx("p",{className:`text-xs ${Ne}`,children:"Requests set to inherit use the nearest folder override, then this collection authorization."})]}),p.jsxs("div",{className:"space-y-2 border-t pt-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:"Collection variables"}),p.jsxs("button",{type:"button","aria-label":"Add collection variable",className:"inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs",onClick:xe,children:[p.jsx(ks,{className:"h-3.5 w-3.5"})," Add"]})]}),p.jsxs("div",{className:"space-y-2",children:[R.variables.map((se,de)=>p.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-1",children:[p.jsx("input",{"aria-label":`Collection variable ${de+1} enabled`,type:"checkbox",checked:se.enabled!==!1,onChange:ge=>_(se.id,{enabled:ge.target.checked})}),p.jsx("input",{"aria-label":`Collection variable ${de+1} key`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${Se}`,placeholder:"baseUrl",value:se.key,onChange:ge=>_(se.id,{key:ge.target.value})}),p.jsx("input",{"aria-label":`Collection variable ${de+1} value`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${Se}`,placeholder:"https://api.example.com",value:se.value,onChange:ge=>_(se.id,{value:ge.target.value})}),p.jsx("button",{type:"button","aria-label":`Remove collection variable ${de+1}`,className:"rounded-md p-1.5 opacity-70 hover:opacity-100",onClick:()=>ee(se.id),children:p.jsx(si,{className:"h-3.5 w-3.5"})})]},se.id)),R.variables.length===0&&p.jsxs("p",{className:`text-xs ${Ne}`,children:["Collection variables provide reusable defaults such as ",p.jsx("code",{children:"{{baseUrl}}"}),". Active environment values override matching collection keys."]})]})]}),p.jsxs("div",{className:"space-y-1 border-t pt-3",children:[p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{"aria-label":"New folder name",className:`min-w-0 flex-1 rounded-md border px-2 py-2 text-sm ${Se}`,value:C,onChange:se=>T(se.target.value),placeholder:"Folder"}),p.jsx("button",{type:"button","aria-label":"Add folder",className:"rounded-md border px-3 py-2",onClick:he,children:p.jsx(iA,{className:"h-4 w-4"})})]}),p.jsx("p",{className:`text-xs ${Ne}`,children:gt?`New folders are created inside ${gt}.`:"New folders are created at the collection root."})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("button",{type:"button","aria-label":"Select collection root",className:`w-full rounded-md px-2 py-2 text-left text-sm ${f===""?"bg-blue-500/10":""}`,onClick:()=>s?.(""),children:"Unfiled / collection root"}),Ke.map(se=>Ze(se,0))]}),z&&p.jsxs("div",{className:"space-y-2 border-t pt-3",children:[p.jsxs("div",{className:"text-xs font-semibold uppercase tracking-wide",children:["Folder authorization — ",gt]}),p.jsx(K0,{auth:z.auth,label:"Folder",allowInherit:!0,hostExecution:b,onChange:ye,theme:v})]}),p.jsxs("div",{className:"space-y-2 border-t pt-3",children:[p.jsx("input",{"aria-label":"Saved request name",className:`w-full rounded-md border px-2 py-2 text-sm ${Se}`,value:D,onChange:se=>j(se.target.value),placeholder:"Request name"}),p.jsxs("select",{"aria-label":"Saved request folder",className:`w-full rounded-md border px-2 py-2 text-sm ${Se}`,value:f,onChange:se=>s?.(se.target.value),children:[p.jsx("option",{value:"",children:"Unfiled"}),X.map(({folder:se,depth:de})=>p.jsx("option",{value:se.id,children:`${"— ".repeat(de)}${se.name}`},se.id))]}),p.jsxs("button",{type:"button",className:"inline-flex w-full items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm font-medium",onClick:$,children:[p.jsx(fA,{className:"h-4 w-4"})," ",E?"Update request":"Save request"]})]}),p.jsxs("div",{className:"space-y-3 border-t pt-3",children:[M.filter(se=>!se.folderId).map(Be),Ke.map(se=>_e(se,0)),M.length===0&&p.jsx("p",{className:`px-2 text-xs ${Ne}`,children:"Save the current request to build a reusable collection."})]})]})]})};function qa(){return new Date().toISOString()}const $O=({workspace:t,onWorkspaceChange:e,theme:n})=>{const[r,s]=I.useState(""),a=t.environments.find(S=>S.id===t.activeEnvironmentId),c=n==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900",d=n==="dark"?"text-gray-400":"text-gray-500",f=()=>{const S=r.trim();if(!S)return;const A=qa(),C=wn("environment");e(T=>({...T,environments:[...T.environments,{id:C,name:S,variables:[],createdAt:A,updatedAt:A}],activeEnvironmentId:C})),s("")},h=S=>{if(!a)return;const A=qa();e(C=>({...C,environments:C.environments.map(T=>T.id===a.id?{...T,name:S,updatedAt:A}:T)}))},g=()=>{if(!a)return;const S=qa();e(A=>({...A,environments:A.environments.map(C=>C.id===a.id?{...C,variables:[...C.variables,{id:wn("variable"),key:"",value:"",enabled:!0}],updatedAt:S}:C)}))},b=(S,A)=>{if(!a)return;const C=qa();e(T=>({...T,environments:T.environments.map(D=>D.id===a.id?{...D,variables:D.variables.map(j=>j.id===S?{...j,...A}:j),updatedAt:C}:D)}))},v=S=>{if(!a)return;const A=qa();e(C=>({...C,environments:C.environments.map(T=>T.id===a.id?{...T,variables:T.variables.filter(D=>D.id!==S),updatedAt:A}:T)}))};return p.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-environment-heading",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx("h3",{id:"api-client-environment-heading",className:"font-semibold",children:"Environment"}),a&&p.jsx("button",{type:"button","aria-label":`Delete environment ${a.name}`,className:"rounded-md p-2 opacity-70 hover:opacity-100",onClick:()=>e(S=>Hk(S,a.id)),children:p.jsx(si,{className:"h-4 w-4"})})]}),p.jsxs("select",{"aria-label":"Active environment",className:`w-full rounded-md border px-2 py-2 text-sm ${c}`,value:t.activeEnvironmentId||"",onChange:S=>e(A=>({...A,activeEnvironmentId:S.target.value||void 0})),children:[p.jsx("option",{value:"",children:"No environment"}),t.environments.map(S=>p.jsx("option",{value:S.id,children:S.name},S.id))]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{"aria-label":"New environment name",className:`min-w-0 flex-1 rounded-md border px-2 py-2 text-sm ${c}`,value:r,onChange:S=>s(S.target.value),placeholder:"New environment"}),p.jsx("button",{type:"button","aria-label":"Add environment",className:"rounded-md border px-3 py-2",onClick:f,children:p.jsx(ks,{className:"h-4 w-4"})})]}),a&&p.jsxs("div",{className:"space-y-3",children:[p.jsx("input",{"aria-label":"Environment name",className:`w-full rounded-md border px-2 py-2 text-sm font-medium ${c}`,value:a.name,onChange:S=>h(S.target.value)}),p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:"Variables"}),p.jsxs("button",{type:"button","aria-label":"Add environment variable",className:"inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs",onClick:g,children:[p.jsx(ks,{className:"h-3.5 w-3.5"})," Add"]})]}),p.jsxs("div",{className:"space-y-2",children:[a.variables.map((S,A)=>p.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-1",children:[p.jsx("input",{"aria-label":`Environment variable ${A+1} enabled`,type:"checkbox",checked:S.enabled!==!1,onChange:C=>b(S.id,{enabled:C.target.checked})}),p.jsx("input",{"aria-label":`Environment variable ${A+1} key`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${c}`,placeholder:"baseUrl",value:S.key,onChange:C=>b(S.id,{key:C.target.value})}),p.jsx("input",{"aria-label":`Environment variable ${A+1} value`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${c}`,placeholder:"https://api.example.com",value:S.value,onChange:C=>b(S.id,{value:C.target.value})}),p.jsx("button",{type:"button","aria-label":`Remove environment variable ${A+1}`,className:"rounded-md p-1.5 opacity-70 hover:opacity-100",onClick:()=>v(S.id),children:p.jsx(si,{className:"h-3.5 w-3.5"})})]},S.id)),a.variables.length===0&&p.jsxs("p",{className:`text-xs ${d}`,children:["Add variables such as ",p.jsx("code",{children:"{{baseUrl}}"})," or ",p.jsx("code",{children:"{{token}}"}),"."]})]})]})]})};function qO(t){const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleString()}const zO=({workspace:t,onWorkspaceChange:e,onLoadRequest:n,onViewAll:r,theme:s})=>{const a=s==="dark"?"text-gray-400":"text-gray-500",c=f=>{const h=t.history.find(g=>g.id===f);h&&n(ai(h.request),h.scripts?cn(h.scripts):void 0,h.collectionId,h.folderId)},d=f=>{const h=t.history.find(g=>g.id===f);h&&(typeof window<"u"&&!window.confirm(`Delete this history entry?
|
|
72
76
|
|
|
73
|
-
`).trim(),o=a.tests.filter(Boolean).join(`
|
|
77
|
+
${h.executedMethod.toUpperCase()} ${h.resolvedUrl}`)||e(g=>({...g,history:g.history.filter(b=>b.id!==f)})))};return p.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-history-heading",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(dd,{className:"h-4 w-4"}),p.jsx("h3",{id:"api-client-history-heading",className:"font-semibold",children:"Recent history"})]}),t.history.length>0&&r&&p.jsx("button",{type:"button",className:`text-xs underline underline-offset-2 ${a}`,onClick:r,children:"View all"})]}),p.jsxs("div",{className:"space-y-1",children:[t.history.slice(0,5).map(f=>{const h=f.status!==void 0?`${f.status}${f.statusText?` ${f.statusText}`:""}`:f.error?"Error":"Sent",g=f.responseTime!==void 0?` · ${f.responseTime} ms`:"",b=f.scriptTests?.filter(S=>S.passed).length||0,v=f.scriptTests?.length?`${b}/${f.scriptTests.length} tests passed`:f.scriptError?"Script error":void 0;return p.jsxs("div",{className:"group flex items-start gap-1 rounded-md",children:[p.jsxs("button",{type:"button",className:"min-w-0 flex-1 rounded-md px-2 py-2 text-left hover:bg-blue-500/10","aria-label":`Load history request ${f.executedMethod.toUpperCase()} ${f.resolvedUrl}`,onClick:()=>c(f.id),children:[p.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[p.jsx("span",{className:"font-mono font-semibold text-blue-600",children:f.executedMethod.toUpperCase()}),p.jsxs("span",{className:f.error?"text-red-600":a,children:[h,g]})]}),p.jsx("div",{className:"truncate font-mono text-xs",title:f.resolvedUrl,children:f.resolvedUrl}),v&&p.jsx("div",{className:`mt-1 text-[11px] ${f.scriptError?"text-red-600":a}`,children:v}),p.jsx("div",{className:`mt-1 text-[11px] ${a}`,children:qO(f.createdAt)})]}),p.jsx("button",{type:"button",className:"rounded-md p-2 opacity-70 hover:opacity-100","aria-label":`Delete history request ${f.executedMethod.toUpperCase()} ${f.resolvedUrl}`,onClick:()=>d(f.id),children:p.jsx(si,{className:"h-4 w-4"})})]},f.id)}),t.history.length===0&&p.jsx("div",{className:`rounded-md border border-dashed px-3 py-3 text-xs ${a}`,children:"Sent requests appear here for quick replay. Import or open a collection request, then Send it to start building history."})]}),t.history.length>0&&r&&p.jsxs("button",{type:"button",className:"w-full rounded-md border px-3 py-2 text-xs font-medium hover:bg-blue-500/10",onClick:r,children:["Open full history · ",t.history.length]})]})};function HO(t){return!!t.error||!!t.scriptError||t.status!==void 0&&t.status>=400||!!t.scriptTests?.some(e=>!e.passed)}function IO(t,e){const n=e.query.trim().toLowerCase();return t.history.filter(r=>{const s=r.collectionId?t.collections.find(g=>g.id===r.collectionId)?.name||"Deleted collection":"",a=r.folderId?t.folders.find(g=>g.id===r.folderId)?.name||"Deleted folder":"",c=!n||[r.executedMethod,r.resolvedUrl,r.status,r.statusText,s,a,r.runName].filter(g=>g!==void 0).some(g=>String(g).toLowerCase().includes(n)),d=e.method==="all"||r.executedMethod.toUpperCase()===e.method,f=HO(r),h=e.outcome==="all"||e.outcome==="success"&&!f||e.outcome==="failed"&&f||e.outcome==="tests"&&!!r.scriptTests?.length;return c&&d&&h})}function UO(t){const e=new Set,n=[];for(const r of t){if(!r.runId){n.push({kind:"entry",entry:r});continue}if(e.has(r.runId))continue;e.add(r.runId);const s=t.filter(c=>c.runId===r.runId).sort((c,d)=>(c.runIndex||Number.MAX_SAFE_INTEGER)-(d.runIndex||Number.MAX_SAFE_INTEGER)),a=Math.max(s.length,...s.map(c=>c.runTotal||0));n.push({kind:"run",group:{runId:r.runId,runName:r.runName||"Collection run",entries:s,total:a,captured:s.length,passed:s.filter(c=>c.runPassed===!0).length,failed:s.filter(c=>c.runPassed===!1).length,cancelled:0}})}return n}function Ev(t){const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleString()}function Lh(t){return!!t.error||!!t.scriptError||t.status!==void 0&&t.status>=400||!!t.scriptTests?.some(e=>!e.passed)}function Bh(t){return t.error?"Request failed":t.status!==void 0?`${t.status}${t.statusText?` ${t.statusText}`:""}`:"Sent"}function FO(t){return(t||[]).filter(e=>e.enabled!==!1&&(e.key.trim()||e.value.trim()))}function Ov({title:t,values:e,mutedClass:n}){const r=FO(e);return r.length===0?null:p.jsxs("section",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:t}),p.jsx("div",{className:"overflow-hidden rounded-md border",children:r.map((s,a)=>p.jsxs("div",{className:"grid grid-cols-[minmax(8rem,0.35fr)_minmax(0,1fr)] gap-3 border-b px-3 py-2 text-xs last:border-b-0",children:[p.jsx("span",{className:"break-all font-mono font-medium",children:s.key||"—"}),p.jsx("span",{className:`break-all font-mono ${n}`,children:s.value})]},`${s.key}:${a}`))})]})}function Mv(t){const e=[`${t.passed} runner passed`,`${t.failed} runner failed`];return t.cancelled&&e.push(`${t.cancelled} cancelled`),e.join(" · ")}const VO=({workspace:t,onWorkspaceChange:e,onLoadRequest:n,onBack:r,theme:s,initialEntryId:a,initialRunId:c})=>{const[d,f]=I.useState(""),[h,g]=I.useState("all"),[b,v]=I.useState("all"),[S,A]=I.useState(c?void 0:a||t.history[0]?.id),[C,T]=I.useState(c),D=s==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",j=s==="dark"?"border-gray-700 bg-gray-800/60 text-gray-100":"border-gray-200 bg-gray-50 text-gray-900",E=s==="dark"?"text-gray-400":"text-gray-500",O=s==="dark"?"border-gray-700 bg-gray-950 text-gray-100":"border-gray-200 bg-white text-gray-900",R=I.useMemo(()=>IO(t,{query:d,method:h,outcome:b}),[h,b,d,t]),B=I.useMemo(()=>UO(R),[R]),M=C&&B.find($=>$.kind==="run"&&$.group.runId===C)?.kind==="run"?B.find($=>$.kind==="run"&&$.group.runId===C).group:void 0,z=M?void 0:R.find($=>$.id===S)||R[0],F=z?.collectionId?t.collections.find($=>$.id===z.collectionId):void 0,X=z?.folderId?t.folders.find($=>$.id===z.folderId):void 0,W=()=>{A(void 0),T(void 0)},G=$=>{A($),T(void 0)},we=$=>{T($),A(void 0)},ye=$=>{n(ai($.request),$.scripts?cn($.scripts):void 0,$.collectionId,$.folderId),r()},xe=$=>{window.confirm("Delete this history entry? This cannot be undone.")&&(e(te=>({...te,history:te.history.filter(L=>L.id!==$)})),S===$&&A(void 0))},_=()=>{window.confirm("Clear all request history? This cannot be undone.")&&(e($=>({...$,history:[]})),W())},ee=z?.responseHeaders||[],he=z?.scriptTests?.filter($=>$.passed).length||0;return p.jsx("section",{className:`rounded-xl border p-4 md:p-5 ${j}`,"aria-labelledby":"api-client-history-page-heading",children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs("header",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:r,children:[p.jsx(Eo,{className:"h-4 w-4"})," Client"]}),p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(dd,{className:"h-5 w-5"}),p.jsx("h2",{id:"api-client-history-page-heading",className:"text-lg font-semibold",children:"Request history"})]}),p.jsxs("p",{className:`text-xs ${E}`,children:[t.history.length," persisted request",t.history.length===1?"":"s"," · newest first"]})]})]}),t.history.length>0&&p.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 self-start rounded-md border px-3 py-2 text-sm text-red-600",onClick:_,children:[p.jsx(si,{className:"h-4 w-4"})," Clear history"]})]}),p.jsxs("div",{className:"grid gap-2 md:grid-cols-[minmax(0,1fr)_10rem_12rem]",children:[p.jsxs("label",{className:"relative",children:[p.jsx("span",{className:"sr-only",children:"Search history"}),p.jsx(gg,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 ${E}`}),p.jsx("input",{"aria-label":"Search history",className:`w-full rounded-md border py-2 pl-9 pr-3 text-sm ${D}`,value:d,onChange:$=>{f($.target.value),W()},placeholder:"Search URL, status, collection or run…"})]}),p.jsxs("select",{"aria-label":"History method filter",className:`rounded-md border px-3 py-2 text-sm ${D}`,value:h,onChange:$=>{g($.target.value),W()},children:[p.jsx("option",{value:"all",children:"All methods"}),["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map($=>p.jsx("option",{value:$,children:$},$))]}),p.jsxs("select",{"aria-label":"History outcome filter",className:`rounded-md border px-3 py-2 text-sm ${D}`,value:b,onChange:$=>{v($.target.value),W()},children:[p.jsx("option",{value:"all",children:"All outcomes"}),p.jsx("option",{value:"success",children:"Successful HTTP"}),p.jsx("option",{value:"failed",children:"HTTP / script failures"}),p.jsx("option",{value:"tests",children:"With tests"})]})]}),p.jsxs("div",{className:"grid min-h-[32rem] gap-4 lg:grid-cols-[minmax(18rem,0.85fr)_minmax(0,1.35fr)]",children:[p.jsxs("div",{className:"max-h-[48rem] space-y-2 overflow-auto rounded-lg border p-2",children:[B.map($=>{if($.kind==="entry"){const P=$.entry,ue=z?.id===P.id,Se=Lh(P),Ne=P.collectionId?t.collections.find(Re=>Re.id===P.collectionId)?.name||"Deleted collection":void 0;return p.jsxs("button",{type:"button",className:`w-full rounded-md border px-3 py-3 text-left transition ${ue?"border-blue-500 bg-blue-500/10":"border-transparent hover:bg-blue-500/5"}`,onClick:()=>G(P.id),children:[p.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[p.jsx("span",{className:"font-mono font-semibold text-blue-600",children:P.executedMethod.toUpperCase()}),p.jsxs("span",{className:Se?"text-red-600":E,children:[Bh(P),P.responseTime!==void 0?` · ${P.responseTime} ms`:""]})]}),p.jsx("div",{className:"mt-1 truncate font-mono text-xs",title:P.resolvedUrl,children:P.resolvedUrl}),p.jsxs("div",{className:`mt-1 flex items-center justify-between gap-2 text-[11px] ${E}`,children:[p.jsx("span",{className:"truncate",children:Ne||"Unsaved request"}),p.jsx("span",{children:Ev(P.createdAt)})]})]},P.id)}const te=$.group,L=M?.runId===te.runId;return p.jsxs("div",{className:`rounded-lg border ${L?"border-blue-500 bg-blue-500/5":""}`,children:[p.jsxs("button",{type:"button","aria-label":`Open collection run ${te.runName}`,className:"w-full px-3 py-3 text-left",onClick:()=>we(te.runId),children:[p.jsx("div",{className:"text-xs font-semibold text-blue-600",children:"Collection run"}),p.jsx("div",{className:"mt-1 truncate text-sm font-medium",children:te.runName}),p.jsxs("div",{className:`mt-1 text-[11px] ${E}`,children:[te.captured,"/",te.total," history entries · ",Mv(te)]})]}),p.jsx("div",{className:"border-t px-2 py-1",children:te.entries.map(P=>p.jsxs("button",{type:"button",className:`w-full rounded-md px-2 py-2 text-left text-xs hover:bg-blue-500/10 ${z?.id===P.id?"bg-blue-500/10":""}`,onClick:()=>G(P.id),children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsxs("span",{children:[p.jsx("span",{className:"mr-2 text-[10px] text-gray-500",children:P.runIndex||"–"}),p.jsx("span",{className:"font-mono font-semibold text-blue-600",children:P.executedMethod.toUpperCase()})]}),p.jsx("span",{className:Lh(P)?"text-red-600":E,children:Bh(P)})]}),p.jsx("div",{className:"mt-1 truncate font-mono",title:P.resolvedUrl,children:P.resolvedUrl})]},P.id))})]},te.runId)}),R.length===0&&p.jsx("div",{className:`px-3 py-8 text-center text-sm ${E}`,children:t.history.length===0?"Send a request to start building history.":"No history entries match these filters."})]}),p.jsxs("div",{className:"min-w-0 rounded-lg border p-4",children:[M&&p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"border-b pb-4",children:[p.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-blue-600",children:"Collection run"}),p.jsx("h3",{className:"mt-1 text-lg font-semibold",children:M.runName}),p.jsxs("p",{className:`mt-1 text-sm ${E}`,children:[M.captured," / ",M.total," history entries captured · ",Mv(M)]}),p.jsx("p",{className:`mt-2 text-xs ${E}`,children:"Runner pass/fail is based on transport, scripts, and tests. An HTTP 4xx/5xx can therefore be a runner pass while still appearing as an HTTP failure in the request inspector."})]}),p.jsx("div",{className:"space-y-2",children:M.entries.map($=>p.jsxs("button",{type:"button","aria-label":`Inspect history ${$.runIndex||""}`,className:"w-full rounded-md border px-3 py-3 text-left hover:bg-blue-500/5",onClick:()=>G($.id),children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[p.jsxs("span",{children:[p.jsx("span",{className:`mr-2 text-xs ${E}`,children:$.runIndex||"–"}),p.jsx("span",{className:"font-mono font-bold text-blue-600",children:$.executedMethod.toUpperCase()})]}),p.jsxs("span",{className:$.runPassed===!1?"text-red-600":$.runPassed===!0?"text-green-600":E,children:[$.runPassed===!0?"Runner pass":$.runPassed===!1?"Runner fail":"Recorded",$.status!==void 0?` · HTTP ${$.status}`:""]})]}),p.jsx("div",{className:"mt-1 truncate font-mono text-xs",children:$.resolvedUrl})]},$.id))})]}),!M&&!z&&p.jsx("div",{className:`flex min-h-[20rem] items-center justify-center text-sm ${E}`,children:"Select a history entry or collection run to inspect it."}),z&&p.jsxs("div",{className:"space-y-5",children:[p.jsxs("div",{className:"space-y-2 border-b pb-4",children:[p.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[p.jsx("span",{className:"font-mono font-bold text-blue-600",children:z.executedMethod.toUpperCase()}),p.jsx("span",{className:Lh(z)?"text-red-600":E,children:Bh(z)}),z.responseTime!==void 0&&p.jsxs("span",{className:E,children:[z.responseTime," ms"]}),z.runPassed!==void 0&&p.jsx("span",{className:z.runPassed?"text-green-600":"text-red-600",children:z.runPassed?"Runner pass":"Runner fail"})]}),p.jsx("div",{className:"mt-1 break-all font-mono text-sm",children:z.resolvedUrl}),p.jsxs("div",{className:`mt-1 text-xs ${E}`,children:[Ev(z.createdAt),z.collectionId?` · ${F?.name||"Deleted collection"}`:"",z.folderId?` / ${X?.name||"Deleted folder"}`:"",z.runName?` · Run: ${z.runName}`:""]})]}),p.jsxs("div",{className:"flex shrink-0 gap-2",children:[p.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium hover:bg-blue-500/10",onClick:()=>ye(z),children:[p.jsx(dA,{className:"h-4 w-4"})," Open in client"]}),p.jsx("button",{type:"button","aria-label":"Delete selected history entry",className:"inline-flex min-h-10 items-center rounded-md border px-3 py-2 text-red-600",onClick:()=>xe(z.id),children:p.jsx(si,{className:"h-4 w-4"})})]})]}),z.error&&p.jsx("div",{className:"rounded-md border border-red-300 bg-red-500/10 px-3 py-2 text-sm text-red-700",children:z.error})]}),p.jsxs("section",{className:"space-y-3",children:[p.jsx("h3",{className:"font-semibold",children:"Request"}),p.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2",children:[p.jsxs("div",{children:[p.jsx("span",{className:E,children:"Original URL"}),p.jsx("div",{className:"mt-1 break-all font-mono",children:z.request.url})]}),p.jsxs("div",{children:[p.jsx("span",{className:E,children:"Content type"}),p.jsx("div",{className:"mt-1 font-mono",children:z.request.contentType||"—"})]})]}),p.jsx(Ov,{title:"Query parameters",values:z.request.query,mutedClass:E}),p.jsx(Ov,{title:"Headers",values:z.request.headers,mutedClass:E}),z.request.body&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Body"}),p.jsx("pre",{className:`max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md border p-3 text-xs ${O}`,children:z.request.body})]})]}),p.jsxs("section",{className:"space-y-3 border-t pt-4",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx("h3",{className:"font-semibold",children:"Response"}),z.responseBodyTruncated&&p.jsx("span",{className:"text-xs text-amber-600",children:"Body truncated in history"})]}),ee.length>0&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Headers"}),p.jsx("div",{className:"overflow-hidden rounded-md border",children:ee.map(([$,te],L)=>p.jsxs("div",{className:"grid grid-cols-[minmax(8rem,0.35fr)_minmax(0,1fr)] gap-3 border-b px-3 py-2 text-xs last:border-b-0",children:[p.jsx("span",{className:"break-all font-mono font-medium",children:$}),p.jsx("span",{className:`break-all font-mono ${E}`,children:te})]},`${$}:${L}`))})]}),z.responseBody!==void 0?p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Body"}),p.jsx("pre",{className:`max-h-96 overflow-auto whitespace-pre-wrap break-words rounded-md border p-3 text-xs ${O}`,children:z.responseBody||"(empty response body)"})]}):p.jsx("p",{className:`text-sm ${E}`,children:"Response payload was not captured for this older history entry."})]}),(z.scriptTests?.length||z.scriptError||z.scriptLogs?.length)&&p.jsxs("section",{className:"space-y-3 border-t pt-4",children:[p.jsx("h3",{className:"font-semibold",children:"Tests & console"}),z.scriptTests?.length?p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:`text-xs ${E}`,children:[he,"/",z.scriptTests.length," tests passed"]}),z.scriptTests.map(($,te)=>p.jsxs("div",{className:`rounded-md border px-3 py-2 text-sm ${$.passed?"":"border-red-300 bg-red-500/10 text-red-700"}`,children:[p.jsxs("span",{className:"font-medium",children:[$.passed?"✓":"✕"," ",$.name]}),$.error&&p.jsx("div",{className:"mt-1 text-xs",children:$.error})]},`${$.name}:${te}`))]}):null,z.scriptError&&p.jsx("div",{className:"rounded-md border border-red-300 bg-red-500/10 px-3 py-2 text-sm text-red-700",children:z.scriptError}),z.scriptLogs?.length?p.jsx("pre",{className:`max-h-56 overflow-auto whitespace-pre-wrap rounded-md border p-3 text-xs ${O}`,children:z.scriptLogs.join(`
|
|
78
|
+
`)}):null]}),(z.scripts?.preRequest.trim()||z.scripts?.tests.trim())&&p.jsxs("section",{className:"space-y-3 border-t pt-4",children:[p.jsx("h3",{className:"font-semibold",children:"Scripts used"}),z.scripts?.preRequest.trim()&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Pre-request"}),p.jsx("pre",{className:`max-h-56 overflow-auto whitespace-pre-wrap rounded-md border p-3 text-xs ${O}`,children:z.scripts.preRequest})]}),z.scripts?.tests.trim()&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Tests"}),p.jsx("pre",{className:`max-h-56 overflow-auto whitespace-pre-wrap rounded-md border p-3 text-xs ${O}`,children:z.scripts.tests})]})]})]})]})]})]})})};function pn(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function st(t){if(t==null)return"";if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);try{return JSON.stringify(t)}catch{return String(t)}}function Xn(t,e,n,r){t.push({code:e,path:n,message:r})}function Jr(t){return Array.isArray(t)?t.filter(pn):[]}function et(t,e,n){const r=Jr(t[e]).find(s=>s.key===n);return r?st(r.value):""}function PO(t){switch(t){case"authorization_code":return"authorizationCode";case"client_credentials":return"clientCredentials";case"password_credentials":case"password":return"password";case"implicit":return"implicit";case"access_token":return"accessToken";default:return}}function $h(t,e,n,r){if(!pn(t)||typeof t.type!="string")return{...e};const s=t.type.toLowerCase();if(s==="inherit")return{...e};if(s==="noauth")return{type:"none"};if(s==="bearer")return{type:"bearer",token:et(t,"bearer","token")};if(s==="basic")return{type:"basic",username:et(t,"basic","username"),password:et(t,"basic","password")};if(s==="apikey"){const c=et(t,"apikey","in").toLowerCase();return c==="cookie"?Xn(r,"postman-auth-host-execution",n,"Imported Postman cookie API key requires FlexDoc API host execution; the browser will not send this auth mode directly."):c&&c!=="header"&&c!=="query"&&Xn(r,"postman-auth-apikey-location",n,`Unsupported Postman API-key location "${c}"; imported as a header API key.`),{type:"apiKey",key:et(t,"apikey","key"),value:et(t,"apikey","value"),in:c==="query"?"query":c==="cookie"?"cookie":"header"}}if(s==="oauth2"){const c=et(t,"oauth2","scope"),d=PO(et(t,"oauth2","grant_type")),f=et(t,"oauth2","client_authentication").toLowerCase();return{type:"oauth2",accessToken:et(t,"oauth2","accessToken"),...d?{grantType:d}:{},authorizationUrl:et(t,"oauth2","authUrl")||void 0,tokenUrl:et(t,"oauth2","accessTokenUrl")||void 0,clientId:et(t,"oauth2","clientId")||void 0,clientSecret:et(t,"oauth2","clientSecret")||void 0,clientAuthentication:f==="header"||f==="basic"?"basic":"body",redirectUri:et(t,"oauth2","redirect_uri")||void 0,scopes:c?c.split(/[\s,]+/).filter(Boolean):void 0,username:et(t,"oauth2","username")||void 0,password:et(t,"oauth2","password")||void 0,refreshToken:et(t,"oauth2","refreshToken")||void 0}}const a=c=>Xn(r,"postman-auth-host-execution",n,`Imported Postman ${c} auth requires FlexDoc API host execution; the browser will not send this auth mode directly.`);if(s==="digest")return a("Digest"),{type:"digest",username:et(t,"digest","username"),password:et(t,"digest","password")};if(s==="hawk"){a("Hawk");const c=et(t,"hawk","algorithm").toLowerCase();return{type:"hawk",id:et(t,"hawk","authId")||et(t,"hawk","id"),key:et(t,"hawk","authKey")||et(t,"hawk","key"),algorithm:c==="sha1"?"sha1":"sha256",ext:et(t,"hawk","extraData")||et(t,"hawk","ext")||void 0}}if(s==="ntlm")return a("NTLM/Negotiate"),{type:"ntlm",username:et(t,"ntlm","username"),password:et(t,"ntlm","password"),domain:et(t,"ntlm","domain")||void 0,workstation:et(t,"ntlm","workstation")||void 0};if(s==="oauth1"){a("OAuth 1.0");const c=et(t,"oauth1","signatureMethod").toUpperCase();return{type:"oauth1",consumerKey:et(t,"oauth1","consumerKey"),consumerSecret:et(t,"oauth1","consumerSecret"),token:et(t,"oauth1","token")||void 0,tokenSecret:et(t,"oauth1","tokenSecret")||void 0,signatureMethod:c==="HMAC-SHA256"||c==="PLAINTEXT"?c:"HMAC-SHA1",realm:et(t,"oauth1","realm")||void 0}}return s==="awsv4"?(a("AWS Signature V4"),{type:"awsv4",accessKey:et(t,"awsv4","accessKey"),secretKey:et(t,"awsv4","secretKey"),sessionToken:et(t,"awsv4","sessionToken")||void 0,region:et(t,"awsv4","region"),service:et(t,"awsv4","service")}):(Xn(r,"postman-auth-unsupported",n,`Postman auth type "${t.type}" is not supported by FlexDoc and was left to inherited/default auth.`),{...e})}function Rv(t,e,n){return Jr(t).flatMap((r,s)=>{const a=st(r.key).trim();return a?[{id:wn("variable"),key:a,value:st(r.value),enabled:r.disabled!==!0&&r.enabled!==!1}]:(Xn(n,"postman-variable-empty-key",`${e}[${s}]`,"Skipped a Postman variable with an empty key."),[])})}function KO(t,e,n){const r=["pm.sendRequest","pm.globals","pm.iterationData","pm.cookies","pm.vault","pm.require","pm.execution","postman."].filter(a=>t.includes(a));let s=t.replace(/\bpm\.response\.to\.have\.status\(([^)\n]+)\)\s*;?/g,"flex.expect(flex.response?.code).to.equal($1);").replace(/\bpm\.response\.to\.have\.header\(([^)\n]+)\)\s*;?/g,"flex.expect(flex.response?.headers.has($1)).to.equal(true);").replace(/\bpm\.collectionVariables\b/g,"flex.collection").replace(/\bpm\.environment\b/g,"flex.environment").replace(/\bpm\.variables\b/g,"flex.variables").replace(/\bpm\.request\b/g,"flex.request").replace(/\bpm\.response\b/g,"flex.response").replace(/\bpm\.expect\b/g,"flex.expect").replace(/\bpm\.test\b/g,"flex.test").replace(/\bflex\.request\.headers\.add\s*\(/g,"flex.request.headers.upsert(");return/\bpm\./.test(s)&&r.push("other pm.* APIs"),r.length>0&&(Xn(n,"postman-script-partial-compatibility",e,`Imported script uses unsupported Postman APIs (${[...new Set(r)].join(", ")}); review the script before relying on it.`),s=`// Imported from Postman. Review unsupported API usage before relying on this script.
|
|
79
|
+
${s}`),s}function YO(t,e,n){return pn(t)?(t.src!==void 0&&Xn(n,"postman-script-src",e,"External Postman script sources are not fetched; only inline script.exec content is imported."),Array.isArray(t.exec)?t.exec.map(st).join(`
|
|
80
|
+
`):st(t.exec)):""}function Dv(t,e,n){const r={preRequest:[],tests:[]};return Jr(t).forEach((s,a)=>{const c=st(s.listen).toLowerCase();if(c!=="prerequest"&&c!=="test")return;const d=`${e}[${a}]`,f=YO(s.script,`${d}.script`,n).trim();if(!f)return;const h=KO(f,`${d}.script`,n);c==="prerequest"?r.preRequest.push(h):r.tests.push(h)}),r}function GO(t,e){return{preRequest:[...t.preRequest,...e.preRequest],tests:[...t.tests,...e.tests]}}function XO(t){const e=t.preRequest.filter(Boolean).join(`
|
|
74
81
|
|
|
75
|
-
`).trim();return r||o?{preRequest:r,tests:o}:void 0}function qf(a){try{return decodeURIComponent(a.replace(/\+/g," "))}catch{return a}}function Df(a){const r=a.split("#",1)[0],o=r.indexOf("?");if(o<0)return{url:r,query:[]};const u=r.slice(o+1),f=u?u.split("&").map(p=>{const g=p.indexOf("=");return{key:qf(g>=0?p.slice(0,g):p),value:qf(g>=0?p.slice(g+1):""),enabled:!0}}):[];return{url:r.slice(0,o),query:f}}function Mx(a){return sa(a).map(r=>({key:Ke(r.key),value:Ke(r.value),enabled:r.disabled!==!0}))}function qx(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zf(a,r){let o=a;for(const u of sa(r)){const f=Ke(u.key).trim();f&&(o=o.replace(new RegExp(`:${qx(f)}(?=/|$)`,"g"),`{{${f}}}`))}return o}function Dx(a){if(typeof a=="string")return Df(a);if(!Ot(a))return{url:"",query:[]};const r=Mx(a.query),o=Ke(a.raw);if(o){const m=Df(o);return{url:zf(m.url,a.variable),query:r.length>0?r:m.query}}const u=Ke(a.protocol).replace(/:$/,""),f=Array.isArray(a.host)?a.host.map(Ke).join("."):Ke(a.host),p=Ke(a.port),g=Array.isArray(a.path)?a.path.map(Ke).join("/"):Ke(a.path).replace(/^\//,""),x=f?`${u?`${u}://`:""}${f}${p?`:${p}`:""}`:"",b=x?`${x}${g?`/${g}`:""}`:g;return{url:zf(b,a.variable),query:r}}function zx(a){return sa(a).map(r=>({key:Ke(r.key),value:Ke(r.value),enabled:r.disabled!==!0}))}function Ux(a){return a.find(r=>r.enabled!==!1&&r.key.toLowerCase()==="content-type")?.value}function Hx(a){switch(a.toLowerCase()){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"javascript":return"application/javascript";case"text":return"text/plain";default:return}}function Lx(a,r,o,u){const f=Ux(r);if(!Ot(a)||!a.mode)return{body:"",contentType:f||"application/json",bodyMode:"none"};const p=Ke(a.mode);if(p==="raw"){const g=Ot(a.options)&&Ot(a.options.raw)?a.options.raw:void 0,x=g?Ke(g.language):"";return{body:Ke(a.raw),contentType:f||Hx(x)||"text/plain",bodyMode:x.toLowerCase()==="json"?"json":"raw"}}if(p==="urlencoded")return{body:"",bodyMode:"urlencoded",urlencoded:sa(a.urlencoded).map(x=>({key:Ke(x.key),value:Ke(x.value),enabled:x.disabled!==!0})),contentType:f||"application/x-www-form-urlencoded"};if(p==="graphql"){const g=Ot(a.graphql)?a.graphql:{},x=Ke(g.variables);return{body:"",bodyMode:"graphql",graphql:{query:Ke(g.query),variables:x},contentType:f||"application/json"}}if(p==="formdata"){const g=sa(a.formdata).map(b=>{const m=Ke(b.type)==="file"?"file":"text",v=Array.isArray(b.src)?b.src.map(Ke).filter(Boolean).join(", "):Ke(b.src);return{key:Ke(b.key),value:m==="text"?Ke(b.value):"",enabled:b.disabled!==!0,type:m,...m==="file"&&v?{fileName:v}:{},...typeof b.contentType=="string"?{contentType:b.contentType}:{}}});return g.filter(b=>b.type==="file").length>0&&nn(u,"postman-body-formdata-files",o,"Multipart file fields were preserved, but exported local file paths cannot be reopened by the browser. Re-select those files before sending."),{body:"",bodyMode:"formdata",formData:g,contentType:f}}if(p==="file"){const g=Ot(a.file)?Ke(a.file.src):Ke(a.src);return nn(u,"postman-body-file",o,g?`Postman binary file body "${g}" was preserved as intent, but browser security requires re-selecting the file before sending.`:"Postman binary file body requires selecting the file again in FlexDoc before sending."),{body:"",contentType:f||"application/octet-stream",bodyMode:"binary",binary:{fileName:g||void 0,contentType:f||"application/octet-stream"}}}return nn(u,"postman-body-unsupported",o,`Postman body mode "${p}" is not supported; the request body was left empty.`),{body:"",contentType:f||"application/octet-stream",bodyMode:"none"}}function Bx(a,r,o,u,f,p,g,x){const b=typeof a=="string"?{method:"GET",url:a}:a;if(!Ot(b))return nn(x,"postman-request-invalid",g,"Skipped an invalid Postman request entry."),null;const m=Ke(b.method).trim().toUpperCase()||"GET",v=Dx(b.url),S=zx(b.header),N=Lx(b.body,S,`${g}.body`,x),_={method:m,url:v.url,query:v.query,headers:S,body:N.body,contentType:N.contentType,bodyMode:N.bodyMode,urlencoded:N.urlencoded,formData:N.formData,binary:N.binary,graphql:N.graphql,auth:po(b.auth,{type:"inherit"},`${g}.auth`,x)},R=$x(f);return{id:Lt("request"),collectionId:o,folderId:u,name:r.trim()||`${m} ${v.url||"request"}`,request:_,...R?{scripts:R}:{},createdAt:p,updatedAt:p}}function Uf(a){Array.isArray(a.items)&&a.items.forEach((r,o)=>{const u=`${a.path}[${o}]`;if(!Ot(r)){nn(a.warnings,"postman-item-invalid",u,"Skipped an invalid Postman item.");return}const f=Ke(r.name)||"Untitled",p=Mf(r.event,`${u}.event`,a.warnings),g=Rx(a.inheritedScripts,p);if(Array.isArray(r.item)){const b=Lt("folder");a.folders.push({id:b,collectionId:a.collectionId,parentFolderId:a.parentFolderId,name:f,auth:po(r.auth,{type:"inherit"},`${u}.auth`,a.warnings),createdAt:a.timestamp,updatedAt:a.timestamp}),Uf({...a,items:r.item,parentFolderId:b,inheritedScripts:g,path:`${u}.item`});return}const x=Bx(r.request,f,a.collectionId,a.parentFolderId,g,a.timestamp,`${u}.request`,a.warnings);x&&a.requests.push(x)})}function Ix(a){if(!Ot(a)||!Ot(a.info)||!Array.isArray(a.item))throw new Error("This JSON is not a Postman collection. Expected info and item fields.");const r=Ke(a.info.name).trim();if(!r)throw new Error("Postman collection info.name is required.");const o=[],u=Ke(a.info.schema);u&&!u.includes("/v2.1.0/")&&nn(o,"postman-schema-version","info.schema",`Collection schema "${u}" is not Postman v2.1; FlexDoc imported the compatible fields it recognized.`);const f=new Date().toISOString(),p=Lt("collection"),g={id:p,name:r,auth:po(a.auth,{type:"none"},"auth",o),variables:$f(a.variable,"variable",o),createdAt:f,updatedAt:f},x=[],b=[];return Uf({items:a.item,collectionId:p,inheritedScripts:Mf(a.event,"event",o),timestamp:f,path:"item",folders:x,requests:b,warnings:o}),{collection:g,folders:x,requests:b,warnings:o}}function Yx(a){if(!Ot(a)||!Array.isArray(a.values)||typeof a.name!="string")throw new Error("This JSON is not a Postman environment. Expected name and values fields.");const r=Ke(a._postman_variable_scope).toLowerCase();if(r&&r!=="environment")throw new Error(`Postman variable scope "${r}" is not an environment.`);const o=[],u=new Date().toISOString();return{environment:{id:Lt("environment"),name:a.name.trim()||"Imported environment",variables:$f(a.values,"values",o),createdAt:u,updatedAt:u},warnings:o}}function Gx(a){if(Ot(a)&&Ot(a.info)&&Array.isArray(a.item))return{kind:"collection",result:Ix(a)};if(Ot(a)&&Array.isArray(a.values)&&typeof a.name=="string")return{kind:"environment",result:Yx(a)};throw new Error("Unsupported Postman JSON. Import a collection v2.1 JSON file or an exported environment JSON file.")}function Fx(a){if(a.collections.length!==1||a.folders.length!==0||a.requests.length!==0)return!1;const r=a.collections[0];return r.name==="My Collection"&&r.auth.type==="none"&&r.variables.length===0}function Vx(a,r){const o=Fx(a)?[]:a.collections;return{...a,collections:[...o,r.collection],folders:[...a.folders,...r.folders],requests:[...a.requests,...r.requests]}}function Kx(a,r){return{...a,environments:[...a.environments,r.environment],activeEnvironmentId:a.activeEnvironmentId||r.environment.id}}function Hf(a,r){return`${a} ${a===1?r:`${r}s`}`}const Xx=({onWorkspaceChange:a,onSelectedCollectionChange:r,theme:o})=>{const u=W.useRef(null),[f,p]=W.useState(null),[g,x]=W.useState([]),b=async R=>{if(R.length===0)return;const z=[],M=[],B=[];for(const Y of R)try{const $=JSON.parse(await Y.text()),q=Gx($);z.push(q),M.push(...q.result.warnings.map(J=>({...J,path:`${Y.name}:${J.path}`})))}catch($){B.push(`${Y.name}: ${$ instanceof Error?$.message:String($)}`)}z.length>0&&a(Y=>{let $=Y;for(const q of z)$=q.kind==="collection"?Vx($,q.result):Kx($,q.result);return $});const T=z.filter(Y=>Y.kind==="collection"),E=z.length-T.length,w=T[T.length-1];w?.kind==="collection"&&r?.(w.result.collection.id),x(M);const U=[T.length>0?Hf(T.length,"collection"):"",E>0?Hf(E,"environment"):""].filter(Boolean);z.length===0?p({tone:"error",text:B.join(" ")||"No Postman documents were imported."}):B.length>0||M.length>0?p({tone:"warning",text:`Imported ${U.join(" and ")}. ${B.length>0?`${B.length} file${B.length===1?"":"s"} failed to import.`:`${M.length} compatibility warning${M.length===1?"":"s"} need review.`}`}):p({tone:"success",text:`Imported ${U.join(" and ")}.`})},m=o==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",v=o==="dark"?"text-gray-400":"text-gray-500",S=o==="dark"?"text-amber-300":"text-amber-700",N=o==="dark"?"text-emerald-300":"text-emerald-700",_=o==="dark"?"text-red-300":"text-red-700";return s.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-import-heading",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Xu,{className:"h-4 w-4"}),s.jsx("h3",{id:"api-client-import-heading",className:"font-semibold",children:"Import"})]}),s.jsx("input",{ref:u,type:"file",accept:".json,application/json",multiple:!0,className:"hidden","aria-label":"Import Postman JSON",onChange:R=>{const z=Array.from(R.currentTarget.files||[]);R.currentTarget.value="",b(z)}}),s.jsxs("button",{type:"button",className:`flex w-full items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm font-medium ${m}`,onClick:()=>u.current?.click(),children:[s.jsx(Xu,{className:"h-4 w-4"}),"Import Postman"]}),s.jsx("p",{className:`text-xs ${v}`,children:"Import Postman Collection v2.1 and exported environment JSON files. Multiple files can be selected together."}),f&&s.jsxs("div",{className:`flex items-start gap-2 text-xs ${f.tone==="success"?N:f.tone==="warning"?S:_}`,role:"status",children:[f.tone==="success"?s.jsx(Gu,{className:"mt-0.5 h-4 w-4 shrink-0"}):s.jsx(bg,{className:"mt-0.5 h-4 w-4 shrink-0"}),s.jsx("span",{children:f.text})]}),g.length>0&&s.jsxs("details",{className:`text-xs ${S}`,children:[s.jsxs("summary",{className:"cursor-pointer font-medium",children:["Review import warnings (",g.length,")"]}),s.jsxs("ul",{className:"mt-2 space-y-2 pl-4",children:[g.slice(0,5).map((R,z)=>s.jsxs("li",{children:[s.jsx("span",{className:"font-mono",children:R.path}),": ",R.message]},`${R.code}-${R.path}-${z}`)),g.length>5&&s.jsxs("li",{children:[g.length-5," more warning",g.length-5===1?"":"s"," not shown."]})]})]})]})};function Zx(a,r){if(!r.folderId)return"Collection root";const o=new Map(a.folders.map(g=>[g.id,g])),u=[],f=new Set;let p=o.get(r.folderId);for(;p&&!f.has(p.id);)f.add(p.id),u.unshift(p.name),p=p.parentFolderId?o.get(p.parentFolderId):void 0;return u.join(" / ")||"Deleted folder"}function Qx(a){return a.status==="running"?"Running":a.status==="passed"?"Runner pass":a.status==="failed"?"Runner fail":a.status==="cancelled"?"Cancelled":a.status==="skipped"?"Not run":"Pending"}const Jx=({workspace:a,onWorkspaceChange:r,collectionId:o,folderId:u,theme:f,credentials:p,requestInterceptor:g,hostExecution:x,externalVariables:b,externalEnvironmentVariables:m,onCollectionChanges:v,onEnvironmentChanges:S,onOpenHistory:N,onBack:_,fetcher:R})=>{const z=W.useMemo(()=>Xr(a,o,u),[o,u,a]),M=W.useMemo(()=>kf(a,o,u),[o,u,a]),B=a.environments.find(ee=>ee.id===a.activeEnvironmentId),[T,E]=W.useState(!1),[w,U]=W.useState(!1),[Y,$]=W.useState(),[q,J]=W.useState({}),Se=W.useRef(void 0),Ae=W.useRef(!0);W.useEffect(()=>(Ae.current=!0,()=>{Ae.current=!1,Se.current?.abort()}),[]);const se=async()=>{if(w||z.length===0)return;const ee=new AbortController;Se.current=ee,U(!0),$(void 0),J(Object.fromEntries(z.map(K=>[K.id,{status:"pending"}])));const oe=await bx({workspace:a,collectionId:o,folderId:u,runName:M,credentials:p,requestInterceptor:g,hostExecution:x,externalVariables:b,externalEnvironmentVariables:m,stopOnFailure:T,signal:ee.signal,fetcher:R,onCollectionChanges:v,onEnvironmentChanges:S,onRequestStart:K=>{Ae.current&&J(ge=>({...ge,[K.id]:{status:"running"}}))},onRequestComplete:K=>{Ae.current&&J(ge=>({...ge,[K.requestId]:{status:K.cancelled?"cancelled":K.passed?"passed":"failed",item:K}}))}});Ae.current&&(r(oe.workspace),J(K=>Object.fromEntries(z.map(ge=>{const C=K[ge.id]||{status:"pending"};return[ge.id,C.status==="pending"&&oe.stopped?{status:"skipped"}:C]}))),$(oe),U(!1),Se.current=void 0)},he=()=>Se.current?.abort(),xe=f==="dark"?"border-gray-700 bg-gray-800/60 text-gray-100":"border-gray-200 bg-gray-50 text-gray-900",Ne=f==="dark"?"text-gray-400":"text-gray-500",O=f==="dark"?"border-gray-700 bg-gray-900/40":"border-gray-200 bg-white";return s.jsx("section",{className:`rounded-xl border p-4 md:p-5 ${xe}`,"aria-labelledby":"api-client-runner-heading",children:s.jsxs("div",{className:"space-y-5",children:[s.jsxs("header",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:_,children:[s.jsx(Bu,{className:"h-4 w-4"})," Client"]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Pa,{className:"h-5 w-5"}),s.jsx("h2",{id:"api-client-runner-heading",className:"text-lg font-semibold",children:"Collection runner"})]}),s.jsx("p",{className:"mt-1 text-sm font-medium",children:M}),s.jsxs("p",{className:`mt-1 text-xs ${Ne}`,children:[z.length," saved request",z.length===1?"":"s"," · Environment: ",B?.name||"None"]})]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Y?.runId&&s.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:()=>N(void 0,Y.runId),children:[s.jsx(cg,{className:"h-4 w-4"})," Open run history"]}),w?s.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border border-red-300 px-3 py-2 text-sm text-red-700",onClick:he,children:[s.jsx(xg,{className:"h-4 w-4"})," Stop run"]}):s.jsxs("button",{type:"button",disabled:z.length===0,className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>{se()},children:[s.jsx(Pa,{className:"h-4 w-4"})," ",Y?"Run again":"Start run"]})]})]}),s.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border p-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:T,disabled:w,onChange:ee=>E(ee.target.checked)}),"Stop on runner failure"]}),s.jsx("p",{className:`text-xs ${Ne}`,children:"Runner failure means transport/script/test failure. HTTP 4xx/5xx alone does not fail an item."})]}),Y&&s.jsxs("div",{className:"grid gap-2 sm:grid-cols-5",children:[s.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[s.jsx("div",{className:Ne,children:"Progress"}),s.jsxs("strong",{children:[Y.completed," / ",Y.total]})]}),s.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[s.jsx("div",{className:Ne,children:"Passed"}),s.jsx("strong",{className:"text-green-600",children:Y.passed})]}),s.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[s.jsx("div",{className:Ne,children:"Failed"}),s.jsx("strong",{className:"text-red-600",children:Y.failed})]}),s.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[s.jsx("div",{className:Ne,children:"Cancelled"}),s.jsx("strong",{children:Y.cancelled})]}),s.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[s.jsx("div",{className:Ne,children:"Run"}),s.jsx("strong",{children:Y.stopped?"Stopped":"Complete"})]})]}),s.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-runner-order-heading",children:[s.jsxs("div",{children:[s.jsx("h3",{id:"api-client-runner-order-heading",className:"font-semibold",children:"Execution order"}),s.jsx("p",{className:`text-xs ${Ne}`,children:"Requests execute sequentially in saved-request order. Folder runs include descendant folders; this list is the exact order that will run."})]}),z.map((ee,oe)=>{const K=q[ee.id]||{status:"pending"},ge=K.item?.outcome.result,C=K.item?.outcome.scriptTests||[],G=C.filter(de=>de.passed).length,pe=ge?.status!==void 0&&ge.status>=400;return s.jsxs("div",{"data-runner-request-id":ee.id,className:`rounded-lg border p-3 ${O}`,children:[s.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[s.jsx("span",{className:`text-xs ${Ne}`,children:oe+1}),s.jsx("span",{className:"font-mono font-bold text-blue-600",children:ee.request.method.toUpperCase()}),s.jsx("span",{className:"font-medium",children:ee.name})]}),s.jsx("div",{className:`mt-1 text-xs ${Ne}`,children:Zx(a,ee)}),s.jsx("div",{className:"mt-1 truncate font-mono text-xs",title:ee.request.url,children:ee.request.url})]}),s.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 text-xs",children:[K.status==="running"&&s.jsx(Ss,{className:"h-4 w-4 animate-spin"}),K.status==="passed"&&s.jsx(Gu,{className:"h-4 w-4 text-green-600"}),K.status==="failed"&&s.jsx(ig,{className:"h-4 w-4 text-red-600"}),s.jsx("span",{children:Qx(K)}),ge?.status!==void 0&&s.jsxs("span",{className:pe?"text-amber-600":Ne,children:["HTTP ",ge.status]}),ge?.responseTime!==void 0&&s.jsxs("span",{className:Ne,children:[s.jsx(xs,{className:"mr-1 inline h-3.5 w-3.5"}),ge.responseTime," ms"]})]})]}),C.length>0&&s.jsxs("div",{className:`mt-2 text-xs ${C.some(de=>!de.passed)?"text-red-600":Ne}`,children:[G,"/",C.length," tests passed"]}),K.item?.outcome.scriptError&&s.jsx("div",{className:"mt-2 text-xs text-red-600",children:K.item.outcome.scriptError}),K.item?.outcome.error&&!K.item.cancelled&&s.jsx("div",{className:"mt-2 text-xs text-red-600",children:K.item.outcome.error}),K.item?.historyEntryId&&s.jsx("button",{type:"button",className:"mt-2 text-xs font-medium text-blue-600 underline underline-offset-2","aria-label":`Open history for ${ee.name}`,onClick:()=>N(K.item?.historyEntryId,K.item?.outcome.result?Y?.runId:void 0),children:"Inspect history"})]},ee.id)}),z.length===0&&s.jsx("div",{className:`rounded-lg border px-4 py-8 text-center text-sm ${Ne}`,children:"There are no saved requests in this run scope yet."})]})]})})};function Px(a){return{method:a?.method||"GET",url:a?.url||"",query:a?.query?.map(r=>({...r}))||[],headers:a?.headers?.map(r=>({...r}))||[],body:a?.body||"",contentType:a?.contentType||"application/json",bodyMode:a?.bodyMode,urlencoded:a?.urlencoded?.map(r=>({...r})),formData:a?.formData?.map(r=>({...r})),binary:a?.binary?{...a.binary}:void 0,graphql:a?.graphql?{...a.graphql}:void 0,hostExecution:a?.hostExecution?{...a.hostExecution}:void 0,auth:a?.auth?a.auth.type==="oauth2"?{...a.auth,scopes:a.auth.scopes?[...a.auth.scopes]:void 0}:{...a.auth}:{type:"inherit"}}}const Wx=({initialRequest:a,initialScripts:r,theme:o="light",persistenceKey:u="default",onRequestChange:f,onDraftChange:p,onScriptsChange:g,onExecutionStart:x,onExecutionComplete:b,variables:m={},environmentVariables:v={},onCollectionChanges:S,onEnvironmentChanges:N,..._})=>{const R=Px(a),z=fn(r),M=Vl(),[B,T]=W.useState(R),[E,w]=W.useState(R),[U,Y]=W.useState(z),[$,q]=W.useState(z),[J,Se]=W.useState(0),[Ae,se]=W.useState("request"),[he,xe]=W.useState({}),[Ne,O]=W.useState(),[ee,oe]=W.useState(M),[K,ge]=W.useState(M.collections[0]?.id),[C,G]=W.useState(""),pe=W.useRef(M.collections[0]?.id),de=W.useRef(void 0),[be,Ee]=W.useState(u===!1);W.useEffect(()=>{if(u===!1)return;let Oe=!1;return j0(u).then(it=>{Oe||(oe(it),ge(it.collections[0]?.id),G(""),Ee(!0))}).catch(()=>{Oe||Ee(!0)}),()=>{Oe=!0}},[u]),W.useEffect(()=>{!be||u===!1||A0(u,ee).catch(()=>{})},[be,u,ee]);const ce=W.useMemo(()=>sf(ee,K),[K,ee]),Ce=W.useMemo(()=>of(ee),[ee]),Le=W.useMemo(()=>({...v,...Ce}),[v,Ce]),Be=W.useMemo(()=>({...ce,...m,...Le}),[ce,Le,m]),rt=W.useCallback(Oe=>rf(ee,K,C||void 0,Oe||{type:"none"}),[K,C,ee]),P=W.useCallback(Oe=>{ge(Oe),G("")},[]),ve=Oe=>{f?.(Oe)},je=Oe=>{w(Nn(Oe)),p?.(Nn(Oe))},ke=Oe=>{const it=fn(Oe);q(it),g?.(it)},Pe=Oe=>{const it=pe.current||K;oe(Rt=>uf(Rt,it,Oe)),S?.(Oe)},at=Oe=>{oe(it=>cf(it,Oe)),N?.(Oe)},yt=()=>{pe.current=K,de.current=C||void 0,x?.()},He=Oe=>{oe(it=>lf(it,{...Oe,collectionId:pe.current,folderId:de.current})),b?.(Oe)},Ft=(Oe,it,Rt,Kt)=>{se("request");const Yt=Rt&&ee.collections.some(Z=>Z.id===Rt)?Rt:void 0;Yt&&ge(Yt);const d=Yt||K,H=Kt&&ee.folders.some(Z=>Z.id===Kt&&Z.collectionId===d)?Kt:"";G(H);const te=Nn(Oe),le=fn(it);T(te),w(te),Y(le),q(le),Se(Z=>Z+1)},Vt=(Oe,it)=>{ge(Oe),G(it||""),O({collectionId:Oe,folderId:it}),se("runner")},wn=(Oe,it)=>{xe({entryId:Oe,runId:it}),se("history")},Rn=o==="dark"?"border-gray-700 bg-gray-900/40 text-gray-100":"border-gray-200 bg-white text-gray-900";return s.jsxs("div",{className:"grid gap-4 lg:grid-cols-[19rem_minmax(0,1fr)]",children:[s.jsxs("aside",{className:`space-y-5 rounded-xl border p-4 ${Rn}`,children:[s.jsx(Xx,{onWorkspaceChange:oe,onSelectedCollectionChange:P,theme:o}),s.jsx("div",{className:"border-t pt-4",children:s.jsx(Sx,{workspace:ee,onWorkspaceChange:oe,theme:o})}),s.jsx("div",{className:"border-t pt-4",children:s.jsx(vx,{request:E,scripts:$,onLoadRequest:Ft,onSelectedCollectionChange:P,onSelectedFolderChange:G,onRunCollection:Oe=>Vt(Oe),onRunFolder:(Oe,it)=>Vt(Oe,it),selectedCollectionId:K,selectedFolderId:C,workspace:ee,onWorkspaceChange:oe,hostExecution:_.hostExecution,theme:o})}),s.jsx("div",{className:"border-t pt-4",children:s.jsx(Ax,{workspace:ee,onWorkspaceChange:oe,onLoadRequest:Ft,onViewAll:()=>wn(),theme:o})})]}),Ae==="history"?s.jsx(Cx,{workspace:ee,onWorkspaceChange:oe,onLoadRequest:Ft,onBack:()=>se("request"),initialEntryId:he.entryId,initialRunId:he.runId,theme:o},`${he.runId||""}:${he.entryId||""}`):Ae==="runner"&&Ne?s.jsx(Jx,{workspace:ee,onWorkspaceChange:oe,collectionId:Ne.collectionId,folderId:Ne.folderId,theme:o,credentials:_.credentials,requestInterceptor:_.requestInterceptor,hostExecution:_.hostExecution,externalVariables:m,externalEnvironmentVariables:v,onCollectionChanges:S,onEnvironmentChanges:N,onOpenHistory:wn,onBack:()=>se("request")}):s.jsx(hx,{..._,initialRequest:B,initialScripts:U,theme:o,resolveAuth:rt,variables:Be,collectionVariables:ce,externalVariables:m,environmentVariables:Le,onCollectionChanges:Pe,onEnvironmentChanges:at,onDraftChange:je,onScriptsChange:ke,onExecutionStart:yt,onExecutionComplete:He,onRequestChange:ve},J)]})};function eb(a,r,o){return a.paths[r]?.[o.toLowerCase()]}function tb(a,r){const o=a.components?.securitySchemes?.[r];if(!o)return;if(!("$ref"in o))return o;const u=o.$ref,f="#/components/securitySchemes/";if(!u.startsWith(f))return;const p=a.components?.securitySchemes?.[decodeURIComponent(u.slice(f.length))];return p&&!("$ref"in p)?p:void 0}function nb(a,r,o,u){const p=eb(a,r,o)?.security??a.security??[];if(!p.length)return;const g=p.find(b=>{const m=Object.keys(b);return m.length===1&&!!u[m[0]]});if(g)return g;const x=p.find(b=>{const m=Object.keys(b);return m.length>0&&m.every(v=>!!u[v])});return x||(p.find(b=>Object.keys(b).length===0)??p[0])}function ab(a,r,o=[]){if(r){if(a.type==="http"&&a.scheme?.toLowerCase()==="bearer")return{type:"bearer",token:r};if(a.type==="http"&&a.scheme?.toLowerCase()==="basic"){const u=r.indexOf(":");return u>=0?{type:"basic",username:r.slice(0,u),password:r.slice(u+1)}:{type:"basic",username:r,password:""}}if(a.type==="apiKey"&&(a.in==="header"||a.in==="query")&&a.name)return{type:"apiKey",key:a.name,value:r,in:a.in};if(a.type==="openIdConnect")return{type:"oauth2",accessToken:r,grantType:"accessToken",scopes:o};if(a.type==="oauth2"){const u=a.flows,f=u?.authorizationCode?["authorizationCode",u.authorizationCode]:u?.clientCredentials?["clientCredentials",u.clientCredentials]:u?.password?["password",u.password]:u?.implicit?["implicit",u.implicit]:void 0,p=f?.[1];return{type:"oauth2",accessToken:r,grantType:f?.[0]||"accessToken",authorizationUrl:p?.authorizationUrl,tokenUrl:p?.tokenUrl,scopes:o.length?o:Object.keys(p?.scopes||{})}}}}function Lf(a,r){return{...a,headers:a.headers?.filter(o=>o.key.toLowerCase()!==r.toLowerCase())}}function lb(a,r){return{...a,query:a.query?.filter(o=>o.key!==r)}}function rb(a,r,o,u,f){let p=no(f);const g=nb(a,r,o,u.auth||{});if(!g||Object.keys(g).length!==1)return p;const x=Object.keys(g)[0],b=tb(a,x),m=u.auth?.[x]||"";if(!b)return p;if(!m)return{...p,auth:{type:"inherit"}};const v=ab(b,m,g[x]||[]);return v?(v.type==="bearer"||v.type==="oauth2"||v.type==="basic"?p=Lf(p,"Authorization"):v.type==="apiKey"&&v.in==="header"?p=Lf(p,v.key):v.type==="apiKey"&&v.in==="query"&&(p=lb(p,v.key)),{...p,auth:v}):p}function ib(a,r,o,u,f){const p=Gl(a,r,o,u);return{request:rb(a,r,o,u,p),serverUrl:u.serverUrl||f}}function sb(a){return a==null?"":Array.isArray(a)?a.map(String):typeof a=="object"?JSON.stringify(a):typeof a=="boolean"?String(a):a}function ob({spec:a,path:r,method:o,options:u}){const f=a.paths[r],g=f?.[o.toLowerCase()]?.servers||f?.servers||a.servers||[];return JSON.stringify({path:r,method:o.toLowerCase(),defaultServer:u?.tryIt?.defaultServer??null,servers:g.map(so),defaults:Zs(a,r,o)})}const cb=({spec:a,path:r,method:o,theme:u,options:f,onRequestChange:p,onOpenInApiClient:g})=>{const x=a.paths[r],b=x?.[o.toLowerCase()],m=W.useMemo(()=>b?.servers||x?.servers||a.servers||[],[b?.servers,x?.servers,a.servers]),v=W.useMemo(()=>m.map(ce=>({server:ce,url:so(ce)})),[m]),S=W.useMemo(()=>v.map(ce=>ce.url),[v]),N=W.useMemo(()=>({...Zs(a,r,o),serverUrl:f?.tryIt?.defaultServer}),[a,r,o,f?.tryIt?.defaultServer]),_=N.serverUrl&&S.includes(N.serverUrl)?N.serverUrl:S[0]||"",R=N.serverUrl&&!S.includes(N.serverUrl)?N.serverUrl:"",[z,M]=W.useState(N),B=W.useRef(N),T=W.useRef(_),E=W.useRef(null),w=W.useRef(p),[U,Y]=W.useState(null),[$,q]=W.useState(null),[J,Se]=W.useState(!1),Ae=W.useMemo(()=>Gd(a,r,o),[a,r,o]),se=f?.noAutoAuth?[]:Object.keys((b?.security??a.security??[])[0]||{}),he=W.useMemo(()=>{try{return no(Gl(a,r,o,z))}catch{return null}},[a,r,o,z]),xe=(()=>{const ce=new Set(he?to(he):[]);return Object.values(z.cookies||{}).some(Ce=>Ce!=null&&String(Ce)!=="")&&ce.add("cookies"),[...ce]})(),Ne=new Set(f?.tryIt?.hostExecution?.capabilities||[]),O=xe.filter(ce=>!Ne.has(ce)),ee=xe.length>0,oe=f?.tryIt?.hostExecution?.available===!0&&O.length===0,K=ee?oe?"The browser cannot send this request. FlexDoc will execute it from the API host.":f?.tryIt?.hostExecution?.available?`The API host does not support the required capability${O.length===1?"":"ies"}: ${O.join(", ")}.`:"Host execution is disabled on this documentation server.":null,ge=ce=>{B.current=ce,M(ce)};W.useEffect(()=>{w.current=p},[p]),W.useEffect(()=>{try{w.current?.(Gl(a,r,o,z))}catch{}},[a,r,o,z]);const C=(ce,Ce,Le)=>{const Be=B.current;ge({...Be,[ce]:{...Be[ce]||{},[Ce]:Le}})},G=async()=>{Se(!0),q(null),Y(null);try{const ce=Gl(a,r,o,B.current),Ce=await io({request:no(ce),credentials:f?.tryIt?.credentials||"same-origin",requestInterceptor:f?.tryIt?.requestInterceptor,hostExecution:f?.tryIt?.hostExecution});Ce.error&&q(Ce.error),Ce.response&&Y({status:Ce.response.status,statusText:Ce.response.statusText,headers:Ce.response.headers.map(([Le,Be])=>[Le,Be]),body:Ce.response.body,responseTime:Ce.response.responseTime})}catch(ce){q(ce instanceof Error?ce.message:"Request failed")}finally{Se(!1)}},pe=()=>{try{g?.(ib(a,r,o,B.current,_||void 0))}catch(ce){q(ce instanceof Error?ce.message:"Request is incomplete")}},de=u==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900",be=u==="dark"?"text-gray-300":"text-gray-700",Ee=`${r}:${o}:${_}:${R}`;return s.jsx("div",{className:`rounded-xl border p-4 md:p-5 ${u==="dark"?"border-gray-700 bg-gray-800/60":"border-gray-200 bg-gray-50"}`,children:s.jsxs("div",{className:"flex flex-col gap-4",children:[m.length>0&&s.jsxs("label",{className:be,children:["Server",s.jsx("select",{"aria-label":"Server",className:`mt-1 w-full rounded-md border px-3 py-2 text-sm ${de}`,defaultValue:_,onChange:ce=>{T.current=ce.target.value,E.current&&(E.current.value=""),ge({...B.current,serverUrl:ce.target.value})},children:v.map(({server:ce,url:Ce})=>s.jsxs("option",{value:Ce,children:[ce.description?`${ce.description} — `:"",ce.url]},`${ce.url}:${Ce}`))},`server:${Ee}`)]}),s.jsxs("label",{className:be,children:["Custom server URL ",s.jsx("span",{className:"text-xs opacity-70",children:"(optional override)"}),s.jsx("input",{ref:E,"aria-label":"Custom server URL",className:`mt-1 w-full rounded-md border px-3 py-2 font-mono text-sm ${de}`,defaultValue:R,onChange:ce=>{const Ce=ce.target.value.trim()||T.current;ge({...B.current,serverUrl:Ce||void 0})},placeholder:"http://localhost:8080"},`custom:${Ee}`)]}),Ae.map(ce=>{const Ce=ce.in==="header"?z.headers?.[ce.name]:ce.in==="cookie"?z.cookies?.[ce.name]:z.parameters?.[ce.name];return s.jsxs("label",{className:be,children:[s.jsxs("span",{className:"text-sm font-medium",children:[ce.name," ",s.jsxs("span",{className:"text-xs opacity-70",children:["(",ce.in,")"]}),ce.required?" *":""]}),s.jsx("input",{"aria-label":`${ce.in} ${ce.name}`,className:`mt-1 w-full rounded-md border px-3 py-2 text-sm ${de}`,value:sb(Ce),onChange:Le=>C(ce.in==="header"?"headers":ce.in==="cookie"?"cookies":"parameters",ce.name,Le.target.value),placeholder:ce.description||ce.name})]},`${ce.in}:${ce.name}`)}),se.map(ce=>s.jsxs("label",{className:be,children:[s.jsxs("span",{className:"text-sm font-medium",children:[ce," credential"]}),s.jsx("input",{type:"password",autoComplete:"off",className:`mt-1 w-full rounded-md border px-3 py-2 text-sm ${de}`,value:z.auth?.[ce]||"",onChange:Ce=>C("auth",ce,Ce.target.value),placeholder:"Token / API key"})]},ce)),N.contentType&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:be,children:["Content type",s.jsx("input",{className:`mt-1 w-full rounded-md border px-3 py-2 text-sm ${de}`,value:z.contentType||"",onChange:ce=>ge({...B.current,contentType:ce.target.value})})]}),s.jsxs("label",{className:be,children:["Request body",s.jsx("textarea",{"aria-label":"Request body",rows:8,className:`mt-1 w-full rounded-md border px-3 py-2 font-mono text-sm ${de}`,value:z.body||"",onChange:ce=>ge({...B.current,body:ce.target.value})})]})]}),K&&s.jsx("div",{role:oe?"status":"alert",className:`rounded-md border p-3 text-sm ${oe?"border-blue-300 bg-blue-50 text-blue-800":"border-amber-300 bg-amber-50 text-amber-800"}`,children:K}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs("button",{onClick:G,disabled:J||ee&&!oe,className:"inline-flex min-h-11 items-center justify-center gap-2 rounded-md bg-blue-600 px-4 py-2 font-medium text-white hover:bg-blue-700 disabled:opacity-60",children:[J?s.jsx(Ss,{className:"h-4 w-4 animate-spin"}):s.jsx(Pa,{className:"h-4 w-4"})," ",J?"Sending…":ee&&oe?"Send via API host":"Send request"]}),g&&s.jsxs("button",{type:"button",onClick:pe,className:"inline-flex min-h-11 items-center justify-center gap-2 rounded-md border px-4 py-2 font-medium",children:[s.jsx(bs,{className:"h-4 w-4"})," Open in API Client"]})]}),$&&s.jsxs("div",{role:"alert",className:"flex gap-2 rounded-md border border-red-300 bg-red-50 p-3 text-sm text-red-700",children:[s.jsx(Ur,{className:"mt-0.5 h-4 w-4 shrink-0"}),$]}),U&&s.jsx(Nf,{response:U,theme:u})]})})},ub=a=>s.jsx(cb,{...a},ob(a)),db=({spec:a,path:r,method:o,theme:u,options:f,onRequestChange:p})=>{const[g,x]=W.useState(null),b=W.useRef(0),m=a.paths[r],S=m?.[o.toLowerCase()]?.servers||m?.servers||a.servers||[],N=f?.tryIt?.apiClientPersistenceKey??g0(a.info?.title,typeof window>"u"?void 0:window.location.host),_=R=>{b.current+=1,x({id:b.current,...R})};return s.jsxs(s.Fragment,{children:[s.jsx(ub,{spec:a,path:r,method:o,theme:u,options:f,onRequestChange:p,onOpenInApiClient:_}),g&&s.jsxs("section",{className:"mt-6","aria-labelledby":"api-client-heading",children:[s.jsx("h2",{id:"api-client-heading",className:"mb-2 text-base font-semibold sm:text-lg",children:"API Client"}),s.jsx("p",{className:`mb-4 text-xs ${u==="dark"?"text-gray-400":"text-gray-600"}`,children:"Changes in Try It do not refresh this client automatically. Reopen it to load the latest Try It values. Saved collections stay local to this browser."}),s.jsx(Wx,{initialRequest:g.request,theme:u,credentials:f?.tryIt?.credentials||"same-origin",requestInterceptor:f?.tryIt?.requestInterceptor,hostExecution:f?.tryIt?.hostExecution,onRequestChange:p,serverOptions:S,initialServerUrl:g.serverUrl,persistenceKey:N},g.id)]})]})},fb=["curl","javascript","python","go","java"],pb=({spec:a,path:r,method:o,theme:u="light",options:f={},defaultExpandedSections:p})=>{const g=p??Vs(f.expand,f.expand===void 0?f.expandResponses:void 0),x=`${o}:${r}:${g.join("|")}`,[b,m]=W.useState(()=>({key:x,sections:new Set(g)})),v=b.key===x?b.sections:new Set(g),[S,N]=W.useState(f.codeSamples?.languages?.[0]||"curl"),_=W.useMemo(()=>Gl(a,r,o,Zs(a,r,o)),[a,r,o]),[R,z]=W.useState(_),B=a.paths[r]?.[o.toLowerCase()],T=W.useMemo(()=>Gd(a,r,o),[a,r,o]);if(!B)return s.jsx("div",{className:"p-6",children:"Operation not found."});const E=u==="dark"?"text-gray-400":"text-gray-600",w=u==="dark"?"border-gray-700 bg-gray-800/60":"border-gray-200 bg-white",U=u==="dark"?"bg-gray-900 text-gray-100":"bg-white text-gray-900",Y=f.codeSamples?.languages?.length?f.codeSamples.languages:fb,$=B.security??a.security,q={requiredPropsFirst:f.requiredPropsFirst,sortPropsAlphabetically:f.sortPropsAlphabetically},J=xe=>m(Ne=>{const O=new Set(Ne.key===x?Ne.sections:g);return O.has(xe)?O.delete(xe):O.add(xe),{key:x,sections:O}}),Se=(xe,Ne,O)=>s.jsxs("section",{className:"mb-8","aria-labelledby":`${Ne}-heading`,children:[s.jsxs("button",{id:`${Ne}-heading`,"aria-expanded":v.has(Ne),onClick:()=>J(Ne),className:"mb-4 flex min-h-10 w-full items-center gap-2 text-left text-base font-semibold sm:text-lg",children:[v.has(Ne)?s.jsx(Iu,{className:"h-5 w-5 shrink-0"}):s.jsx(Yu,{className:"h-5 w-5 shrink-0"}),xe]}),v.has(Ne)&&O]}),Ae=B.requestBody?tn.isReference(B.requestBody)?tn.resolveReference(a,B.requestBody.$ref):B.requestBody:void 0,se=Object.entries(B).filter(([xe])=>xe.startsWith("x-")),he=typeof f.theme=="object"?f.theme.methodColors?.[o.toLowerCase()]:void 0;return s.jsx("div",{className:`h-full overflow-y-auto ${U}`,children:s.jsxs("article",{className:"mx-auto w-full max-w-6xl p-4 sm:p-6 lg:p-8",children:[s.jsxs("header",{className:"mb-8",children:[s.jsxs("div",{className:"mb-4 flex min-w-0 flex-wrap items-center gap-2 sm:gap-3",children:[s.jsx("span",{className:`shrink-0 rounded border px-2.5 py-1 text-xs font-bold sm:text-sm ${tn.getMethodColor(o,u)}`,style:{background:he?.bg,borderColor:he?.border},children:o.toUpperCase()}),s.jsx("code",{className:`min-w-0 max-w-full overflow-x-auto rounded px-2.5 py-1 font-mono text-sm sm:text-base ${u==="dark"?"bg-gray-800 text-blue-300":"bg-gray-100 text-gray-900"}`,children:r})]}),B.summary&&s.jsx("h1",{className:"mb-2 text-2xl font-bold tracking-tight sm:text-3xl",children:B.summary}),B.description&&s.jsx("p",{className:`max-w-3xl whitespace-pre-wrap leading-relaxed ${E}`,children:B.description}),s.jsxs("div",{className:"mt-4 flex flex-wrap gap-3 text-sm",children:[B.deprecated&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-orange-600",children:[s.jsx(Ur,{className:"h-4 w-4"}),"Deprecated"]}),$?.length?s.jsxs("span",{className:"inline-flex items-center gap-1 text-red-600",children:[s.jsx(fg,{className:"h-4 w-4"}),"Authentication required"]}):s.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600",children:[s.jsx(dg,{className:"h-4 w-4"}),"No authentication required"]}),B.operationId&&s.jsxs("span",{className:E,children:["operationId: ",s.jsx("code",{children:B.operationId})]})]}),(f.showExtensions||f.showCommonExtensions)&&se.length>0&&s.jsx("div",{className:`mt-4 rounded-lg border p-3 text-xs ${w}`,children:se.map(([xe,Ne])=>s.jsxs("div",{children:[s.jsx("code",{children:xe}),": ",typeof Ne=="string"?Ne:JSON.stringify(Ne)]},xe))})]}),T.length>0&&Se("Parameters","parameters",s.jsx("div",{className:"space-y-3",children:T.map(xe=>s.jsxs("div",{className:`rounded-lg border p-4 ${w}`,children:[s.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[s.jsx("code",{className:"font-medium",children:xe.name}),s.jsx("span",{className:"rounded bg-blue-100 px-2 py-0.5 text-xs text-blue-700",children:xe.in}),xe.required&&s.jsx("span",{className:"rounded bg-red-100 px-2 py-0.5 text-xs text-red-700",children:"required"}),xe.deprecated&&s.jsx("span",{className:"rounded bg-orange-100 px-2 py-0.5 text-xs text-orange-700",children:"deprecated"})]}),xe.description&&s.jsx("p",{className:`mb-3 text-sm ${E}`,children:xe.description}),xe.schema&&s.jsx(ra,{spec:a,schema:xe.schema,theme:u,required:xe.required,...q})]},`${xe.in}:${xe.name}`))})),Ae&&Se("Request Body","requestBody",s.jsxs("div",{className:"space-y-4",children:[Ae.description&&s.jsx("p",{className:E,children:Ae.description}),Object.entries(Ae.content||{}).map(([xe,Ne])=>s.jsxs("div",{className:`rounded-lg border p-4 ${w}`,children:[s.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[s.jsx("code",{className:"rounded bg-gray-100 px-2 py-1 text-xs text-gray-700",children:xe}),Ae.required&&s.jsx("span",{className:"rounded bg-red-100 px-2 py-0.5 text-xs text-red-700",children:"required"})]}),Ne.schema&&s.jsx(ra,{spec:a,schema:Ne.schema,theme:u,...q}),Ne.example!==void 0&&s.jsx("div",{className:"mt-3",children:s.jsx(zn,{code:JSON.stringify(Ne.example,null,2),language:"json",title:"Example payload",theme:u,wrap:!0})})]},xe))]})),Se("Responses","responses",s.jsx("div",{className:"space-y-4",children:Object.entries(B.responses||{}).map(([xe,Ne])=>{const O=tn.isReference(Ne)?tn.resolveReference(a,Ne.$ref):Ne;return s.jsxs("div",{className:`rounded-lg border p-4 ${w}`,children:[s.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"rounded border px-2.5 py-1 text-sm font-bold",children:xe}),s.jsx("span",{className:`text-sm ${E}`,children:O.description})]}),O.headers&&f.showRequestHeaders&&s.jsxs("div",{className:"mb-3 text-sm",children:[s.jsx("span",{className:"font-medium",children:"Headers:"})," ",Object.keys(O.headers).join(", ")]}),O.content&&Object.entries(O.content).map(([ee,oe])=>s.jsxs("div",{className:"mt-3",children:[s.jsx("code",{className:"text-xs opacity-70",children:ee}),oe.schema&&s.jsx("div",{className:"mt-2",children:s.jsx(ra,{spec:a,schema:oe.schema,theme:u,...q})}),oe.example!==void 0&&s.jsx("div",{className:"mt-3",children:s.jsx(zn,{code:JSON.stringify(oe.example,null,2),language:"json",title:"Example response",theme:u,wrap:!0})}),oe.examples&&Object.values(oe.examples)[f.payloadSampleIdx||0]&&s.jsx("div",{className:"mt-3",children:s.jsx(zn,{code:JSON.stringify(Object.values(oe.examples)[f.payloadSampleIdx||0].value??Object.values(oe.examples)[f.payloadSampleIdx||0],null,2),language:"json",title:"Example response",theme:u,wrap:!0})})]},ee))]},xe)})})),f.tryIt?.enabled!==!1&&Se("Try It","tryIt",s.jsx(db,{spec:a,path:r,method:o,theme:u,options:f,onRequestChange:z},`${o}:${r}:${f.tryIt?.defaultServer||""}`)),f.codeSamples?.enabled!==!1&&Se("Code Examples","codeSamples",s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"mb-3 flex max-w-full gap-1 overflow-x-auto pb-1",role:"tablist","aria-label":"Code example language",children:Y.map(xe=>s.jsx("button",{role:"tab","aria-selected":S===xe,onClick:()=>N(xe),className:`shrink-0 rounded-md px-3 py-2 text-sm ${S===xe?"bg-blue-600 text-white":u==="dark"?"bg-gray-800 text-gray-200":"bg-gray-100 text-gray-700"}`,children:Fd(xe)},xe))}),s.jsx(zn,{code:Xg(R,S),language:S==="curl"?"bash":S,title:Fd(S),theme:u,wrap:!!(typeof f.theme=="object"&&f.theme.typography?.code?.wrap)})]})),B.externalDocs&&s.jsx("p",{className:"pb-4 text-sm",children:s.jsx("a",{className:"text-blue-600 underline",href:B.externalDocs.url,target:"_blank",rel:"noopener noreferrer",children:B.externalDocs.description||"External documentation"})})]})})},mb=({spec:a,onEndpointSelect:r,theme:o="light"})=>{const u=o==="dark"?"bg-gray-800 border-gray-700 shadow-lg text-white":"bg-white border-gray-200 shadow-sm text-gray-900",f=o==="dark"?"text-gray-300":"text-gray-600",p=o==="dark"?"hover:bg-gray-700 hover:border-gray-600":"hover:border-blue-300 hover:bg-blue-50",g=Object.values(a.paths).reduce((m,v)=>(tn.getHttpMethods(v).forEach(N=>{m[N]=(m[N]||0)+1,m.total++}),m),{total:0}),x=Object.entries(a.paths).slice(0,6).flatMap(([m,v])=>tn.getHttpMethods(v).map(S=>({path:m,method:S,operation:v[S]}))),b=[{icon:s.jsx(vs,{className:"w-5 h-5"}),iconBg:o==="dark"?"bg-blue-900":"bg-blue-100",iconColor:o==="dark"?"text-blue-300":"text-blue-600",title:"Total Endpoints",value:g.total},{icon:s.jsx(Vu,{className:"w-5 h-5"}),iconBg:o==="dark"?"bg-green-900":"bg-green-100",iconColor:o==="dark"?"text-green-300":"text-green-600",title:"Servers",value:a.servers?.length||0},{icon:s.jsx(Ku,{className:"w-5 h-5"}),iconBg:o==="dark"?"bg-purple-900":"bg-purple-100",iconColor:o==="dark"?"text-purple-300":"text-purple-600",title:"Tags",value:a.tags?.length||0},{icon:s.jsx(gg,{className:"w-5 h-5"}),iconBg:o==="dark"?"bg-orange-900":"bg-orange-100",iconColor:o==="dark"?"text-orange-300":"text-orange-600",title:"Security Schemes",value:a.components?.securitySchemes?Object.keys(a.components.securitySchemes).length:0}];return s.jsx("div",{className:`flex-1 overflow-y-auto ${o==="dark"?"bg-gray-900":"bg-gray-50"}`,children:s.jsxs("div",{className:"p-4 md:p-8",children:[s.jsxs("div",{className:"mb-8",children:[s.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[s.jsx("div",{className:`w-12 h-12 rounded-xl flex items-center justify-center ${o==="dark"?"bg-blue-700":"bg-gradient-to-br from-blue-500 to-blue-600"}`,children:s.jsx(vs,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:`text-2xl md:text-3xl font-bold ${o==="dark"?"text-white":"text-gray-900"}`,children:a.info.title}),s.jsxs("p",{className:`${o==="dark"?"text-gray-300":"text-gray-600"}`,children:["Version ",a.info.version]})]})]}),a.info.description&&s.jsx("p",{className:`text-lg leading-relaxed max-w-4xl ${o==="dark"?"text-white":"text-gray-600"}`,children:a.info.description})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:b.map((m,v)=>s.jsx("div",{className:`p-4 rounded-xl border transition-colors ${u}`,children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:`w-10 h-10 ${m.iconBg} rounded-lg flex items-center justify-center`,children:gs.cloneElement(m.icon,{className:`${m.iconColor} w-5 h-5`})}),s.jsxs("div",{children:[s.jsx("p",{className:`text-sm font-medium ${f}`,children:m.title}),s.jsx("p",{className:`text-xl font-bold ${o==="dark"?"text-white":"text-gray-900"}`,children:m.value})]})]})},v))}),s.jsxs("div",{className:`rounded-xl border p-4 md:p-6 mb-8 ${u}`,children:[s.jsx("h2",{className:`text-lg md:text-xl font-semibold mb-4 ${o==="dark"?"text-white":"text-gray-900"}`,children:"HTTP Methods Distribution"}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:["get","post","put","delete","patch","options"].map(m=>s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:`px-3 py-1.5 mx-auto rounded-lg flex items-center justify-center mb-2 ${tn.getMethodColor(m,o)}`,children:s.jsx("span",{className:"text-sm font-medium",children:m.toUpperCase()})}),s.jsx("p",{className:`font-bold ${o==="dark"?"text-white":"text-gray-900"}`,children:g[m]||0}),s.jsx("p",{className:"text-xs text-gray-400",children:m.toUpperCase()})]},m))})]}),s.jsxs("div",{className:`rounded-xl border p-4 md:p-6 mb-8 ${u}`,children:[s.jsx("h2",{className:`text-lg md:text-xl font-semibold mb-4 ${o==="dark"?"text-white":"text-gray-900"}`,children:"Available Endpoints"}),s.jsx("div",{className:"space-y-3",children:x.map(({path:m,method:v,operation:S})=>s.jsxs("button",{onClick:()=>r(m,v),className:`w-full text-left p-3 border rounded-lg transition-colors ${p} ${o==="dark"?"border-gray-700":"border-gray-200"}`,children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:`text-xs font-bold px-2 py-1 rounded border ${tn.getMethodColor(v,o)}`,children:v.toUpperCase()}),s.jsx("code",{className:`font-mono text-sm break-all ${o==="dark"?"text-blue-300 group-hover:text-blue-200":"text-blue-600 group-hover:text-blue-700"}`,children:m})]}),S?.summary&&s.jsx("p",{className:`text-sm mt-2 ml-14 ${o==="dark"?"text-gray-300":"text-gray-600"}`,children:S.summary})]},`${v}-${m}`))})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(a.info.contact||a.info.license)&&s.jsxs("div",{className:`rounded-xl border p-4 md:p-6 ${u}`,children:[s.jsx("h2",{className:`text-lg md:text-xl font-semibold mb-4 ${o==="dark"?"text-white":"text-gray-900"}`,children:"Information"}),s.jsxs("div",{className:"space-y-4",children:[a.info.contact&&s.jsxs("div",{children:[s.jsx("h3",{className:`font-medium mb-2 ${o==="dark"?"text-gray-100":"text-gray-900"}`,children:"Contact"}),a.info.contact.name&&s.jsx("p",{className:`text-sm ${f}`,children:a.info.contact.name}),a.info.contact.email&&s.jsx("p",{className:`text-sm ${f}`,children:a.info.contact.email}),a.info.contact.url&&s.jsxs("a",{href:a.info.contact.url,target:"_blank",rel:"noopener noreferrer",className:`text-sm flex items-center gap-1 ${o==="dark"?"text-blue-400 hover:text-blue-300":"text-blue-600 hover:text-blue-700"}`,children:["Website ",s.jsx(bs,{className:"w-3 h-3"})]})]}),a.info.license&&s.jsxs("div",{children:[s.jsx("h3",{className:`font-medium mb-2 ${o==="dark"?"text-gray-100":"text-gray-900"}`,children:"License"}),a.info.license.url?s.jsxs("a",{href:a.info.license.url,target:"_blank",rel:"noopener noreferrer",className:`text-sm flex items-center gap-1 ${o==="dark"?"text-blue-400 hover:text-blue-300":"text-blue-600 hover:text-blue-700"}`,children:[a.info.license.name,s.jsx(bs,{className:"w-3 h-3"})]}):s.jsx("p",{className:`text-sm ${f}`,children:a.info.license.name})]})]})]}),a.servers&&a.servers.length>0&&s.jsxs("div",{className:`rounded-xl border p-4 md:p-6 ${u}`,children:[s.jsx("h2",{className:`text-lg md:text-xl font-semibold mb-4 ${o==="dark"?"text-white":"text-gray-900"}`,children:"Servers"}),s.jsx("div",{className:"space-y-3",children:a.servers.map((m,v)=>s.jsxs("div",{className:`p-3 rounded-lg ${o==="dark"?"bg-gray-700/50":"bg-gray-50"}`,children:[s.jsx("code",{className:`text-sm font-mono ${o==="dark"?"text-blue-300":"text-blue-600"}`,children:m.url}),m.description&&s.jsx("p",{className:`text-sm mt-1 ${f}`,children:m.description})]},v))})]})]})]})})},hb=({footerClasses:a,footer:r})=>{const o=r?.copyright,u=r?.link||[];return s.jsx("footer",{className:`${a} w-full border-t`,children:s.jsxs("div",{className:"mx-auto flex min-h-12 w-full max-w-[1600px] flex-col gap-2 px-4 py-3 text-xs sm:flex-row sm:items-center sm:justify-between sm:px-6 sm:text-sm",children:[s.jsx("p",{children:o||s.jsxs(s.Fragment,{children:["Powered by ",s.jsx("a",{href:"https://prauga.github.io/flexdoc",target:"_blank",rel:"noopener noreferrer",className:"font-semibold hover:opacity-80 transition-opacity",children:"FlexDoc"})]})}),u.length>0&&s.jsx("nav",{"aria-label":"Footer links",className:"flex flex-wrap gap-x-4 gap-y-2",children:u.map(f=>s.jsx("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-80",children:f.text},`${f.text}:${f.url}`))})]})})},yb=(a,r,o)=>a==="dark"?o:r,gb={parameters:"Parameters",requestBody:"Request body",responses:"Responses",tryIt:"Try It",codeSamples:"Code examples"};function xb(a){return a===void 0?"host":Array.isArray(a)?"custom":a==="none"?"minimal":a}function bb(a){return Array.from(a.querySelectorAll('button:not([disabled]), select:not([disabled]), input:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')).filter(r=>r.getAttribute("aria-hidden")!=="true")}const vb=({open:a,theme:r,viewerExpand:o,effectiveExpandedSections:u,onExpandChange:f,onClose:p})=>{const g=W.useRef(null),x=W.useRef(null);if(W.useEffect(()=>{if(!a||typeof document>"u")return;const N=document.activeElement instanceof HTMLElement?document.activeElement:null;x.current?.focus();const _=R=>{if(R.key==="Escape"){R.preventDefault(),p();return}if(R.key!=="Tab"||!g.current)return;const z=bb(g.current);if(z.length===0){R.preventDefault(),g.current.focus();return}const M=z[0],B=z[z.length-1],T=document.activeElement;R.shiftKey&&(T===M||!g.current.contains(T))?(R.preventDefault(),B.focus()):!R.shiftKey&&(T===B||!g.current.contains(T))&&(R.preventDefault(),M.focus())};return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_),N?.isConnected&&N.focus()}},[a,p]),!a)return null;const b=r==="dark",m=b?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900",v=b?"border-gray-700 bg-gray-800 text-gray-100":"border-gray-300 bg-white text-gray-900",S=Array.isArray(o)?o.filter(N=>$a.includes(N)):[];return s.jsxs("div",{className:"fixed inset-0 z-[70]",children:[s.jsx("button",{"aria-label":"Close settings backdrop",className:"absolute inset-0 bg-black/40",onClick:p}),s.jsxs("aside",{ref:g,role:"dialog","aria-modal":"true","aria-label":"Viewer settings",tabIndex:-1,className:`absolute inset-y-0 right-0 flex w-[min(92vw,24rem)] flex-col border-l shadow-2xl ${m}`,children:[s.jsxs("div",{className:"flex min-h-14 items-center justify-between border-b px-4",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-semibold",children:"Settings"}),s.jsx("div",{className:"text-xs opacity-65",children:"Preferences are saved for this documentation."})]}),s.jsx("button",{type:"button","aria-label":"Close settings",className:"inline-flex h-11 w-11 items-center justify-center rounded-md",onClick:p,children:s.jsx(Zu,{className:"h-5 w-5"})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:s.jsxs("section",{"aria-labelledby":"expansion-settings-heading",children:[s.jsx("h2",{id:"expansion-settings-heading",className:"mb-1 text-sm font-semibold",children:"Default expanded sections"}),s.jsx("p",{className:"mb-3 text-xs opacity-65",children:"This preference overrides the documentation author's default. Opening or closing a section manually remains temporary."}),s.jsxs("select",{ref:x,"aria-label":"Default expanded sections",className:`w-full rounded-md border px-3 py-2 text-sm ${v}`,value:xb(o),onChange:N=>{const _=N.target.value;f(_==="host"?void 0:_==="custom"?[...u]:_)},children:[s.jsx("option",{value:"host",children:"Use documentation default"}),s.jsx("option",{value:"minimal",children:"Minimal"}),s.jsx("option",{value:"documentation",children:"Documentation"}),s.jsx("option",{value:"interactive",children:"Interactive"}),s.jsx("option",{value:"all",children:"All sections"}),s.jsx("option",{value:"custom",children:"Custom sections"})]}),Array.isArray(o)&&s.jsxs("fieldset",{className:"mt-4 space-y-2",children:[s.jsx("legend",{className:"mb-2 text-xs font-medium uppercase tracking-wide opacity-65",children:"Custom sections"}),$a.map(N=>s.jsxs("label",{className:"flex min-h-9 items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:S.includes(N),onChange:_=>{const R=new Set(S);_.target.checked?R.add(N):R.delete(N),f($a.filter(z=>R.has(z)))}}),gb[N]]},N))]}),o!==void 0&&s.jsx("button",{type:"button",className:"mt-5 rounded-md border px-3 py-2 text-sm",onClick:()=>f(void 0),children:"Reset to documentation defaults"})]})})]})]})};function Zr(a){if(a!==void 0)return typeof a=="number"?`${a}px`:a}function Sb(a,r){if(!r)return{};const o=r.colors||{},u=r.typography||{},f=r.sidebar||{};return{"--flexdoc-primary":o.primary?.main,"--flexdoc-text":o.text?.primary,"--flexdoc-text-muted":o.text?.secondary,"--flexdoc-border":a==="dark"?o.border?.dark:o.border?.light,"--flexdoc-sidebar-bg":a==="dark"?f.backgroundColorDark:f.backgroundColor,"--flexdoc-sidebar-text":a==="dark"?f.textColorDark:f.textColor,"--flexdoc-sidebar-active-text":a==="dark"?f.activeTextColorDark:f.activeTextColor,"--flexdoc-heading-font":u.headings?.fontFamily,"--flexdoc-heading-weight":u.headings?.fontWeight,"--flexdoc-code-font":u.code?.fontFamily,"--flexdoc-code-size":u.code?.fontSize,"--flexdoc-code-line-height":u.code?.lineHeight,"--flexdoc-code-color":u.code?.color,"--flexdoc-code-bg":u.code?.backgroundColor,fontFamily:u.fontFamily,fontSize:u.fontSize,lineHeight:u.lineHeight}}function Bf(a,r){return`${r.toLowerCase()}-${a.replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"")}`}function If(a,r){const o=r.replace(/^#/,"");if(!o)return null;for(const[u,f]of Object.entries(a.paths))for(const p of tn.getHttpMethods(f))if(Bf(u,p)===o)return{path:u,method:p};return null}function jb({logo:a}){const r=typeof a=="string"?{url:a}:a,o=typeof r.padding=="object"?`${Zr(r.padding.vertical)||"0"} ${Zr(r.padding.horizontal)||"0"}`:r.padding,u=s.jsx("img",{src:r.url,alt:r.alt||"API documentation logo",style:{maxHeight:Zr(r.maxHeight)||"32px",maxWidth:Zr(r.maxWidth)||"180px"}});return s.jsx("div",{className:`flex items-center ${r.containerClass||""}`,style:{backgroundColor:r.backgroundColor,padding:o},children:r.clickable===!1?u:s.jsx("a",{href:"#","aria-label":"Documentation home",children:u})})}const Ab=({spec:a,theme:r="light",customStyles:o={},options:u={}})=>{const[f,p]=W.useState(()=>typeof window>"u"?null:If(a,window.location.hash)),[g,x]=W.useState(!1),[b,m]=W.useState(!1),v=Rg(a.info.title,typeof window>"u"?void 0:window.location.host),[S,N]=W.useState(()=>({key:v,expand:Ld(v).expand})),_=S.key===v?S.expand:Ld(v).expand,R=typeof u.theme=="object"?u.theme:void 0,z=W.useMemo(()=>({...Sb(r,R),...o}),[r,R,o]);W.useEffect(()=>{if(!u.customCss)return;const $=document.createElement("style");return $.dataset.flexdocCustomCss="true",$.textContent=u.customCss,document.head.appendChild($),()=>$.remove()},[u.customCss]),W.useEffect(()=>{if(typeof window>"u")return;const $=()=>p(If(a,window.location.hash));return $(),window.addEventListener("hashchange",$),()=>window.removeEventListener("hashchange",$)},[a]),W.useEffect(()=>{if(!g||typeof document>"u")return;const $=document.body.style.overflow;document.body.style.overflow="hidden";const q=J=>{J.key==="Escape"&&x(!1)};return document.addEventListener("keydown",q),()=>{document.body.style.overflow=$,document.removeEventListener("keydown",q)}},[g]);const M=($,q)=>{p({path:$,method:q}),x(!1),typeof window<"u"&&(window.location.hash=Bf($,q))},B=Vs(u.expand,u.expand===void 0?u.expandResponses:void 0),T=_===void 0?B:Vs(_),E=$=>{N({key:v,expand:$}),$g(v,$)},w=yb(r,"border-gray-200 bg-white text-gray-600","border-gray-700 bg-gray-800 text-gray-300"),U=r==="dark"?"bg-gray-900 text-gray-100":"bg-gray-50 text-gray-900",Y=($=!1)=>s.jsx("button",{type:"button",className:$?`fixed bottom-4 right-4 z-40 inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-lg ${r==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900"}`:"inline-flex h-11 w-11 items-center justify-center rounded-md border","aria-label":"Open settings","aria-expanded":b,onClick:()=>m(!0),children:s.jsx(yg,{className:"h-5 w-5"})});return s.jsxs("div",{className:`flexdoc-root flex min-h-screen flex-col ${U}`,style:z,children:[!u.hideTopbar&&s.jsxs("header",{className:`sticky top-0 z-30 flex min-h-14 items-center gap-3 border-b px-3 sm:px-5 ${r==="dark"?"border-gray-700 bg-gray-900":"border-gray-200 bg-white"}`,children:[s.jsx("button",{className:"inline-flex h-11 w-11 items-center justify-center rounded-md lg:hidden","aria-label":"Open API navigation","aria-expanded":g,onClick:()=>x(!0),children:s.jsx(pg,{className:"h-5 w-5"})}),u.logo&&s.jsx(jb,{logo:u.logo}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"truncate font-semibold",children:a.info.title}),!u.hideHostname&&a.servers?.[0]?.url&&s.jsx("div",{className:"truncate text-xs opacity-60",children:a.servers[0].url})]}),!u.hideDownloadButton&&s.jsx("a",{className:"hidden rounded-md border px-3 py-2 text-sm sm:inline-flex",href:`data:application/json;charset=utf-8,${encodeURIComponent(JSON.stringify(a,null,2))}`,download:"openapi.json",children:"Download spec"}),Y()]}),u.hideTopbar&&Y(!0),s.jsxs("div",{className:"relative flex min-h-0 flex-1 overflow-hidden",children:[s.jsx("aside",{className:"hidden w-80 shrink-0 lg:block",style:{background:"var(--flexdoc-sidebar-bg)",color:"var(--flexdoc-sidebar-text)"},children:s.jsx(Ud,{spec:a,onEndpointSelect:M,theme:r,selectedEndpoint:f||void 0})}),g&&s.jsxs("div",{className:"fixed inset-0 z-50 lg:hidden",role:"dialog","aria-modal":"true","aria-label":"API navigation",children:[s.jsx("button",{"aria-label":"Close navigation backdrop",className:"absolute inset-0 bg-black/40",onClick:()=>x(!1)}),s.jsxs("aside",{className:`absolute inset-y-0 left-0 flex w-[min(88vw,22rem)] flex-col shadow-2xl ${r==="dark"?"bg-gray-900":"bg-white"}`,children:[s.jsxs("div",{className:"flex h-14 items-center justify-between border-b px-4",children:[s.jsx("span",{className:"font-semibold",children:"API navigation"}),s.jsx("button",{className:"inline-flex h-11 w-11 items-center justify-center rounded-md","aria-label":"Close API navigation",onClick:()=>x(!1),children:s.jsx(Zu,{className:"h-5 w-5"})})]}),s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:s.jsx(Ud,{spec:a,onEndpointSelect:M,theme:r,selectedEndpoint:f||void 0})})]})]}),s.jsx("main",{className:"min-w-0 flex-1 overflow-hidden",children:f?s.jsx(pb,{spec:a,path:f.path,method:f.method,theme:r,options:u,defaultExpandedSections:T}):s.jsx(mb,{spec:a,onEndpointSelect:M,theme:r})})]}),s.jsx(hb,{footerClasses:w,footer:u.footer}),s.jsx(vb,{open:b,theme:r,viewerExpand:_,effectiveExpandedSections:T,onExpandChange:E,onClose:()=>m(!1)})]})},mo="x-flexdoc-external-documents";function Nb(a){if(typeof fetch!="function")throw new Error("No document loader is available in this environment");return fetch(a).then(async r=>{if(!r.ok)throw new Error(`Failed to load OpenAPI reference ${a}: ${r.status}`);const o=await r.text();return On.parseSpec(o).catch(()=>{try{return JSON.parse(o)}catch{throw new Error(`Reference document is not valid JSON/YAML: ${a}`)}})})}function wb(a,r){if(a.startsWith("#"))return{documentUri:r,pointer:a};const o=new URL(a,r),u=o.hash||"#";return o.hash="",{documentUri:o.toString(),pointer:u}}function Yf(a,r){const o=On.encodePointerToken(a);if(r==="#"||r==="")return`#/${mo}/${o}`;if(!r.startsWith("#/"))throw new Error(`Unsupported JSON Pointer reference: ${r}`);return`#/${mo}/${o}/${r.slice(2)}`}function Gf(a){return JSON.parse(JSON.stringify(a))}async function Tb(a,r){const o=r.load||Nb,u=new URL(r.baseUri).toString().replace(/#.*$/,""),f=Gf(a),p={},g=new Map;async function x(v){if(v===u)return f;if(p[v])return p[v];if(g.has(v))return g.get(v);const S=Promise.resolve(o(v)).then(_=>Gf(_));g.set(v,S);const N=await S;return p[v]=N,N}const b=new Set;async function m(v,S){if(b.has(S))return;b.add(S);async function N(_){if(!(!_||typeof _!="object")){if(Array.isArray(_)){for(const R of _)await N(R);return}if(typeof _.$ref=="string"){const R=wb(_.$ref,S);if(R.documentUri!==S){const z=await x(R.documentUri);_.$ref=R.documentUri===u?R.pointer:Yf(R.documentUri,R.pointer),await m(z,R.documentUri)}else S!==u&&(_.$ref=Yf(S,R.pointer))}for(const[R,z]of Object.entries(_))R!=="$ref"&&await N(z)}}await N(v)}return await m(f,u),Object.keys(p).length&&(f[mo]=p),f}async function Eb(a,r){return Tb(a,r)}const Qr="1",Jr=new WeakMap;function Cb(a){return JSON.parse(JSON.stringify(a))}function ho(a,r={}){const o=Cb(a);if(r.title&&(o.info.title=r.title),r.description&&(o.info.description=r.description),r.altDescription&&!o.info.description&&(o.info.description=r.altDescription),r.version&&(o.info.version=r.version),!r.tagGroups?.length)return o;const u=new Map;for(const g of r.tagGroups)for(const x of g.tags)u.set(x,g.name);const f={},p=new Set(["get","post","put","delete","patch","options","head","trace"]);for(const[g,x]of Object.entries(o.paths)){const b={};let m=!1;for(const[v,S]of Object.entries(x)){if(!p.has(v)){b[v]=S;continue}const N=S,_=(N?.tags||[]).filter(R=>u.has(R)).map(R=>u.get(R));!_.length||!N||(b[v]={...N,tags:Array.from(new Set(_))},m=!0)}m&&(f[g]=b)}return o.paths=f,o.tags=r.tagGroups.map(g=>({name:g.name})),o}function kb(a){return typeof a.theme=="string"?a.theme:typeof document<"u"&&document.documentElement.classList.contains("dark")?"dark":"light"}function Ff(a,r,o){const u=ho(r,o),f=Jr.get(a);f&&f.unmount();const p=Wy.createRoot(a);return Jr.set(a,p),p.render(s.jsx(Ab,{spec:u,theme:kb(o),options:o})),()=>{Jr.get(a)===p&&Jr.delete(a),p.unmount()}}function Vf(a,r){const o={contractVersion:Qr,...r.options||{}};return Ff(a,r.spec,o)}async function Kf(a,r){const o={contractVersion:Qr,...r.options||{}},u=r.baseUri?await Eb(r.spec,{baseUri:r.baseUri,load:r.documentLoader}):r.spec;return Ff(a,u,o)}return typeof window<"u"&&(window.FlexDocStandalone={mount:Vf,mountAsync:Kf,prepareSpec:ho,contractVersion:Qr}),Ja.FLEXDOC_CONTRACT_VERSION=Qr,Ja.mountFlexDoc=Vf,Ja.mountFlexDocAsync=Kf,Ja.prepareSpec=ho,Object.defineProperty(Ja,Symbol.toStringTag,{value:"Module"}),Ja})({});
|
|
82
|
+
`).trim(),n=t.tests.filter(Boolean).join(`
|
|
83
|
+
|
|
84
|
+
`).trim();return e||n?{preRequest:e,tests:n}:void 0}function _v(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return t}}function Lv(t){const e=t.split("#",1)[0],n=e.indexOf("?");if(n<0)return{url:e,query:[]};const r=e.slice(n+1),s=r?r.split("&").map(a=>{const c=a.indexOf("=");return{key:_v(c>=0?a.slice(0,c):a),value:_v(c>=0?a.slice(c+1):""),enabled:!0}}):[];return{url:e.slice(0,n),query:s}}function JO(t){return Jr(t).map(e=>({key:st(e.key),value:st(e.value),enabled:e.disabled!==!0}))}function QO(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bv(t,e){let n=t;for(const r of Jr(e)){const s=st(r.key).trim();s&&(n=n.replace(new RegExp(`:${QO(s)}(?=/|$)`,"g"),`{{${s}}}`))}return n}function WO(t){if(typeof t=="string")return Lv(t);if(!pn(t))return{url:"",query:[]};const e=JO(t.query),n=st(t.raw);if(n){const h=Lv(n);return{url:Bv(h.url,t.variable),query:e.length>0?e:h.query}}const r=st(t.protocol).replace(/:$/,""),s=Array.isArray(t.host)?t.host.map(st).join("."):st(t.host),a=st(t.port),c=Array.isArray(t.path)?t.path.map(st).join("/"):st(t.path).replace(/^\//,""),d=s?`${r?`${r}://`:""}${s}${a?`:${a}`:""}`:"",f=d?`${d}${c?`/${c}`:""}`:c;return{url:Bv(f,t.variable),query:e}}function ZO(t){return Jr(t).map(e=>({key:st(e.key),value:st(e.value),enabled:e.disabled!==!0}))}function e3(t){return t.find(e=>e.enabled!==!1&&e.key.toLowerCase()==="content-type")?.value}function t3(t){switch(t.toLowerCase()){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"javascript":return"application/javascript";case"text":return"text/plain";default:return}}function n3(t,e,n,r){const s=e3(e);if(!pn(t)||!t.mode)return{body:"",contentType:s||"application/json",bodyMode:"none"};const a=st(t.mode);if(a==="raw"){const c=pn(t.options)&&pn(t.options.raw)?t.options.raw:void 0,d=c?st(c.language):"";return{body:st(t.raw),contentType:s||t3(d)||"text/plain",bodyMode:d.toLowerCase()==="json"?"json":"raw"}}if(a==="urlencoded")return{body:"",bodyMode:"urlencoded",urlencoded:Jr(t.urlencoded).map(d=>({key:st(d.key),value:st(d.value),enabled:d.disabled!==!0})),contentType:s||"application/x-www-form-urlencoded"};if(a==="graphql"){const c=pn(t.graphql)?t.graphql:{},d=st(c.variables);return{body:"",bodyMode:"graphql",graphql:{query:st(c.query),variables:d},contentType:s||"application/json"}}if(a==="formdata"){const c=Jr(t.formdata).map(f=>{const h=st(f.type)==="file"?"file":"text",g=Array.isArray(f.src)?f.src.map(st).filter(Boolean).join(", "):st(f.src);return{key:st(f.key),value:h==="text"?st(f.value):"",enabled:f.disabled!==!0,type:h,...h==="file"&&g?{fileName:g}:{},...typeof f.contentType=="string"?{contentType:f.contentType}:{}}});return c.filter(f=>f.type==="file").length>0&&Xn(r,"postman-body-formdata-files",n,"Multipart file fields were preserved, but exported local file paths cannot be reopened by the browser. Re-select those files before sending."),{body:"",bodyMode:"formdata",formData:c,contentType:s}}if(a==="file"){const c=pn(t.file)?st(t.file.src):st(t.src);return Xn(r,"postman-body-file",n,c?`Postman binary file body "${c}" was preserved as intent, but browser security requires re-selecting the file before sending.`:"Postman binary file body requires selecting the file again in FlexDoc before sending."),{body:"",contentType:s||"application/octet-stream",bodyMode:"binary",binary:{fileName:c||void 0,contentType:s||"application/octet-stream"}}}return Xn(r,"postman-body-unsupported",n,`Postman body mode "${a}" is not supported; the request body was left empty.`),{body:"",contentType:s||"application/octet-stream",bodyMode:"none"}}function i3(t,e,n,r,s,a,c,d){const f=typeof t=="string"?{method:"GET",url:t}:t;if(!pn(f))return Xn(d,"postman-request-invalid",c,"Skipped an invalid Postman request entry."),null;const h=st(f.method).trim().toUpperCase()||"GET",g=WO(f.url),b=ZO(f.header),v=n3(f.body,b,`${c}.body`,d),S={method:h,url:g.url,query:g.query,headers:b,body:v.body,contentType:v.contentType,bodyMode:v.bodyMode,urlencoded:v.urlencoded,formData:v.formData,binary:v.binary,graphql:v.graphql,auth:$h(f.auth,{type:"inherit"},`${c}.auth`,d)},A=XO(s);return{id:wn("request"),collectionId:n,folderId:r,name:e.trim()||`${h} ${g.url||"request"}`,request:S,...A?{scripts:A}:{},createdAt:a,updatedAt:a}}function $v(t){Array.isArray(t.items)&&t.items.forEach((e,n)=>{const r=`${t.path}[${n}]`;if(!pn(e)){Xn(t.warnings,"postman-item-invalid",r,"Skipped an invalid Postman item.");return}const s=st(e.name)||"Untitled",a=Dv(e.event,`${r}.event`,t.warnings),c=GO(t.inheritedScripts,a);if(Array.isArray(e.item)){const f=wn("folder");t.folders.push({id:f,collectionId:t.collectionId,parentFolderId:t.parentFolderId,name:s,auth:$h(e.auth,{type:"inherit"},`${r}.auth`,t.warnings),createdAt:t.timestamp,updatedAt:t.timestamp}),$v({...t,items:e.item,parentFolderId:f,inheritedScripts:c,path:`${r}.item`});return}const d=i3(e.request,s,t.collectionId,t.parentFolderId,c,t.timestamp,`${r}.request`,t.warnings);d&&t.requests.push(d)})}function r3(t){if(!pn(t)||!pn(t.info)||!Array.isArray(t.item))throw new Error("This JSON is not a Postman collection. Expected info and item fields.");const e=st(t.info.name).trim();if(!e)throw new Error("Postman collection info.name is required.");const n=[],r=st(t.info.schema);r&&!r.includes("/v2.1.0/")&&Xn(n,"postman-schema-version","info.schema",`Collection schema "${r}" is not Postman v2.1; FlexDoc imported the compatible fields it recognized.`);const s=new Date().toISOString(),a=wn("collection"),c={id:a,name:e,auth:$h(t.auth,{type:"none"},"auth",n),variables:Rv(t.variable,"variable",n),createdAt:s,updatedAt:s},d=[],f=[];return $v({items:t.item,collectionId:a,inheritedScripts:Dv(t.event,"event",n),timestamp:s,path:"item",folders:d,requests:f,warnings:n}),{collection:c,folders:d,requests:f,warnings:n}}function s3(t){if(!pn(t)||!Array.isArray(t.values)||typeof t.name!="string")throw new Error("This JSON is not a Postman environment. Expected name and values fields.");const e=st(t._postman_variable_scope).toLowerCase();if(e&&e!=="environment")throw new Error(`Postman variable scope "${e}" is not an environment.`);const n=[],r=new Date().toISOString();return{environment:{id:wn("environment"),name:t.name.trim()||"Imported environment",variables:Rv(t.values,"values",n),createdAt:r,updatedAt:r},warnings:n}}function l3(t){if(pn(t)&&pn(t.info)&&Array.isArray(t.item))return{kind:"collection",result:r3(t)};if(pn(t)&&Array.isArray(t.values)&&typeof t.name=="string")return{kind:"environment",result:s3(t)};throw new Error("Unsupported Postman JSON. Import a collection v2.1 JSON file or an exported environment JSON file.")}function a3(t){if(t.collections.length!==1||t.folders.length!==0||t.requests.length!==0)return!1;const e=t.collections[0];return e.name==="My Collection"&&e.auth.type==="none"&&e.variables.length===0}function o3(t,e){const n=a3(t)?[]:t.collections;return{...t,collections:[...n,e.collection],folders:[...t.folders,...e.folders],requests:[...t.requests,...e.requests]}}function c3(t,e){return{...t,environments:[...t.environments,e.environment],activeEnvironmentId:t.activeEnvironmentId||e.environment.id}}function qv(t,e){return`${t} ${t===1?e:`${e}s`}`}const u3=({onWorkspaceChange:t,onSelectedCollectionChange:e,theme:n})=>{const r=I.useRef(null),[s,a]=I.useState(null),[c,d]=I.useState([]),f=async A=>{if(A.length===0)return;const C=[],T=[],D=[];for(const B of A)try{const M=JSON.parse(await B.text()),z=l3(M);C.push(z),T.push(...z.result.warnings.map(F=>({...F,path:`${B.name}:${F.path}`})))}catch(M){D.push(`${B.name}: ${M instanceof Error?M.message:String(M)}`)}C.length>0&&t(B=>{let M=B;for(const z of C)M=z.kind==="collection"?o3(M,z.result):c3(M,z.result);return M});const j=C.filter(B=>B.kind==="collection"),E=C.length-j.length,O=j[j.length-1];O?.kind==="collection"&&e?.(O.result.collection.id),d(T);const R=[j.length>0?qv(j.length,"collection"):"",E>0?qv(E,"environment"):""].filter(Boolean);C.length===0?a({tone:"error",text:D.join(" ")||"No Postman documents were imported."}):D.length>0||T.length>0?a({tone:"warning",text:`Imported ${R.join(" and ")}. ${D.length>0?`${D.length} file${D.length===1?"":"s"} failed to import.`:`${T.length} compatibility warning${T.length===1?"":"s"} need review.`}`}):a({tone:"success",text:`Imported ${R.join(" and ")}.`})},h=n==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",g=n==="dark"?"text-gray-400":"text-gray-500",b=n==="dark"?"text-amber-300":"text-amber-700",v=n==="dark"?"text-emerald-300":"text-emerald-700",S=n==="dark"?"text-red-300":"text-red-700";return p.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-import-heading",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(vg,{className:"h-4 w-4"}),p.jsx("h3",{id:"api-client-import-heading",className:"font-semibold",children:"Import"})]}),p.jsx("input",{ref:r,type:"file",accept:".json,application/json",multiple:!0,className:"hidden","aria-label":"Import Postman JSON",onChange:A=>{const C=Array.from(A.currentTarget.files||[]);A.currentTarget.value="",f(C)}}),p.jsxs("button",{type:"button",className:`flex w-full items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm font-medium ${h}`,onClick:()=>r.current?.click(),children:[p.jsx(vg,{className:"h-4 w-4"}),"Import Postman"]}),p.jsx("p",{className:`text-xs ${g}`,children:"Import Postman Collection v2.1 and exported environment JSON files. Multiple files can be selected together."}),s&&p.jsxs("div",{className:`flex items-start gap-2 text-xs ${s.tone==="success"?v:s.tone==="warning"?b:S}`,role:"status",children:[s.tone==="success"?p.jsx(Oo,{className:"mt-0.5 h-4 w-4 shrink-0"}):p.jsx(md,{className:"mt-0.5 h-4 w-4 shrink-0"}),p.jsx("span",{children:s.text})]}),c.length>0&&p.jsxs("details",{className:`text-xs ${b}`,children:[p.jsxs("summary",{className:"cursor-pointer font-medium",children:["Review import warnings (",c.length,")"]}),p.jsxs("ul",{className:"mt-2 space-y-2 pl-4",children:[c.slice(0,5).map((A,C)=>p.jsxs("li",{children:[p.jsx("span",{className:"font-mono",children:A.path}),": ",A.message]},`${A.code}-${A.path}-${C}`)),c.length>5&&p.jsxs("li",{children:[c.length-5," more warning",c.length-5===1?"":"s"," not shown."]})]})]})]})};function d3(t,e){if(!e.folderId)return"Collection root";const n=new Map(t.folders.map(c=>[c.id,c])),r=[],s=new Set;let a=n.get(e.folderId);for(;a&&!s.has(a.id);)s.add(a.id),r.unshift(a.name),a=a.parentFolderId?n.get(a.parentFolderId):void 0;return r.join(" / ")||"Deleted folder"}function f3(t){return t.status==="running"?"Running":t.status==="passed"?"Runner pass":t.status==="failed"?"Runner fail":t.status==="cancelled"?"Cancelled":t.status==="skipped"?"Not run":"Pending"}const h3=({workspace:t,onWorkspaceChange:e,collectionId:n,folderId:r,theme:s,credentials:a,requestInterceptor:c,hostExecution:d,externalVariables:f,externalEnvironmentVariables:h,onCollectionChanges:g,onEnvironmentChanges:b,onOpenHistory:v,onBack:S,fetcher:A})=>{const C=I.useMemo(()=>Ic(t,n,r),[n,r,t]),T=I.useMemo(()=>jv(t,n,r),[n,r,t]),D=t.environments.find(ee=>ee.id===t.activeEnvironmentId),[j,E]=I.useState(!1),[O,R]=I.useState(!1),[B,M]=I.useState(),[z,F]=I.useState({}),X=I.useRef(void 0),W=I.useRef(!0);I.useEffect(()=>(W.current=!0,()=>{W.current=!1,X.current?.abort()}),[]);const G=async()=>{if(O||C.length===0)return;const ee=new AbortController;X.current=ee,R(!0),M(void 0),F(Object.fromEntries(C.map($=>[$.id,{status:"pending"}])));const he=await LO({workspace:t,collectionId:n,folderId:r,runName:T,credentials:a,requestInterceptor:c,hostExecution:d,externalVariables:f,externalEnvironmentVariables:h,stopOnFailure:j,signal:ee.signal,fetcher:A,onCollectionChanges:g,onEnvironmentChanges:b,onRequestStart:$=>{W.current&&F(te=>({...te,[$.id]:{status:"running"}}))},onRequestComplete:$=>{W.current&&F(te=>({...te,[$.requestId]:{status:$.cancelled?"cancelled":$.passed?"passed":"failed",item:$}}))}});W.current&&(e(he.workspace),F($=>Object.fromEntries(C.map(te=>{const L=$[te.id]||{status:"pending"};return[te.id,L.status==="pending"&&he.stopped?{status:"skipped"}:L]}))),M(he),R(!1),X.current=void 0)},we=()=>X.current?.abort(),ye=s==="dark"?"border-gray-700 bg-gray-800/60 text-gray-100":"border-gray-200 bg-gray-50 text-gray-900",xe=s==="dark"?"text-gray-400":"text-gray-500",_=s==="dark"?"border-gray-700 bg-gray-900/40":"border-gray-200 bg-white";return p.jsx("section",{className:`rounded-xl border p-4 md:p-5 ${ye}`,"aria-labelledby":"api-client-runner-heading",children:p.jsxs("div",{className:"space-y-5",children:[p.jsxs("header",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:S,children:[p.jsx(Eo,{className:"h-4 w-4"})," Client"]}),p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(la,{className:"h-5 w-5"}),p.jsx("h2",{id:"api-client-runner-heading",className:"text-lg font-semibold",children:"Collection runner"})]}),p.jsx("p",{className:"mt-1 text-sm font-medium",children:T}),p.jsxs("p",{className:`mt-1 text-xs ${xe}`,children:[C.length," saved request",C.length===1?"":"s"," · Environment: ",D?.name||"None"]})]})]}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[B?.runId&&p.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:()=>v(void 0,B.runId),children:[p.jsx(rA,{className:"h-4 w-4"})," Open run history"]}),O?p.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border border-red-300 px-3 py-2 text-sm text-red-700",onClick:we,children:[p.jsx(bg,{className:"h-4 w-4"})," Stop run"]}):p.jsxs("button",{type:"button",disabled:C.length===0,className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>{G()},children:[p.jsx(la,{className:"h-4 w-4"})," ",B?"Run again":"Start run"]})]})]}),p.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border p-3 sm:flex-row sm:items-center sm:justify-between",children:[p.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[p.jsx("input",{type:"checkbox",checked:j,disabled:O,onChange:ee=>E(ee.target.checked)}),"Stop on runner failure"]}),p.jsx("p",{className:`text-xs ${xe}`,children:"Runner failure means transport/script/test failure. HTTP 4xx/5xx alone does not fail an item."})]}),B&&p.jsxs("div",{className:"grid gap-2 sm:grid-cols-5",children:[p.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[p.jsx("div",{className:xe,children:"Progress"}),p.jsxs("strong",{children:[B.completed," / ",B.total]})]}),p.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[p.jsx("div",{className:xe,children:"Passed"}),p.jsx("strong",{className:"text-green-600",children:B.passed})]}),p.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[p.jsx("div",{className:xe,children:"Failed"}),p.jsx("strong",{className:"text-red-600",children:B.failed})]}),p.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[p.jsx("div",{className:xe,children:"Cancelled"}),p.jsx("strong",{children:B.cancelled})]}),p.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[p.jsx("div",{className:xe,children:"Run"}),p.jsx("strong",{children:B.stopped?"Stopped":"Complete"})]})]}),p.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-runner-order-heading",children:[p.jsxs("div",{children:[p.jsx("h3",{id:"api-client-runner-order-heading",className:"font-semibold",children:"Execution order"}),p.jsx("p",{className:`text-xs ${xe}`,children:"Requests execute sequentially in saved-request order. Folder runs include descendant folders; this list is the exact order that will run."})]}),C.map((ee,he)=>{const $=z[ee.id]||{status:"pending"},te=$.item?.outcome.result,L=$.item?.outcome.scriptTests||[],P=L.filter(Se=>Se.passed).length,ue=te?.status!==void 0&&te.status>=400;return p.jsxs("div",{"data-runner-request-id":ee.id,className:`rounded-lg border p-3 ${_}`,children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[p.jsx("span",{className:`text-xs ${xe}`,children:he+1}),p.jsx("span",{className:"font-mono font-bold text-blue-600",children:ee.request.method.toUpperCase()}),p.jsx("span",{className:"font-medium",children:ee.name})]}),p.jsx("div",{className:`mt-1 text-xs ${xe}`,children:d3(t,ee)}),p.jsx("div",{className:"mt-1 truncate font-mono text-xs",title:ee.request.url,children:ee.request.url})]}),p.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 text-xs",children:[$.status==="running"&&p.jsx(aA,{className:"h-4 w-4 animate-spin"}),$.status==="passed"&&p.jsx(Oo,{className:"h-4 w-4 text-green-600"}),$.status==="failed"&&p.jsx(tA,{className:"h-4 w-4 text-red-600"}),p.jsx("span",{children:f3($)}),te?.status!==void 0&&p.jsxs("span",{className:ue?"text-amber-600":xe,children:["HTTP ",te.status]}),te?.responseTime!==void 0&&p.jsxs("span",{className:xe,children:[p.jsx(dd,{className:"mr-1 inline h-3.5 w-3.5"}),te.responseTime," ms"]})]})]}),L.length>0&&p.jsxs("div",{className:`mt-2 text-xs ${L.some(Se=>!Se.passed)?"text-red-600":xe}`,children:[P,"/",L.length," tests passed"]}),$.item?.outcome.scriptError&&p.jsx("div",{className:"mt-2 text-xs text-red-600",children:$.item.outcome.scriptError}),$.item?.outcome.error&&!$.item.cancelled&&p.jsx("div",{className:"mt-2 text-xs text-red-600",children:$.item.outcome.error}),$.item?.historyEntryId&&p.jsx("button",{type:"button",className:"mt-2 text-xs font-medium text-blue-600 underline underline-offset-2","aria-label":`Open history for ${ee.name}`,onClick:()=>v($.item?.historyEntryId,$.item?.outcome.result?B?.runId:void 0),children:"Inspect history"})]},ee.id)}),C.length===0&&p.jsx("div",{className:`rounded-lg border px-4 py-8 text-center text-sm ${xe}`,children:"There are no saved requests in this run scope yet."})]})]})})};function zv(t){return`flexdoc:api-client-ui:${encodeURIComponent(t)}`}function Hv(t,e){const n=e??(typeof window<"u"?window.localStorage:void 0);if(!n)return{version:1};try{const r=n.getItem(zv(t));if(!r)return{version:1};const s=JSON.parse(r);if(s.version!==1)return{version:1};const a=new Set(["params","headers","authorization","body","scripts"]),c=new Set(["pre-request","tests"]),d=new Set(["light","dark"]);return s.sidebarCollapsed!==void 0&&typeof s.sidebarCollapsed!="boolean"?{version:1}:s.requestTab!==void 0&&(typeof s.requestTab!="string"||!a.has(s.requestTab))?{version:1}:s.scriptTab!==void 0&&(typeof s.scriptTab!="string"||!c.has(s.scriptTab))?{version:1}:s.theme!==void 0&&(typeof s.theme!="string"||!d.has(s.theme))?{version:1}:{version:1,...typeof s.sidebarCollapsed=="boolean"?{sidebarCollapsed:s.sidebarCollapsed}:{},...typeof s.requestTab=="string"?{requestTab:s.requestTab}:{},...typeof s.scriptTab=="string"?{scriptTab:s.scriptTab}:{},...typeof s.theme=="string"?{theme:s.theme}:{}}}catch{return{version:1}}}function za(t,e,n){const r=typeof window<"u"?window.localStorage:void 0;if(r)try{const s=Hv(t,r);r.setItem(zv(t),JSON.stringify({...s,...e,version:1}))}catch{}}function p3(t){return{method:t?.method||"GET",url:t?.url||"",query:t?.query?.map(e=>({...e}))||[],headers:t?.headers?.map(e=>({...e}))||[],body:t?.body||"",contentType:t?.contentType||"application/json",bodyMode:t?.bodyMode,urlencoded:t?.urlencoded?.map(e=>({...e})),formData:t?.formData?.map(e=>({...e})),binary:t?.binary?{...t.binary}:void 0,graphql:t?.graphql?{...t.graphql}:void 0,hostExecution:t?.hostExecution?{...t.hostExecution}:void 0,auth:t?.auth?t.auth.type==="oauth2"?{...t.auth,scopes:t.auth.scopes?[...t.auth.scopes]:void 0}:{...t.auth}:{type:"inherit"}}}function Iv(t,e){return ca(t)!=="none"?"body":e.preRequest.trim()||e.tests.trim()?"scripts":t.auth&&t.auth.type!=="none"&&t.auth.type!=="inherit"?"authorization":(t.headers||[]).some(n=>n.enabled!==!1&&n.key.trim())?"headers":"params"}function qh(t){return t.tests.trim()&&!t.preRequest.trim()?"tests":"pre-request"}function Uv(t,e){return JSON.stringify({request:t,scripts:cn(e)},(n,r)=>typeof File<"u"&&r instanceof File?{name:r.name,size:r.size,type:r.type,lastModified:r.lastModified}:r)}function m3(t,e){return!!t.url.trim()||!!t.body?.trim()||!!t.query?.some(n=>n.key.trim()||n.value.trim())||!!t.headers?.some(n=>n.key.trim()||n.value.trim())||!!e.preRequest.trim()||!!e.tests.trim()}const Fv=({initialRequest:t,initialScripts:e,initialRequestTab:n,initialScriptTab:r,theme:s="light",persistenceKey:a="default",pageMode:c=!1,manageTheme:d=!0,handoff:f,activeEnvironmentId:h,onActiveEnvironmentIdChange:g,onChromeStateChange:b,onRequestChange:v,onDraftChange:S,onScriptsChange:A,onRequestTabChange:C,onScriptTabChange:T,onExecutionStart:D,onExecutionComplete:j,variables:E={},environmentVariables:O={},onCollectionChanges:R,onEnvironmentChanges:B,...M})=>{const z=p3(t),F=cn(e),X=nl(),W=a===!1?{}:Hv(a),[G,we]=I.useState(z),[ye,xe]=I.useState(z),[_,ee]=I.useState(F),[he,$]=I.useState(F),[te,L]=I.useState(M.initialServerUrl),[P,ue]=I.useState(0),[Se,Ne]=I.useState(n||W.requestTab||"params"),[Re,Be]=I.useState(r||W.scriptTab||qh(F)),[Ze,_e]=I.useState("request"),[Ke,gt]=I.useState({}),[se,de]=I.useState(),[ge,Te]=I.useState(X),[Ie,Xe]=I.useState(X.collections[0]?.id),[ht,Pt]=I.useState(""),rn=I.useRef(X.collections[0]?.id),sn=I.useRef(void 0),[qn,Cn]=I.useState(a===!1),[lt,pi]=I.useState(W.sidebarCollapsed??!1),[Mn,Jn]=I.useState(W.theme||s),Tt=d?Mn:s;I.useEffect(()=>{if(a===!1)return;let Me=!1;return H0(a).then(Qe=>{Me||(Te(Qe),Xe(Qe.collections[0]?.id),Pt(""),Cn(!0))}).catch(()=>{Me||Cn(!0)}),()=>{Me=!0}},[a]),I.useEffect(()=>{!qn||a===!1||I0(a,ge).catch(()=>{})},[qn,a,ge]);const x=I.useMemo(()=>$0(ge,Ie),[Ie,ge]),V=I.useMemo(()=>Xd(ge),[ge]),pe=I.useMemo(()=>({...O,...V}),[O,V]),le=I.useMemo(()=>({...x,...E,...pe}),[x,pe,E]);I.useEffect(()=>{if(h===void 0)return;const Me=h||void 0;let Qe=!1;return queueMicrotask(()=>{Qe||Te(Yt=>Yt.activeEnvironmentId===Me?Yt:{...Yt,activeEnvironmentId:Me})}),()=>{Qe=!0}},[h]);const oe=I.useMemo(()=>Uv(ye,he),[ye,he]),k=I.useMemo(()=>m3(ye,he)&&!ge.requests.some(Me=>Uv(Me.request,Me.scripts)===oe),[oe,ye,he,ge.requests]);I.useEffect(()=>{b?.({environments:ge.environments.map(({id:Me,name:Qe})=>({id:Me,name:Qe})),activeEnvironmentId:ge.activeEnvironmentId,hasUnsavedRequest:k})},[k,b,ge.activeEnvironmentId,ge.environments]);const J=I.useCallback(Me=>B0(ge,Ie,ht||void 0,Me||{type:"none"}),[Ie,ht,ge]),Z=I.useCallback(Me=>{Xe(Me),Pt("")},[]),K=Me=>{v?.(Me)},Q=Me=>{xe(ai(Me)),S?.(ai(Me))},Ae=Me=>{const Qe=cn(Me);$(Qe),A?.(Qe)},fe=Me=>{Ne(Me),a!==!1&&za(a,{requestTab:Me}),C?.(Me)},ke=Me=>{Be(Me),a!==!1&&za(a,{scriptTab:Me}),T?.(Me)},je=Me=>{const Qe=rn.current||Ie;Te(Yt=>q0(Yt,Qe,Me)),R?.(Me)},De=Me=>{Te(Qe=>Jd(Qe,Me)),B?.(Me)},$e=()=>{rn.current=Ie,sn.current=ht||void 0,D?.()},ze=Me=>{Te(Qe=>L0(Qe,{...Me,collectionId:rn.current,folderId:sn.current})),j?.(Me)},Je=(Me,Qe,Yt,mi)=>{_e("request");const Li=Yt&&ge.collections.some(yi=>yi.id===Yt)?Yt:void 0;Li&&Xe(Li);const Wr=Li||Ie,Qn=mi&&ge.folders.some(yi=>yi.id===mi&&yi.collectionId===Wr)?mi:"";Pt(Qn);const _t=ai(Me),It=cn(Qe),gi=Iv(_t,It),cr=qh(It);Ne(gi),Be(cr),a!==!1&&za(a,{requestTab:gi,scriptTab:cr}),we(_t),xe(_t),ee(It),$(It),L(void 0),ue(yi=>yi+1)};I.useEffect(()=>{if(!f)return;const Me=ai(f.request),Qe=cn(f.scripts),Yt=f.requestTab||Iv(Me,Qe),mi=f.scriptTab||qh(Qe);let Li=!1;return queueMicrotask(()=>{Li||(_e("request"),we(Me),xe(Me),ee(Qe),$(Qe),L(f.serverUrl),Ne(Yt),Be(mi),ue(Wr=>Wr+1))}),()=>{Li=!0}},[f]);const Rn=(Me,Qe)=>{Xe(Me),Pt(Qe||""),de({collectionId:Me,folderId:Qe}),_e("runner")},Dn=(Me,Qe)=>{gt({entryId:Me,runId:Qe}),_e("history")},Kt=()=>pi(Me=>{const Qe=!Me;return a!==!1&&za(a,{sidebarCollapsed:Qe}),Qe}),_i=Tt==="dark"?"border-gray-700 bg-gray-900/40 text-gray-100":"border-gray-200 bg-white text-gray-900",or=Tt==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900";return p.jsxs("div",{className:`grid h-full min-h-0 min-w-0 ${c?"gap-0":"gap-4"} ${lt?"lg:grid-cols-[3.5rem_minmax(0,1fr)]":"lg:grid-cols-[19rem_minmax(0,1fr)]"}`,"data-api-client-workspace":!0,children:[p.jsxs("aside",{className:`min-h-0 min-w-0 overflow-y-auto border p-3 ${c?"rounded-none border-b-0 border-l-0 border-t-0":"rounded-xl"} ${_i}`,"data-api-client-workspace-sidebar":!0,"data-collapsed":lt?"true":"false",children:[p.jsx("div",{className:`mb-3 flex ${lt?"justify-center":"justify-end"}`,children:p.jsx("button",{type:"button",className:"inline-flex h-10 w-10 items-center justify-center rounded-md border","aria-label":lt?"Expand API Client sidebar":"Collapse API Client sidebar","aria-expanded":!lt,onClick:Kt,children:lt?p.jsx(pd,{className:"h-4 w-4"}):p.jsx(hd,{className:"h-4 w-4"})})}),!lt&&p.jsxs("div",{className:"space-y-5",children:[p.jsx(u3,{onWorkspaceChange:Te,onSelectedCollectionChange:Z,theme:Tt}),p.jsx("div",{className:"border-t pt-4",children:p.jsx($O,{workspace:ge,onWorkspaceChange:Te,theme:Tt})}),p.jsx("div",{className:"border-t pt-4",children:p.jsx(BO,{request:ye,scripts:he,onLoadRequest:Je,onSelectedCollectionChange:Z,onSelectedFolderChange:Pt,onRunCollection:Me=>Rn(Me),onRunFolder:(Me,Qe)=>Rn(Me,Qe),selectedCollectionId:Ie,selectedFolderId:ht,workspace:ge,onWorkspaceChange:Te,hostExecution:M.hostExecution,theme:Tt})}),p.jsx("div",{className:"border-t pt-4",children:p.jsx(zO,{workspace:ge,onWorkspaceChange:Te,onLoadRequest:Je,onViewAll:()=>Dn(),theme:Tt})})]})]}),p.jsxs("div",{className:"min-h-0 min-w-0 overflow-y-auto overscroll-contain",children:[p.jsxs("div",{className:`mb-3 flex flex-wrap items-center justify-between gap-2 rounded-md border px-3 py-2 text-xs ${_i}`,"data-api-client-toolbar":!0,children:[p.jsxs("label",{className:"flex items-center gap-2",children:[p.jsx("span",{children:M.messages?.environment||"Environment"}),p.jsxs("select",{"aria-label":M.messages?.environment||"API Client environment",className:`rounded-md border px-2 py-1 text-xs ${or}`,value:ge.activeEnvironmentId||"",onChange:Me=>{const Qe=Me.target.value||void 0;Te(Yt=>({...Yt,activeEnvironmentId:Qe})),g?.(Qe)},children:[p.jsx("option",{value:"",children:M.messages?.noEnvironment||"No environment"}),ge.environments.map(Me=>p.jsx("option",{value:Me.id,children:Me.name},Me.id))]})]}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d&&p.jsxs("button",{type:"button",className:`rounded-md border px-2 py-1 text-xs ${or}`,"aria-label":`${M.messages?.viewerTheme||"Theme"}: ${Tt==="dark"?M.messages?.lightTheme||"Light":M.messages?.darkTheme||"Dark"}`,"aria-pressed":Tt==="dark",onClick:()=>{const Me=Tt==="dark"?"light":"dark";Jn(Me),a!==!1&&za(a,{theme:Me})},children:[M.messages?.viewerTheme||"Theme",": ",Tt==="dark"?M.messages?.darkTheme||"Dark":M.messages?.lightTheme||"Light"]}),Ze==="request"&&k&&p.jsx("span",{"aria-label":"Unsaved request changes",children:M.messages?.unsavedChanges||"Unsaved changes"})]})]}),Ze==="history"?p.jsx(VO,{workspace:ge,onWorkspaceChange:Te,onLoadRequest:Je,onBack:()=>_e("request"),initialEntryId:Ke.entryId,initialRunId:Ke.runId,theme:Tt},`${Ke.runId||""}:${Ke.entryId||""}`):Ze==="runner"&&se?p.jsx(h3,{workspace:ge,onWorkspaceChange:Te,collectionId:se.collectionId,folderId:se.folderId,theme:Tt,credentials:M.credentials,requestInterceptor:M.requestInterceptor,hostExecution:M.hostExecution,externalVariables:E,externalEnvironmentVariables:O,onCollectionChanges:R,onEnvironmentChanges:B,onOpenHistory:Dn,onBack:()=>_e("request")}):p.jsx(kv,{...M,initialRequest:G,initialScripts:_,initialRequestTab:Se,initialScriptTab:Re,initialServerUrl:te,theme:Tt,resolveAuth:J,variables:le,collectionVariables:x,externalVariables:E,environmentVariables:pe,onCollectionChanges:je,onEnvironmentChanges:De,onDraftChange:Q,onScriptsChange:Ae,onRequestTabChange:fe,onScriptTabChange:ke,onExecutionStart:$e,onExecutionComplete:ze,onRequestChange:K},P)]})]})};function Uc(t){if(t!==void 0)return typeof t=="number"?`${t}px`:t}function g3(t,e){if(!e)return{};const n=e.colors||{},r=e.typography||{},s=e.sidebar||{};return{"--flexdoc-primary":n.primary?.main,"--flexdoc-text":n.text?.primary,"--flexdoc-text-muted":n.text?.secondary,"--flexdoc-border":t==="dark"?n.border?.dark:n.border?.light,"--flexdoc-sidebar-bg":t==="dark"?s.backgroundColorDark:s.backgroundColor,"--flexdoc-sidebar-text":t==="dark"?s.textColorDark:s.textColor,"--flexdoc-sidebar-active-text":t==="dark"?s.activeTextColorDark:s.activeTextColor,"--flexdoc-heading-font":r.headings?.fontFamily,"--flexdoc-heading-weight":r.headings?.fontWeight,"--flexdoc-code-font":r.code?.fontFamily,"--flexdoc-code-size":r.code?.fontSize,"--flexdoc-code-line-height":r.code?.lineHeight,"--flexdoc-code-color":r.code?.color,"--flexdoc-code-bg":r.code?.backgroundColor,fontFamily:r.fontFamily,fontSize:r.fontSize,lineHeight:r.lineHeight}}function Vv(t,e){const n=e.replace(/^#/,"");if(!n)return null;const r=[];for(const[s,a]of Object.entries(t.paths))for(const c of Ln.getHttpMethods(a)){if(Rh(s,c)===n)return{path:s,method:c};oO(s,c)===n&&r.push({path:s,method:c})}return r.length===1?r[0]:null}function Pv(){return typeof window>"u"?"docs":new URLSearchParams(window.location.search).get("view")==="api-client"?"api-client":"docs"}function zh(t){if(typeof window>"u")return;const e=new URL(window.location.href);t==="api-client"?e.searchParams.set("view","api-client"):e.searchParams.delete("view"),window.history.replaceState(null,"",`${e.pathname}${e.search}${e.hash}`)}function Kv(t,e){if(typeof document>"u"||typeof URL>"u")return"Downloads are unavailable in this environment.";try{const n=e==="yaml"?kA(t,{lineWidth:120,noRefs:!1}):JSON.stringify(t,null,2),r=new Blob([n],{type:e==="yaml"?"application/yaml;charset=utf-8":"application/json;charset=utf-8"}),s=URL.createObjectURL(r),a=document.createElement("a");a.href=s,a.download=`openapi.${e==="yaml"?"yaml":"json"}`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(s);return}catch(n){const r=n instanceof Error?n.message:String(n);return`Unable to download ${e.toUpperCase()}: ${r}`}}function y3({logo:t,onHome:e}){const n=typeof t=="string"?{url:t}:t,r=typeof n.padding=="object"?`${Uc(n.padding.vertical)||"0"} ${Uc(n.padding.horizontal)||"0"}`:n.padding,s=p.jsx("img",{src:n.url,alt:n.alt||"API documentation logo",style:{maxHeight:Uc(n.maxHeight)||"32px",maxWidth:Uc(n.maxWidth)||"180px"}});return p.jsx("div",{className:`flex items-center ${n.containerClass||""}`,style:{backgroundColor:n.backgroundColor,padding:r},children:n.clickable===!1?s:p.jsx("button",{type:"button","aria-label":"Documentation home",onClick:e,children:s})})}const b3=({spec:t,theme:e="light",customStyles:n={},options:r={}})=>{const s=MA(t.info.title,typeof window>"u"?void 0:window.location.host),a=Or(s),c=r.tryIt?.apiClientPersistenceKey??_0(t.info.title,typeof window>"u"?void 0:window.location.host),d=Pv(),[f,h]=I.useState(()=>typeof window>"u"?null:Vv(t,window.location.hash)),[g,b]=I.useState(d),[v,S]=I.useState(d==="api-client"),[A,C]=I.useState(),T=I.useRef(0),[D,j]=I.useState({environments:[],hasUnsavedRequest:!1}),[E,O]=I.useState(void 0),[R,B]=I.useState(!1),[M,z]=I.useState(!1),[F,X]=I.useState(!1),[W,G]=I.useState(),[we,ye]=I.useState(),[xe,_]=I.useState(()=>({key:s,preferences:a})),ee=I.useRef(null),he=I.useRef(null),$=I.useRef(null),te=r.runtimeIntelligence?.available===!0,L=r.runtimeIntelligence?.endpoint,P=te&&L&&we?.endpoint===L?we:void 0,ue=P?.snapshot,Se=P?.error,Ne=!!(te&&L&&!P),Re=I.useCallback(()=>X(!1),[]),Be=xe.key===s?xe.preferences:Or(s),Ze=Be.theme||e,_e=Ze==="high-contrast"?"dark":Ze,Ke=Be.expand,gt=Be.expandedTags??["default"],se=Be.sidebarCollapsed??!1,de=typeof r.theme=="object"?r.theme:void 0,ge=I.useMemo(()=>({...g3(_e,de),...n}),[_e,de,n]);I.useEffect(()=>{if(!te||!L)return;const K=new AbortController;return fetch(L,{credentials:"same-origin",signal:K.signal}).then(async Q=>{if(!Q.ok)throw new Error(`Runtime intelligence unavailable: HTTP ${Q.status}`);return wO(await Q.json())}).then(Q=>ye({endpoint:L,snapshot:Q})).catch(Q=>{K.signal.aborted||ye({endpoint:L,error:Q instanceof Error?Q.message:String(Q)})}),()=>K.abort()},[te,L]),I.useEffect(()=>{if(!r.customCss)return;const K=document.createElement("style");return K.dataset.flexdocCustomCss="true",K.textContent=r.customCss,document.head.appendChild(K),()=>K.remove()},[r.customCss]),I.useEffect(()=>{if(typeof window>"u")return;const K=()=>h(Vv(t,window.location.hash)),Q=()=>{const Ae=Pv();b(Ae),Ae==="api-client"&&S(!0)};return K(),Q(),window.addEventListener("hashchange",K),window.addEventListener("popstate",Q),()=>{window.removeEventListener("hashchange",K),window.removeEventListener("popstate",Q)}},[t]),I.useEffect(()=>{if(!R||typeof document>"u")return;const K=document.body.style.overflow,Q=he.current;document.body.style.overflow="hidden";const Ae=ee.current,fe=()=>Array.from(Ae?.querySelectorAll('button:not([data-focus-trap-ignore]):not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')||[]);requestAnimationFrame(()=>fe()[0]?.focus());const ke=je=>{if(je.key==="Escape"){je.preventDefault(),B(!1);return}if(je.key!=="Tab")return;const De=fe();if(!De.length)return;const $e=De[0],ze=De[De.length-1];je.shiftKey&&document.activeElement===$e?(je.preventDefault(),ze.focus()):!je.shiftKey&&document.activeElement===ze&&(je.preventDefault(),$e.focus())};return document.addEventListener("keydown",ke),()=>{document.body.style.overflow=K,document.removeEventListener("keydown",ke),Q?.focus()}},[R]);const Te=()=>{_({key:s,preferences:Or(s)})},Ie=K=>{_(Q=>{const Ae=Q.key===s?Q.preferences:Or(s);return{key:s,preferences:{...Ae,...K,version:1}}})},Xe=()=>requestAnimationFrame(()=>$.current?.scrollTo({top:0,behavior:"auto"})),ht=(K,Q)=>{h({path:K,method:Q}),b("docs"),B(!1),zh("docs"),typeof window<"u"&&(window.location.hash=Rh(K,Q)),Xe()},Pt=()=>{if(h(null),b("docs"),B(!1),typeof window<"u"){const K=new URL(window.location.href);K.searchParams.delete("view"),K.hash="",window.history.replaceState(null,"",`${K.pathname}${K.search}`)}Xe()},rn=K=>{K&&(T.current+=1,C({id:T.current,request:K.request,scripts:K.scripts,requestTab:K.requestTab,scriptTab:K.scriptTab,serverUrl:K.serverUrl})),S(!0),b("api-client"),zh("api-client")},sn=()=>{b("docs"),zh("docs"),Xe()},qn=()=>{const K=!se;DA(s,K),Ie({sidebarCollapsed:K})},Cn=Id(r.expand,r.expand===void 0?r.expandResponses:void 0),lt=Ke===void 0?Cn:Id(Ke),pi=K=>{RA(s,K),Te()},Mn=K=>{_A(s,K),Te()},Jn=K=>{LA(s,K),Ie({expandedTags:K})},Tt=I.useCallback(()=>{if(typeof document>"u")return;(g==="api-client"?document.querySelector('[data-api-client-page="api-client"]:not(.hidden)'):document.querySelector('[data-flexdoc-docs-view="docs"]:not(.hidden)'))?.querySelector('[data-api-client-send="true"]:not([disabled])')?.click()},[g]),x=bO(_e,"border-gray-200 bg-white text-gray-600","border-gray-700 bg-gray-800 text-gray-300"),V=_e==="dark"?"bg-gray-900 text-gray-100":"bg-gray-50 text-gray-900",pe=_e==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900",le=r.messages,oe=(K=!1)=>p.jsx("button",{type:"button","data-flexdoc-floating-control":K?"settings":void 0,className:K?`fixed bottom-4 right-4 z-40 inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-lg ${pe}`:"inline-flex h-11 w-11 items-center justify-center rounded-md border","aria-label":le?.openSettings||"Open settings","aria-expanded":M,onClick:()=>z(!0),children:p.jsx(hA,{className:"h-5 w-5"})}),k=(K=!1)=>te?p.jsxs("button",{type:"button","data-flexdoc-floating-control":K?"runtime":void 0,className:K?`fixed bottom-4 right-[4.25rem] z-40 inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-lg ${pe}`:"inline-flex h-11 min-w-11 items-center justify-center gap-2 rounded-md border px-2 text-sm sm:px-3",onClick:()=>X(!0),"aria-label":le?.openRuntime||"Open runtime intelligence","aria-expanded":F,children:[p.jsx(dg,{className:"h-4 w-4"}),!K&&p.jsx("span",{className:"hidden sm:inline",children:ue?`Runtime ${ue.summary.matched}/${ue.summary.documented}`:Ne?"Runtime…":"Runtime"})]}):null,J=(K=!1)=>p.jsx("button",{ref:he,type:"button","data-flexdoc-floating-control":K?"navigation":void 0,"data-flexdoc-mobile-nav-trigger":K?"floating":"topbar",className:K?`fixed left-4 top-4 z-[65] pointer-events-auto inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-lg lg:hidden ${pe}`:"inline-flex h-11 w-11 items-center justify-center rounded-md lg:hidden","aria-label":le?.apiNavigation||"Open API navigation","aria-expanded":R,onClick:()=>B(!0),children:p.jsx(uA,{className:"h-5 w-5"})}),Z=p.jsx(CA,{spec:t,onEndpointSelect:ht,theme:_e,selectedEndpoint:f||void 0,expandedTags:gt,onExpandedTagsChange:Jn,messages:le});return p.jsxs("div",{lang:r.locale,className:`flexdoc-root flex h-full min-h-0 flex-col ${V}`,style:ge,"data-theme":Ze,"data-flexdoc-view":g,children:[!r.hideTopbar&&p.jsx("header",{className:`z-30 flex flex-wrap min-h-14 shrink-0 items-center gap-3 border-b px-3 sm:px-5 ${_e==="dark"?"border-gray-700 bg-gray-900":"border-gray-200 bg-white"}`,children:g==="api-client"?p.jsxs(p.Fragment,{children:[p.jsxs("button",{type:"button",className:"inline-flex min-h-11 items-center gap-2 rounded-md border px-3 text-sm",onClick:sn,children:[p.jsx(Eo,{className:"h-4 w-4"}),le?.backToOperation||"Back to operation"]}),p.jsx("div",{className:"min-w-0 flex-1 truncate font-semibold",children:le?.apiClient||"API Client"}),p.jsxs("label",{className:"flex shrink-0 items-center gap-1 text-xs sm:gap-2",children:[p.jsx("span",{className:"sr-only",children:le?.environment||"Environment"}),p.jsxs("select",{"aria-label":le?.environment||"API Client environment",style:{maxWidth:"10rem"},className:`rounded-md border px-2 py-1.5 text-xs ${_e==="dark"?"border-gray-700 bg-gray-900":"border-gray-300 bg-white"}`,value:E??D.activeEnvironmentId??"",onChange:K=>O(K.target.value||null),children:[p.jsx("option",{value:"",children:le?.noEnvironment||"No environment"}),D.environments.map(K=>p.jsx("option",{value:K.id,children:K.name},K.id))]})]}),D.hasUnsavedRequest&&p.jsx("span",{className:"shrink-0 text-xs font-medium","aria-label":le?.unsavedChanges||"Unsaved request changes",children:le?.unsavedChanges||"Unsaved changes"}),oe()]}):p.jsxs(p.Fragment,{children:[J(),p.jsx("button",{type:"button",className:"hidden h-11 w-11 items-center justify-center rounded-md border lg:inline-flex","aria-label":se?"Expand API navigation sidebar":"Collapse API navigation sidebar","aria-expanded":!se,onClick:qn,children:se?p.jsx(pd,{className:"h-5 w-5"}):p.jsx(hd,{className:"h-5 w-5"})}),r.logo&&p.jsx(y3,{logo:r.logo,onHome:Pt}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{className:"truncate font-semibold",children:t.info.title}),!r.hideHostname&&t.servers?.[0]?.url&&p.jsx("div",{className:"truncate text-xs opacity-60",children:t.servers[0].url})]}),k(),f&&p.jsx("button",{type:"button",className:"hidden shrink-0 rounded-md border px-3 py-2 text-sm md:inline-flex","aria-label":le?.printOperation||"Print operation",onClick:()=>{typeof window<"u"&&window.print()},children:le?.printOperation||"Print operation"}),!r.hideDownloadButton&&p.jsxs("div",{className:"flex shrink-0 items-center gap-1","aria-label":"Download OpenAPI specification",children:[p.jsx("button",{type:"button",className:"rounded-md border px-2 py-2 text-xs sm:px-3 sm:text-sm",onClick:()=>G(Kv(t,"json")),children:"JSON"}),p.jsx("button",{type:"button",className:"rounded-md border px-2 py-2 text-xs sm:px-3 sm:text-sm",onClick:()=>G(Kv(t,"yaml")),children:"YAML"})]}),oe()]})}),r.hideTopbar&&g==="docs"&&J(!0),r.hideTopbar&&g==="docs"&&k(!0),r.hideTopbar&&oe(!0),r.hideTopbar&&g==="docs"&&p.jsx("button",{type:"button","data-flexdoc-floating-control":"desktop-navigation",className:`fixed left-4 top-4 z-40 hidden h-11 w-11 items-center justify-center rounded-full border shadow-lg lg:inline-flex ${pe}`,"aria-label":se?"Expand API navigation sidebar":"Collapse API navigation sidebar","aria-expanded":!se,onClick:qn,children:se?p.jsx(pd,{className:"h-5 w-5"}):p.jsx(hd,{className:"h-5 w-5"})}),r.hideTopbar&&g==="api-client"&&p.jsxs(p.Fragment,{children:[p.jsxs("button",{type:"button","data-flexdoc-floating-control":"api-client-back",className:`fixed left-4 top-4 z-[65] inline-flex min-h-11 items-center gap-2 rounded-full border px-3 shadow-lg ${pe}`,onClick:sn,children:[p.jsx(Eo,{className:"h-4 w-4"}),le?.backToOperation||"Back"]}),p.jsxs("div",{"data-flexdoc-floating-control":"api-client-status",className:`fixed right-4 top-4 z-[65] flex items-center gap-2 rounded-full border px-2 py-1.5 shadow-lg ${pe}`,style:{maxWidth:"calc(100vw - 8rem)"},children:[p.jsxs("label",{className:"flex min-w-0 items-center gap-1 text-xs",children:[p.jsx("span",{className:"sr-only",children:le?.environment||"Environment"}),p.jsxs("select",{"aria-label":le?.environment||"API Client environment",style:{maxWidth:"8rem"},className:`rounded-md border px-2 py-1 text-xs ${_e==="dark"?"border-gray-700 bg-gray-900":"border-gray-300 bg-white"}`,value:E??D.activeEnvironmentId??"",onChange:K=>O(K.target.value||null),children:[p.jsx("option",{value:"",children:le?.noEnvironment||"No environment"}),D.environments.map(K=>p.jsx("option",{value:K.id,children:K.name},K.id))]})]}),D.hasUnsavedRequest&&p.jsx("span",{className:"truncate text-xs font-medium","aria-label":le?.unsavedChanges||"Unsaved request changes",children:le?.unsavedChanges||"Unsaved changes"})]})]}),p.jsxs("div",{className:"relative flex min-h-0 flex-1 overflow-hidden",children:[p.jsxs("div",{"data-flexdoc-docs-view":"docs",className:`${g==="docs"?"flex":"hidden"} min-h-0 min-w-0 flex-1`,children:[p.jsx("aside",{className:`hidden min-h-0 shrink-0 overflow-hidden transition-[width] duration-200 motion-reduce:transition-none lg:block ${se?"w-14":"w-80"}`,"data-docs-sidebar":!0,"data-collapsed":se?"true":"false",style:{background:"var(--flexdoc-sidebar-bg)",color:"var(--flexdoc-sidebar-text)"},children:!se&&Z}),p.jsxs("main",{ref:$,"data-flexdoc-main-scroll":!0,className:"min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain",children:[f?p.jsx(fO,{spec:t,path:f.path,method:f.method,theme:_e,options:r,defaultExpandedSections:lt,runtimeSnapshot:ue,onOpenInApiClient:rn}):p.jsx(gO,{spec:t,onEndpointSelect:ht,theme:_e}),p.jsx(yO,{footerClasses:x,footer:r.footer})]})]}),v&&p.jsx("div",{"data-api-client-page":"api-client",className:`${g==="api-client"?"block":"hidden"} min-h-0 min-w-0 flex-1 overflow-hidden`,children:p.jsx(Fv,{pageMode:!0,manageTheme:!1,theme:_e,messages:le,persistenceKey:c,handoff:A,activeEnvironmentId:E,onActiveEnvironmentIdChange:K=>O(K??null),onChromeStateChange:K=>{j(K),O(Q=>Q===void 0?K.activeEnvironmentId??null:Q)},credentials:r.tryIt?.credentials||"same-origin",requestInterceptor:r.tryIt?.requestInterceptor,hostExecution:r.tryIt?.hostExecution,serverOptions:t.servers||[]})})]}),R&&p.jsxs("div",{ref:ee,className:"fixed inset-0 z-[70] lg:hidden",role:"dialog","aria-modal":"true","aria-label":le?.apiNavigation||"API navigation",children:[p.jsx("button",{type:"button",tabIndex:-1,"data-focus-trap-ignore":!0,"aria-label":"Close navigation backdrop",className:"absolute inset-0 bg-black/40",onClick:()=>B(!1)}),p.jsxs("aside",{className:`absolute inset-y-0 left-0 flex w-[min(88vw,22rem)] flex-col shadow-2xl ${_e==="dark"?"bg-gray-900":"bg-white"}`,children:[p.jsxs("div",{className:"flex h-14 items-center justify-between border-b px-4",children:[p.jsx("span",{className:"font-semibold",children:le?.apiNavigation||"API navigation"}),p.jsx("button",{type:"button",className:"inline-flex h-11 w-11 items-center justify-center rounded-md","aria-label":le?.closeApiNavigation||"Close API navigation",onClick:()=>B(!1),children:p.jsx(gd,{className:"h-5 w-5"})})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:Z})]})]}),W&&p.jsx("div",{role:"alert",className:`fixed bottom-4 left-1/2 z-[90] max-w-[min(92vw,40rem)] -translate-x-1/2 rounded-lg border px-4 py-3 text-sm shadow-xl ${_e==="dark"?"border-red-800 bg-red-950 text-red-100":"border-red-300 bg-white text-red-700"}`,onClick:()=>G(void 0),children:le?.downloadFailed||W}),p.jsx(MO,{open:F&&te,theme:_e,loading:Ne,error:Se,snapshot:ue,onClose:Re,onEndpointSelect:ht,messages:le}),p.jsx(CO,{spec:t,theme:_e,messages:le,onEndpointSelect:ht,onHome:Pt,onOpenSettings:()=>z(!0),onOpenApiClient:()=>rn(),onOpenRuntime:te?()=>X(!0):void 0,onSendCurrent:Tt}),p.jsx(EO,{open:M,theme:_e,hostTheme:e,viewerTheme:Be.theme,viewerExpand:Ke,effectiveExpandedSections:lt,messages:le,onThemeChange:Mn,onExpandChange:pi,onClose:()=>z(!1)})]})},Hh="x-flexdoc-external-documents";function x3(t){if(typeof fetch!="function")throw new Error("No document loader is available in this environment");return fetch(t).then(async e=>{if(!e.ok)throw new Error(`Failed to load OpenAPI reference ${t}: ${e.status}`);const n=await e.text();return zi.parseSpec(n).catch(()=>{try{return JSON.parse(n)}catch{throw new Error(`Reference document is not valid JSON/YAML: ${t}`)}})})}function v3(t,e){if(t.startsWith("#"))return{documentUri:e,pointer:t};const n=new URL(t,e),r=n.hash||"#";return n.hash="",{documentUri:n.toString(),pointer:r}}function Yv(t,e){const n=zi.encodePointerToken(t);if(e==="#"||e==="")return`#/${Hh}/${n}`;if(!e.startsWith("#/"))throw new Error(`Unsupported JSON Pointer reference: ${e}`);return`#/${Hh}/${n}/${e.slice(2)}`}function Gv(t){return JSON.parse(JSON.stringify(t))}async function w3(t,e){const n=e.load||x3,r=new URL(e.baseUri).toString().replace(/#.*$/,""),s=Gv(t),a={},c=new Map;async function d(g){if(g===r)return s;if(a[g])return a[g];if(c.has(g))return c.get(g);const b=Promise.resolve(n(g)).then(S=>Gv(S));c.set(g,b);const v=await b;return a[g]=v,v}const f=new Set;async function h(g,b){if(f.has(b))return;f.add(b);async function v(S){if(!(!S||typeof S!="object")){if(Array.isArray(S)){for(const A of S)await v(A);return}if(typeof S.$ref=="string"){const A=v3(S.$ref,b);if(A.documentUri!==b){const C=await d(A.documentUri);S.$ref=A.documentUri===r?A.pointer:Yv(A.documentUri,A.pointer),await h(C,A.documentUri)}else b!==r&&(S.$ref=Yv(b,A.pointer))}for(const[A,C]of Object.entries(S))A!=="$ref"&&await v(C)}}await v(g)}return await h(s,r),Object.keys(a).length&&(s[Hh]=a),s}async function S3(t,e){return w3(t,e)}const Fc="1",Qr=new WeakMap;function A3(t){return JSON.parse(JSON.stringify(t))}function Ih(t,e={}){const n=A3(t);if(e.title&&(n.info.title=e.title),e.description&&(n.info.description=e.description),e.altDescription&&!n.info.description&&(n.info.description=e.altDescription),e.version&&(n.info.version=e.version),!e.tagGroups?.length)return n;const r=new Map;for(const c of e.tagGroups)for(const d of c.tags)r.set(d,c.name);const s={},a=new Set(["get","post","put","delete","patch","options","head","trace"]);for(const[c,d]of Object.entries(n.paths)){const f={};let h=!1;for(const[g,b]of Object.entries(d)){if(!a.has(g)){f[g]=b;continue}const v=b,S=(v?.tags||[]).filter(A=>r.has(A)).map(A=>r.get(A));!S.length||!v||(f[g]={...v,tags:Array.from(new Set(S))},h=!0)}h&&(s[c]=f)}return n.paths=s,n.tags=e.tagGroups.map(c=>({name:c.name})),n}function k3(t){return typeof t.theme=="string"?t.theme:typeof document<"u"&&document.documentElement.classList.contains("dark")?"dark":"light"}function Xv(t,e,n){const r=Ih(e,n),s=Qr.get(t);s&&s.unmount();const a=ag.createRoot(t);return Qr.set(t,a),a.render(p.jsx(b3,{spec:r,theme:k3(n),options:n})),()=>{Qr.get(t)===a&&Qr.delete(t),a.unmount()}}function Jv(t,e){const n={contractVersion:Fc,...e.options||{}};return Xv(t,e.spec,n)}function Qv(t,e={}){const n=Qr.get(t);n&&n.unmount();const r=ag.createRoot(t);return Qr.set(t,r),r.render(p.jsx(Fv,{...e})),()=>{Qr.get(t)===r&&Qr.delete(t),r.unmount()}}async function Wv(t,e){const n={contractVersion:Fc,...e.options||{}},r=e.baseUri?await S3(e.spec,{baseUri:e.baseUri,load:e.documentLoader}):e.spec;return Xv(t,r,n)}return typeof window<"u"&&(window.FlexDocStandalone={mount:Jv,mountAsync:Wv,mountApiClient:Qv,prepareSpec:Ih,contractVersion:Fc}),As.FLEXDOC_CONTRACT_VERSION=Fc,As.mountApiClient=Qv,As.mountFlexDoc=Jv,As.mountFlexDocAsync=Wv,As.prepareSpec=Ih,Object.defineProperty(As,Symbol.toStringTag,{value:"Module"}),As})({});
|
|
76
85
|
//# sourceMappingURL=flexdoc.standalone.js.map
|