@prauga/flexdoc-backend 2.9.9 → 3.1.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/auth.js.map +1 -1
- package/dist/contract-validation.d.ts +43 -0
- package/dist/contract-validation.js +120 -0
- package/dist/contract-validation.js.map +1 -0
- package/dist/contract-validation.test.d.ts +1 -0
- package/dist/contract-validation.test.js +112 -0
- package/dist/contract-validation.test.js.map +1 -0
- 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.d.ts +9 -6
- package/dist/host-execution-route.js.map +1 -1
- package/dist/host-execution.d.ts +38 -42
- package/dist/host-execution.js +1 -1
- package/dist/host-execution.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +105 -105
- package/dist/page-cache.js.map +1 -1
- package/dist/renderer/flexdoc.standalone.css +1 -1
- package/dist/renderer/flexdoc.standalone.js +82 -72
- package/dist/renderer-assets.js.map +1 -1
- 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 +66 -0
- package/dist/runtime-intelligence.js +270 -0
- package/dist/runtime-intelligence.js.map +1 -0
- package/dist/runtime-intelligence.test.d.ts +1 -0
- package/dist/runtime-intelligence.test.js +143 -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,86 @@
|
|
|
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(Cs){"use strict";var Jm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var id={exports:{}},sa={};var Wm;function F2(){if(Wm)return sa;Wm=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 u in s)u!=="key"&&(a[u]=s[u])}else a=s;return s=a.ref,{$$typeof:t,type:r,key:c,ref:s!==void 0?s:null,props:a}}return sa.Fragment=e,sa.jsx=n,sa.jsxs=n,sa}var Zm;function V2(){return Zm||(Zm=1,id.exports=F2()),id.exports}var p=V2(),rd={exports:{}},la={},sd={exports:{}},ld={};var eg;function P2(){return eg||(eg=1,(function(t){function e(_,ee){var de=_.length;_.push(ee);e:for(;0<de;){var $=de-1>>>1,ne=_[$];if(0<s(ne,ee))_[$]=ee,_[de]=ne,de=$;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var ee=_[0],de=_.pop();if(de!==ee){_[0]=de;e:for(var $=0,ne=_.length,L=ne>>>1;$<L;){var V=2*($+1)-1,ue=_[V],ve=V+1,Ne=_[ve];if(0>s(ue,de))ve<ne&&0>s(Ne,ue)?(_[$]=Ne,_[ve]=de,$=ve):(_[$]=ue,_[V]=de,$=V);else if(ve<ne&&0>s(Ne,de))_[$]=Ne,_[ve]=de,$=ve;else break e}}return ee}function s(_,ee){var de=_.sortIndex-ee.sortIndex;return de!==0?de:_.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,u=c.now();t.unstable_now=function(){return c.now()-u}}var f=[],h=[],g=1,b=null,v=3,S=!1,A=!1,C=!1,T=!1,R=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 D(_){if(C=!1,O(_),!A)if(n(f)!==null)A=!0,B||(B=!0,G());else{var ee=n(h);ee!==null&&xe(D,ee.startTime-_)}}var B=!1,M=-1,z=5,P=-1;function J(){return T?!0:!(t.unstable_now()-P<z)}function W(){if(T=!1,B){var _=t.unstable_now();P=_;var ee=!0;try{e:{A=!1,C&&(C=!1,j(M),M=-1),S=!0;var de=v;try{t:{for(O(_),b=n(f);b!==null&&!(b.expirationTime>_&&J());){var $=b.callback;if(typeof $=="function"){b.callback=null,v=b.priorityLevel;var ne=$(b.expirationTime<=_);if(_=t.unstable_now(),typeof ne=="function"){b.callback=ne,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(D,L.startTime-_),ee=!1}}break e}finally{b=null,v=de,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 Se=new MessageChannel,ye=Se.port2;Se.port1.onmessage=W,G=function(){ye.postMessage(null)}}else G=function(){R(W,0)};function xe(_,ee){M=R(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 de=v;v=ee;try{return _()}finally{v=de}},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 de=v;v=_;try{return ee()}finally{v=de}},t.unstable_scheduleCallback=function(_,ee,de){var $=t.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?$+de:$):de=$,_){case 1:var ne=-1;break;case 2:ne=250;break;case 5:ne=1073741823;break;case 4:ne=1e4;break;default:ne=5e3}return ne=de+ne,_={id:g++,callback:ee,priorityLevel:_,startTime:de,expirationTime:ne,sortIndex:-1},de>$?(_.sortIndex=de,e(h,_),n(f)===null&&_===n(h)&&(C?(j(M),M=-1):C=!0,xe(D,de-$))):(_.sortIndex=ne,e(f,_),A||S||(A=!0,B||(B=!0,G()))),_},t.unstable_shouldYield=J,t.unstable_wrapCallback=function(_){var ee=v;return function(){var de=v;v=ee;try{return _.apply(this,arguments)}finally{v=de}}}})(ld)),ld}var tg;function K2(){return tg||(tg=1,sd.exports=P2()),sd.exports}var ad={exports:{}},Ze={};var ng;function Y2(){if(ng)return Ze;ng=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"),u=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 R(L,V,ue){this.props=L,this.context=V,this.refs=T,this.updater=ue||A}R.prototype.isReactComponent={},R.prototype.setState=function(L,V){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,V,"setState")},R.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function j(){}j.prototype=R.prototype;function E(L,V,ue){this.props=L,this.context=V,this.refs=T,this.updater=ue||A}var O=E.prototype=new j;O.constructor=E,C(O,R.prototype),O.isPureReactComponent=!0;var D=Array.isArray;function B(){}var M={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function P(L,V,ue){var ve=ue.ref;return{$$typeof:t,type:L,key:V,ref:ve!==void 0?ve:null,props:ue}}function J(L,V){return P(L.type,V,L.props)}function W(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function G(L){var V={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(ue){return V[ue]})}var Se=/\/+/g;function ye(L,V){return typeof L=="object"&&L!==null&&L.key!=null?G(""+L.key):V.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(V){L.status==="pending"&&(L.status="fulfilled",L.value=V)},function(V){L.status==="pending"&&(L.status="rejected",L.reason=V)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function _(L,V,ue,ve,Ne){var Re=typeof L;(Re==="undefined"||Re==="boolean")&&(L=null);var qe=!1;if(L===null)qe=!0;else switch(Re){case"bigint":case"string":case"number":qe=!0;break;case"object":switch(L.$$typeof){case t:case e:qe=!0;break;case g:return qe=L._init,_(qe(L._payload),V,ue,ve,Ne)}}if(qe)return Ne=Ne(L),qe=ve===""?"."+ye(L,0):ve,D(Ne)?(ue="",qe!=null&&(ue=qe.replace(Se,"$&/")+"/"),_(Ne,V,ue,"",function(Le){return Le})):Ne!=null&&(W(Ne)&&(Ne=J(Ne,ue+(Ne.key==null||L&&L.key===Ne.key?"":(""+Ne.key).replace(Se,"$&/")+"/")+qe)),V.push(Ne)),1;qe=0;var Je=ve===""?".":ve+":";if(D(L))for(var Fe=0;Fe<L.length;Fe++)ve=L[Fe],Re=Je+ye(ve,Fe),qe+=_(ve,V,ue,Re,Ne);else if(Fe=S(L),typeof Fe=="function")for(L=Fe.call(L),Fe=0;!(ve=L.next()).done;)ve=ve.value,Re=Je+ye(ve,Fe++),qe+=_(ve,V,ue,Re,Ne);else if(Re==="object"){if(typeof L.then=="function")return _(xe(L),V,ue,ve,Ne);throw V=String(L),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return qe}function ee(L,V,ue){if(L==null)return L;var ve=[],Ne=0;return _(L,ve,"","",function(Re){return V.call(ue,Re,Ne++)}),ve}function de(L){if(L._status===-1){var V=L._result;V=V(),V.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=V)}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 V=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(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},ne={map:ee,forEach:function(L,V,ue){ee(L,function(){V.apply(this,arguments)},ue)},count:function(L){var V=0;return ee(L,function(){V++}),V},toArray:function(L){return ee(L,function(V){return V})||[]},only:function(L){if(!W(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Ze.Activity=b,Ze.Children=ne,Ze.Component=R,Ze.Fragment=n,Ze.Profiler=s,Ze.PureComponent=E,Ze.StrictMode=r,Ze.Suspense=f,Ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ze.__COMPILER_RUNTIME={__proto__:null,c:function(L){return M.H.useMemoCache(L)}},Ze.cache=function(L){return function(){return L.apply(null,arguments)}},Ze.cacheSignal=function(){return null},Ze.cloneElement=function(L,V,ue){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var ve=C({},L.props),Ne=L.key;if(V!=null)for(Re in V.key!==void 0&&(Ne=""+V.key),V)!z.call(V,Re)||Re==="key"||Re==="__self"||Re==="__source"||Re==="ref"&&V.ref===void 0||(ve[Re]=V[Re]);var Re=arguments.length-2;if(Re===1)ve.children=ue;else if(1<Re){for(var qe=Array(Re),Je=0;Je<Re;Je++)qe[Je]=arguments[Je+2];ve.children=qe}return P(L.type,Ne,ve)},Ze.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},Ze.createElement=function(L,V,ue){var ve,Ne={},Re=null;if(V!=null)for(ve in V.key!==void 0&&(Re=""+V.key),V)z.call(V,ve)&&ve!=="key"&&ve!=="__self"&&ve!=="__source"&&(Ne[ve]=V[ve]);var qe=arguments.length-2;if(qe===1)Ne.children=ue;else if(1<qe){for(var Je=Array(qe),Fe=0;Fe<qe;Fe++)Je[Fe]=arguments[Fe+2];Ne.children=Je}if(L&&L.defaultProps)for(ve in qe=L.defaultProps,qe)Ne[ve]===void 0&&(Ne[ve]=qe[ve]);return P(L,Re,Ne)},Ze.createRef=function(){return{current:null}},Ze.forwardRef=function(L){return{$$typeof:u,render:L}},Ze.isValidElement=W,Ze.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:de}},Ze.memo=function(L,V){return{$$typeof:h,type:L,compare:V===void 0?null:V}},Ze.startTransition=function(L){var V=M.T,ue={};M.T=ue;try{var ve=L(),Ne=M.S;Ne!==null&&Ne(ue,ve),typeof ve=="object"&&ve!==null&&typeof ve.then=="function"&&ve.then(B,$)}catch(Re){$(Re)}finally{V!==null&&ue.types!==null&&(V.types=ue.types),M.T=V}},Ze.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ze.use=function(L){return M.H.use(L)},Ze.useActionState=function(L,V,ue){return M.H.useActionState(L,V,ue)},Ze.useCallback=function(L,V){return M.H.useCallback(L,V)},Ze.useContext=function(L){return M.H.useContext(L)},Ze.useDebugValue=function(){},Ze.useDeferredValue=function(L,V){return M.H.useDeferredValue(L,V)},Ze.useEffect=function(L,V){return M.H.useEffect(L,V)},Ze.useEffectEvent=function(L){return M.H.useEffectEvent(L)},Ze.useId=function(){return M.H.useId()},Ze.useImperativeHandle=function(L,V,ue){return M.H.useImperativeHandle(L,V,ue)},Ze.useInsertionEffect=function(L,V){return M.H.useInsertionEffect(L,V)},Ze.useLayoutEffect=function(L,V){return M.H.useLayoutEffect(L,V)},Ze.useMemo=function(L,V){return M.H.useMemo(L,V)},Ze.useOptimistic=function(L,V){return M.H.useOptimistic(L,V)},Ze.useReducer=function(L,V,ue){return M.H.useReducer(L,V,ue)},Ze.useRef=function(L){return M.H.useRef(L)},Ze.useState=function(L){return M.H.useState(L)},Ze.useSyncExternalStore=function(L,V,ue){return M.H.useSyncExternalStore(L,V,ue)},Ze.useTransition=function(){return M.H.useTransition()},Ze.version="19.2.8",Ze}var ig;function od(){return ig||(ig=1,ad.exports=Y2()),ad.exports}var cd={exports:{}},wn={};var rg;function G2(){if(rg)return wn;rg=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 u(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return wn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,wn.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)},wn.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()}},wn.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))},wn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},wn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var g=h.as,b=u(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})}},wn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=u(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)},wn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,b=u(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})}},wn.preloadModule=function(f,h){if(typeof f=="string")if(h){var g=u(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)},wn.requestFormReset=function(f){r.d.r(f)},wn.unstable_batchedUpdates=function(f,h){return f(h)},wn.useFormState=function(f,h,g){return c.H.useFormState(f,h,g)},wn.useFormStatus=function(){return c.H.useHostTransitionStatus()},wn.version="19.2.8",wn}var sg;function X2(){if(sg)return cd.exports;sg=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=G2(),cd.exports}var lg;function J2(){if(lg)return la;lg=1;var t=K2(),e=od(),n=X2();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 u(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,d=l;;){var m=o.return;if(m===null)break;var y=m.alternate;if(y===null){if(d=m.return,d!==null){o=d;continue}break}if(m.child===y.child){for(y=m.child;y;){if(y===o)return f(m),i;if(y===d)return f(m),l;y=y.sibling}throw Error(r(188))}if(o.return!==d.return)o=m,d=y;else{for(var w=!1,N=m.child;N;){if(N===o){w=!0,o=m,d=y;break}if(N===d){w=!0,d=m,o=y;break}N=N.sibling}if(!w){for(N=y.child;N;){if(N===o){w=!0,o=y,d=m;break}if(N===d){w=!0,d=y,o=m;break}N=N.sibling}if(!w)throw Error(r(189))}}if(o.alternate!==d)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"),R=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),E=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),J=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 Se=Symbol.for("react.client.reference");function ye(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Se?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case R:return"Profiler";case T:return"StrictMode";case D:return"Suspense";case B:return"SuspenseList";case P: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,de={pending:!1,data:null,method:null,action:null},$=[],ne=-1;function L(i){return{current:i}}function V(i){0>ne||(i.current=$[ne],$[ne]=null,ne--)}function ue(i,l){ne++,$[ne]=i.current,i.current=l}var ve=L(null),Ne=L(null),Re=L(null),qe=L(null);function Je(i,l){switch(ue(Re,l),ue(Ne,i),ue(ve,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?u2(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=u2(l),i=d2(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}V(ve),ue(ve,i)}function Fe(){V(ve),V(Ne),V(Re)}function Le(i){i.memoizedState!==null&&ue(qe,i);var l=ve.current,o=d2(l,i.type);l!==o&&(ue(Ne,i),ue(ve,o))}function dt(i){Ne.current===i&&(V(ve),V(Ne)),qe.current===i&&(V(qe),No._currentValue=de)}var ae,le;function ge(i){if(ae===void 0)try{throw Error()}catch(o){var l=o.stack.trim().match(/\n( *(at )?)/);ae=l&&l[1]||"",le=-1<o.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ae+i+le}var Te=!1;function Ie(i,l){if(!i||Te)return"";Te=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(l){var we=function(){throw Error()};if(Object.defineProperty(we.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(we,[])}catch(ce){var re=ce}Reflect.construct(i,[],we)}else{try{we.call()}catch(ce){re=ce}i.call(we.prototype)}}else{try{throw Error()}catch(ce){re=ce}(we=i())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(ce){if(ce&&re&&typeof ce.stack=="string")return[ce.stack,re.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=d.DetermineComponentFrameRoot(),w=y[0],N=y[1];if(w&&N){var q=w.split(`
|
|
4
|
+
`),ie=N.split(`
|
|
5
|
+
`);for(m=d=0;d<q.length&&!q[d].includes("DetermineComponentFrameRoot");)d++;for(;m<ie.length&&!ie[m].includes("DetermineComponentFrameRoot");)m++;if(d===q.length||m===ie.length)for(d=q.length-1,m=ie.length-1;1<=d&&0<=m&&q[d]!==ie[m];)m--;for(;1<=d&&0<=m;d--,m--)if(q[d]!==ie[m]){if(d!==1||m!==1)do if(d--,m--,0>m||q[d]!==ie[m]){var pe=`
|
|
6
|
+
`+q[d].replace(" at new "," at ");return i.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",i.displayName)),pe}while(1<=d&&0<=m);break}}}finally{Te=!1,Error.prepareStackTrace=o}return(o=i?i.displayName||i.name:"")?ge(o):""}function Qe(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 gt(i){try{var l="",o=null;do l+=Qe(i,o),o=i,i=i.return;while(i);return l}catch(d){return`
|
|
7
|
+
Error generating stack: `+d.message+`
|
|
8
|
+
`+d.stack}}var Bt=Object.prototype.hasOwnProperty,sn=t.unstable_scheduleCallback,ln=t.unstable_cancelCallback,Hn=t.unstable_shouldYield,gn=t.unstable_requestPaint,ot=t.unstable_now,Wn=t.unstable_getCurrentPriorityLevel,Rn=t.unstable_ImmediatePriority,Zn=t.unstable_UserBlockingPriority,Tt=t.unstable_NormalPriority,x=t.unstable_LowPriority,K=t.unstable_IdlePriority,me=t.log,fe=t.unstable_setDisableYieldValue,Q=null,k=null;function X(i){if(typeof me=="function"&&fe(i),k&&typeof k.setStrictMode=="function")try{k.setStrictMode(Q,i)}catch{}}var Z=Math.clz32?Math.clz32:he,Ae=Math.log,H=Math.LN2;function he(i){return i>>>=0,i===0?32:31-(Ae(i)/H|0)|0}var oe=256,ke=262144,Ee=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 Be(i,l,o){var d=i.pendingLanes;if(d===0)return 0;var m=0,y=i.suspendedLanes,w=i.pingedLanes;i=i.warmLanes;var N=d&134217727;return N!==0?(d=N&~y,d!==0?m=De(d):(w&=N,w!==0?m=De(w):o||(o=N&~i,o!==0&&(m=De(o))))):(N=d&~y,N!==0?m=De(N):w!==0?m=De(w):o||(o=d&~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 Ye(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 Dn(){var i=Ee;return Ee<<=1,(Ee&62914560)===0&&(Ee=4194304),i}function _n(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 Li(i,l,o,d,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 pe=31-Z(o),we=1<<pe;N[pe]=0,q[pe]=-1;var re=ie[pe];if(re!==null)for(ie[pe]=null,pe=0;pe<re.length;pe++){var ce=re[pe];ce!==null&&(ce.lane&=-536870913)}o&=~we}d!==0&&dr(i,d,0),y!==0&&m===0&&i.tag!==0&&(i.suspendedLanes|=y&~(w&~l))}function dr(i,l,o){i.pendingLanes|=l,i.suspendedLanes&=~l;var d=31-Z(l);i.entangledLanes|=l,i.entanglements[d]=i.entanglements[d]|1073741824|o&261930}function Me(i,l){var o=i.entangledLanes|=l;for(i=i.entanglements;o;){var d=31-Z(o),m=1<<d;m&l|i[d]&l&&(i[d]|=l),o&=~m}}function We(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 yi(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Bi(){var i=ee.p;return i!==0?i:(i=window.event,i===void 0?32:_2(i.type))}function es(i,l){var o=ee.p;try{return ee.p=i,l()}finally{ee.p=o}}var ei=Math.random().toString(36).slice(2),_t="__reactFiber$"+ei,Ut="__reactProps$"+ei,bi="__reactContainer$"+ei,fr="__reactEvents$"+ei,xi="__reactListeners$"+ei,Vc="__reactHandles$"+ei,Ia="__reactResources$"+ei,Wi="__reactMarker$"+ei;function kl(i){delete i[_t],delete i[Ut],delete i[fr],delete i[xi],delete i[Vc]}function In(i){var l=i[_t];if(l)return l;for(var o=i.parentNode;o;){if(l=o[bi]||o[_t]){if(o=l.alternate,l.child!==null||o!==null&&o.child!==null)for(i=b2(i);i!==null;){if(o=i[_t])return o;i=b2(i)}return l}i=o,o=i.parentNode}return null}function hr(i){if(i=i[_t]||i[bi]){var l=i.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return i}return null}function qs(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i.stateNode;throw Error(r(33))}function ts(i){var l=i[Ia];return l||(l=i[Ia]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Ft(i){i[Wi]=!0}var I=new Set,se={};function Xe(i,l){Un(i,l),Un(i+"Capture",l)}function Un(i,l){for(se[i]=l,i=0;i<l.length;i++)I.add(l[i])}var zs=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]*$"),Cl={},t1={};function D3(i){return Bt.call(t1,i)?!0:Bt.call(Cl,i)?!1:zs.test(i)?t1[i]=!0:(Cl[i]=!0,!1)}function Pc(i,l,o){if(D3(l))if(o===null)i.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":i.removeAttribute(l);return;case"boolean":var d=l.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="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 pr(i,l,o,d){if(d===null)i.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttributeNS(l,o,""+d)}}function vi(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function n1(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function _3(i,l,o){var d=Object.getOwnPropertyDescriptor(i.constructor.prototype,l);if(!i.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var m=d.get,y=d.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:d.enumerable}),{getValue:function(){return o},setValue:function(w){o=""+w},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function Fh(i){if(!i._valueTracker){var l=n1(i)?"checked":"value";i._valueTracker=_3(i,l,""+i[l])}}function i1(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var o=l.getValue(),d="";return i&&(d=n1(i)?i.checked?"true":"false":i.value),i=d,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 L3=/[\n"\\]/g;function wi(i){return i.replace(L3,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Vh(i,l,o,d,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=""+vi(l)):i.value!==""+vi(l)&&(i.value=""+vi(l)):w!=="submit"&&w!=="reset"||i.removeAttribute("value"),l!=null?Ph(i,w,vi(l)):o!=null?Ph(i,w,vi(o)):d!=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=""+vi(N):i.removeAttribute("name")}function r1(i,l,o,d,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)){Fh(i);return}o=o!=null?""+vi(o):"",l=l!=null?""+vi(l):o,N||l===i.value||(i.value=l),i.defaultValue=l}d=d??m,d=typeof d!="function"&&typeof d!="symbol"&&!!d,i.checked=N?i.checked:!!d,i.defaultChecked=!!d,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(i.name=w),Fh(i)}function Ph(i,l,o){l==="number"&&Yc(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function Nl(i,l,o,d){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&&d&&(i[o].defaultSelected=!0)}else{for(o=""+vi(o),l=null,m=0;m<i.length;m++){if(i[m].value===o){i[m].selected=!0,d&&(i[m].defaultSelected=!0);return}l!==null||i[m].disabled||(l=i[m])}l!==null&&(l.selected=!0)}}function s1(i,l,o){if(l!=null&&(l=""+vi(l),l!==i.value&&(i.value=l),o==null)){i.defaultValue!==l&&(i.defaultValue=l);return}i.defaultValue=o!=null?""+vi(o):""}function l1(i,l,o,d){if(l==null){if(d!=null){if(o!=null)throw Error(r(92));if(xe(d)){if(1<d.length)throw Error(r(93));d=d[0]}o=d}o==null&&(o=""),l=o}o=vi(l),i.defaultValue=o,d=i.textContent,d===o&&d!==""&&d!==null&&(i.value=d),Fh(i)}function Tl(i,l){if(l){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=l;return}}i.textContent=l}var B3=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 a1(i,l,o){var d=l.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?d?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="":d?i.setProperty(l,o):typeof o!="number"||o===0||B3.has(l)?l==="float"?i.cssFloat=o:i[l]=(""+o).trim():i[l]=o+"px"}function o1(i,l,o){if(l!=null&&typeof l!="object")throw Error(r(62));if(i=i.style,o!=null){for(var d in o)!o.hasOwnProperty(d)||l!=null&&l.hasOwnProperty(d)||(d.indexOf("--")===0?i.setProperty(d,""):d==="float"?i.cssFloat="":i[d]="");for(var m in l)d=l[m],l.hasOwnProperty(m)&&o[m]!==d&&a1(i,m,d)}else for(var y in l)l.hasOwnProperty(y)&&a1(i,y,l[y])}function Kh(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 $3=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"]]),q3=/^[\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 q3.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function mr(){}var Yh=null;function Gh(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var jl=null,El=null;function c1(i){var l=hr(i);if(l&&(i=l.stateNode)){var o=i[Ut]||null;e:switch(i=l.stateNode,l.type){case"input":if(Vh(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="'+wi(""+l)+'"][type="radio"]'),l=0;l<o.length;l++){var d=o[l];if(d!==i&&d.form===i.form){var m=d[Ut]||null;if(!m)throw Error(r(90));Vh(d,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(l=0;l<o.length;l++)d=o[l],d.form===i.form&&i1(d)}break e;case"textarea":s1(i,o.value,o.defaultValue);break e;case"select":l=o.value,l!=null&&Nl(i,!!o.multiple,l,!1)}}}var Xh=!1;function u1(i,l,o){if(Xh)return i(l,o);Xh=!0;try{var d=i(l);return d}finally{if(Xh=!1,(jl!==null||El!==null)&&(Lu(),jl&&(l=jl,i=El,El=jl=null,c1(l),i)))for(l=0;l<i.length;l++)c1(i[l])}}function Ua(i,l){var o=i.stateNode;if(o===null)return null;var d=o[Ut]||null;if(d===null)return null;o=d[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":(d=!d.disabled)||(i=i.type,d=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!d;break e;default:i=!1}if(i)return null;if(o&&typeof o!="function")throw Error(r(231,l,typeof o));return o}var gr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jh=!1;if(gr)try{var Fa={};Object.defineProperty(Fa,"passive",{get:function(){Jh=!0}}),window.addEventListener("test",Fa,Fa),window.removeEventListener("test",Fa,Fa)}catch{Jh=!1}var ns=null,Qh=null,Xc=null;function d1(){if(Xc)return Xc;var i,l=Qh,o=l.length,d,m="value"in ns?ns.value:ns.textContent,y=m.length;for(i=0;i<o&&l[i]===m[i];i++);var w=o-i;for(d=1;d<=w&&l[o-d]===m[y-d];d++);return Xc=m.slice(i,1<d?1-d: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 f1(){return!1}function Fn(i){function l(o,d,m,y,w){this._reactName=o,this._targetInst=m,this.type=d,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:f1,this.isPropagationStopped=f1,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 Hs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wc=Fn(Hs),Va=b({},Hs,{view:0,detail:0}),z3=Fn(Va),Wh,Zh,Pa,Zc=b({},Va,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tp,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!==Pa&&(Pa&&i.type==="mousemove"?(Wh=i.screenX-Pa.screenX,Zh=i.screenY-Pa.screenY):Zh=Wh=0,Pa=i),Wh)},movementY:function(i){return"movementY"in i?i.movementY:Zh}}),h1=Fn(Zc),H3=b({},Zc,{dataTransfer:0}),I3=Fn(H3),U3=b({},Va,{relatedTarget:0}),ep=Fn(U3),F3=b({},Hs,{animationName:0,elapsedTime:0,pseudoElement:0}),V3=Fn(F3),P3=b({},Hs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),K3=Fn(P3),Y3=b({},Hs,{data:0}),p1=Fn(Y3),G3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},X3={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"},J3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Q3(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=J3[i])?!!l[i]:!1}function tp(){return Q3}var W3=b({},Va,{key:function(i){if(i.key){var l=G3[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"?X3[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tp,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}}),Z3=Fn(W3),eM=b({},Zc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),m1=Fn(eM),tM=b({},Va,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tp}),nM=Fn(tM),iM=b({},Hs,{propertyName:0,elapsedTime:0,pseudoElement:0}),rM=Fn(iM),sM=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}),lM=Fn(sM),aM=b({},Hs,{newState:0,oldState:0}),oM=Fn(aM),cM=[9,13,27,32],np=gr&&"CompositionEvent"in window,Ka=null;gr&&"documentMode"in document&&(Ka=document.documentMode);var uM=gr&&"TextEvent"in window&&!Ka,g1=gr&&(!np||Ka&&8<Ka&&11>=Ka),y1=" ",b1=!1;function x1(i,l){switch(i){case"keyup":return cM.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function v1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ol=!1;function dM(i,l){switch(i){case"compositionend":return v1(l);case"keypress":return l.which!==32?null:(b1=!0,y1);case"textInput":return i=l.data,i===y1&&b1?null:i;default:return null}}function fM(i,l){if(Ol)return i==="compositionend"||!np&&x1(i,l)?(i=d1(),Xc=Qh=ns=null,Ol=!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 g1&&l.locale!=="ko"?null:l.data;default:return null}}var hM={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 w1(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!hM[i.type]:l==="textarea"}function S1(i,l,o,d){jl?El?El.push(d):El=[d]:jl=d,l=Uu(l,"onChange"),0<l.length&&(o=new Wc("onChange","change",null,o,d),i.push({event:o,listeners:l}))}var Ya=null,Ga=null;function pM(i){r2(i,0)}function eu(i){var l=qs(i);if(i1(l))return i}function A1(i,l){if(i==="change")return l}var k1=!1;if(gr){var ip;if(gr){var rp="oninput"in document;if(!rp){var C1=document.createElement("div");C1.setAttribute("oninput","return;"),rp=typeof C1.oninput=="function"}ip=rp}else ip=!1;k1=ip&&(!document.documentMode||9<document.documentMode)}function N1(){Ya&&(Ya.detachEvent("onpropertychange",T1),Ga=Ya=null)}function T1(i){if(i.propertyName==="value"&&eu(Ga)){var l=[];S1(l,Ga,i,Gh(i)),u1(pM,l)}}function mM(i,l,o){i==="focusin"?(N1(),Ya=l,Ga=o,Ya.attachEvent("onpropertychange",T1)):i==="focusout"&&N1()}function gM(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return eu(Ga)}function yM(i,l){if(i==="click")return eu(l)}function bM(i,l){if(i==="input"||i==="change")return eu(l)}function xM(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var ti=typeof Object.is=="function"?Object.is:xM;function Xa(i,l){if(ti(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var o=Object.keys(i),d=Object.keys(l);if(o.length!==d.length)return!1;for(d=0;d<o.length;d++){var m=o[d];if(!Bt.call(l,m)||!ti(i[m],l[m]))return!1}return!0}function j1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function E1(i,l){var o=j1(i);i=0;for(var d;o;){if(o.nodeType===3){if(d=i+o.textContent.length,i<=l&&d>=l)return{node:o,offset:l-i};i=d}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=j1(o)}}function O1(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?O1(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function M1(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 sp(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 vM=gr&&"documentMode"in document&&11>=document.documentMode,Ml=null,lp=null,Ja=null,ap=!1;function R1(i,l,o){var d=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;ap||Ml==null||Ml!==Yc(d)||(d=Ml,"selectionStart"in d&&sp(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Ja&&Xa(Ja,d)||(Ja=d,d=Uu(lp,"onSelect"),0<d.length&&(l=new Wc("onSelect","select",null,l,o),i.push({event:l,listeners:d}),l.target=Ml)))}function Is(i,l){var o={};return o[i.toLowerCase()]=l.toLowerCase(),o["Webkit"+i]="webkit"+l,o["Moz"+i]="moz"+l,o}var Rl={animationend:Is("Animation","AnimationEnd"),animationiteration:Is("Animation","AnimationIteration"),animationstart:Is("Animation","AnimationStart"),transitionrun:Is("Transition","TransitionRun"),transitionstart:Is("Transition","TransitionStart"),transitioncancel:Is("Transition","TransitionCancel"),transitionend:Is("Transition","TransitionEnd")},op={},D1={};gr&&(D1=document.createElement("div").style,"AnimationEvent"in window||(delete Rl.animationend.animation,delete Rl.animationiteration.animation,delete Rl.animationstart.animation),"TransitionEvent"in window||delete Rl.transitionend.transition);function Us(i){if(op[i])return op[i];if(!Rl[i])return i;var l=Rl[i],o;for(o in l)if(l.hasOwnProperty(o)&&o in D1)return op[i]=l[o];return i}var _1=Us("animationend"),L1=Us("animationiteration"),B1=Us("animationstart"),wM=Us("transitionrun"),SM=Us("transitionstart"),AM=Us("transitioncancel"),$1=Us("transitionend"),q1=new Map,cp="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(" ");cp.push("scrollEnd");function $i(i,l){q1.set(i,l),Xe(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)},Si=[],Dl=0,up=0;function nu(){for(var i=Dl,l=up=Dl=0;l<i;){var o=Si[l];Si[l++]=null;var d=Si[l];Si[l++]=null;var m=Si[l];Si[l++]=null;var y=Si[l];if(Si[l++]=null,d!==null&&m!==null){var w=d.pending;w===null?m.next=m:(m.next=w.next,w.next=m),d.pending=m}y!==0&&z1(o,m,y)}}function iu(i,l,o,d){Si[Dl++]=i,Si[Dl++]=l,Si[Dl++]=o,Si[Dl++]=d,up|=d,i.lanes|=d,i=i.alternate,i!==null&&(i.lanes|=d)}function dp(i,l,o,d){return iu(i,l,o,d),ru(i)}function Fs(i,l){return iu(i,null,null,l),ru(i)}function z1(i,l,o){i.lanes|=o;var d=i.alternate;d!==null&&(d.lanes|=o);for(var m=!1,y=i.return;y!==null;)y.childLanes|=o,d=y.alternate,d!==null&&(d.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,d=i[m],d===null?i[m]=[l]:d.push(l),l.lane=o|536870912),y):null}function ru(i){if(50<xo)throw xo=0,vm=null,Error(r(185));for(var l=i.return;l!==null;)i=l,l=i.return;return i.tag===3?i.stateNode:null}var _l={};function kM(i,l,o,d){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=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ni(i,l,o,d){return new kM(i,l,o,d)}function fp(i){return i=i.prototype,!(!i||!i.isReactComponent)}function yr(i,l){var o=i.alternate;return o===null?(o=ni(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 H1(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,d,m,y){var w=0;if(d=i,typeof i=="function")fp(i)&&(w=1);else if(typeof i=="string")w=ER(i,o,ve.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case P:return i=ni(31,o,l,m),i.elementType=P,i.lanes=y,i;case C:return Vs(o.children,m,y,l);case T:w=8,m|=24;break;case R:return i=ni(12,o,l,m|2),i.elementType=R,i.lanes=y,i;case D:return i=ni(13,o,l,m),i.elementType=D,i.lanes=y,i;case B:return i=ni(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,d=null;break e}w=29,o=Error(r(130,i===null?"null":typeof i,"")),d=null}return l=ni(w,o,l,m),l.elementType=i,l.type=d,l.lanes=y,l}function Vs(i,l,o,d){return i=ni(7,i,d,l),i.lanes=o,i}function hp(i,l,o){return i=ni(6,i,null,l),i.lanes=o,i}function I1(i){var l=ni(18,null,null,0);return l.stateNode=i,l}function pp(i,l,o){return l=ni(4,i.children!==null?i.children:[],i.key,l),l.lanes=o,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}var U1=new WeakMap;function Ai(i,l){if(typeof i=="object"&&i!==null){var o=U1.get(i);return o!==void 0?o:(l={value:i,source:l,stack:gt(l)},U1.set(i,l),l)}return{value:i,source:l,stack:gt(l)}}var Ll=[],Bl=0,lu=null,Qa=0,ki=[],Ci=0,is=null,Zi=1,er="";function br(i,l){Ll[Bl++]=Qa,Ll[Bl++]=lu,lu=i,Qa=l}function F1(i,l,o){ki[Ci++]=Zi,ki[Ci++]=er,ki[Ci++]=is,is=i;var d=Zi;i=er;var m=32-Z(d)-1;d&=~(1<<m),o+=1;var y=32-Z(l)+m;if(30<y){var w=m-m%5;y=(d&(1<<w)-1).toString(32),d>>=w,m-=w,Zi=1<<32-Z(l)+m|o<<m|d,er=y+i}else Zi=1<<y|o<<m|d,er=i}function mp(i){i.return!==null&&(br(i,1),F1(i,1,0))}function gp(i){for(;i===lu;)lu=Ll[--Bl],Ll[Bl]=null,Qa=Ll[--Bl],Ll[Bl]=null;for(;i===is;)is=ki[--Ci],ki[Ci]=null,er=ki[--Ci],ki[Ci]=null,Zi=ki[--Ci],ki[Ci]=null}function V1(i,l){ki[Ci++]=Zi,ki[Ci++]=er,ki[Ci++]=is,Zi=l.id,er=l.overflow,is=i}var yn=null,Ot=null,ft=!1,rs=null,Ni=!1,yp=Error(r(519));function ss(i){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wa(Ai(l,i)),yp}function P1(i){var l=i.stateNode,o=i.type,d=i.memoizedProps;switch(l[_t]=i,l[Ut]=d,o){case"dialog":at("cancel",l),at("close",l);break;case"iframe":case"object":case"embed":at("load",l);break;case"video":case"audio":for(o=0;o<wo.length;o++)at(wo[o],l);break;case"source":at("error",l);break;case"img":case"image":case"link":at("error",l),at("load",l);break;case"details":at("toggle",l);break;case"input":at("invalid",l),r1(l,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":at("invalid",l);break;case"textarea":at("invalid",l),l1(l,d.value,d.defaultValue,d.children)}o=d.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||l.textContent===""+o||d.suppressHydrationWarning===!0||o2(l.textContent,o)?(d.popover!=null&&(at("beforetoggle",l),at("toggle",l)),d.onScroll!=null&&at("scroll",l),d.onScrollEnd!=null&&at("scrollend",l),d.onClick!=null&&(l.onclick=mr),l=!0):l=!1,l||ss(i,!0)}function K1(i){for(yn=i.return;yn;)switch(yn.tag){case 5:case 31:case 13:Ni=!1;return;case 27:case 3:Ni=!0;return;default:yn=yn.return}}function $l(i){if(i!==yn)return!1;if(!ft)return K1(i),ft=!0,!1;var l=i.tag,o;if((o=l!==3&&l!==27)&&((o=l===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||Lm(i.type,i.memoizedProps)),o=!o),o&&Ot&&ss(i),K1(i),l===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ot=y2(i)}else if(l===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ot=y2(i)}else l===27?(l=Ot,xs(i.type)?(i=Hm,Hm=null,Ot=i):Ot=l):Ot=yn?ji(i.stateNode.nextSibling):null;return!0}function Ps(){Ot=yn=null,ft=!1}function bp(){var i=rs;return i!==null&&(Yn===null?Yn=i:Yn.push.apply(Yn,i),rs=null),i}function Wa(i){rs===null?rs=[i]:rs.push(i)}var xp=L(null),Ks=null,xr=null;function ls(i,l,o){ue(xp,l._currentValue),l._currentValue=o}function vr(i){i._currentValue=xp.current,V(xp)}function vp(i,l,o){for(;i!==null;){var d=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,d!==null&&(d.childLanes|=l)):d!==null&&(d.childLanes&l)!==l&&(d.childLanes|=l),i===o)break;i=i.return}}function wp(i,l,o,d){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),vp(y.return,o,i),d||(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),vp(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 ql(i,l,o,d){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;ti(m.pendingProps.value,w.value)||(i!==null?i.push(N):i=[N])}}else if(m===qe.current){if(w=m.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(i!==null?i.push(No):i=[No])}m=m.return}i!==null&&wp(l,i,o,d),l.flags|=262144}function au(i){for(i=i.firstContext;i!==null;){if(!ti(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ys(i){Ks=i,xr=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function bn(i){return Y1(Ks,i)}function ou(i,l){return Ks===null&&Ys(i),Y1(i,l)}function Y1(i,l){var o=l._currentValue;if(l={context:l,memoizedValue:o,next:null},xr===null){if(i===null)throw Error(r(308));xr=l,i.dependencies={lanes:0,firstContext:l},i.flags|=524288}else xr=xr.next=l;return o}var CM=typeof AbortController<"u"?AbortController:function(){var i=[],l=this.signal={aborted:!1,addEventListener:function(o,d){i.push(d)}};this.abort=function(){l.aborted=!0,i.forEach(function(o){return o()})}},NM=t.unstable_scheduleCallback,TM=t.unstable_NormalPriority,Gt={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sp(){return{controller:new CM,data:new Map,refCount:0}}function Za(i){i.refCount--,i.refCount===0&&NM(TM,function(){i.controller.abort()})}var eo=null,Ap=0,zl=0,Hl=null;function jM(i,l){if(eo===null){var o=eo=[];Ap=0,zl=Nm(),Hl={status:"pending",value:void 0,then:function(d){o.push(d)}}}return Ap++,l.then(G1,G1),l}function G1(){if(--Ap===0&&eo!==null){Hl!==null&&(Hl.status="fulfilled");var i=eo;eo=null,zl=0,Hl=null;for(var l=0;l<i.length;l++)(0,i[l])()}}function EM(i,l){var o=[],d={status:"pending",value:null,reason:null,then:function(m){o.push(m)}};return i.then(function(){d.status="fulfilled",d.value=l;for(var m=0;m<o.length;m++)(0,o[m])(l)},function(m){for(d.status="rejected",d.reason=m,m=0;m<o.length;m++)(0,o[m])(void 0)}),d}var X1=_.S;_.S=function(i,l){RS=ot(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&jM(i,l),X1!==null&&X1(i,l)};var Gs=L(null);function kp(){var i=Gs.current;return i!==null?i:jt.pooledCache}function cu(i,l){l===null?ue(Gs,Gs.current):ue(Gs,l.pool)}function J1(){var i=kp();return i===null?null:{parent:Gt._currentValue,pool:i}}var Il=Error(r(460)),Cp=Error(r(474)),uu=Error(r(542)),du={then:function(){}};function Q1(i){return i=i.status,i==="fulfilled"||i==="rejected"}function W1(i,l,o){switch(o=i[o],o===void 0?i.push(l):o!==l&&(l.then(mr,mr),l=o),l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,ew(i),i;default:if(typeof l.status=="string")l.then(mr,mr);else{if(i=jt,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=l,i.status="pending",i.then(function(d){if(l.status==="pending"){var m=l;m.status="fulfilled",m.value=d}},function(d){if(l.status==="pending"){var m=l;m.status="rejected",m.reason=d}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,ew(i),i}throw Js=l,Il}}function Xs(i){try{var l=i._init;return l(i._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Js=o,Il):o}}var Js=null;function Z1(){if(Js===null)throw Error(r(459));var i=Js;return Js=null,i}function ew(i){if(i===Il||i===uu)throw Error(r(483))}var Ul=null,to=0;function fu(i){var l=to;return to+=1,Ul===null&&(Ul=[]),W1(Ul,i,l)}function no(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 tw(i){function l(Y,F){if(i){var te=Y.deletions;te===null?(Y.deletions=[F],Y.flags|=16):te.push(F)}}function o(Y,F){if(!i)return null;for(;F!==null;)l(Y,F),F=F.sibling;return null}function d(Y){for(var F=new Map;Y!==null;)Y.key!==null?F.set(Y.key,Y):F.set(Y.index,Y),Y=Y.sibling;return F}function m(Y,F){return Y=yr(Y,F),Y.index=0,Y.sibling=null,Y}function y(Y,F,te){return Y.index=te,i?(te=Y.alternate,te!==null?(te=te.index,te<F?(Y.flags|=67108866,F):te):(Y.flags|=67108866,F)):(Y.flags|=1048576,F)}function w(Y){return i&&Y.alternate===null&&(Y.flags|=67108866),Y}function N(Y,F,te,be){return F===null||F.tag!==6?(F=hp(te,Y.mode,be),F.return=Y,F):(F=m(F,te),F.return=Y,F)}function q(Y,F,te,be){var Ue=te.type;return Ue===C?pe(Y,F,te.props.children,be,te.key):F!==null&&(F.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===z&&Xs(Ue)===F.type)?(F=m(F,te.props),no(F,te),F.return=Y,F):(F=su(te.type,te.key,te.props,null,Y.mode,be),no(F,te),F.return=Y,F)}function ie(Y,F,te,be){return F===null||F.tag!==4||F.stateNode.containerInfo!==te.containerInfo||F.stateNode.implementation!==te.implementation?(F=pp(te,Y.mode,be),F.return=Y,F):(F=m(F,te.children||[]),F.return=Y,F)}function pe(Y,F,te,be,Ue){return F===null||F.tag!==7?(F=Vs(te,Y.mode,be,Ue),F.return=Y,F):(F=m(F,te),F.return=Y,F)}function we(Y,F,te){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=hp(""+F,Y.mode,te),F.return=Y,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case S:return te=su(F.type,F.key,F.props,null,Y.mode,te),no(te,F),te.return=Y,te;case A:return F=pp(F,Y.mode,te),F.return=Y,F;case z:return F=Xs(F),we(Y,F,te)}if(xe(F)||G(F))return F=Vs(F,Y.mode,te,null),F.return=Y,F;if(typeof F.then=="function")return we(Y,fu(F),te);if(F.$$typeof===E)return we(Y,ou(Y,F),te);hu(Y,F)}return null}function re(Y,F,te,be){var Ue=F!==null?F.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Ue!==null?null:N(Y,F,""+te,be);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case S:return te.key===Ue?q(Y,F,te,be):null;case A:return te.key===Ue?ie(Y,F,te,be):null;case z:return te=Xs(te),re(Y,F,te,be)}if(xe(te)||G(te))return Ue!==null?null:pe(Y,F,te,be,null);if(typeof te.then=="function")return re(Y,F,fu(te),be);if(te.$$typeof===E)return re(Y,F,ou(Y,te),be);hu(Y,te)}return null}function ce(Y,F,te,be,Ue){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return Y=Y.get(te)||null,N(F,Y,""+be,Ue);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case S:return Y=Y.get(be.key===null?te:be.key)||null,q(F,Y,be,Ue);case A:return Y=Y.get(be.key===null?te:be.key)||null,ie(F,Y,be,Ue);case z:return be=Xs(be),ce(Y,F,te,be,Ue)}if(xe(be)||G(be))return Y=Y.get(te)||null,pe(F,Y,be,Ue,null);if(typeof be.then=="function")return ce(Y,F,te,fu(be),Ue);if(be.$$typeof===E)return ce(Y,F,te,ou(F,be),Ue);hu(F,be)}return null}function _e(Y,F,te,be){for(var Ue=null,yt=null,$e=F,nt=F=0,ut=null;$e!==null&&nt<te.length;nt++){$e.index>nt?(ut=$e,$e=null):ut=$e.sibling;var bt=re(Y,$e,te[nt],be);if(bt===null){$e===null&&($e=ut);break}i&&$e&&bt.alternate===null&&l(Y,$e),F=y(bt,F,nt),yt===null?Ue=bt:yt.sibling=bt,yt=bt,$e=ut}if(nt===te.length)return o(Y,$e),ft&&br(Y,nt),Ue;if($e===null){for(;nt<te.length;nt++)$e=we(Y,te[nt],be),$e!==null&&(F=y($e,F,nt),yt===null?Ue=$e:yt.sibling=$e,yt=$e);return ft&&br(Y,nt),Ue}for($e=d($e);nt<te.length;nt++)ut=ce($e,Y,nt,te[nt],be),ut!==null&&(i&&ut.alternate!==null&&$e.delete(ut.key===null?nt:ut.key),F=y(ut,F,nt),yt===null?Ue=ut:yt.sibling=ut,yt=ut);return i&&$e.forEach(function(ks){return l(Y,ks)}),ft&&br(Y,nt),Ue}function Pe(Y,F,te,be){if(te==null)throw Error(r(151));for(var Ue=null,yt=null,$e=F,nt=F=0,ut=null,bt=te.next();$e!==null&&!bt.done;nt++,bt=te.next()){$e.index>nt?(ut=$e,$e=null):ut=$e.sibling;var ks=re(Y,$e,bt.value,be);if(ks===null){$e===null&&($e=ut);break}i&&$e&&ks.alternate===null&&l(Y,$e),F=y(ks,F,nt),yt===null?Ue=ks:yt.sibling=ks,yt=ks,$e=ut}if(bt.done)return o(Y,$e),ft&&br(Y,nt),Ue;if($e===null){for(;!bt.done;nt++,bt=te.next())bt=we(Y,bt.value,be),bt!==null&&(F=y(bt,F,nt),yt===null?Ue=bt:yt.sibling=bt,yt=bt);return ft&&br(Y,nt),Ue}for($e=d($e);!bt.done;nt++,bt=te.next())bt=ce($e,Y,nt,bt.value,be),bt!==null&&(i&&bt.alternate!==null&&$e.delete(bt.key===null?nt:bt.key),F=y(bt,F,nt),yt===null?Ue=bt:yt.sibling=bt,yt=bt);return i&&$e.forEach(function(HR){return l(Y,HR)}),ft&&br(Y,nt),Ue}function Ct(Y,F,te,be){if(typeof te=="object"&&te!==null&&te.type===C&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case S:e:{for(var Ue=te.key;F!==null;){if(F.key===Ue){if(Ue=te.type,Ue===C){if(F.tag===7){o(Y,F.sibling),be=m(F,te.props.children),be.return=Y,Y=be;break e}}else if(F.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===z&&Xs(Ue)===F.type){o(Y,F.sibling),be=m(F,te.props),no(be,te),be.return=Y,Y=be;break e}o(Y,F);break}else l(Y,F);F=F.sibling}te.type===C?(be=Vs(te.props.children,Y.mode,be,te.key),be.return=Y,Y=be):(be=su(te.type,te.key,te.props,null,Y.mode,be),no(be,te),be.return=Y,Y=be)}return w(Y);case A:e:{for(Ue=te.key;F!==null;){if(F.key===Ue)if(F.tag===4&&F.stateNode.containerInfo===te.containerInfo&&F.stateNode.implementation===te.implementation){o(Y,F.sibling),be=m(F,te.children||[]),be.return=Y,Y=be;break e}else{o(Y,F);break}else l(Y,F);F=F.sibling}be=pp(te,Y.mode,be),be.return=Y,Y=be}return w(Y);case z:return te=Xs(te),Ct(Y,F,te,be)}if(xe(te))return _e(Y,F,te,be);if(G(te)){if(Ue=G(te),typeof Ue!="function")throw Error(r(150));return te=Ue.call(te),Pe(Y,F,te,be)}if(typeof te.then=="function")return Ct(Y,F,fu(te),be);if(te.$$typeof===E)return Ct(Y,F,ou(Y,te),be);hu(Y,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,F!==null&&F.tag===6?(o(Y,F.sibling),be=m(F,te),be.return=Y,Y=be):(o(Y,F),be=hp(te,Y.mode,be),be.return=Y,Y=be),w(Y)):o(Y,F)}return function(Y,F,te,be){try{to=0;var Ue=Ct(Y,F,te,be);return Ul=null,Ue}catch($e){if($e===Il||$e===uu)throw $e;var yt=ni(29,$e,null,Y.mode);return yt.lanes=be,yt.return=Y,yt}}}var Qs=tw(!0),nw=tw(!1),as=!1;function Np(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tp(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 os(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function cs(i,l,o){var d=i.updateQueue;if(d===null)return null;if(d=d.shared,(xt&2)!==0){var m=d.pending;return m===null?l.next=l:(l.next=m.next,m.next=l),d.pending=l,l=ru(i),z1(i,null,o),l}return iu(i,d,l,o),ru(i)}function io(i,l,o){if(l=l.updateQueue,l!==null&&(l=l.shared,(o&4194048)!==0)){var d=l.lanes;d&=i.pendingLanes,o|=d,l.lanes=o,Me(i,o)}}function jp(i,l){var o=i.updateQueue,d=i.alternate;if(d!==null&&(d=d.updateQueue,o===d)){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:d.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:d.shared,callbacks:d.callbacks},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=l:i.next=l,o.lastBaseUpdate=l}var Ep=!1;function ro(){if(Ep){var i=Hl;if(i!==null)throw i}}function so(i,l,o,d){Ep=!1;var m=i.updateQueue;as=!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 pe=i.alternate;pe!==null&&(pe=pe.updateQueue,N=pe.lastBaseUpdate,N!==w&&(N===null?pe.firstBaseUpdate=ie:N.next=ie,pe.lastBaseUpdate=q))}if(y!==null){var we=m.baseState;w=0,pe=ie=q=null,N=y;do{var re=N.lane&-536870913,ce=re!==N.lane;if(ce?(ct&re)===re:(d&re)===re){re!==0&&re===zl&&(Ep=!0),pe!==null&&(pe=pe.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var _e=i,Pe=N;re=l;var Ct=o;switch(Pe.tag){case 1:if(_e=Pe.payload,typeof _e=="function"){we=_e.call(Ct,we,re);break e}we=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Pe.payload,re=typeof _e=="function"?_e.call(Ct,we,re):_e,re==null)break e;we=b({},we,re);break e;case 2:as=!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},pe===null?(ie=pe=ce,q=we):pe=pe.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);pe===null&&(q=we),m.baseState=q,m.firstBaseUpdate=ie,m.lastBaseUpdate=pe,y===null&&(m.shared.lanes=0),ps|=w,i.lanes=w,i.memoizedState=we}}function iw(i,l){if(typeof i!="function")throw Error(r(191,i));i.call(l)}function rw(i,l){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)iw(o[i],l)}var Fl=L(null),pu=L(0);function sw(i,l){i=Er,ue(pu,i),ue(Fl,l),Er=i|l.baseLanes}function Op(){ue(pu,Er),ue(Fl,Fl.current)}function Mp(){Er=pu.current,V(Fl),V(pu)}var ii=L(null),Ti=null;function us(i){var l=i.alternate;ue(Vt,Vt.current&1),ue(ii,i),Ti===null&&(l===null||Fl.current!==null||l.memoizedState!==null)&&(Ti=i)}function Rp(i){ue(Vt,Vt.current),ue(ii,i),Ti===null&&(Ti=i)}function lw(i){i.tag===22?(ue(Vt,Vt.current),ue(ii,i),Ti===null&&(Ti=i)):ds()}function ds(){ue(Vt,Vt.current),ue(ii,ii.current)}function ri(i){V(ii),Ti===i&&(Ti=null),V(Vt)}var Vt=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||qm(o)||zm(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 wr=0,tt=null,At=null,Xt=null,gu=!1,Vl=!1,Ws=!1,yu=0,lo=0,Pl=null,OM=0;function $t(){throw Error(r(321))}function Dp(i,l){if(l===null)return!1;for(var o=0;o<l.length&&o<i.length;o++)if(!ti(i[o],l[o]))return!1;return!0}function _p(i,l,o,d,m,y){return wr=y,tt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,_.H=i===null||i.memoizedState===null?Fw:Xp,Ws=!1,y=o(d,m),Ws=!1,Vl&&(y=ow(l,o,d,m)),aw(i),y}function aw(i){_.H=co;var l=At!==null&&At.next!==null;if(wr=0,Xt=At=tt=null,gu=!1,lo=0,Pl=null,l)throw Error(r(300));i===null||Jt||(i=i.dependencies,i!==null&&au(i)&&(Jt=!0))}function ow(i,l,o,d){tt=i;var m=0;do{if(Vl&&(Pl=null),lo=0,Vl=!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=Vw,y=l(o,d)}while(Vl);return y}function MM(){var i=_.H,l=i.useState()[0];return l=typeof l.then=="function"?ao(l):l,i=i.useState()[0],(At!==null?At.memoizedState:null)!==i&&(tt.flags|=1024),l}function Lp(){var i=yu!==0;return yu=0,i}function Bp(i,l,o){l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~o}function $p(i){if(gu){for(i=i.memoizedState;i!==null;){var l=i.queue;l!==null&&(l.pending=null),i=i.next}gu=!1}wr=0,Xt=At=tt=null,Vl=!1,lo=yu=0,Pl=null}function Ln(){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 Pt(){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 ao(i){var l=lo;return lo+=1,Pl===null&&(Pl=[]),i=W1(Pl,i,l),l=tt,(Xt===null?l.memoizedState:Xt.next)===null&&(l=l.alternate,_.H=l===null||l.memoizedState===null?Fw:Xp),i}function xu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return ao(i);if(i.$$typeof===E)return bn(i)}throw Error(r(438,String(i)))}function qp(i){var l=null,o=tt.updateQueue;if(o!==null&&(l=o.memoCache),l==null){var d=tt.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(l={data:d.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),d=0;d<i;d++)o[d]=J;return l.index++,o}function Sr(i,l){return typeof l=="function"?l(i):l}function vu(i){var l=Pt();return zp(l,At,i)}function zp(i,l,o){var d=i.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=o;var m=i.baseQueue,y=d.pending;if(y!==null){if(m!==null){var w=m.next;m.next=y.next,y.next=w}l.baseQueue=m=y,d.pending=null}if(y=i.baseState,m===null)i.memoizedState=y;else{l=m.next;var N=w=null,q=null,ie=l,pe=!1;do{var we=ie.lane&-536870913;if(we!==ie.lane?(ct&we)===we:(wr&we)===we){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}),we===zl&&(pe=!0);else if((wr&re)===re){ie=ie.next,re===zl&&(pe=!0);continue}else we={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},q===null?(N=q=we,w=y):q=q.next=we,tt.lanes|=re,ps|=re;we=ie.action,Ws&&o(y,we),y=ie.hasEagerState?ie.eagerState:o(y,we)}else re={lane:we,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|=we,ps|=we;ie=ie.next}while(ie!==null&&ie!==l);if(q===null?w=y:q.next=N,!ti(y,i.memoizedState)&&(Jt=!0,pe&&(o=Hl,o!==null)))throw o;i.memoizedState=y,i.baseState=w,i.baseQueue=q,d.lastRenderedState=y}return m===null&&(d.lanes=0),[i.memoizedState,d.dispatch]}function Hp(i){var l=Pt(),o=l.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=i;var d=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);ti(y,l.memoizedState)||(Jt=!0),l.memoizedState=y,l.baseQueue===null&&(l.baseState=y),o.lastRenderedState=y}return[y,d]}function cw(i,l,o){var d=tt,m=Pt(),y=ft;if(y){if(o===void 0)throw Error(r(407));o=o()}else o=l();var w=!ti((At||m).memoizedState,o);if(w&&(m.memoizedState=o,Jt=!0),m=m.queue,Fp(fw.bind(null,d,m,i),[i]),m.getSnapshot!==l||w||Xt!==null&&Xt.memoizedState.tag&1){if(d.flags|=2048,Kl(9,{destroy:void 0},dw.bind(null,d,m,o,l),null),jt===null)throw Error(r(349));y||(wr&127)!==0||uw(d,l,o)}return o}function uw(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 dw(i,l,o,d){l.value=o,l.getSnapshot=d,hw(l)&&pw(i)}function fw(i,l,o){return o(function(){hw(l)&&pw(i)})}function hw(i){var l=i.getSnapshot;i=i.value;try{var o=l();return!ti(i,o)}catch{return!0}}function pw(i){var l=Fs(i,2);l!==null&&Gn(l,i,2)}function Ip(i){var l=Ln();if(typeof i=="function"){var o=i;if(i=o(),Ws){X(!0);try{o()}finally{X(!1)}}}return l.memoizedState=l.baseState=i,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:i},l}function mw(i,l,o,d){return i.baseState=o,zp(i,At,typeof d=="function"?d:Sr)}function RM(i,l,o,d,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,d(y),o=l.pending,o===null?(y.next=l.pending=y,gw(l,y)):(y.next=o.next,l.pending=o.next=y)}}function gw(i,l){var o=l.action,d=l.payload,m=i.state;if(l.isTransition){var y=_.T,w={};_.T=w;try{var N=o(m,d),q=_.S;q!==null&&q(w,N),yw(i,l,N)}catch(ie){Up(i,l,ie)}finally{y!==null&&w.types!==null&&(y.types=w.types),_.T=y}}else try{y=o(m,d),yw(i,l,y)}catch(ie){Up(i,l,ie)}}function yw(i,l,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(d){bw(i,l,d)},function(d){return Up(i,l,d)}):bw(i,l,o)}function bw(i,l,o){l.status="fulfilled",l.value=o,xw(l),i.state=o,l=i.pending,l!==null&&(o=l.next,o===l?i.pending=null:(o=o.next,l.next=o,gw(i,o)))}function Up(i,l,o){var d=i.pending;if(i.pending=null,d!==null){d=d.next;do l.status="rejected",l.reason=o,xw(l),l=l.next;while(l!==d)}i.action=null}function xw(i){i=i.listeners;for(var l=0;l<i.length;l++)(0,i[l])()}function vw(i,l){return l}function ww(i,l){if(ft){var o=jt.formState;if(o!==null){e:{var d=tt;if(ft){if(Ot){t:{for(var m=Ot,y=Ni;m.nodeType!==8;){if(!y){m=null;break t}if(m=ji(m.nextSibling),m===null){m=null;break t}}y=m.data,m=y==="F!"||y==="F"?m:null}if(m){Ot=ji(m.nextSibling),d=m.data==="F!";break e}}ss(d)}d=!1}d&&(l=o[0])}}return o=Ln(),o.memoizedState=o.baseState=l,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vw,lastRenderedState:l},o.queue=d,o=Hw.bind(null,tt,d),d.dispatch=o,d=Ip(!1),y=Gp.bind(null,tt,!1,d.queue),d=Ln(),m={state:l,dispatch:null,action:i,pending:null},d.queue=m,o=RM.bind(null,tt,m,y,o),m.dispatch=o,d.memoizedState=i,[l,o,!1]}function Sw(i){var l=Pt();return Aw(l,At,i)}function Aw(i,l,o){if(l=zp(i,l,vw)[0],i=vu(Sr)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var d=ao(l)}catch(w){throw w===Il?uu:w}else d=l;l=Pt();var m=l.queue,y=m.dispatch;return o!==l.memoizedState&&(tt.flags|=2048,Kl(9,{destroy:void 0},DM.bind(null,m,o),null)),[d,y,i]}function DM(i,l){i.action=l}function kw(i){var l=Pt(),o=At;if(o!==null)return Aw(l,o,i);Pt(),l=l.memoizedState,o=Pt();var d=o.queue.dispatch;return o.memoizedState=i,[l,d,!1]}function Kl(i,l,o,d){return i={tag:i,create:o,deps:d,inst:l,next:null},l=tt.updateQueue,l===null&&(l=bu(),tt.updateQueue=l),o=l.lastEffect,o===null?l.lastEffect=i.next=i:(d=o.next,o.next=i,i.next=d,l.lastEffect=i),i}function Cw(){return Pt().memoizedState}function wu(i,l,o,d){var m=Ln();tt.flags|=i,m.memoizedState=Kl(1|l,{destroy:void 0},o,d===void 0?null:d)}function Su(i,l,o,d){var m=Pt();d=d===void 0?null:d;var y=m.memoizedState.inst;At!==null&&d!==null&&Dp(d,At.memoizedState.deps)?m.memoizedState=Kl(l,y,o,d):(tt.flags|=i,m.memoizedState=Kl(1|l,y,o,d))}function Nw(i,l){wu(8390656,8,i,l)}function Fp(i,l){Su(2048,8,i,l)}function _M(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 Tw(i){var l=Pt().memoizedState;return _M({ref:l,nextImpl:i}),function(){if((xt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function jw(i,l){return Su(4,2,i,l)}function Ew(i,l){return Su(4,4,i,l)}function Ow(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 Mw(i,l,o){o=o!=null?o.concat([i]):null,Su(4,4,Ow.bind(null,l,i),o)}function Vp(){}function Rw(i,l){var o=Pt();l=l===void 0?null:l;var d=o.memoizedState;return l!==null&&Dp(l,d[1])?d[0]:(o.memoizedState=[i,l],i)}function Dw(i,l){var o=Pt();l=l===void 0?null:l;var d=o.memoizedState;if(l!==null&&Dp(l,d[1]))return d[0];if(d=i(),Ws){X(!0);try{i()}finally{X(!1)}}return o.memoizedState=[d,l],d}function Pp(i,l,o){return o===void 0||(wr&1073741824)!==0&&(ct&261930)===0?i.memoizedState=l:(i.memoizedState=o,i=_S(),tt.lanes|=i,ps|=i,o)}function _w(i,l,o,d){return ti(o,l)?o:Fl.current!==null?(i=Pp(i,o,d),ti(i,l)||(Jt=!0),i):(wr&42)===0||(wr&1073741824)!==0&&(ct&261930)===0?(Jt=!0,i.memoizedState=o):(i=_S(),tt.lanes|=i,ps|=i,l)}function Lw(i,l,o,d,m){var y=ee.p;ee.p=y!==0&&8>y?y:8;var w=_.T,N={};_.T=N,Gp(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 pe=EM(q,d);oo(i,l,pe,ai(i))}else oo(i,l,d,ai(i))}catch(we){oo(i,l,{then:function(){},status:"rejected",reason:we},ai())}finally{ee.p=y,w!==null&&N.types!==null&&(w.types=N.types),_.T=w}}function LM(){}function Kp(i,l,o,d){if(i.tag!==5)throw Error(r(476));var m=Bw(i).queue;Lw(i,m,l,de,o===null?LM:function(){return $w(i),o(d)})}function Bw(i){var l=i.memoizedState;if(l!==null)return l;l={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:de},next:null};var o={};return l.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:o},next:null},i.memoizedState=l,i=i.alternate,i!==null&&(i.memoizedState=l),l}function $w(i){var l=Bw(i);l.next===null&&(l=i.alternate.memoizedState),oo(i,l.next.queue,{},ai())}function Yp(){return bn(No)}function qw(){return Pt().memoizedState}function zw(){return Pt().memoizedState}function BM(i){for(var l=i.return;l!==null;){switch(l.tag){case 24:case 3:var o=ai();i=os(o);var d=cs(l,i,o);d!==null&&(Gn(d,l,o),io(d,l,o)),l={cache:Sp()},i.payload=l;return}l=l.return}}function $M(i,l,o){var d=ai();o={lane:d,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Au(i)?Iw(l,o):(o=dp(i,l,o,d),o!==null&&(Gn(o,i,d),Uw(o,l,d)))}function Hw(i,l,o){var d=ai();oo(i,l,o,d)}function oo(i,l,o,d){var m={lane:d,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Au(i))Iw(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,ti(N,w))return iu(i,l,m,0),jt===null&&nu(),!1}catch{}if(o=dp(i,l,m,d),o!==null)return Gn(o,i,d),Uw(o,l,d),!0}return!1}function Gp(i,l,o,d){if(d={lane:2,revertLane:Nm(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Au(i)){if(l)throw Error(r(479))}else l=dp(i,o,d,2),l!==null&&Gn(l,i,2)}function Au(i){var l=i.alternate;return i===tt||l!==null&&l===tt}function Iw(i,l){Vl=gu=!0;var o=i.pending;o===null?l.next=l:(l.next=o.next,o.next=l),i.pending=l}function Uw(i,l,o){if((o&4194048)!==0){var d=l.lanes;d&=i.pendingLanes,o|=d,l.lanes=o,Me(i,o)}}var co={readContext:bn,use:xu,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t};co.useEffectEvent=$t;var Fw={readContext:bn,use:xu,useCallback:function(i,l){return Ln().memoizedState=[i,l===void 0?null:l],i},useContext:bn,useEffect:Nw,useImperativeHandle:function(i,l,o){o=o!=null?o.concat([i]):null,wu(4194308,4,Ow.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=Ln();l=l===void 0?null:l;var d=i();if(Ws){X(!0);try{i()}finally{X(!1)}}return o.memoizedState=[d,l],d},useReducer:function(i,l,o){var d=Ln();if(o!==void 0){var m=o(l);if(Ws){X(!0);try{o(l)}finally{X(!1)}}}else m=l;return d.memoizedState=d.baseState=m,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:m},d.queue=i,i=i.dispatch=$M.bind(null,tt,i),[d.memoizedState,i]},useRef:function(i){var l=Ln();return i={current:i},l.memoizedState=i},useState:function(i){i=Ip(i);var l=i.queue,o=Hw.bind(null,tt,l);return l.dispatch=o,[i.memoizedState,o]},useDebugValue:Vp,useDeferredValue:function(i,l){var o=Ln();return Pp(o,i,l)},useTransition:function(){var i=Ip(!1);return i=Lw.bind(null,tt,i.queue,!0,!1),Ln().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,l,o){var d=tt,m=Ln();if(ft){if(o===void 0)throw Error(r(407));o=o()}else{if(o=l(),jt===null)throw Error(r(349));(ct&127)!==0||uw(d,l,o)}m.memoizedState=o;var y={value:o,getSnapshot:l};return m.queue=y,Nw(fw.bind(null,d,y,i),[i]),d.flags|=2048,Kl(9,{destroy:void 0},dw.bind(null,d,y,o,l),null),o},useId:function(){var i=Ln(),l=jt.identifierPrefix;if(ft){var o=er,d=Zi;o=(d&~(1<<32-Z(d)-1)).toString(32)+o,l="_"+l+"R_"+o,o=yu++,0<o&&(l+="H"+o.toString(32)),l+="_"}else o=OM++,l="_"+l+"r_"+o.toString(32)+"_";return i.memoizedState=l},useHostTransitionStatus:Yp,useFormState:ww,useActionState:ww,useOptimistic:function(i){var l=Ln();l.memoizedState=l.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=o,l=Gp.bind(null,tt,!0,o),o.dispatch=l,[i,l]},useMemoCache:qp,useCacheRefresh:function(){return Ln().memoizedState=BM.bind(null,tt)},useEffectEvent:function(i){var l=Ln(),o={impl:i};return l.memoizedState=o,function(){if((xt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}},Xp={readContext:bn,use:xu,useCallback:Rw,useContext:bn,useEffect:Fp,useImperativeHandle:Mw,useInsertionEffect:jw,useLayoutEffect:Ew,useMemo:Dw,useReducer:vu,useRef:Cw,useState:function(){return vu(Sr)},useDebugValue:Vp,useDeferredValue:function(i,l){var o=Pt();return _w(o,At.memoizedState,i,l)},useTransition:function(){var i=vu(Sr)[0],l=Pt().memoizedState;return[typeof i=="boolean"?i:ao(i),l]},useSyncExternalStore:cw,useId:qw,useHostTransitionStatus:Yp,useFormState:Sw,useActionState:Sw,useOptimistic:function(i,l){var o=Pt();return mw(o,At,i,l)},useMemoCache:qp,useCacheRefresh:zw};Xp.useEffectEvent=Tw;var Vw={readContext:bn,use:xu,useCallback:Rw,useContext:bn,useEffect:Fp,useImperativeHandle:Mw,useInsertionEffect:jw,useLayoutEffect:Ew,useMemo:Dw,useReducer:Hp,useRef:Cw,useState:function(){return Hp(Sr)},useDebugValue:Vp,useDeferredValue:function(i,l){var o=Pt();return At===null?Pp(o,i,l):_w(o,At.memoizedState,i,l)},useTransition:function(){var i=Hp(Sr)[0],l=Pt().memoizedState;return[typeof i=="boolean"?i:ao(i),l]},useSyncExternalStore:cw,useId:qw,useHostTransitionStatus:Yp,useFormState:kw,useActionState:kw,useOptimistic:function(i,l){var o=Pt();return At!==null?mw(o,At,i,l):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:qp,useCacheRefresh:zw};Vw.useEffectEvent=Tw;function Jp(i,l,o,d){l=i.memoizedState,o=o(d,l),o=o==null?l:b({},l,o),i.memoizedState=o,i.lanes===0&&(i.updateQueue.baseState=o)}var Qp={enqueueSetState:function(i,l,o){i=i._reactInternals;var d=ai(),m=os(d);m.payload=l,o!=null&&(m.callback=o),l=cs(i,m,d),l!==null&&(Gn(l,i,d),io(l,i,d))},enqueueReplaceState:function(i,l,o){i=i._reactInternals;var d=ai(),m=os(d);m.tag=1,m.payload=l,o!=null&&(m.callback=o),l=cs(i,m,d),l!==null&&(Gn(l,i,d),io(l,i,d))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var o=ai(),d=os(o);d.tag=2,l!=null&&(d.callback=l),l=cs(i,d,o),l!==null&&(Gn(l,i,o),io(l,i,o))}};function Pw(i,l,o,d,m,y,w){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(d,y,w):l.prototype&&l.prototype.isPureReactComponent?!Xa(o,d)||!Xa(m,y):!0}function Kw(i,l,o,d){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(o,d),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(o,d),l.state!==i&&Qp.enqueueReplaceState(l,l.state,null)}function Zs(i,l){var o=l;if("ref"in l){o={};for(var d in l)d!=="ref"&&(o[d]=l[d])}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 Yw(i){tu(i)}function Gw(i){console.error(i)}function Xw(i){tu(i)}function ku(i,l){try{var o=i.onUncaughtError;o(l.value,{componentStack:l.stack})}catch(d){setTimeout(function(){throw d})}}function Jw(i,l,o){try{var d=i.onCaughtError;d(o.value,{componentStack:o.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Wp(i,l,o){return o=os(o),o.tag=3,o.payload={element:null},o.callback=function(){ku(i,l)},o}function Qw(i){return i=os(i),i.tag=3,i}function Ww(i,l,o,d){var m=o.type.getDerivedStateFromError;if(typeof m=="function"){var y=d.value;i.payload=function(){return m(y)},i.callback=function(){Jw(l,o,d)}}var w=o.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(i.callback=function(){Jw(l,o,d),typeof m!="function"&&(ms===null?ms=new Set([this]):ms.add(this));var N=d.stack;this.componentDidCatch(d.value,{componentStack:N!==null?N:""})})}function qM(i,l,o,d,m){if(o.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(l=o.alternate,l!==null&&ql(l,o,m,!0),o=ii.current,o!==null){switch(o.tag){case 31:case 13:return Ti===null?Bu():o.alternate===null&&qt===0&&(qt=3),o.flags&=-257,o.flags|=65536,o.lanes=m,d===du?o.flags|=16384:(l=o.updateQueue,l===null?o.updateQueue=new Set([d]):l.add(d),Am(i,d,m)),!1;case 22:return o.flags|=65536,d===du?o.flags|=16384:(l=o.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([d])},o.updateQueue=l):(o=l.retryQueue,o===null?l.retryQueue=new Set([d]):o.add(d)),Am(i,d,m)),!1}throw Error(r(435,o.tag))}return Am(i,d,m),Bu(),!1}if(ft)return l=ii.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=m,d!==yp&&(i=Error(r(422),{cause:d}),Wa(Ai(i,o)))):(d!==yp&&(l=Error(r(423),{cause:d}),Wa(Ai(l,o))),i=i.current.alternate,i.flags|=65536,m&=-m,i.lanes|=m,d=Ai(d,o),m=Wp(i.stateNode,d,m),jp(i,m),qt!==4&&(qt=2)),!1;var y=Error(r(520),{cause:d});if(y=Ai(y,o),bo===null?bo=[y]:bo.push(y),qt!==4&&(qt=2),l===null)return!0;d=Ai(d,o),o=l;do{switch(o.tag){case 3:return o.flags|=65536,i=m&-m,o.lanes|=i,i=Wp(o.stateNode,d,i),jp(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"&&(ms===null||!ms.has(y))))return o.flags|=65536,m&=-m,o.lanes|=m,m=Qw(m),Ww(m,i,o,d),jp(o,m),!1}o=o.return}while(o!==null);return!1}var Zp=Error(r(461)),Jt=!1;function xn(i,l,o,d){l.child=i===null?nw(l,null,o,d):Qs(l,i.child,o,d)}function Zw(i,l,o,d,m){o=o.render;var y=l.ref;if("ref"in d){var w={};for(var N in d)N!=="ref"&&(w[N]=d[N])}else w=d;return Ys(l),d=_p(i,l,o,w,y,m),N=Lp(),i!==null&&!Jt?(Bp(i,l,m),Ar(i,l,m)):(ft&&N&&mp(l),l.flags|=1,xn(i,l,d,m),l.child)}function eS(i,l,o,d,m){if(i===null){var y=o.type;return typeof y=="function"&&!fp(y)&&y.defaultProps===void 0&&o.compare===null?(l.tag=15,l.type=y,tS(i,l,y,d,m)):(i=su(o.type,null,d,l,l.mode,m),i.ref=l.ref,i.return=l,l.child=i)}if(y=i.child,!am(i,m)){var w=y.memoizedProps;if(o=o.compare,o=o!==null?o:Xa,o(w,d)&&i.ref===l.ref)return Ar(i,l,m)}return l.flags|=1,i=yr(y,d),i.ref=l.ref,i.return=l,l.child=i}function tS(i,l,o,d,m){if(i!==null){var y=i.memoizedProps;if(Xa(y,d)&&i.ref===l.ref)if(Jt=!1,l.pendingProps=d=y,am(i,m))(i.flags&131072)!==0&&(Jt=!0);else return l.lanes=i.lanes,Ar(i,l,m)}return em(i,l,o,d,m)}function nS(i,l,o,d){var m=d.children,y=i!==null?i.memoizedState:null;if(i===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((l.flags&128)!==0){if(y=y!==null?y.baseLanes|o:o,i!==null){for(d=l.child=i.child,m=0;d!==null;)m=m|d.lanes|d.childLanes,d=d.sibling;d=m&~y}else d=0,l.child=null;return iS(i,l,y,o,d)}if((o&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},i!==null&&cu(l,y!==null?y.cachePool:null),y!==null?sw(l,y):Op(),lw(l);else return d=l.lanes=536870912,iS(i,l,y!==null?y.baseLanes|o:o,o,d)}else y!==null?(cu(l,y.cachePool),sw(l,y),ds(),l.memoizedState=null):(i!==null&&cu(l,null),Op(),ds());return xn(i,l,m,o),l.child}function uo(i,l){return i!==null&&i.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function iS(i,l,o,d,m){var y=kp();return y=y===null?null:{parent:Gt._currentValue,pool:y},l.memoizedState={baseLanes:o,cachePool:y},i!==null&&cu(l,null),Op(),lw(l),i!==null&&ql(i,l,d,!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 rS(i,l,o){return Qs(l,i.child,null,o),i=Cu(l,l.pendingProps),i.flags|=2,ri(l),l.memoizedState=null,i}function zM(i,l,o){var d=l.pendingProps,m=(l.flags&128)!==0;if(l.flags&=-129,i===null){if(ft){if(d.mode==="hidden")return i=Cu(l,d),l.lanes=536870912,uo(null,i);if(Rp(l),(i=Ot)?(i=g2(i,Ni),i=i!==null&&i.data==="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:is!==null?{id:Zi,overflow:er}:null,retryLane:536870912,hydrationErrors:null},o=I1(i),o.return=l,l.child=o,yn=l,Ot=null)):i=null,i===null)throw ss(l);return l.lanes=536870912,null}return Cu(l,d)}var y=i.memoizedState;if(y!==null){var w=y.dehydrated;if(Rp(l),m)if(l.flags&256)l.flags&=-257,l=rS(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||ql(i,l,o,!1),m=(o&i.childLanes)!==0,Jt||m){if(d=jt,d!==null&&(w=We(d,o),w!==0&&w!==y.retryLane))throw y.retryLane=w,Fs(i,w),Gn(d,i,w),Zp;Bu(),l=rS(i,l,o)}else i=y.treeContext,Ot=ji(w.nextSibling),yn=l,ft=!0,rs=null,Ni=!1,i!==null&&V1(l,i),l=Cu(l,d),l.flags|=4096;return l}return i=yr(i.child,{mode:d.mode,children:d.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 em(i,l,o,d,m){return Ys(l),o=_p(i,l,o,d,void 0,m),d=Lp(),i!==null&&!Jt?(Bp(i,l,m),Ar(i,l,m)):(ft&&d&&mp(l),l.flags|=1,xn(i,l,o,m),l.child)}function sS(i,l,o,d,m,y){return Ys(l),l.updateQueue=null,o=ow(l,d,o,m),aw(i),d=Lp(),i!==null&&!Jt?(Bp(i,l,y),Ar(i,l,y)):(ft&&d&&mp(l),l.flags|=1,xn(i,l,o,y),l.child)}function lS(i,l,o,d,m){if(Ys(l),l.stateNode===null){var y=_l,w=o.contextType;typeof w=="object"&&w!==null&&(y=bn(w)),y=new o(d,y),l.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Qp,l.stateNode=y,y._reactInternals=l,y=l.stateNode,y.props=d,y.state=l.memoizedState,y.refs={},Np(l),w=o.contextType,y.context=typeof w=="object"&&w!==null?bn(w):_l,y.state=l.memoizedState,w=o.getDerivedStateFromProps,typeof w=="function"&&(Jp(l,o,w,d),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&&Qp.enqueueReplaceState(y,y.state,null),so(l,d,y,m),ro(),y.state=l.memoizedState),typeof y.componentDidMount=="function"&&(l.flags|=4194308),d=!0}else if(i===null){y=l.stateNode;var N=l.memoizedProps,q=Zs(o,N);y.props=q;var ie=y.context,pe=o.contextType;w=_l,typeof pe=="object"&&pe!==null&&(w=bn(pe));var we=o.getDerivedStateFromProps;pe=typeof we=="function"||typeof y.getSnapshotBeforeUpdate=="function",N=l.pendingProps!==N,pe||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N||ie!==w)&&Kw(l,y,d,w),as=!1;var re=l.memoizedState;y.state=re,so(l,d,y,m),ro(),ie=l.memoizedState,N||re!==ie||as?(typeof we=="function"&&(Jp(l,o,we,d),ie=l.memoizedState),(q=as||Pw(l,o,q,d,re,ie,w))?(pe||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=d,l.memoizedState=ie),y.props=d,y.state=ie,y.context=w,d=q):(typeof y.componentDidMount=="function"&&(l.flags|=4194308),d=!1)}else{y=l.stateNode,Tp(i,l),w=l.memoizedProps,pe=Zs(o,w),y.props=pe,we=l.pendingProps,re=y.context,ie=o.contextType,q=_l,typeof ie=="object"&&ie!==null&&(q=bn(ie)),N=o.getDerivedStateFromProps,(ie=typeof N=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(w!==we||re!==q)&&Kw(l,y,d,q),as=!1,re=l.memoizedState,y.state=re,so(l,d,y,m),ro();var ce=l.memoizedState;w!==we||re!==ce||as||i!==null&&i.dependencies!==null&&au(i.dependencies)?(typeof N=="function"&&(Jp(l,o,N,d),ce=l.memoizedState),(pe=as||Pw(l,o,pe,d,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(d,ce,q),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(d,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=d,l.memoizedState=ce),y.props=d,y.state=ce,y.context=q,d=pe):(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),d=!1)}return y=d,Nu(i,l),d=(l.flags&128)!==0,y||d?(y=l.stateNode,o=d&&typeof o.getDerivedStateFromError!="function"?null:y.render(),l.flags|=1,i!==null&&d?(l.child=Qs(l,i.child,null,m),l.child=Qs(l,null,o,m)):xn(i,l,o,m),l.memoizedState=y.state,i=l.child):i=Ar(i,l,m),i}function aS(i,l,o,d){return Ps(),l.flags|=256,xn(i,l,o,d),l.child}var tm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nm(i){return{baseLanes:i,cachePool:J1()}}function im(i,l,o){return i=i!==null?i.childLanes&~o:0,l&&(i|=li),i}function oS(i,l,o){var d=l.pendingProps,m=!1,y=(l.flags&128)!==0,w;if((w=y)||(w=i!==null&&i.memoizedState===null?!1:(Vt.current&2)!==0),w&&(m=!0,l.flags&=-129),w=(l.flags&32)!==0,l.flags&=-33,i===null){if(ft){if(m?us(l):ds(),(i=Ot)?(i=g2(i,Ni),i=i!==null&&i.data!=="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:is!==null?{id:Zi,overflow:er}:null,retryLane:536870912,hydrationErrors:null},o=I1(i),o.return=l,l.child=o,yn=l,Ot=null)):i=null,i===null)throw ss(l);return zm(i)?l.lanes=32:l.lanes=536870912,null}var N=d.children;return d=d.fallback,m?(ds(),m=l.mode,N=Tu({mode:"hidden",children:N},m),d=Vs(d,m,o,null),N.return=l,d.return=l,N.sibling=d,l.child=N,d=l.child,d.memoizedState=nm(o),d.childLanes=im(i,w,o),l.memoizedState=tm,uo(null,d)):(us(l),rm(l,N))}var q=i.memoizedState;if(q!==null&&(N=q.dehydrated,N!==null)){if(y)l.flags&256?(us(l),l.flags&=-257,l=sm(i,l,o)):l.memoizedState!==null?(ds(),l.child=i.child,l.flags|=128,l=null):(ds(),N=d.fallback,m=l.mode,d=Tu({mode:"visible",children:d.children},m),N=Vs(N,m,o,null),N.flags|=2,d.return=l,N.return=l,d.sibling=N,l.child=d,Qs(l,i.child,null,o),d=l.child,d.memoizedState=nm(o),d.childLanes=im(i,w,o),l.memoizedState=tm,l=uo(null,d));else if(us(l),zm(N)){if(w=N.nextSibling&&N.nextSibling.dataset,w)var ie=w.dgst;w=ie,d=Error(r(419)),d.stack="",d.digest=w,Wa({value:d,source:null,stack:null}),l=sm(i,l,o)}else if(Jt||ql(i,l,o,!1),w=(o&i.childLanes)!==0,Jt||w){if(w=jt,w!==null&&(d=We(w,o),d!==0&&d!==q.retryLane))throw q.retryLane=d,Fs(i,d),Gn(w,i,d),Zp;qm(N)||Bu(),l=sm(i,l,o)}else qm(N)?(l.flags|=192,l.child=i.child,l=null):(i=q.treeContext,Ot=ji(N.nextSibling),yn=l,ft=!0,rs=null,Ni=!1,i!==null&&V1(l,i),l=rm(l,d.children),l.flags|=4096);return l}return m?(ds(),N=d.fallback,m=l.mode,q=i.child,ie=q.sibling,d=yr(q,{mode:"hidden",children:d.children}),d.subtreeFlags=q.subtreeFlags&65011712,ie!==null?N=yr(ie,N):(N=Vs(N,m,o,null),N.flags|=2),N.return=l,d.return=l,d.sibling=N,l.child=d,uo(null,d),d=l.child,N=i.child.memoizedState,N===null?N=nm(o):(m=N.cachePool,m!==null?(q=Gt._currentValue,m=m.parent!==q?{parent:q,pool:q}:m):m=J1(),N={baseLanes:N.baseLanes|o,cachePool:m}),d.memoizedState=N,d.childLanes=im(i,w,o),l.memoizedState=tm,uo(i.child,d)):(us(l),o=i.child,i=o.sibling,o=yr(o,{mode:"visible",children:d.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 rm(i,l){return l=Tu({mode:"visible",children:l},i.mode),l.return=i,i.child=l}function Tu(i,l){return i=ni(22,i,null,l),i.lanes=0,i}function sm(i,l,o){return Qs(l,i.child,null,o),i=rm(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function cS(i,l,o){i.lanes|=l;var d=i.alternate;d!==null&&(d.lanes|=l),vp(i.return,l,o)}function lm(i,l,o,d,m,y){var w=i.memoizedState;w===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:d,tail:o,tailMode:m,treeForkCount:y}:(w.isBackwards=l,w.rendering=null,w.renderingStartTime=0,w.last=d,w.tail=o,w.tailMode=m,w.treeForkCount=y)}function uS(i,l,o){var d=l.pendingProps,m=d.revealOrder,y=d.tail;d=d.children;var w=Vt.current,N=(w&2)!==0;if(N?(w=w&1|2,l.flags|=128):w&=1,ue(Vt,w),xn(i,l,d,o),d=ft?Qa:0,!N&&i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&cS(i,o,l);else if(i.tag===19)cS(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),lm(l,!1,m,o,y,d);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}lm(l,!0,o,null,y,d);break;case"together":lm(l,!1,null,null,void 0,d);break;default:l.memoizedState=null}return l.child}function Ar(i,l,o){if(i!==null&&(l.dependencies=i.dependencies),ps|=l.lanes,(o&l.childLanes)===0)if(i!==null){if(ql(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=yr(i,i.pendingProps),l.child=o,o.return=l;i.sibling!==null;)i=i.sibling,o=o.sibling=yr(i,i.pendingProps),o.return=l;o.sibling=null}return l.child}function am(i,l){return(i.lanes&l)!==0?!0:(i=i.dependencies,!!(i!==null&&au(i)))}function HM(i,l,o){switch(l.tag){case 3:Je(l,l.stateNode.containerInfo),ls(l,Gt,i.memoizedState.cache),Ps();break;case 27:case 5:Le(l);break;case 4:Je(l,l.stateNode.containerInfo);break;case 10:ls(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Rp(l),null;break;case 13:var d=l.memoizedState;if(d!==null)return d.dehydrated!==null?(us(l),l.flags|=128,null):(o&l.child.childLanes)!==0?oS(i,l,o):(us(l),i=Ar(i,l,o),i!==null?i.sibling:null);us(l);break;case 19:var m=(i.flags&128)!==0;if(d=(o&l.childLanes)!==0,d||(ql(i,l,o,!1),d=(o&l.childLanes)!==0),m){if(d)return uS(i,l,o);l.flags|=128}if(m=l.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),ue(Vt,Vt.current),d)break;return null;case 22:return l.lanes=0,nS(i,l,o,l.pendingProps);case 24:ls(l,Gt,i.memoizedState.cache)}return Ar(i,l,o)}function dS(i,l,o){if(i!==null)if(i.memoizedProps!==l.pendingProps)Jt=!0;else{if(!am(i,o)&&(l.flags&128)===0)return Jt=!1,HM(i,l,o);Jt=(i.flags&131072)!==0}else Jt=!1,ft&&(l.flags&1048576)!==0&&F1(l,Qa,l.index);switch(l.lanes=0,l.tag){case 16:e:{var d=l.pendingProps;if(i=Xs(l.elementType),l.type=i,typeof i=="function")fp(i)?(d=Zs(i,d),l.tag=1,l=lS(null,l,i,d,o)):(l.tag=0,l=em(null,l,i,d,o));else{if(i!=null){var m=i.$$typeof;if(m===O){l.tag=11,l=Zw(null,l,i,d,o);break e}else if(m===M){l.tag=14,l=eS(null,l,i,d,o);break e}}throw l=ye(i)||i,Error(r(306,l,""))}}return l;case 0:return em(i,l,l.type,l.pendingProps,o);case 1:return d=l.type,m=Zs(d,l.pendingProps),lS(i,l,d,m,o);case 3:e:{if(Je(l,l.stateNode.containerInfo),i===null)throw Error(r(387));d=l.pendingProps;var y=l.memoizedState;m=y.element,Tp(i,l),so(l,d,null,o);var w=l.memoizedState;if(d=w.cache,ls(l,Gt,d),d!==y.cache&&wp(l,[Gt],o,!0),ro(),d=w.element,y.isDehydrated)if(y={element:d,isDehydrated:!1,cache:w.cache},l.updateQueue.baseState=y,l.memoizedState=y,l.flags&256){l=aS(i,l,d,o);break e}else if(d!==m){m=Ai(Error(r(424)),l),Wa(m),l=aS(i,l,d,o);break e}else for(i=l.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,Ot=ji(i.firstChild),yn=l,ft=!0,rs=null,Ni=!0,o=nw(l,null,d,o),l.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Ps(),d===m){l=Ar(i,l,o);break e}xn(i,l,d,o)}l=l.child}return l;case 26:return Nu(i,l),i===null?(o=S2(l.type,null,l.pendingProps,null))?l.memoizedState=o:ft||(o=l.type,i=l.pendingProps,d=Fu(Re.current).createElement(o),d[_t]=l,d[Ut]=i,vn(d,o,i),Ft(d),l.stateNode=d):l.memoizedState=S2(l.type,i.memoizedProps,l.pendingProps,i.memoizedState),null;case 27:return Le(l),i===null&&ft&&(d=l.stateNode=x2(l.type,l.pendingProps,Re.current),yn=l,Ni=!0,m=Ot,xs(l.type)?(Hm=m,Ot=ji(d.firstChild)):Ot=m),xn(i,l,l.pendingProps.children,o),Nu(i,l),i===null&&(l.flags|=4194304),l.child;case 5:return i===null&&ft&&((m=d=Ot)&&(d=gR(d,l.type,l.pendingProps,Ni),d!==null?(l.stateNode=d,yn=l,Ot=ji(d.firstChild),Ni=!1,m=!0):m=!1),m||ss(l)),Le(l),m=l.type,y=l.pendingProps,w=i!==null?i.memoizedProps:null,d=y.children,Lm(m,y)?d=null:w!==null&&Lm(m,w)&&(l.flags|=32),l.memoizedState!==null&&(m=_p(i,l,MM,null,null,o),No._currentValue=m),Nu(i,l),xn(i,l,d,o),l.child;case 6:return i===null&&ft&&((i=o=Ot)&&(o=yR(o,l.pendingProps,Ni),o!==null?(l.stateNode=o,yn=l,Ot=null,i=!0):i=!1),i||ss(l)),null;case 13:return oS(i,l,o);case 4:return Je(l,l.stateNode.containerInfo),d=l.pendingProps,i===null?l.child=Qs(l,null,d,o):xn(i,l,d,o),l.child;case 11:return Zw(i,l,l.type,l.pendingProps,o);case 7:return xn(i,l,l.pendingProps,o),l.child;case 8:return xn(i,l,l.pendingProps.children,o),l.child;case 12:return xn(i,l,l.pendingProps.children,o),l.child;case 10:return d=l.pendingProps,ls(l,l.type,d.value),xn(i,l,d.children,o),l.child;case 9:return m=l.type._context,d=l.pendingProps.children,Ys(l),m=bn(m),d=d(m),l.flags|=1,xn(i,l,d,o),l.child;case 14:return eS(i,l,l.type,l.pendingProps,o);case 15:return tS(i,l,l.type,l.pendingProps,o);case 19:return uS(i,l,o);case 31:return zM(i,l,o);case 22:return nS(i,l,o,l.pendingProps);case 24:return Ys(l),d=bn(Gt),i===null?(m=kp(),m===null&&(m=jt,y=Sp(),m.pooledCache=y,y.refCount++,y!==null&&(m.pooledCacheLanes|=o),m=y),l.memoizedState={parent:d,cache:m},Np(l),ls(l,Gt,m)):((i.lanes&o)!==0&&(Tp(i,l),so(l,null,null,o),ro()),m=i.memoizedState,y=l.memoizedState,m.parent!==d?(m={parent:d,cache:d},l.memoizedState=m,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=m),ls(l,Gt,d)):(d=y.cache,ls(l,Gt,d),d!==m.cache&&wp(l,[Gt],o,!0))),xn(i,l,l.pendingProps.children,o),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function kr(i){i.flags|=4}function om(i,l,o,d,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(qS())i.flags|=8192;else throw Js=du,Cp}else i.flags&=-16777217}function fS(i,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!T2(l))if(qS())i.flags|=8192;else throw Js=du,Cp}function ju(i,l){l!==null&&(i.flags|=4),i.flags&16384&&(l=i.tag!==22?Dn():536870912,i.lanes|=l,Jl|=l)}function fo(i,l){if(!ft)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 d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:d.sibling=null}}function Mt(i){var l=i.alternate!==null&&i.alternate.child===i.child,o=0,d=0;if(l)for(var m=i.child;m!==null;)o|=m.lanes|m.childLanes,d|=m.subtreeFlags&65011712,d|=m.flags&65011712,m.return=i,m=m.sibling;else for(m=i.child;m!==null;)o|=m.lanes|m.childLanes,d|=m.subtreeFlags,d|=m.flags,m.return=i,m=m.sibling;return i.subtreeFlags|=d,i.childLanes=o,l}function IM(i,l,o){var d=l.pendingProps;switch(gp(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,d=null,i!==null&&(d=i.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),vr(Gt),Fe(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&($l(l)?kr(l):i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,bp())),Mt(l),null;case 26:var m=l.type,y=l.memoizedState;return i===null?(kr(l),y!==null?(Mt(l),fS(l,y)):(Mt(l),om(l,m,null,d,o))):y?y!==i.memoizedState?(kr(l),Mt(l),fS(l,y)):(Mt(l),l.flags&=-16777217):(i=i.memoizedProps,i!==d&&kr(l),Mt(l),om(l,m,i,d,o)),null;case 27:if(dt(l),o=Re.current,m=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==d&&kr(l);else{if(!d){if(l.stateNode===null)throw Error(r(166));return Mt(l),null}i=ve.current,$l(l)?P1(l):(i=x2(m,d,o),l.stateNode=i,kr(l))}return Mt(l),null;case 5:if(dt(l),m=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==d&&kr(l);else{if(!d){if(l.stateNode===null)throw Error(r(166));return Mt(l),null}if(y=ve.current,$l(l))P1(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 d.is=="string"?w.createElement("select",{is:d.is}):w.createElement("select"),d.multiple?y.multiple=!0:d.size&&(y.size=d.size);break;default:y=typeof d.is=="string"?w.createElement(m,{is:d.is}):w.createElement(m)}}y[_t]=l,y[Ut]=d;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(vn(y,m,d),m){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&kr(l)}}return Mt(l),om(l,l.type,i===null?null:i.memoizedProps,l.pendingProps,o),null;case 6:if(i&&l.stateNode!=null)i.memoizedProps!==d&&kr(l);else{if(typeof d!="string"&&l.stateNode===null)throw Error(r(166));if(i=Re.current,$l(l)){if(i=l.stateNode,o=l.memoizedProps,d=null,m=yn,m!==null)switch(m.tag){case 27:case 5:d=m.memoizedProps}i[_t]=l,i=!!(i.nodeValue===o||d!==null&&d.suppressHydrationWarning===!0||o2(i.nodeValue,o)),i||ss(l,!0)}else i=Fu(i).createTextNode(d),i[_t]=l,l.stateNode=i}return Mt(l),null;case 31:if(o=l.memoizedState,i===null||i.memoizedState!==null){if(d=$l(l),o!==null){if(i===null){if(!d)throw Error(r(318));if(i=l.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[_t]=l}else Ps(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Mt(l),i=!1}else o=bp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=o),i=!0;if(!i)return l.flags&256?(ri(l),l):(ri(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Mt(l),null;case 13:if(d=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(m=$l(l),d!==null&&d.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 Ps(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Mt(l),m=!1}else m=bp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=m),m=!0;if(!m)return l.flags&256?(ri(l),l):(ri(l),null)}return ri(l),(l.flags&128)!==0?(l.lanes=o,l):(o=d!==null,i=i!==null&&i.memoizedState!==null,o&&(d=l.child,m=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(m=d.alternate.memoizedState.cachePool.pool),y=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==m&&(d.flags|=2048)),o!==i&&o&&(l.child.flags|=8192),ju(l,l.updateQueue),Mt(l),null);case 4:return Fe(),i===null&&Om(l.stateNode.containerInfo),Mt(l),null;case 10:return vr(l.type),Mt(l),null;case 19:if(V(Vt),d=l.memoizedState,d===null)return Mt(l),null;if(m=(l.flags&128)!==0,y=d.rendering,y===null)if(m)fo(d,!1);else{if(qt!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(y=mu(i),y!==null){for(l.flags|=128,fo(d,!1),i=y.updateQueue,l.updateQueue=i,ju(l,i),l.subtreeFlags=0,i=o,o=l.child;o!==null;)H1(o,i),o=o.sibling;return ue(Vt,Vt.current&1|2),ft&&br(l,d.treeForkCount),l.child}i=i.sibling}d.tail!==null&&ot()>Du&&(l.flags|=128,m=!0,fo(d,!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),fo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!y.alternate&&!ft)return Mt(l),null}else 2*ot()-d.renderingStartTime>Du&&o!==536870912&&(l.flags|=128,m=!0,fo(d,!1),l.lanes=4194304);d.isBackwards?(y.sibling=l.child,l.child=y):(i=d.last,i!==null?i.sibling=y:l.child=y,d.last=y)}return d.tail!==null?(i=d.tail,d.rendering=i,d.tail=i.sibling,d.renderingStartTime=ot(),i.sibling=null,o=Vt.current,ue(Vt,m?o&1|2:o&1),ft&&br(l,d.treeForkCount),i):(Mt(l),null);case 22:case 23:return ri(l),Mp(),d=l.memoizedState!==null,i!==null?i.memoizedState!==null!==d&&(l.flags|=8192):d&&(l.flags|=8192),d?(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),d=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),d!==o&&(l.flags|=2048),i!==null&&V(Gs),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),l.memoizedState.cache!==o&&(l.flags|=2048),vr(Gt),Mt(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function UM(i,l){switch(gp(l),l.tag){case 1:return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return vr(Gt),Fe(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 26:case 27:case 5:return dt(l),null;case 31:if(l.memoizedState!==null){if(ri(l),l.alternate===null)throw Error(r(340));Ps()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 13:if(ri(l),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Ps()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return V(Vt),null;case 4:return Fe(),null;case 10:return vr(l.type),null;case 22:case 23:return ri(l),Mp(),i!==null&&V(Gs),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 24:return vr(Gt),null;case 25:return null;default:return null}}function hS(i,l){switch(gp(l),l.tag){case 3:vr(Gt),Fe();break;case 26:case 27:case 5:dt(l);break;case 4:Fe();break;case 31:l.memoizedState!==null&&ri(l);break;case 13:ri(l);break;case 19:V(Vt);break;case 10:vr(l.type);break;case 22:case 23:ri(l),Mp(),i!==null&&V(Gs);break;case 24:vr(Gt)}}function ho(i,l){try{var o=l.updateQueue,d=o!==null?o.lastEffect:null;if(d!==null){var m=d.next;o=m;do{if((o.tag&i)===i){d=void 0;var y=o.create,w=o.inst;d=y(),w.destroy=d}o=o.next}while(o!==m)}}catch(N){St(l,l.return,N)}}function fs(i,l,o){try{var d=l.updateQueue,m=d!==null?d.lastEffect:null;if(m!==null){var y=m.next;d=y;do{if((d.tag&i)===i){var w=d.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,m=l;var q=o,ie=N;try{ie()}catch(pe){St(m,q,pe)}}}d=d.next}while(d!==y)}}catch(pe){St(l,l.return,pe)}}function pS(i){var l=i.updateQueue;if(l!==null){var o=i.stateNode;try{rw(l,o)}catch(d){St(i,i.return,d)}}}function mS(i,l,o){o.props=Zs(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(d){St(i,l,d)}}function po(i,l){try{var o=i.ref;if(o!==null){switch(i.tag){case 26:case 27:case 5:var d=i.stateNode;break;case 30:d=i.stateNode;break;default:d=i.stateNode}typeof o=="function"?i.refCleanup=o(d):o.current=d}}catch(m){St(i,l,m)}}function tr(i,l){var o=i.ref,d=i.refCleanup;if(o!==null)if(typeof d=="function")try{d()}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 gS(i){var l=i.type,o=i.memoizedProps,d=i.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":o.autoFocus&&d.focus();break e;case"img":o.src?d.src=o.src:o.srcSet&&(d.srcset=o.srcSet)}}catch(m){St(i,i.return,m)}}function cm(i,l,o){try{var d=i.stateNode;uR(d,i.type,o,l),d[Ut]=l}catch(m){St(i,i.return,m)}}function yS(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&xs(i.type)||i.tag===4}function um(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||yS(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&&xs(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 dm(i,l,o){var d=i.tag;if(d===5||d===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=mr));else if(d!==4&&(d===27&&xs(i.type)&&(o=i.stateNode,l=null),i=i.child,i!==null))for(dm(i,l,o),i=i.sibling;i!==null;)dm(i,l,o),i=i.sibling}function Eu(i,l,o){var d=i.tag;if(d===5||d===6)i=i.stateNode,l?o.insertBefore(i,l):o.appendChild(i);else if(d!==4&&(d===27&&xs(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 bS(i){var l=i.stateNode,o=i.memoizedProps;try{for(var d=i.type,m=l.attributes;m.length;)l.removeAttributeNode(m[0]);vn(l,d,o),l[_t]=i,l[Ut]=o}catch(y){St(i,i.return,y)}}var Cr=!1,Qt=!1,fm=!1,xS=typeof WeakSet=="function"?WeakSet:Set,an=null;function FM(i,l){if(i=i.containerInfo,Dm=Ju,i=M1(i),sp(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var d=o.getSelection&&o.getSelection();if(d&&d.rangeCount!==0){o=d.anchorNode;var m=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var w=0,N=-1,q=-1,ie=0,pe=0,we=i,re=null;t:for(;;){for(var ce;we!==o||m!==0&&we.nodeType!==3||(N=w+m),we!==y||d!==0&&we.nodeType!==3||(q=w+d),we.nodeType===3&&(w+=we.nodeValue.length),(ce=we.firstChild)!==null;)re=we,we=ce;for(;;){if(we===i)break t;if(re===o&&++ie===m&&(N=w),re===y&&++pe===d&&(q=w),(ce=we.nextSibling)!==null)break;we=re,re=we.parentNode}we=ce}o=N===-1||q===-1?null:{start:N,end:q}}else o=null}o=o||{start:0,end:0}}else o=null;for(_m={focusedElem:i,selectionRange:o},Ju=!1,an=l;an!==null;)if(l=an,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,an=i;else for(;an!==null;){switch(l=an,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,d=o.stateNode;try{var _e=Zs(o.type,m);i=d.getSnapshotBeforeUpdate(_e,y),d.__reactInternalSnapshotBeforeUpdate=i}catch(Pe){St(o,o.return,Pe)}}break;case 3:if((i&1024)!==0){if(i=l.stateNode.containerInfo,o=i.nodeType,o===9)$m(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":$m(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,an=i;break}an=l.return}}function vS(i,l,o){var d=o.flags;switch(o.tag){case 0:case 11:case 15:Tr(i,o),d&4&&ho(5,o);break;case 1:if(Tr(i,o),d&4)if(i=o.stateNode,l===null)try{i.componentDidMount()}catch(w){St(o,o.return,w)}else{var m=Zs(o.type,l.memoizedProps);l=l.memoizedState;try{i.componentDidUpdate(m,l,i.__reactInternalSnapshotBeforeUpdate)}catch(w){St(o,o.return,w)}}d&64&&pS(o),d&512&&po(o,o.return);break;case 3:if(Tr(i,o),d&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{rw(i,l)}catch(w){St(o,o.return,w)}}break;case 27:l===null&&d&4&&bS(o);case 26:case 5:Tr(i,o),l===null&&d&4&&gS(o),d&512&&po(o,o.return);break;case 12:Tr(i,o);break;case 31:Tr(i,o),d&4&&AS(i,o);break;case 13:Tr(i,o),d&4&&kS(i,o),d&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=WM.bind(null,o),bR(i,o))));break;case 22:if(d=o.memoizedState!==null||Cr,!d){l=l!==null&&l.memoizedState!==null||Qt,m=Cr;var y=Qt;Cr=d,(Qt=l)&&!y?jr(i,o,(o.subtreeFlags&8772)!==0):Tr(i,o),Cr=m,Qt=y}break;case 30:break;default:Tr(i,o)}}function wS(i){var l=i.alternate;l!==null&&(i.alternate=null,wS(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&kl(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,Vn=!1;function Nr(i,l,o){for(o=o.child;o!==null;)SS(i,l,o),o=o.sibling}function SS(i,l,o){if(k&&typeof k.onCommitFiberUnmount=="function")try{k.onCommitFiberUnmount(Q,o)}catch{}switch(o.tag){case 26:Qt||tr(o,l),Nr(i,l,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Qt||tr(o,l);var d=Dt,m=Vn;xs(o.type)&&(Dt=o.stateNode,Vn=!1),Nr(i,l,o),Ao(o.stateNode),Dt=d,Vn=m;break;case 5:Qt||tr(o,l);case 6:if(d=Dt,m=Vn,Dt=null,Nr(i,l,o),Dt=d,Vn=m,Dt!==null)if(Vn)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&&(Vn?(i=Dt,p2(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),ra(i)):p2(Dt,o.stateNode));break;case 4:d=Dt,m=Vn,Dt=o.stateNode.containerInfo,Vn=!0,Nr(i,l,o),Dt=d,Vn=m;break;case 0:case 11:case 14:case 15:fs(2,o,l),Qt||fs(4,o,l),Nr(i,l,o);break;case 1:Qt||(tr(o,l),d=o.stateNode,typeof d.componentWillUnmount=="function"&&mS(o,l,d)),Nr(i,l,o);break;case 21:Nr(i,l,o);break;case 22:Qt=(d=Qt)||o.memoizedState!==null,Nr(i,l,o),Qt=d;break;default:Nr(i,l,o)}}function AS(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{ra(i)}catch(o){St(l,l.return,o)}}}function kS(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{ra(i)}catch(o){St(l,l.return,o)}}function VM(i){switch(i.tag){case 31:case 13:case 19:var l=i.stateNode;return l===null&&(l=i.stateNode=new xS),l;case 22:return i=i.stateNode,l=i._retryCache,l===null&&(l=i._retryCache=new xS),l;default:throw Error(r(435,i.tag))}}function Ou(i,l){var o=VM(i);l.forEach(function(d){if(!o.has(d)){o.add(d);var m=ZM.bind(null,i,d);d.then(m,m)}})}function Pn(i,l){var o=l.deletions;if(o!==null)for(var d=0;d<o.length;d++){var m=o[d],y=i,w=l,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(xs(N.type)){Dt=N.stateNode,Vn=!1;break e}break;case 5:Dt=N.stateNode,Vn=!1;break e;case 3:case 4:Dt=N.stateNode.containerInfo,Vn=!0;break e}N=N.return}if(Dt===null)throw Error(r(160));SS(y,w,m),Dt=null,Vn=!1,y=m.alternate,y!==null&&(y.return=null),m.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)CS(l,i),l=l.sibling}var qi=null;function CS(i,l){var o=i.alternate,d=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Pn(l,i),Kn(i),d&4&&(fs(3,i,i.return),ho(3,i),fs(5,i,i.return));break;case 1:Pn(l,i),Kn(i),d&512&&(Qt||o===null||tr(o,o.return)),d&64&&Cr&&(i=i.updateQueue,i!==null&&(d=i.callbacks,d!==null&&(o=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=o===null?d:o.concat(d))));break;case 26:var m=qi;if(Pn(l,i),Kn(i),d&512&&(Qt||o===null||tr(o,o.return)),d&4){var y=o!==null?o.memoizedState:null;if(d=i.memoizedState,o===null)if(d===null)if(i.stateNode===null){e:{d=i.type,o=i.memoizedProps,m=m.ownerDocument||m;t:switch(d){case"title":y=m.getElementsByTagName("title")[0],(!y||y[Wi]||y[_t]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=m.createElement(d),m.head.insertBefore(y,m.querySelector("head > title"))),vn(y,d,o),y[_t]=i,Ft(y),d=y;break e;case"link":var w=C2("link","href",m).get(d+(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(d),vn(y,d,o),m.head.appendChild(y);break;case"meta":if(w=C2("meta","content",m).get(d+(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(d),vn(y,d,o),m.head.appendChild(y);break;default:throw Error(r(468,d))}y[_t]=i,Ft(y),d=y}i.stateNode=d}else N2(m,i.type,i.stateNode);else i.stateNode=k2(m,d,i.memoizedProps);else y!==d?(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,d===null?N2(m,i.type,i.stateNode):k2(m,d,i.memoizedProps)):d===null&&i.stateNode!==null&&cm(i,i.memoizedProps,o.memoizedProps)}break;case 27:Pn(l,i),Kn(i),d&512&&(Qt||o===null||tr(o,o.return)),o!==null&&d&4&&cm(i,i.memoizedProps,o.memoizedProps);break;case 5:if(Pn(l,i),Kn(i),d&512&&(Qt||o===null||tr(o,o.return)),i.flags&32){m=i.stateNode;try{Tl(m,"")}catch(_e){St(i,i.return,_e)}}d&4&&i.stateNode!=null&&(m=i.memoizedProps,cm(i,m,o!==null?o.memoizedProps:m)),d&1024&&(fm=!0);break;case 6:if(Pn(l,i),Kn(i),d&4){if(i.stateNode===null)throw Error(r(162));d=i.memoizedProps,o=i.stateNode;try{o.nodeValue=d}catch(_e){St(i,i.return,_e)}}break;case 3:if(Ku=null,m=qi,qi=Vu(l.containerInfo),Pn(l,i),qi=m,Kn(i),d&4&&o!==null&&o.memoizedState.isDehydrated)try{ra(l.containerInfo)}catch(_e){St(i,i.return,_e)}fm&&(fm=!1,NS(i));break;case 4:d=qi,qi=Vu(i.stateNode.containerInfo),Pn(l,i),Kn(i),qi=d;break;case 12:Pn(l,i),Kn(i);break;case 31:Pn(l,i),Kn(i),d&4&&(d=i.updateQueue,d!==null&&(i.updateQueue=null,Ou(i,d)));break;case 13:Pn(l,i),Kn(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Ru=ot()),d&4&&(d=i.updateQueue,d!==null&&(i.updateQueue=null,Ou(i,d)));break;case 22:m=i.memoizedState!==null;var q=o!==null&&o.memoizedState!==null,ie=Cr,pe=Qt;if(Cr=ie||m,Qt=pe||q,Pn(l,i),Qt=pe,Cr=ie,Kn(i),d&8192)e:for(l=i.stateNode,l._visibility=m?l._visibility&-2:l._visibility|1,m&&(o===null||q||Cr||Qt||el(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 we=q.memoizedProps.style,re=we!=null&&we.hasOwnProperty("display")?we.display:null;N.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(_e){St(q,q.return,_e)}}}else if(l.tag===6){if(o===null){q=l;try{q.stateNode.nodeValue=m?"":q.memoizedProps}catch(_e){St(q,q.return,_e)}}}else if(l.tag===18){if(o===null){q=l;try{var ce=q.stateNode;m?m2(ce,!0):m2(q.stateNode,!1)}catch(_e){St(q,q.return,_e)}}}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}d&4&&(d=i.updateQueue,d!==null&&(o=d.retryQueue,o!==null&&(d.retryQueue=null,Ou(i,o))));break;case 19:Pn(l,i),Kn(i),d&4&&(d=i.updateQueue,d!==null&&(i.updateQueue=null,Ou(i,d)));break;case 30:break;case 21:break;default:Pn(l,i),Kn(i)}}function Kn(i){var l=i.flags;if(l&2){try{for(var o,d=i.return;d!==null;){if(yS(d)){o=d;break}d=d.return}if(o==null)throw Error(r(160));switch(o.tag){case 27:var m=o.stateNode,y=um(i);Eu(i,y,m);break;case 5:var w=o.stateNode;o.flags&32&&(Tl(w,""),o.flags&=-33);var N=um(i);Eu(i,N,w);break;case 3:case 4:var q=o.stateNode.containerInfo,ie=um(i);dm(i,ie,q);break;default:throw Error(r(161))}}catch(pe){St(i,i.return,pe)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function NS(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var l=i;NS(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),i=i.sibling}}function Tr(i,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)vS(i,l.alternate,l),l=l.sibling}function el(i){for(i=i.child;i!==null;){var l=i;switch(l.tag){case 0:case 11:case 14:case 15:fs(4,l,l.return),el(l);break;case 1:tr(l,l.return);var o=l.stateNode;typeof o.componentWillUnmount=="function"&&mS(l,l.return,o),el(l);break;case 27:Ao(l.stateNode);case 26:case 5:tr(l,l.return),el(l);break;case 22:l.memoizedState===null&&el(l);break;case 30:el(l);break;default:el(l)}i=i.sibling}}function jr(i,l,o){for(o=o&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var d=l.alternate,m=i,y=l,w=y.flags;switch(y.tag){case 0:case 11:case 15:jr(m,y,o),ho(4,y);break;case 1:if(jr(m,y,o),d=y,m=d.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ie){St(d,d.return,ie)}if(d=y,m=d.updateQueue,m!==null){var N=d.stateNode;try{var q=m.shared.hiddenCallbacks;if(q!==null)for(m.shared.hiddenCallbacks=null,m=0;m<q.length;m++)iw(q[m],N)}catch(ie){St(d,d.return,ie)}}o&&w&64&&pS(y),po(y,y.return);break;case 27:bS(y);case 26:case 5:jr(m,y,o),o&&d===null&&w&4&&gS(y),po(y,y.return);break;case 12:jr(m,y,o);break;case 31:jr(m,y,o),o&&w&4&&AS(m,y);break;case 13:jr(m,y,o),o&&w&4&&kS(m,y);break;case 22:y.memoizedState===null&&jr(m,y,o),po(y,y.return);break;case 30:break;default:jr(m,y,o)}l=l.sibling}}function hm(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&&Za(o))}function pm(i,l){i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Za(i))}function zi(i,l,o,d){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)TS(i,l,o,d),l=l.sibling}function TS(i,l,o,d){var m=l.flags;switch(l.tag){case 0:case 11:case 15:zi(i,l,o,d),m&2048&&ho(9,l);break;case 1:zi(i,l,o,d);break;case 3:zi(i,l,o,d),m&2048&&(i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Za(i)));break;case 12:if(m&2048){zi(i,l,o,d),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 zi(i,l,o,d);break;case 31:zi(i,l,o,d);break;case 13:zi(i,l,o,d);break;case 23:break;case 22:y=l.stateNode,w=l.alternate,l.memoizedState!==null?y._visibility&2?zi(i,l,o,d):mo(i,l):y._visibility&2?zi(i,l,o,d):(y._visibility|=2,Yl(i,l,o,d,(l.subtreeFlags&10256)!==0||!1)),m&2048&&hm(w,l);break;case 24:zi(i,l,o,d),m&2048&&pm(l.alternate,l);break;default:zi(i,l,o,d)}}function Yl(i,l,o,d,m){for(m=m&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var y=i,w=l,N=o,q=d,ie=w.flags;switch(w.tag){case 0:case 11:case 15:Yl(y,w,N,q,m),ho(8,w);break;case 23:break;case 22:var pe=w.stateNode;w.memoizedState!==null?pe._visibility&2?Yl(y,w,N,q,m):mo(y,w):(pe._visibility|=2,Yl(y,w,N,q,m)),m&&ie&2048&&hm(w.alternate,w);break;case 24:Yl(y,w,N,q,m),m&&ie&2048&&pm(w.alternate,w);break;default:Yl(y,w,N,q,m)}l=l.sibling}}function mo(i,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var o=i,d=l,m=d.flags;switch(d.tag){case 22:mo(o,d),m&2048&&hm(d.alternate,d);break;case 24:mo(o,d),m&2048&&pm(d.alternate,d);break;default:mo(o,d)}l=l.sibling}}var go=8192;function Gl(i,l,o){if(i.subtreeFlags&go)for(i=i.child;i!==null;)jS(i,l,o),i=i.sibling}function jS(i,l,o){switch(i.tag){case 26:Gl(i,l,o),i.flags&go&&i.memoizedState!==null&&OR(o,qi,i.memoizedState,i.memoizedProps);break;case 5:Gl(i,l,o);break;case 3:case 4:var d=qi;qi=Vu(i.stateNode.containerInfo),Gl(i,l,o),qi=d;break;case 22:i.memoizedState===null&&(d=i.alternate,d!==null&&d.memoizedState!==null?(d=go,go=16777216,Gl(i,l,o),go=d):Gl(i,l,o));break;default:Gl(i,l,o)}}function ES(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 yo(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var o=0;o<l.length;o++){var d=l[o];an=d,MS(d,i)}ES(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)OS(i),i=i.sibling}function OS(i){switch(i.tag){case 0:case 11:case 15:yo(i),i.flags&2048&&fs(9,i,i.return);break;case 3:yo(i);break;case 12:yo(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)):yo(i);break;default:yo(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 d=l[o];an=d,MS(d,i)}ES(i)}for(i=i.child;i!==null;){switch(l=i,l.tag){case 0:case 11:case 15:fs(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 MS(i,l){for(;an!==null;){var o=an;switch(o.tag){case 0:case 11:case 15:fs(8,o,l);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var d=o.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Za(o.memoizedState.cache)}if(d=o.child,d!==null)d.return=o,an=d;else e:for(o=i;an!==null;){d=an;var m=d.sibling,y=d.return;if(wS(d),d===o){an=null;break e}if(m!==null){m.return=y,an=m;break e}an=y}}}var PM={getCacheForType:function(i){var l=bn(Gt),o=l.data.get(i);return o===void 0&&(o=i(),l.data.set(i,o)),o},cacheSignal:function(){return bn(Gt).controller.signal}},KM=typeof WeakMap=="function"?WeakMap:Map,xt=0,jt=null,lt=null,ct=0,wt=0,si=null,hs=!1,Xl=!1,mm=!1,Er=0,qt=0,ps=0,tl=0,gm=0,li=0,Jl=0,bo=null,Yn=null,ym=!1,Ru=0,RS=0,Du=1/0,_u=null,ms=null,tn=0,gs=null,Ql=null,Or=0,bm=0,xm=null,DS=null,xo=0,vm=null;function ai(){return(xt&2)!==0&&ct!==0?ct&-ct:_.T!==null?Nm():Bi()}function _S(){if(li===0)if((ct&536870912)===0||ft){var i=ke;ke<<=1,(ke&3932160)===0&&(ke=262144),li=i}else li=536870912;return i=ii.current,i!==null&&(i.flags|=32),li}function Gn(i,l,o){(i===jt&&(wt===2||wt===9)||i.cancelPendingCommit!==null)&&(Wl(i,0),ys(i,ct,li,!1)),Kt(i,o),((xt&2)===0||i!==jt)&&(i===jt&&((xt&2)===0&&(tl|=o),qt===4&&ys(i,ct,li,!1)),nr(i))}function LS(i,l,o){if((xt&6)!==0)throw Error(r(327));var d=!o&&(l&127)===0&&(l&i.expiredLanes)===0||ze(i,l),m=d?XM(i,l):Sm(i,l,!0),y=d;do{if(m===0){Xl&&!d&&ys(i,l,0,!1);break}else{if(o=i.current.alternate,y&&!YM(o)){m=Sm(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=bo;var q=N.current.memoizedState.isDehydrated;if(q&&(Wl(N,w).flags|=256),w=Sm(N,w,!1),w!==2){if(mm&&!q){N.errorRecoveryDisabledLanes|=y,tl|=y,m=4;break e}y=Yn,Yn=m,y!==null&&(Yn===null?Yn=y:Yn.push.apply(Yn,y))}m=w}if(y=!1,m!==2)continue}}if(m===1){Wl(i,0),ys(i,l,0,!0);break}e:{switch(d=i,y=m,y){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:ys(d,l,li,!hs);break e;case 2:Yn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(m=Ru+300-ot(),10<m)){if(ys(d,l,li,!hs),Be(d,0,!0)!==0)break e;Or=l,d.timeoutHandle=f2(BS.bind(null,d,o,Yn,_u,ym,l,li,tl,Jl,hs,y,"Throttled",-0,0),m);break e}BS(d,o,Yn,_u,ym,l,li,tl,Jl,hs,y,null,-0,0)}}break}while(!0);nr(i)}function BS(i,l,o,d,m,y,w,N,q,ie,pe,we,re,ce){if(i.timeoutHandle=-1,we=l.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:mr},jS(l,y,we);var _e=(y&62914560)===y?Ru-ot():(y&4194048)===y?RS-ot():0;if(_e=MR(we,_e),_e!==null){Or=y,i.cancelPendingCommit=_e(VS.bind(null,i,l,y,o,d,m,w,N,q,pe,we,null,re,ce)),ys(i,y,w,!ie);return}}VS(i,l,y,o,d,m,w,N,q)}function YM(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 d=0;d<o.length;d++){var m=o[d],y=m.getSnapshot;m=m.value;try{if(!ti(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 ys(i,l,o,d){l&=~gm,l&=~tl,i.suspendedLanes|=l,i.pingedLanes&=~l,d&&(i.warmLanes|=l),d=i.expirationTimes;for(var m=l;0<m;){var y=31-Z(m),w=1<<y;d[y]=-1,m&=~w}o!==0&&dr(i,o,l)}function Lu(){return(xt&6)===0?(vo(0),!1):!0}function wm(){if(lt!==null){if(wt===0)var i=lt.return;else i=lt,xr=Ks=null,$p(i),Ul=null,to=0,i=lt;for(;i!==null;)hS(i.alternate,i),i=i.return;lt=null}}function Wl(i,l){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,hR(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),Or=0,wm(),jt=i,lt=o=yr(i.current,null),ct=l,wt=0,si=null,hs=!1,Xl=ze(i,l),mm=!1,Jl=li=gm=tl=ps=qt=0,Yn=bo=null,ym=!1,(l&8)!==0&&(l|=l&32);var d=i.entangledLanes;if(d!==0)for(i=i.entanglements,d&=l;0<d;){var m=31-Z(d),y=1<<m;l|=i[m],d&=~y}return Er=l,nu(),o}function $S(i,l){tt=null,_.H=co,l===Il||l===uu?(l=Z1(),wt=3):l===Cp?(l=Z1(),wt=4):wt=l===Zp?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,si=l,lt===null&&(qt=1,ku(i,Ai(l,i.current)))}function qS(){var i=ii.current;return i===null?!0:(ct&4194048)===ct?Ti===null:(ct&62914560)===ct||(ct&536870912)!==0?i===Ti:!1}function zS(){var i=_.H;return _.H=co,i===null?co:i}function HS(){var i=_.A;return _.A=PM,i}function Bu(){qt=4,hs||(ct&4194048)!==ct&&ii.current!==null||(Xl=!0),(ps&134217727)===0&&(tl&134217727)===0||jt===null||ys(jt,ct,li,!1)}function Sm(i,l,o){var d=xt;xt|=2;var m=zS(),y=HS();(jt!==i||ct!==l)&&(_u=null,Wl(i,l)),l=!1;var w=qt;e:do try{if(wt!==0&<!==null){var N=lt,q=si;switch(wt){case 8:wm(),w=6;break e;case 3:case 2:case 9:case 6:ii.current===null&&(l=!0);var ie=wt;if(wt=0,si=null,Zl(i,N,q,ie),o&&Xl){w=0;break e}break;default:ie=wt,wt=0,si=null,Zl(i,N,q,ie)}}GM(),w=qt;break}catch(pe){$S(i,pe)}while(!0);return l&&i.shellSuspendCounter++,xr=Ks=null,xt=d,_.H=m,_.A=y,lt===null&&(jt=null,ct=0,nu()),w}function GM(){for(;lt!==null;)IS(lt)}function XM(i,l){var o=xt;xt|=2;var d=zS(),m=HS();jt!==i||ct!==l?(_u=null,Du=ot()+500,Wl(i,l)):Xl=ze(i,l);e:do try{if(wt!==0&<!==null){l=lt;var y=si;t:switch(wt){case 1:wt=0,si=null,Zl(i,l,y,1);break;case 2:case 9:if(Q1(y)){wt=0,si=null,US(l);break}l=function(){wt!==2&&wt!==9||jt!==i||(wt=7),nr(i)},y.then(l,l);break e;case 3:wt=7;break e;case 4:wt=5;break e;case 7:Q1(y)?(wt=0,si=null,US(l)):(wt=0,si=null,Zl(i,l,y,7));break;case 5:var w=null;switch(lt.tag){case 26:w=lt.memoizedState;case 5:case 27:var N=lt;if(w?T2(w):N.stateNode.complete){wt=0,si=null;var q=N.sibling;if(q!==null)lt=q;else{var ie=N.return;ie!==null?(lt=ie,$u(ie)):lt=null}break t}}wt=0,si=null,Zl(i,l,y,5);break;case 6:wt=0,si=null,Zl(i,l,y,6);break;case 8:wm(),qt=6;break e;default:throw Error(r(462))}}JM();break}catch(pe){$S(i,pe)}while(!0);return xr=Ks=null,_.H=d,_.A=m,xt=o,lt!==null?0:(jt=null,ct=0,nu(),qt)}function JM(){for(;lt!==null&&!Hn();)IS(lt)}function IS(i){var l=dS(i.alternate,i,Er);i.memoizedProps=i.pendingProps,l===null?$u(i):lt=l}function US(i){var l=i,o=l.alternate;switch(l.tag){case 15:case 0:l=sS(o,l,l.pendingProps,l.type,void 0,ct);break;case 11:l=sS(o,l,l.pendingProps,l.type.render,l.ref,ct);break;case 5:$p(l);default:hS(o,l),l=lt=H1(l,Er),l=dS(o,l,Er)}i.memoizedProps=i.pendingProps,l===null?$u(i):lt=l}function Zl(i,l,o,d){xr=Ks=null,$p(l),Ul=null,to=0;var m=l.return;try{if(qM(i,m,l,o,ct)){qt=1,ku(i,Ai(o,i.current)),lt=null;return}}catch(y){if(m!==null)throw lt=m,y;qt=1,ku(i,Ai(o,i.current)),lt=null;return}l.flags&32768?(ft||d===1?i=!0:Xl||(ct&536870912)!==0?i=!1:(hs=i=!0,(d===2||d===9||d===3||d===6)&&(d=ii.current,d!==null&&d.tag===13&&(d.flags|=16384))),FS(l,i)):$u(l)}function $u(i){var l=i;do{if((l.flags&32768)!==0){FS(l,hs);return}i=l.return;var o=IM(l.alternate,l,Er);if(o!==null){lt=o;return}if(l=l.sibling,l!==null){lt=l;return}lt=l=i}while(l!==null);qt===0&&(qt=5)}function FS(i,l){do{var o=UM(i.alternate,i);if(o!==null){o.flags&=32767,lt=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!l&&(i=i.sibling,i!==null)){lt=i;return}lt=i=o}while(i!==null);qt=6,lt=null}function VS(i,l,o,d,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|=up,Li(i,o,y,w,N,q),i===jt&&(lt=jt=null,ct=0),Ql=l,gs=i,Or=o,bm=y,xm=m,DS=d,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,eR(Tt,function(){return XS(),null})):(i.callbackNode=null,i.callbackPriority=0),d=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||d){d=_.T,_.T=null,m=ee.p,ee.p=2,w=xt,xt|=4;try{FM(i,l,o)}finally{xt=w,ee.p=m,_.T=d}}tn=1,PS(),KS(),YS()}}function PS(){if(tn===1){tn=0;var i=gs,l=Ql,o=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||o){o=_.T,_.T=null;var d=ee.p;ee.p=2;var m=xt;xt|=4;try{CS(l,i);var y=_m,w=M1(i.containerInfo),N=y.focusedElem,q=y.selectionRange;if(w!==N&&N&&N.ownerDocument&&O1(N.ownerDocument.documentElement,N)){if(q!==null&&sp(N)){var ie=q.start,pe=q.end;if(pe===void 0&&(pe=ie),"selectionStart"in N)N.selectionStart=ie,N.selectionEnd=Math.min(pe,N.value.length);else{var we=N.ownerDocument||document,re=we&&we.defaultView||window;if(re.getSelection){var ce=re.getSelection(),_e=N.textContent.length,Pe=Math.min(q.start,_e),Ct=q.end===void 0?Pe:Math.min(q.end,_e);!ce.extend&&Pe>Ct&&(w=Ct,Ct=Pe,Pe=w);var Y=E1(N,Pe),F=E1(N,Ct);if(Y&&F&&(ce.rangeCount!==1||ce.anchorNode!==Y.node||ce.anchorOffset!==Y.offset||ce.focusNode!==F.node||ce.focusOffset!==F.offset)){var te=we.createRange();te.setStart(Y.node,Y.offset),ce.removeAllRanges(),Pe>Ct?(ce.addRange(te),ce.extend(F.node,F.offset)):(te.setEnd(F.node,F.offset),ce.addRange(te))}}}}for(we=[],ce=N;ce=ce.parentNode;)ce.nodeType===1&&we.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<we.length;N++){var be=we[N];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}Ju=!!Dm,_m=Dm=null}finally{xt=m,ee.p=d,_.T=o}}i.current=l,tn=2}}function KS(){if(tn===2){tn=0;var i=gs,l=Ql,o=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||o){o=_.T,_.T=null;var d=ee.p;ee.p=2;var m=xt;xt|=4;try{vS(i,l.alternate,l)}finally{xt=m,ee.p=d,_.T=o}}tn=3}}function YS(){if(tn===4||tn===3){tn=0,gn();var i=gs,l=Ql,o=Or,d=DS;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?tn=5:(tn=0,Ql=gs=null,GS(i,i.pendingLanes));var m=i.pendingLanes;if(m===0&&(ms=null),yi(o),l=l.stateNode,k&&typeof k.onCommitFiberRoot=="function")try{k.onCommitFiberRoot(Q,l,void 0,(l.current.flags&128)===128)}catch{}if(d!==null){l=_.T,m=ee.p,ee.p=2,_.T=null;try{for(var y=i.onRecoverableError,w=0;w<d.length;w++){var N=d[w];y(N.value,{componentStack:N.stack})}}finally{_.T=l,ee.p=m}}(Or&3)!==0&&qu(),nr(i),m=i.pendingLanes,(o&261930)!==0&&(m&42)!==0?i===vm?xo++:(xo=0,vm=i):xo=0,vo(0)}}function GS(i,l){(i.pooledCacheLanes&=l)===0&&(l=i.pooledCache,l!=null&&(i.pooledCache=null,Za(l)))}function qu(){return PS(),KS(),YS(),XS()}function XS(){if(tn!==5)return!1;var i=gs,l=bm;bm=0;var o=yi(Or),d=_.T,m=ee.p;try{ee.p=32>o?32:o,_.T=null,o=xm,xm=null;var y=gs,w=Or;if(tn=0,Ql=gs=null,Or=0,(xt&6)!==0)throw Error(r(331));var N=xt;if(xt|=4,OS(y.current),TS(y,y.current,w,o),xt=N,vo(0,!1),k&&typeof k.onPostCommitFiberRoot=="function")try{k.onPostCommitFiberRoot(Q,y)}catch{}return!0}finally{ee.p=m,_.T=d,GS(i,l)}}function JS(i,l,o){l=Ai(o,l),l=Wp(i.stateNode,l,2),i=cs(i,l,2),i!==null&&(Kt(i,2),nr(i))}function St(i,l,o){if(i.tag===3)JS(i,i,o);else for(;l!==null;){if(l.tag===3){JS(l,i,o);break}else if(l.tag===1){var d=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(ms===null||!ms.has(d))){i=Ai(o,i),o=Qw(2),d=cs(l,o,2),d!==null&&(Ww(o,d,l,i),Kt(d,2),nr(d));break}}l=l.return}}function Am(i,l,o){var d=i.pingCache;if(d===null){d=i.pingCache=new KM;var m=new Set;d.set(l,m)}else m=d.get(l),m===void 0&&(m=new Set,d.set(l,m));m.has(o)||(mm=!0,m.add(o),i=QM.bind(null,i,l,o),l.then(i,i))}function QM(i,l,o){var d=i.pingCache;d!==null&&d.delete(l),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,jt===i&&(ct&o)===o&&(qt===4||qt===3&&(ct&62914560)===ct&&300>ot()-Ru?(xt&2)===0&&Wl(i,0):gm|=o,Jl===ct&&(Jl=0)),nr(i)}function QS(i,l){l===0&&(l=Dn()),i=Fs(i,l),i!==null&&(Kt(i,l),nr(i))}function WM(i){var l=i.memoizedState,o=0;l!==null&&(o=l.retryLane),QS(i,o)}function ZM(i,l){var o=0;switch(i.tag){case 31:case 13:var d=i.stateNode,m=i.memoizedState;m!==null&&(o=m.retryLane);break;case 19:d=i.stateNode;break;case 22:d=i.stateNode._retryCache;break;default:throw Error(r(314))}d!==null&&d.delete(l),QS(i,o)}function eR(i,l){return sn(i,l)}var zu=null,ea=null,km=!1,Hu=!1,Cm=!1,bs=0;function nr(i){i!==ea&&i.next===null&&(ea===null?zu=ea=i:ea=ea.next=i),Hu=!0,km||(km=!0,nR())}function vo(i,l){if(!Cm&&Hu){Cm=!0;do for(var o=!1,d=zu;d!==null;){if(i!==0){var m=d.pendingLanes;if(m===0)var y=0;else{var w=d.suspendedLanes,N=d.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,t2(d,y))}else y=ct,y=Be(d,d===jt?y:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(y&3)===0||ze(d,y)||(o=!0,t2(d,y));d=d.next}while(o);Cm=!1}}function tR(){WS()}function WS(){Hu=km=!1;var i=0;bs!==0&&fR()&&(i=bs);for(var l=ot(),o=null,d=zu;d!==null;){var m=d.next,y=ZS(d,l);y===0?(d.next=null,o===null?zu=m:o.next=m,m===null&&(ea=o)):(o=d,(i!==0||(y&3)!==0)&&(Hu=!0)),d=m}tn!==0&&tn!==5||vo(i),bs!==0&&(bs=0)}function ZS(i,l){for(var o=i.suspendedLanes,d=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&d)!==0)&&(m[w]=Ye(N,l)):q<=l&&(i.expiredLanes|=N),y&=~N}if(l=jt,o=ct,o=Be(i,i===l?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),d=i.callbackNode,o===0||i===l&&(wt===2||wt===9)||i.cancelPendingCommit!==null)return d!==null&&d!==null&&ln(d),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||ze(i,o)){if(l=o&-o,l===i.callbackPriority)return l;switch(d!==null&&ln(d),yi(o)){case 2:case 8:o=Zn;break;case 32:o=Tt;break;case 268435456:o=K;break;default:o=Tt}return d=e2.bind(null,i),o=sn(o,d),i.callbackPriority=l,i.callbackNode=o,l}return d!==null&&d!==null&&ln(d),i.callbackPriority=2,i.callbackNode=null,2}function e2(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 d=ct;return d=Be(i,i===jt?d:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),d===0?null:(LS(i,d,l),ZS(i,ot()),i.callbackNode!=null&&i.callbackNode===o?e2.bind(null,i):null)}function t2(i,l){if(qu())return null;LS(i,l,!0)}function nR(){pR(function(){(xt&6)!==0?sn(Rn,tR):WS()})}function Nm(){if(bs===0){var i=zl;i===0&&(i=oe,oe<<=1,(oe&261888)===0&&(oe=256)),bs=i}return bs}function n2(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Gc(""+i)}function i2(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 iR(i,l,o,d,m){if(l==="submit"&&o&&o.stateNode===m){var y=n2((m[Ut]||null).action),w=d.submitter;w&&(l=(l=w[Ut]||null)?n2(l.formAction):w.getAttribute("formAction"),l!==null&&(y=l,w=null));var N=new Wc("action","action",null,d,m);i.push({event:N,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(bs!==0){var q=w?i2(m,w):new FormData(m);Kp(o,{pending:!0,data:q,method:m.method,action:y},null,q)}}else typeof y=="function"&&(N.preventDefault(),q=w?i2(m,w):new FormData(m),Kp(o,{pending:!0,data:q,method:m.method,action:y},y,q))},currentTarget:m}]})}}for(var Tm=0;Tm<cp.length;Tm++){var jm=cp[Tm],rR=jm.toLowerCase(),sR=jm[0].toUpperCase()+jm.slice(1);$i(rR,"on"+sR)}$i(_1,"onAnimationEnd"),$i(L1,"onAnimationIteration"),$i(B1,"onAnimationStart"),$i("dblclick","onDoubleClick"),$i("focusin","onFocus"),$i("focusout","onBlur"),$i(wM,"onTransitionRun"),$i(SM,"onTransitionStart"),$i(AM,"onTransitionCancel"),$i($1,"onTransitionEnd"),Un("onMouseEnter",["mouseout","mouseover"]),Un("onMouseLeave",["mouseout","mouseover"]),Un("onPointerEnter",["pointerout","pointerover"]),Un("onPointerLeave",["pointerout","pointerover"]),Xe("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xe("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xe("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xe("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xe("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xe("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wo="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(" "),lR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wo));function r2(i,l){l=(l&4)!==0;for(var o=0;o<i.length;o++){var d=i[o],m=d.event;d=d.listeners;e:{var y=void 0;if(l)for(var w=d.length-1;0<=w;w--){var N=d[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(pe){tu(pe)}m.currentTarget=null,y=q}else for(w=0;w<d.length;w++){if(N=d[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(pe){tu(pe)}m.currentTarget=null,y=q}}}}function at(i,l){var o=l[fr];o===void 0&&(o=l[fr]=new Set);var d=i+"__bubble";o.has(d)||(s2(l,i,2,!1),o.add(d))}function Em(i,l,o){var d=0;l&&(d|=4),s2(o,i,d,l)}var Iu="_reactListening"+Math.random().toString(36).slice(2);function Om(i){if(!i[Iu]){i[Iu]=!0,I.forEach(function(o){o!=="selectionchange"&&(lR.has(o)||Em(o,!1,i),Em(o,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[Iu]||(l[Iu]=!0,Em("selectionchange",!1,l))}}function s2(i,l,o,d){switch(_2(l)){case 2:var m=_R;break;case 8:m=LR;break;default:m=Pm}o=m.bind(null,l,o,i),m=void 0,!Jh||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(m=!0),d?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 Mm(i,l,o,d,m){var y=d;if((l&1)===0&&(l&2)===0&&d!==null)e:for(;;){if(d===null)return;var w=d.tag;if(w===3||w===4){var N=d.stateNode.containerInfo;if(N===m)break;if(w===4)for(w=d.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=In(N),w===null)return;if(q=w.tag,q===5||q===6||q===26||q===27){d=y=w;continue e}N=N.parentNode}}d=d.return}u1(function(){var ie=y,pe=Gh(o),we=[];e:{var re=q1.get(i);if(re!==void 0){var ce=Wc,_e=i;switch(i){case"keypress":if(Jc(o)===0)break e;case"keydown":case"keyup":ce=Z3;break;case"focusin":_e="focus",ce=ep;break;case"focusout":_e="blur",ce=ep;break;case"beforeblur":case"afterblur":ce=ep;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=h1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=I3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=nM;break;case _1:case L1:case B1:ce=V3;break;case $1:ce=rM;break;case"scroll":case"scrollend":ce=z3;break;case"wheel":ce=lM;break;case"copy":case"cut":case"paste":ce=K3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=m1;break;case"toggle":case"beforetoggle":ce=oM}var Pe=(l&4)!==0,Ct=!Pe&&(i==="scroll"||i==="scrollend"),Y=Pe?re!==null?re+"Capture":null:re;Pe=[];for(var F=ie,te;F!==null;){var be=F;if(te=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||te===null||Y===null||(be=Ua(F,Y),be!=null&&Pe.push(So(F,be,te))),Ct)break;F=F.return}0<Pe.length&&(re=new ce(re,_e,null,o,pe),we.push({event:re,listeners:Pe}))}}if((l&7)===0){e:{if(re=i==="mouseover"||i==="pointerover",ce=i==="mouseout"||i==="pointerout",re&&o!==Yh&&(_e=o.relatedTarget||o.fromElement)&&(In(_e)||_e[bi]))break e;if((ce||re)&&(re=pe.window===pe?pe:(re=pe.ownerDocument)?re.defaultView||re.parentWindow:window,ce?(_e=o.relatedTarget||o.toElement,ce=ie,_e=_e?In(_e):null,_e!==null&&(Ct=a(_e),Pe=_e.tag,_e!==Ct||Pe!==5&&Pe!==27&&Pe!==6)&&(_e=null)):(ce=null,_e=ie),ce!==_e)){if(Pe=h1,be="onMouseLeave",Y="onMouseEnter",F="mouse",(i==="pointerout"||i==="pointerover")&&(Pe=m1,be="onPointerLeave",Y="onPointerEnter",F="pointer"),Ct=ce==null?re:qs(ce),te=_e==null?re:qs(_e),re=new Pe(be,F+"leave",ce,o,pe),re.target=Ct,re.relatedTarget=te,be=null,In(pe)===ie&&(Pe=new Pe(Y,F+"enter",_e,o,pe),Pe.target=te,Pe.relatedTarget=Ct,be=Pe),Ct=be,ce&&_e)t:{for(Pe=aR,Y=ce,F=_e,te=0,be=Y;be;be=Pe(be))te++;be=0;for(var Ue=F;Ue;Ue=Pe(Ue))be++;for(;0<te-be;)Y=Pe(Y),te--;for(;0<be-te;)F=Pe(F),be--;for(;te--;){if(Y===F||F!==null&&Y===F.alternate){Pe=Y;break t}Y=Pe(Y),F=Pe(F)}Pe=null}else Pe=null;ce!==null&&l2(we,re,ce,Pe,!1),_e!==null&&Ct!==null&&l2(we,Ct,_e,Pe,!0)}}e:{if(re=ie?qs(ie):window,ce=re.nodeName&&re.nodeName.toLowerCase(),ce==="select"||ce==="input"&&re.type==="file")var yt=A1;else if(w1(re))if(k1)yt=bM;else{yt=gM;var $e=mM}else ce=re.nodeName,!ce||ce.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?ie&&Kh(ie.elementType)&&(yt=A1):yt=yM;if(yt&&(yt=yt(i,ie))){S1(we,yt,o,pe);break e}$e&&$e(i,re,ie),i==="focusout"&&ie&&re.type==="number"&&ie.memoizedProps.value!=null&&Ph(re,"number",re.value)}switch($e=ie?qs(ie):window,i){case"focusin":(w1($e)||$e.contentEditable==="true")&&(Ml=$e,lp=ie,Ja=null);break;case"focusout":Ja=lp=Ml=null;break;case"mousedown":ap=!0;break;case"contextmenu":case"mouseup":case"dragend":ap=!1,R1(we,o,pe);break;case"selectionchange":if(vM)break;case"keydown":case"keyup":R1(we,o,pe)}var nt;if(np)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 Ol?x1(i,o)&&(ut="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(ut="onCompositionStart");ut&&(g1&&o.locale!=="ko"&&(Ol||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&Ol&&(nt=d1()):(ns=pe,Qh="value"in ns?ns.value:ns.textContent,Ol=!0)),$e=Uu(ie,ut),0<$e.length&&(ut=new p1(ut,i,null,o,pe),we.push({event:ut,listeners:$e}),nt?ut.data=nt:(nt=v1(o),nt!==null&&(ut.data=nt)))),(nt=uM?dM(i,o):fM(i,o))&&(ut=Uu(ie,"onBeforeInput"),0<ut.length&&($e=new p1("onBeforeInput","beforeinput",null,o,pe),we.push({event:$e,listeners:ut}),$e.data=nt)),iR(we,i,ie,o,pe)}r2(we,l)})}function So(i,l,o){return{instance:i,listener:l,currentTarget:o}}function Uu(i,l){for(var o=l+"Capture",d=[];i!==null;){var m=i,y=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||y===null||(m=Ua(i,o),m!=null&&d.unshift(So(i,m,y)),m=Ua(i,l),m!=null&&d.push(So(i,m,y))),i.tag===3)return d;i=i.return}return[]}function aR(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function l2(i,l,o,d,m){for(var y=l._reactName,w=[];o!==null&&o!==d;){var N=o,q=N.alternate,ie=N.stateNode;if(N=N.tag,q!==null&&q===d)break;N!==5&&N!==26&&N!==27||ie===null||(q=ie,m?(ie=Ua(o,y),ie!=null&&w.unshift(So(o,ie,q))):m||(ie=Ua(o,y),ie!=null&&w.push(So(o,ie,q)))),o=o.return}w.length!==0&&i.push({event:l,listeners:w})}var oR=/\r\n?/g,cR=/\u0000|\uFFFD/g;function a2(i){return(typeof i=="string"?i:""+i).replace(oR,`
|
|
9
|
+
`).replace(cR,"")}function o2(i,l){return l=a2(l),a2(i)===l}function kt(i,l,o,d,m,y){switch(o){case"children":typeof d=="string"?l==="body"||l==="textarea"&&d===""||Tl(i,d):(typeof d=="number"||typeof d=="bigint")&&l!=="body"&&Tl(i,""+d);break;case"className":Kc(i,"class",d);break;case"tabIndex":Kc(i,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Kc(i,o,d);break;case"style":o1(i,d,y);break;case"data":if(l!=="object"){Kc(i,"data",d);break}case"src":case"href":if(d===""&&(l!=="a"||o!=="href")){i.removeAttribute(o);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){i.removeAttribute(o);break}d=Gc(""+d),i.setAttribute(o,d);break;case"action":case"formAction":if(typeof d=="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(d==null||typeof d=="symbol"||typeof d=="boolean"){i.removeAttribute(o);break}d=Gc(""+d),i.setAttribute(o,d);break;case"onClick":d!=null&&(i.onclick=mr);break;case"onScroll":d!=null&&at("scroll",i);break;case"onScrollEnd":d!=null&&at("scrollend",i);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(o=d.__html,o!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"multiple":i.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":i.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){i.removeAttribute("xlink:href");break}o=Gc(""+d),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":d!=null&&typeof d!="function"&&typeof d!="symbol"?i.setAttribute(o,""+d):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":d&&typeof d!="function"&&typeof d!="symbol"?i.setAttribute(o,""):i.removeAttribute(o);break;case"capture":case"download":d===!0?i.setAttribute(o,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?i.setAttribute(o,d):i.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?i.setAttribute(o,d):i.removeAttribute(o);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?i.removeAttribute(o):i.setAttribute(o,d);break;case"popover":at("beforetoggle",i),at("toggle",i),Pc(i,"popover",d);break;case"xlinkActuate":pr(i,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":pr(i,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":pr(i,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":pr(i,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":pr(i,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":pr(i,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":pr(i,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":pr(i,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":pr(i,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Pc(i,"is",d);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=$3.get(o)||o,Pc(i,o,d))}}function Rm(i,l,o,d,m,y){switch(o){case"style":o1(i,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(o=d.__html,o!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"children":typeof d=="string"?Tl(i,d):(typeof d=="number"||typeof d=="bigint")&&Tl(i,""+d);break;case"onScroll":d!=null&&at("scroll",i);break;case"onScrollEnd":d!=null&&at("scrollend",i);break;case"onClick":d!=null&&(i.onclick=mr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!se.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[Ut]||null,y=y!=null?y[o]:null,typeof y=="function"&&i.removeEventListener(l,y,m),typeof d=="function")){typeof y!="function"&&y!==null&&(o in i?i[o]=null:i.hasAttribute(o)&&i.removeAttribute(o)),i.addEventListener(l,d,m);break e}o in i?i[o]=d:d===!0?i.setAttribute(o,""):Pc(i,o,d)}}}function vn(i,l,o){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":at("error",i),at("load",i);var d=!1,m=!1,y;for(y in o)if(o.hasOwnProperty(y)){var w=o[y];if(w!=null)switch(y){case"src":d=!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),d&&kt(i,l,"src",o.src,o,null);return;case"input":at("invalid",i);var N=y=w=m=null,q=null,ie=null;for(d in o)if(o.hasOwnProperty(d)){var pe=o[d];if(pe!=null)switch(d){case"name":m=pe;break;case"type":w=pe;break;case"checked":q=pe;break;case"defaultChecked":ie=pe;break;case"value":y=pe;break;case"defaultValue":N=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,l));break;default:kt(i,l,d,pe,o,null)}}r1(i,y,N,q,ie,w,m,!1);return;case"select":at("invalid",i),d=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":d=N;default:kt(i,l,m,N,o,null)}l=y,o=w,i.multiple=!!d,l!=null?Nl(i,!!d,l,!1):o!=null&&Nl(i,!!d,o,!0);return;case"textarea":at("invalid",i),y=m=d=null;for(w in o)if(o.hasOwnProperty(w)&&(N=o[w],N!=null))switch(w){case"value":d=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)}l1(i,d,m,y);return;case"option":for(q in o)o.hasOwnProperty(q)&&(d=o[q],d!=null)&&(q==="selected"?i.selected=d&&typeof d!="function"&&typeof d!="symbol":kt(i,l,q,d,o,null));return;case"dialog":at("beforetoggle",i),at("toggle",i),at("cancel",i),at("close",i);break;case"iframe":case"object":at("load",i);break;case"video":case"audio":for(d=0;d<wo.length;d++)at(wo[d],i);break;case"image":at("error",i),at("load",i);break;case"details":at("toggle",i);break;case"embed":case"source":case"link":at("error",i),at("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)&&(d=o[ie],d!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:kt(i,l,ie,d,o,null)}return;default:if(Kh(l)){for(pe in o)o.hasOwnProperty(pe)&&(d=o[pe],d!==void 0&&Rm(i,l,pe,d,o,void 0));return}}for(N in o)o.hasOwnProperty(N)&&(d=o[N],d!=null&&kt(i,l,N,d,o,null))}function uR(i,l,o,d){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,pe=null;for(ce in o){var we=o[ce];if(o.hasOwnProperty(ce)&&we!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":q=we;default:d.hasOwnProperty(ce)||kt(i,l,ce,null,d,we)}}for(var re in d){var ce=d[re];if(we=o[re],d.hasOwnProperty(re)&&(ce!=null||we!=null))switch(re){case"type":y=ce;break;case"name":m=ce;break;case"checked":ie=ce;break;case"defaultChecked":pe=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!==we&&kt(i,l,re,ce,d,we)}}Vh(i,w,N,q,ie,pe,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:d.hasOwnProperty(y)||kt(i,l,y,null,d,q)}for(m in d)if(y=d[m],q=o[m],d.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,d,q)}l=N,o=w,d=ce,re!=null?Nl(i,!!o,re,!1):!!d!=!!o&&(l!=null?Nl(i,!!o,l,!0):Nl(i,!!o,o?[]:"",!1));return;case"textarea":ce=re=null;for(N in o)if(m=o[N],o.hasOwnProperty(N)&&m!=null&&!d.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:kt(i,l,N,null,d,m)}for(w in d)if(m=d[w],y=o[w],d.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,d,y)}s1(i,re,ce);return;case"option":for(var _e in o)re=o[_e],o.hasOwnProperty(_e)&&re!=null&&!d.hasOwnProperty(_e)&&(_e==="selected"?i.selected=!1:kt(i,l,_e,null,d,re));for(q in d)re=d[q],ce=o[q],d.hasOwnProperty(q)&&re!==ce&&(re!=null||ce!=null)&&(q==="selected"?i.selected=re&&typeof re!="function"&&typeof re!="symbol":kt(i,l,q,re,d,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 Pe in o)re=o[Pe],o.hasOwnProperty(Pe)&&re!=null&&!d.hasOwnProperty(Pe)&&kt(i,l,Pe,null,d,re);for(ie in d)if(re=d[ie],ce=o[ie],d.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,d,ce)}return;default:if(Kh(l)){for(var Ct in o)re=o[Ct],o.hasOwnProperty(Ct)&&re!==void 0&&!d.hasOwnProperty(Ct)&&Rm(i,l,Ct,void 0,d,re);for(pe in d)re=d[pe],ce=o[pe],!d.hasOwnProperty(pe)||re===ce||re===void 0&&ce===void 0||Rm(i,l,pe,re,d,ce);return}}for(var Y in o)re=o[Y],o.hasOwnProperty(Y)&&re!=null&&!d.hasOwnProperty(Y)&&kt(i,l,Y,null,d,re);for(we in d)re=d[we],ce=o[we],!d.hasOwnProperty(we)||re===ce||re==null&&ce==null||kt(i,l,we,re,d,ce)}function c2(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function dR(){if(typeof performance.getEntriesByType=="function"){for(var i=0,l=0,o=performance.getEntriesByType("resource"),d=0;d<o.length;d++){var m=o[d],y=m.transferSize,w=m.initiatorType,N=m.duration;if(y&&N&&c2(w)){for(w=0,N=m.responseEnd,d+=1;d<o.length;d++){var q=o[d],ie=q.startTime;if(ie>N)break;var pe=q.transferSize,we=q.initiatorType;pe&&c2(we)&&(q=q.responseEnd,w+=pe*(q<N?1:(N-ie)/(q-ie)))}if(--d,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 Dm=null,_m=null;function Fu(i){return i.nodeType===9?i:i.ownerDocument}function u2(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 d2(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 Lm(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 Bm=null;function fR(){var i=window.event;return i&&i.type==="popstate"?i===Bm?!1:(Bm=i,!0):(Bm=null,!1)}var f2=typeof setTimeout=="function"?setTimeout:void 0,hR=typeof clearTimeout=="function"?clearTimeout:void 0,h2=typeof Promise=="function"?Promise:void 0,pR=typeof queueMicrotask=="function"?queueMicrotask:typeof h2<"u"?function(i){return h2.resolve(null).then(i).catch(mR)}:f2;function mR(i){setTimeout(function(){throw i})}function xs(i){return i==="head"}function p2(i,l){var o=l,d=0;do{var m=o.nextSibling;if(i.removeChild(o),m&&m.nodeType===8)if(o=m.data,o==="/$"||o==="/&"){if(d===0){i.removeChild(m),ra(l);return}d--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")d++;else if(o==="html")Ao(i.ownerDocument.documentElement);else if(o==="head"){o=i.ownerDocument.head,Ao(o);for(var y=o.firstChild;y;){var w=y.nextSibling,N=y.nodeName;y[Wi]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&y.rel.toLowerCase()==="stylesheet"||o.removeChild(y),y=w}}else o==="body"&&Ao(i.ownerDocument.body);o=m}while(o);ra(l)}function m2(i,l){var o=i;i=0;do{var d=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||""),d&&d.nodeType===8)if(o=d.data,o==="/$"){if(i===0)break;i--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||i++;o=d}while(o)}function $m(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":$m(o),kl(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function gR(i,l,o,d){for(;i.nodeType===1;){var m=o;if(i.nodeName.toLowerCase()!==l.toLowerCase()){if(!d&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(d){if(!i[Wi])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=ji(i.nextSibling),i===null)break}return null}function yR(i,l,o){if(l==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=ji(i.nextSibling),i===null))return null;return i}function g2(i,l){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=ji(i.nextSibling),i===null))return null;return i}function qm(i){return i.data==="$?"||i.data==="$~"}function zm(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function bR(i,l){var o=i.ownerDocument;if(i.data==="$~")i._reactRetry=l;else if(i.data!=="$?"||o.readyState!=="loading")l();else{var d=function(){l(),o.removeEventListener("DOMContentLoaded",d)};o.addEventListener("DOMContentLoaded",d),i._reactRetry=d}}function ji(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 Hm=null;function y2(i){i=i.nextSibling;for(var l=0;i;){if(i.nodeType===8){var o=i.data;if(o==="/$"||o==="/&"){if(l===0)return ji(i.nextSibling);l--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||l++}i=i.nextSibling}return null}function b2(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 x2(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 Ao(i){for(var l=i.attributes;l.length;)i.removeAttributeNode(l[0]);kl(i)}var Ei=new Map,v2=new Set;function Vu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Mr=ee.d;ee.d={f:xR,r:vR,D:wR,C:SR,L:AR,m:kR,X:NR,S:CR,M:TR};function xR(){var i=Mr.f(),l=Lu();return i||l}function vR(i){var l=hr(i);l!==null&&l.tag===5&&l.type==="form"?$w(l):Mr.r(i)}var ta=typeof document>"u"?null:document;function w2(i,l,o){var d=ta;if(d&&typeof l=="string"&&l){var m=wi(l);m='link[rel="'+i+'"][href="'+m+'"]',typeof o=="string"&&(m+='[crossorigin="'+o+'"]'),v2.has(m)||(v2.add(m),i={rel:i,crossOrigin:o,href:l},d.querySelector(m)===null&&(l=d.createElement("link"),vn(l,"link",i),Ft(l),d.head.appendChild(l)))}}function wR(i){Mr.D(i),w2("dns-prefetch",i,null)}function SR(i,l){Mr.C(i,l),w2("preconnect",i,l)}function AR(i,l,o){Mr.L(i,l,o);var d=ta;if(d&&i&&l){var m='link[rel="preload"][as="'+wi(l)+'"]';l==="image"&&o&&o.imageSrcSet?(m+='[imagesrcset="'+wi(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(m+='[imagesizes="'+wi(o.imageSizes)+'"]')):m+='[href="'+wi(i)+'"]';var y=m;switch(l){case"style":y=na(i);break;case"script":y=ia(i)}Ei.has(y)||(i=b({rel:"preload",href:l==="image"&&o&&o.imageSrcSet?void 0:i,as:l},o),Ei.set(y,i),d.querySelector(m)!==null||l==="style"&&d.querySelector(ko(y))||l==="script"&&d.querySelector(Co(y))||(l=d.createElement("link"),vn(l,"link",i),Ft(l),d.head.appendChild(l)))}}function kR(i,l){Mr.m(i,l);var o=ta;if(o&&i){var d=l&&typeof l.as=="string"?l.as:"script",m='link[rel="modulepreload"][as="'+wi(d)+'"][href="'+wi(i)+'"]',y=m;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=ia(i)}if(!Ei.has(y)&&(i=b({rel:"modulepreload",href:i},l),Ei.set(y,i),o.querySelector(m)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Co(y)))return}d=o.createElement("link"),vn(d,"link",i),Ft(d),o.head.appendChild(d)}}}function CR(i,l,o){Mr.S(i,l,o);var d=ta;if(d&&i){var m=ts(d).hoistableStyles,y=na(i);l=l||"default";var w=m.get(y);if(!w){var N={loading:0,preload:null};if(w=d.querySelector(ko(y)))N.loading=5;else{i=b({rel:"stylesheet",href:i,"data-precedence":l},o),(o=Ei.get(y))&&Im(i,o);var q=w=d.createElement("link");Ft(q),vn(q,"link",i),q._p=new Promise(function(ie,pe){q.onload=ie,q.onerror=pe}),q.addEventListener("load",function(){N.loading|=1}),q.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Pu(w,l,d)}w={type:"stylesheet",instance:w,count:1,state:N},m.set(y,w)}}}function NR(i,l){Mr.X(i,l);var o=ta;if(o&&i){var d=ts(o).hoistableScripts,m=ia(i),y=d.get(m);y||(y=o.querySelector(Co(m)),y||(i=b({src:i,async:!0},l),(l=Ei.get(m))&&Um(i,l),y=o.createElement("script"),Ft(y),vn(y,"link",i),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(m,y))}}function TR(i,l){Mr.M(i,l);var o=ta;if(o&&i){var d=ts(o).hoistableScripts,m=ia(i),y=d.get(m);y||(y=o.querySelector(Co(m)),y||(i=b({src:i,async:!0,type:"module"},l),(l=Ei.get(m))&&Um(i,l),y=o.createElement("script"),Ft(y),vn(y,"link",i),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(m,y))}}function S2(i,l,o,d){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=na(o.href),o=ts(m).hoistableStyles,d=o.get(l),d||(d={type:"style",instance:null,count:0,state:null},o.set(l,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){i=na(o.href);var y=ts(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(ko(i)))&&!y._p&&(w.instance=y,w.state.loading=5),Ei.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},Ei.set(i,o),y||jR(m,i,o,w.state))),l&&d===null)throw Error(r(528,""));return w}if(l&&d!==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=ia(o),o=ts(m).hoistableScripts,d=o.get(l),d||(d={type:"script",instance:null,count:0,state:null},o.set(l,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function na(i){return'href="'+wi(i)+'"'}function ko(i){return'link[rel="stylesheet"]['+i+"]"}function A2(i){return b({},i,{"data-precedence":i.precedence,precedence:null})}function jR(i,l,o,d){i.querySelector('link[rel="preload"][as="style"]['+l+"]")?d.loading=1:(l=i.createElement("link"),d.preload=l,l.addEventListener("load",function(){return d.loading|=1}),l.addEventListener("error",function(){return d.loading|=2}),vn(l,"link",o),Ft(l),i.head.appendChild(l))}function ia(i){return'[src="'+wi(i)+'"]'}function Co(i){return"script[async]"+i}function k2(i,l,o){if(l.count++,l.instance===null)switch(l.type){case"style":var d=i.querySelector('style[data-href~="'+wi(o.href)+'"]');if(d)return l.instance=d,Ft(d),d;var m=b({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return d=(i.ownerDocument||i).createElement("style"),Ft(d),vn(d,"style",m),Pu(d,o.precedence,i),l.instance=d;case"stylesheet":m=na(o.href);var y=i.querySelector(ko(m));if(y)return l.state.loading|=4,l.instance=y,Ft(y),y;d=A2(o),(m=Ei.get(m))&&Im(d,m),y=(i.ownerDocument||i).createElement("link"),Ft(y);var w=y;return w._p=new Promise(function(N,q){w.onload=N,w.onerror=q}),vn(y,"link",d),l.state.loading|=4,Pu(y,o.precedence,i),l.instance=y;case"script":return y=ia(o.src),(m=i.querySelector(Co(y)))?(l.instance=m,Ft(m),m):(d=o,(m=Ei.get(y))&&(d=b({},o),Um(d,m)),i=i.ownerDocument||i,m=i.createElement("script"),Ft(m),vn(m,"link",d),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&&(d=l.instance,l.state.loading|=4,Pu(d,o.precedence,i));return l.instance}function Pu(i,l,o){for(var d=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=d.length?d[d.length-1]:null,y=m,w=0;w<d.length;w++){var N=d[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 Im(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.title==null&&(i.title=l.title)}function Um(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 C2(i,l,o){if(Ku===null){var d=new Map,m=Ku=new Map;m.set(o,d)}else m=Ku,d=m.get(o),d||(d=new Map,m.set(o,d));if(d.has(i))return d;for(d.set(i,null),o=o.getElementsByTagName(i),m=0;m<o.length;m++){var y=o[m];if(!(y[Wi]||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=d.get(w);N?N.push(y):d.set(w,[y])}}return d}function N2(i,l,o){i=i.ownerDocument||i,i.head.insertBefore(o,l==="title"?i.querySelector("head > title"):null)}function ER(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 T2(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function OR(i,l,o,d){if(o.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var m=na(d.href),y=l.querySelector(ko(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,Ft(y);return}y=l.ownerDocument||l,d=A2(d),(m=Ei.get(m))&&Im(d,m),y=y.createElement("link"),Ft(y);var w=y;w._p=new Promise(function(N,q){w.onload=N,w.onerror=q}),vn(y,"link",d),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 Fm=0;function MR(i,l){return i.stylesheets&&i.count===0&&Xu(i,i.stylesheets),0<i.count||0<i.imgCount?function(o){var d=setTimeout(function(){if(i.stylesheets&&Xu(i,i.stylesheets),i.unsuspend){var y=i.unsuspend;i.unsuspend=null,y()}},6e4+l);0<i.imgBytes&&Fm===0&&(Fm=62500*dR());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>Fm?50:800)+l);return i.unsuspend=o,function(){i.unsuspend=null,clearTimeout(d),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(RR,i),Gu=null,Yu.call(i))}function RR(i,l){if(!(l.state.loading&4)){var o=Gu.get(i);if(o)var d=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),d=w)}d&&o.set(null,d)}m=l.instance,w=m.getAttribute("data-precedence"),y=o.get(w)||d,y===d&&o.set(null,m),o.set(w,m),this.count++,d=Yu.bind(this),m.addEventListener("load",d),m.addEventListener("error",d),y?y.parentNode.insertBefore(m,y.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(m,i.firstChild)),l.state.loading|=4}}var No={$$typeof:E,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function DR(i,l,o,d,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=_n(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_n(0),this.hiddenUpdates=_n(null),this.identifierPrefix=d,this.onUncaughtError=m,this.onCaughtError=y,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function j2(i,l,o,d,m,y,w,N,q,ie,pe,we){return i=new DR(i,l,o,w,q,ie,pe,we,N),l=1,y===!0&&(l|=24),y=ni(3,null,null,l),i.current=y,y.stateNode=i,l=Sp(),l.refCount++,i.pooledCache=l,l.refCount++,y.memoizedState={element:d,isDehydrated:o,cache:l},Np(y),i}function E2(i){return i?(i=_l,i):_l}function O2(i,l,o,d,m,y){m=E2(m),d.context===null?d.context=m:d.pendingContext=m,d=os(l),d.payload={element:o},y=y===void 0?null:y,y!==null&&(d.callback=y),o=cs(i,d,l),o!==null&&(Gn(o,i,l),io(o,i,l))}function M2(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<l?o:l}}function Vm(i,l){M2(i,l),(i=i.alternate)&&M2(i,l)}function R2(i){if(i.tag===13||i.tag===31){var l=Fs(i,67108864);l!==null&&Gn(l,i,67108864),Vm(i,67108864)}}function D2(i){if(i.tag===13||i.tag===31){var l=ai();l=Yt(l);var o=Fs(i,l);o!==null&&Gn(o,i,l),Vm(i,l)}}var Ju=!0;function _R(i,l,o,d){var m=_.T;_.T=null;var y=ee.p;try{ee.p=2,Pm(i,l,o,d)}finally{ee.p=y,_.T=m}}function LR(i,l,o,d){var m=_.T;_.T=null;var y=ee.p;try{ee.p=8,Pm(i,l,o,d)}finally{ee.p=y,_.T=m}}function Pm(i,l,o,d){if(Ju){var m=Km(d);if(m===null)Mm(i,l,d,Qu,o),L2(i,d);else if($R(m,i,l,o,d))d.stopPropagation();else if(L2(i,d),l&4&&-1<BR.indexOf(i)){for(;m!==null;){var y=hr(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}nr(y),(xt&6)===0&&(Du=ot()+500,vo(0))}}break;case 31:case 13:N=Fs(y,2),N!==null&&Gn(N,y,2),Lu(),Vm(y,2)}if(y=Km(d),y===null&&Mm(i,l,d,Qu,o),y===m)break;m=y}m!==null&&d.stopPropagation()}else Mm(i,l,d,null,o)}}function Km(i){return i=Gh(i),Ym(i)}var Qu=null;function Ym(i){if(Qu=null,i=In(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=u(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 _2(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(Wn()){case Rn:return 2;case Zn:return 8;case Tt:case x:return 32;case K:return 268435456;default:return 32}default:return 32}}var Gm=!1,vs=null,ws=null,Ss=null,To=new Map,jo=new Map,As=[],BR="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 L2(i,l){switch(i){case"focusin":case"focusout":vs=null;break;case"dragenter":case"dragleave":ws=null;break;case"mouseover":case"mouseout":Ss=null;break;case"pointerover":case"pointerout":To.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":jo.delete(l.pointerId)}}function Eo(i,l,o,d,m,y){return i===null||i.nativeEvent!==y?(i={blockedOn:l,domEventName:o,eventSystemFlags:d,nativeEvent:y,targetContainers:[m]},l!==null&&(l=hr(l),l!==null&&R2(l)),i):(i.eventSystemFlags|=d,l=i.targetContainers,m!==null&&l.indexOf(m)===-1&&l.push(m),i)}function $R(i,l,o,d,m){switch(l){case"focusin":return vs=Eo(vs,i,l,o,d,m),!0;case"dragenter":return ws=Eo(ws,i,l,o,d,m),!0;case"mouseover":return Ss=Eo(Ss,i,l,o,d,m),!0;case"pointerover":var y=m.pointerId;return To.set(y,Eo(To.get(y)||null,i,l,o,d,m)),!0;case"gotpointercapture":return y=m.pointerId,jo.set(y,Eo(jo.get(y)||null,i,l,o,d,m)),!0}return!1}function B2(i){var l=In(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,es(i.priority,function(){D2(o)});return}}else if(l===31){if(l=u(o),l!==null){i.blockedOn=l,es(i.priority,function(){D2(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=Km(i.nativeEvent);if(o===null){o=i.nativeEvent;var d=new o.constructor(o.type,o);Yh=d,o.target.dispatchEvent(d),Yh=null}else return l=hr(o),l!==null&&R2(l),i.blockedOn=o,!1;l.shift()}return!0}function $2(i,l,o){Wu(i)&&o.delete(l)}function qR(){Gm=!1,vs!==null&&Wu(vs)&&(vs=null),ws!==null&&Wu(ws)&&(ws=null),Ss!==null&&Wu(Ss)&&(Ss=null),To.forEach($2),jo.forEach($2)}function Zu(i,l){i.blockedOn===l&&(i.blockedOn=null,Gm||(Gm=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,qR)))}var ed=null;function q2(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],d=i[l+1],m=i[l+2];if(typeof d!="function"){if(Ym(d||o)===null)continue;break}var y=hr(o);y!==null&&(i.splice(l,3),l-=3,Kp(y,{pending:!0,data:m,method:o.method,action:d},d,m))}}))}function ra(i){function l(q){return Zu(q,i)}vs!==null&&Zu(vs,i),ws!==null&&Zu(ws,i),Ss!==null&&Zu(Ss,i),To.forEach(l),jo.forEach(l);for(var o=0;o<As.length;o++){var d=As[o];d.blockedOn===i&&(d.blockedOn=null)}for(;0<As.length&&(o=As[0],o.blockedOn===null);)B2(o),o.blockedOn===null&&As.shift();if(o=(i.ownerDocument||i).$$reactFormReplay,o!=null)for(d=0;d<o.length;d+=3){var m=o[d],y=o[d+1],w=m[Ut]||null;if(typeof y=="function")w||q2(o);else if(w){var N=null;if(y&&y.hasAttribute("formAction")){if(m=y,w=y[Ut]||null)N=w.formAction;else if(Ym(m)!==null)continue}else N=w.action;typeof N=="function"?o[d+1]=N:(o.splice(d,3),d-=3),q2(o)}}}function z2(){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),d||setTimeout(o,20)}function o(){if(!d&&!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 d=!1,m=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(o,100),function(){d=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),m!==null&&(m(),m=null)}}}function Xm(i){this._internalRoot=i}td.prototype.render=Xm.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(r(409));var o=l.current,d=ai();O2(o,d,i,l,null,null)},td.prototype.unmount=Xm.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;O2(i.current,2,null,i,null,null),Lu(),l[bi]=null}};function td(i){this._internalRoot=i}td.prototype.unstable_scheduleHydration=function(i){if(i){var l=Bi();i={blockedOn:null,target:i,priority:l};for(var o=0;o<As.length&&l!==0&&l<As[o].priority;o++);As.splice(o,0,i),o===0&&B2(i)}};var H2=e.version;if(H2!=="19.2.8")throw Error(r(527,H2,"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 zR={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{Q=nd.inject(zR),k=nd}catch{}}return la.createRoot=function(i,l){if(!s(i))throw Error(r(299));var o=!1,d="",m=Yw,y=Gw,w=Xw;return l!=null&&(l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(d=l.identifierPrefix),l.onUncaughtError!==void 0&&(m=l.onUncaughtError),l.onCaughtError!==void 0&&(y=l.onCaughtError),l.onRecoverableError!==void 0&&(w=l.onRecoverableError)),l=j2(i,1,!1,null,null,o,d,null,m,y,w,z2),i[bi]=l.current,Om(i),new Xm(l)},la.hydrateRoot=function(i,l,o){if(!s(i))throw Error(r(299));var d=!1,m="",y=Yw,w=Gw,N=Xw,q=null;return o!=null&&(o.unstable_strictMode===!0&&(d=!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=j2(i,1,!0,l,o??null,d,m,q,y,w,N,z2),l.context=E2(null),o=l.current,d=ai(),d=Yt(d),m=os(d),m.callback=null,cs(o,m,d),o=d,l.current.lanes=o,Kt(l,o),nr(l),i[bi]=l.current,Om(i),new td(l)},la.version="19.2.8",la}var ag;function Q2(){if(ag)return rd.exports;ag=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=J2(),rd.exports}var og=Q2(),U=od();const cg=Qm(U);const W2=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Z2=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),ug=t=>{const e=Z2(t);return e.charAt(0).toUpperCase()+e.slice(1)},dg=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),eA=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var tA={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 nA=U.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:c,...u},f)=>U.createElement("svg",{ref:f,...tA,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:dg("lucide",s),...!a&&!eA(u)&&{"aria-hidden":"true"},...u},[...c.map(([h,g])=>U.createElement(h,g)),...Array.isArray(a)?a:[a]]));const rt=(t,e)=>{const n=U.forwardRef(({className:r,...s},a)=>U.createElement(nA,{ref:a,iconNode:e,className:dg(`lucide-${W2(ug(t))}`,`lucide-${t}`,r),...s}));return n.displayName=ug(t),n};const fg=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 Oo=rt("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const hg=rt("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const pg=rt("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const mg=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 aa=rt("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const iA=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 rA=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 gg=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 sA=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 lA=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 aA=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 oA=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 cA=rt("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const uA=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 dA=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 fA=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 oa=rt("play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const Ns=rt("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const hA=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 pA=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 yg=rt("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const bg=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 mA=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 gA=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 xg=rt("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const vg=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 oi=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 wg=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 yA=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 bA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Sn={},Mo={},Rr={},Sg;function ca(){if(Sg)return Rr;Sg=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,u){if(u){const f=Object.keys(u);for(let h=0,g=f.length;h<g;h+=1){const b=f[h];c[b]=u[b]}}return c}function s(c,u){let f="";for(let h=0;h<u;h+=1)f+=c;return f}function a(c){return c===0&&Number.NEGATIVE_INFINITY===1/c}return Rr.isNothing=t,Rr.isObject=e,Rr.toArray=n,Rr.repeat=s,Rr.isNegativeZero=a,Rr.extend=r,Rr}var yd,Ag;function ua(){if(Ag)return yd;Ag=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,kg;function xA(){if(kg)return bd;kg=1;const t=ca();function e(s,a,c,u,f){let h="",g="";const b=Math.floor(f/2)-1;return u-a>b&&(h=" ... ",a=u-b+h.length),c-u>b&&(g=" ...",c=u+b-g.length),{str:h+s.slice(a,c).replace(/\t/g,"→")+g,pos:u-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,u=[0],f=[];let h,g=-1;for(;h=c.exec(s.buffer);)f.push(h.index),u.push(h.index+h[0].length),s.position<=h.index&&g<0&&(g=u.length-2);g<0&&(g=u.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,u[g-C],f[g-C],s.position-(u[g]-u[g-C]),S);b=t.repeat(" ",a.indent)+n((s.line-C+1).toString(),v)+" | "+T.str+`
|
|
12
|
+
`+b}const A=e(s.buffer,u[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,u[g+C],f[g+C],s.position-(u[g]-u[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,Cg;function Tn(){if(Cg)return xd;Cg=1;const t=ua(),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(u){a[u].forEach(function(f){c[String(f)]=u})}),c}function s(a,c){if(c=c||{},Object.keys(c).forEach(function(u){if(e.indexOf(u)===-1)throw new t('Unknown option "'+u+'" 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(u){return u},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,Ng;function Tg(){if(Ng)return vd;Ng=1;const t=ua(),e=Tn();function n(a,c){const u=[];return a[c].forEach(function(f){let h=u.length;u.forEach(function(g,b){g.tag===f.tag&&g.kind===f.kind&&g.multi===f.multi&&(h=b)}),u[h]=f}),u}function r(){const a={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function c(u){u.multi?(a.multi[u.kind].push(u),a.multi.fallback.push(u)):a[u.kind][u.tag]=a.fallback[u.tag]=u}for(let u=0,f=arguments.length;u<f;u+=1)arguments[u].forEach(c);return a}function s(a){return this.extend(a)}return s.prototype.extend=function(c){let u=[],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&&(u=u.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: [...] })");u.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(u),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,jg;function Eg(){if(jg)return wd;jg=1;const t=Tn();return wd=new t("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),wd}var Sd,Og;function Mg(){if(Og)return Sd;Og=1;const t=Tn();return Sd=new t("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Sd}var Ad,Rg;function Dg(){if(Rg)return Ad;Rg=1;const t=Tn();return Ad=new t("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Ad}var kd,_g;function Lg(){if(_g)return kd;_g=1;const t=Tg();return kd=new t({explicit:[Eg(),Mg(),Dg()]}),kd}var Cd,Bg;function $g(){if(Bg)return Cd;Bg=1;const t=Tn();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,qg;function zg(){if(qg)return Nd;qg=1;const t=Tn();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,Hg;function Ig(){if(Hg)return Td;Hg=1;const t=ca(),e=Tn();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 u(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:u,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,Ug;function Fg(){if(Ug)return jd;Ug=1;const t=ca(),e=Tn(),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 u(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:u,defaultStyle:"lowercase"}),jd}var Ed,Vg;function Pg(){return Vg||(Vg=1,Ed=Lg().extend({implicit:[$g(),zg(),Ig(),Fg()]})),Ed}var Od,Kg;function Yg(){return Kg||(Kg=1,Od=Pg()),Od}var Md,Gg;function Xg(){if(Gg)return Md;Gg=1;const t=Tn(),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 u=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(u=h[7].slice(0,3);u.length<3;)u+="0";u=+u}if(h[9]){const R=+h[10],j=+(h[11]||0);f=(R*60+j)*6e4,h[9]==="-"&&(f=-f)}const T=new Date(Date.UTC(g,b,v,S,A,C,u));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,Jg;function Qg(){if(Jg)return Rd;Jg=1;const t=Tn();function e(n){return n==="<<"||n===null}return Rd=new t("tag:yaml.org,2002:merge",{kind:"scalar",resolve:e}),Rd}var Dd,Wg;function Zg(){if(Wg)return Dd;Wg=1;const t=Tn(),e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
16
|
+
\r`;function n(c){if(c===null)return!1;let u=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;u+=6}}return u%8===0}function r(c){const u=c.replace(/[\r\n=]/g,""),f=u.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(u.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 u="",f=0;const h=c.length,g=e;for(let v=0;v<h;v++)v%3===0&&v&&(u+=g[f>>18&63],u+=g[f>>12&63],u+=g[f>>6&63],u+=g[f&63]),f=(f<<8)+c[v];const b=h%3;return b===0?(u+=g[f>>18&63],u+=g[f>>12&63],u+=g[f>>6&63],u+=g[f&63]):b===2?(u+=g[f>>10&63],u+=g[f>>4&63],u+=g[f<<2&63],u+=g[64]):b===1&&(u+=g[f>>2&63],u+=g[f<<4&63],u+=g[64],u+=g[64]),u}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,e0;function t0(){if(e0)return _d;e0=1;const t=Tn(),e=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function r(a){if(a===null)return!0;const c={},u=a;for(let f=0,h=u.length;f<h;f+=1){const g=u[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,n0;function i0(){if(n0)return Ld;n0=1;const t=Tn(),e=Object.prototype.toString;function n(s){if(s===null)return!0;const a=s,c=new Array(a.length);for(let u=0,f=a.length;u<f;u+=1){const h=a[u];if(e.call(h)!=="[object Object]")return!1;const g=Object.keys(h);if(g.length!==1)return!1;c[u]=[g[0],h[g[0]]]}return!0}function r(s){if(s===null)return[];const a=s,c=new Array(a.length);for(let u=0,f=a.length;u<f;u+=1){const h=a[u],g=Object.keys(h);c[u]=[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,r0;function s0(){if(r0)return Bd;r0=1;const t=Tn(),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,l0;function qd(){return l0||(l0=1,$d=Yg().extend({implicit:[Xg(),Qg()],explicit:[Zg(),t0(),i0(),s0()]})),$d}var a0;function vA(){if(a0)return Mo;a0=1;const t=ca(),e=ua(),n=xA(),r=qd(),s=Object.prototype.hasOwnProperty,a=1,c=2,u=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 R(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 D(x){return x===44||x===91||x===93||x===123||x===125}function B(x){if(x>=48&&x<=57)return x-48;const K=x|32;return K>=97&&K<=102?K-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 P(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 J(x){return x<=65535?String.fromCharCode(x):String.fromCharCode((x-65536>>10)+55296,(x-65536&1023)+56320)}function W(x,K,me){K==="__proto__"?Object.defineProperty(x,K,{configurable:!0,enumerable:!0,writable:!0,value:me}):x[K]=me}const G=new Array(256),Se=new Array(256);for(let x=0;x<256;x++)G[x]=P(x)?1:0,Se[x]=P(x);function ye(x,K){this.input=x,this.filename=K.filename||null,this.schema=K.schema||r,this.onWarning=K.onWarning||null,this.legacy=K.legacy||!1,this.json=K.json||!1,this.listener=K.listener||null,this.maxDepth=typeof K.maxDepth=="number"?K.maxDepth:100,this.maxTotalMergeKeys=typeof K.maxTotalMergeKeys=="number"?K.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,K){const me={name:x.filename,buffer:x.input.slice(0,-1),position:x.position,line:x.line,column:x.position-x.lineStart};return me.snippet=n(me),new e(K,me)}function _(x,K){throw xe(x,K)}function ee(x,K){x.onWarning&&x.onWarning.call(null,xe(x,K))}function de(x,K,me){const fe=x.anchorMapTransactions;if(fe.length!==0){const Q=fe[fe.length-1];s.call(Q,K)||(Q[K]={existed:s.call(x.anchorMap,K),value:x.anchorMap[K]})}x.anchorMap[K]=me}function $(x){x.anchorMapTransactions.push(Object.create(null))}function ne(x){const K=x.anchorMapTransactions.pop(),me=x.anchorMapTransactions;if(me.length===0)return;const fe=me[me.length-1],Q=Object.keys(K);for(let k=0,X=Q.length;k<X;k+=1){const Z=Q[k];s.call(fe,Z)||(fe[Z]=K[Z])}}function L(x){const K=x.anchorMapTransactions.pop(),me=Object.keys(K);for(let fe=me.length-1;fe>=0;fe-=1){const Q=K[me[fe]];Q.existed?x.anchorMap[me[fe]]=Q.value:delete x.anchorMap[me[fe]]}}function V(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,K){x.position=K.position,x.line=K.line,x.lineStart=K.lineStart,x.lineIndent=K.lineIndent,x.firstTabInLine=K.firstTabInLine,x.tag=K.tag,x.anchor=K.anchor,x.kind=K.kind,x.result=K.result}const ve={YAML:function(K,me,fe){K.version!==null&&_(K,"duplication of %YAML directive"),fe.length!==1&&_(K,"YAML directive accepts exactly one argument");const Q=/^([0-9]+)\.([0-9]+)$/.exec(fe[0]);Q===null&&_(K,"ill-formed argument of the YAML directive");const k=parseInt(Q[1],10),X=parseInt(Q[2],10);k!==1&&_(K,"unacceptable YAML version of the document"),K.version=fe[0],K.checkLineBreaks=X<2,X!==1&&X!==2&&ee(K,"unsupported YAML version of the document")},TAG:function(K,me,fe){let Q;fe.length!==2&&_(K,"TAG directive accepts exactly two arguments");const k=fe[0];Q=fe[1],C.test(k)||_(K,"ill-formed tag handle (first argument) of the TAG directive"),s.call(K.tagMap,k)&&_(K,'there is a previously declared suffix for "'+k+'" tag handle'),T.test(Q)||_(K,"ill-formed tag prefix (second argument) of the TAG directive");try{Q=decodeURIComponent(Q)}catch{_(K,"tag prefix is malformed: "+Q)}K.tagMap[k]=Q}};function Ne(x,K,me,fe){if(K<me){const Q=x.input.slice(K,me);if(fe)for(let k=0,X=Q.length;k<X;k+=1){const Z=Q.charCodeAt(k);Z===9||Z>=32&&Z<=1114111||_(x,"expected valid JSON character")}else v.test(Q)&&_(x,"the stream contains non-printable characters");x.result+=Q}}function Re(x){x.totalMergeKeys++,x.maxTotalMergeKeys!==-1&&x.totalMergeKeys>x.maxTotalMergeKeys&&_(x,"merge keys exceeded maxTotalMergeKeys ("+x.maxTotalMergeKeys+")")}function qe(x,K,me,fe){t.isObject(me)||_(x,"cannot merge mappings; the provided source object is unacceptable"),Re(x);const Q=Object.keys(me);for(let k=0,X=Q.length;k<X;k+=1){const Z=Q[k];Re(x),s.call(K,Z)||(W(K,Z,me[Z]),fe[Z]=!0)}}function Je(x,K,me,fe,Q,k,X,Z,Ae){if(Array.isArray(Q)){Q=Array.prototype.slice.call(Q);for(let H=0,he=Q.length;H<he;H+=1)Array.isArray(Q[H])&&_(x,"nested arrays are not supported inside keys"),typeof Q=="object"&&R(Q[H])==="[object Object]"&&(Q[H]="[object Object]")}if(typeof Q=="object"&&R(Q)==="[object Object]"&&(Q="[object Object]"),Q=String(Q),K===null&&(K={}),fe==="tag:yaml.org,2002:merge")if(Array.isArray(k)){k.length>100&&_(x,"abnormal merge sequence size");for(let H=0,he=k.length;H<he;H+=1)qe(x,K,k[H],me)}else qe(x,K,k,me);else!x.json&&!s.call(me,Q)&&s.call(K,Q)&&(x.line=X||x.line,x.lineStart=Z||x.lineStart,x.position=Ae||x.position,_(x,"duplicated mapping key")),W(K,Q,k),delete me[Q];return K}function Fe(x){const K=x.input.charCodeAt(x.position);K===10?x.position++:K===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 Le(x,K,me){let fe=0,Q=x.input.charCodeAt(x.position);for(;Q!==0;){for(;E(Q);)Q===9&&x.firstTabInLine===-1&&(x.firstTabInLine=x.position),Q=x.input.charCodeAt(++x.position);if(K&&Q===35)do Q=x.input.charCodeAt(++x.position);while(Q!==10&&Q!==13&&Q!==0);if(j(Q))for(Fe(x),Q=x.input.charCodeAt(x.position),fe++,x.lineIndent=0;Q===32;)x.lineIndent++,Q=x.input.charCodeAt(++x.position);else break}return me!==-1&&fe!==0&&x.lineIndent<me&&ee(x,"deficient indentation"),fe}function dt(x){let K=x.position,me=x.input.charCodeAt(K);return!!((me===45||me===46)&&me===x.input.charCodeAt(K+1)&&me===x.input.charCodeAt(K+2)&&(K+=3,me=x.input.charCodeAt(K),me===0||O(me)))}function ae(x,K){K===1?x.result+=" ":K>1&&(x.result+=t.repeat(`
|
|
18
|
+
`,K-1))}function le(x,K,me){let fe,Q,k,X,Z,Ae;const H=x.kind,he=x.result;let oe=x.input.charCodeAt(x.position);if(O(oe)||D(oe)||oe===35||oe===38||oe===42||oe===33||oe===124||oe===62||oe===39||oe===34||oe===37||oe===64||oe===96)return!1;if(oe===63||oe===45){const ke=x.input.charCodeAt(x.position+1);if(O(ke)||me&&D(ke))return!1}for(x.kind="scalar",x.result="",fe=Q=x.position,k=!1;oe!==0;){if(oe===58){const ke=x.input.charCodeAt(x.position+1);if(O(ke)||me&&D(ke))break}else if(oe===35){const ke=x.input.charCodeAt(x.position-1);if(O(ke))break}else{if(x.position===x.lineStart&&dt(x)||me&&D(oe))break;if(j(oe))if(X=x.line,Z=x.lineStart,Ae=x.lineIndent,Le(x,!1,-1),x.lineIndent>=K){k=!0,oe=x.input.charCodeAt(x.position);continue}else{x.position=Q,x.line=X,x.lineStart=Z,x.lineIndent=Ae;break}}k&&(Ne(x,fe,Q,!1),ae(x,x.line-X),fe=Q=x.position,k=!1),E(oe)||(Q=x.position+1),oe=x.input.charCodeAt(++x.position)}return Ne(x,fe,Q,!1),x.result?!0:(x.kind=H,x.result=he,!1)}function ge(x,K){let me,fe,Q=x.input.charCodeAt(x.position);if(Q!==39)return!1;for(x.kind="scalar",x.result="",x.position++,me=fe=x.position;(Q=x.input.charCodeAt(x.position))!==0;)if(Q===39)if(Ne(x,me,x.position,!0),Q=x.input.charCodeAt(++x.position),Q===39)me=x.position,x.position++,fe=x.position;else return!0;else j(Q)?(Ne(x,me,fe,!0),ae(x,Le(x,!1,K)),me=fe=x.position):x.position===x.lineStart&&dt(x)?_(x,"unexpected end of the document within a single quoted scalar"):(x.position++,E(Q)||(fe=x.position));_(x,"unexpected end of the stream within a single quoted scalar")}function Te(x,K){let me,fe,Q,k=x.input.charCodeAt(x.position);if(k!==34)return!1;for(x.kind="scalar",x.result="",x.position++,me=fe=x.position;(k=x.input.charCodeAt(x.position))!==0;){if(k===34)return Ne(x,me,x.position,!0),x.position++,!0;if(k===92){if(Ne(x,me,x.position,!0),k=x.input.charCodeAt(++x.position),j(k))Le(x,!1,K);else if(k<256&&G[k])x.result+=Se[k],x.position++;else if((Q=M(k))>0){let X=Q,Z=0;for(;X>0;X--)k=x.input.charCodeAt(++x.position),(Q=B(k))>=0?Z=(Z<<4)+Q:_(x,"expected hexadecimal character");x.result+=J(Z),x.position++}else _(x,"unknown escape sequence");me=fe=x.position}else j(k)?(Ne(x,me,fe,!0),ae(x,Le(x,!1,K)),me=fe=x.position):x.position===x.lineStart&&dt(x)?_(x,"unexpected end of the document within a double quoted scalar"):(x.position++,E(k)||(fe=x.position))}_(x,"unexpected end of the stream within a double quoted scalar")}function Ie(x,K){let me=!0,fe,Q,k;const X=x.tag;let Z;const Ae=x.anchor;let H,he,oe,ke;const Ee=Object.create(null);let De,Be,ze,Ye=x.input.charCodeAt(x.position);if(Ye===91)H=93,ke=!1,Z=[];else if(Ye===123)H=125,ke=!0,Z={};else return!1;for(x.anchor!==null&&de(x,x.anchor,Z),Ye=x.input.charCodeAt(++x.position);Ye!==0;){if(Le(x,!0,K),Ye=x.input.charCodeAt(x.position),Ye===H)return x.position++,x.tag=X,x.anchor=Ae,x.kind=ke?"mapping":"sequence",x.result=Z,!0;if(me?Ye===44&&_(x,"expected the node content, but found ','"):_(x,"missed comma between flow collection entries"),Be=De=ze=null,he=oe=!1,Ye===63){const Dn=x.input.charCodeAt(x.position+1);O(Dn)&&(he=oe=!0,x.position++,Le(x,!0,K))}fe=x.line,Q=x.lineStart,k=x.position,ot(x,K,a,!1,!0),Be=x.tag,De=x.result,Le(x,!0,K),Ye=x.input.charCodeAt(x.position),(oe||x.line===fe)&&Ye===58&&(he=!0,Ye=x.input.charCodeAt(++x.position),Le(x,!0,K),ot(x,K,a,!1,!0),ze=x.result),ke?Je(x,Z,Ee,Be,De,ze,fe,Q,k):he?Z.push(Je(x,null,Ee,Be,De,ze,fe,Q,k)):Z.push(De),Le(x,!0,K),Ye=x.input.charCodeAt(x.position),Ye===44?(me=!0,Ye=x.input.charCodeAt(++x.position)):me=!1}_(x,"unexpected end of the stream within a flow collection")}function Qe(x,K){let me,fe=h,Q=!1,k=!1,X=K,Z=0,Ae=!1,H,he=x.input.charCodeAt(x.position);if(he===124)me=!1;else if(he===62)me=!0;else return!1;for(x.kind="scalar",x.result="";he!==0;)if(he=x.input.charCodeAt(++x.position),he===43||he===45)h===fe?fe=he===43?b:g:_(x,"repeat of a chomping mode identifier");else if((H=z(he))>=0)H===0?_(x,"bad explicit indentation width of a block scalar; it cannot be less than one"):k?_(x,"repeat of an indentation width identifier"):(X=K+H-1,k=!0);else break;if(E(he)){do he=x.input.charCodeAt(++x.position);while(E(he));if(he===35)do he=x.input.charCodeAt(++x.position);while(!j(he)&&he!==0)}for(;he!==0;){for(Fe(x),x.lineIndent=0,he=x.input.charCodeAt(x.position);(!k||x.lineIndent<X)&&he===32;)x.lineIndent++,he=x.input.charCodeAt(++x.position);if(!k&&x.lineIndent>X&&(X=x.lineIndent),j(he)){Z++;continue}if(!k&&X===0&&_(x,"missing indentation for block scalar"),x.lineIndent<X){fe===b?x.result+=t.repeat(`
|
|
19
|
+
`,Q?1+Z:Z):fe===h&&Q&&(x.result+=`
|
|
20
|
+
`);break}me?E(he)?(Ae=!0,x.result+=t.repeat(`
|
|
21
|
+
`,Q?1+Z:Z)):Ae?(Ae=!1,x.result+=t.repeat(`
|
|
22
|
+
`,Z+1)):Z===0?Q&&(x.result+=" "):x.result+=t.repeat(`
|
|
23
|
+
`,Z):x.result+=t.repeat(`
|
|
24
|
+
`,Q?1+Z:Z),Q=!0,k=!0,Z=0;const oe=x.position;for(;!j(he)&&he!==0;)he=x.input.charCodeAt(++x.position);Ne(x,oe,x.position,!1)}return!0}function gt(x,K){const me=x.tag,fe=x.anchor,Q=[];let k=!1;if(x.firstTabInLine!==-1)return!1;x.anchor!==null&&de(x,x.anchor,Q);let X=x.input.charCodeAt(x.position);for(;X!==0&&(x.firstTabInLine!==-1&&(x.position=x.firstTabInLine,_(x,"tab characters must not be used in indentation")),X===45);){const Z=x.input.charCodeAt(x.position+1);if(!O(Z))break;if(k=!0,x.position++,Le(x,!0,-1)&&x.lineIndent<=K){Q.push(null),X=x.input.charCodeAt(x.position);continue}const Ae=x.line;if(ot(x,K,u,!1,!0),Q.push(x.result),Le(x,!0,-1),X=x.input.charCodeAt(x.position),(x.line===Ae||x.lineIndent>K)&&X!==0)_(x,"bad indentation of a sequence entry");else if(x.lineIndent<K)break}return k?(x.tag=me,x.anchor=fe,x.kind="sequence",x.result=Q,!0):!1}function Bt(x,K,me){let fe,Q,k,X;const Z=x.tag,Ae=x.anchor,H={},he=Object.create(null);let oe=null,ke=null,Ee=null,De=!1,Be=!1;if(x.firstTabInLine!==-1)return!1;x.anchor!==null&&de(x,x.anchor,H);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 Ye=x.input.charCodeAt(x.position+1),Dn=x.line;if((ze===63||ze===58)&&O(Ye))ze===63?(De&&(Je(x,H,he,oe,ke,null,Q,k,X),oe=ke=Ee=null),Be=!0,De=!0,fe=!0):De?(De=!1,fe=!0):_(x,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),x.position+=1,ze=Ye;else{if(Q=x.line,k=x.lineStart,X=x.position,!ot(x,me,c,!1,!0))break;if(x.line===Dn){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&&(Je(x,H,he,oe,ke,null,Q,k,X),oe=ke=Ee=null),Be=!0,De=!1,fe=!1,oe=x.tag,ke=x.result;else if(Be)_(x,"can not read an implicit mapping pair; a colon is missed");else return x.tag=Z,x.anchor=Ae,!0}else if(Be)_(x,"can not read a block mapping entry; a multiline key may not be an implicit key");else return x.tag=Z,x.anchor=Ae,!0}if((x.line===Dn||x.lineIndent>K)&&(De&&(Q=x.line,k=x.lineStart,X=x.position),ot(x,K,f,!0,fe)&&(De?ke=x.result:Ee=x.result),De||(Je(x,H,he,oe,ke,Ee,Q,k,X),oe=ke=Ee=null),Le(x,!0,-1),ze=x.input.charCodeAt(x.position)),(x.line===Dn||x.lineIndent>K)&&ze!==0)_(x,"bad indentation of a mapping entry");else if(x.lineIndent<K)break}return De&&Je(x,H,he,oe,ke,null,Q,k,X),Be&&(x.tag=Z,x.anchor=Ae,x.kind="mapping",x.result=H),Be}function sn(x){let K=!1,me=!1,fe,Q,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?(K=!0,k=x.input.charCodeAt(++x.position)):k===33?(me=!0,fe="!!",k=x.input.charCodeAt(++x.position)):fe="!";let X=x.position;if(K){do k=x.input.charCodeAt(++x.position);while(k!==0&&k!==62);x.position<x.length?(Q=x.input.slice(X,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&&(me?_(x,"tag suffix cannot contain exclamation marks"):(fe=x.input.slice(X-1,x.position+1),C.test(fe)||_(x,"named tag handle cannot contain such characters"),me=!0,X=x.position+1)),k=x.input.charCodeAt(++x.position);Q=x.input.slice(X,x.position),A.test(Q)&&_(x,"tag suffix cannot contain flow indicator characters")}Q&&!T.test(Q)&&_(x,"tag name cannot contain such characters: "+Q);try{Q=decodeURIComponent(Q)}catch{_(x,"tag name is malformed: "+Q)}return K?x.tag=Q:s.call(x.tagMap,fe)?x.tag=x.tagMap[fe]+Q:fe==="!"?x.tag="!"+Q:fe==="!!"?x.tag="tag:yaml.org,2002:"+Q:_(x,'undeclared tag handle "'+fe+'"'),!0}function ln(x){let K=x.input.charCodeAt(x.position);if(K!==38)return!1;x.anchor!==null&&_(x,"duplication of an anchor property"),K=x.input.charCodeAt(++x.position);const me=x.position;for(;K!==0&&!O(K)&&!D(K);)K=x.input.charCodeAt(++x.position);return x.position===me&&_(x,"name of an anchor node must contain at least one character"),x.anchor=x.input.slice(me,x.position),!0}function Hn(x){let K=x.input.charCodeAt(x.position);if(K!==42)return!1;K=x.input.charCodeAt(++x.position);const me=x.position;for(;K!==0&&!O(K)&&!D(K);)K=x.input.charCodeAt(++x.position);x.position===me&&_(x,"name of an alias node must contain at least one character");const fe=x.input.slice(me,x.position);return s.call(x.anchorMap,fe)||_(x,'unidentified alias "'+fe+'"'),x.result=x.anchorMap[fe],Le(x,!0,-1),!0}function gn(x,K,me,fe){const Q=V(x);return $(x),ue(x,K),x.tag=null,x.anchor=null,x.kind=null,x.result=null,Bt(x,me,fe)&&x.kind==="mapping"?(ne(x),!0):(L(x),ue(x,Q),!1)}function ot(x,K,me,fe,Q){let k,X,Z=1,Ae=!1,H=!1,he=null,oe,ke,Ee;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=X=f===me||u===me;if(fe&&Le(x,!0,-1)&&(Ae=!0,x.lineIndent>K?Z=1:x.lineIndent===K?Z=0:x.lineIndent<K&&(Z=-1)),Z===1)for(;;){const Be=x.input.charCodeAt(x.position),ze=V(x);if(Ae&&(Be===33&&x.tag!==null||Be===38&&x.anchor!==null)||!sn(x)&&!ln(x))break;he===null&&(he=ze),Le(x,!0,-1)?(Ae=!0,X=De,x.lineIndent>K?Z=1:x.lineIndent===K?Z=0:x.lineIndent<K&&(Z=-1)):X=!1}if(X&&(X=Ae||Q),Z===1||f===me)if(a===me||c===me?ke=K:ke=K+1,Ee=x.position-x.lineStart,Z===1)if(X&&(gt(x,Ee)||Bt(x,Ee,ke))||Ie(x,ke))H=!0;else{const Be=x.input.charCodeAt(x.position);he!==null&&De&&!X&&Be!==124&&Be!==62&&gn(x,he,he.position-he.lineStart,ke)||k&&Qe(x,ke)||ge(x,ke)||Te(x,ke)?H=!0:Hn(x)?(H=!0,(x.tag!==null||x.anchor!==null)&&_(x,"alias node should not have any properties")):le(x,ke,a===me)&&(H=!0,x.tag===null&&(x.tag="?")),x.anchor!==null&&de(x,x.anchor,x.result)}else Z===0&&(H=X&>(x,Ee));if(x.tag===null)x.anchor!==null&&de(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 Be=0,ze=x.implicitTypes.length;Be<ze;Be+=1)if(oe=x.implicitTypes[Be],oe.resolve(x.result)){x.result=oe.construct(x.result),x.tag=oe.tag,x.anchor!==null&&de(x,x.anchor,x.result);break}}else if(x.tag!=="!"){if(s.call(x.typeMap[x.kind||"fallback"],x.tag))oe=x.typeMap[x.kind||"fallback"][x.tag];else{oe=null;const Be=x.typeMap.multi[x.kind||"fallback"];for(let ze=0,Ye=Be.length;ze<Ye;ze+=1)if(x.tag.slice(0,Be[ze].tag.length)===Be[ze].tag){oe=Be[ze];break}}oe||_(x,"unknown tag !<"+x.tag+">"),x.result!==null&&oe.kind!==x.kind&&_(x,"unacceptable node kind for !<"+x.tag+'> tag; it should be "'+oe.kind+'", not "'+x.kind+'"'),oe.resolve(x.result,x.tag)?(x.result=oe.construct(x.result,x.tag),x.anchor!==null&&de(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||H}function Wn(x){const K=x.position;let me=!1,fe;for(x.version=null,x.checkLineBreaks=x.legacy,x.tagMap=Object.create(null),x.anchorMap=Object.create(null);(fe=x.input.charCodeAt(x.position))!==0&&(Le(x,!0,-1),fe=x.input.charCodeAt(x.position),!(x.lineIndent>0||fe!==37));){me=!0,fe=x.input.charCodeAt(++x.position);let Q=x.position;for(;fe!==0&&!O(fe);)fe=x.input.charCodeAt(++x.position);const k=x.input.slice(Q,x.position),X=[];for(k.length<1&&_(x,"directive name must not be less than one character in length");fe!==0;){for(;E(fe);)fe=x.input.charCodeAt(++x.position);if(fe===35){do fe=x.input.charCodeAt(++x.position);while(fe!==0&&!j(fe));break}if(j(fe))break;for(Q=x.position;fe!==0&&!O(fe);)fe=x.input.charCodeAt(++x.position);X.push(x.input.slice(Q,x.position))}fe!==0&&Fe(x),s.call(ve,k)?ve[k](x,k,X):ee(x,'unknown document directive "'+k+'"')}if(Le(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,Le(x,!0,-1)):me&&_(x,"directives end mark is expected"),ot(x,x.lineIndent-1,f,!1,!0),Le(x,!0,-1),x.checkLineBreaks&&S.test(x.input.slice(K,x.position))&&ee(x,"non-ASCII line breaks are interpreted as content"),x.documents.push(x.result),x.position===x.lineStart&&dt(x)){x.input.charCodeAt(x.position)===46&&(x.position+=3,Le(x,!0,-1));return}x.position<x.length-1&&_(x,"end of the stream or a document separator is expected")}function Rn(x,K){x=String(x),K=K||{},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 me=new ye(x,K),fe=x.indexOf("\0");for(fe!==-1&&(me.position=fe,_(me,"null byte is not allowed in input")),me.input+="\0";me.input.charCodeAt(me.position)===32;)me.lineIndent+=1,me.position+=1;for(;me.position<me.length-1;)Wn(me);return me.documents}function Zn(x,K,me){K!==null&&typeof K=="object"&&typeof me>"u"&&(me=K,K=null);const fe=Rn(x,me);if(typeof K!="function")return fe;for(let Q=0,k=fe.length;Q<k;Q+=1)K(fe[Q])}function Tt(x,K){const me=Rn(x,K);if(me.length!==0){if(me.length===1)return me[0];throw new e("expected a single document in the stream, but found more")}}return Mo.loadAll=Zn,Mo.load=Tt,Mo}var zd={},o0;function wA(){if(o0)return zd;o0=1;const t=ca(),e=ua(),n=qd(),r=Object.prototype.toString,s=Object.prototype.hasOwnProperty,a=65279,c=9,u=10,f=13,h=32,g=33,b=34,v=35,S=37,A=38,C=39,T=42,R=44,j=45,E=58,O=61,D=62,B=63,M=64,z=91,P=93,J=96,W=123,G=124,Se=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,X){if(X===null)return{};const Z={},Ae=Object.keys(X);for(let H=0,he=Ae.length;H<he;H+=1){let oe=Ae[H],ke=String(X[oe]);oe.slice(0,2)==="!!"&&(oe="tag:yaml.org,2002:"+oe.slice(2));const Ee=k.compiledTypeMap.fallback[oe];Ee&&s.call(Ee.styleAliases,ke)&&(ke=Ee.styleAliases[ke]),Z[oe]=ke}return Z}function de(k){let X,Z;const Ae=k.toString(16).toUpperCase();if(k<=255)X="x",Z=2;else if(k<=65535)X="u",Z=4;else if(k<=4294967295)X="U",Z=8;else throw new e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+X+t.repeat("0",Z-Ae.length)+Ae}const $=1,ne=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==='"'?ne:$,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 V(k,X){const Z=t.repeat(" ",X);let Ae=0,H="";const he=k.length;for(;Ae<he;){let oe;const ke=k.indexOf(`
|
|
26
|
+
`,Ae);ke===-1?(oe=k.slice(Ae),Ae=he):(oe=k.slice(Ae,ke+1),Ae=ke+1),oe.length&&oe!==`
|
|
27
|
+
`&&(H+=Z),H+=oe}return H}function ue(k,X){return`
|
|
28
|
+
`+t.repeat(" ",k.indent*X)}function ve(k,X){for(let Z=0,Ae=k.implicitTypes.length;Z<Ae;Z+=1)if(k.implicitTypes[Z].resolve(X))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 qe(k){return Re(k)&&k!==a&&k!==f&&k!==u}function Je(k,X,Z){const Ae=qe(k),H=Ae&&!Ne(k);return(Z?Ae:Ae&&k!==R&&k!==z&&k!==P&&k!==W&&k!==Se)&&k!==v&&!(X===E&&!H)||qe(X)&&!Ne(X)&&k===v||X===E&&H}function Fe(k){return Re(k)&&k!==a&&!Ne(k)&&k!==j&&k!==B&&k!==E&&k!==R&&k!==z&&k!==P&&k!==W&&k!==Se&&k!==v&&k!==A&&k!==T&&k!==g&&k!==G&&k!==O&&k!==D&&k!==C&&k!==b&&k!==S&&k!==M&&k!==J}function Le(k){return!Ne(k)&&k!==E}function dt(k,X){const Z=k.charCodeAt(X);let Ae;return Z>=55296&&Z<=56319&&X+1<k.length&&(Ae=k.charCodeAt(X+1),Ae>=56320&&Ae<=57343)?(Z-55296)*1024+Ae-56320+65536:Z}function ae(k){return/^\n* /.test(k)}const le=1,ge=2,Te=3,Ie=4,Qe=5;function gt(k,X,Z,Ae,H,he,oe,ke){let Ee,De=0,Be=null,ze=!1,Ye=!1;const Dn=Ae!==-1;let _n=-1,Kt=Fe(dt(k,0))&&Le(dt(k,k.length-1));if(X||oe)for(Ee=0;Ee<k.length;De>=65536?Ee+=2:Ee++){if(De=dt(k,Ee),!Re(De))return Qe;Kt=Kt&&Je(De,Be,ke),Be=De}else{for(Ee=0;Ee<k.length;De>=65536?Ee+=2:Ee++){if(De=dt(k,Ee),De===u)ze=!0,Dn&&(Ye=Ye||Ee-_n-1>Ae&&k[_n+1]!==" ",_n=Ee);else if(!Re(De))return Qe;Kt=Kt&&Je(De,Be,ke),Be=De}Ye=Ye||Dn&&Ee-_n-1>Ae&&k[_n+1]!==" "}return!ze&&!Ye?Kt&&!oe&&!H(k)?le:he===ne?Qe:ge:Z>9&&ae(k)?Qe:oe?he===ne?Qe:ge:Ye?Ie:Te}function Bt(k,X,Z,Ae,H){k.dump=(function(){if(X.length===0)return k.quotingType===ne?'""':"''";if(!k.noCompatMode&&(xe.indexOf(X)!==-1||_.test(X)))return k.quotingType===ne?'"'+X+'"':"'"+X+"'";const he=k.indent*Math.max(1,Z),oe=k.lineWidth===-1?-1:Math.max(Math.min(k.lineWidth,40),k.lineWidth-he),ke=Ae||k.flowLevel>-1&&Z>=k.flowLevel;function Ee(De){return ve(k,De)}switch(gt(X,ke,k.indent,oe,Ee,k.quotingType,k.forceQuotes&&!Ae,H)){case le:return X;case ge:return"'"+X.replace(/'/g,"''")+"'";case Te:return"|"+sn(X,k.indent)+ln(V(X,he));case Ie:return">"+sn(X,k.indent)+ln(V(Hn(X,oe),he));case Qe:return'"'+ot(X)+'"';default:throw new e("impossible error: invalid scalar style")}})()}function sn(k,X){const Z=ae(k)?String(X):"",Ae=k[k.length-1]===`
|
|
29
|
+
`,he=Ae&&(k[k.length-2]===`
|
|
30
|
+
`||k===`
|
|
31
|
+
`)?"+":Ae?"":"-";return Z+he+`
|
|
32
|
+
`}function ln(k){return k[k.length-1]===`
|
|
33
|
+
`?k.slice(0,-1):k}function Hn(k,X){const Z=/(\n+)([^\n]*)/g;let Ae=(function(){let ke=k.indexOf(`
|
|
34
|
+
`);return ke=ke!==-1?ke:k.length,Z.lastIndex=ke,gn(k.slice(0,ke),X)})(),H=k[0]===`
|
|
35
|
+
`||k[0]===" ",he,oe;for(;oe=Z.exec(k);){const ke=oe[1],Ee=oe[2];he=Ee[0]===" ",Ae+=ke+(!H&&!he&&Ee!==""?`
|
|
36
|
+
`:"")+gn(Ee,X),H=he}return Ae}function gn(k,X){if(k===""||k[0]===" ")return k;const Z=/ [^ ]/g;let Ae,H=0,he,oe=0,ke=0,Ee="";for(;Ae=Z.exec(k);)ke=Ae.index,ke-H>X&&(he=oe>H?oe:ke,Ee+=`
|
|
37
|
+
`+k.slice(H,he),H=he+1),oe=ke;return Ee+=`
|
|
38
|
+
`,k.length-H>X&&oe>H?Ee+=k.slice(H,oe)+`
|
|
39
|
+
`+k.slice(oe+1):Ee+=k.slice(H),Ee.slice(1)}function ot(k){let X="",Z=0;for(let Ae=0;Ae<k.length;Z>=65536?Ae+=2:Ae++){Z=dt(k,Ae);const H=ye[Z];!H&&Re(Z)?(X+=k[Ae],Z>=65536&&(X+=k[Ae+1])):X+=H||de(Z)}return X}function Wn(k,X,Z){let Ae="";const H=k.tag;for(let he=0,oe=Z.length;he<oe;he+=1){let ke=Z[he];k.replacer&&(ke=k.replacer.call(Z,String(he),ke)),(K(k,X,ke,!1,!1)||typeof ke>"u"&&K(k,X,null,!1,!1))&&(Ae!==""&&(Ae+=","+(k.condenseFlow?"":" ")),Ae+=k.dump)}k.tag=H,k.dump="["+Ae+"]"}function Rn(k,X,Z,Ae){let H="";const he=k.tag;for(let oe=0,ke=Z.length;oe<ke;oe+=1){let Ee=Z[oe];k.replacer&&(Ee=k.replacer.call(Z,String(oe),Ee)),(K(k,X+1,Ee,!0,!0,!1,!0)||typeof Ee>"u"&&K(k,X+1,null,!0,!0,!1,!0))&&((!Ae||H!=="")&&(H+=ue(k,X)),k.dump&&u===k.dump.charCodeAt(0)?H+="-":H+="- ",H+=k.dump)}k.tag=he,k.dump=H||"[]"}function Zn(k,X,Z){let Ae="";const H=k.tag,he=Object.keys(Z);for(let oe=0,ke=he.length;oe<ke;oe+=1){let Ee="";Ae!==""&&(Ee+=", "),k.condenseFlow&&(Ee+='"');const De=he[oe];let Be=Z[De];k.replacer&&(Be=k.replacer.call(Z,De,Be)),K(k,X,De,!1,!1)&&(k.dump.length>1024&&(Ee+="? "),Ee+=k.dump+(k.condenseFlow?'"':"")+":"+(k.condenseFlow?"":" "),K(k,X,Be,!1,!1)&&(Ee+=k.dump,Ae+=Ee))}k.tag=H,k.dump="{"+Ae+"}"}function Tt(k,X,Z,Ae){let H="";const he=k.tag,oe=Object.keys(Z);if(k.sortKeys===!0)oe.sort();else if(typeof k.sortKeys=="function")oe.sort(k.sortKeys);else if(k.sortKeys)throw new e("sortKeys must be a boolean or a function");for(let ke=0,Ee=oe.length;ke<Ee;ke+=1){let De="";(!Ae||H!=="")&&(De+=ue(k,X));const Be=oe[ke];let ze=Z[Be];if(k.replacer&&(ze=k.replacer.call(Z,Be,ze)),!K(k,X+1,Be,!0,!0,!0))continue;const Ye=k.tag!==null&&k.tag!=="?"||k.dump&&k.dump.length>1024;Ye&&(k.dump&&u===k.dump.charCodeAt(0)?De+="?":De+="? "),De+=k.dump,Ye&&(De+=ue(k,X)),K(k,X+1,ze,!0,Ye)&&(k.dump&&u===k.dump.charCodeAt(0)?De+=":":De+=": ",De+=k.dump,H+=De)}k.tag=he,k.dump=H||"{}"}function x(k,X,Z){const Ae=Z?k.explicitTypes:k.implicitTypes;for(let H=0,he=Ae.length;H<he;H+=1){const oe=Ae[H];if((oe.instanceOf||oe.predicate)&&(!oe.instanceOf||typeof X=="object"&&X instanceof oe.instanceOf)&&(!oe.predicate||oe.predicate(X))){if(Z?oe.multi&&oe.representName?k.tag=oe.representName(X):k.tag=oe.tag:k.tag="?",oe.represent){const ke=k.styleMap[oe.tag]||oe.defaultStyle;let Ee;if(r.call(oe.represent)==="[object Function]")Ee=oe.represent(X,ke);else if(s.call(oe.represent,ke))Ee=oe.represent[ke](X,ke);else throw new e("!<"+oe.tag+'> tag resolver accepts not "'+ke+'" style');k.dump=Ee}return!0}}return!1}function K(k,X,Z,Ae,H,he,oe){k.tag=null,k.dump=Z,x(k,Z,!1)||x(k,Z,!0);const ke=r.call(k.dump),Ee=Ae;Ae&&(Ae=k.flowLevel<0||k.flowLevel>X);const De=ke==="[object Object]"||ke==="[object Array]";let Be,ze;if(De&&(Be=k.duplicates.indexOf(Z),ze=Be!==-1),(k.tag!==null&&k.tag!=="?"||ze||k.indent!==2&&X>0)&&(H=!1),ze&&k.usedDuplicates[Be])k.dump="*ref_"+Be;else{if(De&&ze&&!k.usedDuplicates[Be]&&(k.usedDuplicates[Be]=!0),ke==="[object Object]")Ae&&Object.keys(k.dump).length!==0?(Tt(k,X,k.dump,H),ze&&(k.dump="&ref_"+Be+k.dump)):(Zn(k,X,k.dump),ze&&(k.dump="&ref_"+Be+" "+k.dump));else if(ke==="[object Array]")Ae&&k.dump.length!==0?(k.noArrayIndent&&!oe&&X>0?Rn(k,X-1,k.dump,H):Rn(k,X,k.dump,H),ze&&(k.dump="&ref_"+Be+k.dump)):(Wn(k,X,k.dump),ze&&(k.dump="&ref_"+Be+" "+k.dump));else if(ke==="[object String]")k.tag!=="?"&&Bt(k,k.dump,X,he,Ee);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 Ye=encodeURI(k.tag[0]==="!"?k.tag.slice(1):k.tag).replace(/!/g,"%21");k.tag[0]==="!"?Ye="!"+Ye:Ye.slice(0,18)==="tag:yaml.org,2002:"?Ye="!!"+Ye.slice(18):Ye="!<"+Ye+">",k.dump=Ye+" "+k.dump}}return!0}function me(k,X){const Z=[],Ae=[];fe(k,Z,Ae);const H=Ae.length;for(let he=0;he<H;he+=1)X.duplicates.push(Z[Ae[he]]);X.usedDuplicates=new Array(H)}function fe(k,X,Z){if(k!==null&&typeof k=="object"){const Ae=X.indexOf(k);if(Ae!==-1)Z.indexOf(Ae)===-1&&Z.push(Ae);else if(X.push(k),Array.isArray(k))for(let H=0,he=k.length;H<he;H+=1)fe(k[H],X,Z);else{const H=Object.keys(k);for(let he=0,oe=H.length;he<oe;he+=1)fe(k[H[he]],X,Z)}}}function Q(k,X){X=X||{};const Z=new L(X);Z.noRefs||me(k,Z);let Ae=k;return Z.replacer&&(Ae=Z.replacer.call({"":Ae},"",Ae)),K(Z,0,Ae,!0,!0)?Z.dump+`
|
|
40
|
+
`:""}return zd.dump=Q,zd}var c0;function SA(){if(c0)return Sn;c0=1;const t=vA(),e=wA();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 Sn.Type=Tn(),Sn.Schema=Tg(),Sn.FAILSAFE_SCHEMA=Lg(),Sn.JSON_SCHEMA=Pg(),Sn.CORE_SCHEMA=Yg(),Sn.DEFAULT_SCHEMA=qd(),Sn.load=t.load,Sn.loadAll=t.loadAll,Sn.dump=e.dump,Sn.YAMLException=ua(),Sn.types={binary:Zg(),float:Fg(),map:Dg(),null:$g(),pairs:i0(),set:s0(),timestamp:Xg(),bool:zg(),int:Ig(),merge:Qg(),omap:t0(),seq:Mg(),str:Eg()},Sn.safeLoad=n("safeLoad","load"),Sn.safeLoadAll=n("safeLoadAll","loadAll"),Sn.safeDump=n("safeDump","dump"),Sn}var AA=SA();const kA=bA(AA),{Type:kD,Schema:CD,FAILSAFE_SCHEMA:ND,JSON_SCHEMA:TD,CORE_SCHEMA:jD,DEFAULT_SCHEMA:ED,load:CA,loadAll:OD,dump:NA,YAMLException:MD,types:RD,safeLoad:DD,safeLoadAll:_D,safeDump:LD}=kA;let Hi=class I2{static async parseSpec(e){let n;if(typeof e=="string"){const r=e.trim();try{n=JSON.parse(r)}catch{try{n=CA(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(I2.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 Bn{static async parseSpec(e){return Hi.parseSpec(e)}static getHttpMethods(e){return Hi.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 Hi.decodePointerToken(e)}static encodePointerToken(e){return Hi.encodePointerToken(e)}static resolveReference(e,n){return Hi.resolveReference(e,n)}static isReference(e){return Hi.isReference(e)}}const TA=({spec:t,onEndpointSelect:e,selectedEndpoint:n=null,theme:r="light",expandedTags:s,onExpandedTagsChange:a,messages:c})=>{const[u,f]=U.useState(""),[h,g]=U.useState(new Set(s?.length?s:["default"])),b=U.useId(),v=U.useRef(null),S=s?new Set(s):h;U.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",R=r==="dark"?"bg-gray-800/50 border-gray-700 text-white":"bg-gray-50 border-gray-100 text-gray-700",j=z=>{const P="text-xs font-bold px-2 py-0.5 rounded border",J={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"?J.dark:J.light;return`${P} ${W[z.toLowerCase()]||W.default}`},E=Object.entries(t.paths).reduce((z,[P,J])=>(Bn.getHttpMethods(J).forEach(W=>{const G=J[W];(G?.tags||["default"]).forEach(ye=>{z[ye]||(z[ye]=[]),z[ye].push({path:P,method:W,operation:G})})}),z),{}),O=u.trim().toLowerCase(),D=O.length>0,B=Object.entries(E).reduce((z,[P,J])=>{const W=J.filter(G=>`${G.method} ${G.path} ${G.operation?.summary||""} ${P}`.toLowerCase().includes(O));return W.length&&(z[P]=W),z},{}),M=z=>{const P=new Set(S);P.has(z)?P.delete(z):P.add(z),s||g(P),a?.([...P])};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(yg,{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:u,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 ${R}`,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 ${R}`,children:[p.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[p.jsx(bg,{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,P)=>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}:${P}`))})]})]})]}),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,P])=>{const J=D||S.has(z);return p.jsxs("div",{className:"mb-4",children:[p.jsxs("button",{type:"button","aria-expanded":J,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:[J?p.jsx(pg,{className:"h-4 w-4 shrink-0 text-gray-400"}):p.jsx(mg,{className:"h-4 w-4 shrink-0 text-gray-400"}),p.jsx(vg,{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:P.length})]}),J&&p.jsx("div",{className:"ml-4 mt-1.5 space-y-1.5 sm:ml-6",children:P.map(({path:W,method:G,operation:Se})=>{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}),Se?.summary&&p.jsx("div",{className:`mt-1 text-xs ${r==="dark"?"text-gray-400":"text-gray-600"}`,children:Se.summary})]},`${G}-${W}`)})})]},z)})]})]})})]})},Ts=["parameters","requestBody","responses","tryIt","codeSamples"],Hd={all:Ts,none:[],minimal:[],documentation:["parameters","requestBody","responses"],interactive:["parameters","requestBody","tryIt","codeSamples"]},jA=new Set(["minimal","documentation","interactive"]),u0=new Set(Ts),EA=new Set(Object.keys(Hd)),OA=new Set(["light","dark","high-contrast"]);function MA(t){return typeof t=="string"?EA.has(t):Array.isArray(t)&&t.every(e=>typeof e=="string"&&(u0.has(e)||jA.has(e)))}function RA(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"),Ts.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)u0.has(r)?n.add(r):RA(n,r);return Ts.filter(r=>n.has(r))}function DA(t,e){return`flexdoc:viewer:${encodeURIComponent(e?.trim()||"unknown-host")}:${encodeURIComponent(t?.trim()||"untitled")}`}function Dr(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&&!MA(s.expand)?{version:1}:s.sidebarCollapsed!==void 0&&typeof s.sidebarCollapsed!="boolean"?{version:1}:s.theme!==void 0&&(typeof s.theme!="string"||!OA.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 _A(t,e,n){const s={...Dr(t)};e===void 0?delete s.expand:s.expand=e,Ro(t,s)}function LA(t,e,n){const s={...Dr(t)};e===void 0?delete s.sidebarCollapsed:s.sidebarCollapsed=e,Ro(t,s)}function BA(t,e,n){const s={...Dr(t)};e===void 0?delete s.theme:s.theme=e,Ro(t,s)}function $A(t,e,n){const s={...Dr(t)};e===void 0?delete s.expandedTags:s.expandedTags=[...new Set(e)],Ro(t,s)}function _r(t,e){if(e)return Hi.isReference(e)?Hi.resolveReference(t,e.$ref):e}function qA(t,e){const n=t.paths[e];if(!n)throw new Error(`Path not found: ${e}`);return _r(t,n)}function zA(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=qA(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=>_r(t,f)).filter(f=>!!f),c=new Map;for(const f of a)c.set(`${f.in}:${f.name}`,f);const u={};for(const[f,h]of Object.entries(s.responses||{})){const g=_r(t,h);g&&(u[f]=g)}return{path:e,method:n.toUpperCase(),pathItem:r,operation:s,parameters:[...c.values()],requestBody:_r(t,s.requestBody),responses:u,servers:s.servers||r.servers||t.servers||[],security:s.security!==void 0?s.security:t.security||[]}}function HA(t,e,n){return Ud(t,e,n).parameters}function IA(t,e){return _r(t,e.schema)}function UA(t,e){if(e.example!==void 0)return e.example;const n=IA(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 FA(t,e,n){const r=Ud(t,e,n),s={parameters:{},headers:{},cookies:{},auth:{}};for(const u of r.parameters){const f=u.in==="header"?s.headers:u.in==="cookie"?s.cookies:s.parameters;f[u.name]=UA(t,u)}const a=r.requestBody,c=a?Object.keys(a.content||{})[0]:void 0;if(c){s.contentType=c;const u=a.content[c],f=_r(t,u.schema),h=u.examples?Object.values(u.examples)[0]:void 0,g=_r(t,h),b=u.example??g?.value??f?.example??f?.examples?.[0]??f?.default;s.body=b!==void 0?JSON.stringify(b,null,2):""}return s}function on(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 d0(t,e=!1){const n=on(t);return e?encodeURI(n).replace(/%5B/g,"[").replace(/%5D/g,"]"):encodeURIComponent(n)}function f0(t,e=!1){const n=Fd(t);if(Array.isArray(n))return n.map(on).join(",");if(n&&typeof n=="object"){const r=Object.entries(n);return e?r.map(([s,a])=>`${s}=${on(a)}`).join(","):r.flatMap(([s,a])=>[s,on(a)]).join(",")}return on(n)}function VA(t,e){const n=t.style||"simple",r=t.explode??!1,s=Fd(e),a=u=>d0(u,t.allowReserved);if(Array.isArray(s)){const u=s.map(a);return n==="label"?`.${u.join(r?".":",")}`:n==="matrix"?r?u.map(f=>`;${t.name}=${f}`).join(""):`;${t.name}=${u.join(",")}`:u.join(",")}if(s&&typeof s=="object"){const u=Object.entries(s).map(([f,h])=>[a(f),a(h)]);return n==="label"?r?`.${u.map(([f,h])=>`${f}=${h}`).join(".")}`:`.${u.flatMap(([f,h])=>[f,h]).join(",")}`:n==="matrix"?r?u.map(([f,h])=>`;${f}=${h}`).join(""):`;${t.name}=${u.flatMap(([f,h])=>[f,h]).join(",")}`:r?u.map(([f,h])=>`${f}=${h}`).join(","):u.flatMap(([f,h])=>[f,h]).join(",")}const c=a(s);return n==="label"?`.${c}`:n==="matrix"?`;${t.name}=${c}`:c}function PA(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}]`,on(c)]);if(Array.isArray(s))return n==="spaceDelimited"?[[t.name,s.map(on).join(" ")]]:n==="pipeDelimited"?[[t.name,s.map(on).join("|")]]:r?s.map(a=>[t.name,on(a)]):[[t.name,s.map(on).join(",")]];if(s&&typeof s=="object"){const a=Object.entries(s);return r?a.map(([c,u])=>[c,on(u)]):[[t.name,a.flatMap(([c,u])=>[c,on(u)]).join(",")]]}return[[t.name,on(s)]]}function KA(t){return typeof globalThis.btoa=="function"?globalThis.btoa(unescape(encodeURIComponent(t))):t}function YA(t,e){return Object.keys(t).every(n=>!!e[n])}function GA(t,e,n,r,s,a){if(!e.length||!t.components?.securitySchemes)return;const c=e.find(u=>Object.keys(u).length===0||YA(u,a))||e[0];for(const u of Object.keys(c)){const f=_r(t,t.components.securitySchemes[u]),h=a[u];!f||!h||(f.type==="http"&&f.scheme?.toLowerCase()==="bearer"?n.Authorization=`Bearer ${h}`:f.type==="http"&&f.scheme?.toLowerCase()==="basic"?n.Authorization=`Basic ${KA(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 h0(t){try{const e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}catch{return}}function XA(t,e,n,r={}){const s=Ud(t,e,n),a=s.servers[0],c=r.serverUrl||(a?zA(a,r.serverVariables):"");let u=e;const f=[],h={...r.headers||{}},g=[];for(const T of s.parameters){const R=T.in==="header"?r.headers?.[T.name]:T.in==="cookie"?r.cookies?.[T.name]:r.parameters?.[T.name];if(!(R===void 0||R===""))if(T.in==="path")u=u.replace(`{${T.name}}`,VA(T,R));else if(T.in==="query")for(const[j,E]of PA(T,R))f.push(`${encodeURIComponent(j)}=${d0(E,T.allowReserved)}`);else T.in==="header"?h[T.name]=f0(R,T.explode):T.in==="cookie"&&g.push(`${T.name}=${encodeURIComponent(f0(R,T.explode))}`)}GA(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 R=h0(r.body);b=R?Object.entries(R).flatMap(([j,E])=>Array.isArray(E)?E.map(O=>`${encodeURIComponent(j)}=${encodeURIComponent(on(O))}`):[`${encodeURIComponent(j)}=${encodeURIComponent(on(E))}`]).join("&"):r.body,S=b,v="form",h["Content-Type"]=T}else if(T.startsWith("multipart/form-data")){const R=h0(r.body);if(R&&typeof FormData<"u"){const j=new FormData;for(const[E,O]of Object.entries(R))Array.isArray(O)?O.forEach(D=>j.append(E,on(D))):j.append(E,on(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(/\/$/,"")}${u}${A?`?${A}`:""}`,method:s.method,headers:h,body:b,bodyKind:v,init:{method:s.method,headers:h,body:S}}}function JA(t,e,n){return HA(t,e,n)}function p0(t,e,n){return FA(t,e,n)}function m0(t,e,n,r={}){return XA(t,e,n,r)}const cn=t=>JSON.stringify(t);function QA(t,e){const n=Object.entries(t.headers);if(e==="curl"){const a=[`curl -X ${t.method} ${cn(t.url)}`];for(const[c,u]of n)a.push(` -H ${cn(`${c}: ${u}`)}`);return t.body&&a.push(` --data-raw ${cn(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(${cn(t.url)}, ${JSON.stringify(a,null,2)});
|
|
42
|
+
const data = await response.json();`}if(e==="python"){const a=["import requests","",`url = ${cn(t.url)}`];return n.length&&a.push(`headers = ${JSON.stringify(t.headers,null,2)}`),t.body&&a.push(`body = ${cn(t.body)}`),a.push(`response = requests.request(${cn(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(${cn(t.body)})`:"nil",c=["package main","","import (",' "fmt"',' "io"',' "net/http"'];t.body&&c.push(' "strings"'),c.push(")","","func main() {",` req, _ := http.NewRequest(${cn(t.method)}, ${cn(t.url)}, ${a})`);for(const[u,f]of n)c.push(` req.Header.Set(${cn(u)}, ${cn(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(${cn(t.url)}))`];for(const[a,c]of n)r.push(` .header(${cn(a)}, ${cn(c)})`);const s=t.body?`HttpRequest.BodyPublishers.ofString(${cn(t.body)})`:"HttpRequest.BodyPublishers.noBody()";return r.push(` .method(${cn(t.method)}, ${s});`,"var response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());","System.out.println(response.body());"),r.join(`
|
|
45
|
+
`)}function WA(t){return{curl:"cURL",javascript:"JavaScript",python:"Python",go:"Go",java:"Java"}[t]}function ZA(t,e){return QA(t,e)}function g0(t){return WA(t)}var Vd={exports:{}},y0;function ek(){return y0||(y0=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={},u={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 D,B;switch(u.util.type(E)){case"Object":if(B=u.util.objId(E),O[B])return O[B];D={},O[B]=D;for(var M in E)E.hasOwnProperty(M)&&(D[M]=j(E[M],O));return D;case"Array":return B=u.util.objId(E),O[B]?O[B]:(D=[],O[B]=D,E.forEach(function(z,P){D[P]=j(z,O)}),D);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(D){var j=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(D.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 D="no-"+E;j;){var B=j.classList;if(B.contains(E))return!0;if(B.contains(D))return!1;j=j.parentElement}return!!O}},languages:{plain:c,plaintext:c,text:c,txt:c,extend:function(j,E){var O=u.util.clone(u.languages[j]);for(var D in E)O[D]=E[D];return O},insertBefore:function(j,E,O,D){D=D||u.languages;var B=D[j],M={};for(var z in B)if(B.hasOwnProperty(z)){if(z==E)for(var P in O)O.hasOwnProperty(P)&&(M[P]=O[P]);O.hasOwnProperty(z)||(M[z]=B[z])}var J=D[j];return D[j]=M,u.languages.DFS(u.languages,function(W,G){G===J&&W!=j&&(this[W]=M)}),M},DFS:function j(E,O,D,B){B=B||{};var M=u.util.objId;for(var z in E)if(E.hasOwnProperty(z)){O.call(E,z,E[z],D||z);var P=E[z],J=u.util.type(P);J==="Object"&&!B[M(P)]?(B[M(P)]=!0,j(P,O,null,B)):J==="Array"&&!B[M(P)]&&(B[M(P)]=!0,j(P,O,z,B))}}},plugins:{},highlightAll:function(j,E){u.highlightAllUnder(document,j,E)},highlightAllUnder:function(j,E,O){var D={callback:O,container:j,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};u.hooks.run("before-highlightall",D),D.elements=Array.prototype.slice.apply(D.container.querySelectorAll(D.selector)),u.hooks.run("before-all-elements-highlight",D);for(var B=0,M;M=D.elements[B++];)u.highlightElement(M,E===!0,D.callback)},highlightElement:function(j,E,O){var D=u.util.getLanguage(j),B=u.languages[D];u.util.setLanguage(j,D);var M=j.parentElement;M&&M.nodeName.toLowerCase()==="pre"&&u.util.setLanguage(M,D);var z=j.textContent,P={element:j,language:D,grammar:B,code:z};function J(G){P.highlightedCode=G,u.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,u.hooks.run("after-highlight",P),u.hooks.run("complete",P),O&&O.call(P.element)}if(u.hooks.run("before-sanity-check",P),M=P.element.parentElement,M&&M.nodeName.toLowerCase()==="pre"&&!M.hasAttribute("tabindex")&&M.setAttribute("tabindex","0"),!P.code){u.hooks.run("complete",P),O&&O.call(P.element);return}if(u.hooks.run("before-highlight",P),!P.grammar){J(u.util.encode(P.code));return}if(E&&r.Worker){var W=new Worker(u.filename);W.onmessage=function(G){J(G.data)},W.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else J(u.highlight(P.code,P.grammar,P.language))},highlight:function(j,E,O){var D={code:j,grammar:E,language:O};if(u.hooks.run("before-tokenize",D),!D.grammar)throw new Error('The language "'+D.language+'" has no grammar.');return D.tokens=u.tokenize(D.code,D.grammar),u.hooks.run("after-tokenize",D),f.stringify(u.util.encode(D.tokens),D.language)},tokenize:function(j,E){var O=E.rest;if(O){for(var D in O)E[D]=O[D];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=u.hooks.all;O[j]=O[j]||[],O[j].push(E)},run:function(j,E){var O=u.hooks.all[j];if(!(!O||!O.length))for(var D=0,B;B=O[D++];)B(E)}},Token:f};r.Prism=u;function f(j,E,O,D){this.type=j,this.content=E,this.alias=O,this.length=(D||"").length|0}f.stringify=function j(E,O){if(typeof E=="string")return E;if(Array.isArray(E)){var D="";return E.forEach(function(J){D+=j(J,O)}),D}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)),u.hooks.run("wrap",B);var z="";for(var P in B.attributes)z+=" "+P+'="'+(B.attributes[P]||"").replace(/"/g,""")+'"';return"<"+B.tag+' class="'+B.classes.join(" ")+'"'+z+">"+B.content+"</"+B.tag+">"};function h(j,E,O,D){j.lastIndex=E;var B=j.exec(O);if(B&&D&&B[1]){var M=B[1].length;B.index+=M,B[0]=B[0].slice(M)}return B}function g(j,E,O,D,B,M){for(var z in O)if(!(!O.hasOwnProperty(z)||!O[z])){var P=O[z];P=Array.isArray(P)?P:[P];for(var J=0;J<P.length;++J){if(M&&M.cause==z+","+J)return;var W=P[J],G=W.inside,Se=!!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,de=D.next,$=B;de!==E.tail&&!(M&&$>=M.reach);$+=de.value.length,de=de.next){var ne=de.value;if(E.length>j.length)return;if(!(ne instanceof f)){var L=1,V;if(ye){if(V=h(ee,$,j,Se),!V||V.index>=j.length)break;var Re=V.index,ue=V.index+V[0].length,ve=$;for(ve+=de.value.length;Re>=ve;)de=de.next,ve+=de.value.length;if(ve-=de.value.length,$=ve,de.value instanceof f)continue;for(var Ne=de;Ne!==E.tail&&(ve<ue||typeof Ne.value=="string");Ne=Ne.next)L++,ve+=Ne.value.length;L--,ne=j.slice($,ve),V.index-=$}else if(V=h(ee,0,ne,Se),!V)continue;var Re=V.index,qe=V[0],Je=ne.slice(0,Re),Fe=ne.slice(Re+qe.length),Le=$+ne.length;M&&Le>M.reach&&(M.reach=Le);var dt=de.prev;Je&&(dt=v(E,dt,Je),$+=Je.length),S(E,dt,L);var ae=new f(z,G?u.tokenize(qe,G):qe,xe,qe);if(de=v(E,dt,ae),Fe&&v(E,de,Fe),L>1){var le={cause:z+","+J,reach:Le};g(j,E,O,de.prev,$,le),M&&le.reach>M.reach&&(M.reach=le.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 D=E.next,B={value:O,prev:E,next:D};return E.next=B,D.prev=B,j.length++,B}function S(j,E,O){for(var D=E.next,B=0;B<O&&D!==j.tail;B++)D=D.next;E.next=D,D.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&&(u.disableWorkerMessageHandler||r.addEventListener("message",function(j){var E=JSON.parse(j.data),O=E.language,D=E.code,B=E.immediateClose;r.postMessage(u.highlight(D,u.languages[O],O)),B&&r.close()},!1)),u;var C=u.util.currentScript();C&&(u.filename=C.src,C.hasAttribute("data-manual")&&(u.manual=!0));function T(){u.manual||u.highlightAll()}if(!u.manual){var R=document.readyState;R==="loading"||R==="interactive"&&C&&C.defer?document.addEventListener("DOMContentLoaded",T):window.requestAnimationFrame?window.requestAnimationFrame(T):window.setTimeout(T,16)}return u})(e);t.exports&&(t.exports=n),typeof Jm<"u"&&(Jm.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 u={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:c}};u["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:u},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"},u="data-src-status",f="loading",h="loaded",g="failed",b="pre[data-src]:not(["+u+'="'+h+'"]):not(['+u+'="'+f+'"])';function v(C,T,R){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?R(s(j.status,j.statusText)):R(a))},j.send(null)}function S(C){var T=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(C||"");if(T){var R=Number(T[1]),j=T[2],E=T[3];return j?E?[R,Number(E)]:[R,void 0]:[R,R]}}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(u,f);var R=T.appendChild(document.createElement("CODE"));R.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(R,E),n.util.setLanguage(T,E);var D=n.plugins.autoloader;D&&D.loadLanguages(E),v(j,function(B){T.setAttribute(u,h);var M=S(T.getAttribute("data-range"));if(M){var z=B.split(/\r\n?|\n/g),P=M[0],J=M[1]==null?z.length:M[1];P<0&&(P+=z.length),P=Math.max(0,Math.min(P-1,z.length)),J<0&&(J+=z.length),J=Math.max(0,Math.min(J,z.length)),B=z.slice(P,J).join(`
|
|
46
|
+
`),T.hasAttribute("data-start")||T.setAttribute("data-start",String(P+1))}R.textContent=B,n.highlightElement(R)},function(B){T.setAttribute(u,g),R.textContent=B})}}),n.plugins.fileHighlight={highlight:function(T){for(var R=(T||document).querySelectorAll(b),j=0,E;E=R[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 tk=ek();const nk=Qm(tk);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(u,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 u});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 b0={},x0;function ik(){return x0||(x0=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),b0}ik(),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 v0={},w0;function rk(){return w0||(w0=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)),v0}rk();const Lr=({code:t,language:e,title:n,showCopy:r=!0,theme:s="dark",wrap:a=!1})=>{const[c,u]=cg.useState(!1);U.useEffect(()=>{nk.highlightAll()},[t,s]);const f=async()=>{try{await navigator.clipboard.writeText(t),u(!0),setTimeout(()=>u(!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(hg,{className:"w-3 h-3"}),p.jsx("span",{children:"Copied"})]}):p.jsxs(p.Fragment,{children:[p.jsx(rA,{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 sk(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 Br=({spec:t,schema:e,theme:n,required:r=!1,level:s=0,seen:a=new Set,requiredPropsFirst:c=!1,sortPropsAlphabetically:u=!1})=>{const f={spec:t,theme:n,requiredPropsFirst:c,sortPropsAlphabetically:u};if(Bn.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=Bn.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(Br,{...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 u?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:sk(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(Lr,{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(Br,{...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,R)=>p.jsx(Br,{...f,schema:T,level:s+1,seen:a},R))})]},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(Br,{...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(Br,{...f,schema:e.additionalProperties,level:s+1,seen:a})]})]})};function un(t){return{preRequest:t?.preRequest||"",tests:t?.tests||""}}function lk(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 nl(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)=>nl(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)&&nl(n[c],r[c]))}return!1}function ci(t){throw new Error(t)}function ak(t){const e=h=>{Object.is(t,h)||ci(`expected ${Wt(t)} to equal ${Wt(h)}`)},n=h=>{nl(t,h)||ci(`expected ${Wt(t)} to deeply equal ${Wt(h)}`)},r=h=>{(typeof t=="string"?t.includes(String(h)):Array.isArray(t)&&t.some(b=>nl(b,h)))||ci(`expected ${Wt(t)} to include ${Wt(h)}`)},s=(h,...g)=>{(!t||typeof t!="object"||!Object.prototype.hasOwnProperty.call(t,h))&&ci(`expected value to have property ${h}`),g.length>0&&!nl(t[h],g[0])&&ci(`expected property ${h} to equal ${Wt(g[0])}`)},f={above:h=>{(typeof t!="number"||t<=h)&&ci(`expected ${Wt(t)} to be above ${h}`)},below:h=>{(typeof t!="number"||t>=h)&&ci(`expected ${Wt(t)} to be below ${h}`)},oneOf:h=>{h.some(g=>nl(t,g))||ci(`expected ${Wt(t)} to be one of ${Wt(h)}`)}};return Object.defineProperties(f,{ok:{get:()=>(t||ci(`expected ${Wt(t)} to be truthy`),!0)},true:{get:()=>(t!==!0&&ci(`expected ${Wt(t)} to be true`),!0)},false:{get:()=>(t!==!1&&ci(`expected ${Wt(t)} to be false`),!0)}}),{to:{equal:e,eql:n,include:r,match:h=>{(typeof t!="string"||!h.test(t))&&ci(`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 ok(t){const e=()=>t.headers||(t.headers=[]),n=(r,s)=>{const a=e(),c=Pd(a,r),u={key:r,value:String(s),enabled:!0};c>=0?a[c]=u:a.push(u)};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 ck(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 S0(t){const e=lk(t.draft),n=Do(t.variables||{}),r=Do(t.collectionVariables||{}),s=Do(t.externalVariables||{}),a=Do(t.environmentVariables||{}),c=[],u=[],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,D){const B=String(D);a[O]=B,n[O]=B,u.push({action:"set",key:O,value:B})},unset(O){delete a[O],b(O),u.push({action:"unset",key:O})},replaceIn(O){return O.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(D,B)=>{const M=B.trim();return Object.prototype.hasOwnProperty.call(a,M)?a[M]:D})}},S={get(O){return r[O]},has(O){return Object.prototype.hasOwnProperty.call(r,O)},set(O,D){const B=String(D);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,(D,B)=>{const M=B.trim();return Object.prototype.hasOwnProperty.call(r,M)?r[M]:D})}},A={get(O){return n[O]},has(O){return Object.prototype.hasOwnProperty.call(n,O)},set(O,D){n[O]=String(D)},unset(O){delete n[O]},replaceIn(O){return O.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(D,B)=>{const M=B.trim();return Object.prototype.hasOwnProperty.call(n,M)?n[M]:D})}},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:ok(e),body:C},R=t.response?{code:t.response.status,status:t.response.statusText,responseTime:t.response.responseTime,headers:ck(t.response.headers),text:()=>t.response?.body||"",json:()=>JSON.parse(t.response?.body||"")}:void 0,j={request:T,response:R,environment:v,collection:S,variables:A,expect:ak,test(O,D){if(t.phase!=="tests")throw new Error("flex.test is only available in post-response test scripts.");const B=Promise.resolve().then(D).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:u,tests:f,logs:h}}catch(O){return await Promise.all(g),{draft:e,variables:n,collectionVariables:r,externalVariables:s,environmentVariables:a,collectionChanges:c,environmentChanges:u,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 A0(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 k0(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 uk(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:u,value:f})=>`${encodeURIComponent(u)}=${encodeURIComponent(f)}`).join("&"),c=r.includes("?")?r.endsWith("?")||r.endsWith("&")?"":"&":"?";return`${r}${c}${a}${s}`}function dk(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((u,f)=>a.push({key:f,value:u})),{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 fk(t){const e={};for(const[n,r]of t)e[n]=r;return e}function hk(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 pk(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 Ve(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 mk(t,e){if(!t||t.type==="none"||t.type==="inherit")return t;if(t.type==="bearer")return{type:"bearer",token:Ve(t.token,e)||""};if(t.type==="oauth2"){const n={...t,accessToken:Ve(t.accessToken,e)||""};return t.authorizationUrl!==void 0&&(n.authorizationUrl=Ve(t.authorizationUrl,e)),t.tokenUrl!==void 0&&(n.tokenUrl=Ve(t.tokenUrl,e)),t.clientId!==void 0&&(n.clientId=Ve(t.clientId,e)),t.clientSecret!==void 0&&(n.clientSecret=Ve(t.clientSecret,e)),t.redirectUri!==void 0&&(n.redirectUri=Ve(t.redirectUri,e)),t.scopes!==void 0&&(n.scopes=t.scopes.map(r=>Ve(r,e)||"")),t.username!==void 0&&(n.username=Ve(t.username,e)),t.password!==void 0&&(n.password=Ve(t.password,e)),t.refreshToken!==void 0&&(n.refreshToken=Ve(t.refreshToken,e)),n}return t.type==="basic"?{type:"basic",username:Ve(t.username,e)||"",password:Ve(t.password,e)||""}:t.type==="apiKey"?{type:"apiKey",key:Ve(t.key,e)||"",value:Ve(t.value,e)||"",in:t.in}:t.type==="digest"?{type:"digest",username:Ve(t.username,e)||"",password:Ve(t.password,e)||""}:t.type==="hawk"?{...t,id:Ve(t.id,e)||"",key:Ve(t.key,e)||"",ext:Ve(t.ext,e)}:t.type==="ntlm"?{...t,username:Ve(t.username,e)||"",password:Ve(t.password,e)||"",domain:Ve(t.domain,e),workstation:Ve(t.workstation,e)}:t.type==="oauth1"?{...t,consumerKey:Ve(t.consumerKey,e)||"",consumerSecret:Ve(t.consumerSecret,e)||"",token:Ve(t.token,e),tokenSecret:Ve(t.tokenSecret,e),realm:Ve(t.realm,e)}:{...t,accessKey:Ve(t.accessKey,e)||"",secretKey:Ve(t.secretKey,e)||"",sessionToken:Ve(t.sessionToken,e),region:Ve(t.region,e)||"",service:Ve(t.service,e)||""}}function C0(t,e){return{method:Ve(t.method,e)??t.method,url:Ve(t.url,e)??t.url,query:t.query?.map(n=>({...n,key:Ve(n.key,e)||"",value:Ve(n.value,e)||""})),headers:t.headers?.map(n=>({...n,key:Ve(n.key,e)||"",value:Ve(n.value,e)||""})),body:Ve(t.body,e),contentType:Ve(t.contentType,e),bodyMode:t.bodyMode,urlencoded:t.urlencoded?.map(n=>({...n,key:Ve(n.key,e)||"",value:Ve(n.value,e)||""})),formData:t.formData?.map(n=>({...n,key:Ve(n.key,e)||"",value:Ve(n.value,e)||"",fileName:Ve(n.fileName,e),contentType:Ve(n.contentType,e)})),binary:t.binary?{...t.binary,fileName:Ve(t.binary.fileName,e),contentType:Ve(t.binary.contentType,e)}:void 0,graphql:t.graphql?{query:Ve(t.graphql.query,e)||"",variables:Ve(t.graphql.variables,e)||""}:void 0,auth:mk(t.auth,e),hostExecution:t.hostExecution?{...t.hostExecution}:void 0}}function gk(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 ${pk(`${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 yk(t,e={}){const n=e.variables?C0(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=k0(n);if(a.length>0)throw new Error(`This request requires API host execution (${a.join(", ")}).`);const c=Kd(n.query),u=Kd(n.headers).map(({key:A,value:C})=>[A,C]);gk(n,u,c);let f,h,g;const b=A0(n);if(b!=="none"){if(b==="formdata")for(let T=u.length-1;T>=0;T-=1)u[T][0].toLowerCase()==="content-type"&&u.splice(T,1);const A=Yd(u,"Content-Type"),C=n.contentType?.trim();if(b==="urlencoded")f=Kd(n.urlencoded).map(({key:R,value:j})=>`${encodeURIComponent(R)}=${encodeURIComponent(j)}`).join("&"),g=f,A||u.push(["Content-Type",C||"application/x-www-form-urlencoded"]),h="form";else if(b==="formdata"){const T=new FormData,R=[];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),R.push(`${j.key}=[file: ${j.fileName||j.file.name}]`)}else T.append(j.key,j.value),R.push(`${j.key}=${j.value}`);f=R.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||u.push(["Content-Type",C||T.contentType||T.file.type||"application/octet-stream"]),h="binary"}else if(b==="graphql"){const T=n.graphql?.query||"",R=n.graphql?.variables?.trim()||"";let j={};if(R)try{j=JSON.parse(R)}catch{throw new Error("GraphQL variables must be valid JSON.")}f=JSON.stringify({query:T,variables:j}),g=f,A||u.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)&&u.push(["Content-Type",C||T]),h=b==="json"||(A||C||T)?.includes("json")?"json":"text"}}const v=fk(u);return{url:uk(s,c),method:r,headers:v,headerEntries:u,body:f,bodyKind:h,init:{method:r,headers:u,body:g}}}function bk(t){const e=hk(t),n=dk(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 N0(t,e={}){return yk(t,e)}function da(t){return A0(t)}function T0(t){return k0(t)}function xk(t,e){return C0(t,e)}function vk(t){return bk(t)}function wk(t,e,n){return t.paths[e]?.[n.toLowerCase()]}function Sk(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 Ak(t,e,n,r){const a=wk(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 u=a.find(f=>{const h=Object.keys(f);return h.length>0&&h.every(g=>!!r[g])});return u||(a.find(f=>Object.keys(f).length===0)??a[0])}function kk(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 j0(t,e){return{...t,headers:t.headers?.filter(n=>n.key.toLowerCase()!==e.toLowerCase())}}function Ck(t,e){return{...t,query:t.query?.filter(n=>n.key!==e)}}function Nk(t,e,n,r,s){let a=vk(s);const c=Ak(t,e,n,r.auth||{});if(!c||Object.keys(c).length!==1)return a;const u=Object.keys(c)[0],f=Sk(t,u),h=r.auth?.[u]||"";if(!f)return a;if(!h)return{...a,auth:{type:"inherit"}};const g=kk(f,h,c[u]||[]);return g?(g.type==="bearer"||g.type==="oauth2"||g.type==="basic"?a=j0(a,"Authorization"):g.type==="apiKey"&&g.in==="header"?a=j0(a,g.key):g.type==="apiKey"&&g.in==="query"&&(a=Ck(a,g.key)),{...a,auth:g}):a}function Tk(t,e,n,r,s){const a=m0(t,e,n,r);return{request:Nk(t,e,n,r,a),serverUrl:r.serverUrl||s}}const jk="flexdoc-api-client",Ek=1,il="workspaces",Ok="My Collection",E0=100,O0=256*1024;function fa(){return new Date().toISOString()}function jn(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function Ke(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!jn(t)||!Ke(t,"key")||!Ke(t,"value")?!1:t.enabled===void 0||typeof t.enabled=="boolean"}function Mk(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 Rk(t){return!(!jn(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(!jn(t)||typeof t.type!="string")return!1;if(t.type==="none"||t.type==="inherit")return!0;if(t.type==="bearer")return Ke(t,"token");if(t.type==="oauth2"){if(!Ke(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"?Ke(t,"username")&&Ke(t,"password"):t.type==="apiKey"?Ke(t,"key")&&Ke(t,"value")&&(t.in==="header"||t.in==="query"||t.in==="cookie"):t.type==="hawk"?Ke(t,"id")&&Ke(t,"key")&&(t.algorithm===void 0||t.algorithm==="sha1"||t.algorithm==="sha256")&&(t.ext===void 0||typeof t.ext=="string"):t.type==="ntlm"?Ke(t,"username")&&Ke(t,"password")&&(t.domain===void 0||typeof t.domain=="string")&&(t.workstation===void 0||typeof t.workstation=="string"):t.type==="oauth1"?Ke(t,"consumerKey")&&Ke(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"?Ke(t,"accessKey")&&Ke(t,"secretKey")&&Ke(t,"region")&&Ke(t,"service")&&(t.sessionToken===void 0||typeof t.sessionToken=="string"):!1}function M0(t){return!jn(t)||!Ke(t,"method")||!Ke(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(Mk))||t.binary!==void 0&&!Rk(t.binary)||t.graphql!==void 0&&(!jn(t.graphql)||!Ke(t.graphql,"query")||!Ke(t.graphql,"variables"))||t.hostExecution!==void 0&&(!jn(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 R0(t){return jn(t)&&Ke(t,"id")&&Ke(t,"key")&&Ke(t,"value")&&(t.enabled===void 0||typeof t.enabled=="boolean")}function Dk(t){return!jn(t)||!Ke(t,"id")||!Ke(t,"name")||!Ke(t,"createdAt")||!Ke(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(R0):[],createdAt:t.createdAt,updatedAt:t.updatedAt}}function _k(t){return!jn(t)||!Ke(t,"id")||!Ke(t,"collectionId")||t.parentFolderId!==void 0&&typeof t.parentFolderId!="string"||!Ke(t,"name")||!Ke(t,"createdAt")||!Ke(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 Lk(t,e){const n=t.map(_k).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 D0(t){if(!(!jn(t)||!Ke(t,"preRequest")||!Ke(t,"tests")))return{preRequest:t.preRequest,tests:t.tests}}function Bk(t){if(!jn(t)||!Ke(t,"id")||!Ke(t,"collectionId")||t.folderId!==void 0&&typeof t.folderId!="string"||!Ke(t,"name")||!M0(t.request)||!Ke(t,"createdAt")||!Ke(t,"updatedAt"))return null;const e=D0(t.scripts);return{id:t.id,collectionId:t.collectionId,folderId:t.folderId,name:t.name,request:ui(t.request),...e?{scripts:e}:{},createdAt:t.createdAt,updatedAt:t.updatedAt}}function $k(t){return!jn(t)||!Ke(t,"id")||!Ke(t,"name")||!Array.isArray(t.variables)||!Ke(t,"createdAt")||!Ke(t,"updatedAt")?null:{id:t.id,name:t.name,variables:t.variables.filter(R0),createdAt:t.createdAt,updatedAt:t.updatedAt}}function qk(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&typeof t[1]=="string"}function zk(t){return!jn(t)||!Ke(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 Hk(t){if(!jn(t)||!Ke(t,"id")||!M0(t.request)||!Ke(t,"executedMethod")||!Ke(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(qk))||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"||!Ke(t,"createdAt"))return null;const e=D0(t.scripts),n=Array.isArray(t.scriptTests)?t.scriptTests.map(zk).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:ui(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 _0(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 An(t){const e=globalThis.crypto?.randomUUID?.();return e?`${t}-${e}`:`${t}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function L0(t,e){const n=e?.trim()||"unknown-host",r=t?.trim()||"untitled";return`flexdoc:${encodeURIComponent(n)}:${encodeURIComponent(r)}`}function ui(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 rl(){const t=fa();return{version:6,collections:[{id:An("collection"),name:Ok,auth:{type:"none"},variables:[],createdAt:t,updatedAt:t}],folders:[],requests:[],environments:[],history:[]}}function Ik(t){if(!jn(t)||![1,2,3,4,5,6].includes(t.version))return rl();const e=(Array.isArray(t.collections)?t.collections:[]).map(Dk).filter(h=>h!==null);if(e.length===0)return rl();const n=new Set(e.map(h=>h.id)),r=Lk(Array.isArray(t.folders)?t.folders:[],n),s=new Map(r.map(h=>[h.id,h])),a=(Array.isArray(t.requests)?t.requests:[]).map(Bk).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($k).filter(h=>h!==null),u=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(Hk).filter(h=>h!==null).slice(0,E0):[];return{version:6,collections:e,folders:r,requests:a,environments:c,activeEnvironmentId:u,history:f}}function B0(t,e){const n=e.responseBody===void 0?void 0:e.responseBody.slice(0,O0),r=e.responseBodyTruncated===!0||(e.responseBody?.length||0)>O0,s={id:An("history"),collectionId:e.collectionId,folderId:e.folderId,request:ui(e.request),...e.scripts?{scripts:un(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:fa()};return{...t,history:[s,...t.history].slice(0,E0)}}function $0(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 u=t.collections.find(f=>f.id===e);return u&&u.auth.type!=="inherit"?{...u.auth}:{type:"none"}}function q0(t,e){const n=t.collections.find(r=>r.id===e);return _0(n?.variables||[])}function Xd(t){const e=t.environments.find(n=>n.id===t.activeEnvironmentId);return _0(e?.variables||[])}function Jd(t,e){if(!t.activeEnvironmentId||e.length===0)return t;const n=t.environments.findIndex(u=>u.id===t.activeEnvironmentId);if(n<0)return t;let s=t.environments[n].variables.map(u=>({...u})),a=!1;for(const u of e){const f=u.key.trim();if(!f)continue;if(u.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=u.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:An("variable"),key:f,value:g,enabled:!0});a=!0}if(!a)return t;const c=t.environments.map((u,f)=>f===n?{...u,variables:s,updatedAt:fa()}:u);return{...t,environments:c}}function z0(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:An("variable"),key:h,value:b,enabled:!0});c=!0}if(!c)return t;const u=t.collections.map((f,h)=>h===r?{...f,variables:a,updatedAt:fa()}:f);return{...t,collections:u}}function Uk(t,e){return{...t,environments:t.environments.filter(n=>n.id!==e),activeEnvironmentId:t.activeEnvironmentId===e?void 0:t.activeEnvironmentId}}function Fk(t,e){const n=t.folders.find(s=>s.id===e);if(!n)return t;const r=fa();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 Vk(t,e){const n=t.collections.filter(r=>r.id!==e);return n.length===0?{...rl(),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 H0(){return typeof indexedDB>"u"?Promise.resolve(null):new Promise((t,e)=>{const n=indexedDB.open(jk,Ek);n.onupgradeneeded=()=>{const r=n.result;r.objectStoreNames.contains(il)||r.createObjectStore(il)},n.onsuccess=()=>t(n.result),n.onerror=()=>e(n.error||new Error("Unable to open FlexDoc API Client storage"))})}async function I0(t){const e=await H0();if(!e)return rl();try{return await new Promise((n,r)=>{const a=e.transaction(il,"readonly").objectStore(il).get(t);a.onsuccess=()=>n(Ik(a.result)),a.onerror=()=>r(a.error||new Error("Unable to load FlexDoc API Client workspace"))})}finally{e.close()}}async function U0(t,e){const n=await H0();if(n)try{await new Promise((r,s)=>{const a=n.transaction(il,"readwrite");a.objectStore(il).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 sl(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 Pk(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 F0(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 V0(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),F0(e)}async function Kk(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 F0(new Uint8Array(e))}function P0(t,e,n,r){const s=sl(t.authorizationUrl,"Authorization URL"),a=sl(t.clientId,"Client ID"),c=new URL(s),u=t.grantType||"accessToken";c.searchParams.set("response_type",u==="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 Yk(t){const e=new URL(t.location.href);return e.search="",e.hash="",e.toString()}async function Gk(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()||Yk(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=V0(24);if((t.grantType||"accessToken")==="implicit")return{url:P0(t,s,r),state:s,redirectUri:r};const a=V0(48),c=await Kk(a);return{url:P0(t,s,r,c),state:s,redirectUri:r,codeVerifier:a}}async function Xk(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=sl(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 ${Pk(`${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 Xk(c)}async function Jk(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,u=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,u))}throw r.close(),new Error("OAuth authorization timed out.")}async function Qk(t,e={}){const n=t.grantType||"accessToken",r=e.fetchImpl??fetch;if(n==="accessToken")return{accessToken:sl(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:sl(t.username,"Username"),password:t.password||""}),v=$o(t);return v&&b.set("scope",v),qo(t,b,r)}const s=await Gk(t,e.windowObject),a=await Jk(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 u=new URLSearchParams(a.hash.replace(/^#/,"")),f=a.searchParams.get("error")||u.get("error");if(f){const b=a.searchParams.get("error_description")||u.get("error_description");throw new Error(b||f)}if(n==="implicit"){const b=u.get("access_token")||"";if(!b)throw new Error("OAuth implicit response did not include access_token.");return{accessToken:b,tokenType:u.get("token_type")||void 0,expiresIn:u.get("expires_in")?Number(u.get("expires_in")):void 0,scope:u.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 Wk(t,e={}){const n=sl(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 Zk(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 eC(t){return t.split(/\s+/).map(e=>e.trim()).filter(Boolean)}const K0=({auth:t,fieldClass:e,label:n,onChange:r})=>{const[s,a]=U.useState(!1),[c,u]=U.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),u(null);try{const A=await Qk(t);r({...t,accessToken:A.accessToken,refreshToken:A.refreshToken??t.refreshToken}),u(A.expiresIn?`Access token acquired; expires in ${A.expiresIn}s.`:"Access token acquired.")}catch(A){u(A instanceof Error?A.message:"OAuth authorization failed.")}finally{a(!1)}},S=async()=>{a(!0),u(null);try{const A=await Wk(t);r({...t,accessToken:A.accessToken,refreshToken:A.refreshToken??t.refreshToken}),u("Access token refreshed.")}catch(A){u(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:eC(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})]})},Y0=({auth:t,label:e,allowInherit:n=!1,hostExecution:r,onChange:s,theme:a})=>{const u=`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:u,value:t.type==="inherit"&&!n?"none":t.type,onChange:b=>s(Zk(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:u,value:t.token,onChange:b=>s({...t,token:b.target.value})}),t.type==="oauth2"&&p.jsx(K0,{auth:t,fieldClass:u,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:u,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:u,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:u,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:u,placeholder:"Value",value:t.value,onChange:b=>s({...t,value:b.target.value})}),p.jsxs("select",{"aria-label":`${e} API key location`,className:u,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:u,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:u,placeholder:"Key",value:t.key,onChange:b=>s({...t,key:b.target.value})}),p.jsxs("select",{"aria-label":`${e} Hawk algorithm`,className:u,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:u,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:u,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:u,placeholder:"Password",value:t.password,onChange:b=>s({...t,password:b.target.value})}),p.jsx("input",{"aria-label":`${e} NTLM domain`,className:u,placeholder:"Domain (optional)",value:t.domain||"",onChange:b=>s({...t,domain:b.target.value})}),p.jsx("input",{"aria-label":`${e} NTLM workstation`,className:u,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:u,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:u,placeholder:"Consumer secret",value:t.consumerSecret,onChange:b=>s({...t,consumerSecret:b.target.value})}),p.jsx("input",{"aria-label":`${e} OAuth1 token`,className:u,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:u,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:u,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:u,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:u,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:u,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:u,placeholder:"Session token (optional)",value:t.sessionToken||"",onChange:b=>s({...t,sessionToken:b.target.value})}),p.jsx("input",{"aria-label":`${e} AWS region`,className:u,placeholder:"Region",value:t.region,onChange:b=>s({...t,region:b.target.value})}),p.jsx("input",{"aria-label":`${e} AWS service`,className:u,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=[],G0=[];(()=>{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?G0:Qd).push(n=n+t[e])})();function tC(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>=G0[r])e=r+1;else return!0;if(e==n)return!1}}function X0(t){return t>=127462&&t<=127487}const J0=8205;function nC(t,e,n=!0,r=!0){return(n?Q0:iC)(t,e,r)}function Q0(t,e,n){if(e==t.length)return e;e&&W0(t.charCodeAt(e))&&Z0(t.charCodeAt(e-1))&&e--;let r=Wd(t,e);for(e+=ey(r);e<t.length;){let s=Wd(t,e);if(r==J0||s==J0||n&&tC(s))e+=ey(s),r=s;else if(X0(s)){let a=0,c=e-2;for(;c>=0&&X0(Wd(t,c));)a++,c-=2;if(a%2==0)break;e+=2}else break}return e}function iC(t,e,n){for(;e>1;){let r=Q0(t,e-2,n);if(r<e)return r;e--}return 0}function Wd(t,e){let n=t.charCodeAt(e);if(!Z0(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return W0(r)?(n-55296<<10)+(r-56320)+65536:n}function W0(t){return t>=56320&&t<57344}function Z0(t){return t>=55296&&t<56320}function ey(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]=ll(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),Ii.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]=ll(this,e,n);let r=[];return this.decompose(e,n,r,0),Ii.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 ha(this),a=new ha(e);for(let c=n,u=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(u+=s.value.length,s.done||u>=r)return!0}}iter(e=1){return new ha(this,e)}iterRange(e,n=this.length){return new ny(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 iy(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 zt(e):Ii.from(zt.split(e,[]))}}class zt extends pt{constructor(e,n=rC(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],u=s+c.length;if((n?r:u)>=e)return new sC(s,u,r,c);s=u+1,r++}}decompose(e,n,r,s){let a=e<=0&&n>=this.length?this:new zt(ty(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(s&1){let c=r.pop(),u=zo(a.text,c.text.slice(),0,a.length);if(u.length<=32)r.push(new zt(u,c.length+a.length));else{let f=u.length>>1;r.push(new zt(u.slice(0,f)),new zt(u.slice(f)))}}else r.push(a)}replace(e,n,r){if(!(r instanceof zt))return super.replace(e,n,r);[e,n]=ll(this,e,n);let s=zo(this.text,zo(r.text,ty(this.text,0,e)),n),a=this.length+r.length-(n-e);return s.length<=32?new zt(s,a):Ii.from(zt.split(s,[]),a)}sliceString(e,n=this.length,r=`
|
|
50
|
+
`){[e,n]=ll(this,e,n);let s="";for(let a=0,c=0;a<=n&&c<this.text.length;c++){let u=this.text[c],f=a+u.length;a>e&&c&&(s+=r),e<f&&n>a&&(s+=u.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 zt(r,s)),r=[],s=-1);return s>-1&&n.push(new zt(r,s)),n}}class Ii 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],u=s+c.length,f=r+c.lines-1;if((n?f:u)>=e)return c.lineInner(e,n,r,s);s=u+1,r=f+1}}decompose(e,n,r,s){for(let a=0,c=0;c<=n&&a<this.children.length;a++){let u=this.children[a],f=c+u.length;if(e<=f&&n>=c){let h=s&((c<=e?1:0)|(f>=n?2:0));c>=e&&f<=n&&!h?r.push(u):u.decompose(e-c,n-c,r,h)}c=f+1}}replace(e,n,r){if([e,n]=ll(this,e,n),r.lines<this.lines)for(let s=0,a=0;s<this.children.length;s++){let c=this.children[s],u=a+c.length;if(e>=a&&n<=u){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 Ii(g,this.length-(n-e)+r.length)}return super.replace(a,u,f)}a=u+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
|
|
51
|
+
`){[e,n]=ll(this,e,n);let s="";for(let a=0,c=0;a<this.children.length&&c<=n;a++){let u=this.children[a],f=c+u.length;c>e&&a&&(s+=r),e<f&&n>c&&(s+=u.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 Ii))return 0;let r=0,[s,a,c,u]=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==u)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 zt(S,n)}let s=Math.max(32,r>>5),a=s<<1,c=s>>1,u=[],f=0,h=-1,g=[];function b(S){let A;if(S.lines>a&&S instanceof Ii)for(let C of S.children)b(C);else S.lines>c&&(f>c||!f)?(v(),u.push(S)):S instanceof zt&&f&&(A=g[g.length-1])instanceof zt&&S.lines+A.lines<=32?(f+=S.lines,h+=S.length+1,g[g.length-1]=new zt(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&&(u.push(g.length==1?g[0]:Ii.from(g,h)),h=-1,f=g.length=0)}for(let S of e)b(S);return v(),u.length==1?u[0]:new Ii(u,n)}}pt.empty=new zt([""],0);function rC(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 u=t[a],f=s+u.length;f>=n&&(f>r&&(u=u.slice(0,r-s)),s<n&&(u=u.slice(n-s)),c?(e[e.length-1]+=u,c=!1):e.push(u)),s=f+1}return e}function ty(t,e,n){return zo(t,[""],e,n)}class ha{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 zt?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,u=s instanceof zt?s.text.length:s.children.length;if(c==(n>0?u:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((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 zt){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 zt?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 ny{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new ha(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 iy{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()},ha.prototype[Symbol.iterator]=ny.prototype[Symbol.iterator]=iy.prototype[Symbol.iterator]=function(){return this});class sC{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 ll(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function kn(t,e,n=!0,r=!0){return nC(t,e,n,r)}function lC(t){return t>=56320&&t<57344}function aC(t){return t>=55296&&t<56320}function oC(t,e){let n=t.charCodeAt(e);if(!aC(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return lC(r)?(n-55296<<10)+(r-56320)+65536:n}function cC(t){return t<65536?1:2}const Zd=/\r\n?|\n/;var Xn=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Xn||(Xn={}));class Ui{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 Ui(e)}composeDesc(e){return this.empty?e:e.empty?this:ry(this,e)}mapDesc(e,n=!1){return e.empty?this:tf(this,e,n)}mapPos(e,n=-1,r=Xn.Simple){let s=0,a=0;for(let c=0;c<this.sections.length;){let u=this.sections[c++],f=this.sections[c++],h=s+u;if(f<0){if(h>e)return a+(e-s);a+=u}else{if(r!=Xn.Simple&&h>=e&&(r==Xn.TrackDel&&s<e&&h>e||r==Xn.TrackBefore&&s<e||r==Xn.TrackAfter&&h>e))return null;if(h>e||h==e&&n<0&&!u)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++],u=s+a;if(c>=0&&s<=n&&u>=e)return s<e&&u>n?"cover":!0;s=u}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 Ui(e)}static create(e){return new Ui(e)}}class Zt extends Ui{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],u=n[s+1];if(u>=0){n[s]=u,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:ry(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 Ui.create(this.sections)}filter(e){let n=[],r=[],s=[],a=new pa(this);e:for(let c=0,u=0;;){let f=c==e.length?1e9:e[c++];for(;u<f||u==f&&a.len==0;){if(a.done)break e;let g=Math.min(a.len,f-u);Cn(s,g,-1);let b=a.ins==-1?-1:a.off==0?a.ins:0;Cn(n,g,b),b>0&&$r(r,n,a.text),a.forward(g),u+=g}let h=e[c++];for(;u<h;){if(a.done)break e;let g=Math.min(a.len,h-u);Cn(n,g,-1),Cn(s,g,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(g),u+=g}}return{changes:new Zt(n,r),filtered:Ui.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,u=null;function f(g=!1){if(!g&&!s.length)return;c<n&&Cn(s,n-c,-1);let b=new Zt(s,a);u=u?u.compose(b.map(u)):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(),u=u?u.compose(g.map(u)):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&&Cn(s,b-c,-1),Cn(s,v-b,C),$r(a,s,A),c=v}}return h(e),f(!u),u}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,u)=>u&&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 Cn(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 u=t.sections[c++],f=t.sections[c++];if(f<0)s+=u,a+=u;else{let h=s,g=a,b=pt.empty;for(;h+=u,g+=f,f&&r&&(b=b.append(r[c-2>>1])),!(n||c==t.sections.length||t.sections[c+1]<0);)u=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 pa(t),u=new pa(e);for(let f=-1;;){if(c.done&&u.len||u.done&&c.len)throw new Error("Mismatched change set lengths");if(c.ins==-1&&u.ins==-1){let h=Math.min(c.len,u.len);Cn(s,h,-1),c.forward(h),u.forward(h)}else if(u.ins>=0&&(c.ins<0||f==c.i||c.off==0&&(u.len<c.len||u.len==c.len&&!n))){let h=u.len;for(Cn(s,u.ins,-1);h;){let g=Math.min(c.len,h);c.ins>=0&&f<c.i&&c.len<=g&&(Cn(s,0,c.ins),a&&$r(a,s,c.text),f=c.i),c.forward(g),h-=g}u.next()}else if(c.ins>=0){let h=0,g=c.len;for(;g;)if(u.ins==-1){let b=Math.min(g,u.len);h+=b,g-=b,u.forward(b)}else if(u.ins==0&&u.len<g)g-=u.len,u.next();else break;Cn(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&&u.done)return a?Zt.createSet(s,a):Ui.create(s);throw new Error("Mismatched change set lengths")}}}function ry(t,e,n=!1){let r=[],s=n?[]:null,a=new pa(t),c=new pa(e);for(let u=!1;;){if(a.done&&c.done)return s?Zt.createSet(r,s):Ui.create(r);if(a.ins==0)Cn(r,a.len,0,u),a.next();else if(c.len==0&&!c.done)Cn(r,0,c.ins,u),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;Cn(r,f,g,u),s&&g&&$r(s,r,c.text)}else c.ins==-1?(Cn(r,a.off?0:a.len,f,u),s&&$r(s,r,a.textBit(f))):(Cn(r,a.off?0:a.len,c.off?0:c.ins,u),s&&!c.off&&$r(s,r,c.text));u=(a.ins>f||c.ins>=0&&c.len>f)&&(u||r.length>h),a.forward2(f),c.forward(f)}}}}class pa{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 qr{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 qr(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 qr(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=>qr.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 qr.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?qr.create(n,e,c|32,r):qr.create(e,n,c,r)}static undirectionalRange(e,n){return qr.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 u=c.from,f=Math.max(a.to,c.to);s<=n&&n--,e.splice(--s,2,a.anchor>a.head?Ce.range(f,u):Ce.range(u,f))}}return new Ce(e,n)}}function sy(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,u=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(u?!ly(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 zr?v.field(T,!1)==b.field(T,!1):!0)||(u?ly(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 ly(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)ga(t,r)&1&&(n=!0);return n}function uC(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 u(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)ga(f,h);return f.values[c]=u(f),1},update(f,h){if(!sf(f,a))return 0;let g=u(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=u(f);return e.compare(S,v)?(f.values[c]=v,0):(f.values[c]=S,1)}}}const Io=He.define({static:!0});class zr{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 zr(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),u;return(u=a.find(f=>f.field==this))&&u!=c.find(f=>f.field==this)?(r.values[n]=u.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 js={lowest:4,low:3,default:2,high:1,highest:0};function ma(t){return e=>new ay(e,t)}const Uo={highest:ma(js.highest),high:ma(js.high),default:ma(js.default),low:ma(js.low),lowest:ma(js.lowest)};class ay{constructor(e,n){this.inner=e,this.prec=n}get extension(){return this}}class ir{of(e){return new lf(this,e)}reconfigure(e){return ir.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 dC(e,n,c))v instanceof zr?s.push(v):(a[v.facet.id]||(a[v.facet.id]=[])).push(v);let u=Object.create(null),f=[],h=[];for(let v of s)u[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(u[A.id]=f.length<<1|1,rf(C,S))f.push(r.facet(A));else{let T=A.combine(S.map(R=>R.value));f.push(r&&A.compare(T,r.facet(A))?r.facet(A):T)}else{for(let T of S)T.type==0?(u[T.id]=f.length<<1|1,f.push(T.value)):(u[T.id]=h.length<<1,h.push(R=>T.dynamicSlot(R)));u[A.id]=h.length<<1,h.push(T=>uC(T,A,S))}}let b=h.map(v=>v(u));return new Fo(e,c,b,u,f,a)}}function dC(t,e,n){let r=[[],[],[],[],[]],s=new Map;function a(c,u){let f=s.get(c);if(f!=null){if(f<=u)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,u),Array.isArray(c))for(let h of c)a(h,u);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,u)}else if(c instanceof ay)a(c.inner,c.prec);else if(c instanceof zr)r[u].push(c),c.provides&&a(c.provides,u);else if(c instanceof Ho)r[u].push(c),c.facet.extensions&&a(c.facet.extensions,js.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,u)}}return a(t,js.default),r.reduce((c,u)=>c.concat(u))}function ga(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 oy=He.define(),af=He.define({combine:t=>t.some(e=>e),static:!0}),cy=He.define({combine:t=>t.length?t[0]:void 0,static:!0}),uy=He.define(),dy=He.define(),fy=He.define(),hy=He.define({combine:t=>t.length?t[0]:!1});class Hr{constructor(e,n){this.type=e,this.value=n}static define(){return new fC}}class fC{of(e){return new Hr(this,e)}}class hC{constructor(e){this.map=e}of(e){return new Ht(this,e)}}class Ht{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 Ht(this.type,n)}is(e){return this.type==e}static define(e={}){return new hC(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}}Ht.reconfigure=Ht.define(),Ht.appendConfig=Ht.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&&sy(r,n.newLength),a.some(u=>u.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=Hr.define(),en.userEvent=Hr.define(),en.addToHistory=Hr.define(),en.remote=Hr.define();function pC(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 py(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:Ht.mapEffects(t.effects,s).concat(Ht.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=al(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(cy)),selection:r&&(r instanceof Ce?r:Ce.single(r.anchor,r.head)),effects:al(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function my(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=py(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 gC(n?mC(s):s)}function mC(t){let e=t.startState,n=!0;for(let s of e.facet(uy)){let a=s(t);if(a===!1){n=!1;break}Array.isArray(a)&&(n=n===!0?a:pC(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),Ht.mapEffects(t.effects,a),t.annotations,t.scrollIntoView)}let r=e.facet(dy);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=my(e,al(a),!1)}return t}function gC(t){let e=t.startState,n=e.facet(fy),r=t;for(let s=n.length-1;s>=0;s--){let a=n[s](t);a&&Object.keys(a).length&&(r=py(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 yC=[];function al(t){return t==null?yC:Array.isArray(t)?t:[t]}var rr=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(rr||(rr={}));const bC=/[\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 xC(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()||bC.test(n)))return!0}return!1}function vC(t){return e=>{if(!/\S/.test(e))return rr.Space;if(xC(e))return rr.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return rr.Word;return rr.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 u=0;u<this.config.dynamicSlots.length;u++)ga(this,u<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return ga(this,r),Vo(this,r)}update(...e){return my(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:s}=n;for(let u of e.effects)u.is(ir.reconfigure)?(n&&(s=new Map,n.compartments.forEach((f,h)=>s.set(h,f)),n=null),s.set(u.value.compartment,u.value.extension)):u.is(Ht.reconfigure)?(n=null,r=u.value):u.is(Ht.appendConfig)&&(n=null,r=al(r).concat(u.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,(u,f)=>f.update(u,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range: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=al(r.effects);for(let u=1;u<n.ranges.length;u++){let f=e(n.ranges[u]),h=this.changes(f.changes),g=h.map(s);for(let v=0;v<u;v++)a[v]=a[v].map(g);let b=s.mapDesc(h,!0);a.push(f.range.map(b)),s=s.compose(g),c=Ht.mapEffects(c,g).concat(Ht.mapEffects(al(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:(ga(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 zr&&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],u=e[a];s.push(c.init(f=>c.spec.fromJSON(u,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 sy(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(hy)}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(oy))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 vC(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:s}=this.doc.lineAt(e),a=this.charCategorizer(e),c=e-r,u=e-r;for(;c>0;){let f=kn(n,c,!1);if(a(n.slice(f,c))!=rr.Word)break;c=f}for(;u<s;){let f=kn(n,u);if(a(n.slice(u,f))!=rr.Word)break;u=f}return c==u?null:Ce.range(c+r,u+r)}}vt.allowMultipleSelections=af,vt.tabSize=He.define({combine:t=>t.length?t[0]:4}),vt.lineSeparator=cy,vt.readOnly=hy,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=oy,vt.changeFilter=uy,vt.transactionFilter=dy,vt.transactionExtender=fy,ir.reconfigure=Ht.define();function uf(t,e,n={}){let r={};for(let s of t)for(let a of Object.keys(s)){let c=s[a],u=r[a];if(u===void 0)r[a]=c;else if(!(u===c||c===void 0))if(Object.hasOwnProperty.call(n,a))r[a]=n[a](u,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 Es{eq(e){return this==e}range(e,n=e){return ff.create(e,n,this)}}Es.prototype.startSide=Es.prototype.endSide=0,Es.prototype.point=!1,Es.prototype.mapMode=Xn.TrackDel;function df(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let ff=class U2{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new U2(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 ol(this.to)}findIndex(e,n,r,s=0){let a=r?this.to:this.from;for(let c=s,u=a.length;;){if(c==u)return c;let f=c+u>>1,h=a[f]-e||(r?this.value[f].endSide:this.value[f].startSide)-n;if(f==c)return h>=0?c:u;h>=0?u=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=[],u=[],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 R=n.mapPos(S,v.startSide,v.mapMode);if(R==null||(C=T=R,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),u.push(C-h),f.push(T-h),r=T,s=v.endSide;else{if(C==T)for(let R=c.length;R>0;R--){if((C-(f[R-1]+h)||v.startSide-c[R-1].endSide)>=0){c.splice(R,0,v),u.splice(R,0,C-h),f.splice(R,0,T-h);continue e}if((C-(u[R-1]+h)||v.endSide-c[R-1].startSide)>0)break}a(C,T,v)}}return{mapped:c.length?new pf(u,f,c,g):null,pos:h}}}class ht{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 ht(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?ht.of(n):this;let u=new yy(this,null,-1).goto(0),f=0,h=[],g=new ya;for(;u.value||f<n.length;)if(f<n.length&&(u.from-n[f].from||u.startSide-n[f].value.startSide)>=0){let b=n[f++];g.addInner(b.from,b.to,b.value,!1)||h.push(b)}else u.rangeIndex==1&&u.chunkIndex<this.chunk.length&&(f==n.length||this.chunkEnd(u.chunkIndex)<n[f].from)&&(!c||s>this.chunkEnd(u.chunkIndex)||a<this.chunkPos[u.chunkIndex])&&g.addChunk(this.chunkPos[u.chunkIndex],this.chunk[u.chunkIndex])?u.nextChunk():((!c||s>u.to||a<u.from||c(u.from,u.to,u.value))&&(g.addInner(u.from,u.to,u.value,!1)||h.push(ff.create(u.from,u.to,u.value))),u.next());return g.finishInner(this.nextLayer.isEmpty&&!h.length?ht.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 ya),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?[ol(r)+ol(n).length,ol(ol(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 u=this.nextLayer.map(e);return a&&(u=a.finishInner(u)),n.length==0?u:new ht(r,n,u||ht.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 ba.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return ba.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),u=n.filter(b=>b.maxPoint>0||!b.isEmpty&&b.maxPoint>=a),f=gy(c,u,r),h=new xa(c,f,a),g=new xa(u,f,a);r.iterGaps((b,v,S)=>by(h,b,g,v,S,s)),r.empty&&r.length==0&&by(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 u=gy(a,c),f=new xa(a,u,0).goto(r),h=new xa(c,u,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 xa(e,null,a).goto(n),u=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(u,h,c.point,g,b,c.pointRank),f=Math.min(c.openEnd(h),g.length)}else h>u&&(s.span(u,h,c.active,f),f=c.openEnd(h));if(c.to>r)return f+(c.point&&c.to>r?1:0);u=c.to,c.next()}}static of(e,n=!1){let r=new ya;for(let s of e instanceof ff?[e]:n?wC(e):e)r.add(s.from,s.to,s.value);return r.finish()}static join(e){if(!e.length)return ht.empty;let n=ol(e);for(let r=e.length-2;r>=0;r--)for(let s=e[r];s!=ht.empty;s=s.nextLayer)n=new ht(s.chunkPos,s.chunk,n,Math.max(s.maxPoint,n.maxPoint));return n}}ht.empty=new ht([],[],null,-1);function ol(t){return t[t.length-1]}function wC(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}ht.empty.nextLayer=ht.empty;class ya{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 ya)).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(ht.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=ht.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function gy(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 u=r.get(a.chunk[c]);u!=null&&(n?n.mapPos(u):u)==a.chunkPos[c]&&!n?.touchesRange(u,u+a.chunk[c].length)&&s.add(a.chunk[c])}return s}class yy{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 ba{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 yy(c,n,r,a));return s.length==1?s[0]:new ba(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 xa{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=ba.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=xy(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=xy(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 by(t,e,n,r,s,a){t.goto(e),n.goto(r);let c=r+s,u=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(u,A,t.point,n.point),g=!1):(g&&a.boundChange(u),A>u&&!gf(t.active,n.active)&&a.compareRange(u,A,t.active,n.active),h&&A<c&&(b||t.openEnd(S)!=n.openEnd(S))&&(g=!0)),S>c)break;u=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 xy(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=kn(t,s));return r}function SC(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=kn(t,s)}return t.length}const yf="ͼ",vy=typeof Symbol>"u"?"__"+yf:Symbol.for(yf),bf=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),wy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class cl{constructor(e,n){this.rules=[];let{finish:r}=n||{};function s(c){return/^@/.test(c)?[c]:c.split(/,\s*/)}function a(c,u,f,h){let g=[],b=/^@(\w+)\b/.exec(c[0]),v=b&&b[1]=="keyframes";if(b&&u==null)return f.push(c[0]+";");for(let S in u){let A=u[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=wy[vy]||1;return wy[vy]=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 AC(e,a),s.mount(Array.isArray(n)?n:[n],e)}}let Sy=new Map;class AC{constructor(e,n){let r=e.ownerDocument||e,s=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let a=Sy.get(r);if(a)return e[bf]=a;this.sheet=new s.CSSStyleSheet,Sy.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 u=e[c],f=this.modules.indexOf(u);if(f<a&&f>-1&&(this.modules.splice(f,1),a--,f=-1),f==-1){if(this.modules.splice(a++,0,u),r)for(let h=0;h<u.rules.length;h++)r.insertRule(u.rules[h],s++)}else{for(;a<f;)s+=this.modules[a++].rules.length;s+=u.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 u=n.head||n;this.styleTag.parentNode!=u&&u.insertBefore(this.styleTag,u.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var Ir={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:"'"},va={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},kC=typeof navigator<"u"&&/Mac/.test(navigator.platform),CC=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),dn=0;dn<10;dn++)Ir[48+dn]=Ir[96+dn]=String(dn);for(var dn=1;dn<=24;dn++)Ir[dn+111]="F"+dn;for(var dn=65;dn<=90;dn++)Ir[dn]=String.fromCharCode(dn+32),va[dn]=String.fromCharCode(dn);for(var xf in Ir)va.hasOwnProperty(xf)||(va[xf]=Ir[xf]);function NC(t){var e=kC&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||CC&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?va:Ir)[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 En=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},vf=typeof document<"u"?document:{documentElement:{style:{}}};const wf=/Edge\/(\d+)/.exec(En.userAgent),Ay=/MSIE \d/.test(En.userAgent),Sf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(En.userAgent),Go=!!(Ay||Sf||wf),ky=!Go&&/gecko\/(\d+)/i.test(En.userAgent),Af=!Go&&/Chrome\/(\d+)/.exec(En.userAgent),Cy="webkitFontSmoothing"in vf.documentElement.style,kf=!Go&&/Apple Computer/.test(En.vendor),Ny=kf&&(/Mobile\/\w+/.test(En.userAgent)||En.maxTouchPoints>2);var Oe={mac:Ny||/Mac/.test(En.platform),windows:/Win/.test(En.platform),linux:/Linux|X11/.test(En.platform),ie:Go,ie_version:Ay?vf.documentMode||6:Sf?+Sf[1]:wf?+wf[1]:0,gecko:ky,gecko_version:ky?+(/Firefox\/(\d+)/.exec(En.userAgent)||[0,0])[1]:0,chrome:!!Af,chrome_version:Af?+Af[1]:0,ios:Ny,android:/Android\b/.test(En.userAgent),webkit:Cy,webkit_version:Cy?+(/\bAppleWebKit\/(\d+)/.exec(En.userAgent)||[0,0])[1]:0,safari:kf,safari_version:kf?+(/\bVersion\/(\d+(\.\d+)?)/.exec(En.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 TC(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 Ty(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 jC(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 fn=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(fn||(fn={}));class nn extends Es{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 wa(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 Os(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}=jy(e,n);r=(a?n?-3e8:-1:5e8)-1,s=(c?n?2e8:1:-6e8)+1}return new Os(e,r,s,n,e.widget||null,!0)}static line(e){return new Sa(e)}static set(e,n=!1){return ht.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}nn.none=ht.empty;class wa extends nn{constructor(e){let{start:n,end:r}=jy(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 wa&&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)}}wa.prototype.point=!1;class Sa extends nn{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Sa&&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)}}Sa.prototype.mapMode=Xn.TrackBefore,Sa.prototype.point=!0;class Os 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?Xn.TrackBefore:Xn.TrackAfter:Xn.TrackDel}get type(){return this.startSide!=this.endSide?fn.WidgetRange:this.startSide<=0?fn.WidgetBefore:fn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Os&&EC(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)}}Os.prototype.point=!0;function jy(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 EC(t,e){return t==e||!!(t&&e&&t.compare(e))}function ul(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 Aa extends Es{constructor(e,n,r){super(),this.tagName=e,this.attributes=n,this.rank=r}eq(e){return e==this||e instanceof Aa&&this.tagName==e.tagName&&Nf(this.attributes,e.attributes)}static create(e){return new Aa(e.tagName,e.attributes||Xo,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,n=!1){return ht.of(e,n)}}Aa.prototype.startSide=Aa.prototype.endSide=-1;function ka(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 Ca(t,e){if(!e.anchorNode)return!1;try{return Tf(t,e.anchorNode)}catch{return!1}}function Qo(t){return t.nodeType==3?Ta(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Na(t,e,n,r){return n?Ey(t,e,n,r,-1)||Ey(t,e,n,r,1):!1}function Ur(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 Ey(t,e,n,r,s){for(;;){if(t==n&&e==r)return!0;if(e==(s<0?0:sr(t))){if(t.nodeName=="DIV")return!1;let a=t.parentNode;if(!a||a.nodeType!=1)return!1;e=Ur(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?sr(t):0}else return!1}}function sr(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 OC(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 Oy(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 MC(t,e,n,r,s,a,c,u){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=OC(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}=Oy(g,j)),v={left:j.left,right:j.left+g.clientWidth*A,top:j.top,bottom:j.top+g.clientHeight*C}}let T=0,R=0;if(s=="nearest")e.top<v.top+c?(R=e.top-(v.top+c),n>0&&e.bottom>v.bottom+R&&(R=e.bottom-v.bottom+c)):e.bottom>v.bottom-c&&(R=e.bottom-v.bottom+c,n<0&&e.top-R<v.top&&(R=e.top-(v.top+c)));else{let j=e.bottom-e.top,E=v.bottom-v.top;R=(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"==u?e.left-a:e.right-(v.right-v.left)+a)-v.left,T||R)if(S)h.scrollBy(T,R);else{let j=0,E=0;if(R){let O=g.scrollTop;g.scrollTop+=R/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-R)<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 My(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 RC{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?sr(n):0),r,Math.min(e.focusOffset,r?sr(r):0))}set(e,n,r,s){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=s}}function Ry(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 Dy(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 Ms=null;Oe.safari&&Oe.safari_version>=26&&(Ms=!1);function _y(t){if(t.setActive)return t.setActive();if(Ms)return t.focus(Ms);let e=Ry(t);t.focus(Ms==null?{get preventScroll(){return Ms={preventScroll:!0},!0}}:void 0),Ms||(Ms=!1,Dy(e))}let Ly;function Ta(t,e,n=e){let r=Ly||(Ly=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function dl(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 DC(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function _C(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,sr(n));;)if(r){if(n.nodeType!=1)return!1;let s=n.childNodes[r-1];s.contentEditable=="false"?r--:(n=s,r=sr(n))}else{if(n==t)return!0;r=Ur(n),n=n.parentNode}}function By(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 $y(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=sr(n)}else if(n.parentNode&&!Wo(n))r=Ur(n),n=n.parentNode;else return null}}function qy(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=Ur(n)+1,n=n.parentNode;else return null}}class Oi{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new Oi(e.parentNode,Ur(e),n)}static after(e,n){return new Oi(e.parentNode,Ur(e)+1,n)}}var Rt=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Rt||(Rt={}));const Rs=Rt.LTR,jf=Rt.RTL;function zy(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const LC=zy("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),BC=zy("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Ef=Object.create(null),Fi=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);Ef[e]=n,Ef[n]=-e}function Hy(t){return t<=247?LC[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?BC[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const $C=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Vi{get dir(){return this.level%2?jf:Rs}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 u=e[c];if(u.from<=n&&u.to>=n){if(u.level==r)return c;(a<0||(s!=0?s<0?u.from<n:u.to>n:e[a].level>u.level))&&(a=c)}}if(a<0)throw new RangeError("Index out of range");return a}}function Iy(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||!Iy(r.inner,s.inner))return!1}return!0}const Nt=[];function qC(t,e,n,r,s){for(let a=0;a<=r.length;a++){let c=a?r[a-1].to:e,u=a<r.length?r[a].from:n,f=a?256:s;for(let h=c,g=f,b=f;h<u;h++){let v=Hy(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<u;h++){let v=Nt[h];if(v==128)h<u-1&&g==Nt[h+1]&&g&24?v=Nt[h]=g:Nt[h]=256;else if(v==64){let S=h+1;for(;S<u&&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 zC(t,e,n,r,s){let a=s==1?2:1;for(let c=0,u=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=u-3;C>=0;C-=3)if(Fi[C+1]==-S){let T=Fi[C+2],R=T&2?s:T&4?T&1?a:s:0;R&&(Nt[b]=Nt[Fi[C]]=R),u=C;break}}else{if(Fi.length==189)break;Fi[u++]=b,Fi[u++]=v,Fi[u++]=f}else if((A=Nt[b])==2||A==1){let C=A==s;f=C?0:1;for(let T=u-3;T>=0;T-=3){let R=Fi[T+2];if(R&2)break;if(C)Fi[T+2]|=2;else{if(R&4)break;Fi[T+2]|=4}}}}}function HC(t,e,n,r){for(let s=0,a=r;s<=n.length;s++){let c=s?n[s-1].to:t,u=s<n.length?n[s].from:e;for(let f=c;f<u;){let h=Nt[f];if(h==256){let g=f+1;for(;;)if(g==u){if(s==n.length)break;g=n[s++].to,u=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 u=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!=u&&(g=!1,b=C==16)}let v=!g&&u==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,R=h+1;;){if(T==n)break e;if(R<a.length&&a[R].from==T)T=a[R++].to;else{if(Nt[T]==u)break e;break}}if(h++,v)v.push(C);else{C.from>f&&c.push(new Vi(f,C.from,S));let T=C.direction==Rs!=!(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]!=u:Nt[A]==u))break;A++}v?Of(t,f,A,r+1,s,v,c):f<A&&c.push(new Vi(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!=u&&(g=!1,b=C==16)}let v=!g&&u==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,R=h;;){if(T==e)break e;if(R&&a[R-1].to==T)T=a[--R].from;else{if(Nt[T-1]==u)break e;break}}if(v)v.push(C);else{C.to<f&&c.push(new Vi(C.to,f,S));let T=C.direction==Rs!=!(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]!=u:Nt[A-1]==u))break;A--}v?Of(t,A,f,r+1,s,v,c):A<f&&c.push(new Vi(A,f,S)),f=A}}function Mf(t,e,n,r,s,a,c){let u=e%2?2:1;qC(t,s,a,r,u),zC(t,s,a,r,u),HC(s,a,r,u),Of(t,s,a,e,n,r,c)}function IC(t,e,n){if(!t)return[new Vi(0,0,e==jf?1:0)];if(e==Rs&&!n.length&&!$C.test(t))return Uy(t.length);if(n.length)for(;t.length>Nt.length;)Nt[Nt.length]=256;let r=[],s=e==Rs?0:1;return Mf(t,s,s,n,0,t.length,r),r}function Uy(t){return[new Vi(0,t,0)]}let Fy="";function UC(t,e,n,r,s){var a;let c=r.head-t.from,u=Vi.find(e,c,(a=r.bidiLevel)!==null&&a!==void 0?a:-1,r.assoc),f=e[u],h=f.side(s,n);if(c==h){let v=u+=s?1:-1;if(v<0||v>=e.length)return null;f=e[u=v],c=f.side(!s,n),h=f.side(s,n)}let g=kn(t.text,c,f.forward(s,n));(g<f.from||g>f.to)&&(g=h),Fy=t.text.slice(Math.min(c,g),Math.max(c,g));let b=u==(s?e.length-1:0)?null:e[u+(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 FC(t,e,n){for(let r=e;r<n;r++){let s=Hy(t.charCodeAt(r));if(s==1)return Rs;if(s==2||s==4)return jf}return Rs}const Vy=He.define(),Py=He.define(),Ky=He.define(),Yy=He.define(),Rf=He.define(),Gy=He.define(),Xy=He.define(),Df=He.define(),_f=He.define(),Jy=He.define({combine:t=>t.some(e=>e)}),Qy=He.define({combine:t=>t.some(e=>e)}),Wy=He.define();class fl{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 fl(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 fl(Ce.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const ec=Ht.define({map:(t,e)=>t.map(e)}),Zy=Ht.define();function Pi(t,e,n){let r=t.facet(Yy);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 lr=He.define({combine:t=>t.length?t[0]:!0});let VC=0;const hl=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 ar{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(hl.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(hl.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:s,provide:a,decorations:c}=n||{};return new ar(VC++,e,r,s,u=>{let f=[];return c&&f.push(tc.of(h=>{let g=h.plugin(u);return g?c(g):nn.none})),a&&f.push(a(u)),f})}static fromClass(e,n){return ar.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(Pi(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){Pi(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){Pi(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const eb=He.define(),Bf=He.define(),tc=He.define(),tb=He.define(),$f=He.define(),ja=He.define(),nb=He.define();function ib(t,e){let n=t.state.facet(nb);if(!n.length)return n;let r=n.map(a=>a instanceof Function?a(t):a),s=[];return ht.spans(r,e.from,e.to,{point(){},span(a,c,u,f){let h=a-e.from,g=c-e.from,b=s;for(let v=u.length-1;v>=0;v--,f--){let S=u[v].spec.bidiIsolate,A;if(S==null&&(S=FC(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 rb=He.define();function sb(t){let e=0,n=0,r=0,s=0;for(let a of t.state.facet(rb)){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 Ea=He.define();class di{constructor(e,n,r,s){this.fromA=e,this.toA=n,this.fromB=r,this.toB=s}join(e){return new di(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 u=s<e.length?e[s].fromB:1e9,f=a<n.length?n[a]:1e9,h=Math.min(u,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 di(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,u,f)=>s.push(new di(a,c,u,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 PC=[];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 PC}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&&TC(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=Ur(this.dom),s=this.length?e>0:n>0;return new Oi(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 u of this.children){if(u.sync(e),c+=u.length+u.breakAfter,s=r?r.nextSibling:n.firstChild,a&&s!=u.dom&&(a.written=!0),u.dom.parentNode==n)for(;s&&s!=u.dom;)s=lb(s);else n.insertBefore(u.dom,s);r=u.dom}for(s=r?r.nextSibling:n.firstChild,a&&s&&(a.written=!0);s;)s=lb(s);this.length=c}}function lb(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 or)n.push(s),r=c,s=0;else{let u=a+c.length,f=e(c,a);if(f!==void 0)return f;a=u+c.breakAfter}}}resolveBlock(e,n){let r,s=-1,a,c=-1;if(this.blockTiles((u,f)=>{let h=f+u.length;if(e>=f&&e<=h){if(u.isWidget()&&n>=-1&&n<=1){if(u.flags&32)return!0;u.flags&16&&(r=void 0)}(f<e||e==h&&(n<-1?u.length:u.covers(1)))&&(!r||!u.isWidget()&&r.isWidget())&&(r=u,s=e-f),(h>e||e==f&&(n>1?u.length:u.covers(-1)))&&(!a||!u.isWidget()&&a.isWidget())&&(a=u,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 or 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 or(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class pl extends ic{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let s=new pl(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,u=-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&&YC(c,A)))&&(C>b||A.flags&32&&n<=1)?(c=A,u=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:u}:null}coordsIn(e,n,r){let s=this.resolveInline(e,n,!0);return s?s.tile.coordsIn(Math.max(0,s.offset),n,r):KC(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 Oi(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,u=!1;for(let f of c.children){if(u)return new Oi(f.dom,0);f==r.tile&&(u=!0)}}return new Oi(this.dom,0)}}function KC(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Qo(e);return n[n.length-1]||null}function YC(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class $n extends ic{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new $n(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Ds 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,u=0;e==0&&n<0||e==s&&n>=0?Oe.chrome||Oe.gecko||(e?(a--,u=1):c<s&&(c++,u=-1)):n<0?a--:c<s&&c++;let f=Ta(this.dom,a,c).getClientRects();if(!f.length)return null;let h=f[(u?u<0:n>=0)?0:f.length-1];return Oe.safari&&!u&&h.width==0&&(h=Array.prototype.find.call(f,g=>g.width)||h),r==null?h:Zo(h,(u?u>0:n<0)==r)}static of(e,n){let r=new Ds(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class _s 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 u=this.flags&16?!0:this.flags&32?!1:e>0;for(let f=u?a.length-1:0;c=a[f],!(e>0?f==0:f==a.length-1||c.top<c.bottom);f+=u?-1:1);return Zo(c,!u)}}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 _s(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 GC{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:u}=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&&!u.length)break;r&&r.leave(s),c=!!s.breakAfter,{tile:s,index:a}=u.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):(u.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}=u.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 XC{constructor(e,n,r,s){this.from=e,this.to=n,this.wrapper=r,this.rank=s}}class JC{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),u=c.lastChild;if(u&&u.isText()&&!(u.flags&8)&&u.length+e.length<512){this.cache.reused.set(u,2);let f=c.children[c.children.length-1]=new Ds(u.dom,u.text+e);f.parent=c}else c.append(s||Ds.of(e,(a=this.cache.find(Ds))===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 u=n.marks.length-1;u>=0;u--){let f=n.marks[u],h=s.lastChild;if(h instanceof $n&&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=$n.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 Ds(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=ob);let s=pl.start(e,n||((r=this.cache.find(pl))===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],u;if(n>0&&(u=s.lastChild)&&u instanceof $n&&u.mark.eq(c))s=u,n--;else{let f=$n.of(c,(r=this.cache.find($n,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||!ab(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Oe.ios&&ab(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(zf,0,32)||new _s(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 XC(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 or&&s.wrapper.eq(r.wrapper))n=s;else{let a=or.of(r.wrapper,(e=this.cache.find(or,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 QC{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 u=this.textOff=Math.min(e,s.length);return a?null:s.slice(0,u)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const lc=[_s,pl,Ds,$n,sc,or,rc];for(let t=0;t<lc.length;t++)lc[t].bucket=t;class WC{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 u=0;u<a.length;u++){let f=(u+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 u=s[a];if(!this.reused.has(u)&&(c==0?u.widget.compare(e):u.widget.constructor==e.constructor&&e.updateDOM(u.dom,this.view,u.widget)))return s.splice(a,1),a<this.index[0]&&this.index[0]--,u.widget==e&&u.length==n&&(u.flags&497)==r?(this.reused.set(u,1),u):(this.reused.set(u,2),new _s(u.dom,n,e,u.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class ZC{constructor(e,n,r,s,a){this.view=e,this.decorations=s,this.disallowBlockEffectsFor=a,this.openWidget=!1,this.openMarks=0,this.cache=new WC(e),this.text=new QC(e.state.doc),this.builder=new JC(this.cache,new rc(e,e.contentDOM),ht.iter(r)),this.cache.reused.set(n,2),this.old=new GC(n),this.reuseWalker={skip:(c,u,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 u=c<e.length?e[c++]:null,f=u?u.fromA:this.old.root.length;if(f>s){let h=f-s;this.preserve(h,!c,!u),s=f,a+=h}if(!u)break;n&&u.fromA<=n.range.fromA&&u.toA>=n.range.toA?(this.forward(u.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(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,u.toA),this.emit(n.range.toB,u.toB)):(this.forward(u.fromA,u.toA),this.emit(a,u.toB)),a=u.toB,s=u.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let s=nN(this.old),a=this.openMarks;this.old.advance(e,r?1:-1,{skip:(c,u,f)=>{if(c.isWidget())if(this.openWidget)this.builder.continueWidget(f-u);else{let h=f>0||u<c.length?_s.of(c.widget,this.view,f-u,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),!u&&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(u,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 $n)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 $n&&s.unshift(c.mark)),this.openWidget=!1},leave:c=>{c.isLine()?s.length&&(s.length=a=0):c instanceof $n&&(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=ht.spans(this.decorations,e,n,{point:(u,f,h,g,b,v)=>{if(h instanceof Os){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(u).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-u);else{let S=h.widget||(h.block?ml.block:ml.inline),A=eN(h),C=this.cache.findWidget(S,f-u,A)||_s.of(S,this.view,f-u,A);h.block?(h.startSide>0&&s.addLineStartIfNotCovered(r),s.addBlockWidget(C)):(s.ensureLine(r),s.addInlineWidget(C,g,b))}r=null}else r=tN(r,h);f>u&&this.text.skip(f-u)},span:(u,f,h,g)=>{for(let b=u;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==u?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 $n?n.push(a):a?.isLine()?r=a:a instanceof or||(s.nodeName=="DIV"&&!r&&s!=this.view.contentDOM?r=new pl(s,ob):r||n.push($n.of(new wa({tagName:s.nodeName.toLowerCase(),attributes:jC(s)}),s)))}return{line:r,marks:n}}}function ab(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 eN(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 ob={class:"cm-line"};function tN(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 nN(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 $n&&e.push(r.mark)}return e}function qf(t){let e=Lt.get(t);return e&&e.setDOM(t.cloneNode()),t}class ml 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}}ml.inline=new ml("span"),ml.block=new ml("div");const zf=new class extends Jo{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class cb{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 di(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:!dN(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let a=s>-1?rN(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){let{from:g,to:b}=this.hasComposition;r=new di(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,u=this.blockWrappers;this.updateDeco();let f=aN(c,this.decorations,e.changes);f.length&&(r=di.extendWithRanges(r,f));let h=cN(u,this.blockWrappers,e.changes);return h.length&&(r=di.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,u=new ZC(this.view,c,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Lt.get(n.text)&&u.cache.reused.set(Lt.get(n.text),2),this.tile=u.run(e,n),Hf(c,u.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let 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(Zy)&&(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(lr)||r.tabIndex>-1)&&Ca(r,this.view.observer.selectionRange)&&!(s&&r.contains(s));if(!(a||n||c))return;let u=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&&iN(h)){let v=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(v,h.node.childNodes[h.offset]||null)),h=g=new Oi(v,0),u=!0}let b=this.view.observer.selectionRange;(u||!b.focusNode||(!Na(h.node,h.offset,b.anchorNode,b.anchorOffset)||!Na(g.node,g.offset,b.focusNode,b.focusOffset))&&!this.suppressWidgetCursorChange(b,f))&&(this.view.observer.ignore(()=>{Oe.android&&Oe.chrome&&r.contains(b.focusNode)&&uN(b.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let v=ka(this.view.root);if(v)if(f.empty){if(Oe.gecko){let S=sN(h.node,h.offset);if(S&&S!=3){let A=(S==1?$y:qy)(h.node,h.offset);A&&(h=new Oi(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 Oi(b.anchorNode,b.anchorOffset),this.impreciseHead=g.precise?null:new Oi(b.focusNode,b.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Na(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=ka(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 u=c.posAtStart;if(n.head==u||n.head==u+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=sr(e)==0?0:n==0?-1:1;for(;;){let u=e.parentNode;if(u==r.dom)break;c==0&&u.firstChild!=u.lastChild&&(e==u.firstChild?c=-1:c=1),e=u}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,u=s;;c++){let f=r.children[c];if(f.dom==a)return u;u+=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,u=-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,u=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(u,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 u of a.children){if(u.length>=c){let f=s(u,c);if(f)return f}if(c-=u.length,c<0)break}else if(a.isText()&&c<a.length){let u=kn(a.text,c);if(u==c)return null;let f=Ta(a.dom,c,u).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,u=-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,R=C.dom.getBoundingClientRect(),{height:j}=R;if(S&&!A&&(h+=R.top-S.top),C instanceof or)T>r&&g(C,v,R);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 D=O[O.length-1],B=f?D.right-R.left:R.right-D.left;B>u&&(u=B,this.minWidth=a,this.minWidthFrom=v,this.minWidthTo=T)}}S&&A==b.children.length-1&&(h+=S.bottom-R.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 u=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;u+=g[0].width,f=g[0].height}if(u)return{lineHeight:c.dom.getBoundingClientRect().height,charWidth:u/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 u=(n.lineBlockAt(c).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(nn.replace({widget:new If(u),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 u=typeof a=="function";return u&&(r=!0),u?a(this.view):a});for(s.length&&(this.dynamicDecorationMap[e++]=r,n.push(ht.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(tb).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(Wy))try{if(h(this.view,e.range,e))return!0}catch(g){Pi(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=sb(this.view),c={left:r.left-a.left,top:r.top-a.top,right:r.right+a.right,bottom:r.bottom+a.bottom},{offsetWidth:u,offsetHeight:f}=this.view.scrollDOM;if(MC(this.view.scrollDOM,c,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,u),-u),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=Ry(h.dom);h.dom.scrollIntoView({block:"nearest"}),Dy(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 iN(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 ub(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=$y(n.focusNode,n.focusOffset),s=qy(n.focusNode,n.focusOffset),a=r||s;if(s&&r&&s.node!=r.node){let u=Lt.get(s.node);if(!u||u.isText()&&u.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 rN(t,e,n){let r=ub(t,n);if(!r)return null;let{node:s,from:a,to:c}=r,u=s.nodeValue;if(/[\n\r]/.test(u)||t.state.doc.sliceString(r.from,r.to)!=u)return null;let f=e.invertedDesc;return{range:new di(f.mapPos(a),f.mapPos(c),a,c),text:s}}function sN(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 lN=class{constructor(){this.changes=[]}compareRange(e,n){ul(e,n,this.changes)}comparePoint(e,n){ul(e,n,this.changes)}boundChange(e){ul(e,e,this.changes)}};function aN(t,e,n){let r=new lN;return ht.compare(t,e,n,r),r.changes}class oN{constructor(){this.changes=[]}compareRange(e,n){ul(e,n,this.changes)}comparePoint(){}boundChange(e){ul(e,e,this.changes)}}function cN(t,e,n){let r=new oN;return ht.compare(t,e,n,r),r.changes}function uN(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 dN(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 fN(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,u=a;n<0?c=kn(s.text,a,!1):u=kn(s.text,a);let f=r(s.text.slice(c,u));for(;c>0;){let h=kn(s.text,c,!1);if(r(s.text.slice(h,c))!=f)break;c=h}for(;u<s.length;){let h=kn(s.text,u);if(r(s.text.slice(u,h))!=f)break;u=h}return Ce.undirectionalRange(c+s.from,u+s.from)}function hN(t,e,n,r,s){let a=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let u=t.viewState.heightOracle.textHeight,f=Math.floor((s-n.top-(t.defaultLineHeight-u)*.5)/u);a+=f*t.viewState.heightOracle.lineLength}let c=t.state.sliceDoc(n.from,n.to);return n.from+SC(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==fn.Text&&(s.type!=a.type||(n<0?a.from<e:a.to>e)))&&(s=a)}}return s||r}return r}function pN(t,e,n,r){let s=Uf(t,e.head,e.assoc||-1),a=!r||s.type!=fn.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(),u=t.textDirectionAt(s.from),f=t.posAtCoords({x:n==(u==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 db(t,e,n,r){let s=t.state.doc.lineAt(e.head),a=t.bidiSpans(s),c=t.textDirectionAt(s.from);for(let u=e,f=null;;){let h=UC(s,a,c,u,n),g=Fy;if(!h){if(s.number==(n?t.state.doc.lines:1))return u;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 u}else{if(!r)return h;f=r(g)}u=h}}function mN(t,e,n){let r=t.state.charCategorizer(e),s=r(n);return a=>{let c=r(a);return s==rr.Space&&(s=c),s==c}}function gN(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,u,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),u=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))),u=(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=u+(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 R=t.coordsAtPos(T.pos,T.assoc),j=R?(R.top+R.bottom)/2:0;if(!R||(n?j>u:j<u))return Ce.cursor(T.pos,T.assoc,void 0,c)}}function Oa(t,e,n){for(;;){let r=0;for(let s of t)s.between(e-1,e+1,(a,c,u)=>{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 fb(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=Oa(t,s.from,0);c!=s.from&&(a=Ce.cursor(c,-1))}else{let c=Oa(t,s.from,-1),u=Oa(t,s.to,1);(c!=s.from||u!=s.to)&&(s.undirectional?a=Ce.undirectionalRange(s.from,s.to):a=Ce.range(s.from==s.anchor?c:u,s.from==s.head?c:u))}a&&(n||(n=e.ranges.slice()),n[r]=a)}return n?Ce.create(n,e.mainIndex):e}function Ff(t,e,n){let r=Oa(t.state.facet(ja).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 Ki{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:u}=e,f=u-a,h;for(;;){if(f<0)return new Ki(0,1);if(f>t.viewState.docHeight)return new Ki(t.state.doc.length,-1);if(h=t.elementAtHeight(f),r==null)break;if(h.type==fn.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==fn.Text){let b=hN(t,s,h,c,u);return new Ki(b,b==h.from?1:-1)}}if(h.type!=fn.Text)return f<(h.top+h.bottom)/2?new Ki(h.from,1):new Ki(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 yN(t,c,u,t.textDirectionAt(h.from)).scanTile(g,h.from)}class yN{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[Vi.find(s,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:s}=this.bidiSpansAt(e);return s[Vi.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,u=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),R=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),R=1;else if(E.top>this.y)(!h||h.top>E.top)&&(h=E),R=-1;else{let O=E.left>this.x?this.x-E.left:E.right<this.x?this.x-E.right:0,D=Math.abs(O);D<b&&(g=C,b=D,v=E),O&&(R=O<0==(this.baseDir==Rt.LTR)?-1:1)}}R==-1&&(!u||this.baseDirAt(e[C],1))?a=C:R==1&&(!u||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=(u?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=kn(e.text,a))r.push(n+a);r.push(n+e.length);let s=this.scan(r,a=>{let c=r[a]-n,u=r[a+1]-n;return Ta(e.dom,c,u).getClientRects()});return s.after?new Ki(r[s.i+1],-1):new Ki(r[s.i],1)}scanTile(e,n){if(!e.length)return new Ki(n,1);if(e.children.length==1){let u=e.children[0];if(u.isText())return this.scanText(u,n);if(u.isComposite())return this.scanTile(u,n)}let r=[n];for(let u=0,f=n;u<e.children.length;u++)r.push(f+=e.children[u].length);let s=this.scan(r,u=>{let f=e.children[u];return f.flags&48?null:(f.dom.nodeType==1?f.dom:Ta(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 Ki(r[s.i+1],-1):new Ki(c,1)}}const gl="";class bN{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+=gl}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),u=s.nextSibling;if(u==n){c?.breakAfter&&!u&&r!=this.view.contentDOM&&this.lineBreak();break}let f=Lt.get(u);(c&&f?c.breakAfter:(c?c.breakAfter:Wo(s))||Wo(u)&&(s.nodeName!="BR"||c?.isWidget())&&this.text.length>a)&&!vN(u,n)&&this.lineBreak(),s=u}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let a=-1,c=1,u;if(this.lineSeparator?(a=n.indexOf(this.lineSeparator,r),c=this.lineSeparator.length):(u=s.exec(n))&&(a=u.index,c=u[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+(xN(e,r.node,r.offset)?n:0))}}function xN(t,e,n){for(;;){if(!e||n<sr(e))return!1;if(e==t)return!0;n=Ur(e)+1,e=e.parentNode}}function vN(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 hb{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class wN{constructor(e,n,r,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:a,impreciseAnchor:c}=e.docView,u=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=pb(e.docView.tile,n,r,0))){let f=a||c?[]:AN(e),h=new bN(f,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=kN(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)?u.main.head:e.docView.posFromDOM(f.focusNode,f.focusOffset),g=c&&c.node==f.anchorNode&&c.offset==f.anchorOffset||!Tf(e.contentDOM,f.anchorNode)?u.main.anchor:e.docView.posFromDOM(f.anchorNode,f.anchorOffset),b=e.viewport;if((Oe.ios||Oe.chrome)&&h!=g&&Math.min(h,g)<=u.main.from&&Math.max(h,g)>=u.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&&u.ranges.length>1)this.newSel=u.replaceRange(Ce.range(g,h));else if(e.lineWrapping&&g==h&&!(u.main.empty&&u.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 pb(t,e,n,r){if(t.isComposite()){let s=-1,a=-1,c=-1,u=-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 pb(b,e,n,h);if(v>=e&&s==-1&&(s=f,a=h),h>n&&b.dom.parentNode==t.dom){c=f,u=g;break}g=v,h=v+b.breakAfter}return{from:a,to:u<0?r+t.length:u,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 mb(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:u,to:f}=e.bounds,h=a.from,g=null;(c===8||Oe.android&&e.text.length<f-u)&&(h=a.to,g="end");let b=s.doc.sliceString(u,f,gl),v,S;!a.empty&&a.from>=u&&a.to<=f&&(e.typeOver||b!=e.text)&&b.slice(0,a.from-u)==e.text.slice(0,a.from-u)&&b.slice(a.to-u)==e.text.slice(v=e.text.length-(b.length-(a.to-u)))?n={from:a.from,to:a.to,insert:pt.of(e.text.slice(a.from-u,v).split(gl))}:(S=gb(b,e.text,h-u,g))&&(Oe.chrome&&c==13&&S.toB==S.from+2&&e.text.slice(S.from,S.toB)==gl+gl&&S.toB--,n={from:u+S.from,to:u+S.toA,insert:pt.of(e.text.slice(S.from,S.toB).split(gl))})}else r&&(!t.hasFocus&&s.facet(lr)||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 u=!1,f="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(u=!0),f=t.inputState.lastSelectionOrigin,f=="select.pointer"&&(r=fb(s.facet(ja).map(h=>h(t)),r))),t.dispatch({selection:r,scrollIntoView:u,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&&dl(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)&&dl(t.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&dl(t.contentDOM,"Delete",46)))return!0;let a=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let c,u=()=>c||(c=SN(t,e,n));return t.state.facet(Gy).some(f=>f(t,e.from,e.to,a,u))||t.dispatch(u()),!0}function SN(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=Oa(s.facet(ja).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&&ub(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 R=s.changes({from:T,to:C,insert:e.insert}),j=A.to-a.to;return{changes:R,range:h?Ce.range(Math.max(0,h.anchor+j),Math.max(0,h.head+j)):A.map(R)}})}else r={changes:f,selection:h&&s.selection.replaceRange(h)}}let u="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,u+=".compose",t.inputState.compositionFirstChange&&(u+=".start",t.inputState.compositionFirstChange=!1)),s.update(r,{userEvent:u,scrollIntoView:!0})}function gb(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,u=e.length;for(;c>0&&u>0&&t.charCodeAt(c-1)==e.charCodeAt(u-1);)c--,u--;if(r=="end"){let f=Math.max(0,a-Math.min(c,u));n-=c+f-a}if(c<a&&t.length<e.length){let f=n<=a&&n>=c?a-n:0;a-=f,u=a+(u-c),c=a}else if(u<a){let f=n<=a&&n>=u?a-n:0;a-=f,c=a+(c-u),u=a}return{from:a,toA:c,toB:u}}function AN(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 hb(n,r)),(s!=n||a!=r)&&e.push(new hb(s,a))),e}function kN(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 CN{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&&IN(e.contentDOM.ownerDocument)}handleEvent(e){!_N(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=TN(e),r=this.handlers,s=this.view.contentDOM;for(let a in n)if(a!="scroll"){let c=!n[a].handlers.length,u=r[a];u&&c!=!u.handlers.length&&(s.removeEventListener(a,this.handleEvent),u=null),u||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&&xb.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&&(bb.some(n=>n.keyCode==e.keyCode)&&!e.ctrlKey||jN.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)&&NN(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,dl(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 NN(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function yb(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(s){Pi(n.state,s)}}}function TN(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 u in a){let f=a[u];f&&n(u).handlers.push(yb(r.value,f))}if(c)for(let u in c){let f=c[u];f&&n(u).observers.push(yb(r.value,f))}}for(let r in Mi)n(r).handlers.push(Mi[r]);for(let r in On)n(r).observers.push(On[r]);return e}const bb=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],jN="dthko",xb=[16,17,18,20,91,92,224,225],oc=6;function cc(t){return Math.max(0,t)*.7+8}function EN(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class ON{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=My(e.contentDOM),this.atoms=e.state.facet(ja).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)&&MN(e,n),this.dragging=DN(e,n)&&Nb(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&&EN(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,s=0,a=0,c=this.view.win.innerWidth,u=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:c}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:a,bottom:u}=this.scrollParents.y.getBoundingClientRect());let f=sb(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>=u-oc&&(r=cc(e.clientY-u)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=fb(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 MN(t,e){let n=t.state.facet(Vy);return n.length?n[0](e):Oe.mac?e.metaKey:e.ctrlKey}function RN(t,e){let n=t.state.facet(Py);return n.length?n[0](e):Oe.mac?!e.altKey:!e.ctrlKey}function DN(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=ka(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 _N(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 Mi=Object.create(null),On=Object.create(null),vb=Oe.ie&&Oe.ie_version<15||Oe.ios&&Oe.webkit_version<604;function LN(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(),wb(t,n.value)},50)}function uc(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function wb(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})}On.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,Oe.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())},On.wheel=On.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()},Mi.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),On.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")},On.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},On.touchend=(t,e)=>{t.inputState.touchActive=!1},Mi.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(Ky))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=$N(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new ON(t,e,n,r)),r&&t.observer.ignore(()=>{_y(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 Sb(t,e,n,r){if(r==1)return Ce.cursor(e,n);if(r==2)return fN(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,u=s?s.posAtEnd:a.to;return u<t.state.doc.length&&u==a.to&&u++,Ce.undirectionalRange(c,u)}}const BN=Oe.ie&&Oe.ie_version<=11;let Ab=null,kb=0,Cb=0;function Nb(t){if(!BN)return t.detail;let e=Ab,n=Cb;return Ab=t,Cb=Date.now(),kb=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(kb+1)%3:1}function $N(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=Nb(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,u){let f=t.posAndSideAtCoords({x:a.clientX,y:a.clientY},!1),h,g=Sb(t,f.pos,f.assoc,r);if(n.pos!=f.pos&&!c){let b=Sb(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)):u&&r==1&&s.ranges.length>1&&(h=qN(s,f.pos))?h:u?s.addRange(g):Ce.create([g])}}}function qN(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}Mi.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},Mi.dragend=t=>(t.inputState.draggedContent=null,!1);function Tb(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&&RN(t,e)?{from:a.from,to:a.to}:null,u={from:s,insert:n},f=t.state.changes(c?[c,u]:u);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}Mi.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&&Tb(t,e,r.filter(c=>c!=null).join(t.state.lineBreak),!1)};for(let c=0;c<n.length;c++){let u=new FileReader;u.onerror=a,u.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(u.result)||(r[c]=u.result),a()},u.readAsText(n[c])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Tb(t,e,r,!0),!0}return!1},Mi.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=vb?null:e.clipboardData;return n?(wb(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(LN(t),!1)};function zN(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 HN(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;Mi.copy=Mi.cut=(t,e)=>{if(!Ca(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:s}=HN(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=vb?null:e.clipboardData;return a?(a.clearData(),a.setData("text/plain",n),!0):(zN(t,n),!1)};const jb=Hr.define();function Eb(t,e){let n=[];for(let r of t.facet(Xy)){let s=r(t,e);s&&n.push(s)}return n.length?t.update({effects:n,annotations:jb.of(!0)}):null}function Ob(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=Eb(t.state,e);n?t.dispatch(n):t.update([])}},10)}On.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),Ob(t)},On.blur=t=>{t.observer.clearSelectionRange(),Ob(t)},On.compositionstart=On.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},On.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))},On.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},Mi.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 u=c[0],f=t.posAtDOM(u.startContainer,u.startOffset),h=t.posAtDOM(u.endContainer,u.endOffset);return Pf(t,{from:f,to:h,insert:t.state.toText(a)},null),!0}}let s;if(Oe.chrome&&Oe.android&&(s=bb.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(()=>On.compositionend(t,e),20),!1};const Mb=new Set;function IN(t){Mb.has(t)||(Mb.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const Rb=["pre-wrap","normal","pre-line","break-spaces"];let yl=!1;function Db(){yl=!1}class UN{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 Rb.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 u=Rb.indexOf(e)>-1,f=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=u;if(this.lineWrapping=u,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 FN{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Ri{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"?fn.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 Os?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 Ri(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 Mn{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&&(yl=!0),this.height=e)}replace(e,n,r){return Mn.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 u=s.length-1;u>=0;u--){let{fromA:f,toA:h,fromB:g,toB:b}=s[u],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;u>0&&v.from<=s[u-1].toA;)f=s[u-1].fromA,g=s[u-1].fromB,u--,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 Jn(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 u=e[n-1];u.break?e.splice(--n,1,u.left,null,u.right):e.splice(--n,1,u.left,u.right),r+=1+u.break,s-=u.size}else if(a>s*2){let u=e[r];u.break?e.splice(r,1,u.left,null,u.right):e.splice(r,1,u.left,u.right),r+=2+u.break,a-=u.size}else break;else if(s<a){let u=e[n++];u&&(s+=u.size)}else{let u=e[--r];u&&(a+=u.size)}let c=0;return e[n-1]==null?(c=1,n--):e[n]==null&&(c=1,r++),new PN(Mn.of(e.slice(0,n)),c,Mn.of(e.slice(r)))}}function fc(t,e){return t==e?t:(t.constructor!=e.constructor&&(yl=!0),e)}Mn.prototype.size=1;const VN=nn.replace({});class _b extends Mn{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new Ri(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 Ri(s,0,r,this.spaceAbove,VN):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 Jn extends _b{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 Ri(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 Jn||s instanceof hn&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof hn?s=new Jn(s.length,this.height,this.spaceAbove):s.height=this.height,this.outdated||(s.outdated=!1),s):Mn.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 hn extends Mn{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,u=0;if(e.lineWrapping){let f=Math.min(this.height,e.lineHeight*a);c=f/a,this.length>a+1&&(u=(this.height-f)/(this.length-a-1))}else c=this.height/a;return{firstLine:r,lastLine:s,perLine:c,perChar:u}}blockAt(e,n,r,s){let{firstLine:a,lastLine:c,perLine:u,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=u+g.length*f,v=Math.max(r,e-b/2);return new Ri(g.from,g.length,v,b,0)}else{let h=Math.max(0,Math.min(c-a,Math.floor((e-r)/u))),{from:g,length:b}=n.doc.line(a+h);return new Ri(g,b,r+u*h,u,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 Ri(S,A-S,0,0,0)}let{firstLine:c,perLine:u,perChar:f}=this.heightMetrics(r,a),h=r.doc.lineAt(e),g=u+h.length*f,b=h.number-c,v=s+u*b+f*(h.from-a-b);return new Ri(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:u,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-u;b+=f*A+h*(e-a-A)}let S=f+h*v.length;c(new Ri(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 hn?r[r.length-1]=new hn(a.length+s):r.push(null,new hn(s-1))}if(e>0){let a=r[0];a instanceof hn?r[0]=new hn(e+a.length):r.unshift(new hn(e-1),null)}return Mn.of(r)}decomposeLeft(e,n){n.push(new hn(e-1),null)}decomposeRight(e,n){n.push(null,new hn(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=[],u=Math.max(n,s.from),f=-1;for(s.from>n&&c.push(new hn(s.from-n-1).updateHeight(e,n));u<=a&&s.more;){let g=e.doc.lineAt(u).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 Jn(g,b,v);S.outdated=!1,c.push(S),u+=g+1}u<=a&&c.push(null,new hn(a-u).updateHeight(e,u));let h=Mn.of(c);return(f<0||Math.abs(h.height-this.height)>=dc||Math.abs(f-this.heightMetrics(e,n).perLine)>=dc)&&(yl=!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 PN extends Mn{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,u=a+this.left.length+this.break,f=n==Et.ByHeight?e<c:e<u,h=f?this.left.lineAt(e,n,r,s,a):this.right.lineAt(e,n,r,c,u);if(this.break||(f?h.to<u:h.from>u))return h;let g=n==Et.ByPosNoHeight?Et.ByPosNoHeight:Et.ByPos;return f?h.join(this.right.lineAt(u,g,r,c,u)):this.left.lineAt(u,g,r,s,a).join(h)}forEachLine(e,n,r,s,a,c){let u=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,u,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,u,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 u of r)a.push(u);if(e>0&&Lb(a,c-1),n<this.length){let u=a.length;this.decomposeRight(n,a),Lb(a,u)}return Mn.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?Mn.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,u=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<=u+c.length&&s.more?f=c=c.updateHeight(e,u,r,s):c.updateHeight(e,u,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 Lb(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof hn&&(r=t[e+1])instanceof hn&&t.splice(e-1,3,new hn(n.length+1+r.length))}const KN=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 Jn?s.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Jn(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 _b(c,s,r)):(c||a||s>=KN)&&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 Jn(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new hn(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 Jn)return e;let n=new Jn(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 Jn)&&!this.isCovered?this.nodes.push(new Jn(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 Jn&&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 ht.spans(n,r,s,a,0),a.finish(r)}}function YN(t,e,n){let r=new GN;return ht.compare(t,e,n,r,0),r.changes}class GN{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,s){(e<n||r&&r.heightRelevant||s&&s.heightRelevant)&&ul(e,n,this.changes,5)}}function XN(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),u=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),u=Math.max(u,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:u-(n.top+e),bottom:Math.max(u,f)-(n.top+e)}}function JN(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 QN(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 WN(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class WN 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 Bb{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=$b,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 UN(r),this.stateDeco=qb(n),this.heightMap=Mn.empty().applyChanges(this.stateDeco,pt.empty,this.heightOracle.setDoc(n.doc),[new di(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?$b: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(Ma(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=qb(this.state);let s=e.changedRanges,a=di.extendWithRanges(s,YN(r,this.stateDeco,e?e.changes:Zt.empty(this.state.doc.length))),c=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Db(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=c||yl)&&(e.flags|=2),u?(this.scrollAnchorPos=e.changes.mapPos(u.from,-1),this.scrollAnchorHeight=u.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(Qy)&&(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",u=n.getBoundingClientRect(),f=c||this.mustMeasureContent||this.contentDOMHeight!=u.height;this.contentDOMHeight=u.height,this.mustMeasureContent=!1;let h=0,g=0;if(u.width&&u.height){let{scaleX:D,scaleY:B}=Oy(n,u);(D>.005&&Math.abs(this.scaleX-D)>.005||B>.005&&Math.abs(this.scaleY-B)>.005)&&(this.scaleX=D,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=My(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=By(this.scrollParent||e.win);let C=(this.printing?QN:XN)(n,this.paddingTop),T=C.top-this.pixelViewport.top,R=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&&!JN(e.dom))return 0;let E=u.width;if((this.contentDOMWidth!=E||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=u.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),f){let D=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(D)&&(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),D),c&&(e.docView.minWidth=0,h|=16)}T>0&&R>0?g=Math.max(T,R):T<0&&R<0&&(g=Math.min(T,R)),Db();for(let B of this.viewports){let M=B.from==this.viewport.from?D:e.docView.measureVisibleLineHeights(B);this.heightMap=(c?Mn.empty().applyChanges(this.stateDeco,pt.empty,this.heightOracle,[new di(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,c,new FN(B.from,M))}yl&&(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:u}=this,f=new hc(s.lineAt(c-r*1e3,Et.ByHeight,a,0,0).from,s.lineAt(u+(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:u}=this;return(e==0||s<=c-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||a>=u+Math.max(10,Math.min(r,250)))&&s>c-2e3&&a<u+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 u=[],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 R of C)if(R>g&&R<b){f(g,R-10,v,S),f(R+10,b,v,S);return}let T=eT(e,R=>R.from>=v.from&&R.to<=v.to&&Math.abs(R.from-g)<a&&Math.abs(R.to-b)<a&&!C.some(j=>R.from<j&&R.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 R=this.gapSize(v,g,b,S),j=r||R<2e6?R:2e6;T=new Gf(g,b,R,j)}u.push(T)},h=g=>{if(g.length<c||g.type!=fn.Text)return;let b=ZN(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,R;if(v!=null){let j=mc(b,v),E=((this.visibleBottom-this.visibleTop)/2+C)/g.height;T=j-E,R=j+E}else T=(this.visibleTop-g.top-C)/g.height,R=(this.visibleBottom-g.top+C)/g.height;S=pc(b,T),A=pc(b,R)}else{let C=b.total*this.heightOracle.charWidth,T=s*this.heightOracle.charWidth,R=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+R<this.pixelViewport.left&&(R=B.size-B.displaySize);let j=this.pixelViewport.left+R,E=this.pixelViewport.right+R,O,D;if(v!=null){let B=mc(b,v),M=((E-j)/2+T)/C;O=B-M,D=B+M}else O=(j-T)/C,D=(E+T)/C;S=pc(b,O),A=pc(b,D)}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 u}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=[];ht.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],u=r[a];(c.from!=u.from||c.to!=u.to)&&(s|=4,e&&e.mapPos(c.from,-1)==u.from&&e.mapPos(c.to,1)==u.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)||Ma(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)||Ma(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 Ma(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 ZN(t,e,n){let r=[],s=t,a=0;return ht.spans(n,t,e,{span(){},point(c,u){c>s&&(r.push({from:s,to:c}),a+=c-s),s=u}},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],u=c-a;if(r<=u)return a+r;r-=u}}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 eT(t,e){for(let n of t)if(e(n))return n}const $b={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function qb(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(ht.join(n)),e}class Xf{constructor(e,n,r){let s=0,a=0,c=0;this.viewports=r.map(({from:u,to:f})=>{let h=n.lineAt(u,Et.ByPos,e,0,0).top,g=n.lineAt(f,Et.ByPos,e,0,0).bottom;return s+=g-h,{from:u,to:f,top:h,bottom:g,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(n.height-s);for(let u of this.viewports)u.domTop=c+(u.top-a)*this.scale,c=u.domBottom=u.domTop+(u.bottom-u.top),a=u.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 Ma(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Ri(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(s=>Ma(s,e)):t._content)}const gc=He.define({combine:t=>t.join(" ")}),Jf=He.define({combine:t=>t.indexOf(!0)>-1}),Qf=cl.newName(),zb=cl.newName(),Hb=cl.newName(),Ib={"&light":"."+zb,"&dark":"."+Hb};function Wf(t,e,n){return new cl(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 tT=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"}},Ib),nT={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Zf=Oe.ie&&Oe.ie_version<=11;class iT{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new RC,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 sT(e),e.state.facet(lr)&&(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(lr)?r.root.activeElement!=this.dom:!Ca(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&&Na(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=ka(e.root);if(!n)return!1;let r=Oe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&rT(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let s=Ca(this.dom,r);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&_C(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,nT),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&&dl(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&&Ca(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 wN(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=mb(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=Ub(n,e.previousSibling||e.target.previousSibling,-1),s=Ub(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(lr)!=e.state.facet(lr)&&(e.view.contentDOM.editContext=e.state.facet(lr)?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 Ub(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 Fb(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 Na(c.node,c.offset,s,a)&&([n,r,s,a]=[s,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:a}}function rT(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return Fb(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?Fb(t,n):null}class sT{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,u=this.toEditorPos(r.updateRangeStart),f=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:u,drifted:!1});let h=f-u>r.text.length;u==this.from&&a<this.from?u=a:f==this.to&&a>this.to&&(f=a);let g=gb(e.state.sliceDoc(u,f),r.text,(h?s.from:s.to)-u,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+u,to:g.toA+u,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:u,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),u=this.toEditorPos(r.rangeEnd);c<u;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,u=a.underlineThickness;if(!/none/i.test(c)&&!/none/i.test(u)){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(u)?1:2}px`;s.push(nn.mark({attributes:{style:g}}).range(f,h))}}}e.dispatch({effects:Zy.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=ka(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,u,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 Ge{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||DC(e.parent)||document,this.viewState=new Bb(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(hl).map(s=>new Lf(s));for(let s of this.plugins)s.update(this);this.observer=new iT(this),this.inputState=new CN(this),this.inputState.ensureHandlers(this.plugins),this.docView=new cb(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,u=0,f=null;e.some(v=>v.annotation(jb))?(this.inputState.notifiedFocused=c,u=1):c!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=c,f=Eb(a,c),f||(u=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|=u;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(Ge.cursorScrollMargin);b=new fl(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(Ea)!=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){Pi(this.state,S,"update listener")}(f||g)&&Promise.resolve().then(()=>{f&&this.state==f.startState&&this.dispatch(f),g&&!mb(this,g)&&h.force&&dl(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 Bb(this,e),this.plugins=e.facet(hl).map(r=>new Lf(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new cb(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(hl),r=e.state.facet(hl);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 u=this.plugins[c];u.mustUpdate=e,s.push(u)}}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){Pi(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:u}=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(By(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}u=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 Pi(this.state,C),Vb}}),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]!=Vb)try{let C=g[A];C.write&&C.write(b[A],this)}catch(C){Pi(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/u;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)?Hb:zb)+" "+this.state.facet(gc)}updateAttrs(){let e=Pb(this,eb,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(lr)?"true":"false",class:"cm-content",style:`${Oe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),Pb(this,Bf,n);let r=this.observer.ignore(()=>{let s=Ty(this.contentDOM,this.contentAttrs,n),a=Ty(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(Ge.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(Ea);let e=this.state.facet(Ge.cspNonce);cl.mount(this.root,this.styleModules.concat(tT).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,db(this,e,n,r))}moveByGroup(e,n){return Ff(this,e,db(this,e,n,r=>mN(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 pN(this,e,n,r)}moveVertically(e,n,r){return Ff(this,e,gN(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[Vi.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(Jy)||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>lT)return Uy(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||Iy(a.isolates,r=ib(this,e))))return a.order;r||(r=ib(this,e));let s=IC(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(()=>{_y(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 fl(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 fl(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 ar.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ar.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=cl.newName(),s=[gc.of(r),Ea.of(Wf(`.${r}`,e))];return n&&n.dark&&s.push(Jf.of(!0)),s}static baseTheme(e){return Uo.lowest(Ea.of(Wf("."+Qf,e,Ib)))}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}}Ge.styleModule=Ea,Ge.inputHandler=Gy,Ge.clipboardInputFilter=Df,Ge.clipboardOutputFilter=_f,Ge.scrollHandler=Wy,Ge.focusChangeEffect=Xy,Ge.perLineTextDirection=Jy,Ge.exceptionSink=Yy,Ge.updateListener=Rf,Ge.editable=lr,Ge.mouseSelectionStyle=Ky,Ge.dragMovesSelection=Py,Ge.clickAddsSelectionRange=Vy,Ge.decorations=tc,Ge.blockWrappers=tb,Ge.outerDecorations=$f,Ge.atomicRanges=ja,Ge.bidiIsolatedRanges=nb,Ge.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}}}),Ge.scrollMargins=rb,Ge.darkTheme=Jf,Ge.cspNonce=He.define({combine:t=>t.length?t[0]:""}),Ge.contentAttributes=Bf,Ge.editorAttributes=eb,Ge.lineWrapping=Ge.contentAttributes.of({class:"cm-lineWrapping"}),Ge.announce=Ht.define();const lT=4096,Vb={};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 Pb(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 aT=Oe.mac?"mac":Oe.windows?"win":Oe.linux?"linux":"key";function oT(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let s,a,c,u;for(let f=0;f<n.length-1;++f){const h=n[f];if(/^(cmd|meta|m)$/i.test(h))u=!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"?u=!0:a=!0;else throw new Error("Unrecognized modifier name: "+h)}return s&&(r="Alt-"+r),a&&(r="Ctrl-"+r),u&&(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 cT=Uo.default(Ge.domEventHandlers({keydown(t,e){return hT(uT(e.state),t,e,"editor")}})),Kb=He.define({enables:cT}),Yb=new WeakMap;function uT(t){let e=t.facet(Kb),n=Yb.get(e);return n||Yb.set(e,n=fT(e.reduce((r,s)=>r.concat(s),[]))),n}let Fr=null;const dT=4e3;function fT(t,e=aT){let n=Object.create(null),r=Object.create(null),s=(c,u)=>{let f=r[c];if(f==null)r[c]=u;else if(f!=u)throw new Error("Key binding "+c+" is used both as a regular binding and as a multi-stroke prefix")},a=(c,u,f,h,g)=>{var b,v;let S=n[c]||(n[c]=Object.create(null)),A=u.split(/ (?!$)/).map(R=>oT(R,e));for(let R=1;R<A.length;R++){let j=A.slice(0,R).join(" ");s(j,!0),S[j]||(S[j]={preventDefault:!0,stopPropagation:!1,run:[E=>{let O=Fr={view:E,prefix:j,scope:c};return setTimeout(()=>{Fr==O&&(Fr=null)},dT),!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 u=c.scope?c.scope.split(" "):["editor"];if(c.any)for(let h of u){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 u)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 hT(t,e,n,r){eh=e;let s=NC(e),a=oC(s,0),c=cC(a)==s.length&&s!=" ",u="",f=!1,h=!1,g=!1;Fr&&Fr.view==n&&Fr.scope==r&&(u=Fr.prefix+" ",xb.indexOf(e.keyCode)<0&&(h=!0,Fr=null));let b=new Set,v=T=>{if(T){for(let R of T.run)if(!b.has(R)&&(b.add(R),R(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[u+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=Ir[e.keyCode])&&A!=s?(v(S[u+bc(A,e,!0)])||e.shiftKey&&(C=va[e.keyCode])!=s&&C!=A&&v(S[u+bc(C,e,!1)]))&&(f=!0):c&&e.shiftKey&&v(S[u+bc(s,e,!0)])&&(f=!0),!f&&v(S._any)&&(f=!0)),h&&(f=!0),f&&g&&e.stopPropagation(),eh=null,f}class Ls{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=Gb(e);return[new Ls(n,s.left-a.left,s.top-a.top,null,s.bottom-s.top)]}else return pT(e,n,r)}}function Gb(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 Xb(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,u=t.posAtCoords({x:a.left+1,y:c}),f=t.posAtCoords({x:a.right-1,y:c});return u==null||f==null?r:{from:Math.max(r.from,Math.min(u,f)),to:Math.min(r.to,Math.max(u,f))}}function pT(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,u=c.getBoundingClientRect(),f=Gb(t),h=c.querySelector(".cm-line"),g=h&&window.getComputedStyle(h),b=u.left+(g?parseInt(g.paddingLeft)+Math.min(0,parseInt(g.textIndent)):0),v=u.right-(g?parseInt(g.paddingRight):0),S=Uf(t,r,1),A=Uf(t,s,-1),C=S.type==fn.Text?S:null,T=A.type==fn.Text?A:null;if(C&&(t.lineWrapping||S.widgetLineBreaks)&&(C=Xb(t,r,1,C)),T&&(t.lineWrapping||A.widgetLineBreaks)&&(T=Xb(t,s,-1,T)),C&&T&&C.from==T.from&&C.to==T.to)return j(E(n.from,n.to,C));{let D=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&&D.bottom+t.defaultLineHeight/2<B.top?M.push(R(b,D.bottom,v,B.top)):D.bottom<B.top&&t.elementAtHeight((D.bottom+B.top)/2).type==fn.Text&&(D.bottom=B.top=(D.bottom+B.top)/2),j(D).concat(M).concat(j(B))}function R(D,B,M,z){return new Ls(e,D-f.left,B-f.top,Math.max(0,M-D),z-B)}function j({top:D,bottom:B,horizontal:M}){let z=[];for(let P=0;P<M.length;P+=2)z.push(R(M[P],D,M[P+1],B));return z}function E(D,B,M){let z=1e9,P=-1e9,J=[];function W(ye,xe,_,ee,de){let $=t.coordsAtPos(ye,ye==M.to?-2:2),ne=t.coordsAtPos(_,_==M.from?2:-2);!$||!ne||(z=Math.min($.top,ne.top,z),P=Math.max($.bottom,ne.bottom,P),de==Rt.LTR?J.push(a&&xe?b:$.left,a&&ee?v:ne.right):J.push(!a&&ee?b:ne.left,!a&&xe?v:$.right))}let G=D??M.from,Se=B??M.to;for(let ye of t.visibleRanges)if(ye.to>G&&ye.from<Se)for(let xe=Math.max(ye.from,G),_=Math.min(ye.to,Se);;){let ee=t.state.doc.lineAt(xe);for(let de of t.bidiSpans(ee)){let $=de.from+ee.from,ne=de.to+ee.from;if($>=_)break;ne>xe&&W(Math.max($,xe),D==null&&$<=G,Math.min(ne,_),B==null&&ne>=Se,de.dir)}if(xe=ee.to+1,xe>=_)break}return J.length==0&&W(G,D==null,Se,B==null,t.textDirection),{top:z,bottom:P,horizontal:J}}function O(D,B){let M=u.top+(B?D.top:D.bottom);return{top:M,bottom:M,horizontal:[]}}}function mT(t,e){return t.constructor==e.constructor&&t.eq(e)}class gT{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)=>!mT(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 Jb(t){return[ar.define(e=>new gT(e,t)),xc.of(t)]}const bl=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 yT(t={}){return[bl.of(t),bT,xT,wT,Qy.of(!0)]}function Qb(t){return t.startState.facet(bl)!=t.state.facet(bl)}const bT=Jb({above:!0,markers(t){let{state:e}=t,n=e.facet(bl),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",u=s.empty?s:Ce.cursor(s.head,s.assoc);for(let f of Ls.forRange(t,c,u))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=Qb(t);return n&&Wb(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){Wb(e.state,t)},class:"cm-cursorLayer"});function Wb(t,e){e.style.animationDuration=t.facet(bl).cursorBlinkRate+"ms"}const xT=Jb({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 Ls.forRange(t,"cm-selectionBackground",s))e.push(a);if(Oe.ios&&!n.empty&&t.state.facet(bl).iosSelectionHandles){for(let s of Ls.forRange(t,"cm-selectionHandle cm-selectionHandle-start",Ce.cursor(n.from,1)))e.push(s);for(let s of Ls.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||Qb(t)},class:"cm-selectionLayer"}),vT=Oe.gecko&&Oe.gecko_version==153?"#ffffff01":"transparent",wT=Uo.highest(Ge.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:`${vT} !important`},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));function Zb(){return AT}const ST=nn.line({class:"cm-activeLine"}),AT=ar.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(ST.range(s.from)),e=s.from)}return nn.set(n)}},{decorations:t=>t.decorations});class Vr extends Es{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Vr.prototype.elementClass="",Vr.prototype.toDOM=void 0,Vr.prototype.mapMode=Xn.TrackBefore,Vr.prototype.startSide=Vr.prototype.endSide=-1,Vr.prototype.point=!0;const vc=He.define(),kT=He.define(),wc=He.define(),ex=He.define({combine:t=>t.some(e=>e)});function CT(t){return[NT]}const NT=ar.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 nx(t,e)),this.fixed=!t.state.facet(ex);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(ex)!=!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=ht.iter(this.view.state.facet(vc),this.view.viewport.from),r=[],s=this.gutters.map(a=>new TT(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 u of a.type)if(u.type==fn.Text&&c){th(n,r,u.from);for(let f of s)f.line(this.view,u,r);c=!1}else if(u.widget)for(let f of s)f.widget(this.view,u)}else if(a.type==fn.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||!ht.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 nx(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=>Ge.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 tx(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 TT{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=ht.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 u=new ix(e,c,a,r);s.elements.push(u),s.dom.appendChild(u.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(kT)){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 nx{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 u=e.lineBlockAtHeight(c-e.documentTop);n.domEventHandlers[r](e,u,s)&&s.preventDefault()});this.markers=tx(n.markers(e)),n.initialSpacer&&(this.spacer=new ix(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=tx(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!ht.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 ix{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":""),jT(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 u=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)){u=b,h=!0;break}}else u=this.markers.length;for(;c<u;){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 jT(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 ET=He.define(),OT=He.define(),xl=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?(u,f,h)=>a(u,f,h)||c(u,f,h):c}return r}})}});class nh extends Vr{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(xl).formatNumber(e,t.state)}const MT=wc.compute([xl],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(ET)},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(OT)){let a=s(e,n,r);if(a)return a}return null},lineMarkerChange:e=>e.startState.facet(xl)!=e.state.facet(xl),initialSpacer(e){return new nh(ih(e,sx(e.state.doc.lines)))},updateSpacer(e,n){let r=ih(n.view,sx(n.view.state.doc.lines));return r==e.number?e:new nh(r)},domEventHandlers:t.facet(xl).domEventHandlers,side:"before"}));function rx(t={}){return[xl.of(t),CT(),MT]}function sx(t){let e=9;for(;e<t;)e=e*10+9;return e}const RT=new class extends Vr{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},DT=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(RT.range(s)))}return ht.of(e)});function lx(){return DT}const _T=1024;let LT=0;class rh{constructor(e,n){this.from=e,this.to=n}}class mt{constructor(e={}){this.id=LT++,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=fi.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 Ra{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 BT=Object.create(null);class fi{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):BT,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new fi(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}}}}fi.none=new fi("",Object.create(null),0,8);const Sc=new WeakMap,ax=new WeakMap;var It;(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"})(It||(It={}));class pn{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,u]of a)this.props[typeof c=="number"?c:c.id]=u}}toString(){let e=Ra.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 hi(this,0,0,null)}resolve(e,n=0){let r=Da(Sc.get(this)||this.topNode,e,n,!1);return Sc.set(this,r),r}resolveInner(e,n=0){let r=Da(ax.get(this)||this.topNode,e,n,!0);return ax.set(this,r),r}resolveStack(e,n=0){return zT(this,e,n)}iterate(e){let{enter:n,leave:r,from:s=0,to:a=this.length}=e,c=e.mode||0,u=(c&It.IncludeAnonymous)>0;for(let f=this.cursor(c|It.IncludeAnonymous);;){let h=!1;if(f.from<=a&&f.to>=s&&(!u&&f.type.isAnonymous||n(f)!==!1)){if(f.firstChild())continue;h=!0}for(;h&&r&&(u||!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(fi.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,s)=>new pn(this.type,n,r,s,this.propValues),e.makeTree||((n,r,s)=>new pn(fi.none,n,r,s)))}static build(e){return HT(e)}}pn.empty=new pn(fi.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 Pr{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return fi.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,u=-1;for(let f=e;f!=n&&!(ox(a,s,c[f+1],c[f+2])&&(u=f,r>0));f=c[f+3]);return u}slice(e,n,r){let s=this.buffer,a=new Uint16Array(n-e),c=0;for(let u=e,f=0;u<n;){a[f++]=s[u++],a[f++]=s[u++]-r;let h=a[f++]=s[u++]-r;a[f++]=s[u++]-e,c=Math.max(c,h)}return new Pr(a,c,this.set)}}function ox(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 Da(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 hi&&t.index<0?null:t.parent;if(!c)return t;t=c}let a=r?0:It.IgnoreOverlays;if(r)for(let c=t,u=c.parent;u;c=u,u=c.parent)c instanceof hi&&c.index<0&&((s=u.enter(e,n,a))===null||s===void 0?void 0:s.from)!=c.from&&(t=u);for(;;){let c=t.enter(e,n,a);if(!c)return t;t=c}}class cx{cursor(e=0){return new ah(this,e)}getChild(e,n=null,r=null){let s=ux(this,e,n,r);return s.length?s[0]:null}getChildren(e,n=null,r=null){return ux(this,e,n,r)}resolve(e,n=0){return Da(this,e,n,!1)}resolveInner(e,n=0){return Da(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 hi extends cx{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:u,positions:f}=c._tree,h=n>0?u.length:-1;e!=h;e+=n){let g=u[e],b=f[e]+c.from,v;if(!(!(a&It.EnterBracketed&&g instanceof pn&&(v=Ra.get(g))&&!v.overlay&&v.bracketed&&r>=b&&r<=b+g.length)&&!ox(s,r,b,b+g.length))){if(g instanceof Pr){if(a&It.ExcludeBuffers)continue;let S=g.findChild(0,g.buffer.length,n,r-b,s);if(S>-1)return new Kr(new $T(c,g,e,b),null,S)}else if(a&It.IncludeAnonymous||!g.type.isAnonymous||oh(g)){let S;if(!(a&It.IgnoreMounts)&&(S=Ra.get(g))&&!S.overlay)return new hi(S.tree,b,e,c);let A=new hi(g,b,e,c);return a&It.IncludeAnonymous||!A.type.isAnonymous?A:A.nextChild(n<0?g.children.length-1:0,n,r,s,a)}}}if(a&It.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&It.IgnoreOverlays)&&(s=Ra.get(this._tree))&&s.overlay){let a=e-this.from,c=r&It.EnterBracketed&&s.bracketed;for(let{from:u,to:f}of s.overlay)if((n>0||c?u<=a:u<a)&&(n<0||c?f>=a:f>a))return new hi(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 ux(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 $T{constructor(e,n,r,s){this.parent=e,this.buffer=n,this.index=r,this.start=s}}class Kr extends cx{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 Kr(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&It.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 Kr(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 Kr(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 Kr(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 pn(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function dx(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 hi&&n.index<0?null:n.parent,s=t.slice();return r?s[e]=r:s.splice(e,1),new qT(s,n)}class qT{constructor(e,n){this.heads=e,this.node=n}get next(){return dx(this.heads)}}function zT(t,e,n){let r=t.resolveInner(e,n),s=null;for(let a=r instanceof hi?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=Ra.get(a.tree);if(c&&c.overlay&&c.overlay[0].from<=e&&c.overlay[c.overlay.length-1].to>=e){let u=new hi(c.tree,c.overlay[0].from+a.from,-1,a);(s||(s=[r])).push(Da(u,e,n,!1))}}return s?dx(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&~It.EnterBracketed,e instanceof hi)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 hi?(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&It.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&It.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&It.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 u=r._tree.children[a];if(this.mode&It.IncludeAnonymous||u instanceof Pr||!u.type.isAnonymous||oh(u))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let 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 Kr(this.buffer,n,this.stack[s]);return this.bufferNode=new Kr(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 Pr||!e.type.isAnonymous||oh(e))}function HT(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:s=_T,reused:a=[],minRepeatType:c=r.types.length}=t,u=Array.isArray(n)?new sh(n,n.length):n,f=r.types,h=0,g=0;function b(D,B,M,z,P,J){let{id:W,start:G,end:Se,size:ye}=u,xe=g,_=h;if(ye<0)if(u.next(),ye==-1){let L=a[W];M.push(L),z.push(G-D);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],de,$,ne=G-D;if(Se-G<=s&&($=T(u.pos-B,P))){let L=new Uint16Array($.size-$.skip),V=u.pos-$.size,ue=L.length;for(;u.pos>V;)ue=R($.start,L,ue);de=new Pr(L,Se-$.start,r),ne=$.start-D}else{let L=u.pos-ye;u.next();let V=[],ue=[],ve=W>=c?W:-1,Ne=0,Re=Se;for(;u.pos>L;)ve>=0&&u.id==ve&&u.size>=0?(u.end<=Re-s&&(A(V,ue,G,Ne,u.end,Re,ve,xe,_),Ne=V.length,Re=u.end),u.next()):J>2500?v(G,L,V,ue):b(G,L,V,ue,ve,J+1);if(ve>=0&&Ne>0&&Ne<V.length&&A(V,ue,G,Ne,G,Re,ve,xe,_),V.reverse(),ue.reverse(),ve>-1&&Ne>0){let qe=S(ee,_);de=ch(ee,V,ue,0,V.length,0,Se-G,qe,qe)}else de=C(ee,V,ue,Se-G,xe-Se,_)}M.push(de),z.push(ne)}function v(D,B,M,z){let P=[],J=0,W=-1;for(;u.pos>B;){let{id:G,start:Se,end:ye,size:xe}=u;if(xe>4)u.next();else{if(W>-1&&Se<W)break;W<0&&(W=ye-s),P.push(G,Se,ye),J++,u.next()}}if(J){let G=new Uint16Array(J*4),Se=P[P.length-2];for(let ye=P.length-3,xe=0;ye>=0;ye-=3)G[xe++]=P[ye],G[xe++]=P[ye+1]-Se,G[xe++]=P[ye+2]-Se,G[xe++]=xe;M.push(new Pr(G,P[2]-Se,r)),z.push(Se-D)}}function S(D,B){return(M,z,P)=>{let J=0,W=M.length-1,G,Se;if(W>=0&&(G=M[W])instanceof pn){if(!W&&G.type==D&&G.length==P)return G;(Se=G.prop(mt.lookAhead))&&(J=z[W]+G.length+Se)}return C(D,M,z,P,J,B)}}function A(D,B,M,z,P,J,W,G,Se){let ye=[],xe=[];for(;D.length>z;)ye.push(D.pop()),xe.push(B.pop()+M-P);D.push(C(r.types[W],ye,xe,J-P,G-J,Se)),B.push(P-M)}function C(D,B,M,z,P,J,W){if(J){let G=[mt.contextHash,J];W=W?[G].concat(W):[G]}if(P>25){let G=[mt.lookAhead,P];W=W?[G].concat(W):[G]}return new pn(D,B,M,z,W)}function T(D,B){let M=u.fork(),z=0,P=0,J=0,W=M.end-s,G={size:0,start:0,skip:0};e:for(let Se=M.pos-D;M.pos>Se;){let ye=M.size;if(M.id==B&&ye>=0){G.size=z,G.start=P,G.skip=J,J+=4,z+=4,M.next();continue}let xe=M.pos-ye;if(ye<0||xe<Se||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()}P=ee,z+=ye,J+=_}return(B<0||z==D)&&(G.size=z,G.start=P,G.skip=J),G.size>4?G:void 0}function R(D,B,M){let{id:z,start:P,end:J,size:W}=u;if(u.next(),W>=0&&z<c){let G=M;if(W>4){let Se=u.pos-(W-4);for(;u.pos>Se;)M=R(D,B,M)}B[--M]=G,B[--M]=J-D,B[--M]=P-D,B[--M]=z}else W==-3?h=z:W==-4&&(g=z);return M}let j=[],E=[];for(;u.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 pn(f[t.topID],j.reverse(),E.reverse(),O)}const fx=new WeakMap;function Ac(t,e){if(!t.isAnonymous||e instanceof Pr||e.type!=t)return 1;let n=fx.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof pn)){n=1;break}n+=Ac(t,r)}fx.set(e,n)}return n}function ch(t,e,n,r,s,a,c,u,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,R,j){for(let E=T;E<R;){let O=E,D=C[E],B=Ac(t,A[E]);for(E++;E<R;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-D;b.push(ch(t,A,C,O,E,D,M,null,f))}v.push(D+j-a)}}return S(e,n,r,s,0),(u||f)(b,v,c)}class Bs{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 Bs(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 u=0,f=0,h=0;;u++){let g=u<n.length?n[u]: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 Bs(S,A,v.tree,v.offset+h,u>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 IT{startParse(e,n,r){return typeof e=="string"&&(e=new UT(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 UT{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 FT=0;class pi{constructor(e,n,r,s){this.name=e,this.set=n,this.base=r,this.modified=s,this.id=FT++}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 pi&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let s=new pi(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 VT=0;class kc{constructor(e){this.name=e,this.instances=[],this.id=VT++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(u=>u.base==e&&PT(n,u.modified));if(r)return r;let s=[],a=new pi(e.name,s,e,n);for(let u of n)u.instances.push(a);let c=KT(n);for(let u of e.set)if(!u.modified.length)for(let f of c)s.push(kc.get(u,f));return a}}function PT(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function KT(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 YT(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,u=s;for(let b=0;;){if(u=="..."&&b>0&&b+3==s.length){c=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(u);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);u=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 GT.add(e)}const GT=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 XT(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 u of a)for(let f of u.set){let h=n[f.id];if(h){c=c?c+" "+h:h;break}}return c},scope:r}}const je=pi.define,Nc=je(),Yr=je(),hx=je(Yr),px=je(Yr),Gr=je(),Tc=je(Gr),uh=je(Gr),Yi=je(),$s=je(Yi),Gi=je(),Xi=je(),dh=je(),_a=je(dh),jc=je(),it={comment:Nc,lineComment:je(Nc),blockComment:je(Nc),docComment:je(Nc),name:Yr,variableName:je(Yr),typeName:hx,tagName:je(hx),propertyName:px,attributeName:je(px),className:je(Yr),labelName:je(Yr),namespace:je(Yr),macroName:je(Yr),literal:Gr,string:Tc,docString:je(Tc),character:je(Tc),attributeValue:je(Tc),number:uh,integer:je(uh),float:je(uh),bool:je(Gr),regexp:je(Gr),escape:je(Gr),color:je(Gr),url:je(Gr),keyword:Gi,self:je(Gi),null:je(Gi),atom:je(Gi),unit:je(Gi),modifier:je(Gi),operatorKeyword:je(Gi),controlKeyword:je(Gi),definitionKeyword:je(Gi),moduleKeyword:je(Gi),operator:Xi,derefOperator:je(Xi),arithmeticOperator:je(Xi),logicOperator:je(Xi),bitwiseOperator:je(Xi),compareOperator:je(Xi),updateOperator:je(Xi),definitionOperator:je(Xi),typeOperator:je(Xi),controlOperator:je(Xi),punctuation:dh,separator:je(dh),bracket:_a,angleBracket:je(_a),squareBracket:je(_a),paren:je(_a),brace:je(_a),content:Yi,heading:$s,heading1:je($s),heading2:je($s),heading3:je($s),heading4:je($s),heading5:je($s),heading6:je($s),contentSeparator:je(Yi),list:je(Yi),quote:je(Yi),emphasis:je(Yi),strong:je(Yi),link:je(Yi),monospace:je(Yi),strikethrough:je(Yi),inserted:je(),deleted:je(),changed:je(),invalid:je(),meta:jc,documentMeta:je(jc),annotation:je(jc),processingInstruction:je(jc),definition:pi.defineModifier("definition"),constant:pi.defineModifier("constant"),function:pi.defineModifier("function"),standard:pi.defineModifier("standard"),local:pi.defineModifier("local"),special:pi.defineModifier("special")};for(let t in it){let e=it[t];e instanceof pi&&(e.name=t)}XT([{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,JT=new mt;class cr{constructor(e,n,r=[],s=""){this.data=e,this.name=s,vt.prototype.hasOwnProperty("tree")||Object.defineProperty(vt.prototype,"tree",{get(){return Xr(this)}}),this.parser=n,this.extension=[wl.of(this),vt.languageData.of((a,c,u)=>{let f=mx(a,c,u),h=f.type.prop(Ec);if(!h)return[];let g=a.facet(h),b=f.type.prop(JT);if(b){let v=f.resolve(c-f.from,u);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 mx(e,n,r).type.prop(Ec)==this.data}findRegions(e){let n=e.facet(wl);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 u=a.prop(mt.mounted);if(u){if(u.tree.prop(Ec)==this.data){if(u.overlay)for(let f of u.overlay)r.push({from:f.from+c,to:f.to+c});else r.push({from:c,to:c+a.length});return}else if(u.overlay){let f=r.length;if(s(u.tree,u.overlay[0].from+c),r.length>f)return}}for(let f=0;f<a.children.length;f++){let h=a.children[f];h instanceof pn&&s(h,a.positions[f]+c)}};return s(Xr(e),0),r}get allowsNesting(){return!0}}cr.setState=Ht.define();function mx(t,e,n){let r=t.facet(wl),s=Xr(t).topNode;if(!r||r.allowsNesting)for(let a=s;a;a=a.enter(e,n,It.ExcludeBuffers|It.EnterBracketed))a.type.isTop&&(s=a);return s}function Xr(t){let e=t.field(cr.state,!1);return e?e.tree:pn.empty}class QT{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 La=null;class Oc{constructor(e,n,r=[],s,a,c,u,f){this.parser=e,this.state=n,this.fragments=r,this.tree=s,this.treeLen=a,this.viewport=c,this.skipped=u,this.scheduleOn=f,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Oc(e,n,[],pn.empty,0,r,[],null)}startParse(){return this.parser.startParse(new QT(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=pn.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(Bs.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(Bs.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=La;La=this;try{return e()}finally{La=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=gx(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:s,treeLen:a,viewport:c,skipped:u}=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=Bs.applyChanges(r,f),s=pn.empty,a=0,c={from:e.mapPos(c.from,-1),to:e.mapPos(c.to,1)},this.skipped.length){u=[];for(let h of this.skipped){let g=e.mapPos(h.from,1),b=e.mapPos(h.to,-1);g<b&&u.push({from:g,to:b})}}}return new Oc(this.parser,n,r,s,a,c,u,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:s,to:a}=this.skipped[r];s<e.to&&a>e.from&&(this.fragments=gx(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 IT{createParse(n,r,s){let a=s[0].from,c=s[s.length-1].to;return{parsedPos:a,advance(){let f=La;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 pn(fi.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 La}}function gx(t,e,n){return Bs.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class vl{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 vl(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=Oc.create(e.facet(wl).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new vl(r)}}cr.state=zr.define({create:vl.init,update(t,e){for(let n of e.effects)if(n.is(cr.setState))return n.value;return e.startState.facet(wl)!=e.state.facet(wl)?vl.init(e.state):t.apply(e)}});let yx=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(yx=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,WT=ar.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(cr.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(cr.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=yx(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(cr.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),u=a.context.treeLen<s&&r.doc.length>s+1e3,f=a.context.work(()=>hh&&hh()||Date.now()>c,s+(u?0:1e5));this.chunkBudget-=Date.now()-n,(f||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:cr.setState.of(new vl(a.context))})),this.chunkBudget>0&&!(f&&!u)&&this.scheduleWork(),this.checkAsyncSchedule(a.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Pi(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()}}}),wl=He.define({combine(t){return t.length?t[0]:null},enables:t=>[cr.state,WT,Ge.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),ZT=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 bx(t,e){t instanceof vt&&(t=new Dc(t));for(let r of t.state.facet(ZT)){let s=r(t,e);if(s!==void 0)return s}let n=Xr(t.state);return n.length>=e?tj(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 ej=new mt;function tj(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 xx(r,t,n)}function xx(t,e,n){for(let r=t;r;r=r.next){let s=ij(r.node);if(s)return s(mh.create(e,n,r))}return 0}function nj(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function ij(t){let e=t.type.prop(ej);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=>aj(c,!0,1,void 0,a&&!nj(c)?s.from:void 0)}return t.parent==null?rj:null}function rj(){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(sj(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return xx(this.context.next,this.base,this.pos)}}function sj(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function lj(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 u=n.to;;){let f=e.childAfter(u);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}}u=f.to}}function aj(t,e,n,r,s){let a=t.textAfter,c=a.match(/^\s*/)[0].length,u=r&&a.slice(c,c+r.length)==r||s==t.pos+c,f=lj(t);return f?u?t.column(f.from):t.column(f.to):t.baseIndent+(u?0:t.unit*n)}const oj=1e4,cj="()[]{}",uj=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(uj);return e?e(t.node):t}function Sl(t,e,n,r={}){let s=r.maxScanDistance||oj,a=r.brackets||cj,c=Xr(t),u=c.resolveInner(e,n);for(let f=u;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 dj(t,e,n,f,g,h,a)}}return fj(t,e,n,c,u.type,s,a)}function dj(t,e,n,r,s,a,c){let u=r.parent,f={from:s.from,to:s.to},h=0,g=u?.cursor();if(g&&(n<0?g.childBefore(r.from):g.childAfter(r.to)))do if(n<0?g.to<=r.from:g.from>=r.to){if(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 fj(t,e,n,r,s,a,c){if(n<0?!e:e==t.doc.length)return null;let u=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),f=c.indexOf(u);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 R=c.indexOf(S[C]);if(!(R<0||r.resolveInner(A+C,1).type!=s))if(R%2==0==n>0)b++;else{if(b==1)return{start:h,end:{from:A+C,to:A+C+1},matched:R>>1==f>>1};b--}}n>0&&(v+=S.length)}return g.done?{start:h,matched:!1}:null}const hj=Object.create(null),vx=[fi.none],wx=[],Sx=Object.create(null),pj=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"]])pj[t]=mj(hj,e);function bh(t,e){wx.indexOf(t)>-1||(wx.push(t),console.warn(e))}function mj(t,e){let n=[];for(let u of e.split(" ")){let f=[];for(let h of u.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(u=>u.id),a=Sx[s];if(a)return a.id;let c=Sx[s]=fi.define({id:vx.length,name:r,props:[YT({[r]:n})]});return vx.push(c),c.id}Rt.RTL,Rt.LTR;const gj=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=vh(t.state,n.from);return r.line?yj(t):r.block?xj(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 yj=xh(Sj,0),bj=xh(Ax,0),xj=xh((t,e)=>Ax(t,e,wj(e)),0);function vh(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const Ba=50;function vj(t,{open:e,close:n},r,s){let a=t.sliceDoc(r-Ba,r),c=t.sliceDoc(s,s+Ba),u=/\s*$/.exec(a)[0].length,f=/^\s*/.exec(c)[0].length,h=a.length-u;if(a.slice(h-e.length,h)==e&&c.slice(f,f+n.length)==n)return{open:{pos:r-u,margin:u&&1},close:{pos:s+f,margin:f&&1}};let g,b;s-r<=2*Ba?g=b=t.sliceDoc(r,s):(g=t.sliceDoc(r,r+Ba),b=t.sliceDoc(s-Ba,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 wj(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 Ax(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)=>vj(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,u;c<s.length;c++)if(u=s[c]){let f=r[c],{open:h,close:g}=u;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 Sj(t,e,n=e.selection.ranges){let r=[],s=-1;e:for(let{from:a,to:c}of n){let u=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=u;g<r.length;g++)r[g].indent<r[g].line.text.length&&(r[g].indent=f);r.length==u+1&&(r[u].single=!0)}if(t!=2&&r.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:u,token:f,indent:h,empty:g,single:b}of r)(b||!g)&&a.push({from:u.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:u,token:f}of r)if(u>=0){let h=c.from+u,g=h+f.length;c.text[g-c.from]==" "&&g++,a.push({from:h,to:g})}return{changes:a}}return null}const wh=Hr.define(),Aj=Hr.define(),kj=He.define(),kx=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)})}}),Cx=zr.define({create(){return Ji.empty},update(t,e){let n=e.state.facet(kx),r=e.annotation(wh);if(r){let f=qn.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=jx(g,e.startState.selection),new Ji(h==0?r.rest:g,h==0?g:r.rest)}let s=e.annotation(Aj);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=qn.fromTransaction(e),c=e.annotation(en.time),u=e.annotation(en.userEvent);return a?t=t.addChanges(a,c,u,n,e):e.selection&&(t=t.addSelection(e.startState.selection,c,u,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 Ji(t.done.map(qn.fromJSON),t.undone.map(qn.fromJSON))}});function Cj(t={}){return[Cx,kx.of(t),Ge.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?Nx: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(Cx,!1);if(!s)return!1;let a=s.pop(t,n,e);return a?(r(a),!0):!1}}const Nx=_c(0,!1),Sh=_c(1,!1),Nj=_c(0,!0),Tj=_c(1,!0);class qn{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 qn(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 qn(e.changes&&Zt.fromJSON(e.changes),[],e.mapped&&Ui.fromJSON(e.mapped),e.startSelection&&Ce.fromJSON(e.startSelection),e.selectionsAfter.map(Ce.fromJSON))}static fromTransaction(e,n){let r=mi;for(let s of e.startState.facet(kj)){let a=s(e);a.length&&(r=r.concat(a))}return!r.length&&e.changes.empty?null:new qn(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,mi)}static selection(e){return new qn(void 0,mi,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 jj(t,e){let n=[],r=!1;return t.iterChangedRanges((s,a)=>n.push(s,a)),e.iterChangedRanges((s,a,c,u)=>{for(let f=0;f<n.length;){let h=n[f++],g=n[f++];u>=h&&c<=g&&(r=!0)}}),r}function Ej(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function Tx(t,e){return t.length?e.length?t.concat(e):t:e}const mi=[],Oj=200;function jx(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Oj));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),Lc(t,t.length-1,1e9,n.setSelAfter(r)))}else return[qn.selection([e])]}function Mj(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=mi;for(;n;){let s=Rj(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?[qn.selection(r)]:mi}function Rj(t,e,n){let r=Tx(t.selectionsAfter.length?t.selectionsAfter.map(u=>u.map(e)):mi,n);if(!t.changes)return qn.selection(r);let s=t.changes.map(e),a=e.mapDesc(t.changes,!0),c=t.mapped?t.mapped.composeDesc(a):a;return new qn(s,Ht.mapEffects(t.effects,e),c,t.startSelection.map(a),r)}const Dj=/^(input\.type|delete)($|\.)/;class Ji{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 Ji(this.done,this.undone):this}addChanges(e,n,r,s,a){let c=this.done,u=c[c.length-1];return u&&u.changes&&!u.changes.empty&&e.changes&&(!r||Dj.test(r))&&(!u.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,jj(u.changes,e.changes))||r=="input.type.compose")?c=Lc(c,c.length-1,s.minDepth,new qn(e.changes.compose(u.changes),Tx(Ht.mapEffects(e.effects,u.changes),u.effects),u.mapped,u.startSelection,mi)):c=Lc(c,c.length,s.minDepth,e),new Ji(c,mi,n,r)}addSelection(e,n,r,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:mi;return a.length>0&&n-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Ej(a[a.length-1],e)?this:new Ji(jx(this.done,e),this.undone,n,r)}addMapping(e){return new Ji(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:Mj(s),selection:c}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let u=s.length==1?mi:s.slice(0,s.length-1);return a.mapped&&(u=Ah(u,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:wh.of({side:e,rest:u,selection:c}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Ji.empty=new Ji(mi,mi);const Ex=[{key:"Mod-z",run:Nx,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:Nj,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Tj,preventDefault:!0}];function Al(t,e){return Ce.create(t.ranges.map(e),t.mainIndex)}function Di(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function _i({state:t,dispatch:e},n){let r=Al(t.selection,n);return r.eq(t.selection,!0)?!1:(e(Di(t,r)),!0)}function Bc(t,e){return Ce.cursor(e?t.to:t.from)}function Ox(t,e){return _i(t,n=>n.empty?t.moveByChar(n,e):Bc(n,e))}function Nn(t){return t.textDirectionAt(t.state.selection.main.head)==Rt.LTR}const Mx=t=>Ox(t,!Nn(t)),Rx=t=>Ox(t,Nn(t));function Dx(t,e){return _i(t,n=>n.empty?t.moveByGroup(n,e):Bc(n,e))}const _j=t=>Dx(t,!Nn(t)),Lj=t=>Dx(t,Nn(t));function Bj(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=Xr(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;Bj(t,h,s)?r=h:f=n?h.to:h.from}let a=r.type.prop(s),c,u;return a&&(c=n?Sl(t,r.from,1):Sl(t,r.to,-1))&&c.matched?u=n?c.end.to:c.end.from:u=n?r.to:r.from,Ce.cursor(u,n?-1:1)}const $j=t=>_i(t,e=>$c(t.state,e,!Nn(t))),qj=t=>_i(t,e=>$c(t.state,e,Nn(t)));function _x(t,e){return _i(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 Lx=t=>_x(t,!1),Bx=t=>_x(t,!0);function $x(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,s;if(e){for(let a of t.state.facet(Ge.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 qx(t,e){let n=$x(t),{state:r}=t,s=Al(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),u=t.scrollDOM.getBoundingClientRect(),f=u.top+n.marginTop,h=u.bottom-n.marginBottom;c&&c.top>f&&c.bottom<h&&(a=Ge.scrollIntoView(s.main.head,{y:"start",yMargin:c.top-f}))}return t.dispatch(Di(r,s),{effects:a}),!0}const zx=t=>qx(t,!1),kh=t=>qx(t,!0);function Jr(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 zj=t=>_i(t,e=>Jr(t,e,!0)),Hj=t=>_i(t,e=>Jr(t,e,!1)),Ij=t=>_i(t,e=>Jr(t,e,!Nn(t))),Uj=t=>_i(t,e=>Jr(t,e,Nn(t))),Fj=t=>_i(t,e=>Ce.cursor(t.lineBlockAt(e.head).from,1)),Vj=t=>_i(t,e=>Ce.cursor(t.lineBlockAt(e.head).to,-1));function Pj(t,e,n){let r=!1,s=Al(t.selection,a=>{let c=Sl(t,a.head,-1)||Sl(t,a.head,1)||a.head>0&&Sl(t,a.head-1,1)||a.head<t.doc.length&&Sl(t,a.head+1,-1);if(!c||!c.end)return a;r=!0;let u=c.start.from==a.head?c.end.to:c.end.from;return Ce.cursor(u)});return r?(e(Di(t,s)),!0):!1}const Kj=({state:t,dispatch:e})=>Pj(t,e);function gi(t,e,n){let r=Al(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(Di(t.state,r)),!0)}function Hx(t,e){return gi(t,e,n=>t.moveByChar(n,e))}const Ix=t=>Hx(t,!Nn(t)),Ux=t=>Hx(t,Nn(t));function Fx(t,e){return gi(t,e,n=>t.moveByGroup(n,e))}const Yj=t=>Fx(t,!Nn(t)),Gj=t=>Fx(t,Nn(t)),Xj=t=>{let e=!Nn(t);return gi(t,e,n=>$c(t.state,n,e))},Jj=t=>{let e=Nn(t);return gi(t,e,n=>$c(t.state,n,e))};function Vx(t,e){return gi(t,e,n=>t.moveVertically(n,e))}const Px=t=>Vx(t,!1),Kx=t=>Vx(t,!0);function Yx(t,e){return gi(t,e,n=>t.moveVertically(n,e,$x(t).height))}const Gx=t=>Yx(t,!1),Xx=t=>Yx(t,!0),Qj=t=>gi(t,!0,e=>Jr(t,e,!0)),Wj=t=>gi(t,!1,e=>Jr(t,e,!1)),Zj=t=>{let e=!Nn(t);return gi(t,e,n=>Jr(t,n,e))},eE=t=>{let e=Nn(t);return gi(t,e,n=>Jr(t,n,e))},tE=t=>gi(t,!1,e=>Ce.cursor(t.lineBlockAt(e.head).from)),nE=t=>gi(t,!0,e=>Ce.cursor(t.lineBlockAt(e.head).to)),Jx=({state:t,dispatch:e})=>(e(Di(t,{anchor:0})),!0),Qx=({state:t,dispatch:e})=>(e(Di(t,{anchor:t.doc.length})),!0),Wx=({state:t,dispatch:e})=>(e(Di(t,{anchor:t.selection.main.anchor,head:0})),!0),Zx=({state:t,dispatch:e})=>(e(Di(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),iE=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),rE=({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},sE=({state:t,dispatch:e})=>{let n=Al(t.selection,r=>{let s=Xr(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:u}=c;if((u.from<r.from&&u.to>=r.to||u.to>r.to&&u.from<=r.from)&&c.next)return Ce.undirectionalRange(u.from,u.to)}return r});return n.eq(t.selection)?!1:(e(Di(t,n)),!0)};function ev(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 u=a;;){let f=t.moveVertically(u,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==u.head)break;u=f}}}return s.length==r.ranges.length?!1:(t.dispatch(Di(n,Ce.create(s,s.length-1))),!0)}const lE=t=>ev(t,!1),aE=t=>ev(t,!0),oE=({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(Di(t,r)),!0):!1};function $a(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,s=r.changeByRange(a=>{let{from:c,to:u}=a;if(c==u){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),u=Math.max(u,f)}else c=qc(t,c,!1),u=qc(t,u,!0);return c==u?{range:a}:{changes:{from:c,to:u},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"?Ge.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function qc(t,e,n){if(t instanceof Ge)for(let r of t.state.facet(Ge.atomicRanges).map(s=>s(t)))r.between(e,e,(s,a)=>{s<e&&a>e&&(e=n?a:s)});return e}const tv=(t,e,n)=>$a(t,r=>{let s=r.from,{state:a}=t,c=a.doc.lineAt(s),u,f;if(n&&!e&&s>c.from&&s<c.from+200&&!/[^ \t]/.test(u=c.text.slice(0,s-c.from))){if(u[u.length-1]==" ")return s-1;let h=Yo(u,a.tabSize),g=h%Mc(a)||Mc(a);for(let b=0;b<g&&u[u.length-1-b]==" ";b++)s--;f=s}else f=kn(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=kn(c.text,f-c.from,!1,!1)+c.from);return f}),Ch=t=>tv(t,!1,!0),nv=t=>tv(t,!0,!1),iv=(t,e)=>$a(t,n=>{let r=n.head,{state:s}=t,a=s.doc.lineAt(r),c=s.charCategorizer(r);for(let u=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=kn(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(u!=null&&g!=u)break;(h!=" "||r!=n.head)&&(u=g),r=f}return r}),rv=t=>iv(t,!1),cE=t=>iv(t,!0),uE=t=>$a(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),dE=t=>$a(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),fE=t=>$a(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),hE=({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},pE=({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:kn(a.text,s-a.from,!1)+a.from,u=s==a.to?s+1:kn(a.text,s-a.from,!0)+a.from;return{changes:{from:c,to:u,insert:t.doc.slice(s,u).append(t.doc.slice(c,s))},range:Ce.cursor(u)}});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 sv(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),u=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+u),Math.min(t.doc.length,f.head+u)))}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-u,f.head-u))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Ce.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const mE=({state:t,dispatch:e})=>sv(t,e,!1),gE=({state:t,dispatch:e})=>sv(t,e,!0);function lv(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 yE=({state:t,dispatch:e})=>lv(t,e,!1),bE=({state:t,dispatch:e})=>lv(t,e,!0),xE=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=Al(e.selection,s=>{let a;if(t.lineWrapping){let c=t.lineBlockAt(s.head),u=t.coordsAtPos(s.head,s.assoc||1);u&&(a=c.bottom+t.documentTop-u.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 vE(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Xr(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 av=ov(!1),wE=ov(!0);function ov(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(s=>{let{from:a,to:c}=s,u=e.doc.lineAt(a),f=!t&&a==c&&vE(e,a);t&&(a=c=(c<=u.to?u:e.doc.lineAt(c)).to);let h=new Dc(e,{simulateBreak:a,simulateDoubleBreak:!!f}),g=bx(h,a);for(g==null&&(g=Yo(/^\s*/.exec(e.doc.lineAt(a).text)[0],e.tabSize));c<u.to&&/\s/.test(u.text[c-u.from]);)c++;f?{from:a,to:c}=f:a>u.from&&a<u.from+100&&!/\S/.test(u.text.slice(0,a))&&(a=u.from);let b=["",Rc(e,g)];return f&&b.push(Rc(e,h.lineIndent(u.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 u=t.doc.lineAt(c);u.number>n&&(r.empty||r.to>u.from)&&(e(u,s,r),n=u.number),c=u.to+1}let a=t.changes(s);return{changes:s,range:Ce.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const SE=({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,u)=>{let f=bx(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||u.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},cv=({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),uv=({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,u=Rc(t,Math.max(0,a-Mc(t)));for(;c<s.length&&c<u.length&&s.charCodeAt(c)==u.charCodeAt(c);)c++;r.push({from:n.from+c,to:n.from+s.length,insert:u.slice(c)})}),{userEvent:"delete.dedent"})),!0),AE=t=>(t.setTabFocusMode(),!0),kE=[{key:"Ctrl-b",run:Mx,shift:Ix,preventDefault:!0},{key:"Ctrl-f",run:Rx,shift:Ux},{key:"Ctrl-p",run:Lx,shift:Px},{key:"Ctrl-n",run:Bx,shift:Kx},{key:"Ctrl-a",run:Fj,shift:tE},{key:"Ctrl-e",run:Vj,shift:nE},{key:"Ctrl-d",run:nv},{key:"Ctrl-h",run:Ch},{key:"Ctrl-k",run:uE},{key:"Ctrl-Alt-h",run:rv},{key:"Ctrl-o",run:hE},{key:"Ctrl-t",run:pE},{key:"Ctrl-v",run:kh}],CE=[{key:"ArrowLeft",run:Mx,shift:Ix,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:_j,shift:Yj,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Ij,shift:Zj,preventDefault:!0},{key:"ArrowRight",run:Rx,shift:Ux,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Lj,shift:Gj,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Uj,shift:eE,preventDefault:!0},{key:"ArrowUp",run:Lx,shift:Px,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Jx,shift:Wx},{mac:"Ctrl-ArrowUp",run:zx,shift:Gx},{key:"ArrowDown",run:Bx,shift:Kx,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Qx,shift:Zx},{mac:"Ctrl-ArrowDown",run:kh,shift:Xx},{key:"PageUp",run:zx,shift:Gx},{key:"PageDown",run:kh,shift:Xx},{key:"Home",run:Hj,shift:Wj,preventDefault:!0},{key:"Mod-Home",run:Jx,shift:Wx},{key:"End",run:zj,shift:Qj,preventDefault:!0},{key:"Mod-End",run:Qx,shift:Zx},{key:"Enter",run:av,shift:av},{key:"Mod-a",run:iE},{key:"Backspace",run:Ch,shift:Ch,preventDefault:!0},{key:"Delete",run:nv,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:rv,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:cE,preventDefault:!0},{mac:"Mod-Backspace",run:dE,preventDefault:!0},{mac:"Mod-Delete",run:fE,preventDefault:!0}].concat(kE.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),dv=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:$j,shift:Xj},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:qj,shift:Jj},{key:"Alt-ArrowUp",run:mE},{key:"Shift-Alt-ArrowUp",run:yE},{key:"Alt-ArrowDown",run:gE},{key:"Shift-Alt-ArrowDown",run:bE},{key:"Mod-Alt-ArrowUp",run:lE},{key:"Mod-Alt-ArrowDown",run:aE},{key:"Escape",run:oE},{key:"Mod-Enter",run:wE},{key:"Alt-l",mac:"Ctrl-l",run:rE},{key:"Mod-i",run:sE,preventDefault:!0},{key:"Mod-[",run:uv},{key:"Mod-]",run:cv},{key:"Mod-Alt-\\",run:SE},{key:"Shift-Mod-k",run:xE},{key:"Shift-Mod-\\",run:Kj},{key:"Mod-/",run:gj},{key:"Alt-A",mac:"Ctrl-A",run:bj},{key:"Ctrl-m",mac:"Shift-Alt-m",run:AE}].concat(CE),NE={key:"Tab",run:cv,shift:uv};function fv({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 hv(t){const e=t==="dark";return Ge.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 TE={key:"Enter",run:t=>(t.dispatch(t.state.replaceSelection(`
|
|
59
|
+
`)),!0)};function pv(t){const e=dv.filter(n=>n.key!=="Enter");return Kb.of(t?[...dv,...Ex,NE]:[TE,...e,...Ex])}const qa=U.forwardRef(({ariaLabel:t,value:e,onChange:n,language:r="text",theme:s="light",minLines:a=7,maxLines:c=16,dataTestId:u,wrap:f=!1,autoIndent:h=!1,ariaControls:g,ariaActiveDescendant:b,ariaAutocomplete:v,ariaExpanded:S,onEditorKeyDown:A,onCursorChange:C},T)=>{const R=U.useRef(null),j=U.useRef(null),E=U.useRef(n),O=U.useRef(C),D=U.useRef(A),B=U.useRef(!1),M=U.useRef({value:e,theme:s,wrap:f,autoIndent:h,ariaLabel:t,dataTestId:u,ariaControls:g,ariaActiveDescendant:b,ariaAutocomplete:v,ariaExpanded:S}),z=U.useMemo(()=>new ir,[]),P=U.useMemo(()=>new ir,[]),J=U.useMemo(()=>new ir,[]),W=U.useMemo(()=>new ir,[]),G=U.useMemo(()=>new ir,[]);E.current=n,O.current=C,D.current=A,U.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,de=ee)=>{const $=j.current;if(!$)return;const ne=$.state.doc.length,L=Math.max(0,Math.min(ee,ne)),V=Math.max(0,Math.min(de,ne));$.dispatch({selection:{anchor:L,head:V},scrollIntoView:!0}),$.focus(),O.current?.(L)},coordsAtPos:ee=>{const de=j.current;if(!de)return null;const $=Math.max(0,Math.min(ee,de.state.doc.length)),ne=de.coordsAtPos($);return ne?{left:ne.left,right:ne.right,top:ne.top,bottom:ne.bottom}:null}}),[]),U.useEffect(()=>{if(!R.current||j.current)return;const ee=M.current,de=vt.create({doc:ee.value,extensions:[Cj(),yT(),z.of(hv(ee.theme)),P.of(ee.wrap?Ge.lineWrapping:[]),J.of(ee.wrap?[]:[rx(),lx(),Zb()]),W.of(pv(ee.autoIndent)),G.of(Ge.contentAttributes.of(fv(ee))),Uo.highest(Ge.domEventHandlers({keydown:ne=>(D.current?.(ne),ne.defaultPrevented)})),Ge.updateListener.of(ne=>{ne.docChanged&&!B.current&&E.current(ne.state.doc.toString()),(ne.selectionSet||ne.docChanged)&&O.current?.(ne.state.selection.main.head)})]}),$=new Ge({state:de,parent:R.current});return j.current=$,()=>{$.destroy(),j.current=null}},[G,J,W,z,P]),U.useEffect(()=>{const ee=j.current;if(!ee||ee.state.doc.toString()===e)return;const de=ee.state.selection.main;B.current=!0,ee.dispatch({changes:{from:0,to:ee.state.doc.length,insert:e},selection:{anchor:Math.min(de.anchor,e.length),head:Math.min(de.head,e.length)}}),B.current=!1},[e]),U.useEffect(()=>{j.current?.dispatch({effects:z.reconfigure(hv(s))})},[s,z]),U.useEffect(()=>{j.current?.dispatch({effects:P.reconfigure(f?Ge.lineWrapping:[])}),j.current?.dispatch({effects:J.reconfigure(f?[]:[rx(),lx(),Zb()])})},[J,f,P]),U.useEffect(()=>{j.current?.dispatch({effects:W.reconfigure(pv(h))})},[h,W]),U.useEffect(()=>{j.current?.dispatch({effects:G.reconfigure(Ge.contentAttributes.of(fv({ariaLabel:t,dataTestId:u,ariaControls:g,ariaActiveDescendant:b,ariaAutocomplete:v,ariaExpanded:S})))})},[b,v,g,S,t,G,u]);const Se=Math.max(1,e.split(`
|
|
60
|
+
`).length),xe=Math.min(c,Math.max(a,Se))*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:R,className:"h-full min-w-0"})})});qa.displayName="ApiClientCodeEditor";const mv=()=>({key:"",value:"",enabled:!0}),Th=()=>({key:"",value:"",enabled:!0,type:"text"}),gv=[["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 jE(t){const e=(t||"").toLowerCase();return e.includes("json")?"json":e.includes("xml")?"xml":e.includes("html")?"html":e.includes("javascript")?"javascript":"text"}function EE({label:t,entries:e,onChange:n,inputClass:r}){const s=(a,c)=>n(e.map((u,f)=>f===a?{...u,...c}:u));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:u=>s(c,{enabled:u.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:u=>s(c,{key:u.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:u=>s(c,{value:u.target.value})}),p.jsx("button",{type:"button","aria-label":`Remove ${t.toLowerCase()} ${c+1}`,className:"rounded-md border p-2",onClick:()=>n(e.filter((u,f)=>f!==c)),children:p.jsx(oi,{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,mv()]),children:[p.jsx(Ns,{className:"h-3.5 w-3.5"})," Add field"]})]})}const OE=({draft:t,onChange:e,theme:n="light"})=>{const r=t.bodyMode||da(t),s=n==="dark",a=s?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",u=gv.some(([v])=>v===t.contentType)?t.contentType||"application/json":"__custom__",f=U.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=U.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:u,onChange:v=>{const S=v.target.value==="__custom__"?"":v.target.value;e({...t,contentType:S})},children:[gv.map(([v,S])=>p.jsx("option",{value:v,children:S},v)),p.jsx("option",{value:"__custom__",children:"Custom…"})]})]}),u==="__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(qa,{ariaLabel:"Request body",language:r==="json"?"json":jE(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(EE,{label:"Form field",entries:t.urlencoded?.length?t.urlencoded:[mv()],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(oi,{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(Ns,{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(qa,{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(qa,{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 ME(t,e){return t.find(([n])=>n.toLowerCase()===e.toLowerCase())?.[1]||""}function RE(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 DE(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 _E(t,e){const n=e.trim().toLowerCase();return n?t.split(`
|
|
61
|
+
`).filter(s=>s.toLowerCase().includes(n)).join(`
|
|
62
|
+
`):t}const LE=({response:t,theme:e="light",curlCommand:n,advanced:r=!0})=>{const[s,a]=U.useState("pretty"),[c,u]=U.useState(""),[f,h]=U.useState(!1),[g,b]=U.useState(""),[v,S]=U.useState(!1),A=ME(t.headers,"content-type"),C=U.useMemo(()=>RE(t.body,A),[A,t.body]),T=/(?:text\/html|application\/xhtml\+xml)/i.test(A),R=U.useMemo(()=>new TextEncoder().encode(t.body).byteLength,[t.body]),j=e==="dark",E=r?s:"pretty",O=E==="pretty"?C.body:t.body,D=U.useMemo(()=>DE(O,c),[c,O]),B=U.useMemo(()=>f?_E(O,c):O,[c,O,f]),M=g.trim().toLowerCase(),z=t.headers.filter(([G,Se])=>!M||`${G}: ${Se}`.toLowerCase().includes(M)),P=j?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",J=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 ${J}`,children:[p.jsxs("span",{children:[t.responseTime," ms"]}),p.jsxs("span",{children:[R.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 Se=G==="pretty"?"Pretty":"Raw";return p.jsx("button",{type:"button","aria-label":Se,"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:Se},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 ${P}`,placeholder:"Search response body…",value:c,onChange:G=>u(G.target.value)}),p.jsx("span",{className:`text-xs ${J}`,children:c.trim()?`${D} match${D===1?"":"es"}`:"Search exact response text"}),p.jsxs("label",{className:`inline-flex items-center gap-2 text-xs ${J}`,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(Lr,{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(Lr,{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 ${P}`,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,Se],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:Se})]},`${G}:${ye}`)),z.length===0&&p.jsx("tr",{children:p.jsx("td",{colSpan:2,className:`px-3 py-4 text-center ${J}`,children:"No response headers match this filter."})})]})]})})]})]})};function BE(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 $E(t,e){let n=0,r=0;const s={...e};for(let a=0;a<t.length;a+=1){const c=t[a],u=t[a+1];if(s.blockComment){c==="*"&&u==="/"&&(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==="/"&&u==="/")break;if(c==="/"&&u==="*"){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 qE(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 u=a.replace(/[ \t]+$/g,"").trimStart();if(!u)return"";const f=u.match(/^}+/)?.[0].length||0,h=Math.max(0,n-f),g=$E(u,r);return r=g.state,n=Math.max(0,n+g.opens-g.closes),`${" ".repeat(h)}${u}`}).join(`
|
|
67
|
+
`)}function yv(t,e){return t.slice(0,Math.max(0,Math.min(e,t.length))).replace(/\r\n?/g,`
|
|
68
|
+
`).length}function bv(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,u=a.lastIndexOf(`
|
|
72
|
+
`),f=a.length-(u+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,R)=>T+R.length+1,0)+A}function zE(t,e,n=e){const r=t.replace(/\r\n?/g,`
|
|
73
|
+
`),s=qE(t),a=bv(r,s,yv(t,e)),c=bv(r,s,yv(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."}],HE={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 xv(t,e){return[...HE[t]||[]].filter(n=>e==="tests"||!n.testsOnly).map(n=>({...n}))}function IE(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 UE=[{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 FE(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 VE(t){const e=t.match(/flex\.(environment|collection|variables)\.(?:get|has|set|unset)\(\s*['"]([^'"]*)$/);return e?{scope:e[1],prefix:e[2]||""}:null}function PE(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 KE(t,e,n,r={},s=!1){const a=Math.max(0,Math.min(e,t.length)),c=t.slice(0,a),u=VE(c);if(u){const v=IE(u.scope,u.prefix,r);return v.length>0?{from:a-u.prefix.length,to:a,items:v}:null}const f=FE(c);if(f){const v=xv(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=PE(c);if(h){const v=xv(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=UE.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 vv=({ariaLabel:t,value:e,onChange:n,phase:r,theme:s="light",variableKeys:a={}})=>{const c=U.useRef(null),u=U.useRef(null),f=U.useRef([]),[h,g]=U.useState(null),[b,v]=U.useState(0),[S,A]=U.useState({left:12,top:36}),C=U.useMemo(()=>`api-client-script-completions-${t.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,[t]),T=U.useMemo(()=>BE(e),[e]),R=s==="dark",j=J=>{const W=u.current,G=c.current;if(!W||!G)return;const Se=W.coordsAtPos(J);if(!Se)return;const ye=G.getBoundingClientRect(),xe=Se.left-ye.left,_=Math.max(8,ye.width-430),ee=Se.bottom-ye.top+2,de=Math.max(8,ye.height-96);A({left:Math.max(8,Math.min(xe,_)),top:Math.max(8,Math.min(ee,de))})},E=(J,W,G=!1)=>{const Se=KE(J,W,r,a,G);g(Se),v(0),Se&&requestAnimationFrame(()=>j(W))},O=J=>{if(!h)return;const W=`${e.slice(0,h.from)}${J.label}${e.slice(h.to)}`,G=h.from+J.label.length;n(W),g(null),requestAnimationFrame(()=>{u.current?.setSelection(G)})},D=()=>{if(!T.valid)return;const J=u.current?.getSelection()??{from:e.length,to:e.length},W=zE(e,J.from,J.to);W.value!==e&&n(W.value),g(null),requestAnimationFrame(()=>{u.current?.setSelection(W.selectionStart,W.selectionEnd)})};U.useEffect(()=>{f.current[b]?.scrollIntoView({block:"nearest"})},[b]);const B=J=>{const W=u.current?.getSelection().from??e.length;if((J.ctrlKey||J.metaKey)&&J.code==="Space"){J.preventDefault(),E(e,W,!0);return}if(J.shiftKey&&J.altKey&&J.code==="KeyF"){J.preventDefault(),D();return}if(!(!h||h.items.length===0)){if(J.key==="ArrowDown"){J.preventDefault(),v(G=>(G+1)%h.items.length);return}if(J.key==="ArrowUp"){J.preventDefault(),v(G=>(G-1+h.items.length)%h.items.length);return}if(J.key==="Enter"||J.key==="Tab"){J.preventDefault(),O(h.items[b]);return}J.key==="Escape"&&(J.preventDefault(),g(null))}},M=h?.items[b],z=!!h&&h.items.length>0,P=R?"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:J=>{J.currentTarget.contains(J.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?R?"text-emerald-300":"text-emerald-700":R?"text-amber-300":"text-amber-700"}`,children:[T.valid?p.jsx(aa,{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:J=>J.preventDefault(),onClick:D,"aria-label":"Format current script",children:[p.jsx(yA,{className:"h-3.5 w-3.5"}),"Format"]})]}),p.jsx(qa,{ref:u,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:J=>{const W=u.current?.getSelection().from??J.length;n(J),requestAnimationFrame(()=>{const G=u.current?.getSelection().from??W;E(J,G)})},onCursorChange:J=>{h&&j(J)},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 ${P}`,"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((J,W)=>p.jsxs("button",{ref:G=>{f.current[W]=G},"aria-label":J.label,"aria-selected":W===b,className:`flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-xs ${W===b?R?"bg-blue-700 text-white":"bg-blue-50 text-gray-900":R?"hover:bg-gray-800":"hover:bg-gray-50"}`,id:`${C}-${W}`,onMouseEnter:()=>v(W),onMouseDown:G=>{G.preventDefault(),O(J)},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:J.kind}),p.jsx("span",{className:"font-mono font-semibold",children:J.label}),p.jsx("span",{"aria-hidden":"true",className:`min-w-0 truncate ${W===b&&R?"text-blue-100":R?"text-gray-400":"text-gray-500"}`,children:J.signature||""})]},`${J.kind}-${J.label}`))}),M&&p.jsxs("div",{className:`border-t px-3 py-2 text-[11px] ${R?"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] ${R?"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 YE(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 GE(t){return t instanceof Error?t.message:"Request failed"}function XE(t){return t?Array.isArray(t)?t.map(([e,n])=>[String(e),String(n)]):[...new Headers(t).entries()]:[]}function JE(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 XE(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(` \\
|
|
74
|
+
`)}function QE(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 WE(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 ZE(t){const e={request:YE(t),...t.hostExecution?.certificateId?{certificateId:t.hostExecution.certificateId}:{},...t.hostExecution?.cookieJar?{cookieJar:t.hostExecution.cookieJar}:{}};t.bodyMode==="binary"&&t.binary?.file&&(e.bodyBase64=WE(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 wv(t){const e=Eh(t.request),n=un(t.scripts),r=t.fetcher||globalThis.fetch,s=t.now||Date.now;let a=Eh(t.request),c=Hc(t.variables),u=Hc(t.collectionVariables);const f=Hc(t.externalVariables);let h=Hc(t.environmentVariables),g=[],b=[],v,S="",A="",C=0,T=!1,R;try{if(n.preRequest.trim()){const M=await S0({script:n.preRequest,phase:"pre-request",draft:a,variables:c,collectionVariables:u,externalVariables:f,environmentVariables:h});if(a=M.draft,c=M.variables,u=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=xk(a,c),S=(a.method||"GET").toUpperCase(),A=a.url;const j=T0(a),E=["GET","HEAD"].includes(S)&&da(a)!=="none",O=j.length>0||E&&t.hostExecution?.available===!0;let D;if(O){const M=new Set(t.hostExecution?.capabilities||[]),z=j.filter(_=>!M.has(_));if(!t.hostExecution?.available||z.length>0){const _=QE(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 P=await ZE(a);C=s(),T=!0;const J=await r(t.hostExecution.endpoint,{method:"POST",credentials:"same-origin",headers:P.headers,body:P.body,...t.signal?{signal:t.signal}:{}}),W=await J.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 Se=typeof G.error=="string"?G.error:void 0;if(!J.ok)throw new Error(Se||`API host execution failed with HTTP ${J.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;D={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=N0(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:P,...J}=z;if(A=P,R=JE(P,J),C=s(),T=!0,!r)throw new Error("Fetch API is not available");const W=await r(P,J),G=await W.text();D={status:W.status,statusText:W.statusText,headers:[...W.headers.entries()],body:G,responseTime:s()-C}}if(n.tests.trim()){const M=await S0({script:n.tests,phase:"tests",draft:a,variables:c,collectionVariables:u,externalVariables:f,environmentVariables:h,response:D});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:D.status,statusText:D.statusText,responseTime:D.responseTime,responseHeaders:D.headers.map(([M,z])=>[M,z]),responseBody:D.body,...b.length?{scriptTests:b}:{},...g.length?{scriptLogs:[...g]}:{},...v?{scriptError:v}:{}},response:D,scriptTests:b,scriptLogs:g,...R?{curlCommand:R}:{},...v?{scriptError:v}:{}}}catch(j){const E=GE(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 eO(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 Sv(t,e){const n=Oh(e);return n?t===n||t.startsWith(`${n}/`)||t.startsWith(`${n}?`):!1}function tO(t,e,n){const r=Oh(n);if(!r)return t;const s=Oh(e);if(s&&Sv(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 nO=()=>({key:"",value:"",enabled:!0});function iO(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||da(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 rO(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 sO(t){try{return new URL(t).origin}catch{return""}}function lO(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 Av({kind:t,label:e,entries:n,onChange:r,inputClass:s,mutedClass:a}){const[c,u]=U.useState(""),f=(g,b)=>r(n.map((v,S)=>S===g?{...v,...b}:v)),h=()=>{const g=lO(t,c);g.length&&(r(g),u(""))};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,nO()]),children:[p.jsx(Ns,{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(oi,{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
|
|
75
|
+
X-Trace: abc123`,value:c,onChange:g=>u(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 kv(t){return(t||[]).filter(e=>e.enabled!==!1&&e.key.trim()).length}function aO(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,u)=>{const f=u.trim();return Object.prototype.hasOwnProperty.call(e,f)?e[f]:c});return{names:r,missing:s,resolved:a}}const Cv=({initialRequest:t,initialScripts:e,initialRequestTab:n="params",initialScriptTab:r,theme:s="light",density:a="advanced",messages:c,credentials:u="same-origin",requestInterceptor:f,onRequestChange:h,onDraftChange:g,onScriptsChange:b,onRequestTabChange:v,onScriptTabChange:S,onExecutionStart:A,onExecutionComplete:C,resolveAuth:T,variables:R={},collectionVariables:j={},externalVariables:E={},environmentVariables:O={},onCollectionChanges:D,onEnvironmentChanges:B,serverOptions:M=[],initialServerUrl:z,onServerUrlChange:P,hostExecution:J})=>{const W=iO(t),G=un(e),Se=M.map(I=>({server:I,url:eO(I)})),ye=Se.map(I=>I.url),xe=z||ye.find(I=>Sv(W.url,I))||"",_=ye.includes(xe)?xe:ye[0]||"",ee=xe&&!ye.includes(xe)?xe:"",de=xe||_||sO(W.url),[$,ne]=U.useState(W),[L,V]=U.useState(G),[ue,ve]=U.useState(_),[Ne,Re]=U.useState(ee),qe=U.useRef(de),Je=U.useRef(de),[Fe,Le]=U.useState(null),[dt,ae]=U.useState(),[le,ge]=U.useState(null),[Te,Ie]=U.useState(null),[Qe,gt]=U.useState([]),[Bt,sn]=U.useState([]),[ln,Hn]=U.useState(!1),gn=U.useRef(null),ot=U.useRef(h),Wn=U.useRef(g),Rn=U.useRef(b),Zn=U.useRef(null),[Tt,x]=U.useState(n),[K,me]=U.useState(()=>r||(G.tests.trim()&&!G.preRequest.trim()?"tests":"pre-request")),fe=U.useRef({}),Q=U.useRef({}),k=U.useId().replace(/:/g,""),X=U.useId().replace(/:/g,"");U.useEffect(()=>{ot.current=h},[h]),U.useEffect(()=>{Wn.current=g},[g]),U.useEffect(()=>{Rn.current=b},[b]),U.useEffect(()=>{Wn.current?.(rO($))},[$]),U.useEffect(()=>{Rn.current?.(un(L))},[L]),U.useEffect(()=>{try{const I=T?{...$,auth:T($.auth)}:$,se=N0(I,{variables:R}),Xe=JSON.stringify([se.method,se.url,se.headerEntries,se.body,se.bodyKind]);if(Xe===Zn.current)return;Zn.current=Xe,ot.current?.(se)}catch{}},[$,T,R]);const Z=($.method||"GET").toUpperCase(),Ae=["GET","HEAD"].includes(Z),H=s==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900",he=s==="dark"?"border-gray-700 bg-gray-800/60 text-gray-100":"border-gray-200 bg-gray-50 text-gray-900",oe=s==="dark"?"text-gray-400":"text-gray-600",ke=Tt==="scripts"&&a!=="advanced"?"params":Tt,Ee=kv($.query),De=kv($.headers),Be=!!$.auth&&$.auth.type!=="none"&&$.auth.type!=="inherit",ze=da($)!=="none",Ye=!!(L.preRequest.trim()||L.tests.trim()),_n=[{id:"params",label:"Params",count:Ee},{id:"headers",label:"Headers",count:De},{id:"authorization",label:"Authorization",active:Be},{id:"body",label:"Body",active:ze},{id:"scripts",label:"Scripts",active:Ye}].filter(I=>a==="advanced"||I.id!=="scripts"),Kt=I=>`${k}-request-tab-${I}`,Li=I=>`${k}-request-panel-${I}`,dr=I=>`${X}-script-tab-${I}`,Me=I=>`${X}-script-panel-${I}`,We=aO($.url,R),Yt=I=>{I==="scripts"&&a!=="advanced"||(x(I),v?.(I))},yi=I=>{me(I),S?.(I)},Bi=(I,se)=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(I.key))return;I.preventDefault();const Xe=_n.filter(Cl=>!Cl.disabled).map(Cl=>Cl.id),Un=Math.max(0,Xe.indexOf(se)),zs=I.key==="Home"?Xe[0]:I.key==="End"?Xe[Xe.length-1]:I.key==="ArrowRight"?Xe[(Un+1)%Xe.length]:Xe[(Un-1+Xe.length)%Xe.length];Yt(zs),fe.current[zs]?.focus()},es=(I,se)=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(I.key))return;I.preventDefault();const Xe=["pre-request","tests"],Un=Xe.indexOf(se),zs=I.key==="Home"?Xe[0]:I.key==="End"?Xe[Xe.length-1]:I.key==="ArrowRight"?Xe[(Un+1)%Xe.length]:Xe[(Un-1+Xe.length)%Xe.length];yi(zs),Q.current[zs]?.focus()},ei=I=>{if(!I)return;const se=qe.current;qe.current=I,P?.(I),ne(Xe=>({...Xe,url:tO(Xe.url,se,I)}))},_t=I=>{const se=I==="inherit"?{type:"inherit"}:I==="bearer"?{type:I,token:""}:I==="oauth2"?{type:I,accessToken:""}:I==="basic"?{type:I,username:"",password:""}:I==="apiKey"?{type:I,key:"",value:"",in:"header"}:I==="digest"?{type:I,username:"",password:""}:I==="hawk"?{type:I,id:"",key:"",algorithm:"sha256"}:I==="ntlm"?{type:I,username:"",password:""}:I==="oauth1"?{type:I,consumerKey:"",consumerSecret:"",signatureMethod:"HMAC-SHA1"}:I==="awsv4"?{type:I,accessKey:"",secretKey:"",region:"",service:""}:{type:"none"};ne(Xe=>({...Xe,auth:se}))},Ut=T?T($.auth):$.auth,bi=T0({...$,auth:Ut}),fr=new Set(J?.capabilities||[]),xi=bi.filter(I=>!fr.has(I)),Vc=Ae&&ze,Ia=bi.length>0,Wi=J?.available===!0&&xi.length===0,kl=Vc?J?.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.`:Ia?Wi?c?.hostBrowserUnsupported||"The browser cannot send this request. FlexDoc will execute it from the API host.":J?.available?`The API host does not support the required capability${xi.length===1?"":"ies"}: ${xi.join(", ")}.`:c?.hostExecutionDisabled||"Host execution is disabled on this documentation server.":null,In=I=>J?.available===!0&&fr.has(I),hr=async()=>{if(ln)return;const I=new AbortController;gn.current=I,A?.(),Hn(!0),ge(null),Ie(null),gt([]),sn([]),Le(null),ae(void 0);try{const se=await wv({request:$,scripts:L,credentials:u,requestInterceptor:f,resolveAuth:T,variables:R,collectionVariables:j,externalVariables:E,environmentVariables:O,hostExecution:J,signal:I.signal,onRequestBuilt:Xe=>ot.current?.(Xe),onCollectionChanges:D,onEnvironmentChanges:B});if(I.signal.aborted){ge(c?.requestCancelled||"Request cancelled.");return}ge(se.error||null),Ie(se.scriptError||null),gt(se.scriptTests),sn(se.scriptLogs),se.response&&(ae(se.curlCommand),Le({status:se.response.status,statusText:se.response.statusText,headers:se.response.headers.map(([Xe,Un])=>[Xe,Un]),body:se.response.body,responseTime:se.response.responseTime})),se.result&&C?.(se.result)}finally{gn.current===I&&(gn.current=null),Hn(!1)}},qs=()=>gn.current?.abort(),ts=Qe.filter(I=>I.passed).length,Ft=!ln&&!(Ia&&!Wi);return p.jsx("div",{className:`min-w-0 rounded-xl border p-4 md:p-5 ${he}`,"data-api-client-editor":!0,onKeyDown:I=>{(I.ctrlKey||I.metaKey)&&I.key==="Enter"&&Ft&&(I.preventDefault(),hr())},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 ${H}`,value:ue,onChange:I=>{ve(I.target.value),Re(""),ei(I.target.value)},children:Se.map(({server:I,url:se})=>p.jsxs("option",{value:se,children:[I.description?`${I.description} — `:"",I.url]},`${I.url}:${se}`))})]}),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 ${H}`,value:Ne,onChange:I=>{const se=I.target.value;Re(se);const Xe=ue||Je.current;(se.trim()||Xe)&&ei(se.trim()||Xe)},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 ${H}`,value:Z,onChange:I=>{const se=I.target.value;ne(Xe=>({...Xe,method:se}))},children:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map(I=>p.jsx("option",{children:I},I))}),p.jsx("input",{"aria-label":"Request URL",className:`w-full rounded-md border px-3 py-2 font-mono text-sm ${H}`,placeholder:"https://api.example.com/resource or {{baseUrl}}/resource",value:$.url,onChange:I=>{const se=I.target.value;ne(Xe=>({...Xe,url:se}))}})]}),We.names.length>0&&p.jsx("div",{className:`rounded-md border px-3 py-2 text-xs ${We.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:We.missing.length>0?p.jsxs(p.Fragment,{children:["Missing URL variable",We.missing.length===1?"":"s",": ",p.jsx("strong",{children:We.missing.join(", ")}),"."]}):p.jsxs(p.Fragment,{children:["Resolved URL: ",p.jsx("code",{className:"break-all",children:We.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:_n.map(I=>p.jsxs("button",{ref:se=>{fe.current[I.id]=se},id:Kt(I.id),type:"button",role:"tab","aria-controls":Li(I.id),"aria-label":I.label,"aria-selected":ke===I.id,tabIndex:ke===I.id?0:-1,className:`inline-flex items-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition ${ke===I.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(I.id),onKeyDown:se=>Bi(se,I.id),children:[p.jsx("span",{children:I.label}),I.count!==void 0&&I.count>0&&p.jsx("span",{className:`rounded-full px-1.5 text-[10px] leading-5 ${ke===I.id?"bg-white/20 text-white":s==="dark"?"bg-gray-700 text-gray-200":"bg-gray-200 text-gray-700"}`,children:I.count}),I.active&&I.count===void 0&&p.jsx("span",{"aria-label":"Configured",className:`h-1.5 w-1.5 rounded-full ${ke===I.id?"bg-white":"bg-blue-500"}`})]},I.id))})}),Ae&&p.jsx("p",{className:`-mt-2 text-xs ${oe}`,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:Li("params"),"aria-labelledby":Kt("params"),children:p.jsx(Av,{kind:"query",label:"Query parameters",entries:$.query||[],onChange:I=>ne(se=>({...se,query:I})),inputClass:H,mutedClass:oe})}),ke==="headers"&&p.jsx("div",{role:"tabpanel",id:Li("headers"),"aria-labelledby":Kt("headers"),children:p.jsx(Av,{kind:"headers",label:"Headers",entries:$.headers||[],onChange:I=>ne(se=>({...se,headers:I})),inputClass:H,mutedClass:oe})}),ke==="authorization"&&p.jsxs("div",{role:"tabpanel",id:Li("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 ${H}`,value:$.auth?.type||"none",onChange:I=>_t(I.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:!In("digest"),children:"Digest (API host)"}),p.jsx("option",{value:"hawk",disabled:!In("hawk"),children:"Hawk (API host)"}),p.jsx("option",{value:"ntlm",disabled:!In("ntlm"),children:"NTLM / Negotiate (API host)"}),p.jsx("option",{value:"oauth1",disabled:!In("oauth1"),children:"OAuth 1.0 (API host)"}),p.jsx("option",{value:"awsv4",disabled:!In("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 ${H}`,value:$.auth.token,onChange:I=>{const se=I.target.value;ne(Xe=>({...Xe,auth:{type:"bearer",token:se}}))}}),(a==="advanced"||$.auth?.type==="oauth2")&&$.auth?.type==="oauth2"&&p.jsx(K0,{auth:$.auth,fieldClass:`w-full rounded-md border px-3 py-2 text-sm ${H}`,label:"",onChange:I=>ne(se=>({...se,auth:I}))}),$.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 ${H}`,placeholder:"Username",value:$.auth.username,onChange:I=>ne(se=>({...se,auth:{...se.auth,username:I.target.value}}))}),p.jsx("input",{"aria-label":"Basic auth password",type:"password",autoComplete:"off",className:`w-full rounded-md border px-3 py-2 ${H}`,placeholder:"Password",value:$.auth.password,onChange:I=>ne(se=>({...se,auth:{...se.auth,password:I.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 ${H}`,placeholder:"Key name",value:$.auth.key,onChange:I=>ne(se=>({...se,auth:{...se.auth,key:I.target.value}}))}),p.jsx("input",{"aria-label":"API key value",type:"password",autoComplete:"off",className:`w-full rounded-md border px-3 py-2 ${H}`,placeholder:"Value",value:$.auth.value,onChange:I=>ne(se=>({...se,auth:{...se.auth,value:I.target.value}}))}),p.jsxs("select",{"aria-label":"API key location",className:`rounded-md border px-3 py-2 text-sm ${H}`,value:$.auth.in,onChange:I=>ne(se=>({...se,auth:{...se.auth,in:I.target.value}})),children:[p.jsx("option",{value:"header",children:"Header"}),p.jsx("option",{value:"query",children:"Query"}),p.jsx("option",{value:"cookie",disabled:!In("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 ${H}`,placeholder:"Username",value:$.auth.username,onChange:I=>ne(se=>({...se,auth:{...se.auth,username:I.target.value}}))}),p.jsx("input",{"aria-label":"Digest password",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${H}`,placeholder:"Password",value:$.auth.password,onChange:I=>ne(se=>({...se,auth:{...se.auth,password:I.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 ${H}`,placeholder:"ID",value:$.auth.id,onChange:I=>ne(se=>({...se,auth:{...se.auth,id:I.target.value}}))}),p.jsx("input",{"aria-label":"Hawk key",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${H}`,placeholder:"Key",value:$.auth.key,onChange:I=>ne(se=>({...se,auth:{...se.auth,key:I.target.value}}))}),p.jsxs("select",{"aria-label":"Hawk algorithm",className:`rounded-md border px-3 py-2 ${H}`,value:$.auth.algorithm||"sha256",onChange:I=>ne(se=>({...se,auth:{...se.auth,algorithm:I.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 ${H}`,placeholder:"ext (optional)",value:$.auth.ext||"",onChange:I=>ne(se=>({...se,auth:{...se.auth,ext:I.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 ${H}`,placeholder:"Username",value:$.auth.username,onChange:I=>ne(se=>({...se,auth:{...se.auth,username:I.target.value}}))}),p.jsx("input",{"aria-label":"NTLM password",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${H}`,placeholder:"Password",value:$.auth.password,onChange:I=>ne(se=>({...se,auth:{...se.auth,password:I.target.value}}))}),p.jsx("input",{"aria-label":"NTLM domain",className:`rounded-md border px-3 py-2 ${H}`,placeholder:"Domain (optional)",value:$.auth.domain||"",onChange:I=>ne(se=>({...se,auth:{...se.auth,domain:I.target.value}}))}),p.jsx("input",{"aria-label":"NTLM workstation",className:`rounded-md border px-3 py-2 ${H}`,placeholder:"Workstation (optional)",value:$.auth.workstation||"",onChange:I=>ne(se=>({...se,auth:{...se.auth,workstation:I.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 ${H}`,placeholder:"Consumer key",value:$.auth.consumerKey,onChange:I=>ne(se=>({...se,auth:{...se.auth,consumerKey:I.target.value}}))}),p.jsx("input",{"aria-label":"OAuth1 consumer secret",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${H}`,placeholder:"Consumer secret",value:$.auth.consumerSecret,onChange:I=>ne(se=>({...se,auth:{...se.auth,consumerSecret:I.target.value}}))}),p.jsx("input",{"aria-label":"OAuth1 token",className:`rounded-md border px-3 py-2 ${H}`,placeholder:"Token (optional)",value:$.auth.token||"",onChange:I=>ne(se=>({...se,auth:{...se.auth,token:I.target.value}}))}),p.jsx("input",{"aria-label":"OAuth1 token secret",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${H}`,placeholder:"Token secret (optional)",value:$.auth.tokenSecret||"",onChange:I=>ne(se=>({...se,auth:{...se.auth,tokenSecret:I.target.value}}))}),p.jsxs("select",{"aria-label":"OAuth1 signature method",className:`rounded-md border px-3 py-2 ${H}`,value:$.auth.signatureMethod||"HMAC-SHA1",onChange:I=>ne(se=>({...se,auth:{...se.auth,signatureMethod:I.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 ${H}`,placeholder:"Realm (optional)",value:$.auth.realm||"",onChange:I=>ne(se=>({...se,auth:{...se.auth,realm:I.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 ${H}`,placeholder:"Access key",value:$.auth.accessKey,onChange:I=>ne(se=>({...se,auth:{...se.auth,accessKey:I.target.value}}))}),p.jsx("input",{"aria-label":"AWS secret key",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${H}`,placeholder:"Secret key",value:$.auth.secretKey,onChange:I=>ne(se=>({...se,auth:{...se.auth,secretKey:I.target.value}}))}),p.jsx("input",{"aria-label":"AWS session token",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${H}`,placeholder:"Session token (optional)",value:$.auth.sessionToken||"",onChange:I=>ne(se=>({...se,auth:{...se.auth,sessionToken:I.target.value}}))}),p.jsx("input",{"aria-label":"AWS region",className:`rounded-md border px-3 py-2 ${H}`,placeholder:"Region",value:$.auth.region,onChange:I=>ne(se=>({...se,auth:{...se.auth,region:I.target.value}}))}),p.jsx("input",{"aria-label":"AWS service",className:`rounded-md border px-3 py-2 ${H}`,placeholder:"Service",value:$.auth.service,onChange:I=>ne(se=>({...se,auth:{...se.auth,service:I.target.value}}))})]}),a==="advanced"&&J?.available&&p.jsxs("div",{className:"grid gap-2 rounded-md border p-3 sm:grid-cols-2",children:[J.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 ${H}`,value:$.hostExecution?.certificateId||"",onChange:I=>ne(se=>({...se,hostExecution:{...se.hostExecution||{},certificateId:I.target.value||void 0}})),children:[p.jsx("option",{value:"",children:"None"}),J.clientCertificates.map(I=>p.jsx("option",{value:I.id,children:I.name},I.id))]})]}):null,In("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:I=>ne(se=>({...se,hostExecution:{...se.hostExecution||{},cookieJar:I.target.checked?"session":void 0}}))}),"Use API host cookie jar"]})]})]}),ke==="body"&&p.jsx("div",{role:"tabpanel",id:Li("body"),"aria-labelledby":Kt("body"),children:p.jsx(OE,{draft:$,onChange:ne,theme:s})}),a==="advanced"&&ke==="scripts"&&p.jsxs("section",{role:"tabpanel",id:Li("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 ${oe}`,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(I=>p.jsxs("button",{ref:se=>{Q.current[I]=se},id:dr(I),type:"button",role:"tab","aria-controls":Me(I),"aria-selected":K===I,tabIndex:K===I?0:-1,className:`rounded-md px-3 py-1.5 text-sm ${K===I?"bg-blue-600 text-white":""}`,onClick:()=>yi(I),onKeyDown:se=>es(se,I),children:[I==="pre-request"?"Pre-request":"Tests",(I==="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 ${K===I?"bg-white":"bg-blue-500"}`})]},I))}),K==="pre-request"?p.jsx("div",{role:"tabpanel",id:Me("pre-request"),"aria-labelledby":dr("pre-request"),className:"min-w-0",children:p.jsx(vv,{ariaLabel:"Pre-request script",phase:"pre-request",theme:s,value:L.preRequest,onChange:I=>V(se=>({...se,preRequest:I})),variableKeys:{environment:Object.keys(O),collection:Object.keys(j),variables:Object.keys(R)}})}):p.jsx("div",{role:"tabpanel",id:Me("tests"),"aria-labelledby":dr("tests"),className:"min-w-0",children:p.jsx(vv,{ariaLabel:"Tests script",phase:"tests",theme:s,value:L.tests,onChange:I=>V(se=>({...se,tests:I})),variableKeys:{environment:Object.keys(O),collection:Object.keys(j),variables:Object.keys(R)}})})]}),kl&&p.jsx("div",{role:Vc||Wi?"status":"alert","aria-label":c?.hostExecutionStatus||"Host execution status",className:`rounded-md border p-3 text-sm ${Wi?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:kl}),ln?p.jsxs("button",{type:"button",onClick:qs,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(xg,{className:"h-4 w-4"}),c?.cancelRequest||"Cancel request"]}):p.jsxs("button",{type:"button","data-api-client-send":"true",onClick:()=>{hr()},disabled:!Ft,"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(oa,{className:"h-4 w-4"})," ",c?.sendRequest||"Send request"," ",p.jsx("span",{className:"text-xs font-normal opacity-80",children:"Ctrl/Cmd+Enter"})]}),le&&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"}),le]}),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]}),Fe&&p.jsx(LE,{response:Fe,theme:s,curlCommand:dt,advanced:a==="advanced"}),Qe.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 ${oe}`,children:[ts,"/",Qe.length," passed"]})]}),p.jsx("div",{className:"space-y-2",children:Qe.map((I,se)=>p.jsxs("div",{className:`rounded-md border px-3 py-2 text-sm ${I.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:[I.passed?"PASS":"FAIL"," — ",I.name]}),I.error&&p.jsx("div",{className:"mt-1 text-xs",children:I.error})]},`${I.name}:${se}`))})]}),Bt.length>0&&p.jsx(Lr,{code:Bt.join(`
|
|
76
|
+
`),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 oO(t,e){return t==="scripts"||e?"advanced":typeof window>"u"?"basic":new URLSearchParams(window.location.search).get("density")==="advanced"?"advanced":"basic"}function Nv(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 cO=({spec:t,path:e,method:n,theme:r,options:s,initialRequestTab:a,initialScriptTab:c,onRequestChange:u,onOpenInApiClient:f})=>{const h=t.paths[e],b=h?.[n.toLowerCase()]?.servers||h?.servers||t.servers||[],v=s?.tryIt?.apiClientPersistenceKey??L0(t.info?.title,typeof window>"u"?void 0:window.location.host),S=U.useMemo(()=>{const ue={...p0(t,e,n),serverUrl:s?.tryIt?.defaultServer};return Tk(t,e,n,ue,s?.tryIt?.defaultServer)},[n,s?.tryIt?.defaultServer,e,t]),A=U.useMemo(()=>un(),[]),[C,T]=U.useState(()=>oO(a,c)),[R,j]=U.useState(S.request),[E,O]=U.useState(S.serverUrl),[D,B]=U.useState(A),[M,z]=U.useState(a||"params"),[P,J]=U.useState(c||"pre-request"),[W,G]=U.useState(()=>rl()),[Se,ye]=U.useState(v===!1),xe=s?.messages;U.useEffect(()=>{if(v===!1)return;let ue=!1;return I0(v).then(ve=>{ue||(G(ve),ye(!0))}).catch(()=>{ue||ye(!0)}),()=>{ue=!0}},[v]),U.useEffect(()=>{!Se||v===!1||U0(v,W).catch(()=>{})},[Se,W,v]);const _=U.useMemo(()=>Xd(W),[W]),ee=Nv(R,D)!==Nv(S.request,A),de=C==="advanced",$=r==="dark"?"border-gray-700 bg-gray-900/40 text-gray-100":"border-gray-200 bg-white text-gray-900",ne=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)},V=()=>f?.({request:R,scripts:un(D),serverUrl:E,requestTab:M,scriptTab:P});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":!de,className:`rounded px-3 py-1.5 text-sm ${de?"":"bg-blue-600 text-white"}`,onClick:()=>L("basic"),children:xe?.tryItBasic||"Basic"}),p.jsx("button",{type:"button","aria-pressed":de,className:`rounded px-3 py-1.5 text-sm ${de?"bg-blue-600 text-white":""}`,onClick:()=>L("advanced"),children:xe?.tryItAdvanced||"Advanced"})]}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[de&&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:V,children:[p.jsx(fd,{className:"h-4 w-4"}),xe?.openApiClient||"Open in API Client"]})]})]}),de&&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 ${ne}`,value:W.activeEnvironmentId||"",onChange:ue=>G(ve=>({...ve,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(Cv,{initialRequest:S.request,initialScripts:A,initialRequestTab:M,initialScriptTab:P,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:u,onDraftChange:j,onScriptsChange:ue=>B(un(ue)),onRequestTabChange:ue=>{z(ue),Mh("tab",ue)},onScriptTabChange:ue=>{J(ue),Mh("script",ue)},onEnvironmentChanges:ue=>G(ve=>Jd(ve,ue))})]})};function Rh(t,e){const n=encodeURIComponent(t).replace(/%/g,"~");return`${e.trim().toLowerCase()}-${n}`}function uO(t,e){return`${e.trim().toLowerCase()}-${t.replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"")}`}const dO=["curl","javascript","python","go","java"];function fO(){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 hO(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 pO=({spec:t,path:e,method:n,theme:r="light",options:s={},defaultExpandedSections:a,runtimeSnapshot:c,onOpenInApiClient:u})=>{const f=fO(),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]=U.useState(()=>({key:b,sections:new Set(g)})),A=v.key===b?v.sections:new Set(g),[C,T]=U.useState(s.codeSamples?.languages?.[0]||"curl"),[R,j]=U.useState(!1),E=U.useId().replace(/:/g,""),O=U.useRef({}),D=U.useMemo(()=>m0(t,e,n,p0(t,e,n)),[t,e,n]),[B,M]=U.useState(D),P=t.paths[e]?.[n.toLowerCase()],J=U.useMemo(()=>JA(t,e,n),[t,e,n]),W=s.messages;if(U.useEffect(()=>{!f.tryIt||typeof document>"u"||requestAnimationFrame(()=>document.getElementById("tryIt-heading")?.scrollIntoView({block:"start"}))},[f.tryIt,n,e]),!P)return p.jsx("div",{className:"p-6",children:"Operation not found."});const G=r==="dark"?"text-gray-400":"text-gray-600",Se=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:dO,_=P.security??t.security,ee={requiredPropsFirst:s.requiredPropsFirst,sortPropsAlphabetically:s.sortPropsAlphabetically},de=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",ne=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",V=le=>`${E}-code-tab-${le}`,ue=`${E}-code-panel`,ve=le=>{const ge=!A.has(le);S(Te=>{const Ie=new Set(Te.key===b?Te.sections:g);return Ie.has(le)?Ie.delete(le):Ie.add(le),{key:b,sections:Ie}}),le==="tryIt"&&hO("tryIt",ge?"1":void 0)},Ne=(le,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:()=>ve(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(pg,{className:"h-5 w-5 shrink-0"}):p.jsx(mg,{className:"h-5 w-5 shrink-0"}),le]}),A.has(ge)&&Te]}),Re=le=>{T(le),O.current[le]?.focus()},qe=(le,ge)=>{if(!/^(ArrowLeft|ArrowRight|Home|End)$/.test(le.key))return;le.preventDefault();const Te=xe.indexOf(ge),Ie=le.key==="Home"?xe[0]:le.key==="End"?xe[xe.length-1]:le.key==="ArrowRight"?xe[(Te+1)%xe.length]:xe[(Te-1+xe.length)%xe.length];Re(Ie)},Je=async()=>{if(typeof window>"u"||typeof navigator>"u"||!navigator.clipboard)return;const le=new URL(window.location.href);le.hash=Rh(e,n),await navigator.clipboard.writeText(le.toString()),j(!0),window.setTimeout(()=>j(!1),1400)},Fe=P.requestBody?Bn.isReference(P.requestBody)?Bn.resolveReference(t,P.requestBody.$ref):P.requestBody:void 0,Le=Object.entries(P).filter(([le])=>le.startsWith("x-")),dt=typeof s.theme=="object"?s.theme.methodColors?.[n.toLowerCase()]:void 0,ae=c?.routes.some(le=>le.method===n.toUpperCase()&&le.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 ${Bn.getMethodColor(n,r)}`,style:{background:dt?.bg,borderColor:dt?.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:()=>{Je()},children:[R?p.jsx(hg,{className:"h-3.5 w-3.5"}):p.jsx(oA,{className:"h-3.5 w-3.5"}),R?"Copied":"Copy link"]})]}),P.summary&&p.jsx("h1",{className:"mb-2 text-2xl font-bold tracking-tight sm:text-3xl",children:P.summary}),P.description&&p.jsx("p",{className:`max-w-3xl whitespace-pre-wrap leading-relaxed ${G}`,children:P.description}),p.jsxs("div",{className:"mt-4 flex flex-wrap gap-3 text-sm",children:[P.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(dA,{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(uA,{className:"h-4 w-4"}),"No authentication required"]}),c&&(ae?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"})),P.operationId&&p.jsxs("span",{className:G,children:["operationId: ",p.jsx("code",{children:P.operationId})]})]}),(s.showExtensions||s.showCommonExtensions)&&Le.length>0&&p.jsx("div",{className:`mt-4 rounded-lg border p-3 text-xs ${Se}`,children:Le.map(([le,ge])=>p.jsxs("div",{children:[p.jsx("code",{children:le}),": ",typeof ge=="string"?ge:JSON.stringify(ge)]},le))})]}),J.length>0&&Ne(W?.parameters||"Parameters","parameters",p.jsx("div",{className:"space-y-3",children:J.map(le=>p.jsxs("div",{className:`rounded-lg border p-4 ${Se}`,children:[p.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[p.jsx("code",{className:"font-medium",children:le.name}),p.jsx("span",{className:`rounded px-2 py-0.5 text-xs ${de}`,children:le.in}),le.required&&p.jsx("span",{className:`rounded px-2 py-0.5 text-xs ${$}`,children:"required"}),le.deprecated&&p.jsx("span",{className:`rounded px-2 py-0.5 text-xs ${ne}`,children:"deprecated"})]}),le.description&&p.jsx("p",{className:`mb-3 text-sm ${G}`,children:le.description}),le.schema&&p.jsx(Br,{spec:t,schema:le.schema,theme:r,required:le.required,...ee})]},`${le.in}:${le.name}`))})),Fe&&Ne(W?.requestBody||"Request Body","requestBody",p.jsxs("div",{className:"space-y-4",children:[Fe.description&&p.jsx("p",{className:G,children:Fe.description}),Object.entries(Fe.content||{}).map(([le,ge])=>p.jsxs("div",{className:`rounded-lg border p-4 ${Se}`,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:le}),Fe.required&&p.jsx("span",{className:`rounded px-2 py-0.5 text-xs ${$}`,children:"required"})]}),ge.schema&&p.jsx(Br,{spec:t,schema:ge.schema,theme:r,...ee}),ge.example!==void 0&&p.jsx("div",{className:"mt-3",children:p.jsx(Lr,{code:JSON.stringify(ge.example,null,2),language:"json",title:"Example payload",theme:r,wrap:!0})})]},le))]})),Ne(W?.responses||"Responses","responses",p.jsx("div",{className:"space-y-4",children:Object.entries(P.responses||{}).map(([le,ge])=>{const Te=Bn.isReference(ge)?Bn.resolveReference(t,ge.$ref):ge;return p.jsxs("div",{className:`rounded-lg border p-4 ${Se}`,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:le}),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,Qe])=>{const gt=Qe.examples&&Object.values(Qe.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}),Qe.schema&&p.jsx("div",{className:"mt-2",children:p.jsx(Br,{spec:t,schema:Qe.schema,theme:r,...ee})}),Qe.example!==void 0&&p.jsx("div",{className:"mt-3",children:p.jsx(Lr,{code:JSON.stringify(Qe.example,null,2),language:"json",title:"Example response",theme:r,wrap:!0})}),gt&&p.jsx("div",{className:"mt-3",children:p.jsx(Lr,{code:JSON.stringify(gt.value??gt,null,2),language:"json",title:"Example response",theme:r,wrap:!0})})]},Ie)})]},le)})})),s.tryIt?.enabled!==!1&&Ne(W?.tryIt||"Try It","tryIt",p.jsx(cO,{spec:t,path:e,method:n,theme:r,options:s,initialRequestTab:f.requestTab,initialScriptTab:f.scriptTab,onRequestChange:M,onOpenInApiClient:u},`${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(le=>p.jsx("button",{ref:ge=>{O.current[le]=ge},id:V(le),type:"button",role:"tab","aria-controls":ue,"aria-selected":C===le,tabIndex:C===le?0:-1,onClick:()=>Re(le),onKeyDown:ge=>qe(ge,le),className:`shrink-0 rounded-md px-3 py-2 text-sm ${C===le?"bg-blue-600 text-white":r==="dark"?"bg-gray-800 text-gray-200":"bg-gray-100 text-gray-700"}`,children:g0(le)},le))}),p.jsx("div",{role:"tabpanel",id:ue,"aria-labelledby":V(C),children:p.jsx(Lr,{code:ZA(B,C),language:C==="curl"?"bash":C,title:g0(C),theme:r,wrap:!!(typeof s.theme=="object"&&s.theme.typography?.code?.wrap)})})]})),P.externalDocs&&p.jsx("p",{className:"pb-4 text-sm",children:p.jsx("a",{className:"text-blue-600 underline",href:P.externalDocs.url,target:"_blank",rel:"noopener noreferrer",children:P.externalDocs.description||"External documentation"})})]})})};function mO(t){const e=t?.["x-flexdoc-priority"]??t?.["x-flexdoc-weight"];return typeof e=="number"&&Number.isFinite(e)?e:0}function gO(t,e){let n=mO(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 yO(t){let e=0;const n=[];for(const[r,s]of Object.entries(t.paths))for(const a of Bn.getHttpMethods(s)){const c=s[a];n.push({path:r,method:a,operation:c,score:gO(c,a),order:e++})}return n.sort((r,s)=>s.score-r.score||r.order-s.order).slice(0,6)}const bO=({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",u=Object.values(t.paths).reduce((g,b)=>{for(const v of Bn.getHttpMethods(b))g[v]=(g[v]||0)+1,g.total+=1;return g},{total:0}),f=yO(t),h=[{icon:gg,title:"Total endpoints",value:u.total,surface:r?"bg-blue-900":"bg-blue-100",iconClass:r?"text-blue-300":"text-blue-600"},{icon:bg,title:"Servers",value:t.servers?.length||0,surface:r?"bg-green-900":"bg-green-100",iconClass:r?"text-green-300":"text-green-600"},{icon:vg,title:"Tags",value:t.tags?.length||0,surface:r?"bg-purple-900":"bg-purple-100",iconClass:r?"text-purple-300":"text-purple-600"},{icon:gA,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(gg,{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 ${Bn.getMethodColor(g,n)}`,children:p.jsx("span",{className:"text-sm font-medium",children:g.toUpperCase()})}),p.jsx("p",{className:"font-bold",children:u[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 ${Bn.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}`))})]})]})]})})},xO=({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}`))})]})})},vO=(t,e,n)=>t==="dark"?n:e,wO="Runtime intelligence returned an invalid snapshot.",SO=new Set(["runtime.operation-undocumented","runtime.operation-unobserved","runtime.method-mismatch","runtime.duplicate-operation"]),AO=new Set(["error","warning","info"]),kO=new Set(["pass","warn","fail","partial"]);function rn(){throw new Error(wO)}function Qi(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function zn(t,e){const n=t[e];return(typeof n!="string"||n.trim()==="")&&rn(),n}function Dh(t,e){const n=t[e];if(n!==void 0)return(typeof n!="string"||n.trim()==="")&&rn(),n}function Tv(t,e){const n=t[e];if(n!==void 0){if(typeof n=="string"&&n.trim()!=="")return n;if(Array.isArray(n)&&n.length>0&&n.every(r=>typeof r=="string"&&r.trim()!==""))return[...n];rn()}}function ur(t,e){const n=t[e];return(typeof n!="number"||!Number.isInteger(n)||n<0)&&rn(),n}function CO(t){return Qi(t)||rn(),{method:zn(t,"method"),path:zn(t,"path")}}function _h(t){return Array.isArray(t)||rn(),t.map(CO)}function NO(t){(!Qi(t)||!Qi(t.location))&&rn();const e=zn(t,"code"),n=zn(t,"severity");(!SO.has(e)||!AO.has(n)||t.location.kind!=="operation")&&rn();const r={id:zn(t,"id"),code:e,severity:n,location:{kind:"operation",path:zn(t.location,"path")},message:zn(t,"message")},s=Dh(t.location,"method");s&&(r.location.method=s);const a=Tv(t,"expected");a!==void 0&&(r.expected=a);const c=Tv(t,"observed");return c!==void 0&&(r.observed=c),r}function TO(t){(!Qi(t)||!Qi(t.summary)||!Array.isArray(t.findings)||typeof t.complete!="boolean")&&rn();const e=zn(t,"status");kO.has(e)||rn();const n=t.findings.map(NO),r={total:ur(t.summary,"total"),errors:ur(t.summary,"errors"),warnings:ur(t.summary,"warnings"),info:ur(t.summary,"info")},s={total:n.length,errors:n.filter(c=>c.severity==="error").length,warnings:n.filter(c=>c.severity==="warning").length,info:n.filter(c=>c.severity==="info").length};JSON.stringify(r)!==JSON.stringify(s)&&rn();const a=r.errors>0?"fail":r.warnings>0?"warn":t.complete?"pass":"partial";return e!==a&&rn(),{status:e,complete:t.complete,findings:n,summary:r}}function jO(t){Qi(t)||rn(),(!Qi(t.runtime)||!Qi(t.summary))&&rn(),typeof t.discoveryComplete!="boolean"&&rn();const e={name:zn(t.runtime,"name"),version:zn(t.runtime,"version"),platform:zn(t.runtime,"platform"),arch:zn(t.runtime,"arch")},n={documented:ur(t.summary,"documented"),runtime:ur(t.summary,"runtime"),matched:ur(t.summary,"matched"),runtimeOnly:ur(t.summary,"runtimeOnly"),documentedOnly:ur(t.summary,"documentedOnly")},r={framework:zn(t,"framework"),runtime:e,discoveryComplete:t.discoveryComplete,routes:_h(t.routes),runtimeOnly:_h(t.runtimeOnly),documentedOnly:_h(t.documentedOnly),summary:n},s=Dh(t,"frameworkVersion");s&&(r.frameworkVersion=s);const a=Dh(t,"serverOrigin");if(a&&(r.serverOrigin=a),t.server!==void 0){Qi(t.server)||rn();const c=t.server.localPort;c!==void 0&&(typeof c!="number"||!Number.isInteger(c)||c<=0||c>65535)&&rn(),r.server=c===void 0?{}:{localPort:c}}return t.environment!==void 0&&(Qi(t.environment)||rn(),r.environment={name:zn(t.environment,"name")}),t.validation!==void 0&&(r.validation=TO(t.validation)),r}const EO=60;function OO(t,e,n=EO){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 Lh=44;function MO(t){return Array.from(t.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])'))}const RO=({spec:t,theme:e,onEndpointSelect:n,onHome:r,onOpenSettings:s,onOpenApiClient:a,onOpenRuntime:c,onSendCurrent:u,messages:f})=>{const[h,g]=U.useState(!1),[b,v]=U.useState(""),[S,A]=U.useState(0),C=U.useRef(null),T=U.useRef(null),R=U.useRef([]),j=h&&typeof document<"u"&&Array.from(document.querySelectorAll('[data-api-client-send="true"]')).some(Se=>!Se.closest(".hidden")),E=U.useMemo(()=>{const Se=[{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},...u&&j?[{id:"send-current",label:f?.sendCurrentRequest||"Send current request",action:u}]:[]];for(const[ye,xe]of Object.entries(t.paths))for(const _ of Bn.getHttpMethods(xe))Se.push({id:`operation:${_}:${ye}`,label:`${_.toUpperCase()} ${ye}`,action:()=>n(ye,_)});return Se},[j,f?.openApiClient,f?.openOverview,f?.openRuntime,f?.openSettings,f?.sendCurrentRequest,n,r,a,c,s,u,t]),O=b.trim().toLowerCase(),D=U.useMemo(()=>O?E.filter(Se=>Se.label.toLowerCase().includes(O)):E,[E,O]),{start:B,end:M}=OO(D.length,S),z=D.slice(B,M),P=U.useCallback(()=>{g(!1),v(""),A(0)},[]),J=U.useCallback(Se=>{Se&&(P(),Se.action())},[P]);if(U.useEffect(()=>{const Se=ye=>{!(ye.ctrlKey||ye.metaKey)||ye.key.toLowerCase()!=="k"||(ye.preventDefault(),g(xe=>!xe))};return document.addEventListener("keydown",Se),()=>document.removeEventListener("keydown",Se)},[]),U.useEffect(()=>{if(!h||typeof document>"u")return;const Se=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(),P();return}if(_.key==="ArrowDown"||_.key==="ArrowUp"||_.key==="Home"||_.key==="End"){_.preventDefault(),A(L=>!D.length||_.key==="Home"?0:_.key==="End"?D.length-1:_.key==="ArrowDown"?(L+1)%D.length:(L-1+D.length)%D.length);return}if(_.key==="Enter"){_.preventDefault(),J(D[S]);return}if(_.key!=="Tab"||!C.current)return;const ee=MO(C.current);if(!ee.length)return;const de=ee[0],$=ee[ee.length-1],ne=document.activeElement;_.shiftKey&&(ne===de||!C.current.contains(ne))?(_.preventDefault(),$.focus()):!_.shiftKey&&(ne===$||!C.current.contains(ne))&&(_.preventDefault(),de.focus())};return document.addEventListener("keydown",xe),()=>{document.body.style.overflow=ye,document.removeEventListener("keydown",xe),Se?.isConnected&&Se.focus()}},[S,J,P,h,D]),U.useEffect(()=>{R.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:P}),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:Se=>{v(Se.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*Lh}}),z.map((Se,ye)=>{const xe=B+ye;return p.jsx("button",{ref:_=>{R.current[xe]=_},type:"button",role:"option","aria-selected":xe===S,"aria-posinset":xe+1,"aria-setsize":D.length,className:`w-full rounded-md p-2 text-left text-sm ${xe===S?G:""}`,style:{height:Lh,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},onMouseEnter:()=>A(xe),onClick:()=>J(Se),children:Se.label},Se.id)}),M<D.length&&p.jsx("div",{"aria-hidden":"true",style:{height:(D.length-M)*Lh}}),!D.length&&p.jsx("div",{className:"p-3 text-sm opacity-65",children:f?.noCommandResults||"No matching commands."})]})]})]})},DO={parameters:"Parameters",requestBody:"Request body",responses:"Responses",tryIt:"Try It",codeSamples:"Code examples"};function _O(t){return t===void 0?"host":Array.isArray(t)?"custom":t==="none"?"minimal":t}function LO(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 BO=({open:t,theme:e,hostTheme:n,manageTheme:r,viewerTheme:s,viewerExpand:a,effectiveExpandedSections:c,messages:u,onThemeChange:f,onExpandChange:h,onClose:g})=>{const b=U.useRef(null),v=U.useRef(null);if(U.useEffect(()=>{if(!t||typeof document>"u")return;const R=document.activeElement instanceof HTMLElement?document.activeElement:null;v.current?.focus();const j=E=>{if(E.key==="Escape"){E.preventDefault(),g();return}if(E.key!=="Tab"||!b.current)return;const O=LO(b.current);if(O.length===0){E.preventDefault(),b.current.focus();return}const D=O[0],B=O[O.length-1],M=document.activeElement;E.shiftKey&&(M===D||!b.current.contains(M))?(E.preventDefault(),B.focus()):!E.shiftKey&&(M===B||!b.current.contains(M))&&(E.preventDefault(),D.focus())};return document.addEventListener("keydown",j),()=>{document.removeEventListener("keydown",j),R?.isConnected&&R.focus()}},[t,g]),!t)return null;const S=e==="dark",A=S?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900",C=S?"border-gray-700 bg-gray-800 text-gray-100":"border-gray-300 bg-white text-gray-900",T=Array.isArray(a)?a.filter(R=>Ts.includes(R)):[];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:g}),p.jsxs("aside",{ref:b,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 ${A}`,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:g,children:p.jsx(gd,{className:"h-5 w-5"})})]}),p.jsxs("div",{className:"flex-1 space-y-6 overflow-y-auto p-4",children:[r&&p.jsxs("section",{"aria-labelledby":"appearance-settings-heading",children:[p.jsx("h2",{id:"appearance-settings-heading",className:"mb-1 text-sm font-semibold",children:u?.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":u?.viewerTheme||"Viewer theme",className:`w-full rounded-md border px-3 py-2 text-sm ${C}`,value:s||"host",onChange:R=>f(R.target.value==="host"?void 0:R.target.value),children:[p.jsxs("option",{value:"host",children:["Use documentation default (",n,")"]}),p.jsx("option",{value:"light",children:u?.lightTheme||"Light"}),p.jsx("option",{value:"dark",children:u?.darkTheme||"Dark"}),p.jsx("option",{value:"high-contrast",children:u?.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:v,"aria-label":"Default expanded sections",className:`w-full rounded-md border px-3 py-2 text-sm ${C}`,value:_O(a),onChange:R=>{const j=R.target.value;h(j==="host"?void 0:j==="custom"?[...c]:j)},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(a)&&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"}),Ts.map(R=>p.jsxs("label",{className:"flex min-h-9 items-center gap-2 text-sm",children:[p.jsx("input",{type:"checkbox",checked:T.includes(R),onChange:j=>{const E=new Set(T);j.target.checked?E.add(R):E.delete(R),h(Ts.filter(O=>E.has(O)))}}),DO[R]]},R))]}),a!==void 0&&p.jsx("button",{type:"button",className:"mt-5 rounded-md border px-3 py-2 text-sm",onClick:()=>h(void 0),children:"Reset to documentation defaults"})]})]})]})]})};function $O(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 qO=({open:t,theme:e,loading:n,error:r,snapshot:s,onClose:a,onEndpointSelect:c,messages:u})=>{const f=U.useRef(null),h=U.useRef(null);if(U.useEffect(()=>{if(!t||typeof document>"u")return;const T=document.activeElement instanceof HTMLElement?document.activeElement:null,R=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=$O(f.current);if(O.length===0){E.preventDefault(),f.current.focus();return}const D=O[0],B=O[O.length-1],M=document.activeElement;E.shiftKey&&(M===D||!f.current.contains(M))?(E.preventDefault(),B.focus()):!E.shiftKey&&(M===B||!f.current.contains(M))&&(E.preventDefault(),D.focus())};return document.addEventListener("keydown",j),()=>{document.body.style.overflow=R,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":u?.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(fg,{className:"h-5 w-5"}),u?.runtimeIntelligence||"Runtime intelligence"]}),p.jsx("p",{className:`mt-1 text-sm ${v}`,children:u?.runtimeIntelligenceDescription||"Live route presence and backend context from the service hosting this documentation."})]}),p.jsx("button",{ref:h,className:"inline-flex h-10 w-10 items-center justify-center rounded-md border","aria-label":u?.closeRuntimeIntelligencePanel||"Close runtime intelligence panel",onClick:a,children:p.jsx(gd,{className:"h-4 w-4"})})]}),n&&p.jsx("p",{className:v,children:u?.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:u?.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:u?.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:u?.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.validation&&p.jsxs("div",{className:"col-span-2 rounded-lg border p-3",children:[p.jsx("div",{className:v,children:u?.contractValidation||"Contract validation"}),p.jsxs("div",{className:"font-semibold",children:[s.validation.status.toUpperCase()," · ",s.validation.summary.total," ",s.validation.summary.total===1?"finding":"findings"]}),p.jsxs("div",{className:`mt-1 text-xs ${v}`,children:[s.validation.summary.errors," errors · ",s.validation.summary.warnings," warnings · ",s.validation.summary.info," info"]})]}),(s.serverOrigin||s.server?.localPort)&&p.jsxs("div",{className:"col-span-2 rounded-lg border p-3",children:[p.jsx("div",{className:v,children:u?.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:[u?.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:u?.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"}),u?.routeDiscoveryPartial||"Route discovery is partial; documented routes not observed at runtime may be false positives."]}),s.validation?p.jsx(zO,{result:s.validation,theme:e,messages:u,onSelect:c?T=>{T.location.method&&(c(T.location.path,T.location.method),a())}:void 0}):p.jsxs(p.Fragment,{children:[p.jsx(Ev,{title:u?.implementedButUndocumented||"Implemented but undocumented",routes:s.runtimeOnly,empty:u?.noUndocumentedRuntimeRoutes||"No undocumented runtime routes discovered.",theme:e,warning:!0,openLabel:u?.openRuntimeRoute||"Open runtime route"}),p.jsx(Ev,{title:u?.documentedButNotObserved||"Documented but not observed",routes:s.documentedOnly,empty:u?.everyDocumentedRouteObserved||"Every documented route was observed.",theme:e,openLabel:u?.openRuntimeRoute||"Open runtime route",onSelect:c?T=>{c(T.path,T.method),a()}:void 0})]}),s.validation?.status==="pass"&&p.jsxs("div",{className:`flex items-center gap-2 text-sm ${C}`,children:[p.jsx(aa,{className:"h-4 w-4"}),u?.contractValidationPass||"The running backend matches the OpenAPI contract for all validated checks."]}),!s.validation&&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(aa,{className:"h-4 w-4"}),u?.runtimeAligned||"Runtime routes and OpenAPI paths are aligned."]})]})]})]})};function zO({result:t,theme:e,messages:n,onSelect:r}){const a=e==="dark"?"text-gray-400":"text-gray-600",c=n?.contractValidation||"Contract validation";return p.jsxs("section",{children:[p.jsxs("h3",{className:"mb-2 font-semibold",children:[c," ",p.jsxs("span",{className:a,children:["(",t.findings.length,")"]})]}),t.findings.length?p.jsx("div",{className:"space-y-2",children:t.findings.map(u=>{const f=u.code==="runtime.operation-unobserved"||u.code==="runtime.method-mismatch",h=!!(r&&f&&u.location.method),g=p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex gap-2 text-sm",children:[p.jsx("span",{className:"w-14 shrink-0 font-semibold",children:u.severity.toUpperCase()}),p.jsx("code",{className:"break-all",children:u.code})]}),p.jsx("div",{className:`mt-1 text-xs ${a}`,children:u.message}),(u.expected!==void 0||u.observed!==void 0)&&p.jsxs("div",{className:`mt-1 text-xs ${a}`,children:[u.expected!==void 0&&p.jsxs("div",{children:[n?.validationExpected||"Expected",": ",jv(u.expected)]}),u.observed!==void 0&&p.jsxs("div",{children:[n?.validationObserved||"Observed",": ",jv(u.observed)]})]})]});return h?p.jsx("button",{type:"button","aria-label":`${n?.openRuntimeRoute||"Open documented operation"} ${u.location.method} ${u.location.path}`,className:"w-full rounded border p-2 text-left",onClick:()=>r?.(u),children:g},u.id):p.jsx("div",{className:"rounded border p-2",children:g},u.id)})}):p.jsx("p",{className:`text-sm ${a}`,children:n?.contractValidationPass||"No contract mismatches detected."})]})}function jv(t){return Array.isArray(t)?t.join(", "):t}function Ev({title:t,routes:e,empty:n,theme:r,warning:s=!1,onSelect:a,openLabel:c="Open runtime route"}){const u=r==="dark",f=u?"text-gray-400":"text-gray-600",h=s?u?"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 HO(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=HO(t,e,n);return t.requests.filter(s=>s.collectionId!==e?!1:r?!!s.folderId&&r.has(s.folderId):!0)}function IO(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 Ov(t,e,n){const r=t.collections.find(a=>a.id===e)?.name||"Deleted collection";if(!n)return r;const s=IO(t.folders.filter(a=>a.collectionId===e),n);return s?`${r} / ${s}`:`${r} / Deleted folder`}function UO(t){return!t.error&&!t.scriptError&&t.scriptTests.every(e=>e.passed)}async function FO(t){const e=Ic(t.workspace,t.collectionId,t.folderId),n=t.runId||An("run"),r=t.runName||Ov(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=q0(s,t.collectionId),S=Xd(s),A={...t.externalEnvironmentVariables||{},...S},C={...v,...t.externalVariables||{},...A},T=await wv({request:b.request,scripts:b.scripts,credentials:t.credentials,requestInterceptor:t.requestInterceptor,hostExecution:t.hostExecution,resolveAuth:D=>$0(s,b.collectionId,b.folderId,D||{type:"none"}),variables:C,collectionVariables:v,externalVariables:t.externalVariables,environmentVariables:A,signal:t.signal,fetcher:t.fetcher,now:t.now,onCollectionChanges:D=>{s=z0(s,b.collectionId,D),t.onCollectionChanges?.(D)},onEnvironmentChanges:D=>{s=Jd(s,D),t.onEnvironmentChanges?.(D)}}),R=t.signal?.aborted===!0,j=!R&&UO(T);let E;T.result&&!R&&(s=B0(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:R,historyEntryId:E,outcome:T};if(a.push(O),t.onRequestComplete?.(O,g,e.length),R){c=!0;break}if(!O.passed&&t.stopOnFailure&&g<e.length-1){c=!0;break}}const u=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:u,failed:h,cancelled:f,stopped:c,items:a,workspace:s}}function Qr(){return new Date().toISOString()}const VO=({request:t,scripts:e,onLoadRequest:n,onSelectedCollectionChange:r,onSelectedFolderChange:s,onRunCollection:a,onRunFolder:c,selectedCollectionId:u,selectedFolderId:f="",workspace:h,onWorkspaceChange:g,hostExecution:b,theme:v})=>{const[S,A]=U.useState(""),[C,T]=U.useState(""),[R,j]=U.useState(""),[E,O]=U.useState(null),D=h.collections.find(ae=>ae.id===u)||h.collections[0],B=U.useMemo(()=>h.folders.filter(ae=>ae.collectionId===D?.id),[D?.id,h.folders]),M=U.useMemo(()=>h.requests.filter(ae=>ae.collectionId===D?.id),[D?.id,h.requests]),z=B.find(ae=>ae.id===f),P=U.useMemo(()=>new Map(B.map(ae=>[ae.id,ae])),[B]),J=U.useMemo(()=>{const ae=[],le=new Set,ge=(Te,Ie)=>{B.filter(Qe=>Qe.parentFolderId===Te).forEach(Qe=>{le.has(Qe.id)||(le.add(Qe.id),ae.push({folder:Qe,depth:Ie}),ge(Qe.id,Ie+1))})};return ge(void 0,0),B.forEach(Te=>{le.has(Te.id)||(le.add(Te.id),ae.push({folder:Te,depth:0}),ge(Te.id,1))}),ae},[B]),W=ae=>{const le=[],ge=new Set;let Te=P.get(ae);for(;Te&&!ge.has(Te.id);)ge.add(Te.id),le.unshift(Te.name),Te=Te.parentFolderId?P.get(Te.parentFolderId):void 0;return le.join(" / ")};U.useEffect(()=>{r?.(D?.id)},[r,D?.id]);const G=()=>{const ae=S.trim();if(!ae)return;const le=Qr(),ge=An("collection");g(Te=>({...Te,collections:[...Te.collections,{id:ge,name:ae,auth:{type:"none"},variables:[],createdAt:le,updatedAt:le}]})),r?.(ge),s?.(""),A(""),O(null)},Se=ae=>{if(!D)return;const le=Qr();g(ge=>({...ge,collections:ge.collections.map(Te=>Te.id===D.id?{...Te,auth:ae,updatedAt:le}:Te)}))},ye=ae=>{if(!z)return;const le=Qr();g(ge=>({...ge,folders:ge.folders.map(Te=>Te.id===z.id?{...Te,auth:ae,updatedAt:le}:Te)}))},xe=()=>{if(!D)return;const ae=Qr();g(le=>({...le,collections:le.collections.map(ge=>ge.id===D.id?{...ge,variables:[...ge.variables,{id:An("variable"),key:"",value:"",enabled:!0}],updatedAt:ae}:ge)}))},_=(ae,le)=>{if(!D)return;const ge=Qr();g(Te=>({...Te,collections:Te.collections.map(Ie=>Ie.id===D.id?{...Ie,variables:Ie.variables.map(Qe=>Qe.id===ae?{...Qe,...le}:Qe),updatedAt:ge}:Ie)}))},ee=ae=>{if(!D)return;const le=Qr();g(ge=>({...ge,collections:ge.collections.map(Te=>Te.id===D.id?{...Te,variables:Te.variables.filter(Ie=>Ie.id!==ae),updatedAt:le}:Te)}))},de=()=>{const ae=C.trim();if(!ae||!D)return;const le=Qr(),ge=An("folder");g(Te=>({...Te,folders:[...Te.folders,{id:ge,collectionId:D.id,parentFolderId:f||void 0,name:ae,auth:{type:"inherit"},createdAt:le,updatedAt:le}]})),s?.(ge),T("")},$=()=>{if(!D)return;const ae=R.trim()||t.url||"Untitled request",le=Qr();if(E){g(Te=>({...Te,requests:Te.requests.map(Ie=>Ie.id===E?{...Ie,collectionId:D.id,folderId:f||void 0,name:ae,request:ui(t),scripts:un(e),updatedAt:le}:Ie)}));return}const ge={id:An("request"),collectionId:D.id,folderId:f||void 0,name:ae,request:ui(t),scripts:un(e),createdAt:le,updatedAt:le};g(Te=>({...Te,requests:[...Te.requests,ge]})),O(ge.id),j(ae)},ne=ae=>{const le=h.requests.find(ge=>ge.id===ae);le&&(O(le.id),r?.(le.collectionId),s?.(le.folderId||""),j(le.name),n(ui(le.request),le.scripts?un(le.scripts):void 0,le.collectionId,le.folderId))},L=ae=>{g(le=>({...le,requests:le.requests.filter(ge=>ge.id!==ae)})),E===ae&&(O(null),j(""))},V=ae=>{const le=h.folders.find(ge=>ge.id===ae);g(ge=>Fk(ge,ae)),f===ae&&s?.(le?.parentFolderId||"")},ue=ae=>{const le=Vk(h,ae);g(le),u===ae&&(r?.(le.collections[0]?.id||""),s?.(""),O(null),j(""))},ve=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",qe=ae=>p.jsxs("div",{className:`group flex items-center gap-1 rounded-md ${E===ae.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 ${ae.name}`,onClick:()=>ne(ae.id),children:[p.jsx("span",{className:"mr-2 font-mono text-xs font-semibold text-blue-600",children:ae.request.method.toUpperCase()}),p.jsx("span",{className:"truncate",children:ae.name})]}),p.jsx("button",{type:"button",className:"rounded-md p-2 opacity-70 hover:opacity-100","aria-label":`Delete saved request ${ae.name}`,onClick:()=>L(ae.id),children:p.jsx(oi,{className:"h-4 w-4"})})]},ae.id),Je=(ae,le,ge=new Set)=>{if(ge.has(ae.id))return null;const Te=new Set(ge);Te.add(ae.id);const Ie=W(ae.id),Qe=B.filter(gt=>gt.parentFolderId===ae.id);return p.jsxs(cg.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===ae.id?"bg-blue-500/10":""}`,style:{paddingLeft:`${8+le*16}px`},onClick:()=>s?.(ae.id),children:ae.name}),p.jsx("button",{type:"button",disabled:Ic(h,ae.collectionId,ae.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?.(ae.collectionId,ae.id),children:p.jsx(oa,{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:()=>V(ae.id),children:p.jsx(oi,{className:"h-4 w-4"})})]}),Qe.map(gt=>Je(gt,le+1,Te))]},ae.id)},Fe=(ae,le,ge=new Set)=>{if(ge.has(ae.id))return null;const Te=new Set(ge);Te.add(ae.id);const Ie=M.filter(gt=>gt.folderId===ae.id),Qe=B.filter(gt=>gt.parentFolderId===ae.id);return Ie.length===0&&Qe.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+le*12}px`},children:ae.name}),p.jsx("div",{style:{paddingLeft:`${le*12}px`},children:Ie.map(qe)})]}),Qe.map(gt=>Fe(gt,le+1,Te))]},ae.id)},Le=B.filter(ae=>!ae.parentFolderId),dt=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(aA,{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 ${ve}`,value:S,onChange:ae=>A(ae.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(Ns,{className:"h-4 w-4"})})]}),p.jsx("div",{className:"space-y-2",children:h.collections.map(ae=>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 ${ae.id===D?.id?Re:""}`,onClick:()=>{r?.(ae.id),s?.(""),O(null),j("")},children:ae.name}),p.jsx("button",{type:"button",disabled:Ic(h,ae.id).length===0,"aria-label":`Run collection ${ae.name}`,className:"rounded-md p-2 opacity-70 hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-30",onClick:()=>a?.(ae.id),children:p.jsx(oa,{className:"h-4 w-4"})}),h.collections.length>1&&p.jsx("button",{type:"button","aria-label":`Delete collection ${ae.name}`,className:"rounded-md p-2 opacity-70 hover:opacity-100",onClick:()=>ue(ae.id),children:p.jsx(oi,{className:"h-4 w-4"})})]},ae.id))}),D&&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(Y0,{auth:D.auth,label:"Collection",hostExecution:b,onChange:Se,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(Ns,{className:"h-3.5 w-3.5"})," Add"]})]}),p.jsxs("div",{className:"space-y-2",children:[D.variables.map((ae,le)=>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 ${le+1} enabled`,type:"checkbox",checked:ae.enabled!==!1,onChange:ge=>_(ae.id,{enabled:ge.target.checked})}),p.jsx("input",{"aria-label":`Collection variable ${le+1} key`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${ve}`,placeholder:"baseUrl",value:ae.key,onChange:ge=>_(ae.id,{key:ge.target.value})}),p.jsx("input",{"aria-label":`Collection variable ${le+1} value`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${ve}`,placeholder:"https://api.example.com",value:ae.value,onChange:ge=>_(ae.id,{value:ge.target.value})}),p.jsx("button",{type:"button","aria-label":`Remove collection variable ${le+1}`,className:"rounded-md p-1.5 opacity-70 hover:opacity-100",onClick:()=>ee(ae.id),children:p.jsx(oi,{className:"h-3.5 w-3.5"})})]},ae.id)),D.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 ${ve}`,value:C,onChange:ae=>T(ae.target.value),placeholder:"Folder"}),p.jsx("button",{type:"button","aria-label":"Add folder",className:"rounded-md border px-3 py-2",onClick:de,children:p.jsx(sA,{className:"h-4 w-4"})})]}),p.jsx("p",{className:`text-xs ${Ne}`,children:dt?`New folders are created inside ${dt}.`:"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"}),Le.map(ae=>Je(ae,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 — ",dt]}),p.jsx(Y0,{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 ${ve}`,value:R,onChange:ae=>j(ae.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 ${ve}`,value:f,onChange:ae=>s?.(ae.target.value),children:[p.jsx("option",{value:"",children:"Unfiled"}),J.map(({folder:ae,depth:le})=>p.jsx("option",{value:ae.id,children:`${"— ".repeat(le)}${ae.name}`},ae.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(pA,{className:"h-4 w-4"})," ",E?"Update request":"Save request"]})]}),p.jsxs("div",{className:"space-y-3 border-t pt-3",children:[M.filter(ae=>!ae.folderId).map(qe),Le.map(ae=>Fe(ae,0)),M.length===0&&p.jsx("p",{className:`px-2 text-xs ${Ne}`,children:"Save the current request to build a reusable collection."})]})]})]})};function za(){return new Date().toISOString()}const PO=({workspace:t,onWorkspaceChange:e,theme:n})=>{const[r,s]=U.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",u=n==="dark"?"text-gray-400":"text-gray-500",f=()=>{const S=r.trim();if(!S)return;const A=za(),C=An("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=za();e(C=>({...C,environments:C.environments.map(T=>T.id===a.id?{...T,name:S,updatedAt:A}:T)}))},g=()=>{if(!a)return;const S=za();e(A=>({...A,environments:A.environments.map(C=>C.id===a.id?{...C,variables:[...C.variables,{id:An("variable"),key:"",value:"",enabled:!0}],updatedAt:S}:C)}))},b=(S,A)=>{if(!a)return;const C=za();e(T=>({...T,environments:T.environments.map(R=>R.id===a.id?{...R,variables:R.variables.map(j=>j.id===S?{...j,...A}:j),updatedAt:C}:R)}))},v=S=>{if(!a)return;const A=za();e(C=>({...C,environments:C.environments.map(T=>T.id===a.id?{...T,variables:T.variables.filter(R=>R.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=>Uk(S,a.id)),children:p.jsx(oi,{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(Ns,{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(Ns,{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(oi,{className:"h-3.5 w-3.5"})})]},S.id)),a.variables.length===0&&p.jsxs("p",{className:`text-xs ${u}`,children:["Add variables such as ",p.jsx("code",{children:"{{baseUrl}}"})," or ",p.jsx("code",{children:"{{token}}"}),"."]})]})]})]})};function KO(t){const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleString()}const YO=({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(ui(h.request),h.scripts?un(h.scripts):void 0,h.collectionId,h.folderId)},u=f=>{const h=t.history.find(g=>g.id===f);h&&(typeof window<"u"&&!window.confirm(`Delete this history entry?
|
|
72
77
|
|
|
73
|
-
`).trim(),o=a.tests.filter(Boolean).join(`
|
|
78
|
+
${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:KO(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:()=>u(f.id),children:p.jsx(oi,{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 GO(t){return!!t.error||!!t.scriptError||t.status!==void 0&&t.status>=400||!!t.scriptTests?.some(e=>!e.passed)}function XO(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)),u=e.method==="all"||r.executedMethod.toUpperCase()===e.method,f=GO(r),h=e.outcome==="all"||e.outcome==="success"&&!f||e.outcome==="failed"&&f||e.outcome==="tests"&&!!r.scriptTests?.length;return c&&u&&h})}function JO(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,u)=>(c.runIndex||Number.MAX_SAFE_INTEGER)-(u.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 Mv(t){const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleString()}function Bh(t){return!!t.error||!!t.scriptError||t.status!==void 0&&t.status>=400||!!t.scriptTests?.some(e=>!e.passed)}function $h(t){return t.error?"Request failed":t.status!==void 0?`${t.status}${t.statusText?` ${t.statusText}`:""}`:"Sent"}function QO(t){return(t||[]).filter(e=>e.enabled!==!1&&(e.key.trim()||e.value.trim()))}function Rv({title:t,values:e,mutedClass:n}){const r=QO(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 Dv(t){const e=[`${t.passed} runner passed`,`${t.failed} runner failed`];return t.cancelled&&e.push(`${t.cancelled} cancelled`),e.join(" · ")}const WO=({workspace:t,onWorkspaceChange:e,onLoadRequest:n,onBack:r,theme:s,initialEntryId:a,initialRunId:c})=>{const[u,f]=U.useState(""),[h,g]=U.useState("all"),[b,v]=U.useState("all"),[S,A]=U.useState(c?void 0:a||t.history[0]?.id),[C,T]=U.useState(c),R=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",D=U.useMemo(()=>XO(t,{query:u,method:h,outcome:b}),[h,b,u,t]),B=U.useMemo(()=>JO(D),[D]),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:D.find($=>$.id===S)||D[0],P=z?.collectionId?t.collections.find($=>$.id===z.collectionId):void 0,J=z?.folderId?t.folders.find($=>$.id===z.folderId):void 0,W=()=>{A(void 0),T(void 0)},G=$=>{A($),T(void 0)},Se=$=>{T($),A(void 0)},ye=$=>{n(ui($.request),$.scripts?un($.scripts):void 0,$.collectionId,$.folderId),r()},xe=$=>{window.confirm("Delete this history entry? This cannot be undone.")&&(e(ne=>({...ne,history:ne.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||[],de=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(Oo,{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(oi,{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(yg,{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 ${R}`,value:u,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 ${R}`,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 ${R}`,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 V=$.entry,ue=z?.id===V.id,ve=Bh(V),Ne=V.collectionId?t.collections.find(Re=>Re.id===V.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(V.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:V.executedMethod.toUpperCase()}),p.jsxs("span",{className:ve?"text-red-600":E,children:[$h(V),V.responseTime!==void 0?` · ${V.responseTime} ms`:""]})]}),p.jsx("div",{className:"mt-1 truncate font-mono text-xs",title:V.resolvedUrl,children:V.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:Mv(V.createdAt)})]})]},V.id)}const ne=$.group,L=M?.runId===ne.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 ${ne.runName}`,className:"w-full px-3 py-3 text-left",onClick:()=>Se(ne.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:ne.runName}),p.jsxs("div",{className:`mt-1 text-[11px] ${E}`,children:[ne.captured,"/",ne.total," history entries · ",Dv(ne)]})]}),p.jsx("div",{className:"border-t px-2 py-1",children:ne.entries.map(V=>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===V.id?"bg-blue-500/10":""}`,onClick:()=>G(V.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:V.runIndex||"–"}),p.jsx("span",{className:"font-mono font-semibold text-blue-600",children:V.executedMethod.toUpperCase()})]}),p.jsx("span",{className:Bh(V)?"text-red-600":E,children:$h(V)})]}),p.jsx("div",{className:"mt-1 truncate font-mono",title:V.resolvedUrl,children:V.resolvedUrl})]},V.id))})]},ne.runId)}),D.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 · ",Dv(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:Bh(z)?"text-red-600":E,children:$h(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:[Mv(z.createdAt),z.collectionId?` · ${P?.name||"Deleted collection"}`:"",z.folderId?` / ${J?.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(hA,{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(oi,{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(Rv,{title:"Query parameters",values:z.request.query,mutedClass:E}),p.jsx(Rv,{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(([$,ne],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:ne})]},`${$}:${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:[de,"/",z.scriptTests.length," tests passed"]}),z.scriptTests.map(($,ne)=>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}:${ne}`))]}):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(`
|
|
79
|
+
`)}):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 mn(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 Qn(t,e,n,r){t.push({code:e,path:n,message:r})}function Wr(t){return Array.isArray(t)?t.filter(mn):[]}function et(t,e,n){const r=Wr(t[e]).find(s=>s.key===n);return r?st(r.value):""}function ZO(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 qh(t,e,n,r){if(!mn(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"?Qn(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"&&Qn(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"),u=ZO(et(t,"oauth2","grant_type")),f=et(t,"oauth2","client_authentication").toLowerCase();return{type:"oauth2",accessToken:et(t,"oauth2","accessToken"),...u?{grantType:u}:{},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=>Qn(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")}):(Qn(r,"postman-auth-unsupported",n,`Postman auth type "${t.type}" is not supported by FlexDoc and was left to inherited/default auth.`),{...e})}function _v(t,e,n){return Wr(t).flatMap((r,s)=>{const a=st(r.key).trim();return a?[{id:An("variable"),key:a,value:st(r.value),enabled:r.disabled!==!0&&r.enabled!==!1}]:(Qn(n,"postman-variable-empty-key",`${e}[${s}]`,"Skipped a Postman variable with an empty key."),[])})}function e3(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&&(Qn(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.
|
|
80
|
+
${s}`),s}function t3(t,e,n){return mn(t)?(t.src!==void 0&&Qn(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(`
|
|
81
|
+
`):st(t.exec)):""}function Lv(t,e,n){const r={preRequest:[],tests:[]};return Wr(t).forEach((s,a)=>{const c=st(s.listen).toLowerCase();if(c!=="prerequest"&&c!=="test")return;const u=`${e}[${a}]`,f=t3(s.script,`${u}.script`,n).trim();if(!f)return;const h=e3(f,`${u}.script`,n);c==="prerequest"?r.preRequest.push(h):r.tests.push(h)}),r}function n3(t,e){return{preRequest:[...t.preRequest,...e.preRequest],tests:[...t.tests,...e.tests]}}function i3(t){const e=t.preRequest.filter(Boolean).join(`
|
|
74
82
|
|
|
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})({});
|
|
83
|
+
`).trim(),n=t.tests.filter(Boolean).join(`
|
|
84
|
+
|
|
85
|
+
`).trim();return e||n?{preRequest:e,tests:n}:void 0}function Bv(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return t}}function $v(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:Bv(c>=0?a.slice(0,c):a),value:Bv(c>=0?a.slice(c+1):""),enabled:!0}}):[];return{url:e.slice(0,n),query:s}}function r3(t){return Wr(t).map(e=>({key:st(e.key),value:st(e.value),enabled:e.disabled!==!0}))}function s3(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qv(t,e){let n=t;for(const r of Wr(e)){const s=st(r.key).trim();s&&(n=n.replace(new RegExp(`:${s3(s)}(?=/|$)`,"g"),`{{${s}}}`))}return n}function l3(t){if(typeof t=="string")return $v(t);if(!mn(t))return{url:"",query:[]};const e=r3(t.query),n=st(t.raw);if(n){const h=$v(n);return{url:qv(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(/^\//,""),u=s?`${r?`${r}://`:""}${s}${a?`:${a}`:""}`:"",f=u?`${u}${c?`/${c}`:""}`:c;return{url:qv(f,t.variable),query:e}}function a3(t){return Wr(t).map(e=>({key:st(e.key),value:st(e.value),enabled:e.disabled!==!0}))}function o3(t){return t.find(e=>e.enabled!==!1&&e.key.toLowerCase()==="content-type")?.value}function c3(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 u3(t,e,n,r){const s=o3(e);if(!mn(t)||!t.mode)return{body:"",contentType:s||"application/json",bodyMode:"none"};const a=st(t.mode);if(a==="raw"){const c=mn(t.options)&&mn(t.options.raw)?t.options.raw:void 0,u=c?st(c.language):"";return{body:st(t.raw),contentType:s||c3(u)||"text/plain",bodyMode:u.toLowerCase()==="json"?"json":"raw"}}if(a==="urlencoded")return{body:"",bodyMode:"urlencoded",urlencoded:Wr(t.urlencoded).map(u=>({key:st(u.key),value:st(u.value),enabled:u.disabled!==!0})),contentType:s||"application/x-www-form-urlencoded"};if(a==="graphql"){const c=mn(t.graphql)?t.graphql:{},u=st(c.variables);return{body:"",bodyMode:"graphql",graphql:{query:st(c.query),variables:u},contentType:s||"application/json"}}if(a==="formdata"){const c=Wr(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&&Qn(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=mn(t.file)?st(t.file.src):st(t.src);return Qn(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 Qn(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 d3(t,e,n,r,s,a,c,u){const f=typeof t=="string"?{method:"GET",url:t}:t;if(!mn(f))return Qn(u,"postman-request-invalid",c,"Skipped an invalid Postman request entry."),null;const h=st(f.method).trim().toUpperCase()||"GET",g=l3(f.url),b=a3(f.header),v=u3(f.body,b,`${c}.body`,u),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:qh(f.auth,{type:"inherit"},`${c}.auth`,u)},A=i3(s);return{id:An("request"),collectionId:n,folderId:r,name:e.trim()||`${h} ${g.url||"request"}`,request:S,...A?{scripts:A}:{},createdAt:a,updatedAt:a}}function zv(t){Array.isArray(t.items)&&t.items.forEach((e,n)=>{const r=`${t.path}[${n}]`;if(!mn(e)){Qn(t.warnings,"postman-item-invalid",r,"Skipped an invalid Postman item.");return}const s=st(e.name)||"Untitled",a=Lv(e.event,`${r}.event`,t.warnings),c=n3(t.inheritedScripts,a);if(Array.isArray(e.item)){const f=An("folder");t.folders.push({id:f,collectionId:t.collectionId,parentFolderId:t.parentFolderId,name:s,auth:qh(e.auth,{type:"inherit"},`${r}.auth`,t.warnings),createdAt:t.timestamp,updatedAt:t.timestamp}),zv({...t,items:e.item,parentFolderId:f,inheritedScripts:c,path:`${r}.item`});return}const u=d3(e.request,s,t.collectionId,t.parentFolderId,c,t.timestamp,`${r}.request`,t.warnings);u&&t.requests.push(u)})}function f3(t){if(!mn(t)||!mn(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/")&&Qn(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=An("collection"),c={id:a,name:e,auth:qh(t.auth,{type:"none"},"auth",n),variables:_v(t.variable,"variable",n),createdAt:s,updatedAt:s},u=[],f=[];return zv({items:t.item,collectionId:a,inheritedScripts:Lv(t.event,"event",n),timestamp:s,path:"item",folders:u,requests:f,warnings:n}),{collection:c,folders:u,requests:f,warnings:n}}function h3(t){if(!mn(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:An("environment"),name:t.name.trim()||"Imported environment",variables:_v(t.values,"values",n),createdAt:r,updatedAt:r},warnings:n}}function p3(t){if(mn(t)&&mn(t.info)&&Array.isArray(t.item))return{kind:"collection",result:f3(t)};if(mn(t)&&Array.isArray(t.values)&&typeof t.name=="string")return{kind:"environment",result:h3(t)};throw new Error("Unsupported Postman JSON. Import a collection v2.1 JSON file or an exported environment JSON file.")}function m3(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 g3(t,e){const n=m3(t)?[]:t.collections;return{...t,collections:[...n,e.collection],folders:[...t.folders,...e.folders],requests:[...t.requests,...e.requests]}}function y3(t,e){return{...t,environments:[...t.environments,e.environment],activeEnvironmentId:t.activeEnvironmentId||e.environment.id}}function Hv(t,e){return`${t} ${t===1?e:`${e}s`}`}const b3=({onWorkspaceChange:t,onSelectedCollectionChange:e,theme:n})=>{const r=U.useRef(null),[s,a]=U.useState(null),[c,u]=U.useState([]),f=async A=>{if(A.length===0)return;const C=[],T=[],R=[];for(const B of A)try{const M=JSON.parse(await B.text()),z=p3(M);C.push(z),T.push(...z.result.warnings.map(P=>({...P,path:`${B.name}:${P.path}`})))}catch(M){R.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"?g3(M,z.result):y3(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),u(T);const D=[j.length>0?Hv(j.length,"collection"):"",E>0?Hv(E,"environment"):""].filter(Boolean);C.length===0?a({tone:"error",text:R.join(" ")||"No Postman documents were imported."}):R.length>0||T.length>0?a({tone:"warning",text:`Imported ${D.join(" and ")}. ${R.length>0?`${R.length} file${R.length===1?"":"s"} failed to import.`:`${T.length} compatibility warning${T.length===1?"":"s"} need review.`}`}):a({tone:"success",text:`Imported ${D.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(wg,{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(wg,{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(aa,{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 x3(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 v3(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 w3=({workspace:t,onWorkspaceChange:e,collectionId:n,folderId:r,theme:s,credentials:a,requestInterceptor:c,hostExecution:u,externalVariables:f,externalEnvironmentVariables:h,onCollectionChanges:g,onEnvironmentChanges:b,onOpenHistory:v,onBack:S,fetcher:A})=>{const C=U.useMemo(()=>Ic(t,n,r),[n,r,t]),T=U.useMemo(()=>Ov(t,n,r),[n,r,t]),R=t.environments.find(ee=>ee.id===t.activeEnvironmentId),[j,E]=U.useState(!1),[O,D]=U.useState(!1),[B,M]=U.useState(),[z,P]=U.useState({}),J=U.useRef(void 0),W=U.useRef(!0);U.useEffect(()=>(W.current=!0,()=>{W.current=!1,J.current?.abort()}),[]);const G=async()=>{if(O||C.length===0)return;const ee=new AbortController;J.current=ee,D(!0),M(void 0),P(Object.fromEntries(C.map($=>[$.id,{status:"pending"}])));const de=await FO({workspace:t,collectionId:n,folderId:r,runName:T,credentials:a,requestInterceptor:c,hostExecution:u,externalVariables:f,externalEnvironmentVariables:h,stopOnFailure:j,signal:ee.signal,fetcher:A,onCollectionChanges:g,onEnvironmentChanges:b,onRequestStart:$=>{W.current&&P(ne=>({...ne,[$.id]:{status:"running"}}))},onRequestComplete:$=>{W.current&&P(ne=>({...ne,[$.requestId]:{status:$.cancelled?"cancelled":$.passed?"passed":"failed",item:$}}))}});W.current&&(e(de.workspace),P($=>Object.fromEntries(C.map(ne=>{const L=$[ne.id]||{status:"pending"};return[ne.id,L.status==="pending"&&de.stopped?{status:"skipped"}:L]}))),M(de),D(!1),J.current=void 0)},Se=()=>J.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(Oo,{className:"h-4 w-4"})," Client"]}),p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(oa,{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: ",R?.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(lA,{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:Se,children:[p.jsx(xg,{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(oa,{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,de)=>{const $=z[ee.id]||{status:"pending"},ne=$.item?.outcome.result,L=$.item?.outcome.scriptTests||[],V=L.filter(ve=>ve.passed).length,ue=ne?.status!==void 0&&ne.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:de+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:x3(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(cA,{className:"h-4 w-4 animate-spin"}),$.status==="passed"&&p.jsx(aa,{className:"h-4 w-4 text-green-600"}),$.status==="failed"&&p.jsx(iA,{className:"h-4 w-4 text-red-600"}),p.jsx("span",{children:v3($)}),ne?.status!==void 0&&p.jsxs("span",{className:ue?"text-amber-600":xe,children:["HTTP ",ne.status]}),ne?.responseTime!==void 0&&p.jsxs("span",{className:xe,children:[p.jsx(dd,{className:"mr-1 inline h-3.5 w-3.5"}),ne.responseTime," ms"]})]})]}),L.length>0&&p.jsxs("div",{className:`mt-2 text-xs ${L.some(ve=>!ve.passed)?"text-red-600":xe}`,children:[V,"/",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 Iv(t){return`flexdoc:api-client-ui:${encodeURIComponent(t)}`}function Uv(t,e){const n=e??(typeof window<"u"?window.localStorage:void 0);if(!n)return{version:1};try{const r=n.getItem(Iv(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"]),u=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"||!u.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 Ha(t,e,n){const r=typeof window<"u"?window.localStorage:void 0;if(r)try{const s=Uv(t,r);r.setItem(Iv(t),JSON.stringify({...s,...e,version:1}))}catch{}}function S3(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 Fv(t,e){return da(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 zh(t){return t.tests.trim()&&!t.preRequest.trim()?"tests":"pre-request"}function Vv(t,e){return JSON.stringify({request:t,scripts:un(e)},(n,r)=>typeof File<"u"&&r instanceof File?{name:r.name,size:r.size,type:r.type,lastModified:r.lastModified}:r)}function A3(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 Pv=({initialRequest:t,initialScripts:e,initialRequestTab:n,initialScriptTab:r,theme:s="light",persistenceKey:a="default",pageMode:c=!1,manageTheme:u=!0,handoff:f,activeEnvironmentId:h,onActiveEnvironmentIdChange:g,onChromeStateChange:b,onRequestChange:v,onDraftChange:S,onScriptsChange:A,onRequestTabChange:C,onScriptTabChange:T,onExecutionStart:R,onExecutionComplete:j,variables:E={},environmentVariables:O={},onCollectionChanges:D,onEnvironmentChanges:B,...M})=>{const z=S3(t),P=un(e),J=rl(),W=a===!1?{}:Uv(a),[G,Se]=U.useState(z),[ye,xe]=U.useState(z),[_,ee]=U.useState(P),[de,$]=U.useState(P),[ne,L]=U.useState(M.initialServerUrl),[V,ue]=U.useState(0),[ve,Ne]=U.useState(n||W.requestTab||"params"),[Re,qe]=U.useState(r||W.scriptTab||zh(P)),[Je,Fe]=U.useState("request"),[Le,dt]=U.useState({}),[ae,le]=U.useState(),[ge,Te]=U.useState(J),[Ie,Qe]=U.useState(J.collections[0]?.id),[gt,Bt]=U.useState(""),sn=U.useRef(J.collections[0]?.id),ln=U.useRef(void 0),[Hn,gn]=U.useState(a===!1),[ot,Wn]=U.useState(W.sidebarCollapsed??!1),[Rn,Zn]=U.useState(W.theme||s),Tt=u?Rn:s;U.useEffect(()=>{if(a===!1)return;let Me=!1;return I0(a).then(We=>{Me||(Te(We),Qe(We.collections[0]?.id),Bt(""),gn(!0))}).catch(()=>{Me||gn(!0)}),()=>{Me=!0}},[a]),U.useEffect(()=>{!Hn||a===!1||U0(a,ge).catch(()=>{})},[Hn,a,ge]);const x=U.useMemo(()=>q0(ge,Ie),[Ie,ge]),K=U.useMemo(()=>Xd(ge),[ge]),me=U.useMemo(()=>({...O,...K}),[O,K]),fe=U.useMemo(()=>({...x,...E,...me}),[x,me,E]);U.useEffect(()=>{if(h===void 0)return;const Me=h||void 0;let We=!1;return queueMicrotask(()=>{We||Te(Yt=>Yt.activeEnvironmentId===Me?Yt:{...Yt,activeEnvironmentId:Me})}),()=>{We=!0}},[h]);const Q=U.useMemo(()=>Vv(ye,de),[ye,de]),k=U.useMemo(()=>A3(ye,de)&&!ge.requests.some(Me=>Vv(Me.request,Me.scripts)===Q),[Q,ye,de,ge.requests]);U.useEffect(()=>{b?.({environments:ge.environments.map(({id:Me,name:We})=>({id:Me,name:We})),activeEnvironmentId:ge.activeEnvironmentId,hasUnsavedRequest:k})},[k,b,ge.activeEnvironmentId,ge.environments]);const X=U.useCallback(Me=>$0(ge,Ie,gt||void 0,Me||{type:"none"}),[Ie,gt,ge]),Z=U.useCallback(Me=>{Qe(Me),Bt("")},[]),Ae=Me=>{v?.(Me)},H=Me=>{xe(ui(Me)),S?.(ui(Me))},he=Me=>{const We=un(Me);$(We),A?.(We)},oe=Me=>{Ne(Me),a!==!1&&Ha(a,{requestTab:Me}),C?.(Me)},ke=Me=>{qe(Me),a!==!1&&Ha(a,{scriptTab:Me}),T?.(Me)},Ee=Me=>{const We=sn.current||Ie;Te(Yt=>z0(Yt,We,Me)),D?.(Me)},De=Me=>{Te(We=>Jd(We,Me)),B?.(Me)},Be=()=>{sn.current=Ie,ln.current=gt||void 0,R?.()},ze=Me=>{Te(We=>B0(We,{...Me,collectionId:sn.current,folderId:ln.current})),j?.(Me)},Ye=(Me,We,Yt,yi)=>{Fe("request");const Bi=Yt&&ge.collections.some(xi=>xi.id===Yt)?Yt:void 0;Bi&&Qe(Bi);const es=Bi||Ie,ei=yi&&ge.folders.some(xi=>xi.id===yi&&xi.collectionId===es)?yi:"";Bt(ei);const _t=ui(Me),Ut=un(We),bi=Fv(_t,Ut),fr=zh(Ut);Ne(bi),qe(fr),a!==!1&&Ha(a,{requestTab:bi,scriptTab:fr}),Se(_t),xe(_t),ee(Ut),$(Ut),L(void 0),ue(xi=>xi+1)};U.useEffect(()=>{if(!f)return;const Me=ui(f.request),We=un(f.scripts),Yt=f.requestTab||Fv(Me,We),yi=f.scriptTab||zh(We);let Bi=!1;return queueMicrotask(()=>{Bi||(Fe("request"),Se(Me),xe(Me),ee(We),$(We),L(f.serverUrl),Ne(Yt),qe(yi),ue(es=>es+1))}),()=>{Bi=!0}},[f]);const Dn=(Me,We)=>{Qe(Me),Bt(We||""),le({collectionId:Me,folderId:We}),Fe("runner")},_n=(Me,We)=>{dt({entryId:Me,runId:We}),Fe("history")},Kt=()=>Wn(Me=>{const We=!Me;return a!==!1&&Ha(a,{sidebarCollapsed:We}),We}),Li=Tt==="dark"?"border-gray-700 bg-gray-900/40 text-gray-100":"border-gray-200 bg-white text-gray-900",dr=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"} ${ot?"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"} ${Li}`,"data-api-client-workspace-sidebar":!0,"data-collapsed":ot?"true":"false",children:[p.jsx("div",{className:`mb-3 flex ${ot?"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":ot?"Expand API Client sidebar":"Collapse API Client sidebar","aria-expanded":!ot,onClick:Kt,children:ot?p.jsx(pd,{className:"h-4 w-4"}):p.jsx(hd,{className:"h-4 w-4"})})}),!ot&&p.jsxs("div",{className:"space-y-5",children:[p.jsx(b3,{onWorkspaceChange:Te,onSelectedCollectionChange:Z,theme:Tt}),p.jsx("div",{className:"border-t pt-4",children:p.jsx(PO,{workspace:ge,onWorkspaceChange:Te,theme:Tt})}),p.jsx("div",{className:"border-t pt-4",children:p.jsx(VO,{request:ye,scripts:de,onLoadRequest:Ye,onSelectedCollectionChange:Z,onSelectedFolderChange:Bt,onRunCollection:Me=>Dn(Me),onRunFolder:(Me,We)=>Dn(Me,We),selectedCollectionId:Ie,selectedFolderId:gt,workspace:ge,onWorkspaceChange:Te,hostExecution:M.hostExecution,theme:Tt})}),p.jsx("div",{className:"border-t pt-4",children:p.jsx(YO,{workspace:ge,onWorkspaceChange:Te,onLoadRequest:Ye,onViewAll:()=>_n(),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 ${Li}`,"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 ${dr}`,value:ge.activeEnvironmentId||"",onChange:Me=>{const We=Me.target.value||void 0;Te(Yt=>({...Yt,activeEnvironmentId:We})),g?.(We)},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:[u&&p.jsxs("button",{type:"button",className:`rounded-md border px-2 py-1 text-xs ${dr}`,"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";Zn(Me),a!==!1&&Ha(a,{theme:Me})},children:[M.messages?.viewerTheme||"Theme",": ",Tt==="dark"?M.messages?.darkTheme||"Dark":M.messages?.lightTheme||"Light"]}),Je==="request"&&k&&p.jsx("span",{"aria-label":"Unsaved request changes",children:M.messages?.unsavedChanges||"Unsaved changes"})]})]}),Je==="history"?p.jsx(WO,{workspace:ge,onWorkspaceChange:Te,onLoadRequest:Ye,onBack:()=>Fe("request"),initialEntryId:Le.entryId,initialRunId:Le.runId,theme:Tt},`${Le.runId||""}:${Le.entryId||""}`):Je==="runner"&&ae?p.jsx(w3,{workspace:ge,onWorkspaceChange:Te,collectionId:ae.collectionId,folderId:ae.folderId,theme:Tt,credentials:M.credentials,requestInterceptor:M.requestInterceptor,hostExecution:M.hostExecution,externalVariables:E,externalEnvironmentVariables:O,onCollectionChanges:D,onEnvironmentChanges:B,onOpenHistory:_n,onBack:()=>Fe("request")}):p.jsx(Cv,{...M,initialRequest:G,initialScripts:_,initialRequestTab:ve,initialScriptTab:Re,initialServerUrl:ne,theme:Tt,resolveAuth:X,variables:fe,collectionVariables:x,externalVariables:E,environmentVariables:me,onCollectionChanges:Ee,onEnvironmentChanges:De,onDraftChange:H,onScriptsChange:he,onRequestTabChange:oe,onScriptTabChange:ke,onExecutionStart:Be,onExecutionComplete:ze,onRequestChange:Ae},V)]})]})};function Uc(t){if(t!==void 0)return typeof t=="number"?`${t}px`:t}function k3(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 Kv(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 Bn.getHttpMethods(a)){if(Rh(s,c)===n)return{path:s,method:c};uO(s,c)===n&&r.push({path:s,method:c})}return r.length===1?r[0]:null}function Yv(){return typeof window>"u"?"docs":new URLSearchParams(window.location.search).get("view")==="api-client"?"api-client":"docs"}function Hh(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 Gv(t,e){if(typeof document>"u"||typeof URL>"u")return"Downloads are unavailable in this environment.";try{const n=e==="yaml"?NA(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 C3({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 N3=({spec:t,theme:e="light",manageTheme:n=!0,customStyles:r={},options:s={}})=>{const a=DA(t.info.title,typeof window>"u"?void 0:window.location.host),c=Dr(a),u=s.tryIt?.apiClientPersistenceKey??L0(t.info.title,typeof window>"u"?void 0:window.location.host),f=Yv(),[h,g]=U.useState(()=>typeof window>"u"?null:Kv(t,window.location.hash)),[b,v]=U.useState(f),[S,A]=U.useState(f==="api-client"),[C,T]=U.useState(),R=U.useRef(0),[j,E]=U.useState({environments:[],hasUnsavedRequest:!1}),[O,D]=U.useState(void 0),[B,M]=U.useState(!1),[z,P]=U.useState(!1),[J,W]=U.useState(!1),[G,Se]=U.useState(),[ye,xe]=U.useState(),[_,ee]=U.useState(()=>({key:a,preferences:c})),de=U.useRef(null),$=U.useRef(null),ne=U.useRef(null),L=s.runtimeIntelligence?.available===!0,V=s.runtimeIntelligence?.endpoint,ue=L&&V&&ye?.endpoint===V?ye:void 0,ve=ue?.snapshot,Ne=ue?.error,Re=!!(L&&V&&!ue),qe=U.useCallback(()=>W(!1),[]),Je=_.key===a?_.preferences:Dr(a),Fe=n&&Je.theme||e,Le=Fe==="high-contrast"?"dark":Fe,dt=Je.expand,ae=Je.expandedTags??["default"],le=Je.sidebarCollapsed??!1,ge=typeof s.theme=="object"?s.theme:void 0,Te=U.useMemo(()=>({...k3(Le,ge),...r}),[Le,ge,r]);U.useEffect(()=>{if(!L||!V)return;const H=new AbortController;return fetch(V,{credentials:"same-origin",signal:H.signal}).then(async he=>{if(!he.ok)throw new Error(`Runtime intelligence unavailable: HTTP ${he.status}`);return jO(await he.json())}).then(he=>xe({endpoint:V,snapshot:he})).catch(he=>{H.signal.aborted||xe({endpoint:V,error:he instanceof Error?he.message:String(he)})}),()=>H.abort()},[L,V]),U.useEffect(()=>{if(!s.customCss)return;const H=document.createElement("style");return H.dataset.flexdocCustomCss="true",H.textContent=s.customCss,document.head.appendChild(H),()=>H.remove()},[s.customCss]),U.useEffect(()=>{if(typeof window>"u")return;const H=()=>g(Kv(t,window.location.hash)),he=()=>{const oe=Yv();v(oe),oe==="api-client"&&A(!0)};return H(),he(),window.addEventListener("hashchange",H),window.addEventListener("popstate",he),()=>{window.removeEventListener("hashchange",H),window.removeEventListener("popstate",he)}},[t]),U.useEffect(()=>{if(!B||typeof document>"u")return;const H=document.body.style.overflow,he=$.current;document.body.style.overflow="hidden";const oe=de.current,ke=()=>Array.from(oe?.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(()=>ke()[0]?.focus());const Ee=De=>{if(De.key==="Escape"){De.preventDefault(),M(!1);return}if(De.key!=="Tab")return;const Be=ke();if(!Be.length)return;const ze=Be[0],Ye=Be[Be.length-1];De.shiftKey&&document.activeElement===ze?(De.preventDefault(),Ye.focus()):!De.shiftKey&&document.activeElement===Ye&&(De.preventDefault(),ze.focus())};return document.addEventListener("keydown",Ee),()=>{document.body.style.overflow=H,document.removeEventListener("keydown",Ee),he?.focus()}},[B]);const Ie=()=>{ee({key:a,preferences:Dr(a)})},Qe=H=>{ee(he=>{const oe=he.key===a?he.preferences:Dr(a);return{key:a,preferences:{...oe,...H,version:1}}})},gt=()=>requestAnimationFrame(()=>ne.current?.scrollTo({top:0,behavior:"auto"})),Bt=(H,he)=>{g({path:H,method:he}),v("docs"),M(!1),Hh("docs"),typeof window<"u"&&(window.location.hash=Rh(H,he)),gt()},sn=()=>{if(g(null),v("docs"),M(!1),typeof window<"u"){const H=new URL(window.location.href);H.searchParams.delete("view"),H.hash="",window.history.replaceState(null,"",`${H.pathname}${H.search}`)}gt()},ln=H=>{H&&(R.current+=1,T({id:R.current,request:H.request,scripts:H.scripts,requestTab:H.requestTab,scriptTab:H.scriptTab,serverUrl:H.serverUrl})),A(!0),v("api-client"),Hh("api-client")},Hn=()=>{v("docs"),Hh("docs"),gt()},gn=()=>{const H=!le;LA(a,H),Qe({sidebarCollapsed:H})},ot=Id(s.expand,s.expand===void 0?s.expandResponses:void 0),Wn=dt===void 0?ot:Id(dt),Rn=H=>{_A(a,H),Ie()},Zn=H=>{n&&(BA(a,H),Ie())},Tt=H=>{$A(a,H),Qe({expandedTags:H})},x=U.useCallback(()=>{if(typeof document>"u")return;(b==="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()},[b]),K=vO(Le,"border-gray-200 bg-white text-gray-600","border-gray-700 bg-gray-800 text-gray-300"),me=Le==="dark"?"bg-gray-900 text-gray-100":"bg-gray-50 text-gray-900",fe=Le==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900",Q=s.messages,k=(H=!1)=>p.jsx("button",{type:"button","data-flexdoc-floating-control":H?"settings":void 0,className:H?`fixed bottom-4 right-4 z-40 inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-lg ${fe}`:"inline-flex h-11 w-11 items-center justify-center rounded-md border","aria-label":Q?.openSettings||"Open settings","aria-expanded":z,onClick:()=>P(!0),children:p.jsx(mA,{className:"h-5 w-5"})}),X=(H=!1)=>L?p.jsxs("button",{type:"button","data-flexdoc-floating-control":H?"runtime":void 0,className:H?`fixed bottom-4 right-[4.25rem] z-40 inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-lg ${fe}`:"inline-flex h-11 min-w-11 items-center justify-center gap-2 rounded-md border px-2 text-sm sm:px-3",onClick:()=>W(!0),"aria-label":Q?.openRuntime||"Open runtime intelligence","aria-expanded":J,children:[p.jsx(fg,{className:"h-4 w-4"}),!H&&p.jsx("span",{className:"hidden sm:inline",children:ve?`Runtime ${ve.summary.matched}/${ve.summary.documented}`:Re?"Runtime…":"Runtime"})]}):null,Z=(H=!1)=>p.jsx("button",{ref:$,type:"button","data-flexdoc-floating-control":H?"navigation":void 0,"data-flexdoc-mobile-nav-trigger":H?"floating":"topbar",className:H?`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 ${fe}`:"inline-flex h-11 w-11 items-center justify-center rounded-md lg:hidden","aria-label":Q?.apiNavigation||"Open API navigation","aria-expanded":B,onClick:()=>M(!0),children:p.jsx(fA,{className:"h-5 w-5"})}),Ae=p.jsx(TA,{spec:t,onEndpointSelect:Bt,theme:Le,selectedEndpoint:h||void 0,expandedTags:ae,onExpandedTagsChange:Tt,messages:Q});return p.jsxs("div",{lang:s.locale,className:`flexdoc-root flex h-full min-h-0 flex-col ${me}`,style:Te,"data-theme":Fe,"data-flexdoc-view":b,children:[!s.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 ${Le==="dark"?"border-gray-700 bg-gray-900":"border-gray-200 bg-white"}`,children:b==="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:Hn,children:[p.jsx(Oo,{className:"h-4 w-4"}),Q?.backToOperation||"Back to operation"]}),p.jsx("div",{className:"min-w-0 flex-1 truncate font-semibold",children:Q?.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:Q?.environment||"Environment"}),p.jsxs("select",{"aria-label":Q?.environment||"API Client environment",style:{maxWidth:"10rem"},className:`rounded-md border px-2 py-1.5 text-xs ${Le==="dark"?"border-gray-700 bg-gray-900":"border-gray-300 bg-white"}`,value:O??j.activeEnvironmentId??"",onChange:H=>D(H.target.value||null),children:[p.jsx("option",{value:"",children:Q?.noEnvironment||"No environment"}),j.environments.map(H=>p.jsx("option",{value:H.id,children:H.name},H.id))]})]}),j.hasUnsavedRequest&&p.jsx("span",{className:"shrink-0 text-xs font-medium","aria-label":Q?.unsavedChanges||"Unsaved request changes",children:Q?.unsavedChanges||"Unsaved changes"}),k()]}):p.jsxs(p.Fragment,{children:[Z(),p.jsx("button",{type:"button",className:"hidden h-11 w-11 items-center justify-center rounded-md border lg:inline-flex","aria-label":le?"Expand API navigation sidebar":"Collapse API navigation sidebar","aria-expanded":!le,onClick:gn,children:le?p.jsx(pd,{className:"h-5 w-5"}):p.jsx(hd,{className:"h-5 w-5"})}),s.logo&&p.jsx(C3,{logo:s.logo,onHome:sn}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{className:"truncate font-semibold",children:t.info.title}),!s.hideHostname&&t.servers?.[0]?.url&&p.jsx("div",{className:"truncate text-xs opacity-60",children:t.servers[0].url})]}),X(),h&&p.jsx("button",{type:"button",className:"hidden shrink-0 rounded-md border px-3 py-2 text-sm md:inline-flex","aria-label":Q?.printOperation||"Print operation",onClick:()=>{typeof window<"u"&&window.print()},children:Q?.printOperation||"Print operation"}),!s.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:()=>Se(Gv(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:()=>Se(Gv(t,"yaml")),children:"YAML"})]}),k()]})}),s.hideTopbar&&b==="docs"&&Z(!0),s.hideTopbar&&b==="docs"&&X(!0),s.hideTopbar&&k(!0),s.hideTopbar&&b==="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 ${fe}`,"aria-label":le?"Expand API navigation sidebar":"Collapse API navigation sidebar","aria-expanded":!le,onClick:gn,children:le?p.jsx(pd,{className:"h-5 w-5"}):p.jsx(hd,{className:"h-5 w-5"})}),s.hideTopbar&&b==="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 ${fe}`,onClick:Hn,children:[p.jsx(Oo,{className:"h-4 w-4"}),Q?.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 ${fe}`,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:Q?.environment||"Environment"}),p.jsxs("select",{"aria-label":Q?.environment||"API Client environment",style:{maxWidth:"8rem"},className:`rounded-md border px-2 py-1 text-xs ${Le==="dark"?"border-gray-700 bg-gray-900":"border-gray-300 bg-white"}`,value:O??j.activeEnvironmentId??"",onChange:H=>D(H.target.value||null),children:[p.jsx("option",{value:"",children:Q?.noEnvironment||"No environment"}),j.environments.map(H=>p.jsx("option",{value:H.id,children:H.name},H.id))]})]}),j.hasUnsavedRequest&&p.jsx("span",{className:"truncate text-xs font-medium","aria-label":Q?.unsavedChanges||"Unsaved request changes",children:Q?.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:`${b==="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 ${le?"w-14":"w-80"}`,"data-docs-sidebar":!0,"data-collapsed":le?"true":"false",style:{background:"var(--flexdoc-sidebar-bg)",color:"var(--flexdoc-sidebar-text)"},children:!le&&Ae}),p.jsxs("main",{ref:ne,"data-flexdoc-main-scroll":!0,className:"min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain",children:[h?p.jsx(pO,{spec:t,path:h.path,method:h.method,theme:Le,options:s,defaultExpandedSections:Wn,runtimeSnapshot:ve,onOpenInApiClient:ln}):p.jsx(bO,{spec:t,onEndpointSelect:Bt,theme:Le}),p.jsx(xO,{footerClasses:K,footer:s.footer})]})]}),S&&p.jsx("div",{"data-api-client-page":"api-client",className:`${b==="api-client"?"block":"hidden"} min-h-0 min-w-0 flex-1 overflow-hidden`,children:p.jsx(Pv,{pageMode:!0,manageTheme:!1,theme:Le,messages:Q,persistenceKey:u,handoff:C,activeEnvironmentId:O,onActiveEnvironmentIdChange:H=>D(H??null),onChromeStateChange:H=>{E(H),D(he=>he===void 0?H.activeEnvironmentId??null:he)},credentials:s.tryIt?.credentials||"same-origin",requestInterceptor:s.tryIt?.requestInterceptor,hostExecution:s.tryIt?.hostExecution,serverOptions:t.servers||[]})})]}),B&&p.jsxs("div",{ref:de,className:"fixed inset-0 z-[70] lg:hidden",role:"dialog","aria-modal":"true","aria-label":Q?.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:()=>M(!1)}),p.jsxs("aside",{className:`absolute inset-y-0 left-0 flex w-[min(88vw,22rem)] flex-col shadow-2xl ${Le==="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:Q?.apiNavigation||"API navigation"}),p.jsx("button",{type:"button",className:"inline-flex h-11 w-11 items-center justify-center rounded-md","aria-label":Q?.closeApiNavigation||"Close API navigation",onClick:()=>M(!1),children:p.jsx(gd,{className:"h-5 w-5"})})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:Ae})]})]}),G&&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 ${Le==="dark"?"border-red-800 bg-red-950 text-red-100":"border-red-300 bg-white text-red-700"}`,onClick:()=>Se(void 0),children:Q?.downloadFailed||G}),p.jsx(qO,{open:J&&L,theme:Le,loading:Re,error:Ne,snapshot:ve,onClose:qe,onEndpointSelect:Bt,messages:Q}),p.jsx(RO,{spec:t,theme:Le,messages:Q,onEndpointSelect:Bt,onHome:sn,onOpenSettings:()=>P(!0),onOpenApiClient:()=>ln(),onOpenRuntime:L?()=>W(!0):void 0,onSendCurrent:x}),p.jsx(BO,{open:z,theme:Le,hostTheme:e,manageTheme:n,viewerTheme:Je.theme,viewerExpand:dt,effectiveExpandedSections:Wn,messages:Q,onThemeChange:Zn,onExpandChange:Rn,onClose:()=>P(!1)})]})},Ih="x-flexdoc-external-documents";function T3(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 Hi.parseSpec(n).catch(()=>{try{return JSON.parse(n)}catch{throw new Error(`Reference document is not valid JSON/YAML: ${t}`)}})})}function j3(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 Xv(t,e){const n=Hi.encodePointerToken(t);if(e==="#"||e==="")return`#/${Ih}/${n}`;if(!e.startsWith("#/"))throw new Error(`Unsupported JSON Pointer reference: ${e}`);return`#/${Ih}/${n}/${e.slice(2)}`}function Jv(t){return JSON.parse(JSON.stringify(t))}async function E3(t,e){const n=e.load||T3,r=new URL(e.baseUri).toString().replace(/#.*$/,""),s=Jv(t),a={},c=new Map;async function u(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=>Jv(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=j3(S.$ref,b);if(A.documentUri!==b){const C=await u(A.documentUri);S.$ref=A.documentUri===r?A.pointer:Xv(A.documentUri,A.pointer),await h(C,A.documentUri)}else b!==r&&(S.$ref=Xv(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[Ih]=a),s}async function O3(t,e){return E3(t,e)}const Fc="1",Zr=new WeakMap;function M3(t){return JSON.parse(JSON.stringify(t))}function Uh(t,e={}){const n=M3(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 u of c.tags)r.set(u,c.name);const s={},a=new Set(["get","post","put","delete","patch","options","head","trace"]);for(const[c,u]of Object.entries(n.paths)){const f={};let h=!1;for(const[g,b]of Object.entries(u)){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 R3(t){return typeof t.theme=="string"?t.theme:typeof document<"u"&&document.documentElement.classList.contains("dark")?"dark":"light"}function Qv(t,e,n){const r=Uh(e,n),s=Zr.get(t);s&&s.unmount();const a=og.createRoot(t);return Zr.set(t,a),a.render(p.jsx(N3,{spec:r,theme:R3(n),options:n})),()=>{Zr.get(t)===a&&Zr.delete(t),a.unmount()}}function Wv(t,e){const n={contractVersion:Fc,...e.options||{}};return Qv(t,e.spec,n)}function Zv(t,e={}){const n=Zr.get(t);n&&n.unmount();const r=og.createRoot(t);return Zr.set(t,r),r.render(p.jsx(Pv,{...e})),()=>{Zr.get(t)===r&&Zr.delete(t),r.unmount()}}async function e1(t,e){const n={contractVersion:Fc,...e.options||{}},r=e.baseUri?await O3(e.spec,{baseUri:e.baseUri,load:e.documentLoader}):e.spec;return Qv(t,r,n)}return typeof window<"u"&&(window.FlexDocStandalone={mount:Wv,mountAsync:e1,mountApiClient:Zv,prepareSpec:Uh,contractVersion:Fc}),Cs.FLEXDOC_CONTRACT_VERSION=Fc,Cs.mountApiClient=Zv,Cs.mountFlexDoc=Wv,Cs.mountFlexDocAsync=e1,Cs.prepareSpec=Uh,Object.defineProperty(Cs,Symbol.toStringTag,{value:"Module"}),Cs})({});
|
|
76
86
|
//# sourceMappingURL=flexdoc.standalone.js.map
|