UNPKG

dynamodb-dashboard

Version:
76 lines 895 kB
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=t(i);fetch(i.href,r)}})();function dk(n,e){return function(){return n.apply(e,arguments)}}const{toString:iV}=Object.prototype,{getPrototypeOf:dv}=Object,{iterator:Bp,toStringTag:pk}=Symbol,Fp=(n=>e=>{const t=iV.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),wi=n=>(n=n.toLowerCase(),e=>Fp(e)===n),Vp=n=>e=>typeof e===n,{isArray:ec}=Array,Da=Vp("undefined");function Ju(n){return n!==null&&!Da(n)&&n.constructor!==null&&!Da(n.constructor)&&ds(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const mk=wi("ArrayBuffer");function rV(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&mk(n.buffer),e}const oV=Vp("string"),ds=Vp("function"),gk=Vp("number"),Zu=n=>n!==null&&typeof n=="object",lV=n=>n===!0||n===!1,sd=n=>{if(Fp(n)!=="object")return!1;const e=dv(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(pk in n)&&!(Bp in n)},aV=n=>{if(!Zu(n)||Ju(n))return!1;try{return Object.keys(n).length===0&&Object.getPrototypeOf(n)===Object.prototype}catch{return!1}},cV=wi("Date"),uV=wi("File"),fV=wi("Blob"),hV=wi("FileList"),dV=n=>Zu(n)&&ds(n.pipe),pV=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||ds(n.append)&&((e=Fp(n))==="formdata"||e==="object"&&ds(n.toString)&&n.toString()==="[object FormData]"))},mV=wi("URLSearchParams"),[gV,bV,yV,vV]=["ReadableStream","Request","Response","Headers"].map(wi),wV=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ef(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let s,i;if(typeof n!="object"&&(n=[n]),ec(n))for(s=0,i=n.length;s<i;s++)e.call(null,n[s],s,n);else{if(Ju(n))return;const r=t?Object.getOwnPropertyNames(n):Object.keys(n),o=r.length;let l;for(s=0;s<o;s++)l=r[s],e.call(null,n[l],l,n)}}function bk(n,e){if(Ju(n))return null;e=e.toLowerCase();const t=Object.keys(n);let s=t.length,i;for(;s-- >0;)if(i=t[s],e===i.toLowerCase())return i;return null}const el=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,yk=n=>!Da(n)&&n!==el;function b0(){const{caseless:n,skipUndefined:e}=yk(this)&&this||{},t={},s=(i,r)=>{const o=n&&bk(t,r)||r;sd(t[o])&&sd(i)?t[o]=b0(t[o],i):sd(i)?t[o]=b0({},i):ec(i)?t[o]=i.slice():(!e||!Da(i))&&(t[o]=i)};for(let i=0,r=arguments.length;i<r;i++)arguments[i]&&ef(arguments[i],s);return t}const SV=(n,e,t,{allOwnKeys:s}={})=>(ef(e,(i,r)=>{t&&ds(i)?n[r]=dk(i,t):n[r]=i},{allOwnKeys:s}),n),xV=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),_V=(n,e,t,s)=>{n.prototype=Object.create(e.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},EV=(n,e,t,s)=>{let i,r,o;const l={};if(e=e||{},n==null)return e;do{for(i=Object.getOwnPropertyNames(n),r=i.length;r-- >0;)o=i[r],(!s||s(o,n,e))&&!l[o]&&(e[o]=n[o],l[o]=!0);n=t!==!1&&dv(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},CV=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const s=n.indexOf(e,t);return s!==-1&&s===t},AV=n=>{if(!n)return null;if(ec(n))return n;let e=n.length;if(!gk(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},kV=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&dv(Uint8Array)),TV=(n,e)=>{const s=(n&&n[Bp]).call(n);let i;for(;(i=s.next())&&!i.done;){const r=i.value;e.call(n,r[0],r[1])}},OV=(n,e)=>{let t;const s=[];for(;(t=n.exec(e))!==null;)s.push(t);return s},RV=wi("HTMLFormElement"),MV=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,s,i){return s.toUpperCase()+i}),Px=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),DV=wi("RegExp"),vk=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),s={};ef(t,(i,r)=>{let o;(o=e(i,r,n))!==!1&&(s[r]=o||i)}),Object.defineProperties(n,s)},LV=n=>{vk(n,(e,t)=>{if(ds(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const s=n[t];if(ds(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},NV=(n,e)=>{const t={},s=i=>{i.forEach(r=>{t[r]=!0})};return ec(n)?s(n):s(String(n).split(e)),t},IV=()=>{},PV=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e;function $V(n){return!!(n&&ds(n.append)&&n[pk]==="FormData"&&n[Bp])}const BV=n=>{const e=new Array(10),t=(s,i)=>{if(Zu(s)){if(e.indexOf(s)>=0)return;if(Ju(s))return s;if(!("toJSON"in s)){e[i]=s;const r=ec(s)?[]:{};return ef(s,(o,l)=>{const c=t(o,i+1);!Da(c)&&(r[l]=c)}),e[i]=void 0,r}}return s};return t(n,0)},FV=wi("AsyncFunction"),VV=n=>n&&(Zu(n)||ds(n))&&ds(n.then)&&ds(n.catch),wk=((n,e)=>n?setImmediate:e?((t,s)=>(el.addEventListener("message",({source:i,data:r})=>{i===el&&r===t&&s.length&&s.shift()()},!1),i=>{s.push(i),el.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",ds(el.postMessage)),WV=typeof queueMicrotask<"u"?queueMicrotask.bind(el):typeof process<"u"&&process.nextTick||wk,HV=n=>n!=null&&ds(n[Bp]),U={isArray:ec,isArrayBuffer:mk,isBuffer:Ju,isFormData:pV,isArrayBufferView:rV,isString:oV,isNumber:gk,isBoolean:lV,isObject:Zu,isPlainObject:sd,isEmptyObject:aV,isReadableStream:gV,isRequest:bV,isResponse:yV,isHeaders:vV,isUndefined:Da,isDate:cV,isFile:uV,isBlob:fV,isRegExp:DV,isFunction:ds,isStream:dV,isURLSearchParams:mV,isTypedArray:kV,isFileList:hV,forEach:ef,merge:b0,extend:SV,trim:wV,stripBOM:xV,inherits:_V,toFlatObject:EV,kindOf:Fp,kindOfTest:wi,endsWith:CV,toArray:AV,forEachEntry:TV,matchAll:OV,isHTMLForm:RV,hasOwnProperty:Px,hasOwnProp:Px,reduceDescriptors:vk,freezeMethods:LV,toObjectSet:NV,toCamelCase:MV,noop:IV,toFiniteNumber:PV,findKey:bk,global:el,isContextDefined:yk,isSpecCompliantForm:$V,toJSONObject:BV,isAsyncFn:FV,isThenable:VV,setImmediate:wk,asap:WV,isIterable:HV};function et(n,e,t,s,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),s&&(this.request=s),i&&(this.response=i,this.status=i.status?i.status:null)}U.inherits(et,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:U.toJSONObject(this.config),code:this.code,status:this.status}}});const Sk=et.prototype,xk={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{xk[n]={value:n}});Object.defineProperties(et,xk);Object.defineProperty(Sk,"isAxiosError",{value:!0});et.from=(n,e,t,s,i,r)=>{const o=Object.create(Sk);U.toFlatObject(n,o,function(h){return h!==Error.prototype},f=>f!=="isAxiosError");const l=n&&n.message?n.message:"Error",c=e==null&&n?n.code:e;return et.call(o,l,c,t,s,i),n&&o.cause==null&&Object.defineProperty(o,"cause",{value:n,configurable:!0}),o.name=n&&n.name||"Error",r&&Object.assign(o,r),o};const UV=null;function y0(n){return U.isPlainObject(n)||U.isArray(n)}function _k(n){return U.endsWith(n,"[]")?n.slice(0,-2):n}function $x(n,e,t){return n?n.concat(e).map(function(i,r){return i=_k(i),!t&&r?"["+i+"]":i}).join(t?".":""):e}function zV(n){return U.isArray(n)&&!n.some(y0)}const qV=U.toFlatObject(U,{},null,function(e){return/^is[A-Z]/.test(e)});function Wp(n,e,t){if(!U.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=U.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,x){return!U.isUndefined(x[w])});const s=t.metaTokens,i=t.visitor||h,r=t.dots,o=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&U.isSpecCompliantForm(e);if(!U.isFunction(i))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(U.isDate(y))return y.toISOString();if(U.isBoolean(y))return y.toString();if(!c&&U.isBlob(y))throw new et("Blob is not supported. Use a Buffer instead.");return U.isArrayBuffer(y)||U.isTypedArray(y)?c&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function h(y,w,x){let S=y;if(y&&!x&&typeof y=="object"){if(U.endsWith(w,"{}"))w=s?w:w.slice(0,-2),y=JSON.stringify(y);else if(U.isArray(y)&&zV(y)||(U.isFileList(y)||U.endsWith(w,"[]"))&&(S=U.toArray(y)))return w=_k(w),S.forEach(function(E,k){!(U.isUndefined(E)||E===null)&&e.append(o===!0?$x([w],k,r):o===null?w:w+"[]",f(E))}),!1}return y0(y)?!0:(e.append($x(x,w,r),f(y)),!1)}const d=[],g=Object.assign(qV,{defaultVisitor:h,convertValue:f,isVisitable:y0});function m(y,w){if(!U.isUndefined(y)){if(d.indexOf(y)!==-1)throw Error("Circular reference detected in "+w.join("."));d.push(y),U.forEach(y,function(S,C){(!(U.isUndefined(S)||S===null)&&i.call(e,S,U.isString(C)?C.trim():C,w,g))===!0&&m(S,w?w.concat(C):[C])}),d.pop()}}if(!U.isObject(n))throw new TypeError("data must be an object");return m(n),e}function Bx(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function pv(n,e){this._pairs=[],n&&Wp(n,this,e)}const Ek=pv.prototype;Ek.append=function(e,t){this._pairs.push([e,t])};Ek.toString=function(e){const t=e?function(s){return e.call(this,s,Bx)}:Bx;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};function KV(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ck(n,e,t){if(!e)return n;const s=t&&t.encode||KV;U.isFunction(t)&&(t={serialize:t});const i=t&&t.serialize;let r;if(i?r=i(e,t):r=U.isURLSearchParams(e)?e.toString():new pv(e,t).toString(s),r){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+r}return n}class Fx{constructor(){this.handlers=[]}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){U.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Ak={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},jV=typeof URLSearchParams<"u"?URLSearchParams:pv,GV=typeof FormData<"u"?FormData:null,YV=typeof Blob<"u"?Blob:null,XV={isBrowser:!0,classes:{URLSearchParams:jV,FormData:GV,Blob:YV},protocols:["http","https","file","blob","url","data"]},mv=typeof window<"u"&&typeof document<"u",v0=typeof navigator=="object"&&navigator||void 0,QV=mv&&(!v0||["ReactNative","NativeScript","NS"].indexOf(v0.product)<0),JV=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ZV=mv&&window.location.href||"http://localhost",e5=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:mv,hasStandardBrowserEnv:QV,hasStandardBrowserWebWorkerEnv:JV,navigator:v0,origin:ZV},Symbol.toStringTag,{value:"Module"})),Dn={...e5,...XV};function t5(n,e){return Wp(n,new Dn.classes.URLSearchParams,{visitor:function(t,s,i,r){return Dn.isNode&&U.isBuffer(t)?(this.append(s,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...e})}function n5(n){return U.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function s5(n){const e={},t=Object.keys(n);let s;const i=t.length;let r;for(s=0;s<i;s++)r=t[s],e[r]=n[r];return e}function kk(n){function e(t,s,i,r){let o=t[r++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),c=r>=t.length;return o=!o&&U.isArray(i)?i.length:o,c?(U.hasOwnProp(i,o)?i[o]=[i[o],s]:i[o]=s,!l):((!i[o]||!U.isObject(i[o]))&&(i[o]=[]),e(t,s,i[o],r)&&U.isArray(i[o])&&(i[o]=s5(i[o])),!l)}if(U.isFormData(n)&&U.isFunction(n.entries)){const t={};return U.forEachEntry(n,(s,i)=>{e(n5(s),i,t,0)}),t}return null}function i5(n,e,t){if(U.isString(n))try{return(e||JSON.parse)(n),U.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(t||JSON.stringify)(n)}const tf={transitional:Ak,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const s=t.getContentType()||"",i=s.indexOf("application/json")>-1,r=U.isObject(e);if(r&&U.isHTMLForm(e)&&(e=new FormData(e)),U.isFormData(e))return i?JSON.stringify(kk(e)):e;if(U.isArrayBuffer(e)||U.isBuffer(e)||U.isStream(e)||U.isFile(e)||U.isBlob(e)||U.isReadableStream(e))return e;if(U.isArrayBufferView(e))return e.buffer;if(U.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return t5(e,this.formSerializer).toString();if((l=U.isFileList(e))||s.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Wp(l?{"files[]":e}:e,c&&new c,this.formSerializer)}}return r||i?(t.setContentType("application/json",!1),i5(e)):e}],transformResponse:[function(e){const t=this.transitional||tf.transitional,s=t&&t.forcedJSONParsing,i=this.responseType==="json";if(U.isResponse(e)||U.isReadableStream(e))return e;if(e&&U.isString(e)&&(s&&!this.responseType||i)){const o=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(l){if(o)throw l.name==="SyntaxError"?et.from(l,et.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Dn.classes.FormData,Blob:Dn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};U.forEach(["delete","get","head","post","put","patch"],n=>{tf.headers[n]={}});const r5=U.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),o5=n=>{const e={};let t,s,i;return n&&n.split(`
`).forEach(function(o){i=o.indexOf(":"),t=o.substring(0,i).trim().toLowerCase(),s=o.substring(i+1).trim(),!(!t||e[t]&&r5[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s)}),e},Vx=Symbol("internals");function Cc(n){return n&&String(n).trim().toLowerCase()}function id(n){return n===!1||n==null?n:U.isArray(n)?n.map(id):String(n)}function l5(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=t.exec(n);)e[s[1]]=s[2];return e}const a5=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function zg(n,e,t,s,i){if(U.isFunction(s))return s.call(this,e,t);if(i&&(e=t),!!U.isString(e)){if(U.isString(s))return e.indexOf(s)!==-1;if(U.isRegExp(s))return s.test(e)}}function c5(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,s)=>t.toUpperCase()+s)}function u5(n,e){const t=U.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(n,s+t,{value:function(i,r,o){return this[s].call(this,e,i,r,o)},configurable:!0})})}let ps=class{constructor(e){e&&this.set(e)}set(e,t,s){const i=this;function r(l,c,f){const h=Cc(c);if(!h)throw new Error("header name must be a non-empty string");const d=U.findKey(i,h);(!d||i[d]===void 0||f===!0||f===void 0&&i[d]!==!1)&&(i[d||c]=id(l))}const o=(l,c)=>U.forEach(l,(f,h)=>r(f,h,c));if(U.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(U.isString(e)&&(e=e.trim())&&!a5(e))o(o5(e),t);else if(U.isObject(e)&&U.isIterable(e)){let l={},c,f;for(const h of e){if(!U.isArray(h))throw TypeError("Object iterator must return a key-value pair");l[f=h[0]]=(c=l[f])?U.isArray(c)?[...c,h[1]]:[c,h[1]]:h[1]}o(l,t)}else e!=null&&r(t,e,s);return this}get(e,t){if(e=Cc(e),e){const s=U.findKey(this,e);if(s){const i=this[s];if(!t)return i;if(t===!0)return l5(i);if(U.isFunction(t))return t.call(this,i,s);if(U.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Cc(e),e){const s=U.findKey(this,e);return!!(s&&this[s]!==void 0&&(!t||zg(this,this[s],s,t)))}return!1}delete(e,t){const s=this;let i=!1;function r(o){if(o=Cc(o),o){const l=U.findKey(s,o);l&&(!t||zg(s,s[l],l,t))&&(delete s[l],i=!0)}}return U.isArray(e)?e.forEach(r):r(e),i}clear(e){const t=Object.keys(this);let s=t.length,i=!1;for(;s--;){const r=t[s];(!e||zg(this,this[r],r,e,!0))&&(delete this[r],i=!0)}return i}normalize(e){const t=this,s={};return U.forEach(this,(i,r)=>{const o=U.findKey(s,r);if(o){t[o]=id(i),delete t[r];return}const l=e?c5(r):String(r).trim();l!==r&&delete t[r],t[l]=id(i),s[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return U.forEach(this,(s,i)=>{s!=null&&s!==!1&&(t[i]=e&&U.isArray(s)?s.join(", "):s)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const s=new this(e);return t.forEach(i=>s.set(i)),s}static accessor(e){const s=(this[Vx]=this[Vx]={accessors:{}}).accessors,i=this.prototype;function r(o){const l=Cc(o);s[l]||(u5(i,o),s[l]=!0)}return U.isArray(e)?e.forEach(r):r(e),this}};ps.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);U.reduceDescriptors(ps.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(s){this[t]=s}}});U.freezeMethods(ps);function qg(n,e){const t=this||tf,s=e||t,i=ps.from(s.headers);let r=s.data;return U.forEach(n,function(l){r=l.call(t,r,i.normalize(),e?e.status:void 0)}),i.normalize(),r}function Tk(n){return!!(n&&n.__CANCEL__)}function tc(n,e,t){et.call(this,n??"canceled",et.ERR_CANCELED,e,t),this.name="CanceledError"}U.inherits(tc,et,{__CANCEL__:!0});function Ok(n,e,t){const s=t.config.validateStatus;!t.status||!s||s(t.status)?n(t):e(new et("Request failed with status code "+t.status,[et.ERR_BAD_REQUEST,et.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function f5(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function h5(n,e){n=n||10;const t=new Array(n),s=new Array(n);let i=0,r=0,o;return e=e!==void 0?e:1e3,function(c){const f=Date.now(),h=s[r];o||(o=f),t[i]=c,s[i]=f;let d=r,g=0;for(;d!==i;)g+=t[d++],d=d%n;if(i=(i+1)%n,i===r&&(r=(r+1)%n),f-o<e)return;const m=h&&f-h;return m?Math.round(g*1e3/m):void 0}}function d5(n,e){let t=0,s=1e3/e,i,r;const o=(f,h=Date.now())=>{t=h,i=null,r&&(clearTimeout(r),r=null),n(...f)};return[(...f)=>{const h=Date.now(),d=h-t;d>=s?o(f,h):(i=f,r||(r=setTimeout(()=>{r=null,o(i)},s-d)))},()=>i&&o(i)]}const Dd=(n,e,t=3)=>{let s=0;const i=h5(50,250);return d5(r=>{const o=r.loaded,l=r.lengthComputable?r.total:void 0,c=o-s,f=i(c),h=o<=l;s=o;const d={loaded:o,total:l,progress:l?o/l:void 0,bytes:c,rate:f||void 0,estimated:f&&l&&h?(l-o)/f:void 0,event:r,lengthComputable:l!=null,[e?"download":"upload"]:!0};n(d)},t)},Wx=(n,e)=>{const t=n!=null;return[s=>e[0]({lengthComputable:t,total:n,loaded:s}),e[1]]},Hx=n=>(...e)=>U.asap(()=>n(...e)),p5=Dn.hasStandardBrowserEnv?((n,e)=>t=>(t=new URL(t,Dn.origin),n.protocol===t.protocol&&n.host===t.host&&(e||n.port===t.port)))(new URL(Dn.origin),Dn.navigator&&/(msie|trident)/i.test(Dn.navigator.userAgent)):()=>!0,m5=Dn.hasStandardBrowserEnv?{write(n,e,t,s,i,r,o){if(typeof document>"u")return;const l=[`${n}=${encodeURIComponent(e)}`];U.isNumber(t)&&l.push(`expires=${new Date(t).toUTCString()}`),U.isString(s)&&l.push(`path=${s}`),U.isString(i)&&l.push(`domain=${i}`),r===!0&&l.push("secure"),U.isString(o)&&l.push(`SameSite=${o}`),document.cookie=l.join("; ")},read(n){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+n+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(n){this.write(n,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function g5(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function b5(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function Rk(n,e,t){let s=!g5(e);return n&&(s||t==!1)?b5(n,e):e}const Ux=n=>n instanceof ps?{...n}:n;function ml(n,e){e=e||{};const t={};function s(f,h,d,g){return U.isPlainObject(f)&&U.isPlainObject(h)?U.merge.call({caseless:g},f,h):U.isPlainObject(h)?U.merge({},h):U.isArray(h)?h.slice():h}function i(f,h,d,g){if(U.isUndefined(h)){if(!U.isUndefined(f))return s(void 0,f,d,g)}else return s(f,h,d,g)}function r(f,h){if(!U.isUndefined(h))return s(void 0,h)}function o(f,h){if(U.isUndefined(h)){if(!U.isUndefined(f))return s(void 0,f)}else return s(void 0,h)}function l(f,h,d){if(d in e)return s(f,h);if(d in n)return s(void 0,f)}const c={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(f,h,d)=>i(Ux(f),Ux(h),d,!0)};return U.forEach(Object.keys({...n,...e}),function(h){const d=c[h]||i,g=d(n[h],e[h],h);U.isUndefined(g)&&d!==l||(t[h]=g)}),t}const Mk=n=>{const e=ml({},n);let{data:t,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:r,headers:o,auth:l}=e;if(e.headers=o=ps.from(o),e.url=Ck(Rk(e.baseURL,e.url,e.allowAbsoluteUrls),n.params,n.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),U.isFormData(t)){if(Dn.hasStandardBrowserEnv||Dn.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(U.isFunction(t.getHeaders)){const c=t.getHeaders(),f=["content-type","content-length"];Object.entries(c).forEach(([h,d])=>{f.includes(h.toLowerCase())&&o.set(h,d)})}}if(Dn.hasStandardBrowserEnv&&(s&&U.isFunction(s)&&(s=s(e)),s||s!==!1&&p5(e.url))){const c=i&&r&&m5.read(r);c&&o.set(i,c)}return e},y5=typeof XMLHttpRequest<"u",v5=y5&&function(n){return new Promise(function(t,s){const i=Mk(n);let r=i.data;const o=ps.from(i.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:f}=i,h,d,g,m,y;function w(){m&&m(),y&&y(),i.cancelToken&&i.cancelToken.unsubscribe(h),i.signal&&i.signal.removeEventListener("abort",h)}let x=new XMLHttpRequest;x.open(i.method.toUpperCase(),i.url,!0),x.timeout=i.timeout;function S(){if(!x)return;const E=ps.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),R={data:!l||l==="text"||l==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:E,config:n,request:x};Ok(function(L){t(L),w()},function(L){s(L),w()},R),x=null}"onloadend"in x?x.onloadend=S:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(S)},x.onabort=function(){x&&(s(new et("Request aborted",et.ECONNABORTED,n,x)),x=null)},x.onerror=function(k){const R=k&&k.message?k.message:"Network Error",T=new et(R,et.ERR_NETWORK,n,x);T.event=k||null,s(T),x=null},x.ontimeout=function(){let k=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const R=i.transitional||Ak;i.timeoutErrorMessage&&(k=i.timeoutErrorMessage),s(new et(k,R.clarifyTimeoutError?et.ETIMEDOUT:et.ECONNABORTED,n,x)),x=null},r===void 0&&o.setContentType(null),"setRequestHeader"in x&&U.forEach(o.toJSON(),function(k,R){x.setRequestHeader(R,k)}),U.isUndefined(i.withCredentials)||(x.withCredentials=!!i.withCredentials),l&&l!=="json"&&(x.responseType=i.responseType),f&&([g,y]=Dd(f,!0),x.addEventListener("progress",g)),c&&x.upload&&([d,m]=Dd(c),x.upload.addEventListener("progress",d),x.upload.addEventListener("loadend",m)),(i.cancelToken||i.signal)&&(h=E=>{x&&(s(!E||E.type?new tc(null,n,x):E),x.abort(),x=null)},i.cancelToken&&i.cancelToken.subscribe(h),i.signal&&(i.signal.aborted?h():i.signal.addEventListener("abort",h)));const C=f5(i.url);if(C&&Dn.protocols.indexOf(C)===-1){s(new et("Unsupported protocol "+C+":",et.ERR_BAD_REQUEST,n));return}x.send(r||null)})},w5=(n,e)=>{const{length:t}=n=n?n.filter(Boolean):[];if(e||t){let s=new AbortController,i;const r=function(f){if(!i){i=!0,l();const h=f instanceof Error?f:this.reason;s.abort(h instanceof et?h:new tc(h instanceof Error?h.message:h))}};let o=e&&setTimeout(()=>{o=null,r(new et(`timeout ${e} of ms exceeded`,et.ETIMEDOUT))},e);const l=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach(f=>{f.unsubscribe?f.unsubscribe(r):f.removeEventListener("abort",r)}),n=null)};n.forEach(f=>f.addEventListener("abort",r));const{signal:c}=s;return c.unsubscribe=()=>U.asap(l),c}},S5=function*(n,e){let t=n.byteLength;if(t<e){yield n;return}let s=0,i;for(;s<t;)i=s+e,yield n.slice(s,i),s=i},x5=async function*(n,e){for await(const t of _5(n))yield*S5(t,e)},_5=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const e=n.getReader();try{for(;;){const{done:t,value:s}=await e.read();if(t)break;yield s}}finally{await e.cancel()}},zx=(n,e,t,s)=>{const i=x5(n,e);let r=0,o,l=c=>{o||(o=!0,s&&s(c))};return new ReadableStream({async pull(c){try{const{done:f,value:h}=await i.next();if(f){l(),c.close();return}let d=h.byteLength;if(t){let g=r+=d;t(g)}c.enqueue(new Uint8Array(h))}catch(f){throw l(f),f}},cancel(c){return l(c),i.return()}},{highWaterMark:2})},qx=64*1024,{isFunction:fh}=U,E5=(({Request:n,Response:e})=>({Request:n,Response:e}))(U.global),{ReadableStream:Kx,TextEncoder:jx}=U.global,Gx=(n,...e)=>{try{return!!n(...e)}catch{return!1}},C5=n=>{n=U.merge.call({skipUndefined:!0},E5,n);const{fetch:e,Request:t,Response:s}=n,i=e?fh(e):typeof fetch=="function",r=fh(t),o=fh(s);if(!i)return!1;const l=i&&fh(Kx),c=i&&(typeof jx=="function"?(y=>w=>y.encode(w))(new jx):async y=>new Uint8Array(await new t(y).arrayBuffer())),f=r&&l&&Gx(()=>{let y=!1;const w=new t(Dn.origin,{body:new Kx,method:"POST",get duplex(){return y=!0,"half"}}).headers.has("Content-Type");return y&&!w}),h=o&&l&&Gx(()=>U.isReadableStream(new s("").body)),d={stream:h&&(y=>y.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!d[y]&&(d[y]=(w,x)=>{let S=w&&w[y];if(S)return S.call(w);throw new et(`Response type '${y}' is not supported`,et.ERR_NOT_SUPPORT,x)})});const g=async y=>{if(y==null)return 0;if(U.isBlob(y))return y.size;if(U.isSpecCompliantForm(y))return(await new t(Dn.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(U.isArrayBufferView(y)||U.isArrayBuffer(y))return y.byteLength;if(U.isURLSearchParams(y)&&(y=y+""),U.isString(y))return(await c(y)).byteLength},m=async(y,w)=>{const x=U.toFiniteNumber(y.getContentLength());return x??g(w)};return async y=>{let{url:w,method:x,data:S,signal:C,cancelToken:E,timeout:k,onDownloadProgress:R,onUploadProgress:T,responseType:L,headers:N,withCredentials:F="same-origin",fetchOptions:ee}=Mk(y),ce=e||fetch;L=L?(L+"").toLowerCase():"text";let ne=w5([C,E&&E.toAbortSignal()],k),pe=null;const Y=ne&&ne.unsubscribe&&(()=>{ne.unsubscribe()});let q;try{if(T&&f&&x!=="get"&&x!=="head"&&(q=await m(N,S))!==0){let X=new t(w,{method:"POST",body:S,duplex:"half"}),fe;if(U.isFormData(S)&&(fe=X.headers.get("content-type"))&&N.setContentType(fe),X.body){const[we,ae]=Wx(q,Dd(Hx(T)));S=zx(X.body,qx,we,ae)}}U.isString(F)||(F=F?"include":"omit");const J=r&&"credentials"in t.prototype,Se={...ee,signal:ne,method:x.toUpperCase(),headers:N.normalize().toJSON(),body:S,duplex:"half",credentials:J?F:void 0};pe=r&&new t(w,Se);let H=await(r?ce(pe,ee):ce(w,Se));const ge=h&&(L==="stream"||L==="response");if(h&&(R||ge&&Y)){const X={};["status","statusText","headers"].forEach(be=>{X[be]=H[be]});const fe=U.toFiniteNumber(H.headers.get("content-length")),[we,ae]=R&&Wx(fe,Dd(Hx(R),!0))||[];H=new s(zx(H.body,qx,we,()=>{ae&&ae(),Y&&Y()}),X)}L=L||"text";let Z=await d[U.findKey(d,L)||"text"](H,y);return!ge&&Y&&Y(),await new Promise((X,fe)=>{Ok(X,fe,{data:Z,headers:ps.from(H.headers),status:H.status,statusText:H.statusText,config:y,request:pe})})}catch(J){throw Y&&Y(),J&&J.name==="TypeError"&&/Load failed|fetch/i.test(J.message)?Object.assign(new et("Network Error",et.ERR_NETWORK,y,pe),{cause:J.cause||J}):et.from(J,J&&J.code,y,pe)}}},A5=new Map,Dk=n=>{let e=n&&n.env||{};const{fetch:t,Request:s,Response:i}=e,r=[s,i,t];let o=r.length,l=o,c,f,h=A5;for(;l--;)c=r[l],f=h.get(c),f===void 0&&h.set(c,f=l?new Map:C5(e)),h=f;return f};Dk();const gv={http:UV,xhr:v5,fetch:{get:Dk}};U.forEach(gv,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const Yx=n=>`- ${n}`,k5=n=>U.isFunction(n)||n===null||n===!1;function T5(n,e){n=U.isArray(n)?n:[n];const{length:t}=n;let s,i;const r={};for(let o=0;o<t;o++){s=n[o];let l;if(i=s,!k5(s)&&(i=gv[(l=String(s)).toLowerCase()],i===void 0))throw new et(`Unknown adapter '${l}'`);if(i&&(U.isFunction(i)||(i=i.get(e))))break;r[l||"#"+o]=i}if(!i){const o=Object.entries(r).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let l=t?o.length>1?`since :
`+o.map(Yx).join(`
`):" "+Yx(o[0]):"as no adapter specified";throw new et("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return i}const Lk={getAdapter:T5,adapters:gv};function Kg(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new tc(null,n)}function Xx(n){return Kg(n),n.headers=ps.from(n.headers),n.data=qg.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Lk.getAdapter(n.adapter||tf.adapter,n)(n).then(function(s){return Kg(n),s.data=qg.call(n,n.transformResponse,s),s.headers=ps.from(s.headers),s},function(s){return Tk(s)||(Kg(n),s&&s.response&&(s.response.data=qg.call(n,n.transformResponse,s.response),s.response.headers=ps.from(s.response.headers))),Promise.reject(s)})}const Nk="1.13.2",Hp={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{Hp[n]=function(s){return typeof s===n||"a"+(e<1?"n ":" ")+n}});const Qx={};Hp.transitional=function(e,t,s){function i(r,o){return"[Axios v"+Nk+"] Transitional option '"+r+"'"+o+(s?". "+s:"")}return(r,o,l)=>{if(e===!1)throw new et(i(o," has been removed"+(t?" in "+t:"")),et.ERR_DEPRECATED);return t&&!Qx[o]&&(Qx[o]=!0,console.warn(i(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(r,o,l):!0}};Hp.spelling=function(e){return(t,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function O5(n,e,t){if(typeof n!="object")throw new et("options must be an object",et.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let i=s.length;for(;i-- >0;){const r=s[i],o=e[r];if(o){const l=n[r],c=l===void 0||o(l,r,n);if(c!==!0)throw new et("option "+r+" must be "+c,et.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new et("Unknown option "+r,et.ERR_BAD_OPTION)}}const rd={assertOptions:O5,validators:Hp},Ri=rd.validators;let ol=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Fx,response:new Fx}}async request(e,t){try{return await this._request(e,t)}catch(s){if(s instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const r=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?r&&!String(s.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(s.stack+=`
`+r):s.stack=r}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=ml(this.defaults,t);const{transitional:s,paramsSerializer:i,headers:r}=t;s!==void 0&&rd.assertOptions(s,{silentJSONParsing:Ri.transitional(Ri.boolean),forcedJSONParsing:Ri.transitional(Ri.boolean),clarifyTimeoutError:Ri.transitional(Ri.boolean)},!1),i!=null&&(U.isFunction(i)?t.paramsSerializer={serialize:i}:rd.assertOptions(i,{encode:Ri.function,serialize:Ri.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),rd.assertOptions(t,{baseUrl:Ri.spelling("baseURL"),withXsrfToken:Ri.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=r&&U.merge(r.common,r[t.method]);r&&U.forEach(["delete","get","head","post","put","patch","common"],y=>{delete r[y]}),t.headers=ps.concat(o,r);const l=[];let c=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(t)===!1||(c=c&&w.synchronous,l.unshift(w.fulfilled,w.rejected))});const f=[];this.interceptors.response.forEach(function(w){f.push(w.fulfilled,w.rejected)});let h,d=0,g;if(!c){const y=[Xx.bind(this),void 0];for(y.unshift(...l),y.push(...f),g=y.length,h=Promise.resolve(t);d<g;)h=h.then(y[d++],y[d++]);return h}g=l.length;let m=t;for(;d<g;){const y=l[d++],w=l[d++];try{m=y(m)}catch(x){w.call(this,x);break}}try{h=Xx.call(this,m)}catch(y){return Promise.reject(y)}for(d=0,g=f.length;d<g;)h=h.then(f[d++],f[d++]);return h}getUri(e){e=ml(this.defaults,e);const t=Rk(e.baseURL,e.url,e.allowAbsoluteUrls);return Ck(t,e.params,e.paramsSerializer)}};U.forEach(["delete","get","head","options"],function(e){ol.prototype[e]=function(t,s){return this.request(ml(s||{},{method:e,url:t,data:(s||{}).data}))}});U.forEach(["post","put","patch"],function(e){function t(s){return function(r,o,l){return this.request(ml(l||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}ol.prototype[e]=t(),ol.prototype[e+"Form"]=t(!0)});let R5=class Ik{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(r){t=r});const s=this;this.promise.then(i=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](i);s._listeners=null}),this.promise.then=i=>{let r;const o=new Promise(l=>{s.subscribe(l),r=l}).then(i);return o.cancel=function(){s.unsubscribe(r)},o},e(function(r,o,l){s.reason||(s.reason=new tc(r,o,l),t(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=s=>{e.abort(s)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Ik(function(i){e=i}),cancel:e}}};function M5(n){return function(t){return n.apply(null,t)}}function D5(n){return U.isObject(n)&&n.isAxiosError===!0}const w0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(w0).forEach(([n,e])=>{w0[e]=n});function Pk(n){const e=new ol(n),t=dk(ol.prototype.request,e);return U.extend(t,ol.prototype,e,{allOwnKeys:!0}),U.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return Pk(ml(n,i))},t}const Xe=Pk(tf);Xe.Axios=ol;Xe.CanceledError=tc;Xe.CancelToken=R5;Xe.isCancel=Tk;Xe.VERSION=Nk;Xe.toFormData=Wp;Xe.AxiosError=et;Xe.Cancel=Xe.CanceledError;Xe.all=function(e){return Promise.all(e)};Xe.spread=M5;Xe.isAxiosError=D5;Xe.mergeConfig=ml;Xe.AxiosHeaders=ps;Xe.formToJSON=n=>kk(U.isHTMLForm(n)?new FormData(n):n);Xe.getAdapter=Lk.getAdapter;Xe.HttpStatusCode=w0;Xe.default=Xe;const{Axios:jae,AxiosError:Gae,CanceledError:Yae,isCancel:Xae,CancelToken:Qae,VERSION:Jae,all:Zae,Cancel:ece,isAxiosError:tce,spread:nce,toFormData:sce,AxiosHeaders:ice,HttpStatusCode:rce,formToJSON:oce,getAdapter:lce,mergeConfig:ace}=Xe;function bv(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const Ot={},pa=[],Ki=()=>{},$k=()=>!1,Up=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),yv=n=>n.startsWith("onUpdate:"),Pn=Object.assign,vv=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},L5=Object.prototype.hasOwnProperty,_t=(n,e)=>L5.call(n,e),qe=Array.isArray,ma=n=>nf(n)==="[object Map]",nc=n=>nf(n)==="[object Set]",Jx=n=>nf(n)==="[object Date]",Je=n=>typeof n=="function",nn=n=>typeof n=="string",mi=n=>typeof n=="symbol",At=n=>n!==null&&typeof n=="object",Bk=n=>(At(n)||Je(n))&&Je(n.then)&&Je(n.catch),Fk=Object.prototype.toString,nf=n=>Fk.call(n),N5=n=>nf(n).slice(8,-1),Vk=n=>nf(n)==="[object Object]",zp=n=>nn(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,tu=bv(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),qp=n=>{const e=Object.create(null);return(t=>e[t]||(e[t]=n(t)))},I5=/-\w/g,ti=qp(n=>n.replace(I5,e=>e.slice(1).toUpperCase())),P5=/\B([A-Z])/g,_l=qp(n=>n.replace(P5,"-$1").toLowerCase()),Kp=qp(n=>n.charAt(0).toUpperCase()+n.slice(1)),jg=qp(n=>n?`on${Kp(n)}`:""),wo=(n,e)=>!Object.is(n,e),od=(n,...e)=>{for(let t=0;t<n.length;t++)n[t](...e)},Wk=(n,e,t,s=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:s,value:t})},jp=n=>{const e=parseFloat(n);return isNaN(e)?n:e};let Zx;const Gp=()=>Zx||(Zx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Hi(n){if(qe(n)){const e={};for(let t=0;t<n.length;t++){const s=n[t],i=nn(s)?V5(s):Hi(s);if(i)for(const r in i)e[r]=i[r]}return e}else if(nn(n)||At(n))return n}const $5=/;(?![^(]*\))/g,B5=/:([^]+)/,F5=/\/\*[^]*?\*\//g;function V5(n){const e={};return n.replace(F5,"").split($5).forEach(t=>{if(t){const s=t.split(B5);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function Pt(n){let e="";if(nn(n))e=n;else if(qe(n))for(let t=0;t<n.length;t++){const s=Pt(n[t]);s&&(e+=s+" ")}else if(At(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}const W5="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",H5=bv(W5);function Hk(n){return!!n||n===""}function U5(n,e){if(n.length!==e.length)return!1;let t=!0;for(let s=0;t&&s<n.length;s++)t=sf(n[s],e[s]);return t}function sf(n,e){if(n===e)return!0;let t=Jx(n),s=Jx(e);if(t||s)return t&&s?n.getTime()===e.getTime():!1;if(t=mi(n),s=mi(e),t||s)return n===e;if(t=qe(n),s=qe(e),t||s)return t&&s?U5(n,e):!1;if(t=At(n),s=At(e),t||s){if(!t||!s)return!1;const i=Object.keys(n).length,r=Object.keys(e).length;if(i!==r)return!1;for(const o in n){const l=n.hasOwnProperty(o),c=e.hasOwnProperty(o);if(l&&!c||!l&&c||!sf(n[o],e[o]))return!1}}return String(n)===String(e)}function wv(n,e){return n.findIndex(t=>sf(t,e))}const Uk=n=>!!(n&&n.__v_isRef===!0),Pe=n=>nn(n)?n:n==null?"":qe(n)||At(n)&&(n.toString===Fk||!Je(n.toString))?Uk(n)?Pe(n.value):JSON.stringify(n,zk,2):String(n),zk=(n,e)=>Uk(e)?zk(n,e.value):ma(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[s,i],r)=>(t[Gg(s,r)+" =>"]=i,t),{})}:nc(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>Gg(t))}:mi(e)?Gg(e):At(e)&&!qe(e)&&!Vk(e)?String(e):e,Gg=(n,e="")=>{var t;return mi(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};let os;class z5{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=os,!e&&os&&(this.index=(os.scopes||(os.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=os;try{return os=this,e()}finally{os=t}}}on(){++this._on===1&&(this.prevScope=os,os=this)}off(){this._on>0&&--this._on===0&&(os=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let t,s;for(t=0,s=this.effects.length;t<s;t++)this.effects[t].stop();for(this.effects.length=0,t=0,s=this.cleanups.length;t<s;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function q5(){return os}let Lt;const Yg=new WeakSet;class qk{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,os&&os.active&&os.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Yg.has(this)&&(Yg.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||jk(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,e_(this),Gk(this);const e=Lt,t=pi;Lt=this,pi=!0;try{return this.fn()}finally{Yk(this),Lt=e,pi=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)_v(e);this.deps=this.depsTail=void 0,e_(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Yg.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){S0(this)&&this.run()}get dirty(){return S0(this)}}let Kk=0,nu,su;function jk(n,e=!1){if(n.flags|=8,e){n.next=su,su=n;return}n.next=nu,nu=n}function Sv(){Kk++}function xv(){if(--Kk>0)return;if(su){let e=su;for(su=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;nu;){let e=nu;for(nu=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(s){n||(n=s)}e=t}}if(n)throw n}function Gk(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Yk(n){let e,t=n.depsTail,s=t;for(;s;){const i=s.prevDep;s.version===-1?(s===t&&(t=i),_v(s),K5(s)):e=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=i}n.deps=e,n.depsTail=t}function S0(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Xk(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function Xk(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Su)||(n.globalVersion=Su,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!S0(n))))return;n.flags|=2;const e=n.dep,t=Lt,s=pi;Lt=n,pi=!0;try{Gk(n);const i=n.fn(n._value);(e.version===0||wo(i,n._value))&&(n.flags|=128,n._value=i,e.version++)}catch(i){throw e.version++,i}finally{Lt=t,pi=s,Yk(n),n.flags&=-3}}function _v(n,e=!1){const{dep:t,prevSub:s,nextSub:i}=n;if(s&&(s.nextSub=i,n.prevSub=void 0),i&&(i.prevSub=s,n.nextSub=void 0),t.subs===n&&(t.subs=s,!s&&t.computed)){t.computed.flags&=-5;for(let r=t.computed.deps;r;r=r.nextDep)_v(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function K5(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let pi=!0;const Qk=[];function Or(){Qk.push(pi),pi=!1}function Rr(){const n=Qk.pop();pi=n===void 0?!0:n}function e_(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=Lt;Lt=void 0;try{e()}finally{Lt=t}}}let Su=0;class j5{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ev{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Lt||!pi||Lt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Lt)t=this.activeLink=new j5(Lt,this),Lt.deps?(t.prevDep=Lt.depsTail,Lt.depsTail.nextDep=t,Lt.depsTail=t):Lt.deps=Lt.depsTail=t,Jk(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const s=t.nextDep;s.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=s),t.prevDep=Lt.depsTail,t.nextDep=void 0,Lt.depsTail.nextDep=t,Lt.depsTail=t,Lt.deps===t&&(Lt.deps=s)}return t}trigger(e){this.version++,Su++,this.notify(e)}notify(e){Sv();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{xv()}}}function Jk(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let s=e.deps;s;s=s.nextDep)Jk(s)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const Ld=new WeakMap,ll=Symbol(""),x0=Symbol(""),xu=Symbol("");function Mn(n,e,t){if(pi&&Lt){let s=Ld.get(n);s||Ld.set(n,s=new Map);let i=s.get(t);i||(s.set(t,i=new Ev),i.map=s,i.key=t),i.track()}}function vr(n,e,t,s,i,r){const o=Ld.get(n);if(!o){Su++;return}const l=c=>{c&&c.trigger()};if(Sv(),e==="clear")o.forEach(l);else{const c=qe(n),f=c&&zp(t);if(c&&t==="length"){const h=Number(s);o.forEach((d,g)=>{(g==="length"||g===xu||!mi(g)&&g>=h)&&l(d)})}else switch((t!==void 0||o.has(void 0))&&l(o.get(t)),f&&l(o.get(xu)),e){case"add":c?f&&l(o.get("length")):(l(o.get(ll)),ma(n)&&l(o.get(x0)));break;case"delete":c||(l(o.get(ll)),ma(n)&&l(o.get(x0)));break;case"set":ma(n)&&l(o.get(ll));break}}xv()}function G5(n,e){const t=Ld.get(n);return t&&t.get(e)}function ql(n){const e=wt(n);return e===n?e:(Mn(e,"iterate",xu),Ds(n)?e:e.map(gi))}function Yp(n){return Mn(n=wt(n),"iterate",xu),n}function no(n,e){return Mr(n)?al(n)?La(gi(e)):La(e):gi(e)}const Y5={__proto__:null,[Symbol.iterator](){return Xg(this,Symbol.iterator,n=>no(this,n))},concat(...n){return ql(this).concat(...n.map(e=>qe(e)?ql(e):e))},entries(){return Xg(this,"entries",n=>(n[1]=no(this,n[1]),n))},every(n,e){return hr(this,"every",n,e,void 0,arguments)},filter(n,e){return hr(this,"filter",n,e,t=>t.map(s=>no(this,s)),arguments)},find(n,e){return hr(this,"find",n,e,t=>no(this,t),arguments)},findIndex(n,e){return hr(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return hr(this,"findLast",n,e,t=>no(this,t),arguments)},findLastIndex(n,e){return hr(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return hr(this,"forEach",n,e,void 0,arguments)},includes(...n){return Qg(this,"includes",n)},indexOf(...n){return Qg(this,"indexOf",n)},join(n){return ql(this).join(n)},lastIndexOf(...n){return Qg(this,"lastIndexOf",n)},map(n,e){return hr(this,"map",n,e,void 0,arguments)},pop(){return Ac(this,"pop")},push(...n){return Ac(this,"push",n)},reduce(n,...e){return t_(this,"reduce",n,e)},reduceRight(n,...e){return t_(this,"reduceRight",n,e)},shift(){return Ac(this,"shift")},some(n,e){return hr(this,"some",n,e,void 0,arguments)},splice(...n){return Ac(this,"splice",n)},toReversed(){return ql(this).toReversed()},toSorted(n){return ql(this).toSorted(n)},toSpliced(...n){return ql(this).toSpliced(...n)},unshift(...n){return Ac(this,"unshift",n)},values(){return Xg(this,"values",n=>no(this,n))}};function Xg(n,e,t){const s=Yp(n),i=s[e]();return s!==n&&!Ds(n)&&(i._next=i.next,i.next=()=>{const r=i._next();return r.done||(r.value=t(r.value)),r}),i}const X5=Array.prototype;function hr(n,e,t,s,i,r){const o=Yp(n),l=o!==n&&!Ds(n),c=o[e];if(c!==X5[e]){const d=c.apply(n,r);return l?gi(d):d}let f=t;o!==n&&(l?f=function(d,g){return t.call(this,no(n,d),g,n)}:t.length>2&&(f=function(d,g){return t.call(this,d,g,n)}));const h=c.call(o,f,s);return l&&i?i(h):h}function t_(n,e,t,s){const i=Yp(n);let r=t;return i!==n&&(Ds(n)?t.length>3&&(r=function(o,l,c){return t.call(this,o,l,c,n)}):r=function(o,l,c){return t.call(this,o,no(n,l),c,n)}),i[e](r,...s)}function Qg(n,e,t){const s=wt(n);Mn(s,"iterate",xu);const i=s[e](...t);return(i===-1||i===!1)&&Xp(t[0])?(t[0]=wt(t[0]),s[e](...t)):i}function Ac(n,e,t=[]){Or(),Sv();const s=wt(n)[e].apply(n,t);return xv(),Rr(),s}const Q5=bv("__proto__,__v_isRef,__isVue"),Zk=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(mi));function J5(n){mi(n)||(n=String(n));const e=wt(this);return Mn(e,"has",n),e.hasOwnProperty(n)}class eT{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,s){if(t==="__v_skip")return e.__v_skip;const i=this._isReadonly,r=this._isShallow;if(t==="__v_isReactive")return!i;if(t==="__v_isReadonly")return i;if(t==="__v_isShallow")return r;if(t==="__v_raw")return s===(i?r?aW:iT:r?sT:nT).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const o=qe(e);if(!i){let c;if(o&&(c=Y5[t]))return c;if(t==="hasOwnProperty")return J5}const l=Reflect.get(e,t,cn(e)?e:s);if((mi(t)?Zk.has(t):Q5(t))||(i||Mn(e,"get",t),r))return l;if(cn(l)){const c=o&&zp(t)?l:l.value;return i&&At(c)?E0(c):c}return At(l)?i?E0(l):Wt(l):l}}class tT extends eT{constructor(e=!1){super(!1,e)}set(e,t,s,i){let r=e[t];const o=qe(e)&&zp(t);if(!this._isShallow){const f=Mr(r);if(!Ds(s)&&!Mr(s)&&(r=wt(r),s=wt(s)),!o&&cn(r)&&!cn(s))return f||(r.value=s),!0}const l=o?Number(t)<e.length:_t(e,t),c=Reflect.set(e,t,s,cn(e)?e:i);return e===wt(i)&&(l?wo(s,r)&&vr(e,"set",t,s):vr(e,"add",t,s)),c}deleteProperty(e,t){const s=_t(e,t);e[t];const i=Reflect.deleteProperty(e,t);return i&&s&&vr(e,"delete",t,void 0),i}has(e,t){const s=Reflect.has(e,t);return(!mi(t)||!Zk.has(t))&&Mn(e,"has",t),s}ownKeys(e){return Mn(e,"iterate",qe(e)?"length":ll),Reflect.ownKeys(e)}}class Z5 extends eT{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const eW=new tT,tW=new Z5,nW=new tT(!0);const _0=n=>n,hh=n=>Reflect.getPrototypeOf(n);function sW(n,e,t){return function(...s){const i=this.__v_raw,r=wt(i),o=ma(r),l=n==="entries"||n===Symbol.iterator&&o,c=n==="keys"&&o,f=i[n](...s),h=t?_0:e?La:gi;return!e&&Mn(r,"iterate",c?x0:ll),{next(){const{value:d,done:g}=f.next();return g?{value:d,done:g}:{value:l?[h(d[0]),h(d[1])]:h(d),done:g}},[Symbol.iterator](){return this}}}}function dh(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function iW(n,e){const t={get(i){const r=this.__v_raw,o=wt(r),l=wt(i);n||(wo(i,l)&&Mn(o,"get",i),Mn(o,"get",l));const{has:c}=hh(o),f=e?_0:n?La:gi;if(c.call(o,i))return f(r.get(i));if(c.call(o,l))return f(r.get(l));r!==o&&r.get(i)},get size(){const i=this.__v_raw;return!n&&Mn(wt(i),"iterate",ll),i.size},has(i){const r=this.__v_raw,o=wt(r),l=wt(i);return n||(wo(i,l)&&Mn(o,"has",i),Mn(o,"has",l)),i===l?r.has(i):r.has(i)||r.has(l)},forEach(i,r){const o=this,l=o.__v_raw,c=wt(l),f=e?_0:n?La:gi;return!n&&Mn(c,"iterate",ll),l.forEach((h,d)=>i.call(r,f(h),f(d),o))}};return Pn(t,n?{add:dh("add"),set:dh("set"),delete:dh("delete"),clear:dh("clear")}:{add(i){!e&&!Ds(i)&&!Mr(i)&&(i=wt(i));const r=wt(this);return hh(r).has.call(r,i)||(r.add(i),vr(r,"add",i,i)),this},set(i,r){!e&&!Ds(r)&&!Mr(r)&&(r=wt(r));const o=wt(this),{has:l,get:c}=hh(o);let f=l.call(o,i);f||(i=wt(i),f=l.call(o,i));const h=c.call(o,i);return o.set(i,r),f?wo(r,h)&&vr(o,"set",i,r):vr(o,"add",i,r),this},delete(i){const r=wt(this),{has:o,get:l}=hh(r);let c=o.call(r,i);c||(i=wt(i),c=o.call(r,i)),l&&l.call(r,i);const f=r.delete(i);return c&&vr(r,"delete",i,void 0),f},clear(){const i=wt(this),r=i.size!==0,o=i.clear();return r&&vr(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=sW(i,n,e)}),t}function Cv(n,e){const t=iW(n,e);return(s,i,r)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?s:Reflect.get(_t(t,i)&&i in s?t:s,i,r)}const rW={get:Cv(!1,!1)},oW={get:Cv(!1,!0)},lW={get:Cv(!0,!1)};const nT=new WeakMap,sT=new WeakMap,iT=new WeakMap,aW=new WeakMap;function cW(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function uW(n){return n.__v_skip||!Object.isExtensible(n)?0:cW(N5(n))}function Wt(n){return Mr(n)?n:Av(n,!1,eW,rW,nT)}function rT(n){return Av(n,!1,nW,oW,sT)}function E0(n){return Av(n,!0,tW,lW,iT)}function Av(n,e,t,s,i){if(!At(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const r=uW(n);if(r===0)return n;const o=i.get(n);if(o)return o;const l=new Proxy(n,r===2?s:t);return i.set(n,l),l}function al(n){return Mr(n)?al(n.__v_raw):!!(n&&n.__v_isReactive)}function Mr(n){return!!(n&&n.__v_isReadonly)}function Ds(n){return!!(n&&n.__v_isShallow)}function Xp(n){return n?!!n.__v_raw:!1}function wt(n){const e=n&&n.__v_raw;return e?wt(e):n}function fW(n){return!_t(n,"__v_skip")&&Object.isExtensible(n)&&Wk(n,"__v_skip",!0),n}const gi=n=>At(n)?Wt(n):n,La=n=>At(n)?E0(n):n;function cn(n){return n?n.__v_isRef===!0:!1}function De(n){return oT(n,!1)}function hW(n){return oT(n,!0)}function oT(n,e){return cn(n)?n:new dW(n,e)}class dW{constructor(e,t){this.dep=new Ev,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:wt(e),this._value=t?e:gi(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,s=this.__v_isShallow||Ds(e)||Mr(e);e=s?e:wt(e),wo(e,t)&&(this._rawValue=e,this._value=s?e:gi(e),this.dep.trigger())}}function ke(n){return cn(n)?n.value:n}const pW={get:(n,e,t)=>e==="__v_raw"?n:ke(Reflect.get(n,e,t)),set:(n,e,t,s)=>{const i=n[e];return cn(i)&&!cn(t)?(i.value=t,!0):Reflect.set(n,e,t,s)}};function lT(n){return al(n)?n:new Proxy(n,pW)}class mW{constructor(e,t,s){this._object=e,this._key=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._raw=wt(e);let i=!0,r=e;if(!qe(e)||!zp(String(t)))do i=!Xp(r)||Ds(r);while(i&&(r=r.__v_raw));this._shallow=i}get value(){let e=this._object[this._key];return this._shallow&&(e=ke(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&cn(this._raw[this._key])){const t=this._object[this._key];if(cn(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return G5(this._raw,this._key)}}class gW{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function bW(n,e,t){return cn(n)?n:Je(n)?new gW(n):At(n)&&arguments.length>1?yW(n,e,t):De(n)}function yW(n,e,t){return new mW(n,e,t)}class vW{constructor(e,t,s){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Ev(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Su-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Lt!==this)return jk(this,!0),!0}get value(){const e=this.dep.track();return Xk(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function wW(n,e,t=!1){let s,i;return Je(n)?s=n:(s=n.get,i=n.set),new vW(s,i,t)}const ph={},Nd=new WeakMap;let Yo;function SW(n,e=!1,t=Yo){if(t){let s=Nd.get(t);s||Nd.set(t,s=[]),s.push(n)}}function xW(n,e,t=Ot){const{immediate:s,deep:i,once:r,scheduler:o,augmentJob:l,call:c}=t,f=k=>i?k:Ds(k)||i===!1||i===0?wr(k,1):wr(k);let h,d,g,m,y=!1,w=!1;if(cn(n)?(d=()=>n.value,y=Ds(n)):al(n)?(d=()=>f(n),y=!0):qe(n)?(w=!0,y=n.some(k=>al(k)||Ds(k)),d=()=>n.map(k=>{if(cn(k))return k.value;if(al(k))return f(k);if(Je(k))return c?c(k,2):k()})):Je(n)?e?d=c?()=>c(n,2):n:d=()=>{if(g){Or();try{g()}finally{Rr()}}const k=Yo;Yo=h;try{return c?c(n,3,[m]):n(m)}finally{Yo=k}}:d=Ki,e&&i){const k=d,R=i===!0?1/0:i;d=()=>wr(k(),R)}const x=q5(),S=()=>{h.stop(),x&&x.active&&vv(x.effects,h)};if(r&&e){const k=e;e=(...R)=>{k(...R),S()}}let C=w?new Array(n.length).fill(ph):ph;const E=k=>{if(!(!(h.flags&1)||!h.dirty&&!k))if(e){const R=h.run();if(i||y||(w?R.some((T,L)=>wo(T,C[L])):wo(R,C))){g&&g();const T=Yo;Yo=h;try{const L=[R,C===ph?void 0:w&&C[0]===ph?[]:C,m];C=R,c?c(e,3,L):e(...L)}finally{Yo=T}}}else h.run()};return l&&l(E),h=new qk(d),h.scheduler=o?()=>o(E,!1):E,m=k=>SW(k,!1,h),g=h.onStop=()=>{const k=Nd.get(h);if(k){if(c)c(k,4);else for(const R of k)R();Nd.delete(h)}},e?s?E(!0):C=h.run():o?o(E.bind(null,!0),!0):h.run(),S.pause=h.pause.bind(h),S.resume=h.resume.bind(h),S.stop=S,S}function wr(n,e=1/0,t){if(e<=0||!At(n)||n.__v_skip||(t=t||new Map,(t.get(n)||0)>=e))return n;if(t.set(n,e),e--,cn(n))wr(n.value,e,t);else if(qe(n))for(let s=0;s<n.length;s++)wr(n[s],e,t);else if(nc(n)||ma(n))n.forEach(s=>{wr(s,e,t)});else if(Vk(n)){for(const s in n)wr(n[s],e,t);for(const s of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,s)&&wr(n[s],e,t)}return n}function rf(n,e,t,s){try{return s?n(...s):n()}catch(i){Qp(i,e,t)}}function Xi(n,e,t,s){if(Je(n)){const i=rf(n,e,t,s);return i&&Bk(i)&&i.catch(r=>{Qp(r,e,t)}),i}if(qe(n)){const i=[];for(let r=0;r<n.length;r++)i.push(Xi(n[r],e,t,s));return i}}function Qp(n,e,t,s=!0){const i=e?e.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||Ot;if(e){let l=e.parent;const c=e.proxy,f=`https://vuejs.org/error-reference/#runtime-${t}`;for(;l;){const h=l.ec;if(h){for(let d=0;d<h.length;d++)if(h[d](n,c,f)===!1)return}l=l.parent}if(r){Or(),rf(r,null,10,[n,c,f]),Rr();return}}_W(n,t,i,s,o)}function _W(n,e,t,s=!0,i=!1){if(i)throw n;console.error(n)}const Kn=[];let $i=-1;const ga=[];let so=null,Zl=0;const aT=Promise.resolve();let Id=null;function _u(n){const e=Id||aT;return n?e.then(this?n.bind(this):n):e}function EW(n){let e=$i+1,t=Kn.length;for(;e<t;){const s=e+t>>>1,i=Kn[s],r=Eu(i);r<n||r===n&&i.flags&2?e=s+1:t=s}return e}function kv(n){if(!(n.flags&1)){const e=Eu(n),t=Kn[Kn.length-1];!t||!(n.flags&2)&&e>=Eu(t)?Kn.push(n):Kn.splice(EW(e),0,n),n.flags|=1,cT()}}function cT(){Id||(Id=aT.then(fT))}function CW(n){qe(n)?ga.push(...n):so&&n.id===-1?so.splice(Zl+1,0,n):n.flags&1||(ga.push(n),n.flags|=1),cT()}function n_(n,e,t=$i+1){for(;t<Kn.length;t++){const s=Kn[t];if(s&&s.flags&2){if(n&&s.id!==n.uid)continue;Kn.splice(t,1),t--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function uT(n){if(ga.length){const e=[...new Set(ga)].sort((t,s)=>Eu(t)-Eu(s));if(ga.length=0,so){so.push(...e);return}for(so=e,Zl=0;Zl<so.length;Zl++){const t=so[Zl];t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2}so=null,Zl=0}}const Eu=n=>n.id==null?n.flags&2?-1:1/0:n.id;function fT(n){try{for($i=0;$i<Kn.length;$i++){const e=Kn[$i];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),rf(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;$i<Kn.length;$i++){const e=Kn[$i];e&&(e.flags&=-2)}$i=-1,Kn.length=0,uT(),Id=null,(Kn.length||ga.length)&&fT()}}let En=null,hT=null;function Pd(n){const e=En;return En=n,hT=n&&n.type.__scopeId||null,e}function qs(n,e=En,t){if(!e||n._n)return n;const s=(...i)=>{s._d&&Vd(-1);const r=Pd(e);let o;try{o=n(...i)}finally{Pd(r),s._d&&Vd(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function Ye(n,e){if(En===null)return n;const t=tm(En),s=n.dirs||(n.dirs=[]);for(let i=0;i<e.length;i++){let[r,o,l,c=Ot]=e[i];r&&(Je(r)&&(r={mounted:r,updated:r}),r.deep&&wr(o),s.push({dir:r,instance:t,value:o,oldValue:void 0,arg:l,modifiers:c}))}return n}function qo(n,e,t,s){const i=n.dirs,r=e&&e.dirs;for(let o=0;o<i.length;o++){const l=i[o];r&&(l.oldValue=r[o].value);let c=l.dir[s];c&&(Or(),Xi(c,t,8,[n.el,l,n,e]),Rr())}}function iu(n,e){if(Ln){let t=Ln.provides;const s=Ln.parent&&Ln.parent.provides;s===t&&(t=Ln.provides=Object.create(s)),t[n]=e}}function Vt(n,e,t=!1){const s=C4();if(s||ya){let i=ya?ya._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(i&&n in i)return i[n];if(arguments.length>1)return t&&Je(e)?e.call(s&&s.proxy):e}}const AW=Symbol.for("v-scx"),kW=()=>Vt(AW);function $d(n,e){return Tv(n,null,e)}function Os(n,e,t){return Tv(n,e,t)}function Tv(n,e,t=Ot){const{immediate:s,deep:i,flush:r,once:o}=t,l=Pn({},t),c=e&&s||!e&&r!=="post";let f;if(ku){if(r==="sync"){const m=kW();f=m.__watcherHandles||(m.__watcherHandles=[])}else if(!c){const m=()=>{};return m.stop=Ki,m.resume=Ki,m.pause=Ki,m}}const h=Ln;l.call=(m,y,w)=>Xi(m,h,y,w);let d=!1;r==="post"?l.scheduler=m=>{As(m,h&&h.suspense)}:r!=="sync"&&(d=!0,l.scheduler=(m,y)=>{y?m():kv(m)}),l.augmentJob=m=>{e&&(m.flags|=4),d&&(m.flags|=2,h&&(m.id=h.uid,m.i=h))};const g=xW(n,e,l);return ku&&(f?f.push(g):c&&g()),g}function TW(n,e,t){const s=this.proxy,i=nn(n)?n.includes(".")?dT(s,n):()=>s[n]:n.bind(s,s);let r;Je(e)?r=e:(r=e.handler,t=e);const o=lf(this),l=Tv(i,r.bind(s),t);return o(),l}function dT(n,e){const t=e.split(".");return()=>{let s=n;for(let i=0;i<t.length&&s;i++)s=s[t[i]];return s}}const OW=Symbol("_vte"),RW=n=>n.__isTeleport,MW=Symbol("_leaveCb");function Ov(n,e){n.shapeFlag&6&&n.component?(n.transition=e,Ov(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function Bn(n,e){return Je(n)?Pn({name:n.name},e,{setup:n}):n}function pT(n){n.ids=[n.ids[0]+n.ids[2]+++"-",0,0]}const Bd=new WeakMap;function ru(n,e,t,s,i=!1){if(qe(n)){n.forEach((y,w)=>ru(y,e&&(qe(e)?e[w]:e),t,s,i));return}if(ba(s)&&!i){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&ru(n,e,t,s.component.subTree);return}const r=s.shapeFlag&4?tm(s.component):s.el,o=i?null:r,{i:l,r:c}=n,f=e&&e.r,h=l.refs===Ot?l.refs={}:l.refs,d=l.setupState,g=wt(d),m=d===Ot?$k:y=>_t(g,y);if(f!=null&&f!==c){if(s_(e),nn(f))h[f]=null,m(f)&&(d[f]=null);else if(cn(f)){f.value=null;const y=e;y.k&&(h[y.k]=null)}}if(Je(c))rf(c,l,12,[o,h]);else{const y=nn(c),w=cn(c);if(y||w){const x=()=>{if(n.f){const S=y?m(c)?d[c]:h[c]:c.value;if(i)qe(S)&&vv(S,r);else if(qe(S))S.includes(r)||S.push(r);else if(y)h[c]=[r],m(c)&&(d[c]=h[c]);else{const C=[r];c.value=C,n.k&&(h[n.k]=C)}}else y?(h[c]=o,m(c)&&(d[c]=o)):w&&(c.value=o,n.k&&(h[n.k]=o))};if(o){const S=()=>{x(),Bd.delete(n)};S.id=-1,Bd.set(n,S),As(S,t)}else s_(n),x()}}}function s_(n){const e=Bd.get(n);e&&(e.flags|=8,Bd.delete(n))}Gp().requestIdleCallback;Gp().cancelIdleCallback;const ba=n=>!!n.type.__asyncLoader,mT=n=>n.type.__isKeepAlive;function DW(n,e){gT(n,"a",e)}function LW(n,e){gT(n,"da",e)}function gT(n,e,t=Ln){const s=n.__wdc||(n.__wdc=()=>{let i=t;for(;i;){if(i.isDeactivated)return;i=i.parent}return n()});if(Jp(e,s,t),t){let i=t.parent;for(;i&&i.parent;)mT(i.parent.vnode)&&NW(s,e,t,i),i=i.parent}}function NW(n,e,t,s){const i=Jp(e,n,s,!0);Rv(()=>{vv(s[e],i)},t)}function Jp(n,e,t=Ln,s=!1){if(t){const i=t[n]||(t[n]=[]),r=e.__weh||(e.__weh=(...o)=>{Or();const l=lf(t),c=Xi(e,t,n,o);return l(),Rr(),c});return s?i.unshift(r):i.push(r),r}}const Fr=n=>(e,t=Ln)=>{(!ku||n==="sp")&&Jp(n,(...s)=>e(...s),t)},of=Fr("bm"),Si=Fr("m"),IW=Fr("bu"),PW=Fr("u"),$W=Fr("bum"),Rv=Fr("um"),BW=Fr("sp"),FW=Fr("rtg"),VW=Fr("rtc");function WW(n,e=Ln){Jp("ec",n,e)}const HW="components";function sc(n,e){return zW(HW,n,!0,e)||n}const UW=Symbol.for("v-ndc");function zW(n,e,t=!0,s=!1){const i=En||Ln;if(i){const r=i.type;{const l=R4(r,!1);if(l&&(l===e||l===ti(e)||l===Kp(ti(e))))return r}const o=i_(i[n]||r[n],e)||i_(i.appContext[n],e);return!o&&s?r:o}}function i_(n,e){return n&&(n[e]||n[ti(e)]||n[Kp(ti(e))])}function mn(n,e,t,s){let i;const r=t,o=qe(n);if(o||nn(n)){const l=o&&al(n);let c=!1,f=!1;l&&(c=!Ds(n),f=Mr(n),n=Yp(n)),i=new Array(n.length);for(let h=0,d=n.length;h<d;h++)i[h]=e(c?f?La(gi(n[h])):gi(n[h]):n[h],h,void 0,r)}else if(typeof n=="number"){i=new Array(n);for(let l=0;l<n;l++)i[l]=e(l+1,l,void 0,r)}else if(At(n))if(n[Symbol.iterator])i=Array.from(n,(l,c)=>e(l,c,void 0,r));else{const l=Object.keys(n);i=new Array(l.length);for(let c=0,f=l.length;c<f;c++){const h=l[c];i[c]=e(n[h],h,c,r)}}else i=[];return i}function qW(n,e,t={},s,i){if(En.ce||En.parent&&ba(En.parent)&&En.parent.ce){const f=Object.keys(t).length>0;return ue(),So(gt,null,[mt("slot",t,s)],f?-2:64)}let r=n[e];r&&r._c&&(r._d=!1),ue();const o=r&&bT(r(t)),l=t.key||o&&o.key,c=So(gt,{key:(l&&!mi(l)?l:`_${e}`)+(!o&&s?"_fb":"")},o||[],o&&n._===1?64:-2);return r&&r._c&&(r._d=!0),c}function bT(n){return n.some(e=>Au(e)?!(e.type===Dr||e.type===gt&&!bT(e.children)):!0)?n:null}const C0=n=>n?PT(n)?tm(n):C0(n.parent):null,ou=Pn(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>C0(n.parent),$root:n=>C0(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>vT(n),$forceUpdate:n=>n.f||(n.f=()=>{kv(n.update)}),$nextTick:n=>n.n||(n.n=_u.bind(n.proxy)),$watch:n=>TW.bind(n)}),Jg=(n,e)=>n!==Ot&&!n.__isScriptSetup&&_t(n,e),KW={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:s,data:i,props:r,accessCache:o,type:l,appContext:c}=n;if(e[0]!=="$"){const g=o[e];if(g!==void 0)switch(g){case 1:return s[e];case 2:return i[e];case 4:return t[e];case 3:return r[e]}else{if(Jg(s,e))return o[e]=1,s[e];if(i!==Ot&&_t(i,e))return o[e]=2,i[e];if(_t(r,e))return o[e]=3,r[e];if(t!==Ot&&_t(t,e))return o[e]=4,t[e];A0&&(o[e]=0)}}const f=ou[e];let h,d;if(f)return e==="$attrs"&&Mn(n.attrs,"get",""),f(n);if((h=l.__cssModules)&&(h=h[e]))return h;if(t!==Ot&&_t(t,e))return o[e]=4,t[e];if(d=c.config.globalProperties,_t(d,e))return d[e]},set({_:n},e,t){const{data:s,setupState:i,ctx:r}=n;return Jg(i,e)?(i[e]=t,!0):s!==Ot&&_t(s,e)?(s[e]=t,!0):_t(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(r[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:s,appContext:i,props:r,type:o}},l){let c;return!!(t[l]||n!==Ot&&l[0]!=="$"&&_t(n,l)||Jg(e,l)||_t(r,l)||_t(s,l)||_t(ou,l)||_t(i.config.globalProperties,l)||(c=o.__cssModules)&&c[l])},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:_t(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function r_(n){return qe(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let A0=!0;function jW(n){const e=vT(n),t=n.proxy,s=n.ctx;A0=!1,e.beforeCreate&&o_(e.beforeCreate,n,"bc");const{data:i,computed:r,methods:o,watch:l,provide:c,inject:f,created:h,beforeMount:d,mounted:g,beforeUpdate:m,updated:y,activated:w,deactivated:x,beforeDestroy:S,beforeUnmount:C,destroyed:E,unmounted:k,render:R,renderTracked:T,renderTriggered:L,errorCaptured:N,serverPrefetch:F,expose:ee,inheritAttrs:ce,components:ne,directives:pe,filters:Y}=e;if(f&&GW(f,s,null),o)for(const Se in o){const H=o[Se];Je(H)&&(s[Se]=H.bind(t))}if(i){const Se=i.call(t,t);At(Se)&&(n.data=Wt(Se))}if(A0=!0,r)for(const Se in r){const H=r[Se],ge=Je(H)?H.bind(t,t):Je(H.get)?H.get.bind(t,t):Ki,Z=!Je(H)&&Je(H.set)?H.set.bind(t):Ki,X=at({get:ge,set:Z});Object.defineProperty(s,Se,{enumerable:!0,configurable:!0,get:()=>X.value,set:fe=>X.value=fe})}if(l)for(const Se in l)yT(l[Se],s,t,Se);if(c){const Se=Je(c)?c.call(t):c;Reflect.ownKeys(Se).forEach(H=>{iu(H,Se[H])})}h&&o_(h,n,"c");function J(Se,H){qe(H)?H.forEach(ge=>Se(ge.bind(t))):H&&Se(H.bind(t))}if(J(of,d),J(Si,g),J(IW,m),J(PW,y),J(DW,w),J(LW,x),J(WW,N),J(VW,T),J(FW,L),J($W,C),J(Rv,k),J(BW,F),qe(ee))if(ee.length){const Se=n.exposed||(n.exposed={});ee.forEach(H=>{Object.defineProperty(Se,H,{get:()=>t[H],set:ge=>t[H]=ge,enumerable:!0})})}else n.exposed||(n.exposed={});R&&n.render===Ki&&(n.render=R),ce!=null&&(n.inheritAttrs=ce),ne&&(n.components=ne),pe&&(n.directives=pe),F&&pT(n)}function GW(n,e,t=Ki){qe(n)&&(n=k0(n));for(const s in n){const i=n[s];let r;At(i)?"default"in i?r=Vt(i.from||s,i.default,!0):r=Vt(i.from||s):r=Vt(i),cn(r)?Object.defineProperty(e,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[s]=r}}function o_(n,e,t){Xi(qe(n)?n.map(s=>s.bind(e.proxy)):n.bind(e.proxy),e,t)}function yT(n,e,t,s){let i=s.includes(".")?dT(t,s):()=>t[s];if(nn(n)){const r=e[n];Je(r)&&Os(i,r)}else if(Je(n))Os(i,n.bind(t));else if(At(n))if(qe(n))n.forEach(r=>yT(r,e,t,s));else{const r=Je(n.handler)?n.handler.bind(t):e[n.handler];Je(r)&&Os(i,r,n)}}function vT(n){const e=n.type,{mixins:t,extends:s}=e,{mixins:i,optionsCache:r,config:{optionMergeStrategies:o}}=n.appContext,l=r.get(e);let c;return l?c=l:!i.length&&!t&&!s?c=e:(c={},i.length&&i.forEach(f=>Fd(c,f,o,!0)),Fd(c,e,o)),At(e)&&r.set(e,c),c}function Fd(n,e,t,s=!1){const{mixins:i,extends:r}=e;r&&Fd(n,r,t,!0),i&&i.forEach(o=>Fd(n,o,t,!0));for(const o in e)if(!(s&&o==="expose")){const l=YW[o]||t&&t[o];n[o]=l?l(n[o],e[o]):e[o]}return n}const YW={data:l_,props:a_,emits:a_,methods:zc,computed:zc,beforeCreate:zn,created:zn,beforeMount:zn,mounted:zn,beforeUpdate:zn,updated:zn,beforeDestroy:zn,beforeUnmount:zn,destroyed:zn,unmounted:zn,activated:zn,deactivated:zn,errorCaptured:zn,serverPrefetch:zn,components:zc,directives:zc,watch:QW,provide:l_,inject:XW};function l_(n,e){return e?n?function(){return Pn(Je(n)?n.call(this,this):n,Je(e)?e.call(this,this):e)}:e:n}function XW(n,e){return zc(k0(n),k0(e))}function k0(n){if(qe(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function zn(n,e){return n?[...new Set([].concat(n,e))]:e}function zc(n,e){return n?Pn(Object.create(null),n,e):e}function a_(n,e){return n?qe(n)&&qe(e)?[...new Set([...n,...e])]:Pn(Object.create(null),r_(n),r_(e??{})):e}function QW(n,e){if(!n)return e;if(!e)return n;const t=Pn(Object.create(null),n);for(const s in e)t[s]=zn(n[s],e[s]);return t}function wT(){return{app:null,config:{isNativeTag:$k,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let JW=0;function ZW(n,e){return function(s,i=null){Je(s)||(s=Pn({},s)),i!=null&&!At(i)&&(i=null);const r=wT(),o=new WeakSet,l=[];let c=!1;const f=r.app={_uid:JW++,_component:s,_props:i,_container:null,_context:r,_instance:null,version:D4,get config(){return r.config},set config(h){},use(h,...d){return o.has(h)||(h&&Je(h.install)?(o.add(h),h.install(f,...d)):Je(h)&&(o.add(h),h(f,...d))),f},mixin(h){return r.mixins.includes(h)||r.mixins.push(h),f},component(h,d){return d?(r.components[h]=d,f):r.components[h]},directive(h,d){return d?(r.directives[h]=d,f):r.directives[h]},mount(h,d,g){if(!c){const m=f._ceVNode||mt(s,i);return m.appContext=r,g===!0?g="svg":g===!1&&(g=void 0),n(m,h,g),c=!0,f._container=h,h.__vue_app__=f,tm(m.component)}},onUnmount(h){l.push(h)},unmount(){c&&(Xi(l,f._instance,16),n(null,f._container),delete f._container.__vue_app__)},provide(h,d){return r.provides[h]=d,f},runWithContext(h){const d=ya;ya=f;try{return h()}finally{ya=d}}};return f}}let ya=null;const e4=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${ti(e)}Modifiers`]||n[`${_l(e)}Modifiers`];function t4(n,e,...t){if(n.isUnmounted)return;const s=n.vnode.props||Ot;let i=t;const r=e.startsWith("update:"),o=r&&e4(s,e.slice(7));o&&(o.trim&&(i=t.map(h=>nn(h)?h.trim():h)),o.number&&(i=t.map(jp)));let l,c=s[l=jg(e)]||s[l=jg(ti(e))];!c&&r&&(c=s[l=jg(_l(e))]),c&&Xi(c,n,6,i);const f=s[l+"Once"];if(f){if(!n.emitted)n.emitted={};else if(n.emitted[l])return;n.emitted[l]=!0,Xi(f,n,6,i)}}const n4=new WeakMap;function ST(n,e,t=!1){const s=t?n4:e.emitsCache,i=s.get(n);if(i!==void 0)return i;const r=n.emits;let o={},l=!1;if(!Je(n)){const c=f=>{const h=ST(f,e,!0);h&&(l=!0,Pn(o,h))};!t&&e.mixins.length&&e.mixins.forEach(c),n.extends&&c(n.extends),n.mixins&&n.mixins.forEach(c)}return!r&&!l?(At(n)&&s.set(n,null),null):(qe(r)?r.forEach(c=>o[c]=null):Pn(o,r),At(n)&&s.set(n,o),o)}function Zp(n,e){return!n||!Up(e)?!1:(e=e.slice(2).replace(/Once$/,""),_t(n,e[0].toLowerCase()+e.slice(1))||_t(n,_l(e))||_t(n,e))}function c_(n){const{type:e,vnode:t,proxy:s,withProxy:i,propsOptions:[r],slots:o,attrs:l,emit:c,render:f,renderCache:h,props:d,data:g,setupState:m,ctx:y,inheritAttrs:w}=n,x=Pd(n);let S,C;try{if(t.shapeFlag&4){const k=i||s,R=k;S=Bi(f.call(R,k,h,d,m,g,y)),C=l}else{const k=e;S=Bi(k.length>1?k(d,{attrs:l,slots:o,emit:c}):k(d,null)),C=e.props?l:s4(l)}}catch(k){lu.length=0,Qp(k,n,1),S=mt(Dr)}let E=S;if(C&&w!==!1){const k=Object.keys(C),{shapeFlag:R}=E;k.length&&R&7&&(r&&k.some(yv)&&(C=i4(C,r)),E=Na(E,C,!1,!0))}return t.dirs&&(E=Na(E,null,!1,!0),E.dirs=E.dirs?E.dirs.concat(t.dirs):t.dirs),t.transition&&Ov(E,t.transition),S=E,Pd(x),S}const s4=n=>{let e;for(const t in n)(t==="class"||t==="style"||Up(t))&&((e||(e={}))[t]=n[t]);return e},i4=(n,e)=>{const t={};for(const s in n)(!yv(s)||!(s.slice(9)in e))&&(t[s]=n[s]);return t};function r4(n,e,t){const{props:s,children:i,component:r}=n,{props:o,children:l,patchFlag:c}=e,f=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&c>=0){if(c&1024)return!0;if(c&16)return s?u_(s,o,f):!!o;if(c&8){const h=e.dynamicProps;for(let d=0;d<h.length;d++){const g=h[d];if(o[g]!==s[g]&&!Zp(f,g))return!0}}}else return(i||l)&&(!l||!l.$stable)?!0:s===o?!1:s?o?u_(s,o,f):!0:!!o;return!1}function u_(n,e,t){const s=Object.keys(e);if(s.length!==Object.keys(n).length)return!0;for(let i=0;i<s.length;i++){const r=s[i];if(e[r]!==n[r]&&!Zp(t,r))return!0}return!1}function o4({vnode:n,parent:e},t){for(;e;){const s=e.subTree;if(s.suspense&&s.suspense.activeBranch===n&&(s.el=n.el),s===n)(n=e.vnode).el=t,e=e.parent;else break}}const xT={},_T=()=>Object.create(xT),ET=n=>Object.getPrototypeOf(n)===xT;function l4(n,e,t,s=!1){const i={},r=_T();n.propsDefaults=Object.create(null),CT(n,e,i,r);for(const o in n.propsOptions[0])o in i||(i[o]=void 0);t?n.props=s?i:rT(i):n.type.props?n.props=i:n.props=r,n.attrs=r}function a4(n,e,t,s){const{props:i,attrs:r,vnode:{patchFlag:o}}=n,l=wt(i),[c]=n.propsOptions;let f=!1;if((s||o>0)&&!(o&16)){if(o&8){const h=n.vnode.dynamicProps;for(let d=0;d<h.length;d++){let g=h[d];if(Zp(n.emitsOptions,g))continue;const m=e[g];if(c)if(_t(r,g))m!==r[g]&&(r[g]=m,f=!0);else{const y=ti(g);i[y]=T0(c,l,y,m,n,!1)}else m!==r[g]&&(r[g]=m,f=!0)}}}else{CT(n,e,i,r)&&(f=!0);let h;for(const d in l)(!e||!_t(e,d)&&((h=_l(d))===d||!_t(e,h)))&&(c?t&&(t[d]!==void 0||t[h]!==void 0)&&(i[d]=T0(c,l,d,void 0,n,!0)):delete i[d]);if(r!==l)for(const d in r)(!e||!_t(e,d))&&(delete r[d],f=!0)}f&&vr(n.attrs,"set","")}function CT(n,e,t,s){const[i,r]=n.propsOptions;let o=!1,l;if(e)for(let c in e){if(tu(c))continue;const f=e[c];let h;i&&_t(i,h=ti(c))?!r||!r.includes(h)?t[h]=f:(l||(l={}))[h]=f:Zp(n.emitsOptions,c)||(!(c in s)||f!==s[c])&&(s[c]=f,o=!0)}if(r){const c=wt(t),f=l||Ot;for(let h=0;h<r.length;h++){const d=r[h];t[d]=T0(i,c,d,f[d],n,!_t(f,d))}}return o}function T0(n,e,t,s,i,r){const o=n[t];if(o!=null){const l=_t(o,"default");if(l&&s===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&Je(c)){const{propsDefaults:f}=i;if(t in f)s=f[t];else{const h=lf(i);s=f[t]=c.call(null,e),h()}}else s=c;i.ce&&i.ce._setProp(t,s)}o[0]&&(r&&!l?s=!1:o[1]&&(s===""||s===_l(t))&&(s=!0))}return s}const c4=new WeakMap;function AT(n,e,t=!1){const s=t?c4:e.propsCache,i=s.get(n);if(i)return i;const r=n.props,o={},l=[];let c=!1;if(!Je(n)){const h=d=>{c=!0;const[g,m]=AT(d,e,!0);Pn(o,g),m&&l.push(...m)};!t&&e.mixins.length&&e.mixins.forEach(h),n.extends&&h(n.extends),n.mixins&&n.mixins.forEach(h)}if(!r&&!c)return At(n)&&s.set(n,pa),pa;if(qe(r))for(let h=0;h<r.length;h++){const d=ti(r[h]);f_(d)&&(o[d]=Ot)}else if(r)for(const h in r){const d=ti(h);if(f_(d)){const g=r[h],m=o[d]=qe(g)||Je(g)?{type:g}:Pn({},g),y=m.type;let w=!1,x=!0;if(qe(y))for(let S=0;S<y.length;++S){const C=y[S],E=Je(C)&&C.name;if(E==="Boolean"){w=!0;break}else E==="String"&&(x=!1)}else w=Je(y)&&y.name==="Boolean";m[0]=w,m[1]=x,(w||_t(m,"default"))&&l.push(d)}}const f=[o,l];return At(n)&&s.set(n,f),f}function f_(n){return n[0]!=="$"&&!tu(n)}const Mv=n=>n==="_"||n==="_ctx"||n==="$stable",Dv=n=>qe(n)?n.map(Bi):[Bi(n)],u4=(n,e,t)=>{if(e._n)return e;const s=qs((...i)=>Dv(e(...i)),t);return s._c=!1,s},kT=(n,e,t)=>{const s=n._ctx;for(const i in n){if(Mv(i))continue;const r=n[i];if(Je(r))e[i]=u4(i,r,s);else if(r!=null){const o=Dv(r);e[i]=()=>o}}},TT=(n,e)=>{const t=Dv(e);n.slots.default=()=>t},OT=(n,e,t)=>{for(const s in e)(t||!Mv(s))&&(n[s]=e[s])},f4=(n,e,t)=>{const s=n.slots=_T();if(n.vnode.shapeFlag&32){const i=e._;i?(OT(s,e,t),t&&Wk(s,"_",i,!0)):kT(e,s)}else e&&TT(n,e)},h4=(n,e,t)=>{const{vnode:s,slots:i}=n;let r=!0,o=Ot;if(s.shapeFlag&32){const l=e._;l?t&&l===1?r=!1:OT(i,e,t):(r=!e.$stable,kT(e,i)),o=e}else e&&(TT(n,e),o={default:1});if(r)for(const l in i)!Mv(l)&&o[l]==null&&delete i[l]},As=b4;function d4(n){return p4(n)}function p4(n,e){const t=Gp();t.__VUE__=!0;const{insert:s,remove:i,patchProp:r,createElement:o,createText:l,createComment:c,setText:f,setElementText:h,parentNode:d,nextSibling:g,setScopeId:m=Ki,insertStaticContent:y}=n,w=(M,I,V,G=null,te=null,K=null,_e=void 0,xe=null,ve=!!I.dynamicChildren)=>{if(M===I)return;M&&!kc(M,I)&&(G=B(M),fe(M,te,K,!0),M=null),I.patchFlag===-2&&(ve=!1,I.dynamicChildren=null);const{type:re,ref:Be,shapeFlag:Ce}=I;switch(re){case em:x(M,I,V,G);break;case Dr:S(M,I,V,G);break;case ld:M==null&&C(I,V,G,_e);break;case gt:ne(M,I,V,G,te,K,_e,xe,ve);break;default:Ce&1?R(M,I,V,G,te,K,_e,xe,ve):Ce&6?pe(M,I,V,G,te,K,_e,xe,ve):(Ce&64||Ce&128)&&re.process(M,I,V,G,te,K,_e,xe,ve,Te)}Be!=null&&te?ru(Be,M&&M.ref,K,I||M,!I):Be==null&&M&&M.ref!=null&&ru(M.ref,null,K,M,!0)},x=(M,I,V,G)=>{if(M==null)s(I.el=l(I.children),V,G);else{const te=I.el=M.el;I.children!==M.children&&f(te,I.children)}},S=(M,I,V,G)=>{M==null?s(I.el=c(I.children||""),V,G):I.el=M.el},C=(M,I,V,G)=>{[M.el,M.anchor]=y(M.children,I,V,G,M.el,M.anchor)},E=({el:M,anchor:I},V,G)=>{let te;for(;M&&M!==I;)te=g(M),s(M,V,G),M=te;s(I,V,G)},k=({el:M,anchor:I})=>{let V;for(;M&&M!==I;)V=g(M),i(M),M=V;i(I)},R=(M,I,V,G,te,K,_e,xe,ve)=>{if(I.type==="svg"?_e="svg":I.type==="math"&&(_e="mathml"),M==null)T(I,V,G,te,K,_e,xe,ve);else{const re=M.el&&M.el._isVueCE?M.el:null;try{re&&re._beginPatch(),F(M,I,te,K,_e,xe,ve)}finally{re&&re._endPatch()}}},T=(M,I,V,G,te,K,_e,xe)=>{let ve,re;const{props:Be,shapeFlag:Ce,transition:Fe,dirs:Ve}=M;if(ve=M.el=o(M.type,K,Be&&Be.is,Be),Ce&8?h(ve,M.children):Ce&16&&N(M.children,ve,null,G,te,Zg(M,K),_e,xe),Ve&&qo(M,null,G,"created"),L(ve,M,M.scopeId,_e,G),Be){for(const ht in Be)ht!=="value"&&!tu(ht)&&r(ve,ht,null,Be[ht],K,G);"value"in Be&&r(ve,"value",null,Be.value,K),(re=Be.onVnodeBeforeMount)&&Mi(re,G,M)}Ve&&qo(M,null,G,"beforeMount");const rt=m4(te,Fe);rt&&Fe.beforeEnter(ve),s(ve,I,V),((re=Be&&Be.onVnodeMounted)||rt||Ve)&&As(()=>{re&&Mi(re,G,M),rt&&Fe.enter(ve),Ve&&qo(M,null,G,"mounted")},te)},L=(M,I,V,G,te)=>{if(V&&m(M,V),G)for(let K=0;K<G.length;K++)m(M,G[K]);if(te){let K=te.subTree;if(I===K||LT(K.type)&&(K.ssContent===I||K.ssFallback===I)){const _e=te.vnode;L(M,_e,_e.scopeId,_e.slotScopeIds,te.parent)}}},N=(M,I,V,G,te,K,_e,xe,ve=0)=>{for(let re=ve;re<M.length;re++){const Be=M[re]=xe?io(M[re]):Bi(M[re]);w(null,Be,I,V,G,te,K,_e,xe)}},F=(M,I,V,G,te,K,_e)=>{const xe=I.el=M.el;let{patchFlag:ve,dynamicChildren:re,dirs:Be}=I;ve|=M.patchFlag&16;const Ce=M.props||Ot,Fe=I.props||Ot;let Ve;if(V&&Ko(V,!1),(Ve=Fe.onVnodeBeforeUpdate)&&Mi(Ve,V,I,M),Be&&qo(I,M,V,"beforeUpdate"),V&&Ko(V,!0),(Ce.innerHTML&&Fe.innerHTML==null||Ce.textContent&&Fe.textContent==null)&&h(xe,""),re?ee(M.dynamicChildren,re,xe,V,G,Zg(I,te),K):_e||H(M,I,xe,null,V,G,Zg(I,te),K,!1),ve>0){if(ve&16)ce(xe,Ce,Fe,V,te);else if(ve&2&&Ce.class!==Fe.class&&r(xe,"class",null,Fe.class,te),ve&4&&r(xe,"style",Ce.style,Fe.style,te),ve&8){const rt=I.dynamicProps;for(let ht=0;ht<rt.length;ht++){const ot=rt[ht],fn=Ce[ot],hn=Fe[ot];(hn!==fn||ot==="value")&&r(xe,ot,fn,hn,te,V)}}ve&1&&M.children!==I.children&&h(xe,I.children)}else!_e&&re==null&&ce(xe,Ce,Fe,V,te);((Ve=Fe.onVnodeUpdated)||Be)&&As(()=>{Ve&&Mi(Ve,V,I,M),Be&&qo(I,M,V,"updated")},G)},ee=(M,I,V,G,te,K,_e)=>{for(let xe=0;xe<I.length;xe++){const ve=M[xe],re=I[xe],Be=ve.el&&(ve.type===gt||!kc(ve,re)||ve.shapeFlag&198)?d(ve.el):V;w(ve,re,Be,null,G,te,K,_e,!0)}},ce=(M,I,V,G,te)=>{if(I!==V){if(I!==Ot)for(const K in I)!tu(K)&&!(K in V)&&r(M,K,I[K],null,te,G);for(const K in V){if(tu(K))continue;const _e=V[K],xe=I[K];_e!==xe&&K!=="value"&&r(M,K,xe,_e,te,G)}"value"in V&&r(M,"value",I.value,V.value,te)}},ne=(M,I,V,G,te,K,_e,xe,ve)=>{const re=I.el=M?M.el:l(""),Be=I.anchor=M?M.anchor:l("");let{patchFlag:Ce,dynamicChildren:Fe,slotScopeIds:Ve}=I;Ve&&(xe=xe?xe.concat(Ve):Ve),M==null?(s(re,V,G),s(Be,V,G),N(I.children||[],V,Be,te,K,_e,xe,ve)):Ce>0&&Ce&64&&Fe&&M.dynamicChildren&&M.dynamicChildren.length===Fe.length?(ee(M.dynamicChildren,Fe,V,te,K,_e,xe),(I.key!=null||te&&I===te.subTree)&&RT(M,I,!0)):H(M,I,V,Be,te,K,_e,xe,ve)},pe=(M,I,V,G,te,K,_e,xe,ve)=>{I.slotScopeIds=xe,M==null?I.shapeFlag&512?te.ctx.activate(I,V,G,_e,ve):Y(I,V,G,te,K,_e,ve):q(M,I,ve)},Y=(M,I,V,G,te,K,_e)=>{const xe=M.component=E4(M,G,te);if(mT(M)&&(xe.ctx.renderer=Te),A4(xe,!1,_e),xe.asyncDep){if(te&&te.registerDep(xe,J,_e),!M.el){const ve=xe.subTree=mt(Dr);S(null,ve,I,V),M.placeholder=ve.el}}else J(xe,M,I,V,te,K,_e)},q=(M,I,V)=>{const G=I.component=M.component;if(r4(M,I,V))if(G.asyncDep&&!G.asyncResolved){Se(G,I,V);return}else G.next=I,G.update();else I.el=M.el,G.vnode=I},J=(M,I,V,G,te,K,_e)=>{const xe=()=>{if(M.isMounted){let{next:Ce,bu:Fe,u:Ve,parent:rt,vnode:ht}=M;{const es=MT(M);if(es){Ce&&(Ce.el=ht.el,Se(M,Ce,_e)),es.asyncDep.then(()=>{M.isUnmounted||xe()});return}}let ot=Ce,fn;Ko(M,!1),Ce?(Ce.el=ht.el,Se(M,Ce,_e)):Ce=ht,Fe&&od(Fe),(fn=Ce.props&&Ce.props.onVnodeBeforeUpdate)&&Mi(fn,rt,Ce,ht),Ko(M,!0);const hn=c_(M),Zn=M.subTree;M.subTree=hn,w(Zn,hn,d(Zn.el),B(Zn),M,te,K),Ce.el=hn.el,ot===null&&o4(M,hn.el),Ve&&As(Ve,te),(fn=Ce.props&&Ce.props.onVnodeUpdated)&&As(()=>Mi(fn,rt,Ce,ht),te)}else{let Ce;const{el:Fe,props:Ve}=I,{bm:rt,m:ht,parent:ot,root:fn,type:hn}=M,Zn=ba(I);Ko(M,!1),rt&&od(rt),!Zn&&(Ce=Ve&&Ve.onVnodeBeforeMount)&&Mi(Ce,ot,I),Ko(M,!0);{fn.ce&&fn.ce._def.shadowRoot!==!1&&fn.ce._injectChildStyle(hn);const es=M.subTree=c_(M);w(null,es,V,G,M,te,K),I.el=es.el}if(ht&&As(ht,te),!Zn&&(Ce=Ve&&Ve.onVnodeMounted)){const es=I;As(()=>Mi(Ce,ot,es),te)}(I.shapeFlag&256||ot&&ba(ot.vnode)&&ot.vnode.shapeFlag&256)&&M.a&&As(M.a,te),M.isMounted=!0,I=V=G=null}};M.scope.on();const ve=M.effect=new qk(xe);M.scope.off();const re=M.update=ve.run.bind(ve),Be=M.job=ve.runIfDirty.bind(ve);Be.i=M,Be.id=M.uid,ve.scheduler=()=>kv(Be),Ko(M,!0),re()},Se=(M,I,V)=>{I.component=M;const G=M.vnode.props;M.vnode=I,M.next=null,a4(M,I.props,G,V),h4(M,I.children,V),Or(),n_(M),Rr()},H=(M,I,V,G,te,K,_e,xe,ve=!1)=>{const re=M&&M.children,Be=M?M.shapeFlag:0,Ce=I.children,{patchFlag:Fe,shapeFlag:Ve}=I;if(Fe>0){if(Fe&128){Z(re,Ce,V,G,te,K,_e,xe,ve);return}else if(Fe&256){ge(re,Ce,V,G,te,K,_e,xe,ve);return}}Ve&8?(Be&16&&Ne(re,te,K),Ce!==re&&h(V,Ce)):Be&16?Ve&16?Z(re,Ce,V,G,te,K,_e,xe,ve):Ne(re,te,K,!0):(Be&8&&h(V,""),Ve&16&&N(Ce,V,G,te,K,_e,xe,ve))},ge=(M,I,V,G,te,K,_e,xe,ve)=>{M=M||pa,I=I||pa;const re=M.length,Be=I.length,Ce=Math.min(re,Be);let Fe;for(Fe=0;Fe<Ce;Fe++){const Ve=I[Fe]=ve?io(I[Fe]):Bi(I[Fe]);w(M[Fe],Ve,V,null,te,K,_e,xe,ve)}re>Be?Ne(M,te,K,!0,!1,Ce):N(I,V,G,te,K,_e,xe,ve,Ce)},Z=(M,I,V,G,te,K,_e,xe,ve)=>{let re=0;const Be=I.length;let Ce=M.length-1,Fe=Be-1;for(;re<=Ce&&re<=Fe;){const Ve=M[re],rt=I[re]=ve?io(I[re]):Bi(I[re]);if(kc(Ve,rt))w(Ve,rt,V,null,te,K,_e,xe,ve);else break;re++}for(;re<=Ce&&re<=Fe;){const Ve=M[Ce],rt=I[Fe]=ve?io(I[Fe]):Bi(I[Fe]);if(kc(Ve,rt))w(Ve,rt,V,null,te,K,_e,xe,ve);else break;Ce--,Fe--}if(re>Ce){if(re<=Fe){const Ve=Fe+1,rt=Ve<Be?I[Ve].el:G;for(;re<=Fe;)w(null,I[re]=ve?io(I[re]):Bi(I[re]),V,rt,te,K,_e,xe,ve),re++}}else if(re>Fe)for(;re<=Ce;)fe(M[re],te,K,!0),re++;else{const Ve=re,rt=re,ht=new Map;for(re=rt;re<=Fe;re++){const yn=I[re]=ve?io(I[re]):Bi(I[re]);yn.key!=null&&ht.set(yn.key,re)}let ot,fn=0;const hn=Fe-rt+1;let Zn=!1,es=0;const nr=new Array(hn);for(re=0;re<hn;re++)nr[re]=0;for(re=Ve;re<=Ce;re++){const yn=M[re];if(fn>=hn){fe(yn,te,K,!0);continue}let ts;if(yn.key!=null)ts=ht.get(yn.key);else for(ot=rt;ot<=Fe;ot++)if(nr[ot-rt]===0&&kc(yn,I[ot])){ts=ot;break}ts===void 0?fe(yn,te,K,!0):(nr[ts-rt]=re+1,ts>=es?es=ts:Zn=!0,w(yn,I[ts],V,null,te,K,_e,xe,ve),fn++)}const Ol=Zn?g4(nr):pa;for(ot=Ol.length-1,re=hn-1;re>=0;re--){const yn=rt+re,ts=I[yn],Rl=I[yn+1],xf=yn+1<Be?Rl.el||DT(Rl):G;nr[re]===0?w(null,ts,V,xf,te,K,_e,xe,ve):Zn&&(ot<0||re!==Ol[ot]?X(ts,V,xf,2):ot--)}}},X=(M,I,V,G,te=null)=>{const{el:K,type:_e,transition:xe,children:ve,shapeFlag:re}=M;if(re&6){X(M.component.subTree,I,V,G);return}if(re&128){M.suspense.move(I,V,G);return}if(re&64){_e.move(M,I,V,Te);return}if(_e===gt){s(K,I,V);for(let Ce=0;Ce<ve.length;Ce++)X(ve[Ce],I,V,G);s(M.anchor,I,V);return}if(_e===ld){E(M,I,V);return}if(G!==2&&re&1&&xe)if(G===0)xe.beforeEnter(K),s(K,I,V),As(()=>xe.enter(K),te);else{const{leave:Ce,delayLeave:Fe,afterLeave:Ve}=xe,rt=()=>{M.ctx.isUnmounted?i(K):s(K,I,V)},ht=()=>{K._isLeaving&&K[MW](!0),Ce(K,()=>{rt(),Ve&&Ve()})};Fe?Fe(K,rt,ht):ht()}else s(K,I,V)},fe=(M,I,V,G=!1,te=!1)=>{const{type:K,props:_e,ref:xe,children:ve,dynamicChildren:re,shapeFlag:Be,patchFlag:Ce,dirs:Fe,cacheIndex:Ve}=M;if(Ce===-2&&(te=!1),xe!=null&&(Or(),ru(xe,null,V,M,!0),Rr()),Ve!=null&&(I.renderCache[Ve]=void 0),Be&256){I.ctx.deactivate(M);return}const rt=Be&1&&Fe,ht=!ba(M);let ot;if(ht&&(ot=_e&&_e.onVnodeBeforeUnmount)&&Mi(ot,I,M),Be&6)be(M.component,V,G);else{if(Be&128){M.suspense.unmount(V,G);return}rt&&qo(M,null,I,"beforeUnmount"),Be&64?M.type.remove(M,I,V,Te,G):re&&!re.hasOnce&&(K!==gt||Ce>0&&Ce&64)?Ne(re,I,V,!1,!0):(K===gt&&Ce&384||!te&&Be&16)&&Ne(ve,I,V),G&&we(M)}(ht&&(ot=_e&&_e.onVnodeUnmounted)||rt)&&As(()=>{ot&&Mi(ot,I,M),rt&&qo(M,null,I,"unmounted")},V)},we=M=>{const{type:I,el:V,anchor:G,transition:te}=M;if(I===gt){ae(V,G);return}if(I===ld){k(M);return}const K=()=>{i(V),te&&!te.persisted&&te.afterLeave&&te.afterLeave()};if(M.shapeFlag&1&&te&&!te.persisted){const{leave:_e,delayLeave:xe}=te,ve=()=>_e(V,K);xe?xe(M.el,K,ve):ve()}else K()},ae=(M,I)=>{let V;for(;M!==I;)V=g(M),i(M),M=V;i(I)},be=(M,I,V)=>{const{bum:G,scope:te,job:K,subTree:_e,um:xe,m:ve,a:re}=M;h_(ve),h_(re),G&&od(G),te.stop(),K&&(K.flags|=8,fe(_e,M,I,V)),xe&&As(xe,I),As(()=>{M.isUnmounted=!0},I)},Ne=(M,I,V,G=!1,te=!1,K=0)=>{for(let _e=K;_e<M.length;_e++)fe(M[_e],I,V,G,te)},B=M=>{if(M.shapeFlag&6)return B(M.component.subTree);if(M.shapeFlag&128)return M.suspense.next();const I=g(M.anchor||M.el),V=I&&I[OW];return V?g(V):I};let se=!1;const he=(M,I,V)=>{let G;M==null?I._vnode&&(fe(I._vnode,null,null,!0),G=I._vnode.component):w(I._vnode||null,M,I,null,null,null,V),I._vnode=M,se||(se=!0,n_(G),uT(),se=!1)},Te={p:w,um:fe,m:X,r:we,mt:Y,mc:N,pc:H,pbc:ee,n:B,o:n};return{render:he,hydrate:void 0,createApp:ZW(he)}}function Zg({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function Ko({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function m4(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function RT(n,e,t=!1){const s=n.children,i=e.children;if(qe(s)&&qe(i))for(let r=0;r<s.length;r++){const o=s[r];let l=i[r];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=i[r]=io(i[r]),l.el=o.el),!t&&l.patchFlag!==-2&&RT(o,l)),l.type===em&&(l.patchFlag!==-1?l.el=o.el:l.__elIndex=r+(n.type===gt?1:0)),l.type===Dr&&!l.el&&(l.el=o.el)}}function g4(n){const e=n.slice(),t=[0];let s,i,r,o,l;const c=n.length;for(s=0;s<c;s++){const f=n[s];if(f!==0){if(i=t[t.length-1],n[i]<f){e[s]=i,t.push(s);continue}for(r=0,o=t.length-1;r<o;)l=r+o>>1,n[t[l]]<f?r=l+1:o=l;f<n[t[r]]&&(r>0&&(e[s]=t[r-1]),t[r]=s)}}for(r=t.length,o=t[r-1];r-- >0;)t[r]=o,o=e[o];return t}function MT(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:MT(e)}function h_(n){if(n)for(let e=0;e<n.length;e++)n[e].flags|=8}function DT(n){if(n.placeholder)return n.placeholder;const e=n.component;return e?DT(e.subTree):null}const LT=n=>n.__isSuspense;function b4(n,e){e&&e.pendingBranch?qe(n)?e.effects.push(...n):e.effects.push(n):CW(n)}const gt=Symbol.for("v-fgt"),em=Symbol.for("v-txt"),Dr=Symbol.for("v-cmt"),ld=Symbol.for("v-stc"),lu=[];let Rs=null;function ue(n=!1){lu.push(Rs=n?null:[])}function y4(){lu.pop(),Rs=lu[lu.length-1]||null}let Cu=1;function Vd(n,e=!1){Cu+=n,n<0&&Rs&&e&&(Rs.hasOnce=!0)}function NT(n){return n.dynamicChildren=Cu>0?Rs||pa:null,y4(),Cu>0&&Rs&&Rs.push(n),n}function ye(n,e,t,s,i,r){return NT(b(n,e,t,s,i,r,!0))}function So(n,e,t,s,i){return NT(mt(n,e,t,s,i,!0))}function Au(n){return n?n.__v_isVNode===!0:!1}function kc(n,e){return n.type===e.type&&n.key===e.key}const IT=({key:n})=>n??null,ad=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?nn(n)||cn(n)||Je(n)?{i:En,r:n,k:e,f:!!t}:n:null);function b(n,e=null,t=null,s=0,i=null,r=n===gt?0:1,o=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&IT(e),ref:e&&ad(e),scopeId:hT,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:En};return l?(Lv(c,t),r&128&&n.normalize(c)):t&&(c.shapeFlag|=nn(t)?8:16),Cu>0&&!o&&Rs&&(c.patchFlag>0||r&6)&&c.patchFlag!==32&&Rs.push(c),c}const mt=v4;function v4(n,e=null,t=null,s=0,i=null,r=!1){if((!n||n===UW)&&(n=Dr),Au(n)){const l=Na(n,e,!0);return t&&Lv(l,t),Cu>0&&!r&&Rs&&(l.shapeFlag&6?Rs[Rs.indexOf(n)]=l:Rs.push(l)),l.patchFlag=-2,l}if(M4(n)&&(n=n.__vccOpts),e){e=w4(e);let{class:l,style:c}=e;l&&!nn(l)&&(e.class=Pt(l)),At(c)&&(Xp(c)&&!qe(c)&&(c=Pn({},c)),e.style=Hi(c))}const o=nn(n)?1:LT(n)?128:RW(n)?64:At(n)?4:Je(n)?2:0;return b(n,e,t,s,i,o,r,!0)}function w4(n){return n?Xp(n)||ET(n)?Pn({},n):n:null}function Na(n,e,t=!1,s=!1){const{props:i,ref:r,patchFlag:o,children:l,transition:c}=n,f=e?S4(i||{},e):i,h={__v_isVNode:!0,__v_skip:!0,type:n.type,props:f,key:f&&IT(f),ref:e&&e.ref?t&&r?qe(r)?r.concat(ad(e)):[r,ad(e)]:ad(e):r,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:l,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==gt?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:c,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Na(n.ssContent),ssFallback:n.ssFallback&&Na(n.ssFallback),placeholder:n.placeholder,el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return c&&s&&Ov(h,c.clone(h)),h}function Ie(n=" ",e=0){return mt(em,null,n,e)}function Wd(n,e){const t=mt(ld,null,n);return t.staticCount=e,t}function st(n="",e=!1){return e?(ue(),So(Dr,null,n)):mt(Dr,null,n)}function Bi(n){return n==null||typeof n=="boolean"?mt(Dr):qe(n)?mt(gt,null,n.slice()):Au(n)?io(n):mt(em,null,String(n))}function io(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:Na(n)}function Lv(n,e){let t=0;const{shapeFlag:s}=n;if(e==null)e=null;else if(qe(e))t=16;else if(typeof e=="object")if(s&65){const i=e.default;i&&(i._c&&(i._d=!1),Lv(n,i()),i._c&&(i._d=!0));return}else{t=32;const i=e._;!i&&!ET(e)?e._ctx=En:i===3&&En&&(En.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else Je(e)?(e={default:e,_ctx:En},t=32):(e=String(e),s&64?(t=16,e=[Ie(e)]):t=8);n.children=e,n.shapeFlag|=t}function S4(...n){const e={};for(let t=0;t<n.length;t++){const s=n[t];for(const i in s)if(i==="class")e.class!==s.class&&(e.class=Pt([e.class,s.class]));else if(i==="style")e.style=Hi([e.style,s.style]);else if(Up(i)){const r=e[i],o=s[i];o&&r!==o&&!(qe(r)&&r.includes(o))&&(e[i]=r?[].concat(r,o):o)}else i!==""&&(e[i]=s[i])}return e}function Mi(n,e,t,s=null){Xi(n,e,7,[t,s])}const x4=wT();let _4=0;function E4(n,e,t){const s=n.type,i=(e?e.appContext:n.appContext)||x4,r={uid:_4++,vnode:n,type:s,parent:e,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new z5(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(i.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:AT(s,i),emitsOptions:ST(s,i),emit:null,emitted:null,propsDefaults:Ot,inheritAttrs:s.inheritAttrs,ctx:Ot,data:Ot,props:Ot,attrs:Ot,slots:Ot,refs:Ot,setupState:Ot,setupContext:null,suspense:t,suspenseId:t?t.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return r.ctx={_:r},r.root=e?e.root:r,r.emit=t4.bind(null,r),n.ce&&n.ce(r),r}let Ln=null;const C4=()=>Ln||En;let Hd,O0;{const n=Gp(),e=(t,s)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(s),r=>{i.length>1?i.forEach(o=>o(r)):i[0](r)}};Hd=e("__VUE_INSTANCE_SETTERS__",t=>Ln=t),O0=e("__VUE_SSR_SETTERS__",t=>ku=t)}const lf=n=>{const e=Ln;return Hd(n),n.scope.on(),()=>{n.scope.off(),Hd(e)}},d_=()=>{Ln&&Ln.scope.off(),Hd(null)};function PT(n){return n.vnode.shapeFlag&4}let ku=!1;function A4(n,e=!1,t=!1){e&&O0(e);const{props:s,children:i}=n.vnode,r=PT(n);l4(n,s,r,e),f4(n,i,t||e);const o=r?k4(n,e):void 0;return e&&O0(!1),o}function k4(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,KW);const{setup:s}=t;if(s){Or();const i=n.setupContext=s.length>1?O4(n):null,r=lf(n),o=rf(s,n,0,[n.props,i]),l=Bk(o);if(Rr(),r(),(l||n.sp)&&!ba(n)&&pT(n),l){if(o.then(d_,d_),e)return o.then(c=>{p_(n,c)}).catch(c=>{Qp(c,n,0)});n.asyncDep=o}else p_(n,o)}else $T(n)}function p_(n,e,t){Je(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:At(e)&&(n.setupState=lT(e)),$T(n)}function $T(n,e,t){const s=n.type;n.render||(n.render=s.render||Ki);{const i=lf(n);Or();try{jW(n)}finally{Rr(),i()}}}const T4={get(n,e){return Mn(n,"get",""),n[e]}};function O4(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,T4),slots:n.slots,emit:n.emit,expose:e}}function tm(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(lT(fW(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in ou)return ou[t](n)},has(e,t){return t in e||t in ou}})):n.proxy}function R4(n,e=!0){return Je(n)?n.displayName||n.name:n.name||e&&n.__name}function M4(n){return Je(n)&&"__vccOpts"in n}const at=(n,e)=>wW(n,e,ku);function BT(n,e,t){try{Vd(-1);const s=arguments.length;return s===2?At(e)&&!qe(e)?Au(e)?mt(n,null,[e]):mt(n,e):mt(n,null,e):(s>3?t=Array.prototype.slice.call(arguments,2):s===3&&Au(t)&&(t=[t]),mt(n,e,t))}finally{Vd(1)}}const D4="3.5.26";let R0;const m_=typeof window<"u"&&window.trustedTypes;if(m_)try{R0=m_.createPolicy("vue",{createHTML:n=>n})}catch{}const FT=R0?n=>R0.createHTML(n):n=>n,L4="http://www.w3.org/2000/svg",N4="http://www.w3.org/1998/Math/MathML",gr=typeof document<"u"?document:null,g_=gr&&gr.createElement("template"),I4={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,s)=>{const i=e==="svg"?gr.createElementNS(L4,n):e==="mathml"?gr.createElementNS(N4,n):t?gr.createElement(n,{is:t}):gr.createElement(n);return n==="select"&&s&&s.multiple!=null&&i.setAttribute("multiple",s.multiple),i},createText:n=>gr.createTextNode(n),createComment:n=>gr.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>gr.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,s,i,r){const o=t?t.previousSibling:e.lastChild;if(i&&(i===r||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),t),!(i===r||!(i=i.nextSibling)););else{g_.innerHTML=FT(s==="svg"?`<svg>${n}</svg>`:s==="mathml"?`<math>${n}</math>`:n);const l=g_.content;if(s==="svg"||s==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}e.insertBefore(l,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},P4=Symbol("_vtc");function $4(n,e,t){const s=n[P4];s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const Ud=Symbol("_vod"),VT=Symbol("_vsh"),Qr={name:"show",beforeMount(n,{value:e},{transition:t}){n[Ud]=n.style.display==="none"?"":n.style.display,t&&e?t.beforeEnter(n):Tc(n,e)},mounted(n,{value:e},{transition:t}){t&&e&&t.enter(n)},updated(n,{value:e,oldValue:t},{transition:s}){!e!=!t&&(s?e?(s.beforeEnter(n),Tc(n,!0),s.enter(n)):s.leave(n,()=>{Tc(n,!1)}):Tc(n,e))},beforeUnmount(n,{value:e}){Tc(n,e)}};function Tc(n,e){n.style.display=e?n[Ud]:"none",n[VT]=!e}const B4=Symbol(""),F4=/(?:^|;)\s*display\s*:/;function V4(n,e,t){const s=n.style,i=nn(t);let r=!1;if(t&&!i){if(e)if(nn(e))for(const o of e.split(";")){const l=o.slice(0,o.indexOf(":")).trim();t[l]==null&&cd(s,l,"")}else for(const o in e)t[o]==null&&cd(s,o,"");for(const o in t)o==="display"&&(r=!0),cd(s,o,t[o])}else if(i){if(e!==t){const o=s[B4];o&&(t+=";"+o),s.cssText=t,r=F4.test(t)}}else e&&n.removeAttribute("style");Ud in n&&(n[Ud]=r?s.display:"",n[VT]&&(s.display="none"))}const b_=/\s*!important$/;function cd(n,e,t){if(qe(t))t.forEach(s=>cd(n,e,s));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const s=W4(n,e);b_.test(t)?n.setProperty(_l(s),t.replace(b_,""),"important"):n[s]=t}}const y_=["Webkit","Moz","ms"],eb={};function W4(n,e){const t=eb[e];if(t)return t;let s=ti(e);if(s!=="filter"&&s in n)return eb[e]=s;s=Kp(s);for(let i=0;i<y_.length;i++){const r=y_[i]+s;if(r in n)return eb[e]=r}return e}const v_="http://www.w3.org/1999/xlink";function w_(n,e,t,s,i,r=H5(e)){s&&e.startsWith("xlink:")?t==null?n.removeAttributeNS(v_,e.slice(6,e.length)):n.setAttributeNS(v_,e,t):t==null||r&&!Hk(t)?n.removeAttribute(e):n.setAttribute(e,r?"":mi(t)?String(t):t)}function S_(n,e,t,s,i){if(e==="innerHTML"||e==="textContent"){t!=null&&(n[e]=e==="innerHTML"?FT(t):t);return}const r=n.tagName;if(e==="value"&&r!=="PROGRESS"&&!r.includes("-")){const l=r==="OPTION"?n.getAttribute("value")||"":n.value,c=t==null?n.type==="checkbox"?"on":"":String(t);(l!==c||!("_value"in n))&&(n.value=c),t==null&&n.removeAttribute(e),n._value=t;return}let o=!1;if(t===""||t==null){const l=typeof n[e];l==="boolean"?t=Hk(t):t==null&&l==="string"?(t="",o=!0):l==="number"&&(t=0,o=!0)}try{n[e]=t}catch{}o&&n.removeAttribute(i||e)}function co(n,e,t,s){n.addEventListener(e,t,s)}function H4(n,e,t,s){n.removeEventListener(e,t,s)}const x_=Symbol("_vei");function U4(n,e,t,s,i=null){const r=n[x_]||(n[x_]={}),o=r[e];if(s&&o)o.value=s;else{const[l,c]=z4(e);if(s){const f=r[e]=j4(s,i);co(n,l,f,c)}else o&&(H4(n,l,o,c),r[e]=void 0)}}const __=/(?:Once|Passive|Capture)$/;function z4(n){let e;if(__.test(n)){e={};let s;for(;s=n.match(__);)n=n.slice(0,n.length-s[0].length),e[s[0].toLowerCase()]=!0}return[n[2]===":"?n.slice(3):_l(n.slice(2)),e]}let tb=0;const q4=Promise.resolve(),K4=()=>tb||(q4.then(()=>tb=0),tb=Date.now());function j4(n,e){const t=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=t.attached)return;Xi(G4(s,t.value),e,5,[s])};return t.value=n,t.attached=K4(),t}function G4(n,e){if(qe(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(s=>i=>!i._stopped&&s&&s(i))}else return e}const E_=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,Y4=(n,e,t,s,i,r)=>{const o=i==="svg";e==="class"?$4(n,s,o):e==="style"?V4(n,t,s):Up(e)?yv(e)||U4(n,e,t,s,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):X4(n,e,s,o))?(S_(n,e,s),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&w_(n,e,s,o,r,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!nn(s))?S_(n,ti(e),s,r,e):(e==="true-value"?n._trueValue=s:e==="false-value"&&(n._falseValue=s),w_(n,e,s,o))};function X4(n,e,t,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in n&&E_(e)&&Je(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&n.tagName==="IFRAME"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=n.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return E_(e)&&nn(t)?!1:e in n}const Ia=n=>{const e=n.props["onUpdate:modelValue"]||!1;return qe(e)?t=>od(e,t):e};function Q4(n){n.target.composing=!0}function C_(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const _r=Symbol("_assign");function A_(n,e,t){return e&&(n=n.trim()),t&&(n=jp(n)),n}const Rt={created(n,{modifiers:{lazy:e,trim:t,number:s}},i){n[_r]=Ia(i);const r=s||i.props&&i.props.type==="number";co(n,e?"change":"input",o=>{o.target.composing||n[_r](A_(n.value,t,r))}),(t||r)&&co(n,"change",()=>{n.value=A_(n.value,t,r)}),e||(co(n,"compositionstart",Q4),co(n,"compositionend",C_),co(n,"change",C_))},mounted(n,{value:e}){n.value=e??""},beforeUpdate(n,{value:e,oldValue:t,modifiers:{lazy:s,trim:i,number:r}},o){if(n[_r]=Ia(o),n.composing)return;const l=(r||n.type==="number")&&!/^0\d/.test(n.value)?jp(n.value):n.value,c=e??"";l!==c&&(document.activeElement===n&&n.type!=="range"&&(s&&e===t||i&&n.value.trim()===c)||(n.value=c))}},WT={deep:!0,created(n,e,t){n[_r]=Ia(t),co(n,"change",()=>{const s=n._modelValue,i=Tu(n),r=n.checked,o=n[_r];if(qe(s)){const l=wv(s,i),c=l!==-1;if(r&&!c)o(s.concat(i));else if(!r&&c){const f=[...s];f.splice(l,1),o(f)}}else if(nc(s)){const l=new Set(s);r?l.add(i):l.delete(i),o(l)}else o(HT(n,r))})},mounted:k_,beforeUpdate(n,e,t){n[_r]=Ia(t),k_(n,e,t)}};function k_(n,{value:e,oldValue:t},s){n._modelValue=e;let i;if(qe(e))i=wv(e,s.props.value)>-1;else if(nc(e))i=e.has(s.props.value);else{if(e===t)return;i=sf(e,HT(n,!0))}n.checked!==i&&(n.checked=i)}const Fi={deep:!0,created(n,{value:e,modifiers:{number:t}},s){const i=nc(e);co(n,"change",()=>{const r=Array.prototype.filter.call(n.options,o=>o.selected).map(o=>t?jp(Tu(o)):Tu(o));n[_r](n.multiple?i?new Set(r):r:r[0]),n._assigning=!0,_u(()=>{n._assigning=!1})}),n[_r]=Ia(s)},mounted(n,{value:e}){T_(n,e)},beforeUpdate(n,e,t){n[_r]=Ia(t)},updated(n,{value:e}){n._assigning||T_(n,e)}};function T_(n,e){const t=n.multiple,s=qe(e);if(!(t&&!s&&!nc(e))){for(let i=0,r=n.options.length;i<r;i++){const o=n.options[i],l=Tu(o);if(t)if(s){const c=typeof l;c==="string"||c==="number"?o.selected=e.some(f=>String(f)===String(l)):o.selected=wv(e,l)>-1}else o.selected=e.has(l);else if(sf(Tu(o),e)){n.selectedIndex!==i&&(n.selectedIndex=i);return}}!t&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function Tu(n){return"_value"in n?n._value:n.value}function HT(n,e){const t=e?"_trueValue":"_falseValue";return t in n?n[t]:e}const J4=["ctrl","shift","alt","meta"],Z4={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>J4.some(t=>n[`${t}Key`]&&!e.includes(t))},Qs=(n,e)=>{const t=n._withMods||(n._withMods={}),s=e.join(".");return t[s]||(t[s]=((i,...r)=>{for(let o=0;o<e.length;o++){const l=Z4[e[o]];if(l&&l(i,e))return}return n(i,...r)}))},eH=Pn({patchProp:Y4},I4);let O_;function tH(){return O_||(O_=d4(eH))}const nH=((...n)=>{const e=tH().createApp(...n),{mount:t}=e;return e.mount=s=>{const i=iH(s);if(!i)return;const r=e._component;!Je(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=t(i,!1,sH(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e});function sH(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function iH(n){return nn(n)?document.querySelector(n):n}var mh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},qc={exports:{}};var rH=qc.exports,R_;function oH(){return R_||(R_=1,(function(n,e){(function(){var t,s="4.17.21",i=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",l="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",f=500,h="__lodash_placeholder__",d=1,g=2,m=4,y=1,w=2,x=1,S=2,C=4,E=8,k=16,R=32,T=64,L=128,N=256,F=512,ee=30,ce="...",ne=800,pe=16,Y=1,q=2,J=3,Se=1/0,H=9007199254740991,ge=17976931348623157e292,Z=NaN,X=4294967295,fe=X-1,we=X>>>1,ae=[["ary",L],["bind",x],["bindKey",S],["curry",E],["curryRight",k],["flip",F],["partial",R],["partialRight",T],["rearg",N]],be="[object Arguments]",Ne="[object Array]",B="[object AsyncFunction]",se="[object Boolean]",he="[object Date]",Te="[object DOMException]",Ke="[object Error]",M="[object Function]",I="[object GeneratorFunction]",V="[object Map]",G="[object Number]",te="[object Null]",K="[object Object]",_e="[object Promise]",xe="[object Proxy]",ve="[object RegExp]",re="[object Set]",Be="[object String]",Ce="[object Symbol]",Fe="[object Undefined]",Ve="[object WeakMap]",rt="[object WeakSet]",ht="[object ArrayBuffer]",ot="[object DataView]",fn="[object Float32Array]",hn="[object Float64Array]",Zn="[object Int8Array]",es="[object Int16Array]",nr="[object Int32Array]",Ol="[object Uint8Array]",yn="[object Uint8ClampedArray]",ts="[object Uint16Array]",Rl="[object Uint32Array]",xf=/\b__p \+= '';/g,AL=/\b(__p \+=) '' \+/g,kL=/(__e\(.*?\)|\b__t\)) \+\n'';/g,l1=/&(?:amp|lt|gt|quot|#39);/g,a1=/[&<>"']/g,TL=RegExp(l1.source),OL=RegExp(a1.source),RL=/<%-([\s\S]+?)%>/g,ML=/<%([\s\S]+?)%>/g,c1=/<%=([\s\S]+?)%>/g,DL=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,LL=/^\w*$/,NL=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dm=/[\\^$.*+?()[\]{}|]/g,IL=RegExp(Dm.source),Lm=/^\s+/,PL=/\s/,$L=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,BL=/\{\n\/\* \[wrapped with (.+)\] \*/,FL=/,? & /,VL=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,WL=/[()=,{}\[\]\/\s]/,HL=/\\(\\)?/g,UL=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,u1=/\w*$/,zL=/^[-+]0x[0-9a-f]+$/i,qL=/^0b[01]+$/i,KL=/^\[object .+?Constructor\]$/,jL=/^0o[0-7]+$/i,GL=/^(?:0|[1-9]\d*)$/,YL=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_f=/($^)/,XL=/['\n\r\u2028\u2029\\]/g,Ef="\\ud800-\\udfff",QL="\\u0300-\\u036f",JL="\\ufe20-\\ufe2f",ZL="\\u20d0-\\u20ff",f1=QL+JL+ZL,h1="\\u2700-\\u27bf",d1="a-z\\xdf-\\xf6\\xf8-\\xff",eN="\\xac\\xb1\\xd7\\xf7",tN="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",nN="\\u2000-\\u206f",sN=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",p1="A-Z\\xc0-\\xd6\\xd8-\\xde",m1="\\ufe0e\\ufe0f",g1=eN+tN+nN+sN,Nm="['’]",iN="["+Ef+"]",b1="["+g1+"]",Cf="["+f1+"]",y1="\\d+",rN="["+h1+"]",v1="["+d1+"]",w1="[^"+Ef+g1+y1+h1+d1+p1+"]",Im="\\ud83c[\\udffb-\\udfff]",oN="(?:"+Cf+"|"+Im+")",S1="[^"+Ef+"]",Pm="(?:\\ud83c[\\udde6-\\uddff]){2}",$m="[\\ud800-\\udbff][\\udc00-\\udfff]",Ml="["+p1+"]",x1="\\u200d",_1="(?:"+v1+"|"+w1+")",lN="(?:"+Ml+"|"+w1+")",E1="(?:"+Nm+"(?:d|ll|m|re|s|t|ve))?",C1="(?:"+Nm+"(?:D|LL|M|RE|S|T|VE))?",A1=oN+"?",k1="["+m1+"]?",aN="(?:"+x1+"(?:"+[S1,Pm,$m].join("|")+")"+k1+A1+")*",cN="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",uN="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",T1=k1+A1+aN,fN="(?:"+[rN,Pm,$m].join("|")+")"+T1,hN="(?:"+[S1+Cf+"?",Cf,Pm,$m,iN].join("|")+")",dN=RegExp(Nm,"g"),pN=RegExp(Cf,"g"),Bm=RegExp(Im+"(?="+Im+")|"+hN+T1,"g"),mN=RegExp([Ml+"?"+v1+"+"+E1+"(?="+[b1,Ml,"$"].join("|")+")",lN+"+"+C1+"(?="+[b1,Ml+_1,"$"].join("|")+")",Ml+"?"+_1+"+"+E1,Ml+"+"+C1,uN,cN,y1,fN].join("|"),"g"),gN=RegExp("["+x1+Ef+f1+m1+"]"),bN=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,yN=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],vN=-1,$t={};$t[fn]=$t[hn]=$t[Zn]=$t[es]=$t[nr]=$t[Ol]=$t[yn]=$t[ts]=$t[Rl]=!0,$t[be]=$t[Ne]=$t[ht]=$t[se]=$t[ot]=$t[he]=$t[Ke]=$t[M]=$t[V]=$t[G]=$t[K]=$t[ve]=$t[re]=$t[Be]=$t[Ve]=!1;var Dt={};Dt[be]=Dt[Ne]=Dt[ht]=Dt[ot]=Dt[se]=Dt[he]=Dt[fn]=Dt[hn]=Dt[Zn]=Dt[es]=Dt[nr]=Dt[V]=Dt[G]=Dt[K]=Dt[ve]=Dt[re]=Dt[Be]=Dt[Ce]=Dt[Ol]=Dt[yn]=Dt[ts]=Dt[Rl]=!0,Dt[Ke]=Dt[M]=Dt[Ve]=!1;var wN={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},SN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},xN={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},_N={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},EN=parseFloat,CN=parseInt,O1=typeof mh=="object"&&mh&&mh.Object===Object&&mh,AN=typeof self=="object"&&self&&self.Object===Object&&self,vn=O1||AN||Function("return this")(),Fm=e&&!e.nodeType&&e,Po=Fm&&!0&&n&&!n.nodeType&&n,R1=Po&&Po.exports===Fm,Vm=R1&&O1.process,$s=(function(){try{var $=Po&&Po.require&&Po.require("util").types;return $||Vm&&Vm.binding&&Vm.binding("util")}catch{}})(),M1=$s&&$s.isArrayBuffer,D1=$s&&$s.isDate,L1=$s&&$s.isMap,N1=$s&&$s.isRegExp,I1=$s&&$s.isSet,P1=$s&&$s.isTypedArray;function gs($,Q,z){switch(z.length){case 0:return $.call(Q);case 1:return $.call(Q,z[0]);case 2:return $.call(Q,z[0],z[1]);case 3:return $.call(Q,z[0],z[1],z[2])}return $.apply(Q,z)}function kN($,Q,z,Me){for(var Qe=-1,vt=$==null?0:$.length;++Qe<vt;){var sn=$[Qe];Q(Me,sn,z(sn),$)}return Me}function Bs($,Q){for(var z=-1,Me=$==null?0:$.length;++z<Me&&Q($[z],z,$)!==!1;);return $}function TN($,Q){for(var z=$==null?0:$.length;z--&&Q($[z],z,$)!==!1;);return $}function $1($,Q){for(var z=-1,Me=$==null?0:$.length;++z<Me;)if(!Q($[z],z,$))return!1;return!0}function Hr($,Q){for(var z=-1,Me=$==null?0:$.length,Qe=0,vt=[];++z<Me;){var sn=$[z];Q(sn,z,$)&&(vt[Qe++]=sn)}return vt}function Af($,Q){var z=$==null?0:$.length;return!!z&&Dl($,Q,0)>-1}function Wm($,Q,z){for(var Me=-1,Qe=$==null?0:$.length;++Me<Qe;)if(z(Q,$[Me]))return!0;return!1}function Ht($,Q){for(var z=-1,Me=$==null?0:$.length,Qe=Array(Me);++z<Me;)Qe[z]=Q($[z],z,$);return Qe}function Ur($,Q){for(var z=-1,Me=Q.length,Qe=$.length;++z<Me;)$[Qe+z]=Q[z];return $}function Hm($,Q,z,Me){var Qe=-1,vt=$==null?0:$.length;for(Me&&vt&&(z=$[++Qe]);++Qe<vt;)z=Q(z,$[Qe],Qe,$);return z}function ON($,Q,z,Me){var Qe=$==null?0:$.length;for(Me&&Qe&&(z=$[--Qe]);Qe--;)z=Q(z,$[Qe],Qe,$);return z}function Um($,Q){for(var z=-1,Me=$==null?0:$.length;++z<Me;)if(Q($[z],z,$))return!0;return!1}var RN=zm("length");function MN($){return $.split("")}function DN($){return $.match(VL)||[]}function B1($,Q,z){var Me;return z($,function(Qe,vt,sn){if(Q(Qe,vt,sn))return Me=vt,!1}),Me}function kf($,Q,z,Me){for(var Qe=$.length,vt=z+(Me?1:-1);Me?vt--:++vt<Qe;)if(Q($[vt],vt,$))return vt;return-1}function Dl($,Q,z){return Q===Q?zN($,Q,z):kf($,F1,z)}function LN($,Q,z,Me){for(var Qe=z-1,vt=$.length;++Qe<vt;)if(Me($[Qe],Q))return Qe;return-1}function F1($){return $!==$}function V1($,Q){var z=$==null?0:$.length;return z?Km($,Q)/z:Z}function zm($){return function(Q){return Q==null?t:Q[$]}}function qm($){return function(Q){return $==null?t:$[Q]}}function W1($,Q,z,Me,Qe){return Qe($,function(vt,sn,kt){z=Me?(Me=!1,vt):Q(z,vt,sn,kt)}),z}function NN($,Q){var z=$.length;for($.sort(Q);z--;)$[z]=$[z].value;return $}function Km($,Q){for(var z,Me=-1,Qe=$.length;++Me<Qe;){var vt=Q($[Me]);vt!==t&&(z=z===t?vt:z+vt)}return z}function jm($,Q){for(var z=-1,Me=Array($);++z<$;)Me[z]=Q(z);return Me}function IN($,Q){return Ht(Q,function(z){return[z,$[z]]})}function H1($){return $&&$.slice(0,K1($)+1).replace(Lm,"")}function bs($){return function(Q){return $(Q)}}function Gm($,Q){return Ht(Q,function(z){return $[z]})}function uc($,Q){return $.has(Q)}function U1($,Q){for(var z=-1,Me=$.length;++z<Me&&Dl(Q,$[z],0)>-1;);return z}function z1($,Q){for(var z=$.length;z--&&Dl(Q,$[z],0)>-1;);return z}function PN($,Q){for(var z=$.length,Me=0;z--;)$[z]===Q&&++Me;return Me}var $N=qm(wN),BN=qm(SN);function FN($){return"\\"+_N[$]}function VN($,Q){return $==null?t:$[Q]}function Ll($){return gN.test($)}function WN($){return bN.test($)}function HN($){for(var Q,z=[];!(Q=$.next()).done;)z.push(Q.value);return z}function Ym($){var Q=-1,z=Array($.size);return $.forEach(function(Me,Qe){z[++Q]=[Qe,Me]}),z}function q1($,Q){return function(z){return $(Q(z))}}function zr($,Q){for(var z=-1,Me=$.length,Qe=0,vt=[];++z<Me;){var sn=$[z];(sn===Q||sn===h)&&($[z]=h,vt[Qe++]=z)}return vt}function Tf($){var Q=-1,z=Array($.size);return $.forEach(function(Me){z[++Q]=Me}),z}function UN($){var Q=-1,z=Array($.size);return $.forEach(function(Me){z[++Q]=[Me,Me]}),z}function zN($,Q,z){for(var Me=z-1,Qe=$.length;++Me<Qe;)if($[Me]===Q)return Me;return-1}function qN($,Q,z){for(var Me=z+1;Me--;)if($[Me]===Q)return Me;return Me}function Nl($){return Ll($)?jN($):RN($)}function ai($){return Ll($)?GN($):MN($)}function K1($){for(var Q=$.length;Q--&&PL.test($.charAt(Q)););return Q}var KN=qm(xN);function jN($){for(var Q=Bm.lastIndex=0;Bm.test($);)++Q;return Q}function GN($){return $.match(Bm)||[]}function YN($){return $.match(mN)||[]}var XN=(function $(Q){Q=Q==null?vn:Il.defaults(vn.Object(),Q,Il.pick(vn,yN));var z=Q.Array,Me=Q.Date,Qe=Q.Error,vt=Q.Function,sn=Q.Math,kt=Q.Object,Xm=Q.RegExp,QN=Q.String,Fs=Q.TypeError,Of=z.prototype,JN=vt.prototype,Pl=kt.prototype,Rf=Q["__core-js_shared__"],Mf=JN.toString,Et=Pl.hasOwnProperty,ZN=0,j1=(function(){var a=/[^.]+$/.exec(Rf&&Rf.keys&&Rf.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),Df=Pl.toString,eI=Mf.call(kt),tI=vn._,nI=Xm("^"+Mf.call(Et).replace(Dm,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Lf=R1?Q.Buffer:t,qr=Q.Symbol,Nf=Q.Uint8Array,G1=Lf?Lf.allocUnsafe:t,If=q1(kt.getPrototypeOf,kt),Y1=kt.create,X1=Pl.propertyIsEnumerable,Pf=Of.splice,Q1=qr?qr.isConcatSpreadable:t,fc=qr?qr.iterator:t,$o=qr?qr.toStringTag:t,$f=(function(){try{var a=Ho(kt,"defineProperty");return a({},"",{}),a}catch{}})(),sI=Q.clearTimeout!==vn.clearTimeout&&Q.clearTimeout,iI=Me&&Me.now!==vn.Date.now&&Me.now,rI=Q.setTimeout!==vn.setTimeout&&Q.setTimeout,Bf=sn.ceil,Ff=sn.floor,Qm=kt.getOwnPropertySymbols,oI=Lf?Lf.isBuffer:t,J1=Q.isFinite,lI=Of.join,aI=q1(kt.keys,kt),rn=sn.max,An=sn.min,cI=Me.now,uI=Q.parseInt,Z1=sn.random,fI=Of.reverse,Jm=Ho(Q,"DataView"),hc=Ho(Q,"Map"),Zm=Ho(Q,"Promise"),$l=Ho(Q,"Set"),dc=Ho(Q,"WeakMap"),pc=Ho(kt,"create"),Vf=dc&&new dc,Bl={},hI=Uo(Jm),dI=Uo(hc),pI=Uo(Zm),mI=Uo($l),gI=Uo(dc),Wf=qr?qr.prototype:t,mc=Wf?Wf.valueOf:t,eS=Wf?Wf.toString:t;function A(a){if(jt(a)&&!Ze(a)&&!(a instanceof ft)){if(a instanceof Vs)return a;if(Et.call(a,"__wrapped__"))return tx(a)}return new Vs(a)}var Fl=(function(){function a(){}return function(u){if(!zt(u))return{};if(Y1)return Y1(u);a.prototype=u;var p=new a;return a.prototype=t,p}})();function Hf(){}function Vs(a,u){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=t}A.templateSettings={escape:RL,evaluate:ML,interpolate:c1,variable:"",imports:{_:A}},A.prototype=Hf.prototype,A.prototype.constructor=A,Vs.prototype=Fl(Hf.prototype),Vs.prototype.constructor=Vs;function ft(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=X,this.__views__=[]}function bI(){var a=new ft(this.__wrapped__);return a.__actions__=ns(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=ns(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=ns(this.__views__),a}function yI(){if(this.__filtered__){var a=new ft(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function vI(){var a=this.__wrapped__.value(),u=this.__dir__,p=Ze(a),v=u<0,_=p?a.length:0,O=MP(0,_,this.__views__),D=O.start,P=O.end,W=P-D,ie=v?P:D-1,oe=this.__iteratees__,de=oe.length,Ae=0,$e=An(W,this.__takeCount__);if(!p||!v&&_==W&&$e==W)return ES(a,this.__actions__);var Ue=[];e:for(;W--&&Ae<$e;){ie+=u;for(var it=-1,ze=a[ie];++it<de;){var ut=oe[it],dt=ut.iteratee,ws=ut.type,Un=dt(ze);if(ws==q)ze=Un;else if(!Un){if(ws==Y)continue e;break e}}Ue[Ae++]=ze}return Ue}ft.prototype=Fl(Hf.prototype),ft.prototype.constructor=ft;function Bo(a){var u=-1,p=a==null?0:a.length;for(this.clear();++u<p;){var v=a[u];this.set(v[0],v[1])}}function wI(){this.__data__=pc?pc(null):{},this.size=0}function SI(a){var u=this.has(a)&&delete this.__data__[a];return this.size-=u?1:0,u}function xI(a){var u=this.__data__;if(pc){var p=u[a];return p===c?t:p}return Et.call(u,a)?u[a]:t}function _I(a){var u=this.__data__;return pc?u[a]!==t:Et.call(u,a)}function EI(a,u){var p=this.__data__;return this.size+=this.has(a)?0:1,p[a]=pc&&u===t?c:u,this}Bo.prototype.clear=wI,Bo.prototype.delete=SI,Bo.prototype.get=xI,Bo.prototype.has=_I,Bo.prototype.set=EI;function sr(a){var u=-1,p=a==null?0:a.length;for(this.clear();++u<p;){var v=a[u];this.set(v[0],v[1])}}function CI(){this.__data__=[],this.size=0}function AI(a){var u=this.__data__,p=Uf(u,a);if(p<0)return!1;var v=u.length-1;return p==v?u.pop():Pf.call(u,p,1),--this.size,!0}function kI(a){var u=this.__data__,p=Uf(u,a);return p<0?t:u[p][1]}function TI(a){return Uf(this.__data__,a)>-1}function OI(a,u){var p=this.__data__,v=Uf(p,a);return v<0?(++this.size,p.push([a,u])):p[v][1]=u,this}sr.prototype.clear=CI,sr.prototype.delete=AI,sr.prototype.get=kI,sr.prototype.has=TI,sr.prototype.set=OI;function ir(a){var u=-1,p=a==null?0:a.length;for(this.clear();++u<p;){var v=a[u];this.set(v[0],v[1])}}function RI(){this.size=0,this.__data__={hash:new Bo,map:new(hc||sr),string:new Bo}}function MI(a){var u=th(this,a).delete(a);return this.size-=u?1:0,u}function DI(a){return th(this,a).get(a)}function LI(a){return th(this,a).has(a)}function NI(a,u){var p=th(this,a),v=p.size;return p.set(a,u),this.size+=p.size==v?0:1,this}ir.prototype.clear=RI,ir.prototype.delete=MI,ir.prototype.get=DI,ir.prototype.has=LI,ir.prototype.set=NI;function Fo(a){var u=-1,p=a==null?0:a.length;for(this.__data__=new ir;++u<p;)this.add(a[u])}function II(a){return this.__data__.set(a,c),this}function PI(a){return this.__data__.has(a)}Fo.prototype.add=Fo.prototype.push=II,Fo.prototype.has=PI;function ci(a){var u=this.__data__=new sr(a);this.size=u.size}function $I(){this.__data__=new sr,this.size=0}function BI(a){var u=this.__data__,p=u.delete(a);return this.size=u.size,p}function FI(a){return this.__data__.get(a)}function VI(a){return this.__data__.has(a)}function WI(a,u){var p=this.__data__;if(p instanceof sr){var v=p.__data__;if(!hc||v.length<i-1)return v.push([a,u]),this.size=++p.size,this;p=this.__data__=new ir(v)}return p.set(a,u),this.size=p.size,this}ci.prototype.clear=$I,ci.prototype.delete=BI,ci.prototype.get=FI,ci.prototype.has=VI,ci.prototype.set=WI;function tS(a,u){var p=Ze(a),v=!p&&zo(a),_=!p&&!v&&Xr(a),O=!p&&!v&&!_&&Ul(a),D=p||v||_||O,P=D?jm(a.length,QN):[],W=P.length;for(var ie in a)(u||Et.call(a,ie))&&!(D&&(ie=="length"||_&&(ie=="offset"||ie=="parent")||O&&(ie=="buffer"||ie=="byteLength"||ie=="byteOffset")||ar(ie,W)))&&P.push(ie);return P}function nS(a){var u=a.length;return u?a[ug(0,u-1)]:t}function HI(a,u){return nh(ns(a),Vo(u,0,a.length))}function UI(a){return nh(ns(a))}function eg(a,u,p){(p!==t&&!ui(a[u],p)||p===t&&!(u in a))&&rr(a,u,p)}function gc(a,u,p){var v=a[u];(!(Et.call(a,u)&&ui(v,p))||p===t&&!(u in a))&&rr(a,u,p)}function Uf(a,u){for(var p=a.length;p--;)if(ui(a[p][0],u))return p;return-1}function zI(a,u,p,v){return Kr(a,function(_,O,D){u(v,_,p(_),D)}),v}function sS(a,u){return a&&Ti(u,dn(u),a)}function qI(a,u){return a&&Ti(u,is(u),a)}function rr(a,u,p){u=="__proto__"&&$f?$f(a,u,{configurable:!0,enumerable:!0,value:p,writable:!0}):a[u]=p}function tg(a,u){for(var p=-1,v=u.length,_=z(v),O=a==null;++p<v;)_[p]=O?t:Ig(a,u[p]);return _}function Vo(a,u,p){return a===a&&(p!==t&&(a=a<=p?a:p),u!==t&&(a=a>=u?a:u)),a}function Ws(a,u,p,v,_,O){var D,P=u&d,W=u&g,ie=u&m;if(p&&(D=_?p(a,v,_,O):p(a)),D!==t)return D;if(!zt(a))return a;var oe=Ze(a);if(oe){if(D=LP(a),!P)return ns(a,D)}else{var de=kn(a),Ae=de==M||de==I;if(Xr(a))return kS(a,P);if(de==K||de==be||Ae&&!_){if(D=W||Ae?{}:KS(a),!P)return W?xP(a,qI(D,a)):SP(a,sS(D,a))}else{if(!Dt[de])return _?a:{};D=NP(a,de,P)}}O||(O=new ci);var $e=O.get(a);if($e)return $e;O.set(a,D),Sx(a)?a.forEach(function(ze){D.add(Ws(ze,u,p,ze,a,O))}):vx(a)&&a.forEach(function(ze,ut){D.set(ut,Ws(ze,u,p,ut,a,O))});var Ue=ie?W?Sg:wg:W?is:dn,it=oe?t:Ue(a);return Bs(it||a,function(ze,ut){it&&(ut=ze,ze=a[ut]),gc(D,ut,Ws(ze,u,p,ut,a,O))}),D}function KI(a){var u=dn(a);return function(p){return iS(p,a,u)}}function iS(a,u,p){var v=p.length;if(a==null)return!v;for(a=kt(a);v--;){var _=p[v],O=u[_],D=a[_];if(D===t&&!(_ in a)||!O(D))return!1}return!0}function rS(a,u,p){if(typeof a!="function")throw new Fs(o);return _c(function(){a.apply(t,p)},u)}function bc(a,u,p,v){var _=-1,O=Af,D=!0,P=a.length,W=[],ie=u.length;if(!P)return W;p&&(u=Ht(u,bs(p))),v?(O=Wm,D=!1):u.length>=i&&(O=uc,D=!1,u=new Fo(u));e:for(;++_<P;){var oe=a[_],de=p==null?oe:p(oe);if(oe=v||oe!==0?oe:0,D&&de===de){for(var Ae=ie;Ae--;)if(u[Ae]===de)continue e;W.push(oe)}else O(u,de,v)||W.push(oe)}return W}var Kr=DS(ki),oS=DS(sg,!0);function jI(a,u){var p=!0;return Kr(a,function(v,_,O){return p=!!u(v,_,O),p}),p}function zf(a,u,p){for(var v=-1,_=a.length;++v<_;){var O=a[v],D=u(O);if(D!=null&&(P===t?D===D&&!vs(D):p(D,P)))var P=D,W=O}return W}function GI(a,u,p,v){var _=a.length;for(p=nt(p),p<0&&(p=-p>_?0:_+p),v=v===t||v>_?_:nt(v),v<0&&(v+=_),v=p>v?0:_x(v);p<v;)a[p++]=u;return a}function lS(a,u){var p=[];return Kr(a,function(v,_,O){u(v,_,O)&&p.push(v)}),p}function wn(a,u,p,v,_){var O=-1,D=a.length;for(p||(p=PP),_||(_=[]);++O<D;){var P=a[O];u>0&&p(P)?u>1?wn(P,u-1,p,v,_):Ur(_,P):v||(_[_.length]=P)}return _}var ng=LS(),aS=LS(!0);function ki(a,u){return a&&ng(a,u,dn)}function sg(a,u){return a&&aS(a,u,dn)}function qf(a,u){return Hr(u,function(p){return cr(a[p])})}function Wo(a,u){u=Gr(u,a);for(var p=0,v=u.length;a!=null&&p<v;)a=a[Oi(u[p++])];return p&&p==v?a:t}function cS(a,u,p){var v=u(a);return Ze(a)?v:Ur(v,p(a))}function Wn(a){return a==null?a===t?Fe:te:$o&&$o in kt(a)?RP(a):UP(a)}function ig(a,u){return a>u}function YI(a,u){return a!=null&&Et.call(a,u)}function XI(a,u){return a!=null&&u in kt(a)}function QI(a,u,p){return a>=An(u,p)&&a<rn(u,p)}function rg(a,u,p){for(var v=p?Wm:Af,_=a[0].length,O=a.length,D=O,P=z(O),W=1/0,ie=[];D--;){var oe=a[D];D&&u&&(oe=Ht(oe,bs(u))),W=An(oe.length,W),P[D]=!p&&(u||_>=120&&oe.length>=120)?new Fo(D&&oe):t}oe=a[0];var de=-1,Ae=P[0];e:for(;++de<_&&ie.length<W;){var $e=oe[de],Ue=u?u($e):$e;if($e=p||$e!==0?$e:0,!(Ae?uc(Ae,Ue):v(ie,Ue,p))){for(D=O;--D;){var it=P[D];if(!(it?uc(it,Ue):v(a[D],Ue,p)))continue e}Ae&&Ae.push(Ue),ie.push($e)}}return ie}function JI(a,u,p,v){return ki(a,function(_,O,D){u(v,p(_),O,D)}),v}function yc(a,u,p){u=Gr(u,a),a=XS(a,u);var v=a==null?a:a[Oi(Us(u))];return v==null?t:gs(v,a,p)}function uS(a){return jt(a)&&Wn(a)==be}function ZI(a){return jt(a)&&Wn(a)==ht}function eP(a){return jt(a)&&Wn(a)==he}function vc(a,u,p,v,_){return a===u?!0:a==null||u==null||!jt(a)&&!jt(u)?a!==a&&u!==u:tP(a,u,p,v,vc,_)}function tP(a,u,p,v,_,O){var D=Ze(a),P=Ze(u),W=D?Ne:kn(a),ie=P?Ne:kn(u);W=W==be?K:W,ie=ie==be?K:ie;var oe=W==K,de=ie==K,Ae=W==ie;if(Ae&&Xr(a)){if(!Xr(u))return!1;D=!0,oe=!1}if(Ae&&!oe)return O||(O=new ci),D||Ul(a)?US(a,u,p,v,_,O):TP(a,u,W,p,v,_,O);if(!(p&y)){var $e=oe&&Et.call(a,"__wrapped__"),Ue=de&&Et.call(u,"__wrapped__");if($e||Ue){var it=$e?a.value():a,ze=Ue?u.value():u;return O||(O=new ci),_(it,ze,p,v,O)}}return Ae?(O||(O=new ci),OP(a,u,p,v,_,O)):!1}function nP(a){return jt(a)&&kn(a)==V}function og(a,u,p,v){var _=p.length,O=_,D=!v;if(a==null)return!O;for(a=kt(a);_--;){var P=p[_];if(D&&P[2]?P[1]!==a[P[0]]:!(P[0]in a))return!1}for(;++_<O;){P=p[_];var W=P[0],ie=a[W],oe=P[1];if(D&&P[2]){if(ie===t&&!(W in a))return!1}else{var de=new ci;if(v)var Ae=v(ie,oe,W,a,u,de);if(!(Ae===t?vc(oe,ie,y|w,v,de):Ae))return!1}}return!0}function fS(a){if(!zt(a)||BP(a))return!1;var u=cr(a)?nI:KL;return u.test(Uo(a))}function sP(a){return jt(a)&&Wn(a)==ve}function iP(a){return jt(a)&&kn(a)==re}function rP(a){return jt(a)&&ah(a.length)&&!!$t[Wn(a)]}function hS(a){return typeof a=="function"?a:a==null?rs:typeof a=="object"?Ze(a)?mS(a[0],a[1]):pS(a):Nx(a)}function lg(a){if(!xc(a))return aI(a);var u=[];for(var p in kt(a))Et.call(a,p)&&p!="constructor"&&u.push(p);return u}function oP(a){if(!zt(a))return HP(a);var u=xc(a),p=[];for(var v in a)v=="constructor"&&(u||!Et.call(a,v))||p.push(v);return p}function ag(a,u){return a<u}function dS(a,u){var p=-1,v=ss(a)?z(a.length):[];return Kr(a,function(_,O,D){v[++p]=u(_,O,D)}),v}function pS(a){var u=_g(a);return u.length==1&&u[0][2]?GS(u[0][0],u[0][1]):function(p){return p===a||og(p,a,u)}}function mS(a,u){return Cg(a)&&jS(u)?GS(Oi(a),u):function(p){var v=Ig(p,a);return v===t&&v===u?Pg(p,a):vc(u,v,y|w)}}function Kf(a,u,p,v,_){a!==u&&ng(u,function(O,D){if(_||(_=new ci),zt(O))lP(a,u,D,p,Kf,v,_);else{var P=v?v(kg(a,D),O,D+"",a,u,_):t;P===t&&(P=O),eg(a,D,P)}},is)}function lP(a,u,p,v,_,O,D){var P=kg(a,p),W=kg(u,p),ie=D.get(W);if(ie){eg(a,p,ie);return}var oe=O?O(P,W,p+"",a,u,D):t,de=oe===t;if(de){var Ae=Ze(W),$e=!Ae&&Xr(W),Ue=!Ae&&!$e&&Ul(W);oe=W,Ae||$e||Ue?Ze(P)?oe=P:Yt(P)?oe=ns(P):$e?(de=!1,oe=kS(W,!0)):Ue?(de=!1,oe=TS(W,!0)):oe=[]:Ec(W)||zo(W)?(oe=P,zo(P)?oe=Ex(P):(!zt(P)||cr(P))&&(oe=KS(W))):de=!1}de&&(D.set(W,oe),_(oe,W,v,O,D),D.delete(W)),eg(a,p,oe)}function gS(a,u){var p=a.length;if(p)return u+=u<0?p:0,ar(u,p)?a[u]:t}function bS(a,u,p){u.length?u=Ht(u,function(O){return Ze(O)?function(D){return Wo(D,O.length===1?O[0]:O)}:O}):u=[rs];var v=-1;u=Ht(u,bs(He()));var _=dS(a,function(O,D,P){var W=Ht(u,function(ie){return ie(O)});return{criteria:W,index:++v,value:O}});return NN(_,function(O,D){return wP(O,D,p)})}function aP(a,u){return yS(a,u,function(p,v){return Pg(a,v)})}function yS(a,u,p){for(var v=-1,_=u.length,O={};++v<_;){var D=u[v],P=Wo(a,D);p(P,D)&&wc(O,Gr(D,a),P)}return O}function cP(a){return function(u){return Wo(u,a)}}function cg(a,u,p,v){var _=v?LN:Dl,O=-1,D=u.length,P=a;for(a===u&&(u=ns(u)),p&&(P=Ht(a,bs(p)));++O<D;)for(var W=0,ie=u[O],oe=p?p(ie):ie;(W=_(P,oe,W,v))>-1;)P!==a&&Pf.call(P,W,1),Pf.call(a,W,1);return a}function vS(a,u){for(var p=a?u.length:0,v=p-1;p--;){var _=u[p];if(p==v||_!==O){var O=_;ar(_)?Pf.call(a,_,1):dg(a,_)}}return a}function ug(a,u){return a+Ff(Z1()*(u-a+1))}function uP(a,u,p,v){for(var _=-1,O=rn(Bf((u-a)/(p||1)),0),D=z(O);O--;)D[v?O:++_]=a,a+=p;return D}function fg(a,u){var p="";if(!a||u<1||u>H)return p;do u%2&&(p+=a),u=Ff(u/2),u&&(a+=a);while(u);return p}function lt(a,u){return Tg(YS(a,u,rs),a+"")}function fP(a){return nS(zl(a))}function hP(a,u){var p=zl(a);return nh(p,Vo(u,0,p.length))}function wc(a,u,p,v){if(!zt(a))return a;u=Gr(u,a);for(var _=-1,O=u.length,D=O-1,P=a;P!=null&&++_<O;){var W=Oi(u[_]),ie=p;if(W==="__proto__"||W==="constructor"||W==="prototype")return a;if(_!=D){var oe=P[W];ie=v?v(oe,W,P):t,ie===t&&(ie=zt(oe)?oe:ar(u[_+1])?[]:{})}gc(P,W,ie),P=P[W]}return a}var wS=Vf?function(a,u){return Vf.set(a,u),a}:rs,dP=$f?function(a,u){return $f(a,"toString",{configurable:!0,enumerable:!1,value:Bg(u),writable:!0})}:rs;function pP(a){return nh(zl(a))}function Hs(a,u,p){var v=-1,_=a.length;u<0&&(u=-u>_?0:_+u),p=p>_?_:p,p<0&&(p+=_),_=u>p?0:p-u>>>0,u>>>=0;for(var O=z(_);++v<_;)O[v]=a[v+u];return O}function mP(a,u){var p;return Kr(a,function(v,_,O){return p=u(v,_,O),!p}),!!p}function jf(a,u,p){var v=0,_=a==null?v:a.length;if(typeof u=="number"&&u===u&&_<=we){for(;v<_;){var O=v+_>>>1,D=a[O];D!==null&&!vs(D)&&(p?D<=u:D<u)?v=O+1:_=O}return _}return hg(a,u,rs,p)}function hg(a,u,p,v){var _=0,O=a==null?0:a.length;if(O===0)return 0;u=p(u);for(var D=u!==u,P=u===null,W=vs(u),ie=u===t;_<O;){var oe=Ff((_+O)/2),de=p(a[oe]),Ae=de!==t,$e=de===null,Ue=de===de,it=vs(de);if(D)var ze=v||Ue;else ie?ze=Ue&&(v||Ae):P?ze=Ue&&Ae&&(v||!$e):W?ze=Ue&&Ae&&!$e&&(v||!it):$e||it?ze=!1:ze=v?de<=u:de<u;ze?_=oe+1:O=oe}return An(O,fe)}function SS(a,u){for(var p=-1,v=a.length,_=0,O=[];++p<v;){var D=a[p],P=u?u(D):D;if(!p||!ui(P,W)){var W=P;O[_++]=D===0?0:D}}return O}function xS(a){return typeof a=="number"?a:vs(a)?Z:+a}function ys(a){if(typeof a=="string")return a;if(Ze(a))return Ht(a,ys)+"";if(vs(a))return eS?eS.call(a):"";var u=a+"";return u=="0"&&1/a==-Se?"-0":u}function jr(a,u,p){var v=-1,_=Af,O=a.length,D=!0,P=[],W=P;if(p)D=!1,_=Wm;else if(O>=i){var ie=u?null:AP(a);if(ie)return Tf(ie);D=!1,_=uc,W=new Fo}else W=u?[]:P;e:for(;++v<O;){var oe=a[v],de=u?u(oe):oe;if(oe=p||oe!==0?oe:0,D&&de===de){for(var Ae=W.length;Ae--;)if(W[Ae]===de)continue e;u&&W.push(de),P.push(oe)}else _(W,de,p)||(W!==P&&W.push(de),P.push(oe))}return P}function dg(a,u){return u=Gr(u,a),a=XS(a,u),a==null||delete a[Oi(Us(u))]}function _S(a,u,p,v){return wc(a,u,p(Wo(a,u)),v)}function Gf(a,u,p,v){for(var _=a.length,O=v?_:-1;(v?O--:++O<_)&&u(a[O],O,a););return p?Hs(a,v?0:O,v?O+1:_):Hs(a,v?O+1:0,v?_:O)}function ES(a,u){var p=a;return p instanceof ft&&(p=p.value()),Hm(u,function(v,_){return _.func.apply(_.thisArg,Ur([v],_.args))},p)}function pg(a,u,p){var v=a.length;if(v<2)return v?jr(a[0]):[];for(var _=-1,O=z(v);++_<v;)for(var D=a[_],P=-1;++P<v;)P!=_&&(O[_]=bc(O[_]||D,a[P],u,p));return jr(wn(O,1),u,p)}function CS(a,u,p){for(var v=-1,_=a.length,O=u.length,D={};++v<_;){var P=v<O?u[v]:t;p(D,a[v],P)}return D}function mg(a){return Yt(a)?a:[]}function gg(a){return typeof a=="function"?a:rs}function Gr(a,u){return Ze(a)?a:Cg(a,u)?[a]:ex(St(a))}var gP=lt;function Yr(a,u,p){var v=a.length;return p=p===t?v:p,!u&&p>=v?a:Hs(a,u,p)}var AS=sI||function(a){return vn.clearTimeout(a)};function kS(a,u){if(u)return a.slice();var p=a.length,v=G1?G1(p):new a.constructor(p);return a.copy(v),v}function bg(a){var u=new a.constructor(a.byteLength);return new Nf(u).set(new Nf(a)),u}function bP(a,u){var p=u?bg(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}function yP(a){var u=new a.constructor(a.source,u1.exec(a));return u.lastIndex=a.lastIndex,u}function vP(a){return mc?kt(mc.call(a)):{}}function TS(a,u){var p=u?bg(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}function OS(a,u){if(a!==u){var p=a!==t,v=a===null,_=a===a,O=vs(a),D=u!==t,P=u===null,W=u===u,ie=vs(u);if(!P&&!ie&&!O&&a>u||O&&D&&W&&!P&&!ie||v&&D&&W||!p&&W||!_)return 1;if(!v&&!O&&!ie&&a<u||ie&&p&&_&&!v&&!O||P&&p&&_||!D&&_||!W)return-1}return 0}function wP(a,u,p){for(var v=-1,_=a.criteria,O=u.criteria,D=_.length,P=p.length;++v<D;){var W=OS(_[v],O[v]);if(W){if(v>=P)return W;var ie=p[v];return W*(ie=="desc"?-1:1)}}return a.index-u.index}function RS(a,u,p,v){for(var _=-1,O=a.length,D=p.length,P=-1,W=u.length,ie=rn(O-D,0),oe=z(W+ie),de=!v;++P<W;)oe[P]=u[P];for(;++_<D;)(de||_<O)&&(oe[p[_]]=a[_]);for(;ie--;)oe[P++]=a[_++];return oe}function MS(a,u,p,v){for(var _=-1,O=a.length,D=-1,P=p.length,W=-1,ie=u.length,oe=rn(O-P,0),de=z(oe+ie),Ae=!v;++_<oe;)de[_]=a[_];for(var $e=_;++W<ie;)de[$e+W]=u[W];for(;++D<P;)(Ae||_<O)&&(de[$e+p[D]]=a[_++]);return de}function ns(a,u){var p=-1,v=a.length;for(u||(u=z(v));++p<v;)u[p]=a[p];return u}function Ti(a,u,p,v){var _=!p;p||(p={});for(var O=-1,D=u.length;++O<D;){var P=u[O],W=v?v(p[P],a[P],P,p,a):t;W===t&&(W=a[P]),_?rr(p,P,W):gc(p,P,W)}return p}function SP(a,u){return Ti(a,Eg(a),u)}function xP(a,u){return Ti(a,zS(a),u)}function Yf(a,u){return function(p,v){var _=Ze(p)?kN:zI,O=u?u():{};return _(p,a,He(v,2),O)}}function Vl(a){return lt(function(u,p){var v=-1,_=p.length,O=_>1?p[_-1]:t,D=_>2?p[2]:t;for(O=a.length>3&&typeof O=="function"?(_--,O):t,D&&Hn(p[0],p[1],D)&&(O=_<3?t:O,_=1),u=kt(u);++v<_;){var P=p[v];P&&a(u,P,v,O)}return u})}function DS(a,u){return function(p,v){if(p==null)return p;if(!ss(p))return a(p,v);for(var _=p.length,O=u?_:-1,D=kt(p);(u?O--:++O<_)&&v(D[O],O,D)!==!1;);return p}}function LS(a){return function(u,p,v){for(var _=-1,O=kt(u),D=v(u),P=D.length;P--;){var W=D[a?P:++_];if(p(O[W],W,O)===!1)break}return u}}function _P(a,u,p){var v=u&x,_=Sc(a);function O(){var D=this&&this!==vn&&this instanceof O?_:a;return D.apply(v?p:this,arguments)}return O}function NS(a){return function(u){u=St(u);var p=Ll(u)?ai(u):t,v=p?p[0]:u.charAt(0),_=p?Yr(p,1).join(""):u.slice(1);return v[a]()+_}}function Wl(a){return function(u){return Hm(Dx(Mx(u).replace(dN,"")),a,"")}}function Sc(a){return function(){var u=arguments;switch(u.length){case 0:return new a;case 1:return new a(u[0]);case 2:return new a(u[0],u[1]);case 3:return new a(u[0],u[1],u[2]);case 4:return new a(u[0],u[1],u[2],u[3]);case 5:return new a(u[0],u[1],u[2],u[3],u[4]);case 6:return new a(u[0],u[1],u[2],u[3],u[4],u[5]);case 7:return new a(u[0],u[1],u[2],u[3],u[4],u[5],u[6])}var p=Fl(a.prototype),v=a.apply(p,u);return zt(v)?v:p}}function EP(a,u,p){var v=Sc(a);function _(){for(var O=arguments.length,D=z(O),P=O,W=Hl(_);P--;)D[P]=arguments[P];var ie=O<3&&D[0]!==W&&D[O-1]!==W?[]:zr(D,W);if(O-=ie.length,O<p)return FS(a,u,Xf,_.placeholder,t,D,ie,t,t,p-O);var oe=this&&this!==vn&&this instanceof _?v:a;return gs(oe,this,D)}return _}function IS(a){return function(u,p,v){var _=kt(u);if(!ss(u)){var O=He(p,3);u=dn(u),p=function(P){return O(_[P],P,_)}}var D=a(u,p,v);return D>-1?_[O?u[D]:D]:t}}function PS(a){return lr(function(u){var p=u.length,v=p,_=Vs.prototype.thru;for(a&&u.reverse();v--;){var O=u[v];if(typeof O!="function")throw new Fs(o);if(_&&!D&&eh(O)=="wrapper")var D=new Vs([],!0)}for(v=D?v:p;++v<p;){O=u[v];var P=eh(O),W=P=="wrapper"?xg(O):t;W&&Ag(W[0])&&W[1]==(L|E|R|N)&&!W[4].length&&W[9]==1?D=D[eh(W[0])].apply(D,W[3]):D=O.length==1&&Ag(O)?D[P]():D.thru(O)}return function(){var ie=arguments,oe=ie[0];if(D&&ie.length==1&&Ze(oe))return D.plant(oe).value();for(var de=0,Ae=p?u[de].apply(this,ie):oe;++de<p;)Ae=u[de].call(this,Ae);return Ae}})}function Xf(a,u,p,v,_,O,D,P,W,ie){var oe=u&L,de=u&x,Ae=u&S,$e=u&(E|k),Ue=u&F,it=Ae?t:Sc(a);function ze(){for(var ut=arguments.length,dt=z(ut),ws=ut;ws--;)dt[ws]=arguments[ws];if($e)var Un=Hl(ze),Ss=PN(dt,Un);if(v&&(dt=RS(dt,v,_,$e)),O&&(dt=MS(dt,O,D,$e)),ut-=Ss,$e&&ut<ie){var Xt=zr(dt,Un);return FS(a,u,Xf,ze.placeholder,p,dt,Xt,P,W,ie-ut)}var fi=de?p:this,fr=Ae?fi[a]:a;return ut=dt.length,P?dt=zP(dt,P):Ue&&ut>1&&dt.reverse(),oe&&W<ut&&(dt.length=W),this&&this!==vn&&this instanceof ze&&(fr=it||Sc(fr)),fr.apply(fi,dt)}return ze}function $S(a,u){return function(p,v){return JI(p,a,u(v),{})}}function Qf(a,u){return function(p,v){var _;if(p===t&&v===t)return u;if(p!==t&&(_=p),v!==t){if(_===t)return v;typeof p=="string"||typeof v=="string"?(p=ys(p),v=ys(v)):(p=xS(p),v=xS(v)),_=a(p,v)}return _}}function yg(a){return lr(function(u){return u=Ht(u,bs(He())),lt(function(p){var v=this;return a(u,function(_){return gs(_,v,p)})})})}function Jf(a,u){u=u===t?" ":ys(u);var p=u.length;if(p<2)return p?fg(u,a):u;var v=fg(u,Bf(a/Nl(u)));return Ll(u)?Yr(ai(v),0,a).join(""):v.slice(0,a)}function CP(a,u,p,v){var _=u&x,O=Sc(a);function D(){for(var P=-1,W=arguments.length,ie=-1,oe=v.length,de=z(oe+W),Ae=this&&this!==vn&&this instanceof D?O:a;++ie<oe;)de[ie]=v[ie];for(;W--;)de[ie++]=arguments[++P];return gs(Ae,_?p:this,de)}return D}function BS(a){return function(u,p,v){return v&&typeof v!="number"&&Hn(u,p,v)&&(p=v=t),u=ur(u),p===t?(p=u,u=0):p=ur(p),v=v===t?u<p?1:-1:ur(v),uP(u,p,v,a)}}function Zf(a){return function(u,p){return typeof u=="string"&&typeof p=="string"||(u=zs(u),p=zs(p)),a(u,p)}}function FS(a,u,p,v,_,O,D,P,W,ie){var oe=u&E,de=oe?D:t,Ae=oe?t:D,$e=oe?O:t,Ue=oe?t:O;u|=oe?R:T,u&=~(oe?T:R),u&C||(u&=-4);var it=[a,u,_,$e,de,Ue,Ae,P,W,ie],ze=p.apply(t,it);return Ag(a)&&QS(ze,it),ze.placeholder=v,JS(ze,a,u)}function vg(a){var u=sn[a];return function(p,v){if(p=zs(p),v=v==null?0:An(nt(v),292),v&&J1(p)){var _=(St(p)+"e").split("e"),O=u(_[0]+"e"+(+_[1]+v));return _=(St(O)+"e").split("e"),+(_[0]+"e"+(+_[1]-v))}return u(p)}}var AP=$l&&1/Tf(new $l([,-0]))[1]==Se?function(a){return new $l(a)}:Wg;function VS(a){return function(u){var p=kn(u);return p==V?Ym(u):p==re?UN(u):IN(u,a(u))}}function or(a,u,p,v,_,O,D,P){var W=u&S;if(!W&&typeof a!="function")throw new Fs(o);var ie=v?v.length:0;if(ie||(u&=-97,v=_=t),D=D===t?D:rn(nt(D),0),P=P===t?P:nt(P),ie-=_?_.length:0,u&T){var oe=v,de=_;v=_=t}var Ae=W?t:xg(a),$e=[a,u,p,v,_,oe,de,O,D,P];if(Ae&&WP($e,Ae),a=$e[0],u=$e[1],p=$e[2],v=$e[3],_=$e[4],P=$e[9]=$e[9]===t?W?0:a.length:rn($e[9]-ie,0),!P&&u&(E|k)&&(u&=-25),!u||u==x)var Ue=_P(a,u,p);else u==E||u==k?Ue=EP(a,u,P):(u==R||u==(x|R))&&!_.length?Ue=CP(a,u,p,v):Ue=Xf.apply(t,$e);var it=Ae?wS:QS;return JS(it(Ue,$e),a,u)}function WS(a,u,p,v){return a===t||ui(a,Pl[p])&&!Et.call(v,p)?u:a}function HS(a,u,p,v,_,O){return zt(a)&&zt(u)&&(O.set(u,a),Kf(a,u,t,HS,O),O.delete(u)),a}function kP(a){return Ec(a)?t:a}function US(a,u,p,v,_,O){var D=p&y,P=a.length,W=u.length;if(P!=W&&!(D&&W>P))return!1;var ie=O.get(a),oe=O.get(u);if(ie&&oe)return ie==u&&oe==a;var de=-1,Ae=!0,$e=p&w?new Fo:t;for(O.set(a,u),O.set(u,a);++de<P;){var Ue=a[de],it=u[de];if(v)var ze=D?v(it,Ue,de,u,a,O):v(Ue,it,de,a,u,O);if(ze!==t){if(ze)continue;Ae=!1;break}if($e){if(!Um(u,function(ut,dt){if(!uc($e,dt)&&(Ue===ut||_(Ue,ut,p,v,O)))return $e.push(dt)})){Ae=!1;break}}else if(!(Ue===it||_(Ue,it,p,v,O))){Ae=!1;break}}return O.delete(a),O.delete(u),Ae}function TP(a,u,p,v,_,O,D){switch(p){case ot:if(a.byteLength!=u.byteLength||a.byteOffset!=u.byteOffset)return!1;a=a.buffer,u=u.buffer;case ht:return!(a.byteLength!=u.byteLength||!O(new Nf(a),new Nf(u)));case se:case he:case G:return ui(+a,+u);case Ke:return a.name==u.name&&a.message==u.message;case ve:case Be:return a==u+"";case V:var P=Ym;case re:var W=v&y;if(P||(P=Tf),a.size!=u.size&&!W)return!1;var ie=D.get(a);if(ie)return ie==u;v|=w,D.set(a,u);var oe=US(P(a),P(u),v,_,O,D);return D.delete(a),oe;case Ce:if(mc)return mc.call(a)==mc.call(u)}return!1}function OP(a,u,p,v,_,O){var D=p&y,P=wg(a),W=P.length,ie=wg(u),oe=ie.length;if(W!=oe&&!D)return!1;for(var de=W;de--;){var Ae=P[de];if(!(D?Ae in u:Et.call(u,Ae)))return!1}var $e=O.get(a),Ue=O.get(u);if($e&&Ue)return $e==u&&Ue==a;var it=!0;O.set(a,u),O.set(u,a);for(var ze=D;++de<W;){Ae=P[de];var ut=a[Ae],dt=u[Ae];if(v)var ws=D?v(dt,ut,Ae,u,a,O):v(ut,dt,Ae,a,u,O);if(!(ws===t?ut===dt||_(ut,dt,p,v,O):ws)){it=!1;break}ze||(ze=Ae=="constructor")}if(it&&!ze){var Un=a.constructor,Ss=u.constructor;Un!=Ss&&"constructor"in a&&"constructor"in u&&!(typeof Un=="function"&&Un instanceof Un&&typeof Ss=="function"&&Ss instanceof Ss)&&(it=!1)}return O.delete(a),O.delete(u),it}function lr(a){return Tg(YS(a,t,ix),a+"")}function wg(a){return cS(a,dn,Eg)}function Sg(a){return cS(a,is,zS)}var xg=Vf?function(a){return Vf.get(a)}:Wg;function eh(a){for(var u=a.name+"",p=Bl[u],v=Et.call(Bl,u)?p.length:0;v--;){var _=p[v],O=_.func;if(O==null||O==a)return _.name}return u}function Hl(a){var u=Et.call(A,"placeholder")?A:a;return u.placeholder}function He(){var a=A.iteratee||Fg;return a=a===Fg?hS:a,arguments.length?a(arguments[0],arguments[1]):a}function th(a,u){var p=a.__data__;return $P(u)?p[typeof u=="string"?"string":"hash"]:p.map}function _g(a){for(var u=dn(a),p=u.length;p--;){var v=u[p],_=a[v];u[p]=[v,_,jS(_)]}return u}function Ho(a,u){var p=VN(a,u);return fS(p)?p:t}function RP(a){var u=Et.call(a,$o),p=a[$o];try{a[$o]=t;var v=!0}catch{}var _=Df.call(a);return v&&(u?a[$o]=p:delete a[$o]),_}var Eg=Qm?function(a){return a==null?[]:(a=kt(a),Hr(Qm(a),function(u){return X1.call(a,u)}))}:Hg,zS=Qm?function(a){for(var u=[];a;)Ur(u,Eg(a)),a=If(a);return u}:Hg,kn=Wn;(Jm&&kn(new Jm(new ArrayBuffer(1)))!=ot||hc&&kn(new hc)!=V||Zm&&kn(Zm.resolve())!=_e||$l&&kn(new $l)!=re||dc&&kn(new dc)!=Ve)&&(kn=function(a){var u=Wn(a),p=u==K?a.constructor:t,v=p?Uo(p):"";if(v)switch(v){case hI:return ot;case dI:return V;case pI:return _e;case mI:return re;case gI:return Ve}return u});function MP(a,u,p){for(var v=-1,_=p.length;++v<_;){var O=p[v],D=O.size;switch(O.type){case"drop":a+=D;break;case"dropRight":u-=D;break;case"take":u=An(u,a+D);break;case"takeRight":a=rn(a,u-D);break}}return{start:a,end:u}}function DP(a){var u=a.match(BL);return u?u[1].split(FL):[]}function qS(a,u,p){u=Gr(u,a);for(var v=-1,_=u.length,O=!1;++v<_;){var D=Oi(u[v]);if(!(O=a!=null&&p(a,D)))break;a=a[D]}return O||++v!=_?O:(_=a==null?0:a.length,!!_&&ah(_)&&ar(D,_)&&(Ze(a)||zo(a)))}function LP(a){var u=a.length,p=new a.constructor(u);return u&&typeof a[0]=="string"&&Et.call(a,"index")&&(p.index=a.index,p.input=a.input),p}function KS(a){return typeof a.constructor=="function"&&!xc(a)?Fl(If(a)):{}}function NP(a,u,p){var v=a.constructor;switch(u){case ht:return bg(a);case se:case he:return new v(+a);case ot:return bP(a,p);case fn:case hn:case Zn:case es:case nr:case Ol:case yn:case ts:case Rl:return TS(a,p);case V:return new v;case G:case Be:return new v(a);case ve:return yP(a);case re:return new v;case Ce:return vP(a)}}function IP(a,u){var p=u.length;if(!p)return a;var v=p-1;return u[v]=(p>1?"& ":"")+u[v],u=u.join(p>2?", ":" "),a.replace($L,`{
/* [wrapped with `+u+`] */
`)}function PP(a){return Ze(a)||zo(a)||!!(Q1&&a&&a[Q1])}function ar(a,u){var p=typeof a;return u=u??H,!!u&&(p=="number"||p!="symbol"&&GL.test(a))&&a>-1&&a%1==0&&a<u}function Hn(a,u,p){if(!zt(p))return!1;var v=typeof u;return(v=="number"?ss(p)&&ar(u,p.length):v=="string"&&u in p)?ui(p[u],a):!1}function Cg(a,u){if(Ze(a))return!1;var p=typeof a;return p=="number"||p=="symbol"||p=="boolean"||a==null||vs(a)?!0:LL.test(a)||!DL.test(a)||u!=null&&a in kt(u)}function $P(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function Ag(a){var u=eh(a),p=A[u];if(typeof p!="function"||!(u in ft.prototype))return!1;if(a===p)return!0;var v=xg(p);return!!v&&a===v[0]}function BP(a){return!!j1&&j1 in a}var FP=Rf?cr:Ug;function xc(a){var u=a&&a.constructor,p=typeof u=="function"&&u.prototype||Pl;return a===p}function jS(a){return a===a&&!zt(a)}function GS(a,u){return function(p){return p==null?!1:p[a]===u&&(u!==t||a in kt(p))}}function VP(a){var u=oh(a,function(v){return p.size===f&&p.clear(),v}),p=u.cache;return u}function WP(a,u){var p=a[1],v=u[1],_=p|v,O=_<(x|S|L),D=v==L&&p==E||v==L&&p==N&&a[7].length<=u[8]||v==(L|N)&&u[7].length<=u[8]&&p==E;if(!(O||D))return a;v&x&&(a[2]=u[2],_|=p&x?0:C);var P=u[3];if(P){var W=a[3];a[3]=W?RS(W,P,u[4]):P,a[4]=W?zr(a[3],h):u[4]}return P=u[5],P&&(W=a[5],a[5]=W?MS(W,P,u[6]):P,a[6]=W?zr(a[5],h):u[6]),P=u[7],P&&(a[7]=P),v&L&&(a[8]=a[8]==null?u[8]:An(a[8],u[8])),a[9]==null&&(a[9]=u[9]),a[0]=u[0],a[1]=_,a}function HP(a){var u=[];if(a!=null)for(var p in kt(a))u.push(p);return u}function UP(a){return Df.call(a)}function YS(a,u,p){return u=rn(u===t?a.length-1:u,0),function(){for(var v=arguments,_=-1,O=rn(v.length-u,0),D=z(O);++_<O;)D[_]=v[u+_];_=-1;for(var P=z(u+1);++_<u;)P[_]=v[_];return P[u]=p(D),gs(a,this,P)}}function XS(a,u){return u.length<2?a:Wo(a,Hs(u,0,-1))}function zP(a,u){for(var p=a.length,v=An(u.length,p),_=ns(a);v--;){var O=u[v];a[v]=ar(O,p)?_[O]:t}return a}function kg(a,u){if(!(u==="constructor"&&typeof a[u]=="function")&&u!="__proto__")return a[u]}var QS=ZS(wS),_c=rI||function(a,u){return vn.setTimeout(a,u)},Tg=ZS(dP);function JS(a,u,p){var v=u+"";return Tg(a,IP(v,qP(DP(v),p)))}function ZS(a){var u=0,p=0;return function(){var v=cI(),_=pe-(v-p);if(p=v,_>0){if(++u>=ne)return arguments[0]}else u=0;return a.apply(t,arguments)}}function nh(a,u){var p=-1,v=a.length,_=v-1;for(u=u===t?v:u;++p<u;){var O=ug(p,_),D=a[O];a[O]=a[p],a[p]=D}return a.length=u,a}var ex=VP(function(a){var u=[];return a.charCodeAt(0)===46&&u.push(""),a.replace(NL,function(p,v,_,O){u.push(_?O.replace(HL,"$1"):v||p)}),u});function Oi(a){if(typeof a=="string"||vs(a))return a;var u=a+"";return u=="0"&&1/a==-Se?"-0":u}function Uo(a){if(a!=null){try{return Mf.call(a)}catch{}try{return a+""}catch{}}return""}function qP(a,u){return Bs(ae,function(p){var v="_."+p[0];u&p[1]&&!Af(a,v)&&a.push(v)}),a.sort()}function tx(a){if(a instanceof ft)return a.clone();var u=new Vs(a.__wrapped__,a.__chain__);return u.__actions__=ns(a.__actions__),u.__index__=a.__index__,u.__values__=a.__values__,u}function KP(a,u,p){(p?Hn(a,u,p):u===t)?u=1:u=rn(nt(u),0);var v=a==null?0:a.length;if(!v||u<1)return[];for(var _=0,O=0,D=z(Bf(v/u));_<v;)D[O++]=Hs(a,_,_+=u);return D}function jP(a){for(var u=-1,p=a==null?0:a.length,v=0,_=[];++u<p;){var O=a[u];O&&(_[v++]=O)}return _}function GP(){var a=arguments.length;if(!a)return[];for(var u=z(a-1),p=arguments[0],v=a;v--;)u[v-1]=arguments[v];return Ur(Ze(p)?ns(p):[p],wn(u,1))}var YP=lt(function(a,u){return Yt(a)?bc(a,wn(u,1,Yt,!0)):[]}),XP=lt(function(a,u){var p=Us(u);return Yt(p)&&(p=t),Yt(a)?bc(a,wn(u,1,Yt,!0),He(p,2)):[]}),QP=lt(function(a,u){var p=Us(u);return Yt(p)&&(p=t),Yt(a)?bc(a,wn(u,1,Yt,!0),t,p):[]});function JP(a,u,p){var v=a==null?0:a.length;return v?(u=p||u===t?1:nt(u),Hs(a,u<0?0:u,v)):[]}function ZP(a,u,p){var v=a==null?0:a.length;return v?(u=p||u===t?1:nt(u),u=v-u,Hs(a,0,u<0?0:u)):[]}function e$(a,u){return a&&a.length?Gf(a,He(u,3),!0,!0):[]}function t$(a,u){return a&&a.length?Gf(a,He(u,3),!0):[]}function n$(a,u,p,v){var _=a==null?0:a.length;return _?(p&&typeof p!="number"&&Hn(a,u,p)&&(p=0,v=_),GI(a,u,p,v)):[]}function nx(a,u,p){var v=a==null?0:a.length;if(!v)return-1;var _=p==null?0:nt(p);return _<0&&(_=rn(v+_,0)),kf(a,He(u,3),_)}function sx(a,u,p){var v=a==null?0:a.length;if(!v)return-1;var _=v-1;return p!==t&&(_=nt(p),_=p<0?rn(v+_,0):An(_,v-1)),kf(a,He(u,3),_,!0)}function ix(a){var u=a==null?0:a.length;return u?wn(a,1):[]}function s$(a){var u=a==null?0:a.length;return u?wn(a,Se):[]}function i$(a,u){var p=a==null?0:a.length;return p?(u=u===t?1:nt(u),wn(a,u)):[]}function r$(a){for(var u=-1,p=a==null?0:a.length,v={};++u<p;){var _=a[u];v[_[0]]=_[1]}return v}function rx(a){return a&&a.length?a[0]:t}function o$(a,u,p){var v=a==null?0:a.length;if(!v)return-1;var _=p==null?0:nt(p);return _<0&&(_=rn(v+_,0)),Dl(a,u,_)}function l$(a){var u=a==null?0:a.length;return u?Hs(a,0,-1):[]}var a$=lt(function(a){var u=Ht(a,mg);return u.length&&u[0]===a[0]?rg(u):[]}),c$=lt(function(a){var u=Us(a),p=Ht(a,mg);return u===Us(p)?u=t:p.pop(),p.length&&p[0]===a[0]?rg(p,He(u,2)):[]}),u$=lt(function(a){var u=Us(a),p=Ht(a,mg);return u=typeof u=="function"?u:t,u&&p.pop(),p.length&&p[0]===a[0]?rg(p,t,u):[]});function f$(a,u){return a==null?"":lI.call(a,u)}function Us(a){var u=a==null?0:a.length;return u?a[u-1]:t}function h$(a,u,p){var v=a==null?0:a.length;if(!v)return-1;var _=v;return p!==t&&(_=nt(p),_=_<0?rn(v+_,0):An(_,v-1)),u===u?qN(a,u,_):kf(a,F1,_,!0)}function d$(a,u){return a&&a.length?gS(a,nt(u)):t}var p$=lt(ox);function ox(a,u){return a&&a.length&&u&&u.length?cg(a,u):a}function m$(a,u,p){return a&&a.length&&u&&u.length?cg(a,u,He(p,2)):a}function g$(a,u,p){return a&&a.length&&u&&u.length?cg(a,u,t,p):a}var b$=lr(function(a,u){var p=a==null?0:a.length,v=tg(a,u);return vS(a,Ht(u,function(_){return ar(_,p)?+_:_}).sort(OS)),v});function y$(a,u){var p=[];if(!(a&&a.length))return p;var v=-1,_=[],O=a.length;for(u=He(u,3);++v<O;){var D=a[v];u(D,v,a)&&(p.push(D),_.push(v))}return vS(a,_),p}function Og(a){return a==null?a:fI.call(a)}function v$(a,u,p){var v=a==null?0:a.length;return v?(p&&typeof p!="number"&&Hn(a,u,p)?(u=0,p=v):(u=u==null?0:nt(u),p=p===t?v:nt(p)),Hs(a,u,p)):[]}function w$(a,u){return jf(a,u)}function S$(a,u,p){return hg(a,u,He(p,2))}function x$(a,u){var p=a==null?0:a.length;if(p){var v=jf(a,u);if(v<p&&ui(a[v],u))return v}return-1}function _$(a,u){return jf(a,u,!0)}function E$(a,u,p){return hg(a,u,He(p,2),!0)}function C$(a,u){var p=a==null?0:a.length;if(p){var v=jf(a,u,!0)-1;if(ui(a[v],u))return v}return-1}function A$(a){return a&&a.length?SS(a):[]}function k$(a,u){return a&&a.length?SS(a,He(u,2)):[]}function T$(a){var u=a==null?0:a.length;return u?Hs(a,1,u):[]}function O$(a,u,p){return a&&a.length?(u=p||u===t?1:nt(u),Hs(a,0,u<0?0:u)):[]}function R$(a,u,p){var v=a==null?0:a.length;return v?(u=p||u===t?1:nt(u),u=v-u,Hs(a,u<0?0:u,v)):[]}function M$(a,u){return a&&a.length?Gf(a,He(u,3),!1,!0):[]}function D$(a,u){return a&&a.length?Gf(a,He(u,3)):[]}var L$=lt(function(a){return jr(wn(a,1,Yt,!0))}),N$=lt(function(a){var u=Us(a);return Yt(u)&&(u=t),jr(wn(a,1,Yt,!0),He(u,2))}),I$=lt(function(a){var u=Us(a);return u=typeof u=="function"?u:t,jr(wn(a,1,Yt,!0),t,u)});function P$(a){return a&&a.length?jr(a):[]}function $$(a,u){return a&&a.length?jr(a,He(u,2)):[]}function B$(a,u){return u=typeof u=="function"?u:t,a&&a.length?jr(a,t,u):[]}function Rg(a){if(!(a&&a.length))return[];var u=0;return a=Hr(a,function(p){if(Yt(p))return u=rn(p.length,u),!0}),jm(u,function(p){return Ht(a,zm(p))})}function lx(a,u){if(!(a&&a.length))return[];var p=Rg(a);return u==null?p:Ht(p,function(v){return gs(u,t,v)})}var F$=lt(function(a,u){return Yt(a)?bc(a,u):[]}),V$=lt(function(a){return pg(Hr(a,Yt))}),W$=lt(function(a){var u=Us(a);return Yt(u)&&(u=t),pg(Hr(a,Yt),He(u,2))}),H$=lt(function(a){var u=Us(a);return u=typeof u=="function"?u:t,pg(Hr(a,Yt),t,u)}),U$=lt(Rg);function z$(a,u){return CS(a||[],u||[],gc)}function q$(a,u){return CS(a||[],u||[],wc)}var K$=lt(function(a){var u=a.length,p=u>1?a[u-1]:t;return p=typeof p=="function"?(a.pop(),p):t,lx(a,p)});function ax(a){var u=A(a);return u.__chain__=!0,u}function j$(a,u){return u(a),a}function sh(a,u){return u(a)}var G$=lr(function(a){var u=a.length,p=u?a[0]:0,v=this.__wrapped__,_=function(O){return tg(O,a)};return u>1||this.__actions__.length||!(v instanceof ft)||!ar(p)?this.thru(_):(v=v.slice(p,+p+(u?1:0)),v.__actions__.push({func:sh,args:[_],thisArg:t}),new Vs(v,this.__chain__).thru(function(O){return u&&!O.length&&O.push(t),O}))});function Y$(){return ax(this)}function X$(){return new Vs(this.value(),this.__chain__)}function Q$(){this.__values__===t&&(this.__values__=xx(this.value()));var a=this.__index__>=this.__values__.length,u=a?t:this.__values__[this.__index__++];return{done:a,value:u}}function J$(){return this}function Z$(a){for(var u,p=this;p instanceof Hf;){var v=tx(p);v.__index__=0,v.__values__=t,u?_.__wrapped__=v:u=v;var _=v;p=p.__wrapped__}return _.__wrapped__=a,u}function eB(){var a=this.__wrapped__;if(a instanceof ft){var u=a;return this.__actions__.length&&(u=new ft(this)),u=u.reverse(),u.__actions__.push({func:sh,args:[Og],thisArg:t}),new Vs(u,this.__chain__)}return this.thru(Og)}function tB(){return ES(this.__wrapped__,this.__actions__)}var nB=Yf(function(a,u,p){Et.call(a,p)?++a[p]:rr(a,p,1)});function sB(a,u,p){var v=Ze(a)?$1:jI;return p&&Hn(a,u,p)&&(u=t),v(a,He(u,3))}function iB(a,u){var p=Ze(a)?Hr:lS;return p(a,He(u,3))}var rB=IS(nx),oB=IS(sx);function lB(a,u){return wn(ih(a,u),1)}function aB(a,u){return wn(ih(a,u),Se)}function cB(a,u,p){return p=p===t?1:nt(p),wn(ih(a,u),p)}function cx(a,u){var p=Ze(a)?Bs:Kr;return p(a,He(u,3))}function ux(a,u){var p=Ze(a)?TN:oS;return p(a,He(u,3))}var uB=Yf(function(a,u,p){Et.call(a,p)?a[p].push(u):rr(a,p,[u])});function fB(a,u,p,v){a=ss(a)?a:zl(a),p=p&&!v?nt(p):0;var _=a.length;return p<0&&(p=rn(_+p,0)),ch(a)?p<=_&&a.indexOf(u,p)>-1:!!_&&Dl(a,u,p)>-1}var hB=lt(function(a,u,p){var v=-1,_=typeof u=="function",O=ss(a)?z(a.length):[];return Kr(a,function(D){O[++v]=_?gs(u,D,p):yc(D,u,p)}),O}),dB=Yf(function(a,u,p){rr(a,p,u)});function ih(a,u){var p=Ze(a)?Ht:dS;return p(a,He(u,3))}function pB(a,u,p,v){return a==null?[]:(Ze(u)||(u=u==null?[]:[u]),p=v?t:p,Ze(p)||(p=p==null?[]:[p]),bS(a,u,p))}var mB=Yf(function(a,u,p){a[p?0:1].push(u)},function(){return[[],[]]});function gB(a,u,p){var v=Ze(a)?Hm:W1,_=arguments.length<3;return v(a,He(u,4),p,_,Kr)}function bB(a,u,p){var v=Ze(a)?ON:W1,_=arguments.length<3;return v(a,He(u,4),p,_,oS)}function yB(a,u){var p=Ze(a)?Hr:lS;return p(a,lh(He(u,3)))}function vB(a){var u=Ze(a)?nS:fP;return u(a)}function wB(a,u,p){(p?Hn(a,u,p):u===t)?u=1:u=nt(u);var v=Ze(a)?HI:hP;return v(a,u)}function SB(a){var u=Ze(a)?UI:pP;return u(a)}function xB(a){if(a==null)return 0;if(ss(a))return ch(a)?Nl(a):a.length;var u=kn(a);return u==V||u==re?a.size:lg(a).length}function _B(a,u,p){var v=Ze(a)?Um:mP;return p&&Hn(a,u,p)&&(u=t),v(a,He(u,3))}var EB=lt(function(a,u){if(a==null)return[];var p=u.length;return p>1&&Hn(a,u[0],u[1])?u=[]:p>2&&Hn(u[0],u[1],u[2])&&(u=[u[0]]),bS(a,wn(u,1),[])}),rh=iI||function(){return vn.Date.now()};function CB(a,u){if(typeof u!="function")throw new Fs(o);return a=nt(a),function(){if(--a<1)return u.apply(this,arguments)}}function fx(a,u,p){return u=p?t:u,u=a&&u==null?a.length:u,or(a,L,t,t,t,t,u)}function hx(a,u){var p;if(typeof u!="function")throw new Fs(o);return a=nt(a),function(){return--a>0&&(p=u.apply(this,arguments)),a<=1&&(u=t),p}}var Mg=lt(function(a,u,p){var v=x;if(p.length){var _=zr(p,Hl(Mg));v|=R}return or(a,v,u,p,_)}),dx=lt(function(a,u,p){var v=x|S;if(p.length){var _=zr(p,Hl(dx));v|=R}return or(u,v,a,p,_)});function px(a,u,p){u=p?t:u;var v=or(a,E,t,t,t,t,t,u);return v.placeholder=px.placeholder,v}function mx(a,u,p){u=p?t:u;var v=or(a,k,t,t,t,t,t,u);return v.placeholder=mx.placeholder,v}function gx(a,u,p){var v,_,O,D,P,W,ie=0,oe=!1,de=!1,Ae=!0;if(typeof a!="function")throw new Fs(o);u=zs(u)||0,zt(p)&&(oe=!!p.leading,de="maxWait"in p,O=de?rn(zs(p.maxWait)||0,u):O,Ae="trailing"in p?!!p.trailing:Ae);function $e(Xt){var fi=v,fr=_;return v=_=t,ie=Xt,D=a.apply(fr,fi),D}function Ue(Xt){return ie=Xt,P=_c(ut,u),oe?$e(Xt):D}function it(Xt){var fi=Xt-W,fr=Xt-ie,Ix=u-fi;return de?An(Ix,O-fr):Ix}function ze(Xt){var fi=Xt-W,fr=Xt-ie;return W===t||fi>=u||fi<0||de&&fr>=O}function ut(){var Xt=rh();if(ze(Xt))return dt(Xt);P=_c(ut,it(Xt))}function dt(Xt){return P=t,Ae&&v?$e(Xt):(v=_=t,D)}function ws(){P!==t&&AS(P),ie=0,v=W=_=P=t}function Un(){return P===t?D:dt(rh())}function Ss(){var Xt=rh(),fi=ze(Xt);if(v=arguments,_=this,W=Xt,fi){if(P===t)return Ue(W);if(de)return AS(P),P=_c(ut,u),$e(W)}return P===t&&(P=_c(ut,u)),D}return Ss.cancel=ws,Ss.flush=Un,Ss}var AB=lt(function(a,u){return rS(a,1,u)}),kB=lt(function(a,u,p){return rS(a,zs(u)||0,p)});function TB(a){return or(a,F)}function oh(a,u){if(typeof a!="function"||u!=null&&typeof u!="function")throw new Fs(o);var p=function(){var v=arguments,_=u?u.apply(this,v):v[0],O=p.cache;if(O.has(_))return O.get(_);var D=a.apply(this,v);return p.cache=O.set(_,D)||O,D};return p.cache=new(oh.Cache||ir),p}oh.Cache=ir;function lh(a){if(typeof a!="function")throw new Fs(o);return function(){var u=arguments;switch(u.length){case 0:return!a.call(this);case 1:return!a.call(this,u[0]);case 2:return!a.call(this,u[0],u[1]);case 3:return!a.call(this,u[0],u[1],u[2])}return!a.apply(this,u)}}function OB(a){return hx(2,a)}var RB=gP(function(a,u){u=u.length==1&&Ze(u[0])?Ht(u[0],bs(He())):Ht(wn(u,1),bs(He()));var p=u.length;return lt(function(v){for(var _=-1,O=An(v.length,p);++_<O;)v[_]=u[_].call(this,v[_]);return gs(a,this,v)})}),Dg=lt(function(a,u){var p=zr(u,Hl(Dg));return or(a,R,t,u,p)}),bx=lt(function(a,u){var p=zr(u,Hl(bx));return or(a,T,t,u,p)}),MB=lr(function(a,u){return or(a,N,t,t,t,u)});function DB(a,u){if(typeof a!="function")throw new Fs(o);return u=u===t?u:nt(u),lt(a,u)}function LB(a,u){if(typeof a!="function")throw new Fs(o);return u=u==null?0:rn(nt(u),0),lt(function(p){var v=p[u],_=Yr(p,0,u);return v&&Ur(_,v),gs(a,this,_)})}function NB(a,u,p){var v=!0,_=!0;if(typeof a!="function")throw new Fs(o);return zt(p)&&(v="leading"in p?!!p.leading:v,_="trailing"in p?!!p.trailing:_),gx(a,u,{leading:v,maxWait:u,trailing:_})}function IB(a){return fx(a,1)}function PB(a,u){return Dg(gg(u),a)}function $B(){if(!arguments.length)return[];var a=arguments[0];return Ze(a)?a:[a]}function BB(a){return Ws(a,m)}function FB(a,u){return u=typeof u=="function"?u:t,Ws(a,m,u)}function VB(a){return Ws(a,d|m)}function WB(a,u){return u=typeof u=="function"?u:t,Ws(a,d|m,u)}function HB(a,u){return u==null||iS(a,u,dn(u))}function ui(a,u){return a===u||a!==a&&u!==u}var UB=Zf(ig),zB=Zf(function(a,u){return a>=u}),zo=uS((function(){return arguments})())?uS:function(a){return jt(a)&&Et.call(a,"callee")&&!X1.call(a,"callee")},Ze=z.isArray,qB=M1?bs(M1):ZI;function ss(a){return a!=null&&ah(a.length)&&!cr(a)}function Yt(a){return jt(a)&&ss(a)}function KB(a){return a===!0||a===!1||jt(a)&&Wn(a)==se}var Xr=oI||Ug,jB=D1?bs(D1):eP;function GB(a){return jt(a)&&a.nodeType===1&&!Ec(a)}function YB(a){if(a==null)return!0;if(ss(a)&&(Ze(a)||typeof a=="string"||typeof a.splice=="function"||Xr(a)||Ul(a)||zo(a)))return!a.length;var u=kn(a);if(u==V||u==re)return!a.size;if(xc(a))return!lg(a).length;for(var p in a)if(Et.call(a,p))return!1;return!0}function XB(a,u){return vc(a,u)}function QB(a,u,p){p=typeof p=="function"?p:t;var v=p?p(a,u):t;return v===t?vc(a,u,t,p):!!v}function Lg(a){if(!jt(a))return!1;var u=Wn(a);return u==Ke||u==Te||typeof a.message=="string"&&typeof a.name=="string"&&!Ec(a)}function JB(a){return typeof a=="number"&&J1(a)}function cr(a){if(!zt(a))return!1;var u=Wn(a);return u==M||u==I||u==B||u==xe}function yx(a){return typeof a=="number"&&a==nt(a)}function ah(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=H}function zt(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function jt(a){return a!=null&&typeof a=="object"}var vx=L1?bs(L1):nP;function ZB(a,u){return a===u||og(a,u,_g(u))}function e3(a,u,p){return p=typeof p=="function"?p:t,og(a,u,_g(u),p)}function t3(a){return wx(a)&&a!=+a}function n3(a){if(FP(a))throw new Qe(r);return fS(a)}function s3(a){return a===null}function i3(a){return a==null}function wx(a){return typeof a=="number"||jt(a)&&Wn(a)==G}function Ec(a){if(!jt(a)||Wn(a)!=K)return!1;var u=If(a);if(u===null)return!0;var p=Et.call(u,"constructor")&&u.constructor;return typeof p=="function"&&p instanceof p&&Mf.call(p)==eI}var Ng=N1?bs(N1):sP;function r3(a){return yx(a)&&a>=-H&&a<=H}var Sx=I1?bs(I1):iP;function ch(a){return typeof a=="string"||!Ze(a)&&jt(a)&&Wn(a)==Be}function vs(a){return typeof a=="symbol"||jt(a)&&Wn(a)==Ce}var Ul=P1?bs(P1):rP;function o3(a){return a===t}function l3(a){return jt(a)&&kn(a)==Ve}function a3(a){return jt(a)&&Wn(a)==rt}var c3=Zf(ag),u3=Zf(function(a,u){return a<=u});function xx(a){if(!a)return[];if(ss(a))return ch(a)?ai(a):ns(a);if(fc&&a[fc])return HN(a[fc]());var u=kn(a),p=u==V?Ym:u==re?Tf:zl;return p(a)}function ur(a){if(!a)return a===0?a:0;if(a=zs(a),a===Se||a===-Se){var u=a<0?-1:1;return u*ge}return a===a?a:0}function nt(a){var u=ur(a),p=u%1;return u===u?p?u-p:u:0}function _x(a){return a?Vo(nt(a),0,X):0}function zs(a){if(typeof a=="number")return a;if(vs(a))return Z;if(zt(a)){var u=typeof a.valueOf=="function"?a.valueOf():a;a=zt(u)?u+"":u}if(typeof a!="string")return a===0?a:+a;a=H1(a);var p=qL.test(a);return p||jL.test(a)?CN(a.slice(2),p?2:8):zL.test(a)?Z:+a}function Ex(a){return Ti(a,is(a))}function f3(a){return a?Vo(nt(a),-H,H):a===0?a:0}function St(a){return a==null?"":ys(a)}var h3=Vl(function(a,u){if(xc(u)||ss(u)){Ti(u,dn(u),a);return}for(var p in u)Et.call(u,p)&&gc(a,p,u[p])}),Cx=Vl(function(a,u){Ti(u,is(u),a)}),uh=Vl(function(a,u,p,v){Ti(u,is(u),a,v)}),d3=Vl(function(a,u,p,v){Ti(u,dn(u),a,v)}),p3=lr(tg);function m3(a,u){var p=Fl(a);return u==null?p:sS(p,u)}var g3=lt(function(a,u){a=kt(a);var p=-1,v=u.length,_=v>2?u[2]:t;for(_&&Hn(u[0],u[1],_)&&(v=1);++p<v;)for(var O=u[p],D=is(O),P=-1,W=D.length;++P<W;){var ie=D[P],oe=a[ie];(oe===t||ui(oe,Pl[ie])&&!Et.call(a,ie))&&(a[ie]=O[ie])}return a}),b3=lt(function(a){return a.push(t,HS),gs(Ax,t,a)});function y3(a,u){return B1(a,He(u,3),ki)}function v3(a,u){return B1(a,He(u,3),sg)}function w3(a,u){return a==null?a:ng(a,He(u,3),is)}function S3(a,u){return a==null?a:aS(a,He(u,3),is)}function x3(a,u){return a&&ki(a,He(u,3))}function _3(a,u){return a&&sg(a,He(u,3))}function E3(a){return a==null?[]:qf(a,dn(a))}function C3(a){return a==null?[]:qf(a,is(a))}function Ig(a,u,p){var v=a==null?t:Wo(a,u);return v===t?p:v}function A3(a,u){return a!=null&&qS(a,u,YI)}function Pg(a,u){return a!=null&&qS(a,u,XI)}var k3=$S(function(a,u,p){u!=null&&typeof u.toString!="function"&&(u=Df.call(u)),a[u]=p},Bg(rs)),T3=$S(function(a,u,p){u!=null&&typeof u.toString!="function"&&(u=Df.call(u)),Et.call(a,u)?a[u].push(p):a[u]=[p]},He),O3=lt(yc);function dn(a){return ss(a)?tS(a):lg(a)}function is(a){return ss(a)?tS(a,!0):oP(a)}function R3(a,u){var p={};return u=He(u,3),ki(a,function(v,_,O){rr(p,u(v,_,O),v)}),p}function M3(a,u){var p={};return u=He(u,3),ki(a,function(v,_,O){rr(p,_,u(v,_,O))}),p}var D3=Vl(function(a,u,p){Kf(a,u,p)}),Ax=Vl(function(a,u,p,v){Kf(a,u,p,v)}),L3=lr(function(a,u){var p={};if(a==null)return p;var v=!1;u=Ht(u,function(O){return O=Gr(O,a),v||(v=O.length>1),O}),Ti(a,Sg(a),p),v&&(p=Ws(p,d|g|m,kP));for(var _=u.length;_--;)dg(p,u[_]);return p});function N3(a,u){return kx(a,lh(He(u)))}var I3=lr(function(a,u){return a==null?{}:aP(a,u)});function kx(a,u){if(a==null)return{};var p=Ht(Sg(a),function(v){return[v]});return u=He(u),yS(a,p,function(v,_){return u(v,_[0])})}function P3(a,u,p){u=Gr(u,a);var v=-1,_=u.length;for(_||(_=1,a=t);++v<_;){var O=a==null?t:a[Oi(u[v])];O===t&&(v=_,O=p),a=cr(O)?O.call(a):O}return a}function $3(a,u,p){return a==null?a:wc(a,u,p)}function B3(a,u,p,v){return v=typeof v=="function"?v:t,a==null?a:wc(a,u,p,v)}var Tx=VS(dn),Ox=VS(is);function F3(a,u,p){var v=Ze(a),_=v||Xr(a)||Ul(a);if(u=He(u,4),p==null){var O=a&&a.constructor;_?p=v?new O:[]:zt(a)?p=cr(O)?Fl(If(a)):{}:p={}}return(_?Bs:ki)(a,function(D,P,W){return u(p,D,P,W)}),p}function V3(a,u){return a==null?!0:dg(a,u)}function W3(a,u,p){return a==null?a:_S(a,u,gg(p))}function H3(a,u,p,v){return v=typeof v=="function"?v:t,a==null?a:_S(a,u,gg(p),v)}function zl(a){return a==null?[]:Gm(a,dn(a))}function U3(a){return a==null?[]:Gm(a,is(a))}function z3(a,u,p){return p===t&&(p=u,u=t),p!==t&&(p=zs(p),p=p===p?p:0),u!==t&&(u=zs(u),u=u===u?u:0),Vo(zs(a),u,p)}function q3(a,u,p){return u=ur(u),p===t?(p=u,u=0):p=ur(p),a=zs(a),QI(a,u,p)}function K3(a,u,p){if(p&&typeof p!="boolean"&&Hn(a,u,p)&&(u=p=t),p===t&&(typeof u=="boolean"?(p=u,u=t):typeof a=="boolean"&&(p=a,a=t)),a===t&&u===t?(a=0,u=1):(a=ur(a),u===t?(u=a,a=0):u=ur(u)),a>u){var v=a;a=u,u=v}if(p||a%1||u%1){var _=Z1();return An(a+_*(u-a+EN("1e-"+((_+"").length-1))),u)}return ug(a,u)}var j3=Wl(function(a,u,p){return u=u.toLowerCase(),a+(p?Rx(u):u)});function Rx(a){return $g(St(a).toLowerCase())}function Mx(a){return a=St(a),a&&a.replace(YL,$N).replace(pN,"")}function G3(a,u,p){a=St(a),u=ys(u);var v=a.length;p=p===t?v:Vo(nt(p),0,v);var _=p;return p-=u.length,p>=0&&a.slice(p,_)==u}function Y3(a){return a=St(a),a&&OL.test(a)?a.replace(a1,BN):a}function X3(a){return a=St(a),a&&IL.test(a)?a.replace(Dm,"\\$&"):a}var Q3=Wl(function(a,u,p){return a+(p?"-":"")+u.toLowerCase()}),J3=Wl(function(a,u,p){return a+(p?" ":"")+u.toLowerCase()}),Z3=NS("toLowerCase");function eF(a,u,p){a=St(a),u=nt(u);var v=u?Nl(a):0;if(!u||v>=u)return a;var _=(u-v)/2;return Jf(Ff(_),p)+a+Jf(Bf(_),p)}function tF(a,u,p){a=St(a),u=nt(u);var v=u?Nl(a):0;return u&&v<u?a+Jf(u-v,p):a}function nF(a,u,p){a=St(a),u=nt(u);var v=u?Nl(a):0;return u&&v<u?Jf(u-v,p)+a:a}function sF(a,u,p){return p||u==null?u=0:u&&(u=+u),uI(St(a).replace(Lm,""),u||0)}function iF(a,u,p){return(p?Hn(a,u,p):u===t)?u=1:u=nt(u),fg(St(a),u)}function rF(){var a=arguments,u=St(a[0]);return a.length<3?u:u.replace(a[1],a[2])}var oF=Wl(function(a,u,p){return a+(p?"_":"")+u.toLowerCase()});function lF(a,u,p){return p&&typeof p!="number"&&Hn(a,u,p)&&(u=p=t),p=p===t?X:p>>>0,p?(a=St(a),a&&(typeof u=="string"||u!=null&&!Ng(u))&&(u=ys(u),!u&&Ll(a))?Yr(ai(a),0,p):a.split(u,p)):[]}var aF=Wl(function(a,u,p){return a+(p?" ":"")+$g(u)});function cF(a,u,p){return a=St(a),p=p==null?0:Vo(nt(p),0,a.length),u=ys(u),a.slice(p,p+u.length)==u}function uF(a,u,p){var v=A.templateSettings;p&&Hn(a,u,p)&&(u=t),a=St(a),u=uh({},u,v,WS);var _=uh({},u.imports,v.imports,WS),O=dn(_),D=Gm(_,O),P,W,ie=0,oe=u.interpolate||_f,de="__p += '",Ae=Xm((u.escape||_f).source+"|"+oe.source+"|"+(oe===c1?UL:_f).source+"|"+(u.evaluate||_f).source+"|$","g"),$e="//# sourceURL="+(Et.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++vN+"]")+`
`;a.replace(Ae,function(ze,ut,dt,ws,Un,Ss){return dt||(dt=ws),de+=a.slice(ie,Ss).replace(XL,FN),ut&&(P=!0,de+=`' +
__e(`+ut+`) +
'`),Un&&(W=!0,de+=`';
`+Un+`;
__p += '`),dt&&(de+=`' +
((__t = (`+dt+`)) == null ? '' : __t) +
'`),ie=Ss+ze.length,ze}),de+=`';
`;var Ue=Et.call(u,"variable")&&u.variable;if(!Ue)de=`with (obj) {
`+de+`
}
`;else if(WL.test(Ue))throw new Qe(l);de=(W?de.replace(xf,""):de).replace(AL,"$1").replace(kL,"$1;"),de="function("+(Ue||"obj")+`) {
`+(Ue?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(P?", __e = _.escape":"")+(W?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+de+`return __p
}`;var it=Lx(function(){return vt(O,$e+"return "+de).apply(t,D)});if(it.source=de,Lg(it))throw it;return it}function fF(a){return St(a).toLowerCase()}function hF(a){return St(a).toUpperCase()}function dF(a,u,p){if(a=St(a),a&&(p||u===t))return H1(a);if(!a||!(u=ys(u)))return a;var v=ai(a),_=ai(u),O=U1(v,_),D=z1(v,_)+1;return Yr(v,O,D).join("")}function pF(a,u,p){if(a=St(a),a&&(p||u===t))return a.slice(0,K1(a)+1);if(!a||!(u=ys(u)))return a;var v=ai(a),_=z1(v,ai(u))+1;return Yr(v,0,_).join("")}function mF(a,u,p){if(a=St(a),a&&(p||u===t))return a.replace(Lm,"");if(!a||!(u=ys(u)))return a;var v=ai(a),_=U1(v,ai(u));return Yr(v,_).join("")}function gF(a,u){var p=ee,v=ce;if(zt(u)){var _="separator"in u?u.separator:_;p="length"in u?nt(u.length):p,v="omission"in u?ys(u.omission):v}a=St(a);var O=a.length;if(Ll(a)){var D=ai(a);O=D.length}if(p>=O)return a;var P=p-Nl(v);if(P<1)return v;var W=D?Yr(D,0,P).join(""):a.slice(0,P);if(_===t)return W+v;if(D&&(P+=W.length-P),Ng(_)){if(a.slice(P).search(_)){var ie,oe=W;for(_.global||(_=Xm(_.source,St(u1.exec(_))+"g")),_.lastIndex=0;ie=_.exec(oe);)var de=ie.index;W=W.slice(0,de===t?P:de)}}else if(a.indexOf(ys(_),P)!=P){var Ae=W.lastIndexOf(_);Ae>-1&&(W=W.slice(0,Ae))}return W+v}function bF(a){return a=St(a),a&&TL.test(a)?a.replace(l1,KN):a}var yF=Wl(function(a,u,p){return a+(p?" ":"")+u.toUpperCase()}),$g=NS("toUpperCase");function Dx(a,u,p){return a=St(a),u=p?t:u,u===t?WN(a)?YN(a):DN(a):a.match(u)||[]}var Lx=lt(function(a,u){try{return gs(a,t,u)}catch(p){return Lg(p)?p:new Qe(p)}}),vF=lr(function(a,u){return Bs(u,function(p){p=Oi(p),rr(a,p,Mg(a[p],a))}),a});function wF(a){var u=a==null?0:a.length,p=He();return a=u?Ht(a,function(v){if(typeof v[1]!="function")throw new Fs(o);return[p(v[0]),v[1]]}):[],lt(function(v){for(var _=-1;++_<u;){var O=a[_];if(gs(O[0],this,v))return gs(O[1],this,v)}})}function SF(a){return KI(Ws(a,d))}function Bg(a){return function(){return a}}function xF(a,u){return a==null||a!==a?u:a}var _F=PS(),EF=PS(!0);function rs(a){return a}function Fg(a){return hS(typeof a=="function"?a:Ws(a,d))}function CF(a){return pS(Ws(a,d))}function AF(a,u){return mS(a,Ws(u,d))}var kF=lt(function(a,u){return function(p){return yc(p,a,u)}}),TF=lt(function(a,u){return function(p){return yc(a,p,u)}});function Vg(a,u,p){var v=dn(u),_=qf(u,v);p==null&&!(zt(u)&&(_.length||!v.length))&&(p=u,u=a,a=this,_=qf(u,dn(u)));var O=!(zt(p)&&"chain"in p)||!!p.chain,D=cr(a);return Bs(_,function(P){var W=u[P];a[P]=W,D&&(a.prototype[P]=function(){var ie=this.__chain__;if(O||ie){var oe=a(this.__wrapped__),de=oe.__actions__=ns(this.__actions__);return de.push({func:W,args:arguments,thisArg:a}),oe.__chain__=ie,oe}return W.apply(a,Ur([this.value()],arguments))})}),a}function OF(){return vn._===this&&(vn._=tI),this}function Wg(){}function RF(a){return a=nt(a),lt(function(u){return gS(u,a)})}var MF=yg(Ht),DF=yg($1),LF=yg(Um);function Nx(a){return Cg(a)?zm(Oi(a)):cP(a)}function NF(a){return function(u){return a==null?t:Wo(a,u)}}var IF=BS(),PF=BS(!0);function Hg(){return[]}function Ug(){return!1}function $F(){return{}}function BF(){return""}function FF(){return!0}function VF(a,u){if(a=nt(a),a<1||a>H)return[];var p=X,v=An(a,X);u=He(u),a-=X;for(var _=jm(v,u);++p<a;)u(p);return _}function WF(a){return Ze(a)?Ht(a,Oi):vs(a)?[a]:ns(ex(St(a)))}function HF(a){var u=++ZN;return St(a)+u}var UF=Qf(function(a,u){return a+u},0),zF=vg("ceil"),qF=Qf(function(a,u){return a/u},1),KF=vg("floor");function jF(a){return a&&a.length?zf(a,rs,ig):t}function GF(a,u){return a&&a.length?zf(a,He(u,2),ig):t}function YF(a){return V1(a,rs)}function XF(a,u){return V1(a,He(u,2))}function QF(a){return a&&a.length?zf(a,rs,ag):t}function JF(a,u){return a&&a.length?zf(a,He(u,2),ag):t}var ZF=Qf(function(a,u){return a*u},1),eV=vg("round"),tV=Qf(function(a,u){return a-u},0);function nV(a){return a&&a.length?Km(a,rs):0}function sV(a,u){return a&&a.length?Km(a,He(u,2)):0}return A.after=CB,A.ary=fx,A.assign=h3,A.assignIn=Cx,A.assignInWith=uh,A.assignWith=d3,A.at=p3,A.before=hx,A.bind=Mg,A.bindAll=vF,A.bindKey=dx,A.castArray=$B,A.chain=ax,A.chunk=KP,A.compact=jP,A.concat=GP,A.cond=wF,A.conforms=SF,A.constant=Bg,A.countBy=nB,A.create=m3,A.curry=px,A.curryRight=mx,A.debounce=gx,A.defaults=g3,A.defaultsDeep=b3,A.defer=AB,A.delay=kB,A.difference=YP,A.differenceBy=XP,A.differenceWith=QP,A.drop=JP,A.dropRight=ZP,A.dropRightWhile=e$,A.dropWhile=t$,A.fill=n$,A.filter=iB,A.flatMap=lB,A.flatMapDeep=aB,A.flatMapDepth=cB,A.flatten=ix,A.flattenDeep=s$,A.flattenDepth=i$,A.flip=TB,A.flow=_F,A.flowRight=EF,A.fromPairs=r$,A.functions=E3,A.functionsIn=C3,A.groupBy=uB,A.initial=l$,A.intersection=a$,A.intersectionBy=c$,A.intersectionWith=u$,A.invert=k3,A.invertBy=T3,A.invokeMap=hB,A.iteratee=Fg,A.keyBy=dB,A.keys=dn,A.keysIn=is,A.map=ih,A.mapKeys=R3,A.mapValues=M3,A.matches=CF,A.matchesProperty=AF,A.memoize=oh,A.merge=D3,A.mergeWith=Ax,A.method=kF,A.methodOf=TF,A.mixin=Vg,A.negate=lh,A.nthArg=RF,A.omit=L3,A.omitBy=N3,A.once=OB,A.orderBy=pB,A.over=MF,A.overArgs=RB,A.overEvery=DF,A.overSome=LF,A.partial=Dg,A.partialRight=bx,A.partition=mB,A.pick=I3,A.pickBy=kx,A.property=Nx,A.propertyOf=NF,A.pull=p$,A.pullAll=ox,A.pullAllBy=m$,A.pullAllWith=g$,A.pullAt=b$,A.range=IF,A.rangeRight=PF,A.rearg=MB,A.reject=yB,A.remove=y$,A.rest=DB,A.reverse=Og,A.sampleSize=wB,A.set=$3,A.setWith=B3,A.shuffle=SB,A.slice=v$,A.sortBy=EB,A.sortedUniq=A$,A.sortedUniqBy=k$,A.split=lF,A.spread=LB,A.tail=T$,A.take=O$,A.takeRight=R$,A.takeRightWhile=M$,A.takeWhile=D$,A.tap=j$,A.throttle=NB,A.thru=sh,A.toArray=xx,A.toPairs=Tx,A.toPairsIn=Ox,A.toPath=WF,A.toPlainObject=Ex,A.transform=F3,A.unary=IB,A.union=L$,A.unionBy=N$,A.unionWith=I$,A.uniq=P$,A.uniqBy=$$,A.uniqWith=B$,A.unset=V3,A.unzip=Rg,A.unzipWith=lx,A.update=W3,A.updateWith=H3,A.values=zl,A.valuesIn=U3,A.without=F$,A.words=Dx,A.wrap=PB,A.xor=V$,A.xorBy=W$,A.xorWith=H$,A.zip=U$,A.zipObject=z$,A.zipObjectDeep=q$,A.zipWith=K$,A.entries=Tx,A.entriesIn=Ox,A.extend=Cx,A.extendWith=uh,Vg(A,A),A.add=UF,A.attempt=Lx,A.camelCase=j3,A.capitalize=Rx,A.ceil=zF,A.clamp=z3,A.clone=BB,A.cloneDeep=VB,A.cloneDeepWith=WB,A.cloneWith=FB,A.conformsTo=HB,A.deburr=Mx,A.defaultTo=xF,A.divide=qF,A.endsWith=G3,A.eq=ui,A.escape=Y3,A.escapeRegExp=X3,A.every=sB,A.find=rB,A.findIndex=nx,A.findKey=y3,A.findLast=oB,A.findLastIndex=sx,A.findLastKey=v3,A.floor=KF,A.forEach=cx,A.forEachRight=ux,A.forIn=w3,A.forInRight=S3,A.forOwn=x3,A.forOwnRight=_3,A.get=Ig,A.gt=UB,A.gte=zB,A.has=A3,A.hasIn=Pg,A.head=rx,A.identity=rs,A.includes=fB,A.indexOf=o$,A.inRange=q3,A.invoke=O3,A.isArguments=zo,A.isArray=Ze,A.isArrayBuffer=qB,A.isArrayLike=ss,A.isArrayLikeObject=Yt,A.isBoolean=KB,A.isBuffer=Xr,A.isDate=jB,A.isElement=GB,A.isEmpty=YB,A.isEqual=XB,A.isEqualWith=QB,A.isError=Lg,A.isFinite=JB,A.isFunction=cr,A.isInteger=yx,A.isLength=ah,A.isMap=vx,A.isMatch=ZB,A.isMatchWith=e3,A.isNaN=t3,A.isNative=n3,A.isNil=i3,A.isNull=s3,A.isNumber=wx,A.isObject=zt,A.isObjectLike=jt,A.isPlainObject=Ec,A.isRegExp=Ng,A.isSafeInteger=r3,A.isSet=Sx,A.isString=ch,A.isSymbol=vs,A.isTypedArray=Ul,A.isUndefined=o3,A.isWeakMap=l3,A.isWeakSet=a3,A.join=f$,A.kebabCase=Q3,A.last=Us,A.lastIndexOf=h$,A.lowerCase=J3,A.lowerFirst=Z3,A.lt=c3,A.lte=u3,A.max=jF,A.maxBy=GF,A.mean=YF,A.meanBy=XF,A.min=QF,A.minBy=JF,A.stubArray=Hg,A.stubFalse=Ug,A.stubObject=$F,A.stubString=BF,A.stubTrue=FF,A.multiply=ZF,A.nth=d$,A.noConflict=OF,A.noop=Wg,A.now=rh,A.pad=eF,A.padEnd=tF,A.padStart=nF,A.parseInt=sF,A.random=K3,A.reduce=gB,A.reduceRight=bB,A.repeat=iF,A.replace=rF,A.result=P3,A.round=eV,A.runInContext=$,A.sample=vB,A.size=xB,A.snakeCase=oF,A.some=_B,A.sortedIndex=w$,A.sortedIndexBy=S$,A.sortedIndexOf=x$,A.sortedLastIndex=_$,A.sortedLastIndexBy=E$,A.sortedLastIndexOf=C$,A.startCase=aF,A.startsWith=cF,A.subtract=tV,A.sum=nV,A.sumBy=sV,A.template=uF,A.times=VF,A.toFinite=ur,A.toInteger=nt,A.toLength=_x,A.toLower=fF,A.toNumber=zs,A.toSafeInteger=f3,A.toString=St,A.toUpper=hF,A.trim=dF,A.trimEnd=pF,A.trimStart=mF,A.truncate=gF,A.unescape=bF,A.uniqueId=HF,A.upperCase=yF,A.upperFirst=$g,A.each=cx,A.eachRight=ux,A.first=rx,Vg(A,(function(){var a={};return ki(A,function(u,p){Et.call(A.prototype,p)||(a[p]=u)}),a})(),{chain:!1}),A.VERSION=s,Bs(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){A[a].placeholder=A}),Bs(["drop","take"],function(a,u){ft.prototype[a]=function(p){p=p===t?1:rn(nt(p),0);var v=this.__filtered__&&!u?new ft(this):this.clone();return v.__filtered__?v.__takeCount__=An(p,v.__takeCount__):v.__views__.push({size:An(p,X),type:a+(v.__dir__<0?"Right":"")}),v},ft.prototype[a+"Right"]=function(p){return this.reverse()[a](p).reverse()}}),Bs(["filter","map","takeWhile"],function(a,u){var p=u+1,v=p==Y||p==J;ft.prototype[a]=function(_){var O=this.clone();return O.__iteratees__.push({iteratee:He(_,3),type:p}),O.__filtered__=O.__filtered__||v,O}}),Bs(["head","last"],function(a,u){var p="take"+(u?"Right":"");ft.prototype[a]=function(){return this[p](1).value()[0]}}),Bs(["initial","tail"],function(a,u){var p="drop"+(u?"":"Right");ft.prototype[a]=function(){return this.__filtered__?new ft(this):this[p](1)}}),ft.prototype.compact=function(){return this.filter(rs)},ft.prototype.find=function(a){return this.filter(a).head()},ft.prototype.findLast=function(a){return this.reverse().find(a)},ft.prototype.invokeMap=lt(function(a,u){return typeof a=="function"?new ft(this):this.map(function(p){return yc(p,a,u)})}),ft.prototype.reject=function(a){return this.filter(lh(He(a)))},ft.prototype.slice=function(a,u){a=nt(a);var p=this;return p.__filtered__&&(a>0||u<0)?new ft(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),u!==t&&(u=nt(u),p=u<0?p.dropRight(-u):p.take(u-a)),p)},ft.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},ft.prototype.toArray=function(){return this.take(X)},ki(ft.prototype,function(a,u){var p=/^(?:filter|find|map|reject)|While$/.test(u),v=/^(?:head|last)$/.test(u),_=A[v?"take"+(u=="last"?"Right":""):u],O=v||/^find/.test(u);_&&(A.prototype[u]=function(){var D=this.__wrapped__,P=v?[1]:arguments,W=D instanceof ft,ie=P[0],oe=W||Ze(D),de=function(ut){var dt=_.apply(A,Ur([ut],P));return v&&Ae?dt[0]:dt};oe&&p&&typeof ie=="function"&&ie.length!=1&&(W=oe=!1);var Ae=this.__chain__,$e=!!this.__actions__.length,Ue=O&&!Ae,it=W&&!$e;if(!O&&oe){D=it?D:new ft(this);var ze=a.apply(D,P);return ze.__actions__.push({func:sh,args:[de],thisArg:t}),new Vs(ze,Ae)}return Ue&&it?a.apply(this,P):(ze=this.thru(de),Ue?v?ze.value()[0]:ze.value():ze)})}),Bs(["pop","push","shift","sort","splice","unshift"],function(a){var u=Of[a],p=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",v=/^(?:pop|shift)$/.test(a);A.prototype[a]=function(){var _=arguments;if(v&&!this.__chain__){var O=this.value();return u.apply(Ze(O)?O:[],_)}return this[p](function(D){return u.apply(Ze(D)?D:[],_)})}}),ki(ft.prototype,function(a,u){var p=A[u];if(p){var v=p.name+"";Et.call(Bl,v)||(Bl[v]=[]),Bl[v].push({name:u,func:p})}}),Bl[Xf(t,S).name]=[{name:"wrapper",func:t}],ft.prototype.clone=bI,ft.prototype.reverse=yI,ft.prototype.value=vI,A.prototype.at=G$,A.prototype.chain=Y$,A.prototype.commit=X$,A.prototype.next=Q$,A.prototype.plant=Z$,A.prototype.reverse=eB,A.prototype.toJSON=A.prototype.valueOf=A.prototype.value=tB,A.prototype.first=A.prototype.head,fc&&(A.prototype[fc]=J$),A}),Il=XN();Po?((Po.exports=Il)._=Il,Fm._=Il):vn._=Il}).call(rH)})(qc,qc.exports)),qc.exports}var Lr=oH();function Fn(n,e){let t=n;for(const[s,i]of Object.entries(e))t=t.replace(`:${s}`,i);return t}function UT(n=5){const e="abcdefghijklmnopqrstuvwxyz";let t="";for(let s=0;s<n;s++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}function lH(n=[],{KeySchema:e=[]}){const t=e.find(({KeyType:o})=>o==="HASH")??{},s=e.find(({KeyType:o})=>o==="RANGE")??{},i=new Set;n.forEach(o=>{Object.keys(o).forEach(i.add,i)});const r=Array.from(i).filter(o=>![t.AttributeName,s.AttributeName].includes(o)).sort();return s.AttributeName&&r.unshift(s.AttributeName),r.unshift(t.AttributeName),r}function aH({indexName:n,table:e}){let t=[];n===e.TableName?t=e.KeySchema??[]:t=[...e.GlobalSecondaryIndexes??[],...e.LocalSecondaryIndexes??[]].find(({IndexName:l})=>l===n)?.KeySchema??[];const s=t.map(o=>{const{AttributeType:l}=e.AttributeDefinitions.find(c=>o.AttributeName===c.AttributeName);return{...o,AttributeType:l}}),i=s.find(({KeyType:o})=>o==="HASH"),r=s.find(({KeyType:o})=>o==="RANGE");return{pk:i,sk:r,keySchemaWithAttributeType:s}}function dr(n,e){if(e==="S")return String(n);if(e==="N")return parseInt(n);if(e==="BOOL")return String(n)==="true"}function zT({table:n,indexName:e,parameters:t}){const{pk:s,sk:i}=aH({table:n,indexName:e});if(!s||!t?.keys)return;let r="",o="";const l={},c={};s&&t.keys.pk.value&&(o=`#${s.AttributeName} ${t.keys.pk.condition} :${s.AttributeName}`,l[`#${s.AttributeName}`]=s.AttributeName,c[`:${s.AttributeName}`]=dr(t.keys.pk.value,s.AttributeType)),s&&t.keys.sk&&i&&t.keys.sk.value1&&(l[`#${i.AttributeName}`]=i.AttributeName,t.keys.sk.condition==="begins_with"?(r=`begins_with(#${i.AttributeName}, :${i.AttributeName})`,c[`:${i.AttributeName}`]=dr(t.keys.sk.value1,i.AttributeType)):t.keys.sk.condition==="between"?(r=`#${i.AttributeName} between :${i.AttributeName}1 and :${i.AttributeName}2`,c[`:${i.AttributeName}1`]=dr(t.keys.sk.value1,i.AttributeType),c[`:${i.AttributeName}2`]=dr(t.keys.sk.value2,i.AttributeType)):(r=`#${i.AttributeName} ${t.keys.sk.condition} :${i.AttributeName}`,c[`:${i.AttributeName}`]=dr(t.keys.sk.value1,i.AttributeType)));const f=[];let h=t.scan??[];h=h.filter(({name:m})=>!!m).map(m=>({...m,salt:UT()}));for(const m of h){let{name:y}=m;const{value:w,type:x,condition:S,value2:C,salt:E}=m,k=y.split(".");y=y.replaceAll(".",".#");let R="";if(S){if(["attribute_exists","attribute_not_exists"].includes(S)){R=`${S}(#${y})`,k.map(T=>l[`#${T}`]=T),f.push(R);continue}!y||!x||S==="between"&&!C||(["begins_with","contains","not contains"].includes(S)?(R=`${S}(#${y}, :${E})`,k.map(T=>l[`#${T}`]=T),c[`:${E}`]=dr(w,x)):S==="between"?(R=`#${y} between :${E}1 and :${E}2`,k.map(T=>l[`#${T}`]=T),c[`:${E}1`]=dr(w,x),c[`:${E}2`]=dr(C,x)):(R=`#${y} ${S} :${E}`,k.map(T=>l[`#${T}`]=T),c[`:${E}`]=dr(w,x)),f.push(R))}}const d=e===n.TableName?null:e,g={...d&&{IndexName:d},...s&&t.keys.pk.value&&{KeyConditionExpression:i&&t.keys.sk?.value1?[o,r].join(" and "):o},...Object.keys(f).length&&{FilterExpression:f.join(" and ")},...Object.keys(l).length&&{ExpressionAttributeNames:l},...Object.keys(c).length&&{ExpressionAttributeValues:c},ScanIndexForward:!!t.keys.sk.scanIndexForward};return g.ScanIndexForward&&delete g.ScanIndexForward,g}function cH({indices:n=[],deleteIndices:e=[]}){const t={},s=n.filter(({readOnly:i})=>!i);if((s.length||e.length)&&(t.GlobalSecondaryIndexUpdates=[]),e.length){const i=e.map(r=>({Delete:{IndexName:r}}));t.GlobalSecondaryIndexUpdates.push(...i)}if(s.length){t.AttributeDefinitions=[];const i=s.map(({name:r,pk:o={name:"",type:""},sk:l={name:"",type:""}})=>{const c={IndexName:r,Projection:{ProjectionType:"ALL"},KeySchema:[{AttributeName:o.name,KeyType:"HASH"},...l.name.trim()?[{AttributeName:l.name,KeyType:"RANGE"}]:[]],ProvisionedThroughput:{ReadCapacityUnits:5,WriteCapacityUnits:5}},f=t.AttributeDefinitions.find(({AttributeName:d})=>d===o.name),h=t.AttributeDefinitions.find(({AttributeName:d})=>d===l.name);return f||t.AttributeDefinitions.push({AttributeName:o.name,AttributeType:o.type}),!h&&l.name.trim()&&t.AttributeDefinitions.push({AttributeName:l.name,AttributeType:l.type}),c});t.GlobalSecondaryIndexUpdates.push(...i.map(r=>({Create:r})))}return t}function uH({name:n="",throughput:{read:e=5,write:t=5},keySchema:{pk:s={name:"",type:""},sk:i={name:"",type:""}},indices:r=[]}){const o={TableName:n,ProvisionedThroughput:{ReadCapacityUnits:e,WriteCapacityUnits:t},KeySchema:[{AttributeName:s.name,KeyType:"HASH"},...i.name.trim()?[{AttributeName:i.name,KeyType:"RANGE"}]:[]],AttributeDefinitions:[{AttributeName:s.name,AttributeType:s.type},...i.name.trim()?[{AttributeName:i.name,AttributeType:i.type}]:[]]},l=r.filter(({type:f})=>f==="GSI"),c=r.filter(({type:f})=>f==="LSI");return l.length&&(o.GlobalSecondaryIndexes=l.map(({name:f,pk:h={name:"",type:""},sk:d={name:"",type:""}})=>{const g={IndexName:f,Projection:{ProjectionType:"ALL"},KeySchema:[{AttributeName:h.name,KeyType:"HASH"},...d.name.trim()?[{AttributeName:d.name,KeyType:"RANGE"}]:[]],ProvisionedThroughput:{ReadCapacityUnits:e,WriteCapacityUnits:t}},m=o.AttributeDefinitions.find(({AttributeName:w})=>w===h.name),y=o.AttributeDefinitions.find(({AttributeName:w})=>w===d.name);return m||o.AttributeDefinitions.push({AttributeName:h.name,AttributeType:h.type}),!y&&d.name.trim()&&o.AttributeDefinitions.push({AttributeName:d.name,AttributeType:d.type}),g})),c.length&&(o.LocalSecondaryIndexes=c.map(({name:f,sk:h={name:"",type:""}})=>{const d={IndexName:f,Projection:{ProjectionType:"ALL"},KeySchema:[{AttributeName:s.name,KeyType:"HASH"},...h.name.trim()?[{AttributeName:h.name,KeyType:"RANGE"}]:[]]};return o.AttributeDefinitions.find(({AttributeName:m})=>m===h.name)||o.AttributeDefinitions.push({AttributeName:h.name,AttributeType:h.type}),d})),o}const Ii=Wt({table:{page:1,rows:[],headers:[],selectedRows:0,count:0,scannedCount:0},isLoading:!1}),fH={setIsLoading:n=>{Ii.isLoading=n},setTable:(n,e,t=0,s=0)=>{Ii.table.rows=e,Ii.table.headers=lH(e,n),Lr.isEmpty(n)?(Ii.table.count=0,Ii.table.scannedCount=0):(Ii.table.count+=t,Ii.table.scannedCount+=s)},setPage:n=>{Ii.table.page=n},setSelectedRows:n=>{Ii.table.selectedRows=n}},hH={state:Ii,setters:fH},dH=Wt({}),pH={state:dH},zd=Wt({Table:{},TableNames:[]}),mH={setTableNames:n=>{zd.TableNames=n},setTable:n=>{zd.Table=n}},gH={getTable:()=>zd.Table},bH={state:zd,setters:mH,getters:gH},Tn=Wt({Limit:50,IndexName:null,FilterExpression:null,KeyConditionExpression:null,ExclusiveStartKey:null,ExpressionAttributeNames:null,ExpressionAttributeValues:null,ScanIndexForward:null}),yH={init:({IndexName:n=null,FilterExpression:e=null,LastEvaluatedKey:t=null,KeyConditionExpression:s=null,ExpressionAttributeNames:i=null,ExpressionAttributeValues:r=null,ScanIndexForward:o=null})=>{Tn.IndexName=n,Tn.FilterExpression=e,Tn.ExclusiveStartKey=t,Tn.KeyConditionExpression=s,Tn.ExpressionAttributeNames=i,Tn.ExpressionAttributeValues=r,Tn.ScanIndexForward=o},setLimit:n=>{Tn.Limit=n},setIndexName:n=>{Tn.IndexName=n},setExclusiveStartKey:n=>{Tn.ExclusiveStartKey=n},reset:()=>{Tn.FilterExpression=null,Tn.KeyConditionExpression=null,Tn.ExpressionAttributeNames=null,Tn.ExpressionAttributeValues=null,Tn.ScanIndexForward=null}},vH={state:Tn,setters:yH},qd={ui:hH,item:pH,table:bH,dynamodb:vH};var Yn="top",Ns="bottom",Is="right",Xn="left",nm="auto",ic=[Yn,Ns,Is,Xn],gl="start",Pa="end",qT="clippingParents",Nv="viewport",ea="popper",KT="reference",M0=ic.reduce(function(n,e){return n.concat([e+"-"+gl,e+"-"+Pa])},[]),Iv=[].concat(ic,[nm]).reduce(function(n,e){return n.concat([e,e+"-"+gl,e+"-"+Pa])},[]),jT="beforeRead",GT="read",YT="afterRead",XT="beforeMain",QT="main",JT="afterMain",ZT="beforeWrite",eO="write",tO="afterWrite",nO=[jT,GT,YT,XT,QT,JT,ZT,eO,tO];function Qi(n){return n?(n.nodeName||"").toLowerCase():null}function Ps(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function bl(n){var e=Ps(n).Element;return n instanceof e||n instanceof Element}function Js(n){var e=Ps(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Pv(n){if(typeof ShadowRoot>"u")return!1;var e=Ps(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function wH(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var s=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];!Js(r)||!Qi(r)||(Object.assign(r.style,s),Object.keys(i).forEach(function(o){var l=i[o];l===!1?r.removeAttribute(o):r.setAttribute(o,l===!0?"":l)}))})}function SH(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(s){var i=e.elements[s],r=e.attributes[s]||{},o=Object.keys(e.styles.hasOwnProperty(s)?e.styles[s]:t[s]),l=o.reduce(function(c,f){return c[f]="",c},{});!Js(i)||!Qi(i)||(Object.assign(i.style,l),Object.keys(r).forEach(function(c){i.removeAttribute(c)}))})}}const $v={name:"applyStyles",enabled:!0,phase:"write",fn:wH,effect:SH,requires:["computeStyles"]};function ji(n){return n.split("-")[0]}var cl=Math.max,Kd=Math.min,$a=Math.round;function D0(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function sO(){return!/^((?!chrome|android).)*safari/i.test(D0())}function Ba(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var s=n.getBoundingClientRect(),i=1,r=1;e&&Js(n)&&(i=n.offsetWidth>0&&$a(s.width)/n.offsetWidth||1,r=n.offsetHeight>0&&$a(s.height)/n.offsetHeight||1);var o=bl(n)?Ps(n):window,l=o.visualViewport,c=!sO()&&t,f=(s.left+(c&&l?l.offsetLeft:0))/i,h=(s.top+(c&&l?l.offsetTop:0))/r,d=s.width/i,g=s.height/r;return{width:d,height:g,top:h,right:f+d,bottom:h+g,left:f,x:f,y:h}}function Bv(n){var e=Ba(n),t=n.offsetWidth,s=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:s}}function iO(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Pv(t)){var s=e;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function Nr(n){return Ps(n).getComputedStyle(n)}function xH(n){return["table","td","th"].indexOf(Qi(n))>=0}function Mo(n){return((bl(n)?n.ownerDocument:n.document)||window.document).documentElement}function sm(n){return Qi(n)==="html"?n:n.assignedSlot||n.parentNode||(Pv(n)?n.host:null)||Mo(n)}function M_(n){return!Js(n)||Nr(n).position==="fixed"?null:n.offsetParent}function _H(n){var e=/firefox/i.test(D0()),t=/Trident/i.test(D0());if(t&&Js(n)){var s=Nr(n);if(s.position==="fixed")return null}var i=sm(n);for(Pv(i)&&(i=i.host);Js(i)&&["html","body"].indexOf(Qi(i))<0;){var r=Nr(i);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||e&&r.willChange==="filter"||e&&r.filter&&r.filter!=="none")return i;i=i.parentNode}return null}function af(n){for(var e=Ps(n),t=M_(n);t&&xH(t)&&Nr(t).position==="static";)t=M_(t);return t&&(Qi(t)==="html"||Qi(t)==="body"&&Nr(t).position==="static")?e:t||_H(n)||e}function Fv(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function au(n,e,t){return cl(n,Kd(e,t))}function EH(n,e,t){var s=au(n,e,t);return s>t?t:s}function rO(){return{top:0,right:0,bottom:0,left:0}}function oO(n){return Object.assign({},rO(),n)}function lO(n,e){return e.reduce(function(t,s){return t[s]=n,t},{})}var CH=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,oO(typeof e!="number"?e:lO(e,ic))};function AH(n){var e,t=n.state,s=n.name,i=n.options,r=t.elements.arrow,o=t.modifiersData.popperOffsets,l=ji(t.placement),c=Fv(l),f=[Xn,Is].indexOf(l)>=0,h=f?"height":"width";if(!(!r||!o)){var d=CH(i.padding,t),g=Bv(r),m=c==="y"?Yn:Xn,y=c==="y"?Ns:Is,w=t.rects.reference[h]+t.rects.reference[c]-o[c]-t.rects.popper[h],x=o[c]-t.rects.reference[c],S=af(r),C=S?c==="y"?S.clientHeight||0:S.clientWidth||0:0,E=w/2-x/2,k=d[m],R=C-g[h]-d[y],T=C/2-g[h]/2+E,L=au(k,T,R),N=c;t.modifiersData[s]=(e={},e[N]=L,e.centerOffset=L-T,e)}}function kH(n){var e=n.state,t=n.options,s=t.element,i=s===void 0?"[data-popper-arrow]":s;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||iO(e.elements.popper,i)&&(e.elements.arrow=i))}const aO={name:"arrow",enabled:!0,phase:"main",fn:AH,effect:kH,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Fa(n){return n.split("-")[1]}var TH={top:"auto",right:"auto",bottom:"auto",left:"auto"};function OH(n,e){var t=n.x,s=n.y,i=e.devicePixelRatio||1;return{x:$a(t*i)/i||0,y:$a(s*i)/i||0}}function D_(n){var e,t=n.popper,s=n.popperRect,i=n.placement,r=n.variation,o=n.offsets,l=n.position,c=n.gpuAcceleration,f=n.adaptive,h=n.roundOffsets,d=n.isFixed,g=o.x,m=g===void 0?0:g,y=o.y,w=y===void 0?0:y,x=typeof h=="function"?h({x:m,y:w}):{x:m,y:w};m=x.x,w=x.y;var S=o.hasOwnProperty("x"),C=o.hasOwnProperty("y"),E=Xn,k=Yn,R=window;if(f){var T=af(t),L="clientHeight",N="clientWidth";if(T===Ps(t)&&(T=Mo(t),Nr(T).position!=="static"&&l==="absolute"&&(L="scrollHeight",N="scrollWidth")),T=T,i===Yn||(i===Xn||i===Is)&&r===Pa){k=Ns;var F=d&&T===R&&R.visualViewport?R.visualViewport.height:T[L];w-=F-s.height,w*=c?1:-1}if(i===Xn||(i===Yn||i===Ns)&&r===Pa){E=Is;var ee=d&&T===R&&R.visualViewport?R.visualViewport.width:T[N];m-=ee-s.width,m*=c?1:-1}}var ce=Object.assign({position:l},f&&TH),ne=h===!0?OH({x:m,y:w},Ps(t)):{x:m,y:w};if(m=ne.x,w=ne.y,c){var pe;return Object.assign({},ce,(pe={},pe[k]=C?"0":"",pe[E]=S?"0":"",pe.transform=(R.devicePixelRatio||1)<=1?"translate("+m+"px, "+w+"px)":"translate3d("+m+"px, "+w+"px, 0)",pe))}return Object.assign({},ce,(e={},e[k]=C?w+"px":"",e[E]=S?m+"px":"",e.transform="",e))}function RH(n){var e=n.state,t=n.options,s=t.gpuAcceleration,i=s===void 0?!0:s,r=t.adaptive,o=r===void 0?!0:r,l=t.roundOffsets,c=l===void 0?!0:l,f={placement:ji(e.placement),variation:Fa(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,D_(Object.assign({},f,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,D_(Object.assign({},f,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Vv={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:RH,data:{}};var gh={passive:!0};function MH(n){var e=n.state,t=n.instance,s=n.options,i=s.scroll,r=i===void 0?!0:i,o=s.resize,l=o===void 0?!0:o,c=Ps(e.elements.popper),f=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&f.forEach(function(h){h.addEventListener("scroll",t.update,gh)}),l&&c.addEventListener("resize",t.update,gh),function(){r&&f.forEach(function(h){h.removeEventListener("scroll",t.update,gh)}),l&&c.removeEventListener("resize",t.update,gh)}}const Wv={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:MH,data:{}};var DH={left:"right",right:"left",bottom:"top",top:"bottom"};function ud(n){return n.replace(/left|right|bottom|top/g,function(e){return DH[e]})}var LH={start:"end",end:"start"};function L_(n){return n.replace(/start|end/g,function(e){return LH[e]})}function Hv(n){var e=Ps(n),t=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:t,scrollTop:s}}function Uv(n){return Ba(Mo(n)).left+Hv(n).scrollLeft}function NH(n,e){var t=Ps(n),s=Mo(n),i=t.visualViewport,r=s.clientWidth,o=s.clientHeight,l=0,c=0;if(i){r=i.width,o=i.height;var f=sO();(f||!f&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:r,height:o,x:l+Uv(n),y:c}}function IH(n){var e,t=Mo(n),s=Hv(n),i=(e=n.ownerDocument)==null?void 0:e.body,r=cl(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=cl(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-s.scrollLeft+Uv(n),c=-s.scrollTop;return Nr(i||t).direction==="rtl"&&(l+=cl(t.clientWidth,i?i.clientWidth:0)-r),{width:r,height:o,x:l,y:c}}function zv(n){var e=Nr(n),t=e.overflow,s=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+s)}function cO(n){return["html","body","#document"].indexOf(Qi(n))>=0?n.ownerDocument.body:Js(n)&&zv(n)?n:cO(sm(n))}function cu(n,e){var t;e===void 0&&(e=[]);var s=cO(n),i=s===((t=n.ownerDocument)==null?void 0:t.body),r=Ps(s),o=i?[r].concat(r.visualViewport||[],zv(s)?s:[]):s,l=e.concat(o);return i?l:l.concat(cu(sm(o)))}function L0(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function PH(n,e){var t=Ba(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function N_(n,e,t){return e===Nv?L0(NH(n,t)):bl(e)?PH(e,t):L0(IH(Mo(n)))}function $H(n){var e=cu(sm(n)),t=["absolute","fixed"].indexOf(Nr(n).position)>=0,s=t&&Js(n)?af(n):n;return bl(s)?e.filter(function(i){return bl(i)&&iO(i,s)&&Qi(i)!=="body"}):[]}function BH(n,e,t,s){var i=e==="clippingParents"?$H(n):[].concat(e),r=[].concat(i,[t]),o=r[0],l=r.reduce(function(c,f){var h=N_(n,f,s);return c.top=cl(h.top,c.top),c.right=Kd(h.right,c.right),c.bottom=Kd(h.bottom,c.bottom),c.left=cl(h.left,c.left),c},N_(n,o,s));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function uO(n){var e=n.reference,t=n.element,s=n.placement,i=s?ji(s):null,r=s?Fa(s):null,o=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,c;switch(i){case Yn:c={x:o,y:e.y-t.height};break;case Ns:c={x:o,y:e.y+e.height};break;case Is:c={x:e.x+e.width,y:l};break;case Xn:c={x:e.x-t.width,y:l};break;default:c={x:e.x,y:e.y}}var f=i?Fv(i):null;if(f!=null){var h=f==="y"?"height":"width";switch(r){case gl:c[f]=c[f]-(e[h]/2-t[h]/2);break;case Pa:c[f]=c[f]+(e[h]/2-t[h]/2);break}}return c}function Va(n,e){e===void 0&&(e={});var t=e,s=t.placement,i=s===void 0?n.placement:s,r=t.strategy,o=r===void 0?n.strategy:r,l=t.boundary,c=l===void 0?qT:l,f=t.rootBoundary,h=f===void 0?Nv:f,d=t.elementContext,g=d===void 0?ea:d,m=t.altBoundary,y=m===void 0?!1:m,w=t.padding,x=w===void 0?0:w,S=oO(typeof x!="number"?x:lO(x,ic)),C=g===ea?KT:ea,E=n.rects.popper,k=n.elements[y?C:g],R=BH(bl(k)?k:k.contextElement||Mo(n.elements.popper),c,h,o),T=Ba(n.elements.reference),L=uO({reference:T,element:E,placement:i}),N=L0(Object.assign({},E,L)),F=g===ea?N:T,ee={top:R.top-F.top+S.top,bottom:F.bottom-R.bottom+S.bottom,left:R.left-F.left+S.left,right:F.right-R.right+S.right},ce=n.modifiersData.offset;if(g===ea&&ce){var ne=ce[i];Object.keys(ee).forEach(function(pe){var Y=[Is,Ns].indexOf(pe)>=0?1:-1,q=[Yn,Ns].indexOf(pe)>=0?"y":"x";ee[pe]+=ne[q]*Y})}return ee}function FH(n,e){e===void 0&&(e={});var t=e,s=t.placement,i=t.boundary,r=t.rootBoundary,o=t.padding,l=t.flipVariations,c=t.allowedAutoPlacements,f=c===void 0?Iv:c,h=Fa(s),d=h?l?M0:M0.filter(function(y){return Fa(y)===h}):ic,g=d.filter(function(y){return f.indexOf(y)>=0});g.length===0&&(g=d);var m=g.reduce(function(y,w){return y[w]=Va(n,{placement:w,boundary:i,rootBoundary:r,padding:o})[ji(w)],y},{});return Object.keys(m).sort(function(y,w){return m[y]-m[w]})}function VH(n){if(ji(n)===nm)return[];var e=ud(n);return[L_(n),e,L_(e)]}function WH(n){var e=n.state,t=n.options,s=n.name;if(!e.modifiersData[s]._skip){for(var i=t.mainAxis,r=i===void 0?!0:i,o=t.altAxis,l=o===void 0?!0:o,c=t.fallbackPlacements,f=t.padding,h=t.boundary,d=t.rootBoundary,g=t.altBoundary,m=t.flipVariations,y=m===void 0?!0:m,w=t.allowedAutoPlacements,x=e.options.placement,S=ji(x),C=S===x,E=c||(C||!y?[ud(x)]:VH(x)),k=[x].concat(E).reduce(function(ae,be){return ae.concat(ji(be)===nm?FH(e,{placement:be,boundary:h,rootBoundary:d,padding:f,flipVariations:y,allowedAutoPlacements:w}):be)},[]),R=e.rects.reference,T=e.rects.popper,L=new Map,N=!0,F=k[0],ee=0;ee<k.length;ee++){var ce=k[ee],ne=ji(ce),pe=Fa(ce)===gl,Y=[Yn,Ns].indexOf(ne)>=0,q=Y?"width":"height",J=Va(e,{placement:ce,boundary:h,rootBoundary:d,altBoundary:g,padding:f}),Se=Y?pe?Is:Xn:pe?Ns:Yn;R[q]>T[q]&&(Se=ud(Se));var H=ud(Se),ge=[];if(r&&ge.push(J[ne]<=0),l&&ge.push(J[Se]<=0,J[H]<=0),ge.every(function(ae){return ae})){F=ce,N=!1;break}L.set(ce,ge)}if(N)for(var Z=y?3:1,X=function(be){var Ne=k.find(function(B){var se=L.get(B);if(se)return se.slice(0,be).every(function(he){return he})});if(Ne)return F=Ne,"break"},fe=Z;fe>0;fe--){var we=X(fe);if(we==="break")break}e.placement!==F&&(e.modifiersData[s]._skip=!0,e.placement=F,e.reset=!0)}}const fO={name:"flip",enabled:!0,phase:"main",fn:WH,requiresIfExists:["offset"],data:{_skip:!1}};function I_(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function P_(n){return[Yn,Is,Ns,Xn].some(function(e){return n[e]>=0})}function HH(n){var e=n.state,t=n.name,s=e.rects.reference,i=e.rects.popper,r=e.modifiersData.preventOverflow,o=Va(e,{elementContext:"reference"}),l=Va(e,{altBoundary:!0}),c=I_(o,s),f=I_(l,i,r),h=P_(c),d=P_(f);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:f,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}const hO={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:HH};function UH(n,e,t){var s=ji(n),i=[Xn,Yn].indexOf(s)>=0?-1:1,r=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=r[0],l=r[1];return o=o||0,l=(l||0)*i,[Xn,Is].indexOf(s)>=0?{x:l,y:o}:{x:o,y:l}}function zH(n){var e=n.state,t=n.options,s=n.name,i=t.offset,r=i===void 0?[0,0]:i,o=Iv.reduce(function(h,d){return h[d]=UH(d,e.rects,r),h},{}),l=o[e.placement],c=l.x,f=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=f),e.modifiersData[s]=o}const dO={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:zH};function qH(n){var e=n.state,t=n.name;e.modifiersData[t]=uO({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const qv={name:"popperOffsets",enabled:!0,phase:"read",fn:qH,data:{}};function KH(n){return n==="x"?"y":"x"}function jH(n){var e=n.state,t=n.options,s=n.name,i=t.mainAxis,r=i===void 0?!0:i,o=t.altAxis,l=o===void 0?!1:o,c=t.boundary,f=t.rootBoundary,h=t.altBoundary,d=t.padding,g=t.tether,m=g===void 0?!0:g,y=t.tetherOffset,w=y===void 0?0:y,x=Va(e,{boundary:c,rootBoundary:f,padding:d,altBoundary:h}),S=ji(e.placement),C=Fa(e.placement),E=!C,k=Fv(S),R=KH(k),T=e.modifiersData.popperOffsets,L=e.rects.reference,N=e.rects.popper,F=typeof w=="function"?w(Object.assign({},e.rects,{placement:e.placement})):w,ee=typeof F=="number"?{mainAxis:F,altAxis:F}:Object.assign({mainAxis:0,altAxis:0},F),ce=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ne={x:0,y:0};if(T){if(r){var pe,Y=k==="y"?Yn:Xn,q=k==="y"?Ns:Is,J=k==="y"?"height":"width",Se=T[k],H=Se+x[Y],ge=Se-x[q],Z=m?-N[J]/2:0,X=C===gl?L[J]:N[J],fe=C===gl?-N[J]:-L[J],we=e.elements.arrow,ae=m&&we?Bv(we):{width:0,height:0},be=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:rO(),Ne=be[Y],B=be[q],se=au(0,L[J],ae[J]),he=E?L[J]/2-Z-se-Ne-ee.mainAxis:X-se-Ne-ee.mainAxis,Te=E?-L[J]/2+Z+se+B+ee.mainAxis:fe+se+B+ee.mainAxis,Ke=e.elements.arrow&&af(e.elements.arrow),M=Ke?k==="y"?Ke.clientTop||0:Ke.clientLeft||0:0,I=(pe=ce?.[k])!=null?pe:0,V=Se+he-I-M,G=Se+Te-I,te=au(m?Kd(H,V):H,Se,m?cl(ge,G):ge);T[k]=te,ne[k]=te-Se}if(l){var K,_e=k==="x"?Yn:Xn,xe=k==="x"?Ns:Is,ve=T[R],re=R==="y"?"height":"width",Be=ve+x[_e],Ce=ve-x[xe],Fe=[Yn,Xn].indexOf(S)!==-1,Ve=(K=ce?.[R])!=null?K:0,rt=Fe?Be:ve-L[re]-N[re]-Ve+ee.altAxis,ht=Fe?ve+L[re]+N[re]-Ve-ee.altAxis:Ce,ot=m&&Fe?EH(rt,ve,ht):au(m?rt:Be,ve,m?ht:Ce);T[R]=ot,ne[R]=ot-ve}e.modifiersData[s]=ne}}const pO={name:"preventOverflow",enabled:!0,phase:"main",fn:jH,requiresIfExists:["offset"]};function GH(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function YH(n){return n===Ps(n)||!Js(n)?Hv(n):GH(n)}function XH(n){var e=n.getBoundingClientRect(),t=$a(e.width)/n.offsetWidth||1,s=$a(e.height)/n.offsetHeight||1;return t!==1||s!==1}function QH(n,e,t){t===void 0&&(t=!1);var s=Js(e),i=Js(e)&&XH(e),r=Mo(e),o=Ba(n,i,t),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(s||!s&&!t)&&((Qi(e)!=="body"||zv(r))&&(l=YH(e)),Js(e)?(c=Ba(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):r&&(c.x=Uv(r))),{x:o.left+l.scrollLeft-c.x,y:o.top+l.scrollTop-c.y,width:o.width,height:o.height}}function JH(n){var e=new Map,t=new Set,s=[];n.forEach(function(r){e.set(r.name,r)});function i(r){t.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(l){if(!t.has(l)){var c=e.get(l);c&&i(c)}}),s.push(r)}return n.forEach(function(r){t.has(r.name)||i(r)}),s}function ZH(n){var e=JH(n);return nO.reduce(function(t,s){return t.concat(e.filter(function(i){return i.phase===s}))},[])}function eU(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function tU(n){var e=n.reduce(function(t,s){var i=t[s.name];return t[s.name]=i?Object.assign({},i,s,{options:Object.assign({},i.options,s.options),data:Object.assign({},i.data,s.data)}):s,t},{});return Object.keys(e).map(function(t){return e[t]})}var $_={placement:"bottom",modifiers:[],strategy:"absolute"};function B_(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function im(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,s=t===void 0?[]:t,i=e.defaultOptions,r=i===void 0?$_:i;return function(l,c,f){f===void 0&&(f=r);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},$_,r),modifiersData:{},elements:{reference:l,popper:c},attributes:{},styles:{}},d=[],g=!1,m={state:h,setOptions:function(S){var C=typeof S=="function"?S(h.options):S;w(),h.options=Object.assign({},r,h.options,C),h.scrollParents={reference:bl(l)?cu(l):l.contextElement?cu(l.contextElement):[],popper:cu(c)};var E=ZH(tU([].concat(s,h.options.modifiers)));return h.orderedModifiers=E.filter(function(k){return k.enabled}),y(),m.update()},forceUpdate:function(){if(!g){var S=h.elements,C=S.reference,E=S.popper;if(B_(C,E)){h.rects={reference:QH(C,af(E),h.options.strategy==="fixed"),popper:Bv(E)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(ee){return h.modifiersData[ee.name]=Object.assign({},ee.data)});for(var k=0;k<h.orderedModifiers.length;k++){if(h.reset===!0){h.reset=!1,k=-1;continue}var R=h.orderedModifiers[k],T=R.fn,L=R.options,N=L===void 0?{}:L,F=R.name;typeof T=="function"&&(h=T({state:h,options:N,name:F,instance:m})||h)}}}},update:eU(function(){return new Promise(function(x){m.forceUpdate(),x(h)})}),destroy:function(){w(),g=!0}};if(!B_(l,c))return m;m.setOptions(f).then(function(x){!g&&f.onFirstUpdate&&f.onFirstUpdate(x)});function y(){h.orderedModifiers.forEach(function(x){var S=x.name,C=x.options,E=C===void 0?{}:C,k=x.effect;if(typeof k=="function"){var R=k({state:h,name:S,instance:m,options:E}),T=function(){};d.push(R||T)}})}function w(){d.forEach(function(x){return x()}),d=[]}return m}}var nU=im(),sU=[Wv,qv,Vv,$v],iU=im({defaultModifiers:sU}),rU=[Wv,qv,Vv,$v,dO,fO,pO,aO,hO],Kv=im({defaultModifiers:rU});const mO=Object.freeze(Object.defineProperty({__proto__:null,afterMain:JT,afterRead:YT,afterWrite:tO,applyStyles:$v,arrow:aO,auto:nm,basePlacements:ic,beforeMain:XT,beforeRead:jT,beforeWrite:ZT,bottom:Ns,clippingParents:qT,computeStyles:Vv,createPopper:Kv,createPopperBase:nU,createPopperLite:iU,detectOverflow:Va,end:Pa,eventListeners:Wv,flip:fO,hide:hO,left:Xn,main:QT,modifierPhases:nO,offset:dO,placements:Iv,popper:ea,popperGenerator:im,popperOffsets:qv,preventOverflow:pO,read:GT,reference:KT,right:Is,start:gl,top:Yn,variationPlacements:M0,viewport:Nv,write:eO},Symbol.toStringTag,{value:"Module"}));const Jr=new Map,nb={set(n,e,t){Jr.has(n)||Jr.set(n,new Map);const s=Jr.get(n);if(!s.has(e)&&s.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`);return}s.set(e,t)},get(n,e){return Jr.has(n)&&Jr.get(n).get(e)||null},remove(n,e){if(!Jr.has(n))return;const t=Jr.get(n);t.delete(e),t.size===0&&Jr.delete(n)}},oU=1e6,lU=1e3,N0="transitionend",gO=n=>(n&&window.CSS&&window.CSS.escape&&(n=n.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),n),aU=n=>n==null?`${n}`:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase(),cU=n=>{do n+=Math.floor(Math.random()*oU);while(document.getElementById(n));return n},uU=n=>{if(!n)return 0;let{transitionDuration:e,transitionDelay:t}=window.getComputedStyle(n);const s=Number.parseFloat(e),i=Number.parseFloat(t);return!s&&!i?0:(e=e.split(",")[0],t=t.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(t))*lU)},bO=n=>{n.dispatchEvent(new Event(N0))},Er=n=>!n||typeof n!="object"?!1:(typeof n.jquery<"u"&&(n=n[0]),typeof n.nodeType<"u"),_o=n=>Er(n)?n.jquery?n[0]:n:typeof n=="string"&&n.length>0?document.querySelector(gO(n)):null,rc=n=>{if(!Er(n)||n.getClientRects().length===0)return!1;const e=getComputedStyle(n).getPropertyValue("visibility")==="visible",t=n.closest("details:not([open])");if(!t)return e;if(t!==n){const s=n.closest("summary");if(s&&s.parentNode!==t||s===null)return!1}return e},Eo=n=>!n||n.nodeType!==Node.ELEMENT_NODE||n.classList.contains("disabled")?!0:typeof n.disabled<"u"?n.disabled:n.hasAttribute("disabled")&&n.getAttribute("disabled")!=="false",yO=n=>{if(!document.documentElement.attachShadow)return null;if(typeof n.getRootNode=="function"){const e=n.getRootNode();return e instanceof ShadowRoot?e:null}return n instanceof ShadowRoot?n:n.parentNode?yO(n.parentNode):null},jd=()=>{},cf=n=>{n.offsetHeight},vO=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,sb=[],fU=n=>{document.readyState==="loading"?(sb.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of sb)e()}),sb.push(n)):n()},ni=()=>document.documentElement.dir==="rtl",oi=n=>{fU(()=>{const e=vO();if(e){const t=n.NAME,s=e.fn[t];e.fn[t]=n.jQueryInterface,e.fn[t].Constructor=n,e.fn[t].noConflict=()=>(e.fn[t]=s,n.jQueryInterface)}})},us=(n,e=[],t=n)=>typeof n=="function"?n.call(...e):t,wO=(n,e,t=!0)=>{if(!t){us(n);return}const i=uU(e)+5;let r=!1;const o=({target:l})=>{l===e&&(r=!0,e.removeEventListener(N0,o),us(n))};e.addEventListener(N0,o),setTimeout(()=>{r||bO(e)},i)},jv=(n,e,t,s)=>{const i=n.length;let r=n.indexOf(e);return r===-1?!t&&s?n[i-1]:n[0]:(r+=t?1:-1,s&&(r=(r+i)%i),n[Math.max(0,Math.min(r,i-1))])},hU=/[^.]*(?=\..*)\.|.*/,dU=/\..*/,pU=/::\d+$/,ib={};let F_=1;const SO={mouseenter:"mouseover",mouseleave:"mouseout"},mU=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function xO(n,e){return e&&`${e}::${F_++}`||n.uidEvent||F_++}function _O(n){const e=xO(n);return n.uidEvent=e,ib[e]=ib[e]||{},ib[e]}function gU(n,e){return function t(s){return Gv(s,{delegateTarget:n}),t.oneOff&&me.off(n,s.type,e),e.apply(n,[s])}}function bU(n,e,t){return function s(i){const r=n.querySelectorAll(e);for(let{target:o}=i;o&&o!==this;o=o.parentNode)for(const l of r)if(l===o)return Gv(i,{delegateTarget:o}),s.oneOff&&me.off(n,i.type,e,t),t.apply(o,[i])}}function EO(n,e,t=null){return Object.values(n).find(s=>s.callable===e&&s.delegationSelector===t)}function CO(n,e,t){const s=typeof e=="string",i=s?t:e||t;let r=AO(n);return mU.has(r)||(r=n),[s,i,r]}function V_(n,e,t,s,i){if(typeof e!="string"||!n)return;let[r,o,l]=CO(e,t,s);e in SO&&(o=(y=>function(w){if(!w.relatedTarget||w.relatedTarget!==w.delegateTarget&&!w.delegateTarget.contains(w.relatedTarget))return y.call(this,w)})(o));const c=_O(n),f=c[l]||(c[l]={}),h=EO(f,o,r?t:null);if(h){h.oneOff=h.oneOff&&i;return}const d=xO(o,e.replace(hU,"")),g=r?bU(n,t,o):gU(n,o);g.delegationSelector=r?t:null,g.callable=o,g.oneOff=i,g.uidEvent=d,f[d]=g,n.addEventListener(l,g,r)}function I0(n,e,t,s,i){const r=EO(e[t],s,i);r&&(n.removeEventListener(t,r,!!i),delete e[t][r.uidEvent])}function yU(n,e,t,s){const i=e[t]||{};for(const[r,o]of Object.entries(i))r.includes(s)&&I0(n,e,t,o.callable,o.delegationSelector)}function AO(n){return n=n.replace(dU,""),SO[n]||n}const me={on(n,e,t,s){V_(n,e,t,s,!1)},one(n,e,t,s){V_(n,e,t,s,!0)},off(n,e,t,s){if(typeof e!="string"||!n)return;const[i,r,o]=CO(e,t,s),l=o!==e,c=_O(n),f=c[o]||{},h=e.startsWith(".");if(typeof r<"u"){if(!Object.keys(f).length)return;I0(n,c,o,r,i?t:null);return}if(h)for(const d of Object.keys(c))yU(n,c,d,e.slice(1));for(const[d,g]of Object.entries(f)){const m=d.replace(pU,"");(!l||e.includes(m))&&I0(n,c,o,g.callable,g.delegationSelector)}},trigger(n,e,t){if(typeof e!="string"||!n)return null;const s=vO(),i=AO(e),r=e!==i;let o=null,l=!0,c=!0,f=!1;r&&s&&(o=s.Event(e,t),s(n).trigger(o),l=!o.isPropagationStopped(),c=!o.isImmediatePropagationStopped(),f=o.isDefaultPrevented());const h=Gv(new Event(e,{bubbles:l,cancelable:!0}),t);return f&&h.preventDefault(),c&&n.dispatchEvent(h),h.defaultPrevented&&o&&o.preventDefault(),h}};function Gv(n,e={}){for(const[t,s]of Object.entries(e))try{n[t]=s}catch{Object.defineProperty(n,t,{configurable:!0,get(){return s}})}return n}function W_(n){if(n==="true")return!0;if(n==="false")return!1;if(n===Number(n).toString())return Number(n);if(n===""||n==="null")return null;if(typeof n!="string")return n;try{return JSON.parse(decodeURIComponent(n))}catch{return n}}function rb(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const Cr={setDataAttribute(n,e,t){n.setAttribute(`data-bs-${rb(e)}`,t)},removeDataAttribute(n,e){n.removeAttribute(`data-bs-${rb(e)}`)},getDataAttributes(n){if(!n)return{};const e={},t=Object.keys(n.dataset).filter(s=>s.startsWith("bs")&&!s.startsWith("bsConfig"));for(const s of t){let i=s.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),e[i]=W_(n.dataset[s])}return e},getDataAttribute(n,e){return W_(n.getAttribute(`data-bs-${rb(e)}`))}};class uf{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const s=Er(t)?Cr.getDataAttribute(t,"config"):{};return{...this.constructor.Default,...typeof s=="object"?s:{},...Er(t)?Cr.getDataAttributes(t):{},...typeof e=="object"?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[s,i]of Object.entries(t)){const r=e[s],o=Er(r)?"element":aU(r);if(!new RegExp(i).test(o))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${s}" provided type "${o}" but expected type "${i}".`)}}}const vU="5.3.8";class xi extends uf{constructor(e,t){super(),e=_o(e),e&&(this._element=e,this._config=this._getConfig(t),nb.set(this._element,this.constructor.DATA_KEY,this))}dispose(){nb.remove(this._element,this.constructor.DATA_KEY),me.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,s=!0){wO(e,t,s)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return nb.get(_o(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,typeof t=="object"?t:null)}static get VERSION(){return vU}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const ob=n=>{let e=n.getAttribute("data-bs-target");if(!e||e==="#"){let t=n.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),e=t&&t!=="#"?t.trim():null}return e?e.split(",").map(t=>gO(t)).join(","):null},We={find(n,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,n))},findOne(n,e=document.documentElement){return Element.prototype.querySelector.call(e,n)},children(n,e){return[].concat(...n.children).filter(t=>t.matches(e))},parents(n,e){const t=[];let s=n.parentNode.closest(e);for(;s;)t.push(s),s=s.parentNode.closest(e);return t},prev(n,e){let t=n.previousElementSibling;for(;t;){if(t.matches(e))return[t];t=t.previousElementSibling}return[]},next(n,e){let t=n.nextElementSibling;for(;t;){if(t.matches(e))return[t];t=t.nextElementSibling}return[]},focusableChildren(n){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,n).filter(t=>!Eo(t)&&rc(t))},getSelectorFromElement(n){const e=ob(n);return e&&We.findOne(e)?e:null},getElementFromSelector(n){const e=ob(n);return e?We.findOne(e):null},getMultipleElementsFromSelector(n){const e=ob(n);return e?We.find(e):[]}},rm=(n,e="hide")=>{const t=`click.dismiss${n.EVENT_KEY}`,s=n.NAME;me.on(document,t,`[data-bs-dismiss="${s}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),Eo(this))return;const r=We.getElementFromSelector(this)||this.closest(`.${s}`);n.getOrCreateInstance(r)[e]()})},wU="alert",SU="bs.alert",kO=`.${SU}`,xU=`close${kO}`,_U=`closed${kO}`,EU="fade",CU="show";class om extends xi{static get NAME(){return wU}close(){if(me.trigger(this._element,xU).defaultPrevented)return;this._element.classList.remove(CU);const t=this._element.classList.contains(EU);this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),me.trigger(this._element,_U),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=om.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}rm(om,"close");oi(om);const AU="button",kU="bs.button",TU=`.${kU}`,OU=".data-api",RU="active",H_='[data-bs-toggle="button"]',MU=`click${TU}${OU}`;class lm extends xi{static get NAME(){return AU}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(RU))}static jQueryInterface(e){return this.each(function(){const t=lm.getOrCreateInstance(this);e==="toggle"&&t[e]()})}}me.on(document,MU,H_,n=>{n.preventDefault();const e=n.target.closest(H_);lm.getOrCreateInstance(e).toggle()});oi(lm);const DU="swipe",oc=".bs.swipe",LU=`touchstart${oc}`,NU=`touchmove${oc}`,IU=`touchend${oc}`,PU=`pointerdown${oc}`,$U=`pointerup${oc}`,BU="touch",FU="pen",VU="pointer-event",WU=40,HU={endCallback:null,leftCallback:null,rightCallback:null},UU={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Gd extends uf{constructor(e,t){super(),this._element=e,!(!e||!Gd.isSupported())&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return HU}static get DefaultType(){return UU}static get NAME(){return DU}dispose(){me.off(this._element,oc)}_start(e){if(!this._supportPointerEvents){this._deltaX=e.touches[0].clientX;return}this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX)}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),us(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=WU)return;const t=e/this._deltaX;this._deltaX=0,t&&us(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(me.on(this._element,PU,e=>this._start(e)),me.on(this._element,$U,e=>this._end(e)),this._element.classList.add(VU)):(me.on(this._element,LU,e=>this._start(e)),me.on(this._element,NU,e=>this._move(e)),me.on(this._element,IU,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===FU||e.pointerType===BU)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const zU="carousel",qU="bs.carousel",Do=`.${qU}`,TO=".data-api",KU="ArrowLeft",jU="ArrowRight",GU=500,Oc="next",Kl="prev",ta="left",fd="right",YU=`slide${Do}`,lb=`slid${Do}`,XU=`keydown${Do}`,QU=`mouseenter${Do}`,JU=`mouseleave${Do}`,ZU=`dragstart${Do}`,e8=`load${Do}${TO}`,t8=`click${Do}${TO}`,OO="carousel",bh="active",n8="slide",s8="carousel-item-end",i8="carousel-item-start",r8="carousel-item-next",o8="carousel-item-prev",RO=".active",MO=".carousel-item",l8=RO+MO,a8=".carousel-item img",c8=".carousel-indicators",u8="[data-bs-slide], [data-bs-slide-to]",f8='[data-bs-ride="carousel"]',h8={[KU]:fd,[jU]:ta},d8={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},p8={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class ff extends xi{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=We.findOne(c8,this._element),this._addEventListeners(),this._config.ride===OO&&this.cycle()}static get Default(){return d8}static get DefaultType(){return p8}static get NAME(){return zU}next(){this._slide(Oc)}nextWhenVisible(){!document.hidden&&rc(this._element)&&this.next()}prev(){this._slide(Kl)}pause(){this._isSliding&&bO(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding){me.one(this._element,lb,()=>this.cycle());return}this.cycle()}}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding){me.one(this._element,lb,()=>this.to(e));return}const s=this._getItemIndex(this._getActive());if(s===e)return;const i=e>s?Oc:Kl;this._slide(i,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&me.on(this._element,XU,e=>this._keydown(e)),this._config.pause==="hover"&&(me.on(this._element,QU,()=>this.pause()),me.on(this._element,JU,()=>this._maybeEnableCycle())),this._config.touch&&Gd.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const s of We.find(a8,this._element))me.on(s,ZU,i=>i.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(ta)),rightCallback:()=>this._slide(this._directionToOrder(fd)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),GU+this._config.interval))}};this._swipeHelper=new Gd(this._element,t)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=h8[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=We.findOne(RO,this._indicatorsElement);t.classList.remove(bh),t.removeAttribute("aria-current");const s=We.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);s&&(s.classList.add(bh),s.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const s=this._getActive(),i=e===Oc,r=t||jv(this._getItems(),s,i,this._config.wrap);if(r===s)return;const o=this._getItemIndex(r),l=m=>me.trigger(this._element,m,{relatedTarget:r,direction:this._orderToDirection(e),from:this._getItemIndex(s),to:o});if(l(YU).defaultPrevented||!s||!r)return;const f=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=r;const h=i?i8:s8,d=i?r8:o8;r.classList.add(d),cf(r),s.classList.add(h),r.classList.add(h);const g=()=>{r.classList.remove(h,d),r.classList.add(bh),s.classList.remove(bh,d,h),this._isSliding=!1,l(lb)};this._queueCallback(g,s,this._isAnimated()),f&&this.cycle()}_isAnimated(){return this._element.classList.contains(n8)}_getActive(){return We.findOne(l8,this._element)}_getItems(){return We.find(MO,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return ni()?e===ta?Kl:Oc:e===ta?Oc:Kl}_orderToDirection(e){return ni()?e===Kl?ta:fd:e===Kl?fd:ta}static jQueryInterface(e){return this.each(function(){const t=ff.getOrCreateInstance(this,e);if(typeof e=="number"){t.to(e);return}if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}me.on(document,t8,u8,function(n){const e=We.getElementFromSelector(this);if(!e||!e.classList.contains(OO))return;n.preventDefault();const t=ff.getOrCreateInstance(e),s=this.getAttribute("data-bs-slide-to");if(s){t.to(s),t._maybeEnableCycle();return}if(Cr.getDataAttribute(this,"slide")==="next"){t.next(),t._maybeEnableCycle();return}t.prev(),t._maybeEnableCycle()});me.on(window,e8,()=>{const n=We.find(f8);for(const e of n)ff.getOrCreateInstance(e)});oi(ff);const m8="collapse",g8="bs.collapse",hf=`.${g8}`,b8=".data-api",y8=`show${hf}`,v8=`shown${hf}`,w8=`hide${hf}`,S8=`hidden${hf}`,x8=`click${hf}${b8}`,ab="show",aa="collapse",yh="collapsing",_8="collapsed",E8=`:scope .${aa} .${aa}`,C8="collapse-horizontal",A8="width",k8="height",T8=".collapse.show, .collapse.collapsing",P0='[data-bs-toggle="collapse"]',O8={parent:null,toggle:!0},R8={parent:"(null|element)",toggle:"boolean"};class Wa extends xi{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const s=We.find(P0);for(const i of s){const r=We.getSelectorFromElement(i),o=We.find(r).filter(l=>l===this._element);r!==null&&o.length&&this._triggerArray.push(i)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return O8}static get DefaultType(){return R8}static get NAME(){return m8}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(T8).filter(l=>l!==this._element).map(l=>Wa.getOrCreateInstance(l,{toggle:!1}))),e.length&&e[0]._isTransitioning||me.trigger(this._element,y8).defaultPrevented)return;for(const l of e)l.hide();const s=this._getDimension();this._element.classList.remove(aa),this._element.classList.add(yh),this._element.style[s]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=()=>{this._isTransitioning=!1,this._element.classList.remove(yh),this._element.classList.add(aa,ab),this._element.style[s]="",me.trigger(this._element,v8)},o=`scroll${s[0].toUpperCase()+s.slice(1)}`;this._queueCallback(i,this._element,!0),this._element.style[s]=`${this._element[o]}px`}hide(){if(this._isTransitioning||!this._isShown()||me.trigger(this._element,w8).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,cf(this._element),this._element.classList.add(yh),this._element.classList.remove(aa,ab);for(const i of this._triggerArray){const r=We.getElementFromSelector(i);r&&!this._isShown(r)&&this._addAriaAndCollapsedClass([i],!1)}this._isTransitioning=!0;const s=()=>{this._isTransitioning=!1,this._element.classList.remove(yh),this._element.classList.add(aa),me.trigger(this._element,S8)};this._element.style[t]="",this._queueCallback(s,this._element,!0)}_isShown(e=this._element){return e.classList.contains(ab)}_configAfterMerge(e){return e.toggle=!!e.toggle,e.parent=_o(e.parent),e}_getDimension(){return this._element.classList.contains(C8)?A8:k8}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(P0);for(const t of e){const s=We.getElementFromSelector(t);s&&this._addAriaAndCollapsedClass([t],this._isShown(s))}}_getFirstLevelChildren(e){const t=We.find(E8,this._config.parent);return We.find(e,this._config.parent).filter(s=>!t.includes(s))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const s of e)s.classList.toggle(_8,!t),s.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return typeof e=="string"&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const s=Wa.getOrCreateInstance(this,t);if(typeof e=="string"){if(typeof s[e]>"u")throw new TypeError(`No method named "${e}"`);s[e]()}})}}me.on(document,x8,P0,function(n){(n.target.tagName==="A"||n.delegateTarget&&n.delegateTarget.tagName==="A")&&n.preventDefault();for(const e of We.getMultipleElementsFromSelector(this))Wa.getOrCreateInstance(e,{toggle:!1}).toggle()});oi(Wa);const U_="dropdown",M8="bs.dropdown",El=`.${M8}`,Yv=".data-api",D8="Escape",z_="Tab",L8="ArrowUp",q_="ArrowDown",N8=2,I8=`hide${El}`,P8=`hidden${El}`,$8=`show${El}`,B8=`shown${El}`,DO=`click${El}${Yv}`,LO=`keydown${El}${Yv}`,F8=`keyup${El}${Yv}`,na="show",V8="dropup",W8="dropend",H8="dropstart",U8="dropup-center",z8="dropdown-center",tl='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',q8=`${tl}.${na}`,hd=".dropdown-menu",K8=".navbar",j8=".navbar-nav",G8=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",Y8=ni()?"top-end":"top-start",X8=ni()?"top-start":"top-end",Q8=ni()?"bottom-end":"bottom-start",J8=ni()?"bottom-start":"bottom-end",Z8=ni()?"left-start":"right-start",e6=ni()?"right-start":"left-start",t6="top",n6="bottom",s6={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},i6={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Gi extends xi{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=We.next(this._element,hd)[0]||We.prev(this._element,hd)[0]||We.findOne(hd,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return s6}static get DefaultType(){return i6}static get NAME(){return U_}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Eo(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!me.trigger(this._element,$8,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(j8))for(const s of[].concat(...document.body.children))me.on(s,"mouseover",jd);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(na),this._element.classList.add(na),me.trigger(this._element,B8,e)}}hide(){if(Eo(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!me.trigger(this._element,I8,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const s of[].concat(...document.body.children))me.off(s,"mouseover",jd);this._popper&&this._popper.destroy(),this._menu.classList.remove(na),this._element.classList.remove(na),this._element.setAttribute("aria-expanded","false"),Cr.removeDataAttribute(this._menu,"popper"),me.trigger(this._element,P8,e)}}_getConfig(e){if(e=super._getConfig(e),typeof e.reference=="object"&&!Er(e.reference)&&typeof e.reference.getBoundingClientRect!="function")throw new TypeError(`${U_.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(typeof mO>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)");let e=this._element;this._config.reference==="parent"?e=this._parent:Er(this._config.reference)?e=_o(this._config.reference):typeof this._config.reference=="object"&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=Kv(e,this._menu,t)}_isShown(){return this._menu.classList.contains(na)}_getPlacement(){const e=this._parent;if(e.classList.contains(W8))return Z8;if(e.classList.contains(H8))return e6;if(e.classList.contains(U8))return t6;if(e.classList.contains(z8))return n6;const t=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return e.classList.contains(V8)?t?X8:Y8:t?J8:Q8}_detectNavbar(){return this._element.closest(K8)!==null}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(Cr.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...us(this._config.popperConfig,[void 0,e])}}_selectMenuItem({key:e,target:t}){const s=We.find(G8,this._menu).filter(i=>rc(i));s.length&&jv(s,t,e===q_,!s.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=Gi.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(e.button===N8||e.type==="keyup"&&e.key!==z_)return;const t=We.find(q8);for(const s of t){const i=Gi.getInstance(s);if(!i||i._config.autoClose===!1)continue;const r=e.composedPath(),o=r.includes(i._menu);if(r.includes(i._element)||i._config.autoClose==="inside"&&!o||i._config.autoClose==="outside"&&o||i._menu.contains(e.target)&&(e.type==="keyup"&&e.key===z_||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const l={relatedTarget:i._element};e.type==="click"&&(l.clickEvent=e),i._completeHide(l)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),s=e.key===D8,i=[L8,q_].includes(e.key);if(!i&&!s||t&&!s)return;e.preventDefault();const r=this.matches(tl)?this:We.prev(this,tl)[0]||We.next(this,tl)[0]||We.findOne(tl,e.delegateTarget.parentNode),o=Gi.getOrCreateInstance(r);if(i){e.stopPropagation(),o.show(),o._selectMenuItem(e);return}o._isShown()&&(e.stopPropagation(),o.hide(),r.focus())}}me.on(document,LO,tl,Gi.dataApiKeydownHandler);me.on(document,LO,hd,Gi.dataApiKeydownHandler);me.on(document,DO,Gi.clearMenus);me.on(document,F8,Gi.clearMenus);me.on(document,DO,tl,function(n){n.preventDefault(),Gi.getOrCreateInstance(this).toggle()});oi(Gi);const NO="backdrop",r6="fade",K_="show",j_=`mousedown.bs.${NO}`,o6={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},l6={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class IO extends uf{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return o6}static get DefaultType(){return l6}static get NAME(){return NO}show(e){if(!this._config.isVisible){us(e);return}this._append();const t=this._getElement();this._config.isAnimated&&cf(t),t.classList.add(K_),this._emulateAnimation(()=>{us(e)})}hide(e){if(!this._config.isVisible){us(e);return}this._getElement().classList.remove(K_),this._emulateAnimation(()=>{this.dispose(),us(e)})}dispose(){this._isAppended&&(me.off(this._element,j_),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add(r6),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=_o(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),me.on(e,j_,()=>{us(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){wO(e,this._getElement(),this._config.isAnimated)}}const a6="focustrap",c6="bs.focustrap",Yd=`.${c6}`,u6=`focusin${Yd}`,f6=`keydown.tab${Yd}`,h6="Tab",d6="forward",G_="backward",p6={autofocus:!0,trapElement:null},m6={autofocus:"boolean",trapElement:"element"};class PO extends uf{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return p6}static get DefaultType(){return m6}static get NAME(){return a6}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),me.off(document,Yd),me.on(document,u6,e=>this._handleFocusin(e)),me.on(document,f6,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,me.off(document,Yd))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const s=We.focusableChildren(t);s.length===0?t.focus():this._lastTabNavDirection===G_?s[s.length-1].focus():s[0].focus()}_handleKeydown(e){e.key===h6&&(this._lastTabNavDirection=e.shiftKey?G_:d6)}}const Y_=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",X_=".sticky-top",vh="padding-right",Q_="margin-right";class $0{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,vh,t=>t+e),this._setElementAttributes(Y_,vh,t=>t+e),this._setElementAttributes(X_,Q_,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,vh),this._resetElementAttributes(Y_,vh),this._resetElementAttributes(X_,Q_)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,s){const i=this.getWidth(),r=o=>{if(o!==this._element&&window.innerWidth>o.clientWidth+i)return;this._saveInitialAttribute(o,t);const l=window.getComputedStyle(o).getPropertyValue(t);o.style.setProperty(t,`${s(Number.parseFloat(l))}px`)};this._applyManipulationCallback(e,r)}_saveInitialAttribute(e,t){const s=e.style.getPropertyValue(t);s&&Cr.setDataAttribute(e,t,s)}_resetElementAttributes(e,t){const s=i=>{const r=Cr.getDataAttribute(i,t);if(r===null){i.style.removeProperty(t);return}Cr.removeDataAttribute(i,t),i.style.setProperty(t,r)};this._applyManipulationCallback(e,s)}_applyManipulationCallback(e,t){if(Er(e)){t(e);return}for(const s of We.find(e,this._element))t(s)}}const g6="modal",b6="bs.modal",si=`.${b6}`,y6=".data-api",v6="Escape",w6=`hide${si}`,S6=`hidePrevented${si}`,$O=`hidden${si}`,BO=`show${si}`,x6=`shown${si}`,_6=`resize${si}`,E6=`click.dismiss${si}`,C6=`mousedown.dismiss${si}`,A6=`keydown.dismiss${si}`,k6=`click${si}${y6}`,J_="modal-open",T6="fade",Z_="show",cb="modal-static",O6=".modal.show",R6=".modal-dialog",M6=".modal-body",D6='[data-bs-toggle="modal"]',L6={backdrop:!0,focus:!0,keyboard:!0},N6={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Ir extends xi{constructor(e,t){super(e,t),this._dialog=We.findOne(R6,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new $0,this._addEventListeners()}static get Default(){return L6}static get DefaultType(){return N6}static get NAME(){return g6}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||me.trigger(this._element,BO,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(J_),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){!this._isShown||this._isTransitioning||me.trigger(this._element,w6).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Z_),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){me.off(window,si),me.off(this._dialog,si),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new IO({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new PO({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=We.findOne(M6,this._dialog);t&&(t.scrollTop=0),cf(this._element),this._element.classList.add(Z_);const s=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,me.trigger(this._element,x6,{relatedTarget:e})};this._queueCallback(s,this._dialog,this._isAnimated())}_addEventListeners(){me.on(this._element,A6,e=>{if(e.key===v6){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),me.on(window,_6,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),me.on(this._element,C6,e=>{me.one(this._element,E6,t=>{if(!(this._element!==e.target||this._element!==t.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(J_),this._resetAdjustments(),this._scrollBar.reset(),me.trigger(this._element,$O)})}_isAnimated(){return this._element.classList.contains(T6)}_triggerBackdropTransition(){if(me.trigger(this._element,S6).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,s=this._element.style.overflowY;s==="hidden"||this._element.classList.contains(cb)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(cb),this._queueCallback(()=>{this._element.classList.remove(cb),this._queueCallback(()=>{this._element.style.overflowY=s},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),s=t>0;if(s&&!e){const i=ni()?"paddingLeft":"paddingRight";this._element.style[i]=`${t}px`}if(!s&&e){const i=ni()?"paddingRight":"paddingLeft";this._element.style[i]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const s=Ir.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof s[e]>"u")throw new TypeError(`No method named "${e}"`);s[e](t)}})}}me.on(document,k6,D6,function(n){const e=We.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&n.preventDefault(),me.one(e,BO,i=>{i.defaultPrevented||me.one(e,$O,()=>{rc(this)&&this.focus()})});const t=We.findOne(O6);t&&Ir.getInstance(t).hide(),Ir.getOrCreateInstance(e).toggle(this)});rm(Ir);oi(Ir);const I6="offcanvas",P6="bs.offcanvas",Vr=`.${P6}`,FO=".data-api",$6=`load${Vr}${FO}`,B6="Escape",eE="show",tE="showing",nE="hiding",F6="offcanvas-backdrop",VO=".offcanvas.show",V6=`show${Vr}`,W6=`shown${Vr}`,H6=`hide${Vr}`,sE=`hidePrevented${Vr}`,WO=`hidden${Vr}`,U6=`resize${Vr}`,z6=`click${Vr}${FO}`,q6=`keydown.dismiss${Vr}`,K6='[data-bs-toggle="offcanvas"]',j6={backdrop:!0,keyboard:!0,scroll:!1},G6={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Pr extends xi{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return j6}static get DefaultType(){return G6}static get NAME(){return I6}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||me.trigger(this._element,V6,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new $0().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(tE);const s=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(eE),this._element.classList.remove(tE),me.trigger(this._element,W6,{relatedTarget:e})};this._queueCallback(s,this._element,!0)}hide(){if(!this._isShown||me.trigger(this._element,H6).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(nE),this._backdrop.hide();const t=()=>{this._element.classList.remove(eE,nE),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new $0().reset(),me.trigger(this._element,WO)};this._queueCallback(t,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=()=>{if(this._config.backdrop==="static"){me.trigger(this._element,sE);return}this.hide()},t=!!this._config.backdrop;return new IO({className:F6,isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?e:null})}_initializeFocusTrap(){return new PO({trapElement:this._element})}_addEventListeners(){me.on(this._element,q6,e=>{if(e.key===B6){if(this._config.keyboard){this.hide();return}me.trigger(this._element,sE)}})}static jQueryInterface(e){return this.each(function(){const t=Pr.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}me.on(document,z6,K6,function(n){const e=We.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),Eo(this))return;me.one(e,WO,()=>{rc(this)&&this.focus()});const t=We.findOne(VO);t&&t!==e&&Pr.getInstance(t).hide(),Pr.getOrCreateInstance(e).toggle(this)});me.on(window,$6,()=>{for(const n of We.find(VO))Pr.getOrCreateInstance(n).show()});me.on(window,U6,()=>{for(const n of We.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(n).position!=="fixed"&&Pr.getOrCreateInstance(n).hide()});rm(Pr);oi(Pr);const Y6=/^aria-[\w-]*$/i,HO={"*":["class","dir","id","lang","role",Y6],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},X6=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Q6=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,J6=(n,e)=>{const t=n.nodeName.toLowerCase();return e.includes(t)?X6.has(t)?!!Q6.test(n.nodeValue):!0:e.filter(s=>s instanceof RegExp).some(s=>s.test(t))};function Z6(n,e,t){if(!n.length)return n;if(t&&typeof t=="function")return t(n);const i=new window.DOMParser().parseFromString(n,"text/html"),r=[].concat(...i.body.querySelectorAll("*"));for(const o of r){const l=o.nodeName.toLowerCase();if(!Object.keys(e).includes(l)){o.remove();continue}const c=[].concat(...o.attributes),f=[].concat(e["*"]||[],e[l]||[]);for(const h of c)J6(h,f)||o.removeAttribute(h.nodeName)}return i.body.innerHTML}const e9="TemplateFactory",t9={allowList:HO,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},n9={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},s9={entry:"(string|element|function|null)",selector:"(string|element)"};class i9 extends uf{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return t9}static get DefaultType(){return n9}static get NAME(){return e9}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[i,r]of Object.entries(this._config.content))this._setContent(e,r,i);const t=e.children[0],s=this._resolvePossibleFunction(this._config.extraClass);return s&&t.classList.add(...s.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,s]of Object.entries(e))super._typeCheckConfig({selector:t,entry:s},s9)}_setContent(e,t,s){const i=We.findOne(s,e);if(i){if(t=this._resolvePossibleFunction(t),!t){i.remove();return}if(Er(t)){this._putElementInTemplate(_o(t),i);return}if(this._config.html){i.innerHTML=this._maybeSanitize(t);return}i.textContent=t}}_maybeSanitize(e){return this._config.sanitize?Z6(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return us(e,[void 0,this])}_putElementInTemplate(e,t){if(this._config.html){t.innerHTML="",t.append(e);return}t.textContent=e.textContent}}const r9="tooltip",o9=new Set(["sanitize","allowList","sanitizeFn"]),ub="fade",l9="modal",wh="show",a9=".tooltip-inner",iE=`.${l9}`,rE="hide.bs.modal",Rc="hover",fb="focus",hb="click",c9="manual",u9="hide",f9="hidden",h9="show",d9="shown",p9="inserted",m9="click",g9="focusin",b9="focusout",y9="mouseenter",v9="mouseleave",w9={AUTO:"auto",TOP:"top",RIGHT:ni()?"left":"right",BOTTOM:"bottom",LEFT:ni()?"right":"left"},S9={allowList:HO,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},x9={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Cl extends xi{constructor(e,t){if(typeof mO>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return S9}static get DefaultType(){return x9}static get NAME(){return r9}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),me.off(this._element.closest(iE),rE,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;const e=me.trigger(this._element,this.constructor.eventName(h9)),s=(yO(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!s)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:r}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(r.append(i),me.trigger(this._element,this.constructor.eventName(p9))),this._popper=this._createPopper(i),i.classList.add(wh),"ontouchstart"in document.documentElement)for(const l of[].concat(...document.body.children))me.on(l,"mouseover",jd);const o=()=>{me.trigger(this._element,this.constructor.eventName(d9)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(o,this.tip,this._isAnimated())}hide(){if(!this._isShown()||me.trigger(this._element,this.constructor.eventName(u9)).defaultPrevented)return;if(this._getTipElement().classList.remove(wh),"ontouchstart"in document.documentElement)for(const i of[].concat(...document.body.children))me.off(i,"mouseover",jd);this._activeTrigger[hb]=!1,this._activeTrigger[fb]=!1,this._activeTrigger[Rc]=!1,this._isHovered=null;const s=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),me.trigger(this._element,this.constructor.eventName(f9)))};this._queueCallback(s,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(ub,wh),t.classList.add(`bs-${this.constructor.NAME}-auto`);const s=cU(this.constructor.NAME).toString();return t.setAttribute("id",s),this._isAnimated()&&t.classList.add(ub),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new i9({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[a9]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(ub)}_isShown(){return this.tip&&this.tip.classList.contains(wh)}_createPopper(e){const t=us(this._config.placement,[this,e,this._element]),s=w9[t.toUpperCase()];return Kv(this._element,e,this._getPopperConfig(s))}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_resolvePossibleFunction(e){return us(e,[this._element,this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:s=>{this._getTipElement().setAttribute("data-popper-placement",s.state.placement)}}]};return{...t,...us(this._config.popperConfig,[void 0,t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if(t==="click")me.on(this._element,this.constructor.eventName(m9),this._config.selector,s=>{const i=this._initializeOnDelegatedTarget(s);i._activeTrigger[hb]=!(i._isShown()&&i._activeTrigger[hb]),i.toggle()});else if(t!==c9){const s=t===Rc?this.constructor.eventName(y9):this.constructor.eventName(g9),i=t===Rc?this.constructor.eventName(v9):this.constructor.eventName(b9);me.on(this._element,s,this._config.selector,r=>{const o=this._initializeOnDelegatedTarget(r);o._activeTrigger[r.type==="focusin"?fb:Rc]=!0,o._enter()}),me.on(this._element,i,this._config.selector,r=>{const o=this._initializeOnDelegatedTarget(r);o._activeTrigger[r.type==="focusout"?fb:Rc]=o._element.contains(r.relatedTarget),o._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},me.on(this._element.closest(iE),rE,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=Cr.getDataAttributes(this._element);for(const s of Object.keys(t))o9.has(s)&&delete t[s];return e={...t,...typeof e=="object"&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=e.container===!1?document.body:_o(e.container),typeof e.delay=="number"&&(e.delay={show:e.delay,hide:e.delay}),typeof e.title=="number"&&(e.title=e.title.toString()),typeof e.content=="number"&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,s]of Object.entries(this._config))this.constructor.Default[t]!==s&&(e[t]=s);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=Cl.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}}oi(Cl);const _9="popover",E9=".popover-header",C9=".popover-body",A9={...Cl.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},k9={...Cl.DefaultType,content:"(null|string|element|function)"};class Xv extends Cl{static get Default(){return A9}static get DefaultType(){return k9}static get NAME(){return _9}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[E9]:this._getTitle(),[C9]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=Xv.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}}oi(Xv);const T9="scrollspy",O9="bs.scrollspy",Qv=`.${O9}`,R9=".data-api",M9=`activate${Qv}`,oE=`click${Qv}`,D9=`load${Qv}${R9}`,L9="dropdown-item",jl="active",N9='[data-bs-spy="scroll"]',db="[href]",I9=".nav, .list-group",lE=".nav-link",P9=".nav-item",$9=".list-group-item",B9=`${lE}, ${P9} > ${lE}, ${$9}`,F9=".dropdown",V9=".dropdown-toggle",W9={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},H9={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class am extends xi{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return W9}static get DefaultType(){return H9}static get NAME(){return T9}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=_o(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,typeof e.threshold=="string"&&(e.threshold=e.threshold.split(",").map(t=>Number.parseFloat(t))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(me.off(this._config.target,oE),me.on(this._config.target,oE,db,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const s=this._rootElement||window,i=t.offsetTop-this._element.offsetTop;if(s.scrollTo){s.scrollTo({top:i,behavior:"smooth"});return}s.scrollTop=i}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),e)}_observerCallback(e){const t=o=>this._targetLinks.get(`#${o.target.id}`),s=o=>{this._previousScrollData.visibleEntryTop=o.target.offsetTop,this._process(t(o))},i=(this._rootElement||document.documentElement).scrollTop,r=i>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=i;for(const o of e){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(o));continue}const l=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(r&&l){if(s(o),!i)return;continue}!r&&!l&&s(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=We.find(db,this._config.target);for(const t of e){if(!t.hash||Eo(t))continue;const s=We.findOne(decodeURI(t.hash),this._element);rc(s)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,s))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(jl),this._activateParents(e),me.trigger(this._element,M9,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains(L9)){We.findOne(V9,e.closest(F9)).classList.add(jl);return}for(const t of We.parents(e,I9))for(const s of We.prev(t,B9))s.classList.add(jl)}_clearActiveClass(e){e.classList.remove(jl);const t=We.find(`${db}.${jl}`,e);for(const s of t)s.classList.remove(jl)}static jQueryInterface(e){return this.each(function(){const t=am.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}me.on(window,D9,()=>{for(const n of We.find(N9))am.getOrCreateInstance(n)});oi(am);const U9="tab",z9="bs.tab",Al=`.${z9}`,q9=`hide${Al}`,K9=`hidden${Al}`,j9=`show${Al}`,G9=`shown${Al}`,Y9=`click${Al}`,X9=`keydown${Al}`,Q9=`load${Al}`,J9="ArrowLeft",aE="ArrowRight",Z9="ArrowUp",cE="ArrowDown",pb="Home",uE="End",nl="active",fE="fade",mb="show",ez="dropdown",UO=".dropdown-toggle",tz=".dropdown-menu",gb=`:not(${UO})`,nz='.list-group, .nav, [role="tablist"]',sz=".nav-item, .list-group-item",iz=`.nav-link${gb}, .list-group-item${gb}, [role="tab"]${gb}`,zO='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',bb=`${iz}, ${zO}`,rz=`.${nl}[data-bs-toggle="tab"], .${nl}[data-bs-toggle="pill"], .${nl}[data-bs-toggle="list"]`;class Ha extends xi{constructor(e){super(e),this._parent=this._element.closest(nz),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),me.on(this._element,X9,t=>this._keydown(t)))}static get NAME(){return U9}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),s=t?me.trigger(t,q9,{relatedTarget:e}):null;me.trigger(e,j9,{relatedTarget:t}).defaultPrevented||s&&s.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(nl),this._activate(We.getElementFromSelector(e));const s=()=>{if(e.getAttribute("role")!=="tab"){e.classList.add(mb);return}e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),me.trigger(e,G9,{relatedTarget:t})};this._queueCallback(s,e,e.classList.contains(fE))}_deactivate(e,t){if(!e)return;e.classList.remove(nl),e.blur(),this._deactivate(We.getElementFromSelector(e));const s=()=>{if(e.getAttribute("role")!=="tab"){e.classList.remove(mb);return}e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),me.trigger(e,K9,{relatedTarget:t})};this._queueCallback(s,e,e.classList.contains(fE))}_keydown(e){if(![J9,aE,Z9,cE,pb,uE].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(i=>!Eo(i));let s;if([pb,uE].includes(e.key))s=t[e.key===pb?0:t.length-1];else{const i=[aE,cE].includes(e.key);s=jv(t,e.target,i,!0)}s&&(s.focus({preventScroll:!0}),Ha.getOrCreateInstance(s).show())}_getChildren(){return We.find(bb,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const s of t)this._setInitialAttributesOnChild(s)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),s=this._getOuterElement(e);e.setAttribute("aria-selected",t),s!==e&&this._setAttributeIfNotExists(s,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=We.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const s=this._getOuterElement(e);if(!s.classList.contains(ez))return;const i=(r,o)=>{const l=We.findOne(r,s);l&&l.classList.toggle(o,t)};i(UO,nl),i(tz,mb),s.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,s){e.hasAttribute(t)||e.setAttribute(t,s)}_elemIsActive(e){return e.classList.contains(nl)}_getInnerElement(e){return e.matches(bb)?e:We.findOne(bb,e)}_getOuterElement(e){return e.closest(sz)||e}static jQueryInterface(e){return this.each(function(){const t=Ha.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}me.on(document,Y9,zO,function(n){["A","AREA"].includes(this.tagName)&&n.preventDefault(),!Eo(this)&&Ha.getOrCreateInstance(this).show()});me.on(window,Q9,()=>{for(const n of We.find(rz))Ha.getOrCreateInstance(n)});oi(Ha);const oz="toast",lz="bs.toast",Lo=`.${lz}`,az=`mouseover${Lo}`,cz=`mouseout${Lo}`,uz=`focusin${Lo}`,fz=`focusout${Lo}`,hz=`hide${Lo}`,dz=`hidden${Lo}`,pz=`show${Lo}`,mz=`shown${Lo}`,gz="fade",hE="hide",Sh="show",xh="showing",bz={animation:"boolean",autohide:"boolean",delay:"number"},yz={animation:!0,autohide:!0,delay:5e3};class en extends xi{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return yz}static get DefaultType(){return bz}static get NAME(){return oz}show(){if(me.trigger(this._element,pz).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(gz);const t=()=>{this._element.classList.remove(xh),me.trigger(this._element,mz),this._maybeScheduleHide()};this._element.classList.remove(hE),cf(this._element),this._element.classList.add(Sh,xh),this._queueCallback(t,this._element,this._config.animation)}hide(){if(!this.isShown()||me.trigger(this._element,hz).defaultPrevented)return;const t=()=>{this._element.classList.add(hE),this._element.classList.remove(xh,Sh),me.trigger(this._element,dz)};this._element.classList.add(xh),this._queueCallback(t,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Sh),super.dispose()}isShown(){return this._element.classList.contains(Sh)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=t;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=t;break}}if(t){this._clearTimeout();return}const s=e.relatedTarget;this._element===s||this._element.contains(s)||this._maybeScheduleHide()}_setListeners(){me.on(this._element,az,e=>this._onInteraction(e,!0)),me.on(this._element,cz,e=>this._onInteraction(e,!1)),me.on(this._element,uz,e=>this._onInteraction(e,!0)),me.on(this._element,fz,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=en.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}rm(en);oi(en);const sa=typeof document<"u";function qO(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function vz(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&qO(n.default)}const xt=Object.assign;function yb(n,e){const t={};for(const s in e){const i=e[s];t[s]=bi(i)?i.map(n):n(i)}return t}const uu=()=>{},bi=Array.isArray;function dE(n,e){const t={};for(const s in n)t[s]=s in e?e[s]:n[s];return t}const KO=/#/g,wz=/&/g,Sz=/\//g,xz=/=/g,_z=/\?/g,jO=/\+/g,Ez=/%5B/g,Cz=/%5D/g,GO=/%5E/g,Az=/%60/g,YO=/%7B/g,kz=/%7C/g,XO=/%7D/g,Tz=/%20/g;function Jv(n){return n==null?"":encodeURI(""+n).replace(kz,"|").replace(Ez,"[").replace(Cz,"]")}function Oz(n){return Jv(n).replace(YO,"{").replace(XO,"}").replace(GO,"^")}function B0(n){return Jv(n).replace(jO,"%2B").replace(Tz,"+").replace(KO,"%23").replace(wz,"%26").replace(Az,"`").replace(YO,"{").replace(XO,"}").replace(GO,"^")}function Rz(n){return B0(n).replace(xz,"%3D")}function Mz(n){return Jv(n).replace(KO,"%23").replace(_z,"%3F")}function Dz(n){return Mz(n).replace(Sz,"%2F")}function Ou(n){if(n==null)return null;try{return decodeURIComponent(""+n)}catch{}return""+n}const Lz=/\/$/,Nz=n=>n.replace(Lz,"");function vb(n,e,t="/"){let s,i={},r="",o="";const l=e.indexOf("#");let c=e.indexOf("?");return c=l>=0&&c>l?-1:c,c>=0&&(s=e.slice(0,c),r=e.slice(c,l>0?l:e.length),i=n(r.slice(1))),l>=0&&(s=s||e.slice(0,l),o=e.slice(l,e.length)),s=Bz(s??e,t),{fullPath:s+r+o,path:s,query:i,hash:Ou(o)}}function Iz(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function pE(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function Pz(n,e,t){const s=e.matched.length-1,i=t.matched.length-1;return s>-1&&s===i&&Ua(e.matched[s],t.matched[i])&&QO(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function Ua(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function QO(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(var t in n)if(!$z(n[t],e[t]))return!1;return!0}function $z(n,e){return bi(n)?mE(n,e):bi(e)?mE(e,n):n?.valueOf()===e?.valueOf()}function mE(n,e){return bi(e)?n.length===e.length&&n.every((t,s)=>t===e[s]):n.length===1&&n[0]===e}function Bz(n,e){if(n.startsWith("/"))return n;if(!n)return e;const t=e.split("/"),s=n.split("/"),i=s[s.length-1];(i===".."||i===".")&&s.push("");let r=t.length-1,o,l;for(o=0;o<s.length;o++)if(l=s[o],l!==".")if(l==="..")r>1&&r--;else break;return t.slice(0,r).join("/")+"/"+s.slice(o).join("/")}const Zr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let F0=(function(n){return n.pop="pop",n.push="push",n})({}),wb=(function(n){return n.back="back",n.forward="forward",n.unknown="",n})({});function Fz(n){if(!n)if(sa){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),Nz(n)}const Vz=/^[^#]+#/;function Wz(n,e){return n.replace(Vz,"#")+e}function Hz(n,e){const t=document.documentElement.getBoundingClientRect(),s=n.getBoundingClientRect();return{behavior:e.behavior,left:s.left-t.left-(e.left||0),top:s.top-t.top-(e.top||0)}}const cm=()=>({left:window.scrollX,top:window.scrollY});function Uz(n){let e;if("el"in n){const t=n.el,s=typeof t=="string"&&t.startsWith("#"),i=typeof t=="string"?s?document.getElementById(t.slice(1)):document.querySelector(t):t;if(!i)return;e=Hz(i,n)}else e=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function gE(n,e){return(history.state?history.state.position-e:-1)+n}const V0=new Map;function zz(n,e){V0.set(n,e)}function qz(n){const e=V0.get(n);return V0.delete(n),e}function Kz(n){return typeof n=="string"||n&&typeof n=="object"}function JO(n){return typeof n=="string"||typeof n=="symbol"}let Gt=(function(n){return n[n.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",n[n.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",n[n.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",n[n.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",n[n.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",n})({});const ZO=Symbol("");Gt.MATCHER_NOT_FOUND+"",Gt.NAVIGATION_GUARD_REDIRECT+"",Gt.NAVIGATION_ABORTED+"",Gt.NAVIGATION_CANCELLED+"",Gt.NAVIGATION_DUPLICATED+"";function za(n,e){return xt(new Error,{type:n,[ZO]:!0},e)}function pr(n,e){return n instanceof Error&&ZO in n&&(e==null||!!(n.type&e))}const jz=["params","query","hash"];function Gz(n){if(typeof n=="string")return n;if(n.path!=null)return n.path;const e={};for(const t of jz)t in n&&(e[t]=n[t]);return JSON.stringify(e,null,2)}function Yz(n){const e={};if(n===""||n==="?")return e;const t=(n[0]==="?"?n.slice(1):n).split("&");for(let s=0;s<t.length;++s){const i=t[s].replace(jO," "),r=i.indexOf("="),o=Ou(r<0?i:i.slice(0,r)),l=r<0?null:Ou(i.slice(r+1));if(o in e){let c=e[o];bi(c)||(c=e[o]=[c]),c.push(l)}else e[o]=l}return e}function bE(n){let e="";for(let t in n){const s=n[t];if(t=Rz(t),s==null){s!==void 0&&(e+=(e.length?"&":"")+t);continue}(bi(s)?s.map(i=>i&&B0(i)):[s&&B0(s)]).forEach(i=>{i!==void 0&&(e+=(e.length?"&":"")+t,i!=null&&(e+="="+i))})}return e}function Xz(n){const e={};for(const t in n){const s=n[t];s!==void 0&&(e[t]=bi(s)?s.map(i=>i==null?null:""+i):s==null?s:""+s)}return e}const Qz=Symbol(""),yE=Symbol(""),um=Symbol(""),Zv=Symbol(""),W0=Symbol("");function Mc(){let n=[];function e(s){return n.push(s),()=>{const i=n.indexOf(s);i>-1&&n.splice(i,1)}}function t(){n=[]}return{add:e,list:()=>n.slice(),reset:t}}function ro(n,e,t,s,i,r=o=>o()){const o=s&&(s.enterCallbacks[i]=s.enterCallbacks[i]||[]);return()=>new Promise((l,c)=>{const f=g=>{g===!1?c(za(Gt.NAVIGATION_ABORTED,{from:t,to:e})):g instanceof Error?c(g):Kz(g)?c(za(Gt.NAVIGATION_GUARD_REDIRECT,{from:e,to:g})):(o&&s.enterCallbacks[i]===o&&typeof g=="function"&&o.push(g),l())},h=r(()=>n.call(s&&s.instances[i],e,t,f));let d=Promise.resolve(h);n.length<3&&(d=d.then(f)),d.catch(g=>c(g))})}function Sb(n,e,t,s,i=r=>r()){const r=[];for(const o of n)for(const l in o.components){let c=o.components[l];if(!(e!=="beforeRouteEnter"&&!o.instances[l]))if(qO(c)){const f=(c.__vccOpts||c)[e];f&&r.push(ro(f,t,s,o,l,i))}else{let f=c();r.push(()=>f.then(h=>{if(!h)throw new Error(`Couldn't resolve component "${l}" at "${o.path}"`);const d=vz(h)?h.default:h;o.mods[l]=h,o.components[l]=d;const g=(d.__vccOpts||d)[e];return g&&ro(g,t,s,o,l,i)()}))}}return r}function Jz(n,e){const t=[],s=[],i=[],r=Math.max(e.matched.length,n.matched.length);for(let o=0;o<r;o++){const l=e.matched[o];l&&(n.matched.find(f=>Ua(f,l))?s.push(l):t.push(l));const c=n.matched[o];c&&(e.matched.find(f=>Ua(f,c))||i.push(c))}return[t,s,i]}let Zz=()=>location.protocol+"//"+location.host;function eR(n,e){const{pathname:t,search:s,hash:i}=e,r=n.indexOf("#");if(r>-1){let o=i.includes(n.slice(r))?n.slice(r).length:1,l=i.slice(o);return l[0]!=="/"&&(l="/"+l),pE(l,"")}return pE(t,n)+s+i}function eq(n,e,t,s){let i=[],r=[],o=null;const l=({state:g})=>{const m=eR(n,location),y=t.value,w=e.value;let x=0;if(g){if(t.value=m,e.value=g,o&&o===y){o=null;return}x=w?g.position-w.position:0}else s(m);i.forEach(S=>{S(t.value,y,{delta:x,type:F0.pop,direction:x?x>0?wb.forward:wb.back:wb.unknown})})};function c(){o=t.value}function f(g){i.push(g);const m=()=>{const y=i.indexOf(g);y>-1&&i.splice(y,1)};return r.push(m),m}function h(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(xt({},g.state,{scroll:cm()}),"")}}function d(){for(const g of r)g();r=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",h),document.removeEventListener("visibilitychange",h)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",h),document.addEventListener("visibilitychange",h),{pauseListeners:c,listen:f,destroy:d}}function vE(n,e,t,s=!1,i=!1){return{back:n,current:e,forward:t,replaced:s,position:window.history.length,scroll:i?cm():null}}function tq(n){const{history:e,location:t}=window,s={value:eR(n,t)},i={value:e.state};i.value||r(s.value,{back:null,current:s.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(c,f,h){const d=n.indexOf("#"),g=d>-1?(t.host&&document.querySelector("base")?n:n.slice(d))+c:Zz()+n+c;try{e[h?"replaceState":"pushState"](f,"",g),i.value=f}catch(m){console.error(m),t[h?"replace":"assign"](g)}}function o(c,f){r(c,xt({},e.state,vE(i.value.back,c,i.value.forward,!0),f,{position:i.value.position}),!0),s.value=c}function l(c,f){const h=xt({},i.value,e.state,{forward:c,scroll:cm()});r(h.current,h,!0),r(c,xt({},vE(s.value,c,null),{position:h.position+1},f),!1),s.value=c}return{location:s,state:i,push:l,replace:o}}function nq(n){n=Fz(n);const e=tq(n),t=eq(n,e.state,e.location,e.replace);function s(r,o=!0){o||t.pauseListeners(),history.go(r)}const i=xt({location:"",base:n,go:s,createHref:Wz.bind(null,n)},e,t);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>e.state.value}),i}let sl=(function(n){return n[n.Static=0]="Static",n[n.Param=1]="Param",n[n.Group=2]="Group",n})({});var on=(function(n){return n[n.Static=0]="Static",n[n.Param=1]="Param",n[n.ParamRegExp=2]="ParamRegExp",n[n.ParamRegExpEnd=3]="ParamRegExpEnd",n[n.EscapeNext=4]="EscapeNext",n})(on||{});const sq={type:sl.Static,value:""},iq=/[a-zA-Z0-9_]/;function rq(n){if(!n)return[[]];if(n==="/")return[[sq]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function e(m){throw new Error(`ERR (${t})/"${f}": ${m}`)}let t=on.Static,s=t;const i=[];let r;function o(){r&&i.push(r),r=[]}let l=0,c,f="",h="";function d(){f&&(t===on.Static?r.push({type:sl.Static,value:f}):t===on.Param||t===on.ParamRegExp||t===on.ParamRegExpEnd?(r.length>1&&(c==="*"||c==="+")&&e(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),r.push({type:sl.Param,value:f,regexp:h,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):e("Invalid state to consume buffer"),f="")}function g(){f+=c}for(;l<n.length;){if(c=n[l++],c==="\\"&&t!==on.ParamRegExp){s=t,t=on.EscapeNext;continue}switch(t){case on.Static:c==="/"?(f&&d(),o()):c===":"?(d(),t=on.Param):g();break;case on.EscapeNext:g(),t=s;break;case on.Param:c==="("?t=on.ParamRegExp:iq.test(c)?g():(d(),t=on.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--);break;case on.ParamRegExp:c===")"?h[h.length-1]=="\\"?h=h.slice(0,-1)+c:t=on.ParamRegExpEnd:h+=c;break;case on.ParamRegExpEnd:d(),t=on.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--,h="";break;default:e("Unknown state");break}}return t===on.ParamRegExp&&e(`Unfinished custom RegExp for param "${f}"`),d(),o(),i}const wE="[^/]+?",oq={sensitive:!1,strict:!1,start:!0,end:!0};var qn=(function(n){return n[n._multiplier=10]="_multiplier",n[n.Root=90]="Root",n[n.Segment=40]="Segment",n[n.SubSegment=30]="SubSegment",n[n.Static=40]="Static",n[n.Dynamic=20]="Dynamic",n[n.BonusCustomRegExp=10]="BonusCustomRegExp",n[n.BonusWildcard=-50]="BonusWildcard",n[n.BonusRepeatable=-20]="BonusRepeatable",n[n.BonusOptional=-8]="BonusOptional",n[n.BonusStrict=.7000000000000001]="BonusStrict",n[n.BonusCaseSensitive=.25]="BonusCaseSensitive",n})(qn||{});const lq=/[.+*?^${}()[\]/\\]/g;function aq(n,e){const t=xt({},oq,e),s=[];let i=t.start?"^":"";const r=[];for(const f of n){const h=f.length?[]:[qn.Root];t.strict&&!f.length&&(i+="/");for(let d=0;d<f.length;d++){const g=f[d];let m=qn.Segment+(t.sensitive?qn.BonusCaseSensitive:0);if(g.type===sl.Static)d||(i+="/"),i+=g.value.replace(lq,"\\$&"),m+=qn.Static;else if(g.type===sl.Param){const{value:y,repeatable:w,optional:x,regexp:S}=g;r.push({name:y,repeatable:w,optional:x});const C=S||wE;if(C!==wE){m+=qn.BonusCustomRegExp;try{`${C}`}catch(k){throw new Error(`Invalid custom RegExp for param "${y}" (${C}): `+k.message)}}let E=w?`((?:${C})(?:/(?:${C}))*)`:`(${C})`;d||(E=x&&f.length<2?`(?:/${E})`:"/"+E),x&&(E+="?"),i+=E,m+=qn.Dynamic,x&&(m+=qn.BonusOptional),w&&(m+=qn.BonusRepeatable),C===".*"&&(m+=qn.BonusWildcard)}h.push(m)}s.push(h)}if(t.strict&&t.end){const f=s.length-1;s[f][s[f].length-1]+=qn.BonusStrict}t.strict||(i+="/?"),t.end?i+="$":t.strict&&!i.endsWith("/")&&(i+="(?:/|$)");const o=new RegExp(i,t.sensitive?"":"i");function l(f){const h=f.match(o),d={};if(!h)return null;for(let g=1;g<h.length;g++){const m=h[g]||"",y=r[g-1];d[y.name]=m&&y.repeatable?m.split("/"):m}return d}function c(f){let h="",d=!1;for(const g of n){(!d||!h.endsWith("/"))&&(h+="/"),d=!1;for(const m of g)if(m.type===sl.Static)h+=m.value;else if(m.type===sl.Param){const{value:y,repeatable:w,optional:x}=m,S=y in f?f[y]:"";if(bi(S)&&!w)throw new Error(`Provided param "${y}" is an array but it is not repeatable (* or + modifiers)`);const C=bi(S)?S.join("/"):S;if(!C)if(x)g.length<2&&(h.endsWith("/")?h=h.slice(0,-1):d=!0);else throw new Error(`Missing required param "${y}"`);h+=C}}return h||"/"}return{re:o,score:s,keys:r,parse:l,stringify:c}}function cq(n,e){let t=0;for(;t<n.length&&t<e.length;){const s=e[t]-n[t];if(s)return s;t++}return n.length<e.length?n.length===1&&n[0]===qn.Static+qn.Segment?-1:1:n.length>e.length?e.length===1&&e[0]===qn.Static+qn.Segment?1:-1:0}function tR(n,e){let t=0;const s=n.score,i=e.score;for(;t<s.length&&t<i.length;){const r=cq(s[t],i[t]);if(r)return r;t++}if(Math.abs(i.length-s.length)===1){if(SE(s))return 1;if(SE(i))return-1}return i.length-s.length}function SE(n){const e=n[n.length-1];return n.length>0&&e[e.length-1]<0}const uq={strict:!1,end:!0,sensitive:!1};function fq(n,e,t){const s=aq(rq(n.path),t),i=xt(s,{record:n,parent:e,children:[],alias:[]});return e&&!i.record.aliasOf==!e.record.aliasOf&&e.children.push(i),i}function hq(n,e){const t=[],s=new Map;e=dE(uq,e);function i(d){return s.get(d)}function r(d,g,m){const y=!m,w=_E(d);w.aliasOf=m&&m.record;const x=dE(e,d),S=[w];if("alias"in d){const k=typeof d.alias=="string"?[d.alias]:d.alias;for(const R of k)S.push(_E(xt({},w,{components:m?m.record.components:w.components,path:R,aliasOf:m?m.record:w})))}let C,E;for(const k of S){const{path:R}=k;if(g&&R[0]!=="/"){const T=g.record.path,L=T[T.length-1]==="/"?"":"/";k.path=g.record.path+(R&&L+R)}if(C=fq(k,g,x),m?m.alias.push(C):(E=E||C,E!==C&&E.alias.push(C),y&&d.name&&!EE(C)&&o(d.name)),nR(C)&&c(C),w.children){const T=w.children;for(let L=0;L<T.length;L++)r(T[L],C,m&&m.children[L])}m=m||C}return E?()=>{o(E)}:uu}function o(d){if(JO(d)){const g=s.get(d);g&&(s.delete(d),t.splice(t.indexOf(g),1),g.children.forEach(o),g.alias.forEach(o))}else{const g=t.indexOf(d);g>-1&&(t.splice(g,1),d.record.name&&s.delete(d.record.name),d.children.forEach(o),d.alias.forEach(o))}}function l(){return t}function c(d){const g=mq(d,t);t.splice(g,0,d),d.record.name&&!EE(d)&&s.set(d.record.name,d)}function f(d,g){let m,y={},w,x;if("name"in d&&d.name){if(m=s.get(d.name),!m)throw za(Gt.MATCHER_NOT_FOUND,{location:d});x=m.record.name,y=xt(xE(g.params,m.keys.filter(E=>!E.optional).concat(m.parent?m.parent.keys.filter(E=>E.optional):[]).map(E=>E.name)),d.params&&xE(d.params,m.keys.map(E=>E.name))),w=m.stringify(y)}else if(d.path!=null)w=d.path,m=t.find(E=>E.re.test(w)),m&&(y=m.parse(w),x=m.record.name);else{if(m=g.name?s.get(g.name):t.find(E=>E.re.test(g.path)),!m)throw za(Gt.MATCHER_NOT_FOUND,{location:d,currentLocation:g});x=m.record.name,y=xt({},g.params,d.params),w=m.stringify(y)}const S=[];let C=m;for(;C;)S.unshift(C.record),C=C.parent;return{name:x,path:w,params:y,matched:S,meta:pq(S)}}n.forEach(d=>r(d));function h(){t.length=0,s.clear()}return{addRoute:r,resolve:f,removeRoute:o,clearRoutes:h,getRoutes:l,getRecordMatcher:i}}function xE(n,e){const t={};for(const s of e)s in n&&(t[s]=n[s]);return t}function _E(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:dq(n),children:n.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in n?n.components||null:n.component&&{default:n.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function dq(n){const e={},t=n.props||!1;if("component"in n)e.default=t;else for(const s in n.components)e[s]=typeof t=="object"?t[s]:t;return e}function EE(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function pq(n){return n.reduce((e,t)=>xt(e,t.meta),{})}function mq(n,e){let t=0,s=e.length;for(;t!==s;){const r=t+s>>1;tR(n,e[r])<0?s=r:t=r+1}const i=gq(n);return i&&(s=e.lastIndexOf(i,s-1)),s}function gq(n){let e=n;for(;e=e.parent;)if(nR(e)&&tR(n,e)===0)return e}function nR({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function CE(n){const e=Vt(um),t=Vt(Zv),s=at(()=>{const c=ke(n.to);return e.resolve(c)}),i=at(()=>{const{matched:c}=s.value,{length:f}=c,h=c[f-1],d=t.matched;if(!h||!d.length)return-1;const g=d.findIndex(Ua.bind(null,h));if(g>-1)return g;const m=AE(c[f-2]);return f>1&&AE(h)===m&&d[d.length-1].path!==m?d.findIndex(Ua.bind(null,c[f-2])):g}),r=at(()=>i.value>-1&&Sq(t.params,s.value.params)),o=at(()=>i.value>-1&&i.value===t.matched.length-1&&QO(t.params,s.value.params));function l(c={}){if(wq(c)){const f=e[ke(n.replace)?"replace":"push"](ke(n.to)).catch(uu);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>f),f}return Promise.resolve()}return{route:s,href:at(()=>s.value.href),isActive:r,isExactActive:o,navigate:l}}function bq(n){return n.length===1?n[0]:n}const yq=Bn({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:CE,setup(n,{slots:e}){const t=Wt(CE(n)),{options:s}=Vt(um),i=at(()=>({[kE(n.activeClass,s.linkActiveClass,"router-link-active")]:t.isActive,[kE(n.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&bq(e.default(t));return n.custom?r:BT("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:i.value},r)}}}),vq=yq;function wq(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!==void 0&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const e=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return n.preventDefault&&n.preventDefault(),!0}}function Sq(n,e){for(const t in e){const s=e[t],i=n[t];if(typeof s=="string"){if(s!==i)return!1}else if(!bi(i)||i.length!==s.length||s.some((r,o)=>r.valueOf()!==i[o].valueOf()))return!1}return!0}function AE(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const kE=(n,e,t)=>n??e??t,xq=Bn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const s=Vt(W0),i=at(()=>n.route||s.value),r=Vt(yE,0),o=at(()=>{let f=ke(r);const{matched:h}=i.value;let d;for(;(d=h[f])&&!d.components;)f++;return f}),l=at(()=>i.value.matched[o.value]);iu(yE,at(()=>o.value+1)),iu(Qz,l),iu(W0,i);const c=De();return Os(()=>[c.value,l.value,n.name],([f,h,d],[g,m,y])=>{h&&(h.instances[d]=f,m&&m!==h&&f&&f===g&&(h.leaveGuards.size||(h.leaveGuards=m.leaveGuards),h.updateGuards.size||(h.updateGuards=m.updateGuards))),f&&h&&(!m||!Ua(h,m)||!g)&&(h.enterCallbacks[d]||[]).forEach(w=>w(f))},{flush:"post"}),()=>{const f=i.value,h=n.name,d=l.value,g=d&&d.components[h];if(!g)return TE(t.default,{Component:g,route:f});const m=d.props[h],y=m?m===!0?f.params:typeof m=="function"?m(f):m:null,x=BT(g,xt({},y,e,{onVnodeUnmounted:S=>{S.component.isUnmounted&&(d.instances[h]=null)},ref:c}));return TE(t.default,{Component:x,route:f})||x}}});function TE(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const _q=xq;function Eq(n){const e=hq(n.routes,n),t=n.parseQuery||Yz,s=n.stringifyQuery||bE,i=n.history,r=Mc(),o=Mc(),l=Mc(),c=hW(Zr);let f=Zr;sa&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const h=yb.bind(null,B=>""+B),d=yb.bind(null,Dz),g=yb.bind(null,Ou);function m(B,se){let he,Te;return JO(B)?(he=e.getRecordMatcher(B),Te=se):Te=B,e.addRoute(Te,he)}function y(B){const se=e.getRecordMatcher(B);se&&e.removeRoute(se)}function w(){return e.getRoutes().map(B=>B.record)}function x(B){return!!e.getRecordMatcher(B)}function S(B,se){if(se=xt({},se||c.value),typeof B=="string"){const V=vb(t,B,se.path),G=e.resolve({path:V.path},se),te=i.createHref(V.fullPath);return xt(V,G,{params:g(G.params),hash:Ou(V.hash),redirectedFrom:void 0,href:te})}let he;if(B.path!=null)he=xt({},B,{path:vb(t,B.path,se.path).path});else{const V=xt({},B.params);for(const G in V)V[G]==null&&delete V[G];he=xt({},B,{params:d(V)}),se.params=d(se.params)}const Te=e.resolve(he,se),Ke=B.hash||"";Te.params=h(g(Te.params));const M=Iz(s,xt({},B,{hash:Oz(Ke),path:Te.path})),I=i.createHref(M);return xt({fullPath:M,hash:Ke,query:s===bE?Xz(B.query):B.query||{}},Te,{redirectedFrom:void 0,href:I})}function C(B){return typeof B=="string"?vb(t,B,c.value.path):xt({},B)}function E(B,se){if(f!==B)return za(Gt.NAVIGATION_CANCELLED,{from:se,to:B})}function k(B){return L(B)}function R(B){return k(xt(C(B),{replace:!0}))}function T(B,se){const he=B.matched[B.matched.length-1];if(he&&he.redirect){const{redirect:Te}=he;let Ke=typeof Te=="function"?Te(B,se):Te;return typeof Ke=="string"&&(Ke=Ke.includes("?")||Ke.includes("#")?Ke=C(Ke):{path:Ke},Ke.params={}),xt({query:B.query,hash:B.hash,params:Ke.path!=null?{}:B.params},Ke)}}function L(B,se){const he=f=S(B),Te=c.value,Ke=B.state,M=B.force,I=B.replace===!0,V=T(he,Te);if(V)return L(xt(C(V),{state:typeof V=="object"?xt({},Ke,V.state):Ke,force:M,replace:I}),se||he);const G=he;G.redirectedFrom=se;let te;return!M&&Pz(s,Te,he)&&(te=za(Gt.NAVIGATION_DUPLICATED,{to:G,from:Te}),X(Te,Te,!0,!1)),(te?Promise.resolve(te):ee(G,Te)).catch(K=>pr(K)?pr(K,Gt.NAVIGATION_GUARD_REDIRECT)?K:Z(K):H(K,G,Te)).then(K=>{if(K){if(pr(K,Gt.NAVIGATION_GUARD_REDIRECT))return L(xt({replace:I},C(K.to),{state:typeof K.to=="object"?xt({},Ke,K.to.state):Ke,force:M}),se||G)}else K=ne(G,Te,!0,I,Ke);return ce(G,Te,K),K})}function N(B,se){const he=E(B,se);return he?Promise.reject(he):Promise.resolve()}function F(B){const se=ae.values().next().value;return se&&typeof se.runWithContext=="function"?se.runWithContext(B):B()}function ee(B,se){let he;const[Te,Ke,M]=Jz(B,se);he=Sb(Te.reverse(),"beforeRouteLeave",B,se);for(const V of Te)V.leaveGuards.forEach(G=>{he.push(ro(G,B,se))});const I=N.bind(null,B,se);return he.push(I),Ne(he).then(()=>{he=[];for(const V of r.list())he.push(ro(V,B,se));return he.push(I),Ne(he)}).then(()=>{he=Sb(Ke,"beforeRouteUpdate",B,se);for(const V of Ke)V.updateGuards.forEach(G=>{he.push(ro(G,B,se))});return he.push(I),Ne(he)}).then(()=>{he=[];for(const V of M)if(V.beforeEnter)if(bi(V.beforeEnter))for(const G of V.beforeEnter)he.push(ro(G,B,se));else he.push(ro(V.beforeEnter,B,se));return he.push(I),Ne(he)}).then(()=>(B.matched.forEach(V=>V.enterCallbacks={}),he=Sb(M,"beforeRouteEnter",B,se,F),he.push(I),Ne(he))).then(()=>{he=[];for(const V of o.list())he.push(ro(V,B,se));return he.push(I),Ne(he)}).catch(V=>pr(V,Gt.NAVIGATION_CANCELLED)?V:Promise.reject(V))}function ce(B,se,he){l.list().forEach(Te=>F(()=>Te(B,se,he)))}function ne(B,se,he,Te,Ke){const M=E(B,se);if(M)return M;const I=se===Zr,V=sa?history.state:{};he&&(Te||I?i.replace(B.fullPath,xt({scroll:I&&V&&V.scroll},Ke)):i.push(B.fullPath,Ke)),c.value=B,X(B,se,he,I),Z()}let pe;function Y(){pe||(pe=i.listen((B,se,he)=>{if(!be.listening)return;const Te=S(B),Ke=T(Te,be.currentRoute.value);if(Ke){L(xt(Ke,{replace:!0,force:!0}),Te).catch(uu);return}f=Te;const M=c.value;sa&&zz(gE(M.fullPath,he.delta),cm()),ee(Te,M).catch(I=>pr(I,Gt.NAVIGATION_ABORTED|Gt.NAVIGATION_CANCELLED)?I:pr(I,Gt.NAVIGATION_GUARD_REDIRECT)?(L(xt(C(I.to),{force:!0}),Te).then(V=>{pr(V,Gt.NAVIGATION_ABORTED|Gt.NAVIGATION_DUPLICATED)&&!he.delta&&he.type===F0.pop&&i.go(-1,!1)}).catch(uu),Promise.reject()):(he.delta&&i.go(-he.delta,!1),H(I,Te,M))).then(I=>{I=I||ne(Te,M,!1),I&&(he.delta&&!pr(I,Gt.NAVIGATION_CANCELLED)?i.go(-he.delta,!1):he.type===F0.pop&&pr(I,Gt.NAVIGATION_ABORTED|Gt.NAVIGATION_DUPLICATED)&&i.go(-1,!1)),ce(Te,M,I)}).catch(uu)}))}let q=Mc(),J=Mc(),Se;function H(B,se,he){Z(B);const Te=J.list();return Te.length?Te.forEach(Ke=>Ke(B,se,he)):console.error(B),Promise.reject(B)}function ge(){return Se&&c.value!==Zr?Promise.resolve():new Promise((B,se)=>{q.add([B,se])})}function Z(B){return Se||(Se=!B,Y(),q.list().forEach(([se,he])=>B?he(B):se()),q.reset()),B}function X(B,se,he,Te){const{scrollBehavior:Ke}=n;if(!sa||!Ke)return Promise.resolve();const M=!he&&qz(gE(B.fullPath,0))||(Te||!he)&&history.state&&history.state.scroll||null;return _u().then(()=>Ke(B,se,M)).then(I=>I&&Uz(I)).catch(I=>H(I,B,se))}const fe=B=>i.go(B);let we;const ae=new Set,be={currentRoute:c,listening:!0,addRoute:m,removeRoute:y,clearRoutes:e.clearRoutes,hasRoute:x,getRoutes:w,resolve:S,options:n,push:k,replace:R,go:fe,back:()=>fe(-1),forward:()=>fe(1),beforeEach:r.add,beforeResolve:o.add,afterEach:l.add,onError:J.add,isReady:ge,install(B){B.component("RouterLink",vq),B.component("RouterView",_q),B.config.globalProperties.$router=be,Object.defineProperty(B.config.globalProperties,"$route",{enumerable:!0,get:()=>ke(c)}),sa&&!we&&c.value===Zr&&(we=!0,k(i.location).catch(Te=>{}));const se={};for(const Te in Zr)Object.defineProperty(se,Te,{get:()=>c.value[Te],enumerable:!0});B.provide(um,be),B.provide(Zv,rT(se)),B.provide(W0,c);const he=B.unmount;ae.add(B),B.unmount=function(){ae.delete(B),ae.size<1&&(f=Zr,pe&&pe(),pe=null,c.value=Zr,we=!1,Se=!1),he()}}};function Ne(B){return B.reduce((se,he)=>se.then(()=>F(he)),Promise.resolve())}return be}function _i(){return Vt(um)}function er(n){return Vt(Zv)}const Kt={TABLE:{ALL:"/tables",CREATE:"/tables",DELETE:"/tables/:tableName",UPDATE:"/tables/:tableName",TRUNCATE:"/tables/:tableName/truncate",DESCRIBE:"/tables/:tableName/describe",TTL:"/tables/:tableName/time-to-live"},DATABASE:{ALL:"/database/tables",RESTORE:"/database/restore/:uid",STREAM:"/database/stream/:uid",CONNECT:"/database/connect",DISCONNECT:"/database/disconnect",ABORT:"/database/restore/abort"},ITEM:{CREATE:"/tables/:tableName/items",GET:"/tables/:tableName/items/get",UPDATE:"/tables/:tableName/items",SCAN:"/tables/:tableName/items/scan",QUERY:"/tables/:tableName/items/query",COUNT:"/tables/:tableName/items/count",TRUNCATE:"/tables/:tableName/items/truncate",DELETE:"/tables/:tableName/items/delete"}};async function Cq(n){const{data:e}=await Xe.put(Kt.DATABASE.CONNECT,n);return e}async function Aq(){const{data:n}=await Xe.put(Kt.DATABASE.DISCONNECT,{});return n}const kq={class:"dropdown"},Tq=["placeholder","value","id"],Oq=["onClick"],Rq={key:0},Mq=Bn({__name:"SearchDropdown",props:{modelValue:{},items:{},placeholder:{default:"Search..."},id:{default:"search-dropdown"},showNoItemsFound:{type:Boolean,default:!1}},emits:["update:modelValue","select"],setup(n,{expose:e,emit:t}){const s=n,i=t,r=De(!1),o=De(""),l=at(()=>o.value?s.items.filter(m=>m?.toLowerCase()?.includes(o.value.toLowerCase())):s.items);Os(l,m=>{m.length===0&&!s.showNoItemsFound&&(r.value=!1)});const c=m=>{const y=m.target;o.value=y.value,i("update:modelValue",y.value),r.value=!0},f=()=>{(s.items.length>0||s.showNoItemsFound)&&(r.value=!0)},h=m=>{o.value=m,i("update:modelValue",m),i("select",m),r.value=!1},d=m=>{m.target.closest(".dropdown")||(r.value=!1)},g=()=>{o.value=""};return Si(()=>{document.addEventListener("click",d)}),Rv(()=>{document.removeEventListener("click",d)}),e({clear:g}),(m,y)=>(ue(),ye("div",kq,[b("input",{type:"text",autocomplete:"off",class:"form-control rounded-0 mb-2",placeholder:n.placeholder,value:n.modelValue,onInput:c,onFocus:f,id:n.id},null,40,Tq),b("ul",{class:Pt(["dropdown-menu rounded-0 w-100",{show:r.value&&(l.value.length>0||n.showNoItemsFound)}]),style:Hi({display:r.value&&(l.value.length>0||n.showNoItemsFound)?"block":"none"})},[(ue(!0),ye(gt,null,mn(l.value,w=>(ue(),ye("li",{key:w},[b("a",{class:Pt(["dropdown-item",{active:w===n.modelValue}]),onClick:Qs(x=>h(w),["prevent"])},Pe(w),11,Oq)]))),128)),n.showNoItemsFound&&!l.value.length?(ue(),ye("li",Rq,[...y[0]||(y[0]=[b("span",{class:"dropdown-item text-muted"},"No matches found",-1)])])):st("",!0)],6)]))}}),tr=(n,e)=>{const t=n.__vccOpts||n;for(const[s,i]of e)t[s]=i;return t},Ru=tr(Mq,[["__scopeId","data-v-420ce410"]]),OE={STATUS:{DISABLED:"DISABLED",ENABLED:"ENABLED"}},sR=["us-east-2","us-east-1","us-west-1","us-west-2","af-south-1","ap-east-1","ap-south-2","ap-southeast-3","ap-southeast-4","ap-south-1","ap-northeast-3","ap-northeast-2","ap-southeast-1","ap-southeast-2","ap-northeast-1","ca-central-1","eu-central-1","eu-west-1","eu-west-2","eu-south-1","eu-west-3","eu-south-2","eu-north-1","eu-central-2","il-central-1","me-south-1","me-central-1","sa-east-1","us-gov-east-1","us-gov-west-1"],iR=["https://dynamodb.us-east-2.amazonaws.com","https://dynamodb.us-east-1.amazonaws.com","https://dynamodb.us-west-1.amazonaws.com","https://dynamodb.us-west-2.amazonaws.com","https://dynamodb.af-south-1.amazonaws.com","https://dynamodb.ap-east-1.amazonaws.com","https://dynamodb.ap-south-2.amazonaws.com","https://dynamodb.ap-southeast-3.amazonaws.com","https://dynamodb.ap-southeast-4.amazonaws.com","https://dynamodb.ap-south-1.amazonaws.com","https://dynamodb.ap-northeast-3.amazonaws.com","https://dynamodb.ap-northeast-2.amazonaws.com","https://dynamodb.ap-southeast-1.amazonaws.com","https://dynamodb.ap-southeast-2.amazonaws.com","https://dynamodb.ap-northeast-1.amazonaws.com","https://dynamodb.ca-central-1.amazonaws.com","https://dynamodb.eu-central-1.amazonaws.com","https://dynamodb.eu-west-1.amazonaws.com","https://dynamodb.eu-west-2.amazonaws.com","https://dynamodb.eu-south-1.amazonaws.com","https://dynamodb.eu-west-3.amazonaws.com","https://dynamodb.eu-south-2.amazonaws.com","https://dynamodb.eu-north-1.amazonaws.com","https://dynamodb.eu-central-2.amazonaws.com","https://dynamodb.il-central-1.amazonaws.com","https://dynamodb.me-south-1.amazonaws.com","https://dynamodb.me-central-1.amazonaws.com","https://dynamodb.sa-east-1.amazonaws.com","https://dynamodb.us-gov-east-1.amazonaws.com","https://dynamodb.us-gov-west-1.amazonaws.com"];var RE;(function(n){n.GET_DATA="ui-bg-get-data",n.GET_DEVTOOLS_DATA="ui-bg-get-devtools-data",n.SUBSCRIBE_TO_CHANGES="ui-bg-subscribe-to-changes",n.UNSUBSCRIBE_FROM_CHANGES="ui-bg-unsubscribe-from-changes",n.CHANGE_SETTINGS="ui-bg-change-settings",n.SET_THEME="ui-bg-set-theme",n.TOGGLE_ACTIVE_TAB="ui-bg-toggle-active-tab",n.MARK_NEWS_AS_READ="ui-bg-mark-news-as-read",n.MARK_NEWS_AS_DISPLAYED="ui-bg-mark-news-as-displayed",n.LOAD_CONFIG="ui-bg-load-config",n.APPLY_DEV_DYNAMIC_THEME_FIXES="ui-bg-apply-dev-dynamic-theme-fixes",n.RESET_DEV_DYNAMIC_THEME_FIXES="ui-bg-reset-dev-dynamic-theme-fixes",n.APPLY_DEV_INVERSION_FIXES="ui-bg-apply-dev-inversion-fixes",n.RESET_DEV_INVERSION_FIXES="ui-bg-reset-dev-inversion-fixes",n.APPLY_DEV_STATIC_THEMES="ui-bg-apply-dev-static-themes",n.RESET_DEV_STATIC_THEMES="ui-bg-reset-dev-static-themes",n.START_ACTIVATION="ui-bg-start-activation",n.RESET_ACTIVATION="ui-bg-reset-activation",n.COLOR_SCHEME_CHANGE="ui-bg-color-scheme-change",n.HIDE_HIGHLIGHTS="ui-bg-hide-highlights"})(RE||(RE={}));var ME;(function(n){n.CHANGES="bg-ui-changes"})(ME||(ME={}));var DE;(function(n){n.CSS_UPDATE="debug-bg-ui-css-update",n.UPDATE="debug-bg-ui-update"})(DE||(DE={}));var Mu;(function(n){n.ADD_CSS_FILTER="bg-cs-add-css-filter",n.ADD_DYNAMIC_THEME="bg-cs-add-dynamic-theme",n.ADD_STATIC_THEME="bg-cs-add-static-theme",n.ADD_SVG_FILTER="bg-cs-add-svg-filter",n.CLEAN_UP="bg-cs-clean-up",n.FETCH_RESPONSE="bg-cs-fetch-response",n.UNSUPPORTED_SENDER="bg-cs-unsupported-sender"})(Mu||(Mu={}));var LE;(function(n){n.RELOAD="debug-bg-cs-reload"})(LE||(LE={}));var Xd;(function(n){n.COLOR_SCHEME_CHANGE="cs-bg-color-scheme-change",n.DARK_THEME_DETECTED="cs-bg-dark-theme-detected",n.DARK_THEME_NOT_DETECTED="cs-bg-dark-theme-not-detected",n.FETCH="cs-bg-fetch",n.DOCUMENT_CONNECT="cs-bg-document-connect",n.DOCUMENT_FORGET="cs-bg-document-forget",n.DOCUMENT_FREEZE="cs-bg-document-freeze",n.DOCUMENT_RESUME="cs-bg-document-resume"})(Xd||(Xd={}));var NE;(function(n){n.LOG="debug-cs-bg-log"})(NE||(NE={}));var IE;(function(n){n.EXPORT_CSS_RESPONSE="cs-ui-export-css-response"})(IE||(IE={}));var PE;(function(n){n.EXPORT_CSS="ui-cs-export-css"})(PE||(PE={}));const ew=typeof navigator<"u",Ar=ew?navigator.userAgentData&&Array.isArray(navigator.userAgentData.brands)?navigator.userAgentData.brands.map(n=>`${n.brand.toLowerCase()} ${n.version}`).join(" "):navigator.userAgent.toLowerCase():"some useragent",rR=ew?navigator.userAgentData&&typeof navigator.userAgentData.platform=="string"?navigator.userAgentData.platform.toLowerCase():navigator.platform.toLowerCase():"some platform",H0=Ar.includes("chrome")||Ar.includes("chromium"),df=Ar.includes("firefox")||Ar.includes("thunderbird")||Ar.includes("librewolf"),Qd=Ar.includes("safari")&&!H0,Dq=rR.startsWith("win"),Lq=rR.startsWith("mac");ew&&navigator.userAgentData?navigator.userAgentData.mobile:Ar.includes("mobile");const oR=typeof ShadowRoot=="function",lR=typeof CSSLayerBlockRule=="function";(()=>{const n=Ar.match(/chrom(?:e|ium)(?:\/| )([^ ]+)/);return n&&n[1]?n[1]:""})();(()=>{const n=Ar.match(/(?:firefox|librewolf)(?:\/| )([^ ]+)/);return n&&n[1]?n[1]:""})();const Nq=(()=>{try{return document.querySelector(":defined"),!0}catch{return!1}})(),aR=(()=>{try{if(typeof document>"u")return!1;const n=document.createElement("div");return!n||typeof n.style!="object"?!1:typeof n.style.colorScheme=="string"?!0:(n.setAttribute("style","color-scheme: dark"),n.style.colorScheme==="dark")}catch{return!1}})();async function tw(n,e,t){const s=t&&n.startsWith(`${t}/`)?void 0:"omit",i=await fetch(n,{cache:"force-cache",credentials:s,referrer:t});if(df&&e==="text/css"&&n.startsWith("moz-extension://")&&n.endsWith(".css"))return i;if(e&&!(i.headers.get("Content-Type")===e||i.headers.get("Content-Type").startsWith(`${e};`)))throw new Error(`Mime type mismatch when loading ${n}`);if(!i.ok)throw new Error(`Unable to load ${n} ${i.status} ${i.statusText}`);return i}async function Iq(n,e){const t=await tw(n,e);return await cR(t)}async function Pq(n,e){return await(await tw(n,e)).blob()}async function cR(n){const e=await n.blob();return await new Promise(s=>{const i=new FileReader;i.onloadend=()=>s(i.result),i.readAsDataURL(e)})}async function $q(n,e,t){return await(await tw(n,e,t)).text()}const uR=async n=>Promise.reject(new Error(["Embedded Dark Reader cannot access a cross-origin resource",n,"Overview your URLs and CORS policies or use","`DarkReader.setFetchMethod(fetch: (url) => Promise<Response>))`.","See if using `DarkReader.setFetchMethod(window.fetch)`","before `DarkReader.enable()` works."].join(" ")));let U0=uR;function Bq(n){n?U0=n:U0=uR}async function Fq(n){return await U0(n)}window.chrome||(window.chrome={});chrome.runtime||(chrome.runtime={});const z0=new Set;async function $E(...n){if(n[0]&&n[0].type===Xd.FETCH){const{id:e}=n[0];try{const{url:t,responseType:s}=n[0].data,i=await Fq(t);let r;s==="data-url"?r=await cR(i):r=await i.text(),z0.forEach(o=>o({type:Mu.FETCH_RESPONSE,data:r,error:null,id:e}))}catch(t){console.error(t),z0.forEach(s=>s({type:Mu.FETCH_RESPONSE,data:null,error:t,id:e}))}}}function BE(n){z0.add(n)}if(typeof chrome.runtime.sendMessage=="function"){const n=chrome.runtime.sendMessage;chrome.runtime.sendMessage=(...e)=>{$E(...e),n.apply(chrome.runtime,e)}}else chrome.runtime.sendMessage=$E;chrome.runtime.onMessage||(chrome.runtime.onMessage={});if(typeof chrome.runtime.onMessage.addListener=="function"){const n=chrome.runtime.onMessage.addListener;chrome.runtime.onMessage.addListener=(...e)=>{BE(e[0]),n.apply(chrome.runtime.onMessage,e)}}else chrome.runtime.onMessage.addListener=(...n)=>BE(n[0]);var Du;(function(n){n.cssFilter="cssFilter",n.svgFilter="svgFilter",n.staticTheme="staticTheme",n.dynamicTheme="dynamicTheme"})(Du||(Du={}));var q0;(function(n){n.NONE="",n.TIME="time",n.SYSTEM="system",n.LOCATION="location"})(q0||(q0={}));const _h={darkScheme:{background:"#181a1b",text:"#e8e6e3"},lightScheme:{background:"#dcdad7",text:"#181a1b"}},fR={mode:1,brightness:100,contrast:100,grayscale:0,sepia:0,useFont:!1,fontFamily:Lq?"Helvetica Neue":Dq?"Segoe UI":"Open Sans",textStroke:0,engine:Du.dynamicTheme,stylesheet:"",darkSchemeBackgroundColor:_h.darkScheme.background,darkSchemeTextColor:_h.darkScheme.text,lightSchemeBackgroundColor:_h.lightScheme.background,lightSchemeTextColor:_h.lightScheme.text,scrollbarColor:"",selectionColor:"auto",styleSystemControls:!aR,lightColorScheme:"Default",darkColorScheme:"Default",immediateModify:!1},Vq=["*.officeapps.live.com","*.sharepoint.com","docs.google.com","onedrive.live.com"];Vq.map(n=>{const e=Du.cssFilter;return{url:[n],theme:{...fR,engine:e},builtIn:!0}}),q0.NONE;function K0(n,e,t=0){const s=[];let i;for(;i=n.exec(e);)s.push(i[t]);return s}function Wq(n,e,t=0){const s=[];let i;for(;i=n.exec(e);)s.push({text:i[t],offset:i.index});return s}function hR(n){const e=n.length;let t=0;for(let s=0;s<e;s++){const i=n.charCodeAt(s);t=(t<<5)-t+i&4294967295}return t}function Hq(n){return n.replaceAll(/[\^$.*+?\(\)\[\]{}|\-\\]/g,"\\$&")}function nw(n,e=0){return Uq(n,e,"(",")",[])}function Uq(n,e,t,s,i){let r;i.length===0?r=(f,h)=>n.indexOf(f,h):r=(f,h)=>dR(n,f,h,i);const{length:o}=n;let l=0,c=-1;for(let f=e;f<o;f++)if(l===0){const h=r(t,f);if(h<0)break;c=h,l++,f=h}else{const h=r(s,f);if(h<0)break;const d=r(t,f);if(d<0||h<=d){if(l--,l===0)return{start:c,end:h+1};f=h}else l++,f=d}return null}function dR(n,e,t,s){const i=n.indexOf(e,t),r=s.find(o=>i>=o.start&&i<o.end);return r?dR(n,e,r.end,s):i}let Eh;const Kc=new Map;function FE(n){return Eh||(Eh=document.createElement("a")),Eh.href=n,Eh.href}function Jd(n,e=null){const t=`${n}${e?`;${e}`:""}`;if(Kc.has(t))return Kc.get(t);if(e){const i=new URL(n,FE(e));return Kc.set(t,i),i}const s=new URL(FE(n));return Kc.set(n,s),s}function fm(n,e){if(e.match(/^data\\?\:/))return e;if(/^\/\//.test(e))return`${location.protocol}${e}`;const t=Jd(n);return Jd(e,t.href).href}function zq(n){if(n.startsWith("data:"))return!0;const e=Jd(n);return e.protocol!==location.protocol||e.hostname!==location.hostname||e.port!==location.port?!1:e.pathname===location.pathname}const qq=["pre","pre *","code",'[aria-hidden="true"]','[class*="fa-"]',".fa",".fab",".fad",".fal",".far",".fas",".fass",".fasr",".fat",".icofont",'[style*="font-"]','[class*="icon"]','[class*="Icon"]','[class*="symbol"]','[class*="Symbol"]',".glyphicon",'[class*="material-symbol"]','[class*="material-icon"]',"mu",'[class*="mu-"]',".typcn",'[class*="vjs-"]'];function Kq(n){const e=[];return e.push(`*:not(${qq.join(", ")}) {`),n.useFont&&n.fontFamily&&e.push(`  font-family: ${n.fontFamily} !important;`),n.textStroke>0&&(e.push(`  -webkit-text-stroke: ${n.textStroke}px !important;`),e.push(`  text-stroke: ${n.textStroke}px !important;`)),e.push("}"),e.join(`
`)}function jq(n){return n.length!=null}function ii(n,e){if(jq(n))for(let t=0,s=n.length;t<s;t++)e(n[t]);else for(const t of n)e(t)}function sw(n,e){ii(e,t=>n.push(t))}function Gq(n){const e=[];for(let t=0,s=n.length;t<s;t++)e.push(n[t]);return e}function hi(n,e,t,s,i){return(n-e)*(i-s)/(t-e)+s}function ul(n,e,t){return Math.min(t,Math.max(e,n))}function ia(n,e){const t=[];for(let s=0,i=n.length;s<i;s++){t[s]=[];for(let r=0,o=e[0].length;r<o;r++){let l=0;for(let c=0,f=n[0].length;c<f;c++)l+=n[s][c]*e[c][r];t[s][r]=l}}return t}function pR(n){let e=Gl.identity();return n.sepia!==0&&(e=ia(e,Gl.sepia(n.sepia/100))),n.grayscale!==0&&(e=ia(e,Gl.grayscale(n.grayscale/100))),n.contrast!==100&&(e=ia(e,Gl.contrast(n.contrast/100))),n.brightness!==100&&(e=ia(e,Gl.brightness(n.brightness/100))),n.mode===1&&(e=ia(e,Gl.invertNHue())),e}function Yq([n,e,t],s){const i=[[n/255],[e/255],[t/255],[1],[1]],r=ia(s,i);return[0,1,2].map(o=>ul(Math.round(r[o][0]*255),0,255))}const Gl={identity(){return[[1,0,0,0,0],[0,1,0,0,0],[0,0,1,0,0],[0,0,0,1,0],[0,0,0,0,1]]},invertNHue(){return[[.333,-.667,-.667,0,1],[-.667,.333,-.667,0,1],[-.667,-.667,.333,0,1],[0,0,0,1,0],[0,0,0,0,1]]},brightness(n){return[[n,0,0,0,0],[0,n,0,0,0],[0,0,n,0,0],[0,0,0,1,0],[0,0,0,0,1]]},contrast(n){const e=(1-n)/2;return[[n,0,0,0,e],[0,n,0,0,e],[0,0,n,0,e],[0,0,0,1,0],[0,0,0,0,1]]},sepia(n){return[[.393+.607*(1-n),.769-.769*(1-n),.189-.189*(1-n),0,0],[.349-.349*(1-n),.686+.314*(1-n),.168-.168*(1-n),0,0],[.272-.272*(1-n),.534-.534*(1-n),.131+.869*(1-n),0,0],[0,0,0,1,0],[0,0,0,0,1]]},grayscale(n){return[[.2126+.7874*(1-n),.7152-.7152*(1-n),.0722-.0722*(1-n),0,0],[.2126-.2126*(1-n),.7152+.2848*(1-n),.0722-.0722*(1-n),0,0],[.2126-.2126*(1-n),.7152-.7152*(1-n),.0722+.9278*(1-n),0,0],[0,0,0,1,0],[0,0,0,0,1]]}};var j0;(function(n){n[n.light=0]="light",n[n.dark=1]="dark"})(j0||(j0={}));function mR(n){const e=[];return n.mode===j0.dark&&e.push("invert(100%) hue-rotate(180deg)"),n.brightness!==100&&e.push(`brightness(${n.brightness}%)`),n.contrast!==100&&e.push(`contrast(${n.contrast}%)`),n.grayscale!==0&&e.push(`grayscale(${n.grayscale}%)`),n.sepia!==0&&e.push(`sepia(${n.sepia}%)`),e.length===0?null:e.join(" ")}function Xq(n){const e=[],t=[];let s;for(let r=0,o=n.length;r<o;r++){const l=n[r];if(!(!l||l===" ")){if(Dc.has(l)){const c=Dc.get(l);for(;t.length;){const f=Dc.get(t[0]);if(!f)break;if(c.lessOrEqualThan(f))e.push(t.shift());else break}t.unshift(l)}else!s||Dc.has(s)?e.push(l):e[e.length-1]+=l;s=l}}e.push(...t);const i=[];for(let r=0,o=e.length;r<o;r++){const l=Dc.get(e[r]);if(l){const c=i.splice(0,2);i.push(l.exec(c[1],c[0]))}else i.unshift(parseFloat(e[r]))}return i[0]}class Ch{constructor(e,t){this.precendce=e,this.execMethod=t}exec(e,t){return this.execMethod(e,t)}lessOrEqualThan(e){return this.precendce<=e.precendce}}const Dc=new Map([["+",new Ch(1,(n,e)=>n+e)],["-",new Ch(1,(n,e)=>n-e)],["*",new Ch(2,(n,e)=>n*e)],["/",new Ch(2,(n,e)=>n/e)]]),Qq=()=>matchMedia("(prefers-color-scheme: dark)").matches,dd=new Map,pd=new Map;function bn(n){if(n=n.trim(),pd.has(n))return pd.get(n);n.includes("calc(")&&(n=dK(n));const e=bR(n);return e?(pd.set(n,e),e):null}function VE(n){if(dd.has(n))return dd.get(n);const e=bn(n);if(!e)return null;const t=hm(e);return dd.set(n,t),t}function Jq(){dd.clear(),pd.clear()}function gR({h:n,s:e,l:t,a:s=1}){if(e===0){const[h,d,g]=[t,t,t].map(m=>Math.round(m*255));return{r:h,g,b:d,a:s}}const i=(1-Math.abs(2*t-1))*e,r=i*(1-Math.abs(n/60%2-1)),o=t-i/2,[l,c,f]=(n<60?[i,r,0]:n<120?[r,i,0]:n<180?[0,i,r]:n<240?[0,r,i]:n<300?[r,0,i]:[i,0,r]).map(h=>Math.round((h+o)*255));return{r:l,g:c,b:f,a:s}}function hm({r:n,g:e,b:t,a:s=1}){const i=n/255,r=e/255,o=t/255,l=Math.max(i,r,o),c=Math.min(i,r,o),f=l-c,h=(l+c)/2;if(f===0)return{h:0,s:0,l:h,a:s};let d=(l===i?(r-o)/f%6:l===r?(o-i)/f+2:(i-r)/f+4)*60;d<0&&(d+=360);const g=f/(1-Math.abs(2*h-1));return{h:d,s:g,l:h,a:s}}function ls(n,e=0){const t=n.toFixed(e);if(e===0)return t;const s=t.indexOf(".");if(s>=0){const i=t.match(/0+$/);if(i)return i.index===s+1?t.substring(0,s):t.substring(0,i.index)}return t}function Zq(n){const{r:e,g:t,b:s,a:i}=n;return i!=null&&i<1?`rgba(${ls(e)}, ${ls(t)}, ${ls(s)}, ${ls(i,2)})`:`rgb(${ls(e)}, ${ls(t)}, ${ls(s)})`}function iw({r:n,g:e,b:t,a:s}){return`#${(s!=null&&s<1?[n,e,t,Math.round(s*255)]:[n,e,t]).map(i=>`${i<16?"0":""}${i.toString(16)}`).join("")}`}function WE(n){const{h:e,s:t,l:s,a:i}=n;return i!=null&&i<1?`hsla(${ls(e)}, ${ls(t*100)}%, ${ls(s*100)}%, ${ls(i,2)})`:`hsl(${ls(e)}, ${ls(t*100)}%, ${ls(s*100)}%)`}const eK=/^rgba?\([^\(\)]+\)$/,tK=/^hsla?\([^\(\)]+\)$/,nK=/^#[0-9a-f]+$/i,sK=["color","color-mix","hwb","lab","lch","oklab","oklch"];function bR(n){const e=n.trim().toLowerCase();if(e.includes("(from "))return e.indexOf("(from")!==e.lastIndexOf("(from")?null:xb(e);if(e.match(eK))return e.startsWith("rgb(#")||e.startsWith("rgba(#")?e.lastIndexOf("rgb")>0?null:xb(e):vR(e);if(e.match(tK))return cK(e);if(e.match(nK))return uK(e);if(wR.has(e))return fK(e);if(SR.has(e))return hK(e);if(e==="transparent")return{r:0,g:0,b:0,a:0};if(e.endsWith(")")&&sK.some(t=>e.startsWith(t)&&e[t.length]==="("&&e.lastIndexOf(t)===0))return xb(e);if(e.startsWith("light-dark(")&&e.endsWith(")")){const t=e.match(/^light-dark\(\s*([a-z]+(\(.*\))?),\s*([a-z]+(\(.*\))?)\s*\)$/);if(t){const s=Qq()?t[3]:t[1];return bR(s)}}return null}function iK(n){const e=[];let t=0,s=!1;const i=n.indexOf("(");n=n.substring(i+1,n.length-1);for(let r=0;r<n.length;r++){const o=n[r];o>="0"&&o<="9"||o==="."||o==="+"||o==="-"?s=!0:s&&(o===" "||o===","||o==="/")?(e.push(n.substring(t,r)),s=!1,t=r+1):s||(t=r+1)}return s&&e.push(n.substring(t,n.length)),e}function yR(n,e,t){const s=iK(n),i=Object.entries(t);return s.map(o=>o.trim()).map((o,l)=>{let c;const f=i.find(([h])=>o.endsWith(h));return f?c=parseFloat(o.substring(0,o.length-f[0].length))/f[1]*e[l]:c=parseFloat(o),e[l]>1?Math.round(c):c})}const rK=[255,255,255,1],oK={"%":100};function vR(n){const[e,t,s,i=1]=yR(n,rK,oK);return e==null||t==null||s==null||i==null?null:{r:e,g:t,b:s,a:i}}const lK=[360,1,1,1],aK={"%":100,deg:360,rad:2*Math.PI,turn:1};function cK(n){const[e,t,s,i=1]=yR(n,lK,aK);return e==null||t==null||s==null||i==null?null:gR({h:e,s:t,l:s,a:i})}function uK(n){const e=n.substring(1);switch(e.length){case 3:case 4:{const[t,s,i]=[0,1,2].map(o=>parseInt(`${e[o]}${e[o]}`,16)),r=e.length===3?1:parseInt(`${e[3]}${e[3]}`,16)/255;return{r:t,g:s,b:i,a:r}}case 6:case 8:{const[t,s,i]=[0,2,4].map(o=>parseInt(e.substring(o,o+2),16)),r=e.length===6?1:parseInt(e.substring(6,8),16)/255;return{r:t,g:s,b:i,a:r}}}return null}function fK(n){const e=wR.get(n);return{r:e>>16&255,g:e>>8&255,b:e>>0&255,a:1}}function hK(n){const e=SR.get(n);return{r:e>>16&255,g:e>>8&255,b:e>>0&255,a:1}}function dK(n){let e=0;const t=(s,i,r)=>{n=n.substring(0,s)+r+n.substring(i)};for(;(e=n.indexOf("calc("))!==-1;){const s=nw(n,e);if(!s)break;let i=n.slice(s.start+1,s.end-1);const r=i.includes("%");i=i.split("%").join("");const o=Math.round(Xq(i));t(s.start-4,s.end,o+(r?"%":""))}return n}const wR=new Map(Object.entries({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgrey:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,grey:8421504,green:32768,greenyellow:11403055,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgrey:13882323,lightgreen:9498256,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074})),SR=new Map(Object.entries({ActiveBorder:3906044,ActiveCaption:0,AppWorkspace:11184810,Background:6513614,ButtonFace:16777215,ButtonHighlight:15329769,ButtonShadow:10461343,ButtonText:0,CaptionText:0,GrayText:8355711,Highlight:11720703,HighlightText:0,InactiveBorder:16777215,InactiveCaption:16777215,InactiveCaptionText:0,InfoBackground:16514245,InfoText:0,Menu:16185078,MenuText:16777215,Scrollbar:11184810,ThreeDDarkShadow:0,ThreeDFace:12632256,ThreeDHighlight:16777215,ThreeDLightShadow:16777215,ThreeDShadow:0,Window:15527148,WindowFrame:11184810,WindowText:0,"-webkit-focus-ring-color":15046400}).map(([n,e])=>[n.toLowerCase(),e]));function xR(n,e,t){return(.2126*n+.7152*e+.0722*t)/255}let Ah,Lc;function xb(n){Lc||(Ah=document.createElement("canvas"),Ah.width=1,Ah.height=1,Lc=Ah.getContext("2d",{willReadFrequently:!0})),Lc.fillStyle=n,Lc.fillRect(0,0,1,1);const e=Lc.getImageData(0,0,1,1).data,t=`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${(e[3]/255).toFixed(2)})`;return vR(t)}function rw(n){let e=!1,t=null,s;return Object.assign((...o)=>{s=o,t?e=!0:(n(...s),t=requestAnimationFrame(()=>{t=null,e&&(n(...s),e=!1)}))},{cancel:()=>{cancelAnimationFrame(t),e=!1,t=null}})}function pK(){const n=[];let e=null;function t(){let r;for(;r=n.shift();)r();e=null}function s(r){n.push(r),e||(e=requestAnimationFrame(t))}function i(){n.splice(0),cancelAnimationFrame(e),e=null}return{add:s,cancel:i}}const _b=new Set;function mK(n,e){_b.has(n)||(_b.add(n),requestAnimationFrame(()=>{_b.delete(n),e()}))}function gK(n){return(n<16?"0":"")+n.toString(16)}function _R(){if("randomUUID"in crypto){const n=crypto.randomUUID();return n.substring(0,8)+n.substring(9,13)+n.substring(14,18)+n.substring(19,23)+n.substring(24)}return"getRandomValues"in crypto?Array.from(crypto.getRandomValues(new Uint8Array(16))).map(n=>gK(n)).join(""):Math.floor(Math.random()*2**55).toString(36)}let kr=null,ER=!document.hidden;const va={capture:!0,passive:!0};function bK(){document.addEventListener("visibilitychange",kr,va),window.addEventListener("pageshow",kr,va),window.addEventListener("focus",kr,va)}function yK(){document.removeEventListener("visibilitychange",kr,va),window.removeEventListener("pageshow",kr,va),window.removeEventListener("focus",kr,va)}function vK(n){const e=!!kr;kr=()=>{document.hidden||(CR(),n(),ER=!0)},e||bK()}function CR(){yK(),kr=null}function AR(){return ER}function Zd(n){let e=0;return n.seconds&&(e+=n.seconds*1e3),n.minutes&&(e+=n.minutes*60*1e3),n.hours&&(e+=n.hours*60*60*1e3),n.days&&(e+=n.days*24*60*60*1e3),e}function Sr(...n){}function Ct(...n){}function wK(...n){}function ow(n,e){e||wK(n)}function uo(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function kR(n,e,t=Function.prototype){const i=Zd({seconds:2}),r=Zd({seconds:10});let o=n.previousSibling,l=n.parentNode;if(!l)throw new Error("Unable to watch for node position: parent element not found");if(e==="prev-sibling"&&!o)throw new Error("Unable to watch for node position: there is no previous sibling");let c=0,f=null,h=null;const d=rw(()=>{if(h)return;c++;const S=Date.now();if(f==null)f=S;else if(c>=10){if(S-f<r){Ct(`Node position watcher paused: retry in ${i}ms`,n,o),h=setTimeout(()=>{f=null,c=0,h=null,d()},i);return}f=S,c=1}if(e==="head"&&o&&o.parentNode!==l&&(Ct("Sibling moved, moving node to the head end",n,o,l),o=document.head.lastChild),e==="prev-sibling"){if(o.parentNode==null){Ct("Unable to restore node position: sibling was removed",n,o,l),y();return}o.parentNode!==l&&(Ct("Style was moved to another parent",n,o,l),x(o.parentNode))}e==="head"&&!l.isConnected&&(l=document.head),Ct("Restoring node position",n,o,l),l.insertBefore(n,o&&o.isConnected?o.nextSibling:l.firstChild),g.takeRecords(),t&&t()}),g=new MutationObserver(()=>{(e==="head"&&(n.parentNode!==l||!n.parentNode.isConnected)||e==="prev-sibling"&&n.previousSibling!==o)&&d()}),m=()=>{g.observe(l,{childList:!0})},y=()=>{clearTimeout(h),g.disconnect(),d.cancel()},w=()=>{g.takeRecords()},x=S=>{l=S,y(),m()};return m(),{run:m,stop:y,skip:w}}function lc(n,e){if(n==null)return;const t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode(s){return s.shadowRoot==null?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});for(let s=n.shadowRoot?t.currentNode:t.nextNode();s!=null;s=t.nextNode())s.classList.contains("surfingkeys_hints_host")||(e(s),lc(s.shadowRoot,e))}let Co=()=>document.readyState==="complete"||document.readyState==="interactive";function SK(n){Co=n}const ep=new Set;function lw(n){Co()?n():ep.add(n)}function TR(n){ep.delete(n)}function dm(){return document.readyState==="complete"}const tp=new Set;function aw(n){dm()?n():tp.add(n)}function xK(){tp.clear()}if(!Co()){const n=()=>{Co()&&(ep.forEach(e=>e()),ep.clear(),dm()&&(document.removeEventListener("readystatechange",n),tp.forEach(e=>e()),tp.clear()))};document.addEventListener("readystatechange",n)}const HE=1e3;function _K(n){if(n.length>HE)return!0;let e=0;for(let t=0;t<n.length;t++)if(e+=n[t].addedNodes.length,e>HE)return!0;return!1}function EK(n){const e=new Set,t=new Set,s=new Set;n.forEach(o=>{ii(o.addedNodes,l=>{l instanceof Element&&l.isConnected&&e.add(l)}),ii(o.removedNodes,l=>{l instanceof Element&&(l.isConnected?(s.add(l),e.delete(l)):t.add(l))})});const i=[],r=[];return e.forEach(o=>{e.has(o.parentElement)&&i.push(o)}),t.forEach(o=>{t.has(o.parentElement)&&r.push(o)}),i.forEach(o=>e.delete(o)),r.forEach(o=>t.delete(o)),{additions:e,moves:s,deletions:t}}const kh=new Map,Eb=new WeakMap;function OR(n,e){let t,s,i;if(kh.has(n))t=kh.get(n),s=Eb.get(t);else{let r=!1,o=!1;t=new MutationObserver(l=>{if(_K(l))!r||Co()?s.forEach(({onHugeMutations:c})=>c(n)):o||(i=()=>s.forEach(({onHugeMutations:c})=>c(n)),lw(i),o=!0),r=!0;else{const c=EK(l);s.forEach(({onMinorMutations:f})=>f(n,c))}}),t.observe(n,{childList:!0,subtree:!0}),kh.set(n,t),s=new Set,Eb.set(t,s)}return s.add(e),{disconnect(){s.delete(e),i&&TR(i),s.size===0&&(t.disconnect(),Eb.delete(t),kh.delete(n))}}}function fo(n,e,t){ii(n,s=>{if(uw(s))e(s),s.cssRules?.length>0&&fo(s.cssRules,e);else if(OK(s))try{fo(s.styleSheet.cssRules,e,t)}catch{t?.()}else if(G0(s)){const i=Array.from(s.media),r=i.some(l=>l.startsWith("screen")||l.startsWith("all")||l.startsWith("(")),o=!r&&i.some(l=>RR.some(c=>l.startsWith(c)));(r||!o)&&fo(s.cssRules,e,t)}else RK(s)?CSS.supports(s.conditionText)&&fo(s.cssRules,e,t):Y0(s)?fo(s.cssRules,e,t):Ct("CSSRule type not supported",s)})}const RR=["aural","braille","embossed","handheld","print","projection","speech","tty","tv"],MR=["background","border","border-color","border-bottom","border-left","border-right","border-top","outline","outline-color"],CK=Qd?MR.map(n=>{const e=new RegExp(`${n}:\\s*(.*?)\\s*;`);return[n,e]}):null;function ca(n,e){ii(n,s=>{const i=n.getPropertyValue(s).trim();i&&e(s,i)});const t=n.cssText;t.includes("var(")&&(Qd?CK.forEach(([s,i])=>{const r=t.match(i);if(r&&r[1]){const o=r[1].trim();e(s,o)}}):MR.forEach(s=>{const i=n.getPropertyValue(s);i&&i.includes("var(")&&e(s,i)})),(t.includes("background-color: ;")||t.includes("background-image: ;"))&&!n.getPropertyValue("background")&&UE("background",n,e),t.includes("border-")&&t.includes("-color: ;")&&!n.getPropertyValue("border")&&UE("border",n,e)}function UE(n,e,t){const s=e.parentRule;if(uw(s)){const i=s.parentStyleSheet?.ownerNode?.textContent;if(i){let r=Hq(s.selectorText);r=r.replaceAll(/\s+/g,"\\s*"),r=r.replaceAll(/::/g,"::?");const o=new RegExp(`${r}\\s*{[^}]*${n}:\\s*([^;}]+)`),l=i.match(o);l&&t(n,l[1])}else n==="background"&&(t("background-color","#ffffff"),t("background-image","none"))}}const DR=/url\((('.*?')|(".*?")|([^\)]*?))\)/g,LR=/@import\s*(url\()?(('.+?')|(".+?")|([^\)]*?))\)? ?(screen)?;?/gi;function cw(n){return n.trim().replace(/[\n\r\\]+/g,"").replace(/^url\((.*)\)$/,"$1").trim().replace(/^"(.*)"$/,"$1").replace(/^'(.*)'$/,"$1").replace(/(?:\\(.))/g,"$1")}function np(n){const e=Jd(n);return`${e.origin}${e.pathname.replace(/\?.*$/,"").replace(/(\/)([^\/]+)$/i,"$1")}`}function AK(n,e){return n.replace(DR,t=>{try{const s=cw(t);return`url('${fm(e,s).replaceAll("'","\\'")}')`}catch{return Ct("Not able to replace relative URL with Absolute URL, skipping"),t}})}const kK=/@font-face\s*{[^}]*}/g;function TK(n){return n.replace(kK,"")}const qa=new WeakSet,zE=new WeakSet,qE=new WeakSet,KE=new WeakSet,jE=new WeakSet;function uw(n){return n?qa.has(n)?!0:n.selectorText?(qa.add(n),!0):!1:!1}function OK(n){return!n||qa.has(n)?!1:zE.has(n)?!0:n.href?(zE.add(n),!0):!1}function G0(n){return!n||qa.has(n)?!1:qE.has(n)?!0:n.media?(qE.add(n),!0):!1}function RK(n){return!n||qa.has(n)?!1:KE.has(n)?!0:n instanceof CSSSupportsRule?(KE.add(n),!0):!1}function Y0(n){return!n||qa.has(n)?!1:jE.has(n)?!0:lR&&n instanceof CSSLayerBlockRule?(jE.add(n),!0):!1}const X0=new WeakMap;function NR(n,e){X0.set(n,e)}function MK(n){if(!n.ownerNode)return null;if(X0.has(n))return X0.get(n);let e=n.ownerNode;for(;e;){if(e instanceof ShadowRoot||e instanceof Document)return NR(n,e),e;e=e.parentNode}return null}let Lu;const fl=new Map;function GE(n){Lu=n;const e=["background","text","border"];fl.forEach(t=>{e.forEach(s=>{if(t[s]){const{variable:i,value:r}=t[s];Lu?.cssRules[0].style.setProperty(i,r)}})})}function DK(){Lu=null,Q0()}function IR(n,e){return`var(${e[n].variable}, ${e[n].value})`}function LK(n,e){const t=iw(e),s=fl.get(t);return s?.[n]?IR(n,s):null}function NK(n,e,t){const s=iw(e);let i;fl.has(s)?i=fl.get(s):(i={parsed:bn(s)},fl.set(s,i));const r=`--darkreader-${n}-${s.replace("#","")}`;return i[n]={variable:r,value:t},Lu?.cssRules[0]?.style&&Lu?.cssRules[0].style.setProperty(r,t),IR(n,i)}function IK(){const n=[],e=[],t=[];return fl.forEach(s=>{s.background&&n.push(s.parsed),s.border&&e.push(s.parsed),s.text&&t.push(s.parsed)}),{background:n,border:e,text:t}}function Q0(){fl.clear()}function fw(n){const t=n.mode===1?"darkSchemeBackgroundColor":"lightSchemeBackgroundColor";return n[t]}function hw(n){const t=n.mode===1?"darkSchemeTextColor":"lightSchemeTextColor";return n[t]}const md=new Map;function PK(){md.clear()}const $K=["r","g","b","a"],PR=["mode","brightness","contrast","grayscale","sepia","darkSchemeBackgroundColor","darkSchemeTextColor","lightSchemeBackgroundColor","lightSchemeTextColor"];function BK(n,e){let t="";return $K.forEach(s=>{t+=`${n[s]};`}),PR.forEach(s=>{t+=`${e[s]};`}),t}function pm(n,e,t,s,i){let r;md.has(t)?r=md.get(t):(r=new Map,md.set(t,r));const o=BK(n,e);if(r.has(o))return r.get(o);const l=hm(n),c=s==null?null:VE(s),f=i==null?null:VE(i),h=t(l,c,f),{r:d,g,b:m,a:y}=gR(h),w=pR({...e,mode:0}),[x,S,C]=Yq([d,g,m],w),E=y===1?iw({r:x,g:S,b:C}):Zq({r:x,g:S,b:C,a:y});return r.set(o,E),E}function dw(n,e,t,s){const i=LK(n,e);if(i)return i;const r=s(e,t);return NK(n,e,r)}function pw(n,e){const t=fw(e),s=hw(e);return pm(n,e,FK,s,t)}function FK({h:n,s:e,l:t,a:s},i,r){const o=t<.5;let l;if(o)l=t<.2||e<.12;else{const d=n>200&&n<280;l=e<.24||t>.8&&d}let c=n,f=e;l&&(o?(c=i.h,f=i.s):(c=r.h,f=r.s));const h=hi(t,0,1,i.l,r.l);return{h:c,s:f,l:h,a:s}}const YE=.4;function VK({h:n,s:e,l:t,a:s},i){const r=t<.5,o=n>200&&n<280,l=e<.12||t>.8&&o;if(r){const d=hi(t,0,.5,0,YE);if(l){const g=i.h,m=i.s;return{h:g,s:m,l:d,a:s}}return{h:n,s:e,l:d,a:s}}let c=hi(t,.5,1,YE,i.l);if(l){const d=i.h,g=i.s;return{h:d,s:g,l:c,a:s}}let f=n;return n>60&&n<180&&(n>120?f=hi(n,120,180,135,180):f=hi(n,60,120,60,105)),f>40&&f<80&&(c*=.75),{h:f,s:e,l:c,a:s}}function XE(n,e){if(e.mode===0)return pw(n,e);const t=fw(e);return pm(n,e,VK,t)}function In(n,e,t=!0){return t?dw("background",n,e,XE):XE(n,e)}const Th=.55;function QE(n){return hi(n,205,245,205,220)}function WK({h:n,s:e,l:t,a:s},i){const r=t>.5,o=t<.2||e<.24,l=!o&&n>205&&n<245;if(r){const h=hi(t,.5,1,Th,i.l);if(o){const g=i.h,m=i.s;return{h:g,s:m,l:h,a:s}}let d=n;return l&&(d=QE(n)),{h:d,s:e,l:h,a:s}}if(o){const h=i.h,d=i.s,g=hi(t,0,.5,i.l,Th);return{h,s:d,l:g,a:s}}let c=n,f;return l?(c=QE(n),f=hi(t,0,.5,i.l,Math.min(1,Th+.05))):f=hi(t,0,.5,i.l,Th),{h:c,s:e,l:f,a:s}}function JE(n,e){if(e.mode===0)return pw(n,e);const t=hw(e);return pm(n,e,WK,t)}function fs(n,e,t=!0){return t?dw("text",n,e,JE):JE(n,e)}function HK({h:n,s:e,l:t,a:s},i,r){const o=t<.5,l=t<.2||e<.24;let c=n,f=e;l&&(o?(c=i.h,f=i.s):(c=r.h,f=r.s));const h=hi(t,0,1,.5,.2);return{h:c,s:f,l:h,a:s}}function ZE(n,e){if(e.mode===0)return pw(n,e);const t=hw(e),s=fw(e);return pm(n,e,HK,t,s)}function Ka(n,e,t=!0){return t?dw("border",n,e,ZE):ZE(n,e)}function UK(n,e){return In(n,e)}function Cb(n,e){return In(n,e)}const eC=8,J0="conic-",zK=J0.length,qK="radial-",KK="linear-";function jK(n){const e=[];let t=0,s=J0.length;for(;(t=n.indexOf("gradient",s))!==-1;){let i;if([KK,qK,J0].find(c=>{if(t-c.length>=0&&n.substring(t-c.length,t)===c)return n.slice(t-c.length-10,t-c.length-1)==="repeating"?(i=`repeating-${c}gradient`,!0):n.slice(t-c.length-8,t-c.length-1)==="-webkit"?(i=`-webkit-${c}gradient`,!0):(i=`${c}gradient`,!0)}),!i)break;const{start:r,end:o}=nw(n,t+eC),l=n.substring(r+1,o-1);s=o+1+zK,e.push({typeGradient:i,match:l,offset:i.length+2,index:t-i.length+eC,hasComma:!0})}return e.length&&(e[e.length-1].hasComma=!1),e}const $R="__darkreader__imageDetails_v2_list",BR="__darkreader__imageDetails_v2_",FR="__darkreader__cssFetch_";let tC=0;const Z0=new Map,nC=[];function GK(){Z0.forEach((n,e)=>{if(e&&e.startsWith("https://"))try{const t=JSON.stringify(n);sessionStorage.setItem(`${BR}${e}`,t),nC.push(e)}catch{}}),Z0.clear(),sessionStorage.setItem($R,JSON.stringify(nC))}function YK(n,e){!n||!n.startsWith("https://")||(Z0.set(n,e),clearTimeout(tC),tC=setTimeout(GK,1e3))}function XK(n){try{const e=sessionStorage.getItem($R);if(!e)return;JSON.parse(e).forEach(s=>{const i=sessionStorage.getItem(`${BR}${s}`);if(i){const r=JSON.parse(i);n.set(s,r)}})}catch{}}function QK(n,e){const t=`${FR}${n}`;try{sessionStorage.setItem(t,e)}catch{}}function JK(n){const e=`${FR}${n}`;try{return sessionStorage.getItem(e)??null}catch{}return null}function ZK(n){return n.slice(0,4).map(e=>e.map(t=>t.toFixed(3)).join(" ")).join(" ")}function ej(n){return ZK(pR(n))}const tj=1e3/60;class nj{constructor(){this.queue=[],this.timerId=null}addTask(e){this.queue.push(e),this.scheduleFrame()}stop(){this.timerId!==null&&(cancelAnimationFrame(this.timerId),this.timerId=null),this.queue=[]}scheduleFrame(){this.timerId||(this.timerId=requestAnimationFrame(()=>{this.timerId=null;const e=Date.now();let t;for(;t=this.queue.shift();)if(t(),Date.now()-e>=tj){this.scheduleFrame();break}}))}}const ey=new Map,ty=new Map;async function VR(n){if(window.DarkReader?.Plugins?.fetch)return window.DarkReader.Plugins.fetch(n);const e=new URL(n.url);if(e.origin!==n.origin&&oj(e))throw new Error("Cross-origin limit reached");return new Promise((t,s)=>{const i=_R();ey.set(i,t),ty.set(i,s),chrome.runtime.sendMessage({type:Xd.FETCH,data:n,id:i})})}chrome.runtime.onMessage.addListener(({type:n,data:e,error:t,id:s})=>{if(n===Mu.FETCH_RESPONSE){const i=ey.get(s),r=ty.get(s);ey.delete(s),ty.delete(s),t?r&&r(typeof t=="string"?new Error(t):t):i&&i(e)}});const sj=/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/,ij=16,Ab=new Set,sC=new Set,WR=["127-0-0-1.org.uk","42foo.com","domaincontrol.com","fbi.com","fuf.me","lacolhost.com","local.sisteminha.com","localfabriek.nl","localhost","localhst.co.uk","localmachine.info","localmachine.name","localtest.me","lvh.me","mouse-potato.com","nip.io","sslip.io","vcap.me","xip.io","yoogle.com"],rj=[".corp",".direct",".home",".internal",".intranet",".lan",".local",".localdomain",".test",".zz",...WR.map(n=>`.${n}`)];function oj(n){const{host:e,hostname:t,port:s,protocol:i}=n;return Ab.has(e)||Ab.add(e),sC.has(e)?!1:Ab.size>=ij||i!=="https:"||s!==""||WR.includes(t)||rj.some(r=>t.endsWith(r))||t.startsWith("[")||t.match(sj)?!0:(sC.add(e),!1)}const ny=new nj;async function HR(n){return new Promise(async(e,t)=>{try{const s=n.startsWith("data:")?n:await lj(n),i=zR(s)??await Pq(n);let r;s.startsWith("data:image/svg+xml")?r=await iC(s):r=await aj(i)??await iC(s),ny.addTask(()=>{const o=pj(r);e({src:n,dataURL:o.isLarge?"":s,width:r.width,height:r.height,...o})})}catch(s){t(s)}})}async function lj(n){return new URL(n).origin===location.origin?await Iq(n):await VR({url:n,responseType:"data-url",origin:location.origin})}async function aj(n){try{return await createImageBitmap(n)}catch(e){return Ct(`Unable to create image bitmap for type ${n.type}: ${String(e)}`),null}}const cj=256;let uj=0;async function iC(n){return new Promise((e,t)=>{const s=new Image;s.onload=()=>e(s),s.onerror=()=>t(`Unable to load image ${n}`),++uj<=cj||dm()?s.src=n:aw(()=>s.src=n)})}const sy=1024;let ua,wa;function fj(){const n=sy,e=sy;ua=document.createElement("canvas"),ua.width=n,ua.height=e,wa=ua.getContext("2d",{willReadFrequently:!0}),wa.imageSmoothingEnabled=!1}function hj(){ua=null,wa=null}const dj=512*512;function pj(n){ua||fj();let e,t;if(n instanceof HTMLImageElement?(e=n.naturalWidth,t=n.naturalHeight):(e=n.width,t=n.height),e===0||t===0)return Ct("Image is empty"),{isDark:!1,isLight:!1,isTransparent:!1,isLarge:!1};const s=e*t>dj,i=e*t,r=Math.min(1,Math.sqrt(sy/i)),o=Math.ceil(e*r),l=Math.ceil(t*r);wa.clearRect(0,0,o,l),wa.drawImage(n,0,0,e,t,0,0,o,l);const f=wa.getImageData(0,0,o,l).data,h=.05,d=.4,g=.7;let m=0,y=0,w=0,x,S,C,E,k,R,T,L;for(C=0;C<l;C++)for(S=0;S<o;S++)x=4*(C*o+S),E=f[x+0],k=f[x+1],R=f[x+2],T=f[x+3],T/255<h?m++:(L=xR(E,k,R),L<d&&y++,L>g&&w++);const N=o*l,F=N-m;return{isDark:y/F>=.7,isLight:w/F>=.7,isTransparent:m/N>=.1,isLarge:s}}let pf=null,mw=!1,rC=!1;const kb=[];document.addEventListener("__darkreader__inlineScriptsAllowed",()=>mw=!0,{once:!0});async function mj(){if(mw){if(rC)return await new Promise(n=>kb.push(n));rC=!0,await new Promise(n=>{document.addEventListener("__darkreader__blobURLCheckResponse",e=>{pf=e.detail.blobURLAllowed,n(),kb.forEach(t=>t()),kb.splice(0)},{once:!0}),document.dispatchEvent(new CustomEvent("__darkreader__blobURLCheckRequest"))})}}function gj(){return pf!=null||!mw}function UR(n){n.blockedURI==="blob"&&(pf=!1,document.removeEventListener("securitypolicyviolation",UR))}document.addEventListener("securitypolicyviolation",UR);const iy=new Set;function Tb({dataURL:n,width:e,height:t},s){n.startsWith("data:image/svg+xml")&&(n=yj(n));const i=ej(s),r=[`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="${e}" height="${t}">`,"<defs>",'<filter id="darkreader-image-filter">',`<feColorMatrix type="matrix" values="${i}" />`,"</filter>","</defs>",`<image width="${e}" height="${t}" filter="url(#darkreader-image-filter)" xlink:href="${n}" />`,"</svg>"].join("");if(!pf)return`data:image/svg+xml;base64,${btoa(r)}`;const o=new Uint8Array(r.length);for(let f=0;f<r.length;f++)o[f]=r.charCodeAt(f);const l=new Blob([o],{type:"image/svg+xml"}),c=URL.createObjectURL(l);return iy.add(c),c}const bj={"<":"&lt;",">":"&gt;","&":"&amp;","'":"&apos;",'"':"&quot;"};function yj(n){return n.replace(/[<>&'"]/g,e=>bj[e]??e)}const sp=new Map;function zR(n){const e=n.indexOf(":"),t=n.indexOf(";",e+1),s=n.indexOf(",",t+1),i=n.substring(t+1,s).toLocaleLowerCase(),r=n.substring(e+1,t);if(i!=="base64"||!r)return null;const o=atob(n.substring(s+1)),l=new Uint8Array(o.length);for(let c=0;c<o.length;c++)l[c]=o.charCodeAt(c);return new Blob([l],{type:r})}async function vj(n){if(!pf)return null;const e=hR(n);let t=sp.get(e);if(t)return t;let s=zR(n);return s||(s=await(await fetch(n)).blob()),t=URL.createObjectURL(s),sp.set(e,t),t}function wj(){ny&&ny.stop(),hj(),iy.forEach(n=>URL.revokeObjectURL(n)),iy.clear(),sp.forEach(n=>URL.revokeObjectURL(n)),sp.clear()}function Sj(n,e){return!!(n&&n.getPropertyPriority(e))}function qR(n,e,t,s,i,r){let o=null;if(n.startsWith("--"))o=Nj(s,n,e,t,i,r);else if(e.includes("var("))o=Ij(s,n,e);else if(n==="color-scheme")o=Lj();else if(n==="scrollbar-color")o=Dj(e);else if(n.includes("color")&&n!=="-webkit-print-color-adjust"||n==="fill"||n==="stroke"||n==="stop-color")if(n.startsWith("border")&&n!=="border-color"&&e==="initial"){const l=n.substring(0,n.length-6),c=t.style.getPropertyValue(l);c.startsWith("0px")||c==="none"?(n=l,o=c):o=e}else o=Tj(n,e,t);else n==="background-image"||n==="list-style-image"?o=jR(e,t,i,r):n.includes("shadow")&&(o=Mj(e));return o?{property:n,value:o,important:Sj(t.style,n),sourceValue:e}:null}function oC(...n){return n.filter(Boolean).join(", ")}const xj=["calendar.google.com"];function _j(n,e,t){const s=[];e||(s.push("html {"),s.push(`    background-color: ${In({r:255,g:255,b:255},n)} !important;`),s.push("}")),aR&&n.mode===1&&(s.push("html {"),s.push("    color-scheme: dark !important;"),s.push("}"),s.push("iframe {"),s.push("    color-scheme: dark !important;"),s.push("}"));const i=oC(e?"":"html, body",t?"input, textarea, select, button, dialog":"");return i&&(s.push(`${i} {`),s.push(`    background-color: ${In({r:255,g:255,b:255},n)};`),s.push("}")),s.push(`${oC("html, body",t?"input, textarea, select, button":"")} {`),s.push(`    border-color: ${Ka({r:76,g:76,b:76},n)};`),s.push(`    color: ${fs({r:0,g:0,b:0},n)};`),s.push("}"),s.push("a {"),s.push(`    color: ${fs({r:0,g:64,b:255},n)};`),s.push("}"),s.push("table {"),s.push(`    border-color: ${Ka({r:128,g:128,b:128},n)};`),s.push("}"),s.push("mark {"),s.push(`    color: ${fs({r:0,g:0,b:0},n)};`),s.push("}"),s.push("::placeholder {"),s.push(`    color: ${fs({r:169,g:169,b:169},n)};`),s.push("}"),s.push("input:-webkit-autofill,"),s.push("textarea:-webkit-autofill,"),s.push("select:-webkit-autofill {"),s.push(`    background-color: ${In({r:250,g:255,b:189},n)} !important;`),s.push(`    color: ${fs({r:0,g:0,b:0},n)} !important;`),s.push("}"),n.scrollbarColor&&!xj.includes(location.hostname)&&s.push(Cj(n)),n.selectionColor&&s.push(Ej(n)),lR&&(s.unshift("@layer {"),s.push("}")),s.join(`
`)}function KR(n){let e,t;if(n.selectionColor==="auto")e=In({r:0,g:96,b:212},{...n,grayscale:0}),t=fs({r:255,g:255,b:255},{...n,grayscale:0});else{const s=bn(n.selectionColor),i=hm(s);e=n.selectionColor,i.l<.5?t="#FFF":t="#000"}return{backgroundColorSelection:e,foregroundColorSelection:t}}function Ej(n){const e=[],t=KR(n),s=t.backgroundColorSelection,i=t.foregroundColorSelection;return["::selection","::-moz-selection"].forEach(r=>{e.push(`${r} {`),e.push(`    background-color: ${s} !important;`),e.push(`    color: ${i} !important;`),e.push("}")}),e.join(`
`)}function Cj(n){let e,t;if(n.scrollbarColor==="auto")e=In({r:241,g:241,b:241},n),t=In({r:176,g:176,b:176},n);else{const s=bn(n.scrollbarColor),i=hm(s);e=WE((o=>({...i,l:ul(i.l-o,0,1)}))(.4)),t=WE(i)}return["* {",`    scrollbar-color: ${t} ${e};`,"}"].join(`
`)}function gw(n,{strict:e}){return Aj(n,{strict:e})}function Aj(n,{strict:e}){const t=[];return t.push(`html, body, ${e?"body :not(iframe)":"body > :not(iframe)"} {`),t.push(`    background-color: ${In({r:255,g:255,b:255},n)} !important;`),t.push(`    border-color: ${Ka({r:64,g:64,b:64},n)} !important;`),t.push(`    color: ${fs({r:0,g:0,b:0},n)} !important;`),t.push("}"),t.push('div[style*="background-color: rgb(135, 135, 135)"] {'),t.push("    background-color: #878787 !important;"),t.push("}"),t.join(`
`)}const kj=new Set(["inherit","transparent","initial","currentcolor","none","unset","auto"]);function Tj(n,e,t){if(kj.has(e.toLowerCase())&&!(n==="color"&&e==="initial"))return e;let s=null;return n==="color"&&e==="initial"?s={r:0,g:0,b:0,a:1}:s=bn(e),s?n.includes("background")?t.style.webkitMaskImage&&t.style.webkitMaskImage!=="none"||t.style.webkitMask&&!t.style.webkitMask.startsWith("none")||t.style.mask&&t.style.mask!=="none"||t.style.getPropertyValue("mask-image")&&t.style.getPropertyValue("mask-image")!=="none"?i=>fs(s,i):i=>In(s,i):n.includes("border")||n.includes("outline")?i=>Ka(s,i):i=>fs(s,i):(Ct("Couldn't parse color",e),null)}const jc=new Map,mr=new Map;let lC=!1;function Oj(n,e){if(!n||e.length===0)return!1;if(e.some(s=>s==="*"))return!0;const t=n.split(/,\s*/g);for(let s=0;s<e.length;s++){const i=e[s];if(i.startsWith("^")){const r=i.slice(1);if(t.some(o=>o.startsWith(r)))return!0}else if(i.endsWith("$")){const r=i.slice(0,i.length-1);if(t.some(o=>o.endsWith(r)))return!0}else if(t.some(r=>r===i))return!0}return!1}const Sa=new Map,Rj=new Map,Ob=new Set;let Rb=null,fu=null;function ry(n){for(const[e,t]of Sa)(n.querySelector(e)||n instanceof Element&&n.matches(e))&&(Sa.delete(e),t.forEach(s=>s()));fu||(fu=new MutationObserver(e=>{e.forEach(t=>{Ob.add(t.target),Rb||(Rb=requestAnimationFrame(()=>{Ob.forEach(s=>{ry(s)}),Ob.clear(),Rb=null}))})}),fu.observe(document.documentElement,{attributes:!0,attributeFilter:["class"],subtree:!0}))}function jR(n,e,t,s){try{if(Oj(e.selectorText,t))return n;const i=jK(n),r=K0(DR,n);if(r.length===0&&i.length===0)return n;const o=y=>{let w=0;return y.map(x=>{const S=n.indexOf(x,w);return w=S+x.length,{match:x,index:S}})},l=i.map(y=>({type:"gradient",...y})).concat(o(r).map(y=>({type:"url",offset:0,...y}))).sort((y,w)=>y.index>w.index?1:-1),c=y=>{const{typeGradient:w,match:x,hasComma:S}=y,C=/([^\(\),]+(\([^\(\)]*(\([^\(\)]*\)*[^\(\)]*)?\))?([^\(\), ]|( (?!calc)))*),?/g,E=/^(from|color-stop|to)\(([^\(\)]*?,\s*)?(.*?)\)$/,k=K0(C,x,1).map(R=>{R=R.trim();let T=bn(R);if(T)return F=>Cb(T,F);const L=R.lastIndexOf(" ");if(T=bn(R.substring(0,L)),T)return F=>`${Cb(T,F)} ${R.substring(L+1)}`;const N=R.match(E);return N&&(T=bn(N[3]),T)?F=>`${N[1]}(${N[2]?`${N[2]}, `:""}${Cb(T,F)})`:()=>R});return R=>`${w}(${k.map(T=>T(R)).join(", ")})${S?", ":""}`},f=y=>{lC||(lC=!0,XK(jc));let w=cw(y);const x=w.length===0,{parentStyleSheet:S}=e,C=S?.ownerNode,E=(S&&MK(S))??document,k=S&&S.href?np(S.href):C?.baseURI||location.origin;return w=fm(k,w),async R=>{if(x)return"url('')";let T=e.selectorText;T&&(T.includes("::before")&&(T=T.replaceAll("::before","")),T.includes("::after")&&(T=T.replaceAll("::after","")),E.querySelector(T)||await new Promise(N=>{Sa.has(T)?Sa.get(T).push(N):(Sa.set(T,[N]),Rj.set(T,y))}));let L=null;if(jc.has(w))L=jc.get(w);else try{if(gj()||await mj(),mr.has(w)){const N=mr.get(w);if(L=await new Promise(F=>N.push(F)),!L)return null}else mr.set(w,[]),L=await HR(w),jc.set(w,L),w.startsWith("data:")||new URL(w).origin===location.origin&&YK(w,L),mr.get(w).forEach(N=>N(L)),mr.delete(w);if(s())return null}catch(N){Ct(N),mr.has(w)&&(mr.get(w).forEach(F=>F(null)),mr.delete(w))}if(L){const N=h(L,R);if(N)return N}if(w.startsWith("data:")){const N=await vj(w);if(N)return`url("${N}")`}return`url("${w}")`}},h=(y,w)=>{const{isDark:x,isLight:S,isTransparent:C,isLarge:E,width:k}=y;let R;const T=y.src.startsWith("data:")?"data:":y.src;return E&&S&&!C&&w.mode===1?(Sr(`Hiding large light image ${T}`),R="none"):x&&C&&w.mode===1&&k>2?(Sr(`Inverting dark image ${T}`),R=`url("${Tb(y,{...w,sepia:ul(w.sepia+10,0,100)})}")`):S&&!C&&w.mode===1?(Sr(`Dimming light image ${T}`),R=`url("${Tb(y,w)}")`):w.mode===0&&S?(Sr(`Applying filter to image ${T}`),R=`url("${Tb(y,{...w,brightness:ul(w.brightness-10,5,200),sepia:ul(w.sepia+10,0,100)})}")`):(Sr(`Not modifying the image ${T}`),R=null),R},d=[];let g=0,m=!1;return l.forEach(({type:y,match:w,index:x,typeGradient:S,hasComma:C,offset:E},k)=>{const R=x,T=g,L=R+w.length+E;g=L,T!==R&&(m?d.push(()=>{let N=n.substring(T,R);return N[0]===","&&(N=N.substring(1)),N}):d.push(()=>n.substring(T,R))),m=C||!1,y==="url"?d.push(f(w)):y==="gradient"&&d.push(c({match:w,index:x,typeGradient:S,hasComma:C||!1,offset:E})),k===l.length-1&&d.push(()=>n.substring(L))}),y=>{const w=d.filter(Boolean).map(S=>S(y));if(w.some(S=>S instanceof Promise))return Promise.all(w).then(S=>S.filter(Boolean).join(""));const x=w.join("");return x.endsWith(", initial")?x.slice(0,-9):x}}catch(i){return Ct(`Unable to parse gradient ${n}`,i),null}}function GR(n){try{let e=0;const t=K0(/(^|\s)(?!calc)([a-z]+\(.+?\)|#[0-9a-f]+|[a-z]+)(.*?(inset|outset)?($|,))/gi,n,2);let s=0;const i=t.map((r,o)=>{const l=e,c=n.indexOf(r,e),f=c+r.length;e=f;const h=bn(r);return h?d=>`${n.substring(l,c)}${UK(h,d)}${o===t.length-1?n.substring(f):""}`:(s++,()=>n.substring(l,f))});return r=>{const o=i.map(l=>l(r)).join("");return{matchesLength:t.length,unparsableMatchesLength:s,result:o}}}catch(e){return Ct(`Unable to parse shadow ${n}`,e),null}}function Mj(n){const e=GR(n);return e?t=>e(t).result:null}function Dj(n){const e=n.match(/^\s*([a-z]+(\(.*\))?)\s+([a-z]+(\(.*\))?)\s*$/);if(!e)return n;const t=bn(e[1]),s=bn(e[3]);return!t||!s?(Ct("Couldn't parse color",...[t,s].filter(i=>!i)),null):i=>`${fs(t,i)} ${In(s,i)}`}function Lj(){return n=>n.mode===0?"dark light":"dark"}function Nj(n,e,t,s,i,r){return n.getModifierForVariable({varName:e,sourceValue:t,rule:s,ignoredImgSelectors:i,isCancelled:r})}function Ij(n,e,t){return n.getModifierForVarDependant(e,t)}function Pj(){PK(),jc.clear(),wj(),mr.clear(),Sa.clear(),fu?.disconnect(),fu=null}const xs=1,Yl=2,Xl=4,Nc=8,$j=!location.hostname.startsWith("www.ebay.")&&!location.hostname.includes(".ebay.");class Bj{constructor(){this.varTypes=new Map,this.rulesQueue=new Set,this.inlineStyleQueue=[],this.definedVars=new Set,this.varRefs=new Map,this.unknownColorVars=new Set,this.unknownBgVars=new Set,this.undefinedVars=new Set,this.initialVarTypes=new Map,this.changedTypeVars=new Set,this.typeChangeSubscriptions=new Map,this.unstableVarValues=new Map}clear(){this.varTypes.clear(),this.rulesQueue.clear(),this.inlineStyleQueue.splice(0),this.definedVars.clear(),this.varRefs.clear(),this.unknownColorVars.clear(),this.unknownBgVars.clear(),this.undefinedVars.clear(),this.initialVarTypes.clear(),this.changedTypeVars.clear(),this.typeChangeSubscriptions.clear(),this.unstableVarValues.clear()}isVarType(e,t){return this.varTypes.has(e)&&(this.varTypes.get(e)&t)>0}addRulesForMatching(e){this.rulesQueue.add(e)}addInlineStyleForMatching(e){this.inlineStyleQueue.push(e)}matchVariablesAndDependents(){this.rulesQueue.size===0&&this.inlineStyleQueue.length===0||(this.changedTypeVars.clear(),this.initialVarTypes=new Map(this.varTypes),this.collectRootVariables(),this.collectVariablesAndVarDep(),this.collectRootVarDependents(),this.varRefs.forEach((e,t)=>{e.forEach(s=>{this.varTypes.has(t)&&this.resolveVariableType(s,this.varTypes.get(t))})}),this.unknownColorVars.forEach(e=>{this.unknownBgVars.has(e)?(this.unknownColorVars.delete(e),this.unknownBgVars.delete(e),this.resolveVariableType(e,xs)):this.isVarType(e,xs|Yl|Xl)?this.unknownColorVars.delete(e):this.undefinedVars.add(e)}),this.unknownBgVars.forEach(e=>{this.findVarRef(e,s=>this.unknownColorVars.has(s)||this.isVarType(s,xs|Yl|Xl))!=null?this.iterateVarRefs(e,s=>{this.resolveVariableType(s,xs)}):this.isVarType(e,xs|Nc)?this.unknownBgVars.delete(e):this.undefinedVars.add(e)}),this.changedTypeVars.forEach(e=>{this.typeChangeSubscriptions.has(e)&&this.typeChangeSubscriptions.get(e).forEach(t=>{t()})}),this.changedTypeVars.clear())}getModifierForVariable(e){return t=>{const{varName:s,sourceValue:i,rule:r,ignoredImgSelectors:o,isCancelled:l}=e,c=()=>{const g=[],m=(y,w,x)=>{if(!this.isVarType(s,y))return;const S=w(s);let C;if(Xo(i))if(cC(i)){let E=oy(i,this.unstableVarValues);E||(E=y===xs?"#ffffff":"#000000"),C=x(E,t)}else C=oo(i,E=>w(E),E=>x(E,t));else C=x(i,t);g.push({property:S,value:C})};if(m(xs,Ic,jo),m(Yl,Mb,Pc),m(Xl,Db,Rh),this.isVarType(s,Nc)){const y=aC(s);let w=i;Xo(i)&&(w=oo(i,S=>Ic(S),S=>jo(S,t)));const x=jR(w,r,o,l);w=typeof x=="function"?x(t):x,g.push({property:y,value:w})}return g},f=new Set,h=g=>{const m=()=>{const y=c();g(y)};f.add(m),this.subscribeForVarTypeChange(s,m)},d=()=>{f.forEach(g=>{this.unsubscribeFromVariableTypeChanges(s,g)})};return{declarations:c(),onTypeChange:{addListener:h,removeListeners:d}}}}getModifierForVarDependant(e,t){const s=t.match(/^\s*(rgb|hsl)a?\(/),i=t.match(/^rgba?\(var\(--[\-_A-Za-z0-9]+\)(\s*,?\/?\s*0?\.\d+)?\)$/);if(s&&!i){const r=e.startsWith("background"),o=Lb(e);return l=>{let c=oy(t,this.unstableVarValues);return c||(c=r?"#ffffff":"#000000"),(r?jo:o?Pc:Rh)(c,l)}}return e==="background-color"||i&&e==="background"?r=>{const o=$j?jo(s?"255, 255, 255":"#ffffff",r):"transparent";return oo(t,l=>Ic(l),l=>jo(l,r),o)}:Lb(e)?r=>{const o=Pc(s?"0, 0, 0":"#000000",r);return oo(t,l=>Mb(l),l=>Pc(l,r),o)}:e==="background"||e==="background-image"||e==="box-shadow"?r=>{const o=new Set,l=()=>{const f=oo(t,h=>this.isVarType(h,xs)?Ic(h):this.isVarType(h,Nc)?aC(h):(o.add(h),h),h=>jo(h,r));if(e==="box-shadow"){const d=GR(f)(r);if(d.unparsableMatchesLength!==d.matchesLength)return d.result}return f},c=l();return o.size>0?Hj(c)?c:new Promise(f=>{for(const h of o.values()){const d=()=>{this.unsubscribeFromVariableTypeChanges(h,d);const g=l();f(g)};this.subscribeForVarTypeChange(h,d)}}):c}:e.startsWith("border")||e.startsWith("outline")?r=>oo(t,o=>Db(o),o=>Rh(o,r)):null}subscribeForVarTypeChange(e,t){this.typeChangeSubscriptions.has(e)||this.typeChangeSubscriptions.set(e,new Set);const s=this.typeChangeSubscriptions.get(e);s.has(t)||s.add(t)}unsubscribeFromVariableTypeChanges(e,t){this.typeChangeSubscriptions.has(e)&&this.typeChangeSubscriptions.get(e).delete(t)}collectVariablesAndVarDep(){this.rulesQueue.forEach(e=>{fo(e,t=>{t.style&&this.collectVarsFromCSSDeclarations(t.style)})}),this.inlineStyleQueue.forEach(e=>{this.collectVarsFromCSSDeclarations(e)}),this.rulesQueue.clear(),this.inlineStyleQueue.splice(0)}collectVarsFromCSSDeclarations(e){ca(e,(t,s)=>{Oh(t)&&this.inspectVariable(t,s),Xo(s)&&this.inspectVarDependant(t,s)})}shouldProcessRootVariables(){return this.rulesQueue.size>0&&document.documentElement.getAttribute("style")?.includes("--")}collectRootVariables(){this.shouldProcessRootVariables()&&ca(document.documentElement.style,(e,t)=>{Oh(e)&&this.inspectVariable(e,t)})}inspectVariable(e,t){if(this.unstableVarValues.set(e,t),Xo(t)&&cC(t)&&(this.unknownColorVars.add(e),this.definedVars.add(e)),this.definedVars.has(e))return;this.definedVars.add(e),!!(t.match(QR)||t.match(JR)||bn(t))?this.unknownColorVars.add(e):(t.includes("url(")||t.includes("linear-gradient(")||t.includes("radial-gradient("))&&this.resolveVariableType(e,Nc)}resolveVariableType(e,t){const s=this.initialVarTypes.get(e)||0,r=(this.varTypes.get(e)||0)|t;this.varTypes.set(e,r),(r!==s||this.undefinedVars.has(e))&&(this.changedTypeVars.add(e),this.undefinedVars.delete(e)),this.unknownColorVars.delete(e),this.unknownBgVars.delete(e)}collectRootVarDependents(){this.shouldProcessRootVariables()&&ca(document.documentElement.style,(e,t)=>{Xo(t)&&this.inspectVarDependant(e,t)})}inspectVarDependant(e,t){Oh(e)?this.iterateVarDeps(t,s=>{this.varRefs.has(e)||this.varRefs.set(e,new Set),this.varRefs.get(e).add(s)}):e==="background-color"||e==="box-shadow"?this.iterateVarDeps(t,s=>this.resolveVariableType(s,xs)):Lb(e)?this.iterateVarDeps(t,s=>this.resolveVariableType(s,Yl)):e.startsWith("border")||e.startsWith("outline")?this.iterateVarDeps(t,s=>this.resolveVariableType(s,Xl)):(e==="background"||e==="background-image")&&this.iterateVarDeps(t,s=>{if(this.isVarType(s,xs|Nc))return;const i=this.findVarRef(s,r=>this.unknownColorVars.has(r)||this.isVarType(r,xs|Yl|Xl))!=null;this.iterateVarRefs(s,r=>{i?this.resolveVariableType(r,xs):this.unknownBgVars.add(r)})})}iterateVarDeps(e,t){const s=new Set;Wj(e,i=>s.add(i)),s.forEach(i=>t(i))}findVarRef(e,t,s=new Set){if(s.has(e))return null;if(s.add(e),t(e))return e;const r=this.varRefs.get(e);if(!r||r.size===0)return null;for(const o of r){const l=this.findVarRef(o,t,s);if(l)return l}return null}iterateVarRefs(e,t){this.findVarRef(e,s=>(t(s),!1))}setOnRootVariableChange(e){this.onRootVariableDefined=e}putRootVars(e,t){const s=e.sheet;s.cssRules.length>0&&s.deleteRule(0);const i=new Map;ca(document.documentElement.style,(l,c)=>{Oh(l)&&(this.isVarType(l,xs)&&i.set(Ic(l),jo(c,t)),this.isVarType(l,Yl)&&i.set(Mb(l),Pc(c,t)),this.isVarType(l,Xl)&&i.set(Db(l),Rh(c,t)),this.subscribeForVarTypeChange(l,this.onRootVariableDefined))});const r=[];r.push(":root {");for(const[l,c]of i)r.push(`    ${l}: ${c};`);r.push("}");const o=r.join(`
`);s.insertRule(o)}}const qt=new Bj;function Fj(n,e=0){const t=n.indexOf("var(",e);if(t>=0){const s=nw(n,t+3);if(s)return{start:t,end:s.end}}return null}function Vj(n){const e=[];let t=0,s;for(;s=Fj(n,t);){const{start:i,end:r}=s;e.push({start:i,end:r,value:n.substring(i,r)}),t=s.end+1}return e}function YR(n,e){const t=Vj(n),s=t.length;if(s===0)return n;const i=n.length,r=t.map(l=>e(l.value,t.length)),o=[];o.push(n.substring(0,t[0].start));for(let l=0;l<s;l++){o.push(r[l]);const c=t[l].end,f=l<s-1?t[l+1].start:i;o.push(n.substring(c,f))}return o.join("")}function XR(n){const e=n.indexOf(",");let t,s;return e>=0?(t=n.substring(4,e).trim(),s=n.substring(e+1,n.length-1).trim()):(t=n.substring(4,n.length-1).trim(),s=""),{name:t,fallback:s}}function oo(n,e,t,s){return YR(n,r=>{const{name:o,fallback:l}=XR(r),c=e(o);if(!l)return s?`var(${c}, ${s})`:`var(${c})`;let f;return Xo(l)?f=oo(l,e,t):t?f=t(l):f=l,`var(${c}, ${f})`})}function Wj(n,e){oo(n,t=>(e(t),t))}function Ic(n){return`--darkreader-bg${n}`}function Mb(n){return`--darkreader-text${n}`}function Db(n){return`--darkreader-border${n}`}function aC(n){return`--darkreader-bgimg${n}`}function Oh(n){return n.startsWith("--")}function Xo(n){return n.includes("var(")}function cC(n){return n.match(/^\s*(rgb|hsl)a?\(/)||n.match(/^(((\d{1,3})|(var\([\-_A-Za-z0-9]+\))),?\s*?){3}$/)}function Hj(n){if(n.startsWith("var(")&&n.endsWith(")")){const e=n.endsWith("))"),t=n.endsWith(")))"),s=e?n.lastIndexOf("("):-1,i=t?n.lastIndexOf("(",s-1):s,r=n.lastIndexOf(",",e?i:n.length);if(r<0||n[r+1]!==" ")return!1;const o=n.slice(r+2,n.length-1);return e?o.startsWith("rgb(")||o.startsWith("rgba(")||o.startsWith("hsl(")||o.startsWith("hsla(")||o.startsWith("var(--darkreader-bg--")||o.startsWith("var(--darkreader-background-")||t&&o.includes("var(--darkreader-background-"):o.match(/^(#[0-9a-f]+)|([a-z]+)$/i)}return!1}const Uj=["color","caret-color","-webkit-text-fill-color","fill","stroke"];function Lb(n){return Uj.includes(n)}const QR=/^(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s*(\/\s*\d+\.?\d*)?$/,JR=/^(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})$/;function zj(n){const e=n.match(QR)??n.match(JR);return e?{isRaw:!0,color:e[4]?`rgb(${e[1]} ${e[2]} ${e[3]} / ${e[4]})`:`rgb(${e[1]}, ${e[2]}, ${e[3]})`}:{isRaw:!1,color:n}}function bw(n,e,t){const{isRaw:s,color:i}=zj(n),r=bn(i);if(r){const o=t(r,e,!s);if(s){const l=bn(o);return l?`${l.r}, ${l.g}, ${l.b}`:o}return o}return i}function jo(n,e){return bw(n,e,In)}function Pc(n,e){return bw(n,e,fs)}function Rh(n,e){return bw(n,e,Ka)}function oy(n,e,t=new Set){let s=!1;const r=YR(n,(o,l)=>{const{name:c,fallback:f}=XR(o),h=l>1?new Set(t):t;if(h.has(c))return s=!0,null;h.add(c);const d=e.get(c)||f;let g=null;return d&&(Xo(d)?g=oy(d,e,h):g=d),g||(s=!0,null)});return s?null:r}function qj(n){let e="";return PR.forEach(t=>{e+=`${t}:${n[t]};`}),e}const Kj=pK();function yw(){let n=0;function e(h){let d=h.cssText;return G0(h.parentRule)&&(d=`${h.parentRule.media.mediaText} { ${d} }`),Y0(h.parentRule)&&(d=`${h.parentRule.name} { ${d} }`),hR(d)}const t=new Set,s=new Map,i=new Set;let r=null,o=!1,l=!1;function c(){return o&&!l}function f(h){const d=h.sourceCSSRules,{theme:g,ignoreImageAnalysis:m,force:y,prepareSheet:w,isAsyncCancelled:x}=h;let S=s.size===0;const C=new Set(s.keys()),E=qj(g),k=E!==r;o&&(l=!0);const R=[];if(fo(d,H=>{const ge=e(H);let Z=!1;if(C.delete(ge),t.has(ge)||(t.add(ge),Z=!0),Z)S=!0;else{R.push(s.get(ge));return}if(H.style.all==="revert")return;const X=[];H.style&&ca(H.style,(we,ae)=>{const be=qR(we,ae,H,qt,m,x);be&&X.push(be)});let fe=null;if(X.length>0){const we=H.parentRule;fe={selector:H.selectorText,declarations:X,parentRule:we},R.push(fe)}s.set(ge,fe)},()=>{o=!0}),C.forEach(H=>{t.delete(H),s.delete(H)}),r=E,!y&&!S&&!k)return;n++;function T(H,ge,Z){const{selector:X,declarations:fe}=Z;let we=X;const ae=H0&&X.startsWith(":is(")&&(X.includes(":is()")||X.includes(":where()")||X.includes(":where(")&&X.includes(":-moz")),be=X.includes("::view-transition-");(ae||be)&&(we=".darkreader-unsupported-selector"),H0&&we.endsWith("::picker")&&(we=we.replaceAll("::picker","::picker(select)"));let Ne=`${we} {`;for(const B of fe){const{property:se,value:he,important:Te}=B;he&&(Ne+=` ${se}: ${he}${Te?" !important":""};`)}Ne+=" }",H.insertRule(Ne,ge)}const L=new Map,N=new Map;let F=0,ee=0;const ce={rule:null,rules:[],isGroup:!0},ne=new WeakMap;function pe(H){if(H==null)return ce;if(ne.has(H))return ne.get(H);const ge={rule:H,rules:[],isGroup:!0};return ne.set(H,ge),pe(H.parentRule).rules.push(ge),ge}i.forEach(H=>H()),i.clear(),R.filter(H=>H).forEach(({selector:H,declarations:ge,parentRule:Z})=>{const X=pe(Z),fe={selector:H,declarations:[],isGroup:!1},we=fe.declarations;X.rules.push(fe);function ae(Ne,B,se,he){const Te=++F,Ke={property:Ne,value:null,important:se,asyncKey:Te,sourceValue:he};we.push(Ke);const M=n;B.then(I=>{!I||x()||M!==n||(Ke.value=I,Kj.add(()=>{x()||M!==n||J(Te)}))})}function be(Ne,B,se,he){const{declarations:Te,onTypeChange:Ke}=B,M=++ee,I=n,V=we.length;let G=[];if(Te.length===0){const te={property:Ne,value:he,important:se,sourceValue:he,varKey:M};we.push(te),G=[te]}Te.forEach(te=>{if(te.value instanceof Promise)ae(te.property,te.value,se,he);else{const K={property:te.property,value:te.value,important:se,sourceValue:he,varKey:M};we.push(K),G.push(K)}}),Ke.addListener(te=>{if(x()||I!==n)return;const K=te.map(xe=>({property:xe.property,value:xe.value,important:se,sourceValue:he,varKey:M})),_e=we.indexOf(G[0],V);we.splice(_e,G.length,...K),G=K,Se(M)}),i.add(()=>Ke.removeListeners())}ge.forEach(({property:Ne,value:B,important:se,sourceValue:he})=>{if(typeof B=="function"){const Te=B(g);Te instanceof Promise?ae(Ne,Te,se,he):Ne.startsWith("--")?be(Ne,Te,se,he):we.push({property:Ne,value:Te,important:se,sourceValue:he})}else we.push({property:Ne,value:B,important:se,sourceValue:he})})});const Y=w();function q(){function H(Z,X){const{rule:fe}=Z;if(uw(fe)){const{selectorText:we}=fe,ae=X.cssRules.length;return X.insertRule(`${we} {}`,ae),X.cssRules[ae]}if(G0(fe)){const{media:we}=fe,ae=X.cssRules.length;return X.insertRule(`@media ${we.mediaText} {}`,ae),X.cssRules[ae]}if(Y0(fe)){const{name:we}=fe,ae=X.cssRules.length;return X.insertRule(`@layer ${we} {}`,ae),X.cssRules[ae]}return X}function ge(Z,X,fe){Z.rules.forEach(we=>{if(we.isGroup){const ae=H(we,X);ge(we,ae,fe)}else fe(we,X)})}ge(ce,Y,(Z,X)=>{const fe=X.cssRules.length;Z.declarations.forEach(({asyncKey:we,varKey:ae})=>{we!=null&&L.set(we,{rule:Z,target:X,index:fe}),ae!=null&&N.set(ae,{rule:Z,target:X,index:fe})}),T(X,fe,Z)})}function J(H){const{rule:ge,target:Z,index:X}=L.get(H);Z.deleteRule(X),T(Z,X,ge),L.delete(H)}function Se(H){const{rule:ge,target:Z,index:X}=N.get(H);Z.deleteRule(X),T(Z,X,ge)}q()}return{modifySheet:f,shouldRebuildStyle:c}}let gd=!1;document.addEventListener("__darkreader__inlineScriptsAllowed",()=>gd=!0,{once:!0});const $c=new WeakSet,Nb=new WeakMap;function jj(n){return Array.isArray(n.adoptedStyleSheets)}function Gj(n){let e=!1;function t(E){n.adoptedStyleSheets.forEach(k=>{$c.has(k)||E(k),NR(k,n)})}function s(E,k){const R=[...n.adoptedStyleSheets],T=R.indexOf(E),L=R.indexOf(k);L>=0&&R.splice(L,1),R.splice(T+1,0,k),n.adoptedStyleSheets=R}function i(){const E=[...n.adoptedStyleSheets];for(let k=E.length-1;k>=0;k--){const R=E[k];$c.has(R)&&E.splice(k,1)}n.adoptedStyleSheets.length!==E.length&&(n.adoptedStyleSheets=E),f=new WeakSet,h=new WeakSet}const r=[];function o(){r.forEach(E=>E()),r.splice(0),e=!0,i(),w&&(cancelAnimationFrame(w),w=null)}let l=0;function c(){let E=0;if(t(k=>{E+=k.cssRules.length}),E===1){const k=n.adoptedStyleSheets[0].cssRules[0];return k instanceof CSSStyleRule?k.style.length:E}return E}let f=new WeakSet,h=new WeakSet;function d(E,k){i();for(let R=n.adoptedStyleSheets.length-1;R>=0;R--){const T=n.adoptedStyleSheets[R];if($c.has(T))continue;f.add(T);const L=Nb.get(T);if(L){l=c(),s(T,L);continue}const N=T.cssRules,F=new CSSStyleSheet;Nb.set(T,F),fo(N,ne=>h.add(ne.style));const ee=()=>{for(let ne=F.cssRules.length-1;ne>=0;ne--)F.deleteRule(ne);return F.insertRule("#__darkreader__adoptedOverride {}"),s(T,F),$c.add(F),F};yw().modifySheet({prepareSheet:ee,sourceCSSRules:N,theme:E,ignoreImageAnalysis:k,force:!1,isAsyncCancelled:()=>e})}l=c()}let g=!1;function m(E){g||(g=!0,queueMicrotask(()=>{g=!1;const k=n.adoptedStyleSheets.filter(R=>!$c.has(R));k.forEach(R=>Nb.delete(R)),E(k)}))}function y(){return c()!==l}let w=null;function x(E){w=requestAnimationFrame(()=>{gd||(y()&&m(E),x(E))})}function S(E,k){n.addEventListener(E,k),r.push(()=>n.removeEventListener(E,k))}function C(E){const k=()=>{gd=!0,m(E)};S("__darkreader__adoptedStyleSheetsChange",k),S("__darkreader__adoptedStyleSheetChange",k),S("__darkreader__adoptedStyleDeclarationChange",k),!gd&&x(E)}return{render:d,destroy:o,watch:C}}class vw{constructor(){this.cssRules=[],this.commands=[]}insertRule(e,t=0){return this.commands.push({type:"insert",index:t,cssText:e}),this.cssRules.splice(t,0,new vw),t}deleteRule(e){this.commands.push({type:"delete",index:e}),this.cssRules.splice(e,1)}replaceSync(e){if(this.commands.splice(0),this.commands.push({type:"replace",cssText:e}),e==="")this.cssRules.splice(0);else throw new Error("StyleSheetCommandBuilder.replaceSync() is not fully supported")}getDeepCSSCommands(){const e=[];return this.commands.forEach(t=>{e.push({type:t.type,cssText:t.type!=="delete"?t.cssText:"",path:t.type==="replace"?[]:[t.index]})}),this.cssRules.forEach((t,s)=>{t.getDeepCSSCommands().forEach(r=>r.path.unshift(s))}),e}clearDeepCSSCommands(){this.commands.splice(0),this.cssRules.forEach(e=>e.clearDeepCSSCommands())}}function Yj(){let n=!1;const e=new vw;function t(r){const o=()=>(e.replaceSync(""),e);yw().modifySheet({prepareSheet:o,sourceCSSRules:r.cssRules,theme:r.theme,ignoreImageAnalysis:r.ignoreImageAnalysis,force:!1,isAsyncCancelled:()=>n})}function s(){const r=e.getDeepCSSCommands();return e.clearDeepCSSCommands(),r}function i(){n=!0}return{render:t,destroy:i,commands:s}}const Xj=["gogoprivate.com","gprivate.com","www.berlingske.dk","www.bloomberg.com","www.diffusioneshop.com","www.weekendavisen.dk","zhale.me"],Qj=Xj.includes(location.hostname)?"away":"next";function ZR(){return Qj}const Ib=new Set;let Gc;function ww(n){if(!document.body){Ib.add(n),Gc||(Gc=new MutationObserver(()=>{document.body&&(Gc.disconnect(),Gc=null,Ib.forEach(t=>ww(t)),Ib.clear())}));return}let e=document.body.querySelector(".darkreader-style-container");e||(e=document.createElement("div"),e.classList.add("darkreader"),e.classList.add("darkreader-style-container"),e.style.display="none",document.body.append(e),ly=new MutationObserver(()=>{e?.nextElementSibling!=null&&(e.querySelectorAll(".darkreader--sync").forEach(t=>{if(t.sheet.cssRules.length>0){let s="";for(const i of t.sheet.cssRules)s+=i.cssText;t.textContent=s}}),document.body.append(e))}),ly.observe(document.body,{childList:!0})),e.append(n)}let ly;function Jj(){Gc?.disconnect(),ly?.disconnect(),document.querySelector(".darkreader-style-container")?.remove()}const ra={"background-color":{customProp:"--darkreader-inline-bgcolor",cssProp:"background-color",dataAttr:"data-darkreader-inline-bgcolor"},"background-image":{customProp:"--darkreader-inline-bgimage",cssProp:"background-image",dataAttr:"data-darkreader-inline-bgimage"},"border-color":{customProp:"--darkreader-inline-border",cssProp:"border-color",dataAttr:"data-darkreader-inline-border"},"border-bottom-color":{customProp:"--darkreader-inline-border-bottom",cssProp:"border-bottom-color",dataAttr:"data-darkreader-inline-border-bottom"},"border-left-color":{customProp:"--darkreader-inline-border-left",cssProp:"border-left-color",dataAttr:"data-darkreader-inline-border-left"},"border-right-color":{customProp:"--darkreader-inline-border-right",cssProp:"border-right-color",dataAttr:"data-darkreader-inline-border-right"},"border-top-color":{customProp:"--darkreader-inline-border-top",cssProp:"border-top-color",dataAttr:"data-darkreader-inline-border-top"},"box-shadow":{customProp:"--darkreader-inline-boxshadow",cssProp:"box-shadow",dataAttr:"data-darkreader-inline-boxshadow"},color:{customProp:"--darkreader-inline-color",cssProp:"color",dataAttr:"data-darkreader-inline-color"},fill:{customProp:"--darkreader-inline-fill",cssProp:"fill",dataAttr:"data-darkreader-inline-fill"},stroke:{customProp:"--darkreader-inline-stroke",cssProp:"stroke",dataAttr:"data-darkreader-inline-stroke"},"outline-color":{customProp:"--darkreader-inline-outline",cssProp:"outline-color",dataAttr:"data-darkreader-inline-outline"},"stop-color":{customProp:"--darkreader-inline-stopcolor",cssProp:"stop-color",dataAttr:"data-darkreader-inline-stopcolor"}},ay={background:{customProp:"--darkreader-inline-bg",cssProp:"background",dataAttr:"data-darkreader-inline-bg"},border:{customProp:"--darkreader-inline-border-short",cssProp:"border",dataAttr:"data-darkreader-inline-border-short"},"border-bottom":{customProp:"--darkreader-inline-border-bottom-short",cssProp:"border-bottom",dataAttr:"data-darkreader-inline-border-bottom-short"},"border-left":{customProp:"--darkreader-inline-border-left-short",cssProp:"border-left",dataAttr:"data-darkreader-inline-border-left-short"},"border-right":{customProp:"--darkreader-inline-border-right-short",cssProp:"border-right",dataAttr:"data-darkreader-inline-border-right-short"},"border-top":{customProp:"--darkreader-inline-border-top-short",cssProp:"border-top",dataAttr:"data-darkreader-inline-border-top-short"}},Sw=Object.values(ra),cy={};Sw.forEach(({cssProp:n,customProp:e})=>cy[e]=n);const ip=["style","fill","stop-color","stroke","bgcolor","color","background"],Nu=ip.map(n=>`[${n}]`).join(", ");function e2(){return Sw.concat(Object.values(ay)).map(({dataAttr:e,customProp:t,cssProp:s})=>[`[${e}] {`,`  ${s}: var(${t}) !important;`,"}"].join(`
`)).concat(["[data-darkreader-inline-invert] {","    filter: invert(100%) hue-rotate(180deg);","}"]).join(`
`)}function Zj(n){const e=[];return n instanceof Element&&n.matches(Nu)&&e.push(n),(n instanceof Element||oR&&n instanceof ShadowRoot||n instanceof Document)&&sw(e,n.querySelectorAll(Nu)),e}const hu=new Map,rp=new Map;function e7(n,e){uy(document,n,e),lc(document.documentElement,t=>{uy(t.shadowRoot,n,e)})}function uy(n,e,t){hu.has(n)&&(hu.get(n).disconnect(),rp.get(n).disconnect());const s=new WeakSet;function i(w){Zj(w).forEach(x=>{s.has(x)||(s.add(x),e(x))}),lc(w,x=>{s.has(w)||(s.add(w),t(x.shadowRoot),uy(x.shadowRoot,e,t))}),qt.matchVariablesAndDependents()}const r=OR(n,{onMinorMutations:(w,{additions:x})=>{x.forEach(S=>i(S))},onHugeMutations:()=>{i(n)}});hu.set(n,r);let o=0,l=null;const c=Zd({seconds:10}),f=Zd({seconds:2}),h=50;let d=[],g=null;const m=rw(w=>{const x=new Set;w.forEach(S=>{const C=S.target;x.has(C)||ip.includes(S.attributeName)&&(x.add(C),e(C))}),qt.matchVariablesAndDependents()}),y=new MutationObserver(w=>{if(g){d.push(...w);return}o++;const x=Date.now();if(l==null)l=x;else if(o>=h){if(x-l<c){g=setTimeout(()=>{l=null,o=0,g=null;const S=d;d=[],m(S)},f),d.push(...w);return}l=x,o=1}m(w)});y.observe(n,{attributes:!0,attributeFilter:ip.concat(Sw.map(({dataAttr:w})=>w)),subtree:!0}),rp.set(n,y)}function t7(){hu.forEach(n=>n.disconnect()),rp.forEach(n=>n.disconnect()),hu.clear(),rp.clear()}const Pb=new WeakMap,uC=new WeakSet,$b=new WeakMap,n7=["brightness","contrast","grayscale","sepia","mode"];function s7(n){if($b.has(n))return $b.get(n);const e=!!(n&&(n.getAttribute("class")?.includes("logo")||n.parentElement?.getAttribute("class")?.includes("logo")));return $b.set(n,e),e}function Bb(n,e){return ip.map(t=>`${t}="${n.getAttribute(t)}"`).concat(n7.map(t=>`${t}="${e[t]}"`)).join(" ")}function i7(n,e){for(let t=0,s=e.length;t<s;t++){const i=e[t];if(n.matches(i))return!0}return!1}const r7=1e3,o7=10,Fb=new WeakMap,Vb=new WeakMap,Wb=32,Hb=new WeakMap,Ub=new WeakMap;function t2(n){if(!n)return null;if(Hb.has(n))return Hb.get(n);if(n instanceof SVGSVGElement)return n;const e=n.parentNode,t=t2(e);return Hb.set(n,t),t}function fy(n,e,t,s){if(Fb.has(n)){if(Date.now()-Fb.get(n)<r7){const f=Vb.get(n)??0;Vb.set(n,f+1)}if((Vb.get(n)??0)>=o7)return}if(n.parentElement?.dataset.nodeViewContent||Bb(n,e)===Pb.get(n))return;const r=new Set(Object.keys(ra));function o(f,h,d){const g=qR(h,d,{style:n.style},qt,s,null);if(!g)return;function m(S){const{customProp:C,dataAttr:E}=ra[f]??ay[f];n.style.setProperty(C,S),n.hasAttribute(E)||n.setAttribute(E,""),r.delete(f)}function y(S){let C=[];function E(k){C.forEach(({property:R})=>{n.style.removeProperty(R)}),k.forEach(({property:R,value:T})=>{T instanceof Promise||n.style.setProperty(R,T)}),C=k}E(S.declarations),S.onTypeChange.addListener(E)}function w(S,C){S.then(E=>{E&&f==="background"&&E.startsWith("var(--darkreader-bg--")&&m(E),E&&f==="background-image"&&((n===document.documentElement||n===document.body)&&E===C&&(E="none"),m(E)),Pb.set(n,Bb(n,e))})}const x=typeof g.value=="function"?g.value(e):g.value;typeof x=="string"?m(x):x instanceof Promise?w(x,d):typeof x=="object"&&y(x)}if(t.length>0&&i7(n,t)){r.forEach(f=>{n.removeAttribute(ra[f].dataAttr)});return}const l=n instanceof SVGElement,c=l?n.ownerSVGElement??(n instanceof SVGSVGElement?n:null):null;if(l&&e.mode===1&&c){if(uC.has(c))return;if(s7(c)){uC.add(c);const f=()=>{let h=c.outerHTML;h=h.replaceAll('<style class="darkreader darkreader--sync" media="screen"></style>',"");const d=`data:image/svg+xml;base64,${btoa(h)}`;HR(d).then(g=>{g.isDark&&g.isTransparent||g.isLarge&&g.isLight&&!g.isTransparent?c.setAttribute("data-darkreader-inline-invert",""):c.removeAttribute("data-darkreader-inline-invert")})};f(),Co()||lw(f);return}}if(n.hasAttribute("bgcolor")){let f=n.getAttribute("bgcolor");(f.match(/^[0-9a-f]{3}$/i)||f.match(/^[0-9a-f]{6}$/i))&&(f=`#${f}`),o("background-color","background-color",f)}if((n===document.documentElement||n===document.body)&&n.hasAttribute("background")){const h=`url("${fm(location.href,n.getAttribute("background")??"")}")`;o("background-image","background-image",h)}if(n.hasAttribute("color")&&n.rel!=="mask-icon"){let f=n.getAttribute("color");(f.match(/^[0-9a-f]{3}$/i)||f.match(/^[0-9a-f]{6}$/i))&&(f=`#${f}`),o("color","color",f)}if(l){if(n.hasAttribute("fill")){const f=n.getAttribute("fill");if(f!=="none")if(n instanceof SVGTextElement)o("fill","color",f);else{const h=()=>{let d=!1;const g=t2(n);if(!g)return;if(Ub.has(g))d=Ub.get(g);else{const y=g.getBoundingClientRect();d=y.width*y.height<=Math.pow(Wb,2),Ub.set(g,d)}let m;if(d)m=!1;else{const{width:y,height:w}=n.getBoundingClientRect();m=y>Wb||w>Wb}o("fill",m?"background-color":"color",f)};dm()?h():aw(h)}}n.hasAttribute("stop-color")&&o("stop-color","background-color",n.getAttribute("stop-color"))}if(n.hasAttribute("stroke")){const f=n.getAttribute("stroke");o("stroke",n instanceof SVGLineElement||n instanceof SVGTextElement?"border-color":"color",f)}n.style&&ca(n.style,(f,h)=>{if(f==="background-image"&&h.includes("url")){(n===document.documentElement||n===document.body)&&o(f,f,h);return}if(ra.hasOwnProperty(f)||f.startsWith("--")&&!cy[f])o(f,f,h);else if(ay[f]&&h.includes("var("))o(f,f,h);else{const d=cy[f];if(d&&!n.style.getPropertyValue(d)&&!n.hasAttribute(d)){if(d==="background-color"&&n.hasAttribute("bgcolor"))return;n.style.setProperty(f,"")}}}),n.style&&n instanceof SVGTextElement&&n.style.fill&&o("fill","color",n.style.getPropertyValue("fill")),n.getAttribute("style")?.includes("--")&&qt.addInlineStyleForMatching(n.style),ii(r,f=>{n.removeAttribute(ra[f].dataAttr)}),Pb.set(n,Bb(n,e)),Fb.set(n,Date.now())}const n2="theme-color",s2=`meta[name="${n2}"]`;let du=null,br=null;function fC(n,e){du=du||n.content;const t=bn(du);if(!t){Ct("Invalid meta color",t);return}n.content=In(t,e,!1)}function l7(n){const e=document.querySelector(s2);e?fC(e,n):(br&&br.disconnect(),br=new MutationObserver(t=>{e:for(let s=0;s<t.length;s++){const{addedNodes:i}=t[s];for(let r=0;r<i.length;r++){const o=i[r];if(o instanceof HTMLMetaElement&&o.name===n2){br.disconnect(),br=null,fC(o,n);break e}}}}),br.observe(document.head,{childList:!0}))}function a7(){br&&(br.disconnect(),br=null);const n=document.querySelector(s2);n&&du&&(n.content=du)}const c7=/\/\*[\s\S]*?\*\//g;function i2(n){return n.replace(c7,"")}let op=!1;document.addEventListener("__darkreader__inlineScriptsAllowed",()=>op=!0,{once:!0});function u7(n,e,t,s){let i=null;function r(){c(),op&&n.sheet||(i=f7(n,e,t,s),i.start())}let o=!1;function l(){if(op=!0,i?.stop(),o)return;function d(){o=!1,!s()&&t()}o=!0,queueMicrotask(d)}function c(){n.addEventListener("__darkreader__updateSheet",l)}function f(){n.removeEventListener("__darkreader__updateSheet",l)}function h(){f(),i?.stop()}return{start:r,stop:h}}function f7(n,e,t,s){let i=null,r=null;function o(){const h=e();return h?h.length:null}function l(){return o()!==i}function c(){i=o(),f();const h=()=>{const d=s();if(!d&&l()&&(i=o(),t()),d||op&&n.sheet){f();return}r=requestAnimationFrame(h)};h()}function f(){r&&cancelAnimationFrame(r)}return{start:c,stop:f}}const h7='style, link[rel*="stylesheet" i]:not([disabled])';function d7(n){if(!n.href)return!1;try{return new URL(n.href).hostname==="fonts.googleapis.com"}catch{return Sr(`Couldn't construct ${n.href} as URL`),!1}}const p7=["account.containerstore.com","containerstore.com","www.onet.pl"];function r2(n){return(n instanceof HTMLStyleElement||n instanceof SVGStyleElement&&!p7.includes(location.hostname)||n instanceof HTMLLinkElement&&!!n.rel&&n.rel.toLowerCase().includes("stylesheet")&&!!n.href&&!n.disabled&&(df?!n.href.startsWith("moz-extension://"):!0)&&!d7(n))&&!n.classList.contains("darkreader")&&!RR.includes(n.media.toLowerCase())&&!n.classList.contains("stylus")}function ho(n,e=[],t=!0){return r2(n)?e.push(n):(n instanceof Element||oR&&n instanceof ShadowRoot||n===document)&&(ii(n.querySelectorAll(h7),s=>ho(s,e,!1)),t&&lc(n,s=>ho(s.shadowRoot,e,!1))),e}const hC=new WeakSet,eo=new WeakMap,dC=new WeakMap;let m7=0;const xa=new Map;function g7(){xa.clear()}function b7(n,{update:e,loadingStart:t,loadingEnd:s}){const i=ZR();let r=null;if(i==="next"){const Z=[];let X=n;for(;(X=X.nextElementSibling)&&X.matches(".darkreader");)Z.push(X);r=Z.find(fe=>fe.matches(".darkreader--sync")&&!hC.has(fe))||null}let o=null,l=!1,c=!0;const f=()=>l,h=yw(),d=new MutationObserver(Z=>{if(Z.some(X=>X.type==="characterData")&&m()){const X=(n.textContent??"").trim();T(X,location.href).then(e)}else e()}),g={attributes:!0,childList:!0,subtree:!0,characterData:!0};function m(){return n instanceof HTMLStyleElement?i2(n.textContent??"").trim().match(LR):!1}function y(Z,X){let fe=!1;if(Z){let we;e:for(let ae=0,be=Z.length;ae<be;ae++)if(we=Z[ae],we.href)if(X){if(!we.href.startsWith("https://fonts.googleapis.com/")&&we.href.startsWith("http")&&!we.href.startsWith(location.origin)){fe=!0;break e}}else{fe=!0;break e}}return fe}function w(){if(eo.has(n))return eo.get(n).cssRules;if(m())return null;const Z=ne();return n instanceof HTMLLinkElement&&!zq(n.href)&&y(Z,!1)||y(Z,!0)?null:(!Z&&Ct("[getRulesSync] cssRules is null, trying again."),Z)}function x(){i==="next"?n.nextSibling!==r&&n.parentNode.insertBefore(r,n.nextSibling):i==="away"&&ww(r)}function S(){r=n instanceof SVGStyleElement?document.createElementNS("http://www.w3.org/2000/svg","style"):document.createElement("style"),r.classList.add("darkreader"),r.classList.add("darkreader--sync"),r.media="screen",n.title&&(r.title=n.title),hC.add(r)}let C=!1,E=!1;const k=++m7;async function R(){let Z,X;if(n instanceof HTMLLinkElement){let[fe,we]=ee();if(we&&Ct(we),Qd&&!n.sheet||!Qd&&!fe&&!we||ce(we)){try{Sr(`Linkelement ${k} is not loaded yet and thus will be await for`,n),await y7(n,k)}catch(ae){Ct(ae),E=!0}if(l)return null;[fe,we]=ee(),we&&Ct(we)}if(fe&&!y(fe,!1))return fe;try{Z=await o2(n.href)}catch(ae){Ct(ae),Z=""}if(X=np(n.href),l)return null}else if(m())Z=n.textContent.trim(),X=np(location.href);else return null;return await T(Z,X),eo.has(n)?eo.get(n).cssRules:null}async function T(Z,X){if(Z)try{const fe=await l2(Z,X);if(eo.has(n))(dC.get(n)??0)<fe.length&&(eo.get(n).replaceSync(fe),dC.set(n,fe.length));else{const we=new CSSStyleSheet;we.replaceSync(fe),eo.set(n,we)}}catch(fe){Ct(fe)}}function L(Z){const X=w();return X?{rules:X}:Z.secondRound?(Ct("Detected dead-lock at details(), returning early to prevent it."),null):(C||E||(C=!0,t(),R().then(fe=>{C=!1,s(),fe&&e()}).catch(fe=>{Ct(fe),C=!1,s()})),null)}let N=!1;function F(Z,X){const fe=w();if(!fe)return;l=!1;function we(Ne){if(Ne)for(let B=Ne.cssRules.length-1;B>=0;B--)Ne.deleteRule(B)}function ae(){r||S(),o&&o.stop(),x(),r.sheet==null&&(r.textContent="");const Ne=r.sheet;return we(Ne),o?o.run():i==="next"&&(o=kR(r,"prev-sibling",()=>{N=!0,be()})),r.sheet}function be(){const Ne=N;N=!1,h.modifySheet({prepareSheet:ae,sourceCSSRules:fe,theme:Z,ignoreImageAnalysis:X,force:Ne,isAsyncCancelled:f}),c=!r.sheet||r.sheet.cssRules.length===0,h.shouldRebuildStyle()&&aw(()=>e())}be()}function ee(){try{return n.sheet==null?[null,null]:[n.sheet.cssRules,null]}catch(Z){return[null,Z]}}function ce(Z){return Z&&Z.message&&Z.message.includes("loading")}function ne(){const[Z,X]=ee();return X?(Ct(X),null):Z}const pe=u7(n,ne,e,f);function Y(){d.disconnect(),l=!0,o&&o.stop(),pe.stop()}function q(){if(Y(),eo.delete(n),uo(r),s(),xa.has(k)){const Z=xa.get(k);xa.delete(k),Z&&Z()}}function J(){d.observe(n,g),n instanceof HTMLStyleElement&&pe.start()}const Se=10;let H=0;function ge(){if(r){if(H++,H>Se){Ct("Style sheet was moved multiple times",n);return}Ct("Restore style",r,n),x(),o&&o.skip(),c||(N=!0,e())}}return{details:L,render:F,pause:Y,destroy:q,watch:J,restore:ge}}async function y7(n,e){return new Promise((t,s)=>{const i=()=>{n.removeEventListener("load",r),n.removeEventListener("error",o),xa.delete(e)},r=()=>{i(),t()},o=()=>{i(),s(`Linkelement ${e} couldn't be loaded. ${n.href}`)};xa.set(e,()=>{i(),s()}),n.addEventListener("load",r,{passive:!0}),n.addEventListener("error",o,{passive:!0}),n.href||o()})}function v7(n){return cw(n.substring(7).trim().replace(/;$/,"").replace(/screen$/,""))}async function o2(n){if(n.startsWith("data:"))return await(await fetch(n)).text();const e=JK(n);if(e)return e;const t=new URL(n);let s;return t.origin===location.origin?s=await $q(n,"text/css",location.origin):s=await VR({url:n,responseType:"text",mimeType:"text/css",origin:location.origin}),t.origin===location.origin&&QK(n,s),s}async function l2(n,e,t=new Map){n=i2(n),n=TK(n),n=AK(n,e);const s=Wq(LR,n);let i=null,r=!1,o=0;for(const l of s){let c;const f=i?i.offset+i.text.length:0,h=l.offset,d=n.indexOf("{",f),g=n.indexOf("}",f);if(r||d>=0&&d<h&&g>=0&&g<h)r=!0,c="";else{const m=v7(l.text),y=fm(e,m);if(t.has(y))c=t.get(y);else try{c=await o2(y),t.set(y,c),c=await l2(c,np(y),t)}catch(w){Ct(w),c=""}}n=n.substring(0,l.offset+o)+c+n.substring(l.offset+l.text.length+o),o+=c.length-l.text.length,i=l}return n=n.trim(),n}function w7(n,e){document.dispatchEvent(new CustomEvent("__darkreader__inlineScriptsAllowed"));const t=[];function s(){t.forEach(N=>N()),t.splice(0)}function i(N,F,ee){document.addEventListener(N,F,ee),t.push(()=>document.removeEventListener(N,F))}function r(){window?.WPDarkMode?.deactivate&&window.WPDarkMode.deactivate()}i("__darkreader__cleanUp",s),i("__darkreader__disableConflictingPlugins",r);function o(N,F,ee){const ce=N.prototype,ne=Object.getOwnPropertyDescriptor(ce,F);if(!ne)return;const pe={...ne};Object.keys(ee).forEach(Y=>{const q=ee[Y];pe[Y]=q(ne[Y])}),Object.defineProperty(ce,F,pe),t.push(()=>Object.defineProperty(ce,F,ne))}function l(N,F,ee){o(N,F,{value:ee})}function c(N){return N?.classList?.contains("darkreader")}function f(N){return c(N.ownerNode)}const h=new CustomEvent("__darkreader__updateSheet"),d=new CustomEvent("__darkreader__adoptedStyleSheetChange"),g=new CustomEvent("__darkreader__shadowDomAttaching",{bubbles:!0}),m=new WeakMap,y=new WeakMap;function w(N){const F=m.get(N);F?.forEach(ee=>{ee.isConnected?ee.dispatchEvent(d):F.delete(ee)})}function x(N){N.ownerNode&&!f(N)&&N.ownerNode.dispatchEvent(h),m.has(N)&&w(N)}function S(N,F){const{ownerNode:ee}=N;ee&&!f(N)&&F&&F instanceof Promise&&F.then(()=>ee.dispatchEvent(h)),m.has(N)&&F&&F instanceof Promise&&F.then(()=>w(N))}l(CSSStyleSheet,"addRule",N=>function(F,ee,ce){return N.call(this,F,ee,ce),x(this),-1}),l(CSSStyleSheet,"insertRule",N=>function(F,ee){const ce=N.call(this,F,ee);return x(this),ce}),l(CSSStyleSheet,"deleteRule",N=>function(F){N.call(this,F),x(this)}),l(CSSStyleSheet,"removeRule",N=>function(F){N.call(this,F),x(this)}),l(CSSStyleSheet,"replace",N=>function(F){const ee=N.call(this,F);return S(this,ee),ee}),l(CSSStyleSheet,"replaceSync",N=>function(F){N.call(this,F),x(this)}),l(Element,"attachShadow",N=>function(F){return this.dispatchEvent(g),N.call(this,F)}),(location.hostname==="baidu.com"||location.hostname.endsWith(".baidu.com"))&&l(Element,"getElementsByTagName",N=>function(F){if(F!=="style")return N.call(this,F);const ee=()=>{const pe=N.call(this,F);return Object.setPrototypeOf([...pe].filter(Y=>Y&&!c(Y)),NodeList.prototype)};let ce=ee();const ne={get:function(pe,Y){return ee()[Number(Y)||Y]}};return ce=new Proxy(ce,ne),ce}),["brilliant.org","www.vy.no"].includes(location.hostname)&&o(Node,"childNodes",{get:N=>function(){const F=N.call(this);return Object.setPrototypeOf([...F].filter(ee=>!c(ee)),NodeList.prototype)}});function k(N){customElements.whenDefined(N).then(()=>{document.dispatchEvent(new CustomEvent("__darkreader__isDefined",{detail:{tag:N}}))})}i("__darkreader__addUndefinedResolver",N=>k(N.detail.tag)),e&&l(CustomElementRegistry,"define",N=>function(F,ee,ce){k(F),N.call(this,F,ee,ce)});let R=null;function T(){if(R!=null){document.dispatchEvent(new CustomEvent("__darkreader__blobURLCheckResponse",{detail:{blobURLAllowed:R}}));return}const N='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><rect width="1" height="1" fill="transparent"/></svg>',F=new Uint8Array(N.length);for(let pe=0;pe<N.length;pe++)F[pe]=N.charCodeAt(pe);const ee=new Blob([F],{type:"image/svg+xml"}),ce=URL.createObjectURL(ee),ne=new Image;ne.onload=()=>{R=!0,L()},ne.onerror=()=>{R=!1,L()},ne.src=ce}function L(){document.dispatchEvent(new CustomEvent("__darkreader__blobURLCheckResponse",{detail:{blobURLAllowed:R}}))}i("__darkreader__blobURLCheckRequest",T),n&&o(Document,"styleSheets",{get:N=>function(){const F=()=>{const pe=[...N.call(this)].filter(Y=>Y.ownerNode&&!f(Y));return pe.item=Y=>pe[Y],Object.setPrototypeOf(pe,StyleSheetList.prototype)};let ee=F();const ce={get:function(ne,pe){return F()[pe]}};return ee=new Proxy(ee,ce),ee}});{const N=new WeakMap,F=new WeakMap,ee=new CustomEvent("__darkreader__adoptedStyleSheetsChange"),ce=new WeakSet,ne=new WeakMap,pe=H=>!H||!H.cssRules?!1:ce.has(H)?!0:H.cssRules.length>0&&H.cssRules[0].cssText.startsWith("#__darkreader__adoptedOverride")?(ce.add(H),!0):!1,Y=(H,ge)=>H.length===ge.length&&H.every((Z,X)=>Z===ge[X]),q=H=>{const ge=ne.get(H),Z=(H.adoptedStyleSheets||[]).filter(X=>!pe(X));ne.set(H,Z),(!ge||!Y(ge,Z))&&(Z.forEach(X=>{m.has(X)||m.set(X,new Set),m.get(X).add(H);for(const fe of X.cssRules){const we=fe.style;we&&y.set(we,X)}}),H.dispatchEvent(ee))},J=(H,ge)=>{if(F.has(ge))return ge;if(N.has(ge))return N.get(ge);const Z=new Proxy(ge,{deleteProperty(X,fe){return delete X[fe],!0},set(X,fe,we){return X[fe]=we,fe==="length"&&q(H),!0}});return N.set(ge,Z),F.set(Z,ge),Z};[Document,ShadowRoot].forEach(H=>{o(H,"adoptedStyleSheets",{get:ge=>function(){const Z=ge.call(this);return J(this,Z)},set:ge=>function(Z){F.has(Z)&&(Z=F.get(Z)),ge.call(this,Z),q(this)}})});const Se=new CustomEvent("__darkreader__adoptedStyleDeclarationChange");["setProperty","removeProperty"].forEach(H=>{l(CSSStyleDeclaration,H,ge=>function(...Z){const X=ge.apply(this,Z),fe=y.get(this);if(fe){const we=m.get(fe);we&&we.forEach(ae=>{ae.dispatchEvent(Se)})}return X})})}}const a2=new Set,Qo=new Map;let Iu;function S7(n){return!!(n.tagName.includes("-")||n.getAttribute("is"))}function c2(n){let e=n.tagName.toLowerCase();if(!e.includes("-")){const t=n.getAttribute("is");if(t)e=t;else return}Qo.has(e)||(Qo.set(e,new Set),x7(e).then(()=>{if(Iu){const t=Qo.get(e);ow("recordUndefinedElement() undefined groups should not be empty",t),Qo.delete(e),Iu(Array.from(t))}})),Qo.get(e).add(n)}function Mh(n){Nq&&ii(n.querySelectorAll(":not(:defined)"),c2)}let xw=!1;document.addEventListener("__darkreader__inlineScriptsAllowed",()=>{xw=!0},{once:!0,passive:!0});const Dh=new Set;document.addEventListener("__darkreader__shadowDomAttaching",n=>{const e=n.target;Dh.size===0&&queueMicrotask(()=>{const t=[...Dh].filter(s=>s.shadowRoot);Iu?.(t),Dh.clear()}),Dh.add(e)});const _a=new Map;function u2(n){xw=!0;const e=n.detail.tag;if(ow("handleIsDefined() expects lower-case node names",()=>e.toLowerCase()===e),a2.add(e),_a.has(e)){const t=_a.get(e);_a.delete(e),t.forEach(s=>s())}}async function x7(n){if(ow("customElementsWhenDefined() expects lower-case node names",()=>n.toLowerCase()===n),!a2.has(n))return new Promise(e=>{if(window.customElements&&typeof customElements.whenDefined=="function")customElements.whenDefined(n).then(()=>e());else if(xw)_a.has(n)?_a.get(n).push(e):_a.set(n,[e]),document.dispatchEvent(new CustomEvent("__darkreader__addUndefinedResolver",{detail:{tag:n}}));else{const t=()=>{const s=Qo.get(n);s&&s.size>0&&(s.values().next().value.matches(":defined")?e():requestAnimationFrame(t))};requestAnimationFrame(t)}})}function _7(n){Iu=n}function E7(){Iu=null,Qo.clear(),document.removeEventListener("__darkreader__isDefined",u2)}const bd=[];let yd,hy;function C7(n,e,t){f2();const s=new WeakMap,i=S=>(s.has(S)||s.set(S,new Set),s.get(S));n.forEach(S=>{let C=S;for(;C=C.parentNode;)if(C===document||C.nodeType===Node.DOCUMENT_FRAGMENT_NODE){i(C).add(S);break}});const r=new WeakMap,o=new WeakMap;function l(S){r.set(S,S.previousElementSibling),o.set(S,S.nextElementSibling)}function c(S){r.delete(S),o.delete(S)}function f(S){return S.previousElementSibling!==r.get(S)||S.nextElementSibling!==o.get(S)}n.forEach(l);function h(S,C){const{createdStyles:E,removedStyles:k,movedStyles:R}=C;E.forEach(L=>l(L)),R.forEach(L=>l(L)),k.forEach(L=>c(L));const T=i(S);E.forEach(L=>T.add(L)),k.forEach(L=>T.delete(L)),E.size+k.size+R.size>0&&e({created:Array.from(E),removed:Array.from(k),moved:Array.from(R),updated:[]})}function d(S,{additions:C,moves:E,deletions:k}){const R=new Set,T=new Set,L=new Set;C.forEach(N=>ho(N).forEach(F=>R.add(F))),k.forEach(N=>ho(N).forEach(F=>T.add(F))),E.forEach(N=>ho(N).forEach(F=>L.add(F))),h(S,{createdStyles:R,removedStyles:T,movedStyles:L}),C.forEach(N=>{x(N),Mh(N)}),C.forEach(N=>S7(N)&&c2(N)),C.forEach(N=>ry(N))}function g(S){const C=new Set(ho(S)),E=new Set,k=new Set,R=new Set,T=i(S);C.forEach(L=>{T.has(L)||E.add(L)}),T.forEach(L=>{C.has(L)||k.add(L)}),C.forEach(L=>{!E.has(L)&&!k.has(L)&&f(L)&&R.add(L)}),h(S,{createdStyles:E,removedStyles:k,movedStyles:R}),x(S),Mh(S),ry(S)}function m(S){const C=new Set,E=new Set;S.forEach(k=>{const{target:R}=k;R.isConnected&&(r2(R)?C.add(R):R instanceof HTMLLinkElement&&R.disabled&&E.add(R))}),C.size+E.size>0&&e({updated:Array.from(C),created:[],removed:Array.from(E),moved:[]})}function y(S){if(yd.has(S))return;const C=OR(S,{onMinorMutations:d,onHugeMutations:g}),E=new MutationObserver(m);E.observe(S,{attributeFilter:["rel","disabled","media","href"],subtree:!0}),bd.push(C,E),yd.add(S)}function w(S){const{shadowRoot:C}=S;C==null||yd.has(C)||(y(C),t(C))}function x(S){lc(S,w)}y(document),x(document.documentElement),_7(S=>{S=S.filter(E=>!hy.has(E));const C=[];S.forEach(E=>sw(C,ho(E.shadowRoot))),e({created:C,updated:[],removed:[],moved:[]}),S.forEach(E=>{const{shadowRoot:k}=E;k!=null&&(w(E),x(k),Mh(k))}),S.forEach(E=>hy.add(E))}),document.addEventListener("__darkreader__isDefined",u2),Mh(document)}function A7(){bd.forEach(n=>n.disconnect()),bd.splice(0,bd.length),yd=new WeakSet,hy=new WeakSet}function f2(){A7(),E7()}function k7(n,e,t){C7(n,e,t)}function T7(){f2()}const _w=_R(),Gs=new Map,lp=[],ap=new Map,zb=new WeakMap;let Ge=null,It=null,h2=null,Ls=[],Pu=[],Ea=new WeakMap;function On(n,e=document.head||document){let t=e.querySelector(`.${n}`);Ea.has(e)||Ea.set(e,new Map);const s=Ea.get(e);return t?s.set(n,t):s.has(n)?t=s.get(n):(t=document.createElement("style"),t.classList.add("darkreader"),t.classList.add(n),t.media="screen",t.textContent="",s.set(n,t)),t}function O7(n,e=document.head||document){let t=e.querySelector(`.${n}`);return t||(t=document.createElement("script"),t.classList.add("darkreader"),t.classList.add(n)),t}const pu=new Map;function R7(n,e,t){pu.has(e)&&pu.get(e).stop(),pu.set(e,kR(n,"head",t))}function M7(){ii(pu.values(),n=>n.stop()),pu.clear()}function to(n,e,t,s){const i=ZR();i==="next"?(document.head.insertBefore(n,e?e.nextSibling:document.head.firstChild),R7(n,t,s)):i==="away"&&ww(n)}function D7(){const n=On("darkreader--fallback",document);n.textContent=gw(Ge,{strict:!0}),to(n,null,"fallback");const e=On("darkreader--user-agent");e.textContent=_j(Ge,h2,Ge.styleSystemControls),to(e,n,"user-agent");const t=On("darkreader--text");Ge.useFont||Ge.textStroke>0?t.textContent=Kq(Ge):t.textContent="",to(t,e,"text");const s=On("darkreader--invert");It&&Array.isArray(It.invert)&&It.invert.length>0?s.textContent=[`${It.invert.join(", ")} {`,`    filter: ${mR({...Ge,contrast:Ge.mode===0?Ge.contrast:ul(Ge.contrast-10,0,100)})} !important;`,"}"].join(`
`):s.textContent="",to(s,t,"invert");const i=On("darkreader--inline");i.textContent=e2(),to(i,s,"inline");const r=On("darkreader--variables"),o=Ge?.selectionColor?KR(Ge):null,l=In(bn("#ffffff"),Ge),c=fs(bn("#000000"),Ge);r.textContent=[":root {",`   --darkreader-neutral-background: ${l};`,`   --darkreader-neutral-text: ${c};`,`   --darkreader-selection-background: ${o?.backgroundColorSelection??"initial"};`,`   --darkreader-selection-text: ${o?.foregroundColorSelection??"initial"};`,"}"].join(`
`),to(r,i,"variables",()=>GE(r.sheet)),GE(r.sheet);const f=On("darkreader--root-vars");to(f,r,"root-vars");const h=!(It&&It.disableStyleSheetsProxy),d=!(It&&It.disableCustomElementRegistryProxy);document.dispatchEvent(new CustomEvent("__darkreader__cleanUp"));{const m=O7("darkreader--proxy");m.append(`(${w7})(${h}, ${d})`),document.head.insertBefore(m,f.nextSibling),m.remove()}const g=On("darkreader--override");g.textContent=It&&It.css?p2(It.css):"",to(g,document.head.lastChild,"override")}const dy=new Set;function d2(n){const e=On("darkreader--inline",n);e.textContent=e2(),n.insertBefore(e,n.firstChild);const t=On("darkreader--override",n);t.textContent=It&&It.css?p2(It.css):"",n.insertBefore(t,e.nextSibling);const s=On("darkreader--invert",n);It&&Array.isArray(It.invert)&&It.invert.length>0?s.textContent=[`${It.invert.join(", ")} {`,`    filter: ${mR({...Ge,contrast:Ge.mode===0?Ge.contrast:ul(Ge.contrast-10,0,100)})} !important;`,"}"].join(`
`):s.textContent="",n.insertBefore(s,t.nextSibling),dy.add(n)}function L7(n){new MutationObserver((t,s)=>{s.disconnect();for(const{type:i,removedNodes:r}of t)if(i==="childList"){for(const{nodeName:o,className:l}of r)if(o==="STYLE"&&["darkreader darkreader--inline","darkreader darkreader--override","darkreader darkreader--invert"].includes(l)){d2(n);return}}}).observe(n,{childList:!0})}function py(n){const e=n.firstChild===null;d2(n),e&&L7(n)}function p2(n){return n.replace(/\${(.+?)}/g,(e,t)=>{const s=bn(t);return s?xR(s.r,s.g,s.b)>.5?In(s,Ge):fs(s,Ge):(Ct("Couldn't parse CSSTemplate's color."),t)})}function Ew(){const n=Ea.get(document.head)?.get("darkreader--fallback")||Ea.get(document)?.get("darkreader--fallback")||document.querySelector(".darkreader--fallback");n&&(n.textContent="")}function N7(){b2();const e=ho(document).filter(i=>!Gs.has(i)).map(i=>m2(i));e.map(i=>i.details({secondRound:!1})).filter(i=>i&&i.rules.length>0).forEach(i=>{qt.addRulesForMatching(i.rules)}),qt.matchVariablesAndDependents(),qt.setOnRootVariableChange(()=>{const i=On("darkreader--root-vars");qt.putRootVars(i,Ge)});const t=On("darkreader--root-vars");qt.putRootVars(t,Ge),Gs.forEach(i=>i.render(Ge,Ls)),xr.size===0&&Ew(),e.forEach(i=>i.watch());const s=Gq(document.querySelectorAll(Nu));if(lc(document.documentElement,i=>{py(i.shadowRoot);const r=i.shadowRoot.querySelectorAll(Nu);r.length>0&&sw(s,r)}),s.forEach(i=>fy(i,Ge,Pu,Ls)),v2(document),qt.matchVariablesAndDependents(),df){const i=r=>{const{sheets:o}=r.detail;if(!Array.isArray(o)||o.length===0)return;o.forEach(({sheet:c})=>{const{cssRules:f}=c;qt.addRulesForMatching(f)}),qt.matchVariablesAndDependents();const l=[];o.forEach(({sheetId:c,sheet:f})=>{const h=F7(f),d=f.cssRules;h.render({theme:Ge,ignoreImageAnalysis:Ls,cssRules:d});const g=h.commands();l.push({sheetId:c,commands:g})}),mK(B7(o[0].sheet),()=>{document.dispatchEvent(new CustomEvent("__darkreader__adoptedStyleSheetCommands",{detail:JSON.stringify(l)}))})};document.addEventListener("__darkreader__adoptedStyleSheetsChange",i),cp.push(()=>document.removeEventListener("__darkreader__adoptedStyleSheetsChange",i)),document.dispatchEvent(new CustomEvent("__darkreader__startAdoptedStyleSheetsWatcher"))}}let I7=0;const xr=new Set;function m2(n){const e=++I7;function t(){if(!Co()||!AR()){xr.add(e),Sr(`Current amount of styles loading: ${xr.size}`);const o=On("darkreader--fallback");o.textContent||(o.textContent=gw(Ge,{strict:!1}))}}function s(){xr.delete(e),Sr(`Removed loadingStyle ${e}, now awaiting: ${xr.size}`),xr.size===0&&Co()&&Ew()}function i(){const o=r.details({secondRound:!0});o&&(qt.addRulesForMatching(o.rules),qt.matchVariablesAndDependents(),r.render(Ge,Ls))}const r=b7(n,{update:i,loadingStart:t,loadingEnd:s});return Gs.set(n,r),r}function g2(n){const e=Gs.get(n);e&&(e.destroy(),Gs.delete(n))}const P7=rw(n=>{Gs.forEach(e=>e.render(Ge,Ls)),lp.forEach(e=>e.render(Ge,Ls)),n&&n()}),b2=function(){P7.cancel()};function y2(){if(xr.size===0){Ew();return}Ct("DOM is ready, but still have styles being loaded.",xr)}function pC(){N7(),V7()}function $7(){D7(),!AR()&&!Ge.immediateModify?vK(pC):pC(),l7(Ge)}function v2(n){if(!df&&jj(n)){n.adoptedStyleSheets.forEach(t=>{qt.addRulesForMatching(t.cssRules)});const e=Gj(n);lp.push(e),e.render(Ge,Ls),e.watch(t=>{t.forEach(s=>{qt.addRulesForMatching(s.cssRules)}),qt.matchVariablesAndDependents(),e.render(Ge,Ls)})}}function B7(n){if(zb.has(n))return zb.get(n);const e=Symbol();return zb.set(n,e),e}function F7(n){let e=ap.get(n);return e||(e=Yj(),ap.set(n,e)),e}function V7(){const n=Array.from(Gs.keys());k7(n,({created:e,updated:t,removed:s,moved:i})=>{const r=s,o=e.concat(t).concat(i).filter(f=>!Gs.has(f)),l=i.filter(f=>Gs.has(f));r.forEach(f=>g2(f));const c=o.map(f=>m2(f));c.map(f=>f.details({secondRound:!1})).filter(f=>f&&f.rules.length>0).forEach(f=>{qt.addRulesForMatching(f.rules)}),qt.matchVariablesAndDependents(),c.forEach(f=>f.render(Ge,Ls)),c.forEach(f=>f.watch()),l.forEach(f=>Gs.get(f).restore())},e=>{py(e),v2(e)}),e7(e=>{if(fy(e,Ge,Pu,Ls),e===document.documentElement&&(e.getAttribute("style")||"").includes("--")){qt.matchVariablesAndDependents();const s=On("darkreader--root-vars");qt.putRootVars(s,Ge)}},e=>{py(e);const t=e.querySelectorAll(Nu);t.length>0&&ii(t,s=>fy(s,Ge,Pu,Ls))}),lw(y2)}function W7(){Gs.forEach(n=>n.pause()),M7(),T7(),t7(),TR(y2),xK()}let mu,Ql=null;function H7(){mu=new MutationObserver(()=>{document.querySelector('meta[name="darkreader-lock"]')&&(mu.disconnect(),Cw())}),mu.observe(document.head,{childList:!0,subtree:!0})}function U7(){const n=document.createElement("meta");n.name="darkreader",n.content=_w,document.head.appendChild(n)}function z7(){return document.querySelector('meta[name="darkreader-lock"]')!=null}function q7(){const n=document.querySelector('meta[name="darkreader"]');return n?n.content!==_w:(U7(),H7(),!1)}let K7=2;function j7({success:n,failure:e}){if(--K7<=0){e();return}const t=document.head.querySelector('meta[name="darkreader"]');if(!t||t.content===_w)return;const s=document.createElement("meta");s.name="darkreader-lock",document.head.append(s),queueMicrotask(()=>{s.remove(),n()})}function G7(){if(document.documentElement.hasAttribute("data-wp-dark-mode-preset")){const n=()=>{document.dispatchEvent(new CustomEvent("__darkreader__disableConflictingPlugins")),document.documentElement.classList.remove("wp-dark-mode-active"),document.documentElement.removeAttribute("data-wp-dark-mode-active")};n(),new MutationObserver(()=>{(document.documentElement.classList.contains("wp-dark-mode-active")||document.documentElement.hasAttribute("data-wp-dark-mode-active"))&&n()}).observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-wp-dark-mode-active"]})}}let Yc=null,vd=null;function Y7(n,e,t){Ge=n,It=e;const s=["brightness","contrast","darkSchemeBackgroundColor","darkSchemeTextColor","grayscale","lightSchemeBackgroundColor","lightSchemeTextColor","sepia"];if(Yc&&vd){const r=new Set([...Object.keys(Ge),...Object.keys(Yc)]);let o=!0;for(const l of r)if(Ge[l]!==Yc[l]&&!s.includes(l)){o=!1;break}if(o&&JSON.stringify(It)!==JSON.stringify(vd)&&(o=!1),o){const l=IK();Q0(),l.background.forEach(c=>In(c,Ge)),l.text.forEach(c=>fs(c,Ge)),l.border.forEach(c=>Ka(c,Ge));return}Q0()}It?(Ls=Array.isArray(It.ignoreImageAnalysis)?It.ignoreImageAnalysis:[],Pu=Array.isArray(It.ignoreInlineStyle)?It.ignoreInlineStyle:[]):(Ls=[],Pu=[]),Ge.immediateModify&&SK(()=>!0),h2=t;const i=()=>{const r=()=>{G7(),document.documentElement.setAttribute("data-darkreader-mode","dynamic"),document.documentElement.setAttribute("data-darkreader-scheme",Ge.mode?"dark":"dimmed"),$7()},o=()=>{Cw()};z7()?uo(document.querySelector(".darkreader--fallback")):q7()?j7({success:r,failure:o}):r()};if(document.head)i();else{if(!df){const r=On("darkreader--fallback");document.documentElement.appendChild(r),r.textContent=gw(Ge,{strict:!0})}Ql?.disconnect(),Ql=new MutationObserver(()=>{document.head&&(Ql?.disconnect(),i())}),cp.push(()=>{Ql?.disconnect(),Ql=null}),Ql.observe(document,{childList:!0,subtree:!0})}Yc=Ge,vd=It}function X7(){document.dispatchEvent(new CustomEvent("__darkreader__cleanUp")),uo(document.head.querySelector(".darkreader--proxy"))}const cp=[];function Cw(){if(document.documentElement.removeAttribute("data-darkreader-mode"),document.documentElement.removeAttribute("data-darkreader-scheme"),Q7(),uo(document.querySelector(".darkreader--fallback")),document.head){const n=[".darkreader--user-agent",".darkreader--text",".darkreader--invert",".darkreader--inline",".darkreader--override",".darkreader--variables",".darkreader--root-vars",'meta[name="darkreader"]'];a7(),n.forEach(e=>uo(document.head.querySelector(e))),Ea=new WeakMap,X7()}dy.forEach(n=>{uo(n.querySelector(".darkreader--inline")),uo(n.querySelector(".darkreader--override"))}),dy.clear(),ii(Gs.keys(),n=>g2(n)),xr.clear(),g7(),ii(document.querySelectorAll(".darkreader"),uo),Jj(),lp.forEach(n=>n.destroy()),lp.splice(0),ap.forEach(n=>n.destroy()),ap.clear(),mu&&mu.disconnect(),cp.forEach(n=>n()),cp.splice(0)}function Q7(){qt.clear(),Kc.clear(),CR(),b2(),W7(),Pj(),Jq(),DK(),Yc=null,vd=null}const J7=(()=>{try{return window.self!==window.top}catch(n){return console.warn(n),!0}})();function Z7(n={},e=null){const t={...fR,...n};if(t.engine!==Du.dynamicTheme)throw new Error("Theme engine is not supported.");Y7(t,e,J7)}function eG(){Cw()}typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)");const tG=Bq,nG={class:"row"},sG={class:"col-12"},iG={style:{"--bs-breadcrumb-divider":'">"'},"aria-label":"breadcrumb",class:"d-flex justify-content-between"},rG={class:"breadcrumb"},oG={class:"breadcrumb-item"},lG={class:"breadcrumb-item active","aria-current":"page"},aG={class:"d-flex"},cG={class:"form-check form-switch"},uG=["checked"],fG={class:"toast-container position-fixed top-0 start-50 translate-middle-x p-3"},hG={class:"d-flex"},dG={class:"toast-body"},pG={class:"modal fade",id:"settings",tabindex:"-1","aria-hidden":"true"},mG={class:"modal-content"},gG={class:"modal-body"},bG={class:"card-body border-0"},yG={class:"mb-3"},vG={class:"row mb-3"},wG={class:"row mb-3"},SG={class:"row mb-3"},xG={class:"row mb-3"},_G={class:"row mb-3"},EG=Bn({__name:"bread-crumb",setup(n){const e=er(),t=_i(),s=Vt("store"),i=De(!1),r=De(),o=Wt({className:"",message:""}),l=Wt({AWS_REGION:"",AWS_ENDPOINT:"",AWS_ACCESS_KEY_ID:"",AWS_SESSION_TOKEN:"",AWS_SECRET_ACCESS_KEY:""}),c=()=>{window.history.length>1?t.back():t.push({name:"home"})},f=async()=>{try{await Cq({credentials:l}),window.location.reload()}catch(g){o.className="text-bg-danger",o.message=g.response?.data?.message??g.message;const m=new en(r.value,{delay:1e3});setTimeout(()=>m.show(),0)}},h=async()=>{try{await Aq(),window.location.reload()}catch(g){o.className="text-bg-danger",o.message=g.response?.data?.message??g.message;const m=new en(r.value,{delay:1e3});setTimeout(()=>m.show(),0)}};of(()=>{tG(window.fetch),i.value=!!localStorage.getItem("darkreader"),d(i.value)});const d=g=>{g?(Z7({brightness:90,contrast:90}),localStorage.setItem("darkreader",g.toString())):(eG(),localStorage.removeItem("darkreader"))};return(g,m)=>(ue(),ye("div",nG,[b("div",sG,[b("nav",iG,[b("ol",rG,[m[8]||(m[8]=b("li",{class:"breadcrumb-item"},[b("a",{href:"/"},"DynamoDB")],-1)),b("li",oG,[b("a",{href:"#",onClick:Qs(c,["prevent"])},Pe(ke(e).meta.name),1)]),b("li",lG,Pe(ke(s).table.state.Table.TableName),1)]),b("div",aG,[m[10]||(m[10]=b("i",{class:"bi bi-gear me-3",type:"button","data-bs-toggle":"modal","data-bs-target":"#settings"},null,-1)),b("i",{class:"bi bi-bootstrap-reboot me-2",type:"button",onClick:Qs(h,["prevent"])}),m[11]||(m[11]=b("i",{class:"bi bi-sun me-1"},null,-1)),b("div",cG,[b("input",{class:"form-check-input",type:"checkbox",role:"switch",onChange:m[0]||(m[0]=y=>d(y.target.checked)),checked:i.value},null,40,uG),m[9]||(m[9]=b("i",{class:"bi bi-moon"},null,-1))])])])]),b("div",fG,[b("div",{class:Pt(["toast align-items-center border-0",o.className]),role:"alert","aria-live":"assertive","aria-atomic":"true",ref_key:"toastRef",ref:r},[b("div",hG,[b("div",dG,Pe(o.message),1),m[12]||(m[12]=b("button",{type:"button",class:"btn-close btn-close-white me-2 m-auto","data-bs-dismiss":"toast","aria-label":"Close"},null,-1))])],2)]),b("div",pG,[b("form",{class:"modal-dialog",onSubmit:Qs(f,["prevent"])},[b("div",mG,[m[18]||(m[18]=b("div",{class:"modal-header"},[b("h1",{class:"modal-title fs-5",id:"exampleModalLabel"}," Settings "),b("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),b("div",gG,[b("div",bG,[b("div",yG,[b("div",vG,[b("div",null,[m[13]||(m[13]=b("label",{class:"form-label"},[Ie(" AWS Region * "),b("br")],-1)),mt(Ru,{modelValue:l.AWS_REGION,"onUpdate:modelValue":m[1]||(m[1]=y=>l.AWS_REGION=y),items:ke(sR),placeholder:"eg: us-west-2",id:"dropdown-input-toggle-aws-region",onSelect:m[2]||(m[2]=y=>l.AWS_REGION=y)},null,8,["modelValue","items"])])]),b("div",wG,[b("div",null,[m[14]||(m[14]=b("label",{class:"form-label"},[Ie(" AWS DynamoDB Endpoint * "),b("br")],-1)),mt(Ru,{modelValue:l.AWS_ENDPOINT,"onUpdate:modelValue":m[3]||(m[3]=y=>l.AWS_ENDPOINT=y),items:ke(iR),placeholder:"eg: https://dynamodb.us-west-2.amazonaws.com",id:"dropdown-input-toggle-aws-dynamodb",onSelect:m[4]||(m[4]=y=>l.AWS_ENDPOINT=y)},null,8,["modelValue","items"])])]),b("div",SG,[b("div",null,[m[15]||(m[15]=b("label",{class:"form-label"},[Ie(" AWS Access Key Id * "),b("br")],-1)),Ye(b("input",{required:"",type:"text",class:"form-control rounded-0",placeholder:"eg: AKIAIOSFODNN7EXAMPLE","onUpdate:modelValue":m[5]||(m[5]=y=>l.AWS_ACCESS_KEY_ID=y)},null,512),[[Rt,l.AWS_ACCESS_KEY_ID]])])]),b("div",xG,[b("div",null,[m[16]||(m[16]=b("label",{class:"form-label"},[Ie(" AWS Secret access key * "),b("br")],-1)),Ye(b("input",{required:"",type:"text",class:"form-control rounded-0",placeholder:"eg: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY","onUpdate:modelValue":m[6]||(m[6]=y=>l.AWS_SECRET_ACCESS_KEY=y)},null,512),[[Rt,l.AWS_SECRET_ACCESS_KEY]])])]),b("div",_G,[b("div",null,[m[17]||(m[17]=b("label",{class:"form-label"},[Ie(" AWS session token "),b("br")],-1)),Ye(b("input",{type:"text",class:"form-control rounded-0",placeholder:"eg: FQoGZXIvYXdzENv//////////wEaDEeLj11xTbnBk6azRCKsAacCiJK85DSXExJ81GtHrkEyev8eedQcFY4EoM00PsD1FAEMOfzQclVEFsoh9Y4ZHUjgGmCPRUnYCLNc2NnHkadvmI+MT7jRRa1Mo2HA/HYStOOwEyfXFYG91MNj9rVXXXXXXXXA6+7FF6jcxj3cr1U9CDB9hjW+jGq4UgjxXXXXXXXCoIidDjl4Z911zIzP/Q+FYA1R2CUz5Y32EUaMzR+bQvmheUolLOq3wU=","onUpdate:modelValue":m[7]||(m[7]=y=>l.AWS_SESSION_TOKEN=y)},null,512),[[Rt,l.AWS_SESSION_TOKEN]])])])])])]),m[19]||(m[19]=b("div",{class:"modal-footer"},[b("button",{type:"button",class:"btn btn-secondary rounded-0","data-bs-dismiss":"modal"}," Cancel "),b("button",{type:"submit",class:"btn btn-primary rounded-0"}," Connect ")],-1))])],32)])]))}}),CG={class:"wrapper container-fluid py-4 px-5"},AG=Bn({__name:"App",setup(n){return iu("store",qd),(e,t)=>{const s=sc("RouterView");return ue(),ye("div",CG,[mt(EG),t[0]||(t[0]=b("br",null,null,-1)),mt(s),t[1]||(t[1]=b("div",{class:"position-fixed bottom-0 end-0 z-3"},[b("h6",null,[b("span",{class:"badge text-bg-secondary m-4"},"v1.24.2")])],-1))])}}}),kG=tr(AG,[["__scopeId","data-v-8b8a0982"]]);async function TG(){const{data:n}=await Xe.get(Kt.TABLE.ALL);return n}async function hl(n){const e=Fn(Kt.TABLE.DESCRIBE,{tableName:n}),{data:t}=await Xe.get(e);return t.Table}async function OG(n){const e=Fn(Kt.TABLE.TTL,{tableName:n}),{data:t}=await Xe.get(e);return t.TimeToLiveDescription}async function RG(n,e){const t=Fn(Kt.TABLE.TTL,{tableName:n}),{data:s}=await Xe.put(t,e);return s.TimeToLiveDescription}async function MG(n){const e=Kt.TABLE.CREATE,{data:t}=await Xe.post(e,n);return t}async function DG(n){const e=Fn(Kt.TABLE.DELETE,{tableName:n}),{data:t}=await Xe.delete(e);return t}async function LG(n){const e=Fn(Kt.TABLE.TRUNCATE,{tableName:n}),{data:t}=await Xe.put(e);return t}async function NG(n,e){const t=Fn(Kt.TABLE.UPDATE,{tableName:n}),{data:s}=await Xe.put(t,e);return s}async function IG(n){const{data:e}=await Xe.post(Kt.DATABASE.ALL,n);return e}async function PG(n,e){const t=Fn(Kt.DATABASE.RESTORE,{uid:n}),{data:s}=await Xe.post(t,e);return s}class yt{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,t,s){[e,t]=ja(this,e,t);let i=[];return this.decompose(0,e,i,2),s.length&&s.decompose(0,s.length,i,3),this.decompose(t,this.length,i,1),Vi.from(i,this.length-(t-e)+s.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=ja(this,e,t);let s=[];return this.decompose(e,t,s,0),Vi.from(s,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),s=this.length-this.scanIdentical(e,-1),i=new gu(this),r=new gu(e);for(let o=t,l=t;;){if(i.next(o),r.next(o),o=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(l+=i.value.length,i.done||l>=s)return!0}}iter(e=1){return new gu(this,e)}iterRange(e,t=this.length){return new w2(this,e,t)}iterLines(e,t){let s;if(e==null)s=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;s=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new S2(s)}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]?yt.empty:e.length<=32?new Qt(e):Vi.from(Qt.split(e,[]))}}class Qt extends yt{constructor(e,t=$G(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,s,i){for(let r=0;;r++){let o=this.text[r],l=i+o.length;if((t?s:l)>=e)return new BG(i,l,s,o);i=l+1,s++}}decompose(e,t,s,i){let r=e<=0&&t>=this.length?this:new Qt(mC(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let o=s.pop(),l=wd(r.text,o.text.slice(),0,r.length);if(l.length<=32)s.push(new Qt(l,o.length+r.length));else{let c=l.length>>1;s.push(new Qt(l.slice(0,c)),new Qt(l.slice(c)))}}else s.push(r)}replace(e,t,s){if(!(s instanceof Qt))return super.replace(e,t,s);[e,t]=ja(this,e,t);let i=wd(this.text,wd(s.text,mC(this.text,0,e)),t),r=this.length+s.length-(t-e);return i.length<=32?new Qt(i,r):Vi.from(Qt.split(i,[]),r)}sliceString(e,t=this.length,s=`
`){[e,t]=ja(this,e,t);let i="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],c=r+l.length;r>e&&o&&(i+=s),e<c&&t>r&&(i+=l.slice(Math.max(0,e-r),t-r)),r=c+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let s=[],i=-1;for(let r of e)s.push(r),i+=r.length+1,s.length==32&&(t.push(new Qt(s,i)),s=[],i=-1);return i>-1&&t.push(new Qt(s,i)),t}}class Vi extends yt{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let s of e)this.lines+=s.lines}lineInner(e,t,s,i){for(let r=0;;r++){let o=this.children[r],l=i+o.length,c=s+o.lines-1;if((t?c:l)>=e)return o.lineInner(e,t,s,i);i=l+1,s=c+1}}decompose(e,t,s,i){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],c=o+l.length;if(e<=c&&t>=o){let f=i&((o<=e?1:0)|(c>=t?2:0));o>=e&&c<=t&&!f?s.push(l):l.decompose(e-o,t-o,s,f)}o=c+1}}replace(e,t,s){if([e,t]=ja(this,e,t),s.lines<this.lines)for(let i=0,r=0;i<this.children.length;i++){let o=this.children[i],l=r+o.length;if(e>=r&&t<=l){let c=o.replace(e-r,t-r,s),f=this.lines-o.lines+c.lines;if(c.lines<f>>4&&c.lines>f>>6){let h=this.children.slice();return h[i]=c,new Vi(h,this.length-(t-e)+s.length)}return super.replace(r,l,c)}r=l+1}return super.replace(e,t,s)}sliceString(e,t=this.length,s=`
`){[e,t]=ja(this,e,t);let i="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],c=o+l.length;o>e&&r&&(i+=s),e<c&&t>o&&(i+=l.sliceString(e-o,t-o,s)),o=c+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Vi))return 0;let s=0,[i,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,r+=t){if(i==o||r==l)return s;let c=this.children[i],f=e.children[r];if(c!=f)return s+c.scanIdentical(f,t);s+=c.length+1}}static from(e,t=e.reduce((s,i)=>s+i.length+1,-1)){let s=0;for(let m of e)s+=m.lines;if(s<32){let m=[];for(let y of e)y.flatten(m);return new Qt(m,t)}let i=Math.max(32,s>>5),r=i<<1,o=i>>1,l=[],c=0,f=-1,h=[];function d(m){let y;if(m.lines>r&&m instanceof Vi)for(let w of m.children)d(w);else m.lines>o&&(c>o||!c)?(g(),l.push(m)):m instanceof Qt&&c&&(y=h[h.length-1])instanceof Qt&&m.lines+y.lines<=32?(c+=m.lines,f+=m.length+1,h[h.length-1]=new Qt(y.text.concat(m.text),y.length+1+m.length)):(c+m.lines>i&&g(),c+=m.lines,f+=m.length+1,h.push(m))}function g(){c!=0&&(l.push(h.length==1?h[0]:Vi.from(h,f)),f=-1,c=h.length=0)}for(let m of e)d(m);return g(),l.length==1?l[0]:new Vi(l,t)}}yt.empty=new Qt([""],0);function $G(n){let e=-1;for(let t of n)e+=t.length+1;return e}function wd(n,e,t=0,s=1e9){for(let i=0,r=0,o=!0;r<n.length&&i<=s;r++){let l=n[r],c=i+l.length;c>=t&&(c>s&&(l=l.slice(0,s-i)),i<t&&(l=l.slice(t-i)),o?(e[e.length-1]+=l,o=!1):e.push(l)),i=c+1}return e}function mC(n,e,t){return wd(n,[""],e,t)}class gu{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Qt?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let s=this.nodes.length-1,i=this.nodes[s],r=this.offsets[s],o=r>>1,l=i instanceof Qt?i.text.length:i.children.length;if(o==(t>0?l:0)){if(s==0)return this.done=!0,this.value="",this;t>0&&this.offsets[s-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[s]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(i instanceof Qt){let c=i.text[o+(t<0?-1:0)];if(this.offsets[s]+=t,c.length>Math.max(0,e))return this.value=e==0?c:t>0?c.slice(e):c.slice(0,c.length-e),this;e-=c.length}else{let c=i.children[o+(t<0?-1:0)];e>c.length?(e-=c.length,this.offsets[s]+=t):(t<0&&this.offsets[s]--,this.nodes.push(c),this.offsets.push(t>0?1:(c instanceof Qt?c.text.length:c.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class w2{constructor(e,t,s){this.value="",this.done=!1,this.cursor=new gu(e,t>s?-1:1),this.pos=t>s?e.length:0,this.from=Math.min(t,s),this.to=Math.max(t,s)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let s=t<0?this.pos-this.from:this.to-this.pos;e>s&&(e=s),s-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=s?i:t<0?i.slice(i.length-s):i.slice(0,s),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 S2{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:s,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):s?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(yt.prototype[Symbol.iterator]=function(){return this.iter()},gu.prototype[Symbol.iterator]=w2.prototype[Symbol.iterator]=S2.prototype[Symbol.iterator]=function(){return this});class BG{constructor(e,t,s,i){this.from=e,this.to=t,this.number=s,this.text=i}get length(){return this.to-this.from}}function ja(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}let Ca="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;n<Ca.length;n++)Ca[n]+=Ca[n-1];function FG(n){for(let e=1;e<Ca.length;e+=2)if(Ca[e]>n)return Ca[e-1]<=n;return!1}function gC(n){return n>=127462&&n<=127487}const bC=8205;function Cn(n,e,t=!0,s=!0){return(t?x2:VG)(n,e,s)}function x2(n,e,t){if(e==n.length)return e;e&&_2(n.charCodeAt(e))&&E2(n.charCodeAt(e-1))&&e--;let s=xn(n,e);for(e+=js(s);e<n.length;){let i=xn(n,e);if(s==bC||i==bC||t&&FG(i))e+=js(i),s=i;else if(gC(i)){let r=0,o=e-2;for(;o>=0&&gC(xn(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function VG(n,e,t){for(;e>0;){let s=x2(n,e-2,t);if(s<e)return s;e--}return 0}function _2(n){return n>=56320&&n<57344}function E2(n){return n>=55296&&n<56320}function xn(n,e){let t=n.charCodeAt(e);if(!E2(t)||e+1==n.length)return t;let s=n.charCodeAt(e+1);return _2(s)?(t-55296<<10)+(s-56320)+65536:t}function Aw(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function js(n){return n<65536?1:2}const my=/\r\n?|\n/;var jn=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(jn||(jn={}));class Yi{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let s=this.sections[t+1];e+=s<0?this.sections[t]:s}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,s=0,i=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(s,i,r),i+=r):i+=o,s+=r}}iterChangedRanges(e,t=!1){gy(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let s=this.sections[t++],i=this.sections[t++];i<0?e.push(s,i):e.push(i,s)}return new Yi(e)}composeDesc(e){return this.empty?e:e.empty?this:C2(this,e)}mapDesc(e,t=!1){return e.empty?this:by(this,e,t)}mapPos(e,t=-1,s=jn.Simple){let i=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],c=this.sections[o++],f=i+l;if(c<0){if(f>e)return r+(e-i);r+=l}else{if(s!=jn.Simple&&f>=e&&(s==jn.TrackDel&&i<e&&f>e||s==jn.TrackBefore&&i<e||s==jn.TrackAfter&&f>e))return null;if(f>e||f==e&&t<0&&!l)return e==i||t<0?r:r+c;r+=c}i=f}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return r}touchesRange(e,t=e){for(let s=0,i=0;s<this.sections.length&&i<=t;){let r=this.sections[s++],o=this.sections[s++],l=i+r;if(o>=0&&i<=t&&l>=e)return i<e&&l>t?"cover":!0;i=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let s=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+s+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Yi(e)}static create(e){return new Yi(e)}}class ln extends Yi{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return gy(this,(t,s,i,r,o)=>e=e.replace(i,i+(s-t),o),!1),e}mapDesc(e,t=!1){return by(this,e,t,!0)}invert(e){let t=this.sections.slice(),s=[];for(let i=0,r=0;i<t.length;i+=2){let o=t[i],l=t[i+1];if(l>=0){t[i]=l,t[i+1]=o;let c=i>>1;for(;s.length<c;)s.push(yt.empty);s.push(o?e.slice(r,r+o):yt.empty)}r+=o}return new ln(t,s)}compose(e){return this.empty?e:e.empty?this:C2(this,e,!0)}map(e,t=!1){return e.empty?this:by(this,e,t,!0)}iterChanges(e,t=!1){gy(this,e,t)}get desc(){return Yi.create(this.sections)}filter(e){let t=[],s=[],i=[],r=new $u(this);e:for(let o=0,l=0;;){let c=o==e.length?1e9:e[o++];for(;l<c||l==c&&r.len==0;){if(r.done)break e;let h=Math.min(r.len,c-l);Rn(i,h,-1);let d=r.ins==-1?-1:r.off==0?r.ins:0;Rn(t,h,d),d>0&&go(s,t,r.text),r.forward(h),l+=h}let f=e[o++];for(;l<f;){if(r.done)break e;let h=Math.min(r.len,f-l);Rn(t,h,-1),Rn(i,h,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(h),l+=h}}return{changes:new ln(t,s),filtered:Yi.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let s=this.sections[t],i=this.sections[t+1];i<0?e.push(s):i==0?e.push([s]):e.push([s].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,s){let i=[],r=[],o=0,l=null;function c(h=!1){if(!h&&!i.length)return;o<t&&Rn(i,t-o,-1);let d=new ln(i,r);l=l?l.compose(d.map(l)):d,i=[],r=[],o=0}function f(h){if(Array.isArray(h))for(let d of h)f(d);else if(h instanceof ln){if(h.length!=t)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${t})`);c(),l=l?l.compose(h.map(l)):h}else{let{from:d,to:g=d,insert:m}=h;if(d>g||d<0||g>t)throw new RangeError(`Invalid change range ${d} to ${g} (in doc of length ${t})`);let y=m?typeof m=="string"?yt.of(m.split(s||my)):m:yt.empty,w=y.length;if(d==g&&w==0)return;d<o&&c(),d>o&&Rn(i,d-o,-1),Rn(i,g-d,w),go(r,i,y),o=g}}return f(e),c(!l),l}static empty(e){return new ln(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],s=[];for(let i=0;i<e.length;i++){let r=e[i];if(typeof r=="number")t.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!="number"||r.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;s.length<i;)s.push(yt.empty);s[i]=yt.of(r.slice(1)),t.push(r[0],s[i].length)}}}return new ln(t,s)}static createSet(e,t){return new ln(e,t)}}function Rn(n,e,t,s=!1){if(e==0&&t<=0)return;let i=n.length-2;i>=0&&t<=0&&t==n[i+1]?n[i]+=e:e==0&&n[i]==0?n[i+1]+=t:s?(n[i]+=e,n[i+1]+=t):n.push(e,t)}function go(n,e,t){if(t.length==0)return;let s=e.length-2>>1;if(s<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<s;)n.push(yt.empty);n.push(t)}}function gy(n,e,t){let s=n.inserted;for(let i=0,r=0,o=0;o<n.sections.length;){let l=n.sections[o++],c=n.sections[o++];if(c<0)i+=l,r+=l;else{let f=i,h=r,d=yt.empty;for(;f+=l,h+=c,c&&s&&(d=d.append(s[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],c=n.sections[o++];e(i,f,r,h,d),i=f,r=h}}}function by(n,e,t,s=!1){let i=[],r=s?[]:null,o=new $u(n),l=new $u(e);for(let c=-1;;)if(o.ins==-1&&l.ins==-1){let f=Math.min(o.len,l.len);Rn(i,f,-1),o.forward(f),l.forward(f)}else if(l.ins>=0&&(o.ins<0||c==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let f=l.len;for(Rn(i,l.ins,-1);f;){let h=Math.min(o.len,f);o.ins>=0&&c<o.i&&o.len<=h&&(Rn(i,0,o.ins),r&&go(r,i,o.text),c=o.i),o.forward(h),f-=h}l.next()}else if(o.ins>=0){let f=0,h=o.len;for(;h;)if(l.ins==-1){let d=Math.min(h,l.len);f+=d,h-=d,l.forward(d)}else if(l.ins==0&&l.len<h)h-=l.len,l.next();else break;Rn(i,f,c<o.i?o.ins:0),r&&c<o.i&&go(r,i,o.text),c=o.i,o.forward(o.len-h)}else{if(o.done&&l.done)return r?ln.createSet(i,r):Yi.create(i);throw new Error("Mismatched change set lengths")}}function C2(n,e,t=!1){let s=[],i=t?[]:null,r=new $u(n),o=new $u(e);for(let l=!1;;){if(r.done&&o.done)return i?ln.createSet(s,i):Yi.create(s);if(r.ins==0)Rn(s,r.len,0,l),r.next();else if(o.len==0&&!o.done)Rn(s,0,o.ins,l),i&&go(i,s,o.text),o.next();else{if(r.done||o.done)throw new Error("Mismatched change set lengths");{let c=Math.min(r.len2,o.len),f=s.length;if(r.ins==-1){let h=o.ins==-1?-1:o.off?0:o.ins;Rn(s,c,h,l),i&&h&&go(i,s,o.text)}else o.ins==-1?(Rn(s,r.off?0:r.len,c,l),i&&go(i,s,r.textBit(c))):(Rn(s,r.off?0:r.len,o.off?0:o.ins,l),i&&!o.off&&go(i,s,o.text));l=(r.ins>c||o.ins>=0&&o.len>c)&&(l||s.length>f),r.forward2(c),o.forward(c)}}}}class $u{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,t=this.i-2>>1;return t>=e.length?yt.empty:e[t]}textBit(e){let{inserted:t}=this.set,s=this.i-2>>1;return s>=t.length&&!e?yt.empty:t[s].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 il{constructor(e,t,s){this.from=e,this.to=t,this.flags=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 bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let s,i;return this.empty?s=i=e.mapPos(this.from,t):(s=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),s==this.from&&i==this.to?this:new il(s,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return le.range(e,t);let s=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return le.range(this.anchor,s)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!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 le.range(e.anchor,e.head)}static create(e,t,s){return new il(e,t,s)}}class le{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:le.create(this.ranges.map(s=>s.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let s=0;s<this.ranges.length;s++)if(!this.ranges[s].eq(e.ranges[s],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new le([this.main],0)}addRange(e,t=!0){return le.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let s=this.ranges.slice();return s[t]=e,le.create(s,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 le(e.ranges.map(t=>il.fromJSON(t)),e.main)}static single(e,t=e){return new le([le.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let s=0,i=0;i<e.length;i++){let r=e[i];if(r.empty?r.from<=s:r.from<s)return le.normalized(e.slice(),t);s=r.to}return new le(e,t)}static cursor(e,t=0,s,i){return il.create(e,e,(t==0?0:t<0?8:16)|(s==null?7:Math.min(6,s))|(i??16777215)<<6)}static range(e,t,s,i){let r=(s??16777215)<<6|(i==null?7:Math.min(6,i));return t<e?il.create(t,e,48|r):il.create(e,t,(t>e?8:0)|r)}static normalized(e,t=0){let s=e[t];e.sort((i,r)=>i.from-r.from),t=e.indexOf(s);for(let i=1;i<e.length;i++){let r=e[i],o=e[i-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,c=Math.max(r.to,o.to);i<=t&&t--,e.splice(--i,2,r.anchor>r.head?le.range(c,l):le.range(l,c))}}return new le(e,t)}}function A2(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let kw=0;class Re{constructor(e,t,s,i,r){this.combine=e,this.compareInput=t,this.compare=s,this.isStatic=i,this.id=kw++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new Re(e.combine||(t=>t),e.compareInput||((t,s)=>t===s),e.compare||(e.combine?(t,s)=>t===s:Tw),!!e.static,e.enables)}of(e){return new Sd([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Sd(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Sd(e,this,2,t)}from(e,t){return t||(t=s=>s),this.compute([e],s=>t(s.field(e)))}}function Tw(n,e){return n==e||n.length==e.length&&n.every((t,s)=>t===e[s])}class Sd{constructor(e,t,s,i){this.dependencies=e,this.facet=t,this.type=s,this.value=i,this.id=kw++}dynamicSlot(e){var t;let s=this.value,i=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,c=!1,f=!1,h=[];for(let d of this.dependencies)d=="doc"?c=!0:d=="selection"?f=!0:(((t=e[d.id])!==null&&t!==void 0?t:1)&1)==0&&h.push(e[d.id]);return{create(d){return d.values[o]=s(d),1},update(d,g){if(c&&g.docChanged||f&&(g.docChanged||g.selection)||yy(d,h)){let m=s(d);if(l?!yC(m,d.values[o],i):!i(m,d.values[o]))return d.values[o]=m,1}return 0},reconfigure:(d,g)=>{let m,y=g.config.address[r];if(y!=null){let w=fp(g,y);if(this.dependencies.every(x=>x instanceof Re?g.facet(x)===d.facet(x):x instanceof un?g.field(x,!1)==d.field(x,!1):!0)||(l?yC(m=s(d),w,i):i(m=s(d),w)))return d.values[o]=w,0}else m=s(d);return d.values[o]=m,1}}}}function yC(n,e,t){if(n.length!=e.length)return!1;for(let s=0;s<n.length;s++)if(!t(n[s],e[s]))return!1;return!0}function yy(n,e){let t=!1;for(let s of e)bu(n,s)&1&&(t=!0);return t}function WG(n,e,t){let s=t.map(c=>n[c.id]),i=t.map(c=>c.type),r=s.filter(c=>!(c&1)),o=n[e.id]>>1;function l(c){let f=[];for(let h=0;h<s.length;h++){let d=fp(c,s[h]);if(i[h]==2)for(let g of d)f.push(g);else f.push(d)}return e.combine(f)}return{create(c){for(let f of s)bu(c,f);return c.values[o]=l(c),1},update(c,f){if(!yy(c,r))return 0;let h=l(c);return e.compare(h,c.values[o])?0:(c.values[o]=h,1)},reconfigure(c,f){let h=yy(c,s),d=f.config.facets[e.id],g=f.facet(e);if(d&&!h&&Tw(t,d))return c.values[o]=g,0;let m=l(c);return e.compare(m,g)?(c.values[o]=g,0):(c.values[o]=m,1)}}}const vC=Re.define({static:!0});class un{constructor(e,t,s,i,r){this.id=e,this.createF=t,this.updateF=s,this.compareF=i,this.spec=r,this.provides=void 0}static define(e){let t=new un(kw++,e.create,e.update,e.compare||((s,i)=>s===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(vC).find(s=>s.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:s=>(s.values[t]=this.create(s),1),update:(s,i)=>{let r=s.values[t],o=this.updateF(r,i);return this.compareF(r,o)?0:(s.values[t]=o,1)},reconfigure:(s,i)=>i.config.address[this.id]!=null?(s.values[t]=i.field(this),0):(s.values[t]=this.create(s),1)}}init(e){return[this,vC.of({field:this,create:e})]}get extension(){return this}}const Jo={lowest:4,low:3,default:2,high:1,highest:0};function Bc(n){return e=>new k2(e,n)}const kl={highest:Bc(Jo.highest),high:Bc(Jo.high),default:Bc(Jo.default),low:Bc(Jo.low),lowest:Bc(Jo.lowest)};class k2{constructor(e,t){this.inner=e,this.prec=t}}class mm{of(e){return new vy(this,e)}reconfigure(e){return mm.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class vy{constructor(e,t){this.compartment=e,this.inner=t}}class up{constructor(e,t,s,i,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=s,this.address=i,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<s.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,s){let i=[],r=Object.create(null),o=new Map;for(let g of HG(e,t,o))g instanceof un?i.push(g):(r[g.facet.id]||(r[g.facet.id]=[])).push(g);let l=Object.create(null),c=[],f=[];for(let g of i)l[g.id]=f.length<<1,f.push(m=>g.slot(m));let h=s?.config.facets;for(let g in r){let m=r[g],y=m[0].facet,w=h&&h[g]||[];if(m.every(x=>x.type==0))if(l[y.id]=c.length<<1|1,Tw(w,m))c.push(s.facet(y));else{let x=y.combine(m.map(S=>S.value));c.push(s&&y.compare(x,s.facet(y))?s.facet(y):x)}else{for(let x of m)x.type==0?(l[x.id]=c.length<<1|1,c.push(x.value)):(l[x.id]=f.length<<1,f.push(S=>x.dynamicSlot(S)));l[y.id]=f.length<<1,f.push(x=>WG(x,y,m))}}let d=f.map(g=>g(l));return new up(e,o,d,l,c,r)}}function HG(n,e,t){let s=[[],[],[],[],[]],i=new Map;function r(o,l){let c=i.get(o);if(c!=null){if(c<=l)return;let f=s[c].indexOf(o);f>-1&&s[c].splice(f,1),o instanceof vy&&t.delete(o.compartment)}if(i.set(o,l),Array.isArray(o))for(let f of o)r(f,l);else if(o instanceof vy){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let f=e.get(o.compartment)||o.inner;t.set(o.compartment,f),r(f,l)}else if(o instanceof k2)r(o.inner,o.prec);else if(o instanceof un)s[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Sd)s[l].push(o),o.facet.extensions&&r(o.facet.extensions,Jo.default);else{let f=o.extension;if(!f)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(f,l)}}return r(n,Jo.default),s.reduce((o,l)=>o.concat(l))}function bu(n,e){if(e&1)return 2;let t=e>>1,s=n.status[t];if(s==4)throw new Error("Cyclic dependency between fields and/or facets");if(s&2)return s;n.status[t]=4;let i=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|i}function fp(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const T2=Re.define(),wy=Re.define({combine:n=>n.some(e=>e),static:!0}),O2=Re.define({combine:n=>n.length?n[0]:void 0,static:!0}),R2=Re.define(),M2=Re.define(),D2=Re.define(),L2=Re.define({combine:n=>n.length?n[0]:!1});class Wr{constructor(e,t){this.type=e,this.value=t}static define(){return new UG}}class UG{of(e){return new Wr(this,e)}}class zG{constructor(e){this.map=e}of(e){return new tt(this,e)}}class tt{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new tt(this.type,t)}is(e){return this.type==e}static define(e={}){return new zG(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let s=[];for(let i of e){let r=i.map(t);r&&s.push(r)}return s}}tt.reconfigure=tt.define();tt.appendConfig=tt.define();class an{constructor(e,t,s,i,r,o){this.startState=e,this.changes=t,this.selection=s,this.effects=i,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,s&&A2(s,t.newLength),r.some(l=>l.type==an.time)||(this.annotations=r.concat(an.time.of(Date.now())))}static create(e,t,s,i,r,o){return new an(e,t,s,i,r,o)}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 t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(an.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}an.time=Wr.define();an.userEvent=Wr.define();an.addToHistory=Wr.define();an.remote=Wr.define();function qG(n,e){let t=[];for(let s=0,i=0;;){let r,o;if(s<n.length&&(i==e.length||e[i]>=n[s]))r=n[s++],o=n[s++];else if(i<e.length)r=e[i++],o=e[i++];else return t;!t.length||t[t.length-1]<r?t.push(r,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function N2(n,e,t){var s;let i,r,o;return t?(i=e.changes,r=ln.empty(e.changes.length),o=n.changes.compose(e.changes)):(i=e.changes.map(n.changes),r=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(i)),{changes:o,selection:e.selection?e.selection.map(r):(s=n.selection)===null||s===void 0?void 0:s.map(i),effects:tt.mapEffects(n.effects,i).concat(tt.mapEffects(e.effects,r)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function Sy(n,e,t){let s=e.selection,i=Aa(e.annotations);return e.userEvent&&(i=i.concat(an.userEvent.of(e.userEvent))),{changes:e.changes instanceof ln?e.changes:ln.of(e.changes||[],t,n.facet(O2)),selection:s&&(s instanceof le?s:le.single(s.anchor,s.head)),effects:Aa(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function I2(n,e,t){let s=Sy(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let r=1;r<e.length;r++){e[r].filter===!1&&(t=!1);let o=!!e[r].sequential;s=N2(s,Sy(n,e[r],o?s.changes.newLength:n.doc.length),o)}let i=an.create(n,s.changes,s.selection,s.effects,s.annotations,s.scrollIntoView);return jG(t?KG(i):i)}function KG(n){let e=n.startState,t=!0;for(let i of e.facet(R2)){let r=i(n);if(r===!1){t=!1;break}Array.isArray(r)&&(t=t===!0?r:qG(t,r))}if(t!==!0){let i,r;if(t===!1)r=n.changes.invertedDesc,i=ln.empty(e.doc.length);else{let o=n.changes.filter(t);i=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}n=an.create(e,i,n.selection&&n.selection.map(r),tt.mapEffects(n.effects,r),n.annotations,n.scrollIntoView)}let s=e.facet(M2);for(let i=s.length-1;i>=0;i--){let r=s[i](n);r instanceof an?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof an?n=r[0]:n=I2(e,Aa(r),!1)}return n}function jG(n){let e=n.startState,t=e.facet(D2),s=n;for(let i=t.length-1;i>=0;i--){let r=t[i](n);r&&Object.keys(r).length&&(s=N2(s,Sy(e,r,n.changes.newLength),!0))}return s==n?n:an.create(e,n.changes,n.selection,s.effects,s.annotations,s.scrollIntoView)}const GG=[];function Aa(n){return n==null?GG:Array.isArray(n)?n:[n]}var Ut=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(Ut||(Ut={}));const YG=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let xy;try{xy=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function XG(n){if(xy)return xy.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||YG.test(t)))return!0}return!1}function QG(n){return e=>{if(!/\S/.test(e))return Ut.Space;if(XG(e))return Ut.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return Ut.Word;return Ut.Other}}class bt{constructor(e,t,s,i,r,o){this.config=e,this.doc=t,this.selection=s,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)bu(this,l<<1);this.computeSlot=null}field(e,t=!0){let s=this.config.address[e.id];if(s==null){if(t)throw new RangeError("Field is not present in this state");return}return bu(this,s),fp(this,s)}update(...e){return I2(this,e,!0)}applyTransaction(e){let t=this.config,{base:s,compartments:i}=t;for(let l of e.effects)l.is(mm.reconfigure)?(t&&(i=new Map,t.compartments.forEach((c,f)=>i.set(f,c)),t=null),i.set(l.value.compartment,l.value.extension)):l.is(tt.reconfigure)?(t=null,s=l.value):l.is(tt.appendConfig)&&(t=null,s=Aa(s).concat(l.value));let r;t?r=e.startState.values.slice():(t=up.resolve(s,i,this),r=new bt(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(c,f)=>f.reconfigure(c,this),null).values);let o=e.startState.facet(wy)?e.newSelection:e.newSelection.asSingle();new bt(t,e.newDoc,o,r,(l,c)=>c.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:le.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,s=e(t.ranges[0]),i=this.changes(s.changes),r=[s.range],o=Aa(s.effects);for(let l=1;l<t.ranges.length;l++){let c=e(t.ranges[l]),f=this.changes(c.changes),h=f.map(i);for(let g=0;g<l;g++)r[g]=r[g].map(h);let d=i.mapDesc(f,!0);r.push(c.range.map(d)),i=i.compose(h),o=tt.mapEffects(o,h).concat(tt.mapEffects(Aa(c.effects),d))}return{changes:i,selection:le.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof ln?e:ln.of(e,this.doc.length,this.facet(bt.lineSeparator))}toText(e){return yt.of(e.split(this.facet(bt.lineSeparator)||my))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(bu(this,t),fp(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let s in e){let i=e[s];i instanceof un&&this.config.address[i.id]!=null&&(t[s]=i.spec.toJSON(this.field(e[s]),this))}return t}static fromJSON(e,t={},s){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(s){for(let r in s)if(Object.prototype.hasOwnProperty.call(e,r)){let o=s[r],l=e[r];i.push(o.init(c=>o.spec.fromJSON(l,c)))}}return bt.create({doc:e.doc,selection:le.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=up.resolve(e.extensions||[],new Map),s=e.doc instanceof yt?e.doc:yt.of((e.doc||"").split(t.staticFacet(bt.lineSeparator)||my)),i=e.selection?e.selection instanceof le?e.selection:le.single(e.selection.anchor,e.selection.head):le.single(0);return A2(i,s.length),t.staticFacet(wy)||(i=i.asSingle()),new bt(t,s,i,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(bt.tabSize)}get lineBreak(){return this.facet(bt.lineSeparator)||`
`}get readOnly(){return this.facet(L2)}phrase(e,...t){for(let s of this.facet(bt.phrases))if(Object.prototype.hasOwnProperty.call(s,e)){e=s[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(s,i)=>{if(i=="$")return"$";let r=+(i||1);return!r||r>t.length?s:t[r-1]})),e}languageDataAt(e,t,s=-1){let i=[];for(let r of this.facet(T2))for(let o of r(this,t,s))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){return QG(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:s,length:i}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-s,l=e-s;for(;o>0;){let c=Cn(t,o,!1);if(r(t.slice(c,o))!=Ut.Word)break;o=c}for(;l<i;){let c=Cn(t,l);if(r(t.slice(l,c))!=Ut.Word)break;l=c}return o==l?null:le.range(o+s,l+s)}}bt.allowMultipleSelections=wy;bt.tabSize=Re.define({combine:n=>n.length?n[0]:4});bt.lineSeparator=O2;bt.readOnly=L2;bt.phrases=Re.define({compare(n,e){let t=Object.keys(n),s=Object.keys(e);return t.length==s.length&&t.every(i=>n[i]==e[i])}});bt.languageData=T2;bt.changeFilter=R2;bt.transactionFilter=M2;bt.transactionExtender=D2;mm.reconfigure=tt.define();function Ei(n,e,t={}){let s={};for(let i of n)for(let r of Object.keys(i)){let o=i[r],l=s[r];if(l===void 0)s[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))s[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let i in e)s[i]===void 0&&(s[i]=e[i]);return s}class yl{eq(e){return this==e}range(e,t=e){return _y.create(e,t,this)}}yl.prototype.startSide=yl.prototype.endSide=0;yl.prototype.point=!1;yl.prototype.mapMode=jn.TrackDel;let _y=class P2{constructor(e,t,s){this.from=e,this.to=t,this.value=s}static create(e,t,s){return new P2(e,t,s)}};function Ey(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Ow{constructor(e,t,s,i){this.from=e,this.to=t,this.value=s,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,s,i=0){let r=s?this.to:this.from;for(let o=i,l=r.length;;){if(o==l)return o;let c=o+l>>1,f=r[c]-e||(s?this.value[c].endSide:this.value[c].startSide)-t;if(c==o)return f>=0?o:l;f>=0?l=c:o=c+1}}between(e,t,s,i){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(s,1e9,!1,r);r<o;r++)if(i(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,t){let s=[],i=[],r=[],o=-1,l=-1;for(let c=0;c<this.value.length;c++){let f=this.value[c],h=this.from[c]+e,d=this.to[c]+e,g,m;if(h==d){let y=t.mapPos(h,f.startSide,f.mapMode);if(y==null||(g=m=y,f.startSide!=f.endSide&&(m=t.mapPos(h,f.endSide),m<g)))continue}else if(g=t.mapPos(h,f.startSide),m=t.mapPos(d,f.endSide),g>m||g==m&&f.startSide>0&&f.endSide<=0)continue;(m-g||f.endSide-f.startSide)<0||(o<0&&(o=g),f.point&&(l=Math.max(l,m-g)),s.push(f),i.push(g-o),r.push(m-o))}return{mapped:s.length?new Ow(i,r,s,l):null,pos:o}}}class pt{constructor(e,t,s,i){this.chunkPos=e,this.chunk=t,this.nextLayer=s,this.maxPoint=i}static create(e,t,s,i){return new pt(e,t,s,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:s=!1,filterFrom:i=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(s&&(t=t.slice().sort(Ey)),this.isEmpty)return t.length?pt.of(t):this;let l=new $2(this,null,-1).goto(0),c=0,f=[],h=new $r;for(;l.value||c<t.length;)if(c<t.length&&(l.from-t[c].from||l.startSide-t[c].value.startSide)>=0){let d=t[c++];h.addInner(d.from,d.to,d.value)||f.push(d)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(c==t.length||this.chunkEnd(l.chunkIndex)<t[c].from)&&(!o||i>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&h.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||i>l.to||r<l.from||o(l.from,l.to,l.value))&&(h.addInner(l.from,l.to,l.value)||f.push(_y.create(l.from,l.to,l.value))),l.next());return h.finishInner(this.nextLayer.isEmpty&&!f.length?pt.empty:this.nextLayer.update({add:f,filter:o,filterFrom:i,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],s=[],i=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],c=this.chunk[o],f=e.touchesRange(l,l+c.length);if(f===!1)i=Math.max(i,c.maxPoint),t.push(c),s.push(e.mapPos(l));else if(f===!0){let{mapped:h,pos:d}=c.map(l,e);h&&(i=Math.max(i,h.maxPoint),t.push(h),s.push(d))}}let r=this.nextLayer.map(e);return t.length==0?r:new pt(s,t,r||pt.empty,i)}between(e,t,s){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let r=this.chunkPos[i],o=this.chunk[i];if(t>=r&&e<=r+o.length&&o.between(r,e-r,t-r,s)===!1)return}this.nextLayer.between(e,t,s)}}iter(e=0){return Bu.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Bu.from(e).goto(t)}static compare(e,t,s,i,r=-1){let o=e.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=r),l=t.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=r),c=wC(o,l,s),f=new Fc(o,c,r),h=new Fc(l,c,r);s.iterGaps((d,g,m)=>SC(f,d,h,g,m,i)),s.empty&&s.length==0&&SC(f,0,h,0,0,i)}static eq(e,t,s=0,i){i==null&&(i=999999999);let r=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),o=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=wC(r,o),c=new Fc(r,l,0).goto(s),f=new Fc(o,l,0).goto(s);for(;;){if(c.to!=f.to||!Cy(c.active,f.active)||c.point&&(!f.point||!c.point.eq(f.point)))return!1;if(c.to>i)return!0;c.next(),f.next()}}static spans(e,t,s,i,r=-1){let o=new Fc(e,null,r).goto(t),l=t,c=o.openStart;for(;;){let f=Math.min(o.to,s);if(o.point){let h=o.activeForPoint(o.to),d=o.pointFrom<t?h.length+1:o.point.startSide<0?h.length:Math.min(h.length,c);i.point(l,f,o.point,h,d,o.pointRank),c=Math.min(o.openEnd(f),h.length)}else f>l&&(i.span(l,f,o.active,c),c=o.openEnd(f));if(o.to>s)return c+(o.point&&o.to>s?1:0);l=o.to,o.next()}}static of(e,t=!1){let s=new $r;for(let i of e instanceof _y?[e]:t?JG(e):e)s.add(i.from,i.to,i.value);return s.finish()}static join(e){if(!e.length)return pt.empty;let t=e[e.length-1];for(let s=e.length-2;s>=0;s--)for(let i=e[s];i!=pt.empty;i=i.nextLayer)t=new pt(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}pt.empty=new pt([],[],null,-1);function JG(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let s=n[t];if(Ey(e,s)>0)return n.slice().sort(Ey);e=s}return n}pt.empty.nextLayer=pt.empty;class $r{finishChunk(e){this.chunks.push(new Ow(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,t,s){this.addInner(e,t,s)||(this.nextLayer||(this.nextLayer=new $r)).add(e,t,s)}addInner(e,t,s){let i=e-this.lastTo||s.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||s.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=s,this.lastFrom=e,this.lastTo=t,this.value.push(s),s.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let s=t.value.length-1;return this.last=t.value[s],this.lastFrom=t.from[s]+e,this.lastTo=t.to[s]+e,!0}finish(){return this.finishInner(pt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=pt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function wC(n,e,t){let s=new Map;for(let r of n)for(let o=0;o<r.chunk.length;o++)r.chunk[o].maxPoint<=0&&s.set(r.chunk[o],r.chunkPos[o]);let i=new Set;for(let r of e)for(let o=0;o<r.chunk.length;o++){let l=s.get(r.chunk[o]);l!=null&&(t?t.mapPos(l):l)==r.chunkPos[o]&&!t?.touchesRange(l,l+r.chunk[o].length)&&i.add(r.chunk[o])}return i}class $2{constructor(e,t,s,i=0){this.layer=e,this.skip=t,this.minPoint=s,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,s){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,s=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!s||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!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],t=this.layer.chunk[this.chunkIndex],s=e+t.from[this.rangeIndex];if(this.from=s,this.to=e+t.to[this.rangeIndex],this.value=t.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 Bu{constructor(e){this.heap=e}static from(e,t=null,s=-1){let i=[];for(let r=0;r<e.length;r++)for(let o=e[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=s&&i.push(new $2(o,t,s,r));return i.length==1?i[0]:new Bu(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let s of this.heap)s.goto(e,t);for(let s=this.heap.length>>1;s>=0;s--)qb(this.heap,s);return this.next(),this}forward(e,t){for(let s of this.heap)s.forward(e,t);for(let s=this.heap.length>>1;s>=0;s--)qb(this.heap,s);(this.to-e||this.value.endSide-t)<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(),qb(this.heap,0)}}}function qb(n,e){for(let t=n[e];;){let s=(e<<1)+1;if(s>=n.length)break;let i=n[s];if(s+1<n.length&&i.compare(n[s+1])>=0&&(i=n[s+1],s++),t.compare(i)<0)break;n[s]=t,n[e]=i,e=s}}class Fc{constructor(e,t,s){this.minPoint=s,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=Bu.from(e,t,s)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Lh(this.active,e),Lh(this.activeTo,e),Lh(this.activeRank,e),this.minActive=xC(this.active,this.activeTo)}addActive(e){let t=0,{value:s,to:i,rank:r}=this.cursor;for(;t<this.activeRank.length&&(r-this.activeRank[t]||i-this.activeTo[t])>0;)t++;Nh(this.active,t,s),Nh(this.activeTo,t,i),Nh(this.activeRank,t,r),e&&Nh(e,t,this.cursor.from),this.minActive=xC(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let s=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),s&&Lh(s,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(s),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=r,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=r.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(s){this.openStart=0;for(let i=s.length-1;i>=0&&s[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let s=this.active.length-1;s>=0&&!(this.activeRank[s]<this.pointRank);s--)(this.activeTo[s]>e||this.activeTo[s]==e&&this.active[s].endSide>=this.point.endSide)&&t.push(this.active[s]);return t.reverse()}openEnd(e){let t=0;for(let s=this.activeTo.length-1;s>=0&&this.activeTo[s]>e;s--)t++;return t}}function SC(n,e,t,s,i,r){n.goto(e),t.goto(s);let o=s+i,l=s,c=s-e;for(;;){let f=n.to+c-t.to||n.endSide-t.endSide,h=f<0?n.to+c:t.to,d=Math.min(h,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&Cy(n.activeForPoint(n.to),t.activeForPoint(t.to))||r.comparePoint(l,d,n.point,t.point):d>l&&!Cy(n.active,t.active)&&r.compareRange(l,d,n.active,t.active),h>o)break;l=h,f<=0&&n.next(),f>=0&&t.next()}}function Cy(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!n[t].eq(e[t]))return!1;return!0}function Lh(n,e){for(let t=e,s=n.length-1;t<s;t++)n[t]=n[t+1];n.pop()}function Nh(n,e,t){for(let s=n.length-1;s>=e;s--)n[s+1]=n[s];n[e]=t}function xC(n,e){let t=-1,s=1e9;for(let i=0;i<e.length;i++)(e[i]-s||n[i].endSide-n[t].endSide)<0&&(t=i,s=e[i]);return t}function ac(n,e,t=n.length){let s=0;for(let i=0;i<t;)n.charCodeAt(i)==9?(s+=e-s%e,i++):(s++,i=Cn(n,i));return s}function Ay(n,e,t,s){for(let i=0,r=0;;){if(r>=e)return i;if(i==n.length)break;r+=n.charCodeAt(i)==9?t-r%t:1,i=Cn(n,i)}return s===!0?-1:n.length}const ky="ͼ",_C=typeof Symbol>"u"?"__"+ky:Symbol.for(ky),Ty=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),EC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Ao{constructor(e,t){this.rules=[];let{finish:s}=t||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,c,f){let h=[],d=/^@(\w+)\b/.exec(o[0]),g=d&&d[1]=="keyframes";if(d&&l==null)return c.push(o[0]+";");for(let m in l){let y=l[m];if(/&/.test(m))r(m.split(/,\s*/).map(w=>o.map(x=>w.replace(/&/,x))).reduce((w,x)=>w.concat(x)),y,c);else if(y&&typeof y=="object"){if(!d)throw new RangeError("The value of a property ("+m+") should be a primitive value.");r(i(m),y,h,g)}else y!=null&&h.push(m.replace(/_.*/,"").replace(/[A-Z]/g,w=>"-"+w.toLowerCase())+": "+y+";")}(h.length||g)&&c.push((s&&!d&&!f?o.map(s):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)r(i(o),e[o],this.rules)}getRules(){return this.rules.join(`
`)}static newName(){let e=EC[_C]||1;return EC[_C]=e+1,ky+e.toString(36)}static mount(e,t,s){let i=e[Ty],r=s&&s.nonce;i?r&&i.setNonce(r):i=new ZG(e,r),i.mount(Array.isArray(t)?t:[t],e)}}let CC=new Map;class ZG{constructor(e,t){let s=e.ownerDocument||e,i=s.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let r=CC.get(s);if(r)return e[Ty]=r;this.sheet=new i.CSSStyleSheet,CC.set(s,this)}else this.styleTag=s.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Ty]=this}mount(e,t){let s=this.sheet,i=0,r=0;for(let o=0;o<e.length;o++){let l=e[o],c=this.modules.indexOf(l);if(c<r&&c>-1&&(this.modules.splice(c,1),r--,c=-1),c==-1){if(this.modules.splice(r++,0,l),s)for(let f=0;f<l.rules.length;f++)s.insertRule(l.rules[f],i++)}else{for(;r<c;)i+=this.modules[r++].rules.length;i+=l.rules.length,r++}}if(s)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let c=0;c<this.modules.length;c++)o+=this.modules[c].getRules()+`
`;this.styleTag.textContent=o;let l=t.head||t;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var ko={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:"'"},Fu={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},eY=typeof navigator<"u"&&/Mac/.test(navigator.platform),tY=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var _n=0;_n<10;_n++)ko[48+_n]=ko[96+_n]=String(_n);for(var _n=1;_n<=24;_n++)ko[_n+111]="F"+_n;for(var _n=65;_n<=90;_n++)ko[_n]=String.fromCharCode(_n+32),Fu[_n]=String.fromCharCode(_n);for(var Kb in ko)Fu.hasOwnProperty(Kb)||(Fu[Kb]=ko[Kb]);function nY(n){var e=eY&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||tY&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Fu:ko)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Vu(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Oy(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function xd(n,e){if(!e.anchorNode)return!1;try{return Oy(n,e.anchorNode)}catch{return!1}}function Wu(n){return n.nodeType==3?wl(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function yu(n,e,t,s){return t?AC(n,e,t,s,-1)||AC(n,e,t,s,1):!1}function vl(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function hp(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function AC(n,e,t,s,i){for(;;){if(n==t&&e==s)return!0;if(e==(i<0?0:Ji(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=vl(n)+(i<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=i<0?Ji(n):0}else return!1}}function Ji(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function gm(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function sY(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function B2(n,e){let t=e.width/n.offsetWidth,s=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(s>.995&&s<1.005||!isFinite(s)||Math.abs(e.height-n.offsetHeight)<1)&&(s=1),{scaleX:t,scaleY:s}}function iY(n,e,t,s,i,r,o,l){let c=n.ownerDocument,f=c.defaultView||window;for(let h=n,d=!1;h&&!d;)if(h.nodeType==1){let g,m=h==c.body,y=1,w=1;if(m)g=sY(f);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(d=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let C=h.getBoundingClientRect();({scaleX:y,scaleY:w}=B2(h,C)),g={left:C.left,right:C.left+h.clientWidth*y,top:C.top,bottom:C.top+h.clientHeight*w}}let x=0,S=0;if(i=="nearest")e.top<g.top?(S=-(g.top-e.top+o),t>0&&e.bottom>g.bottom+S&&(S=e.bottom-g.bottom+S+o)):e.bottom>g.bottom&&(S=e.bottom-g.bottom+o,t<0&&e.top-S<g.top&&(S=-(g.top+S-e.top+o)));else{let C=e.bottom-e.top,E=g.bottom-g.top;S=(i=="center"&&C<=E?e.top+C/2-E/2:i=="start"||i=="center"&&t<0?e.top-o:e.bottom-E+o)-g.top}if(s=="nearest"?e.left<g.left?(x=-(g.left-e.left+r),t>0&&e.right>g.right+x&&(x=e.right-g.right+x+r)):e.right>g.right&&(x=e.right-g.right+r,t<0&&e.left<g.left+x&&(x=-(g.left+x-e.left+r))):x=(s=="center"?e.left+(e.right-e.left)/2-(g.right-g.left)/2:s=="start"==l?e.left-r:e.right-(g.right-g.left)+r)-g.left,x||S)if(m)f.scrollBy(x,S);else{let C=0,E=0;if(S){let k=h.scrollTop;h.scrollTop+=S/w,E=(h.scrollTop-k)*w}if(x){let k=h.scrollLeft;h.scrollLeft+=x/y,C=(h.scrollLeft-k)*y}e={left:e.left-C,top:e.top-E,right:e.right-C,bottom:e.bottom-E},C&&Math.abs(C-x)<1&&(s="nearest"),E&&Math.abs(E-S)<1&&(i="nearest")}if(m)break;h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function rY(n){let e=n.ownerDocument,t,s;for(let i=n.parentNode;i&&!(i==e.body||t&&s);)if(i.nodeType==1)!s&&i.scrollHeight>i.clientHeight&&(s=i),!t&&i.scrollWidth>i.clientWidth&&(t=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:t,y:s}}class oY{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:t,focusNode:s}=e;this.set(t,Math.min(e.anchorOffset,t?Ji(t):0),s,Math.min(e.focusOffset,s?Ji(s):0))}set(e,t,s,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=s,this.focusOffset=i}}let Jl=null;function F2(n){if(n.setActive)return n.setActive();if(Jl)return n.focus(Jl);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Jl==null?{get preventScroll(){return Jl={preventScroll:!0},!0}}:void 0),!Jl){Jl=!1;for(let t=0;t<e.length;){let s=e[t++],i=e[t++],r=e[t++];s.scrollTop!=i&&(s.scrollTop=i),s.scrollLeft!=r&&(s.scrollLeft=r)}}}let kC;function wl(n,e,t=e){let s=kC||(kC=document.createRange());return s.setEnd(n,t),s.setStart(n,e),s}function ka(n,e,t,s){let i={key:e,code:e,keyCode:t,which:t,cancelable:!0};s&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=s);let r=new KeyboardEvent("keydown",i);r.synthetic=!0,n.dispatchEvent(r);let o=new KeyboardEvent("keyup",i);return o.synthetic=!0,n.dispatchEvent(o),r.defaultPrevented||o.defaultPrevented}function lY(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function V2(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}function aY(n,e){let t=e.focusNode,s=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=s)return!1;for(s=Math.min(s,Ji(t));;)if(s){if(t.nodeType!=1)return!1;let i=t.childNodes[s-1];i.contentEditable=="false"?s--:(t=i,s=Ji(t))}else{if(t==n)return!0;s=vl(t),t=t.parentNode}}function W2(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function H2(n,e){for(let t=n,s=e;;){if(t.nodeType==3&&s>0)return{node:t,offset:s};if(t.nodeType==1&&s>0){if(t.contentEditable=="false")return null;t=t.childNodes[s-1],s=Ji(t)}else if(t.parentNode&&!hp(t))s=vl(t),t=t.parentNode;else return null}}function U2(n,e){for(let t=n,s=e;;){if(t.nodeType==3&&s<t.nodeValue.length)return{node:t,offset:s};if(t.nodeType==1&&s<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[s],s=0}else if(t.parentNode&&!hp(t))s=vl(t)+1,t=t.parentNode;else return null}}class Nn{constructor(e,t,s=!0){this.node=e,this.offset=t,this.precise=s}static before(e,t){return new Nn(e.parentNode,vl(e),t)}static after(e,t){return new Nn(e.parentNode,vl(e)+1,t)}}const Rw=[];class Mt{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let s of this.children){if(s==e)return t;t+=s.length+s.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let s=this.dom,i=null,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=i?i.nextSibling:s.firstChild)){let l=Mt.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=i?i.nextSibling:s.firstChild,t&&!t.written&&t.node==s&&r!=o.dom&&(t.written=!0),o.dom.parentNode==s)for(;r&&r!=o.dom;)r=TC(r);else s.insertBefore(o.dom,r);i=o.dom}for(r=i?i.nextSibling:s.firstChild,r&&t&&t.node==s&&(t.written=!0);r;)r=TC(r)}else if(this.flags&1)for(let s of this.children)s.flags&7&&(s.sync(e,t),s.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let s;if(e==this.dom)s=this.dom.childNodes[t];else{let i=Ji(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;i==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?i=-1:i=1),e=r}i<0?s=e:s=e.nextSibling}if(s==this.dom.firstChild)return 0;for(;s&&!Mt.get(s);)s=s.nextSibling;if(!s)return this.length;for(let i=0,r=0;;i++){let o=this.children[i];if(o.dom==s)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,s=0){let i=-1,r=-1,o=-1,l=-1;for(let c=0,f=s,h=s;c<this.children.length;c++){let d=this.children[c],g=f+d.length;if(f<e&&g>t)return d.domBoundsAround(e,t,f);if(g>=e&&i==-1&&(i=c,r=f),f>t&&d.dom.parentNode==this.dom){o=c,l=h;break}h=g,f=g+d.breakAfter}return{from:r,to:l<0?s+this.length:l,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,s=Rw){this.markDirty();for(let i=e;i<t;i++){let r=this.children[i];r.parent==this&&s.indexOf(r)<0&&r.destroy()}s.length<250?this.children.splice(e,t-e,...s):this.children=[].concat(this.children.slice(0,e),s,this.children.slice(t));for(let i=0;i<s.length;i++)s[i].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new z2(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,s,i,r,o){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}Mt.prototype.breakAfter=0;function TC(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class z2{constructor(e,t,s){this.children=e,this.pos=t,this.i=s,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let s=this.children[--this.i];this.pos-=s.length+s.breakAfter}}}function q2(n,e,t,s,i,r,o,l,c){let{children:f}=n,h=f.length?f[e]:null,d=r.length?r[r.length-1]:null,g=d?d.breakAfter:o;if(!(e==s&&h&&!o&&!g&&r.length<2&&h.merge(t,i,r.length?d:null,t==0,l,c))){if(s<f.length){let m=f[s];m&&(i<m.length||m.breakAfter&&d?.breakAfter)?(e==s&&(m=m.split(i),i=0),!g&&d&&m.merge(0,i,d,!0,0,c)?r[r.length-1]=m:((i||m.children.length&&!m.children[0].length)&&m.merge(0,i,null,!1,0,c),r.push(m))):m?.breakAfter&&(d?d.breakAfter=1:o=1),s++}for(h&&(h.breakAfter=o,t>0&&(!o&&r.length&&h.merge(t,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(t<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(t,h.length,null,!1,l,0),e++));e<s&&r.length;)if(f[s-1].become(r[r.length-1]))s--,r.pop(),c=r.length?0:l;else if(f[e].become(r[0]))e++,r.shift(),l=r.length?0:c;else break;!r.length&&e&&s<f.length&&!f[e-1].breakAfter&&f[s].merge(0,0,f[e-1],!1,l,c)&&e--,(e<s||r.length)&&n.replaceChildren(e,s,r)}}function K2(n,e,t,s,i,r){let o=n.childCursor(),{i:l,off:c}=o.findPos(t,1),{i:f,off:h}=o.findPos(e,-1),d=e-t;for(let g of s)d+=g.length;n.length+=d,q2(n,f,h,l,c,s,0,i,r)}let as=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Ry=typeof document<"u"?document:{documentElement:{style:{}}};const My=/Edge\/(\d+)/.exec(as.userAgent),j2=/MSIE \d/.test(as.userAgent),Dy=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(as.userAgent),bm=!!(j2||Dy||My),OC=!bm&&/gecko\/(\d+)/i.test(as.userAgent),jb=!bm&&/Chrome\/(\d+)/.exec(as.userAgent),cY="webkitFontSmoothing"in Ry.documentElement.style,G2=!bm&&/Apple Computer/.test(as.vendor),RC=G2&&(/Mobile\/\w+/.test(as.userAgent)||as.maxTouchPoints>2);var Le={mac:RC||/Mac/.test(as.platform),windows:/Win/.test(as.platform),linux:/Linux|X11/.test(as.platform),ie:bm,ie_version:j2?Ry.documentMode||6:Dy?+Dy[1]:My?+My[1]:0,gecko:OC,gecko_version:OC?+(/Firefox\/(\d+)/.exec(as.userAgent)||[0,0])[1]:0,chrome:!!jb,chrome_version:jb?+jb[1]:0,ios:RC,android:/Android\b/.test(as.userAgent),safari:G2,webkit_version:cY?+(/\bAppleWebKit\/(\d+)/.exec(as.userAgent)||[0,0])[1]:0,tabSize:Ry.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const uY=256;class yi extends Mt{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,s){return this.flags&8||s&&(!(s instanceof yi)||this.length-(t-e)+s.length>uY||s.flags&8)?!1:(this.text=this.text.slice(0,e)+(s?s.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new yi(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Nn(this.dom,e)}domBoundsAround(e,t,s){return{from:s,to:s+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return fY(this.dom,e,t)}}class Br extends Mt{constructor(e,t=[],s=0){super(),this.mark=e,this.children=t,this.length=s;for(let i of t)i.setParent(this)}setAttrs(e){if(V2(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,s,i,r,o){return s&&(!(s instanceof Br&&s.mark.eq(this.mark))||e&&r<=0||t<this.length&&o<=0)?!1:(K2(this,e,t,s?s.children.slice():[],r-1,o-1),this.markDirty(),!0)}split(e){let t=[],s=0,i=-1,r=0;for(let l of this.children){let c=s+l.length;c>e&&t.push(s<e?l.split(e-s):l),i<0&&s>=e&&(i=r),s=c,r++}let o=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new Br(this.mark,t,o)}domAtPos(e){return Y2(this,e)}coordsAt(e,t){return Q2(this,e,t)}}function fY(n,e,t){let s=n.nodeValue.length;e>s&&(e=s);let i=e,r=e,o=0;e==0&&t<0||e==s&&t>=0?Le.chrome||Le.gecko||(e?(i--,o=1):r<s&&(r++,o=-1)):t<0?i--:r<s&&r++;let l=wl(n,i,r).getClientRects();if(!l.length)return null;let c=l[(o?o<0:t>=0)?0:l.length-1];return Le.safari&&!o&&c.width==0&&(c=Array.prototype.find.call(l,f=>f.width)||c),o?gm(c,o<0):c||null}class bo extends Mt{static create(e,t,s){return new bo(e,t,s)}constructor(e,t,s){super(),this.widget=e,this.length=t,this.side=s,this.prevWidget=null}split(e){let t=bo.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,s,i,r,o){return s&&(!(s instanceof bo)||!this.widget.compare(s.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(s?s.length:0)+(this.length-t),!0)}become(e){return e instanceof bo&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return yt.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,s=t&&t.state.doc,i=this.posAtStart;return s?s.slice(i,i+this.length):yt.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Nn.before(this.dom):Nn.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let s=this.widget.coordsAt(this.dom,e,t);if(s)return s;let i=this.dom.getClientRects(),r=null;if(!i.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?i.length-1:0;r=i[l],!(e>0?l==0:l==i.length-1||r.top<r.bottom);l+=o?-1:1);return gm(r,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Ga extends Mt{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof Ga&&e.side==this.side}split(){return new Ga(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?Nn.before(this.dom):Nn.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return yt.empty}get isHidden(){return!0}}yi.prototype.children=bo.prototype.children=Ga.prototype.children=Rw;function Y2(n,e){let t=n.dom,{children:s}=n,i=0;for(let r=0;i<s.length;i++){let o=s[i],l=r+o.length;if(!(l==r&&o.getSide()<=0)){if(e>r&&e<l&&o.dom.parentNode==t)return o.domAtPos(e-r);if(e<=r)break;r=l}}for(let r=i;r>0;r--){let o=s[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=i;r<s.length;r++){let o=s[r];if(o.dom.parentNode==t)return o.domAtPos(0)}return new Nn(t,0)}function X2(n,e,t){let s,{children:i}=n;t>0&&e instanceof Br&&i.length&&(s=i[i.length-1])instanceof Br&&s.mark.eq(e.mark)?X2(s,e.children[0],t-1):(i.push(e),e.setParent(n)),n.length+=e.length}function Q2(n,e,t){let s=null,i=-1,r=null,o=-1;function l(f,h){for(let d=0,g=0;d<f.children.length&&g<=h;d++){let m=f.children[d],y=g+m.length;y>=h&&(m.children.length?l(m,h-g):(!r||r.isHidden&&t>0)&&(y>h||g==y&&m.getSide()>0)?(r=m,o=h-g):(g<h||g==y&&m.getSide()<0&&!m.isHidden)&&(s=m,i=h-g)),g=y}}l(n,e);let c=(t<0?s:r)||s||r;return c?c.coordsAt(Math.max(0,c==s?i:o),t):hY(n)}function hY(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=Wu(e);return t[t.length-1]||null}function Ly(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const MC=Object.create(null);function dp(n,e,t){if(n==e)return!0;n||(n=MC),e||(e=MC);let s=Object.keys(n),i=Object.keys(e);if(s.length-(t&&s.indexOf(t)>-1?1:0)!=i.length-(t&&i.indexOf(t)>-1?1:0))return!1;for(let r of s)if(r!=t&&(i.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function Ny(n,e,t){let s=!1;if(e)for(let i in e)t&&i in t||(s=!0,i=="style"?n.style.cssText="":n.removeAttribute(i));if(t)for(let i in t)e&&e[i]==t[i]||(s=!0,i=="style"?n.style.cssText=t[i]:n.setAttribute(i,t[i]));return s}function dY(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let s=n.attributes[t];e[s.name]=s.value}return e}class No{eq(e){return!1}updateDOM(e,t){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,t,s){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Qn=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(Qn||(Qn={}));class je extends yl{constructor(e,t,s,i){super(),this.startSide=e,this.endSide=t,this.widget=s,this.spec=i}get heightRelevant(){return!1}static mark(e){return new mf(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),s=!!e.block;return t+=s&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new To(e,t,t,s,e.widget||null,!1)}static replace(e){let t=!!e.block,s,i;if(e.isBlockGap)s=-5e8,i=4e8;else{let{start:r,end:o}=J2(e,t);s=(r?t?-3e8:-1:5e8)-1,i=(o?t?2e8:1:-6e8)+1}return new To(e,s,i,t,e.widget||null,!0)}static line(e){return new gf(e)}static set(e,t=!1){return pt.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}je.none=pt.empty;class mf extends je{constructor(e){let{start:t,end:s}=J2(e);super(t?-1:5e8,s?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,s;return this==e||e instanceof mf&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((s=e.attrs)===null||s===void 0?void 0:s.class))&&dp(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}mf.prototype.point=!1;class gf extends je{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof gf&&this.spec.class==e.spec.class&&dp(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}gf.prototype.mapMode=jn.TrackBefore;gf.prototype.point=!0;class To extends je{constructor(e,t,s,i,r,o){super(t,s,r,e),this.block=i,this.isReplace=o,this.mapMode=i?t<=0?jn.TrackBefore:jn.TrackAfter:jn.TrackDel}get type(){return this.startSide!=this.endSide?Qn.WidgetRange:this.startSide<=0?Qn.WidgetBefore:Qn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof To&&pY(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}To.prototype.point=!0;function J2(n,e=!1){let{inclusiveStart:t,inclusiveEnd:s}=n;return t==null&&(t=n.inclusive),s==null&&(s=n.inclusive),{start:t??e,end:s??e}}function pY(n,e){return n==e||!!(n&&e&&n.compare(e))}function Iy(n,e,t,s=0){let i=t.length-1;i>=0&&t[i]+s>=n?t[i]=Math.max(t[i],e):t.push(n,e)}class Zt extends Mt{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,s,i,r,o){if(s){if(!(s instanceof Zt))return!1;this.dom||s.transferDOM(this)}return i&&this.setDeco(s?s.attrs:null),K2(this,e,t,s?s.children.slice():[],r,o),!0}split(e){let t=new Zt;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:s,off:i}=this.childPos(e);i&&(t.append(this.children[s].split(i),0),this.children[s].merge(i,this.children[s].length,null,!1,0,0),s++);for(let r=s;r<this.children.length;r++)t.append(this.children[r],0);for(;s>0&&this.children[s-1].length==0;)this.children[--s].destroy();return this.children.length=s,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){dp(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){X2(this,e,t)}addLineDeco(e){let t=e.spec.attributes,s=e.spec.class;t&&(this.attrs=Ly(t,this.attrs||{})),s&&(this.attrs=Ly({class:s},this.attrs||{}))}domAtPos(e){return Y2(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var s;this.dom?this.flags&4&&(V2(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Ny(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let i=this.dom.lastChild;for(;i&&Mt.get(i)instanceof Br;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((s=Mt.get(i))===null||s===void 0?void 0:s.isEditable)==!1&&(!Le.ios||!this.children.some(r=>r instanceof yi))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let s of this.children){if(!(s instanceof yi)||/[^ -~]/.test(s.text))return null;let i=Wu(s.dom);if(i.length!=1)return null;e+=i[0].width,t=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let s=Q2(this,e,t);if(!this.children.length&&s&&this.parent){let{heightOracle:i}=this.parent.view.viewState,r=s.bottom-s.top;if(Math.abs(r-i.lineHeight)<2&&i.textHeight<r){let o=(r-i.textHeight)/2;return{top:s.top+o,bottom:s.bottom-o,left:s.left,right:s.left}}}return s}become(e){return e instanceof Zt&&this.children.length==0&&e.children.length==0&&dp(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let s=0,i=0;s<e.children.length;s++){let r=e.children[s],o=i+r.length;if(o>=t){if(r instanceof Zt)return r;if(o>t)break}i=o+r.breakAfter}return null}}class Tr extends Mt{constructor(e,t,s){super(),this.widget=e,this.length=t,this.deco=s,this.breakAfter=0,this.prevWidget=null}merge(e,t,s,i,r,o){return s&&(!(s instanceof Tr)||!this.widget.compare(s.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(s?s.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?Nn.before(this.dom):Nn.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let s=new Tr(this.widget,t,this.deco);return s.breakAfter=this.breakAfter,s}get children(){return Rw}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):yt.empty}domBoundsAround(){return null}become(e){return e instanceof Tr&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){let s=this.widget.coordsAt(this.dom,e,t);return s||(this.widget instanceof Py?null:gm(this.dom.getBoundingClientRect(),this.length?e==0:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:s}=this.deco;return t==s?!1:e<0?t<0:s>0}}class Py extends No{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}}class vu{constructor(e,t,s,i){this.doc=e,this.pos=t,this.end=s,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Tr&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Zt),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Ih(new Ga(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Tr)&&this.getLine()}buildText(e,t,s){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-s)),this.getLine().append(Ih(new yi(this.text.slice(this.textOff,this.textOff+i)),t),s),this.atCursorPos=!0,this.textOff+=i,e-=i,s=0}}span(e,t,s,i){this.buildText(t-e,s,i),this.pos=t,this.openStart<0&&(this.openStart=i)}point(e,t,s,i,r,o){if(this.disallowBlockEffectsFor[o]&&s instanceof To){if(s.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(s instanceof To)if(s.block)s.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Tr(s.widget||Ya.block,l,s));else{let c=bo.create(s.widget||Ya.inline,l,l?0:s.startSide),f=this.atCursorPos&&!c.isEditable&&r<=i.length&&(e<t||s.startSide>0),h=!c.isEditable&&(e<t||r>i.length||s.startSide<=0),d=this.getLine();this.pendingBuffer==2&&!f&&!c.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),f&&(d.append(Ih(new Ga(1),i),r),r=i.length+Math.max(0,r-i.length)),d.append(Ih(c,i),r),this.atCursorPos=h,this.pendingBuffer=h?e<t||r>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(s);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,s,i,r){let o=new vu(e,t,s,r);return o.openEnd=pt.spans(i,t,s,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Ih(n,e){for(let t of e)n=new Br(t,[n],n.length);return n}class Ya extends No{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}}Ya.inline=new Ya("span");Ya.block=new Ya("div");var Ft=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(Ft||(Ft={}));const Sl=Ft.LTR,Mw=Ft.RTL;function Z2(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const mY=Z2("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),gY=Z2("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),$y=Object.create(null),Di=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);$y[e]=t,$y[t]=-e}function eM(n){return n<=247?mY[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?gY[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const bY=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class yo{get dir(){return this.level%2?Mw:Sl}constructor(e,t,s){this.from=e,this.to=t,this.level=s}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,s,i){let r=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=t&&l.to>=t){if(l.level==s)return o;(r<0||(i!=0?i<0?l.from<t:l.to>t:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function tM(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let s=n[t],i=e[t];if(s.from!=i.from||s.to!=i.to||s.direction!=i.direction||!tM(s.inner,i.inner))return!1}return!0}const Tt=[];function yY(n,e,t,s,i){for(let r=0;r<=s.length;r++){let o=r?s[r-1].to:e,l=r<s.length?s[r].from:t,c=r?256:i;for(let f=o,h=c,d=c;f<l;f++){let g=eM(n.charCodeAt(f));g==512?g=h:g==8&&d==4&&(g=16),Tt[f]=g==4?2:g,g&7&&(d=g),h=g}for(let f=o,h=c,d=c;f<l;f++){let g=Tt[f];if(g==128)f<l-1&&h==Tt[f+1]&&h&24?g=Tt[f]=h:Tt[f]=256;else if(g==64){let m=f+1;for(;m<l&&Tt[m]==64;)m++;let y=f&&h==8||m<t&&Tt[m]==8?d==1?1:8:256;for(let w=f;w<m;w++)Tt[w]=y;f=m-1}else g==8&&d==1&&(Tt[f]=1);h=g,g&7&&(d=g)}}}function vY(n,e,t,s,i){let r=i==1?2:1;for(let o=0,l=0,c=0;o<=s.length;o++){let f=o?s[o-1].to:e,h=o<s.length?s[o].from:t;for(let d=f,g,m,y;d<h;d++)if(m=$y[g=n.charCodeAt(d)])if(m<0){for(let w=l-3;w>=0;w-=3)if(Di[w+1]==-m){let x=Di[w+2],S=x&2?i:x&4?x&1?r:i:0;S&&(Tt[d]=Tt[Di[w]]=S),l=w;break}}else{if(Di.length==189)break;Di[l++]=d,Di[l++]=g,Di[l++]=c}else if((y=Tt[d])==2||y==1){let w=y==i;c=w?0:1;for(let x=l-3;x>=0;x-=3){let S=Di[x+2];if(S&2)break;if(w)Di[x+2]|=2;else{if(S&4)break;Di[x+2]|=4}}}}}function wY(n,e,t,s){for(let i=0,r=s;i<=t.length;i++){let o=i?t[i-1].to:n,l=i<t.length?t[i].from:e;for(let c=o;c<l;){let f=Tt[c];if(f==256){let h=c+1;for(;;)if(h==l){if(i==t.length)break;h=t[i++].to,l=i<t.length?t[i].from:e}else if(Tt[h]==256)h++;else break;let d=r==1,g=(h<e?Tt[h]:s)==1,m=d==g?d?1:2:s;for(let y=h,w=i,x=w?t[w-1].to:n;y>c;)y==x&&(y=t[--w].from,x=w?t[w-1].to:n),Tt[--y]=m;c=h}else r=f,c++}}}function By(n,e,t,s,i,r,o){let l=s%2?2:1;if(s%2==i%2)for(let c=e,f=0;c<t;){let h=!0,d=!1;if(f==r.length||c<r[f].from){let w=Tt[c];w!=l&&(h=!1,d=w==16)}let g=!h&&l==1?[]:null,m=h?s:s+1,y=c;e:for(;;)if(f<r.length&&y==r[f].from){if(d)break e;let w=r[f];if(!h)for(let x=w.to,S=f+1;;){if(x==t)break e;if(S<r.length&&r[S].from==x)x=r[S++].to;else{if(Tt[x]==l)break e;break}}if(f++,g)g.push(w);else{w.from>c&&o.push(new yo(c,w.from,m));let x=w.direction==Sl!=!(m%2);Fy(n,x?s+1:s,i,w.inner,w.from,w.to,o),c=w.to}y=w.to}else{if(y==t||(h?Tt[y]!=l:Tt[y]==l))break;y++}g?By(n,c,y,s+1,i,g,o):c<y&&o.push(new yo(c,y,m)),c=y}else for(let c=t,f=r.length;c>e;){let h=!0,d=!1;if(!f||c>r[f-1].to){let w=Tt[c-1];w!=l&&(h=!1,d=w==16)}let g=!h&&l==1?[]:null,m=h?s:s+1,y=c;e:for(;;)if(f&&y==r[f-1].to){if(d)break e;let w=r[--f];if(!h)for(let x=w.from,S=f;;){if(x==e)break e;if(S&&r[S-1].to==x)x=r[--S].from;else{if(Tt[x-1]==l)break e;break}}if(g)g.push(w);else{w.to<c&&o.push(new yo(w.to,c,m));let x=w.direction==Sl!=!(m%2);Fy(n,x?s+1:s,i,w.inner,w.from,w.to,o),c=w.from}y=w.from}else{if(y==e||(h?Tt[y-1]!=l:Tt[y-1]==l))break;y--}g?By(n,y,c,s+1,i,g,o):y<c&&o.push(new yo(y,c,m)),c=y}}function Fy(n,e,t,s,i,r,o){let l=e%2?2:1;yY(n,i,r,s,l),vY(n,i,r,s,l),wY(i,r,s,l),By(n,i,r,e,t,s,o)}function SY(n,e,t){if(!n)return[new yo(0,0,e==Mw?1:0)];if(e==Sl&&!t.length&&!bY.test(n))return nM(n.length);if(t.length)for(;n.length>Tt.length;)Tt[Tt.length]=256;let s=[],i=e==Sl?0:1;return Fy(n,i,i,t,0,n.length,s),s}function nM(n){return[new yo(0,n,0)]}let sM="";function xY(n,e,t,s,i){var r;let o=s.head-n.from,l=yo.find(e,o,(r=s.bidiLevel)!==null&&r!==void 0?r:-1,s.assoc),c=e[l],f=c.side(i,t);if(o==f){let g=l+=i?1:-1;if(g<0||g>=e.length)return null;c=e[l=g],o=c.side(!i,t),f=c.side(i,t)}let h=Cn(n.text,o,c.forward(i,t));(h<c.from||h>c.to)&&(h=f),sM=n.text.slice(Math.min(o,h),Math.max(o,h));let d=l==(i?e.length-1:0)?null:e[l+(i?1:-1)];return d&&h==f&&d.level+(i?0:1)<c.level?le.cursor(d.side(!i,t)+n.from,d.forward(i,t)?1:-1,d.level):le.cursor(h+n.from,c.forward(i,t)?-1:1,c.level)}function _Y(n,e,t){for(let s=e;s<t;s++){let i=eM(n.charCodeAt(s));if(i==1)return Sl;if(i==2||i==4)return Mw}return Sl}const iM=Re.define(),rM=Re.define(),oM=Re.define(),lM=Re.define(),Vy=Re.define(),aM=Re.define(),cM=Re.define(),Dw=Re.define(),Lw=Re.define(),uM=Re.define({combine:n=>n.some(e=>e)}),fM=Re.define({combine:n=>n.some(e=>e)}),hM=Re.define();class Ta{constructor(e,t="nearest",s="nearest",i=5,r=5,o=!1){this.range=e,this.y=t,this.x=s,this.yMargin=i,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new Ta(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 Ta(le.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Ph=tt.define({map:(n,e)=>n.map(e)}),dM=tt.define();function Gn(n,e,t){let s=n.facet(lM);s.length?s[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const po=Re.define({combine:n=>n.length?n[0]:!0});let EY=0;const Xc=Re.define();class Jt{constructor(e,t,s,i,r){this.id=e,this.create=t,this.domEventHandlers=s,this.domEventObservers=i,this.extension=r(this)}static define(e,t){const{eventHandlers:s,eventObservers:i,provide:r,decorations:o}=t||{};return new Jt(EY++,e,s,i,l=>{let c=[Xc.of(l)];return o&&c.push(Hu.of(f=>{let h=f.plugin(l);return h?o(h):je.none})),r&&c.push(r(l)),c})}static fromClass(e,t){return Jt.define(s=>new e(s),t)}}class Gb{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(s){if(Gn(t.state,s,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Gn(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(s){Gn(e.state,s,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const pM=Re.define(),Nw=Re.define(),Hu=Re.define(),mM=Re.define(),Iw=Re.define(),gM=Re.define();function DC(n,e){let t=n.state.facet(gM);if(!t.length)return t;let s=t.map(r=>r instanceof Function?r(n):r),i=[];return pt.spans(s,e.from,e.to,{point(){},span(r,o,l,c){let f=r-e.from,h=o-e.from,d=i;for(let g=l.length-1;g>=0;g--,c--){let m=l[g].spec.bidiIsolate,y;if(m==null&&(m=_Y(e.text,f,h)),c>0&&d.length&&(y=d[d.length-1]).to==f&&y.direction==m)y.to=h,d=y.inner;else{let w={from:f,to:h,direction:m,inner:[]};d.push(w),d=w.inner}}}}),i}const bM=Re.define();function Pw(n){let e=0,t=0,s=0,i=0;for(let r of n.state.facet(bM)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(s=Math.max(s,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:t,top:s,bottom:i}}const Qc=Re.define();class Zs{constructor(e,t,s,i){this.fromA=e,this.toA=t,this.fromB=s,this.toB=i}join(e){return new Zs(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 t=e.length,s=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>s.toA)){if(i.toA<s.fromA)break;s=s.join(i),e.splice(t-1,1)}}return e.splice(t,0,s),e}static extendWithRanges(e,t){if(t.length==0)return e;let s=[];for(let i=0,r=0,o=0,l=0;;i++){let c=i==e.length?null:e[i],f=o-l,h=c?c.fromB:1e9;for(;r<t.length&&t[r]<h;){let d=t[r],g=t[r+1],m=Math.max(l,d),y=Math.min(h,g);if(m<=y&&new Zs(m+f,y+f,m,y).addToSet(s),g>h)break;r+=2}if(!c)return s;new Zs(c.fromA,c.toA,c.fromB,c.toB).addToSet(s),o=c.toA,l=c.toB}}}class pp{constructor(e,t,s){this.view=e,this.state=t,this.transactions=s,this.flags=0,this.startState=e.state,this.changes=ln.empty(this.startState.doc.length);for(let r of s)this.changes=this.changes.compose(r.changes);let i=[];this.changes.iterChangedRanges((r,o,l,c)=>i.push(new Zs(r,o,l,c))),this.changedRanges=i}static create(e,t,s){return new pp(e,t,s)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>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}}class LC extends Mt{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=je.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.setDOM(e.contentDOM),this.children=[new Zt],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Zs(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let s=e.changedRanges;this.minWidth>0&&s.length&&(s.every(({fromA:f,toA:h})=>h<this.minWidthFrom||f>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?i=this.domChanged.newSel.head:!MY(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let r=i>-1?AY(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:f,to:h}=this.hasComposition;s=new Zs(f,h,e.changes.mapPos(f,-1),e.changes.mapPos(h,1)).addToSet(s.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(Le.ie||Le.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),c=OY(o,l,e.changes);return s=Zs.extendWithRanges(s,c),!(this.flags&7)&&s.length==0?!1:(this.updateInner(s,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,s){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,s);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=Le.chrome||Le.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||i.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof Tr&&o.widget instanceof Py&&r.push(o.dom);i.updateGaps(r)}updateChildren(e,t,s){let i=s?s.range.addToSet(e.slice()):e,r=this.childCursor(t);for(let o=i.length-1;;o--){let l=o>=0?i[o]:null;if(!l)break;let{fromA:c,toA:f,fromB:h,toB:d}=l,g,m,y,w;if(s&&s.range.fromB<d&&s.range.toB>h){let k=vu.build(this.view.state.doc,h,s.range.fromB,this.decorations,this.dynamicDecorationMap),R=vu.build(this.view.state.doc,s.range.toB,d,this.decorations,this.dynamicDecorationMap);m=k.breakAtStart,y=k.openStart,w=R.openEnd;let T=this.compositionView(s);R.breakAtStart?T.breakAfter=1:R.content.length&&T.merge(T.length,T.length,R.content[0],!1,R.openStart,0)&&(T.breakAfter=R.content[0].breakAfter,R.content.shift()),k.content.length&&T.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),g=k.content.concat(T).concat(R.content)}else({content:g,breakAtStart:m,openStart:y,openEnd:w}=vu.build(this.view.state.doc,h,d,this.decorations,this.dynamicDecorationMap));let{i:x,off:S}=r.findPos(f,1),{i:C,off:E}=r.findPos(c,-1);q2(this,C,E,x,S,g,m,y,w)}s&&this.fixCompositionDOM(s)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let s of t.effects)s.is(dM)&&(this.editContextFormatting=s.value)}compositionView(e){let t=new yi(e.text.nodeValue);t.flags|=8;for(let{deco:i}of e.marks)t=new Br(i,[t],t.length);let s=new Zt;return s.append(t,0),s}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(c=>c.flags&7)?1:0),this.markedForComposition.add(o);let l=Mt.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},s=this.childPos(e.range.fromB,1),i=this.children[s.i];t(e.line,i);for(let r=e.marks.length-1;r>=-1;r--)s=i.childPos(s.off,1),i=i.children[s.i],t(r>=0?e.marks[r].node:e.text,i)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let s=this.view.root.activeElement,i=s==this.dom,r=!i&&xd(this.dom,this.view.observer.selectionRange)&&!(s&&this.dom.contains(s));if(!(i||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,c=this.moveToLine(this.domAtPos(l.anchor)),f=l.empty?c:this.moveToLine(this.domAtPos(l.head));if(Le.gecko&&l.empty&&!this.hasComposition&&CY(c)){let d=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(d,c.node.childNodes[c.offset]||null)),c=f=new Nn(d,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!yu(c.node,c.offset,h.anchorNode,h.anchorOffset)||!yu(f.node,f.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{Le.android&&Le.chrome&&this.dom.contains(h.focusNode)&&RY(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let d=Vu(this.view.root);if(d)if(l.empty){if(Le.gecko){let g=kY(c.node,c.offset);if(g&&g!=3){let m=(g==1?H2:U2)(c.node,c.offset);m&&(c=new Nn(m.node,m.offset))}}d.collapse(c.node,c.offset),l.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=l.bidiLevel)}else if(d.extend){d.collapse(c.node,c.offset);try{d.extend(f.node,f.offset)}catch{}}else{let g=document.createRange();l.anchor>l.head&&([c,f]=[f,c]),g.setEnd(f.node,f.offset),g.setStart(c.node,c.offset),d.removeAllRanges(),d.addRange(g)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(c,f)),this.impreciseAnchor=c.precise?null:new Nn(h.anchorNode,h.anchorOffset),this.impreciseHead=f.precise?null:new Nn(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&yu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,s=Vu(e.root),{anchorNode:i,anchorOffset:r}=e.observer.selectionRange;if(!s||!t.empty||!t.assoc||!s.modify)return;let o=Zt.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let c=this.coordsAt(t.head,-1),f=this.coordsAt(t.head,1);if(!c||!f||c.bottom>f.top)return;let h=this.domAtPos(t.head+t.assoc);s.collapse(h.node,h.offset),s.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let d=e.observer.selectionRange;e.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=t.from&&s.collapse(i,r)}moveToLine(e){let t=this.dom,s;if(e.node!=t)return e;for(let i=e.offset;!s&&i<t.childNodes.length;i++){let r=Mt.get(t.childNodes[i]);r instanceof Zt&&(s=r.domAtPos(0))}for(let i=e.offset-1;!s&&i>=0;i--){let r=Mt.get(t.childNodes[i]);r instanceof Zt&&(s=r.domAtPos(r.length))}return s?new Nn(s.node,s.offset,!0):e}nearest(e){for(let t=e;t;){let s=Mt.get(t);if(s&&s.rootView==this)return s;t=t.parentNode}return null}posFromDOM(e,t){let s=this.nearest(e);if(!s)throw new RangeError("Trying to find position for a DOM position outside of the document");return s.localPosFromDOM(e,t)+s.posAtStart}domAtPos(e){let{i:t,off:s}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let i=this.children[t];if(s<i.length||i instanceof Zt)break;t++,s=0}return this.children[t].domAtPos(s)}coordsAt(e,t){let s=null,i=0;for(let r=this.length,o=this.children.length-1;o>=0;o--){let l=this.children[o],c=r-l.breakAfter,f=c-l.length;if(c<e)break;if(f<=e&&(f<e||l.covers(-1))&&(c>e||l.covers(1))&&(!s||l instanceof Zt&&!(s instanceof Zt&&t>=0)))s=l,i=f;else if(s&&f==e&&c==e&&l instanceof Tr&&Math.abs(t)<2){if(l.deco.startSide<0)break;o&&(s=null)}r=f}return s?s.coordsAt(e-i,t):null}coordsForChar(e){let{i:t,off:s}=this.childPos(e,1),i=this.children[t];if(!(i instanceof Zt))return null;for(;i.children.length;){let{i:l,off:c}=i.childPos(s,1);for(;;l++){if(l==i.children.length)return null;if((i=i.children[l]).length)break}s=c}if(!(i instanceof yi))return null;let r=Cn(i.text,s);if(r==s)return null;let o=wl(i.dom,s,r).getClientRects();for(let l=0;l<o.length;l++){let c=o[l];if(l==o.length-1||c.top<c.bottom&&c.left<c.right)return c}return null}measureVisibleLineHeights(e){let t=[],{from:s,to:i}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==Ft.LTR;for(let f=0,h=0;h<this.children.length;h++){let d=this.children[h],g=f+d.length;if(g>i)break;if(f>=s){let m=d.dom.getBoundingClientRect();if(t.push(m.height),o){let y=d.dom.lastChild,w=y?Wu(y):[];if(w.length){let x=w[w.length-1],S=c?x.right-m.left:m.right-x.left;S>l&&(l=S,this.minWidth=r,this.minWidthFrom=f,this.minWidthTo=g)}}}f=g+d.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Ft.RTL:Ft.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Zt){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,s,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=Wu(e.firstChild)[0];t=e.getBoundingClientRect().height,s=r?r.width/27:7,i=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:s,textHeight:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new z2(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let s=0,i=0;;i++){let r=i==t.viewports.length?null:t.viewports[i],o=r?r.from-1:this.length;if(o>s){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(s).top)/this.view.scaleY;e.push(je.replace({widget:new Py(l),block:!0,inclusive:!0,isBlockGap:!0}).range(s,o))}if(!r)break;s=r.to+1}return je.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Hu).map(r=>(this.dynamicDecorationMap[e++]=typeof r=="function")?r(this.view):r),s=!1,i=this.view.state.facet(mM).map((r,o)=>{let l=typeof r=="function";return l&&(s=!0),l?r(this.view):r});for(i.length&&(this.dynamicDecorationMap[e++]=s,t.push(pt.join(i))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let f=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=f.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let f of this.view.state.facet(hM))try{if(f(this.view,e.range,e))return!0}catch(h){Gn(this.view.state,h,"scroll handler")}let{range:t}=e,s=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),i;if(!s)return;!t.empty&&(i=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(s={left:Math.min(s.left,i.left),top:Math.min(s.top,i.top),right:Math.max(s.right,i.right),bottom:Math.max(s.bottom,i.bottom)});let r=Pw(this.view),o={left:s.left-r.left,top:s.top-r.top,right:s.right+r.right,bottom:s.bottom+r.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;iY(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,c),-c),this.view.textDirection==Ft.LTR)}}function CY(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function yM(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let s=H2(t.focusNode,t.focusOffset),i=U2(t.focusNode,t.focusOffset),r=s||i;if(i&&s&&i.node!=s.node){let l=Mt.get(i.node);if(!l||l instanceof yi&&l.text!=i.node.nodeValue)r=i;else if(n.docView.lastCompositionAfterCursor){let c=Mt.get(s.node);!c||c instanceof yi&&c.text!=s.node.nodeValue||(r=i)}}if(n.docView.lastCompositionAfterCursor=r!=s,!r)return null;let o=e-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function AY(n,e,t){let s=yM(n,t);if(!s)return null;let{node:i,from:r,to:o}=s,l=i.nodeValue;if(/[\n\r]/.test(l)||n.state.doc.sliceString(s.from,s.to)!=l)return null;let c=e.invertedDesc,f=new Zs(c.mapPos(r),c.mapPos(o),r,o),h=[];for(let d=i.parentNode;;d=d.parentNode){let g=Mt.get(d);if(g instanceof Br)h.push({node:d,deco:g.mark});else{if(g instanceof Zt||d.nodeName=="DIV"&&d.parentNode==n.contentDOM)return{range:f,text:i,marks:h,line:d};if(d!=n.contentDOM)h.push({node:d,deco:new mf({inclusive:!0,attributes:dY(d),tagName:d.tagName.toLowerCase()})});else return null}}}function kY(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let TY=class{constructor(){this.changes=[]}compareRange(e,t){Iy(e,t,this.changes)}comparePoint(e,t){Iy(e,t,this.changes)}};function OY(n,e,t){let s=new TY;return pt.compare(n,e,t,s),s.changes}function RY(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function MY(n,e){let t=!1;return e&&n.iterChangedRanges((s,i)=>{s<e.to&&i>e.from&&(t=!0)}),t}function DY(n,e,t=1){let s=n.charCategorizer(e),i=n.doc.lineAt(e),r=e-i.from;if(i.length==0)return le.cursor(e);r==0?t=1:r==i.length&&(t=-1);let o=r,l=r;t<0?o=Cn(i.text,r,!1):l=Cn(i.text,r);let c=s(i.text.slice(o,l));for(;o>0;){let f=Cn(i.text,o,!1);if(s(i.text.slice(f,o))!=c)break;o=f}for(;l<i.length;){let f=Cn(i.text,l);if(s(i.text.slice(l,f))!=c)break;l=f}return le.range(o+i.from,l+i.from)}function LY(n,e){return e.left>n?e.left-n:Math.max(0,n-e.right)}function NY(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function Yb(n,e){return n.top<e.bottom-1&&n.bottom>e.top+1}function NC(n,e){return e<n.top?{top:e,left:n.left,right:n.right,bottom:n.bottom}:n}function IC(n,e){return e>n.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function Wy(n,e,t){let s,i,r,o,l=!1,c,f,h,d;for(let y=n.firstChild;y;y=y.nextSibling){let w=Wu(y);for(let x=0;x<w.length;x++){let S=w[x];i&&Yb(i,S)&&(S=NC(IC(S,i.bottom),i.top));let C=LY(e,S),E=NY(t,S);if(C==0&&E==0)return y.nodeType==3?PC(y,e,t):Wy(y,e,t);if(!s||o>E||o==E&&r>C){s=y,i=S,r=C,o=E;let k=E?t<S.top?-1:1:C?e<S.left?-1:1:0;l=!k||(k>0?x<w.length-1:x>0)}C==0?t>S.bottom&&(!h||h.bottom<S.bottom)?(c=y,h=S):t<S.top&&(!d||d.top>S.top)&&(f=y,d=S):h&&Yb(h,S)?h=IC(h,S.bottom):d&&Yb(d,S)&&(d=NC(d,S.top))}}if(h&&h.bottom>=t?(s=c,i=h):d&&d.top<=t&&(s=f,i=d),!s)return{node:n,offset:0};let g=Math.max(i.left,Math.min(i.right,e));if(s.nodeType==3)return PC(s,g,t);if(l&&s.contentEditable!="false")return Wy(s,g,t);let m=Array.prototype.indexOf.call(n.childNodes,s)+(e>=(i.left+i.right)/2?1:0);return{node:n,offset:m}}function PC(n,e,t){let s=n.nodeValue.length,i=-1,r=1e9,o=0;for(let l=0;l<s;l++){let c=wl(n,l,l+1).getClientRects();for(let f=0;f<c.length;f++){let h=c[f];if(h.top==h.bottom)continue;o||(o=e-h.left);let d=(h.top>t?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&d<r){let g=e>=(h.left+h.right)/2,m=g;if((Le.chrome||Le.gecko)&&wl(n,l).getBoundingClientRect().left==h.right&&(m=!g),d<=0)return{node:n,offset:l+(m?1:0)};i=l+(m?1:0),r=d}}}return{node:n,offset:i>-1?i:o>0?n.nodeValue.length:0}}function vM(n,e,t,s=-1){var i,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,c,{docHeight:f}=n.viewState,{x:h,y:d}=e,g=d-l;if(g<0)return 0;if(g>f)return n.state.doc.length;for(let k=n.viewState.heightOracle.textHeight/2,R=!1;c=n.elementAtHeight(g),c.type!=Qn.Text;)for(;g=s>0?c.bottom+k:c.top-k,!(g>=0&&g<=f);){if(R)return t?null:0;R=!0,s=-s}d=l+g;let m=c.from;if(m<n.viewport.from)return n.viewport.from==0?0:t?null:$C(n,o,c,h,d);if(m>n.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:$C(n,o,c,h,d);let y=n.dom.ownerDocument,w=n.root.elementFromPoint?n.root:y,x=w.elementFromPoint(h,d);x&&!n.contentDOM.contains(x)&&(x=null),x||(h=Math.max(o.left+1,Math.min(o.right-1,h)),x=w.elementFromPoint(h,d),x&&!n.contentDOM.contains(x)&&(x=null));let S,C=-1;if(x&&((i=n.docView.nearest(x))===null||i===void 0?void 0:i.isEditable)!=!1){if(y.caretPositionFromPoint){let k=y.caretPositionFromPoint(h,d);k&&({offsetNode:S,offset:C}=k)}else if(y.caretRangeFromPoint){let k=y.caretRangeFromPoint(h,d);k&&({startContainer:S,startOffset:C}=k,(!n.contentDOM.contains(S)||Le.safari&&IY(S,C,h)||Le.chrome&&PY(S,C,h))&&(S=void 0))}S&&(C=Math.min(Ji(S),C))}if(!S||!n.docView.dom.contains(S)){let k=Zt.find(n.docView,m);if(!k)return g>c.top+c.height/2?c.to:c.from;({node:S,offset:C}=Wy(k.dom,h,d))}let E=n.docView.nearest(S);if(!E)return null;if(E.isWidget&&((r=E.dom)===null||r===void 0?void 0:r.nodeType)==1){let k=E.dom.getBoundingClientRect();return e.y<k.top||e.y<=k.bottom&&e.x<=(k.left+k.right)/2?E.posAtStart:E.posAtEnd}else return E.localPosFromDOM(S,C)+E.posAtStart}function $C(n,e,t,s,i){let r=Math.round((s-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,c=Math.floor((i-t.top-(n.defaultLineHeight-l)*.5)/l);r+=c*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+Ay(o,r,n.state.tabSize)}function IY(n,e,t){let s;if(n.nodeType!=3||e!=(s=n.nodeValue.length))return!1;for(let i=n.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return wl(n,s-1,s).getBoundingClientRect().left>t}function PY(n,e,t){if(e!=0)return!1;for(let i=n;;){let r=i.parentNode;if(!r||r.nodeType!=1||r.firstChild!=i)return!1;if(r.classList.contains("cm-line"))break;i=r}let s=n.nodeType==1?n.getBoundingClientRect():wl(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-s.left>5}function Hy(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let s of t.type)if(s.to>e||s.to==e&&(s.to==t.to||s.type==Qn.Text))return s}return t}function $Y(n,e,t,s){let i=Hy(n,e.head),r=!s||i.type!=Qn.Text||!(n.lineWrapping||i.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(i.from),c=n.posAtCoords({x:t==(l==Ft.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(c!=null)return le.cursor(c,t?-1:1)}return le.cursor(t?i.to:i.from,t?-1:1)}function BC(n,e,t,s){let i=n.state.doc.lineAt(e.head),r=n.bidiSpans(i),o=n.textDirectionAt(i.from);for(let l=e,c=null;;){let f=xY(i,r,o,l,t),h=sM;if(!f){if(i.number==(t?n.state.doc.lines:1))return l;h=`
`,i=n.state.doc.line(i.number+(t?1:-1)),r=n.bidiSpans(i),f=n.visualLineSide(i,!t)}if(c){if(!c(h))return l}else{if(!s)return f;c=s(h)}l=f}}function BY(n,e,t){let s=n.state.charCategorizer(e),i=s(t);return r=>{let o=s(r);return i==Ut.Space&&(i=o),i==o}}function FY(n,e,t,s){let i=e.head,r=t?1:-1;if(i==(t?n.state.doc.length:0))return le.cursor(i,e.assoc);let o=e.goalColumn,l,c=n.contentDOM.getBoundingClientRect(),f=n.coordsAtPos(i,e.assoc||-1),h=n.documentTop;if(f)o==null&&(o=f.left-c.left),l=r<0?f.top:f.bottom;else{let m=n.viewState.lineBlockAt(i);o==null&&(o=Math.min(c.right-c.left,n.defaultCharacterWidth*(i-m.from))),l=(r<0?m.top:m.bottom)+h}let d=c.left+o,g=s??n.viewState.heightOracle.textHeight>>1;for(let m=0;;m+=10){let y=l+(g+m)*r,w=vM(n,{x:d,y},!1,r);if(y<c.top||y>c.bottom||(r<0?w<i:w>i)){let x=n.docView.coordsForChar(w),S=!x||y<x.top?-1:1;return le.cursor(w,S,void 0,o)}}}function _d(n,e,t){for(;;){let s=0;for(let i of n)i.between(e-1,e+1,(r,o,l)=>{if(e>r&&e<o){let c=s||t||(e-r<o-e?-1:1);e=c<0?r:o,s=c}});if(!s)return e}}function Xb(n,e,t){let s=_d(n.state.facet(Iw).map(i=>i(n)),t.from,e.head>t.from?-1:1);return s==t.from?t:le.cursor(s,s<t.from?1:-1)}const Jc="￿";class VY{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(bt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Jc}readRange(e,t){if(!e)return this;let s=e.parentNode;for(let i=e;;){this.findPointBefore(s,i);let r=this.text.length;this.readNode(i);let o=i.nextSibling;if(o==t)break;let l=Mt.get(i),c=Mt.get(o);(l&&c?l.breakAfter:(l?l.breakAfter:hp(i))||hp(o)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>r)&&this.lineBreak(),i=o}return this.findPointBefore(s,t),this}readTextNode(e){let t=e.nodeValue;for(let s of this.points)s.node==e&&(s.pos=this.text.length+Math.min(s.offset,t.length));for(let s=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,s),o=this.lineSeparator.length):(l=i.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(s,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let c of this.points)c.node==e&&c.pos>this.text.length&&(c.pos-=o-1);s=r+o}}readNode(e){if(e.cmIgnore)return;let t=Mt.get(e),s=t&&t.overrideDOMText;if(s!=null){this.findPointInside(e,s.length);for(let i=s.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let s of this.points)s.node==e&&e.childNodes[s.offset]==t&&(s.pos=this.text.length)}findPointInside(e,t){for(let s of this.points)(e.nodeType==3?s.node==e:e.contains(s.node))&&(s.pos=this.text.length+(WY(e,s.node,s.offset)?t:0))}}function WY(n,e,t){for(;;){if(!e||t<Ji(e))return!1;if(e==n)return!0;t=vl(e)+1,e=e.parentNode}}class FC{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class HY{constructor(e,t,s,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,s,0))){let l=r||o?[]:qY(e),c=new VY(l,e.state);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=KY(l,this.bounds.from)}else{let l=e.observer.selectionRange,c=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Oy(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),f=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Oy(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((Le.ios||Le.chrome)&&e.state.selection.main.empty&&c!=f&&(h.from>0||h.to<e.state.doc.length)){let d=Math.min(c,f),g=Math.max(c,f),m=h.from-d,y=h.to-g;(m==0||m==1||d==0)&&(y==0||y==-1||g==e.state.doc.length)&&(c=0,f=e.state.doc.length)}this.newSel=le.single(f,c)}}}function wM(n,e){let t,{newSel:s}=e,i=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,c=i.from,f=null;(r===8||Le.android&&e.text.length<l-o)&&(c=i.to,f="end");let h=zY(n.state.doc.sliceString(o,l,Jc),e.text,c-o,f);h&&(Le.chrome&&r==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==Jc+Jc&&h.toB--,t={from:o+h.from,to:o+h.toA,insert:yt.of(e.text.slice(h.from,h.toB).split(Jc))})}else s&&(!n.hasFocus&&n.state.facet(po)||s.main.eq(i))&&(s=null);if(!t&&!s)return!1;if(!t&&e.typeOver&&!i.empty&&s&&s.main.empty?t={from:i.from,to:i.to,insert:n.state.doc.slice(i.from,i.to)}:t&&t.from>=i.from&&t.to<=i.to&&(t.from!=i.from||t.to!=i.to)&&i.to-i.from-(t.to-t.from)<=4?t={from:i.from,to:i.to,insert:n.state.doc.slice(i.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,i.to))}:(Le.mac||Le.android)&&t&&t.from==t.to&&t.from==i.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(s&&t.insert.length==2&&(s=le.single(s.main.anchor-1,s.main.head-1)),t={from:i.from,to:i.to,insert:yt.of([" "])}):Le.chrome&&t&&t.from==t.to&&t.from==i.head&&t.insert.toString()==`
 `&&n.lineWrapping&&(s&&(s=le.single(s.main.anchor-1,s.main.head-1)),t={from:i.from,to:i.to,insert:yt.of([" "])}),t)return $w(n,t,s,r);if(s&&!s.main.eq(i)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:s,scrollIntoView:o,userEvent:l}),!0}else return!1}function $w(n,e,t,s=-1){if(Le.ios&&n.inputState.flushIOSKey(e))return!0;let i=n.state.selection.main;if(Le.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&n.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ka(n.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||s==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&ka(n.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&ka(n.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=UY(n,e,t));return n.state.facet(aM).some(c=>c(n,e.from,e.to,r,l))||n.dispatch(l()),!0}function UY(n,e,t){let s,i=n.state,r=i.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=r.from<e.from?i.sliceDoc(r.from,e.from):"",c=r.to>e.to?i.sliceDoc(e.to,r.to):"";s=i.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+c))}else{let l=i.changes(e),c=t&&t.main.to<=l.newLength?t.main:void 0;if(i.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let f=n.state.sliceDoc(e.from,e.to),h,d=t&&yM(n,t.main.head);if(d){let y=e.insert.length-(e.to-e.from);h={from:d.from,to:d.to-y}}else h=n.state.doc.lineAt(r.head);let g=r.to-e.to,m=r.to-r.from;s=i.changeByRange(y=>{if(y.from==r.from&&y.to==r.to)return{changes:l,range:c||y.map(l)};let w=y.to-g,x=w-f.length;if(y.to-y.from!=m||n.state.sliceDoc(x,w)!=f||y.to>=h.from&&y.from<=h.to)return{range:y};let S=i.changes({from:x,to:w,insert:e.insert}),C=y.to-r.to;return{changes:S,range:c?le.range(Math.max(0,c.anchor+C),Math.max(0,c.head+C)):y.map(S)}})}else s={changes:l,selection:c&&i.selection.replaceRange(c)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),i.update(s,{userEvent:o,scrollIntoView:!0})}function zY(n,e,t,s){let i=Math.min(n.length,e.length),r=0;for(;r<i&&n.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==i&&n.length==e.length)return null;let o=n.length,l=e.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(s=="end"){let c=Math.max(0,r-Math.min(o,l));t-=o+c-r}if(o<r&&n.length<e.length){let c=t<=r&&t>=o?r-t:0;r-=c,l=r+(l-o),o=r}else if(l<r){let c=t<=r&&t>=l?r-t:0;r-=c,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function qY(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:s,focusNode:i,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new FC(t,s)),(i!=t||r!=s)&&e.push(new FC(i,r))),e}function KY(n,e){if(n.length==0)return null;let t=n[0].pos,s=n.length==2?n[1].pos:t;return t>-1&&s>-1?le.single(t+e,s+e):null}class jY{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Le.safari&&e.contentDOM.addEventListener("input",()=>null),Le.gecko&&cX(e.contentDOM.ownerDocument)}handleEvent(e){!tX(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let s=this.handlers[e];if(s){for(let i of s.observers)i(this.view,t);for(let i of s.handlers){if(t.defaultPrevented)break;if(i(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=GY(e),s=this.handlers,i=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=s[r];l&&o!=!l.handlers.length&&(i.removeEventListener(r,this.handleEvent),l=null),l||i.addEventListener(r,this.handleEvent,{passive:o})}for(let r in s)r!="scroll"&&!t[r]&&i.removeEventListener(r,this.handleEvent);this.handlers=t}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&&xM.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Le.android&&Le.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Le.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=SM.find(s=>s.keyCode==e.keyCode))&&!e.ctrlKey||YY.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,ka(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:Le.safari&&!Le.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!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 VC(n,e){return(t,s)=>{try{return e.call(n,s,t)}catch(i){Gn(t.state,i)}}}function GY(n){let e=Object.create(null);function t(s){return e[s]||(e[s]={observers:[],handlers:[]})}for(let s of n){let i=s.spec;if(i&&i.domEventHandlers)for(let r in i.domEventHandlers){let o=i.domEventHandlers[r];o&&t(r).handlers.push(VC(s.value,o))}if(i&&i.domEventObservers)for(let r in i.domEventObservers){let o=i.domEventObservers[r];o&&t(r).observers.push(VC(s.value,o))}}for(let s in vi)t(s).handlers.push(vi[s]);for(let s in ri)t(s).observers.push(ri[s]);return e}const SM=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],YY="dthko",xM=[16,17,18,20,91,92,224,225],$h=6;function Bh(n){return Math.max(0,n)*.7+8}function XY(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class QY{constructor(e,t,s,i){this.view=e,this.startEvent=t,this.style=s,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=rY(e.contentDOM),this.atoms=e.state.facet(Iw).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(bt.allowMultipleSelections)&&JY(e,t),this.dragging=eX(e,t)&&CM(t)==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&&XY(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,s=0,i=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=Pw(this.view);e.clientX-c.left<=i+$h?t=-Bh(i-e.clientX):e.clientX+c.right>=o-$h&&(t=Bh(e.clientX-o)),e.clientY-c.top<=r+$h?s=-Bh(r-e.clientY):e.clientY+c.bottom>=l-$h&&(s=Bh(e.clientY-l)),this.setScrollSpeed(t,s)}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,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let s=0;s<e.ranges.length;s++){let i=e.ranges[s],r=null;if(i.empty){let o=_d(this.atoms,i.from,0);o!=i.from&&(r=le.cursor(o,-1))}else{let o=_d(this.atoms,i.from,-1),l=_d(this.atoms,i.to,1);(o!=i.from||l!=i.to)&&(r=le.range(i.from==i.anchor?o:l,i.from==i.head?o:l))}r&&(t||(t=e.ranges.slice()),t[s]=r)}return t?le.create(t,e.mainIndex):e}select(e){let{view:t}=this,s=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!s.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:s,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function JY(n,e){let t=n.state.facet(iM);return t.length?t[0](e):Le.mac?e.metaKey:e.ctrlKey}function ZY(n,e){let t=n.state.facet(rM);return t.length?t[0](e):Le.mac?!e.altKey:!e.ctrlKey}function eX(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let s=Vu(n.root);if(!s||s.rangeCount==0)return!0;let i=s.getRangeAt(0).getClientRects();for(let r=0;r<i.length;r++){let o=i[r];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function tX(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,s;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(s=Mt.get(t))&&s.ignoreEvent(e))return!1;return!0}const vi=Object.create(null),ri=Object.create(null),_M=Le.ie&&Le.ie_version<15||Le.ios&&Le.webkit_version<604;function nX(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),EM(n,t.value)},50)}function ym(n,e,t){for(let s of n.facet(e))t=s(t,n);return t}function EM(n,e){e=ym(n.state,Dw,e);let{state:t}=n,s,i=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Uy!=null&&t.selection.ranges.every(c=>c.empty)&&Uy==r.toString()){let c=-1;s=t.changeByRange(f=>{let h=t.doc.lineAt(f.from);if(h.from==c)return{range:f};c=h.from;let d=t.toText((o?r.line(i++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:d},range:le.cursor(f.from+d.length)}})}else o?s=t.changeByRange(c=>{let f=r.line(i++);return{changes:{from:c.from,to:c.to,insert:f.text},range:le.cursor(c.from+f.length)}}):s=t.replaceSelection(r);n.dispatch(s,{userEvent:"input.paste",scrollIntoView:!0})}ri.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};vi.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);ri.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};ri.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};vi.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let s of n.state.facet(oM))if(t=s(n,e),t)break;if(!t&&e.button==0&&(t=rX(n,e)),t){let s=!n.hasFocus;n.inputState.startMouseSelection(new QY(n,e,t,s)),s&&n.observer.ignore(()=>{F2(n.contentDOM);let r=n.root.activeElement;r&&!r.contains(n.contentDOM)&&r.blur()});let i=n.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function WC(n,e,t,s){if(s==1)return le.cursor(e,t);if(s==2)return DY(n.state,e,t);{let i=Zt.find(n.docView,e),r=n.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:r.from,l=i?i.posAtEnd:r.to;return l<n.state.doc.length&&l==r.to&&l++,le.range(o,l)}}let HC=(n,e,t)=>e>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function sX(n,e,t,s){let i=Zt.find(n.docView,e);if(!i)return 1;let r=e-i.posAtStart;if(r==0)return 1;if(r==i.length)return-1;let o=i.coordsAt(r,-1);if(o&&HC(t,s,o))return-1;let l=i.coordsAt(r,1);return l&&HC(t,s,l)?1:o&&o.bottom>=s?-1:1}function UC(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:sX(n,t,e.clientX,e.clientY)}}const iX=Le.ie&&Le.ie_version<=11;let zC=null,qC=0,KC=0;function CM(n){if(!iX)return n.detail;let e=zC,t=KC;return zC=n,KC=Date.now(),qC=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(qC+1)%3:1}function rX(n,e){let t=UC(n,e),s=CM(e),i=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),i=i.map(r.changes))},get(r,o,l){let c=UC(n,r),f,h=WC(n,c.pos,c.bias,s);if(t.pos!=c.pos&&!o){let d=WC(n,t.pos,t.bias,s),g=Math.min(d.from,h.from),m=Math.max(d.to,h.to);h=g<h.from?le.range(g,m):le.range(m,g)}return o?i.replaceRange(i.main.extend(h.from,h.to)):l&&s==1&&i.ranges.length>1&&(f=oX(i,c.pos))?f:l?i.addRange(h):le.create([h])}}}function oX(n,e){for(let t=0;t<n.ranges.length;t++){let{from:s,to:i}=n.ranges[t];if(s<=e&&i>=e)return le.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}vi.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let i=n.docView.nearest(e.target);if(i&&i.isWidget){let r=i.posAtStart,o=r+i.length;(r>=t.to||o<=t.from)&&(t=le.range(r,o))}}let{inputState:s}=n;return s.mouseSelection&&(s.mouseSelection.dragging=!0),s.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",ym(n.state,Lw,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};vi.dragend=n=>(n.inputState.draggedContent=null,!1);function jC(n,e,t,s){if(t=ym(n.state,Dw,t),!t)return;let i=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=n.inputState,o=s&&r&&ZY(n,e)?{from:r.from,to:r.to}:null,l={from:i,insert:t},c=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}vi.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let s=Array(t.length),i=0,r=()=>{++i==t.length&&jC(n,e,s.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(s[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let s=e.dataTransfer.getData("Text");if(s)return jC(n,e,s,!0),!0}return!1};vi.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=_M?null:e.clipboardData;return t?(EM(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(nX(n),!1)};function lX(n,e){let t=n.dom.parentNode;if(!t)return;let s=t.appendChild(document.createElement("textarea"));s.style.cssText="position: fixed; left: -10000px; top: 10px",s.value=e,s.focus(),s.selectionEnd=e.length,s.selectionStart=0,setTimeout(()=>{s.remove(),n.focus()},50)}function aX(n){let e=[],t=[],s=!1;for(let i of n.selection.ranges)i.empty||(e.push(n.sliceDoc(i.from,i.to)),t.push(i));if(!e.length){let i=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>i&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),i=o.number}s=!0}return{text:ym(n,Lw,e.join(n.lineBreak)),ranges:t,linewise:s}}let Uy=null;vi.copy=vi.cut=(n,e)=>{let{text:t,ranges:s,linewise:i}=aX(n.state);if(!t&&!i)return!1;Uy=i?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:s,scrollIntoView:!0,userEvent:"delete.cut"});let r=_M?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(lX(n,t),!1)};const AM=Wr.define();function kM(n,e){let t=[];for(let s of n.facet(cM)){let i=s(n,e);i&&t.push(i)}return t?n.update({effects:t,annotations:AM.of(!0)}):null}function TM(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=kM(n.state,e);t?n.dispatch(t):n.update([])}},10)}ri.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),TM(n)};ri.blur=n=>{n.observer.clearSelectionRange(),TM(n)};ri.compositionstart=ri.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};ri.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,Le.chrome&&Le.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};ri.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};vi.beforeinput=(n,e)=>{var t,s;if(e.inputType=="insertReplacementText"&&n.observer.editContext){let r=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(r&&o.length){let l=o[0],c=n.posAtDOM(l.startContainer,l.startOffset),f=n.posAtDOM(l.endContainer,l.endOffset);return $w(n,{from:c,to:f,insert:n.state.toText(r)},null),!0}}let i;if(Le.chrome&&Le.android&&(i=SM.find(r=>r.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let r=((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return Le.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),Le.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>ri.compositionend(n,e),20),!1};const GC=new Set;function cX(n){GC.has(n)||(GC.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const YC=["pre-wrap","normal","pre-line","break-spaces"];let Xa=!1;function XC(){Xa=!1}class uX{constructor(e){this.lineWrapping=e,this.doc=yt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let s=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(s+=Math.max(0,Math.ceil((t-e-s*this.lineLength*.5)/this.lineLength))),this.lineHeight*s}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return YC.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let s=0;s<e.length;s++){let i=e[s];i<0?s++:this.heightSamples[Math.floor(i*10)]||(t=!0,this.heightSamples[Math.floor(i*10)]=!0)}return t}refresh(e,t,s,i,r,o){let l=YC.indexOf(e)>-1,c=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=s,this.textHeight=i,this.lineLength=r,c){this.heightSamples={};for(let f=0;f<o.length;f++){let h=o[f];h<0?f++:this.heightSamples[Math.floor(h*10)]=!0}}return c}}class fX{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Wi{constructor(e,t,s,i,r){this.from=e,this.length=t,this.top=s,this.height=i,this._content=r}get type(){return typeof this._content=="number"?Qn.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 To?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Wi(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Bt=(function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n})(Bt||(Bt={}));const Ed=.001;class Jn{constructor(e,t,s=2){this.length=e,this.height=t,this.flags=s}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)>Ed&&(Xa=!0),this.height=e)}replace(e,t,s){return Jn.of(s)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,s,i){let r=this,o=s.doc;for(let l=i.length-1;l>=0;l--){let{fromA:c,toA:f,fromB:h,toB:d}=i[l],g=r.lineAt(c,Bt.ByPosNoHeight,s.setDoc(t),0,0),m=g.to>=f?g:r.lineAt(f,Bt.ByPosNoHeight,s,0,0);for(d+=m.to-f,f=m.to;l>0&&g.from<=i[l-1].toA;)c=i[l-1].fromA,h=i[l-1].fromB,l--,c<g.from&&(g=r.lineAt(c,Bt.ByPosNoHeight,s,0,0));h+=g.from-c,c=g.from;let y=Bw.build(s.setDoc(o),e,h,d);r=mp(r,r.replace(c,f,y))}return r.updateHeight(s,0)}static empty(){return new Ts(0,0)}static of(e){if(e.length==1)return e[0];let t=0,s=e.length,i=0,r=0;for(;;)if(t==s)if(i>r*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),s+=1+l.break,i-=l.size}else if(r>i*2){let l=e[s];l.break?e.splice(s,1,l.left,null,l.right):e.splice(s,1,l.left,l.right),s+=2+l.break,r-=l.size}else break;else if(i<r){let l=e[t++];l&&(i+=l.size)}else{let l=e[--s];l&&(r+=l.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,s++),new hX(Jn.of(e.slice(0,t)),o,Jn.of(e.slice(s)))}}function mp(n,e){return n==e?n:(n.constructor!=e.constructor&&(Xa=!0),e)}Jn.prototype.size=1;class OM extends Jn{constructor(e,t,s){super(e,t),this.deco=s}blockAt(e,t,s,i){return new Wi(i,this.length,s,this.height,this.deco||0)}lineAt(e,t,s,i,r){return this.blockAt(0,s,i,r)}forEachLine(e,t,s,i,r,o){e<=r+this.length&&t>=r&&o(this.blockAt(0,s,i,r))}updateHeight(e,t=0,s=!1,i){return i&&i.from<=t&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ts extends OM{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,s,i){return new Wi(i,this.length,s,this.height,this.breaks)}replace(e,t,s){let i=s[0];return s.length==1&&(i instanceof Ts||i instanceof Sn&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Sn?i=new Ts(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Jn.of(s)}updateHeight(e,t=0,s=!1,i){return i&&i.from<=t&&i.more?this.setHeight(i.heights[i.index++]):(s||this.outdated)&&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 Sn extends Jn{constructor(e){super(e,0)}heightMetrics(e,t){let s=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,r=i-s+1,o,l=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*r);o=c/r,this.length>r+1&&(l=(this.height-c)/(this.length-r-1))}else o=this.height/r;return{firstLine:s,lastLine:i,perLine:o,perChar:l}}blockAt(e,t,s,i){let{firstLine:r,lastLine:o,perLine:l,perChar:c}=this.heightMetrics(t,i);if(t.lineWrapping){let f=i+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-s)/this.height))*this.length)),h=t.doc.lineAt(f),d=l+h.length*c,g=Math.max(s,e-d/2);return new Wi(h.from,h.length,g,d,0)}else{let f=Math.max(0,Math.min(o-r,Math.floor((e-s)/l))),{from:h,length:d}=t.doc.line(r+f);return new Wi(h,d,s+l*f,l,0)}}lineAt(e,t,s,i,r){if(t==Bt.ByHeight)return this.blockAt(e,s,i,r);if(t==Bt.ByPosNoHeight){let{from:m,to:y}=s.doc.lineAt(e);return new Wi(m,y-m,0,0,0)}let{firstLine:o,perLine:l,perChar:c}=this.heightMetrics(s,r),f=s.doc.lineAt(e),h=l+f.length*c,d=f.number-o,g=i+l*d+c*(f.from-r-d);return new Wi(f.from,f.length,Math.max(i,Math.min(g,i+this.height-h)),h,0)}forEachLine(e,t,s,i,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:c,perChar:f}=this.heightMetrics(s,r);for(let h=e,d=i;h<=t;){let g=s.doc.lineAt(h);if(h==e){let y=g.number-l;d+=c*y+f*(e-r-y)}let m=c+f*g.length;o(new Wi(g.from,g.length,d,m,0)),d+=m,h=g.to+1}}replace(e,t,s){let i=this.length-t;if(i>0){let r=s[s.length-1];r instanceof Sn?s[s.length-1]=new Sn(r.length+i):s.push(null,new Sn(i-1))}if(e>0){let r=s[0];r instanceof Sn?s[0]=new Sn(e+r.length):s.unshift(new Sn(e-1),null)}return Jn.of(s)}decomposeLeft(e,t){t.push(new Sn(e-1),null)}decomposeRight(e,t){t.push(null,new Sn(this.length-e-1))}updateHeight(e,t=0,s=!1,i){let r=t+this.length;if(i&&i.from<=t+this.length&&i.more){let o=[],l=Math.max(t,i.from),c=-1;for(i.from>t&&o.push(new Sn(i.from-t-1).updateHeight(e,t));l<=r&&i.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let d=i.heights[i.index++];c==-1?c=d:Math.abs(d-c)>=Ed&&(c=-2);let g=new Ts(h,d);g.outdated=!1,o.push(g),l+=h+1}l<=r&&o.push(null,new Sn(r-l).updateHeight(e,l));let f=Jn.of(o);return(c<0||Math.abs(f.height-this.height)>=Ed||Math.abs(c-this.heightMetrics(e,t).perLine)>=Ed)&&(Xa=!0),mp(this,f)}else(s||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class hX extends Jn{constructor(e,t,s){super(e.length+t+s.length,e.height+s.height,t|(e.outdated||s.outdated?2:0)),this.left=e,this.right=s,this.size=e.size+s.size}get break(){return this.flags&1}blockAt(e,t,s,i){let r=s+this.left.height;return e<r?this.left.blockAt(e,t,s,i):this.right.blockAt(e,t,r,i+this.left.length+this.break)}lineAt(e,t,s,i,r){let o=i+this.left.height,l=r+this.left.length+this.break,c=t==Bt.ByHeight?e<o:e<l,f=c?this.left.lineAt(e,t,s,i,r):this.right.lineAt(e,t,s,o,l);if(this.break||(c?f.to<l:f.from>l))return f;let h=t==Bt.ByPosNoHeight?Bt.ByPosNoHeight:Bt.ByPos;return c?f.join(this.right.lineAt(l,h,s,o,l)):this.left.lineAt(l,h,s,i,r).join(f)}forEachLine(e,t,s,i,r,o){let l=i+this.left.height,c=r+this.left.length+this.break;if(this.break)e<c&&this.left.forEachLine(e,t,s,i,r,o),t>=c&&this.right.forEachLine(e,t,s,l,c,o);else{let f=this.lineAt(c,Bt.ByPos,s,i,r);e<f.from&&this.left.forEachLine(e,f.from-1,s,i,r,o),f.to>=e&&f.from<=t&&o(f),t>f.to&&this.right.forEachLine(f.to+1,t,s,l,c,o)}}replace(e,t,s){let i=this.left.length+this.break;if(t<i)return this.balanced(this.left.replace(e,t,s),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,s));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of s)r.push(l);if(e>0&&QC(r,o-1),t<this.length){let l=r.length;this.decomposeRight(t,r),QC(r,l)}return Jn.of(r)}decomposeLeft(e,t){let s=this.left.length;if(e<=s)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(s++,e>=s&&t.push(null)),e>s&&this.right.decomposeLeft(e-s,t)}decomposeRight(e,t){let s=this.left.length,i=s+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e<s&&this.left.decomposeRight(e,t),this.break&&e<i&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Jn.of(this.break?[e,null,t]:[e,t]):(this.left=mp(this.left,e),this.right=mp(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,s=!1,i){let{left:r,right:o}=this,l=t+r.length+this.break,c=null;return i&&i.from<=t+r.length&&i.more?c=r=r.updateHeight(e,t,s,i):r.updateHeight(e,t,s),i&&i.from<=l+o.length&&i.more?c=o=o.updateHeight(e,l,s,i):o.updateHeight(e,l,s),c?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function QC(n,e){let t,s;n[e]==null&&(t=n[e-1])instanceof Sn&&(s=n[e+1])instanceof Sn&&n.splice(e-1,3,new Sn(t.length+1+s.length))}const dX=5;class Bw{constructor(e,t){this.pos=e,this.oracle=t,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,t){if(this.lineStart>-1){let s=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Ts?i.length+=s-this.pos:(s>this.pos||!this.isCovered)&&this.nodes.push(new Ts(s-this.pos,-1)),this.writtenTo=s,t>s&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,s){if(e<t||s.heightRelevant){let i=s.widget?s.widget.estimatedHeight:0,r=s.widget?s.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=t-e;s.block?this.addBlock(new OM(o,i,s)):(o||r||i>=dX)&&this.addLineDeco(i,r,o)}else t>e&&this.span(e,t);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:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,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 Ts(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let s=new Sn(t-e);return this.oracle.doc.lineAt(e).to==t&&(s.flags|=4),s}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ts)return e;let t=new Ts(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,s){let i=this.ensureLine();i.length+=s,i.collapsed+=s,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+s}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ts)&&!this.isCovered?this.nodes.push(new Ts(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let s=e;for(let i of this.nodes)i instanceof Ts&&i.updateHeight(this.oracle,s),s+=i?i.length:1;return this.nodes}static build(e,t,s,i){let r=new Bw(s,e);return pt.spans(t,s,i,r,0),r.finish(s)}}function pX(n,e,t){let s=new mX;return pt.compare(n,e,t,s,0),s.changes}class mX{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,s,i){(e<t||s&&s.heightRelevant||i&&i.heightRelevant)&&Iy(e,t,this.changes,5)}}function gX(n,e){let t=n.getBoundingClientRect(),s=n.ownerDocument,i=s.defaultView||window,r=Math.max(0,t.left),o=Math.min(i.innerWidth,t.right),l=Math.max(0,t.top),c=Math.min(i.innerHeight,t.bottom);for(let f=n.parentNode;f&&f!=s.body;)if(f.nodeType==1){let h=f,d=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&d.overflow!="visible"){let g=h.getBoundingClientRect();r=Math.max(r,g.left),o=Math.min(o,g.right),l=Math.max(l,g.top),c=Math.min(f==n.parentNode?i.innerHeight:c,g.bottom)}f=d.position=="absolute"||d.position=="fixed"?h.offsetParent:h.parentNode}else if(f.nodeType==11)f=f.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,c)-(t.top+e)}}function bX(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Qb{constructor(e,t,s,i){this.from=e,this.to=t,this.size=s,this.displaySize=i}static same(e,t){if(e.length!=t.length)return!1;for(let s=0;s<e.length;s++){let i=e[s],r=t[s];if(i.from!=r.from||i.to!=r.to||i.size!=r.size)return!1}return!0}draw(e,t){return je.replace({widget:new yX(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class yX extends No{constructor(e,t){super(),this.size=e,this.vertical=t}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 JC{constructor(e){this.state=e,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.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=ZC,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Ft.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Nw).some(s=>typeof s!="function"&&s.class=="cm-lineWrapping");this.heightOracle=new uX(t),this.stateDeco=e.facet(Hu).filter(s=>typeof s!="function"),this.heightMap=Jn.empty().applyChanges(this.stateDeco,yt.empty,this.heightOracle.setDoc(e.doc),[new Zs(0,0,0,e.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=je.set(this.lineGaps.map(s=>s.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let s=0;s<=1;s++){let i=s?t.head:t.anchor;if(!e.some(({from:r,to:o})=>i>=r&&i<=o)){let{from:r,to:o}=this.lineBlockAt(i);e.push(new Fh(r,o))}}return this.viewports=e.sort((s,i)=>s.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?ZC:new Fw(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(Zc(e,this.scaler))})}update(e,t=null){this.state=e.state;let s=this.stateDeco;this.stateDeco=this.state.facet(Hu).filter(h=>typeof h!="function");let i=e.changedRanges,r=Zs.extendWithRanges(i,pX(s,this.stateDeco,e?e.changes:ln.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);XC(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||Xa)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let c=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<c.from||t.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,t));let f=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(f||!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(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(fM)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,s=window.getComputedStyle(t),i=this.heightOracle,r=s.whiteSpace;this.defaultTextDirection=s.direction=="rtl"?Ft.RTL:Ft.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),c=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let f=0,h=0;if(l.width&&l.height){let{scaleX:k,scaleY:R}=B2(t,l);(k>.005&&Math.abs(this.scaleX-k)>.005||R>.005&&Math.abs(this.scaleY-R)>.005)&&(this.scaleX=k,this.scaleY=R,f|=8,o=c=!0)}let d=(parseInt(s.paddingTop)||0)*this.scaleY,g=(parseInt(s.paddingBottom)||0)*this.scaleY;(this.paddingTop!=d||this.paddingBottom!=g)&&(this.paddingTop=d,this.paddingBottom=g,f|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,f|=8);let m=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=m&&(this.scrollAnchorHeight=-1,this.scrollTop=m),this.scrolledToBottom=W2(e.scrollDOM);let y=(this.printing?bX:gX)(t,this.paddingTop),w=y.top-this.pixelViewport.top,x=y.bottom-this.pixelViewport.bottom;this.pixelViewport=y;let S=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(S!=this.inView&&(this.inView=S,S&&(c=!0)),!this.inView&&!this.scrollTarget)return 0;let C=l.width;if((this.contentDOMWidth!=C||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,f|=8),c){let k=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(k)&&(o=!0),o||i.lineWrapping&&Math.abs(C-this.contentDOMWidth)>i.charWidth){let{lineHeight:R,charWidth:T,textHeight:L}=e.docView.measureTextSize();o=R>0&&i.refresh(r,R,T,L,C/T,k),o&&(e.docView.minWidth=0,f|=8)}w>0&&x>0?h=Math.max(w,x):w<0&&x<0&&(h=Math.min(w,x)),XC();for(let R of this.viewports){let T=R.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(R);this.heightMap=(o?Jn.empty().applyChanges(this.stateDeco,yt.empty,this.heightOracle,[new Zs(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new fX(R.from,T))}Xa&&(f|=2)}let E=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return E&&(f&2&&(f|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),f|=this.updateForViewport()),(f&2||E)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),f|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),f}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let s=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,c=new Fh(i.lineAt(o-s*1e3,Bt.ByHeight,r,0,0).from,i.lineAt(l+(1-s)*1e3,Bt.ByHeight,r,0,0).to);if(t){let{head:f}=t.range;if(f<c.from||f>c.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),d=i.lineAt(f,Bt.ByPos,r,0,0),g;t.y=="center"?g=(d.top+d.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&f<c.from?g=d.top:g=d.bottom-h,c=new Fh(i.lineAt(g-1e3/2,Bt.ByHeight,r,0,0).from,i.lineAt(g+h+1e3/2,Bt.ByHeight,r,0,0).to)}}return c}mapViewport(e,t){let s=t.mapPos(e.from,-1),i=t.mapPos(e.to,1);return new Fh(this.heightMap.lineAt(s,Bt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,Bt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},s=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,Bt.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,Bt.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||i<=o-Math.max(10,Math.min(-s,250)))&&(t==this.state.doc.length||r>=l+Math.max(10,Math.min(s,250)))&&i>o-2*1e3&&r<l+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let s=[];for(let i of e)t.touchesRange(i.from,i.to)||s.push(new Qb(t.mapPos(i.from),t.mapPos(i.to),i.size,i.displaySize));return s}ensureLineGaps(e,t){let s=this.heightOracle.lineWrapping,i=s?1e4:2e3,r=i>>1,o=i<<1;if(this.defaultTextDirection!=Ft.LTR&&!s)return[];let l=[],c=(h,d,g,m)=>{if(d-h<r)return;let y=this.state.selection.main,w=[y.from];y.empty||w.push(y.to);for(let S of w)if(S>h&&S<d){c(h,S-10,g,m),c(S+10,d,g,m);return}let x=wX(e,S=>S.from>=g.from&&S.to<=g.to&&Math.abs(S.from-h)<r&&Math.abs(S.to-d)<r&&!w.some(C=>S.from<C&&S.to>C));if(!x){if(d<g.to&&t&&s&&t.visibleRanges.some(E=>E.from<=d&&E.to>=d)){let E=t.moveToLineBoundary(le.cursor(d),!1,!0).head;E>h&&(d=E)}let S=this.gapSize(g,h,d,m),C=s||S<2e6?S:2e6;x=new Qb(h,d,S,C)}l.push(x)},f=h=>{if(h.length<o||h.type!=Qn.Text)return;let d=vX(h.from,h.to,this.stateDeco);if(d.total<o)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,m,y;if(s){let w=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,x,S;if(g!=null){let C=Wh(d,g),E=((this.visibleBottom-this.visibleTop)/2+w)/h.height;x=C-E,S=C+E}else x=(this.visibleTop-h.top-w)/h.height,S=(this.visibleBottom-h.top+w)/h.height;m=Vh(d,x),y=Vh(d,S)}else{let w=d.total*this.heightOracle.charWidth,x=i*this.heightOracle.charWidth,S=0;if(w>2e6)for(let T of e)T.from>=h.from&&T.from<h.to&&T.size!=T.displaySize&&T.from*this.heightOracle.charWidth+S<this.pixelViewport.left&&(S=T.size-T.displaySize);let C=this.pixelViewport.left+S,E=this.pixelViewport.right+S,k,R;if(g!=null){let T=Wh(d,g),L=((E-C)/2+x)/w;k=T-L,R=T+L}else k=(C-x)/w,R=(E+x)/w;m=Vh(d,k),y=Vh(d,R)}m>h.from&&c(h.from,m,h,d),y<h.to&&c(y,h.to,h,d)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(f):f(h);return l}gapSize(e,t,s,i){let r=Wh(i,s)-Wh(i,t);return this.heightOracle.lineWrapping?e.height*r:i.total*this.heightOracle.charWidth*r}updateLineGaps(e){Qb.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=je.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];pt.spans(e,this.viewport.from,this.viewport.to,{span(i,r){t.push({from:i,to:r})},point(){}},20);let s=t.length!=this.visibleRanges.length||this.visibleRanges.some((i,r)=>i.from!=t[r].from||i.to!=t[r].to);return this.visibleRanges=t,s?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Zc(this.heightMap.lineAt(e,Bt.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(t=>t.top<=e&&t.bottom>=e)||Zc(this.heightMap.lineAt(this.scaler.fromDOM(e),Bt.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Zc(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 Fh{constructor(e,t){this.from=e,this.to=t}}function vX(n,e,t){let s=[],i=n,r=0;return pt.spans(t,n,e,{span(){},point(o,l){o>i&&(s.push({from:i,to:o}),r+=o-i),i=l}},20),i<e&&(s.push({from:i,to:e}),r+=e-i),{total:r,ranges:s}}function Vh({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let s=Math.floor(n*t);for(let i=0;;i++){let{from:r,to:o}=e[i],l=o-r;if(s<=l)return r+s;s-=l}}function Wh(n,e){let t=0;for(let{from:s,to:i}of n.ranges){if(e<=i){t+=e-s;break}t+=i-s}return t/n.total}function wX(n,e){for(let t of n)if(e(t))return t}const ZC={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};class Fw{constructor(e,t,s){let i=0,r=0,o=0;this.viewports=s.map(({from:l,to:c})=>{let f=t.lineAt(l,Bt.ByPos,e,0,0).top,h=t.lineAt(c,Bt.ByPos,e,0,0).bottom;return i+=h-f,{from:l,to:c,top:f,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,s=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return i+(e-s)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);s=r.bottom,i=r.domBottom}}fromDOM(e){for(let t=0,s=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return s+(e-i)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);s=r.bottom,i=r.domBottom}}eq(e){return e instanceof Fw?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,s)=>t.from==e.viewports[s].from&&t.to==e.viewports[s].to):!1}}function Zc(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),s=e.toDOM(n.bottom);return new Wi(n.from,n.length,t,s-t,Array.isArray(n._content)?n._content.map(i=>Zc(i,e)):n._content)}const Hh=Re.define({combine:n=>n.join(" ")}),zy=Re.define({combine:n=>n.indexOf(!0)>-1}),qy=Ao.newName(),RM=Ao.newName(),MM=Ao.newName(),DM={"&light":"."+RM,"&dark":"."+MM};function Ky(n,e,t){return new Ao(e,{finish(s){return/&/.test(s)?s.replace(/&\w*/,i=>{if(i=="&")return n;if(!t||!t[i])throw new RangeError(`Unsupported selector: ${i}`);return t[i]}):n+" "+s}})}const SX=Ky("."+qy,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-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",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-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"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},DM),xX={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Jb=Le.ie&&Le.ie_version<=11;class _X{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new oY,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(t=>{for(let s of t)this.queue.push(s);(Le.ie&&Le.ie_version<=11||Le.ios&&e.composing)&&t.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(Le.chrome&&Le.chrome_version<126)&&(this.editContext=new CX(e),e.state.facet(po)&&(e.contentDOM.editContext=this.editContext.editContext)),Jb&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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 t;((t=this.view.docView)===null||t===void 0?void 0:t.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(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.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(t=>{t.length>0&&t[t.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((t,s)=>t!=e[s]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:s}=this,i=this.selectionRange;if(s.state.facet(po)?s.root.activeElement!=this.dom:!xd(this.dom,i))return;let r=i.anchorNode&&s.docView.nearest(i.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Le.ie&&Le.ie_version<=11||Le.android&&Le.chrome)&&!s.state.selection.main.empty&&i.focusNode&&yu(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Vu(e.root);if(!t)return!1;let s=Le.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&EX(this.view,t)||t;if(!s||this.selectionRange.eq(s))return!1;let i=xd(this.dom,s);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&aY(this.dom,s)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(s),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let s=this.dom;s;)if(s.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==s?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);for(let s of this.scrollTargets=t)s.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,xX),Jb&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Jb&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var s;if(!this.delayedAndroidKey){let i=()=>{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&ka(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((s=this.delayedAndroidKey)===null||s===void 0)&&s.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 t=-1,s=-1,i=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(i=!0),t==-1?{from:t,to:s}=o:(t=Math.min(o.from,t),s=Math.max(o.to,s)))}return{from:t,to:s,typeOver:i}}readChange(){let{from:e,to:t,typeOver:s}=this.processRecords(),i=this.selectionChanged&&xd(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new HY(this.view,e,t,s);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let s=this.view.state,i=wM(this.view,t);return this.view.state==s&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let s=eA(t,e.previousSibling||e.target.previousSibling,-1),i=eA(t,e.nextSibling||e.target.nextSibling,1);return{from:s?t.posAfter(s):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.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(po)!=e.state.facet(po)&&(e.view.contentDOM.editContext=e.state.facet(po)?this.editContext.editContext:null))}destroy(){var e,t,s;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(s=this.resizeScroll)===null||s===void 0||s.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function eA(n,e,t){for(;e;){let s=Mt.get(e);if(s&&s.parent==n)return s;let i=e.parentNode;e=i!=n.dom?i:t>0?e.nextSibling:e.previousSibling}return null}function tA(n,e){let t=e.startContainer,s=e.startOffset,i=e.endContainer,r=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return yu(o.node,o.offset,i,r)&&([t,s,i,r]=[i,r,t,s]),{anchorNode:t,anchorOffset:s,focusNode:i,focusOffset:r}}function EX(n,e){if(e.getComposedRanges){let i=e.getComposedRanges(n.root)[0];if(i)return tA(n,i)}let t=null;function s(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",s,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",s,!0),t?tA(n,t):null}class CX{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=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=s=>{let{anchor:i}=e.state.selection.main,r=this.toEditorPos(s.updateRangeStart),o=this.toEditorPos(s.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:s.updateRangeStart,editorBase:r,drifted:!1});let l={from:r,to:o,insert:yt.of(s.text.split(`
`))};l.from==this.from&&i<this.from?l.from=i:l.to==this.to&&i>this.to&&(l.to=i),!(l.from==l.to&&!l.insert.length)&&(this.pendingContextChange=l,e.state.readOnly||$w(e,l,le.single(this.toEditorPos(s.selectionStart),this.toEditorPos(s.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=s=>{let i=[],r=null;for(let o=this.toEditorPos(s.rangeStart),l=this.toEditorPos(s.rangeEnd);o<l;o++){let c=e.coordsForChar(o);r=c&&new DOMRect(c.left,c.top,c.right-c.left,c.bottom-c.top)||r||new DOMRect,i.push(r)}t.updateCharacterBounds(s.rangeStart,i)},this.handlers.textformatupdate=s=>{let i=[];for(let r of s.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let c=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;i.push(je.mark({attributes:{style:c}}).range(this.toEditorPos(r.rangeStart),this.toEditorPos(r.rangeEnd)))}}e.dispatch({effects:dM.of(je.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:s}=this.composing;this.composing=null,s&&this.reset(e.state)}};for(let s in this.handlers)t.addEventListener(s,this.handlers[s]);this.measureReq={read:s=>{this.editContext.updateControlBounds(s.contentDOM.getBoundingClientRect());let i=Vu(s.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,s=!1,i=this.pendingContextChange;return e.changes.iterChanges((r,o,l,c,f)=>{if(s)return;let h=f.length-(o-r);if(i&&o>=i.to)if(i.from==r&&i.to==o&&i.insert.eq(f)){i=this.pendingContextChange=null,t+=h,this.to+=h;return}else i=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+f.length>3e4){s=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),f.toString()),this.to+=h}t+=h}),i&&!s&&this.revertPending(e.state),!s}update(e){let t=this.pendingContextChange;this.composing&&(this.composing.drifted||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||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+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 t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,s=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),i=this.toContextPos(t.head);(this.editContext.selectionStart!=s||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(s,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e){let t=this.composing;return t&&t.drifted?t.editorBase+(e-t.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Oe{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.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;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:s}=e;this.dispatchTransactions=e.dispatchTransactions||s&&(i=>i.forEach(r=>s(r,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||lY(e.parent)||document,this.viewState=new JC(e.state||bt.create(e)),e.scrollTo&&e.scrollTo.is(Ph)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Xc).map(i=>new Gb(i));for(let i of this.plugins)i.update(this);this.observer=new _X(this),this.inputState=new jY(this),this.inputState.ensureHandlers(this.plugins),this.docView=new LC(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof an?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,s=!1,i,r=this.state;for(let g of e){if(g.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=g.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,c=null;e.some(g=>g.annotation(AM))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=kM(r,o),c||(l=1));let f=this.observer.delayedAndroidKey,h=null;if(f?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(bt.phrases)!=this.state.facet(bt.phrases))return this.setState(r);i=pp.create(this,r,e),i.flags|=l;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(d&&(d=d.map(g.changes)),g.scrollIntoView){let{main:m}=g.state.selection;d=new Ta(m.empty?m:le.cursor(m.head,m.head>m.anchor?-1:1))}for(let m of g.effects)m.is(Ph)&&(d=m.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=gp.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(Qc)!=this.styleModules&&this.mountStyles(),s=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Hh)!=i.state.facet(Hh)&&(this.viewState.mustMeasureContent=!0),(t||s||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!i.empty)for(let g of this.state.facet(Vy))try{g(i)}catch(m){Gn(this.state,m,"update listener")}(c||h)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),h&&!wM(this,h)&&f.force&&ka(this.contentDOM,f.key,f.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 t=this.hasFocus;try{for(let s of this.plugins)s.destroy(this);this.viewState=new JC(e),this.plugins=e.facet(Xc).map(s=>new Gb(s)),this.pluginMap.clear();for(let s of this.plugins)s.update(this);this.docView.destroy(),this.docView=new LC(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Xc),s=e.state.facet(Xc);if(t!=s){let i=[];for(let r of s){let o=t.indexOf(r);if(o<0)i.push(new Gb(r));else{let l=this.plugins[o];l.mustUpdate=e,i.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);t!=s&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(s){Gn(this.state,s,"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 t=null,s=this.scrollDOM,i=s.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(W2(s))r=-1,o=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(i);r=m.from,o=m.top}this.updateState=1;let c=this.viewState.measure(this);if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let f=[];c&4||([this.measureRequests,f]=[f,this.measureRequests]);let h=f.map(m=>{try{return m.read(this)}catch(y){return Gn(this.state,y),nA}}),d=pp.create(this,this.state,[]),g=!1;d.flags|=c,t?t.flags|=c:t=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),g=this.docView.update(d),g&&this.docViewUpdate());for(let m=0;m<f.length;m++)if(h[m]!=nA)try{let y=f[m];y.write&&y.write(h[m],this)}catch(y){Gn(this.state,y)}if(g&&this.docView.updateSelection(!0),!d.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let y=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(y>1||y<-1){i=i+y,s.scrollTop=i/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Vy))l(t)}get themeClasses(){return qy+" "+(this.state.facet(zy)?MM:RM)+" "+this.state.facet(Hh)}updateAttrs(){let e=sA(this,pM,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(po)?"true":"false",class:"cm-content",style:`${Le.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),sA(this,Nw,t);let s=this.observer.ignore(()=>{let i=Ny(this.contentDOM,this.contentAttrs,t),r=Ny(this.dom,this.editorAttrs,e);return i||r});return this.editorAttrs=e,this.contentAttrs=t,s}showAnnouncements(e){let t=!0;for(let s of e)for(let i of s.effects)if(i.is(Oe.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Qc);let e=this.state.facet(Oe.cspNonce);Ao.mount(this.root,this.styleModules.concat(SX).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 t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(s=>s.spec==e)||null),t&&t.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,t,s){return Xb(this,e,BC(this,e,t,s))}moveByGroup(e,t){return Xb(this,e,BC(this,e,t,s=>BY(this,e.head,s)))}visualLineSide(e,t){let s=this.bidiSpans(e),i=this.textDirectionAt(e.from),r=s[t?s.length-1:0];return le.cursor(r.side(t,i)+e.from,r.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,s=!0){return $Y(this,e,t,s)}moveVertically(e,t,s){return Xb(this,e,FY(this,e,t,s))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),vM(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let s=this.docView.coordsAt(e,t);if(!s||s.left==s.right)return s;let i=this.state.doc.lineAt(e),r=this.bidiSpans(i),o=r[yo.find(r,e-i.from,-1,t)];return gm(s,o.dir==Ft.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(uM)||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>AX)return nM(e.length);let t=this.textDirectionAt(e.from),s;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||tM(r.isolates,s=DC(this,e))))return r.order;s||(s=DC(this,e));let i=SY(e.text,t,s);return this.bidiCache.push(new gp(e.from,e.to,t,s,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Le.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{F2(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,t={}){return Ph.of(new Ta(typeof e=="number"?le.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,s=this.viewState.scrollAnchorAt(e);return Ph.of(new Ta(le.cursor(s.from),"start","start",s.top-e,t,!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 Jt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Jt.define(()=>({}),{eventObservers:e})}static theme(e,t){let s=Ao.newName(),i=[Hh.of(s),Qc.of(Ky(`.${s}`,e))];return t&&t.dark&&i.push(zy.of(!0)),i}static baseTheme(e){return kl.lowest(Qc.of(Ky("."+qy,e,DM)))}static findFromDOM(e){var t;let s=e.querySelector(".cm-content"),i=s&&Mt.get(s)||Mt.get(e);return((t=i?.rootView)===null||t===void 0?void 0:t.view)||null}}Oe.styleModule=Qc;Oe.inputHandler=aM;Oe.clipboardInputFilter=Dw;Oe.clipboardOutputFilter=Lw;Oe.scrollHandler=hM;Oe.focusChangeEffect=cM;Oe.perLineTextDirection=uM;Oe.exceptionSink=lM;Oe.updateListener=Vy;Oe.editable=po;Oe.mouseSelectionStyle=oM;Oe.dragMovesSelection=rM;Oe.clickAddsSelectionRange=iM;Oe.decorations=Hu;Oe.outerDecorations=mM;Oe.atomicRanges=Iw;Oe.bidiIsolatedRanges=gM;Oe.scrollMargins=bM;Oe.darkTheme=zy;Oe.cspNonce=Re.define({combine:n=>n.length?n[0]:""});Oe.contentAttributes=Nw;Oe.editorAttributes=pM;Oe.lineWrapping=Oe.contentAttributes.of({class:"cm-lineWrapping"});Oe.announce=tt.define();const AX=4096,nA={};class gp{constructor(e,t,s,i,r,o){this.from=e,this.to=t,this.dir=s,this.isolates=i,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let s=[],i=e.length?e[e.length-1].dir:Ft.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir==i&&!t.touchesRange(o.from,o.to)&&s.push(new gp(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return s}}function sA(n,e,t){for(let s=n.state.facet(e),i=s.length-1;i>=0;i--){let r=s[i],o=typeof r=="function"?r(n):r;o&&Ly(o,t)}return t}const kX=Le.mac?"mac":Le.windows?"win":Le.linux?"linux":"key";function TX(n,e){const t=n.split(/-(?!$)/);let s=t[t.length-1];s=="Space"&&(s=" ");let i,r,o,l;for(let c=0;c<t.length-1;++c){const f=t[c];if(/^(cmd|meta|m)$/i.test(f))l=!0;else if(/^a(lt)?$/i.test(f))i=!0;else if(/^(c|ctrl|control)$/i.test(f))r=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))e=="mac"?l=!0:r=!0;else throw new Error("Unrecognized modifier name: "+f)}return i&&(s="Alt-"+s),r&&(s="Ctrl-"+s),l&&(s="Meta-"+s),o&&(s="Shift-"+s),s}function Uh(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const OX=kl.default(Oe.domEventHandlers({keydown(n,e){return NM(LM(e.state),n,e,"editor")}})),vm=Re.define({enables:OX}),iA=new WeakMap;function LM(n){let e=n.facet(vm),t=iA.get(e);return t||iA.set(e,t=DX(e.reduce((s,i)=>s.concat(i),[]))),t}function RX(n,e,t){return NM(LM(n.state),e,n,t)}let mo=null;const MX=4e3;function DX(n,e=kX){let t=Object.create(null),s=Object.create(null),i=(o,l)=>{let c=s[o];if(c==null)s[o]=l;else if(c!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,c,f,h)=>{var d,g;let m=t[o]||(t[o]=Object.create(null)),y=l.split(/ (?!$)/).map(S=>TX(S,e));for(let S=1;S<y.length;S++){let C=y.slice(0,S).join(" ");i(C,!0),m[C]||(m[C]={preventDefault:!0,stopPropagation:!1,run:[E=>{let k=mo={view:E,prefix:C,scope:o};return setTimeout(()=>{mo==k&&(mo=null)},MX),!0}]})}let w=y.join(" ");i(w,!1);let x=m[w]||(m[w]={preventDefault:!1,stopPropagation:!1,run:((g=(d=m._any)===null||d===void 0?void 0:d.run)===null||g===void 0?void 0:g.slice())||[]});c&&x.run.push(c),f&&(x.preventDefault=!0),h&&(x.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let f of l){let h=t[f]||(t[f]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:d}=o;for(let g in h)h[g].run.push(m=>d(m,jy))}let c=o[e]||o.key;if(c)for(let f of l)r(f,c,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(f,"Shift-"+c,o.shift,o.preventDefault,o.stopPropagation)}return t}let jy=null;function NM(n,e,t,s){jy=e;let i=nY(e),r=xn(i,0),o=js(r)==i.length&&i!=" ",l="",c=!1,f=!1,h=!1;mo&&mo.view==t&&mo.scope==s&&(l=mo.prefix+" ",xM.indexOf(e.keyCode)<0&&(f=!0,mo=null));let d=new Set,g=x=>{if(x){for(let S of x.run)if(!d.has(S)&&(d.add(S),S(t)))return x.stopPropagation&&(h=!0),!0;x.preventDefault&&(x.stopPropagation&&(h=!0),f=!0)}return!1},m=n[s],y,w;return m&&(g(m[l+Uh(i,e,!o)])?c=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Le.windows&&e.ctrlKey&&e.altKey)&&(y=ko[e.keyCode])&&y!=i?(g(m[l+Uh(y,e,!0)])||e.shiftKey&&(w=Fu[e.keyCode])!=i&&w!=y&&g(m[l+Uh(w,e,!1)]))&&(c=!0):o&&e.shiftKey&&g(m[l+Uh(i,e,!0)])&&(c=!0),!c&&g(m._any)&&(c=!0)),f&&(c=!0),c&&h&&e.stopPropagation(),jy=null,c}class bf{constructor(e,t,s,i,r){this.className=e,this.left=t,this.top=s,this.width=i,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.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,t,s){if(s.empty){let i=e.coordsAtPos(s.head,s.assoc||1);if(!i)return[];let r=IM(e);return[new bf(t,i.left-r.left,i.top-r.top,null,i.bottom-i.top)]}else return LX(e,t,s)}}function IM(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==Ft.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function rA(n,e,t,s){let i=n.coordsAtPos(e,t*2);if(!i)return s;let r=n.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,l=n.posAtCoords({x:r.left+1,y:o}),c=n.posAtCoords({x:r.right-1,y:o});return l==null||c==null?s:{from:Math.max(s.from,Math.min(l,c)),to:Math.min(s.to,Math.max(l,c))}}function LX(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let s=Math.max(t.from,n.viewport.from),i=Math.min(t.to,n.viewport.to),r=n.textDirection==Ft.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),c=IM(n),f=o.querySelector(".cm-line"),h=f&&window.getComputedStyle(f),d=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),g=l.right-(h?parseInt(h.paddingRight):0),m=Hy(n,s),y=Hy(n,i),w=m.type==Qn.Text?m:null,x=y.type==Qn.Text?y:null;if(w&&(n.lineWrapping||m.widgetLineBreaks)&&(w=rA(n,s,1,w)),x&&(n.lineWrapping||y.widgetLineBreaks)&&(x=rA(n,i,-1,x)),w&&x&&w.from==x.from&&w.to==x.to)return C(E(t.from,t.to,w));{let R=w?E(t.from,null,w):k(m,!1),T=x?E(null,t.to,x):k(y,!0),L=[];return(w||m).to<(x||y).from-(w&&x?1:0)||m.widgetLineBreaks>1&&R.bottom+n.defaultLineHeight/2<T.top?L.push(S(d,R.bottom,g,T.top)):R.bottom<T.top&&n.elementAtHeight((R.bottom+T.top)/2).type==Qn.Text&&(R.bottom=T.top=(R.bottom+T.top)/2),C(R).concat(L).concat(C(T))}function S(R,T,L,N){return new bf(e,R-c.left,T-c.top-.01,L-R,N-T+.01)}function C({top:R,bottom:T,horizontal:L}){let N=[];for(let F=0;F<L.length;F+=2)N.push(S(L[F],R,L[F+1],T));return N}function E(R,T,L){let N=1e9,F=-1e9,ee=[];function ce(Y,q,J,Se,H){let ge=n.coordsAtPos(Y,Y==L.to?-2:2),Z=n.coordsAtPos(J,J==L.from?2:-2);!ge||!Z||(N=Math.min(ge.top,Z.top,N),F=Math.max(ge.bottom,Z.bottom,F),H==Ft.LTR?ee.push(r&&q?d:ge.left,r&&Se?g:Z.right):ee.push(!r&&Se?d:Z.left,!r&&q?g:ge.right))}let ne=R??L.from,pe=T??L.to;for(let Y of n.visibleRanges)if(Y.to>ne&&Y.from<pe)for(let q=Math.max(Y.from,ne),J=Math.min(Y.to,pe);;){let Se=n.state.doc.lineAt(q);for(let H of n.bidiSpans(Se)){let ge=H.from+Se.from,Z=H.to+Se.from;if(ge>=J)break;Z>q&&ce(Math.max(ge,q),R==null&&ge<=ne,Math.min(Z,J),T==null&&Z>=pe,H.dir)}if(q=Se.to+1,q>=J)break}return ee.length==0&&ce(ne,R==null,pe,T==null,n.textDirection),{top:N,bottom:F,horizontal:ee}}function k(R,T){let L=l.top+(T?R.top:R.bottom);return{top:L,bottom:L,horizontal:[]}}}function NX(n,e){return n.constructor==e.constructor&&n.eq(e)}class IX{constructor(e,t){this.view=e,this.layer=t,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"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Cd)!=e.state.facet(Cd)&&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 t=0,s=e.facet(Cd);for(;t<s.length&&s[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,s)=>!NX(t,this.drawn[s]))){let t=this.dom.firstChild,s=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[s].constructor&&i.update(t,this.drawn[s])?(t=t.nextSibling,s++):this.dom.insertBefore(i.draw(),t);for(;t;){let i=t.nextSibling;t.remove(),t=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Cd=Re.define();function PM(n){return[Jt.define(e=>new IX(e,n)),Cd.of(n)]}const $M=!Le.ios,Uu=Re.define({combine(n){return Ei(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function PX(n={}){return[Uu.of(n),$X,BX,FX,fM.of(!0)]}function BM(n){return n.startState.facet(Uu)!=n.state.facet(Uu)}const $X=PM({above:!0,markers(n){let{state:e}=n,t=e.facet(Uu),s=[];for(let i of e.selection.ranges){let r=i==e.selection.main;if(i.empty?!r||$M:t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=i.empty?i:le.cursor(i.head,i.head>i.anchor?-1:1);for(let c of bf.forRange(n,o,l))s.push(c)}}return s},update(n,e){n.transactions.some(s=>s.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=BM(n);return t&&oA(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){oA(e.state,n)},class:"cm-cursorLayer"});function oA(n,e){e.style.animationDuration=n.facet(Uu).cursorBlinkRate+"ms"}const BX=PM({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:bf.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||BM(n)},class:"cm-selectionLayer"}),Gy={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};$M&&(Gy[".cm-line"].caretColor=Gy[".cm-content"].caretColor="transparent !important");const FX=kl.highest(Oe.theme(Gy)),FM=tt.define({map(n,e){return n==null?null:e.mapPos(n)}}),eu=un.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,s)=>s.is(FM)?s.value:t,n)}}),VX=Jt.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(eu);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(eu)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(eu),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let s=n.scrollDOM.getBoundingClientRect();return{left:t.left-s.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-s.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(eu)!=n&&this.view.dispatch({effects:FM.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function WX(){return[eu,VX]}function lA(n,e,t,s,i){e.lastIndex=0;for(let r=n.iterRange(t,s),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)i(o+l.index,l)}function HX(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let s=[];for(let{from:i,to:r}of t)i=Math.max(n.state.doc.lineAt(i).from,i-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),s.length&&s[s.length-1].to>=i?s[s.length-1].to=r:s.push({from:i,to:r});return s}class UX{constructor(e){const{regexp:t,decoration:s,decorate:i,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(l,c,f,h)=>i(h,f,f+l[0].length,l,c);else if(typeof s=="function")this.addMatch=(l,c,f,h)=>{let d=s(l,c,f);d&&h(f,f+l[0].length,d)};else if(s)this.addMatch=(l,c,f,h)=>h(f,f+l[0].length,s);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new $r,s=t.add.bind(t);for(let{from:i,to:r}of HX(e,this.maxLength))lA(e.state.doc,this.regexp,i,r,(o,l)=>this.addMatch(l,e,o,s));return t.finish()}updateDeco(e,t){let s=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,c)=>{c>e.view.viewport.from&&l<e.view.viewport.to&&(s=Math.min(l,s),i=Math.max(c,i))}),e.viewportChanged||i-s>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),s,i):t}updateRange(e,t,s,i){for(let r of e.visibleRanges){let o=Math.max(r.from,s),l=Math.min(r.to,i);if(l>o){let c=e.state.doc.lineAt(o),f=c.to<l?e.state.doc.lineAt(l):c,h=Math.max(r.from,c.from),d=Math.min(r.to,f.to);if(this.boundary){for(;o>c.from;o--)if(this.boundary.test(c.text[o-1-c.from])){h=o;break}for(;l<f.to;l++)if(this.boundary.test(f.text[l-f.from])){d=l;break}}let g=[],m,y=(w,x,S)=>g.push(S.range(w,x));if(c==f)for(this.regexp.lastIndex=h-c.from;(m=this.regexp.exec(c.text))&&m.index<d-c.from;)this.addMatch(m,e,m.index+c.from,y);else lA(e.state.doc,this.regexp,h,d,(w,x)=>this.addMatch(x,e,w,y));t=t.update({filterFrom:h,filterTo:d,filter:(w,x)=>w<h||x>d,add:g})}}return t}}const Yy=/x/.unicode!=null?"gu":"g",zX=new RegExp(`[\0-\b
--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Yy),qX={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Zb=null;function KX(){var n;if(Zb==null&&typeof document<"u"&&document.body){let e=document.body.style;Zb=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Zb||!1}const Ad=Re.define({combine(n){let e=Ei(n,{render:null,specialChars:zX,addSpecialChars:null});return(e.replaceTabs=!KX())&&(e.specialChars=new RegExp("	|"+e.specialChars.source,Yy)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Yy)),e}});function jX(n={}){return[Ad.of(n),GX()]}let aA=null;function GX(){return aA||(aA=Jt.fromClass(class{constructor(n){this.view=n,this.decorations=je.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Ad)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new UX({regexp:n.specialChars,decoration:(e,t,s)=>{let{doc:i}=t.state,r=xn(e[0],0);if(r==9){let o=i.lineAt(s),l=t.state.tabSize,c=ac(o.text,l,s-o.from);return je.replace({widget:new JX((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=je.replace({widget:new QX(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Ad);n.startState.facet(Ad)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const YX="•";function XX(n){return n>=32?YX:n==10?"␤":String.fromCharCode(9216+n)}class QX extends No{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=XX(this.code),s=e.state.phrase("Control character")+" "+(qX[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,s,t);if(i)return i;let r=document.createElement("span");return r.textContent=t,r.title=s,r.setAttribute("aria-label",s),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class JX extends No{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="	",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function ZX(){return tQ}const eQ=je.line({class:"cm-activeLine"}),tQ=Jt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let s of n.state.selection.ranges){let i=n.lineBlockAt(s.head);i.from>e&&(t.push(eQ.range(i.from)),e=i.from)}return je.set(t)}},{decorations:n=>n.decorations}),Xy=2e3;function nQ(n,e,t){let s=Math.min(e.line,t.line),i=Math.max(e.line,t.line),r=[];if(e.off>Xy||t.off>Xy||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let c=s;c<=i;c++){let f=n.doc.line(c);f.length<=l&&r.push(le.range(f.from+o,f.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let c=s;c<=i;c++){let f=n.doc.line(c),h=Ay(f.text,o,n.tabSize,!0);if(h<0)r.push(le.cursor(f.to));else{let d=Ay(f.text,l,n.tabSize);r.push(le.range(f.from+h,f.from+d))}}}return r}function sQ(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function cA(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),s=n.state.doc.lineAt(t),i=t-s.from,r=i>Xy?-1:i==s.length?sQ(n,e.clientX):ac(s.text,n.state.tabSize,t-s.from);return{line:s.number,col:r,off:i}}function iQ(n,e){let t=cA(n,e),s=n.state.selection;return t?{update(i){if(i.docChanged){let r=i.changes.mapPos(i.startState.doc.line(t.line).from),o=i.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},s=s.map(i.changes)}},get(i,r,o){let l=cA(n,i);if(!l)return s;let c=nQ(n.state,t,l);return c.length?o?le.create(c.concat(s.ranges)):le.create(c):s}}:null}function rQ(n){let e=(t=>t.altKey&&t.button==0);return Oe.mouseSelectionStyle.of((t,s)=>e(s)?iQ(t,s):null)}const oQ={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},lQ={style:"cursor: crosshair"};function aQ(n={}){let[e,t]=oQ[n.key||"Alt"],s=Jt.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||t(i))},keyup(i){(i.keyCode==e||!t(i))&&this.set(!1)},mousemove(i){this.set(t(i))}}});return[s,Oe.contentAttributes.of(i=>{var r;return!((r=i.plugin(s))===null||r===void 0)&&r.isDown?lQ:null})]}const Vc="-10000px";class VM{constructor(e,t,s,i){this.facet=t,this.createTooltipView=s,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=s(o,r))}update(e,t){var s;let i=e.state.facet(this.facet),r=i.filter(c=>c);if(i===this.input){for(let c of this.tooltipViews)c.update&&c.update(e);return!1}let o=[],l=t?[]:null;for(let c=0;c<r.length;c++){let f=r[c],h=-1;if(f){for(let d=0;d<this.tooltips.length;d++){let g=this.tooltips[d];g&&g.create==f.create&&(h=d)}if(h<0)o[c]=this.createTooltipView(f,c?o[c-1]:null),l&&(l[c]=!!f.above);else{let d=o[c]=this.tooltipViews[h];l&&(l[c]=t[h]),d.update&&d.update(e)}}}for(let c of this.tooltipViews)o.indexOf(c)<0&&(this.removeTooltipView(c),(s=c.destroy)===null||s===void 0||s.call(c));return t&&(l.forEach((c,f)=>t[f]=c),t.length=l.length),this.input=i,this.tooltips=r,this.tooltipViews=o,!0}}function cQ(n){let{win:e}=n;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const e0=Re.define({combine:n=>{var e,t,s;return{position:Le.ios?"absolute":((e=n.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((s=n.find(i=>i.tooltipSpace))===null||s===void 0?void 0:s.tooltipSpace)||cQ}}}),uA=new WeakMap,Vw=Jt.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(e0);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new VM(n,wm,(t,s)=>this.createTooltip(t,s),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,s=n.state.facet(e0);if(s.position!=this.position&&!this.madeAbsolute){this.position=s.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(s.parent!=this.parent){this.parent&&this.container.remove(),this.parent=s.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),s=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",t.dom.appendChild(i)}return t.dom.style.position=this.position,t.dom.style.top=Vc,t.dom.style.left="0px",this.container.insertBefore(t.dom,s),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let s of this.manager.tooltipViews)s.dom.remove(),(n=s.destroy)===null||n===void 0||n.call(s);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(Le.gecko)t=r.offsetParent!=this.container.ownerDocument.body;else if(r.style.top==Vc&&r.style.left=="0px"){let o=r.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(t||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(n=r.width/this.parent.offsetWidth,e=r.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let s=this.view.scrollDOM.getBoundingClientRect(),i=Pw(this.view);return{visible:{left:s.left+i.left,top:s.top+i.top,right:s.right-i.right,bottom:s.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((r,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(e0).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:t,space:s,scaleX:i,scaleY:r}=n,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let c=this.manager.tooltips[l],f=this.manager.tooltipViews[l],{dom:h}=f,d=n.pos[l],g=n.size[l];if(!d||c.clip!==!1&&(d.bottom<=Math.max(t.top,s.top)||d.top>=Math.min(t.bottom,s.bottom)||d.right<Math.max(t.left,s.left)-.1||d.left>Math.min(t.right,s.right)+.1)){h.style.top=Vc;continue}let m=c.arrow?f.dom.querySelector(".cm-tooltip-arrow"):null,y=m?7:0,w=g.right-g.left,x=(e=uA.get(f))!==null&&e!==void 0?e:g.bottom-g.top,S=f.offset||fQ,C=this.view.textDirection==Ft.LTR,E=g.width>s.right-s.left?C?s.left:s.right-g.width:C?Math.max(s.left,Math.min(d.left-(m?14:0)+S.x,s.right-w)):Math.min(Math.max(s.left,d.left-w+(m?14:0)-S.x),s.right-w),k=this.above[l];!c.strictSide&&(k?d.top-x-y-S.y<s.top:d.bottom+x+y+S.y>s.bottom)&&k==s.bottom-d.bottom>d.top-s.top&&(k=this.above[l]=!k);let R=(k?d.top-s.top:s.bottom-d.bottom)-y;if(R<x&&f.resize!==!1){if(R<this.view.defaultLineHeight){h.style.top=Vc;continue}uA.set(f,x),h.style.height=(x=R)/r+"px"}else h.style.height&&(h.style.height="");let T=k?d.top-x-y-S.y:d.bottom+y+S.y,L=E+w;if(f.overlap!==!0)for(let N of o)N.left<L&&N.right>E&&N.top<T+x&&N.bottom>T&&(T=k?N.top-x-2-y:N.bottom+y+2);if(this.position=="absolute"?(h.style.top=(T-n.parent.top)/r+"px",h.style.left=(E-n.parent.left)/i+"px"):(h.style.top=T/r+"px",h.style.left=E/i+"px"),m){let N=d.left+(C?S.x:-S.x)-(E+14-7);m.style.left=N/i+"px"}f.overlap!==!0&&o.push({left:E,top:T,right:L,bottom:T+x}),h.classList.toggle("cm-tooltip-above",k),h.classList.toggle("cm-tooltip-below",!k),f.positioned&&f.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Vc}},{eventObservers:{scroll(){this.maybeMeasure()}}}),uQ=Oe.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),fQ={x:0,y:0},wm=Re.define({enables:[Vw,uQ]}),bp=Re.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class Sm{static create(e){return new Sm(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new VM(e,bp,(t,s)=>this.createHostedView(t,s),t=>t.dom.remove())}createHostedView(e,t){let s=e.create(this.view);return s.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(s.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&s.mount&&s.mount(this.view),s}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let s of this.manager.tooltipViews){let i=s[e];if(i!==void 0){if(t===void 0)t=i;else if(t!==i)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const hQ=wm.compute([bp],n=>{let e=n.facet(bp);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var s;return(s=t.end)!==null&&s!==void 0?s:t.pos})),create:Sm.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class dQ{constructor(e,t,s,i,r){this.view=e,this.source=t,this.field=s,this.setHover=i,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,s=e.docView.nearest(t.target);if(!s)return;let i,r=1;if(s instanceof bo)i=s.posAtStart;else{if(i=e.posAtCoords(t),i==null)return;let l=e.coordsAtPos(i);if(!l||t.y<l.top||t.y>l.bottom||t.x<l.left-e.defaultCharacterWidth||t.x>l.right+e.defaultCharacterWidth)return;let c=e.bidiSpans(e.state.doc.lineAt(i)).find(h=>h.from<=i&&h.to>=i),f=c&&c.dir==Ft.RTL?-1:1;r=t.x<l.left?-f:f}let o=this.source(e,i,r);if(o?.then){let l=this.pending={pos:i};o.then(c=>{this.pending==l&&(this.pending=null,c&&!(Array.isArray(c)&&!c.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(c)?c:[c])}))},c=>Gn(e.state,c,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(Vw),t=e?e.manager.tooltips.findIndex(s=>s.create==Sm.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,s;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:r}=this;if(i.length&&r&&!pQ(r.dom,e)||this.pending){let{pos:o}=i[0]||this.pending,l=(s=(t=i[0])===null||t===void 0?void 0:t.end)!==null&&s!==void 0?s:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!mQ(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:s}=this;s&&s.dom.contains(e.relatedTarget)?this.watchTooltipLeave(s.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=s=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(s.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const zh=4;function pQ(n,e){let{left:t,right:s,top:i,bottom:r}=n.getBoundingClientRect(),o;if(o=n.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();i=Math.min(l.top,i),r=Math.max(l.bottom,r)}return e.clientX>=t-zh&&e.clientX<=s+zh&&e.clientY>=i-zh&&e.clientY<=r+zh}function mQ(n,e,t,s,i,r){let o=n.scrollDOM.getBoundingClientRect(),l=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>s||o.right<s||o.top>i||Math.min(o.bottom,l)<i)return!1;let c=n.posAtCoords({x:s,y:i},!1);return c>=e&&c<=t}function gQ(n,e={}){let t=tt.define(),s=un.define({create(){return[]},update(i,r){if(i.length&&(e.hideOnChange&&(r.docChanged||r.selection)?i=[]:e.hideOn&&(i=i.filter(o=>!e.hideOn(r,o))),r.docChanged)){let o=[];for(let l of i){let c=r.changes.mapPos(l.pos,-1,jn.TrackDel);if(c!=null){let f=Object.assign(Object.create(null),l);f.pos=c,f.end!=null&&(f.end=r.changes.mapPos(f.end)),o.push(f)}}i=o}for(let o of r.effects)o.is(t)&&(i=o.value),o.is(bQ)&&(i=[]);return i},provide:i=>bp.from(i)});return{active:s,extension:[s,Jt.define(i=>new dQ(i,n,s,t,e.hoverTime||300)),hQ]}}function WM(n,e){let t=n.plugin(Vw);if(!t)return null;let s=t.manager.tooltips.indexOf(e);return s<0?null:t.manager.tooltipViews[s]}const bQ=tt.define(),fA=Re.define({combine(n){let e,t;for(let s of n)e=e||s.topContainer,t=t||s.bottomContainer;return{topContainer:e,bottomContainer:t}}});function zu(n,e){let t=n.plugin(HM),s=t?t.specs.indexOf(e):-1;return s>-1?t.panels[s]:null}const HM=Jt.fromClass(class{constructor(n){this.input=n.state.facet(qu),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(fA);this.top=new qh(n,!0,e.topContainer),this.bottom=new qh(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(fA);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new qh(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new qh(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(qu);if(t!=this.input){let s=t.filter(c=>c),i=[],r=[],o=[],l=[];for(let c of s){let f=this.specs.indexOf(c),h;f<0?(h=c(n.view),l.push(h)):(h=this.panels[f],h.update&&h.update(n)),i.push(h),(h.top?r:o).push(h)}this.specs=s,this.panels=i,this.top.sync(r),this.bottom.sync(o);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let s of this.panels)s.update&&s.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>Oe.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class qh{constructor(e,t,s){this.view=e,this.top=t,this.container=s,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=hA(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=hA(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function hA(n){let e=n.nextSibling;return n.remove(),e}const qu=Re.define({enables:HM});class Zi extends yl{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Zi.prototype.elementClass="";Zi.prototype.toDOM=void 0;Zi.prototype.mapMode=jn.TrackBefore;Zi.prototype.startSide=Zi.prototype.endSide=-1;Zi.prototype.point=!0;const kd=Re.define(),yQ=Re.define(),vQ={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>pt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},wu=Re.define();function UM(n){return[zM(),wu.of(Object.assign(Object.assign({},vQ),n))]}const dA=Re.define({combine:n=>n.some(e=>e)});function zM(n){return[wQ]}const wQ=Jt.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(wu).map(e=>new mA(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(dA),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,s=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(s<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(dA)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=pt.iter(this.view.state.facet(kd),this.view.viewport.from),s=[],i=this.gutters.map(r=>new SQ(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(s.length&&(s=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==Qn.Text&&o){Qy(t,s,l.from);for(let c of i)c.line(this.view,l,s);o=!1}else if(l.widget)for(let c of i)c.widget(this.view,l)}else if(r.type==Qn.Text){Qy(t,s,r.from);for(let o of i)o.line(this.view,r,s)}else if(r.widget)for(let o of i)o.widget(this.view,r);for(let r of i)r.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(wu),t=n.state.facet(wu),s=n.docChanged||n.heightChanged||n.viewportChanged||!pt.eq(n.startState.facet(kd),n.state.facet(kd),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(n)&&(s=!0);else{s=!0;let i=[];for(let r of t){let o=e.indexOf(r);o<0?i.push(new mA(this.view,r)):(this.gutters[o].update(n),i.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),i.indexOf(r)<0&&r.destroy();for(let r of i)this.dom.appendChild(r.dom);this.gutters=i}return s}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>Oe.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==Ft.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function pA(n){return Array.isArray(n)?n:[n]}function Qy(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class SQ{constructor(e,t,s){this.gutter=e,this.height=s,this.i=0,this.cursor=pt.iter(e.markers,t.from)}addElement(e,t,s){let{gutter:i}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==i.elements.length){let l=new qM(e,o,r,s);i.elements.push(l),i.dom.appendChild(l.dom)}else i.elements[this.i].update(e,o,r,s);this.height=t.bottom,this.i++}line(e,t,s){let i=[];Qy(this.cursor,i,t.from),s.length&&(i=i.concat(s));let r=this.gutter.config.lineMarker(e,t,i);r&&i.unshift(r);let o=this.gutter;i.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let s=this.gutter.config.widgetMarker(e,t.widget,t),i=s?[s]:null;for(let r of e.state.facet(yQ)){let o=r(e,t.widget,t);o&&(i||(i=[])).push(o)}i&&this.addElement(e,t,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class mA{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let s in t.domEventHandlers)this.dom.addEventListener(s,i=>{let r=i.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let c=r.getBoundingClientRect();o=(c.top+c.bottom)/2}else o=i.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[s](e,l,i)&&i.preventDefault()});this.markers=pA(t.markers(e)),t.initialSpacer&&(this.spacer=new qM(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=pA(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let s=e.view.viewport;return!pt.eq(this.markers,t,s.from,s.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class qM{constructor(e,t,s,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,s,i)}update(e,t,s,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=s&&(this.dom.style.marginTop=(this.above=s)?s+"px":""),xQ(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let s="cm-gutterElement",i=this.dom.firstChild;for(let r=0,o=0;;){let l=o,c=r<t.length?t[r++]:null,f=!1;if(c){let h=c.elementClass;h&&(s+=" "+h);for(let d=o;d<this.markers.length;d++)if(this.markers[d].compare(c)){l=d,f=!0;break}}else l=this.markers.length;for(;o<l;){let h=this.markers[o++];if(h.toDOM){h.destroy(i);let d=i.nextSibling;i.remove(),i=d}}if(!c)break;c.toDOM&&(f?i=i.nextSibling:this.dom.insertBefore(c.toDOM(e),i)),f&&o++}this.dom.className=s,this.markers=t}destroy(){this.setMarkers(null,[])}}function xQ(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const _Q=Re.define(),EQ=Re.define(),fa=Re.define({combine(n){return Ei(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let s=Object.assign({},e);for(let i in t){let r=s[i],o=t[i];s[i]=r?(l,c,f)=>r(l,c,f)||o(l,c,f):o}return s}})}});class t0 extends Zi{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function n0(n,e){return n.state.facet(fa).formatNumber(e,n.state)}const CQ=wu.compute([fa],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(_Q)},lineMarker(e,t,s){return s.some(i=>i.toDOM)?null:new t0(n0(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,s)=>{for(let i of e.state.facet(EQ)){let r=i(e,t,s);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(fa)!=e.state.facet(fa),initialSpacer(e){return new t0(n0(e,gA(e.state.doc.lines)))},updateSpacer(e,t){let s=n0(t.view,gA(t.view.state.doc.lines));return s==e.number?e:new t0(s)},domEventHandlers:n.facet(fa).domEventHandlers}));function AQ(n={}){return[fa.of(n),zM(),CQ]}function gA(n){let e=9;for(;e<n;)e=e*10+9;return e}const kQ=new class extends Zi{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},TQ=kd.compute(["selection"],n=>{let e=[],t=-1;for(let s of n.selection.ranges){let i=n.doc.lineAt(s.head).from;i>t&&(t=i,e.push(kQ.range(i)))}return pt.of(e)});function OQ(){return TQ}const KM=1024;let RQ=0;class s0{constructor(e,t){this.from=e,this.to=t}}class ct{constructor(e={}){this.id=RQ++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ms.match(e)),t=>{let s=e(t);return s===void 0?null:[this,s]}}}ct.closedBy=new ct({deserialize:n=>n.split(" ")});ct.openedBy=new ct({deserialize:n=>n.split(" ")});ct.group=new ct({deserialize:n=>n.split(" ")});ct.isolate=new ct({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});ct.contextHash=new ct({perNode:!0});ct.lookAhead=new ct({perNode:!0});ct.mounted=new ct({perNode:!0});class yp{constructor(e,t,s){this.tree=e,this.overlay=t,this.parser=s}static get(e){return e&&e.props&&e.props[ct.mounted.id]}}const MQ=Object.create(null);class ms{constructor(e,t,s,i=0){this.name=e,this.props=t,this.id=s,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):MQ,s=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new ms(e.name||"",t,e.id,s);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(i)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(ct.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let s in e)for(let i of s.split(" "))t[i]=e[s];return s=>{for(let i=s.prop(ct.group),r=-1;r<(i?i.length:0);r++){let o=t[r<0?s.name:i[r]];if(o)return o}}}}ms.none=new ms("",Object.create(null),0,8);class Ww{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let s of this.types){let i=null;for(let r of e){let o=r(s);o&&(i||(i=Object.assign({},s.props)),i[o[0].id]=o[1])}t.push(i?new ms(s.name,i,s.id,s.flags):s)}return new Ww(t)}}const Kh=new WeakMap,bA=new WeakMap;var pn;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays"})(pn||(pn={}));class tn{constructor(e,t,s,i,r){if(this.type=e,this.children=t,this.positions=s,this.length=i,this.props=null,r&&r.length){this.props=Object.create(null);for(let[o,l]of r)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=yp.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let s of this.children){let i=s.toString();i&&(t&&(t+=","),t+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Zy(this.topNode,e)}cursorAt(e,t=0,s=0){let i=Kh.get(this)||this.topNode,r=new Zy(i);return r.moveTo(e,t),Kh.set(this,r._tree),r}get topNode(){return new ei(this,0,0,null)}resolve(e,t=0){let s=Ku(Kh.get(this)||this.topNode,e,t,!1);return Kh.set(this,s),s}resolveInner(e,t=0){let s=Ku(bA.get(this)||this.topNode,e,t,!0);return bA.set(this,s),s}resolveStack(e,t=0){return NQ(this,e,t)}iterate(e){let{enter:t,leave:s,from:i=0,to:r=this.length}=e,o=e.mode||0,l=(o&pn.IncludeAnonymous)>0;for(let c=this.cursor(o|pn.IncludeAnonymous);;){let f=!1;if(c.from<=r&&c.to>=i&&(!l&&c.type.isAnonymous||t(c)!==!1)){if(c.firstChild())continue;f=!0}for(;f&&s&&(l||!c.type.isAnonymous)&&s(c),!c.nextSibling();){if(!c.parent())return;f=!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 t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:zw(ms.none,this.children,this.positions,0,this.children.length,0,this.length,(t,s,i)=>new tn(this.type,t,s,i,this.propValues),e.makeTree||((t,s,i)=>new tn(ms.none,t,s,i)))}static build(e){return IQ(e)}}tn.empty=new tn(ms.none,[],[],0);class Hw{constructor(e,t){this.buffer=e,this.index=t}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 Hw(this.buffer,this.index)}}class Oo{constructor(e,t,s){this.buffer=e,this.length=t,this.set=s}get type(){return ms.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],s=this.buffer[e+3],i=this.set.types[t],r=i.name;if(/\W/.test(r)&&!i.isError&&(r=JSON.stringify(r)),e+=4,s==e)return r;let o=[];for(;e<s;)o.push(this.childString(e)),e=this.buffer[e+3];return r+"("+o.join(",")+")"}findChild(e,t,s,i,r){let{buffer:o}=this,l=-1;for(let c=e;c!=t&&!(jM(r,i,o[c+1],o[c+2])&&(l=c,s>0));c=o[c+3]);return l}slice(e,t,s){let i=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,c=0;l<t;){r[c++]=i[l++],r[c++]=i[l++]-s;let f=r[c++]=i[l++]-s;r[c++]=i[l++]-e,o=Math.max(o,f)}return new Oo(r,o,this.set)}}function jM(n,e,t,s){switch(n){case-2:return t<e;case-1:return s>=e&&t<e;case 0:return t<e&&s>e;case 1:return t<=e&&s>e;case 2:return s>e;case 4:return!0}}function Ku(n,e,t,s){for(var i;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let o=!s&&n instanceof ei&&n.index<0?null:n.parent;if(!o)return n;n=o}let r=s?0:pn.IgnoreOverlays;if(s)for(let o=n,l=o.parent;l;o=l,l=o.parent)o instanceof ei&&o.index<0&&((i=l.enter(e,t,r))===null||i===void 0?void 0:i.from)!=o.from&&(n=l);for(;;){let o=n.enter(e,t,r);if(!o)return n;n=o}}class GM{cursor(e=0){return new Zy(this,e)}getChild(e,t=null,s=null){let i=yA(this,e,t,s);return i.length?i[0]:null}getChildren(e,t=null,s=null){return yA(this,e,t,s)}resolve(e,t=0){return Ku(this,e,t,!1)}resolveInner(e,t=0){return Ku(this,e,t,!0)}matchContext(e){return Jy(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),s=this;for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(s=t,t=i.prevSibling):t=i}return s}get node(){return this}get next(){return this.parent}}class ei extends GM{constructor(e,t,s,i){super(),this._tree=e,this.from=t,this.index=s,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,s,i,r=0){for(let o=this;;){for(let{children:l,positions:c}=o._tree,f=t>0?l.length:-1;e!=f;e+=t){let h=l[e],d=c[e]+o.from;if(jM(i,s,d,d+h.length)){if(h instanceof Oo){if(r&pn.ExcludeBuffers)continue;let g=h.findChild(0,h.buffer.length,t,s-d,i);if(g>-1)return new vo(new DQ(o,h,e,d),null,g)}else if(r&pn.IncludeAnonymous||!h.type.isAnonymous||Uw(h)){let g;if(!(r&pn.IgnoreMounts)&&(g=yp.get(h))&&!g.overlay)return new ei(g.tree,d,e,o);let m=new ei(h,d,e,o);return r&pn.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(t<0?h.children.length-1:0,t,s,i)}}}if(r&pn.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))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)}enter(e,t,s=0){let i;if(!(s&pn.IgnoreOverlays)&&(i=yp.get(this._tree))&&i.overlay){let r=e-this.from;for(let{from:o,to:l}of i.overlay)if((t>0?o<=r:o<r)&&(t<0?l>=r:l>r))return new ei(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,s)}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 yA(n,e,t,s){let i=n.cursor(),r=[];if(!i.firstChild())return r;if(t!=null){for(let o=!1;!o;)if(o=i.type.is(t),!i.nextSibling())return r}for(;;){if(s!=null&&i.type.is(s))return r;if(i.type.is(e)&&r.push(i.node),!i.nextSibling())return s==null?r:[]}}function Jy(n,e,t=e.length-1){for(let s=n;t>=0;s=s.parent){if(!s)return!1;if(!s.type.isAnonymous){if(e[t]&&e[t]!=s.name)return!1;t--}}return!0}class DQ{constructor(e,t,s,i){this.parent=e,this.buffer=t,this.index=s,this.start=i}}class vo extends GM{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,t,s){super(),this.context=e,this._parent=t,this.index=s,this.type=e.buffer.set.types[e.buffer.buffer[s]]}child(e,t,s){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,s);return r<0?null:new vo(this.context,this,r)}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)}enter(e,t,s=0){if(s&pn.ExcludeBuffers)return null;let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new vo(this.context,this,r)}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,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new vo(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new vo(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:s}=this.context,i=this.index+4,r=s.buffer[this.index+3];if(r>i){let o=s.buffer[this.index+1];e.push(s.slice(i,r,o)),t.push(0)}return new tn(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function YM(n){if(!n.length)return null;let e=0,t=n[0];for(let r=1;r<n.length;r++){let o=n[r];(o.from>t.from||o.to<t.to)&&(t=o,e=r)}let s=t instanceof ei&&t.index<0?null:t.parent,i=n.slice();return s?i[e]=s:i.splice(e,1),new LQ(i,t)}class LQ{constructor(e,t){this.heads=e,this.node=t}get next(){return YM(this.heads)}}function NQ(n,e,t){let s=n.resolveInner(e,t),i=null;for(let r=s instanceof ei?s:s.context.parent;r;r=r.parent)if(r.index<0){let o=r.parent;(i||(i=[s])).push(o.resolve(e,t)),r=o}else{let o=yp.get(r.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new ei(o.tree,o.overlay[0].from+r.from,-1,r);(i||(i=[s])).push(Ku(l,e,t,!1))}}return i?YM(i):s}class Zy{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof ei)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let s=e._parent;s;s=s._parent)this.stack.unshift(s.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,t){this.index=e;let{start:s,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=s+i.buffer[e+1],this.to=s+i.buffer[e+2],!0}yield(e){return e?e instanceof ei?(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,t,s){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,s,this.mode));let{buffer:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,s);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}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,t,s=this.mode){return this.buffer?s&pn.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,s))}parent(){if(!this.buffer)return this.yieldNode(this.mode&pn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&pn.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:t}=this.buffer,s=this.stack.length-1;if(e<0){let i=s<0?0:this.stack[s]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(s<0?t.buffer.length:t.buffer[this.stack[s]+3]))return this.yieldBuf(i)}return s<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 t,s,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let r=0;r<this.index;r++)if(i.buffer.buffer[r+3]<this.index)return!1;({index:t,parent:s}=i)}else({index:t,_parent:s}=this._tree);for(;s;{index:t,_parent:s}=s)if(t>-1)for(let r=t+e,o=e<0?-1:s._tree.children.length;r!=o;r+=e){let l=s._tree.children[r];if(this.mode&pn.IncludeAnonymous||l instanceof Oo||!l.type.isAnonymous||Uw(l))return!1}return!0}move(e,t){if(t&&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,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,s=0;if(e&&e.context==this.buffer)e:for(let i=this.index,r=this.stack.length;r>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;t=o,s=r+1;break e}i=this.stack[--r]}for(let i=s;i<this.stack.length;i++)t=new vo(this.buffer,t,this.stack[i]);return this.bufferNode=new vo(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let s=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){s++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!s)return;if(this.nextSibling())break;this.parent(),s--,i=!0}}}matchContext(e){if(!this.buffer)return Jy(this.node.parent,e);let{buffer:t}=this.buffer,{types:s}=t.set;for(let i=e.length-1,r=this.stack.length-1;i>=0;r--){if(r<0)return Jy(this._tree,e,i);let o=s[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function Uw(n){return n.children.some(e=>e instanceof Oo||!e.type.isAnonymous||Uw(e))}function IQ(n){var e;let{buffer:t,nodeSet:s,maxBufferLength:i=KM,reused:r=[],minRepeatType:o=s.types.length}=n,l=Array.isArray(t)?new Hw(t,t.length):t,c=s.types,f=0,h=0;function d(R,T,L,N,F,ee){let{id:ce,start:ne,end:pe,size:Y}=l,q=h,J=f;for(;Y<0;)if(l.next(),Y==-1){let X=r[ce];L.push(X),N.push(ne-R);return}else if(Y==-3){f=ce;return}else if(Y==-4){h=ce;return}else throw new RangeError(`Unrecognized record size: ${Y}`);let Se=c[ce],H,ge,Z=ne-R;if(pe-ne<=i&&(ge=x(l.pos-T,F))){let X=new Uint16Array(ge.size-ge.skip),fe=l.pos-ge.size,we=X.length;for(;l.pos>fe;)we=S(ge.start,X,we);H=new Oo(X,pe-ge.start,s),Z=ge.start-R}else{let X=l.pos-Y;l.next();let fe=[],we=[],ae=ce>=o?ce:-1,be=0,Ne=pe;for(;l.pos>X;)ae>=0&&l.id==ae&&l.size>=0?(l.end<=Ne-i&&(y(fe,we,ne,be,l.end,Ne,ae,q,J),be=fe.length,Ne=l.end),l.next()):ee>2500?g(ne,X,fe,we):d(ne,X,fe,we,ae,ee+1);if(ae>=0&&be>0&&be<fe.length&&y(fe,we,ne,be,ne,Ne,ae,q,J),fe.reverse(),we.reverse(),ae>-1&&be>0){let B=m(Se,J);H=zw(Se,fe,we,0,fe.length,0,pe-ne,B,B)}else H=w(Se,fe,we,pe-ne,q-pe,J)}L.push(H),N.push(Z)}function g(R,T,L,N){let F=[],ee=0,ce=-1;for(;l.pos>T;){let{id:ne,start:pe,end:Y,size:q}=l;if(q>4)l.next();else{if(ce>-1&&pe<ce)break;ce<0&&(ce=Y-i),F.push(ne,pe,Y),ee++,l.next()}}if(ee){let ne=new Uint16Array(ee*4),pe=F[F.length-2];for(let Y=F.length-3,q=0;Y>=0;Y-=3)ne[q++]=F[Y],ne[q++]=F[Y+1]-pe,ne[q++]=F[Y+2]-pe,ne[q++]=q;L.push(new Oo(ne,F[2]-pe,s)),N.push(pe-R)}}function m(R,T){return(L,N,F)=>{let ee=0,ce=L.length-1,ne,pe;if(ce>=0&&(ne=L[ce])instanceof tn){if(!ce&&ne.type==R&&ne.length==F)return ne;(pe=ne.prop(ct.lookAhead))&&(ee=N[ce]+ne.length+pe)}return w(R,L,N,F,ee,T)}}function y(R,T,L,N,F,ee,ce,ne,pe){let Y=[],q=[];for(;R.length>N;)Y.push(R.pop()),q.push(T.pop()+L-F);R.push(w(s.types[ce],Y,q,ee-F,ne-ee,pe)),T.push(F-L)}function w(R,T,L,N,F,ee,ce){if(ee){let ne=[ct.contextHash,ee];ce=ce?[ne].concat(ce):[ne]}if(F>25){let ne=[ct.lookAhead,F];ce=ce?[ne].concat(ce):[ne]}return new tn(R,T,L,N,ce)}function x(R,T){let L=l.fork(),N=0,F=0,ee=0,ce=L.end-i,ne={size:0,start:0,skip:0};e:for(let pe=L.pos-R;L.pos>pe;){let Y=L.size;if(L.id==T&&Y>=0){ne.size=N,ne.start=F,ne.skip=ee,ee+=4,N+=4,L.next();continue}let q=L.pos-Y;if(Y<0||q<pe||L.start<ce)break;let J=L.id>=o?4:0,Se=L.start;for(L.next();L.pos>q;){if(L.size<0)if(L.size==-3)J+=4;else break e;else L.id>=o&&(J+=4);L.next()}F=Se,N+=Y,ee+=J}return(T<0||N==R)&&(ne.size=N,ne.start=F,ne.skip=ee),ne.size>4?ne:void 0}function S(R,T,L){let{id:N,start:F,end:ee,size:ce}=l;if(l.next(),ce>=0&&N<o){let ne=L;if(ce>4){let pe=l.pos-(ce-4);for(;l.pos>pe;)L=S(R,T,L)}T[--L]=ne,T[--L]=ee-R,T[--L]=F-R,T[--L]=N}else ce==-3?f=N:ce==-4&&(h=N);return L}let C=[],E=[];for(;l.pos>0;)d(n.start||0,n.bufferStart||0,C,E,-1,0);let k=(e=n.length)!==null&&e!==void 0?e:C.length?E[0]+C[0].length:0;return new tn(c[n.topID],C.reverse(),E.reverse(),k)}const vA=new WeakMap;function Td(n,e){if(!n.isAnonymous||e instanceof Oo||e.type!=n)return 1;let t=vA.get(e);if(t==null){t=1;for(let s of e.children){if(s.type!=n||!(s instanceof tn)){t=1;break}t+=Td(n,s)}vA.set(e,t)}return t}function zw(n,e,t,s,i,r,o,l,c){let f=0;for(let y=s;y<i;y++)f+=Td(n,e[y]);let h=Math.ceil(f*1.5/8),d=[],g=[];function m(y,w,x,S,C){for(let E=x;E<S;){let k=E,R=w[E],T=Td(n,y[E]);for(E++;E<S;E++){let L=Td(n,y[E]);if(T+L>=h)break;T+=L}if(E==k+1){if(T>h){let L=y[k];m(L.children,L.positions,0,L.children.length,w[k]+C);continue}d.push(y[k])}else{let L=w[E-1]+y[E-1].length-R;d.push(zw(n,y,w,k,E,R,L,null,c))}g.push(R+C-r)}}return m(e,t,s,i,0),(l||c)(d,g,o)}class dl{constructor(e,t,s,i,r=!1,o=!1){this.from=e,this.to=t,this.tree=s,this.offset=i,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],s=!1){let i=[new dl(0,e.length,e,0,!1,s)];for(let r of t)r.to>e.length&&i.push(r);return i}static applyChanges(e,t,s=128){if(!t.length)return e;let i=[],r=1,o=e.length?e[0]:null;for(let l=0,c=0,f=0;;l++){let h=l<t.length?t[l]:null,d=h?h.fromA:1e9;if(d-c>=s)for(;o&&o.from<d;){let g=o;if(c>=g.from||d<=g.to||f){let m=Math.max(g.from,c)-f,y=Math.min(g.to,d)-f;g=m>=y?null:new dl(m,y,g.tree,g.offset+f,l>0,!!h)}if(g&&i.push(g),o.to>d)break;o=r<e.length?e[r++]:null}if(!h)break;c=h.toA,f=h.toA-h.toB}return i}}class XM{startParse(e,t,s){return typeof e=="string"&&(e=new PQ(e)),s=s?s.length?s.map(i=>new s0(i.from,i.to)):[new s0(0,0)]:[new s0(0,e.length)],this.createParse(e,t||[],s)}parse(e,t,s){let i=this.startParse(e,t,s);for(;;){let r=i.advance();if(r)return r}}}class PQ{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new ct({perNode:!0});let $Q=0;class Ks{constructor(e,t,s,i){this.name=e,this.set=t,this.base=s,this.modified=i,this.id=$Q++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let s=typeof e=="string"?e:"?";if(e instanceof Ks&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let i=new Ks(s,[],null,[]);if(i.set.push(i),t)for(let r of t.set)i.set.push(r);return i}static defineModifier(e){let t=new vp(e);return s=>s.modified.indexOf(t)>-1?s:vp.get(s.base||s,s.modified.concat(t).sort((i,r)=>i.id-r.id))}}let BQ=0;class vp{constructor(e){this.name=e,this.instances=[],this.id=BQ++}static get(e,t){if(!t.length)return e;let s=t[0].instances.find(l=>l.base==e&&FQ(t,l.modified));if(s)return s;let i=[],r=new Ks(e.name,i,e,t);for(let l of t)l.instances.push(r);let o=VQ(t);for(let l of e.set)if(!l.modified.length)for(let c of o)i.push(vp.get(l,c));return r}}function FQ(n,e){return n.length==e.length&&n.every((t,s)=>t==e[s])}function VQ(n){let e=[[]];for(let t=0;t<n.length;t++)for(let s=0,i=e.length;s<i;s++)e.push(e[s].concat(n[t]));return e.sort((t,s)=>s.length-t.length)}function QM(n){let e=Object.create(null);for(let t in n){let s=n[t];Array.isArray(s)||(s=[s]);for(let i of t.split(" "))if(i){let r=[],o=2,l=i;for(let d=0;;){if(l=="..."&&d>0&&d+3==i.length){o=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!g)throw new RangeError("Invalid path: "+i);if(r.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),d+=g[0].length,d==i.length)break;let m=i[d++];if(d==i.length&&m=="!"){o=0;break}if(m!="/")throw new RangeError("Invalid path: "+i);l=i.slice(d)}let c=r.length-1,f=r[c];if(!f)throw new RangeError("Invalid path: "+i);let h=new wp(s,o,c>0?r.slice(0,c):null);e[f]=h.sort(e[f])}}return JM.add(e)}const JM=new ct;class wp{constructor(e,t,s,i){this.tags=e,this.mode=t,this.context=s,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}wp.empty=new wp([],2,null);function ZM(n,e){let t=Object.create(null);for(let r of n)if(!Array.isArray(r.tag))t[r.tag.id]=r.class;else for(let o of r.tag)t[o.id]=r.class;let{scope:s,all:i=null}=e||{};return{style:r=>{let o=i;for(let l of r)for(let c of l.set){let f=t[c.id];if(f){o=o?o+" "+f:f;break}}return o},scope:s}}function WQ(n,e){let t=null;for(let s of n){let i=s.style(e);i&&(t=t?t+" "+i:i)}return t}function HQ(n,e,t,s=0,i=n.length){let r=new UQ(s,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),s,i,"",r.highlighters),r.flush(i)}class UQ{constructor(e,t,s){this.at=e,this.highlighters=t,this.span=s,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,s,i,r){let{type:o,from:l,to:c}=e;if(l>=s||c<=t)return;o.isTop&&(r=this.highlighters.filter(m=>!m.scope||m.scope(o)));let f=i,h=zQ(e)||wp.empty,d=WQ(r,h.tags);if(d&&(f&&(f+=" "),f+=d,h.mode==1&&(i+=(i?" ":"")+d)),this.startSpan(Math.max(t,l),f),h.opaque)return;let g=e.tree&&e.tree.prop(ct.mounted);if(g&&g.overlay){let m=e.node.enter(g.overlay[0].from+l,1),y=this.highlighters.filter(x=>!x.scope||x.scope(g.tree.type)),w=e.firstChild();for(let x=0,S=l;;x++){let C=x<g.overlay.length?g.overlay[x]:null,E=C?C.from+l:c,k=Math.max(t,S),R=Math.min(s,E);if(k<R&&w)for(;e.from<R&&(this.highlightRange(e,k,R,i,r),this.startSpan(Math.min(R,e.to),f),!(e.to>=E||!e.nextSibling())););if(!C||E>s)break;S=C.to+l,S>t&&(this.highlightRange(m.cursor(),Math.max(t,C.from+l),Math.min(s,S),"",y),this.startSpan(Math.min(s,S),f))}w&&e.parent()}else if(e.firstChild()){g&&(i="");do if(!(e.to<=t)){if(e.from>=s)break;this.highlightRange(e,t,s,i,r),this.startSpan(Math.min(s,e.to),f)}while(e.nextSibling());e.parent()}}}function zQ(n){let e=n.type.prop(JM);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const Ee=Ks.define,jh=Ee(),lo=Ee(),wA=Ee(lo),SA=Ee(lo),ao=Ee(),Gh=Ee(ao),i0=Ee(ao),Pi=Ee(),Go=Ee(Pi),Li=Ee(),Ni=Ee(),ev=Ee(),Wc=Ee(ev),Yh=Ee(),j={comment:jh,lineComment:Ee(jh),blockComment:Ee(jh),docComment:Ee(jh),name:lo,variableName:Ee(lo),typeName:wA,tagName:Ee(wA),propertyName:SA,attributeName:Ee(SA),className:Ee(lo),labelName:Ee(lo),namespace:Ee(lo),macroName:Ee(lo),literal:ao,string:Gh,docString:Ee(Gh),character:Ee(Gh),attributeValue:Ee(Gh),number:i0,integer:Ee(i0),float:Ee(i0),bool:Ee(ao),regexp:Ee(ao),escape:Ee(ao),color:Ee(ao),url:Ee(ao),keyword:Li,self:Ee(Li),null:Ee(Li),atom:Ee(Li),unit:Ee(Li),modifier:Ee(Li),operatorKeyword:Ee(Li),controlKeyword:Ee(Li),definitionKeyword:Ee(Li),moduleKeyword:Ee(Li),operator:Ni,derefOperator:Ee(Ni),arithmeticOperator:Ee(Ni),logicOperator:Ee(Ni),bitwiseOperator:Ee(Ni),compareOperator:Ee(Ni),updateOperator:Ee(Ni),definitionOperator:Ee(Ni),typeOperator:Ee(Ni),controlOperator:Ee(Ni),punctuation:ev,separator:Ee(ev),bracket:Wc,angleBracket:Ee(Wc),squareBracket:Ee(Wc),paren:Ee(Wc),brace:Ee(Wc),content:Pi,heading:Go,heading1:Ee(Go),heading2:Ee(Go),heading3:Ee(Go),heading4:Ee(Go),heading5:Ee(Go),heading6:Ee(Go),contentSeparator:Ee(Pi),list:Ee(Pi),quote:Ee(Pi),emphasis:Ee(Pi),strong:Ee(Pi),link:Ee(Pi),monospace:Ee(Pi),strikethrough:Ee(Pi),inserted:Ee(),deleted:Ee(),changed:Ee(),invalid:Ee(),meta:Yh,documentMeta:Ee(Yh),annotation:Ee(Yh),processingInstruction:Ee(Yh),definition:Ks.defineModifier("definition"),constant:Ks.defineModifier("constant"),function:Ks.defineModifier("function"),standard:Ks.defineModifier("standard"),local:Ks.defineModifier("local"),special:Ks.defineModifier("special")};for(let n in j){let e=j[n];e instanceof Ks&&(e.name=n)}ZM([{tag:j.link,class:"tok-link"},{tag:j.heading,class:"tok-heading"},{tag:j.emphasis,class:"tok-emphasis"},{tag:j.strong,class:"tok-strong"},{tag:j.keyword,class:"tok-keyword"},{tag:j.atom,class:"tok-atom"},{tag:j.bool,class:"tok-bool"},{tag:j.url,class:"tok-url"},{tag:j.labelName,class:"tok-labelName"},{tag:j.inserted,class:"tok-inserted"},{tag:j.deleted,class:"tok-deleted"},{tag:j.literal,class:"tok-literal"},{tag:j.string,class:"tok-string"},{tag:j.number,class:"tok-number"},{tag:[j.regexp,j.escape,j.special(j.string)],class:"tok-string2"},{tag:j.variableName,class:"tok-variableName"},{tag:j.local(j.variableName),class:"tok-variableName tok-local"},{tag:j.definition(j.variableName),class:"tok-variableName tok-definition"},{tag:j.special(j.variableName),class:"tok-variableName2"},{tag:j.definition(j.propertyName),class:"tok-propertyName tok-definition"},{tag:j.typeName,class:"tok-typeName"},{tag:j.namespace,class:"tok-namespace"},{tag:j.className,class:"tok-className"},{tag:j.macroName,class:"tok-macroName"},{tag:j.propertyName,class:"tok-propertyName"},{tag:j.operator,class:"tok-operator"},{tag:j.comment,class:"tok-comment"},{tag:j.meta,class:"tok-meta"},{tag:j.invalid,class:"tok-invalid"},{tag:j.punctuation,class:"tok-punctuation"}]);var r0;const ha=new ct;function qQ(n){return Re.define({combine:n?e=>e.concat(n):void 0})}const KQ=new ct;class di{constructor(e,t,s=[],i=""){this.data=e,this.name=i,bt.prototype.hasOwnProperty("tree")||Object.defineProperty(bt.prototype,"tree",{get(){return $n(this)}}),this.parser=t,this.extension=[Ro.of(this),bt.languageData.of((r,o,l)=>{let c=xA(r,o,l),f=c.type.prop(ha);if(!f)return[];let h=r.facet(f),d=c.type.prop(KQ);if(d){let g=c.resolve(o-c.from,l);for(let m of d)if(m.test(g,r)){let y=r.facet(m.facet);return m.type=="replace"?y:y.concat(h)}}return h})].concat(s)}isActiveAt(e,t,s=-1){return xA(e,t,s).type.prop(ha)==this.data}findRegions(e){let t=e.facet(Ro);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let s=[],i=(r,o)=>{if(r.prop(ha)==this.data){s.push({from:o,to:o+r.length});return}let l=r.prop(ct.mounted);if(l){if(l.tree.prop(ha)==this.data){if(l.overlay)for(let c of l.overlay)s.push({from:c.from+o,to:c.to+o});else s.push({from:o,to:o+r.length});return}else if(l.overlay){let c=s.length;if(i(l.tree,l.overlay[0].from+o),s.length>c)return}}for(let c=0;c<r.children.length;c++){let f=r.children[c];f instanceof tn&&i(f,r.positions[c]+o)}};return i($n(e),0),s}get allowsNesting(){return!0}}di.setState=tt.define();function xA(n,e,t){let s=n.facet(Ro),i=$n(n).topNode;if(!s||s.allowsNesting)for(let r=i;r;r=r.enter(e,t,pn.ExcludeBuffers))r.type.isTop&&(i=r);return i}class Sp extends di{constructor(e,t,s){super(e,t,[],s),this.parser=t}static define(e){let t=qQ(e.languageData);return new Sp(t,e.parser.configure({props:[ha.add(s=>s.isTop?t:void 0)]}),e.name)}configure(e,t){return new Sp(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function $n(n){let e=n.field(di.state,!1);return e?e.tree:tn.empty}class jQ{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,t){let s=this.cursorPos-this.string.length;return e<s||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-s,t-s)}}let Hc=null;class xp{constructor(e,t,s=[],i,r,o,l,c){this.parser=e,this.state=t,this.fragments=s,this.tree=i,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,t,s){return new xp(e,t,[],tn.empty,0,s,[],null)}startParse(){return this.parser.startParse(new jQ(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=tn.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var s;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(dl.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(s=this.parse.stoppedAt)!==null&&s!==void 0?s:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(dl.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Hc;Hc=this;try{return e()}finally{Hc=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=_A(e,t.from,t.to);return e}changes(e,t){let{fragments:s,tree:i,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((f,h,d,g)=>c.push({fromA:f,toA:h,fromB:d,toB:g})),s=dl.applyChanges(s,c),i=tn.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let f of this.skipped){let h=e.mapPos(f.from,1),d=e.mapPos(f.to,-1);h<d&&l.push({from:h,to:d})}}}return new xp(this.parser,t,s,i,r,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let s=0;s<this.skipped.length;s++){let{from:i,to:r}=this.skipped[s];i<e.to&&r>e.from&&(this.fragments=_A(this.fragments,i,r),this.skipped.splice(s--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends XM{createParse(t,s,i){let r=i[0].from,o=i[i.length-1].to;return{parsedPos:r,advance(){let c=Hc;if(c){for(let f of i)c.tempSkipped.push(f);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=o,new tn(ms.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Hc}}function _A(n,e,t){return dl.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Qa{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),s=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,s)||t.takeTree(),new Qa(t)}static init(e){let t=Math.min(3e3,e.doc.length),s=xp.create(e.facet(Ro).parser,e,{from:0,to:t});return s.work(20,t)||s.takeTree(),new Qa(s)}}di.state=un.define({create:Qa.init,update(n,e){for(let t of e.effects)if(t.is(di.setState))return t.value;return e.startState.facet(Ro)!=e.state.facet(Ro)?Qa.init(e.state):n.apply(e)}});let eD=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(eD=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const o0=typeof navigator<"u"&&(!((r0=navigator.scheduling)===null||r0===void 0)&&r0.isInputPending)?()=>navigator.scheduling.isInputPending():null,GQ=Jt.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 t=this.view.state.field(di.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(di.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=eD(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:s,viewport:{to:i}}=this.view,r=s.field(di.state);if(r.tree==r.context.tree&&r.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!o0?Math.max(25,e.timeRemaining()-5):1e9),l=r.context.treeLen<i&&s.doc.length>i+1e3,c=r.context.work(()=>o0&&o0()||Date.now()>o,i+(l?0:1e5));this.chunkBudget-=Date.now()-t,(c||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:di.setState.of(new Qa(r.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Gn(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ro=Re.define({combine(n){return n.length?n[0]:null},enables:n=>[di.state,GQ,Oe.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class YQ{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const XQ=Re.define(),qw=Re.define({combine:n=>{if(!n.length)return"  ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function _p(n){let e=n.facet(qw);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function ju(n,e){let t="",s=n.tabSize,i=n.facet(qw)[0];if(i=="	"){for(;e>=s;)t+="	",e-=s;i=" "}for(let r=0;r<e;r++)t+=i;return t}function Kw(n,e){n instanceof bt&&(n=new xm(n));for(let s of n.state.facet(XQ)){let i=s(n,e);if(i!==void 0)return i}let t=$n(n.state);return t.length>=e?QQ(n,t,e):null}class xm{constructor(e,t={}){this.state=e,this.options=t,this.unit=_p(e)}lineAt(e,t=1){let s=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:r}=this.options;return i!=null&&i>=s.from&&i<=s.to?r&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:s.text.slice(i-s.from),from:i}:{text:s.text.slice(0,i-s.from),from:s.from}:s}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:s,from:i}=this.lineAt(e,t);return s.slice(e-i,Math.min(s.length,e+100-i))}column(e,t=1){let{text:s,from:i}=this.lineAt(e,t),r=this.countColumn(s,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(r+=o-this.countColumn(s,s.search(/\S|$/))),r}countColumn(e,t=e.length){return ac(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:s,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(i);if(o>-1)return o}return this.countColumn(s,s.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const tD=new ct;function QQ(n,e,t){let s=e.resolveStack(t),i=s.node.enterUnfinishedNodesBefore(t);if(i!=s.node){let r=[];for(let o=i;o!=s.node;o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)s={node:r[o],next:s}}return nD(s,n,t)}function nD(n,e,t){for(let s=n;s;s=s.next){let i=ZQ(s.node);if(i)return i(jw.create(e,t,s))}return 0}function JQ(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function ZQ(n){let e=n.type.prop(tD);if(e)return e;let t=n.firstChild,s;if(t&&(s=t.type.prop(ct.closedBy))){let i=n.lastChild,r=i&&s.indexOf(i.name)>-1;return o=>sJ(o,!0,1,void 0,r&&!JQ(o)?i.from:void 0)}return n.parent==null?eJ:null}function eJ(){return 0}class jw extends xm{constructor(e,t,s){super(e.state,e.options),this.base=e,this.pos=t,this.context=s}get node(){return this.context.node}static create(e,t,s){return new jw(e,t,s)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let s=e.resolve(t.from);for(;s.parent&&s.parent.from==s.from;)s=s.parent;if(tJ(s,e))break;t=this.state.doc.lineAt(s.from)}return this.lineIndent(t.from)}continue(){return nD(this.context.next,this.base,this.pos)}}function tJ(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function nJ(n){let e=n.node,t=e.childAfter(e.from),s=e.lastChild;if(!t)return null;let i=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=i==null||i<=r.from?r.to:Math.min(r.to,i);for(let l=t.to;;){let c=e.childAfter(l);if(!c||c==s)return null;if(!c.type.isSkipped){if(c.from>=o)return null;let f=/^ */.exec(r.text.slice(t.to-r.from))[0].length;return{from:t.from,to:t.to+f}}l=c.to}}function sJ(n,e,t,s,i){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=s&&r.slice(o,o+s.length)==s||i==n.pos+o,c=nJ(n);return c?l?n.column(c.from):n.column(c.to):n.baseIndent+(l?0:n.unit*t)}function EA({except:n,units:e=1}={}){return t=>{let s=n&&n.test(t.textAfter);return t.baseIndent+(s?0:e*t.unit)}}const iJ=200;function rJ(){return bt.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:s}=n.newSelection.main,i=t.lineAt(s);if(s>i.from+iJ)return n;let r=t.sliceString(i.from,s);if(!e.some(f=>f.test(r)))return n;let{state:o}=n,l=-1,c=[];for(let{head:f}of o.selection.ranges){let h=o.doc.lineAt(f);if(h.from==l)continue;l=h.from;let d=Kw(o,h.from);if(d==null)continue;let g=/^\s*/.exec(h.text)[0],m=ju(o,d);g!=m&&c.push({from:h.from,to:h.from+g.length,insert:m})}return c.length?[n,{changes:c,sequential:!0}]:n})}const oJ=Re.define(),sD=new ct;function lJ(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function aJ(n,e,t){let s=$n(n);if(s.length<t)return null;let i=s.resolveStack(t,1),r=null;for(let o=i;o;o=o.next){let l=o.node;if(l.to<=t||l.from>t)continue;if(r&&l.from<e)break;let c=l.type.prop(sD);if(c&&(l.to<s.length-50||s.length==n.doc.length||!cJ(l))){let f=c(l,n);f&&f.from<=t&&f.from>=e&&f.to>t&&(r=f)}}return r}function cJ(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Ep(n,e,t){for(let s of n.facet(oJ)){let i=s(n,e,t);if(i)return i}return aJ(n,e,t)}function iD(n,e){let t=e.mapPos(n.from,1),s=e.mapPos(n.to,-1);return t>=s?void 0:{from:t,to:s}}const _m=tt.define({map:iD}),yf=tt.define({map:iD});function rD(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(s=>s.from<=t&&s.to>=t)||e.push(n.lineBlockAt(t));return e}const xl=un.define({create(){return je.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is(_m)&&!uJ(n,t.value.from,t.value.to)){let{preparePlaceholder:s}=e.state.facet(aD),i=s?je.replace({widget:new bJ(s(e.state,t.value))}):CA;n=n.update({add:[i.range(t.value.from,t.value.to)]})}else t.is(yf)&&(n=n.update({filter:(s,i)=>t.value.from!=s||t.value.to!=i,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:s}=e.selection.main;n.between(s,s,(i,r)=>{i<s&&r>s&&(t=!0)}),t&&(n=n.update({filterFrom:s,filterTo:s,filter:(i,r)=>r<=s||i>=s}))}return n},provide:n=>Oe.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(s,i)=>{t.push(s,i)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let s=n[t++],i=n[t++];if(typeof s!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(CA.range(s,i))}return je.set(e,!0)}});function Cp(n,e,t){var s;let i=null;return(s=n.field(xl,!1))===null||s===void 0||s.between(e,t,(r,o)=>{(!i||i.from>r)&&(i={from:r,to:o})}),i}function uJ(n,e,t){let s=!1;return n.between(e,e,(i,r)=>{i==e&&r==t&&(s=!0)}),s}function oD(n,e){return n.field(xl,!1)?e:e.concat(tt.appendConfig.of(cD()))}const fJ=n=>{for(let e of rD(n)){let t=Ep(n.state,e.from,e.to);if(t)return n.dispatch({effects:oD(n.state,[_m.of(t),lD(n,t)])}),!0}return!1},hJ=n=>{if(!n.state.field(xl,!1))return!1;let e=[];for(let t of rD(n)){let s=Cp(n.state,t.from,t.to);s&&e.push(yf.of(s),lD(n,s,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function lD(n,e,t=!0){let s=n.state.doc.lineAt(e.from).number,i=n.state.doc.lineAt(e.to).number;return Oe.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${s} ${n.state.phrase("to")} ${i}.`)}const dJ=n=>{let{state:e}=n,t=[];for(let s=0;s<e.doc.length;){let i=n.lineBlockAt(s),r=Ep(e,i.from,i.to);r&&t.push(_m.of(r)),s=(r?n.lineBlockAt(r.to):i).to+1}return t.length&&n.dispatch({effects:oD(n.state,t)}),!!t.length},pJ=n=>{let e=n.state.field(xl,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(s,i)=>{t.push(yf.of({from:s,to:i}))}),n.dispatch({effects:t}),!0},mJ=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:fJ},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:hJ},{key:"Ctrl-Alt-[",run:dJ},{key:"Ctrl-Alt-]",run:pJ}],gJ={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},aD=Re.define({combine(n){return Ei(n,gJ)}});function cD(n){return[xl,wJ]}function uD(n,e){let{state:t}=n,s=t.facet(aD),i=o=>{let l=n.lineBlockAt(n.posAtDOM(o.target)),c=Cp(n.state,l.from,l.to);c&&n.dispatch({effects:yf.of(c)}),o.preventDefault()};if(s.placeholderDOM)return s.placeholderDOM(n,i,e);let r=document.createElement("span");return r.textContent=s.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=i,r}const CA=je.replace({widget:new class extends No{toDOM(n){return uD(n,null)}}});class bJ extends No{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return uD(e,this.value)}}const yJ={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class l0 extends Zi{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function vJ(n={}){let e=Object.assign(Object.assign({},yJ),n),t=new l0(e,!0),s=new l0(e,!1),i=Jt.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Ro)!=o.state.facet(Ro)||o.startState.field(xl,!1)!=o.state.field(xl,!1)||$n(o.startState)!=$n(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new $r;for(let c of o.viewportLineBlocks){let f=Cp(o.state,c.from,c.to)?s:Ep(o.state,c.from,c.to)?t:null;f&&l.add(c.from,c.from,f)}return l.finish()}}),{domEventHandlers:r}=e;return[i,UM({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(i))===null||l===void 0?void 0:l.markers)||pt.empty},initialSpacer(){return new l0(e,!1)},domEventHandlers:Object.assign(Object.assign({},r),{click:(o,l,c)=>{if(r.click&&r.click(o,l,c))return!0;let f=Cp(o.state,l.from,l.to);if(f)return o.dispatch({effects:yf.of(f)}),!0;let h=Ep(o.state,l.from,l.to);return h?(o.dispatch({effects:_m.of(h)}),!0):!1}})}),cD()]}const wJ=Oe.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class vf{constructor(e,t){this.specs=e;let s;function i(l){let c=Ao.newName();return(s||(s=Object.create(null)))["."+c]=l,c}const r=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof di?l=>l.prop(ha)==o.data:o?l=>l==o:void 0,this.style=ZM(e.map(l=>({tag:l.tag,class:l.class||i(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=s?new Ao(s):null,this.themeType=t.themeType}static define(e,t){return new vf(e,t||{})}}const tv=Re.define(),fD=Re.define({combine(n){return n.length?[n[0]]:null}});function a0(n){let e=n.facet(tv);return e.length?e:n.facet(fD)}function hD(n,e){let t=[xJ],s;return n instanceof vf&&(n.module&&t.push(Oe.styleModule.of(n.module)),s=n.themeType),e?.fallback?t.push(fD.of(n)):s?t.push(tv.computeN([Oe.darkTheme],i=>i.facet(Oe.darkTheme)==(s=="dark")?[n]:[])):t.push(tv.of(n)),t}class SJ{constructor(e){this.markCache=Object.create(null),this.tree=$n(e.state),this.decorations=this.buildDeco(e,a0(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=$n(e.state),s=a0(e.state),i=s!=a0(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<r.to&&!i&&t.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,s),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return je.none;let s=new $r;for(let{from:i,to:r}of e.visibleRanges)HQ(this.tree,t,(o,l,c)=>{s.add(o,l,this.markCache[c]||(this.markCache[c]=je.mark({class:c})))},i,r);return s.finish()}}const xJ=kl.high(Jt.fromClass(SJ,{decorations:n=>n.decorations})),_J=vf.define([{tag:j.meta,color:"#404740"},{tag:j.link,textDecoration:"underline"},{tag:j.heading,textDecoration:"underline",fontWeight:"bold"},{tag:j.emphasis,fontStyle:"italic"},{tag:j.strong,fontWeight:"bold"},{tag:j.strikethrough,textDecoration:"line-through"},{tag:j.keyword,color:"#708"},{tag:[j.atom,j.bool,j.url,j.contentSeparator,j.labelName],color:"#219"},{tag:[j.literal,j.inserted],color:"#164"},{tag:[j.string,j.deleted],color:"#a11"},{tag:[j.regexp,j.escape,j.special(j.string)],color:"#e40"},{tag:j.definition(j.variableName),color:"#00f"},{tag:j.local(j.variableName),color:"#30a"},{tag:[j.typeName,j.namespace],color:"#085"},{tag:j.className,color:"#167"},{tag:[j.special(j.variableName),j.macroName],color:"#256"},{tag:j.definition(j.propertyName),color:"#00c"},{tag:j.comment,color:"#940"},{tag:j.invalid,color:"#f00"}]),EJ=Oe.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),dD=1e4,pD="()[]{}",mD=Re.define({combine(n){return Ei(n,{afterCursor:!0,brackets:pD,maxScanDistance:dD,renderMatch:kJ})}}),CJ=je.mark({class:"cm-matchingBracket"}),AJ=je.mark({class:"cm-nonmatchingBracket"});function kJ(n){let e=[],t=n.matched?CJ:AJ;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const TJ=un.define({create(){return je.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],s=e.state.facet(mD);for(let i of e.state.selection.ranges){if(!i.empty)continue;let r=Ui(e.state,i.head,-1,s)||i.head>0&&Ui(e.state,i.head-1,1,s)||s.afterCursor&&(Ui(e.state,i.head,1,s)||i.head<e.state.doc.length&&Ui(e.state,i.head+1,-1,s));r&&(t=t.concat(s.renderMatch(r,e.state)))}return je.set(t,!0)},provide:n=>Oe.decorations.from(n)}),OJ=[TJ,EJ];function RJ(n={}){return[mD.of(n),OJ]}const MJ=new ct;function nv(n,e,t){let s=n.prop(e<0?ct.openedBy:ct.closedBy);if(s)return s;if(n.name.length==1){let i=t.indexOf(n.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function sv(n){let e=n.type.prop(MJ);return e?e(n.node):n}function Ui(n,e,t,s={}){let i=s.maxScanDistance||dD,r=s.brackets||pD,o=$n(n),l=o.resolveInner(e,t);for(let c=l;c;c=c.parent){let f=nv(c.type,t,r);if(f&&c.from<c.to){let h=sv(c);if(h&&(t>0?e>=h.from&&e<h.to:e>h.from&&e<=h.to))return DJ(n,e,t,c,h,f,r)}}return LJ(n,e,t,o,l.type,i,r)}function DJ(n,e,t,s,i,r,o){let l=s.parent,c={from:i.from,to:i.to},f=0,h=l?.cursor();if(h&&(t<0?h.childBefore(s.from):h.childAfter(s.to)))do if(t<0?h.to<=s.from:h.from>=s.to){if(f==0&&r.indexOf(h.type.name)>-1&&h.from<h.to){let d=sv(h);return{start:c,end:d?{from:d.from,to:d.to}:void 0,matched:!0}}else if(nv(h.type,t,o))f++;else if(nv(h.type,-t,o)){if(f==0){let d=sv(h);return{start:c,end:d&&d.from<d.to?{from:d.from,to:d.to}:void 0,matched:!1}}f--}}while(t<0?h.prevSibling():h.nextSibling());return{start:c,matched:!1}}function LJ(n,e,t,s,i,r,o){let l=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),c=o.indexOf(l);if(c<0||c%2==0!=t>0)return null;let f={from:t<0?e-1:e,to:t>0?e+1:e},h=n.doc.iterRange(e,t>0?n.doc.length:0),d=0;for(let g=0;!h.next().done&&g<=r;){let m=h.value;t<0&&(g+=m.length);let y=e+g*t;for(let w=t>0?0:m.length-1,x=t>0?m.length:-1;w!=x;w+=t){let S=o.indexOf(m[w]);if(!(S<0||s.resolveInner(y+w,1).type!=i))if(S%2==0==t>0)d++;else{if(d==1)return{start:f,end:{from:y+w,to:y+w+1},matched:S>>1==c>>1};d--}}t>0&&(g+=m.length)}return h.done?{start:f,matched:!1}:null}const NJ=Object.create(null),AA=[ms.none],kA=[],TA=Object.create(null),IJ=Object.create(null);for(let[n,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"]])IJ[n]=PJ(NJ,e);function c0(n,e){kA.indexOf(n)>-1||(kA.push(n),console.warn(e))}function PJ(n,e){let t=[];for(let l of e.split(" ")){let c=[];for(let f of l.split(".")){let h=n[f]||j[f];h?typeof h=="function"?c.length?c=c.map(h):c0(f,`Modifier ${f} used at start of tag`):c.length?c0(f,`Tag ${f} used as modifier`):c=Array.isArray(h)?h:[h]:c0(f,`Unknown highlighting tag ${f}`)}for(let f of c)t.push(f)}if(!t.length)return 0;let s=e.replace(/ /g,"_"),i=s+" "+t.map(l=>l.id),r=TA[i];if(r)return r.id;let o=TA[i]=ms.define({id:AA.length,name:s,props:[QM({[s]:t})]});return AA.push(o),o.id}Ft.RTL,Ft.LTR;const $J=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),s=Yw(n.state,t.from);return s.line?BJ(n):s.block?VJ(n):!1};function Gw(n,e){return({state:t,dispatch:s})=>{if(t.readOnly)return!1;let i=n(e,t);return i?(s(t.update(i)),!0):!1}}const BJ=Gw(UJ,0),FJ=Gw(gD,0),VJ=Gw((n,e)=>gD(n,e,HJ(e)),0);function Yw(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const Uc=50;function WJ(n,{open:e,close:t},s,i){let r=n.sliceDoc(s-Uc,s),o=n.sliceDoc(i,i+Uc),l=/\s*$/.exec(r)[0].length,c=/^\s*/.exec(o)[0].length,f=r.length-l;if(r.slice(f-e.length,f)==e&&o.slice(c,c+t.length)==t)return{open:{pos:s-l,margin:l&&1},close:{pos:i+c,margin:c&&1}};let h,d;i-s<=2*Uc?h=d=n.sliceDoc(s,i):(h=n.sliceDoc(s,s+Uc),d=n.sliceDoc(i-Uc,i));let g=/^\s*/.exec(h)[0].length,m=/\s*$/.exec(d)[0].length,y=d.length-m-t.length;return h.slice(g,g+e.length)==e&&d.slice(y,y+t.length)==t?{open:{pos:s+g+e.length,margin:/\s/.test(h.charAt(g+e.length))?1:0},close:{pos:i-m-t.length,margin:/\s/.test(d.charAt(y-1))?1:0}}:null}function HJ(n){let e=[];for(let t of n.selection.ranges){let s=n.doc.lineAt(t.from),i=t.to<=s.to?s:n.doc.lineAt(t.to);i.from>s.from&&i.from==t.to&&(i=t.to==s.to+1?s:n.doc.lineAt(t.to-1));let r=e.length-1;r>=0&&e[r].to>s.from?e[r].to=i.to:e.push({from:s.from+/^\s*/.exec(s.text)[0].length,to:i.to})}return e}function gD(n,e,t=e.selection.ranges){let s=t.map(r=>Yw(e,r.from).block);if(!s.every(r=>r))return null;let i=t.map((r,o)=>WJ(e,s[o],r.from,r.to));if(n!=2&&!i.every(r=>r))return{changes:e.changes(t.map((r,o)=>i[o]?[]:[{from:r.from,insert:s[o].open+" "},{from:r.to,insert:" "+s[o].close}]))};if(n!=1&&i.some(r=>r)){let r=[];for(let o=0,l;o<i.length;o++)if(l=i[o]){let c=s[o],{open:f,close:h}=l;r.push({from:f.pos-c.open.length,to:f.pos+f.margin},{from:h.pos-h.margin,to:h.pos+c.close.length})}return{changes:r}}return null}function UJ(n,e,t=e.selection.ranges){let s=[],i=-1;for(let{from:r,to:o}of t){let l=s.length,c=1e9,f=Yw(e,r).line;if(f){for(let h=r;h<=o;){let d=e.doc.lineAt(h);if(d.from>i&&(r==o||o>d.from)){i=d.from;let g=/^\s*/.exec(d.text)[0].length,m=g==d.length,y=d.text.slice(g,g+f.length)==f?g:-1;g<d.text.length&&g<c&&(c=g),s.push({line:d,comment:y,token:f,indent:g,empty:m,single:!1})}h=d.to+1}if(c<1e9)for(let h=l;h<s.length;h++)s[h].indent<s[h].line.text.length&&(s[h].indent=c);s.length==l+1&&(s[l].single=!0)}}if(n!=2&&s.some(r=>r.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:c,indent:f,empty:h,single:d}of s)(d||!h)&&r.push({from:l.from+f,insert:c+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&s.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:c}of s)if(l>=0){let f=o.from+l,h=f+c.length;o.text[h-o.from]==" "&&h++,r.push({from:f,to:h})}return{changes:r}}return null}const iv=Wr.define(),zJ=Wr.define(),qJ=Re.define(),bD=Re.define({combine(n){return Ei(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(s,i)=>e(s,i)||t(s,i)})}}),yD=un.define({create(){return zi.empty},update(n,e){let t=e.state.facet(bD),s=e.annotation(iv);if(s){let c=hs.fromTransaction(e,s.selection),f=s.side,h=f==0?n.undone:n.done;return c?h=Ap(h,h.length,t.minDepth,c):h=SD(h,e.startState.selection),new zi(f==0?s.rest:h,f==0?h:s.rest)}let i=e.annotation(zJ);if((i=="full"||i=="before")&&(n=n.isolate()),e.annotation(an.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=hs.fromTransaction(e),o=e.annotation(an.time),l=e.annotation(an.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(i=="full"||i=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new zi(n.done.map(hs.fromJSON),n.undone.map(hs.fromJSON))}});function KJ(n={}){return[yD,bD.of(n),Oe.domEventHandlers({beforeinput(e,t){let s=e.inputType=="historyUndo"?vD:e.inputType=="historyRedo"?rv:null;return s?(e.preventDefault(),s(t)):!1}})]}function Em(n,e){return function({state:t,dispatch:s}){if(!e&&t.readOnly)return!1;let i=t.field(yD,!1);if(!i)return!1;let r=i.pop(n,t,e);return r?(s(r),!0):!1}}const vD=Em(0,!1),rv=Em(1,!1),jJ=Em(0,!0),GJ=Em(1,!0);class hs{constructor(e,t,s,i,r){this.changes=e,this.effects=t,this.mapped=s,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new hs(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,s;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(s=this.startSelection)===null||s===void 0?void 0:s.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new hs(e.changes&&ln.fromJSON(e.changes),[],e.mapped&&Yi.fromJSON(e.mapped),e.startSelection&&le.fromJSON(e.startSelection),e.selectionsAfter.map(le.fromJSON))}static fromTransaction(e,t){let s=Ys;for(let i of e.startState.facet(qJ)){let r=i(e);r.length&&(s=s.concat(r))}return!s.length&&e.changes.empty?null:new hs(e.changes.invert(e.startState.doc),s,void 0,t||e.startState.selection,Ys)}static selection(e){return new hs(void 0,Ys,void 0,void 0,e)}}function Ap(n,e,t,s){let i=e+1>t+20?e-t-1:0,r=n.slice(i,e);return r.push(s),r}function YJ(n,e){let t=[],s=!1;return n.iterChangedRanges((i,r)=>t.push(i,r)),e.iterChangedRanges((i,r,o,l)=>{for(let c=0;c<t.length;){let f=t[c++],h=t[c++];l>=f&&o<=h&&(s=!0)}}),s}function XJ(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,s)=>t.empty!=e.ranges[s].empty).length===0}function wD(n,e){return n.length?e.length?n.concat(e):n:e}const Ys=[],QJ=200;function SD(n,e){if(n.length){let t=n[n.length-1],s=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-QJ));return s.length&&s[s.length-1].eq(e)?n:(s.push(e),Ap(n,n.length-1,1e9,t.setSelAfter(s)))}else return[hs.selection([e])]}function JJ(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function u0(n,e){if(!n.length)return n;let t=n.length,s=Ys;for(;t;){let i=ZJ(n[t-1],e,s);if(i.changes&&!i.changes.empty||i.effects.length){let r=n.slice(0,t);return r[t-1]=i,r}else e=i.mapped,t--,s=i.selectionsAfter}return s.length?[hs.selection(s)]:Ys}function ZJ(n,e,t){let s=wD(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Ys,t);if(!n.changes)return hs.selection(s);let i=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new hs(i,tt.mapEffects(n.effects,e),o,n.startSelection.map(r),s)}const eZ=/^(input\.type|delete)($|\.)/;class zi{constructor(e,t,s=0,i=void 0){this.done=e,this.undone=t,this.prevTime=s,this.prevUserEvent=i}isolate(){return this.prevTime?new zi(this.done,this.undone):this}addChanges(e,t,s,i,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!s||eZ.test(s))&&(!l.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(r,YJ(l.changes,e.changes))||s=="input.type.compose")?o=Ap(o,o.length-1,i.minDepth,new hs(e.changes.compose(l.changes),wD(tt.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,Ys)):o=Ap(o,o.length,i.minDepth,e),new zi(o,Ys,t,s)}addSelection(e,t,s,i){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:Ys;return r.length>0&&t-this.prevTime<i&&s==this.prevUserEvent&&s&&/^select($|\.)/.test(s)&&XJ(r[r.length-1],e)?this:new zi(SD(this.done,e),this.undone,t,s)}addMapping(e){return new zi(u0(this.done,e),u0(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,s){let i=e==0?this.done:this.undone;if(i.length==0)return null;let r=i[i.length-1],o=r.selectionsAfter[0]||t.selection;if(s&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:iv.of({side:e,rest:JJ(i),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let l=i.length==1?Ys:i.slice(0,i.length-1);return r.mapped&&(l=u0(l,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:iv.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}zi.empty=new zi(Ys,Ys);const tZ=[{key:"Mod-z",run:vD,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:rv,preventDefault:!0},{linux:"Ctrl-Shift-z",run:rv,preventDefault:!0},{key:"Mod-u",run:jJ,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:GJ,preventDefault:!0}];function cc(n,e){return le.create(n.ranges.map(e),n.mainIndex)}function Ci(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Ai({state:n,dispatch:e},t){let s=cc(n.selection,t);return s.eq(n.selection,!0)?!1:(e(Ci(n,s)),!0)}function Cm(n,e){return le.cursor(e?n.to:n.from)}function xD(n,e){return Ai(n,t=>t.empty?n.moveByChar(t,e):Cm(t,e))}function Vn(n){return n.textDirectionAt(n.state.selection.main.head)==Ft.LTR}const _D=n=>xD(n,!Vn(n)),ED=n=>xD(n,Vn(n));function CD(n,e){return Ai(n,t=>t.empty?n.moveByGroup(t,e):Cm(t,e))}const nZ=n=>CD(n,!Vn(n)),sZ=n=>CD(n,Vn(n));function iZ(n,e,t){if(e.type.prop(t))return!0;let s=e.to-e.from;return s&&(s>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Am(n,e,t){let s=$n(n).resolveInner(e.head),i=t?ct.closedBy:ct.openedBy;for(let c=e.head;;){let f=t?s.childAfter(c):s.childBefore(c);if(!f)break;iZ(n,f,i)?s=f:c=t?f.to:f.from}let r=s.type.prop(i),o,l;return r&&(o=t?Ui(n,s.from,1):Ui(n,s.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?s.to:s.from,le.cursor(l,t?-1:1)}const rZ=n=>Ai(n,e=>Am(n.state,e,!Vn(n))),oZ=n=>Ai(n,e=>Am(n.state,e,Vn(n)));function AD(n,e){return Ai(n,t=>{if(!t.empty)return Cm(t,e);let s=n.moveVertically(t,e);return s.head!=t.head?s:n.moveToLineBoundary(t,e)})}const kD=n=>AD(n,!1),TD=n=>AD(n,!0);function OD(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,s=0,i;if(e){for(let r of n.state.facet(Oe.scrollMargins)){let o=r(n);o?.top&&(t=Math.max(o?.top,t)),o?.bottom&&(s=Math.max(o?.bottom,s))}i=n.scrollDOM.clientHeight-t-s}else i=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:s,selfScroll:e,height:Math.max(n.defaultLineHeight,i-5)}}function RD(n,e){let t=OD(n),{state:s}=n,i=cc(s.selection,o=>o.empty?n.moveVertically(o,e,t.height):Cm(o,e));if(i.eq(s.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(s.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),c=l.top+t.marginTop,f=l.bottom-t.marginBottom;o&&o.top>c&&o.bottom<f&&(r=Oe.scrollIntoView(i.main.head,{y:"start",yMargin:o.top-c}))}return n.dispatch(Ci(s,i),{effects:r}),!0}const OA=n=>RD(n,!1),ov=n=>RD(n,!0);function Io(n,e,t){let s=n.lineBlockAt(e.head),i=n.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?s.to:s.from)&&(i=n.moveToLineBoundary(e,t,!1)),!t&&i.head==s.from&&s.length){let r=/^\s*/.exec(n.state.sliceDoc(s.from,Math.min(s.from+100,s.to)))[0].length;r&&e.head!=s.from+r&&(i=le.cursor(s.from+r))}return i}const lZ=n=>Ai(n,e=>Io(n,e,!0)),aZ=n=>Ai(n,e=>Io(n,e,!1)),cZ=n=>Ai(n,e=>Io(n,e,!Vn(n))),uZ=n=>Ai(n,e=>Io(n,e,Vn(n))),fZ=n=>Ai(n,e=>le.cursor(n.lineBlockAt(e.head).from,1)),hZ=n=>Ai(n,e=>le.cursor(n.lineBlockAt(e.head).to,-1));function dZ(n,e,t){let s=!1,i=cc(n.selection,r=>{let o=Ui(n,r.head,-1)||Ui(n,r.head,1)||r.head>0&&Ui(n,r.head-1,1)||r.head<n.doc.length&&Ui(n,r.head+1,-1);if(!o||!o.end)return r;s=!0;let l=o.start.from==r.head?o.end.to:o.end.from;return le.cursor(l)});return s?(e(Ci(n,i)),!0):!1}const pZ=({state:n,dispatch:e})=>dZ(n,e);function li(n,e){let t=cc(n.state.selection,s=>{let i=e(s);return le.range(s.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Ci(n.state,t)),!0)}function MD(n,e){return li(n,t=>n.moveByChar(t,e))}const DD=n=>MD(n,!Vn(n)),LD=n=>MD(n,Vn(n));function ND(n,e){return li(n,t=>n.moveByGroup(t,e))}const mZ=n=>ND(n,!Vn(n)),gZ=n=>ND(n,Vn(n)),bZ=n=>li(n,e=>Am(n.state,e,!Vn(n))),yZ=n=>li(n,e=>Am(n.state,e,Vn(n)));function ID(n,e){return li(n,t=>n.moveVertically(t,e))}const PD=n=>ID(n,!1),$D=n=>ID(n,!0);function BD(n,e){return li(n,t=>n.moveVertically(t,e,OD(n).height))}const RA=n=>BD(n,!1),MA=n=>BD(n,!0),vZ=n=>li(n,e=>Io(n,e,!0)),wZ=n=>li(n,e=>Io(n,e,!1)),SZ=n=>li(n,e=>Io(n,e,!Vn(n))),xZ=n=>li(n,e=>Io(n,e,Vn(n))),_Z=n=>li(n,e=>le.cursor(n.lineBlockAt(e.head).from)),EZ=n=>li(n,e=>le.cursor(n.lineBlockAt(e.head).to)),DA=({state:n,dispatch:e})=>(e(Ci(n,{anchor:0})),!0),LA=({state:n,dispatch:e})=>(e(Ci(n,{anchor:n.doc.length})),!0),NA=({state:n,dispatch:e})=>(e(Ci(n,{anchor:n.selection.main.anchor,head:0})),!0),IA=({state:n,dispatch:e})=>(e(Ci(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),CZ=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),AZ=({state:n,dispatch:e})=>{let t=km(n).map(({from:s,to:i})=>le.range(s,Math.min(i+1,n.doc.length)));return e(n.update({selection:le.create(t),userEvent:"select"})),!0},kZ=({state:n,dispatch:e})=>{let t=cc(n.selection,s=>{let i=$n(n),r=i.resolveStack(s.from,1);if(s.empty){let o=i.resolveStack(s.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from<s.from&&l.to>=s.to||l.to>s.to&&l.from<=s.from)&&o.next)return le.range(l.to,l.from)}return s});return t.eq(n.selection)?!1:(e(Ci(n,t)),!0)};function FD(n,e){let{state:t}=n,s=t.selection,i=t.selection.ranges.slice();for(let r of t.selection.ranges){let o=t.doc.lineAt(r.head);if(e?o.to<n.state.doc.length:o.from>0)for(let l=r;;){let c=n.moveVertically(l,e);if(c.head<o.from||c.head>o.to){i.some(f=>f.head==c.head)||i.push(c);break}else{if(c.head==l.head)break;l=c}}}return i.length==s.ranges.length?!1:(n.dispatch(Ci(t,le.create(i,i.length-1))),!0)}const TZ=n=>FD(n,!1),OZ=n=>FD(n,!0),RZ=({state:n,dispatch:e})=>{let t=n.selection,s=null;return t.ranges.length>1?s=le.create([t.main]):t.main.empty||(s=le.create([le.cursor(t.main.head)])),s?(e(Ci(n,s)),!0):!1};function wf(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:s}=n,i=s.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let c=e(r);c<o?(t="delete.backward",c=Xh(n,c,!1)):c>o&&(t="delete.forward",c=Xh(n,c,!0)),o=Math.min(o,c),l=Math.max(l,c)}else o=Xh(n,o,!1),l=Xh(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:le.cursor(o,o<r.head?-1:1)}});return i.changes.empty?!1:(n.dispatch(s.update(i,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?Oe.announce.of(s.phrase("Selection deleted")):void 0})),!0)}function Xh(n,e,t){if(n instanceof Oe)for(let s of n.state.facet(Oe.atomicRanges).map(i=>i(n)))s.between(e,e,(i,r)=>{i<e&&r>e&&(e=t?r:i)});return e}const VD=(n,e,t)=>wf(n,s=>{let i=s.from,{state:r}=n,o=r.doc.lineAt(i),l,c;if(t&&!e&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,i-o.from))){if(l[l.length-1]=="	")return i-1;let f=ac(l,r.tabSize),h=f%_p(r)||_p(r);for(let d=0;d<h&&l[l.length-1-d]==" ";d++)i--;c=i}else c=Cn(o.text,i-o.from,e,e)+o.from,c==i&&o.number!=(e?r.doc.lines:1)?c+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=Cn(o.text,c-o.from,!1,!1)+o.from);return c}),lv=n=>VD(n,!1,!0),WD=n=>VD(n,!0,!1),HD=(n,e)=>wf(n,t=>{let s=t.head,{state:i}=n,r=i.doc.lineAt(s),o=i.charCategorizer(s);for(let l=null;;){if(s==(e?r.to:r.from)){s==t.head&&r.number!=(e?i.doc.lines:1)&&(s+=e?1:-1);break}let c=Cn(r.text,s-r.from,e)+r.from,f=r.text.slice(Math.min(s,c)-r.from,Math.max(s,c)-r.from),h=o(f);if(l!=null&&h!=l)break;(f!=" "||s!=t.head)&&(l=h),s=c}return s}),UD=n=>HD(n,!1),MZ=n=>HD(n,!0),DZ=n=>wf(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),LZ=n=>wf(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),NZ=n=>wf(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),IZ=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(s=>({changes:{from:s.from,to:s.to,insert:yt.of(["",""])},range:le.cursor(s.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},PZ=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(s=>{if(!s.empty||s.from==0||s.from==n.doc.length)return{range:s};let i=s.from,r=n.doc.lineAt(i),o=i==r.from?i-1:Cn(r.text,i-r.from,!1)+r.from,l=i==r.to?i+1:Cn(r.text,i-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(i,l).append(n.doc.slice(o,i))},range:le.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function km(n){let e=[],t=-1;for(let s of n.selection.ranges){let i=n.doc.lineAt(s.from),r=n.doc.lineAt(s.to);if(!s.empty&&s.to==r.from&&(r=n.doc.lineAt(s.to-1)),t>=i.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(s)}else e.push({from:i.from,to:r.to,ranges:[s]});t=r.number+1}return e}function zD(n,e,t){if(n.readOnly)return!1;let s=[],i=[];for(let r of km(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){s.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let c of r.ranges)i.push(le.range(Math.min(n.doc.length,c.anchor+l),Math.min(n.doc.length,c.head+l)))}else{s.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let c of r.ranges)i.push(le.range(c.anchor-l,c.head-l))}}return s.length?(e(n.update({changes:s,scrollIntoView:!0,selection:le.create(i,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const $Z=({state:n,dispatch:e})=>zD(n,e,!1),BZ=({state:n,dispatch:e})=>zD(n,e,!0);function qD(n,e,t){if(n.readOnly)return!1;let s=[];for(let r of km(n))t?s.push({from:r.from,insert:n.doc.slice(r.from,r.to)+n.lineBreak}):s.push({from:r.to,insert:n.lineBreak+n.doc.slice(r.from,r.to)});let i=n.changes(s);return e(n.update({changes:i,selection:n.selection.map(i,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const FZ=({state:n,dispatch:e})=>qD(n,e,!1),VZ=({state:n,dispatch:e})=>qD(n,e,!0),WZ=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(km(e).map(({from:i,to:r})=>(i>0?i--:r<e.doc.length&&r++,{from:i,to:r}))),s=cc(e.selection,i=>{let r;if(n.lineWrapping){let o=n.lineBlockAt(i.head),l=n.coordsAtPos(i.head,i.assoc||1);l&&(r=o.bottom+n.documentTop-l.bottom+n.defaultLineHeight/2)}return n.moveVertically(i,!0,r)}).map(t);return n.dispatch({changes:t,selection:s,scrollIntoView:!0,userEvent:"delete.line"}),!0};function HZ(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=$n(n).resolveInner(e),s=t.childBefore(e),i=t.childAfter(e),r;return s&&i&&s.to<=e&&i.from>=e&&(r=s.type.prop(ct.closedBy))&&r.indexOf(i.name)>-1&&n.doc.lineAt(s.to).from==n.doc.lineAt(i.from).from&&!/\S/.test(n.sliceDoc(s.to,i.from))?{from:s.to,to:i.from}:null}const PA=KD(!1),UZ=KD(!0);function KD(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let s=e.changeByRange(i=>{let{from:r,to:o}=i,l=e.doc.lineAt(r),c=!n&&r==o&&HZ(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let f=new xm(e,{simulateBreak:r,simulateDoubleBreak:!!c}),h=Kw(f,r);for(h==null&&(h=ac(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;c?{from:r,to:o}=c:r>l.from&&r<l.from+100&&!/\S/.test(l.text.slice(0,r))&&(r=l.from);let d=["",ju(e,h)];return c&&d.push(ju(e,f.lineIndent(l.from,-1))),{changes:{from:r,to:o,insert:yt.of(d)},range:le.cursor(r+1+d[1].length)}});return t(e.update(s,{scrollIntoView:!0,userEvent:"input"})),!0}}function Xw(n,e){let t=-1;return n.changeByRange(s=>{let i=[];for(let o=s.from;o<=s.to;){let l=n.doc.lineAt(o);l.number>t&&(s.empty||s.to>l.from)&&(e(l,i,s),t=l.number),o=l.to+1}let r=n.changes(i);return{changes:i,range:le.range(r.mapPos(s.anchor,1),r.mapPos(s.head,1))}})}const zZ=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),s=new xm(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),i=Xw(n,(r,o,l)=>{let c=Kw(s,r.from);if(c==null)return;/\S/.test(r.text)||(c=0);let f=/^\s*/.exec(r.text)[0],h=ju(n,c);(f!=h||l.from<r.from+f.length)&&(t[r.from]=c,o.push({from:r.from,to:r.from+f.length,insert:h}))});return i.changes.empty||e(n.update(i,{userEvent:"indent"})),!0},jD=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Xw(n,(t,s)=>{s.push({from:t.from,insert:n.facet(qw)})}),{userEvent:"input.indent"})),!0),GD=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Xw(n,(t,s)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=ac(i,n.tabSize),o=0,l=ju(n,Math.max(0,r-_p(n)));for(;o<i.length&&o<l.length&&i.charCodeAt(o)==l.charCodeAt(o);)o++;s.push({from:t.from+o,to:t.from+i.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),qZ=n=>(n.setTabFocusMode(),!0),KZ=[{key:"Ctrl-b",run:_D,shift:DD,preventDefault:!0},{key:"Ctrl-f",run:ED,shift:LD},{key:"Ctrl-p",run:kD,shift:PD},{key:"Ctrl-n",run:TD,shift:$D},{key:"Ctrl-a",run:fZ,shift:_Z},{key:"Ctrl-e",run:hZ,shift:EZ},{key:"Ctrl-d",run:WD},{key:"Ctrl-h",run:lv},{key:"Ctrl-k",run:DZ},{key:"Ctrl-Alt-h",run:UD},{key:"Ctrl-o",run:IZ},{key:"Ctrl-t",run:PZ},{key:"Ctrl-v",run:ov}],jZ=[{key:"ArrowLeft",run:_D,shift:DD,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:nZ,shift:mZ,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:cZ,shift:SZ,preventDefault:!0},{key:"ArrowRight",run:ED,shift:LD,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:sZ,shift:gZ,preventDefault:!0},{mac:"Cmd-ArrowRight",run:uZ,shift:xZ,preventDefault:!0},{key:"ArrowUp",run:kD,shift:PD,preventDefault:!0},{mac:"Cmd-ArrowUp",run:DA,shift:NA},{mac:"Ctrl-ArrowUp",run:OA,shift:RA},{key:"ArrowDown",run:TD,shift:$D,preventDefault:!0},{mac:"Cmd-ArrowDown",run:LA,shift:IA},{mac:"Ctrl-ArrowDown",run:ov,shift:MA},{key:"PageUp",run:OA,shift:RA},{key:"PageDown",run:ov,shift:MA},{key:"Home",run:aZ,shift:wZ,preventDefault:!0},{key:"Mod-Home",run:DA,shift:NA},{key:"End",run:lZ,shift:vZ,preventDefault:!0},{key:"Mod-End",run:LA,shift:IA},{key:"Enter",run:PA,shift:PA},{key:"Mod-a",run:CZ},{key:"Backspace",run:lv,shift:lv,preventDefault:!0},{key:"Delete",run:WD,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:UD,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:MZ,preventDefault:!0},{mac:"Mod-Backspace",run:LZ,preventDefault:!0},{mac:"Mod-Delete",run:NZ,preventDefault:!0}].concat(KZ.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),YD=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:rZ,shift:bZ},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:oZ,shift:yZ},{key:"Alt-ArrowUp",run:$Z},{key:"Shift-Alt-ArrowUp",run:FZ},{key:"Alt-ArrowDown",run:BZ},{key:"Shift-Alt-ArrowDown",run:VZ},{key:"Mod-Alt-ArrowUp",run:TZ},{key:"Mod-Alt-ArrowDown",run:OZ},{key:"Escape",run:RZ},{key:"Mod-Enter",run:UZ},{key:"Alt-l",mac:"Ctrl-l",run:AZ},{key:"Mod-i",run:kZ,preventDefault:!0},{key:"Mod-[",run:GD},{key:"Mod-]",run:jD},{key:"Mod-Alt-\\",run:zZ},{key:"Shift-Mod-k",run:WZ},{key:"Shift-Mod-\\",run:pZ},{key:"Mod-/",run:$J},{key:"Alt-A",run:FJ},{key:"Ctrl-m",mac:"Shift-Alt-m",run:qZ}].concat(jZ),GZ={key:"Tab",run:jD,shift:GD};function Nt(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){var i=t[s];typeof i=="string"?n.setAttribute(s,i):i!=null&&(n[s]=i)}e++}for(;e<arguments.length;e++)XD(n,arguments[e]);return n}function XD(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)XD(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}const $A=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class Ja{constructor(e,t,s=0,i=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(s,i),this.bufferStart=s,this.normalize=r?l=>r($A(l)):$A,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return xn(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Aw(e),s=this.bufferStart+this.bufferPos;this.bufferPos+=js(e);let i=this.normalize(t);if(i.length)for(let r=0,o=s;;r++){let l=i.charCodeAt(r),c=this.match(l,o,this.bufferPos+this.bufferStart);if(r==i.length-1){if(c)return this.value=c,this;break}o==s&&r<t.length&&t.charCodeAt(r)==l&&o++}}}match(e,t,s){let i=null;for(let r=0;r<this.matches.length;r+=2){let o=this.matches[r],l=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?i={from:this.matches[r+1],to:s}:(this.matches[r]++,l=!0)),l||(this.matches.splice(r,2),r-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?i={from:t,to:s}:this.matches.push(1,t)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(Ja.prototype[Symbol.iterator]=function(){return this});const QD={from:-1,to:-1,match:/.*/.exec("")},Qw="gm"+(/x/.unicode==null?"":"u");class JD{constructor(e,t,s,i=0,r=e.length){if(this.text=e,this.to=r,this.curLine="",this.done=!1,this.value=QD,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new ZD(e,t,s,i,r);this.re=new RegExp(t,Qw+(s?.ignoreCase?"i":"")),this.test=s?.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=kp(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let s=this.curLineStart+t.index,i=s+t[0].length;if(this.matchPos=kp(this.text,i+(s==i?1:0)),s==this.curLineStart+this.curLine.length&&this.nextLine(),(s<i||s>this.value.to)&&(!this.test||this.test(s,i,t)))return this.value={from:s,to:i,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const f0=new WeakMap;class Oa{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,s){let i=f0.get(e);if(!i||i.from>=s||i.to<=t){let l=new Oa(t,e.sliceString(t,s));return f0.set(e,l),l}if(i.from==t&&i.to==s)return i;let{text:r,from:o}=i;return o>t&&(r=e.sliceString(t,o)+r,o=t),i.to<s&&(r+=e.sliceString(i.to,s)),f0.set(e,new Oa(o,r)),new Oa(t,r.slice(t-o,s-o))}}class ZD{constructor(e,t,s,i,r){this.text=e,this.to=r,this.done=!1,this.value=QD,this.matchPos=kp(e,i),this.re=new RegExp(t,Qw+(s?.ignoreCase?"i":"")),this.test=s?.test,this.flat=Oa.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let s=this.flat.from+t.index,i=s+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(s,i,t)))return this.value={from:s,to:i,match:t},this.matchPos=kp(this.text,i+(s==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Oa.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(JD.prototype[Symbol.iterator]=ZD.prototype[Symbol.iterator]=function(){return this});function YZ(n){try{return new RegExp(n,Qw),!0}catch{return!1}}function kp(n,e){if(e>=n.length)return e;let t=n.lineAt(e),s;for(;e<t.to&&(s=t.text.charCodeAt(e-t.from))>=56320&&s<57344;)e++;return e}function av(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=Nt("input",{class:"cm-textfield",name:"line",value:e}),s=Nt("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),n.dispatch({effects:Tp.of(!1)}),n.focus()):r.keyCode==13&&(r.preventDefault(),i())},onsubmit:r=>{r.preventDefault(),i()}},Nt("label",n.state.phrase("Go to line"),": ",t)," ",Nt("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!r)return;let{state:o}=n,l=o.doc.lineAt(o.selection.main.head),[,c,f,h,d]=r,g=h?+h.slice(1):0,m=f?+f:l.number;if(f&&d){let x=m/100;c&&(x=x*(c=="-"?-1:1)+l.number/o.doc.lines),m=Math.round(o.doc.lines*x)}else f&&c&&(m=m*(c=="-"?-1:1)+l.number);let y=o.doc.line(Math.max(1,Math.min(o.doc.lines,m))),w=le.cursor(y.from+Math.max(0,Math.min(g,y.length)));n.dispatch({effects:[Tp.of(!1),Oe.scrollIntoView(w.from,{y:"center"})],selection:w}),n.focus()}return{dom:s}}const Tp=tt.define(),BA=un.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Tp)&&(n=t.value);return n},provide:n=>qu.from(n,e=>e?av:null)}),XZ=n=>{let e=zu(n,av);if(!e){let t=[Tp.of(!0)];n.state.field(BA,!1)==null&&t.push(tt.appendConfig.of([BA,QZ])),n.dispatch({effects:t}),e=zu(n,av)}return e&&e.dom.querySelector("input").select(),!0},QZ=Oe.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),JZ={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},ZZ=Re.define({combine(n){return Ei(n,JZ,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function eee(n){return[ree,iee]}const tee=je.mark({class:"cm-selectionMatch"}),nee=je.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function FA(n,e,t,s){return(t==0||n(e.sliceDoc(t-1,t))!=Ut.Word)&&(s==e.doc.length||n(e.sliceDoc(s,s+1))!=Ut.Word)}function see(n,e,t,s){return n(e.sliceDoc(t,t+1))==Ut.Word&&n(e.sliceDoc(s-1,s))==Ut.Word}const iee=Jt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(ZZ),{state:t}=n,s=t.selection;if(s.ranges.length>1)return je.none;let i=s.main,r,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return je.none;let c=t.wordAt(i.head);if(!c)return je.none;o=t.charCategorizer(i.head),r=t.sliceDoc(c.from,c.to)}else{let c=i.to-i.from;if(c<e.minSelectionLength||c>200)return je.none;if(e.wholeWords){if(r=t.sliceDoc(i.from,i.to),o=t.charCategorizer(i.head),!(FA(o,t,i.from,i.to)&&see(o,t,i.from,i.to)))return je.none}else if(r=t.sliceDoc(i.from,i.to),!r)return je.none}let l=[];for(let c of n.visibleRanges){let f=new Ja(t.doc,r,c.from,c.to);for(;!f.next().done;){let{from:h,to:d}=f.value;if((!o||FA(o,t,h,d))&&(i.empty&&h<=i.from&&d>=i.to?l.push(nee.range(h,d)):(h>=i.to||d<=i.from)&&l.push(tee.range(h,d)),l.length>e.maxMatches))return je.none}}return je.set(l)}},{decorations:n=>n.decorations}),ree=Oe.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),oee=({state:n,dispatch:e})=>{let{selection:t}=n,s=le.create(t.ranges.map(i=>n.wordAt(i.head)||le.cursor(i.head)),t.mainIndex);return s.eq(t)?!1:(e(n.update({selection:s})),!0)};function lee(n,e){let{main:t,ranges:s}=n.selection,i=n.wordAt(t.head),r=i&&i.from==t.from&&i.to==t.to;for(let o=!1,l=new Ja(n.doc,e,s[s.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Ja(n.doc,e,0,Math.max(0,s[s.length-1].from-1)),o=!0}else{if(o&&s.some(c=>c.from==l.value.from))continue;if(r){let c=n.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const aee=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return oee({state:n,dispatch:e});let s=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=s))return!1;let i=lee(n,s);return i?(e(n.update({selection:n.selection.addRange(le.range(i.from,i.to),!1),effects:Oe.scrollIntoView(i.to)})),!0):!1},Tl=Re.define({combine(n){return Ei(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new See(e),scrollToMatch:e=>Oe.scrollIntoView(e)})}});function cee(n){return n?[Tl.of(n),uv]:uv}class eL{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||YZ(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,s)=>s=="n"?`
`:s=="r"?"\r":s=="t"?"	":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new dee(this):new fee(this)}getCursor(e,t=0,s){let i=e.doc?e:bt.create({doc:e});return s==null&&(s=i.doc.length),this.regexp?la(this,i,t,s):oa(this,i,t,s)}}class tL{constructor(e){this.spec=e}}function oa(n,e,t,s){return new Ja(e.doc,n.unquoted,t,s,n.caseSensitive?void 0:i=>i.toLowerCase(),n.wholeWord?uee(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function uee(n,e){return(t,s,i,r)=>((r>t||r+i.length<s)&&(r=Math.max(0,t-2),i=n.sliceString(r,Math.min(n.length,s+2))),(e(Op(i,t-r))!=Ut.Word||e(Rp(i,t-r))!=Ut.Word)&&(e(Rp(i,s-r))!=Ut.Word||e(Op(i,s-r))!=Ut.Word))}class fee extends tL{constructor(e){super(e)}nextMatch(e,t,s){let i=oa(this.spec,e,s,e.doc.length).nextOverlapping();if(i.done){let r=Math.min(e.doc.length,t+this.spec.unquoted.length);i=oa(this.spec,e,0,r).nextOverlapping()}return i.done||i.value.from==t&&i.value.to==s?null:i.value}prevMatchInRange(e,t,s){for(let i=s;;){let r=Math.max(t,i-1e4-this.spec.unquoted.length),o=oa(this.spec,e,r,i),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;i-=1e4}}prevMatch(e,t,s){let i=this.prevMatchInRange(e,0,t);return i||(i=this.prevMatchInRange(e,Math.max(0,s-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=t||i.to!=s)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let s=oa(this.spec,e,0,e.doc.length),i=[];for(;!s.next().done;){if(i.length>=t)return null;i.push(s.value)}return i}highlight(e,t,s,i){let r=oa(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(s+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}function la(n,e,t,s){return new JD(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?hee(e.charCategorizer(e.selection.main.head)):void 0},t,s)}function Op(n,e){return n.slice(Cn(n,e,!1),e)}function Rp(n,e){return n.slice(e,Cn(n,e))}function hee(n){return(e,t,s)=>!s[0].length||(n(Op(s.input,s.index))!=Ut.Word||n(Rp(s.input,s.index))!=Ut.Word)&&(n(Rp(s.input,s.index+s[0].length))!=Ut.Word||n(Op(s.input,s.index+s[0].length))!=Ut.Word)}class dee extends tL{nextMatch(e,t,s){let i=la(this.spec,e,s,e.doc.length).next();return i.done&&(i=la(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,s){for(let i=1;;i++){let r=Math.max(t,s-i*1e4),o=la(this.spec,e,r,s),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,s){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,s,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,s)=>s=="$"?"$":s=="&"?e.match[0]:s!="0"&&+s<e.match.length?e.match[s]:t)}matchAll(e,t){let s=la(this.spec,e,0,e.doc.length),i=[];for(;!s.next().done;){if(i.length>=t)return null;i.push(s.value)}return i}highlight(e,t,s,i){let r=la(this.spec,e,Math.max(0,t-250),Math.min(s+250,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}const Gu=tt.define(),Jw=tt.define(),xo=un.define({create(n){return new h0(cv(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Gu)?n=new h0(t.value.create(),n.panel):t.is(Jw)&&(n=new h0(n.query,t.value?Zw:null));return n},provide:n=>qu.from(n,e=>e.panel)});class h0{constructor(e,t){this.query=e,this.panel=t}}const pee=je.mark({class:"cm-searchMatch"}),mee=je.mark({class:"cm-searchMatch cm-searchMatch-selected"}),gee=Jt.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(xo))}update(n){let e=n.state.field(xo);(e!=n.startState.field(xo)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return je.none;let{view:t}=this,s=new $r;for(let i=0,r=t.visibleRanges,o=r.length;i<o;i++){let{from:l,to:c}=r[i];for(;i<o-1&&c>r[i+1].from-500;)c=r[++i].to;n.highlight(t.state,l,c,(f,h)=>{let d=t.state.selection.ranges.some(g=>g.from==f&&g.to==h);s.add(f,h,d?mee:pee)})}return s.finish()}},{decorations:n=>n.decorations});function Sf(n){return e=>{let t=e.state.field(xo,!1);return t&&t.query.spec.valid?n(e,t):e1(e)}}const Mp=Sf((n,{query:e})=>{let{to:t}=n.state.selection.main,s=e.nextMatch(n.state,t,t);if(!s)return!1;let i=le.single(s.from,s.to),r=n.state.facet(Tl);return n.dispatch({selection:i,effects:[t1(n,s),r.scrollToMatch(i.main,n)],userEvent:"select.search"}),sL(n),!0}),Dp=Sf((n,{query:e})=>{let{state:t}=n,{from:s}=t.selection.main,i=e.prevMatch(t,s,s);if(!i)return!1;let r=le.single(i.from,i.to),o=n.state.facet(Tl);return n.dispatch({selection:r,effects:[t1(n,i),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),sL(n),!0}),bee=Sf((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:le.create(t.map(s=>le.range(s.from,s.to))),userEvent:"select.search.matches"}),!0)}),yee=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:s,to:i}=t.main,r=[],o=0;for(let l=new Ja(n.doc,n.sliceDoc(s,i));!l.next().done;){if(r.length>1e3)return!1;l.value.from==s&&(o=r.length),r.push(le.range(l.value.from,l.value.to))}return e(n.update({selection:le.create(r,o),userEvent:"select.search.matches"})),!0},VA=Sf((n,{query:e})=>{let{state:t}=n,{from:s,to:i}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,s,s);if(!r)return!1;let o=r,l=[],c,f,h=[];if(o.from==s&&o.to==i&&(f=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:f}),o=e.nextMatch(t,o.from,o.to),h.push(Oe.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(s).number)+"."))),o){let d=l.length==0||l[0].from>=r.to?0:r.to-r.from-f.length;c=le.single(o.from-d,o.to-d),h.push(t1(n,o)),h.push(t.facet(Tl).scrollToMatch(c.main,n))}return n.dispatch({changes:l,selection:c,effects:h,userEvent:"input.replace"}),!0}),vee=Sf((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(i=>{let{from:r,to:o}=i;return{from:r,to:o,insert:e.getReplacement(i)}});if(!t.length)return!1;let s=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:Oe.announce.of(s),userEvent:"input.replace.all"}),!0});function Zw(n){return n.state.facet(Tl).createPanel(n)}function cv(n,e){var t,s,i,r,o;let l=n.selection.main,c=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!c)return e;let f=n.facet(Tl);return new eL({search:((t=e?.literal)!==null&&t!==void 0?t:f.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(s=e?.caseSensitive)!==null&&s!==void 0?s:f.caseSensitive,literal:(i=e?.literal)!==null&&i!==void 0?i:f.literal,regexp:(r=e?.regexp)!==null&&r!==void 0?r:f.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:f.wholeWord})}function nL(n){let e=zu(n,Zw);return e&&e.dom.querySelector("[main-field]")}function sL(n){let e=nL(n);e&&e==n.root.activeElement&&e.select()}const e1=n=>{let e=n.state.field(xo,!1);if(e&&e.panel){let t=nL(n);if(t&&t!=n.root.activeElement){let s=cv(n.state,e.query.spec);s.valid&&n.dispatch({effects:Gu.of(s)}),t.focus(),t.select()}}else n.dispatch({effects:[Jw.of(!0),e?Gu.of(cv(n.state,e.query.spec)):tt.appendConfig.of(uv)]});return!0},iL=n=>{let e=n.state.field(xo,!1);if(!e||!e.panel)return!1;let t=zu(n,Zw);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Jw.of(!1)}),!0},wee=[{key:"Mod-f",run:e1,scope:"editor search-panel"},{key:"F3",run:Mp,shift:Dp,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Mp,shift:Dp,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:iL,scope:"editor search-panel"},{key:"Mod-Shift-l",run:yee},{key:"Mod-Alt-g",run:XZ},{key:"Mod-d",run:aee,preventDefault:!0}];class See{constructor(e){this.view=e;let t=this.query=e.state.field(xo).query.spec;this.commit=this.commit.bind(this),this.searchField=Nt("input",{value:t.search,placeholder:_s(e,"Find"),"aria-label":_s(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Nt("input",{value:t.replace,placeholder:_s(e,"Replace"),"aria-label":_s(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Nt("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Nt("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Nt("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function s(i,r,o){return Nt("button",{class:"cm-button",name:i,onclick:r,type:"button"},o)}this.dom=Nt("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,s("next",()=>Mp(e),[_s(e,"next")]),s("prev",()=>Dp(e),[_s(e,"previous")]),s("select",()=>bee(e),[_s(e,"all")]),Nt("label",null,[this.caseField,_s(e,"match case")]),Nt("label",null,[this.reField,_s(e,"regexp")]),Nt("label",null,[this.wordField,_s(e,"by word")]),...e.state.readOnly?[]:[Nt("br"),this.replaceField,s("replace",()=>VA(e),[_s(e,"replace")]),s("replaceAll",()=>vee(e),[_s(e,"replace all")])],Nt("button",{name:"close",onclick:()=>iL(e),"aria-label":_s(e,"close"),type:"button"},["×"])])}commit(){let e=new eL({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Gu.of(e)}))}keydown(e){RX(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Dp:Mp)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),VA(this.view))}update(e){for(let t of e.transactions)for(let s of t.effects)s.is(Gu)&&!s.value.eq(this.query)&&this.setQuery(s.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Tl).top}}function _s(n,e){return n.state.phrase(e)}const Qh=30,Jh=/[\s\.,:;?!]/;function t1(n,{from:e,to:t}){let s=n.state.doc.lineAt(e),i=n.state.doc.lineAt(t).to,r=Math.max(s.from,e-Qh),o=Math.min(i,t+Qh),l=n.state.sliceDoc(r,o);if(r!=s.from){for(let c=0;c<Qh;c++)if(!Jh.test(l[c+1])&&Jh.test(l[c])){l=l.slice(c);break}}if(o!=i){for(let c=l.length-1;c>l.length-Qh;c--)if(!Jh.test(l[c-1])&&Jh.test(l[c])){l=l.slice(0,c);break}}return Oe.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${s.number}.`)}const xee=Oe.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),uv=[xo,kl.low(gee),xee];class rL{constructor(e,t,s,i){this.state=e,this.pos=t,this.explicit=s,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=$n(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),s=Math.max(t.from,this.pos-250),i=t.text.slice(s-t.from,this.pos-t.from),r=i.search(oL(e,!1));return r<0?null:{from:s+r,to:this.pos,text:i.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,s){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),s&&s.onDocChange&&(this.abortOnDocChange=!0))}}function WA(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function _ee(n){let e=Object.create(null),t=Object.create(null);for(let{label:i}of n){e[i[0]]=!0;for(let r=1;r<i.length;r++)t[i[r]]=!0}let s=WA(e)+WA(t)+"*$";return[new RegExp("^"+s),new RegExp(s)]}function Eee(n){let e=n.map(i=>typeof i=="string"?{label:i}:i),[t,s]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:_ee(e);return i=>{let r=i.matchBefore(s);return r||i.explicit?{from:r?r.from:i.pos,options:e,validFor:t}:null}}class HA{constructor(e,t,s,i){this.completion=e,this.source=t,this.match=s,this.score=i}}function pl(n){return n.selection.main.from}function oL(n,e){var t;let{source:s}=n,i=e&&s[0]!="^",r=s[s.length-1]!="$";return!i&&!r?n:new RegExp(`${i?"^":""}(?:${s})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const lL=Wr.define();function Cee(n,e,t,s){let{main:i}=n.selection,r=t-i.from,o=s-i.from;return Object.assign(Object.assign({},n.changeByRange(l=>{if(l!=i&&t!=s&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,s))return{range:l};let c=n.toText(e);return{changes:{from:l.from+r,to:s==i.from?l.to:l.from+o,insert:c},range:le.cursor(l.from+r+c.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const UA=new WeakMap;function Aee(n){if(!Array.isArray(n))return n;let e=UA.get(n);return e||UA.set(n,e=Eee(n)),e}const Lp=tt.define(),Yu=tt.define();class kee{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let s=xn(e,t),i=js(s);this.chars.push(s);let r=e.slice(t,t+i),o=r.toUpperCase();this.folded.push(xn(o==r?r.toLowerCase():o,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:s,any:i,precise:r,byWord:o}=this;if(t.length==1){let C=xn(e,0),E=js(C),k=E==e.length?0:-100;if(C!=t[0])if(C==s[0])k+=-200;else return null;return this.ret(k,[0,E])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let c=t.length,f=0;if(l<0){for(let C=0,E=Math.min(e.length,200);C<E&&f<c;){let k=xn(e,C);(k==t[f]||k==s[f])&&(i[f++]=C),C+=js(k)}if(f<c)return null}let h=0,d=0,g=!1,m=0,y=-1,w=-1,x=/[a-z]/.test(e),S=!0;for(let C=0,E=Math.min(e.length,200),k=0;C<E&&d<c;){let R=xn(e,C);l<0&&(h<c&&R==t[h]&&(r[h++]=C),m<c&&(R==t[m]||R==s[m]?(m==0&&(y=C),w=C+1,m++):m=0));let T,L=R<255?R>=48&&R<=57||R>=97&&R<=122?2:R>=65&&R<=90?1:0:(T=Aw(R))!=T.toLowerCase()?1:T!=T.toUpperCase()?2:0;(!C||L==1&&x||k==0&&L!=0)&&(t[d]==R||s[d]==R&&(g=!0)?o[d++]=C:o.length&&(S=!1)),k=L,C+=js(R)}return d==c&&o[0]==0&&S?this.result(-100+(g?-200:0),o,e):m==c&&y==0?this.ret(-200-e.length+(w==e.length?0:-100),[0,w]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):m==c?this.ret(-900-e.length,[y,w]):d==c?this.result(-100+(g?-200:0)+-700+(S?0:-1100),o,e):t.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,s){let i=[],r=0;for(let o of t){let l=o+(this.astral?js(xn(s,o)):1);r&&i[r-1]==o?i[r-1]=l:(i[r++]=o,i[r++]=l)}return this.ret(e-s.length,i)}}class Tee{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),s=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return s==null?null:(this.matched=[0,t.length],this.score=s+(e.length==this.pattern.length?0:-100),this)}}const gn=Re.define({combine(n){return Ei(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Oee,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>s=>zA(e(s),t(s)),optionClass:(e,t)=>s=>zA(e(s),t(s)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function zA(n,e){return n?e?n+" "+e:n:e}function Oee(n,e,t,s,i,r){let o=n.textDirection==Ft.RTL,l=o,c=!1,f="top",h,d,g=e.left-i.left,m=i.right-e.right,y=s.right-s.left,w=s.bottom-s.top;if(l&&g<Math.min(y,m)?l=!1:!l&&m<Math.min(y,g)&&(l=!0),y<=(l?g:m))h=Math.max(i.top,Math.min(t.top,i.bottom-w))-e.top,d=Math.min(400,l?g:m);else{c=!0,d=Math.min(400,(o?e.right:i.right-e.left)-30);let C=i.bottom-e.bottom;C>=w||C>e.top?h=t.bottom-e.top:(f="bottom",h=e.bottom-t.top)}let x=(e.bottom-e.top)/r.offsetHeight,S=(e.right-e.left)/r.offsetWidth;return{style:`${f}: ${h/x}px; max-width: ${d/S}px`,class:"cm-completionInfo-"+(c?o?"left-narrow":"right-narrow":l?"left":"right")}}function Ree(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let s=document.createElement("div");return s.classList.add("cm-completionIcon"),t.type&&s.classList.add(...t.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),s.setAttribute("aria-hidden","true"),s},position:20}),e.push({render(t,s,i,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=t.displayLabel||t.label,c=0;for(let f=0;f<r.length;){let h=r[f++],d=r[f++];h>c&&o.appendChild(document.createTextNode(l.slice(c,h)));let g=o.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(l.slice(h,d))),g.className="cm-completionMatchedText",c=d}return c<l.length&&o.appendChild(document.createTextNode(l.slice(c))),o},position:50},{render(t){if(!t.detail)return null;let s=document.createElement("span");return s.className="cm-completionDetail",s.textContent=t.detail,s},position:80}),e.sort((t,s)=>t.position-s.position).map(t=>t.render)}function d0(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let i=Math.floor(e/t);return{from:i*t,to:(i+1)*t}}let s=Math.floor((n-e)/t);return{from:n-(s+1)*t,to:n-s*t}}class Mee{constructor(e,t,s){this.view=e,this.stateField=t,this.applyCompletion=s,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:r,selected:o}=i.open,l=e.state.facet(gn);this.optionContent=Ree(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=d0(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",c=>{let{options:f}=e.state.field(t).open;for(let h=c.target,d;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(d=/-(\d+)$/.exec(h.id))&&+d[1]<f.length){this.applyCompletion(e,f[+d[1]]),c.preventDefault();return}}),this.dom.addEventListener("focusout",c=>{let f=e.state.field(this.stateField,!1);f&&f.tooltip&&e.state.facet(gn).closeOnBlur&&c.relatedTarget!=e.contentDOM&&e.dispatch({effects:Yu.of(null)})}),this.showOptions(r,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let s=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),s!=i){let{options:r,selected:o,disabled:l}=s.open;(!i.open||i.open.options!=r)&&(this.range=d0(r.length,o,e.state.facet(gn).maxRenderedOptions),this.showOptions(r,s.id)),this.updateSel(),l!=((t=i.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let s of this.currentClass.split(" "))s&&this.dom.classList.remove(s);for(let s of t.split(" "))s&&this.dom.classList.add(s);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=d0(t.options.length,t.selected,this.view.state.facet(gn).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:s}=t.options[t.selected],{info:i}=s;if(!i)return;let r=typeof i=="string"?document.createTextNode(i):i(s);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,s)}).catch(o=>Gn(this.view.state,o,"completion info")):this.addInfoPane(r,s)}}addInfoPane(e,t){this.destroyInfo();let s=this.info=document.createElement("div");if(s.className="cm-tooltip cm-completionInfo",e.nodeType!=null)s.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:r}=e;s.appendChild(i),this.infoDestroy=r||null}this.dom.appendChild(s),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let s=this.list.firstChild,i=this.range.from;s;s=s.nextSibling,i++)s.nodeName!="LI"||!s.id?i--:i==e?s.hasAttribute("aria-selected")||(s.setAttribute("aria-selected","true"),t=s):s.hasAttribute("aria-selected")&&s.removeAttribute("aria-selected");return t&&Lee(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),s=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return i.top>Math.min(r.bottom,t.bottom)-10||i.bottom<Math.max(r.top,t.top)+10?null:this.view.state.facet(gn).positionInfo(this.view,t,i,s,r,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,s){const i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions"));let r=null;for(let o=s.from;o<s.to;o++){let{completion:l,match:c}=e[o],{section:f}=l;if(f){let g=typeof f=="string"?f:f.name;if(g!=r&&(o>s.from||s.from==0))if(r=g,typeof f!="string"&&f.header)i.appendChild(f.header(f));else{let m=i.appendChild(document.createElement("completion-section"));m.textContent=g}}const h=i.appendChild(document.createElement("li"));h.id=t+"-"+o,h.setAttribute("role","option");let d=this.optionClass(l);d&&(h.className=d);for(let g of this.optionContent){let m=g(l,this.view.state,this.view,c);m&&h.appendChild(m)}}return s.from&&i.classList.add("cm-completionListIncompleteTop"),s.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function Dee(n,e){return t=>new Mee(t,n,e)}function Lee(n,e){let t=n.getBoundingClientRect(),s=e.getBoundingClientRect(),i=t.height/n.offsetHeight;s.top<t.top?n.scrollTop-=(t.top-s.top)/i:s.bottom>t.bottom&&(n.scrollTop+=(s.bottom-t.bottom)/i)}function qA(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function Nee(n,e){let t=[],s=null,i=f=>{t.push(f);let{section:h}=f.completion;if(h){s||(s=[]);let d=typeof h=="string"?h:h.name;s.some(g=>g.name==d)||s.push(typeof h=="string"?{name:d}:h)}},r=e.facet(gn);for(let f of n)if(f.hasResult()){let h=f.result.getMatch;if(f.result.filter===!1)for(let d of f.result.options)i(new HA(d,f.source,h?h(d):[],1e9-t.length));else{let d=e.sliceDoc(f.from,f.to),g,m=r.filterStrict?new Tee(d):new kee(d);for(let y of f.result.options)if(g=m.match(y.label)){let w=y.displayLabel?h?h(y,g.matched):[]:g.matched;i(new HA(y,f.source,w,g.score+(y.boost||0)))}}}if(s){let f=Object.create(null),h=0,d=(g,m)=>{var y,w;return((y=g.rank)!==null&&y!==void 0?y:1e9)-((w=m.rank)!==null&&w!==void 0?w:1e9)||(g.name<m.name?-1:1)};for(let g of s.sort(d))h-=1e5,f[g.name]=h;for(let g of t){let{section:m}=g.completion;m&&(g.score+=f[typeof m=="string"?m:m.name])}}let o=[],l=null,c=r.compareCompletions;for(let f of t.sort((h,d)=>d.score-h.score||c(h.completion,d.completion))){let h=f.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?o.push(f):qA(f.completion)>qA(l)&&(o[o.length-1]=f),l=f.completion}return o}class da{constructor(e,t,s,i,r,o){this.options=e,this.attrs=t,this.tooltip=s,this.timestamp=i,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new da(this.options,KA(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,s,i,r,o){if(i&&!o&&e.some(f=>f.isPending))return i.setDisabled();let l=Nee(e,t);if(!l.length)return i&&e.some(f=>f.isPending)?i.setDisabled():null;let c=t.facet(gn).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let f=i.options[i.selected].completion;for(let h=0;h<l.length;h++)if(l[h].completion==f){c=h;break}}return new da(l,KA(s,c),{pos:e.reduce((f,h)=>h.hasResult()?Math.min(f,h.from):f,1e8),create:Vee,above:r.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(e){return new da(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new da(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Np{constructor(e,t,s){this.active=e,this.id=t,this.open=s}static start(){return new Np(Bee,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,s=t.facet(gn),r=(s.override||t.languageDataAt("autocomplete",pl(t)).map(Aee)).map(c=>(this.active.find(h=>h.source==c)||new Xs(c,this.active.some(h=>h.state!=0)?1:0)).update(e,s));r.length==this.active.length&&r.every((c,f)=>c==this.active[f])&&(r=this.active);let o=this.open,l=e.effects.some(c=>c.is(n1));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(c=>c.hasResult()&&e.changes.touchesRange(c.from,c.to))||!Iee(r,this.active)||l?o=da.build(r,t,this.id,o,s,l):o&&o.disabled&&!r.some(c=>c.isPending)&&(o=null),!o&&r.every(c=>!c.isPending)&&r.some(c=>c.hasResult())&&(r=r.map(c=>c.hasResult()?new Xs(c.source,0):c));for(let c of e.effects)c.is(cL)&&(o=o&&o.setSelected(c.value,this.id));return r==this.active&&o==this.open?this:new Np(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Pee:$ee}}function Iee(n,e){if(n==e)return!0;for(let t=0,s=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;s<e.length&&!e[s].hasResult();)s++;let i=t==n.length,r=s==e.length;if(i||r)return i==r;if(n[t++].result!=e[s++].result)return!1}}const Pee={"aria-autocomplete":"list"},$ee={};function KA(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const Bee=[];function aL(n,e){if(n.isUserEvent("input.complete")){let s=n.annotation(lL);if(s&&e.activateOnCompletion(s))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Xs{constructor(e,t,s=!1){this.source=e,this.state=t,this.explicit=s}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let s=aL(e,t),i=this;(s&8||s&16&&this.touches(e))&&(i=new Xs(i.source,0)),s&4&&i.state==0&&(i=new Xs(this.source,1)),i=i.updateFor(e,s);for(let r of e.effects)if(r.is(Lp))i=new Xs(i.source,1,r.value);else if(r.is(Yu))i=new Xs(i.source,0);else if(r.is(n1))for(let o of r.value)o.source==i.source&&(i=o);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(pl(e.state))}}class Ra extends Xs{constructor(e,t,s,i,r,o){super(e,3,t),this.limit=s,this.result=i,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,t){var s;if(!(t&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=pl(e.state);if(l>o||!i||t&2&&(pl(e.startState)==this.from||l<this.limit))return new Xs(this.source,t&4?1:0);let c=e.changes.mapPos(this.limit);return Fee(i.validFor,e.state,r,o)?new Ra(this.source,this.explicit,c,i,r,o):i.update&&(i=i.update(i,r,o,new rL(e.state,l,!1)))?new Ra(this.source,this.explicit,c,i,i.from,(s=i.to)!==null&&s!==void 0?s:pl(e.state)):new Xs(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Ra(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Xs(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function Fee(n,e,t,s){if(!n)return!1;let i=e.sliceDoc(t,s);return typeof n=="function"?n(i,t,s,e):oL(n,!0).test(i)}const n1=tt.define({map(n,e){return n.map(t=>t.map(e))}}),cL=tt.define(),cs=un.define({create(){return Np.start()},update(n,e){return n.update(e)},provide:n=>[wm.from(n,e=>e.tooltip),Oe.contentAttributes.from(n,e=>e.attrs)]});function s1(n,e){const t=e.completion.apply||e.completion.label;let s=n.state.field(cs).active.find(i=>i.source==e.source);return s instanceof Ra?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},Cee(n.state,t,s.from,s.to)),{annotations:lL.of(e.completion)})):t(n,e.completion,s.from,s.to),!0):!1}const Vee=Dee(cs,s1);function Zh(n,e="option"){return t=>{let s=t.state.field(cs,!1);if(!s||!s.open||s.open.disabled||Date.now()-s.open.timestamp<t.state.facet(gn).interactionDelay)return!1;let i=1,r;e=="page"&&(r=WM(t,s.open.tooltip))&&(i=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let{length:o}=s.open.options,l=s.open.selected>-1?s.open.selected+i*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:cL.of(l)}),!0}}const Wee=n=>{let e=n.state.field(cs,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(gn).interactionDelay?!1:s1(n,e.open.options[e.open.selected])},jA=n=>n.state.field(cs,!1)?(n.dispatch({effects:Lp.of(!0)}),!0):!1,Hee=n=>{let e=n.state.field(cs,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Yu.of(null)}),!0)};class Uee{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const zee=50,qee=1e3,Kee=Jt.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(cs).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(cs),t=n.state.facet(gn);if(!n.selectionSet&&!n.docChanged&&n.startState.field(cs)==e)return;let s=n.transactions.some(r=>{let o=aL(r,t);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;r<this.running.length;r++){let o=this.running[r];if(s||o.context.abortOnDocChange&&n.docChanged||o.updates.length+n.transactions.length>zee&&Date.now()-o.time>qee){for(let l of o.context.abortListeners)try{l()}catch(c){Gn(this.view.state,c)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(r=>r.effects.some(o=>o.is(Lp)))&&(this.pendingStart=!0);let i=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let r of n.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(cs);for(let t of e.active)t.isPending&&!this.running.some(s=>s.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(gn).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=pl(e),s=new rL(e,t,n.explicit,this.view),i=new Uee(n,s);this.running.push(i),Promise.resolve(n.source(s)).then(r=>{i.context.aborted||(i.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:Yu.of(null)}),Gn(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(gn).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(gn),s=this.view.state.field(cs);for(let i=0;i<this.running.length;i++){let r=this.running[i];if(r.done===void 0)continue;if(this.running.splice(i--,1),r.done){let l=pl(r.updates.length?r.updates[0].startState:this.view.state),c=Math.min(l,r.done.from+(r.active.explicit?0:1)),f=new Ra(r.active.source,r.active.explicit,c,r.done,r.done.from,(n=r.done.to)!==null&&n!==void 0?n:l);for(let h of r.updates)f=f.update(h,t);if(f.hasResult()){e.push(f);continue}}let o=s.active.find(l=>l.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new Xs(r.active.source,0);for(let c of r.updates)l=l.update(c,t);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||s.open&&s.open.disabled)&&this.view.dispatch({effects:n1.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(cs,!1);if(e&&e.tooltip&&this.view.state.facet(gn).closeOnBlur){let t=e.open&&WM(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Yu.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Lp.of(!1)}),20),this.composing=0}}}),jee=typeof navigator=="object"&&/Win/.test(navigator.platform),Gee=kl.highest(Oe.domEventHandlers({keydown(n,e){let t=e.state.field(cs,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(jee&&n.altKey)||n.metaKey)return!1;let s=t.open.options[t.open.selected],i=t.active.find(o=>o.source==s.source),r=s.completion.commitCharacters||i.result.commitCharacters;return r&&r.indexOf(n.key)>-1&&s1(e,s),!1}})),Yee=Oe.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),Xu={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},rl=tt.define({map(n,e){let t=e.mapPos(n,-1,jn.TrackAfter);return t??void 0}}),i1=new class extends yl{};i1.startSide=1;i1.endSide=-1;const uL=un.define({create(){return pt.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:s=>s>=t.from&&s<=t.to})}for(let t of e.effects)t.is(rl)&&(n=n.update({add:[i1.range(t.value,t.value+1)]}));return n}});function Xee(){return[Jee,uL]}const p0="()[]{}<>";function fL(n){for(let e=0;e<p0.length;e+=2)if(p0.charCodeAt(e)==n)return p0.charAt(e+1);return Aw(n<128?n:n+1)}function hL(n,e){return n.languageDataAt("closeBrackets",e)[0]||Xu}const Qee=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Jee=Oe.inputHandler.of((n,e,t,s)=>{if((Qee?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let i=n.state.selection.main;if(s.length>2||s.length==2&&js(xn(s,0))==1||e!=i.from||t!=i.to)return!1;let r=tte(n.state,s);return r?(n.dispatch(r),!0):!1}),Zee=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let s=hL(n,n.selection.main.head).brackets||Xu.brackets,i=null,r=n.changeByRange(o=>{if(o.empty){let l=nte(n.doc,o.head);for(let c of s)if(c==l&&Tm(n.doc,o.head)==fL(xn(c,0)))return{changes:{from:o.head-c.length,to:o.head+c.length},range:le.cursor(o.head-c.length)}}return{range:i=o}});return i||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},ete=[{key:"Backspace",run:Zee}];function tte(n,e){let t=hL(n,n.selection.main.head),s=t.brackets||Xu.brackets;for(let i of s){let r=fL(xn(i,0));if(e==i)return r==i?rte(n,i,s.indexOf(i+i+i)>-1,t):ste(n,i,r,t.before||Xu.before);if(e==r&&dL(n,n.selection.main.from))return ite(n,i,r)}return null}function dL(n,e){let t=!1;return n.field(uL).between(0,n.doc.length,s=>{s==e&&(t=!0)}),t}function Tm(n,e){let t=n.sliceString(e,e+2);return t.slice(0,js(xn(t,0)))}function nte(n,e){let t=n.sliceString(e-2,e);return js(xn(t,0))==t.length?t:t.slice(1)}function ste(n,e,t,s){let i=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:rl.of(o.to+e.length),range:le.range(o.anchor+e.length,o.head+e.length)};let l=Tm(n.doc,o.head);return!l||/\s/.test(l)||s.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:rl.of(o.head+e.length),range:le.cursor(o.head+e.length)}:{range:i=o}});return i?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function ite(n,e,t){let s=null,i=n.changeByRange(r=>r.empty&&Tm(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:le.cursor(r.head+t.length)}:s={range:r});return s?null:n.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function rte(n,e,t,s){let i=s.stringPrefixes||Xu.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:rl.of(l.to+e.length),range:le.range(l.anchor+e.length,l.head+e.length)};let c=l.head,f=Tm(n.doc,c),h;if(f==e){if(GA(n,c))return{changes:{insert:e+e,from:c},effects:rl.of(c+e.length),range:le.cursor(c+e.length)};if(dL(n,c)){let g=t&&n.sliceDoc(c,c+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:c,to:c+g.length,insert:g},range:le.cursor(c+g.length)}}}else{if(t&&n.sliceDoc(c-2*e.length,c)==e+e&&(h=YA(n,c-2*e.length,i))>-1&&GA(n,h))return{changes:{insert:e+e+e+e,from:c},effects:rl.of(c+e.length),range:le.cursor(c+e.length)};if(n.charCategorizer(c)(f)!=Ut.Word&&YA(n,c,i)>-1&&!ote(n,c,e,i))return{changes:{insert:e+e,from:c},effects:rl.of(c+e.length),range:le.cursor(c+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function GA(n,e){let t=$n(n).resolveInner(e+1);return t.parent&&t.from==e}function ote(n,e,t,s){let i=$n(n).resolveInner(e,-1),r=s.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(i.from,Math.min(i.to,i.from+t.length+r)),c=l.indexOf(t);if(!c||c>-1&&s.indexOf(l.slice(0,c))>-1){let h=i.firstChild;for(;h&&h.from==i.from&&h.to-h.from>t.length+c;){if(n.sliceDoc(h.to-t.length,h.to)==t)return!1;h=h.firstChild}return!0}let f=i.to==e&&i.parent;if(!f)break;i=f}return!1}function YA(n,e,t){let s=n.charCategorizer(e);if(s(n.sliceDoc(e-1,e))!=Ut.Word)return e;for(let i of t){let r=e-i.length;if(n.sliceDoc(r,e)==i&&s(n.sliceDoc(r-1,r))!=Ut.Word)return r}return-1}function lte(n={}){return[Gee,cs,gn.of(n),Kee,ate,Yee]}const pL=[{key:"Ctrl-Space",run:jA},{mac:"Alt-`",run:jA},{key:"Escape",run:Hee},{key:"ArrowDown",run:Zh(!0)},{key:"ArrowUp",run:Zh(!1)},{key:"PageDown",run:Zh(!0,"page")},{key:"PageUp",run:Zh(!1,"page")},{key:"Enter",run:Wee}],ate=kl.highest(vm.computeN([gn],n=>n.facet(gn).defaultKeymap?[pL]:[]));class XA{constructor(e,t,s){this.from=e,this.to=t,this.diagnostic=s}}class Zo{constructor(e,t,s){this.diagnostics=e,this.panel=t,this.selected=s}static init(e,t,s){let i=s.facet(qi).markerFilter;i&&(e=i(e,s));let r=e.slice().sort((m,y)=>m.from-y.from||m.to-y.to),o=new $r,l=[],c=0,f=s.doc.iter(),h=0,d=s.doc.length;for(let m=0;;){let y=m==r.length?null:r[m];if(!y&&!l.length)break;let w,x;if(l.length)w=c,x=l.reduce((E,k)=>Math.min(E,k.to),y&&y.from>w?y.from:1e8);else{if(w=y.from,w>d)break;x=y.to,l.push(y),m++}for(;m<r.length;){let E=r[m];if(E.from==w&&(E.to>E.from||E.to==w))l.push(E),m++,x=Math.min(E.to,x);else{x=Math.min(E.from,x);break}}x=Math.min(x,d);let S=!1;if(l.some(E=>E.from==w&&(E.to==x||x==d))&&(S=w==x,!S&&x-w<10)){let E=w-(h+f.value.length);E>0&&(f.next(E),h=w);for(let k=w;;){if(k>=x){S=!0;break}if(!f.lineBreak&&h+f.value.length>k)break;k=h+f.value.length,h+=f.value.length,f.next()}}let C=SL(l);if(S)o.add(w,w,je.widget({widget:new yte(C),diagnostics:l.slice()}));else{let E=l.reduce((k,R)=>R.markClass?k+" "+R.markClass:k,"");o.add(w,x,je.mark({class:"cm-lintRange cm-lintRange-"+C+E,diagnostics:l.slice(),inclusiveEnd:l.some(k=>k.to>x)}))}if(c=x,c==d)break;for(let E=0;E<l.length;E++)l[E].to<=c&&l.splice(E--,1)}let g=o.finish();return new Zo(g,t,Za(g))}}function Za(n,e=null,t=0){let s=null;return n.between(t,1e9,(i,r,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!s)s=new XA(i,r,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(s.diagnostic)<0)return!1;s=new XA(s.from,r,s.diagnostic)}}),s}function mL(n,e){let t=e.pos,s=e.end||t,i=n.state.facet(qi).hideOn(n,t,s);if(i!=null)return i;let r=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(Om))||n.changes.touchesRange(r.from,Math.max(r.to,s)))}function gL(n,e){return n.field(Ms,!1)?e:e.concat(tt.appendConfig.of(EL))}function cte(n,e){return{effects:gL(n,[Om.of(e)])}}const Om=tt.define(),r1=tt.define(),bL=tt.define(),Ms=un.define({create(){return new Zo(je.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),s=null,i=n.panel;if(n.selected){let r=e.changes.mapPos(n.selected.from,1);s=Za(t,n.selected.diagnostic,r)||Za(t,null,r)}!t.size&&i&&e.state.facet(qi).autoPanel&&(i=null),n=new Zo(t,i,s)}for(let t of e.effects)if(t.is(Om)){let s=e.state.facet(qi).autoPanel?t.value.length?Qu.open:null:n.panel;n=Zo.init(t.value,s,e.state)}else t.is(r1)?n=new Zo(n.diagnostics,t.value?Qu.open:null,n.selected):t.is(bL)&&(n=new Zo(n.diagnostics,n.panel,t.value));return n},provide:n=>[qu.from(n,e=>e.panel),Oe.decorations.from(n,e=>e.diagnostics)]}),ute=je.mark({class:"cm-lintRange cm-lintRange-active"});function fte(n,e,t){let{diagnostics:s}=n.state.field(Ms),i,r=-1,o=-1;s.between(e-(t<0?1:0),e+(t>0?1:0),(c,f,{spec:h})=>{if(e>=c&&e<=f&&(c==f||(e>c||t>0)&&(e<f||t<0)))return i=h.diagnostics,r=c,o=f,!1});let l=n.state.facet(qi).tooltipFilter;return i&&l&&(i=l(i,n.state)),i?{pos:r,end:o,above:n.state.doc.lineAt(r).to<o,create(){return{dom:yL(n,i)}}}:null}function yL(n,e){return Nt("ul",{class:"cm-tooltip-lint"},e.map(t=>wL(n,t,!1)))}const hte=n=>{let e=n.state.field(Ms,!1);(!e||!e.panel)&&n.dispatch({effects:gL(n.state,[r1.of(!0)])});let t=zu(n,Qu.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},QA=n=>{let e=n.state.field(Ms,!1);return!e||!e.panel?!1:(n.dispatch({effects:r1.of(!1)}),!0)},dte=n=>{let e=n.state.field(Ms,!1);if(!e)return!1;let t=n.state.selection.main,s=e.diagnostics.iter(t.to+1);return!s.value&&(s=e.diagnostics.iter(0),!s.value||s.from==t.from&&s.to==t.to)?!1:(n.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0}),!0)},pte=[{key:"Mod-Shift-m",run:hte,preventDefault:!0},{key:"F8",run:dte}],mte=Jt.fromClass(class{constructor(n){this.view=n,this.timeout=-1,this.set=!0;let{delay:e}=n.state.facet(qi);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){clearTimeout(this.timeout);let n=Date.now();if(n<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-n);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(qi);t.length&&gte(t.map(s=>Promise.resolve(s(this.view))),s=>{this.view.state.doc==e.doc&&this.view.dispatch(cte(this.view.state,s.reduce((i,r)=>i.concat(r))))},s=>{Gn(this.view.state,s)})}}update(n){let e=n.state.facet(qi);(n.docChanged||e!=n.startState.facet(qi)||e.needsRefresh&&e.needsRefresh(n))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function gte(n,e,t){let s=[],i=-1;for(let r of n)r.then(o=>{s.push(o),clearTimeout(i),s.length==n.length?e(s):i=setTimeout(()=>e(s),200)},t)}const qi=Re.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...Ei(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:JA,tooltipFilter:JA,needsRefresh:(e,t)=>e?t?s=>e(s)||t(s):e:t,hideOn:(e,t)=>e?t?(s,i,r)=>e(s,i,r)||t(s,i,r):e:t,autoPanel:(e,t)=>e||t})}}});function JA(n,e){return n?e?(t,s)=>e(n(t,s),s):n:e}function bte(n,e={}){return[qi.of({source:n,config:e}),mte,EL]}function vL(n){let e=[];if(n)e:for(let{name:t}of n){for(let s=0;s<t.length;s++){let i=t[s];if(/[a-zA-Z]/.test(i)&&!e.some(r=>r.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function wL(n,e,t){var s;let i=t?vL(e.actions):[];return Nt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Nt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(s=e.actions)===null||s===void 0?void 0:s.map((r,o)=>{let l=!1,c=m=>{if(m.preventDefault(),l)return;l=!0;let y=Za(n.state.field(Ms).diagnostics,e);y&&r.apply(n,y.from,y.to)},{name:f}=r,h=i[o]?f.indexOf(i[o]):-1,d=h<0?f:[f.slice(0,h),Nt("u",f.slice(h,h+1)),f.slice(h+1)],g=r.markClass?" "+r.markClass:"";return Nt("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:c,onmousedown:c,"aria-label":` Action: ${f}${h<0?"":` (access key "${i[o]})"`}.`},d)}),e.source&&Nt("div",{class:"cm-diagnosticSource"},e.source))}class yte extends No{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Nt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class ZA{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=wL(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Qu{constructor(e){this.view=e,this.items=[];let t=i=>{if(i.keyCode==27)QA(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=vL(r.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==i.keyCode){let c=Za(this.view.state.field(Ms).diagnostics,r);c&&r.actions[l].apply(e,c.from,c.to)}}else return;i.preventDefault()},s=i=>{for(let r=0;r<this.items.length;r++)this.items[r].dom.contains(i.target)&&this.moveSelection(r)};this.list=Nt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:s}),this.dom=Nt("div",{class:"cm-panel-lint"},this.list,Nt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>QA(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Ms).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Ms),s=0,i=!1,r=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,c,{spec:f})=>{for(let h of f.diagnostics){if(o.has(h))continue;o.add(h);let d=-1,g;for(let m=s;m<this.items.length;m++)if(this.items[m].diagnostic==h){d=m;break}d<0?(g=new ZA(this.view,h),this.items.splice(s,0,g),i=!0):(g=this.items[d],d>s&&(this.items.splice(s,d-s),i=!0)),t&&g.diagnostic==t.diagnostic?g.dom.hasAttribute("aria-selected")||(g.dom.setAttribute("aria-selected","true"),r=g):g.dom.hasAttribute("aria-selected")&&g.dom.removeAttribute("aria-selected"),s++}});s<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new ZA(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let f=c.height/this.list.offsetHeight;l.top<c.top?this.list.scrollTop-=(c.top-l.top)/f:l.bottom>c.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/f)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let s=e;e=s.nextSibling,s.remove()}for(let s of this.items)if(s.dom.parentNode==this.list){for(;e!=s.dom;)t();e=s.dom.nextSibling}else this.list.insertBefore(s.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Ms),s=Za(t.diagnostics,this.items[e].diagnostic);s&&this.view.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:bL.of(s)})}static open(e){return new Qu(e)}}function Od(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function ed(n){return Od(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const vte=Oe.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:ed("#d11")},".cm-lintRange-warning":{backgroundImage:ed("orange")},".cm-lintRange-info":{backgroundImage:ed("#999")},".cm-lintRange-hint":{backgroundImage:ed("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function wte(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function SL(n){let e="hint",t=1;for(let s of n){let i=wte(s.severity);i>t&&(t=i,e=s.severity)}return e}class xL extends Zi{constructor(e){super(),this.diagnostics=e,this.severity=SL(e)}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let s=this.diagnostics,i=e.state.facet(Rm).tooltipFilter;return i&&(s=i(s,e.state)),s.length&&(t.onmouseover=()=>xte(e,t,s)),t}}function Ste(n,e){let t=s=>{let i=e.getBoundingClientRect();if(!(s.clientX>i.left-10&&s.clientX<i.right+10&&s.clientY>i.top-10&&s.clientY<i.bottom+10)){for(let r=s.target;r;r=r.parentNode)if(r.nodeType==1&&r.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",t),n.state.field(_L)&&n.dispatch({effects:o1.of(null)})}};window.addEventListener("mousemove",t)}function xte(n,e,t){function s(){let o=n.elementAtHeight(e.getBoundingClientRect().top+5-n.documentTop);n.coordsAtPos(o.from)&&n.dispatch({effects:o1.of({pos:o.from,above:!1,clip:!1,create(){return{dom:yL(n,t),getCoords:()=>e.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,Ste(n,e)}let{hoverTime:i}=n.state.facet(Rm),r=setTimeout(s,i);e.onmouseout=()=>{clearTimeout(r),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(r),r=setTimeout(s,i)}}function _te(n,e){let t=Object.create(null);for(let i of e){let r=n.lineAt(i.from);(t[r.from]||(t[r.from]=[])).push(i)}let s=[];for(let i in t)s.push(new xL(t[i]).range(+i));return pt.of(s,!0)}const Ete=UM({class:"cm-gutter-lint",markers:n=>n.state.field(fv),widgetMarker:(n,e,t)=>{let s=[];return n.state.field(fv).between(t.from,t.to,(i,r,o)=>{i>t.from&&i<t.to&&s.push(...o.diagnostics)}),s.length?new xL(s):null}}),fv=un.define({create(){return pt.empty},update(n,e){n=n.map(e.changes);let t=e.state.facet(Rm).markerFilter;for(let s of e.effects)if(s.is(Om)){let i=s.value;t&&(i=t(i||[],e.state)),n=_te(e.state.doc,i.slice(0))}return n}}),o1=tt.define(),_L=un.define({create(){return null},update(n,e){return n&&e.docChanged&&(n=mL(e,n)?null:{...n,pos:e.changes.mapPos(n.pos)}),e.effects.reduce((t,s)=>s.is(o1)?s.value:t,n)},provide:n=>wm.from(n)}),Cte=Oe.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:Od('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:Od('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:Od('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),EL=[Ms,Oe.decorations.compute([Ms],n=>{let{selected:e,panel:t}=n.field(Ms);return!e||!t||e.from==e.to?je.none:je.set([ute.range(e.from,e.to)])}),gQ(fte,{hideOn:mL}),vte],Rm=Re.define({combine(n){return Ei(n,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function Ate(n={}){return[Rm.of(n),fv,Ete,Cte,_L]}const kte=[AQ(),OQ(),jX(),KJ(),vJ(),PX(),WX(),bt.allowMultipleSelections.of(!0),rJ(),hD(_J,{fallback:!0}),RJ(),Xee(),lte(),rQ(),aQ(),ZX(),eee(),vm.of([...ete,...YD,...wee,...tZ,...mJ,...pL,...pte])],Tte="#e5c07b",ek="#e06c75",Ote="#56b6c2",Rte="#ffffff",Rd="#abb2bf",hv="#7d8799",Mte="#61afef",Dte="#98c379",tk="#d19a66",Lte="#c678dd",Nte="#21252b",nk="#2c313a",sk="#282c34",m0="#353a42",Ite="#3E4451",ik="#528bff",Pte=Oe.theme({"&":{color:Rd,backgroundColor:sk},".cm-content":{caretColor:ik},".cm-cursor, .cm-dropCursor":{borderLeftColor:ik},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Ite},".cm-panels":{backgroundColor:Nte,color:Rd},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:sk,color:hv,border:"none"},".cm-activeLineGutter":{backgroundColor:nk},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:m0},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:m0,borderBottomColor:m0},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:nk,color:Rd}}},{dark:!0}),$te=vf.define([{tag:j.keyword,color:Lte},{tag:[j.name,j.deleted,j.character,j.propertyName,j.macroName],color:ek},{tag:[j.function(j.variableName),j.labelName],color:Mte},{tag:[j.color,j.constant(j.name),j.standard(j.name)],color:tk},{tag:[j.definition(j.name),j.separator],color:Rd},{tag:[j.typeName,j.className,j.number,j.changed,j.annotation,j.modifier,j.self,j.namespace],color:Tte},{tag:[j.operator,j.operatorKeyword,j.url,j.escape,j.regexp,j.link,j.special(j.string)],color:Ote},{tag:[j.meta,j.comment],color:hv},{tag:j.strong,fontWeight:"bold"},{tag:j.emphasis,fontStyle:"italic"},{tag:j.strikethrough,textDecoration:"line-through"},{tag:j.link,color:hv,textDecoration:"underline"},{tag:j.heading,fontWeight:"bold",color:ek},{tag:[j.atom,j.bool,j.special(j.variableName)],color:tk},{tag:[j.processingInstruction,j.string,j.inserted],color:Dte},{tag:j.invalid,color:Rte}]),Bte=[Pte,hD($te)];var rk={};class Ip{constructor(e,t,s,i,r,o,l,c,f,h=0,d){this.p=e,this.stack=t,this.state=s,this.reducePos=i,this.pos=r,this.score=o,this.buffer=l,this.bufferBase=c,this.curContext=f,this.lookAhead=h,this.parent=d}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,s=0){let i=e.parser.context;return new Ip(e,[],t,s,s,0,[],0,i?new ok(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let s=e>>19,i=e&65535,{parser:r}=this.p,o=this.reducePos<this.pos-25;o&&this.setLookAhead(this.pos);let l=r.dynamicPrecedence(i);if(l&&(this.score+=l),s==0){this.pushState(r.getGoto(this.state,i,!0),this.reducePos),i<r.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(i,this.reducePos);return}let c=this.stack.length-(s-1)*3-(e&262144?6:0),f=c?this.stack[c-2]:this.p.ranges[0].from,h=this.reducePos-f;h>=2e3&&!(!((t=this.p.parser.nodeSet.types[i])===null||t===void 0)&&t.isAnonymous)&&(f==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSize<h&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=f,this.p.lastBigReductionSize=h));let d=c?this.stack[c-1]:0,g=this.bufferBase+this.buffer.length-d;if(i<r.minRepeatTerm||e&131072){let m=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,f,m,g+4,!0)}if(e&262144)this.state=this.stack[c];else{let m=this.stack[c-3];this.state=r.getGoto(m,i,!0)}for(;this.stack.length>c;)this.stack.pop();this.reduceContext(i,f)}storeNode(e,t,s,i=4,r=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,l=this.buffer.length;if(l==0&&o.parent&&(l=o.bufferBase-o.parent.bufferBase,o=o.parent),l>0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(t==s)return;if(o.buffer[l-2]>=t){o.buffer[l-2]=s;return}}}if(!r||this.pos==s)this.buffer.push(e,t,s,i);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0){let l=!1;for(let c=o;c>0&&this.buffer[c-2]>s;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>s;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,i>4&&(i-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=s,this.buffer[o+3]=i}}shift(e,t,s,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let r=e,{parser:o}=this.p;(i>this.pos||t<=o.maxNode)&&(this.pos=i,o.stateFlag(r,1)||(this.reducePos=i)),this.pushState(r,s),this.shiftContext(t,s),t<=o.maxNode&&this.buffer.push(t,s,i,4)}else this.pos=i,this.shiftContext(t,s),t<=this.p.parser.maxNode&&this.buffer.push(t,s,i,4)}apply(e,t,s,i){e&65536?this.reduce(e):this.shift(e,t,s,i)}useNode(e,t){let s=this.p.reused.length-1;(s<0||this.p.reused[s]!=e)&&(this.p.reused.push(e),s++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(s,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let s=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new Ip(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,s,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let s=e<=this.p.parser.maxNode;s&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,s?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Fte(this);;){let s=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(s==0)return!1;if((s&65536)==0)return!0;t.reduce(s)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let i=[];for(let r=0,o;r<t.length;r+=2)(o=t[r+1])!=this.state&&this.p.parser.hasAction(o,e)&&i.push(t[r],o);if(this.stack.length<120)for(let r=0;i.length<8&&r<t.length;r+=2){let o=t[r+1];i.some((l,c)=>c&1&&l==o)||i.push(t[r],o)}t=i}let s=[];for(let i=0;i<t.length&&s.length<4;i+=2){let r=t[i+1];if(r==this.state)continue;let o=this.split();o.pushState(r,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(t[i],this.pos),o.reducePos=this.pos,o.score-=200,s.push(o)}return s}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let s=t>>19,i=t&65535,r=this.stack.length-s*3;if(r<0||e.getGoto(this.stack[r],i,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],s=(i,r)=>{if(!t.includes(i))return t.push(i),e.allActions(i,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-r;if(l>1){let c=o&65535,f=this.stack.length-l*3;if(f>=0&&e.getGoto(this.stack[f],c,!1)>=0)return l<<19|65536|c}}else{let l=s(o,r+1);if(l!=null)return l}})};return s(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new ok(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class ok{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Fte{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,s=e>>19;s==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(s-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=i}}class Pp{constructor(e,t,s){this.stack=e,this.pos=t,this.index=s,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Pp(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}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]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Pp(this.stack,this.pos,this.index)}}function td(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let s=0,i=0;s<n.length;){let r=0;for(;;){let o=n.charCodeAt(s++),l=!1;if(o==126){r=65535;break}o>=92&&o--,o>=34&&o--;let c=o-32;if(c>=46&&(c-=46,l=!0),r+=c,l)break;r*=46}t?t[i++]=r:t=new e(r)}return t}class Md{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const lk=new Md;class Vte{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=lk,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let s=this.range,i=this.rangeIndex,r=this.pos+e;for(;r<s.from;){if(!i)return null;let o=this.ranges[--i];r-=s.from-o.to,s=o}for(;t<0?r>s.to:r>=s.to;){if(i==this.ranges.length-1)return null;let o=this.ranges[++i];r+=o.from-s.to,s=o}return r}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,s,i;if(t>=0&&t<this.chunk.length)s=this.pos+e,i=this.chunk.charCodeAt(t);else{let r=this.resolveOffset(e,1);if(r==null)return-1;if(s=r,s>=this.chunk2Pos&&s<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(s-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=s;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=s),s+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-s)),i=this.chunk2.charCodeAt(0)}}return s>=this.token.lookAhead&&(this.token.lookAhead=s+1),i}acceptToken(e,t=0){let s=t?this.resolveOffset(t,-1):this.pos;if(s==null||s<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=s}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=lk,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let s="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(s+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return s}}class Ma{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:s}=t.p;Wte(this.data,e,t,this.id,s.data,s.tokenPrecTable)}}Ma.prototype.contextual=Ma.prototype.fallback=Ma.prototype.extend=!1;Ma.prototype.fallback=Ma.prototype.extend=!1;function Wte(n,e,t,s,i,r){let o=0,l=1<<s,{dialect:c}=t.p.parser;e:for(;(l&n[o])!=0;){let f=n[o+1];for(let m=o+3;m<f;m+=2)if((n[m+1]&l)>0){let y=n[m];if(c.allows(y)&&(e.token.value==-1||e.token.value==y||Hte(y,e.token.value,i,r))){e.acceptToken(y);break}}let h=e.next,d=0,g=n[o+2];if(e.next<0&&g>d&&n[f+g*3-3]==65535){o=n[f+g*3-1];continue e}for(;d<g;){let m=d+g>>1,y=f+m+(m<<1),w=n[y],x=n[y+1]||65536;if(h<w)g=m;else if(h>=x)d=m+1;else{o=n[y+2],e.advance();continue e}}break}}function ak(n,e,t){for(let s=e,i;(i=n[s])!=65535;s++)if(i==t)return s-e;return-1}function Hte(n,e,t,s){let i=ak(t,s,e);return i<0||ak(t,s,n)<i}const Es=typeof process<"u"&&rk&&/\bparse\b/.test(rk.LOG);let g0=null;function ck(n,e,t){let s=n.cursor(pn.IncludeAnonymous);for(s.moveTo(e);;)if(!(t<0?s.childBefore(e):s.childAfter(e)))for(;;){if((t<0?s.to<e:s.from>e)&&!s.type.isError)return t<0?Math.max(0,Math.min(s.to-1,e-25)):Math.min(n.length,Math.max(s.from+1,e+25));if(t<0?s.prevSibling():s.nextSibling())break;if(!s.parent())return t<0?0:n.length}}class Ute{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?ck(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?ck(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let s=this.trees[t],i=this.index[t];if(i==s.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let r=s.children[i],o=this.start[t]+s.positions[i];if(o>e)return this.nextStart=o,null;if(r instanceof tn){if(o==e){if(o<this.safeFrom)return null;let l=o+r.length;if(l<=this.safeTo){let c=r.prop(ct.lookAhead);if(!c||l+c<this.fragment.to)return r}}this.index[t]++,o+r.length>=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+r.length}}}class zte{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(s=>new Md)}getActions(e){let t=0,s=null,{parser:i}=e.p,{tokenizers:r}=i,o=i.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,c=0;for(let f=0;f<r.length;f++){if((1<<f&o)==0)continue;let h=r[f],d=this.tokens[f];if(!(s&&!h.fallback)&&((h.contextual||d.start!=e.pos||d.mask!=o||d.context!=l)&&(this.updateCachedToken(d,h,e),d.mask=o,d.context=l),d.lookAhead>d.end+25&&(c=Math.max(d.lookAhead,c)),d.value!=0)){let g=t;if(d.extended>-1&&(t=this.addActions(e,d.extended,d.end,t)),t=this.addActions(e,d.value,d.end,t),!h.extend&&(s=d,t>g))break}}for(;this.actions.length>t;)this.actions.pop();return c&&e.setLookAhead(c),!s&&e.pos==this.stream.end&&(s=new Md,s.value=e.p.parser.eofTerm,s.start=s.end=e.pos,t=this.addActions(e,s.value,s.end,t)),this.mainToken=s,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Md,{pos:s,p:i}=e;return t.start=s,t.end=Math.min(s+1,i.stream.end),t.value=s==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,s){let i=this.stream.clipPos(s.pos);if(t.token(this.stream.reset(i,e),s),e.value>-1){let{parser:r}=s.p;for(let o=0;o<r.specialized.length;o++)if(r.specialized[o]==e.value){let l=r.specializers[o](this.stream.read(e.start,e.end),s);if(l>=0&&s.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,s,i){for(let r=0;r<i;r+=3)if(this.actions[r]==e)return i;return this.actions[i++]=e,this.actions[i++]=t,this.actions[i++]=s,i}addActions(e,t,s,i){let{state:r}=e,{parser:o}=e.p,{data:l}=o;for(let c=0;c<2;c++)for(let f=o.stateSlot(r,c?2:1);;f+=3){if(l[f]==65535)if(l[f+1]==1)f=yr(l,f+2);else{i==0&&l[f+1]==2&&(i=this.putAction(yr(l,f+2),t,s,i));break}l[f]==t&&(i=this.putAction(yr(l,f+1),t,s,i))}return i}}class qte{constructor(e,t,s,i){this.parser=e,this.input=t,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Vte(t,i),this.tokens=new zte(e,this.stream),this.topTerm=e.top[1];let{from:r}=i[0];this.stacks=[Ip.start(this,e.top[0],r)],this.fragments=s.length&&this.stream.end-r>e.bufferLength*4?new Ute(s,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,s=this.stacks=[],i,r;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>t)s.push(l);else{if(this.advanceStack(l,s,e))continue;{i||(i=[],r=[]),i.push(l);let c=this.tokens.getMainToken(l);r.push(c.value,c.end)}}break}}if(!s.length){let o=i&&jte(i);if(o)return Es&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Es&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&i){let o=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,r,s);if(o)return Es&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(s.length>o)for(s.sort((l,c)=>c.score-l.score);s.length>o;)s.pop();s.some(l=>l.reducePos>t)&&this.recovering--}else if(s.length>1){e:for(let o=0;o<s.length-1;o++){let l=s[o];for(let c=o+1;c<s.length;c++){let f=s[c];if(l.sameState(f)||l.buffer.length>500&&f.buffer.length>500)if((l.score-f.score||l.buffer.length-f.buffer.length)>0)s.splice(c--,1);else{s.splice(o--,1);continue e}}}s.length>12&&s.splice(12,s.length-12)}this.minStackPos=s[0].pos;for(let o=1;o<s.length;o++)s[o].pos<this.minStackPos&&(this.minStackPos=s[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,s){let i=e.pos,{parser:r}=this,o=Es?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let f=e.curContext&&e.curContext.tracker.strict,h=f?e.curContext.hash:0;for(let d=this.fragments.nodeAt(i);d;){let g=this.parser.nodeSet.types[d.type.id]==d.type?r.getGoto(e.state,d.type.id):-1;if(g>-1&&d.length&&(!f||(d.prop(ct.contextHash)||0)==h))return e.useNode(d,g),Es&&console.log(o+this.stackID(e)+` (via reuse of ${r.getName(d.type.id)})`),!0;if(!(d instanceof tn)||d.children.length==0||d.positions[0]>0)break;let m=d.children[0];if(m instanceof tn&&d.positions[0]==0)d=m;else break}}let l=r.stateSlot(e.state,4);if(l>0)return e.reduce(l),Es&&console.log(o+this.stackID(e)+` (via always-reduce ${r.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let c=this.tokens.getActions(e);for(let f=0;f<c.length;){let h=c[f++],d=c[f++],g=c[f++],m=f==c.length||!s,y=m?e:e.split(),w=this.tokens.mainToken;if(y.apply(h,d,w?w.start:y.pos,g),Es&&console.log(o+this.stackID(y)+` (via ${(h&65536)==0?"shift":`reduce of ${r.getName(h&65535)}`} for ${r.getName(d)} @ ${i}${y==e?"":", split"})`),m)return!0;y.pos>i?t.push(y):s.push(y)}return!1}advanceFully(e,t){let s=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>s)return uk(e,t),!0}}runRecovery(e,t,s){let i=null,r=!1;for(let o=0;o<e.length;o++){let l=e[o],c=t[o<<1],f=t[(o<<1)+1],h=Es?this.stackID(l)+" -> ":"";if(l.deadEnd&&(r||(r=!0,l.restart(),Es&&console.log(h+this.stackID(l)+" (restarted)"),this.advanceFully(l,s))))continue;let d=l.split(),g=h;for(let m=0;d.forceReduce()&&m<10&&(Es&&console.log(g+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,s));m++)Es&&(g=this.stackID(d)+" -> ");for(let m of l.recoverByInsert(c))Es&&console.log(h+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,s);this.stream.end>l.pos?(f==l.pos&&(f++,c=0),l.recoverByDelete(c,f),Es&&console.log(h+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),uk(l,s)):(!i||i.score<l.score)&&(i=l)}return i}stackToTree(e){return e.close(),tn.build({buffer:Pp.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(g0||(g0=new WeakMap)).get(e);return t||g0.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function uk(n,e){for(let t=0;t<e.length;t++){let s=e[t];if(s.pos==n.pos&&s.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}class Kte{constructor(e,t,s){this.source=e,this.flags=t,this.disabled=s}allows(e){return!this.disabled||this.disabled[e]==0}}class $p extends XM{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;l<e.repeatNodeCount;l++)t.push("");let s=Object.keys(e.topRules).map(l=>e.topRules[l][1]),i=[];for(let l=0;l<t.length;l++)i.push([]);function r(l,c,f){i[l].push([c,c.deserialize(String(f))])}if(e.nodeProps)for(let l of e.nodeProps){let c=l[0];typeof c=="string"&&(c=ct[c]);for(let f=1;f<l.length;){let h=l[f++];if(h>=0)r(h,c,l[f++]);else{let d=l[f+-h];for(let g=-h;g>0;g--)r(l[f++],c,d);f++}}}this.nodeSet=new Ww(t.map((l,c)=>ms.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:i[c],top:s.indexOf(c)>-1,error:c==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(c)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=KM;let o=td(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(fk),this.states=td(e.states,Uint32Array),this.data=td(e.stateData),this.goto=td(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new Ma(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,s){let i=new qte(this,e,t,s);for(let r of this.wrappers)i=r(i,e,t,s);return i}getGoto(e,t,s=!1){let i=this.goto;if(t>=i[0])return-1;for(let r=i[t+1];;){let o=i[r++],l=o&1,c=i[r++];if(l&&s)return c;for(let f=r+(o>>1);r<f;r++)if(i[r]==e)return c;if(l)return-1}}hasAction(e,t){let s=this.data;for(let i=0;i<2;i++)for(let r=this.stateSlot(e,i?2:1),o;;r+=3){if((o=s[r])==65535)if(s[r+1]==1)o=s[r=yr(s,r+2)];else{if(s[r+1]==2)return yr(s,r+2);break}if(o==t||o==0)return yr(s,r+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,s=>s==t?!0:null)}allActions(e,t){let s=this.stateSlot(e,4),i=s?t(s):void 0;for(let r=this.stateSlot(e,1);i==null;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=yr(this.data,r+2);else break;i=t(yr(this.data,r+1))}return i}nextStates(e){let t=[];for(let s=this.stateSlot(e,1);;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=yr(this.data,s+2);else break;if((this.data[s+2]&1)==0){let i=this.data[s+1];t.some((r,o)=>o&1&&r==i)||t.push(this.data[s],i)}}return t}configure(e){let t=Object.assign(Object.create($p.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let s=this.topRules[e.top];if(!s)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=s}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(s=>{let i=e.tokenizers.find(r=>r.from==s);return i?i.to:s})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((s,i)=>{let r=e.specializers.find(l=>l.from==s.external);if(!r)return s;let o=Object.assign(Object.assign({},s),{external:r.to});return t.specializers[i]=fk(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),s=t.map(()=>!1);if(e)for(let r of e.split(" ")){let o=t.indexOf(r);o>=0&&(s[o]=!0)}let i=null;for(let r=0;r<t.length;r++)if(!s[r])for(let o=this.dialects[t[r]],l;(l=this.data[o++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[l]=1;return new Kte(e,s,i)}static deserialize(e){return new $p(e)}}function yr(n,e){return n[e]|n[e+1]<<16}function jte(n){let e=null;for(let t of n){let s=t.p.stoppedAt;(t.pos==t.p.stream.end||s!=null&&t.pos>s)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function fk(n){if(n.external){let e=n.extend?1:0;return(t,s)=>n.external(t,s)<<1|e}return n.get}const Gte=QM({String:j.string,Number:j.number,"True False":j.bool,PropertyName:j.propertyName,Null:j.null,",":j.separator,"[ ]":j.squareBracket,"{ }":j.brace}),Yte=$p.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[Gte],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),Xte=()=>n=>{try{JSON.parse(n.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const t=Qte(e,n.state.doc);return[{from:t,message:e.message,severity:"error",to:t}]}return[]};function Qte(n,e){let t;return(t=n.message.match(/at position (\d+)/))?Math.min(+t[1],e.length):(t=n.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+t[1]).from+ +t[2]-1,e.length):0}const Jte=Sp.define({name:"json",parser:Yte.configure({props:[tD.add({Object:EA({except:/^\s*\}/}),Array:EA({except:/^\s*\]/})}),sD.add({"Object Array":lJ})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Zte(){return new YQ(Jte)}const ene=Oe.theme({".cm-line, .cm-line span":{"font-size":"13px","font-weight":"bold","font-family":"'JetBrains Mono', monospace !important"},".cm-tooltip":{"background-color":"#fafafa"},"&":{maxHeight:"100%",height:"100%"},".cm-gutter,.cm-content":{minHeight:"100%"},".cm-scroller":{overflow:"auto"}}),tne=(n,e)=>{const t=new Oe({doc:JSON.stringify({},null,"	"),extensions:e});return n.parentNode.insertBefore(t.dom,n),n.style.display="none",t},Mm=(n,e,t=!1)=>tne(n.value,[kte,Zte(),bte(Xte()),Ate(),cee({top:!0}),ene,Bte,Oe.updateListener.of(i=>{e&&(e.value=i.state.doc.toString())}),vm.of([...YD,GZ]),Oe.editable.of(!t)]);async function nne(n,e){const t=Fn(Kt.ITEM.QUERY,{tableName:n}),s={};Object.keys(e).forEach(r=>{Lr.isNil(e[r])||(s[r]=e[r])});const{data:i}=await Xe.post(t,s);return i}async function sne(n,e){const t=Fn(Kt.ITEM.SCAN,{tableName:n}),s={};Object.keys(e).forEach(r=>{Lr.isNil(e[r])||(s[r]=e[r])});const{data:i}=await Xe.post(t,s);return i}async function ine(n,e){const t=Fn(Kt.ITEM.COUNT,{tableName:n}),s={};Object.keys(e).forEach(r=>{Lr.isNil(e[r])||(s[r]=e[r])}),delete s.Limit,delete s.ExclusiveStartKey;const{data:i}=await Xe.post(t,s);return i}async function rne(n,e){const t=Fn(Kt.ITEM.TRUNCATE,{tableName:n}),s={};Object.keys(e).forEach(r=>{Lr.isNil(e[r])||(s[r]=e[r])}),delete s.Limit,delete s.ExclusiveStartKey;const{data:i}=await Xe.put(t,s);return i}async function one(n,e,t,s){const i=Fn(Kt.ITEM.UPDATE,{tableName:n}),r={},o={};s.forEach(({AttributeName:c})=>{r[c]=e[c],o[c]=t[c]});const{data:l}=await Xe.put(i,{ref:r,body:t});return{data:l,ref:o,body:t}}async function lne(n,e,t){const s=Fn(Kt.ITEM.GET,{tableName:n}),i={};Object.keys(e).forEach(o=>{const{AttributeType:l}=t.find(({AttributeName:c})=>c===o)??{AttributeType:"S"};switch(l){case"N":i[o]=parseInt(e[o]);break;default:i[o]=e[o];break}});const{data:r}=await Xe.post(s,i);return r}async function ane(n,e){const t=Fn(Kt.ITEM.DELETE,{tableName:n}),s=[];e.forEach(r=>{const o={DeleteRequest:{Key:r}};s.push(o)});const{data:i}=await Xe.post(t,s);return i}async function cne(n,e){const t=Fn(Kt.ITEM.CREATE,{tableName:n}),{data:s}=await Xe.post(t,e);return{data:s,body:e}}const une={setup(){let n;const e=De("{}"),t=De("{}"),s=De(""),i=De(!0),r=De(!1),o=Wt({className:"text-bg-success",message:"The item has been saved successfully."}),l=er(),c=_i(),f=De(null),h=De(null),d=Vt("store"),g=()=>{window.history.length>1?c.back():c.push({name:"home"})},m=async()=>{const w=d.table.state.Table,x=w.TableName;try{const{ref:S,body:C}=await one(x,JSON.parse(e.value),JSON.parse(t.value),w.KeySchema);o.className="text-bg-success",o.message="The item has been saved successfully.",r.value&&(e.value=JSON.stringify(C,null,2),c.replace({name:"edit-item",query:{...l.query,...S}}))}catch(S){o.className="text-bg-danger",o.message=S.message}finally{const S=new en(h.value,{delay:1e3});setTimeout(()=>S.show(),0)}};Os([e,t],([w,x])=>{i.value=!1,s.value="";try{const S=JSON.parse(x),C=JSON.parse(w);i.value=!0,r.value=!1,Object.keys(l.query).forEach(E=>{r.value||=C[E]!==S[E]})}catch(S){s.value=S.message,i.value=!1}}),Si(async()=>{n=Mm(f,t),await y(),n.dispatch({changes:{from:0,to:n.state.doc.length,insert:e.value}})});const y=async()=>{const{tableName:w}=l.params,x=await hl(w),{Item:S}=await lne(w,l.query,x.AttributeDefinitions);e.value=JSON.stringify(S,null,2),d.table.setters.setTable(x)};return{store:d,textAreaRef:f,isValid:i,hasKeyChanged:r,toast:o,toastRef:h,cancel:g,save:m,errorMsg:s}}},fne={class:"row"},hne={class:"col-12 col-xl-8",id:"edit-item"},dne={class:"vh-60"},pne={ref:"textAreaRef"},mne={key:0,class:"alert alert-danger rounded-0",role:"alert"},gne={key:1,class:"alert alert-primary rounded-0",role:"alert"},bne={class:"d-flex justify-content-end"},yne=["disabled"],vne={key:0,class:"spinner-grow spinner-grow-sm",role:"status","aria-hidden":"true"},wne={class:"toast-container position-fixed top-0 start-50 translate-middle-x p-3"},Sne={class:"d-flex"},xne={class:"toast-body"};function _ne(n,e,t,s,i,r){return ue(),ye("div",fne,[b("div",hne,[e[5]||(e[5]=b("h3",null,"Edit item",-1)),e[6]||(e[6]=b("p",null," You can add, remove, or edit the attributes of an item. You can nest attributes inside other attributes up to 32 levels deep. ",-1)),b("div",dne,[b("textarea",pne,null,512)]),s.errorMsg?(ue(),ye("div",mne,Pe(s.errorMsg),1)):st("",!0),s.hasKeyChanged?(ue(),ye("div",gne," You are changing the values of the item keys. A transaction will be used to delete and recreate the item with the new keys. ")):st("",!0),e[7]||(e[7]=b("br",null,null,-1)),e[8]||(e[8]=b("br",null,null,-1)),e[9]||(e[9]=b("br",null,null,-1)),b("div",bne,[b("button",{class:"btn btn-primary rounded-0",type:"button",disabled:!s.isValid||s.store.ui.state.isLoading,onClick:e[0]||(e[0]=(...o)=>s.save&&s.save(...o))},[s.store.ui.state.isLoading?(ue(),ye("span",vne)):st("",!0),e[2]||(e[2]=b("span",{class:"visually-hidden"},"Loading...",-1)),e[3]||(e[3]=Ie(" Save Changes ",-1))],8,yne),b("button",{type:"button",class:"btn btn-secondary rounded-0 ms-2",onClick:e[1]||(e[1]=(...o)=>s.cancel&&s.cancel(...o))}," Cancel ")]),b("div",wne,[b("div",{class:Pt(["toast align-items-center border-0",s.toast.className]),role:"alert","aria-live":"assertive","aria-atomic":"true",ref:"toastRef"},[b("div",Sne,[b("div",xne,Pe(s.toast.message),1),e[4]||(e[4]=b("button",{type:"button",class:"btn-close btn-close-white me-2 m-auto","data-bs-dismiss":"toast","aria-label":"Close"},null,-1))])],2)])])])}const Ene=tr(une,[["render",_ne]]),ks={NONE:null,ASC:"ASC",DESC:"DESC"},nd=[ks.NONE,ks.ASC,ks.DESC],Cne={class:"sticky-top table-actions bg-white"},Ane={class:"d-flex"},kne={class:"ms-3 overflow-hidden shadow-sm min-width-min-content table-responsive"},Tne={class:"shadow-sm border-top-0 border-bottom-0"},One=["checked","indeterminate"],Rne={class:"text-nowrap"},Mne={key:0},Dne={class:"bi bi-arrow-down"},Lne={class:"bi bi-arrow-up"},Nne={class:"shadow-sm border-top-0 border-bottom-0"},Ine=["onClick"],Pne={class:"text-nowrap"},$ne={key:0},Bne={class:"bi bi-arrow-down"},Fne={class:"bi bi-arrow-up"},Vne={class:"position-relative d-flex"},Wne={class:"mb-0 position-relative table table-hover table-bordered"},Hne={class:"shadow-sm border-top-0 border-bottom-0"},Une={scope:"col"},zne=["checked","indeterminate"],qne={class:"text-nowrap"},Kne={key:0},jne={class:"bi bi-arrow-down"},Gne={class:"bi bi-arrow-up"},Yne=["onClick"],Xne=["onChange","checked"],Qne=["onClick"],Jne=["onClick"],Zne={class:"shadow-sm border-top-0 border-bottom-0"},ese=["onClick"],tse={class:"text-nowrap"},nse={key:0},sse={class:"bi bi-arrow-down"},ise={class:"bi bi-arrow-up"},rse=["onClick"],ose={class:"modal-dialog modal-dialog-centered"},lse={class:"modal-content"},ase={class:"modal-header"},cse={class:"modal-title"},use={class:"modal-body"},fse={class:"modal-footer"},hse=["disabled"],dse={key:0,class:"spinner-grow spinner-grow-sm",role:"status","aria-hidden":"true"},pse={class:"offcanvas-body p-0"},mse={class:"h-100"},gse=Bn({__name:"item-list",props:{action:String,isSelected:Boolean,count:Number},emits:["reset","unselect"],setup(n,{expose:e,emit:t}){const s=n,i=_i(),r=Vt("store"),o=t,l=Wt({key:null,order:null}),c=De([]),f=at(()=>r.ui.state.table.headers??[]),h=at(()=>{c.value=[];const{Limit:ae}=r.dynamodb.state,{rows:be,page:Ne}=r.ui.state.table;return d(be).slice((Ne-1)*ae,Ne*ae)}),d=(ae=[])=>!l.key||!l.order?ae:[...ae].sort((be,Ne)=>{const B=l.key&&be[l.key]||"",se=l.key&&Ne[l.key]||"";return l.order===ks.ASC?B>se?1:B<se?-1:0:l.order===ks.DESC?B>se?-1:B<se?1:0:0}),g=ae=>{const be=nd.findIndex(Ne=>Ne===l.order);l.key===ae?l.order=nd[(be+1)%nd.length]:(l.key=ae,l.order=nd[1])};De(null);const m=De(null),y=De(null),w=De(null),x=De(null),S=De(null),C=De(null),E=De(null),k=De(null);$d(()=>{s.isSelected&&(c.value=[...h.value])}),Os(()=>h.value,async()=>{await _u(()=>{w.value.style.width=`${+m.value.scrollWidth}px`,C.value.style.marginLeft=`${+x.value.scrollWidth+14}px`})}),Os(c,ae=>{r.ui.setters.setSelectedRows(ae.length)},{immediate:!0,deep:!0});const R=De([]);Os(()=>h.value,async()=>{await _u(()=>{const be=k.value?.getElementsByTagName("tr")?.[0]?.getElementsByTagName("td"),B=y.value?.getElementsByTagName("tr")?.[0]?.getElementsByTagName("td");B&&be&&(R.value=[...be,...B].map(se=>se.getBoundingClientRect()?.width))})});const T=Lr.throttle(ae=>{C.value?.scroll({left:ae.target.scrollLeft}),E.value?.scroll({left:ae.target.scrollLeft})},.5),L=Lr.throttle(ae=>{S.value?.scroll({left:ae.target.scrollLeft}),E.value?.scroll({left:ae.target.scrollLeft})},.5);Os(()=>h.value,()=>{setTimeout(()=>{[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function(be){return new Cl(be)})},0)});const N=at(()=>r.table.state.Table.KeySchema.find(({KeyType:ae})=>ae==="HASH")),F=at(()=>r.table.state.Table.KeySchema.find(({KeyType:ae})=>ae==="RANGE")),ee=De(null),ce=De(null),ne=De(null),pe=De(null),Y=De(null);Si(()=>{ee.value=new Ir(ce.value,{}),Y.value=Mm(pe,{},!0)});const q=ae=>({name:"edit-item",params:{tableName:r.table.state.Table.TableName},query:{...N.value&&{[N.value.AttributeName]:ae[N.value.AttributeName]},...F.value&&{[F.value.AttributeName]:ae[F.value.AttributeName]}}}),J=ae=>c.value.findIndex(Ne=>{const B=N.value?Ne[N.value.AttributeName]===ae[N.value.AttributeName]:!0,se=F.value?Ne[F.value.AttributeName]===ae[F.value.AttributeName]:!0;return B&&se}),Se=ae=>{o("unselect");const be=J(ae);be>-1?c.value.splice(be,1):c.value.push(ae)},H=()=>{o("unselect"),c.value.length?c.value=[]:c.value=[...h.value]},ge=()=>{c.value=[]};$d(()=>{s.action&&c.value.length&&(s.action==="EDIT"&&c.value.forEach(ae=>{const be=i.resolve(q(ae));window.open(be.href,"_blank")}),s.action==="DELETE"&&ee.value.show()),o("reset","")});const Z=async()=>{const ae=r.table.state.Table,be=ae.TableName,Ne=r.dynamodb.state;if(s.isSelected)await rne(be,Ne),r.ui.setters.setTable(ae,[]);else{const B=[];c.value.forEach(he=>{const{query:Te}=q(he);B.push(Te)}),await ane(be,B);const se=r.ui.state.table.rows.filter(he=>J(he)===-1);r.ui.setters.setTable(ae,[...se])}ee.value.hide()},X=ae=>{navigator.clipboard.writeText(ae)},fe=ae=>{const be=new Pr(ne.value);q(ae),Y.value.dispatch({changes:{from:0,to:Y.value.state.doc.length,insert:JSON.stringify(ae,null,2)}}),e1(Y.value),be.show()},we=(ae,be)=>{ae.detail===3&&(Se(be),window.getSelection()?.empty()&&window.getSelection()?.removeAllRanges())};return e({clear:ge,selectedItems:c}),(ae,be)=>{const Ne=sc("RouterLink");return ue(),ye(gt,null,[b("div",Cne,[qW(ae.$slots,"default",{},void 0),b("div",Ane,[b("div",kne,[b("table",{ref_key:"table",ref:m,class:"mb-0 position-relative table table-hover table-bordered"},[b("thead",null,[b("tr",Tne,[b("th",{scope:"col",style:Hi(`min-width: ${R.value[0]}px`)},[b("input",{class:"form-check-input mt-1",type:"checkbox",value:"","aria-label":"Checkbox for following text input",checked:c.value.length>0,onChange:H,indeterminate:c.value.length>0&&c.value.length<h.value.length},null,40,One)],4),(ue(),ye("th",{scope:"col",key:ae.key,onClick:be[0]||(be[0]=B=>g(f.value[0])),style:Hi(`min-width: ${R.value[1]}px`)},[b("span",Rne,[Ie(Pe(f.value[0])+" ",1),l.key===f.value[0]?(ue(),ye("span",Mne,[Ye(b("i",Dne,null,512),[[Qr,l.order===ke(ks).DESC]]),Ye(b("i",Lne,null,512),[[Qr,l.order===ke(ks).ASC]])])):st("",!0)])],4)),b("th",{scope:"col",style:Hi(`min-width: ${R.value[2]}px`)},[...be[4]||(be[4]=[b("i",{class:"bi bi-eye me-2 text-white","data-bs-toggle":"tooltip","data-bs-placement":"top","data-bs-title":"Preview"},null,-1)])],4)])])],512)]),b("div",{class:"table-responsive me-3 overflow-hidden shadow-sm w-100",ref_key:"tableHeaderContainer",ref:E},[b("table",{ref_key:"table",ref:m,class:"mb-0 position-relative table table-hover table-bordered"},[b("thead",null,[b("tr",Nne,[(ue(!0),ye(gt,null,mn(f.value.slice(1),(B,se)=>(ue(),ye("th",{scope:"col",key:B,onClick:he=>g(B),style:Hi(`min-width: ${R.value[se+3]}px`)},[b("span",Pne,[Ie(Pe(B)+" ",1),l.key===B?(ue(),ye("span",$ne,[Ye(b("i",Bne,null,512),[[Qr,l.order===ke(ks).DESC]]),Ye(b("i",Fne,null,512),[[Qr,l.order===ke(ks).ASC]])])):st("",!0)])],12,Ine))),128))])])],512)],512)])]),b("section",Vne,[b("div",{class:"ms-3",ref_key:"twocolumns",ref:x},[b("table",Wne,[b("thead",null,[b("tr",Hne,[b("th",Une,[b("input",{class:"form-check-input mt-1",type:"checkbox",value:"","aria-label":"Checkbox for following text input",checked:c.value.length>0,onChange:H,indeterminate:c.value.length>0&&c.value.length<h.value.length},null,40,zne)]),(ue(),ye("th",{scope:"col",key:f.value[0],onClick:be[1]||(be[1]=B=>g(ae.key))},[b("span",qne,[Ie(Pe(f.value[0])+" ",1),l.key===f.value[0]?(ue(),ye("span",Kne,[Ye(b("i",jne,null,512),[[Qr,l.order===ke(ks).DESC]]),Ye(b("i",Gne,null,512),[[Qr,l.order===ke(ks).ASC]])])):st("",!0)])]))])]),b("tbody",{ref_key:"metatbody",ref:k},[(ue(!0),ye(gt,null,mn(h.value,B=>(ue(),ye("tr",{class:Pt({"table-primary":J(B)>-1}),key:B[N.value.AttributeName]+(F.value?B[F.value.AttributeName]:""),onClick:se=>we(se,B)},[b("td",null,[b("input",{class:"form-check-input mt-1",type:"checkbox",value:"","aria-label":"Checkbox for following text input",onChange:se=>Se(B),checked:J(B)>-1},null,40,Xne)]),(ue(),ye("td",{key:f.value[0],class:"text-nowrap"},[b("i",{class:"bi bi-clipboard2 me-2","data-bs-toggle":"tooltip","data-bs-placement":"top","data-bs-title":"Copy to clipboard",onClick:se=>X(B[f.value[0]])},null,8,Qne),mt(Ne,{to:q(B),class:"card-link text-decoration-none"},{default:qs(()=>[Ie(Pe(B[f.value[0]]),1)]),_:2},1032,["to"])])),b("td",null,[b("i",{class:"bi bi-eye me-2","data-bs-toggle":"tooltip","data-bs-placement":"top","data-bs-title":"Preview",onClick:se=>fe(B)},null,8,Jne)])],10,Yne))),128))],512)])],512),b("div",{class:"table-responsive me-3 w-100",ref_key:"tableContainer",ref:S,onScroll:be[2]||(be[2]=(...B)=>ke(T)&&ke(T)(...B))},[b("table",{ref_key:"table",ref:m,class:"mb-0 position-relative table table-hover table-bordered"},[b("thead",null,[b("tr",Zne,[(ue(!0),ye(gt,null,mn(f.value.slice(1),B=>(ue(),ye("th",{scope:"col",key:B,onClick:se=>g(B)},[b("span",tse,[Ie(Pe(B)+" ",1),l.key===B?(ue(),ye("span",nse,[Ye(b("i",sse,null,512),[[Qr,l.order===ke(ks).DESC]]),Ye(b("i",ise,null,512),[[Qr,l.order===ke(ks).ASC]])])):st("",!0)])],8,ese))),128))])]),b("tbody",{ref_key:"tbody",ref:y},[(ue(!0),ye(gt,null,mn(h.value,B=>(ue(),ye("tr",{class:Pt({"table-primary":J(B)>-1}),key:B[N.value.AttributeName]+(F.value?B[F.value.AttributeName]:""),onClick:se=>we(se,B)},[(ue(!0),ye(gt,null,mn(f.value.slice(1),(se,he)=>(ue(),ye("td",{key:se},[b("div",null,Pe(B[se]),1)]))),128))],10,rse))),128))],512)],512)],544)]),b("div",{class:"scrollbar-container overflow-x-scroll sticky-bottom me-3",onScroll:be[3]||(be[3]=(...B)=>ke(L)&&ke(L)(...B)),ref_key:"scrollcontainer",ref:C},[b("hr",{ref_key:"scrollbar",ref:w,class:"m-0"},null,512)],544),be[12]||(be[12]=b("div",{class:"hide-double-scrollbar bg-white w-100 position-relative"},null,-1)),b("div",{class:"modal",tabindex:"-1",ref_key:"modalRef",ref:ce},[b("div",ose,[b("div",lse,[b("div",ase,[b("h5",cse,"Delete "+Pe(n.count||c.value.length)+" items",1),be[5]||(be[5]=b("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),b("div",use,[b("p",null,[be[6]||(be[6]=Ie(" Delete ",-1)),b("b",null,Pe(n.count||c.value.length),1),be[7]||(be[7]=Ie(" item from the ",-1)),b("b",null,Pe(ke(r).table.state.Table.TableName),1),be[8]||(be[8]=Ie(" table? This action cannot be reversed. ",-1))])]),b("div",fse,[be[11]||(be[11]=b("button",{type:"button",class:"btn btn-secondary rounded-0","data-bs-dismiss":"modal"}," Cancel ",-1)),b("button",{class:"btn btn-danger rounded-0",type:"button",disabled:ke(r).ui.state.isLoading,onClick:Z},[ke(r).ui.state.isLoading?(ue(),ye("span",dse)):st("",!0),be[9]||(be[9]=b("span",{class:"visually-hidden"},"Loading...",-1)),be[10]||(be[10]=Ie(" Delete ",-1))],8,hse)])])])],512),b("div",{class:"offcanvas offcanvas-end vw-30",tabindex:"-1",id:"offcanvas",ref_key:"offcanvasRef",ref:ne},[b("div",pse,[b("div",mse,[b("textarea",{readonly:"",ref_key:"textAreaRef",ref:pe},null,512)])])],512)],64)}}}),bse=tr(gse,[["__scopeId","data-v-3eadf0fd"]]),yse={props:{activeTableName:String},setup(n){const e=Vt("store"),t=De(""),s=bW(n,"activeTableName"),i=at(()=>e.table.state.TableNames.filter(r=>r.toLowerCase().includes(t.value.toLowerCase())));return{activeTableName:s,tableNames:i,search:t,store:e}}},vse={class:"list-group rounded-0 shadow-sm"},wse={class:"list-group-item py-3"},Sse={class:"mb-3"},xse={class:"text-muted"},_se={class:"input-group mb-3 flex-row-reverse"},Ese=["onClick"],Cse={class:"form-check"},Ase=["value","id","checked"],kse=["for"];function Tse(n,e,t,s,i,r){const o=sc("router-link");return ue(),ye("ul",vse,[b("li",wse,[b("h5",Sse,[e[1]||(e[1]=Ie(" Tables ",-1)),b("span",xse,"("+Pe(s.tableNames.length)+")",1)]),b("div",_se,[Ye(b("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=l=>s.search=l),class:"form-control rounded-0 border-start-0",placeholder:"Find tables by table name"},null,512),[[Rt,s.search]]),e[2]||(e[2]=b("span",{class:"input-group-text bg-white rounded-0 border-end-0 pe-0"},[b("i",{class:"bi bi-search"})],-1))])]),(ue(!0),ye(gt,null,mn(s.tableNames,l=>(ue(),So(o,{custom:"",key:l,to:{name:"home",query:{limit:s.store.dynamodb.state.Limit,tableName:l,page:1,operation:"SCAN",indexName:l}}},{default:qs(({navigate:c})=>[b("li",{class:"list-group-item py-2",onClick:c},[b("div",Cse,[b("input",{class:"form-check-input",name:"table",type:"radio",value:l,id:l,checked:l===(s.activeTableName??s.store.table.state.Table.TableName)},null,8,Ase),b("label",{class:"form-check-label ps-3 text-break",for:l},Pe(l),9,kse)])],8,Ese)]),_:2},1032,["to"]))),128))])}const Ose=tr(yse,[["render",Tse]]),Rse={S:[{label:"=",value:"="},{label:"<>",value:"<>"},{label:"<=",value:"<="},{label:"<",value:"<"},{label:">=",value:">="},{label:">",value:">"},{label:"Between",value:"between"},{label:"Exists",value:"attribute_exists"},{label:"Not exists",value:"attribute_not_exists"},{label:"Contains",value:"contains"},{label:"Not contains",value:"not contains"},{label:"Begins with",value:"begins_with"}],N:[{label:"=",value:"="},{label:"<>",value:"<>"},{label:"<=",value:"<="},{label:"<",value:"<"},{label:">=",value:">="},{label:">",value:">"},{label:"Between",value:"between"},{label:"Exists",value:"attribute_exists"},{label:"Not exists",value:"attribute_not_exists"}],B:[{label:"=",value:"="},{label:"<>",value:"<>"},{label:"<=",value:"<="},{label:"<",value:"<"},{label:">=",value:">="},{label:">",value:">"},{label:"Between",value:"between"},{label:"Exists",value:"attribute_exists"},{label:"Not exists",value:"attribute_not_exists"},{label:"Contains",value:"contains"},{label:"Not contains",value:"not contains"},{label:"Begins with",value:"begins_with"}],BOOL:[{label:"=",value:"="},{label:"<>",value:"<>"},{label:"Exists",value:"attribute_exists"},{label:"Not exists",value:"attribute_not_exists"}],NULL:[{label:"Exists",value:"attribute_exists"},{label:"Not exists",value:"attribute_not_exists"}]},Mse={class:"accordion shadow-sm",id:"scan-query"},Dse={class:"accordion-item rounded-0 border-0"},Lse={id:"collapseOne",class:"accordion-collapse collapse show","data-bs-parent":"#scan-query"},Nse={class:"accordion-body"},Ise={class:"d-flex"},Pse={class:"btn-group",role:"group"},$se=["value"],Bse=["value"],Fse=["value"],Vse=["value"],Wse={key:0},Hse={class:"row"},Use={class:"col-xl-7"},zse={key:0},qse={class:"input-group mb-3 mt-1"},Kse={class:"input-group-text rounded-0"},jse={key:0,class:"row"},Gse={key:0},Yse={class:"col-md-2 col-xl-1"},Xse={key:0,value:"begins_with"},Qse={class:"col-md-6 col-xl-4"},Jse={class:"row"},Zse={class:"input-group mb-3 mt-1"},eie={class:"input-group-text rounded-0"},tie={key:0,class:"col-6"},nie={class:"input-group mb-3 mt-1"},sie={class:"input-group-text rounded-0"},iie={class:"col-md-3 col-xl-1"},rie={class:"text-nowrap mb-3 pt-1 mt-2"},oie={class:"accordion accordion-flush",id:"filters"},lie={class:"accordion-item"},aie={class:"accordion-body p-0"},cie={class:"col-6 col-xl-2"},uie={class:"col-6 col-xl-2"},fie=["onUpdate:modelValue"],hie={class:"col-6 col-xl-2"},die=["onUpdate:modelValue","onChange"],pie=["value"],mie={class:"col-6 col-xl-4"},gie={class:"d-flex mb-2"},bie={class:"row w-100 gx-0"},yie=["onUpdate:modelValue","disabled"],vie=["onUpdate:modelValue"],wie={class:"ms-3 d-none d-xl-block"},Sie=["onClick"],xie={class:"col-12 col-xl-2"},_ie=["onClick"],Eie=Bn({__name:"table-filter",setup(n){const e=er(),t=_i(),s=Vt("store"),i=at(()=>s.table.state.Table),r=De([]),o=at(()=>i.value.KeySchema??[]),l=at(()=>i.value.TableName??e.query.tableName),c=at(()=>i.value.AttributeDefinitions??[]),f=at(()=>i.value.GlobalSecondaryIndexes??[]),h=at(()=>i.value.LocalSecondaryIndexes??[]),d=at(()=>E.value.find(({KeyType:Y=""})=>Y==="HASH")),g=at(()=>E.value.find(({KeyType:Y=""})=>Y==="RANGE"));Si(()=>{m.value&&new Wa(m.value).show()});const m=De(null),y=De(""),w=De(""),x=Wt({keys:{pk:{value:"",condition:"="},sk:{value1:"",value2:"",condition:"=",scanIndexForward:!0}},scan:[{name:"",type:"S",value:"",value2:"",condition:"="}]}),S={keys:{pk:{value:{}}}},C=Wt(structuredClone(S));$d(()=>{w.value=e.query.indexName?.toString()??l.value,y.value=e.query.operation?.toString()}),Os(()=>[e.query.tableName],([Y],[q])=>{Y!==q&&T()}),$d(()=>{const Y=e.query.parameters;if(Y)try{const q=JSON.parse(decodeURIComponent(Y.toString()));Object.keys(q.keys??[]).forEach(J=>{x.keys[J]=q.keys[J]}),x.scan=q.scan??[]}catch(q){console.log(q)}});const E=at(()=>{let Y=[];return w.value===l.value?Y=o.value??[]:Y=[...f.value,...h.value].find(({IndexName:Se})=>Se===w.value)?.KeySchema??[],Y.map(J=>{const{AttributeType:Se}=c.value.find(H=>J.AttributeName===H.AttributeName);return{...J,AttributeType:Se}})}),k=Y=>{T(),y.value=Y},R=()=>{Object.keys(S).forEach(q=>{Object.assign(C[q],structuredClone(S[q]))})},T=(Y=!0)=>{R(),Y&&(y.value="SCAN"),x.keys.pk={value:"",condition:"="},x.keys.sk={value1:"",value2:"",condition:"=",scanIndexForward:!0},x.scan=[{name:"",type:"S",value:"",value2:"",condition:"="}],r.value.forEach(q=>q.clear())},L=Y=>{T(!1),w.value=Y.target.value},N=Y=>Y.keys.pk.value?!0:(C.keys.pk.value.required="Partition key value is required",!1),F=async()=>{const Y={...x};R(),y.value==="SCAN"&&(Y.keys.pk={value:"",condition:"="},Y.keys.sk={value1:"",value2:"",condition:"=",scanIndexForward:!0}),!(y.value==="QUERY"&&!N(x))&&t.push({name:"home",params:e.params,query:{...e.query,requestId:Date.now(),operation:y.value,indexName:w.value,parameters:pe.value?encodeURIComponent(JSON.stringify(x)):null}})},ee=(Y,q)=>{["attribute_exists","attribute_not_exists"].includes(Y.target.value)&&(x.scan[q].value="",x.scan[q].value2="")},ce=()=>{x.scan.push({name:"",type:"S",value:"",value2:"",condition:"="})},ne=Y=>{const q=[...x.scan];q.splice(Y,1),x.scan=q},pe=at(()=>{if(!i.value.TableName)return;const Y=zT({parameters:x,table:i.value,indexName:w.value});return Y&&y.value==="SCAN"&&(delete Y.KeyConditionExpression,delete Y.ScanIndexForward),Y&&Y.ScanIndexForward&&delete Y.ScanIndexForward,Y&&Object.keys(Y).length?Y:null});return(Y,q)=>(ue(),ye("div",Mse,[b("div",Dse,[q[22]||(q[22]=b("h2",{class:"accordion-header"},[b("button",{class:"accordion-button",type:"button","data-bs-toggle":"collapse","data-bs-target":"#collapseOne","aria-expanded":"true","aria-controls":"collapseOne"},[b("div",null,[b("h5",{class:"mb-0"},"Scan/Query Items"),b("small",null,"Scan/query a table or index")])])],-1)),b("div",Lse,[b("div",Nse,[q[18]||(q[18]=b("p",null,"Scan/query a table or index",-1)),b("div",Ise,[b("div",Pse,[b("button",{onClick:q[0]||(q[0]=J=>k("SCAN")),class:Pt(["btn btn-outline-secondary rounded-0 px-4",{active:y.value==="SCAN"}])}," SCAN ",2),b("button",{onClick:q[1]||(q[1]=J=>k("QUERY")),class:Pt(["btn btn-outline-secondary rounded-0 px-4",{active:y.value==="QUERY"}])}," QUERY ",2)]),b("select",{class:"form-select rounded-0 ms-3",value:w.value,onChange:L},[q[7]||(q[7]=b("option",{disabled:""},"Table",-1)),b("option",{value:i.value.TableName},"    "+Pe(l.value),9,Bse),q[8]||(q[8]=b("option",{disabled:""},"Global Secondary Index",-1)),(ue(!0),ye(gt,null,mn(f.value,J=>(ue(),ye("option",{value:J.IndexName,key:J.IndexName},"     "+Pe(J.IndexName),9,Fse))),128)),q[9]||(q[9]=b("option",{disabled:""},"Local Secondary Index",-1)),(ue(!0),ye(gt,null,mn(h.value,J=>(ue(),ye("option",{value:J.IndexName,key:J.IndexName},"     "+Pe(J.IndexName),9,Vse))),128))],40,$se)]),q[19]||(q[19]=b("br",null,null,-1)),y.value==="QUERY"?(ue(),ye("div",Wse,[b("div",Hse,[b("div",Use,[d.value?(ue(),ye("div",zse,Pe(d.value?.AttributeName)+" (Partition key)",1)):st("",!0),b("div",qse,[b("span",Kse,Pe(d.value?.AttributeType),1),Ye(b("input",{placeholder:"Enter partition key value",type:"text",class:Pt(["form-control rounded-0",{"is-invalid":Object.keys(C.keys.pk.value).length}]),required:"","onUpdate:modelValue":q[2]||(q[2]=J=>x.keys.pk.value=J)},null,2),[[Rt,x.keys.pk.value]]),(ue(!0),ye(gt,null,mn(C.keys.pk.value,J=>(ue(),ye("div",{class:"invalid-feedback",key:J},Pe(J),1))),128))])])]),g.value?(ue(),ye("div",jse,[g.value?(ue(),ye("div",Gse,Pe(g.value?.AttributeName)+" (Sort key)",1)):st("",!0),b("div",Yse,[Ye(b("select",{class:"form-select mt-1 rounded-0","onUpdate:modelValue":q[3]||(q[3]=J=>x.keys.sk.condition=J)},[q[10]||(q[10]=Wd('<option value="=" data-v-3028140c>=</option><option value="&lt;=" data-v-3028140c>&lt;=</option><option value="&lt;" data-v-3028140c>&lt;</option><option value="&gt;=" data-v-3028140c>&gt;=</option><option value="&gt;" data-v-3028140c>&gt;</option><option value="between" data-v-3028140c>Between</option>',6)),g.value?.AttributeType==="S"?(ue(),ye("option",Xse," Begins with ")):st("",!0)],512),[[Fi,x.keys.sk.condition]])]),b("div",Qse,[b("div",Jse,[b("div",{class:Pt(x.keys.sk.condition==="between"?"col-6":"col-12")},[b("div",Zse,[b("span",eie,Pe(g.value?.AttributeType),1),Ye(b("input",{type:"text",placeholder:"Enter sort key value",class:"form-control rounded-0","onUpdate:modelValue":q[4]||(q[4]=J=>x.keys.sk.value1=J)},null,512),[[Rt,x.keys.sk.value1]])])],2),x.keys.sk.condition==="between"?(ue(),ye("div",tie,[b("div",nie,[b("span",sie,Pe(g.value?.AttributeType),1),Ye(b("input",{type:"text",placeholder:"Enter sort key value",class:"form-control rounded-0","onUpdate:modelValue":q[5]||(q[5]=J=>x.keys.sk.value2=J)},null,512),[[Rt,x.keys.sk.value2]])])])):st("",!0)])]),b("div",iie,[b("div",rie,[Ye(b("input",{"onUpdate:modelValue":q[6]||(q[6]=J=>x.keys.sk.scanIndexForward=J),class:"form-check-input me-1",type:"checkbox",id:"scanIndexForward"},null,512),[[WT,x.keys.sk.scanIndexForward]]),q[11]||(q[11]=b("label",{class:"form-check-label",for:"scanIndexForward"}," Sort ascending ",-1))])])])):st("",!0)])):st("",!0),q[20]||(q[20]=b("hr",{class:"my-2"},null,-1)),b("div",oie,[b("div",lie,[q[17]||(q[17]=b("h2",{class:"accordion-header",id:"flush-headingOne"},[b("button",{class:"accordion-button collapsed bg-transparent ps-0 fw-bold",type:"button","data-bs-toggle":"collapse","data-bs-target":"#flush-collapseOne","aria-expanded":"false","aria-controls":"flush-collapseOne"}," Filters ")],-1)),b("div",{id:"flush-collapseOne",ref_key:"collapseRef",ref:m,class:"accordion-collapse collapse","aria-labelledby":"flush-headingOne","data-bs-parent":"#filters"},[b("div",aie,[(ue(!0),ye(gt,null,mn(x.scan,(J,Se)=>(ue(),ye("div",{class:"row",key:Se},[b("div",cie,[q[12]||(q[12]=b("label",{class:"mb-1"},"Attribute Name",-1)),mt(Ru,{ref_for:!0,ref_key:"searchDropdownRefs",ref:r,modelValue:J.name,"onUpdate:modelValue":H=>J.name=H,items:ke(s).ui.state.table.headers,placeholder:"Enter attribute name",id:`dropdown-input-toggle-${Se}`,onSelect:H=>J.name=H},null,8,["modelValue","onUpdate:modelValue","items","id","onSelect"])]),b("div",uie,[q[14]||(q[14]=b("label",{class:"mb-1"},"Type",-1)),Ye(b("select",{class:"form-select mb-1 rounded-0","onUpdate:modelValue":H=>J.type=H},[...q[13]||(q[13]=[Wd('<option value="S" data-v-3028140c>String</option><option value="N" data-v-3028140c>Number</option><option value="B" disabled data-v-3028140c> Binary (Unsupported) </option><option value="BOOL" data-v-3028140c>Boolean</option><option value="NULL" data-v-3028140c>Null</option>',5)])],8,fie),[[Fi,J.type]])]),b("div",hie,[q[15]||(q[15]=b("label",{class:"mb-1"},"Condition",-1)),Ye(b("select",{class:"form-select mb-1 rounded-0","onUpdate:modelValue":H=>J.condition=H,onChange:H=>ee(H,Se)},[(ue(!0),ye(gt,null,mn(ke(Rse)[J.type],({label:H,value:ge})=>(ue(),ye("option",{key:ge,value:ge},Pe(H),9,pie))),128))],40,die),[[Fi,J.condition]])]),b("div",mie,[q[16]||(q[16]=b("label",{class:"mb-1"},"Value",-1)),b("div",gie,[b("div",bie,[b("div",{class:Pt(J.condition==="between"?"col-6":"col-12")},[Ye(b("input",{type:"text",class:"form-control rounded-0",placeholder:"Enter attribute value","onUpdate:modelValue":H=>J.value=H,disabled:["attribute_exists","attribute_not_exists"].includes(J.condition)},null,8,yie),[[Rt,J.value]])],2),b("div",{class:Pt(["col-6 ps-2",{"d-none":J.condition!=="between"}])},[Ye(b("input",{type:"text",class:"form-control rounded-0",placeholder:"Enter attribute value","onUpdate:modelValue":H=>J.value2=H},null,8,vie),[[Rt,J.value2]])],2)]),b("div",wie,[b("button",{onClick:H=>ne(Se),class:"btn btn-outline-secondary rounded-0 d-none d-xl-block"}," Remove ",8,Sie)])])]),b("div",xie,[b("button",{onClick:H=>ne(Se),class:"btn btn-outline-secondary rounded-0 mt-1 d-block d-xl-none mt-2 float-end"}," Remove ",8,_ie)])]))),128)),b("button",{class:"btn btn-outline-secondary rounded-0 mt-1 mt-2",onClick:ce}," Add Filter ")])],512)])]),q[21]||(q[21]=b("br",null,null,-1)),b("code",null,[b("pre",null,Pe(pe.value),1)]),b("button",{type:"button",class:"btn btn-primary rounded-0 px-4 mb-2",onClick:F}," RUN "),b("button",{type:"button",class:"btn btn-outline-secondary rounded-0 px-4 mb-2 ms-2",onClick:T}," RESET ")])])])]))}}),Cie=tr(Eie,[["__scopeId","data-v-3028140c"]]),Aie={class:"mb-0"},kie={key:0},Tie=["disabled"],Oie=Bn({__name:"retrieve-next",props:{disabled:Boolean},emits:["next"],setup(n,{emit:e}){const t=e,s=Vt("store"),i=n;return(r,o)=>(ue(),ye("div",{class:Pt(["alert rounded-0 mx-3 d-flex align-items-center justify-content-between",{"alert-info":ke(s).ui.state.isLoading,"alert-warning":ke(s).dynamodb.state.ExclusiveStartKey,"alert-success":!ke(s).dynamodb.state.ExclusiveStartKey}]),role:"alert"},[b("p",Aie,[o[1]||(o[1]=Ie(" • Items returned: ",-1)),b("strong",null,Pe(ke(s).ui.state.table.count),1),o[2]||(o[2]=Ie(" • Items scanned: ",-1)),b("strong",null,Pe(ke(s).ui.state.table.scannedCount),1),o[3]||(o[3]=Ie(" • Efficiency: ",-1)),b("strong",null,Pe(ke(s).ui.state.table.scannedCount?Number(ke(s).ui.state.table.count/ke(s).ui.state.table.scannedCount*100).toFixed(2):"100.00"),1),o[4]||(o[4]=Ie(" % ",-1))]),ke(s).dynamodb.state.ExclusiveStartKey?(ue(),ye("div",kie,[b("button",{type:"button",disabled:i.disabled,class:"btn btn-outline-secondary btn-sm rounded-0 ms-3",onClick:o[0]||(o[0]=Qs(l=>t("next"),["prevent"]))}," Retrieve next page ",8,Tie)])):st("",!0)],2))}}),Rie={class:"px-4 mt-4 d-flex justify-content-between"},Mie={class:"mb-0"},Die={class:"text-muted"},Lie={key:0,class:"spinner-border spinner-border-sm ms-3",role:"status"},Nie={class:"d-flex"},Iie={class:"dropdown ms-3"},Pie={class:"dropdown-menu rounded-0"},$ie={class:"toast-container position-fixed bottom-0 end-0 p-3",style:{"z-index":"1500"}},Bie={class:"toast-header"},Fie={class:"me-auto"},Vie={key:0,class:"bi bi-check-circle-fill text-success me-2"},Wie={class:"toast-body"},Hie={class:"d-flex align-items-center"},Uie={class:"flex-grow-1 me-3"},zie={class:"progress",style:{height:"5px"}},qie=["aria-valuenow"],Kie={class:"text-muted"},jie={class:"mt-2 text-muted small"},Gie={key:0},Yie={key:1},Xie=Bn({__name:"table-actions",props:{tableRef:{type:Object,required:!0}},emits:["action"],setup(n,{emit:e}){const t=Vt("store"),s=e,i=er(),r=n,o=at(()=>t.ui.state.table.rows),l=at(()=>t.ui.state.table.selectedRows),c=De(null),f=De(null),h=De(!1),d=De(0),g=De(""),m=De(!1),y=at(()=>t.table?.Table?.TableName||i.query.tableName?.toString()),w=at(()=>l.value>0?l.value:o.value.length),x=C=>{if(C===0)return"0 Bytes";const E=1024,k=["Bytes","KB","MB","GB"],R=Math.floor(Math.log(C)/Math.log(E));return parseFloat((C/Math.pow(E,R)).toFixed(2))+" "+k[R]};Si(()=>{c.value&&(f.value=new en(c.value,{autohide:!1}))});const S=async()=>{h.value=!0,d.value=0,m.value=!1,f.value?.show();const C=setInterval(()=>{d.value<90&&(d.value+=10)},100);try{const E=r.tableRef.selectedItems||[],k=E.length>0?E:o.value,R=JSON.stringify(k,null,2),T="data:application/json;charset=utf-8,"+encodeURIComponent(R),L=`${y.value}_data.json`,N=new Blob([R],{type:"application/json"});g.value=x(N.size);const F=document.createElement("a");F.setAttribute("href",T),F.setAttribute("download",L),d.value=100,m.value=!0,clearInterval(C),setTimeout(()=>{F.click(),setTimeout(()=>{f.value?.hide(),h.value=!1,d.value=0,g.value="",m.value=!1},3e3)},500)}catch(E){console.error("Download failed:",E),clearInterval(C),h.value=!1,d.value=0,g.value="",m.value=!1,f.value?.hide()}};return(C,E)=>{const k=sc("RouterLink");return ue(),ye(gt,null,[b("div",Rie,[b("h5",Mie,[E[3]||(E[3]=Ie(" Items returned ",-1)),b("span",Die,"("+Pe(o.value.length)+")",1),ke(t).ui.state.isLoading?(ue(),ye("div",Lie,[...E[2]||(E[2]=[b("span",{class:"visually-hidden"},"Loading...",-1)])])):st("",!0)]),b("div",Nie,[b("div",Iie,[E[4]||(E[4]=b("button",{class:"ms-3 btn btn-outline-primary dropdown-toggle btn-sm rounded-0",type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"}," Actions ",-1)),b("ul",Pie,[b("li",null,[b("a",{href:"#",class:"dropdown-item",onClick:E[0]||(E[0]=Qs(R=>s("action","EDIT"),["prevent"]))}," Edit Items "),b("a",{href:"#",class:"dropdown-item",onClick:E[1]||(E[1]=Qs(R=>s("action","DELETE"),["prevent"]))}," Delete Items "),b("a",{href:"#",class:"dropdown-item",onClick:Qs(S,["prevent"])}," Download as JSON ")])])]),y.value?(ue(),So(k,{key:0,to:{name:"create-item",params:{tableName:y.value}}},{default:qs(()=>[...E[5]||(E[5]=[b("button",{type:"button",class:"ms-2 btn btn-outline-primary btn-sm rounded-0"}," Create Item ",-1)])]),_:1},8,["to"])):st("",!0)])]),b("div",$ie,[b("div",{id:"downloadToast",class:"toast",role:"alert","aria-live":"assertive","aria-atomic":"true",ref_key:"downloadToastRef",ref:c},[b("div",Bie,[b("strong",Fie,[m.value?(ue(),ye("i",Vie)):st("",!0),Ie(" "+Pe(m.value?"Download Complete":"Downloading Data"),1)]),b("small",null,Pe(w.value)+" "+Pe(w.value===1?"item":"items"),1),E[6]||(E[6]=b("button",{type:"button",class:"btn-close","data-bs-dismiss":"toast","aria-label":"Close"},null,-1))]),b("div",Wie,[b("div",Hie,[b("div",Uie,[b("div",zie,[b("div",{class:Pt(["progress-bar",{"progress-bar-striped progress-bar-animated":!m.value,"bg-success":m.value}]),role:"progressbar",style:Hi({width:d.value+"%"}),"aria-valuenow":d.value,"aria-valuemin":"0","aria-valuemax":"100"},null,14,qie)])]),b("small",Kie,Pe(d.value)+"%",1)]),b("div",jie,[g.value?(ue(),ye("span",Gie,"File size: "+Pe(g.value),1)):(ue(),ye("span",Yie,"Preparing download..."))])])],512)])],64)}}}),Qie=tr(Xie,[["__scopeId","data-v-36d0b159"]]),Jie={class:"d-flex align-items-center justify-content-end"},Zie={"aria-label":"Page navigation example"},ere={class:"pagination pagination-sm m-0"},tre={class:"dropdown ms-3"},nre={class:"btn btn-secondary dropdown-toggle btn-sm rounded-0",type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},sre={class:"dropdown-menu rounded-0"},ire=Bn({__name:"table-paginate",emits:["next"],setup(n,{emit:e}){const t=e,s=er(),i=Vt("store"),r=at(()=>i.ui.state.table.rows),o=at(()=>i.dynamodb.state.Limit),l=at(()=>Math.ceil(r.value.length/o.value));return(c,f)=>{const h=sc("RouterLink");return ue(),ye("div",Jie,[b("nav",Zie,[b("ul",ere,[(ue(!0),ye(gt,null,mn(l.value,d=>(ue(),ye("li",{class:"page-item",key:d},[mt(h,{class:Pt(["page-link rounded-0",{active:ke(i).ui.state.table.page===d,disabled:ke(i).ui.state.isLoading}]),to:{name:"home",query:{...ke(s).query,page:d}}},{default:qs(()=>[Ie(Pe(d),1)]),_:2},1032,["class","to"])]))),128)),ke(i).dynamodb.state.ExclusiveStartKey?(ue(),ye("li",{key:0,class:Pt(["page-item",{disabled:ke(i).ui.state.isLoading}])},[b("a",{class:"page-link rounded-0",href:"#",onClick:f[0]||(f[0]=Qs(d=>t("next"),["prevent"]))}," ... ")],2)):st("",!0)])]),b("div",tre,[b("button",nre,Pe(o.value)+" items ",1),b("ul",sre,[(ue(),ye(gt,null,mn([10,25,50,100,200,300,500],d=>b("li",{key:d},[mt(h,{class:Pt(["dropdown-item",{active:d===ke(i).dynamodb.state.Limit}]),to:{name:"home",query:{...ke(s).query,limit:d}}},{default:qs(()=>[Ie(Pe(d)+" items ",1)]),_:2},1032,["to","class"])])),64))])])])}}}),rre={class:"row"},ore={class:"col-xl-2 col-lg-3 col-4 mb-4"},lre={class:"col-xl-10 col-lg-9 col-8"},are={class:"d-flex justify-content-between"},cre={class:"mb-4"},ure={class:"fs-6"},fre={class:"dropdown-menu rounded-0"},hre={class:"table-container bg-white shadow-sm"},dre={class:"d-flex justify-content-between align-items-center px-4 py-3"},pre={class:"d-flex"},mre={key:0},gre={key:0},bre={key:1},yre={key:1,class:"ms-3"},vre={key:0},wre={key:1},Sre={class:"modal-dialog modal-dialog-centered"},xre={class:"modal-content"},_re={class:"modal-body"},Ere={class:"mb-0"},Cre={class:"modal-footer"},Are=["disabled"],kre={key:0,class:"spinner-grow spinner-grow-sm",role:"status","aria-hidden":"true"},Tre={class:"modal-dialog modal-dialog-centered"},Ore={class:"modal-content"},Rre={class:"modal-body"},Mre={class:"mb-0"},Dre={class:"modal-footer"},Lre=["disabled"],Nre={key:0,class:"spinner-grow spinner-grow-sm",role:"status","aria-hidden":"true"},Ire={class:"toast-container position-fixed top-0 start-50 translate-middle-x p-3"},Pre={class:"d-flex"},$re={class:"toast-body"},Bre=Bn({__name:"HomeTable",setup(n){const e=er(),t=_i(),s=Vt("store"),i=De(null),r=Wt({className:"text-bg-danger",message:""}),o=De({clear:()=>{},selectedItem:[]}),l=Wt({count:0,isSelected:!1}),c=De(""),f=at(()=>s.ui.state.table.rows),h=at(()=>s.dynamodb.state.Limit),d=at(()=>Math.ceil(f.value.length/h.value)),g=async()=>{l.count-0,l.isSelected=!1;const R=s.dynamodb.state,T=s.table.state.Table,L=s.ui.state.table.rows;let N;try{e.query.operation==="QUERY"?N=await nne(T.TableName,R):N=await sne(T.TableName,R),s.dynamodb.setters.init({...R,...N}),s.ui.setters.setTable(T,[...L,...N.Items],N.Count,N.ScannedCount)}catch(F){r.className="text-bg-danger",r.message=F.response.data.message??F.message;const ee=new en(i.value,{delay:5e3});setTimeout(()=>ee.show(),0)}};of(async()=>{const R={...e.query},{searchParams:T}=new URL(window.location.toString()),L=T.get("page"),N=T.get("limit"),F=T.get("tableName"),ee=await TG(),ce=parseInt(L??"1"),ne=parseInt(N??"50"),pe=F??ee[0],Y=T.get("operation"),q=T.get("indexName"),J=await hl(pe),Se=["SCAN","QUERY"].includes(Y??"")?Y:"SCAN",H=J.GlobalSecondaryIndexes?.map(({IndexName:Z})=>Z).includes(q)?q:pe;let ge=T.get("parameters")?.toString()??null;try{JSON.parse(decodeURIComponent(ge))}catch{delete R.parameters,ge=null}t.push({name:"home",query:{...R,page:ce,limit:ne,tableName:pe,indexName:H,operation:Se,parameters:ge}}),s.table.setters.setTableNames(ee)}),Os(()=>[e.query.tableName,e.query.limit,e.query.page,e.query.parameters,e.query.indexName,e.query.requestId],async([R,T,L,N,F,ee],ce)=>{if(l.count-0,l.isSelected=!1,!R)return;const[ne,pe,Y,q,J,Se]=ce??[];if(R!==ne){s.dynamodb.setters.init({}),s.ui.setters.setTable({},[]),c.value=R?.toString();try{const H=await hl(R.toString());s.table.setters.setTable(H)}catch{window.location.href="/"}}if(N||s.dynamodb.setters.reset(),q!==N||J!==F||Se!==ee){const H=JSON.parse(decodeURIComponent(N?.toString()??"{}"));({...s.dynamodb.state});const ge=zT({parameters:H,table:s.table.state.Table,indexName:F});s.ui.setters.setTable({},[]),s.dynamodb.setters.init({...ge})}{if(!(T&&L))return;const H=parseInt(T.toString()),ge=parseInt(L.toString());if(s.ui.setters.setPage(ge),s.dynamodb.setters.setLimit(H),d.value>=ge)return;let Z=0;s.dynamodb.state.ExclusiveStartKey||s.ui.setters.setTable({},[]);do if(Z++,await g(),!s.dynamodb.state.ExclusiveStartKey)break;while(Z<ge);ge>Z&&t.push({name:"home",query:{...e.query,page:Z}})}},{immediate:!0});const m=De(""),y=De(null),w=De(null),x=De(null),S=De(null),C=async()=>{try{await DG(c.value),y.value?.hide(),window.location.href="/"}catch(R){r.className="text-bg-danger",r.message=R.response.data.message??R.message;const T=new en(i.value,{delay:5e3});setTimeout(()=>T.show(),0)}},E=async()=>{try{await LG(c.value);const R=await hl(c.value);s.table.setters.setTable(R),s.ui.setters.setTable({},[]),s.ui.setters.setPage(1),s.dynamodb.setters.setExclusiveStartKey(null),await g(),w.value?.hide()}catch(R){r.className="text-bg-danger",r.message=R.response.data.message??R.message;const T=new en(i.value,{delay:5e3});setTimeout(()=>T.show(),0)}},k=async()=>{if(l.isSelected){l.count=0,l.isSelected=!1,o.value.clear();return}const R=s.table.state.Table,T=s.dynamodb.state;try{const L=await ine(R.TableName,T);l.count=L.Count,l.isSelected=!0}catch(L){r.className="text-bg-danger",r.message=L.response.data.message??L.message;const N=new en(i.value,{delay:5e3});setTimeout(()=>N.show(),0)}};return Si(()=>{y.value=new Ir(x.value,{}),w.value=new Ir(S.value,{})}),(R,T)=>{const L=sc("RouterLink");return ue(),ye("div",rre,[b("div",ore,[mt(Ose,{activeTableName:c.value},null,8,["activeTableName"])]),b("div",lre,[b("div",are,[b("h3",cre,[Ie(Pe(ke(s).table.state.Table.TableName)+" ",1),b("small",ure,"("+Pe(ke(s).table.state.Table.ItemCount??0)+")",1)]),b("div",null,[T[10]||(T[10]=b("button",{class:"ms-3 btn btn-outline-primary dropdown-toggle btn-sm rounded-0",type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"}," Actions ",-1)),b("ul",fre,[b("li",null,[b("a",{href:"#",class:"dropdown-item",onClick:T[0]||(T[0]=Qs(()=>{},["prevent"])),"data-bs-toggle":"modal","data-bs-target":"#delete-table-modal"}," Delete Table "),b("a",{href:"#",class:"dropdown-item",onClick:T[1]||(T[1]=Qs(()=>{},["prevent"])),"data-bs-toggle":"modal","data-bs-target":"#truncate-table-modal"}," Truncate Table "),c.value?(ue(),So(L,{key:0,class:"dropdown-item",to:{name:"edit-table",params:{tableName:c.value}}},{default:qs(()=>[...T[5]||(T[5]=[Ie(" Create/Delete Index ",-1)])]),_:1},8,["to"])):st("",!0),c.value?(ue(),So(L,{key:1,class:"dropdown-item",to:{name:"table-schema",params:{tableName:c.value}}},{default:qs(()=>[...T[6]||(T[6]=[Ie(" View Table Schema ",-1)])]),_:1},8,["to"])):st("",!0),c.value?(ue(),So(L,{key:2,class:"dropdown-item",to:{name:"table-ttl",params:{tableName:c.value}}},{default:qs(()=>[...T[7]||(T[7]=[Ie(" Time to Live (TTL) ",-1)])]),_:1},8,["to"])):st("",!0)])]),mt(L,{to:"/table/create-table"},{default:qs(()=>[...T[8]||(T[8]=[b("button",{class:"btn btn-outline-primary btn-sm rounded-0 ms-2"},"Create Table",-1)])]),_:1}),mt(L,{to:"/table/restore-tables"},{default:qs(()=>[...T[9]||(T[9]=[b("button",{class:"btn btn-outline-primary btn-sm rounded-0 ms-2"},"Restore Tables",-1)])]),_:1})])]),T[13]||(T[13]=b("br",null,null,-1)),mt(Cie),T[14]||(T[14]=b("br",null,null,-1)),b("div",hre,[mt(bse,{ref_key:"tableRef",ref:o,action:m.value,onReset:T[3]||(T[3]=N=>m.value=""),count:l.count,isSelected:l.isSelected,onUnselect:T[4]||(T[4]=N=>{l.count=0,l.isSelected=!1})},{default:qs(()=>[T[12]||(T[12]=b("br",null,null,-1)),mt(Oie,{disabled:ke(s).ui.state.isLoading,onNext:g},null,8,["disabled"]),mt(Qie,{onAction:T[2]||(T[2]=N=>m.value=N),"table-ref":o.value},null,8,["table-ref"]),b("div",dre,[b("div",pre,[ke(s).ui.state.table.selectedRows>0?(ue(),ye("div",mre,[b("strong",null,Pe(l.isSelected?`${l.count} `:`${ke(s).ui.state.table.selectedRows} `),1),ke(s).ui.state.table.selectedRows>1?(ue(),ye("span",gre,"items")):(ue(),ye("span",bre,"item")),T[11]||(T[11]=Ie(" selected ",-1))])):st("",!0),ke(s).ui.state.table.selectedRows>0&&(ke(s).ui.state.table.count!==ke(s).ui.state.table.selectedRows||ke(s).dynamodb.state.ExclusiveStartKey)?(ue(),ye("div",yre,[b("button",{class:"btn btn-outline-primary py-0 px-2",onClick:k},[l.isSelected?(ue(),ye("span",vre,"Clear selection")):(ue(),ye("span",wre,"Select all items"))])])):st("",!0)]),mt(ire,{onNext:g})])]),_:1},8,["action","count","isSelected"])])]),b("div",{id:"truncate-table-modal",class:"modal",tabindex:"-1",ref_key:"truncateModalRef",ref:S},[b("div",Sre,[b("div",xre,[T[20]||(T[20]=b("div",{class:"modal-header"},[b("h5",{class:"modal-title"},"Truncate table"),b("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),b("div",_re,[b("p",Ere,[T[15]||(T[15]=Ie(" You are about to truncate ",-1)),b("b",null,Pe(c.value),1),T[16]||(T[16]=Ie(" table. ",-1))])]),b("div",Cre,[T[19]||(T[19]=b("button",{type:"button",class:"btn btn-secondary rounded-0","data-bs-dismiss":"modal"}," Cancel ",-1)),b("button",{class:"btn btn-danger rounded-0",type:"button",disabled:ke(s).ui.state.isLoading,onClick:E},[ke(s).ui.state.isLoading?(ue(),ye("span",kre)):st("",!0),T[17]||(T[17]=b("span",{class:"visually-hidden"},"Loading...",-1)),T[18]||(T[18]=Ie(" Truncate Table ",-1))],8,Are)])])])],512),b("div",{id:"delete-table-modal",class:"modal",tabindex:"-1",ref_key:"deleteModalRef",ref:x},[b("div",Tre,[b("div",Ore,[T[26]||(T[26]=b("div",{class:"modal-header"},[b("h5",{class:"modal-title"},"Delete table"),b("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),b("div",Rre,[b("p",Mre,[T[21]||(T[21]=Ie(" You are about to delete ",-1)),b("b",null,Pe(c.value),1),T[22]||(T[22]=Ie(" table. ",-1))])]),b("div",Dre,[T[25]||(T[25]=b("button",{type:"button",class:"btn btn-secondary rounded-0","data-bs-dismiss":"modal"}," Cancel ",-1)),b("button",{class:"btn btn-danger rounded-0",type:"button",disabled:ke(s).ui.state.isLoading,onClick:C},[ke(s).ui.state.isLoading?(ue(),ye("span",Nre)):st("",!0),T[23]||(T[23]=b("span",{class:"visually-hidden"},"Loading...",-1)),T[24]||(T[24]=Ie(" Delete Table ",-1))],8,Lre)])])])],512),b("div",Ire,[b("div",{class:Pt(["toast align-items-center border-0",r.className]),role:"alert","aria-live":"assertive","aria-atomic":"true",ref_key:"toastRef",ref:i},[b("div",Pre,[b("div",$re,Pe(r.message),1),T[27]||(T[27]=b("button",{type:"button",class:"btn-close btn-close-white me-2 m-auto","data-bs-dismiss":"toast","aria-label":"Close"},null,-1))])],2)])])}}}),hk=tr(Bre,[["__scopeId","data-v-862fa9c6"]]),Fre={setup(){let n;const e=De("{}"),t=De("{}"),s=De(""),i=De(!0),r=De(!0),o=Wt({className:"text-bg-success",message:"The item has been saved successfully."}),l=er(),c=_i(),f=De(null),h=De(null),d=Vt("store"),g=()=>{window.history.length>1?c.back():c.push({name:"home"})},m=(x,S)=>{const C={};try{const E=JSON.parse(x),k=JSON.parse(S);Object.keys(E).forEach(T=>C[T]=k[T])}catch{}return C},y=async()=>{const S=d.table.state.Table.TableName;try{await cne(S,JSON.parse(t.value)),o.className="text-bg-success",o.message="The item has been saved successfully.",setTimeout(()=>{c.replace({name:"edit-item",params:{tableName:S},query:m(e.value,t.value)})},250)}catch(C){o.className="text-bg-danger",o.message=C.response.data.message??C.message}finally{const C=new en(h.value,{delay:5e3});setTimeout(()=>C.show(),0)}};Os([e,t],([x,S])=>{r.value=!1,s.value="";try{const C=JSON.parse(S),E=JSON.parse(x);r.value=!0,i.value=!0,Object.keys(E).forEach(k=>i.value&=Object.keys(C).includes(k))}catch(C){r.value=!1,s.value=C.message}}),Si(async()=>{n=Mm(f,t),await w(),n.dispatch({changes:{from:0,to:n.state.doc.length,insert:e.value+`






















`}})});const w=async()=>{const{tableName:x}=l.params,S=await hl(x),{KeySchema:C,AttributeDefinitions:E}=S,k={};C.forEach(({AttributeName:R})=>{const{AttributeType:T}=E.find(L=>L.AttributeName===R);k[R]=T==="S"?"":0}),e.value=JSON.stringify(k,null,2),d.table.setters.setTable(S)};return{store:d,textAreaRef:f,isValid:r,hasKeys:i,toast:o,toastRef:h,cancel:g,create:y,errorMsg:s}}},Vre={class:"row"},Wre={class:"col-12 col-xl-8",id:"edit-item"},Hre={class:"vh-60"},Ure={ref:"textAreaRef"},zre={key:0,class:"alert alert-danger rounded-0",role:"alert"},qre={key:1,class:"alert alert-primary rounded-0",role:"alert"},Kre={class:"d-flex justify-content-end"},jre=["disabled"],Gre={key:0,class:"spinner-grow spinner-grow-sm",role:"status","aria-hidden":"true"},Yre={class:"toast-container position-fixed top-0 start-50 translate-middle-x p-3"},Xre={class:"d-flex"},Qre={class:"toast-body"};function Jre(n,e,t,s,i,r){return ue(),ye("div",Vre,[b("div",Wre,[e[5]||(e[5]=b("h3",null,"Create item",-1)),e[6]||(e[6]=b("p",null," You can add, remove, or edit the attributes of an item. You can nest attributes inside other attributes up to 32 levels deep. ",-1)),b("div",Hre,[b("textarea",Ure,null,512)]),s.errorMsg?(ue(),ye("div",zre,Pe(s.errorMsg),1)):st("",!0),s.hasKeys?st("",!0):(ue(),ye("div",qre," You must provide the partition key attribute with a non-empty value. ")),e[7]||(e[7]=b("br",null,null,-1)),e[8]||(e[8]=b("br",null,null,-1)),e[9]||(e[9]=b("br",null,null,-1)),b("div",Kre,[b("button",{class:"btn btn-primary rounded-0",type:"button",disabled:!s.isValid||!s.hasKeys||s.store.ui.state.isLoading,onClick:e[0]||(e[0]=(...o)=>s.create&&s.create(...o))},[s.store.ui.state.isLoading?(ue(),ye("span",Gre)):st("",!0),e[2]||(e[2]=b("span",{class:"visually-hidden"},"Loading...",-1)),e[3]||(e[3]=Ie(" Create Item ",-1))],8,jre),b("button",{type:"button",class:"btn btn-secondary rounded-0 ms-2",onClick:e[1]||(e[1]=(...o)=>s.cancel&&s.cancel(...o))}," Cancel ")]),b("div",Yre,[b("div",{class:Pt(["toast align-items-center border-0",s.toast.className]),role:"alert","aria-live":"assertive","aria-atomic":"true",ref:"toastRef"},[b("div",Xre,[b("div",Qre,Pe(s.toast.message),1),e[4]||(e[4]=b("button",{type:"button",class:"btn-close btn-close-white me-2 m-auto","data-bs-dismiss":"toast","aria-label":"Close"},null,-1))])],2)])])])}const Zre=tr(Fre,[["render",Jre]]),eoe={class:"row"},toe={class:"col-12 col-xl-11"},noe={class:"mb-3"},soe={class:"card rounded-0 border-0 shadow-sm"},ioe={class:"card-body border-0"},roe={class:"col-lg-3 col-xl-2 mb-2"},ooe=["onUpdate:modelValue","disabled"],loe={class:"col-lg-3 col-xl-2 mb-2"},aoe=["onUpdate:modelValue","disabled"],coe={class:"col-lg-3 col-xl-2 mb-2"},uoe=["onUpdate:modelValue","disabled"],foe={class:"col-lg-3 col-xl-2 mb-2"},hoe=["onUpdate:modelValue","disabled"],doe={class:"col-lg-3 col-xl-2 mb-2"},poe=["onUpdate:modelValue","disabled"],moe={class:"col-xl-1 mb-2"},goe=["onClick"],boe={class:"bg-white p-4 shadow-sm"},yoe={class:"mb-0"},voe={class:"d-flex justify-content-end"},woe={key:0,class:"spinner-grow spinner-grow-sm me-1",role:"status","aria-hidden":"true"},Soe={class:"toast-container position-fixed top-0 start-50 translate-middle-x p-3"},xoe={class:"d-flex"},_oe={class:"toast-body"},Eoe=Bn({__name:"EditTable",setup(n){const e=er(),t=_i(),s=Vt("store");of(async()=>{try{const m=await hl(e.params.tableName.toString());s.table.setters.setTable(m),i.indices=(m.GlobalSecondaryIndexes??[]).map(({IndexName:y="",KeySchema:w=[]})=>{const x=w.find(({KeyType:k})=>k==="HASH"),S=w.find(({KeyType:k})=>k==="RANGE"),C=m.AttributeDefinitions.find(({AttributeName:k})=>x?.AttributeName===k),E=m.AttributeDefinitions.find(({AttributeName:k})=>S?.AttributeName===k);return{type:"GSI",name:y,readOnly:!0,pk:{name:C?.AttributeName??"",type:C?.AttributeType??""},sk:{name:E?.AttributeName??"",type:E?.AttributeType??""}}})}catch{window.location.href="/"}});const i=Wt({indices:[],deleteIndices:[]}),r=()=>{window.history.length>1?t.back():t.push({name:"home"})},o=()=>{i.indices=[]},l=De(),c=Wt({className:"",message:""}),f=async()=>{try{await NG(e.params.tableName,g.value),o(),c.className="text-bg-success",c.message="The table has been updated successfully.",setTimeout(r,250)}catch(m){c.className="text-bg-danger",c.message=m.response?.data?.message??m.message}finally{const m=new en(l.value,{delay:1e3});setTimeout(()=>m.show(),0)}},h=(m=!1,y)=>{m&&i.deleteIndices.push(i.indices[y]?.name),i.indices.splice(y,1)},d=()=>{i.indices.push({type:"GSI",name:"",pk:{name:"",type:"S"},sk:{name:"",type:"S"}})},g=at(()=>cH(i));return(m,y)=>(ue(),ye("div",eoe,[b("div",toe,[b("h3",noe,"Edit "+Pe(ke(e).params.tableName),1),b("div",soe,[y[9]||(y[9]=b("div",{class:"card-header py-3 border-0"},[b("h4",{class:"mb-1"},"Secondary indexes"),b("small",null," Use secondary indexes to perform queries on attributes that are not part of your table's primary key. "),b("ul",null,[b("li",null,[b("small",null," A local secondary index has the same partition key as its base table, but it has a different sort key. ")]),b("li",null,[b("small",null," Create global secondary indexes to query attributes outside the primary key of your original table. ")])])],-1)),b("div",ioe,[(ue(!0),ye(gt,null,mn(i.indices,(w,x)=>(ue(),ye("div",{class:"row mb-4",key:x},[y[8]||(y[8]=Wd('<div class="col-lg-3 col-xl-1 mb-2"><label class="form-label"> Index Type <br></label><select class="rounded-0 form-select" value="GSI" disabled><option value="GSI">GSI   (Global Secondary Index)</option><option value="LSI">LSI   (Local Secondary Index)</option></select></div>',1)),b("div",roe,[y[0]||(y[0]=b("label",{class:"form-label"},[Ie(" Index Name "),b("br")],-1)),Ye(b("input",{type:"text",class:"form-control rounded-0",placeholder:"Enter the partition key name","onUpdate:modelValue":S=>w.name=S,disabled:w.readOnly},null,8,ooe),[[Rt,w.name]])]),b("div",loe,[y[1]||(y[1]=b("label",{class:"form-label"},[Ie(" Partition key "),b("br")],-1)),Ye(b("input",{type:"text",class:"form-control rounded-0",placeholder:"Enter the partition key name","onUpdate:modelValue":S=>w.pk.name=S,disabled:w.type==="LSI"||w.readOnly},null,8,aoe),[[Rt,w.pk.name]])]),b("div",coe,[y[3]||(y[3]=b("label",{class:"form-label"},[Ie(" Partition key type "),b("br")],-1)),Ye(b("select",{class:"rounded-0 form-select","onUpdate:modelValue":S=>w.pk.type=S,disabled:w.type==="LSI"||w.readOnly},[...y[2]||(y[2]=[b("option",{value:"S"},"String",-1),b("option",{value:"N"},"Number",-1),b("option",{value:"B"},"Binary",-1)])],8,uoe),[[Fi,w.pk.type]])]),b("div",foe,[y[4]||(y[4]=b("label",{class:"form-label"},[Ie(" Sort key - optional "),b("br")],-1)),Ye(b("input",{type:"text",class:"form-control rounded-0",placeholder:"Enter the sort key name","onUpdate:modelValue":S=>w.sk.name=S,disabled:w.readOnly},null,8,hoe),[[Rt,w.sk.name]])]),b("div",doe,[y[6]||(y[6]=b("label",{class:"form-label"},[Ie(" Sort key type "),b("br")],-1)),Ye(b("select",{class:"rounded-0 form-select","onUpdate:modelValue":S=>w.sk.type=S,disabled:w.readOnly},[...y[5]||(y[5]=[b("option",{value:"S"},"String",-1),b("option",{value:"N"},"Number",-1),b("option",{value:"B"},"Binary",-1)])],8,poe),[[Fi,w.sk.type]])]),b("div",moe,[y[7]||(y[7]=b("label",{class:"form-label text-white d-none d-xl-block"},"--",-1)),b("button",{class:"btn btn-outline-secondary rounded-0",onClick:S=>h(w.readOnly,x)}," Remove ",8,goe)])]))),128)),!i.indices.length||i.indices.filter(({readOnly:w})=>!w).length===0?(ue(),ye("button",{key:0,class:"btn btn-outline-secondary rounded-0 my-3",onClick:d}," Add Secondary Index ")):st("",!0)])]),y[12]||(y[12]=b("br",null,null,-1)),b("div",boe,[b("code",null,[b("pre",yoe,Pe(g.value),1)])]),y[13]||(y[13]=b("br",null,null,-1)),b("div",voe,[b("button",{type:"button",class:"btn btn-secondary rounded-0 me-2",onClick:r}," Cancel "),b("button",{class:"btn btn-primary rounded-0",type:"button",onClick:f},[ke(s).ui.state.isLoading?(ue(),ye("span",woe)):st("",!0),y[10]||(y[10]=b("span",{class:"visually-hidden"},"Loading...",-1)),y[11]||(y[11]=Ie(" Update Index ",-1))])])]),b("div",Soe,[b("div",{class:Pt(["toast align-items-center border-0",c.className]),role:"alert","aria-live":"assertive","aria-atomic":"true",ref_key:"toastRef",ref:l},[b("div",xoe,[b("div",_oe,Pe(c.message),1),y[14]||(y[14]=b("button",{type:"button",class:"btn-close btn-close-white me-2 m-auto","data-bs-dismiss":"toast","aria-label":"Close"},null,-1))])],2)])]))}}),Coe={class:"row"},Aoe={class:"col-12 col-xl-11"},koe={class:"mb-3"},Toe={class:"card rounded-0 border-0 shadow-sm"},Ooe={class:"toast-container position-fixed top-0 start-50 translate-middle-x p-3"},Roe={class:"d-flex"},Moe={class:"toast-body"},Doe=Bn({__name:"TableSchema",setup(n){const e=er(),t=_i(),s=De(null),i=De("{}"),r=De(null);Si(async()=>{try{const c=Mm(r,{}),f=await hl(e.params.tableName.toString());i.value=JSON.stringify({Table:f},null,2),c.dispatch({changes:{from:0,to:c.state.doc.length,insert:i.value+`




`}})}catch{window.location.href="/"}});const o=()=>{window.history.length>1?t.back():t.push({name:"home"})},l=()=>{navigator.clipboard.writeText(i.value);const c=new en(s.value,{delay:5e3});setTimeout(()=>c.show(),0)};return(c,f)=>(ue(),ye("div",Coe,[b("div",Aoe,[b("h3",koe,Pe(ke(e).params.tableName)+" Description",1),b("div",Toe,[f[0]||(f[0]=Wd('<div class="card-header py-3 border-0"><h4 class="mb-1">Getting information about a table</h4><small> DynamoDB tables are schemaless—other than the primary key, you do not need to define any extra attributes or data types when you create a table. </small><div class="row"><div class="col-6"><ul><li><small>TableName – Name of the table.</small></li><li><small> KeySchema – Attributes that are used for the primary key. For more information, see Tables, items, and attributes and Primary key. </small></li></ul></div><div class="col-6"><ul><li><small>AttributeDefinitions – Data types for the key schema attributes.</small></li><li><small> ProvisionedThroughput (for provisioned tables) – Number of reads and writes per second that you need for this table. </small></li></ul></div></div></div>',1)),b("textarea",{ref_key:"textAreaRef",ref:r},null,512)]),f[2]||(f[2]=b("br",null,null,-1)),b("div",{class:"d-flex justify-content-end"},[b("button",{type:"button",class:"btn btn-secondary rounded-0 me-2",onClick:o}," Cancel "),b("button",{class:"btn btn-primary rounded-0",type:"button",onClick:l},[...f[1]||(f[1]=[b("i",{class:"bi bi-clipboard2 me-2"},null,-1),Ie(" Copy to Clipboard ",-1)])])])]),b("div",Ooe,[b("div",{class:"toast align-items-center border-0 text-bg-success",role:"alert","aria-live":"assertive","aria-atomic":"true",ref_key:"toastRef",ref:s},[b("div",Roe,[b("div",Moe,Pe(ke(e).params.tableName)+" Schema copied to clipboard",1),f[3]||(f[3]=b("button",{type:"button",class:"btn-close btn-close-white me-2 m-auto","data-bs-dismiss":"toast","aria-label":"Close"},null,-1))])],512)])]))}}),Loe={class:"row"},Noe={class:"col-12 col-xl-11"},Ioe={class:"card rounded-0 border-0 shadow-sm"},Poe={class:"card-body border-0"},$oe={class:"mb-3"},Boe={class:"row"},Foe={class:"col-xl-4"},Voe={class:"row mb-4"},Woe={class:"col-xl-3 mb-1"},Hoe={class:"col-xl-2 mb-1"},Uoe={class:"row"},zoe={class:"col-xl-3 mb-1"},qoe={class:"col-xl-2 mb-1"},Koe={class:"card rounded-0 border-0 shadow-sm"},joe={class:"card-body border-0"},Goe={class:"mb-3"},Yoe={class:"row"},Xoe={class:"col-lg-3 mb-2"},Qoe={class:"col-lg-3"},Joe={class:"card rounded-0 border-0 shadow-sm"},Zoe={class:"card-body border-0"},ele={class:"col-lg-3 col-xl-1 mb-2"},tle=["onUpdate:modelValue"],nle={class:"col-lg-3 col-xl-2 mb-2"},sle=["onUpdate:modelValue"],ile={class:"col-lg-3 col-xl-2 mb-2"},rle=["onUpdate:modelValue","disabled"],ole={class:"col-lg-3 col-xl-2 mb-2"},lle=["onUpdate:modelValue","disabled"],ale={class:"col-lg-3 col-xl-2 mb-2"},cle=["onUpdate:modelValue"],ule={class:"col-lg-3 col-xl-2 mb-2"},fle=["onUpdate:modelValue"],hle={class:"col-xl-1 mb-2"},dle=["onClick"],ple={class:"bg-white p-4 shadow-sm"},mle={class:"mb-0"},gle={class:"d-flex justify-content-end"},ble={key:0,class:"spinner-grow spinner-grow-sm me-1",role:"status","aria-hidden":"true"},yle={class:"toast-container position-fixed top-0 start-50 translate-middle-x p-3"},vle={class:"d-flex"},wle={class:"toast-body"},Sle=Bn({__name:"CreateTable",setup(n){const e=Vt("store");Si(()=>{e.table.setters.setTable({TableName:"Create Table"})});const t=Wt({name:"",keySchema:{pk:{name:"",type:"S"},sk:{name:"",type:"S"}},throughput:{read:5,write:5},indices:[]}),s=_i(),i=()=>{t.name="",t.keySchema={pk:{name:"",type:"S"},sk:{name:"",type:"S"}},t.throughput={read:5,write:5},t.indices=[]},r=De(),o=Wt({className:"",message:""}),l=at(()=>uH(t)),c=async()=>{try{await MG(l.value),i(),o.className="text-bg-success",o.message="The table has been created successfully."}catch(g){o.className="text-bg-danger",o.message=g.response?.data?.message??g.message}finally{const g=new en(r.value,{delay:1e3});setTimeout(()=>g.show(),0)}},f=g=>{t.indices.splice(g,1)},h=()=>{t.indices.push({type:"GSI",name:"",pk:{name:"",type:"S"},sk:{name:"",type:"S"}})},d=()=>{window.history.length>1?s.back():s.push({name:"home"})};return(g,m)=>(ue(),ye("div",Loe,[b("div",Noe,[m[34]||(m[34]=b("h3",{class:"mb-3"},"Create table",-1)),b("div",Ioe,[m[16]||(m[16]=b("div",{class:"card-header py-3 border-0"},[b("h4",{class:"mb-1"},"Table details"),b("small",null," DynamoDB is a schemaless database that requires only a table name and a primary key when you create the table. ")],-1)),b("div",Poe,[b("div",$oe,[b("div",Boe,[b("div",Foe,[m[7]||(m[7]=b("label",{class:"form-label"},[Ie(" Table name "),b("br"),b("small",{class:"text-muted"},"This will be used to identify your table.")],-1)),Ye(b("input",{type:"text",class:"form-control rounded-0",placeholder:"Enter name for table","onUpdate:modelValue":m[0]||(m[0]=y=>t.name=y)},null,512),[[Rt,t.name]]),m[8]||(m[8]=b("div",{class:"form-text"}," Between 3 and 255 characters, containing only letters, numbers, underscores (_), hyphens (-), and periods (.). ",-1))])]),m[13]||(m[13]=b("hr",null,null,-1)),m[14]||(m[14]=b("label",{class:"form-label"},[Ie(" Partition key "),b("br"),b("small",{class:"text-muted"}," The partition key is part of the table's primary key. It is a hash value that is used to retrieve items from your table and allocate data across hosts for scalability and availability. ")],-1)),b("div",Voe,[b("div",Woe,[Ye(b("input",{type:"text",class:"form-control rounded-0",placeholder:"Enter the partition key name","onUpdate:modelValue":m[1]||(m[1]=y=>t.keySchema.pk.name=y)},null,512),[[Rt,t.keySchema.pk.name]]),m[9]||(m[9]=b("div",{class:"form-text"},"1 to 255 characters and case sensitive.",-1))]),b("div",Hoe,[Ye(b("select",{class:"rounded-0 form-select","onUpdate:modelValue":m[2]||(m[2]=y=>t.keySchema.pk.type=y)},[...m[10]||(m[10]=[b("option",{value:"S"},"String",-1),b("option",{value:"N"},"Number",-1),b("option",{value:"B"},"Binary",-1)])],512),[[Fi,t.keySchema.pk.type]])])]),m[15]||(m[15]=b("label",{class:"form-label"},[Ie(" Sort key - optional "),b("br"),b("small",{class:"text-muted"}," You can use a sort key as the second part of a table's primary key. The sort key allows you to sort or search among all items sharing the same partition key. ")],-1)),b("div",Uoe,[b("div",zoe,[Ye(b("input",{type:"text",class:"form-control rounded-0",placeholder:"Enter the sort key name","onUpdate:modelValue":m[3]||(m[3]=y=>t.keySchema.sk.name=y)},null,512),[[Rt,t.keySchema.sk.name]]),m[11]||(m[11]=b("div",{class:"form-text"},"1 to 255 characters and case sensitive.",-1))]),b("div",qoe,[Ye(b("select",{class:"rounded-0 form-select","onUpdate:modelValue":m[4]||(m[4]=y=>t.keySchema.sk.type=y)},[...m[12]||(m[12]=[b("option",{value:"S"},"String",-1),b("option",{value:"N"},"Number",-1),b("option",{value:"B"},"Binary",-1)])],512),[[Fi,t.keySchema.sk.type]])])])])])]),m[35]||(m[35]=b("br",null,null,-1)),m[36]||(m[36]=b("br",null,null,-1)),b("div",Koe,[m[19]||(m[19]=b("div",{class:"card-header py-3 border-0"},[b("h4",{class:"mb-1"},"Read/write capacity settings")],-1)),b("div",joe,[b("div",Goe,[b("div",Yoe,[b("div",Xoe,[m[17]||(m[17]=b("label",{class:"form-label"},[Ie(" Read capacity "),b("br"),b("small",{class:"text-muted"},"Provisioned capacity units")],-1)),Ye(b("input",{type:"number",min:"1",class:"form-control rounded-0",placeholder:"Enter provisioned capacity","onUpdate:modelValue":m[5]||(m[5]=y=>t.throughput.read=y)},null,512),[[Rt,t.throughput.read]])]),b("div",Qoe,[m[18]||(m[18]=b("label",{class:"form-label"},[Ie(" Write capacity "),b("br"),b("small",{class:"text-muted"},"Provisioned capacity units")],-1)),Ye(b("input",{type:"number",min:"1",class:"form-control rounded-0",placeholder:"Enter provisioned capacity","onUpdate:modelValue":m[6]||(m[6]=y=>t.throughput.write=y)},null,512),[[Rt,t.throughput.write]])])])])])]),m[37]||(m[37]=b("br",null,null,-1)),m[38]||(m[38]=b("br",null,null,-1)),b("div",Joe,[m[31]||(m[31]=b("div",{class:"card-header py-3 border-0"},[b("h4",{class:"mb-1"},"Secondary indexes"),b("small",null," Use secondary indexes to perform queries on attributes that are not part of your table's primary key. "),b("ul",null,[b("li",null,[b("small",null," A local secondary index has the same partition key as its base table, but it has a different sort key. ")]),b("li",null,[b("small",null," Create global secondary indexes to query attributes outside the primary key of your original table. ")])])],-1)),b("div",Zoe,[(ue(!0),ye(gt,null,mn(t.indices,(y,w)=>(ue(),ye("div",{class:"row mb-4",key:w},[b("div",ele,[m[21]||(m[21]=b("label",{class:"form-label"},[Ie(" Index Type "),b("br")],-1)),Ye(b("select",{class:"rounded-0 form-select","onUpdate:modelValue":x=>y.type=x},[...m[20]||(m[20]=[b("option",{value:"GSI"},"GSI   (Global Secondary Index)",-1),b("option",{value:"LSI"},"LSI   (Local Secondary Index)",-1)])],8,tle),[[Fi,y.type]])]),b("div",nle,[m[22]||(m[22]=b("label",{class:"form-label"},[Ie(" Index Name "),b("br")],-1)),Ye(b("input",{type:"text",class:"form-control rounded-0",placeholder:"Enter the partition key name","onUpdate:modelValue":x=>y.name=x},null,8,sle),[[Rt,y.name]])]),b("div",ile,[m[23]||(m[23]=b("label",{class:"form-label"},[Ie(" Partition key "),b("br")],-1)),Ye(b("input",{type:"text",class:"form-control rounded-0",placeholder:"Enter the partition key name","onUpdate:modelValue":x=>y.pk.name=x,disabled:y.type==="LSI"},null,8,rle),[[Rt,y.pk.name]])]),b("div",ole,[m[25]||(m[25]=b("label",{class:"form-label"},[Ie(" Partition key type "),b("br")],-1)),Ye(b("select",{class:"rounded-0 form-select","onUpdate:modelValue":x=>y.pk.type=x,disabled:y.type==="LSI"},[...m[24]||(m[24]=[b("option",{value:"S"},"String",-1),b("option",{value:"N"},"Number",-1),b("option",{value:"BOOL"},"Boolean",-1)])],8,lle),[[Fi,y.pk.type]])]),b("div",ale,[m[26]||(m[26]=b("label",{class:"form-label"},[Ie(" Sort key - optional "),b("br")],-1)),Ye(b("input",{type:"text",class:"form-control rounded-0",placeholder:"Enter the sort key name","onUpdate:modelValue":x=>y.sk.name=x},null,8,cle),[[Rt,y.sk.name]])]),b("div",ule,[m[28]||(m[28]=b("label",{class:"form-label"},[Ie(" Sort key type "),b("br")],-1)),Ye(b("select",{class:"rounded-0 form-select","onUpdate:modelValue":x=>y.sk.type=x},[...m[27]||(m[27]=[b("option",{value:"S"},"String",-1),b("option",{value:"N"},"Number",-1),b("option",{value:"BOOL"},"Boolean",-1)])],8,fle),[[Fi,y.sk.type]])]),b("div",hle,[m[29]||(m[29]=b("label",{class:"form-label text-white d-none d-xl-block"},"--",-1)),b("button",{class:"btn btn-outline-secondary rounded-0",onClick:x=>f(w)}," Remove ",8,dle)])]))),128)),b("button",{class:"btn btn-outline-secondary rounded-0 my-3",onClick:h}," Add Secondary Index "),m[30]||(m[30]=b("div",{class:"alert alert-info rounded-0 my-4"}," By default, the global secondary index's capacity is the same as your base table's capacity. ",-1))])]),m[39]||(m[39]=b("br",null,null,-1)),m[40]||(m[40]=b("br",null,null,-1)),b("div",ple,[b("code",null,[b("pre",mle,Pe(l.value),1)])]),m[41]||(m[41]=b("br",null,null,-1)),b("div",gle,[b("button",{type:"button",class:"btn btn-secondary rounded-0 me-2",onClick:d}," Cancel "),b("button",{class:"btn btn-primary rounded-0",type:"button",onClick:c},[ke(e).ui.state.isLoading?(ue(),ye("span",ble)):st("",!0),m[32]||(m[32]=b("span",{class:"visually-hidden"},"Loading...",-1)),m[33]||(m[33]=Ie(" Create Table ",-1))])])]),b("div",yle,[b("div",{class:Pt(["toast align-items-center border-0",o.className]),role:"alert","aria-live":"assertive","aria-atomic":"true",ref_key:"toastRef",ref:r},[b("div",vle,[b("div",wle,Pe(o.message),1),m[42]||(m[42]=b("button",{type:"button",class:"btn-close btn-close-white me-2 m-auto","data-bs-dismiss":"toast","aria-label":"Close"},null,-1))])],2)])]))}}),Cs={BEGIN:"BEGIN",SUCCESS:"SUCCESS",FAILURE:"FAILURE",END:"END",CLOSE:"CLOSE",ACK:"ACK",PROGRESS:"PROGRESS"},xle={class:"row"},_le={class:"col-12"},Ele={class:"row align-items-stretch"},Cle={class:"col-4"},Ale={class:"card rounded-0 border-0 shadow-sm h-100"},kle={class:"card-body border-0"},Tle={class:"row mb-3"},Ole={class:"row mb-3"},Rle={class:"row mb-3"},Mle={class:"row mb-3"},Dle={class:"row mb-3"},Lle={class:"d-flex justify-content-end mt-5"},Nle={class:"btn btn-primary rounded-0",type:"submit"},Ile={key:0,class:"spinner-grow spinner-grow-sm me-1",role:"status","aria-hidden":"true"},Ple={class:"col-8"},$le={class:"card rounded-0 border-0 shadow-sm h-100"},Ble={class:"card-body border-0 table-list"},Fle={class:"row"},Vle={class:"col-6"},Wle={class:"list-group rounded-0"},Hle={class:"list-group-item pt-3"},Ule={class:"input-group mb-3 flex-row-reverse"},zle={class:"table-container overflow-scroll list-group-item p-0"},qle={class:"table table-bordered mb-0"},Kle={class:"sticky-top bg-light shadow-sm"},jle={class:"border-top-0"},Gle={scope:"col",class:"checkbox-container border-start-0"},Yle=["checked","indeterminate"],Xle=["onClick"],Qle=["checked"],Jle=["onClick"],Zle={class:"border-end-0 p-0"},eae=["onUpdate:modelValue"],tae={class:"col-6"},nae={class:"list-group rounded-0"},sae={class:"list-group-item pt-3"},iae={class:"input-group mb-3 flex-row-reverse"},rae={class:"table-container overflow-scroll list-group-item p-0"},oae={class:"table table-bordered mb-0"},lae={class:"sticky-top bg-light shadow-sm"},aae={class:"border-top-0"},cae={scope:"col",class:"checkbox-container border-start-0"},uae=["checked"],fae=["onClick"],hae={class:"border-end-0"},dae={class:"d-flex align-items-center"},pae={class:"w-100"},mae={key:0,class:"progress mt-2 me-3",role:"progressbar",style:{height:"4px"}},gae={key:0,class:"spinner-grow text-warning spinner-grow-sm float-end",role:"status"},bae={key:1,class:"spinner-border spinner-border-sm float-end",role:"status"},yae={key:2,class:"bi bi-check-circle float-end text-success"},vae={key:3,class:"bi bi-exclamation-circle float-end text-danger"},wae={class:"d-flex justify-content-end mt-5"},Sae={key:0,class:"spinner-grow spinner-grow-sm me-1",role:"status","aria-hidden":"true"},xae={class:"toast-container position-fixed top-0 start-50 translate-middle-x p-3"},_ae={class:"d-flex"},Eae={class:"toast-body"},Cae=Bn({__name:"RestoreTables",setup(n){const e=Vt("store");Si(()=>{e.table.setters.setTable({TableName:"Restore Table"})});const t=De(""),s=De(""),i=De([]),r=De([]),o=De(new Map),l=Wt({AWS_REGION:"",AWS_ENDPOINT:"",AWS_ACCESS_KEY_ID:"",AWS_SESSION_TOKEN:"",AWS_SECRET_ACCESS_KEY:""}),c=_i(),f=De(),h=Wt({className:"",message:""}),d=async()=>{o.value=new Map;try{const x=await IG({credentials:l});i.value=x.map(S=>({source:S,target:S})),r.value=[]}catch(x){h.className="text-bg-danger",h.message=x.response?.data?.message??x.message;const S=new en(f.value,{delay:1e3});setTimeout(()=>S.show(),0)}},g=(x,{data:S})=>{const C=JSON.parse(S),{event:E}=C;if(E===Cs.ACK){const{uid:k}=C;(async()=>{try{await PG(k,{credentials:l,tables:r.value})}catch(R){h.className="text-bg-danger",h.message=R.response?.data?.message??R.message;const T=new en(f.value,{delay:1e3});setTimeout(()=>T.show(),0)}})()}if(E===Cs.CLOSE)return x.close();if(E===Cs.BEGIN){const{tableName:k}=C;o.value.set(k,Cs.BEGIN);return}if(E===Cs.PROGRESS){const{tableName:k,data:R}=C,T=Math.ceil(R[0]/R[1]*100);o.value.set(k,T);return}if(E===Cs.FAILURE){const{tableName:k,error:R}=C;o.value.set(k,Cs.FAILURE),h.className="text-bg-danger",h.message=R.response?.data?.message??R.message;const T=new en(f.value,{delay:1e3});setTimeout(()=>T.show(),0);return}if(E===Cs.SUCCESS){const{tableName:k}=C;o.value.set(k,Cs.SUCCESS)}},m=async()=>{Object.values(r.value).map(E=>o.value.set(E.source,!1));const x=UT(32),S=Fn(`${Xe.defaults.baseURL}${Kt.DATABASE.STREAM}`,{uid:x}),C=new EventSource(S);C.onerror=C.close,C.onmessage=E=>g(C,E)},y=x=>{const S=!!Lr.find(r.value,x);r.value=S?r.value.filter(C=>C.source!==x.source):[...r.value,x]},w=()=>{navigator.sendBeacon(`${Xe.defaults.baseURL}${Kt.DATABASE.ABORT}`),window.history.length>1?c.back():c.push({name:"home"})};return window.addEventListener("beforeunload",()=>{navigator.sendBeacon(`${Xe.defaults.baseURL}${Kt.DATABASE.ABORT}`)}),(x,S)=>(ue(),ye("div",xle,[b("div",_le,[S[36]||(S[36]=b("h3",{class:"mb-3"},"Restore tables",-1)),b("div",Ele,[b("div",Cle,[b("div",Ale,[S[18]||(S[18]=b("div",{class:"card-header py-3 border-0"},[b("h4",{class:"mb-1"},"Command line or programmatic access"),b("small",null,"Temporary credentials of an IAM role for CLI or programmatic access to an AWS account.")],-1)),b("div",kle,[b("form",{onSubmit:Qs(d,["prevent"])},[b("div",Tle,[b("div",null,[S[11]||(S[11]=b("label",{class:"form-label"},[Ie(" AWS Region * "),b("br")],-1)),mt(Ru,{modelValue:l.AWS_REGION,"onUpdate:modelValue":S[0]||(S[0]=C=>l.AWS_REGION=C),items:ke(sR),placeholder:"eg: us-west-2",id:"dropdown-input-toggle-aws-region",onSelect:S[1]||(S[1]=C=>l.AWS_REGION=C)},null,8,["modelValue","items"])])]),b("div",Ole,[b("div",null,[S[12]||(S[12]=b("label",{class:"form-label"},[Ie(" AWS DynamoDB Endpoint * "),b("br")],-1)),mt(Ru,{modelValue:l.AWS_ENDPOINT,"onUpdate:modelValue":S[2]||(S[2]=C=>l.AWS_ENDPOINT=C),items:ke(iR),placeholder:"eg: https://dynamodb.us-west-2.amazonaws.com",id:"dropdown-input-toggle-aws-dynamodb",onSelect:S[3]||(S[3]=C=>l.AWS_ENDPOINT=C)},null,8,["modelValue","items"])])]),b("div",Rle,[b("div",null,[S[13]||(S[13]=b("label",{class:"form-label"},[Ie(" AWS Access Key Id * "),b("br")],-1)),Ye(b("input",{required:"",type:"text",class:"form-control rounded-0",placeholder:"eg: AKIAIOSFODNN7EXAMPLE","onUpdate:modelValue":S[4]||(S[4]=C=>l.AWS_ACCESS_KEY_ID=C)},null,512),[[Rt,l.AWS_ACCESS_KEY_ID]])])]),b("div",Mle,[b("div",null,[S[14]||(S[14]=b("label",{class:"form-label"},[Ie(" AWS Secret access key * "),b("br")],-1)),Ye(b("input",{required:"",type:"text",class:"form-control rounded-0",placeholder:"eg: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY","onUpdate:modelValue":S[5]||(S[5]=C=>l.AWS_SECRET_ACCESS_KEY=C)},null,512),[[Rt,l.AWS_SECRET_ACCESS_KEY]])])]),b("div",Dle,[b("div",null,[S[15]||(S[15]=b("label",{class:"form-label"},[Ie(" AWS session token "),b("br")],-1)),Ye(b("input",{type:"text",class:"form-control rounded-0",placeholder:"eg: FQoGZXIvYXdzENv//////////wEaDEeLj11xTbnBk6azRCKsAacCiJK85DSXExJ81GtHrkEyev8eedQcFY4EoM00PsD1FAEMOfzQclVEFsoh9Y4ZHUjgGmCPRUnYCLNc2NnHkadvmI+MT7jRRa1Mo2HA/HYStOOwEyfXFYG91MNj9rVXXXXXXXXA6+7FF6jcxj3cr1U9CDB9hjW+jGq4UgjxXXXXXXXCoIidDjl4Z911zIzP/Q+FYA1R2CUz5Y32EUaMzR+bQvmheUolLOq3wU=","onUpdate:modelValue":S[6]||(S[6]=C=>l.AWS_SESSION_TOKEN=C)},null,512),[[Rt,l.AWS_SESSION_TOKEN]])])]),b("div",Lle,[b("button",{type:"button",class:"btn btn-secondary rounded-0 me-2",onClick:w}," Cancel "),b("button",Nle,[ke(e).ui.state.isLoading?(ue(),ye("span",Ile)):st("",!0),S[16]||(S[16]=b("span",{class:"visually-hidden"},"Loading...",-1)),S[17]||(S[17]=Ie(" Explore Tables ",-1))])])],32)])])]),b("div",Ple,[b("div",$le,[S[34]||(S[34]=b("div",{class:"card-header py-3 border-0"},[b("h4",{class:"mb-1"},"Tables"),b("small",null," These changes are destructive. This means that the table schemas and all data in the tables will be deleted and refreshed from the source table. ")],-1)),b("div",Ble,[b("div",Fle,[b("div",Vle,[b("ul",Wle,[b("li",Hle,[b("div",Ule,[Ye(b("input",{type:"text",class:"form-control rounded-0 border-start-0",placeholder:"Find tables by table name","onUpdate:modelValue":S[7]||(S[7]=C=>t.value=C)},null,512),[[Rt,t.value]]),S[19]||(S[19]=b("span",{class:"input-group-text bg-white rounded-0 border-end-0 pe-0"},[b("i",{class:"bi bi-search"})],-1))])]),b("li",zle,[b("table",qle,[b("thead",Kle,[b("tr",jle,[b("th",Gle,[b("input",{class:"form-check-input mt-1",type:"checkbox",value:"",checked:r.value.length>0,indeterminate:r.value.length>0&&r.value.length<i.value.length,onChange:S[8]||(S[8]=C=>r.value=r.value.length?[]:i.value)},null,40,Yle)]),S[20]||(S[20]=b("th",{scope:"col",class:"border-end-0"}," Export Tables ",-1)),S[21]||(S[21]=b("th",{scope:"col",class:"border-end-0"},null,-1)),S[22]||(S[22]=b("th",{scope:"col",class:"border-end-0"},null,-1))])]),b("tbody",null,[(ue(!0),ye(gt,null,mn(i.value.filter(C=>C.source.toLowerCase().includes(t.value.toLowerCase())),C=>(ue(),ye("tr",{key:C},[b("th",{scope:"row",class:"border-start-0",onClick:E=>y(C)},[b("input",{class:"form-check-input mt-1",type:"checkbox",checked:!!ke(Lr.find)(r.value,C)},null,8,Qle)],8,Xle),b("td",{onClick:E=>y(C),class:"border-end-0"},Pe(C.source),9,Jle),S[23]||(S[23]=b("td",{class:"border-end-0 w-30px"},[b("i",{class:"bi bi-arrow-right"})],-1)),b("td",Zle,[Ye(b("input",{"onUpdate:modelValue":E=>C.target=E,type:"text",class:"form-control rounded-0 border-0 min-w-max-content"},null,8,eae),[[Rt,C.target]])])]))),128))])])])])]),b("div",tae,[b("ul",nae,[b("li",sae,[b("div",iae,[Ye(b("input",{type:"text",class:"form-control rounded-0 border-start-0",placeholder:"Find tables by table name","onUpdate:modelValue":S[9]||(S[9]=C=>s.value=C)},null,512),[[Rt,s.value]]),S[24]||(S[24]=b("span",{class:"input-group-text bg-white rounded-0 border-end-0 pe-0"},[b("i",{class:"bi bi-search"})],-1))])]),b("li",rae,[b("table",oae,[b("thead",lae,[b("tr",aae,[b("th",cae,[b("input",{class:"form-check-input mt-1",type:"checkbox",value:"",checked:r.value.length>0,onChange:S[10]||(S[10]=C=>r.value=[])},null,40,uae)]),S[25]||(S[25]=b("th",{scope:"col",class:"border-end-0"}," Import Tables ",-1)),S[26]||(S[26]=b("th",{scope:"col",class:"border-end-0"},null,-1)),S[27]||(S[27]=b("th",{scope:"col",class:"border-end-0"},null,-1))])]),b("tbody",null,[(ue(!0),ye(gt,null,mn(r.value.filter(C=>C.source.toLowerCase().includes(s.value.toLowerCase())),C=>(ue(),ye("tr",{onClick:E=>y(C),key:C},[S[30]||(S[30]=b("th",{scope:"row",class:"border-start-0"},[b("input",{class:"form-check-input mt-1",type:"checkbox",checked:""})],-1)),b("td",null,Pe(C.source),1),S[31]||(S[31]=b("td",{class:"border-end-0 w-30px"},[b("i",{class:"bi bi-arrow-right"})],-1)),b("td",hae,[b("div",dae,[b("div",pae,[Ie(Pe(C.target)+" ",1),o.value.get(C.source)===ke(Cs).BEGIN||Number.isFinite(o.value.get(C.source))?(ue(),ye("div",mae,[b("div",{class:"progress-bar",style:Hi(`width: ${o.value.get(C.source)}%`)},null,4)])):st("",!0)]),o.value.get(C.source)===!1?(ue(),ye("div",gae,[...S[28]||(S[28]=[b("span",{class:"visually-hidden"},"Loading...",-1)])])):st("",!0),o.value.get(C.source)===ke(Cs).BEGIN||Number.isFinite(o.value.get(C.source))?(ue(),ye("div",bae,[...S[29]||(S[29]=[b("span",{class:"visually-hidden"},"Loading...",-1)])])):st("",!0),o.value.get(C.source)===ke(Cs).SUCCESS?(ue(),ye("i",yae)):st("",!0),o.value.get(C.source)===ke(Cs).FAILURE?(ue(),ye("i",vae)):st("",!0)])])],8,fae))),128))])])])])])]),b("div",wae,[b("button",{type:"button",class:"btn btn-secondary rounded-0 me-2",onClick:w}," Cancel "),b("button",{class:"btn btn-danger rounded-0",type:"button",onClick:m},[ke(e).ui.state.isLoading?(ue(),ye("span",Sae)):st("",!0),S[32]||(S[32]=b("span",{class:"visually-hidden"},"Loading...",-1)),S[33]||(S[33]=Ie(" Restore Tables ",-1))])])])])])]),b("div",xae,[b("div",{class:Pt(["toast align-items-center border-0",h.className]),role:"alert","aria-live":"assertive","aria-atomic":"true",ref_key:"toastRef",ref:f},[b("div",_ae,[b("div",Eae,Pe(h.message),1),S[35]||(S[35]=b("button",{type:"button",class:"btn-close btn-close-white me-2 m-auto","data-bs-dismiss":"toast","aria-label":"Close"},null,-1))])],2)])])]))}}),Aae=tr(Cae,[["__scopeId","data-v-d039400d"]]),kae={class:"row"},Tae={class:"col-12 col-xl-11"},Oae={class:"mb-3"},Rae={class:"card rounded-0 border-0 shadow-sm"},Mae={class:"card-body border-0"},Dae={class:"row mb-4"},Lae={class:"col-12 mb-4"},Nae={class:"form-check form-switch"},Iae=["checked"],Pae={class:"col-lg-6 col-xl-4 mb-2"},$ae=["disabled"],Bae={class:"d-flex justify-content-end"},Fae={key:0,class:"spinner-grow spinner-grow-sm me-1",role:"status","aria-hidden":"true"},Vae={class:"toast-container position-fixed top-0 start-50 translate-middle-x p-3"},Wae={class:"d-flex"},Hae={class:"toast-body"},Uae=Bn({__name:"TableTTL",setup(n){const e=er(),t=_i(),s=Vt("store"),i=Wt({TimeToLiveSpecification:{Enabled:!1,AttributeName:""}});of(async()=>{try{const f=await OG(e.params.tableName.toString());i.TimeToLiveSpecification.Enabled=f.TimeToLiveStatus===OE.STATUS.ENABLED,i.TimeToLiveSpecification.AttributeName=f.AttributeName||""}catch{window.location.href="/"}});const r=()=>{window.history.length>1?t.back():t.push({name:"home"})},o=De(),l=Wt({className:"",message:""}),c=async()=>{try{const f=await RG(e.params.tableName,i);i.TimeToLiveSpecification.Enabled=f.TimeToLiveStatus===OE.STATUS.ENABLED,i.TimeToLiveSpecification.AttributeName=f.AttributeName||"",l.className="text-bg-success",l.message="The table TTL has been updated successfully."}catch(f){l.className="text-bg-danger",l.message=f.response?.data?.message??f.message}finally{const f=new en(o.value,{delay:1e3});setTimeout(()=>f.show(),0)}};return(f,h)=>(ue(),ye("div",kae,[b("div",Tae,[b("h3",Oae,"Time to Live (TTL) "+Pe(ke(e).params.tableName),1),b("div",Rae,[h[5]||(h[5]=b("div",{class:"card-header py-3 border-0"},[b("h4",{class:"mb-1"},"Time to Live (TTL)"),b("small",null,"Automatically delete expired items from a table.")],-1)),b("div",Mae,[b("div",Dae,[b("div",Lae,[b("div",Nae,[Ye(b("input",{class:"form-check-input",id:"ttlStatus",type:"checkbox",role:"switch",checked:i.TimeToLiveSpecification.Enabled,"onUpdate:modelValue":h[0]||(h[0]=d=>i.TimeToLiveSpecification.Enabled=d)},null,8,Iae),[[WT,i.TimeToLiveSpecification.Enabled]]),h[2]||(h[2]=b("label",{class:"form-check-label",for:"ttlStatus"}," TTL Status ",-1))])]),b("div",Pae,[h[3]||(h[3]=b("label",{class:"form-label"},[Ie(" TTL attribute name "),b("br"),b("div",{class:"form-text"},"The name of the attribute that will be stored in the TTL timestamp.")],-1)),Ye(b("input",{type:"text",class:"form-control rounded-0",placeholder:"Enter attribute name","onUpdate:modelValue":h[1]||(h[1]=d=>i.TimeToLiveSpecification.AttributeName=d),disabled:!i.TimeToLiveSpecification.Enabled},null,8,$ae),[[Rt,i.TimeToLiveSpecification.AttributeName]]),h[4]||(h[4]=b("div",{class:"form-text"},"Between 1 and 255 characters.",-1))])])])]),h[7]||(h[7]=b("br",null,null,-1)),b("div",Bae,[b("button",{type:"button",class:"btn btn-secondary rounded-0 me-2",onClick:r}," Cancel "),b("button",{class:"btn btn-primary rounded-0",type:"button",onClick:c},[ke(s).ui.state.isLoading?(ue(),ye("span",Fae)):st("",!0),h[6]||(h[6]=b("span",{class:"visually-hidden"},"Loading...",-1)),Ie(" Turn "+Pe(i.TimeToLiveSpecification.Enabled?"on":"off")+" TTL ",1)])])]),b("div",Vae,[b("div",{class:Pt(["toast align-items-center border-0",l.className]),role:"alert","aria-live":"assertive","aria-atomic":"true",ref_key:"toastRef",ref:o},[b("div",Wae,[b("div",Hae,Pe(l.message),1),h[8]||(h[8]=b("button",{type:"button",class:"btn-close btn-close-white me-2 m-auto","data-bs-dismiss":"toast","aria-label":"Close"},null,-1))])],2)])]))}}),zae=Eq({history:nq("/dynamodb/"),routes:[{path:"/",name:"home",component:hk,meta:{name:"Item"}},{path:"/:tableName/edit-item",name:"edit-item",component:Ene,meta:{name:"Item"}},{path:"/:tableName/create-item",name:"create-item",component:Zre,meta:{name:"Item"}},{path:"/table/create-table",name:"create-table",component:Sle,meta:{name:"Tables"}},{path:"/table/:tableName/edit-table",name:"edit-table",component:Eoe,meta:{name:"Tables"}},{path:"/table/:tableName/table-schema",name:"table-schema",component:Doe,meta:{name:"Tables"}},{path:"/table/:tableName/ttl",name:"table-ttl",component:Uae,meta:{name:"Tables"}},{path:"/table/restore-tables",name:"restore-tables",component:Aae,meta:{name:"Tables"}},{path:"/:catchAll(.*)",component:hk,meta:{name:"Items"}}]});Xe.interceptors.request.use(n=>(qd.ui.setters.setIsLoading(!0),n));Xe.interceptors.response.use(n=>(qd.ui.setters.setIsLoading(!1),n),n=>(qd.ui.setters.setIsLoading(!1),Promise.reject(n)));Xe.defaults.baseURL="/dynamodb/api";const CL=nH(kG);CL.use(zae);CL.mount("#app");