From 8cf72457a1d60ed138aa283c84ee1cdb16f173b2 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 2 Jan 2025 14:28:05 +0000 Subject: [PATCH] GitHub Pages b6065bdfefabeb133ef4b7653770f9fb28b58e20 --- develop/assets/index-BJxQEF3L.js | 4645 +++++++++++++++++ .../assets/virtual_pwa-register-T0LD5wEJ.js | 1 + develop/index.html | 2 +- develop/sw.js | 2 +- 4 files changed, 4648 insertions(+), 2 deletions(-) create mode 100644 develop/assets/index-BJxQEF3L.js create mode 100644 develop/assets/virtual_pwa-register-T0LD5wEJ.js diff --git a/develop/assets/index-BJxQEF3L.js b/develop/assets/index-BJxQEF3L.js new file mode 100644 index 0000000..d826bc2 --- /dev/null +++ b/develop/assets/index-BJxQEF3L.js @@ -0,0 +1,4645 @@ +var a8=Object.defineProperty;var l8=(t,e,n)=>e in t?a8(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var xe=(t,e,n)=>l8(t,typeof e!="symbol"?e+"":e,n);(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 n(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=n(i);fetch(i.href,r)}})();/** +* @vue/shared v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function D1(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Nt={},Rl=[],Mi=()=>{},c8=()=>!1,Ep=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),N1=t=>t.startsWith("onUpdate:"),mn=Object.assign,U1=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},u8=Object.prototype.hasOwnProperty,kt=(t,e)=>u8.call(t,e),Qe=Array.isArray,Cl=t=>yd(t)==="[object Map]",mc=t=>yd(t)==="[object Set]",Yy=t=>yd(t)==="[object Date]",dt=t=>typeof t=="function",on=t=>typeof t=="string",ii=t=>typeof t=="symbol",Ut=t=>t!==null&&typeof t=="object",RT=t=>(Ut(t)||dt(t))&&dt(t.then)&&dt(t.catch),CT=Object.prototype.toString,yd=t=>CT.call(t),d8=t=>yd(t).slice(8,-1),kT=t=>yd(t)==="[object Object]",F1=t=>on(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,wu=D1(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Sp=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},f8=/-(\w)/g,Hs=Sp(t=>t.replace(f8,(e,n)=>n?n.toUpperCase():"")),h8=/\B([A-Z])/g,ka=Sp(t=>t.replace(h8,"-$1").toLowerCase()),Tp=Sp(t=>t.charAt(0).toUpperCase()+t.slice(1)),Cm=Sp(t=>t?`on${Tp(t)}`:""),co=(t,e)=>!Object.is(t,e),sh=(t,...e)=>{for(let n=0;n{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:s,value:n})},Lh=t=>{const e=parseFloat(t);return isNaN(e)?t:e},p8=t=>{const e=on(t)?Number(t):NaN;return isNaN(e)?t:e};let Zy;const Ap=()=>Zy||(Zy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Mp(t){if(Qe(t)){const e={};for(let n=0;n{if(n){const s=n.split(g8);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function ds(t){let e="";if(on(t))e=t;else if(Qe(t))for(let n=0;nbd(n,e))}const OT=t=>!!(t&&t.__v_isRef===!0),$e=t=>on(t)?t:t==null?"":Qe(t)||Ut(t)&&(t.toString===CT||!dt(t.toString))?OT(t)?$e(t.value):JSON.stringify(t,LT,2):String(t),LT=(t,e)=>OT(e)?LT(t,e.value):Cl(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[s,i],r)=>(n[km(s,r)+" =>"]=i,n),{})}:mc(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>km(n))}:ii(e)?km(e):Ut(e)&&!Qe(e)&&!kT(e)?String(e):e,km=(t,e="")=>{var n;return ii(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/** +* @vue/reactivity v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Kn;class DT{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Kn,!e&&Kn&&(this.index=(Kn.scopes||(Kn.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e0)return;if(Eu){let e=Eu;for(Eu=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;xu;){let e=xu;for(xu=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(s){t||(t=s)}e=n}}if(t)throw t}function HT(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function GT(t){let e,n=t.depsTail,s=n;for(;s;){const i=s.prevDep;s.version===-1?(s===n&&(n=i),G1(s),E8(s)):e=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=i}t.deps=e,t.depsTail=n}function T_(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(zT(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function zT(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Gu))return;t.globalVersion=Gu;const e=t.dep;if(t.flags|=2,e.version>0&&!t.isSSR&&t.deps&&!T_(t)){t.flags&=-3;return}const n=$t,s=ni;$t=t,ni=!0;try{HT(t);const i=t.fn(t._value);(e.version===0||co(i,t._value))&&(t._value=i,e.version++)}catch(i){throw e.version++,i}finally{$t=n,ni=s,GT(t),t.flags&=-3}}function G1(t,e=!1){const{dep:n,prevSub:s,nextSub:i}=t;if(s&&(s.nextSub=i,t.prevSub=void 0),i&&(i.prevSub=s,t.nextSub=void 0),n.subs===t&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)G1(r,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function E8(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let ni=!0;const VT=[];function Ao(){VT.push(ni),ni=!1}function Mo(){const t=VT.pop();ni=t===void 0?!0:t}function Jy(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=$t;$t=void 0;try{e()}finally{$t=n}}}let Gu=0;class S8{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class z1{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}track(e){if(!$t||!ni||$t===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==$t)n=this.activeLink=new S8($t,this),$t.deps?(n.prevDep=$t.depsTail,$t.depsTail.nextDep=n,$t.depsTail=n):$t.deps=$t.depsTail=n,WT(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=$t.depsTail,n.nextDep=void 0,$t.depsTail.nextDep=n,$t.depsTail=n,$t.deps===n&&($t.deps=s)}return n}trigger(e){this.version++,Gu++,this.notify(e)}notify(e){B1();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{H1()}}}function WT(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let s=e.deps;s;s=s.nextDep)WT(s)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const Dh=new WeakMap,ha=Symbol(""),A_=Symbol(""),zu=Symbol("");function Nn(t,e,n){if(ni&&$t){let s=Dh.get(t);s||Dh.set(t,s=new Map);let i=s.get(n);i||(s.set(n,i=new z1),i.map=s,i.key=n),i.track()}}function ar(t,e,n,s,i,r){const o=Dh.get(t);if(!o){Gu++;return}const a=l=>{l&&l.trigger()};if(B1(),e==="clear")o.forEach(a);else{const l=Qe(t),c=l&&F1(n);if(l&&n==="length"){const u=Number(s);o.forEach((d,f)=>{(f==="length"||f===zu||!ii(f)&&f>=u)&&a(d)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),c&&a(o.get(zu)),e){case"add":l?c&&a(o.get("length")):(a(o.get(ha)),Cl(t)&&a(o.get(A_)));break;case"delete":l||(a(o.get(ha)),Cl(t)&&a(o.get(A_)));break;case"set":Cl(t)&&a(o.get(ha));break}}H1()}function T8(t,e){const n=Dh.get(t);return n&&n.get(e)}function Na(t){const e=_t(t);return e===t?e:(Nn(e,"iterate",zu),$s(t)?e:e.map(Un))}function Rp(t){return Nn(t=_t(t),"iterate",zu),t}const A8={__proto__:null,[Symbol.iterator](){return Im(this,Symbol.iterator,Un)},concat(...t){return Na(this).concat(...t.map(e=>Qe(e)?Na(e):e))},entries(){return Im(this,"entries",t=>(t[1]=Un(t[1]),t))},every(t,e){return zi(this,"every",t,e,void 0,arguments)},filter(t,e){return zi(this,"filter",t,e,n=>n.map(Un),arguments)},find(t,e){return zi(this,"find",t,e,Un,arguments)},findIndex(t,e){return zi(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return zi(this,"findLast",t,e,Un,arguments)},findLastIndex(t,e){return zi(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return zi(this,"forEach",t,e,void 0,arguments)},includes(...t){return Om(this,"includes",t)},indexOf(...t){return Om(this,"indexOf",t)},join(t){return Na(this).join(t)},lastIndexOf(...t){return Om(this,"lastIndexOf",t)},map(t,e){return zi(this,"map",t,e,void 0,arguments)},pop(){return Nc(this,"pop")},push(...t){return Nc(this,"push",t)},reduce(t,...e){return Qy(this,"reduce",t,e)},reduceRight(t,...e){return Qy(this,"reduceRight",t,e)},shift(){return Nc(this,"shift")},some(t,e){return zi(this,"some",t,e,void 0,arguments)},splice(...t){return Nc(this,"splice",t)},toReversed(){return Na(this).toReversed()},toSorted(t){return Na(this).toSorted(t)},toSpliced(...t){return Na(this).toSpliced(...t)},unshift(...t){return Nc(this,"unshift",t)},values(){return Im(this,"values",Un)}};function Im(t,e,n){const s=Rp(t),i=s[e]();return s!==t&&!$s(t)&&(i._next=i.next,i.next=()=>{const r=i._next();return r.value&&(r.value=n(r.value)),r}),i}const M8=Array.prototype;function zi(t,e,n,s,i,r){const o=Rp(t),a=o!==t&&!$s(t),l=o[e];if(l!==M8[e]){const d=l.apply(t,r);return a?Un(d):d}let c=n;o!==t&&(a?c=function(d,f){return n.call(this,Un(d),f,t)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,t)}));const u=l.call(o,c,s);return a&&i?i(u):u}function Qy(t,e,n,s){const i=Rp(t);let r=n;return i!==t&&($s(t)?n.length>3&&(r=function(o,a,l){return n.call(this,o,a,l,t)}):r=function(o,a,l){return n.call(this,o,Un(a),l,t)}),i[e](r,...s)}function Om(t,e,n){const s=_t(t);Nn(s,"iterate",zu);const i=s[e](...n);return(i===-1||i===!1)&&wd(n[0])?(n[0]=_t(n[0]),s[e](...n)):i}function Nc(t,e,n=[]){Ao(),B1();const s=_t(t)[e].apply(t,n);return H1(),Mo(),s}const R8=D1("__proto__,__v_isRef,__isVue"),jT=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(ii));function C8(t){ii(t)||(t=String(t));const e=_t(this);return Nn(e,"has",t),e.hasOwnProperty(t)}class qT{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,s){if(n==="__v_skip")return e.__v_skip;const i=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return r;if(n==="__v_raw")return s===(i?r?$8:ZT:r?YT:KT).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const o=Qe(e);if(!i){let l;if(o&&(l=A8[n]))return l;if(n==="hasOwnProperty")return C8}const a=Reflect.get(e,n,un(e)?e:s);return(ii(n)?jT.has(n):R8(n))||(i||Nn(e,"get",n),r)?a:un(a)?o&&F1(n)?a:a.value:Ut(a)?i?QT(a):gc(a):a}}class XT extends qT{constructor(e=!1){super(!1,e)}set(e,n,s,i){let r=e[n];if(!this._isShallow){const l=ya(r);if(!$s(s)&&!ya(s)&&(r=_t(r),s=_t(s)),!Qe(e)&&un(r)&&!un(s))return l?!1:(r.value=s,!0)}const o=Qe(e)&&F1(n)?Number(n)t,Bd=t=>Reflect.getPrototypeOf(t);function L8(t,e,n){return function(...s){const i=this.__v_raw,r=_t(i),o=Cl(r),a=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,c=i[t](...s),u=n?M_:e?R_:Un;return!e&&Nn(r,"iterate",l?A_:ha),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:a?[u(d[0]),u(d[1])]:u(d),done:f}},[Symbol.iterator](){return this}}}}function Hd(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function D8(t,e){const n={get(i){const r=this.__v_raw,o=_t(r),a=_t(i);t||(co(i,a)&&Nn(o,"get",i),Nn(o,"get",a));const{has:l}=Bd(o),c=e?M_:t?R_:Un;if(l.call(o,i))return c(r.get(i));if(l.call(o,a))return c(r.get(a));r!==o&&r.get(i)},get size(){const i=this.__v_raw;return!t&&Nn(_t(i),"iterate",ha),Reflect.get(i,"size",i)},has(i){const r=this.__v_raw,o=_t(r),a=_t(i);return t||(co(i,a)&&Nn(o,"has",i),Nn(o,"has",a)),i===a?r.has(i):r.has(i)||r.has(a)},forEach(i,r){const o=this,a=o.__v_raw,l=_t(a),c=e?M_:t?R_:Un;return!t&&Nn(l,"iterate",ha),a.forEach((u,d)=>i.call(r,c(u),c(d),o))}};return mn(n,t?{add:Hd("add"),set:Hd("set"),delete:Hd("delete"),clear:Hd("clear")}:{add(i){!e&&!$s(i)&&!ya(i)&&(i=_t(i));const r=_t(this);return Bd(r).has.call(r,i)||(r.add(i),ar(r,"add",i,i)),this},set(i,r){!e&&!$s(r)&&!ya(r)&&(r=_t(r));const o=_t(this),{has:a,get:l}=Bd(o);let c=a.call(o,i);c||(i=_t(i),c=a.call(o,i));const u=l.call(o,i);return o.set(i,r),c?co(r,u)&&ar(o,"set",i,r):ar(o,"add",i,r),this},delete(i){const r=_t(this),{has:o,get:a}=Bd(r);let l=o.call(r,i);l||(i=_t(i),l=o.call(r,i)),a&&a.call(r,i);const c=r.delete(i);return l&&ar(r,"delete",i,void 0),c},clear(){const i=_t(this),r=i.size!==0,o=i.clear();return r&&ar(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=L8(i,t,e)}),n}function V1(t,e){const n=D8(t,e);return(s,i,r)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?s:Reflect.get(kt(n,i)&&i in s?n:s,i,r)}const N8={get:V1(!1,!1)},U8={get:V1(!1,!0)},F8={get:V1(!0,!1)};const KT=new WeakMap,YT=new WeakMap,ZT=new WeakMap,$8=new WeakMap;function B8(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function H8(t){return t.__v_skip||!Object.isExtensible(t)?0:B8(d8(t))}function gc(t){return ya(t)?t:W1(t,!1,P8,N8,KT)}function JT(t){return W1(t,!1,O8,U8,YT)}function QT(t){return W1(t,!0,I8,F8,ZT)}function W1(t,e,n,s,i){if(!Ut(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const r=i.get(t);if(r)return r;const o=H8(t);if(o===0)return t;const a=new Proxy(t,o===2?s:n);return i.set(t,a),a}function uo(t){return ya(t)?uo(t.__v_raw):!!(t&&t.__v_isReactive)}function ya(t){return!!(t&&t.__v_isReadonly)}function $s(t){return!!(t&&t.__v_isShallow)}function wd(t){return t?!!t.__v_raw:!1}function _t(t){const e=t&&t.__v_raw;return e?_t(e):t}function j1(t){return!kt(t,"__v_skip")&&Object.isExtensible(t)&&PT(t,"__v_skip",!0),t}const Un=t=>Ut(t)?gc(t):t,R_=t=>Ut(t)?QT(t):t;function un(t){return t?t.__v_isRef===!0:!1}function Cp(t){return e3(t,!1)}function kp(t){return e3(t,!0)}function e3(t,e){return un(t)?t:new G8(t,e)}class G8{constructor(e,n){this.dep=new z1,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:_t(e),this._value=n?e:Un(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,s=this.__v_isShallow||$s(e)||ya(e);e=s?e:_t(e),co(e,n)&&(this._rawValue=e,this._value=s?e:Un(e),this.dep.trigger())}}function kl(t){return un(t)?t.value:t}const z8={get:(t,e,n)=>e==="__v_raw"?t:kl(Reflect.get(t,e,n)),set:(t,e,n,s)=>{const i=t[e];return un(i)&&!un(n)?(i.value=n,!0):Reflect.set(t,e,n,s)}};function t3(t){return uo(t)?t:new Proxy(t,z8)}function V8(t){const e=Qe(t)?new Array(t.length):{};for(const n in t)e[n]=j8(t,n);return e}class W8{constructor(e,n,s){this._object=e,this._key=n,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return T8(_t(this._object),this._key)}}function j8(t,e,n){const s=t[e];return un(s)?s:new W8(t,e,n)}class q8{constructor(e,n,s){this.fn=e,this.setter=n,this._value=void 0,this.dep=new z1(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Gu-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&$t!==this)return BT(this,!0),!0}get value(){const e=this.dep.track();return zT(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function X8(t,e,n=!1){let s,i;return dt(t)?s=t:(s=t.get,i=t.set),new q8(s,i,n)}const Gd={},Nh=new WeakMap;let qo;function K8(t,e=!1,n=qo){if(n){let s=Nh.get(n);s||Nh.set(n,s=[]),s.push(t)}}function Y8(t,e,n=Nt){const{immediate:s,deep:i,once:r,scheduler:o,augmentJob:a,call:l}=n,c=w=>i?w:$s(w)||i===!1||i===0?lr(w,1):lr(w);let u,d,f,h,v=!1,_=!1;if(un(t)?(d=()=>t.value,v=$s(t)):uo(t)?(d=()=>c(t),v=!0):Qe(t)?(_=!0,v=t.some(w=>uo(w)||$s(w)),d=()=>t.map(w=>{if(un(w))return w.value;if(uo(w))return c(w);if(dt(w))return l?l(w,2):w()})):dt(t)?e?d=l?()=>l(t,2):t:d=()=>{if(f){Ao();try{f()}finally{Mo()}}const w=qo;qo=u;try{return l?l(t,3,[h]):t(h)}finally{qo=w}}:d=Mi,e&&i){const w=d,T=i===!0?1/0:i;d=()=>lr(w(),T)}const m=UT(),g=()=>{u.stop(),m&&m.active&&U1(m.effects,u)};if(r&&e){const w=e;e=(...T)=>{w(...T),g()}}let y=_?new Array(t.length).fill(Gd):Gd;const b=w=>{if(!(!(u.flags&1)||!u.dirty&&!w))if(e){const T=u.run();if(i||v||(_?T.some((S,A)=>co(S,y[A])):co(T,y))){f&&f();const S=qo;qo=u;try{const A=[T,y===Gd?void 0:_&&y[0]===Gd?[]:y,h];l?l(e,3,A):e(...A),y=T}finally{qo=S}}}else u.run()};return a&&a(b),u=new FT(d),u.scheduler=o?()=>o(b,!1):b,h=w=>K8(w,!1,u),f=u.onStop=()=>{const w=Nh.get(u);if(w){if(l)l(w,4);else for(const T of w)T();Nh.delete(u)}},e?s?b(!0):y=u.run():o?o(b.bind(null,!0),!0):u.run(),g.pause=u.pause.bind(u),g.resume=u.resume.bind(u),g.stop=g,g}function lr(t,e=1/0,n){if(e<=0||!Ut(t)||t.__v_skip||(n=n||new Set,n.has(t)))return t;if(n.add(t),e--,un(t))lr(t.value,e,n);else if(Qe(t))for(let s=0;s{lr(s,e,n)});else if(kT(t)){for(const s in t)lr(t[s],e,n);for(const s of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,s)&&lr(t[s],e,n)}return t}/** +* @vue/runtime-core v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function xd(t,e,n,s){try{return s?t(...s):t()}catch(i){Pp(i,e,n)}}function ri(t,e,n,s){if(dt(t)){const i=xd(t,e,n,s);return i&&RT(i)&&i.catch(r=>{Pp(r,e,n)}),i}if(Qe(t)){const i=[];for(let r=0;r>>1,i=Jn[s],r=Vu(i);r=Vu(n)?Jn.push(t):Jn.splice(J8(e),0,t),t.flags|=1,s3()}}function s3(){Uh||(Uh=n3.then(r3))}function Q8(t){Qe(t)?Pl.push(...t):Zr&&t.id===-1?Zr.splice(fl+1,0,t):t.flags&1||(Pl.push(t),t.flags|=1),s3()}function eb(t,e,n=_i+1){for(;nVu(n)-Vu(s));if(Pl.length=0,Zr){Zr.push(...e);return}for(Zr=e,fl=0;flt.id==null?t.flags&2?-1:1/0:t.id;function r3(t){try{for(_i=0;_i{s._d&&db(-1);const r=Fh(e);let o;try{o=t(...i)}finally{Fh(r),s._d&&db(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function We(t,e){if(pn===null)return t;const n=Up(pn),s=t.dirs||(t.dirs=[]);for(let i=0;it.__isTeleport,Jr=Symbol("_leaveCb"),zd=Symbol("_enterCb");function l3(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return K1(()=>{t.isMounted=!0}),g3(()=>{t.isUnmounting=!0}),t}const Cs=[Function,Array],c3={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Cs,onEnter:Cs,onAfterEnter:Cs,onEnterCancelled:Cs,onBeforeLeave:Cs,onLeave:Cs,onAfterLeave:Cs,onLeaveCancelled:Cs,onBeforeAppear:Cs,onAppear:Cs,onAfterAppear:Cs,onAppearCancelled:Cs},u3=t=>{const e=t.subTree;return e.component?u3(e.component):e},tk={name:"BaseTransition",props:c3,setup(t,{slots:e}){const n=B3(),s=l3();return()=>{const i=e.default&&X1(e.default(),!0);if(!i||!i.length)return;const r=d3(i),o=_t(t),{mode:a}=o;if(s.isLeaving)return Lm(r);const l=tb(r);if(!l)return Lm(r);let c=Wu(l,o,s,n,d=>c=d);l.type!==es&&ba(l,c);let u=n.subTree&&tb(n.subTree);if(u&&u.type!==es&&!Qo(l,u)&&u3(n).type!==es){let d=Wu(u,o,s,n);if(ba(u,d),a==="out-in"&&l.type!==es)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Lm(r);a==="in-out"&&l.type!==es?d.delayLeave=(f,h,v)=>{const _=f3(s,u);_[String(u.key)]=u,f[Jr]=()=>{h(),f[Jr]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{v(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return r}}};function d3(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==es){e=n;break}}return e}const nk=tk;function f3(t,e){const{leavingVNodes:n}=t;let s=n.get(e.type);return s||(s=Object.create(null),n.set(e.type,s)),s}function Wu(t,e,n,s,i){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:v,onLeaveCancelled:_,onBeforeAppear:m,onAppear:g,onAfterAppear:y,onAppearCancelled:b}=e,w=String(t.key),T=f3(n,t),S=(x,E)=>{x&&ri(x,s,9,E)},A=(x,E)=>{const k=E[1];S(x,E),Qe(x)?x.every(U=>U.length<=1)&&k():x.length<=1&&k()},R={mode:o,persisted:a,beforeEnter(x){let E=l;if(!n.isMounted)if(r)E=m||l;else return;x[Jr]&&x[Jr](!0);const k=T[w];k&&Qo(t,k)&&k.el[Jr]&&k.el[Jr](),S(E,[x])},enter(x){let E=c,k=u,U=d;if(!n.isMounted)if(r)E=g||c,k=y||u,U=b||d;else return;let H=!1;const D=x[zd]=I=>{H||(H=!0,I?S(U,[x]):S(k,[x]),R.delayedLeave&&R.delayedLeave(),x[zd]=void 0)};E?A(E,[x,D]):D()},leave(x,E){const k=String(t.key);if(x[zd]&&x[zd](!0),n.isUnmounting)return E();S(f,[x]);let U=!1;const H=x[Jr]=D=>{U||(U=!0,E(),D?S(_,[x]):S(v,[x]),x[Jr]=void 0,T[k]===t&&delete T[k])};T[k]=t,h?A(h,[x,H]):H()},clone(x){const E=Wu(x,e,n,s,i);return i&&i(E),E}};return R}function Lm(t){if(Ip(t))return t=go(t),t.children=null,t}function tb(t){if(!Ip(t))return a3(t.type)&&t.children?d3(t.children):t;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&dt(n.default))return n.default()}}function ba(t,e){t.shapeFlag&6&&t.component?(t.transition=e,ba(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function X1(t,e=!1,n){let s=[],i=0;for(let r=0;r1)for(let r=0;r$h(v,e&&(Qe(e)?e[_]:e),n,s,i));return}if(Il(s)&&!i){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&$h(t,e,n,s.component.subTree);return}const r=s.shapeFlag&4?Up(s.component):s.el,o=i?null:r,{i:a,r:l}=t,c=e&&e.r,u=a.refs===Nt?a.refs={}:a.refs,d=a.setupState,f=_t(d),h=d===Nt?()=>!1:v=>kt(f,v);if(c!=null&&c!==l&&(on(c)?(u[c]=null,h(c)&&(d[c]=null)):un(c)&&(c.value=null)),dt(l))xd(l,a,12,[o,u]);else{const v=on(l),_=un(l);if(v||_){const m=()=>{if(t.f){const g=v?h(l)?d[l]:u[l]:l.value;i?Qe(g)&&U1(g,r):Qe(g)?g.includes(r)||g.push(r):v?(u[l]=[r],h(l)&&(d[l]=u[l])):(l.value=[r],t.k&&(u[t.k]=l.value))}else v?(u[l]=o,h(l)&&(d[l]=o)):_&&(l.value=o,t.k&&(u[t.k]=o))};o?(m.id=-1,bs(m,n)):m()}}}Ap().requestIdleCallback;Ap().cancelIdleCallback;const Il=t=>!!t.type.__asyncLoader,Ip=t=>t.type.__isKeepAlive;function sk(t,e){p3(t,"a",e)}function ik(t,e){p3(t,"da",e)}function p3(t,e,n=wn){const s=t.__wdc||(t.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(Op(e,s,n),n){let i=n.parent;for(;i&&i.parent;)Ip(i.parent.vnode)&&rk(s,e,n,i),i=i.parent}}function rk(t,e,n,s){const i=Op(e,t,s,!0);Y1(()=>{U1(s[e],i)},n)}function Op(t,e,n=wn,s=!1){if(n){const i=n[t]||(n[t]=[]),r=e.__weh||(e.__weh=(...o)=>{Ao();const a=Sd(n),l=ri(e,n,t,o);return a(),Mo(),l});return s?i.unshift(r):i.push(r),r}}const Ar=t=>(e,n=wn)=>{(!Xu||t==="sp")&&Op(t,(...s)=>e(...s),n)},ok=Ar("bm"),K1=Ar("m"),ak=Ar("bu"),m3=Ar("u"),g3=Ar("bum"),Y1=Ar("um"),lk=Ar("sp"),ck=Ar("rtg"),uk=Ar("rtc");function dk(t,e=wn){Op("ec",t,e)}const Z1="components",fk="directives";function Ie(t,e){return J1(Z1,t,!0,e)||t}const _3=Symbol.for("v-ndc");function hk(t){return on(t)?J1(Z1,t,!1)||t:t||_3}function pk(t){return J1(fk,t)}function J1(t,e,n=!0,s=!1){const i=pn||wn;if(i){const r=i.type;if(t===Z1){const a=eP(r,!1);if(a&&(a===e||a===Hs(e)||a===Tp(Hs(e))))return r}const o=nb(i[t]||r[t],e)||nb(i.appContext[t],e);return!o&&s?r:o}}function nb(t,e){return t&&(t[e]||t[Hs(e)]||t[Tp(Hs(e))])}function Ht(t,e,n,s){let i;const r=n,o=Qe(t);if(o||on(t)){const a=o&&uo(t);let l=!1;a&&(l=!$s(t),t=Rp(t)),i=new Array(t.length);for(let c=0,u=t.length;ce(a,l,void 0,r));else{const a=Object.keys(t);i=new Array(a.length);for(let l=0,c=a.length;lqu(e)?!(e.type===es||e.type===it&&!y3(e.children)):!0)?t:null}const C_=t=>t?H3(t)?Up(t):C_(t.parent):null,Su=mn(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>C_(t.parent),$root:t=>C_(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>w3(t),$forceUpdate:t=>t.f||(t.f=()=>{q1(t.update)}),$nextTick:t=>t.n||(t.n=Ed.bind(t.proxy)),$watch:t=>Nk.bind(t)}),Dm=(t,e)=>t!==Nt&&!t.__isScriptSetup&&kt(t,e),mk={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:s,data:i,props:r,accessCache:o,type:a,appContext:l}=t;let c;if(e[0]!=="$"){const h=o[e];if(h!==void 0)switch(h){case 1:return s[e];case 2:return i[e];case 4:return n[e];case 3:return r[e]}else{if(Dm(s,e))return o[e]=1,s[e];if(i!==Nt&&kt(i,e))return o[e]=2,i[e];if((c=t.propsOptions[0])&&kt(c,e))return o[e]=3,r[e];if(n!==Nt&&kt(n,e))return o[e]=4,n[e];k_&&(o[e]=0)}}const u=Su[e];let d,f;if(u)return e==="$attrs"&&Nn(t.attrs,"get",""),u(t);if((d=a.__cssModules)&&(d=d[e]))return d;if(n!==Nt&&kt(n,e))return o[e]=4,n[e];if(f=l.config.globalProperties,kt(f,e))return f[e]},set({_:t},e,n){const{data:s,setupState:i,ctx:r}=t;return Dm(i,e)?(i[e]=n,!0):s!==Nt&&kt(s,e)?(s[e]=n,!0):kt(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(r[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:s,appContext:i,propsOptions:r}},o){let a;return!!n[o]||t!==Nt&&kt(t,o)||Dm(e,o)||(a=r[0])&&kt(a,o)||kt(s,o)||kt(Su,o)||kt(i.config.globalProperties,o)},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:kt(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function sb(t){return Qe(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}let k_=!0;function gk(t){const e=w3(t),n=t.proxy,s=t.ctx;k_=!1,e.beforeCreate&&ib(e.beforeCreate,t,"bc");const{data:i,computed:r,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:v,activated:_,deactivated:m,beforeDestroy:g,beforeUnmount:y,destroyed:b,unmounted:w,render:T,renderTracked:S,renderTriggered:A,errorCaptured:R,serverPrefetch:x,expose:E,inheritAttrs:k,components:U,directives:H,filters:D}=e;if(c&&_k(c,s,null),o)for(const B in o){const L=o[B];dt(L)&&(s[B]=L.bind(n))}if(i){const B=i.call(n,n);Ut(B)&&(t.data=gc(B))}if(k_=!0,r)for(const B in r){const L=r[B],Y=dt(L)?L.bind(n,n):dt(L.get)?L.get.bind(n,n):Mi,q=!dt(L)&&dt(L.set)?L.set.bind(n):Mi,de=ln({get:Y,set:q});Object.defineProperty(s,B,{enumerable:!0,configurable:!0,get:()=>de.value,set:fe=>de.value=fe})}if(a)for(const B in a)b3(a[B],s,n,B);if(l){const B=dt(l)?l.call(n):l;Reflect.ownKeys(B).forEach(L=>{ih(L,B[L])})}u&&ib(u,t,"c");function P(B,L){Qe(L)?L.forEach(Y=>B(Y.bind(n))):L&&B(L.bind(n))}if(P(ok,d),P(K1,f),P(ak,h),P(m3,v),P(sk,_),P(ik,m),P(dk,R),P(uk,S),P(ck,A),P(g3,y),P(Y1,w),P(lk,x),Qe(E))if(E.length){const B=t.exposed||(t.exposed={});E.forEach(L=>{Object.defineProperty(B,L,{get:()=>n[L],set:Y=>n[L]=Y})})}else t.exposed||(t.exposed={});T&&t.render===Mi&&(t.render=T),k!=null&&(t.inheritAttrs=k),U&&(t.components=U),H&&(t.directives=H),x&&h3(t)}function _k(t,e,n=Mi){Qe(t)&&(t=P_(t));for(const s in t){const i=t[s];let r;Ut(i)?"default"in i?r=Ri(i.from||s,i.default,!0):r=Ri(i.from||s):r=Ri(i),un(r)?Object.defineProperty(e,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[s]=r}}function ib(t,e,n){ri(Qe(t)?t.map(s=>s.bind(e.proxy)):t.bind(e.proxy),e,n)}function b3(t,e,n,s){let i=s.includes(".")?D3(n,s):()=>n[s];if(on(t)){const r=e[t];dt(r)&&ma(i,r)}else if(dt(t))ma(i,t.bind(n));else if(Ut(t))if(Qe(t))t.forEach(r=>b3(r,e,n,s));else{const r=dt(t.handler)?t.handler.bind(n):e[t.handler];dt(r)&&ma(i,r,t)}}function w3(t){const e=t.type,{mixins:n,extends:s}=e,{mixins:i,optionsCache:r,config:{optionMergeStrategies:o}}=t.appContext,a=r.get(e);let l;return a?l=a:!i.length&&!n&&!s?l=e:(l={},i.length&&i.forEach(c=>Bh(l,c,o,!0)),Bh(l,e,o)),Ut(e)&&r.set(e,l),l}function Bh(t,e,n,s=!1){const{mixins:i,extends:r}=e;r&&Bh(t,r,n,!0),i&&i.forEach(o=>Bh(t,o,n,!0));for(const o in e)if(!(s&&o==="expose")){const a=vk[o]||n&&n[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const vk={data:rb,props:ob,emits:ob,methods:cu,computed:cu,beforeCreate:jn,created:jn,beforeMount:jn,mounted:jn,beforeUpdate:jn,updated:jn,beforeDestroy:jn,beforeUnmount:jn,destroyed:jn,unmounted:jn,activated:jn,deactivated:jn,errorCaptured:jn,serverPrefetch:jn,components:cu,directives:cu,watch:bk,provide:rb,inject:yk};function rb(t,e){return e?t?function(){return mn(dt(t)?t.call(this,this):t,dt(e)?e.call(this,this):e)}:e:t}function yk(t,e){return cu(P_(t),P_(e))}function P_(t){if(Qe(t)){const e={};for(let n=0;n1)return n&&dt(e)?e.call(s&&s.proxy):e}}function Ek(){return!!(wn||pn||pa)}const E3={},S3=()=>Object.create(E3),T3=t=>Object.getPrototypeOf(t)===E3;function Sk(t,e,n,s=!1){const i={},r=S3();t.propsDefaults=Object.create(null),A3(t,e,i,r);for(const o in t.propsOptions[0])o in i||(i[o]=void 0);n?t.props=s?i:JT(i):t.type.props?t.props=i:t.props=r,t.attrs=r}function Tk(t,e,n,s){const{props:i,attrs:r,vnode:{patchFlag:o}}=t,a=_t(i),[l]=t.propsOptions;let c=!1;if((s||o>0)&&!(o&16)){if(o&8){const u=t.vnode.dynamicProps;for(let d=0;d{l=!0;const[f,h]=M3(d,e,!0);mn(o,f),h&&a.push(...h)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!r&&!l)return Ut(t)&&s.set(t,Rl),Rl;if(Qe(r))for(let u=0;ut[0]==="_"||t==="$stable",Q1=t=>Qe(t)?t.map(yi):[yi(t)],Mk=(t,e,n)=>{if(e._n)return e;const s=tt((...i)=>Q1(e(...i)),n);return s._c=!1,s},C3=(t,e,n)=>{const s=t._ctx;for(const i in t){if(R3(i))continue;const r=t[i];if(dt(r))e[i]=Mk(i,r,s);else if(r!=null){const o=Q1(r);e[i]=()=>o}}},k3=(t,e)=>{const n=Q1(e);t.slots.default=()=>n},P3=(t,e,n)=>{for(const s in e)(n||s!=="_")&&(t[s]=e[s])},Rk=(t,e,n)=>{const s=t.slots=S3();if(t.vnode.shapeFlag&32){const i=e._;i?(P3(s,e,n),n&&PT(s,"_",i,!0)):C3(e,s)}else e&&k3(t,e)},Ck=(t,e,n)=>{const{vnode:s,slots:i}=t;let r=!0,o=Nt;if(s.shapeFlag&32){const a=e._;a?n&&a===1?r=!1:P3(i,e,n):(r=!e.$stable,C3(e,i)),o=e}else e&&(k3(t,e),o={default:1});if(r)for(const a in i)!R3(a)&&o[a]==null&&delete i[a]},bs=zk;function kk(t){return Pk(t)}function Pk(t,e){const n=Ap();n.__VUE__=!0;const{insert:s,remove:i,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=Mi,insertStaticContent:v}=t,_=(M,z,K,ce=null,te=null,we=null,Me=void 0,Se=null,N=!!z.dynamicChildren)=>{if(M===z)return;M&&!Qo(M,z)&&(ce=J(M),fe(M,te,we,!0),M=null),z.patchFlag===-2&&(N=!1,z.dynamicChildren=null);const{type:C,ref:Q,shapeFlag:ae}=z;switch(C){case Dp:m(M,z,K,ce);break;case es:g(M,z,K,ce);break;case rh:M==null&&y(z,K,ce,Me);break;case it:U(M,z,K,ce,te,we,Me,Se,N);break;default:ae&1?T(M,z,K,ce,te,we,Me,Se,N):ae&6?H(M,z,K,ce,te,we,Me,Se,N):(ae&64||ae&128)&&C.process(M,z,K,ce,te,we,Me,Se,N,Ce)}Q!=null&&te&&$h(Q,M&&M.ref,we,z||M,!z)},m=(M,z,K,ce)=>{if(M==null)s(z.el=a(z.children),K,ce);else{const te=z.el=M.el;z.children!==M.children&&c(te,z.children)}},g=(M,z,K,ce)=>{M==null?s(z.el=l(z.children||""),K,ce):z.el=M.el},y=(M,z,K,ce)=>{[M.el,M.anchor]=v(M.children,z,K,ce,M.el,M.anchor)},b=({el:M,anchor:z},K,ce)=>{let te;for(;M&&M!==z;)te=f(M),s(M,K,ce),M=te;s(z,K,ce)},w=({el:M,anchor:z})=>{let K;for(;M&&M!==z;)K=f(M),i(M),M=K;i(z)},T=(M,z,K,ce,te,we,Me,Se,N)=>{z.type==="svg"?Me="svg":z.type==="math"&&(Me="mathml"),M==null?S(z,K,ce,te,we,Me,Se,N):x(M,z,te,we,Me,Se,N)},S=(M,z,K,ce,te,we,Me,Se)=>{let N,C;const{props:Q,shapeFlag:ae,transition:_e,dirs:pe}=M;if(N=M.el=o(M.type,we,Q&&Q.is,Q),ae&8?u(N,M.children):ae&16&&R(M.children,N,null,ce,te,Nm(M,we),Me,Se),pe&&Io(M,null,ce,"created"),A(N,M,M.scopeId,Me,ce),Q){for(const Pe in Q)Pe!=="value"&&!wu(Pe)&&r(N,Pe,null,Q[Pe],we,ce);"value"in Q&&r(N,"value",null,Q.value,we),(C=Q.onVnodeBeforeMount)&&di(C,ce,M)}pe&&Io(M,null,ce,"beforeMount");const De=Ik(te,_e);De&&_e.beforeEnter(N),s(N,z,K),((C=Q&&Q.onVnodeMounted)||De||pe)&&bs(()=>{C&&di(C,ce,M),De&&_e.enter(N),pe&&Io(M,null,ce,"mounted")},te)},A=(M,z,K,ce,te)=>{if(K&&h(M,K),ce)for(let we=0;we{for(let C=N;C{const Se=z.el=M.el;let{patchFlag:N,dynamicChildren:C,dirs:Q}=z;N|=M.patchFlag&16;const ae=M.props||Nt,_e=z.props||Nt;let pe;if(K&&Oo(K,!1),(pe=_e.onVnodeBeforeUpdate)&&di(pe,K,z,M),Q&&Io(z,M,K,"beforeUpdate"),K&&Oo(K,!0),(ae.innerHTML&&_e.innerHTML==null||ae.textContent&&_e.textContent==null)&&u(Se,""),C?E(M.dynamicChildren,C,Se,K,ce,Nm(z,te),we):Me||L(M,z,Se,null,K,ce,Nm(z,te),we,!1),N>0){if(N&16)k(Se,ae,_e,K,te);else if(N&2&&ae.class!==_e.class&&r(Se,"class",null,_e.class,te),N&4&&r(Se,"style",ae.style,_e.style,te),N&8){const De=z.dynamicProps;for(let Pe=0;Pe{pe&&di(pe,K,z,M),Q&&Io(z,M,K,"updated")},ce)},E=(M,z,K,ce,te,we,Me)=>{for(let Se=0;Se{if(z!==K){if(z!==Nt)for(const we in z)!wu(we)&&!(we in K)&&r(M,we,z[we],null,te,ce);for(const we in K){if(wu(we))continue;const Me=K[we],Se=z[we];Me!==Se&&we!=="value"&&r(M,we,Se,Me,te,ce)}"value"in K&&r(M,"value",z.value,K.value,te)}},U=(M,z,K,ce,te,we,Me,Se,N)=>{const C=z.el=M?M.el:a(""),Q=z.anchor=M?M.anchor:a("");let{patchFlag:ae,dynamicChildren:_e,slotScopeIds:pe}=z;pe&&(Se=Se?Se.concat(pe):pe),M==null?(s(C,K,ce),s(Q,K,ce),R(z.children||[],K,Q,te,we,Me,Se,N)):ae>0&&ae&64&&_e&&M.dynamicChildren?(E(M.dynamicChildren,_e,K,te,we,Me,Se),(z.key!=null||te&&z===te.subTree)&&I3(M,z,!0)):L(M,z,K,Q,te,we,Me,Se,N)},H=(M,z,K,ce,te,we,Me,Se,N)=>{z.slotScopeIds=Se,M==null?z.shapeFlag&512?te.ctx.activate(z,K,ce,Me,N):D(z,K,ce,te,we,Me,N):I(M,z,N)},D=(M,z,K,ce,te,we,Me)=>{const Se=M.component=Kk(M,ce,te);if(Ip(M)&&(Se.ctx.renderer=Ce),Yk(Se,!1,Me),Se.asyncDep){if(te&&te.registerDep(Se,P,Me),!M.el){const N=Se.subTree=X(es);g(null,N,z,K)}}else P(Se,M,z,K,te,we,Me)},I=(M,z,K)=>{const ce=z.component=M.component;if(Hk(M,z,K))if(ce.asyncDep&&!ce.asyncResolved){B(ce,z,K);return}else ce.next=z,ce.update();else z.el=M.el,ce.vnode=z},P=(M,z,K,ce,te,we,Me)=>{const Se=()=>{if(M.isMounted){let{next:ae,bu:_e,u:pe,parent:De,vnode:Pe}=M;{const O=O3(M);if(O){ae&&(ae.el=Pe.el,B(M,ae,Me)),O.asyncDep.then(()=>{M.isUnmounted||Se()});return}}let Oe=ae,Xe;Oo(M,!1),ae?(ae.el=Pe.el,B(M,ae,Me)):ae=Pe,_e&&sh(_e),(Xe=ae.props&&ae.props.onVnodeBeforeUpdate)&&di(Xe,De,ae,Pe),Oo(M,!0);const he=cb(M),j=M.subTree;M.subTree=he,_(j,he,d(j.el),J(j),M,te,we),ae.el=he.el,Oe===null&&Gk(M,he.el),pe&&bs(pe,te),(Xe=ae.props&&ae.props.onVnodeUpdated)&&bs(()=>di(Xe,De,ae,Pe),te)}else{let ae;const{el:_e,props:pe}=z,{bm:De,m:Pe,parent:Oe,root:Xe,type:he}=M,j=Il(z);Oo(M,!1),De&&sh(De),!j&&(ae=pe&&pe.onVnodeBeforeMount)&&di(ae,Oe,z),Oo(M,!0);{Xe.ce&&Xe.ce._injectChildStyle(he);const O=M.subTree=cb(M);_(null,O,K,ce,M,te,we),z.el=O.el}if(Pe&&bs(Pe,te),!j&&(ae=pe&&pe.onVnodeMounted)){const O=z;bs(()=>di(ae,Oe,O),te)}(z.shapeFlag&256||Oe&&Il(Oe.vnode)&&Oe.vnode.shapeFlag&256)&&M.a&&bs(M.a,te),M.isMounted=!0,z=K=ce=null}};M.scope.on();const N=M.effect=new FT(Se);M.scope.off();const C=M.update=N.run.bind(N),Q=M.job=N.runIfDirty.bind(N);Q.i=M,Q.id=M.uid,N.scheduler=()=>q1(Q),Oo(M,!0),C()},B=(M,z,K)=>{z.component=M;const ce=M.vnode.props;M.vnode=z,M.next=null,Tk(M,z.props,ce,K),Ck(M,z.children,K),Ao(),eb(M),Mo()},L=(M,z,K,ce,te,we,Me,Se,N=!1)=>{const C=M&&M.children,Q=M?M.shapeFlag:0,ae=z.children,{patchFlag:_e,shapeFlag:pe}=z;if(_e>0){if(_e&128){q(C,ae,K,ce,te,we,Me,Se,N);return}else if(_e&256){Y(C,ae,K,ce,te,we,Me,Se,N);return}}pe&8?(Q&16&&ke(C,te,we),ae!==C&&u(K,ae)):Q&16?pe&16?q(C,ae,K,ce,te,we,Me,Se,N):ke(C,te,we,!0):(Q&8&&u(K,""),pe&16&&R(ae,K,ce,te,we,Me,Se,N))},Y=(M,z,K,ce,te,we,Me,Se,N)=>{M=M||Rl,z=z||Rl;const C=M.length,Q=z.length,ae=Math.min(C,Q);let _e;for(_e=0;_eQ?ke(M,te,we,!0,!1,ae):R(z,K,ce,te,we,Me,Se,N,ae)},q=(M,z,K,ce,te,we,Me,Se,N)=>{let C=0;const Q=z.length;let ae=M.length-1,_e=Q-1;for(;C<=ae&&C<=_e;){const pe=M[C],De=z[C]=N?Qr(z[C]):yi(z[C]);if(Qo(pe,De))_(pe,De,K,null,te,we,Me,Se,N);else break;C++}for(;C<=ae&&C<=_e;){const pe=M[ae],De=z[_e]=N?Qr(z[_e]):yi(z[_e]);if(Qo(pe,De))_(pe,De,K,null,te,we,Me,Se,N);else break;ae--,_e--}if(C>ae){if(C<=_e){const pe=_e+1,De=pe_e)for(;C<=ae;)fe(M[C],te,we,!0),C++;else{const pe=C,De=C,Pe=new Map;for(C=De;C<=_e;C++){const V=z[C]=N?Qr(z[C]):yi(z[C]);V.key!=null&&Pe.set(V.key,C)}let Oe,Xe=0;const he=_e-De+1;let j=!1,O=0;const ee=new Array(he);for(C=0;C=he){fe(V,te,we,!0);continue}let W;if(V.key!=null)W=Pe.get(V.key);else for(Oe=De;Oe<=_e;Oe++)if(ee[Oe-De]===0&&Qo(V,z[Oe])){W=Oe;break}W===void 0?fe(V,te,we,!0):(ee[W-De]=C+1,W>=O?O=W:j=!0,_(V,z[W],K,null,te,we,Me,Se,N),Xe++)}const $=j?Ok(ee):Rl;for(Oe=$.length-1,C=he-1;C>=0;C--){const V=De+C,W=z[V],ne=V+1{const{el:we,type:Me,transition:Se,children:N,shapeFlag:C}=M;if(C&6){de(M.component.subTree,z,K,ce);return}if(C&128){M.suspense.move(z,K,ce);return}if(C&64){Me.move(M,z,K,Ce);return}if(Me===it){s(we,z,K);for(let ae=0;aeSe.enter(we),te);else{const{leave:ae,delayLeave:_e,afterLeave:pe}=Se,De=()=>s(we,z,K),Pe=()=>{ae(we,()=>{De(),pe&&pe()})};_e?_e(we,De,Pe):Pe()}else s(we,z,K)},fe=(M,z,K,ce=!1,te=!1)=>{const{type:we,props:Me,ref:Se,children:N,dynamicChildren:C,shapeFlag:Q,patchFlag:ae,dirs:_e,cacheIndex:pe}=M;if(ae===-2&&(te=!1),Se!=null&&$h(Se,null,K,M,!0),pe!=null&&(z.renderCache[pe]=void 0),Q&256){z.ctx.deactivate(M);return}const De=Q&1&&_e,Pe=!Il(M);let Oe;if(Pe&&(Oe=Me&&Me.onVnodeBeforeUnmount)&&di(Oe,z,M),Q&6)me(M.component,K,ce);else{if(Q&128){M.suspense.unmount(K,ce);return}De&&Io(M,null,z,"beforeUnmount"),Q&64?M.type.remove(M,z,K,Ce,ce):C&&!C.hasOnce&&(we!==it||ae>0&&ae&64)?ke(C,z,K,!1,!0):(we===it&&ae&384||!te&&Q&16)&&ke(N,z,K),ce&&Re(M)}(Pe&&(Oe=Me&&Me.onVnodeUnmounted)||De)&&bs(()=>{Oe&&di(Oe,z,M),De&&Io(M,null,z,"unmounted")},K)},Re=M=>{const{type:z,el:K,anchor:ce,transition:te}=M;if(z===it){oe(K,ce);return}if(z===rh){w(M);return}const we=()=>{i(K),te&&!te.persisted&&te.afterLeave&&te.afterLeave()};if(M.shapeFlag&1&&te&&!te.persisted){const{leave:Me,delayLeave:Se}=te,N=()=>Me(K,we);Se?Se(M.el,we,N):N()}else we()},oe=(M,z)=>{let K;for(;M!==z;)K=f(M),i(M),M=K;i(z)},me=(M,z,K)=>{const{bum:ce,scope:te,job:we,subTree:Me,um:Se,m:N,a:C}=M;lb(N),lb(C),ce&&sh(ce),te.stop(),we&&(we.flags|=8,fe(Me,M,z,K)),Se&&bs(Se,z),bs(()=>{M.isUnmounted=!0},z),z&&z.pendingBranch&&!z.isUnmounted&&M.asyncDep&&!M.asyncResolved&&M.suspenseId===z.pendingId&&(z.deps--,z.deps===0&&z.resolve())},ke=(M,z,K,ce=!1,te=!1,we=0)=>{for(let Me=we;Me{if(M.shapeFlag&6)return J(M.component.subTree);if(M.shapeFlag&128)return M.suspense.next();const z=f(M.anchor||M.el),K=z&&z[ek];return K?f(K):z};let Ae=!1;const Ee=(M,z,K)=>{M==null?z._vnode&&fe(z._vnode,null,null,!0):_(z._vnode||null,M,z,null,null,null,K),z._vnode=M,Ae||(Ae=!0,eb(),i3(),Ae=!1)},Ce={p:_,um:fe,m:de,r:Re,mt:D,mc:R,pc:L,pbc:E,n:J,o:t};return{render:Ee,hydrate:void 0,createApp:xk(Ee)}}function Nm({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function Oo({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function Ik(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function I3(t,e,n=!1){const s=t.children,i=e.children;if(Qe(s)&&Qe(i))for(let r=0;r>1,t[n[a]]0&&(e[s]=n[r-1]),n[r]=s)}}for(r=n.length,o=n[r-1];r-- >0;)n[r]=o,o=e[o];return n}function O3(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:O3(e)}function lb(t){if(t)for(let e=0;eRi(Lk);function ma(t,e,n){return L3(t,e,n)}function L3(t,e,n=Nt){const{immediate:s,deep:i,flush:r,once:o}=n,a=mn({},n),l=e&&s||!e&&r!=="post";let c;if(Xu){if(r==="sync"){const h=Dk();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=Mi,h.resume=Mi,h.pause=Mi,h}}const u=wn;a.call=(h,v,_)=>ri(h,u,v,_);let d=!1;r==="post"?a.scheduler=h=>{bs(h,u&&u.suspense)}:r!=="sync"&&(d=!0,a.scheduler=(h,v)=>{v?h():q1(h)}),a.augmentJob=h=>{e&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=Y8(t,e,a);return Xu&&(c?c.push(f):l&&f()),f}function Nk(t,e,n){const s=this.proxy,i=on(t)?t.includes(".")?D3(s,t):()=>s[t]:t.bind(s,s);let r;dt(e)?r=e:(r=e.handler,n=e);const o=Sd(this),a=L3(i,r.bind(s),n);return o(),a}function D3(t,e){const n=e.split(".");return()=>{let s=t;for(let i=0;ie==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Hs(e)}Modifiers`]||t[`${ka(e)}Modifiers`];function Fk(t,e,...n){if(t.isUnmounted)return;const s=t.vnode.props||Nt;let i=n;const r=e.startsWith("update:"),o=r&&Uk(s,e.slice(7));o&&(o.trim&&(i=n.map(u=>on(u)?u.trim():u)),o.number&&(i=n.map(Lh)));let a,l=s[a=Cm(e)]||s[a=Cm(Hs(e))];!l&&r&&(l=s[a=Cm(ka(e))]),l&&ri(l,t,6,i);const c=s[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,ri(c,t,6,i)}}function N3(t,e,n=!1){const s=e.emitsCache,i=s.get(t);if(i!==void 0)return i;const r=t.emits;let o={},a=!1;if(!dt(t)){const l=c=>{const u=N3(c,e,!0);u&&(a=!0,mn(o,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!r&&!a?(Ut(t)&&s.set(t,null),null):(Qe(r)?r.forEach(l=>o[l]=null):mn(o,r),Ut(t)&&s.set(t,o),o)}function Lp(t,e){return!t||!Ep(e)?!1:(e=e.slice(2).replace(/Once$/,""),kt(t,e[0].toLowerCase()+e.slice(1))||kt(t,ka(e))||kt(t,e))}function cb(t){const{type:e,vnode:n,proxy:s,withProxy:i,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:v,inheritAttrs:_}=t,m=Fh(t);let g,y;try{if(n.shapeFlag&4){const w=i||s,T=w;g=yi(c.call(T,w,u,d,h,f,v)),y=a}else{const w=e;g=yi(w.length>1?w(d,{attrs:a,slots:o,emit:l}):w(d,null)),y=e.props?a:$k(a)}}catch(w){Tu.length=0,Pp(w,t,1),g=X(es)}let b=g;if(y&&_!==!1){const w=Object.keys(y),{shapeFlag:T}=b;w.length&&T&7&&(r&&w.some(N1)&&(y=Bk(y,r)),b=go(b,y,!1,!0))}return n.dirs&&(b=go(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&ba(b,n.transition),g=b,Fh(m),g}const $k=t=>{let e;for(const n in t)(n==="class"||n==="style"||Ep(n))&&((e||(e={}))[n]=t[n]);return e},Bk=(t,e)=>{const n={};for(const s in t)(!N1(s)||!(s.slice(9)in e))&&(n[s]=t[s]);return n};function Hk(t,e,n){const{props:s,children:i,component:r}=t,{props:o,children:a,patchFlag:l}=e,c=r.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return s?ub(s,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let d=0;dt.__isSuspense;function zk(t,e){e&&e.pendingBranch?Qe(t)?e.effects.push(...t):e.effects.push(t):Q8(t)}const it=Symbol.for("v-fgt"),Dp=Symbol.for("v-txt"),es=Symbol.for("v-cmt"),rh=Symbol.for("v-stc"),Tu=[];let Ts=null;function Z(t=!1){Tu.push(Ts=t?null:[])}function Vk(){Tu.pop(),Ts=Tu[Tu.length-1]||null}let ju=1;function db(t,e=!1){ju+=t,t<0&&Ts&&e&&(Ts.hasOnce=!0)}function F3(t){return t.dynamicChildren=ju>0?Ts||Rl:null,Vk(),ju>0&&Ts&&Ts.push(t),t}function re(t,e,n,s,i,r){return F3(p(t,e,n,s,i,r,!0))}function Bt(t,e,n,s,i){return F3(X(t,e,n,s,i,!0))}function qu(t){return t?t.__v_isVNode===!0:!1}function Qo(t,e){return t.type===e.type&&t.key===e.key}const $3=({key:t})=>t??null,oh=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?on(t)||un(t)||dt(t)?{i:pn,r:t,k:e,f:!!n}:t:null);function p(t,e=null,n=null,s=0,i=null,r=t===it?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&$3(e),ref:e&&oh(e),scopeId:o3,slotScopeIds:null,children:n,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:pn};return a?(ev(l,n),r&128&&t.normalize(l)):n&&(l.shapeFlag|=on(n)?8:16),ju>0&&!o&&Ts&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&Ts.push(l),l}const X=Wk;function Wk(t,e=null,n=null,s=0,i=null,r=!1){if((!t||t===_3)&&(t=es),qu(t)){const a=go(t,e,!0);return n&&ev(a,n),ju>0&&!r&&Ts&&(a.shapeFlag&6?Ts[Ts.indexOf(t)]=a:Ts.push(a)),a.patchFlag=-2,a}if(tP(t)&&(t=t.__vccOpts),e){e=jk(e);let{class:a,style:l}=e;a&&!on(a)&&(e.class=ds(a)),Ut(l)&&(wd(l)&&!Qe(l)&&(l=mn({},l)),e.style=Mp(l))}const o=on(t)?1:U3(t)?128:a3(t)?64:Ut(t)?4:dt(t)?2:0;return p(t,e,n,s,i,o,r,!0)}function jk(t){return t?wd(t)||T3(t)?mn({},t):t:null}function go(t,e,n=!1,s=!1){const{props:i,ref:r,patchFlag:o,children:a,transition:l}=t,c=e?Np(i||{},e):i,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&$3(c),ref:e&&e.ref?n&&r?Qe(r)?r.concat(oh(e)):[r,oh(e)]:oh(e):r,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==it?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&go(t.ssContent),ssFallback:t.ssFallback&&go(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&s&&ba(u,l.clone(u)),u}function ye(t=" ",e=0){return X(Dp,null,t,e)}function _o(t,e){const n=X(rh,null,t);return n.staticCount=e,n}function He(t="",e=!1){return e?(Z(),Bt(es,null,t)):X(es,null,t)}function yi(t){return t==null||typeof t=="boolean"?X(es):Qe(t)?X(it,null,t.slice()):qu(t)?Qr(t):X(Dp,null,String(t))}function Qr(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:go(t)}function ev(t,e){let n=0;const{shapeFlag:s}=t;if(e==null)e=null;else if(Qe(e))n=16;else if(typeof e=="object")if(s&65){const i=e.default;i&&(i._c&&(i._d=!1),ev(t,i()),i._c&&(i._d=!0));return}else{n=32;const i=e._;!i&&!T3(e)?e._ctx=pn:i===3&&pn&&(pn.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else dt(e)?(e={default:e,_ctx:pn},n=32):(e=String(e),s&64?(n=16,e=[ye(e)]):n=8);t.children=e,t.shapeFlag|=n}function Np(...t){const e={};for(let n=0;nwn||pn;let Hh,O_;{const t=Ap(),e=(n,s)=>{let i;return(i=t[n])||(i=t[n]=[]),i.push(s),r=>{i.length>1?i.forEach(o=>o(r)):i[0](r)}};Hh=e("__VUE_INSTANCE_SETTERS__",n=>wn=n),O_=e("__VUE_SSR_SETTERS__",n=>Xu=n)}const Sd=t=>{const e=wn;return Hh(t),t.scope.on(),()=>{t.scope.off(),Hh(e)}},fb=()=>{wn&&wn.scope.off(),Hh(null)};function H3(t){return t.vnode.shapeFlag&4}let Xu=!1;function Yk(t,e=!1,n=!1){e&&O_(e);const{props:s,children:i}=t.vnode,r=H3(t);Sk(t,s,r,e),Rk(t,i,n);const o=r?Zk(t,e):void 0;return e&&O_(!1),o}function Zk(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,mk);const{setup:s}=n;if(s){Ao();const i=t.setupContext=s.length>1?Qk(t):null,r=Sd(t),o=xd(s,t,0,[t.props,i]),a=RT(o);if(Mo(),r(),(a||t.sp)&&!Il(t)&&h3(t),a){if(o.then(fb,fb),e)return o.then(l=>{hb(t,l)}).catch(l=>{Pp(l,t,0)});t.asyncDep=o}else hb(t,o)}else G3(t)}function hb(t,e,n){dt(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Ut(e)&&(t.setupState=t3(e)),G3(t)}function G3(t,e,n){const s=t.type;t.render||(t.render=s.render||Mi);{const i=Sd(t);Ao();try{gk(t)}finally{Mo(),i()}}}const Jk={get(t,e){return Nn(t,"get",""),t[e]}};function Qk(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,Jk),slots:t.slots,emit:t.emit,expose:e}}function Up(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(t3(j1(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Su)return Su[n](t)},has(e,n){return n in e||n in Su}})):t.proxy}function eP(t,e=!0){return dt(t)?t.displayName||t.name:t.name||e&&t.__name}function tP(t){return dt(t)&&"__vccOpts"in t}const ln=(t,e)=>X8(t,e,Xu);function wa(t,e,n){const s=arguments.length;return s===2?Ut(e)&&!Qe(e)?qu(e)?X(t,null,[e]):X(t,e):X(t,null,e):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&qu(n)&&(n=[n]),X(t,e,n))}const z3="3.5.13";/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let L_;const pb=typeof window<"u"&&window.trustedTypes;if(pb)try{L_=pb.createPolicy("vue",{createHTML:t=>t})}catch{}const V3=L_?t=>L_.createHTML(t):t=>t,nP="http://www.w3.org/2000/svg",sP="http://www.w3.org/1998/Math/MathML",nr=typeof document<"u"?document:null,mb=nr&&nr.createElement("template"),iP={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,s)=>{const i=e==="svg"?nr.createElementNS(nP,t):e==="mathml"?nr.createElementNS(sP,t):n?nr.createElement(t,{is:n}):nr.createElement(t);return t==="select"&&s&&s.multiple!=null&&i.setAttribute("multiple",s.multiple),i},createText:t=>nr.createTextNode(t),createComment:t=>nr.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>nr.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,s,i,r){const o=n?n.previousSibling:e.lastChild;if(i&&(i===r||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),n),!(i===r||!(i=i.nextSibling)););else{mb.innerHTML=V3(s==="svg"?`${t}`:s==="mathml"?`${t}`:t);const a=mb.content;if(s==="svg"||s==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[o?o.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},Ir="transition",Uc="animation",jl=Symbol("_vtc"),W3={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},j3=mn({},c3,W3),rP=t=>(t.displayName="Transition",t.props=j3,t),oP=rP((t,{slots:e})=>wa(nk,q3(t),e)),Lo=(t,e=[])=>{Qe(t)?t.forEach(n=>n(...e)):t&&t(...e)},gb=t=>t?Qe(t)?t.some(e=>e.length>1):t.length>1:!1;function q3(t){const e={};for(const U in t)U in W3||(e[U]=t[U]);if(t.css===!1)return e;const{name:n="v",type:s,duration:i,enterFromClass:r=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=r,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=t,v=aP(i),_=v&&v[0],m=v&&v[1],{onBeforeEnter:g,onEnter:y,onEnterCancelled:b,onLeave:w,onLeaveCancelled:T,onBeforeAppear:S=g,onAppear:A=y,onAppearCancelled:R=b}=e,x=(U,H,D,I)=>{U._enterCancelled=I,jr(U,H?u:a),jr(U,H?c:o),D&&D()},E=(U,H)=>{U._isLeaving=!1,jr(U,d),jr(U,h),jr(U,f),H&&H()},k=U=>(H,D)=>{const I=U?A:y,P=()=>x(H,U,D);Lo(I,[H,P]),_b(()=>{jr(H,U?l:r),pi(H,U?u:a),gb(I)||vb(H,s,_,P)})};return mn(e,{onBeforeEnter(U){Lo(g,[U]),pi(U,r),pi(U,o)},onBeforeAppear(U){Lo(S,[U]),pi(U,l),pi(U,c)},onEnter:k(!1),onAppear:k(!0),onLeave(U,H){U._isLeaving=!0;const D=()=>E(U,H);pi(U,d),U._enterCancelled?(pi(U,f),D_()):(D_(),pi(U,f)),_b(()=>{U._isLeaving&&(jr(U,d),pi(U,h),gb(w)||vb(U,s,m,D))}),Lo(w,[U,D])},onEnterCancelled(U){x(U,!1,void 0,!0),Lo(b,[U])},onAppearCancelled(U){x(U,!0,void 0,!0),Lo(R,[U])},onLeaveCancelled(U){E(U),Lo(T,[U])}})}function aP(t){if(t==null)return null;if(Ut(t))return[Um(t.enter),Um(t.leave)];{const e=Um(t);return[e,e]}}function Um(t){return p8(t)}function pi(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[jl]||(t[jl]=new Set)).add(e)}function jr(t,e){e.split(/\s+/).forEach(s=>s&&t.classList.remove(s));const n=t[jl];n&&(n.delete(e),n.size||(t[jl]=void 0))}function _b(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let lP=0;function vb(t,e,n,s){const i=t._endId=++lP,r=()=>{i===t._endId&&s()};if(n!=null)return setTimeout(r,n);const{type:o,timeout:a,propCount:l}=X3(t,e);if(!o)return s();const c=o+"end";let u=0;const d=()=>{t.removeEventListener(c,f),r()},f=h=>{h.target===t&&++u>=l&&d()};setTimeout(()=>{u(n[v]||"").split(", "),i=s(`${Ir}Delay`),r=s(`${Ir}Duration`),o=yb(i,r),a=s(`${Uc}Delay`),l=s(`${Uc}Duration`),c=yb(a,l);let u=null,d=0,f=0;e===Ir?o>0&&(u=Ir,d=o,f=r.length):e===Uc?c>0&&(u=Uc,d=c,f=l.length):(d=Math.max(o,c),u=d>0?o>c?Ir:Uc:null,f=u?u===Ir?r.length:l.length:0);const h=u===Ir&&/\b(transform|all)(,|$)/.test(s(`${Ir}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function yb(t,e){for(;t.lengthbb(n)+bb(t[s])))}function bb(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function D_(){return document.body.offsetHeight}function cP(t,e,n){const s=t[jl];s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const Gh=Symbol("_vod"),K3=Symbol("_vsh"),zh={beforeMount(t,{value:e},{transition:n}){t[Gh]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):Fc(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:s}){!e!=!n&&(s?e?(s.beforeEnter(t),Fc(t,!0),s.enter(t)):s.leave(t,()=>{Fc(t,!1)}):Fc(t,e))},beforeUnmount(t,{value:e}){Fc(t,e)}};function Fc(t,e){t.style.display=e?t[Gh]:"none",t[K3]=!e}const uP=Symbol(""),dP=/(^|;)\s*display\s*:/;function fP(t,e,n){const s=t.style,i=on(n);let r=!1;if(n&&!i){if(e)if(on(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&ah(s,a,"")}else for(const o in e)n[o]==null&&ah(s,o,"");for(const o in n)o==="display"&&(r=!0),ah(s,o,n[o])}else if(i){if(e!==n){const o=s[uP];o&&(n+=";"+o),s.cssText=n,r=dP.test(n)}}else e&&t.removeAttribute("style");Gh in t&&(t[Gh]=r?s.display:"",t[K3]&&(s.display="none"))}const wb=/\s*!important$/;function ah(t,e,n){if(Qe(n))n.forEach(s=>ah(t,e,s));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const s=hP(t,e);wb.test(n)?t.setProperty(ka(s),n.replace(wb,""),"important"):t[s]=n}}const xb=["Webkit","Moz","ms"],Fm={};function hP(t,e){const n=Fm[e];if(n)return n;let s=Hs(e);if(s!=="filter"&&s in t)return Fm[e]=s;s=Tp(s);for(let i=0;i$m||(_P.then(()=>$m=0),$m=Date.now());function yP(t,e){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;ri(bP(s,n.value),e,5,[s])};return n.value=t,n.attached=vP(),n}function bP(t,e){if(Qe(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(s=>i=>!i._stopped&&s&&s(i))}else return e}const Rb=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,wP=(t,e,n,s,i,r)=>{const o=i==="svg";e==="class"?cP(t,s,o):e==="style"?fP(t,n,s):Ep(e)?N1(e)||mP(t,e,n,s,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):xP(t,e,s,o))?(Tb(t,e,s),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Sb(t,e,s,o,r,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!on(s))?Tb(t,Hs(e),s,r,e):(e==="true-value"?t._trueValue=s:e==="false-value"&&(t._falseValue=s),Sb(t,e,s,o))};function xP(t,e,n,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in t&&Rb(e)&&dt(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=t.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Rb(e)&&on(n)?!1:e in t}const Y3=new WeakMap,Z3=new WeakMap,Vh=Symbol("_moveCb"),Cb=Symbol("_enterCb"),EP=t=>(delete t.props.mode,t),SP=EP({name:"TransitionGroup",props:mn({},j3,{tag:String,moveClass:String}),setup(t,{slots:e}){const n=B3(),s=l3();let i,r;return m3(()=>{if(!i.length)return;const o=t.moveClass||`${t.name||"v"}-move`;if(!CP(i[0].el,n.vnode.el,o))return;i.forEach(AP),i.forEach(MP);const a=i.filter(RP);D_(),a.forEach(l=>{const c=l.el,u=c.style;pi(c,o),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[Vh]=f=>{f&&f.target!==c||(!f||/transform$/.test(f.propertyName))&&(c.removeEventListener("transitionend",d),c[Vh]=null,jr(c,o))};c.addEventListener("transitionend",d)})}),()=>{const o=_t(t),a=q3(o);let l=o.tag||it;if(i=[],r)for(let c=0;c{a.split(/\s+/).forEach(l=>l&&s.classList.remove(l))}),n.split(/\s+/).forEach(a=>a&&s.classList.add(a)),s.style.display="none";const r=e.nodeType===1?e:e.parentNode;r.appendChild(s);const{hasTransform:o}=X3(s);return r.removeChild(s),o}const ql=t=>{const e=t.props["onUpdate:modelValue"]||!1;return Qe(e)?n=>sh(e,n):e};function kP(t){t.target.composing=!0}function kb(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const hr=Symbol("_assign"),et={created(t,{modifiers:{lazy:e,trim:n,number:s}},i){t[hr]=ql(i);const r=s||i.props&&i.props.type==="number";so(t,e?"change":"input",o=>{if(o.target.composing)return;let a=t.value;n&&(a=a.trim()),r&&(a=Lh(a)),t[hr](a)}),n&&so(t,"change",()=>{t.value=t.value.trim()}),e||(so(t,"compositionstart",kP),so(t,"compositionend",kb),so(t,"change",kb))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:s,trim:i,number:r}},o){if(t[hr]=ql(o),t.composing)return;const a=(r||t.type==="number")&&!/^0\d/.test(t.value)?Lh(t.value):t.value,l=e??"";a!==l&&(document.activeElement===t&&t.type!=="range"&&(s&&e===n||i&&t.value.trim()===l)||(t.value=l))}},J3={deep:!0,created(t,e,n){t[hr]=ql(n),so(t,"change",()=>{const s=t._modelValue,i=Ku(t),r=t.checked,o=t[hr];if(Qe(s)){const a=$1(s,i),l=a!==-1;if(r&&!l)o(s.concat(i));else if(!r&&l){const c=[...s];c.splice(a,1),o(c)}}else if(mc(s)){const a=new Set(s);r?a.add(i):a.delete(i),o(a)}else o(Q3(t,r))})},mounted:Pb,beforeUpdate(t,e,n){t[hr]=ql(n),Pb(t,e,n)}};function Pb(t,{value:e,oldValue:n},s){t._modelValue=e;let i;if(Qe(e))i=$1(e,s.props.value)>-1;else if(mc(e))i=e.has(s.props.value);else{if(e===n)return;i=bd(e,Q3(t,!0))}t.checked!==i&&(t.checked=i)}const Td={deep:!0,created(t,{value:e,modifiers:{number:n}},s){const i=mc(e);so(t,"change",()=>{const r=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>n?Lh(Ku(o)):Ku(o));t[hr](t.multiple?i?new Set(r):r:r[0]),t._assigning=!0,Ed(()=>{t._assigning=!1})}),t[hr]=ql(s)},mounted(t,{value:e}){Ib(t,e)},beforeUpdate(t,e,n){t[hr]=ql(n)},updated(t,{value:e}){t._assigning||Ib(t,e)}};function Ib(t,e){const n=t.multiple,s=Qe(e);if(!(n&&!s&&!mc(e))){for(let i=0,r=t.options.length;iString(c)===String(a)):o.selected=$1(e,a)>-1}else o.selected=e.has(a);else if(bd(Ku(o),e)){t.selectedIndex!==i&&(t.selectedIndex=i);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Ku(t){return"_value"in t?t._value:t.value}function Q3(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const PP=["ctrl","shift","alt","meta"],IP={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>PP.some(n=>t[`${n}Key`]&&!e.includes(n))},OP=(t,e)=>{const n=t._withMods||(t._withMods={}),s=e.join(".");return n[s]||(n[s]=(i,...r)=>{for(let o=0;o{const e=DP().createApp(...t),{mount:n}=e;return e.mount=s=>{const i=FP(s);if(!i)return;const r=e._component;!dt(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=n(i,!1,UP(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e};function UP(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function FP(t){return on(t)?document.querySelector(t):t}const $P="modulepreload",BP=function(t){return"/develop/"+t},Lb={},HP=function(e,n,s){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=BP(l),l in Lb)return;Lb[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":$P,c||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),c)return new Promise((f,h)=>{d.addEventListener("load",f),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};function GP(){class t{constructor(){xe(this,"hasUpdate",!1);xe(this,"updateSW");xe(this,"updateCallback")}updatePreparing(){return!1}updatePending(){return!1}async checkForUpdate(n,s){if(this.updateCallback=s,!this.updateSW)try{const i=this,{registerSW:r}=await HP(async()=>{const{registerSW:o}=await import("./virtual_pwa-register-T0LD5wEJ.js");return{registerSW:o}},[]);this.updateSW=r({immediate:!0,onOfflineReady(){console.log("PWA offline ready")},onNeedRefresh(){i.hasUpdate=!0,i.updateCallback&&i.updateCallback(i.hasUpdate)},onRegistered(o){},onRegisterError(o){}})}catch{console.log("PWA disabled")}}async update(n){this.hasUpdate&&(this.hasUpdate=!1,this.updateSW&&this.updateSW(!0))}async finishUpdate(){}}return new t}function zP(){try{throw new Error("new.App undefined")}catch{return console.log("Registering PWA updater"),GP()}}const ra=zP();/*! + * vue-router v4.5.0 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */const hl=typeof document<"u";function eA(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function VP(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&eA(t.default)}const Ct=Object.assign;function Bm(t,e){const n={};for(const s in e){const i=e[s];n[s]=oi(i)?i.map(t):t(i)}return n}const Au=()=>{},oi=Array.isArray,tA=/#/g,WP=/&/g,jP=/\//g,qP=/=/g,XP=/\?/g,nA=/\+/g,KP=/%5B/g,YP=/%5D/g,sA=/%5E/g,ZP=/%60/g,iA=/%7B/g,JP=/%7C/g,rA=/%7D/g,QP=/%20/g;function tv(t){return encodeURI(""+t).replace(JP,"|").replace(KP,"[").replace(YP,"]")}function eI(t){return tv(t).replace(iA,"{").replace(rA,"}").replace(sA,"^")}function N_(t){return tv(t).replace(nA,"%2B").replace(QP,"+").replace(tA,"%23").replace(WP,"%26").replace(ZP,"`").replace(iA,"{").replace(rA,"}").replace(sA,"^")}function tI(t){return N_(t).replace(qP,"%3D")}function nI(t){return tv(t).replace(tA,"%23").replace(XP,"%3F")}function sI(t){return t==null?"":nI(t).replace(jP,"%2F")}function Yu(t){try{return decodeURIComponent(""+t)}catch{}return""+t}const iI=/\/$/,rI=t=>t.replace(iI,"");function Hm(t,e,n="/"){let s,i={},r="",o="";const a=e.indexOf("#");let l=e.indexOf("?");return a=0&&(l=-1),l>-1&&(s=e.slice(0,l),r=e.slice(l+1,a>-1?a:e.length),i=t(r)),a>-1&&(s=s||e.slice(0,a),o=e.slice(a,e.length)),s=cI(s??e,n),{fullPath:s+(r&&"?")+r+o,path:s,query:i,hash:Yu(o)}}function oI(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function Db(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function aI(t,e,n){const s=e.matched.length-1,i=n.matched.length-1;return s>-1&&s===i&&Xl(e.matched[s],n.matched[i])&&oA(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function Xl(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function oA(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(!lI(t[n],e[n]))return!1;return!0}function lI(t,e){return oi(t)?Nb(t,e):oi(e)?Nb(e,t):t===e}function Nb(t,e){return oi(e)?t.length===e.length&&t.every((n,s)=>n===e[s]):t.length===1&&t[0]===e}function cI(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),s=t.split("/"),i=s[s.length-1];(i===".."||i===".")&&s.push("");let r=n.length-1,o,a;for(o=0;o1&&r--;else break;return n.slice(0,r).join("/")+"/"+s.slice(o).join("/")}const Or={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Zu;(function(t){t.pop="pop",t.push="push"})(Zu||(Zu={}));var Mu;(function(t){t.back="back",t.forward="forward",t.unknown=""})(Mu||(Mu={}));function uI(t){if(!t)if(hl){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),rI(t)}const dI=/^[^#]+#/;function fI(t,e){return t.replace(dI,"#")+e}function hI(t,e){const n=document.documentElement.getBoundingClientRect(),s=t.getBoundingClientRect();return{behavior:e.behavior,left:s.left-n.left-(e.left||0),top:s.top-n.top-(e.top||0)}}const Fp=()=>({left:window.scrollX,top:window.scrollY});function pI(t){let e;if("el"in t){const n=t.el,s=typeof n=="string"&&n.startsWith("#"),i=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;e=hI(i,t)}else e=t;"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 Ub(t,e){return(history.state?history.state.position-e:-1)+t}const U_=new Map;function mI(t,e){U_.set(t,e)}function gI(t){const e=U_.get(t);return U_.delete(t),e}let _I=()=>location.protocol+"//"+location.host;function aA(t,e){const{pathname:n,search:s,hash:i}=e,r=t.indexOf("#");if(r>-1){let a=i.includes(t.slice(r))?t.slice(r).length:1,l=i.slice(a);return l[0]!=="/"&&(l="/"+l),Db(l,"")}return Db(n,t)+s+i}function vI(t,e,n,s){let i=[],r=[],o=null;const a=({state:f})=>{const h=aA(t,location),v=n.value,_=e.value;let m=0;if(f){if(n.value=h,e.value=f,o&&o===v){o=null;return}m=_?f.position-_.position:0}else s(h);i.forEach(g=>{g(n.value,v,{delta:m,type:Zu.pop,direction:m?m>0?Mu.forward:Mu.back:Mu.unknown})})};function l(){o=n.value}function c(f){i.push(f);const h=()=>{const v=i.indexOf(f);v>-1&&i.splice(v,1)};return r.push(h),h}function u(){const{history:f}=window;f.state&&f.replaceState(Ct({},f.state,{scroll:Fp()}),"")}function d(){for(const f of r)f();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:l,listen:c,destroy:d}}function Fb(t,e,n,s=!1,i=!1){return{back:t,current:e,forward:n,replaced:s,position:window.history.length,scroll:i?Fp():null}}function yI(t){const{history:e,location:n}=window,s={value:aA(t,n)},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(l,c,u){const d=t.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?t:t.slice(d))+l:_I()+t+l;try{e[u?"replaceState":"pushState"](c,"",f),i.value=c}catch(h){console.error(h),n[u?"replace":"assign"](f)}}function o(l,c){const u=Ct({},e.state,Fb(i.value.back,l,i.value.forward,!0),c,{position:i.value.position});r(l,u,!0),s.value=l}function a(l,c){const u=Ct({},i.value,e.state,{forward:l,scroll:Fp()});r(u.current,u,!0);const d=Ct({},Fb(s.value,l,null),{position:u.position+1},c);r(l,d,!1),s.value=l}return{location:s,state:i,push:a,replace:o}}function bI(t){t=uI(t);const e=yI(t),n=vI(t,e.state,e.location,e.replace);function s(r,o=!0){o||n.pauseListeners(),history.go(r)}const i=Ct({location:"",base:t,go:s,createHref:fI.bind(null,t)},e,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>e.state.value}),i}function wI(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),bI(t)}function xI(t){return typeof t=="string"||t&&typeof t=="object"}function lA(t){return typeof t=="string"||typeof t=="symbol"}const cA=Symbol("");var $b;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})($b||($b={}));function Kl(t,e){return Ct(new Error,{type:t,[cA]:!0},e)}function Vi(t,e){return t instanceof Error&&cA in t&&(e==null||!!(t.type&e))}const Bb="[^/]+?",EI={sensitive:!1,strict:!1,start:!0,end:!0},SI=/[.+*?^${}()[\]/\\]/g;function TI(t,e){const n=Ct({},EI,e),s=[];let i=n.start?"^":"";const r=[];for(const c of t){const u=c.length?[]:[90];n.strict&&!c.length&&(i+="/");for(let d=0;de.length?e.length===1&&e[0]===80?1:-1:0}function uA(t,e){let n=0;const s=t.score,i=e.score;for(;n0&&e[e.length-1]<0}const MI={type:0,value:""},RI=/[a-zA-Z0-9_]/;function CI(t){if(!t)return[[]];if(t==="/")return[[MI]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(h){throw new Error(`ERR (${n})/"${c}": ${h}`)}let n=0,s=n;const i=[];let r;function o(){r&&i.push(r),r=[]}let a=0,l,c="",u="";function d(){c&&(n===0?r.push({type:0,value:c}):n===1||n===2||n===3?(r.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function f(){c+=l}for(;a{o(b)}:Au}function o(d){if(lA(d)){const f=s.get(d);f&&(s.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(o),f.alias.forEach(o))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&s.delete(d.record.name),d.children.forEach(o),d.alias.forEach(o))}}function a(){return n}function l(d){const f=LI(d,n);n.splice(f,0,d),d.record.name&&!Vb(d)&&s.set(d.record.name,d)}function c(d,f){let h,v={},_,m;if("name"in d&&d.name){if(h=s.get(d.name),!h)throw Kl(1,{location:d});m=h.record.name,v=Ct(Gb(f.params,h.keys.filter(b=>!b.optional).concat(h.parent?h.parent.keys.filter(b=>b.optional):[]).map(b=>b.name)),d.params&&Gb(d.params,h.keys.map(b=>b.name))),_=h.stringify(v)}else if(d.path!=null)_=d.path,h=n.find(b=>b.re.test(_)),h&&(v=h.parse(_),m=h.record.name);else{if(h=f.name?s.get(f.name):n.find(b=>b.re.test(f.path)),!h)throw Kl(1,{location:d,currentLocation:f});m=h.record.name,v=Ct({},f.params,d.params),_=h.stringify(v)}const g=[];let y=h;for(;y;)g.unshift(y.record),y=y.parent;return{name:m,path:_,params:v,matched:g,meta:OI(g)}}t.forEach(d=>r(d));function u(){n.length=0,s.clear()}return{addRoute:r,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:a,getRecordMatcher:i}}function Gb(t,e){const n={};for(const s of e)s in t&&(n[s]=t[s]);return n}function zb(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:II(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function II(t){const e={},n=t.props||!1;if("component"in t)e.default=n;else for(const s in t.components)e[s]=typeof n=="object"?n[s]:n;return e}function Vb(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function OI(t){return t.reduce((e,n)=>Ct(e,n.meta),{})}function Wb(t,e){const n={};for(const s in t)n[s]=s in e?e[s]:t[s];return n}function LI(t,e){let n=0,s=e.length;for(;n!==s;){const r=n+s>>1;uA(t,e[r])<0?s=r:n=r+1}const i=DI(t);return i&&(s=e.lastIndexOf(i,s-1)),s}function DI(t){let e=t;for(;e=e.parent;)if(dA(e)&&uA(t,e)===0)return e}function dA({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function NI(t){const e={};if(t===""||t==="?")return e;const s=(t[0]==="?"?t.slice(1):t).split("&");for(let i=0;ir&&N_(r)):[s&&N_(s)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+n,r!=null&&(e+="="+r))})}return e}function UI(t){const e={};for(const n in t){const s=t[n];s!==void 0&&(e[n]=oi(s)?s.map(i=>i==null?null:""+i):s==null?s:""+s)}return e}const FI=Symbol(""),qb=Symbol(""),nv=Symbol(""),fA=Symbol(""),F_=Symbol("");function $c(){let t=[];function e(s){return t.push(s),()=>{const i=t.indexOf(s);i>-1&&t.splice(i,1)}}function n(){t=[]}return{add:e,list:()=>t.slice(),reset:n}}function eo(t,e,n,s,i,r=o=>o()){const o=s&&(s.enterCallbacks[i]=s.enterCallbacks[i]||[]);return()=>new Promise((a,l)=>{const c=f=>{f===!1?l(Kl(4,{from:n,to:e})):f instanceof Error?l(f):xI(f)?l(Kl(2,{from:e,to:f})):(o&&s.enterCallbacks[i]===o&&typeof f=="function"&&o.push(f),a())},u=r(()=>t.call(s&&s.instances[i],e,n,c));let d=Promise.resolve(u);t.length<3&&(d=d.then(c)),d.catch(f=>l(f))})}function Gm(t,e,n,s,i=r=>r()){const r=[];for(const o of t)for(const a in o.components){let l=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(eA(l)){const u=(l.__vccOpts||l)[e];u&&r.push(eo(u,n,s,o,a,i))}else{let c=l();r.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const d=VP(u)?u.default:u;o.mods[a]=u,o.components[a]=d;const h=(d.__vccOpts||d)[e];return h&&eo(h,n,s,o,a,i)()}))}}return r}function Xb(t){const e=Ri(nv),n=Ri(fA),s=ln(()=>{const l=kl(t.to);return e.resolve(l)}),i=ln(()=>{const{matched:l}=s.value,{length:c}=l,u=l[c-1],d=n.matched;if(!u||!d.length)return-1;const f=d.findIndex(Xl.bind(null,u));if(f>-1)return f;const h=Kb(l[c-2]);return c>1&&Kb(u)===h&&d[d.length-1].path!==h?d.findIndex(Xl.bind(null,l[c-2])):f}),r=ln(()=>i.value>-1&&GI(n.params,s.value.params)),o=ln(()=>i.value>-1&&i.value===n.matched.length-1&&oA(n.params,s.value.params));function a(l={}){if(HI(l)){const c=e[kl(t.replace)?"replace":"push"](kl(t.to)).catch(Au);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:s,href:ln(()=>s.value.href),isActive:r,isExactActive:o,navigate:a}}function $I(t){return t.length===1?t[0]:t}const BI=nt({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"}},useLink:Xb,setup(t,{slots:e}){const n=gc(Xb(t)),{options:s}=Ri(nv),i=ln(()=>({[Yb(t.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Yb(t.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const r=e.default&&$I(e.default(n));return t.custom?r:wa("a",{"aria-current":n.isExactActive?t.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}}),hA=BI;function HI(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function GI(t,e){for(const n in e){const s=e[n],i=t[n];if(typeof s=="string"){if(s!==i)return!1}else if(!oi(i)||i.length!==s.length||s.some((r,o)=>r!==i[o]))return!1}return!0}function Kb(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const Yb=(t,e,n)=>t??e??n,zI=nt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:n}){const s=Ri(F_),i=ln(()=>t.route||s.value),r=Ri(qb,0),o=ln(()=>{let c=kl(r);const{matched:u}=i.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=ln(()=>i.value.matched[o.value]);ih(qb,ln(()=>o.value+1)),ih(FI,a),ih(F_,i);const l=Cp();return ma(()=>[l.value,a.value,t.name],([c,u,d],[f,h,v])=>{u&&(u.instances[d]=c,h&&h!==u&&c&&c===f&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!Xl(u,h)||!f)&&(u.enterCallbacks[d]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=i.value,u=t.name,d=a.value,f=d&&d.components[u];if(!f)return Zb(n.default,{Component:f,route:c});const h=d.props[u],v=h?h===!0?c.params:typeof h=="function"?h(c):h:null,m=wa(f,Ct({},v,e,{onVnodeUnmounted:g=>{g.component.isUnmounted&&(d.instances[u]=null)},ref:l}));return Zb(n.default,{Component:m,route:c})||m}}});function Zb(t,e){if(!t)return null;const n=t(e);return n.length===1?n[0]:n}const pA=zI;function VI(t){const e=PI(t.routes,t),n=t.parseQuery||NI,s=t.stringifyQuery||jb,i=t.history,r=$c(),o=$c(),a=$c(),l=kp(Or);let c=Or;hl&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Bm.bind(null,J=>""+J),d=Bm.bind(null,sI),f=Bm.bind(null,Yu);function h(J,Ae){let Ee,Ce;return lA(J)?(Ee=e.getRecordMatcher(J),Ce=Ae):Ce=J,e.addRoute(Ce,Ee)}function v(J){const Ae=e.getRecordMatcher(J);Ae&&e.removeRoute(Ae)}function _(){return e.getRoutes().map(J=>J.record)}function m(J){return!!e.getRecordMatcher(J)}function g(J,Ae){if(Ae=Ct({},Ae||l.value),typeof J=="string"){const K=Hm(n,J,Ae.path),ce=e.resolve({path:K.path},Ae),te=i.createHref(K.fullPath);return Ct(K,ce,{params:f(ce.params),hash:Yu(K.hash),redirectedFrom:void 0,href:te})}let Ee;if(J.path!=null)Ee=Ct({},J,{path:Hm(n,J.path,Ae.path).path});else{const K=Ct({},J.params);for(const ce in K)K[ce]==null&&delete K[ce];Ee=Ct({},J,{params:d(K)}),Ae.params=d(Ae.params)}const Ce=e.resolve(Ee,Ae),Ge=J.hash||"";Ce.params=u(f(Ce.params));const M=oI(s,Ct({},J,{hash:eI(Ge),path:Ce.path})),z=i.createHref(M);return Ct({fullPath:M,hash:Ge,query:s===jb?UI(J.query):J.query||{}},Ce,{redirectedFrom:void 0,href:z})}function y(J){return typeof J=="string"?Hm(n,J,l.value.path):Ct({},J)}function b(J,Ae){if(c!==J)return Kl(8,{from:Ae,to:J})}function w(J){return A(J)}function T(J){return w(Ct(y(J),{replace:!0}))}function S(J){const Ae=J.matched[J.matched.length-1];if(Ae&&Ae.redirect){const{redirect:Ee}=Ae;let Ce=typeof Ee=="function"?Ee(J):Ee;return typeof Ce=="string"&&(Ce=Ce.includes("?")||Ce.includes("#")?Ce=y(Ce):{path:Ce},Ce.params={}),Ct({query:J.query,hash:J.hash,params:Ce.path!=null?{}:J.params},Ce)}}function A(J,Ae){const Ee=c=g(J),Ce=l.value,Ge=J.state,M=J.force,z=J.replace===!0,K=S(Ee);if(K)return A(Ct(y(K),{state:typeof K=="object"?Ct({},Ge,K.state):Ge,force:M,replace:z}),Ae||Ee);const ce=Ee;ce.redirectedFrom=Ae;let te;return!M&&aI(s,Ce,Ee)&&(te=Kl(16,{to:ce,from:Ce}),de(Ce,Ce,!0,!1)),(te?Promise.resolve(te):E(ce,Ce)).catch(we=>Vi(we)?Vi(we,2)?we:q(we):L(we,ce,Ce)).then(we=>{if(we){if(Vi(we,2))return A(Ct({replace:z},y(we.to),{state:typeof we.to=="object"?Ct({},Ge,we.to.state):Ge,force:M}),Ae||ce)}else we=U(ce,Ce,!0,z,Ge);return k(ce,Ce,we),we})}function R(J,Ae){const Ee=b(J,Ae);return Ee?Promise.reject(Ee):Promise.resolve()}function x(J){const Ae=oe.values().next().value;return Ae&&typeof Ae.runWithContext=="function"?Ae.runWithContext(J):J()}function E(J,Ae){let Ee;const[Ce,Ge,M]=WI(J,Ae);Ee=Gm(Ce.reverse(),"beforeRouteLeave",J,Ae);for(const K of Ce)K.leaveGuards.forEach(ce=>{Ee.push(eo(ce,J,Ae))});const z=R.bind(null,J,Ae);return Ee.push(z),ke(Ee).then(()=>{Ee=[];for(const K of r.list())Ee.push(eo(K,J,Ae));return Ee.push(z),ke(Ee)}).then(()=>{Ee=Gm(Ge,"beforeRouteUpdate",J,Ae);for(const K of Ge)K.updateGuards.forEach(ce=>{Ee.push(eo(ce,J,Ae))});return Ee.push(z),ke(Ee)}).then(()=>{Ee=[];for(const K of M)if(K.beforeEnter)if(oi(K.beforeEnter))for(const ce of K.beforeEnter)Ee.push(eo(ce,J,Ae));else Ee.push(eo(K.beforeEnter,J,Ae));return Ee.push(z),ke(Ee)}).then(()=>(J.matched.forEach(K=>K.enterCallbacks={}),Ee=Gm(M,"beforeRouteEnter",J,Ae,x),Ee.push(z),ke(Ee))).then(()=>{Ee=[];for(const K of o.list())Ee.push(eo(K,J,Ae));return Ee.push(z),ke(Ee)}).catch(K=>Vi(K,8)?K:Promise.reject(K))}function k(J,Ae,Ee){a.list().forEach(Ce=>x(()=>Ce(J,Ae,Ee)))}function U(J,Ae,Ee,Ce,Ge){const M=b(J,Ae);if(M)return M;const z=Ae===Or,K=hl?history.state:{};Ee&&(Ce||z?i.replace(J.fullPath,Ct({scroll:z&&K&&K.scroll},Ge)):i.push(J.fullPath,Ge)),l.value=J,de(J,Ae,Ee,z),q()}let H;function D(){H||(H=i.listen((J,Ae,Ee)=>{if(!me.listening)return;const Ce=g(J),Ge=S(Ce);if(Ge){A(Ct(Ge,{replace:!0,force:!0}),Ce).catch(Au);return}c=Ce;const M=l.value;hl&&mI(Ub(M.fullPath,Ee.delta),Fp()),E(Ce,M).catch(z=>Vi(z,12)?z:Vi(z,2)?(A(Ct(y(z.to),{force:!0}),Ce).then(K=>{Vi(K,20)&&!Ee.delta&&Ee.type===Zu.pop&&i.go(-1,!1)}).catch(Au),Promise.reject()):(Ee.delta&&i.go(-Ee.delta,!1),L(z,Ce,M))).then(z=>{z=z||U(Ce,M,!1),z&&(Ee.delta&&!Vi(z,8)?i.go(-Ee.delta,!1):Ee.type===Zu.pop&&Vi(z,20)&&i.go(-1,!1)),k(Ce,M,z)}).catch(Au)}))}let I=$c(),P=$c(),B;function L(J,Ae,Ee){q(J);const Ce=P.list();return Ce.length?Ce.forEach(Ge=>Ge(J,Ae,Ee)):console.error(J),Promise.reject(J)}function Y(){return B&&l.value!==Or?Promise.resolve():new Promise((J,Ae)=>{I.add([J,Ae])})}function q(J){return B||(B=!J,D(),I.list().forEach(([Ae,Ee])=>J?Ee(J):Ae()),I.reset()),J}function de(J,Ae,Ee,Ce){const{scrollBehavior:Ge}=t;if(!hl||!Ge)return Promise.resolve();const M=!Ee&&gI(Ub(J.fullPath,0))||(Ce||!Ee)&&history.state&&history.state.scroll||null;return Ed().then(()=>Ge(J,Ae,M)).then(z=>z&&pI(z)).catch(z=>L(z,J,Ae))}const fe=J=>i.go(J);let Re;const oe=new Set,me={currentRoute:l,listening:!0,addRoute:h,removeRoute:v,clearRoutes:e.clearRoutes,hasRoute:m,getRoutes:_,resolve:g,options:t,push:w,replace:T,go:fe,back:()=>fe(-1),forward:()=>fe(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:P.add,isReady:Y,install(J){const Ae=this;J.component("RouterLink",hA),J.component("RouterView",pA),J.config.globalProperties.$router=Ae,Object.defineProperty(J.config.globalProperties,"$route",{enumerable:!0,get:()=>kl(l)}),hl&&!Re&&l.value===Or&&(Re=!0,w(i.location).catch(Ge=>{}));const Ee={};for(const Ge in Or)Object.defineProperty(Ee,Ge,{get:()=>l.value[Ge],enumerable:!0});J.provide(nv,Ae),J.provide(fA,JT(Ee)),J.provide(F_,l);const Ce=J.unmount;oe.add(J),J.unmount=function(){oe.delete(J),oe.size<1&&(c=Or,H&&H(),H=null,l.value=Or,Re=!1,B=!1),Ce()}}};function ke(J){return J.reduce((Ae,Ee)=>Ae.then(()=>x(Ee)),Promise.resolve())}return me}function WI(t,e){const n=[],s=[],i=[],r=Math.max(e.matched.length,t.matched.length);for(let o=0;oXl(c,a))?s.push(a):n.push(a));const l=t.matched[o];l&&(e.matched.find(c=>Xl(c,l))||i.push(l))}return[n,s,i]}var jI=!1;/*! + * pinia v2.3.0 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */let mA;const $p=t=>mA=t,gA=Symbol();function $_(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var Ru;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(Ru||(Ru={}));function qI(){const t=NT(!0),e=t.run(()=>Cp({}));let n=[],s=[];const i=j1({install(r){$p(i),i._a=r,r.provide(gA,i),r.config.globalProperties.$pinia=i,s.forEach(o=>n.push(o)),s=[]},use(r){return!this._a&&!jI?s.push(r):n.push(r),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return i}const _A=()=>{};function Jb(t,e,n,s=_A){t.push(e);const i=()=>{const r=t.indexOf(e);r>-1&&(t.splice(r,1),s())};return!n&&UT()&&x8(i),i}function Ua(t,...e){t.slice().forEach(n=>{n(...e)})}const XI=t=>t(),Qb=Symbol(),zm=Symbol();function B_(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,s)=>t.set(s,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const s=e[n],i=t[n];$_(i)&&$_(s)&&t.hasOwnProperty(n)&&!un(s)&&!uo(s)?t[n]=B_(i,s):t[n]=s}return t}const KI=Symbol();function YI(t){return!$_(t)||!t.hasOwnProperty(KI)}const{assign:qr}=Object;function ZI(t){return!!(un(t)&&t.effect)}function JI(t,e,n,s){const{state:i,actions:r,getters:o}=e,a=n.state.value[t];let l;function c(){a||(n.state.value[t]=i?i():{});const u=V8(n.state.value[t]);return qr(u,r,Object.keys(o||{}).reduce((d,f)=>(d[f]=j1(ln(()=>{$p(n);const h=n._s.get(t);return o[f].call(h,h)})),d),{}))}return l=vA(t,c,e,n,s,!0),l}function vA(t,e,n={},s,i,r){let o;const a=qr({actions:{}},n),l={deep:!0};let c,u,d=[],f=[],h;const v=s.state.value[t];!r&&!v&&(s.state.value[t]={}),Cp({});let _;function m(R){let x;c=u=!1,typeof R=="function"?(R(s.state.value[t]),x={type:Ru.patchFunction,storeId:t,events:h}):(B_(s.state.value[t],R),x={type:Ru.patchObject,payload:R,storeId:t,events:h});const E=_=Symbol();Ed().then(()=>{_===E&&(c=!0)}),u=!0,Ua(d,x,s.state.value[t])}const g=r?function(){const{state:x}=n,E=x?x():{};this.$patch(k=>{qr(k,E)})}:_A;function y(){o.stop(),d=[],f=[],s._s.delete(t)}const b=(R,x="")=>{if(Qb in R)return R[zm]=x,R;const E=function(){$p(s);const k=Array.from(arguments),U=[],H=[];function D(B){U.push(B)}function I(B){H.push(B)}Ua(f,{args:k,name:E[zm],store:T,after:D,onError:I});let P;try{P=R.apply(this&&this.$id===t?this:T,k)}catch(B){throw Ua(H,B),B}return P instanceof Promise?P.then(B=>(Ua(U,B),B)).catch(B=>(Ua(H,B),Promise.reject(B))):(Ua(U,P),P)};return E[Qb]=!0,E[zm]=x,E},w={_p:s,$id:t,$onAction:Jb.bind(null,f),$patch:m,$reset:g,$subscribe(R,x={}){const E=Jb(d,R,x.detached,()=>k()),k=o.run(()=>ma(()=>s.state.value[t],U=>{(x.flush==="sync"?u:c)&&R({storeId:t,type:Ru.direct,events:h},U)},qr({},l,x)));return E},$dispose:y},T=gc(w);s._s.set(t,T);const A=(s._a&&s._a.runWithContext||XI)(()=>s._e.run(()=>(o=NT()).run(()=>e({action:b}))));for(const R in A){const x=A[R];if(un(x)&&!ZI(x)||uo(x))r||(v&&YI(x)&&(un(x)?x.value=v[R]:B_(x,v[R])),s.state.value[t][R]=x);else if(typeof x=="function"){const E=b(x,R);A[R]=E,a.actions[R]=x}}return qr(T,A),qr(_t(T),A),Object.defineProperty(T,"$state",{get:()=>s.state.value[t],set:R=>{m(x=>{qr(x,R)})}}),s._p.forEach(R=>{qr(T,o.run(()=>R({store:T,app:s._a,pinia:s,options:a})))}),v&&r&&n.hydrate&&n.hydrate(T.$state,v),c=!0,u=!0,T}/*! #__NO_SIDE_EFFECTS__ */function Vn(t,e,n){let s,i;const r=typeof e=="function";typeof t=="string"?(s=t,i=r?n:e):(i=t,s=t.id);function o(a,l){const c=Ek();return a=a||(c?Ri(gA,null):null),a&&$p(a),a=mA,a._s.has(s)||(r?vA(s,e,i,a):JI(s,i,a)),a._s.get(s)}return o.$id=s,o}function sv(t,e){return Array.isArray(e)?e.reduce((n,s)=>(n[s]=function(){return t(this.$pinia)[s]},n),{}):Object.keys(e).reduce((n,s)=>(n[s]=function(){const i=t(this.$pinia),r=e[s];return typeof r=="function"?r.call(this,i):i[r]},n),{})}const yA=35;var xn=(t=>(t[t.Invalid=0]="Invalid",t[t.Get=1]="Get",t[t.Set=2]="Set",t[t.Log=3]="Log",t[t.CalImu=4]="CalImu",t[t.Blackbox=5]="Blackbox",t[t.Motor=6]="Motor",t[t.CalSticks=7]="CalSticks",t[t.Serial=8]="Serial",t[t.OSD=9]="OSD",t[t.Max=10]="Max",t))(xn||{}),en=(t=>(t[t.Invalid=0]="Invalid",t[t.Info=1]="Info",t[t.Profile=2]="Profile",t[t.DefaultProfile=3]="DefaultProfile",t[t.State=4]="State",t[t.PidRatePresets=5]="PidRatePresets",t[t.VtxSettings=6]="VtxSettings",t[t.OSDFont=7]="OSDFont",t[t.BLHeliSettings=8]="BLHeliSettings",t[t.BindInfo=9]="BindInfo",t[t.PerfCounters=10]="PerfCounters",t[t.BlackboxPresets=11]="BlackboxPresets",t[t.Target=12]="Target",t))(en||{}),uu=(t=>(t[t.Reset=0]="Reset",t[t.List=1]="List",t[t.Get=2]="Get",t))(uu||{}),du=(t=>(t[t.TestStatus=0]="TestStatus",t[t.TestEnable=1]="TestEnable",t[t.TestDisable=2]="TestDisable",t[t.TestSetValue=3]="TestSetValue",t[t.Esc4WayIf=4]="Esc4WayIf",t))(du||{}),H_=(t=>(t[t.ReadChar=0]="ReadChar",t[t.WriteChar=1]="WriteChar",t))(H_||{}),lh=(t=>(t[t.None=0]="None",t[t.Error=1]="Error",t[t.Streaming=2]="Streaming",t[t.Exit=3]="Exit",t))(lh||{}),Ci=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ui(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var G_={exports:{}};const QI="2.0.0",bA=256,e6=Number.MAX_SAFE_INTEGER||9007199254740991,t6=16,n6=bA-6,s6=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Bp={MAX_LENGTH:bA,MAX_SAFE_COMPONENT_LENGTH:t6,MAX_SAFE_BUILD_LENGTH:n6,MAX_SAFE_INTEGER:e6,RELEASE_TYPES:s6,SEMVER_SPEC_VERSION:QI,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Vm={};const i6=typeof process=="object"&&Vm&&Vm.NODE_DEBUG&&/\bsemver\b/i.test(Vm.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var Hp=i6;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:i}=Bp,r=Hp;e=t.exports={};const o=e.re=[],a=e.safeRe=[],l=e.src=[],c=e.t={};let u=0;const d="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[d,s]],h=_=>{for(const[m,g]of f)_=_.split(`${m}*`).join(`${m}{0,${g}}`).split(`${m}+`).join(`${m}{1,${g}}`);return _},v=(_,m,g)=>{const y=h(m),b=u++;r(_,b,m),c[_]=b,l[b]=m,o[b]=new RegExp(m,g?"g":void 0),a[b]=new RegExp(y,g?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),v("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),v("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${d}+`),v("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),v("FULL",`^${l[c.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),v("LOOSE",`^${l[c.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),v("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),v("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),v("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),v("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?(?:${l[c.BUILD]})?(?:$|[^\\d])`),v("COERCERTL",l[c.COERCE],!0),v("COERCERTLFULL",l[c.COERCEFULL],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",v("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",v("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(G_,G_.exports);var Ad=G_.exports;const r6=Object.freeze({loose:!0}),o6=Object.freeze({}),a6=t=>t?typeof t!="object"?r6:t:o6;var iv=a6;const ew=/^[0-9]+$/,wA=(t,e)=>{const n=ew.test(t),s=ew.test(e);return n&&s&&(t=+t,e=+e),t===e?0:n&&!s?-1:s&&!n?1:twA(e,t);var xA={compareIdentifiers:wA,rcompareIdentifiers:l6};const Vd=Hp,{MAX_LENGTH:tw,MAX_SAFE_INTEGER:Wd}=Bp,{safeRe:nw,t:sw}=Ad,c6=iv,{compareIdentifiers:Fa}=xA;let u6=class mi{constructor(e,n){if(n=c6(n),e instanceof mi){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>tw)throw new TypeError(`version is longer than ${tw} characters`);Vd("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const s=e.trim().match(n.loose?nw[sw.LOOSE]:nw[sw.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>Wd||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Wd||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Wd||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const r=+i;if(r>=0&&r=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);if(r===-1){if(n===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let r=[n,i];s===!1&&(r=[n]),Fa(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var is=u6;const iw=is,d6=(t,e,n=!1)=>{if(t instanceof iw)return t;try{return new iw(t,e)}catch(s){if(!n)return null;throw s}};var _c=d6;const f6=_c,h6=(t,e)=>{const n=f6(t,e);return n?n.version:null};var p6=h6;const m6=_c,g6=(t,e)=>{const n=m6(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};var _6=g6;const rw=is,v6=(t,e,n,s,i)=>{typeof n=="string"&&(i=s,s=n,n=void 0);try{return new rw(t instanceof rw?t.version:t,n).inc(e,s,i).version}catch{return null}};var y6=v6;const ow=_c,b6=(t,e)=>{const n=ow(t,null,!0),s=ow(e,null,!0),i=n.compare(s);if(i===0)return null;const r=i>0,o=r?n:s,a=r?s:n,l=!!o.prerelease.length;if(!!a.prerelease.length&&!l)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const u=l?"pre":"";return n.major!==s.major?u+"major":n.minor!==s.minor?u+"minor":n.patch!==s.patch?u+"patch":"prerelease"};var w6=b6;const x6=is,E6=(t,e)=>new x6(t,e).major;var S6=E6;const T6=is,A6=(t,e)=>new T6(t,e).minor;var M6=A6;const R6=is,C6=(t,e)=>new R6(t,e).patch;var k6=C6;const P6=_c,I6=(t,e)=>{const n=P6(t,e);return n&&n.prerelease.length?n.prerelease:null};var O6=I6;const aw=is,L6=(t,e,n)=>new aw(t,n).compare(new aw(e,n));var ai=L6;const D6=ai,N6=(t,e,n)=>D6(e,t,n);var U6=N6;const F6=ai,$6=(t,e)=>F6(t,e,!0);var B6=$6;const lw=is,H6=(t,e,n)=>{const s=new lw(t,n),i=new lw(e,n);return s.compare(i)||s.compareBuild(i)};var rv=H6;const G6=rv,z6=(t,e)=>t.sort((n,s)=>G6(n,s,e));var V6=z6;const W6=rv,j6=(t,e)=>t.sort((n,s)=>W6(s,n,e));var q6=j6;const X6=ai,K6=(t,e,n)=>X6(t,e,n)>0;var Gp=K6;const Y6=ai,Z6=(t,e,n)=>Y6(t,e,n)<0;var ov=Z6;const J6=ai,Q6=(t,e,n)=>J6(t,e,n)===0;var EA=Q6;const eO=ai,tO=(t,e,n)=>eO(t,e,n)!==0;var SA=tO;const nO=ai,sO=(t,e,n)=>nO(t,e,n)>=0;var av=sO;const iO=ai,rO=(t,e,n)=>iO(t,e,n)<=0;var lv=rO;const oO=EA,aO=SA,lO=Gp,cO=av,uO=ov,dO=lv,fO=(t,e,n,s)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return oO(t,n,s);case"!=":return aO(t,n,s);case">":return lO(t,n,s);case">=":return cO(t,n,s);case"<":return uO(t,n,s);case"<=":return dO(t,n,s);default:throw new TypeError(`Invalid operator: ${e}`)}};var TA=fO;const hO=is,pO=_c,{safeRe:jd,t:qd}=Ad,mO=(t,e)=>{if(t instanceof hO)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?jd[qd.COERCEFULL]:jd[qd.COERCE]);else{const l=e.includePrerelease?jd[qd.COERCERTLFULL]:jd[qd.COERCERTL];let c;for(;(c=l.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||c.index+c[0].length!==n.index+n[0].length)&&(n=c),l.lastIndex=c.index+c[1].length+c[2].length;l.lastIndex=-1}if(n===null)return null;const s=n[2],i=n[3]||"0",r=n[4]||"0",o=e.includePrerelease&&n[5]?`-${n[5]}`:"",a=e.includePrerelease&&n[6]?`+${n[6]}`:"";return pO(`${s}.${i}.${r}${o}${a}`,e)};var gO=mO;class _O{constructor(){this.max=1e3,this.map=new Map}get(e){const n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(e,n)}return this}}var vO=_O,Wm,cw;function li(){if(cw)return Wm;cw=1;const t=/\s+/g;class e{constructor(I,P){if(P=i(P),I instanceof e)return I.loose===!!P.loose&&I.includePrerelease===!!P.includePrerelease?I:new e(I.raw,P);if(I instanceof r)return this.raw=I.value,this.set=[[I]],this.formatted=void 0,this;if(this.options=P,this.loose=!!P.loose,this.includePrerelease=!!P.includePrerelease,this.raw=I.trim().replace(t," "),this.set=this.raw.split("||").map(B=>this.parseRange(B.trim())).filter(B=>B.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const B=this.set[0];if(this.set=this.set.filter(L=>!_(L[0])),this.set.length===0)this.set=[B];else if(this.set.length>1){for(const L of this.set)if(L.length===1&&m(L[0])){this.set=[L];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let I=0;I0&&(this.formatted+="||");const P=this.set[I];for(let B=0;B0&&(this.formatted+=" "),this.formatted+=P[B].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(I){const B=((this.options.includePrerelease&&h)|(this.options.loose&&v))+":"+I,L=s.get(B);if(L)return L;const Y=this.options.loose,q=Y?l[c.HYPHENRANGELOOSE]:l[c.HYPHENRANGE];I=I.replace(q,U(this.options.includePrerelease)),o("hyphen replace",I),I=I.replace(l[c.COMPARATORTRIM],u),o("comparator trim",I),I=I.replace(l[c.TILDETRIM],d),o("tilde trim",I),I=I.replace(l[c.CARETTRIM],f),o("caret trim",I);let de=I.split(" ").map(me=>y(me,this.options)).join(" ").split(/\s+/).map(me=>k(me,this.options));Y&&(de=de.filter(me=>(o("loose invalid filter",me,this.options),!!me.match(l[c.COMPARATORLOOSE])))),o("range list",de);const fe=new Map,Re=de.map(me=>new r(me,this.options));for(const me of Re){if(_(me))return[me];fe.set(me.value,me)}fe.size>1&&fe.has("")&&fe.delete("");const oe=[...fe.values()];return s.set(B,oe),oe}intersects(I,P){if(!(I instanceof e))throw new TypeError("a Range is required");return this.set.some(B=>g(B,P)&&I.set.some(L=>g(L,P)&&B.every(Y=>L.every(q=>Y.intersects(q,P)))))}test(I){if(!I)return!1;if(typeof I=="string")try{I=new a(I,this.options)}catch{return!1}for(let P=0;PD.value==="<0.0.0-0",m=D=>D.value==="",g=(D,I)=>{let P=!0;const B=D.slice();let L=B.pop();for(;P&&B.length;)P=B.every(Y=>L.intersects(Y,I)),L=B.pop();return P},y=(D,I)=>(o("comp",D,I),D=S(D,I),o("caret",D),D=w(D,I),o("tildes",D),D=R(D,I),o("xrange",D),D=E(D,I),o("stars",D),D),b=D=>!D||D.toLowerCase()==="x"||D==="*",w=(D,I)=>D.trim().split(/\s+/).map(P=>T(P,I)).join(" "),T=(D,I)=>{const P=I.loose?l[c.TILDELOOSE]:l[c.TILDE];return D.replace(P,(B,L,Y,q,de)=>{o("tilde",D,B,L,Y,q,de);let fe;return b(L)?fe="":b(Y)?fe=`>=${L}.0.0 <${+L+1}.0.0-0`:b(q)?fe=`>=${L}.${Y}.0 <${L}.${+Y+1}.0-0`:de?(o("replaceTilde pr",de),fe=`>=${L}.${Y}.${q}-${de} <${L}.${+Y+1}.0-0`):fe=`>=${L}.${Y}.${q} <${L}.${+Y+1}.0-0`,o("tilde return",fe),fe})},S=(D,I)=>D.trim().split(/\s+/).map(P=>A(P,I)).join(" "),A=(D,I)=>{o("caret",D,I);const P=I.loose?l[c.CARETLOOSE]:l[c.CARET],B=I.includePrerelease?"-0":"";return D.replace(P,(L,Y,q,de,fe)=>{o("caret",D,L,Y,q,de,fe);let Re;return b(Y)?Re="":b(q)?Re=`>=${Y}.0.0${B} <${+Y+1}.0.0-0`:b(de)?Y==="0"?Re=`>=${Y}.${q}.0${B} <${Y}.${+q+1}.0-0`:Re=`>=${Y}.${q}.0${B} <${+Y+1}.0.0-0`:fe?(o("replaceCaret pr",fe),Y==="0"?q==="0"?Re=`>=${Y}.${q}.${de}-${fe} <${Y}.${q}.${+de+1}-0`:Re=`>=${Y}.${q}.${de}-${fe} <${Y}.${+q+1}.0-0`:Re=`>=${Y}.${q}.${de}-${fe} <${+Y+1}.0.0-0`):(o("no pr"),Y==="0"?q==="0"?Re=`>=${Y}.${q}.${de}${B} <${Y}.${q}.${+de+1}-0`:Re=`>=${Y}.${q}.${de}${B} <${Y}.${+q+1}.0-0`:Re=`>=${Y}.${q}.${de} <${+Y+1}.0.0-0`),o("caret return",Re),Re})},R=(D,I)=>(o("replaceXRanges",D,I),D.split(/\s+/).map(P=>x(P,I)).join(" ")),x=(D,I)=>{D=D.trim();const P=I.loose?l[c.XRANGELOOSE]:l[c.XRANGE];return D.replace(P,(B,L,Y,q,de,fe)=>{o("xRange",D,B,L,Y,q,de,fe);const Re=b(Y),oe=Re||b(q),me=oe||b(de),ke=me;return L==="="&&ke&&(L=""),fe=I.includePrerelease?"-0":"",Re?L===">"||L==="<"?B="<0.0.0-0":B="*":L&&ke?(oe&&(q=0),de=0,L===">"?(L=">=",oe?(Y=+Y+1,q=0,de=0):(q=+q+1,de=0)):L==="<="&&(L="<",oe?Y=+Y+1:q=+q+1),L==="<"&&(fe="-0"),B=`${L+Y}.${q}.${de}${fe}`):oe?B=`>=${Y}.0.0${fe} <${+Y+1}.0.0-0`:me&&(B=`>=${Y}.${q}.0${fe} <${Y}.${+q+1}.0-0`),o("xRange return",B),B})},E=(D,I)=>(o("replaceStars",D,I),D.trim().replace(l[c.STAR],"")),k=(D,I)=>(o("replaceGTE0",D,I),D.trim().replace(l[I.includePrerelease?c.GTE0PRE:c.GTE0],"")),U=D=>(I,P,B,L,Y,q,de,fe,Re,oe,me,ke)=>(b(B)?P="":b(L)?P=`>=${B}.0.0${D?"-0":""}`:b(Y)?P=`>=${B}.${L}.0${D?"-0":""}`:q?P=`>=${P}`:P=`>=${P}${D?"-0":""}`,b(Re)?fe="":b(oe)?fe=`<${+Re+1}.0.0-0`:b(me)?fe=`<${Re}.${+oe+1}.0-0`:ke?fe=`<=${Re}.${oe}.${me}-${ke}`:D?fe=`<${Re}.${oe}.${+me+1}-0`:fe=`<=${fe}`,`${P} ${fe}`.trim()),H=(D,I,P)=>{for(let B=0;B0){const L=D[B].semver;if(L.major===I.major&&L.minor===I.minor&&L.patch===I.patch)return!0}return!1}return!0};return Wm}var jm,uw;function zp(){if(uw)return jm;uw=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(u,d){if(d=n(d),u instanceof e){if(u.loose===!!d.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),o("comparator",u,d),this.options=d,this.loose=!!d.loose,this.parse(u),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(u){const d=this.options.loose?s[i.COMPARATORLOOSE]:s[i.COMPARATOR],f=u.match(d);if(!f)throw new TypeError(`Invalid comparator: ${u}`);this.operator=f[1]!==void 0?f[1]:"",this.operator==="="&&(this.operator=""),f[2]?this.semver=new a(f[2],this.options.loose):this.semver=t}toString(){return this.value}test(u){if(o("Comparator.test",u,this.options.loose),this.semver===t||u===t)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return r(u,this.operator,this.semver,this.options)}intersects(u,d){if(!(u instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(u.value,d).test(this.value):u.operator===""?u.value===""?!0:new l(this.value,d).test(u.semver):(d=n(d),d.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||r(this.semver,"<",u.semver,d)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||r(this.semver,">",u.semver,d)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}jm=e;const n=iv,{safeRe:s,t:i}=Ad,r=TA,o=Hp,a=is,l=li();return jm}const yO=li(),bO=(t,e,n)=>{try{e=new yO(e,n)}catch{return!1}return e.test(t)};var Vp=bO;const wO=li(),xO=(t,e)=>new wO(t,e).set.map(n=>n.map(s=>s.value).join(" ").trim().split(" "));var EO=xO;const SO=is,TO=li(),AO=(t,e,n)=>{let s=null,i=null,r=null;try{r=new TO(e,n)}catch{return null}return t.forEach(o=>{r.test(o)&&(!s||i.compare(o)===-1)&&(s=o,i=new SO(s,n))}),s};var MO=AO;const RO=is,CO=li(),kO=(t,e,n)=>{let s=null,i=null,r=null;try{r=new CO(e,n)}catch{return null}return t.forEach(o=>{r.test(o)&&(!s||i.compare(o)===1)&&(s=o,i=new RO(s,n))}),s};var PO=kO;const qm=is,IO=li(),dw=Gp,OO=(t,e)=>{t=new IO(t,e);let n=new qm("0.0.0");if(t.test(n)||(n=new qm("0.0.0-0"),t.test(n)))return n;n=null;for(let s=0;s{const a=new qm(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!r||dw(a,r))&&(r=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),r&&(!n||dw(n,r))&&(n=r)}return n&&t.test(n)?n:null};var LO=OO;const DO=li(),NO=(t,e)=>{try{return new DO(t,e).range||"*"}catch{return null}};var UO=NO;const FO=is,AA=zp(),{ANY:$O}=AA,BO=li(),HO=Vp,fw=Gp,hw=ov,GO=lv,zO=av,VO=(t,e,n,s)=>{t=new FO(t,s),e=new BO(e,s);let i,r,o,a,l;switch(n){case">":i=fw,r=GO,o=hw,a=">",l=">=";break;case"<":i=hw,r=zO,o=fw,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(HO(t,e,s))return!1;for(let c=0;c{h.semver===$O&&(h=new AA(">=0.0.0")),d=d||h,f=f||h,i(h.semver,d.semver,s)?d=h:o(h.semver,f.semver,s)&&(f=h)}),d.operator===a||d.operator===l||(!f.operator||f.operator===a)&&r(t,f.semver))return!1;if(f.operator===l&&o(t,f.semver))return!1}return!0};var cv=VO;const WO=cv,jO=(t,e,n)=>WO(t,e,">",n);var qO=jO;const XO=cv,KO=(t,e,n)=>XO(t,e,"<",n);var YO=KO;const pw=li(),ZO=(t,e,n)=>(t=new pw(t,n),e=new pw(e,n),t.intersects(e,n));var JO=ZO;const QO=Vp,eL=ai;var tL=(t,e,n)=>{const s=[];let i=null,r=null;const o=t.sort((u,d)=>eL(u,d,n));for(const u of o)QO(u,e,n)?(r=u,i||(i=u)):(r&&s.push([i,r]),r=null,i=null);i&&s.push([i,null]);const a=[];for(const[u,d]of s)u===d?a.push(u):!d&&u===o[0]?a.push("*"):d?u===o[0]?a.push(`<=${d}`):a.push(`${u} - ${d}`):a.push(`>=${u}`);const l=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return l.length{if(t===e)return!0;t=new mw(t,n),e=new mw(e,n);let s=!1;e:for(const i of t.set){for(const r of e.set){const o=iL(i,r,n);if(s=s||o!==null,o)continue e}if(s)return!1}return!0},sL=[new uv(">=0.0.0-0")],gw=[new uv(">=0.0.0")],iL=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Xm){if(e.length===1&&e[0].semver===Xm)return!0;n.includePrerelease?t=sL:t=gw}if(e.length===1&&e[0].semver===Xm){if(n.includePrerelease)return!0;e=gw}const s=new Set;let i,r;for(const h of t)h.operator===">"||h.operator===">="?i=_w(i,h,n):h.operator==="<"||h.operator==="<="?r=vw(r,h,n):s.add(h.semver);if(s.size>1)return null;let o;if(i&&r){if(o=dv(i.semver,r.semver,n),o>0)return null;if(o===0&&(i.operator!==">="||r.operator!=="<="))return null}for(const h of s){if(i&&!Bc(h,String(i),n)||r&&!Bc(h,String(r),n))return null;for(const v of e)if(!Bc(h,String(v),n))return!1;return!0}let a,l,c,u,d=r&&!n.includePrerelease&&r.semver.prerelease.length?r.semver:!1,f=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&r.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(const h of e){if(u=u||h.operator===">"||h.operator===">=",c=c||h.operator==="<"||h.operator==="<=",i){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator===">"||h.operator===">="){if(a=_w(i,h,n),a===h&&a!==i)return!1}else if(i.operator===">="&&!Bc(i.semver,String(h),n))return!1}if(r){if(d&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch&&(d=!1),h.operator==="<"||h.operator==="<="){if(l=vw(r,h,n),l===h&&l!==r)return!1}else if(r.operator==="<="&&!Bc(r.semver,String(h),n))return!1}if(!h.operator&&(r||i)&&o!==0)return!1}return!(i&&c&&!r&&o!==0||r&&u&&!i&&o!==0||f||d)},_w=(t,e,n)=>{if(!t)return e;const s=dv(t.semver,e.semver,n);return s>0?t:s<0||e.operator===">"&&t.operator===">="?e:t},vw=(t,e,n)=>{if(!t)return e;const s=dv(t.semver,e.semver,n);return s<0?t:s>0||e.operator==="<"&&t.operator==="<="?e:t};var rL=nL;const Km=Ad,yw=Bp,oL=is,bw=xA,aL=_c,lL=p6,cL=_6,uL=y6,dL=w6,fL=S6,hL=M6,pL=k6,mL=O6,gL=ai,_L=U6,vL=B6,yL=rv,bL=V6,wL=q6,xL=Gp,EL=ov,SL=EA,TL=SA,AL=av,ML=lv,RL=TA,CL=gO,kL=zp(),PL=li(),IL=Vp,OL=EO,LL=MO,DL=PO,NL=LO,UL=UO,FL=cv,$L=qO,BL=YO,HL=JO,GL=tL,zL=rL;var ch={parse:aL,valid:lL,clean:cL,inc:uL,diff:dL,major:fL,minor:hL,patch:pL,prerelease:mL,compare:gL,rcompare:_L,compareLoose:vL,compareBuild:yL,sort:bL,rsort:wL,gt:xL,lt:EL,eq:SL,neq:TL,gte:AL,lte:ML,cmp:RL,coerce:CL,Comparator:kL,Range:PL,satisfies:IL,toComparators:OL,maxSatisfying:LL,minSatisfying:DL,minVersion:NL,validRange:UL,outside:FL,gtr:$L,ltr:BL,intersects:HL,simplifyRange:GL,subset:zL,SemVer:oL,re:Km.re,src:Km.src,tokens:Km.t,SEMVER_SPEC_VERSION:yw.SEMVER_SPEC_VERSION,RELEASE_TYPES:yw.RELEASE_TYPES,compareIdentifiers:bw.compareIdentifiers,rcompareIdentifiers:bw.rcompareIdentifiers};const Bn=Ui(ch);function Cu(t,e){const n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}function Ym(t){const e=new Uint8Array(t.length);for(let n=0;n=this.buf.byteLength){let n=this.buf.byteLength;for(;n>16&255}.${t>>8&255}.${t>>0&255}`}function bi(t){return new Promise(e=>{setTimeout(e,t)})}const VL={0:"trace",1:"debug",2:"info",3:"warning",4:"error"},Os=class Os{static trace(e,...n){Os.log(0,e,...n)}static debug(e,...n){Os.log(1,e,...n)}static info(e,...n){Os.log(2,e,...n)}static warn(e,...n){Os.log(3,e,...n)}static warning(e,...n){Os.log(3,e,...n)}static error(e,...n){Os.log(4,e,...n)}static logFmtStr(e,n,s){let i="["+VL[e]+"]";for(n&&n.length&&(i+="["+n+"]"),i+=" ";typeof s[0]=="string";)i+=s.shift();return i}static logToFile(e,n,...s){for(const i of s)n+=" ",typeof i=="string"?n+=i:n+=JSON.stringify(i);Os.history.push(n)}static log(e,n,...s){if(!(e>>0===e)this.encodeRaw(0,e,$a(e));else if(e>>0===e){const n=-e-1;this.encodeRaw(1,n,$a(n))}else this.encodeHeader(7,26),this.buf.writeFloat32(e)}encodeObject(e){const n=Object.entries(e);this.encodeRaw(5,n.length,$a(n.length));for(const[s,i]of n)this.encode(s),this.encode(i)}encodeArray(e){this.encodeRaw(4,e.length,$a(e.length));for(const n of e)this.encode(n)}encodeString(e){this.encodeRaw(3,e.length,$a(e.length));for(let n=0;n=0;r--)this.buf.writeUint8(n>>r*8&255)}encodeHeader(e,n){return this.buf.writeUint8(e<{if(n)return n;if(this.buf.remaining()<=0)return 0;const{type:s,max:i}=this.decodeType();return s==7&&i==31?(this.buf.advance(1),0):1/0}}decodeSimpleValue(e){switch(e){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;default:return e}}decodeFloat16(e){const n=(e&31744)>>10,s=e&1023;return(e>>15?-1:1)*(n?n===31?s?NaN:1/0:Math.pow(2,n-15)*(1+s/1024):6103515625e-14*(s/1024))}decodeFloat(e){switch(e){case 24:{const n=this.decodeSimpleValue(this.buf.peekUint8());return this.buf.advance(1),n}case 25:{const n=this.buf.peekUint16();return this.buf.advance(2),this.decodeFloat16(n)}case 26:{const n=[this.buf.peekUint8(),this.buf.peekUint8(),this.buf.peekUint8(),this.buf.peekUint8()],s=this.buf.peekFloat32();this.buf.advance(4);const i=CA[(n[0]&127)<<1|n[1]>>7];return(i*s+(s>0?.5:-.5)>>0)/i}case 27:{const n=this.buf.peekFloat64();return this.buf.advance(8),n}default:{if(e<24)return this.decodeSimpleValue(e);throw new Error("wrong size "+e+" on float")}}}decodeRaw(e){if(e<24)return e;const n=1<=0;i--){const r=this.buf.peekUint8();this.buf.advance(1),s|=r<>>0}decodeType(){if(this.buf.remaining()<=0)throw new Error("EOF");const e=this.buf.peekUint8();return{type:(e&WL)>>MA,max:e&RA}}}class uh{static encode(e){return new jL().encode(e)}static decode(e){const n=[],s=new qL(e);for(;!s.isEOF();)try{n.push(s.decode())}catch(i){if(i.message!="EOF")throw i}return n}}var z_;(function(t){t[t.UsbCdcAcm=0]="UsbCdcAcm"})(z_||(z_={}));const XL=32,KL=34,YL=35,xw=255,ZL=8,JL="none",QL=1,eD=[16,8,7,6,5],tD=[1,2],nD=["none","even","odd"],sD=["none","odd","even"],iD=[1,1.5,2],V_={protocol:z_.UsbCdcAcm,usbControlInterfaceClass:2,usbTransferInterfaceClass:10};function Ew(t,e){const n=t.configurations[0];for(const s of n.interfaces)if(s.alternates[0].interfaceClass===e)return s;throw new TypeError(`Unable to find interface with class ${e}.`)}function Sw(t,e){const n=t.alternates[0];for(const s of n.endpoints)if(s.direction==e)return s;throw new TypeError(`Interface ${t.interfaceNumber} does not have an ${e} endpoint.`)}class rD{constructor(e,n,s){this.type="bytes",this.device_=e,this.endpoint_=n,this.onError_=s}pull(e){(async()=>{var n;const s=e.desiredSize||this.endpoint_.packetSize;let i=Math.ceil(s/this.endpoint_.packetSize);try{for(;i;){const r=await this.device_.transferIn(this.endpoint_.endpointNumber,this.endpoint_.packetSize);if(r.status!="ok"){e.error(`USB error: ${r.status}`),this.onError_();break}if(!((n=r.data)===null||n===void 0)&&n.buffer&&r.data.byteLength>0){const o=new Uint8Array(r.data.buffer,r.data.byteOffset,r.data.byteLength);e.enqueue(o),i--}}}catch(r){e.error(r.toString()),this.onError_()}})()}}class oD{constructor(e,n,s){this.device_=e,this.endpoint_=n,this.onError_=s}async write(e,n){try{const s=await this.device_.transferOut(this.endpoint_.endpointNumber,e);s.status!="ok"&&(n.error(s.status),this.onError_())}catch(s){n.error(s.toString()),this.onError_()}}}class Tw{constructor(e,n){this.polyfillOptions_=Object.assign(Object.assign({},V_),n),this.outputSignals_={dataTerminalReady:!1,requestToSend:!1,break:!1},this.device_=e,this.controlInterface_=Ew(this.device_,this.polyfillOptions_.usbControlInterfaceClass),this.transferInterface_=Ew(this.device_,this.polyfillOptions_.usbTransferInterfaceClass),this.inEndpoint_=Sw(this.transferInterface_,"in"),this.outEndpoint_=Sw(this.transferInterface_,"out")}get readable(){var e;return!this.readable_&&this.device_.opened&&(this.readable_=new ReadableStream(new rD(this.device_,this.inEndpoint_,()=>{this.readable_=null}),{highWaterMark:(e=this.serialOptions_.bufferSize)!==null&&e!==void 0?e:xw})),this.readable_}get writable(){var e;return!this.writable_&&this.device_.opened&&(this.writable_=new WritableStream(new oD(this.device_,this.outEndpoint_,()=>{this.writable_=null}),new ByteLengthQueuingStrategy({highWaterMark:(e=this.serialOptions_.bufferSize)!==null&&e!==void 0?e:xw}))),this.writable_}async open(e){this.serialOptions_=e,this.validateOptions();try{await this.device_.open(),this.device_.configuration===null&&await this.device_.selectConfiguration(1),await this.device_.claimInterface(this.controlInterface_.interfaceNumber),this.controlInterface_!==this.transferInterface_&&await this.device_.claimInterface(this.transferInterface_.interfaceNumber),await this.setLineCoding(),await this.setSignals({dataTerminalReady:!0})}catch(n){throw this.device_.opened&&await this.device_.close(),new Error("Error setting up device: "+n.toString())}}async close(){const e=[];this.readable_&&e.push(this.readable_.cancel()),this.writable_&&e.push(this.writable_.abort()),await Promise.all(e),this.readable_=null,this.writable_=null,this.device_.opened&&(await this.setSignals({dataTerminalReady:!1,requestToSend:!1}),await this.device_.close())}async forget(){return this.device_.forget()}getInfo(){return{usbVendorId:this.device_.vendorId,usbProductId:this.device_.productId}}reconfigure(e){return this.serialOptions_=Object.assign(Object.assign({},this.serialOptions_),e),this.validateOptions(),this.setLineCoding()}async setSignals(e){if(this.outputSignals_=Object.assign(Object.assign({},this.outputSignals_),e),e.dataTerminalReady!==void 0||e.requestToSend!==void 0){const n=(this.outputSignals_.dataTerminalReady?1:0)|(this.outputSignals_.requestToSend?2:0);await this.device_.controlTransferOut({requestType:"class",recipient:"interface",request:KL,value:n,index:this.controlInterface_.interfaceNumber})}if(e.break!==void 0){const n=this.outputSignals_.break?65535:0;await this.device_.controlTransferOut({requestType:"class",recipient:"interface",request:YL,value:n,index:this.controlInterface_.interfaceNumber})}}validateOptions(){if(!this.isValidBaudRate(this.serialOptions_.baudRate))throw new RangeError("invalid Baud Rate "+this.serialOptions_.baudRate);if(!this.isValidDataBits(this.serialOptions_.dataBits))throw new RangeError("invalid dataBits "+this.serialOptions_.dataBits);if(!this.isValidStopBits(this.serialOptions_.stopBits))throw new RangeError("invalid stopBits "+this.serialOptions_.stopBits);if(!this.isValidParity(this.serialOptions_.parity))throw new RangeError("invalid parity "+this.serialOptions_.parity)}isValidBaudRate(e){return e%1===0}isValidDataBits(e){return typeof e>"u"?!0:eD.includes(e)}isValidStopBits(e){return typeof e>"u"?!0:tD.includes(e)}isValidParity(e){return typeof e>"u"?!0:nD.includes(e)}async setLineCoding(){var e,n,s;const i=new ArrayBuffer(7),r=new DataView(i);if(r.setUint32(0,this.serialOptions_.baudRate,!0),r.setUint8(4,iD.indexOf((e=this.serialOptions_.stopBits)!==null&&e!==void 0?e:QL)),r.setUint8(5,sD.indexOf((n=this.serialOptions_.parity)!==null&&n!==void 0?n:JL)),r.setUint8(6,(s=this.serialOptions_.dataBits)!==null&&s!==void 0?s:ZL),(await this.device_.controlTransferOut({requestType:"class",recipient:"interface",request:XL,value:0,index:this.controlInterface_.interfaceNumber},i)).status!="ok")throw new DOMException("NetworkError","Failed to set line coding.")}}let aD=class{async requestPort(e,n){n=Object.assign(Object.assign({},V_),n);const s=[];if(e&&e.filters)for(const o of e.filters){const a={classCode:n.usbControlInterfaceClass};o.usbVendorId!==void 0&&(a.vendorId=o.usbVendorId),o.usbProductId!==void 0&&(a.productId=o.usbProductId),s.push(a)}s.length===0&&s.push({classCode:n.usbControlInterfaceClass});const i=await navigator.usb.requestDevice({filters:s});return new Tw(i,n)}async getPorts(e){e=Object.assign(Object.assign({},V_),e);const n=await navigator.usb.getDevices(),s=[];return n.forEach(i=>{try{const r=new Tw(i,e);s.push(r)}catch{}}),s}};const lD=new aD,Ol=navigator.serial?navigator.serial:lD,cD=/(android)/i.test(navigator.userAgent),uD={baudRate:921600,bufferSize:4*1024*1024,updateInterval:1e3},dD={baudRate:921600,bufferSize:4*1024*1024,updateInterval:250},ml={websocketUrl(){return new URL(document.location.toString()).searchParams.get("ws")},serial:cD?uD:dD},fD="S",hD="R",Aw=[{usbVendorId:1155,usbProductId:22336},{usbVendorId:11836,usbProductId:22336}],Mw=()=>{};class Rw extends TransformStream{constructor(){super({transform:(n,s)=>{for(const i of n){const r=this.push(i);r&&s.enqueue(r)}}});xe(this,"state",0);xe(this,"header",{cmd:0,flag:0,len:0});xe(this,"payload",new Uint8Array(0));xe(this,"offset",0)}push(n){switch(this.state){case 0:n==yA&&(this.state=1);break;case 1:this.header.cmd=n&31,this.header.flag=n>>5,this.state=2;break;case 2:this.header.len=n<<8,this.state=3;break;case 3:if(this.header.len|=n,this.offset=0,this.payload=new Uint8Array(this.header.len),this.state=4,this.header.len==0)return this.state=0,{...this.header,payload:this.payload};break;case 4:if(this.payload[this.offset++]=n,this.offset{this.ws=new WebSocket("wss://"+e+"/ws"),this.ws.binaryType="arraybuffer",this.ws.onopen=a=>{r()},this.ws.onmessage=async a=>{try{i.write(new Uint8Array(a.data))}catch(l){n(l)}},this.ws.onclose=a=>{n(a),this.close()},this.ws.onerror=a=>{n(a),o(a)}})}async softReboot(){await this.write(Ym(fD)),await this.close()}async hardReboot(){if(this.port)throw new Error("port already connected");const e=await Ol.requestPort({filters:Aw});await this._connectPort(e);const n=await this.get(en.Target,500).then(s=>s.name).catch(()=>{});return await bi(100),await this.write(Ym(hD)),await bi(100),await this.write(Ym(`\r +bl\r +`)),await this.close(),n}async get(e,n){const s=await this._command(xn.Get,Mw,n,[e]);if(s.payload[0]!=e)throw new Error("invalid value");if(s.payload.length<2)throw new Error("no payload");return s.payload.length==2?s.payload[1]:s.payload.slice(1)}async set(e,...n){const s=await this.command(xn.Set,e,...n);if(s.payload[0]!=e)throw new Error("invalid value");if(s.payload.length<2)throw new Error("no payload");return s.payload.length==2?s.payload[1]:s.payload.slice(1)}async command(e,...n){return this._command(e,Mw,void 0,n)}async commandProgress(e,n,...s){return this._command(e,n,void 0,s)}async close(){var e,n,s,i,r,o;try{await((e=this.reader)==null?void 0:e.cancel().catch(console.warn)),await(this.transfromClosed||Promise.resolve()).catch(console.warn),(n=this.reader)==null||n.releaseLock()}catch(a){at.warn("serial",a)}try{await((s=this.writer)==null?void 0:s.close()),(i=this.writer)==null||i.releaseLock()}catch(a){at.warn("serial",a)}await((r=this.port)==null?void 0:r.close().catch(console.warn)),(o=this.ws)==null||o.close(),this.reader=void 0,this.writer=void 0,this.transfromClosed=void 0,this.port=void 0,this.ws=void 0}async _command(e,n,s,i){return this.waitingCommands=this.waitingCommands.then(()=>this.send(e,n,s,i)).then(r=>{if(r.cmd!=e)throw new Error("invalid command");if(r.flag&lh.Error)throw new Error(r.payload[0]);return r}).catch(r=>{throw this.errorCallback&&this.errorCallback(r),r})}async write(e){var n;if(this.ws)await((n=this.ws)==null?void 0:n.send(e));else if(this.writer)await this.writer.write(e);else throw new Error("no serial writer")}async send(e,n,s,i){const r=this.encodeValues(i),o=Uint8Array.from([yA,e,r.length>>8&255,r.length&255]);at.trace("serial","[quic] sent cmd:",e,"len:",r.length,i),await this.write(Cu(o,r));let a=await this.readPacket(n,s);for(;a.cmd==xn.Log;)at.info("serial","[quic] "+a.payload[0]),a=await this.readPacket(n,s);return at.trace("serial","[quic] recv cmd:",a.cmd,"flag:",a.flag,"len:",a.len,a.payload),a}encodeValues(e){let n=new Uint8Array;for(const s of e){const i=uh.encode(s);n=Cu(n,i)}return n}async readPacket(e,n){if(!this.reader)throw new Error("no serial reader");const s=[this.reader.read().then(l=>l.value)];n&&s.push(new Promise((l,c)=>setTimeout(()=>c("timeout"),n)));const i=await Promise.race(s);if(!i)throw new Error("no packet");if(i.cmd>=xn.Max||i.cmd==xn.Invalid)throw new Error("invalid command");if(!(i.flag&lh.Streaming))return{...i,payload:uh.decode(i.payload)};const r=new fv;r.writeUint8s(i.payload),at.trace("serial","[quic] recv stream chunk",r.length),e(r.length);const o=i.cmd;for(;r;){const{value:l}=await this.reader.read();if(!l)throw new Error("no packet");if(l.cmd!=o||!(l.flag&lh.Streaming))throw new Error("invalid command");if(l.len==0)break;r.writeUint8s(l.payload),at.trace("serial","[quic] recv stream chunk",r.length),e(r.length)}const a=uh.decode(r.array());return{...i,payload:a}}};const gt=new pD,Xt=Vn("root",{state:()=>({needs_apply:!1,needs_reboot:!1,alerts:[],pid_rate_presets:[]}),actions:{append_alert(t){this.alerts=[...this.alerts,{id:Date.now().toString()+"-"+this.alerts.length.toString(),...t}]},pop_alert(t){this.alerts=[...this.alerts.filter(e=>e.id!=t)]},set_needs_apply(){this.needs_apply=!0},set_needs_reboot(){this.needs_apply=!0,this.needs_reboot=!0},reset_needs_apply(){this.needs_apply=!1},reset_needs_reboot(){this.needs_apply=!1,this.needs_reboot=!1},fetch_pid_rate_presets(){return gt.get(en.PidRatePresets).then(t=>this.pid_rate_presets=t)},cal_imu(){return gt.command(xn.CalImu)},cal_sticks(){return gt.command(xn.CalSticks)}}}),mD=nt({name:"AlterPortal",setup(){return{root:Xt()}},data(){return{timeouts:{}}},watch:{"root.alerts"(t,e){if(t.length<=e.length)return;const n=t[t.length-1].id;this.timeouts[n]=window.setTimeout(()=>{this.root.pop_alert(n),delete this.timeouts[n]},2500)}},methods:{dismiss(t){clearTimeout(this.timeouts[t]),this.root.pop_alert(t),delete this.timeouts[t]}}}),lt=(t,e)=>{const n=t.__vccOpts||t;for(const[s,i]of e)n[s]=i;return n},gD={class:"alert-portal"},_D=["onClick"];function vD(t,e,n,s,i,r){return Z(),re("div",gD,[X(TP,{name:"alert",tag:"div"},{default:tt(()=>[(Z(!0),re(it,null,Ht(t.root.alerts,o=>(Z(),re("div",{key:o.id,class:ds(["notification",["is-"+o.type]])},[p("button",{class:"delete",onClick:a=>t.dismiss(o.id)},null,8,_D),ye(" "+$e(o.msg),1)],2))),128))]),_:1})])}const yD=lt(mD,[["render",vD]]),bD=nt({name:"ModalPortal"}),wD={class:"modal-portal"},xD={key:0,class:"modal is-active"};function ED(t,e,n,s,i,r){return Z(),re("div",wD,[t.$modal.isShown?(Z(),re("div",xD,[e[1]||(e[1]=p("div",{class:"modal-background"},null,-1)),(Z(),Bt(hk(t.$modal.component),Np(t.$modal.props,{onClose:e[0]||(e[0]=o=>t.$modal.close(o))}),null,16))])):He("",!0)])}const SD=lt(bD,[["render",ED]]),TD=nt({name:"SelectModal",props:["options","title"],data(){return{value:void 0}}}),AD={class:"modal-card"},MD={class:"modal-card-head"},RD={class:"modal-card-title"},CD={class:"modal-card-body"},kD={class:"select is-fullwidth is-multiple select-list"},PD={class:"control"},ID=["value"],OD={class:"modal-card-foot"},LD={class:"buttons is-justify-content-space-between",style:{width:"100%"}},DD=["disabled"];function ND(t,e,n,s,i,r){return Z(),re("div",AD,[p("header",MD,[p("p",RD,"Select "+$e(t.title),1),p("button",{class:"delete has-background-primary","aria-label":"close",onClick:e[0]||(e[0]=o=>t.$emit("close"))})]),p("section",CD,[p("div",kD,[p("div",PD,[We(p("select",{"onUpdate:modelValue":e[1]||(e[1]=o=>t.value=o),size:"8"},[(Z(!0),re(it,null,Ht(t.options,o=>(Z(),re("option",{key:o.value,value:o.value},$e(o.text),9,ID))),128))],512),[[Td,t.value]])])])]),p("footer",OD,[p("div",LD,[p("button",{class:"button",onClick:e[2]||(e[2]=o=>t.$emit("close"))},"Cancel"),p("button",{class:"button is-success",disabled:t.value==null,onClick:e[3]||(e[3]=o=>t.$emit("close",t.value))}," Select ",8,DD)])])])}const Cw=lt(TD,[["render",ND]]),vc=Vn("default_profile",{state:()=>({serial:{rx:0,smart_audio:0,hdzero:0},filter:{gyro:[{},{}],dterm:[{},{}]},osd:{callsign:"",elements:[],elements_hd:[]},meta:{version:0,datetime:0},motor:{invert_yaw:1},rate:{mode:0,silverware:{},betaflight:{}},voltage:{},receiver:{lqi_source:-1,aux:[]},pid:{pid_profile:0,pid_rates:[{}],stick_profile:0,stick_rates:[{}],big_angle:{},small_angle:{},throttle_dterm_attenuation:{}}}),getters:{has_legacy_stickrates(t){return Bn.lte(xa(t.meta.version),"v0.1.0")},has_legacy_osd(t){return Bn.lte(xa(t.meta.version),"v0.2.4")}},actions:{fetch_default_profile(){return gt.get(en.DefaultProfile).then(t=>{t.meta.name=t.meta.name.replace(/\0/g,""),this.$patch(t)})}}});var kA={exports:{}};(function(t,e){(function(n,s){t.exports=s()})(Ci,function(){var n=1e3,s=6e4,i=36e5,r="millisecond",o="second",a="minute",l="hour",c="day",u="week",d="month",f="quarter",h="year",v="date",_="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(D){var I=["th","st","nd","rd"],P=D%100;return"["+D+(I[(P-20)%10]||I[P]||I[0])+"]"}},b=function(D,I,P){var B=String(D);return!B||B.length>=I?D:""+Array(I+1-B.length).join(P)+D},w={s:b,z:function(D){var I=-D.utcOffset(),P=Math.abs(I),B=Math.floor(P/60),L=P%60;return(I<=0?"+":"-")+b(B,2,"0")+":"+b(L,2,"0")},m:function D(I,P){if(I.date()1)return D(q[0])}else{var de=I.name;S[de]=I,L=de}return!B&&L&&(T=L),L||!B&&T},E=function(D,I){if(R(D))return D.clone();var P=typeof I=="object"?I:{};return P.date=D,P.args=arguments,new U(P)},k=w;k.l=x,k.i=R,k.w=function(D,I){return E(D,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var U=function(){function D(P){this.$L=x(P.locale,null,!0),this.parse(P),this.$x=this.$x||P.x||{},this[A]=!0}var I=D.prototype;return I.parse=function(P){this.$d=function(B){var L=B.date,Y=B.utc;if(L===null)return new Date(NaN);if(k.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var q=L.match(m);if(q){var de=q[2]-1||0,fe=(q[7]||"0").substring(0,3);return Y?new Date(Date.UTC(q[1],de,q[3]||1,q[4]||0,q[5]||0,q[6]||0,fe)):new Date(q[1],de,q[3]||1,q[4]||0,q[5]||0,q[6]||0,fe)}}return new Date(L)}(P),this.init()},I.init=function(){var P=this.$d;this.$y=P.getFullYear(),this.$M=P.getMonth(),this.$D=P.getDate(),this.$W=P.getDay(),this.$H=P.getHours(),this.$m=P.getMinutes(),this.$s=P.getSeconds(),this.$ms=P.getMilliseconds()},I.$utils=function(){return k},I.isValid=function(){return this.$d.toString()!==_},I.isSame=function(P,B){var L=E(P);return this.startOf(B)<=L&&L<=this.endOf(B)},I.isAfter=function(P,B){return E(P)0,S<=T.r||!T.r){S<=1&&w>0&&(T=y[w-1]);var A=g[T.l];h&&(S=h(""+S)),_=typeof A=="string"?A.replace("%d",S):A(S,u,T.l,m);break}}if(u)return _;var R=m?g.future:g.past;return typeof R=="function"?R(_):R.replace("%s",_)},r.to=function(c,u){return a(c,u,this,!0)},r.from=function(c,u){return a(c,u,this)};var l=function(c){return c.$u?i.utc():i()};r.toNow=function(c){return this.to(l(this),c)},r.fromNow=function(c){return this.from(l(this),c)}}})})(PA);var FD=PA.exports;const $D=Ui(FD);hn.extend($D);function BD(t){return hn(t).fromNow()}function HD(t,e=!1,n=1){const s=e?1e3:1024;if(Math.abs(t)=s&&r!!t&&typeof t=="object"&&t[Gs]===hv,Ia=t=>!!t&&typeof t=="object"&&t[Gs]===W_,bc=t=>!!t&&typeof t=="object"&&t[Gs]===fo,Yt=t=>!!t&&typeof t=="object"&&t[Gs]===IA,Ft=t=>!!t&&typeof t=="object"&&t[Gs]===Di,wc=t=>!!t&&typeof t=="object"&&t[Gs]===yc;function Jt(t){if(t&&typeof t=="object")switch(t[Gs]){case fo:case yc:return!0}return!1}function tn(t){if(t&&typeof t=="object")switch(t[Gs]){case hv:case fo:case Di:case yc:return!0}return!1}const GD=t=>(Ft(t)||Jt(t))&&!!t.anchor,cs=Symbol("break visit"),OA=Symbol("skip children"),ki=Symbol("remove node");function vo(t,e){const n=LA(e);Ia(t)?gl(null,t.contents,n,Object.freeze([t]))===ki&&(t.contents=null):gl(null,t,n,Object.freeze([]))}vo.BREAK=cs;vo.SKIP=OA;vo.REMOVE=ki;function gl(t,e,n,s){const i=DA(t,e,n,s);if(tn(i)||Yt(i))return NA(t,s,i),gl(t,i,n,s);if(typeof i!="symbol"){if(Jt(e)){s=Object.freeze(s.concat(e));for(let r=0;rt.replace(/[!,[\]{}]/g,e=>zD[e]);class Yn{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Yn.defaultYaml,e),this.tags=Object.assign({},Yn.defaultTags,n)}clone(){const e=new Yn(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new Yn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Yn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Yn.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:Yn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Yn.defaultTags),this.atNextDocument=!1);const s=e.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return n(6,`Unsupported YAML version ${r}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,s,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);const r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return n(String(o)),null}return s==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[n,s]of Object.entries(this.tags))if(e.startsWith(s))return n+VD(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(e&&s.length>0&&tn(e.contents)){const r={};vo(e.contents,(o,a)=>{tn(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${r} ${o}`);return n.join(` +`)}}Yn.defaultYaml={explicit:!1,version:"1.2"};Yn.defaultTags={"!!":"tag:yaml.org,2002:"};function UA(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function FA(t){const e=new Set;return vo(t,{Value(n,s){s.anchor&&e.add(s.anchor)}}),e}function $A(t,e){for(let n=1;;++n){const s=`${t}${n}`;if(!e.has(s))return s}}function WD(t,e){const n=[],s=new Map;let i=null;return{onAnchor:r=>{n.push(r),i||(i=FA(t));const o=$A(e,i);return i.add(o),o},setAnchors:()=>{for(const r of n){const o=s.get(r);if(typeof o=="object"&&o.anchor&&(Ft(o.node)||Jt(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:s}}function vl(t,e,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;iBs(s,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!GD(t))return t.toJSON(e,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(t,s),n.onCreate=r=>{s.res=r,delete n.onCreate};const i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!(n!=null&&n.keep)?Number(t):t}class pv{constructor(e){Object.defineProperty(this,Gs,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!Ia(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=Bs(this,"",o);if(typeof i=="function")for(const{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?vl(r,{"":a},"",a):a}}class jp extends pv{constructor(e){super(hv),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let n;return vo(e,{Node:(s,i)=>{if(i===this)return vo.BREAK;i.anchor===this.source&&(n=i)}}),n}toJSON(e,n){if(!n)return{source:this.source};const{anchors:s,doc:i,maxAliasCount:r}=n,o=this.resolve(i);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=s.get(o);if(a||(Bs(o,null,n),a=s.get(o)),!a||a.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=dh(i,o,s)),a.count*a.aliasCount>r)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,n,s){const i=`*${this.source}`;if(e){if(UA(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}}function dh(t,e,n){if(Pa(e)){const s=e.resolve(t),i=n&&s&&n.get(s);return i?i.count*i.aliasCount:0}else if(Jt(e)){let s=0;for(const i of e.items){const r=dh(t,i,n);r>s&&(s=r)}return s}else if(Yt(e)){const s=dh(t,e.key,n),i=dh(t,e.value,n);return Math.max(s,i)}return 1}const BA=t=>!t||typeof t!="function"&&typeof t!="object";class ut extends pv{constructor(e){super(Di),this.value=e}toJSON(e,n){return n!=null&&n.keep?this.value:Bs(this.value,e,n)}toString(){return String(this.value)}}ut.BLOCK_FOLDED="BLOCK_FOLDED";ut.BLOCK_LITERAL="BLOCK_LITERAL";ut.PLAIN="PLAIN";ut.QUOTE_DOUBLE="QUOTE_DOUBLE";ut.QUOTE_SINGLE="QUOTE_SINGLE";const jD="tag:yaml.org,2002:";function qD(t,e,n){if(e){const s=n.filter(r=>r.tag===e),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(s=>{var i;return((i=s.identify)==null?void 0:i.call(s,t))&&!s.format})}function Ju(t,e,n){var d,f,h;if(Ia(t)&&(t=t.contents),tn(t))return t;if(Yt(t)){const v=(f=(d=n.schema[fo]).createNode)==null?void 0:f.call(d,n.schema,null,n);return v.items.push(t),v}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=n;let l;if(s&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor||(l.anchor=i(t)),new jp(l.anchor);l={anchor:null,node:null},a.set(t,l)}e!=null&&e.startsWith("!!")&&(e=jD+e.slice(2));let c=qD(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const v=new ut(t);return l&&(l.node=v),v}c=t instanceof Map?o[fo]:Symbol.iterator in Object(t)?o[yc]:o[fo]}r&&(r(c),delete n.onTagObj);const u=c!=null&&c.createNode?c.createNode(n.schema,t,n):typeof((h=c==null?void 0:c.nodeClass)==null?void 0:h.from)=="function"?c.nodeClass.from(n.schema,t,n):new ut(t);return e?u.tag=e:c.default||(u.tag=c.tag),l&&(l.node=u),u}function Wh(t,e,n){let s=n;for(let i=e.length-1;i>=0;--i){const r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return Ju(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const fu=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;let HA=class extends pv{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(s=>tn(s)||Yt(s)?s.clone(e):s),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(fu(e))this.add(n);else{const[s,...i]=e,r=this.get(s,!0);if(Jt(r))r.addIn(i,n);else if(r===void 0&&this.schema)this.set(s,Wh(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(e){const[n,...s]=e;if(s.length===0)return this.delete(n);const i=this.get(n,!0);if(Jt(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(e,n){const[s,...i]=e,r=this.get(s,!0);return i.length===0?!n&&Ft(r)?r.value:r:Jt(r)?r.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!Yt(n))return!1;const s=n.value;return s==null||e&&Ft(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){const[n,...s]=e;if(s.length===0)return this.has(n);const i=this.get(n,!0);return Jt(i)?i.hasIn(s):!1}setIn(e,n){const[s,...i]=e;if(i.length===0)this.set(s,n);else{const r=this.get(s,!0);if(Jt(r))r.setIn(i,n);else if(r===void 0&&this.schema)this.set(s,Wh(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}};const XD=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function ur(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const oa=(t,e,n)=>t.endsWith(` +`)?ur(n,e):n.includes(` +`)?` +`+ur(n,e):(t.endsWith(" ")?"":" ")+n,GA="flow",j_="block",fh="quoted";function qp(t,e,n="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,r)?c.push(0):d=i-s);let f,h,v=!1,_=-1,m=-1,g=-1;n===j_&&(_=kw(t,_,e.length),_!==-1&&(d=_+l));for(let b;b=t[_+=1];){if(n===fh&&b==="\\"){switch(m=_,t[_+1]){case"x":_+=3;break;case"u":_+=5;break;case"U":_+=9;break;default:_+=1}g=_}if(b===` +`)n===j_&&(_=kw(t,_,e.length)),d=_+e.length+l,f=void 0;else{if(b===" "&&h&&h!==" "&&h!==` +`&&h!==" "){const w=t[_+1];w&&w!==" "&&w!==` +`&&w!==" "&&(f=_)}if(_>=d)if(f)c.push(f),d=f+l,f=void 0;else if(n===fh){for(;h===" "||h===" ";)h=b,b=t[_+=1],v=!0;const w=_>g+1?_-2:m-1;if(u[w])return t;c.push(w),u[w]=!0,d=w+l,f=void 0}else v=!0}h=b}if(v&&a&&a(),c.length===0)return t;o&&o();let y=t.slice(0,c[0]);for(let b=0;b({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Kp=t=>/^(%|---|\.\.\.)/m.test(t);function KD(t,e,n){if(!e||e<0)return!1;const s=e-n,i=t.length;if(i<=s)return!1;for(let r=0,o=0;rs)return!0;if(o=r+1,i-o<=s)return!1}return!0}function ku(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(Kp(t)?" ":"");let o="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);const u=n.substr(l+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(s||n[l+2]==='"'||n.length +`;let d,f;for(f=n.length;f>0;--f){const T=n[f-1];if(T!==` +`&&T!==" "&&T!==" ")break}let h=n.substring(f);const v=h.indexOf(` +`);v===-1?d="-":n===h||v!==h.length-1?(d="+",r&&r()):d="",h&&(n=n.slice(0,-h.length),h[h.length-1]===` +`&&(h=h.slice(0,-1)),h=h.replace(X_,`$&${c}`));let _=!1,m,g=-1;for(m=0;m{S=!0});const R=qp(`${y}${T}${h}`,c,j_,A);if(!S)return`>${w} +${c}${R}`}return n=n.replace(/\n+/g,`$&${c}`),`|${w} +${c}${y}${n}${h}`}function YD(t,e,n,s){const{type:i,value:r}=t,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=e;if(a&&r.includes(` +`)||u&&/[[\]{},]/.test(r))return yl(r,e);if(!r||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||u||!r.includes(` +`)?yl(r,e):hh(t,e,n,s);if(!a&&!u&&i!==ut.PLAIN&&r.includes(` +`))return hh(t,e,n,s);if(Kp(r)){if(l==="")return e.forceBlockIndent=!0,hh(t,e,n,s);if(a&&l===c)return yl(r,e)}const d=r.replace(/\n+/g,`$& +${l}`);if(o){const f=_=>{var m;return _.default&&_.tag!=="tag:yaml.org,2002:str"&&((m=_.test)==null?void 0:m.test(d))},{compat:h,tags:v}=e.doc.schema;if(v.some(f)||h!=null&&h.some(f))return yl(r,e)}return a?d:qp(d,l,GA,Xp(e,!1))}function Md(t,e,n,s){const{implicitKey:i,inFlow:r}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:a}=t;a!==ut.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ut.QUOTE_DOUBLE);const l=u=>{switch(u){case ut.BLOCK_FOLDED:case ut.BLOCK_LITERAL:return i||r?yl(o.value,e):hh(o,e,n,s);case ut.QUOTE_DOUBLE:return ku(o.value,e);case ut.QUOTE_SINGLE:return q_(o.value,e);case ut.PLAIN:return YD(o,e,n,s);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:u,defaultStringType:d}=e.options,f=i&&u||d;if(c=l(f),c===null)throw new Error(`Unsupported default string type ${f}`)}return c}function zA(t,e){const n=Object.assign({blockQuote:!0,commentString:XD,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function ZD(t,e){var i;if(e.tag){const r=t.filter(o=>o.tag===e.tag);if(r.length>0)return r.find(o=>o.format===e.format)??r[0]}let n,s;if(Ft(e)){s=e.value;let r=t.filter(o=>{var a;return(a=o.identify)==null?void 0:a.call(o,s)});if(r.length>1){const o=r.filter(a=>a.test);o.length>0&&(r=o)}n=r.find(o=>o.format===e.format)??r.find(o=>!o.format)}else s=e,n=t.find(r=>r.nodeClass&&s instanceof r.nodeClass);if(!n){const r=((i=s==null?void 0:s.constructor)==null?void 0:i.name)??typeof s;throw new Error(`Tag not resolved for ${r} value`)}return n}function JD(t,e,{anchors:n,doc:s}){if(!s.directives)return"";const i=[],r=(Ft(t)||Jt(t))&&t.anchor;r&&UA(r)&&(n.add(r),i.push(`&${r}`));const o=t.tag?t.tag:e.default?null:e.tag;return o&&i.push(s.directives.tagString(o)),i.join(" ")}function Yl(t,e,n,s){var l;if(Yt(t))return t.toString(e,n,s);if(Pa(t)){if(e.doc.directives)return t.toString(e);if((l=e.resolvedAliases)!=null&&l.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i;const r=tn(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i||(i=ZD(e.doc.schema.tags,r));const o=JD(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(r,e,n,s):Ft(r)?Md(r,e,n,s):r.toString(e,n,s);return o?Ft(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o} +${e.indent}${a}`:a}function QD({key:t,value:e},n,s,i){const{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:d}}=n;let f=tn(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Jt(t)||!tn(t)&&typeof t=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let h=!d&&(!t||f&&e==null&&!n.inFlow||Jt(t)||(Ft(t)?t.type===ut.BLOCK_FOLDED||t.type===ut.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(d||!r),indent:a+l});let v=!1,_=!1,m=Yl(t,n,()=>v=!0,()=>_=!0);if(!h&&!n.inFlow&&m.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(r||e==null)return v&&s&&s(),m===""?"?":h?`? ${m}`:m}else if(r&&!d||e==null&&h)return m=`? ${m}`,f&&!v?m+=oa(m,n.indent,c(f)):_&&i&&i(),m;v&&(f=null),h?(f&&(m+=oa(m,n.indent,c(f))),m=`? ${m} +${a}:`):(m=`${m}:`,f&&(m+=oa(m,n.indent,c(f))));let g,y,b;tn(e)?(g=!!e.spaceBefore,y=e.commentBefore,b=e.comment):(g=!1,y=null,b=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!f&&Ft(e)&&(n.indentAtStart=m.length+1),_=!1,!u&&l.length>=2&&!n.inFlow&&!h&&wc(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let w=!1;const T=Yl(e,n,()=>w=!0,()=>_=!0);let S=" ";if(f||g||y){if(S=g?` +`:"",y){const A=c(y);S+=` +${ur(A,n.indent)}`}T===""&&!n.inFlow?S===` +`&&(S=` + +`):S+=` +${n.indent}`}else if(!h&&Jt(e)){const A=T[0],R=T.indexOf(` +`),x=R!==-1,E=n.inFlow??e.flow??e.items.length===0;if(x||!E){let k=!1;if(x&&(A==="&"||A==="!")){let U=T.indexOf(" ");A==="&"&&U!==-1&&Ut===Xd||typeof t=="symbol"&&t.description===Xd,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ut(Symbol(Xd)),{addToJSMap:WA}),stringify:()=>Xd},e7=(t,e)=>(pr.identify(e)||Ft(e)&&(!e.type||e.type===ut.PLAIN)&&pr.identify(e.value))&&(t==null?void 0:t.doc.schema.tags.some(n=>n.tag===pr.tag&&n.default));function WA(t,e,n){if(n=t&&Pa(n)?n.resolve(t.doc):n,wc(n))for(const s of n.items)Zm(t,e,s);else if(Array.isArray(n))for(const s of n)Zm(t,e,s);else Zm(t,e,n)}function Zm(t,e,n){const s=t&&Pa(n)?n.resolve(t.doc):n;if(!bc(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,t,Map);for(const[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function jA(t,e,{key:n,value:s}){if(tn(n)&&n.addToJSMap)n.addToJSMap(t,e,s);else if(e7(t,n))WA(t,e,s);else{const i=Bs(n,"",t);if(e instanceof Map)e.set(i,Bs(s,i,t));else if(e instanceof Set)e.add(i);else{const r=t7(n,i,t),o=Bs(s,r,t);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function t7(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(tn(t)&&(n!=null&&n.doc)){const s=zA(n.doc,{});s.anchors=new Set;for(const r of n.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;const i=t.toString(s);if(!n.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),VA(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(e)}function mv(t,e,n){const s=Ju(t,void 0,n),i=Ju(e,void 0,n);return new Gn(s,i)}class Gn{constructor(e,n=null){Object.defineProperty(this,Gs,{value:IA}),this.key=e,this.value=n}clone(e){let{key:n,value:s}=this;return tn(n)&&(n=n.clone(e)),tn(s)&&(s=s.clone(e)),new Gn(n,s)}toJSON(e,n){const s=n!=null&&n.mapAsMap?new Map:{};return jA(n,s,this)}toString(e,n,s){return e!=null&&e.doc?QD(this,e,n,s):JSON.stringify(this)}}function qA(t,e,n){return(e.inFlow??t.flow?s7:n7)(t,e,n)}function n7({comment:t,items:e},n,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=n,u=Object.assign({},n,{indent:r,type:null});let d=!1;const f=[];for(let v=0;vm=null,()=>d=!0);m&&(g+=oa(g,r,c(m))),d&&m&&(d=!1),f.push(s+g)}let h;if(f.length===0)h=i.start+i.end;else{h=f[0];for(let v=1;vm=null);vu||g.includes(` +`))&&(c=!0),d.push(g),u=d.length}const{start:f,end:h}=n;if(d.length===0)return f+h;if(!c){const v=d.reduce((_,m)=>_+m.length+2,2);c=e.options.lineWidth>0&&v>e.options.lineWidth}if(c){let v=f;for(const _ of d)v+=_?` +${r}${i}${_}`:` +`;return`${v} +${i}${h}`}else return`${f}${o}${d.join(" ")}${o}${h}`}function jh({indent:t,options:{commentString:e}},n,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const r=ur(e(s),t);n.push(r.trimStart())}}function aa(t,e){const n=Ft(e)?e.value:e;for(const s of t)if(Yt(s)&&(s.key===e||s.key===n||Ft(s.key)&&s.key.value===n))return s}class Es extends HA{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(fo,e),this.items=[]}static from(e,n,s){const{keepUndefined:i,replacer:r}=s,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(n,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(mv(l,c,s))};if(n instanceof Map)for(const[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(const l of Object.keys(n))a(l,n[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){var o;let s;Yt(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new Gn(e,e==null?void 0:e.value):s=new Gn(e.key,e.value);const i=aa(this.items,s.key),r=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!n)throw new Error(`Key ${s.key} already set`);Ft(i.value)&&BA(s.value)?i.value.value=s.value:i.value=s.value}else if(r){const a=this.items.findIndex(l=>r(s,l)<0);a===-1?this.items.push(s):this.items.splice(a,0,s)}else this.items.push(s)}delete(e){const n=aa(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){const s=aa(this.items,e),i=s==null?void 0:s.value;return(!n&&Ft(i)?i.value:i)??void 0}has(e){return!!aa(this.items,e)}set(e,n){this.add(new Gn(e,n),!0)}toJSON(e,n,s){const i=s?new s:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items)jA(n,i,r);return i}toString(e,n,s){if(!e)return JSON.stringify(this);for(const i of this.items)if(!Yt(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),qA(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:n})}}const xc={collection:"map",default:!0,nodeClass:Es,tag:"tag:yaml.org,2002:map",resolve(t,e){return bc(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>Es.from(t,e,n)};class yo extends HA{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(yc,e),this.items=[]}add(e){this.items.push(e)}delete(e){const n=Kd(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){const s=Kd(e);if(typeof s!="number")return;const i=this.items[s];return!n&&Ft(i)?i.value:i}has(e){const n=Kd(e);return typeof n=="number"&&n=0?e:null}const Ec={collection:"seq",default:!0,nodeClass:yo,tag:"tag:yaml.org,2002:seq",resolve(t,e){return wc(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>yo.from(t,e,n)},Yp={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,s){return e=Object.assign({actualString:!0},e),Md(t,e,n,s)}},Zp={identify:t=>t==null,createNode:()=>new ut(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ut(null),stringify:({source:t},e)=>typeof t=="string"&&Zp.test.test(t)?t:e.options.nullStr},gv={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new ut(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&gv.test.test(t)){const s=t[0]==="t"||t[0]==="T";if(e===s)return t}return e?n.options.trueStr:n.options.falseStr}};function ci({format:t,minFractionDigits:e,tag:n,value:s}){if(typeof s=="bigint")return String(s);const i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=JSON.stringify(s);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}const XA={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ci},KA={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ci(t)}},YA={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new ut(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:ci},Jp=t=>typeof t=="bigint"||Number.isInteger(t),_v=(t,e,n,{intAsBigInt:s})=>s?BigInt(t):parseInt(t.substring(e),n);function ZA(t,e,n){const{value:s}=t;return Jp(s)&&s>=0?n+s.toString(e):ci(t)}const JA={identify:t=>Jp(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>_v(t,2,8,n),stringify:t=>ZA(t,8,"0o")},QA={identify:Jp,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>_v(t,0,10,n),stringify:ci},eM={identify:t=>Jp(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>_v(t,2,16,n),stringify:t=>ZA(t,16,"0x")},i7=[xc,Ec,Yp,Zp,gv,JA,QA,eM,XA,KA,YA];function Pw(t){return typeof t=="bigint"||Number.isInteger(t)}const Yd=({value:t})=>JSON.stringify(t),r7=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Yd},{identify:t=>t==null,createNode:()=>new ut(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Yd},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Yd},{identify:Pw,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>Pw(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Yd}],o7={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},a7=[xc,Ec].concat(r7,o7),vv={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof atob=="function"){const n=atob(t.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let i=0;i1&&e("Each pair must have its own sequence indicator");const i=s.items[0]||new Gn(new ut(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore} +${i.key.commentBefore}`:s.commentBefore),s.comment){const r=i.value??i.key;r.comment=r.comment?`${s.comment} +${r.comment}`:s.comment}s=i}t.items[n]=Yt(s)?s:new Gn(s)}}else e("Expected a sequence for this tag");return t}function nM(t,e,n){const{replacer:s}=n,i=new yo(t);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(mv(a,l,n))}return i}const yv={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:tM,createNode:nM};class Ll extends yo{constructor(){super(),this.add=Es.prototype.add.bind(this),this.delete=Es.prototype.delete.bind(this),this.get=Es.prototype.get.bind(this),this.has=Es.prototype.has.bind(this),this.set=Es.prototype.set.bind(this),this.tag=Ll.tag}toJSON(e,n){if(!n)return super.toJSON(e);const s=new Map;n!=null&&n.onCreate&&n.onCreate(s);for(const i of this.items){let r,o;if(Yt(i)?(r=Bs(i.key,"",n),o=Bs(i.value,r,n)):r=Bs(i,"",n),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(e,n,s){const i=nM(e,n,s),r=new this;return r.items=i.items,r}}Ll.tag="tag:yaml.org,2002:omap";const bv={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ll,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=tM(t,e),s=[];for(const{key:i}of n.items)Ft(i)&&(s.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new Ll,n)},createNode:(t,e,n)=>Ll.from(t,e,n)};function sM({value:t,source:e},n){return e&&(t?iM:rM).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const iM={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ut(!0),stringify:sM},rM={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ut(!1),stringify:sM},l7={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ci},c7={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ci(t)}},u7={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new ut(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){const s=t.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:ci},Rd=t=>typeof t=="bigint"||Number.isInteger(t);function Qp(t,e,n,{intAsBigInt:s}){const i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),s){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}const o=BigInt(t);return i==="-"?BigInt(-1)*o:o}const r=parseInt(t,n);return i==="-"?-1*r:r}function wv(t,e,n){const{value:s}=t;if(Rd(s)){const i=s.toString(e);return s<0?"-"+n+i.substr(1):n+i}return ci(t)}const d7={identify:Rd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Qp(t,2,2,n),stringify:t=>wv(t,2,"0b")},f7={identify:Rd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Qp(t,1,8,n),stringify:t=>wv(t,8,"0")},h7={identify:Rd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Qp(t,0,10,n),stringify:ci},p7={identify:Rd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Qp(t,2,16,n),stringify:t=>wv(t,16,"0x")};class Dl extends Es{constructor(e){super(e),this.tag=Dl.tag}add(e){let n;Yt(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new Gn(e.key,null):n=new Gn(e,null),aa(this.items,n.key)||this.items.push(n)}get(e,n){const s=aa(this.items,e);return!n&&Yt(s)?Ft(s.key)?s.key.value:s.key:s}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const s=aa(this.items,e);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new Gn(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(e,n,s){const{replacer:i}=s,r=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),r.items.push(mv(o,null,s));return r}}Dl.tag="tag:yaml.org,2002:set";const xv={collection:"map",identify:t=>t instanceof Set,nodeClass:Dl,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Dl.from(t,e,n),resolve(t,e){if(bc(t)){if(t.hasAllNullValues(!0))return Object.assign(new Dl,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function Ev(t,e){const n=t[0],s=n==="-"||n==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),r=s.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return n==="-"?i(-1)*r:r}function oM(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return ci(t);let s="";e<0&&(s="-",e*=n(-1));const i=n(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const aM={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>Ev(t,n),stringify:oM},lM={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Ev(t,!1),stringify:oM},em={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(em.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(n,s-1,i,r||0,o||0,a||0,l);const u=e[8];if(u&&u!=="Z"){let d=Ev(u,!1);Math.abs(d)<30&&(d*=60),c-=6e4*d}return new Date(c)},stringify:({value:t})=>t.toISOString().replace(/(T00:00:00)?\.000Z$/,"")},Iw=[xc,Ec,Yp,Zp,iM,rM,d7,f7,h7,p7,l7,c7,u7,vv,pr,bv,yv,xv,aM,lM,em],Ow=new Map([["core",i7],["failsafe",[xc,Ec,Yp]],["json",a7],["yaml11",Iw],["yaml-1.1",Iw]]),Lw={binary:vv,bool:gv,float:YA,floatExp:KA,floatNaN:XA,floatTime:lM,int:QA,intHex:eM,intOct:JA,intTime:aM,map:xc,merge:pr,null:Zp,omap:bv,pairs:yv,seq:Ec,set:xv,timestamp:em},m7={"tag:yaml.org,2002:binary":vv,"tag:yaml.org,2002:merge":pr,"tag:yaml.org,2002:omap":bv,"tag:yaml.org,2002:pairs":yv,"tag:yaml.org,2002:set":xv,"tag:yaml.org,2002:timestamp":em};function Jm(t,e,n){const s=Ow.get(e);if(s&&!t)return n&&!s.includes(pr)?s.concat(pr):s.slice();let i=s;if(!i)if(Array.isArray(t))i=[];else{const r=Array.from(Ow.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(t))for(const r of t)i=i.concat(r);else typeof t=="function"&&(i=t(i.slice()));return n&&(i=i.concat(pr)),i.reduce((r,o)=>{const a=typeof o=="string"?Lw[o]:o;if(!a){const l=JSON.stringify(o),c=Object.keys(Lw).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}const g7=(t,e)=>t.keye.key?1:0;class tm{constructor({compat:e,customTags:n,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Jm(e,"compat"):e?Jm(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?m7:{},this.tags=Jm(n,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,fo,{value:xc}),Object.defineProperty(this,Di,{value:Yp}),Object.defineProperty(this,yc,{value:Ec}),this.sortMapEntries=typeof o=="function"?o:o===!0?g7:null}clone(){const e=Object.create(tm.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function _7(t,e){var l;const n=[];let s=e.directives===!0;if(e.directives!==!1&&t.directives){const c=t.directives.toString(t);c?(n.push(c),s=!0):t.directives.docStart&&(s=!0)}s&&n.push("---");const i=zA(t,e),{commentString:r}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");const c=r(t.commentBefore);n.unshift(ur(c,""))}let o=!1,a=null;if(t.contents){if(tn(t.contents)){if(t.contents.spaceBefore&&s&&n.push(""),t.contents.commentBefore){const d=r(t.contents.commentBefore);n.push(ur(d,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}const c=a?void 0:()=>o=!0;let u=Yl(t.contents,i,()=>a=null,c);a&&(u+=oa(u,"",r(a))),(u[0]==="|"||u[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${u}`:n.push(u)}else n.push(Yl(t.contents,i));if((l=t.directives)!=null&&l.docEnd)if(t.comment){const c=r(t.comment);c.includes(` +`)?(n.push("..."),n.push(ur(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(ur(r(c),"")))}return n.join(` +`)+` +`}class Sc{constructor(e,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Gs,{value:W_});let i=null;typeof n=="function"||Array.isArray(n)?i=n:s===void 0&&n&&(s=n,n=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:o}=r;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Yn({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,i,s)}clone(){const e=Object.create(Sc.prototype,{[Gs]:{value:W_}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=tn(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ba(this.contents)&&this.contents.add(e)}addIn(e,n){Ba(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){const s=FA(this);e.anchor=!n||s.has(n)?$A(n||"a",s):n}return new jp(e.anchor)}createNode(e,n,s){let i;if(typeof n=="function")e=n.call({"":e},"",e),i=n;else if(Array.isArray(n)){const m=y=>typeof y=="number"||y instanceof String||y instanceof Number,g=n.filter(m).map(String);g.length>0&&(n=n.concat(g)),i=n}else s===void 0&&n&&(s=n,n=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:u}=s??{},{onAnchor:d,setAnchors:f,sourceObjects:h}=WD(this,o||"a"),v={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:d,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:h},_=Ju(e,u,v);return a&&Jt(_)&&(_.flow=!0),f(),_}createPair(e,n,s={}){const i=this.createNode(e,null,s),r=this.createNode(n,null,s);return new Gn(i,r)}delete(e){return Ba(this.contents)?this.contents.delete(e):!1}deleteIn(e){return fu(e)?this.contents==null?!1:(this.contents=null,!0):Ba(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Jt(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return fu(e)?!n&&Ft(this.contents)?this.contents.value:this.contents:Jt(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Jt(this.contents)?this.contents.has(e):!1}hasIn(e){return fu(e)?this.contents!==void 0:Jt(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Wh(this.schema,[e],n):Ba(this.contents)&&this.contents.set(e,n)}setIn(e,n){fu(e)?this.contents=n:this.contents==null?this.contents=Wh(this.schema,Array.from(e),n):Ba(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Yn({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Yn({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new tm(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Bs(this.contents,n??"",a);if(typeof r=="function")for(const{count:c,res:u}of a.anchors.values())r(u,c);return typeof o=="function"?vl(o,{"":l},"",l):l}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return _7(this,e)}}function Ba(t){if(Jt(t))return!0;throw new Error("Expected a YAML collection as document contents")}class Sv extends Error{constructor(e,n,s,i){super(),this.name=e,this.code=s,this.message=i,this.pos=n}}class la extends Sv{constructor(e,n,s){super("YAMLParseError",e,n,s)}}class cM extends Sv{constructor(e,n,s){super("YAMLWarning",e,n,s)}}const qh=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));const{line:s,col:i}=n.linePos[0];n.message+=` at line ${s}, column ${i}`;let r=i-1,o=t.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const a=Math.min(r-39,o.length-79);o="…"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,r))){let a=t.substring(e.lineStarts[s-2],e.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`… +`),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=n.linePos[1];l&&l.line===s&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));const c=" ".repeat(r)+"^".repeat(a);n.message+=`: + +${o} +${c} +`}};function Zl(t,{flow:e,indicator:n,next:s,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,u=a,d="",f="",h=!1,v=!1,_=null,m=null,g=null,y=null,b=null,w=null,T=null;for(const R of t)switch(v&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&r(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),v=!1),_&&(c&&R.type!=="comment"&&R.type!=="newline"&&r(_,"TAB_AS_INDENT","Tabs are not allowed as indentation"),_=null),R.type){case"space":!e&&(n!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&R.source.includes(" ")&&(_=R),u=!0;break;case"comment":{u||r(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const x=R.source.substring(1)||" ";d?d+=f+x:d=x,f="",c=!1;break}case"newline":c?d?d+=R.source:(!w||n!=="seq-item-ind")&&(l=!0):f+=R.source,c=!0,h=!0,(m||g)&&(y=R),u=!0;break;case"anchor":m&&r(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&r(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=R,T===null&&(T=R.offset),c=!1,u=!1,v=!0;break;case"tag":{g&&r(R,"MULTIPLE_TAGS","A node can have at most one tag"),g=R,T===null&&(T=R.offset),c=!1,u=!1,v=!0;break}case n:(m||g)&&r(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),w&&r(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${e??"collection"}`),w=R,c=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){b&&r(R,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=R,c=!1,u=!1;break}default:r(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),c=!1,u=!1}const S=t[t.length-1],A=S?S.offset+S.source.length:i;return v&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),_&&(c&&_.indent<=o||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&r(_,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:w,spaceBefore:l,comment:d,hasNewline:h,anchor:m,tag:g,newlineAfterProp:y,end:A,start:T??A}}function Qu(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` +`))return!0;if(t.end){for(const e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of t.items){for(const n of e.start)if(n.type==="newline")return!0;if(e.sep){for(const n of e.sep)if(n.type==="newline")return!0}if(Qu(e.key)||Qu(e.value))return!0}return!1;default:return!0}}function K_(t,e,n){if((e==null?void 0:e.type)==="flow-collection"){const s=e.end[0];s.indent===t&&(s.source==="]"||s.source==="}")&&Qu(e)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function uM(t,e,n){const{uniqueKeys:s}=t.options;if(s===!1)return!1;const i=typeof s=="function"?s:(r,o)=>r===o||Ft(r)&&Ft(o)&&r.value===o.value;return e.some(r=>i(r.key,n))}const Dw="All mapping items must start at the same column";function v7({composeNode:t,composeEmptyNode:e},n,s,i,r){var u;const o=(r==null?void 0:r.nodeClass)??Es,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=s.offset,c=null;for(const d of s.items){const{start:f,key:h,sep:v,value:_}=d,m=Zl(f,{indicator:"explicit-key-ind",next:h??(v==null?void 0:v[0]),offset:l,onError:i,parentIndent:s.indent,startOnNewline:!0}),g=!m.found;if(g){if(h&&(h.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==s.indent&&i(l,"BAD_INDENT",Dw)),!m.anchor&&!m.tag&&!v){c=m.end,m.comment&&(a.comment?a.comment+=` +`+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||Qu(h))&&i(h??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((u=m.found)==null?void 0:u.indent)!==s.indent&&i(l,"BAD_INDENT",Dw);n.atKey=!0;const y=m.end,b=h?t(n,h,m,i):e(n,y,f,null,m,i);n.schema.compat&&K_(s.indent,h,i),n.atKey=!1,uM(n,a.items,b)&&i(y,"DUPLICATE_KEY","Map keys must be unique");const w=Zl(v??[],{indicator:"map-value-ind",next:_,offset:b.range[2],onError:i,parentIndent:s.indent,startOnNewline:!h||h.type==="block-scalar"});if(l=w.end,w.found){g&&((_==null?void 0:_.type)==="block-map"&&!w.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.startt&&(t.type==="block-map"||t.type==="block-seq");function b7({composeNode:t,composeEmptyNode:e},n,s,i,r){const o=s.start.source==="{",a=o?"flow map":"flow sequence",l=(r==null?void 0:r.nodeClass)??(o?Es:yo),c=new l(n.schema);c.flow=!0;const u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=s.offset+s.start.source.length;for(let m=0;m0){const m=Cd(v,_,n.options.strict,i);m.comment&&(c.comment?c.comment+=` +`+m.comment:c.comment=m.comment),c.range=[s.offset,_,m.offset]}else c.range=[s.offset,_,_];return c}function tg(t,e,n,s,i,r){const o=n.type==="block-map"?v7(t,e,n,s,r):n.type==="block-seq"?y7(t,e,n,s,r):b7(t,e,n,s,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function w7(t,e,n,s,i){var f;const r=s.tag,o=r?e.directives.tagName(r.source,h=>i(r,"TAG_RESOLVE_FAILED",h)):null;if(n.type==="block-seq"){const{anchor:h,newlineAfterProp:v}=s,_=h&&r?h.offset>r.offset?h:r:h??r;_&&(!v||v.offset<_.offset)&&i(_,"MISSING_CHAR","Missing newline after block sequence props")}const a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===Es.tagName&&a==="map"||o===yo.tagName&&a==="seq")return tg(t,e,n,i,o);let l=e.schema.tags.find(h=>h.tag===o&&h.collection===a);if(!l){const h=e.schema.knownTags[o];if(h&&h.collection===a)e.schema.tags.push(Object.assign({},h,{default:!1})),l=h;else return h!=null&&h.collection?i(r,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),tg(t,e,n,i,o)}const c=tg(t,e,n,i,o,l),u=((f=l.resolve)==null?void 0:f.call(l,c,h=>i(r,"TAG_RESOLVE_FAILED",h),e.options))??c,d=tn(u)?u:new ut(u);return d.range=c.range,d.tag=o,l!=null&&l.format&&(d.format=l.format),d}function dM(t,e,n){const s=e.offset,i=x7(e,t.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};const r=i.mode===">"?ut.BLOCK_FOLDED:ut.BLOCK_LITERAL,o=e.source?E7(e.source):[];let a=o.length;for(let _=o.length-1;_>=0;--_){const m=o[_][1];if(m===""||m==="\r")a=_;else break}if(a===0){const _=i.chomp==="+"&&o.length>0?` +`.repeat(Math.max(1,o.length-1)):"";let m=s+i.length;return e.source&&(m+=e.source.length),{value:_,type:r,comment:i.comment,range:[s,m,m]}}let l=e.indent+i.indent,c=e.offset+i.length,u=0;for(let _=0;_l&&(l=m.length);else{m.length=a;--_)o[_][0].length>l&&(a=_+1);let d="",f="",h=!1;for(let _=0;_l||g[0]===" "?(f===" "?f=` +`:!h&&f===` +`&&(f=` + +`),d+=f+m.slice(l)+g,f=` +`,h=!0):g===""?f===` +`?d+=` +`:f=` +`:(d+=f+g,f=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let _=a;_n(s+f,h,v);switch(i){case"scalar":a=ut.PLAIN,l=S7(r,c);break;case"single-quoted-scalar":a=ut.QUOTE_SINGLE,l=T7(r,c);break;case"double-quoted-scalar":a=ut.QUOTE_DOUBLE,l=A7(r,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}const u=s+r.length,d=Cd(o,u,e,n);return{value:l,type:a,comment:d.comment,range:[s,u,d.offset]}}function S7(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),hM(t)}function T7(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),hM(t.slice(1,-1)).replace(/''/g,"'")}function hM(t){let e,n;try{e=new RegExp(`(.*?)(?r?t.slice(r,s+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function M7(t,e){let n="",s=t[e+1];for(;(s===" "||s===" "||s===` +`||s==="\r")&&!(s==="\r"&&t[e+2]!==` +`);)s===` +`&&(n+=` +`),e+=1,s=t[e+1];return n||(n=" "),{fold:n,offset:e}}const R7={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` +`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function C7(t,e,n,s){const i=t.substr(e,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const a=t.substr(e-2,n+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}function pM(t,e,n,s){const{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?dM(t,e,s):fM(e,t.options.strict,s),l=n?t.directives.tagName(n.source,d=>s(n,"TAG_RESOLVE_FAILED",d)):null;let c;t.options.stringKeys&&t.atKey?c=t.schema[Di]:l?c=k7(t.schema,i,l,n,s):e.type==="scalar"?c=P7(t,i,e,s):c=t.schema[Di];let u;try{const d=c.resolve(i,f=>s(n??e,"TAG_RESOLVE_FAILED",f),t.options);u=Ft(d)?d:new ut(d)}catch(d){const f=d instanceof Error?d.message:String(d);s(n??e,"TAG_RESOLVE_FAILED",f),u=new ut(i)}return u.range=a,u.source=i,r&&(u.type=r),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function k7(t,e,n,s,i){var a;if(n==="!")return t[Di];const r=[];for(const l of t.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)r.push(l);else return l;for(const l of r)if((a=l.test)!=null&&a.test(e))return l;const o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Di])}function P7({atKey:t,directives:e,schema:n},s,i,r){const o=n.tags.find(a=>{var l;return(a.default===!0||t&&a.default==="key")&&((l=a.test)==null?void 0:l.test(s))})||n[Di];if(n.compat){const a=n.compat.find(l=>{var c;return l.default&&((c=l.test)==null?void 0:c.test(s))})??n[Di];if(o.tag!==a.tag){const l=e.tagString(o.tag),c=e.tagString(a.tag),u=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",u,!0)}}return o}function I7(t,e,n){if(e){n===null&&(n=e.length);for(let s=n-1;s>=0;--s){let i=e[s];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++s];(i==null?void 0:i.type)==="space";)t+=i.source.length,i=e[++s];break}}return t}const O7={composeNode:mM,composeEmptyNode:Tv};function mM(t,e,n,s){const i=t.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=n;let c,u=!0;switch(e.type){case"alias":c=L7(t,e,s),(a||l)&&s(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=pM(t,e,l,s),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=w7(O7,t,e,n,s),a&&(c.anchor=a.source.substring(1));break;default:{const d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",d),c=Tv(t,e.offset,void 0,null,n,s),u=!1}}return a&&c.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!Ft(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&s(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&u&&(c.srcToken=e),c}function Tv(t,e,n,s,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){const u={type:"scalar",offset:I7(e,n,s),indent:-1,source:""},d=pM(t,u,a,c);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),r&&(d.comment=r,d.range[2]=l),d}function L7({options:t},{offset:e,source:n,end:s},i){const r=new jp(n.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+n.length,a=Cd(s,o,t.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}function D7(t,e,{offset:n,start:s,value:i,end:r},o){const a=Object.assign({_directives:e},t),l=new Sc(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=Zl(s,{indicator:"doc-start",next:i??(r==null?void 0:r[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?mM(c,i,u,o):Tv(c,u.end,s,null,u,o);const d=l.contents.range[2],f=Cd(r,d,!1,o);return f.comment&&(l.comment=f.comment),l.range=[n,d,f.offset],l}function Hc(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];const{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function Nw(t){var i;let e="",n=!1,s=!1;for(let r=0;r{const o=Hc(n);r?this.warnings.push(new cM(o,s,i)):this.errors.push(new la(o,s,i))},this.directives=new Yn({version:e.version||"1.2"}),this.options=e}decorate(e,n){const{comment:s,afterEmptyLine:i}=Nw(this.prelude);if(s){const r=e.contents;if(n)e.comment=e.comment?`${e.comment} +${s}`:s;else if(i||e.directives.docStart||!r)e.commentBefore=s;else if(Jt(r)&&!r.flow&&r.items.length>0){let o=r.items[0];Yt(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${s} +${a}`:s}else{const o=r.commentBefore;r.commentBefore=o?`${s} +${o}`:s}}n?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Nw(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,s=-1){for(const i of e)yield*this.next(i);yield*this.end(n,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(n,s,i)=>{const r=Hc(e);r[0]+=n,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const n=D7(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new la(Hc(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new la(Hc(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const n=Cd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const s=this.doc.comment;this.doc.comment=s?`${s} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new la(Hc(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const s=Object.assign({_directives:this.directives},this.options),i=new Sc(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}}function N7(t,e=!0,n){if(t){const s=(i,r,o)=>{const a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,r,o);else throw new la([a,a+1],r,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return fM(t,e,s);case"block-scalar":return dM({options:{strict:e}},t,s)}}return null}function U7(t,e){const{implicitKey:n=!1,indent:s,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=Md({type:o,value:t},{implicitKey:n,indent:s>0?" ".repeat(s):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:s,source:` +`}];switch(a[0]){case"|":case">":{const c=a.indexOf(` +`),u=a.substring(0,c),d=a.substring(c+1)+` +`,f=[{type:"block-scalar-header",offset:r,indent:s,source:u}];return gM(f,l)||f.push({type:"newline",offset:-1,indent:s,source:` +`}),{type:"block-scalar",offset:r,indent:s,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:r,indent:s,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:s,source:a,end:l};default:return{type:"scalar",offset:r,indent:s,source:a,end:l}}}function F7(t,e,n={}){let{afterKey:s=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=n,a="indent"in t?t.indent:null;if(s&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const c=t.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const l=Md({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":$7(t,l);break;case'"':ng(t,l,"double-quoted-scalar");break;case"'":ng(t,l,"single-quoted-scalar");break;default:ng(t,l,"scalar")}}function $7(t,e){const n=e.indexOf(` +`),s=e.substring(0,n),i=e.substring(n+1)+` +`;if(t.type==="block-scalar"){const r=t.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=s,t.source=i}else{const{offset:r}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:s}];gM(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:` +`});for(const l of Object.keys(t))l!=="type"&&l!=="offset"&&delete t[l];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:i})}}function gM(t,e){if(e)for(const n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function ng(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{const s=t.props.slice(1);let i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(const r of s)r.offset+=i;delete t.props,Object.assign(t,{type:n,source:e,end:s});break}case"block-map":case"block-seq":{const i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` +`};delete t.items,Object.assign(t,{type:n,source:e,end:[i]});break}default:{const s="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(const r of Object.keys(t))r!=="type"&&r!=="offset"&&delete t[r];Object.assign(t,{type:n,indent:s,source:e,end:i})}}}const B7=t=>"type"in t?Xh(t):ph(t);function Xh(t){switch(t.type){case"block-scalar":{let e="";for(const n of t.props)e+=Xh(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(const n of t.items)e+=ph(n);return e}case"flow-collection":{let e=t.start.source;for(const n of t.items)e+=ph(n);for(const n of t.end)e+=n.source;return e}case"document":{let e=ph(t);if(t.end)for(const n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(const n of t.end)e+=n.source;return e}}}function ph({start:t,key:e,sep:n,value:s}){let i="";for(const r of t)i+=r.source;if(e&&(i+=Xh(e)),n)for(const r of n)i+=r.source;return s&&(i+=Xh(s)),i}const Y_=Symbol("break visit"),H7=Symbol("skip children"),_M=Symbol("remove item");function Ea(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),vM(Object.freeze([]),t,e)}Ea.BREAK=Y_;Ea.SKIP=H7;Ea.REMOVE=_M;Ea.itemAtPath=(t,e)=>{let n=t;for(const[s,i]of e){const r=n==null?void 0:n[s];if(r&&"items"in r)n=r.items[i];else return}return n};Ea.parentCollection=(t,e)=>{const n=Ea.itemAtPath(t,e.slice(0,-1)),s=e[e.length-1][0],i=n==null?void 0:n[s];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function vM(t,e,n){let s=n(e,t);if(typeof s=="symbol")return s;for(const i of["key","value"]){const r=e[i];if(r&&"items"in r){for(let o=0;o!!t&&"items"in t,z7=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function V7(t){switch(t){case nm:return"";case sm:return"";case im:return"";case ed:return"";default:return JSON.stringify(t)}}function yM(t){switch(t){case nm:return"byte-order-mark";case sm:return"doc-mode";case im:return"flow-error-end";case ed:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`:case`\r +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const W7=Object.freeze(Object.defineProperty({__proto__:null,BOM:nm,DOCUMENT:sm,FLOW_END:im,SCALAR:ed,createScalarToken:U7,isCollection:G7,isScalar:z7,prettyToken:V7,resolveAsScalar:N7,setScalarValue:F7,stringify:B7,tokenType:yM,visit:Ea},Symbol.toStringTag,{value:"Module"}));function js(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}const Uw=new Set("0123456789ABCDEFabcdef"),j7=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Zd=new Set(",[]{}"),q7=new Set(` ,[]{} +\r `),sg=t=>!t||q7.has(t);class bM{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let s=this.next??"stream";for(;s&&(n||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===` +`?!0:n==="\r"?this.buffer[e+1]===` +`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let s=0;for(;n===" ";)n=this.buffer[++s+e];if(n==="\r"){const i=this.buffer[s+e+1];if(i===` +`||!i&&!this.atEnd)return e+s+1}return n===` +`||s>=this.indentNext||!n&&!this.atEnd?e+s:-1}if(n==="-"||n==="."){const s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&js(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!js(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&js(n)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(sg),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,s=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>js(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,s;e:for(let r=this.pos;s=this.buffer[r];++r)switch(s){case" ":n+=1;break;case` +`:e=r,n=0;break;case"\r":{const o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===` +`)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(` +`,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(s=this.buffer[i];s===" ";)s=this.buffer[++i];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===` +`;)s=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);const a=r;for(;o===" ";)o=this.buffer[--r];if(o===` +`&&r>=this.pos&&r+1+n>a)e=r;else break}while(!0);return yield ed,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let n=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){const r=this.buffer[s+1];if(js(r)||e&&Zd.has(r))break;n=s}else if(js(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===` +`?(s+=1,i=` +`,r=this.buffer[s+1]):n=s),r==="#"||e&&Zd.has(r))break;if(i===` +`){const o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&Zd.has(i))break;n=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield ed,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){const s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(sg))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,n=this.charAt(1);if(js(n)||e&&Zd.has(n))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!js(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(j7.has(n))n=this.buffer[++e];else if(n==="%"&&Uw.has(this.buffer[e+1])&&Uw.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===` +`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` +`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,s;do s=this.buffer[++n];while(s===" "||e&&s===" ");const i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,s=this.buffer[n];for(;!e(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class wM{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,s=this.lineStarts.length;for(;n>1;this.lineStarts[r]=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=t[++e])==null?void 0:n.type)==="space";);return t.splice(e,t.length)}function $w(t){if(t.start.type==="flow-seq-start")for(const e of t.items)e.sep&&!e.value&&!ea(e.start,"explicit-key-ind")&&!ea(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,xM(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class Mv{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new bM,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(e,n))yield*this.next(s);n||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const n=yM(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const s=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in s?s.indent:0:n.type==="flow-collection"&&s.type==="document"&&(n.indent=0),n.type==="flow-collection"&&$w(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{const i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{const i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Fw(i.start)===-1&&(n.indent===0||i.start.every(r=>r.type!=="comment"||r.indent=e.indent){const i=!this.onKeyLine&&this.indent===e.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(r&&n.sep&&!n.value){const a=[];for(let l=0;le.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=n.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ea(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(xM(n.key)&&!ea(n.sep,"newline")){const a=Ha(n.start),l=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:c}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(ea(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const a=Ha(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:o,key:null,sep:[this.sourceToken]}):ea(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);r||n.value?(e.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(a):(Object.assign(n,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(e);if(a){i&&a.type!=="block-seq"&&e.items.push({start:o}),this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var s;const n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){const i="end"in n.value?n.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){const i=e.items[e.items.length-2],r=(s=i==null?void 0:i.value)==null?void 0:s.end;if(Array.isArray(r)){Array.prototype.push.apply(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||ea(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s&&s.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const i=Jd(s),r=Ha(i);$w(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(` +`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` +`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Jd(e),s=Ha(n);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Jd(e),s=Ha(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function EM(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new wM||null,prettyErrors:e}}function X7(t,e={}){const{lineCounter:n,prettyErrors:s}=EM(e),i=new Mv(n==null?void 0:n.addNewLine),r=new Av(e),o=Array.from(r.compose(i.parse(t)));if(s&&n)for(const a of o)a.errors.forEach(qh(t,n)),a.warnings.forEach(qh(t,n));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function SM(t,e={}){const{lineCounter:n,prettyErrors:s}=EM(e),i=new Mv(n==null?void 0:n.addNewLine),r=new Av(e);let o=null;for(const a of r.compose(i.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new la(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(qh(t,n)),o.warnings.forEach(qh(t,n))),o}function K7(t,e,n){let s;typeof e=="function"?s=e:n===void 0&&e&&typeof e=="object"&&(n=e);const i=SM(t,n);if(!i)return null;if(i.warnings.forEach(r=>VA(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},n))}function Y7(t,e,n){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){const i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){const{keepUndefined:i}=n??e??{};if(!i)return}return Ia(t)&&!s?t.toString(n):new Sc(t,s,n).toString(n)}const vr=Object.freeze(Object.defineProperty({__proto__:null,Alias:jp,CST:W7,Composer:Av,Document:Sc,Lexer:bM,LineCounter:wM,Pair:Gn,Parser:Mv,Scalar:ut,Schema:tm,YAMLError:Sv,YAMLMap:Es,YAMLParseError:la,YAMLSeq:yo,YAMLWarning:cM,isAlias:Pa,isCollection:Jt,isDocument:Ia,isMap:bc,isNode:tn,isPair:Yt,isScalar:Ft,isSeq:wc,parse:K7,parseAllDocuments:X7,parseDocument:SM,stringify:Y7,visit:vo,visitAsync:Wp},Symbol.toStringTag,{value:"Module"}));function Z_(t){if(t!==void 0&&t!=="NONE"){if(Array.isArray(t)){for(let e=t.length-1;e>=0;e--)t[e]=Z_(t[e]),t[e]||t.splice(e,1);if(t.length==0)return}if(Object.getPrototypeOf(t)===Object.prototype){const e=Object.keys(t);for(let n=e.length-1;n>=0;n--)t[e[n]]=Z_(t[e[n]]),t[e[n]]||delete t[e[n]];if(Object.keys(t).length==0)return}return t}}const Tc=Vn("target",{state:()=>({name:"",brushless:!0,gyro_orientation:0,leds:[],serial_ports:[],serial_soft_ports:[],spi_ports:[],motor_pins:[]}),getters:{yaml(t){const e=rn();return vr.stringify(Z_({mcu:e.mcu,...t.$state}))},serial_port_names(t){const e={},n=rn();if(n.quic_semver_gte("0.2.0")){for(const s of t.serial_ports)s.index!=0&&(e[`SERIAL_PORT${s.index}`]=s.index);for(const s of t.serial_soft_ports)s.index!=0&&(e[`SERIAL_SOFT_PORT${s.index}`]=100+s.index)}else for(let s=1;sthis.$patch(t))},apply(t){const e=Xt();return gt.set(en.Target,t).then(()=>this.fetch()).then(()=>e.append_alert({type:"success",msg:"Target applied!"}))}}});var Le;let Ve=(Le=class{static pixelsWidth(e,n=Le.BORDER,s=!1){return s&&(n=0),e*(Le.CHAR_WIDTH*(s?2:1)+n)+n}static pixelsHeight(e,n=Le.BORDER,s=!1){return s&&(n=0),e*(Le.CHAR_HEIGHT*(s?2:1)+n)+n}static elementDecode(e,n){switch(n){case"active":return e&1;case"invert":return e>>1&1;case"pos_sd_x":return e>>2&31;case"pos_sd_y":return e>>7&31;case"pos_hd_x":return e>>12&255;case"pos_hd_y":return e>>20&255;default:return 0}}static elementEncode(e,n,s){switch(n){case"active":return s?e|1:e&-2;case"invert":return s?e|2:e&-3;case"pos_sd_x":return e&-125|(s&31)<<2;case"pos_sd_y":return e&-3969|(s&31)<<7;case"pos_hd_x":return e&-1044481|(s&255)<<12;case"pos_hd_y":return e&~(255<<20)|(s&255)<<20;default:return e}}static elementDecodeLegacy(e,n){switch(n){case"active":return e&1;case"invert":return e>>1&1;case"pos_x":return e>>2&255;case"pos_y":return e>>10&255;default:return 0}}static elementEncodeLegacy(e,n,s){switch(n){case"active":return s?e|1:e&-2;case"invert":return s?e|2:e&-3;case"pos_x":return e&-1021|(s&255)<<2;case"pos_y":return e&-261121|(s&255)<<10;default:return e}}static unpackFont(e,n){return Le.unpackFontCanvas(e,n),e.toDataURL()}static unpackFontBitmap(e,n=!1){const s=new global.OffscreenCanvas(209,305);return Le.unpackFontCanvas(s,e,n),s.transferToImageBitmap()}static unpackFontCanvas(e,n,s=!1){const i=e.getContext("2d");i.clearRect(0,0,e.width,e.height),i.fillStyle="red",i.fillRect(0,0,Le.FULL_WIDTH,Le.FULL_HEIGHT);const r=new Uint8ClampedArray(Le.CHAR_WIDTH*Le.CHAR_HEIGHT*4);for(let o=0;o>6&3,s),Le.setPixel(r,c+1,u,f>>4&3,s),Le.setPixel(r,c+2,u,f>>2&3,s),Le.setPixel(r,c+3,u,f>>0&3,s),c+=4,c==Le.CHAR_WIDTH&&(c=0,u++);const d=new ImageData(r,Le.CHAR_WIDTH,Le.CHAR_HEIGHT);i.putImageData(d,Le.pixelsWidth(a),Le.pixelsHeight(o))}}static packCanvas(e){const n=e.getImageData(0,0,Le.FULL_WIDTH,Le.FULL_HEIGHT),s=[];for(let i=0;i0&&(i|=2),e[(s*Le.FULL_WIDTH+n)*4+3]<255&&(i|=1),i}},xe(Le,"CHAR_WIDTH",12),xe(Le,"CHAR_HEIGHT",18),xe(Le,"BORDER",1),xe(Le,"FONT_WIDTH",16),xe(Le,"FONT_HEIGHT",16),xe(Le,"FULL_WIDTH",Le.pixelsWidth(Le.FONT_WIDTH)),xe(Le,"FULL_HEIGHT",Le.pixelsHeight(Le.FONT_HEIGHT)),xe(Le,"LOGO_HEIGHT",4),xe(Le,"LOGO_WIDTH",24),xe(Le,"LOGO_FULL_WIDTH",Le.pixelsWidth(Le.LOGO_WIDTH,0)),xe(Le,"LOGO_FULL_HEIGHT",Le.pixelsHeight(Le.LOGO_HEIGHT,0)),Le);function Kh(t,e){for(const[n,s]of Object.entries(e))s!==null&&typeof s=="object"?(t[n]===void 0&&(t[n]=new s.__proto__.constructor),Kh(t[n],s)):t[n]=s;return t}function ig(t,e,n){return t<<16|e<<8|n}function Bw(t){return t=t||ig(0,1,0),tf.index!=0);for(const f of Object.keys(t.serial))t.serial[f]!=0&&(t.serial[f]<=d.length?t.serial[f]=d[t.serial[f]-1].index:t.serial[f]=t.serial[f]-d.length+100)}if(Bn.lte(n,"v0.2.4")){const d=[];for(let f=0;f({semver:"v0.0.0",modified:"",serial:{rx:0,smart_audio:0,hdzero:0},filter:{gyro:[{},{}],dterm:[{},{}]},osd:{callsign:"",elements:[],elements_hd:[],profiles:[{callsign:"",elements:[]},{callsign:"",elements:[]}]},meta:{name:"",datetime:0},motor:{gyro_orientation:0,invert_yaw:1,motor_pins:[]},rate:{mode:0,profile:0,silverware:{},betaflight:{},low_rate_mulitplier:0,level_max_angle:0,sticks_deadband:0,rates:[],throttle_expo:0,throttle_mid:0},voltage:{vbat_scale:0,ibat_scale:0},receiver:{lqi_source:-1,channel_mapping:0,aux:[],protocol:0},pid:{pid_profile:0,pid_rates:[{}],stick_profile:0,stick_rates:[{}],big_angle:{},small_angle:{},throttle_dterm_attenuation:{}},blackbox:{field_flags:0,sample_rate_hz:0}}),getters:{current_pid_rate:t=>t.pid.pid_rates[t.pid.pid_profile],current_stick_rate:t=>t.pid.stick_rates[t.pid.stick_profile],profileVersionGt(t){return e=>Bn.gt(t.semver,e)}},actions:{set_profile(t){t.modified=BD(new Date(t.meta.datetime*1e3)),t.semver=xa(t.meta.version),t.meta.name=t.meta.name.replace(/\0/g,""),this.$patch(t)},set_current_pid_rate(t){const e=[...this.pid.pid_rates];e[this.pid.pid_profile]=t,this.pid={...this.pid,pid_rates:e}},set_current_stick_rate(t){const e=[...this.pid.stick_rates];e[this.pid.stick_profile]=t,this.pid={...this.pid,stick_rates:e}},set_osd_elements(t){this.osd={...this.osd,elements:t}},set_osd_elements_hd(t){this.osd={...this.osd,elements_hd:t}},reset(){const t=vc();return this.apply_profile(t.$state)},fetch_profile(){return gt.get(en.Profile).then(t=>this.set_profile(t))},async merge_profile(t){const e=rg(await gt.get(en.Profile)),n=rg(t),s=Kh(e,n);return this.apply_profile(s)},apply_profile(t){const e=Xt(),n=rg(t);return gt.set(en.Profile,n).then(s=>this.set_profile(s)).then(()=>e.append_alert({type:"success",msg:"Profile applied!"})).then(()=>e.reset_needs_apply()).catch(s=>{at.error(s),e.append_alert({type:"danger",msg:"Apply failed! "+s})})}}});var TM=(t=>(t[t.BRUSHLESS=2]="BRUSHLESS",t[t.OSD=4]="OSD",t[t.BLACKBOX=8]="BLACKBOX",t[t.DEBUG=16]="DEBUG",t))(TM||{}),AM=(t=>(t[t.ROTATE_NONE=0]="ROTATE_NONE",t[t.ROTATE_45_CCW=1]="ROTATE_45_CCW",t[t.ROTATE_45_CW=2]="ROTATE_45_CW",t[t.ROTATE_90_CW=4]="ROTATE_90_CW",t[t.ROTATE_90_CCW=8]="ROTATE_90_CCW",t[t.ROTATE_180=16]="ROTATE_180",t[t.FLIP_180=32]="FLIP_180",t))(AM||{}),MM=(t=>(t[t.INVALID=0]="INVALID",t[t.MPU6000=1]="MPU6000",t[t.MPU6500=2]="MPU6500",t[t.ICM20601=3]="ICM20601",t[t.ICM20602=4]="ICM20602",t[t.ICM20608=5]="ICM20608",t[t.ICM20649=6]="ICM20649",t[t.ICM20689=7]="ICM20689",t[t.ICM42605=8]="ICM42605",t[t.ICM42688P=9]="ICM42688P",t[t.BMI270=10]="BMI270",t))(MM||{}),RM=(t=>(t[t.INVALID=0]="INVALID",t[t.MPU6000=1]="MPU6000",t[t.MPU6500=2]="MPU6500",t[t.ICM20601=3]="ICM20601",t[t.ICM20602=4]="ICM20602",t[t.ICM20608=5]="ICM20608",t[t.ICM20689=6]="ICM20689",t[t.ICM42605=7]="ICM42605",t[t.ICM42688P=8]="ICM42688P",t[t.BMI270=9]="BMI270",t[t.BMI323=10]="BMI323",t))(RM||{}),CM=(t=>(t[t.CHANNEL_5=0]="CHANNEL_5",t[t.CHANNEL_6=1]="CHANNEL_6",t[t.CHANNEL_7=2]="CHANNEL_7",t[t.CHANNEL_8=3]="CHANNEL_8",t[t.CHANNEL_9=4]="CHANNEL_9",t[t.CHANNEL_10=5]="CHANNEL_10",t[t.CHANNEL_11=6]="CHANNEL_11",t[t.CHANNEL_12=7]="CHANNEL_12",t[t.CHANNEL_13=8]="CHANNEL_13",t[t.CHANNEL_14=9]="CHANNEL_14",t[t.CHANNEL_15=10]="CHANNEL_15",t[t.CHANNEL_16=11]="CHANNEL_16",t[t.OFF=12]="OFF",t[t.ON=13]="ON",t))(CM||{}),kM=(t=>(t[t.AUX_ARMING=0]="AUX_ARMING",t[t.AUX_IDLE_UP=1]="AUX_IDLE_UP",t[t.AUX_LEVELMODE=2]="AUX_LEVELMODE",t[t.AUX_RACEMODE=3]="AUX_RACEMODE",t[t.AUX_HORIZON=4]="AUX_HORIZON",t[t.AUX_STICK_BOOST_PROFILE=5]="AUX_STICK_BOOST_PROFILE",t[t._AUX_RATE_PROFILE=6]="_AUX_RATE_PROFILE",t[t.AUX_BUZZER_ENABLE=7]="AUX_BUZZER_ENABLE",t[t.AUX_TURTLE=8]="AUX_TURTLE",t[t.AUX_MOTOR_TEST=9]="AUX_MOTOR_TEST",t[t.AUX_RSSI=10]="AUX_RSSI",t[t.AUX_FPV_SWITCH=11]="AUX_FPV_SWITCH",t[t.AUX_BLACKBOX=12]="AUX_BLACKBOX",t))(kM||{}),PM=(t=>(t[t.AUX_ARMING=0]="AUX_ARMING",t[t.AUX_IDLE_UP=1]="AUX_IDLE_UP",t[t.AUX_LEVELMODE=2]="AUX_LEVELMODE",t[t.AUX_RACEMODE=3]="AUX_RACEMODE",t[t.AUX_HORIZON=4]="AUX_HORIZON",t[t.AUX_STICK_BOOST_PROFILE=5]="AUX_STICK_BOOST_PROFILE",t[t._AUX_RATE_PROFILE=6]="_AUX_RATE_PROFILE",t[t.AUX_BUZZER_ENABLE=7]="AUX_BUZZER_ENABLE",t[t.AUX_TURTLE=8]="AUX_TURTLE",t[t.AUX_MOTOR_TEST=9]="AUX_MOTOR_TEST",t[t.AUX_RSSI=10]="AUX_RSSI",t[t.AUX_FPV_SWITCH=11]="AUX_FPV_SWITCH",t[t.AUX_BLACKBOX=12]="AUX_BLACKBOX",t[t.AUX_PREARM=13]="AUX_PREARM",t))(PM||{}),IM=(t=>(t[t.AUX_ARMING=0]="AUX_ARMING",t[t.AUX_IDLE_UP=1]="AUX_IDLE_UP",t[t.AUX_LEVELMODE=2]="AUX_LEVELMODE",t[t.AUX_RACEMODE=3]="AUX_RACEMODE",t[t.AUX_HORIZON=4]="AUX_HORIZON",t[t.AUX_STICK_BOOST_PROFILE=5]="AUX_STICK_BOOST_PROFILE",t[t._AUX_RATE_PROFILE=6]="_AUX_RATE_PROFILE",t[t.AUX_BUZZER_ENABLE=7]="AUX_BUZZER_ENABLE",t[t.AUX_TURTLE=8]="AUX_TURTLE",t[t.AUX_MOTOR_TEST=9]="AUX_MOTOR_TEST",t[t.AUX_RSSI=10]="AUX_RSSI",t[t.AUX_FPV_SWITCH=11]="AUX_FPV_SWITCH",t[t.AUX_BLACKBOX=12]="AUX_BLACKBOX",t[t.AUX_PREARM=13]="AUX_PREARM",t[t.AUX_OSD_PROFILE=14]="AUX_OSD_PROFILE",t))(IM||{}),OM=(t=>(t[t.INVALID=0]="INVALID",t[t.UNIFIED_SERIAL=1]="UNIFIED_SERIAL",t[t.SBUS=2]="SBUS",t[t.CRSF=3]="CRSF",t[t.IBUS=4]="IBUS",t[t.FPORT=5]="FPORT",t[t.DSMX_2048=6]="DSMX_2048",t[t.DSM2_1024=7]="DSM2_1024",t[t.NRF24_BAYANG_TELEMETRY=8]="NRF24_BAYANG_TELEMETRY",t[t.BAYANG_PROTOCOL_BLE_BEACON=9]="BAYANG_PROTOCOL_BLE_BEACON",t[t.BAYANG_PROTOCOL_TELEMETRY_AUTOBIND=10]="BAYANG_PROTOCOL_TELEMETRY_AUTOBIND",t[t.FRSKY_D8=11]="FRSKY_D8",t[t.FRSKY_D16=12]="FRSKY_D16",t[t.REDPINE=13]="REDPINE",t[t.EXPRESS_LRS=14]="EXPRESS_LRS",t))(OM||{}),LM=(t=>(t[t.INVALID=0]="INVALID",t[t.UNIFIED_SERIAL=1]="UNIFIED_SERIAL",t[t.SBUS=2]="SBUS",t[t.CRSF=3]="CRSF",t[t.IBUS=4]="IBUS",t[t.FPORT=5]="FPORT",t[t.DSM=6]="DSM",t[t.NRF24_BAYANG_TELEMETRY=7]="NRF24_BAYANG_TELEMETRY",t[t.BAYANG_PROTOCOL_BLE_BEACON=8]="BAYANG_PROTOCOL_BLE_BEACON",t[t.BAYANG_PROTOCOL_TELEMETRY_AUTOBIND=9]="BAYANG_PROTOCOL_TELEMETRY_AUTOBIND",t[t.FRSKY_D8=10]="FRSKY_D8",t[t.FRSKY_D16=11]="FRSKY_D16",t[t.REDPINE=12]="REDPINE",t[t.EXPRESS_LRS=13]="EXPRESS_LRS",t))(LM||{}),DM=(t=>(t[t.INVALID=0]="INVALID",t[t.UNIFIED_SERIAL=1]="UNIFIED_SERIAL",t[t.SBUS=2]="SBUS",t[t.CRSF=3]="CRSF",t[t.IBUS=4]="IBUS",t[t.FPORT=5]="FPORT",t[t.DSM=6]="DSM",t[t.NRF24_BAYANG_TELEMETRY=7]="NRF24_BAYANG_TELEMETRY",t[t.BAYANG_PROTOCOL_BLE_BEACON=8]="BAYANG_PROTOCOL_BLE_BEACON",t[t.BAYANG_PROTOCOL_TELEMETRY_AUTOBIND=9]="BAYANG_PROTOCOL_TELEMETRY_AUTOBIND",t[t.FRSKY_D8=10]="FRSKY_D8",t[t.FRSKY_D16_FCC=11]="FRSKY_D16_FCC",t[t.FRSKY_D16_LBT=12]="FRSKY_D16_LBT",t[t.REDPINE=13]="REDPINE",t[t.EXPRESS_LRS=14]="EXPRESS_LRS",t[t.FLYSKY_AFHDS=15]="FLYSKY_AFHDS",t[t.FLYSKY_AFHDS2A=16]="FLYSKY_AFHDS2A",t))(DM||{}),NM=(t=>(t[t.INVALID=0]="INVALID",t[t.DSM=1]="DSM",t[t.SBUS=2]="SBUS",t[t.IBUS=3]="IBUS",t[t.FPORT=4]="FPORT",t[t.CRSF=5]="CRSF",t[t.REDPINE=6]="REDPINE",t[t.SBUS_INVERTED=7]="SBUS_INVERTED",t[t.FPORT_INVERTED=8]="FPORT_INVERTED",t[t.REDPINE_INVERTED=9]="REDPINE_INVERTED",t))(NM||{}),bl=(t=>(t[t.STICK_WIZARD_INACTIVE=0]="STICK_WIZARD_INACTIVE",t[t.STICK_WIZARD_SUCCESS=1]="STICK_WIZARD_SUCCESS",t[t.STICK_WIZARD_FAILED=2]="STICK_WIZARD_FAILED",t[t.STICK_WIZARD_START=3]="STICK_WIZARD_START",t[t.STICK_WIZARD_CAPTURE_STICKS=4]="STICK_WIZARD_CAPTURE_STICKS",t[t.STICK_WIZARD_WAIT_FOR_CONFIRM=5]="STICK_WIZARD_WAIT_FOR_CONFIRM",t[t.STICK_WIZARD_CONFIRMED=6]="STICK_WIZARD_CONFIRMED",t[t.STICK_WIZARD_TIMEOUT=7]="STICK_WIZARD_TIMEOUT",t))(bl||{}),UM=(t=>(t[t.FAILLOOP_NONE=0]="FAILLOOP_NONE",t[t.FAILLOOP_LOW_BATTERY=2]="FAILLOOP_LOW_BATTERY",t[t.FAILLOOP_RADIO=3]="FAILLOOP_RADIO",t[t.FAILLOOP_GYRO=4]="FAILLOOP_GYRO",t[t.FAILLOOP_FAULT=5]="FAILLOOP_FAULT",t[t.FAILLOOP_LOOPTIME=6]="FAILLOOP_LOOPTIME",t[t.FAILLOOP_SPI=7]="FAILLOOP_SPI",t[t.FAILLOOP_SPI_MAIN=8]="FAILLOOP_SPI_MAIN",t))(UM||{}),Ke=(t=>(t[t.LOOP=0]="LOOP",t[t.TIME=1]="TIME",t[t.PID_P_TERM=2]="PID_P_TERM",t[t.PID_I_TERM=3]="PID_I_TERM",t[t.PID_D_TERM=4]="PID_D_TERM",t[t.RX=5]="RX",t[t.SETPOINT=6]="SETPOINT",t[t.ACCEL_RAW=7]="ACCEL_RAW",t[t.ACCEL_FILTER=8]="ACCEL_FILTER",t[t.GYRO_RAW=9]="GYRO_RAW",t[t.GYRO_FILTER=10]="GYRO_FILTER",t[t.MOTOR=11]="MOTOR",t[t.CPU_LOAD=12]="CPU_LOAD",t[t.DEBUG=13]="DEBUG",t))(Ke||{}),FM=(t=>(t[t.PACKET_RATE=0]="PACKET_RATE",t[t.CHANNEL=1]="CHANNEL",t[t.DIRECT=2]="DIRECT",t))(FM||{});const J7={0:"",2:"low battery at powerup - currently unused",3:"radio chip not found",4:"gyro not found",5:"clock, intterrupts, systick, gcc bad code, bad memory access (code issues like bad pointers) - this should not come up",6:"loop time issue - if loop time exceeds 20mS",7:"spi error - triggered by hardware spi driver only",8:"spi error main loop - triggered by hardware spi driver only"},Ro=Vn("constant",{state:()=>({Features:TM,GyroRotation:AM,AuxChannels:CM,RXSerialProtocol:NM,StickWizardState:bl,Failloop:UM,LQISource:FM}),getters:{RXProtocol(){const t=rn();return Bn.gt(t.quic_protocol_semver,"0.1.0")?DM:t.quic_protocol_version>5?LM:OM},AuxFunctions(){if(Dt().profileVersionGt("0.2.4"))return IM;const e=rn();return Bn.gt(e.quic_protocol_semver,"0.1.0")?PM:kM},GyroType(){const t=rn();return Bn.gt(t.quic_protocol_semver,"0.2.0")?RM:MM}},actions:{}}),ps=Vn("state",{state:()=>({looptime_autodetect:0,cpu_load:0,cpu_temp:0,vbat_filtered:0,vbattfilt:null,ibat_filtered:0,ibat_drawn:0,rx:[],rx_filtered:[],rx_status:0,rx_rssi:0,gyro_temp:0,GEstG:null,accel:null,angle_error:[],stick_vector:[],aux:[],stick_calibration_wizard:0,failloop:0,pidoutput:null,accel_raw:null,gyro:null,gyro_raw:null}),getters:{vbat(t){return t.vbattfilt||t.vbat_filtered},failloopMessage(t){return J7[t.failloop]}},actions:{fetch_state(){return gt.get(en.State).then(t=>this.$patch(t)).catch(t=>at.warn("state",t))}}});function rm(t){return t!==String(parseFloat(t))}function Q7(t){return Object.getOwnPropertyNames(t).filter(function(e){return t.propertyIsEnumerable(e)&&rm(e)})}function eN(t){return Object.keys(t).filter(rm)}function tN(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&t.propertyIsEnumerable(n)&&rm(n)&&e.push(n);return e}var nN=Object.getOwnPropertyNames?Q7:Object.keys?eN:tN,$M=function(){function t(e){this.enumObj=e,this.keysList=Object.freeze(nN(e));for(var n=this.keysList.length,s=new Array(n),i=new Map,r=0;r=n.length,r={done:i,value:n.keysList[s]};return++s,r}},e[Symbol.iterator]=function(){return this},e},t.prototype.values=function(){var e,n=this,s=0;return e={next:function(){var i=s>=n.length,r={done:i,value:n.valuesList[s]};return++s,r}},e[Symbol.iterator]=function(){return this},e},t.prototype.entries=function(){var e,n=this,s=0;return e={next:function(){var i=s>=n.length,r={done:i,value:n[s]};return++s,r}},e[Symbol.iterator]=function(){return this},e},t.prototype[Symbol.iterator]=function(){return this.entries()},t.prototype.forEach=function(e,n){for(var s=this.length,i=0;i({usart_ports:[],motor_pins:[],mcu:"",target_name:"",git_version:"",quic_protocol_version:0,quic_protocol_semver:"v0.0.0",gyro_id:0,gyro_name:"",rx_protocol:0,rx_protocols:[],features:0}),getters:{has_feature(t){return e=>t.features==null?!0:t.features&e},quic_semver_gt(t){return e=>Bn.gt(t.quic_protocol_semver,e)},quic_semver_gte(t){return e=>Bn.gte(t.quic_protocol_semver,e)},version_too_old(t){const e=vc();return t.quic_protocol_version<5||Bn.lte(xa(e.meta.version),"v0.1.0")},is_read_only(t){const e=ps();return this.version_too_old||e.failloop>0}},actions:{set_info(t){this.$patch(t),this.quic_protocol_version&&(this.quic_protocol_semver=xa(this.quic_protocol_version));const e=Ro();this.gyro_name=Cn(e.GyroType).getKeys()[this.gyro_id]}}}),J_=Vn("vtx",{state:()=>({settings:{protocol:0,detected:0,channel:0,band:0,power_table:{levels:0,labels:[],values:[]}}}),actions:{apply_vtx_settings(t){const e=Xt();if(t.power_table)for(let n=0;nthis.settings=n).then(()=>{e.append_alert({type:"success",msg:"Apply successful!"})}).catch(()=>{e.append_alert({type:"danger",msg:"Apply failed"})})},update_vtx_settings(t=!1){if(this.settings.detected==0||t)return gt.get(en.VtxSettings).then(e=>{const n=e.detected==0?this.settings.protocol:e.protocol;this.settings={...e,protocol:n}})}}}),HM=Vn("perf",{state:()=>({counters:[]}),actions:{fetch_perf_counters(){return gt.get(en.PerfCounters).then(t=>this.counters=t)}}}),Cv=Vn("bind",{state:()=>({info:{bind_saved:0,raw:new Uint8Array}}),actions:{fetch_bind_info(){return gt.get(en.BindInfo).then(t=>this.info=t)},apply_bind_info(t){const e=Xt();return gt.set(en.BindInfo,t).then(n=>this.info=n).then(()=>e.set_needs_reboot()).then(()=>e.append_alert({type:"success",msg:"Bind info applied!"})).catch(n=>{at.error(n),e.append_alert({type:"danger",msg:"Apply failed! "+n})})}}}),dN=nt({name:"Motor",setup(){return{profile:Dt(),info:rn(),constants:Ro()}},data(){return{invertYawModes:[{value:0,text:"Props In"},{value:1,text:"Props Out"}],dshotTimes:[{value:150,text:"150"},{value:300,text:"300"},{value:600,text:"600"}]}},computed:{gyroOrientation:{get(){return this.profile.motor.gyro_orientation&31},set(t){this.profile.motor.gyro_orientation=t|(this.gyroFlip?this.constants.GyroRotation.FLIP_180:0)}},gyroOrientations(){return[{value:this.constants.GyroRotation.ROTATE_NONE,text:"ROTATE_NONE"},{value:this.constants.GyroRotation.ROTATE_45_CCW,text:"ROTATE_45_CCW"},{value:this.constants.GyroRotation.ROTATE_45_CW,text:"ROTATE_45_CW"},{value:this.constants.GyroRotation.ROTATE_90_CW,text:"ROTATE_90_CW"},{value:this.constants.GyroRotation.ROTATE_90_CCW,text:"ROTATE_90_CCW"},{value:this.constants.GyroRotation.ROTATE_90_CCW|this.constants.GyroRotation.ROTATE_45_CCW,text:"ROTATE_135_CW"},{value:this.constants.GyroRotation.ROTATE_90_CW|this.constants.GyroRotation.ROTATE_45_CW,text:"ROTATE_135_CCW"},{value:this.constants.GyroRotation.ROTATE_180,text:"ROTATE_180"}]},gyroFlip:{get(){return(this.profile.motor.gyro_orientation&this.constants.GyroRotation.FLIP_180)>0},set(t){this.profile.motor.gyro_orientation=this.gyroOrientation|(t?this.constants.GyroRotation.FLIP_180:0)}}}}),fN={class:"card"},hN={class:"card-content"},pN={class:"content column-narrow field-is-5"},mN={class:"columns"},gN={class:"column is-6"},_N={id:"svg1",width:"100%",style:{"max-width":"400px",width:"100%"},height:"400",viewBox:"0 0 135.46665 135.46665",version:"1.1","sodipodi:docname":"props_view.svg","inkscape:version":"1.3.2 (091e20ef0f, 2023-11-25, custom)","xml:space":"preserve","xmlns:inkscape":"http://www.inkscape.org/namespaces/inkscape","xmlns:sodipodi":"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg"},vN={key:0,id:"g5",style:{"stroke-width":"2.64583","stroke-dasharray":"none"},transform:"matrix(1.2037011,0,0,1.2037011,-13.909145,-13.640148)","inkscape:label":"props_in_bl"},yN={key:1,id:"g5-2",transform:"matrix(-1.2037011,0,0,-1.2037011,149.37581,149.26403)",style:{"stroke-width":"2.64583","stroke-dasharray":"none"},"inkscape:label":"props_in_fr"},bN={key:2,id:"g5-2-2",transform:"matrix(-1.2037013,0,0,1.2037013,149.37582,-13.797383)",style:{"stroke-width":"2.64583","stroke-dasharray":"none"},"inkscape:label":"props_in_br"},wN={key:3,id:"g5-2-1-2",transform:"matrix(1.2037013,0,0,-1.2037013,-13.829304,149.26404)",style:{display:"inline","stroke-width":"2.64583","stroke-dasharray":"none"},"inkscape:label":"props_in_fl"},xN={key:4,id:"g5-2-1",transform:"matrix(1.2037013,0,0,-1.2037013,-13.909145,149.65895)",style:{display:"inline","stroke-width":"2.64583","stroke-dasharray":"none"},"inkscape:label":"props_out_fl"},EN={key:5,id:"g5-2-1-8",transform:"matrix(-1.2037011,0,0,-1.2037011,149.37581,149.26403)",style:{display:"inline","stroke-width":"2.64583","stroke-dasharray":"none"},"inkscape:label":"props_out_fr"},SN={key:6,id:"g5-2-1-0",transform:"matrix(-1.2037013,0,0,1.2037013,149.37582,-13.988638)",style:{display:"inline","stroke-width":"2.64583","stroke-dasharray":"none"},"inkscape:label":"props_out_br"},TN={key:7,id:"g5-2-1-5",transform:"matrix(1.2037011,0,0,1.2037011,-13.909145,-13.842473)",style:{display:"inline","stroke-width":"2.64583","stroke-dasharray":"none"},"inkscape:label":"props_out_bl"},AN={class:"column is-6"},MN={class:"field is-horizontal"},RN={class:"field-label"},CN={class:"label"},kN={class:"field-body"},PN={class:"field"},IN={class:"control is-expanded"},ON={class:"field is-horizontal"},LN={class:"field-label"},DN={class:"label"},NN={class:"field-body"},UN={class:"field"},FN={class:"control is-expanded"},$N={key:0,class:"field is-horizontal"},BN={class:"field-label"},HN={class:"label"},GN={class:"field-body"},zN={class:"field"},VN={class:"control is-expanded"},WN={class:"field is-horizontal"},jN={class:"field-label"},qN={class:"label"},XN={class:"field-body"},KN={class:"field"},YN={class:"control is-expanded"},ZN={class:"field is-horizontal"},JN={class:"field-label"},QN={class:"label"},e9={class:"field-body"},t9={class:"field"},n9={class:"control is-expanded"},s9={class:"field is-horizontal"},i9={class:"field-label"},r9={class:"label"},o9={class:"field-body"},a9={class:"field"},l9={class:"control is-expanded"},c9={class:"field is-horizontal"},u9={class:"field-label"},d9={class:"label"},f9={class:"field-body"},h9={class:"field"},p9={class:"control is-expanded"},m9={class:"field is-horizontal"},g9={class:"field-label"},_9={class:"label"},v9={class:"field-body"},y9={class:"field"},b9={class:"control is-expanded"},w9={key:1,class:"field is-horizontal"},x9={class:"field-label"},E9={class:"label"},S9={class:"field-body"},T9={class:"field"},A9={class:"control is-expanded"};function M9(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("input-select");return Z(),re("div",fN,[e[29]||(e[29]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Motor")],-1)),p("div",hN,[p("div",pN,[p("div",mN,[p("div",gN,[p("div",null,[p("h4",null,[ye(" Props "+$e(t.profile.motor.invert_yaw?"Out":"In")+" ",1),X(o,{entry:"motor.invert_yaw"})]),(Z(),re("svg",_N,[e[17]||(e[17]=p("path",{id:"path1",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"11.1468","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"M 108.49869,108.49869 26.967982,26.967982"},null,-1)),e[18]||(e[18]=p("path",{id:"path2",style:{display:"inline",fill:"#7a7a7a","fill-opacity":"1",stroke:"#7a7a7a","stroke-width":"11.1468","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"M 26.967982,108.49869 108.49869,26.967982","inkscape:label":"path2"},null,-1)),t.profile.motor.invert_yaw?He("",!0):(Z(),re("g",vN,e[9]||(e[9]=[p("circle",{id:"path4",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),p("path",{id:"path5",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 0.346888,-6.75997"},null,-1),p("path",{id:"path5-6",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 -6.759978,0.34689"},null,-1)]))),t.profile.motor.invert_yaw?He("",!0):(Z(),re("g",yN,e[10]||(e[10]=[p("circle",{id:"path4-0",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),p("path",{id:"path5-2",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 0.346888,-6.75997"},null,-1),p("path",{id:"path5-6-3",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 -6.759978,0.34689"},null,-1)]))),t.profile.motor.invert_yaw?He("",!0):(Z(),re("g",bN,e[11]||(e[11]=[p("circle",{id:"path4-0-2",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),p("path",{id:"path5-2-8",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 0.346888,-6.75997"},null,-1),p("path",{id:"path5-6-3-9",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 -6.759978,0.34689"},null,-1)]))),t.profile.motor.invert_yaw?He("",!0):(Z(),re("g",wN,e[12]||(e[12]=[p("circle",{id:"path4-0-29-54",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),p("path",{id:"path5-2-3-7",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 0.346888,-6.75997"},null,-1),p("path",{id:"path5-6-3-1-4",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 -6.759978,0.34689"},null,-1)]))),t.profile.motor.invert_yaw?(Z(),re("g",xN,e[13]||(e[13]=[p("circle",{id:"path4-0-29",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),p("path",{id:"path5-2-3",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 -0.34689,6.75997"},null,-1),p("path",{id:"path5-6-3-1",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 6.75997,-0.34689"},null,-1)]))):He("",!0),t.profile.motor.invert_yaw?(Z(),re("g",EN,e[14]||(e[14]=[p("circle",{id:"path4-0-29-4",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),p("path",{id:"path5-2-3-5",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 -0.34689,6.75997"},null,-1),p("path",{id:"path5-6-3-1-0",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 6.75997,-0.34689"},null,-1)]))):He("",!0),t.profile.motor.invert_yaw?(Z(),re("g",SN,e[15]||(e[15]=[p("circle",{id:"path4-0-29-6",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),p("path",{id:"path5-2-3-3",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 -0.34689,6.75997"},null,-1),p("path",{id:"path5-6-3-1-2",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 6.75997,-0.34689"},null,-1)]))):He("",!0),t.profile.motor.invert_yaw?(Z(),re("g",TN,e[16]||(e[16]=[p("circle",{id:"path4-0-29-5",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),p("path",{id:"path5-2-3-4",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 -0.34689,6.75997"},null,-1),p("path",{id:"path5-6-3-1-7",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 6.75997,-0.34689"},null,-1)]))):He("",!0)]))])]),p("div",AN,[p("div",MN,[p("div",RN,[p("label",CN,[e[19]||(e[19]=ye(" Invert Yaw ")),X(o,{entry:"motor.invert_yaw"})])]),p("div",kN,[p("div",PN,[p("div",IN,[X(a,{id:"invert-yaw",modelValue:t.profile.motor.invert_yaw,"onUpdate:modelValue":e[0]||(e[0]=l=>t.profile.motor.invert_yaw=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.invertYawModes},null,8,["modelValue","options"])])])])]),p("div",ON,[p("div",LN,[p("label",DN,[e[20]||(e[20]=ye(" Digital Idle ")),X(o,{entry:"motor.digital_idle"})])]),p("div",NN,[p("div",UN,[p("div",FN,[We(p("input",{id:"digital-idle","onUpdate:modelValue":e[1]||(e[1]=l=>t.profile.motor.digital_idle=l),class:"input",type:"number",step:"0.5",min:"0",max:"100"},null,512),[[et,t.profile.motor.digital_idle,void 0,{number:!0}]])])])])]),t.info.quic_protocol_version>1&&t.info.has_feature(t.constants.Features.BRUSHLESS)?(Z(),re("div",$N,[p("div",BN,[p("label",HN,[e[21]||(e[21]=ye(" DShot Time ")),X(o,{entry:"motor.dshot_time"})])]),p("div",GN,[p("div",zN,[p("div",VN,[X(a,{id:"dshot-time",modelValue:t.profile.motor.dshot_time,"onUpdate:modelValue":e[2]||(e[2]=l=>t.profile.motor.dshot_time=l),class:"is-fullwidth",options:t.dshotTimes},null,8,["modelValue","options"])])])])])):He("",!0),p("div",WN,[p("div",jN,[p("label",qN,[e[22]||(e[22]=ye(" Flip Gyro ")),X(o,{entry:"motor.flip_gyro"})])]),p("div",XN,[p("div",KN,[p("div",YN,[We(p("input",{id:"gyro-flip","onUpdate:modelValue":e[3]||(e[3]=l=>t.gyroFlip=l),type:"checkbox",class:"switch"},null,512),[[J3,t.gyroFlip]]),e[23]||(e[23]=p("label",{class:"py-0",style:{height:"2em"},for:"gyro-flip"},null,-1))])])])]),p("div",ZN,[p("div",JN,[p("label",QN,[e[24]||(e[24]=ye(" Gyro Orientation ")),X(o,{entry:"motor.gyro_orientation"})])]),p("div",e9,[p("div",t9,[p("div",n9,[X(a,{id:"gyro-orientation",modelValue:t.gyroOrientation,"onUpdate:modelValue":e[4]||(e[4]=l=>t.gyroOrientation=l),class:"is-fullwidth",options:t.gyroOrientations},null,8,["modelValue","options"])])])])]),p("div",s9,[p("div",i9,[p("label",r9,[e[25]||(e[25]=ye(" Torque Boost ")),X(o,{entry:"motor.torque_boost"})])]),p("div",o9,[p("div",a9,[p("div",l9,[We(p("input",{id:"torque-boost","onUpdate:modelValue":e[5]||(e[5]=l=>t.profile.motor.torque_boost=l),class:"input",type:"number",step:"0.1",min:"0"},null,512),[[et,t.profile.motor.torque_boost,void 0,{number:!0}]])])])])]),p("div",c9,[p("div",u9,[p("label",d9,[e[26]||(e[26]=ye(" Throttle Boost ")),X(o,{entry:"motor.throttle_boost"})])]),p("div",f9,[p("div",h9,[p("div",p9,[We(p("input",{id:"throttle-boost","onUpdate:modelValue":e[6]||(e[6]=l=>t.profile.motor.throttle_boost=l),class:"input",type:"number",step:"0.1",min:"0"},null,512),[[et,t.profile.motor.throttle_boost,void 0,{number:!0}]])])])])]),p("div",m9,[p("div",g9,[p("label",_9,[e[27]||(e[27]=ye(" Turtle Throttle Percent ")),X(o,{entry:"motor.turtle_throttle_percent"})])]),p("div",v9,[p("div",y9,[p("div",b9,[We(p("input",{id:"turtle-throttle-percent","onUpdate:modelValue":e[7]||(e[7]=l=>t.profile.motor.turtle_throttle_percent=l),class:"input",type:"number",step:"1",min:"0",max:"100"},null,512),[[et,t.profile.motor.turtle_throttle_percent,void 0,{number:!0}]])])])])]),t.profile.profileVersionGt("0.2.0")?(Z(),re("div",w9,[p("div",x9,[p("label",E9,[e[28]||(e[28]=ye(" Motor Limit Percent ")),X(o,{entry:"motor.motor_limit"})])]),p("div",S9,[p("div",T9,[p("div",A9,[We(p("input",{id:"motor-limit-percent","onUpdate:modelValue":e[8]||(e[8]=l=>t.profile.motor.motor_limit=l),class:"input",type:"number",step:"1",min:"0",max:"100"},null,512),[[et,t.profile.motor.motor_limit,void 0,{number:!0}]])])])])])):He("",!0)])])])])])}const R9=lt(dN,[["render",M9]]),C9=nt({name:"Voltage",setup(){return{profile:Dt(),state:ps()}},data(){return{pidVoltageCompensationOptions:[{value:0,text:"Off"},{value:1,text:"On"}]}},computed:{pid_voltage_compensation:{get(){return this.profile.voltage.pid_voltage_compensation},set(t){this.profile.voltage.pid_voltage_compensation=t?1:0}}}}),k9={class:"card"},P9={class:"card-header"},I9={class:"card-header-icon"},O9={class:"card-content"},L9={class:"content column-narrow field-is-5"},D9={class:"field is-horizontal"},N9={class:"field-label"},U9={class:"label"},F9={class:"field-body"},$9={class:"field"},B9={class:"control is-expanded"},H9={class:"field is-horizontal"},G9={class:"field-label"},z9={class:"label"},V9={class:"field-body"},W9={class:"field"},j9={class:"control is-expanded"},q9={class:"field is-horizontal"},X9={class:"field-label"},K9={class:"label"},Y9={class:"field-body"},Z9={class:"field"},J9={class:"control is-expanded"},Q9={class:"field is-horizontal"},eU={class:"field-label"},tU={class:"label"},nU={class:"field-body"},sU={class:"field"},iU={class:"control is-expanded"},rU={class:"field is-horizontal"},oU={class:"field-label"},aU={class:"label"},lU={class:"field-body"},cU={class:"field"},uU={class:"control is-expanded"},dU={class:"field is-horizontal"},fU={class:"field-label"},hU={class:"label"},pU={class:"field-body"},mU={class:"field"},gU={class:"control is-expanded"},_U={class:"field is-horizontal"},vU={class:"field-label"},yU={class:"label"},bU={class:"field-body"},wU={class:"field"},xU={class:"control is-expanded"},EU={key:0,class:"field is-horizontal"},SU={class:"field-label"},TU={class:"label"},AU={class:"field-body"},MU={class:"field"},RU={class:"control is-expanded"},CU=["checked"];function kU(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("input-select");return Z(),re("div",k9,[p("header",P9,[e[8]||(e[8]=p("p",{class:"card-header-title"},"Voltage",-1)),p("small",I9,$e(t.state.vbat.toFixed(2))+"V "+$e(t.state.ibat_filtered.toFixed(2))+"mA ",1)]),p("div",O9,[p("div",L9,[p("div",D9,[p("div",N9,[p("label",U9,[e[9]||(e[9]=ye(" LipoCellCount ")),X(o,{entry:"voltage.lipo_cell_count"})])]),p("div",F9,[p("div",$9,[p("div",B9,[We(p("input",{id:"lipo-cell-count","onUpdate:modelValue":e[0]||(e[0]=l=>t.profile.voltage.lipo_cell_count=l),class:"input",type:"number",step:"1",min:"0"},null,512),[[et,t.profile.voltage.lipo_cell_count,void 0,{number:!0}]])])])])]),p("div",H9,[p("div",G9,[p("label",z9,[e[10]||(e[10]=ye(" PidVoltageCompensation ")),X(o,{entry:"voltage.pid_voltage_compensation"})])]),p("div",V9,[p("div",W9,[p("div",j9,[X(a,{modelValue:t.profile.voltage.pid_voltage_compensation,"onUpdate:modelValue":e[1]||(e[1]=l=>t.profile.voltage.pid_voltage_compensation=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.pidVoltageCompensationOptions},null,8,["modelValue","options"])])])])]),p("div",q9,[p("div",X9,[p("label",K9,[e[11]||(e[11]=ye(" VBattLow ")),X(o,{entry:"voltage.vbattlow"})])]),p("div",Y9,[p("div",Z9,[p("div",J9,[We(p("input",{id:"vbattlow","onUpdate:modelValue":e[2]||(e[2]=l=>t.profile.voltage.vbattlow=l),class:"input",type:"number",step:"0.1",min:"0"},null,512),[[et,t.profile.voltage.vbattlow,void 0,{number:!0}]])])])])]),p("div",Q9,[p("div",eU,[p("label",tU,[e[12]||(e[12]=ye(" ActualBatteryVoltage ")),X(o,{entry:"voltage.actual_battery_voltage"})])]),p("div",nU,[p("div",sU,[p("div",iU,[We(p("input",{id:"actual-battery-voltage","onUpdate:modelValue":e[3]||(e[3]=l=>t.profile.voltage.actual_battery_voltage=l),class:"input",type:"number",step:"0.1",min:"0"},null,512),[[et,t.profile.voltage.actual_battery_voltage,void 0,{number:!0}]])])])])]),p("div",rU,[p("div",oU,[p("label",aU,[e[13]||(e[13]=ye(" ReportedTelemetryVoltage ")),X(o,{entry:"voltage.reported_telemetry_voltage"})])]),p("div",lU,[p("div",cU,[p("div",uU,[We(p("input",{id:"reported-telemetry-voltage","onUpdate:modelValue":e[4]||(e[4]=l=>t.profile.voltage.reported_telemetry_voltage=l),class:"input",type:"number",step:"0.1",min:"0"},null,512),[[et,t.profile.voltage.reported_telemetry_voltage,void 0,{number:!0}]])])])])]),p("div",dU,[p("div",fU,[p("label",hU,[e[14]||(e[14]=ye(" Voltage Meter Scale ")),X(o,{entry:"voltage.vbat_scale"})])]),p("div",pU,[p("div",mU,[p("div",gU,[We(p("input",{id:"vbat_scale","onUpdate:modelValue":e[5]||(e[5]=l=>t.profile.voltage.vbat_scale=l),class:"input",type:"number",step:"1",min:"0"},null,512),[[et,t.profile.voltage.vbat_scale,void 0,{number:!0}]])])])])]),p("div",_U,[p("div",vU,[p("label",yU,[e[15]||(e[15]=ye(" Current Meter Scale ")),X(o,{entry:"voltage.ibat_scale"})])]),p("div",bU,[p("div",wU,[p("div",xU,[We(p("input",{id:"ibat_scale","onUpdate:modelValue":e[6]||(e[6]=l=>t.profile.voltage.ibat_scale=l),class:"input",type:"number",step:"1",min:"0"},null,512),[[et,t.profile.voltage.ibat_scale,void 0,{number:!0}]])])])])]),t.profile.profileVersionGt("0.2.2")?(Z(),re("div",EU,[p("div",SU,[p("label",TU,[e[16]||(e[16]=ye(" Filtered voltage warnings ")),X(o,{entry:"voltage.use_filtered_voltage_for_warnings"})])]),p("div",AU,[p("div",MU,[p("div",RU,[p("input",{type:"checkbox",class:"switch",id:"use_filtered_voltage_for_warnings",checked:t.profile.voltage.use_filtered_voltage_for_warnings||0,onChange:e[7]||(e[7]=l=>t.profile.voltage.use_filtered_voltage_for_warnings=t.profile.voltage.use_filtered_voltage_for_warnings?0:1)},null,40,CU),e[17]||(e[17]=p("label",{class:"py-0",style:{height:"2em"},for:"use_filtered_voltage_for_warnings"},null,-1))])])])])):He("",!0)])])])}const PU=lt(C9,[["render",kU]]),IU=nt({name:"Serial",setup(){return{root:Xt(),target:Tc(),profile:Dt()}},computed:{serialPorts(){const t=[{value:0,text:"None"}];for(const[e,n]of Object.entries(this.target.serial_port_names))t.push({value:n,text:e});return t}},watch:{"profile.serial":{handler(){this.root.set_needs_reboot()},deep:!0}}}),OU={class:"card"},LU={class:"card-content"},DU={class:"content column-narrow field-is-5"},NU={class:"field is-horizontal"},UU={class:"field-label"},FU={class:"label"},$U={class:"field-body"},BU={class:"field"},HU={class:"control is-expanded"},GU={class:"field is-horizontal"},zU={class:"field-label"},VU={class:"label"},WU={class:"field-body"},jU={class:"field"},qU={class:"control is-expanded"},XU={class:"field is-horizontal"},KU={class:"field-label"},YU={class:"label"},ZU={class:"field-body"},JU={class:"field"},QU={class:"control is-expanded"};function eF(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("input-select");return Z(),re("div",OU,[e[6]||(e[6]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Serial")],-1)),p("div",LU,[p("div",DU,[p("div",NU,[p("div",UU,[p("label",FU,[e[3]||(e[3]=ye(" RX ")),X(o,{entry:"serial.rx"})])]),p("div",$U,[p("div",BU,[p("div",HU,[X(a,{id:"rx",modelValue:t.profile.serial.rx,"onUpdate:modelValue":e[0]||(e[0]=l=>t.profile.serial.rx=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.serialPorts},null,8,["modelValue","options"])])])])]),p("div",GU,[p("div",zU,[p("label",VU,[e[4]||(e[4]=ye(" VTX ")),X(o,{entry:"serial.smart_audio"})])]),p("div",WU,[p("div",jU,[p("div",qU,[X(a,{id:"smart-audio",modelValue:t.profile.serial.smart_audio,"onUpdate:modelValue":e[1]||(e[1]=l=>t.profile.serial.smart_audio=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.serialPorts},null,8,["modelValue","options"])])])])]),p("div",XU,[p("div",KU,[p("label",YU,[e[5]||(e[5]=ye(" Digital VTX ")),X(o,{entry:"serial.digital_vtx"})])]),p("div",ZU,[p("div",JU,[p("div",QU,[X(a,{id:"digital_vtx",modelValue:t.profile.serial.hdzero,"onUpdate:modelValue":e[2]||(e[2]=l=>t.profile.serial.hdzero=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.serialPorts},null,8,["modelValue","options"])])])])])])])])}const tF=lt(IU,[["render",eF]]),nF=nt({name:"Vtx",setup(){return{vtx:J_(),info:rn()}},data(){return{protocolNames:["INVALID","TRAMP","SMARTAUDIO","MSP_VTX"],frequencyTable:[[5865,5845,5825,5805,5785,5765,5745,5725],[5733,5752,5771,5790,5809,5828,5847,5866],[5705,5685,5665,5645,5885,5905,5925,5945],[5740,5760,5780,5800,5820,5840,5860,5880],[5658,5695,5732,5769,5806,5843,5880,5917],[5333,5373,5413,5453,5493,5533,5573,5613]]}},computed:{displayValueEdit(){return this.vtx.settings.protocol==1},vtxProtocolOptions(){const t=[{value:0,text:"AUTO"},{value:1,text:"TRAMP"},{value:2,text:"SMARTAUDIO"}];return this.info.quic_semver_gt("0.1.1")&&t.push({value:3,text:"MSP_VTX"}),t},vtxBandOptions(){const t=[{value:0,text:"VTX_BAND_A"},{value:1,text:"VTX_BAND_B"},{value:2,text:"VTX_BAND_E"},{value:3,text:"VTX_BAND_F"},{value:4,text:"VTX_BAND_R"}];return this.info.quic_semver_gt("0.1.1")&&t.push({value:5,text:"VTX_BAND_L"}),t},vtxPowerLevelOptions(){if(this.vtx.settings.power_table)return this.vtx.settings.power_table.labels.map((e,n)=>({value:n,text:e}));const t=[{value:0,text:"VTX_POWER_LEVEL_1"},{value:1,text:"VTX_POWER_LEVEL_2"},{value:2,text:"VTX_POWER_LEVEL_3"},{value:3,text:"VTX_POWER_LEVEL_4"}];return this.info.quic_semver_gt("0.1.1")&&t.push({value:4,text:"VTX_POWER_LEVEL_5"}),t},vtxChannelOptions(){return[{value:0,text:"VTX_CHANNEL_1"},{value:1,text:"VTX_CHANNEL_2"},{value:2,text:"VTX_CHANNEL_3"},{value:3,text:"VTX_CHANNEL_4"},{value:4,text:"VTX_CHANNEL_5"},{value:5,text:"VTX_CHANNEL_6"},{value:6,text:"VTX_CHANNEL_7"},{value:7,text:"VTX_CHANNEL_8"}]},vtxPitModeOptions(){return[{value:0,text:"Off"},{value:1,text:"On"}]}},created(){this.vtx.update_vtx_settings(!0)}}),sF={class:"card"},iF={class:"card-content"},rF={class:"content columns"},oF={class:"column field-is-3"},aF={class:"field is-horizontal"},lF={class:"field-body"},cF={class:"field"},uF={class:"control is-expanded"},dF={class:"field is-horizontal"},fF={class:"field-body"},hF={class:"field"},pF={class:"control is-expanded"},mF={class:"field is-horizontal"},gF={class:"field-body"},_F={class:"field"},vF={class:"control is-expanded"},yF={class:"field is-horizontal"},bF={class:"field-body"},wF={class:"field"},xF={class:"control is-expanded"},EF={key:0,class:"field is-horizontal"},SF={class:"field-body"},TF={class:"field"},AF={class:"control is-expanded"},MF={class:"field is-horizontal"},RF={class:"field-body"},CF={class:"field"},kF={class:"control is-expanded"},PF={key:1,class:"is-size-5 has-text-centered has-text-weight-semibold"},IF={class:"column field-is-3"},OF={class:"columns"},LF={key:0,class:"column is-4"},DF={class:"field field-is-2 is-horizontal"},NF={class:"field-label"},UF={class:"label"},FF={class:"field-body"},$F={class:"field"},BF={class:"control is-expanded"},HF={class:"columns is-multiline"},GF={class:"column is-6"},zF=["id","onUpdate:modelValue","readonly"],VF={key:0,class:"column is-6"},WF=["id","onUpdate:modelValue"],jF={class:"card-footer"};function qF(t,e,n,s,i,r){const o=Ie("input-select"),a=Ie("spinner-btn");return Z(),re("div",sF,[e[16]||(e[16]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"VTX")],-1)),p("div",iF,[p("div",rF,[p("div",oF,[p("div",aF,[e[6]||(e[6]=p("div",{class:"field-label"},[p("label",{class:"label"},"Protocol")],-1)),p("div",lF,[p("div",cF,[p("div",uF,[X(o,{id:"vtx-protocol",modelValue:t.vtx.settings.protocol,"onUpdate:modelValue":e[0]||(e[0]=l=>t.vtx.settings.protocol=l),modelModifiers:{number:!0},options:t.vtxProtocolOptions},null,8,["modelValue","options"])])])])]),t.vtx.settings.detected?(Z(),re(it,{key:0},[p("div",dF,[e[7]||(e[7]=p("div",{class:"field-label"},[p("label",{class:"label"},"Frequency")],-1)),p("div",fF,[p("div",hF,[p("div",pF,$e(t.frequencyTable[t.vtx.settings.band][t.vtx.settings.channel]),1)])])]),p("div",mF,[e[8]||(e[8]=p("div",{class:"field-label"},[p("label",{class:"label"},"Band")],-1)),p("div",gF,[p("div",_F,[p("div",vF,[X(o,{id:"vtx-band",modelValue:t.vtx.settings.band,"onUpdate:modelValue":e[1]||(e[1]=l=>t.vtx.settings.band=l),modelModifiers:{number:!0},options:t.vtxBandOptions},null,8,["modelValue","options"])])])])]),p("div",yF,[e[9]||(e[9]=p("div",{class:"field-label"},[p("label",{class:"label"},"Channel")],-1)),p("div",bF,[p("div",wF,[p("div",xF,[X(o,{id:"vtx-channel",modelValue:t.vtx.settings.channel,"onUpdate:modelValue":e[2]||(e[2]=l=>t.vtx.settings.channel=l),modelModifiers:{number:!0},options:t.vtxChannelOptions},null,8,["modelValue","options"])])])])]),t.vtx.settings.pit_mode!=2?(Z(),re("div",EF,[e[10]||(e[10]=p("div",{class:"field-label"},[p("label",{class:"label"},"Pit Mode")],-1)),p("div",SF,[p("div",TF,[p("div",AF,[X(o,{id:"vtx-pit-mode",modelValue:t.vtx.settings.pit_mode,"onUpdate:modelValue":e[3]||(e[3]=l=>t.vtx.settings.pit_mode=l),modelModifiers:{number:!0},options:t.vtxPitModeOptions},null,8,["modelValue","options"])])])])])):He("",!0),p("div",MF,[e[11]||(e[11]=p("div",{class:"field-label"},[p("label",{class:"label"},"Power")],-1)),p("div",RF,[p("div",CF,[p("div",kF,[X(o,{id:"vtx-power-level",modelValue:t.vtx.settings.power_level,"onUpdate:modelValue":e[4]||(e[4]=l=>t.vtx.settings.power_level=l),modelModifiers:{number:!0},options:t.vtxPowerLevelOptions},null,8,["modelValue","options"])])])])])],64)):(Z(),re("div",PF," Not detected "))]),p("div",IF,[t.vtx.settings.detected&&t.vtx.settings.power_table?(Z(),re(it,{key:0},[p("div",OF,[e[13]||(e[13]=p("div",{class:"column is-4",style:{"margin-left":"30%"}},[p("h6",{class:"mb-1 ml-2"},"Label")],-1)),t.displayValueEdit?(Z(),re("div",LF,e[12]||(e[12]=[p("h6",{class:"mb-1 ml-3"},"Value",-1)]))):He("",!0)]),(Z(!0),re(it,null,Ht(t.vtx.settings.power_table.labels,(l,c)=>(Z(),re("div",DF,[p("div",NF,[p("label",UF,"Power Level "+$e(c+1),1)]),p("div",FF,[p("div",$F,[p("div",BF,[p("div",HF,[p("div",GF,[We(p("input",{id:"power-level-value-"+c,"onUpdate:modelValue":u=>t.vtx.settings.power_table.labels[c]=u,class:ds(["input",{"is-static":t.vtx.settings.protocol==3}]),readonly:t.vtx.settings.protocol==3,type:"text",maxlength:"3"},null,10,zF),[[et,t.vtx.settings.power_table.labels[c],void 0,{text:!0}]])]),t.displayValueEdit?(Z(),re("div",VF,[We(p("input",{id:"power-level-value-"+c,"onUpdate:modelValue":u=>t.vtx.settings.power_table.values[c]=u,class:"input",type:"number",step:"0.1",min:"0"},null,8,WF),[[et,t.vtx.settings.power_table.values[c],void 0,{number:!0}]])])):He("",!0)])])])])]))),256))],64)):He("",!0)])])]),p("footer",jF,[e[15]||(e[15]=p("span",{class:"card-footer-item"},null,-1)),X(a,{class:"card-footer-item is-primary",onClick:e[5]||(e[5]=l=>t.vtx.apply_vtx_settings(t.vtx.settings))},{default:tt(()=>e[14]||(e[14]=[ye(" Apply ")])),_:1})])])}const XF=lt(nF,[["render",qF]]);/** + * @license + * Copyright 2010-2024 Three.js Authors + * SPDX-License-Identifier: MIT + */const kv="167",KF=0,Gw=1,YF=2,GM=1,ZF=2,Qi=3,yr=0,hs=1,xi=2,ho=0,Nl=1,zw=2,Vw=3,Ww=4,JF=5,ta=100,QF=101,e$=102,t$=103,n$=104,s$=200,i$=201,r$=202,o$=203,Q_=204,e0=205,a$=206,l$=207,c$=208,u$=209,d$=210,f$=211,h$=212,p$=213,m$=214,g$=0,_$=1,v$=2,Yh=3,y$=4,b$=5,w$=6,x$=7,zM=0,E$=1,S$=2,po=0,T$=1,A$=2,M$=3,R$=4,C$=5,k$=6,P$=7,jw="attached",I$="detached",VM=300,ec=301,tc=302,t0=303,n0=304,om=306,nc=1e3,ro=1001,Zh=1002,ts=1003,WM=1004,hu=1005,Ss=1006,mh=1007,dr=1008,br=1009,jM=1010,qM=1011,sd=1012,Pv=1013,Sa=1014,ei=1015,kd=1016,Iv=1017,Ov=1018,sc=1020,XM=35902,KM=1021,YM=1022,Ns=1023,ZM=1024,JM=1025,Ul=1026,ic=1027,Lv=1028,Dv=1029,QM=1030,Nv=1031,Uv=1033,gh=33776,_h=33777,vh=33778,yh=33779,s0=35840,i0=35841,r0=35842,o0=35843,a0=36196,l0=37492,c0=37496,u0=37808,d0=37809,f0=37810,h0=37811,p0=37812,m0=37813,g0=37814,_0=37815,v0=37816,y0=37817,b0=37818,w0=37819,x0=37820,E0=37821,bh=36492,S0=36494,T0=36495,e4=36283,A0=36284,M0=36285,R0=36286,id=2300,rd=2301,og=2302,qw=2400,Xw=2401,Kw=2402,O$=2500,L$=0,t4=1,C0=2,D$=3200,N$=3201,n4=0,U$=1,io="",Zn="srgb",kn="srgb-linear",Fv="display-p3",am="display-p3-linear",Jh="linear",Gt="srgb",Qh="rec709",ep="p3",Ga=7680,Yw=519,F$=512,$$=513,B$=514,s4=515,H$=516,G$=517,z$=518,V$=519,k0=35044,Zw="300 es",fr=2e3,tp=2001;class Ac{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(n)===-1&&s[e].push(n)}hasEventListener(e,n){if(this._listeners===void 0)return!1;const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(n)!==-1}removeEventListener(e,n){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let r=0,o=i.length;r>8&255]+In[t>>16&255]+In[t>>24&255]+"-"+In[e&255]+In[e>>8&255]+"-"+In[e>>16&15|64]+In[e>>24&255]+"-"+In[n&63|128]+In[n>>8&255]+"-"+In[n>>16&255]+In[n>>24&255]+In[s&255]+In[s>>8&255]+In[s>>16&255]+In[s>>24&255]).toLowerCase()}function Fn(t,e,n){return Math.max(e,Math.min(n,t))}function $v(t,e){return(t%e+e)%e}function W$(t,e,n,s,i){return s+(t-e)*(i-s)/(n-e)}function j$(t,e,n){return t!==e?(n-t)/(e-t):0}function Iu(t,e,n){return(1-n)*t+n*e}function q$(t,e,n,s){return Iu(t,e,1-Math.exp(-n*s))}function X$(t,e=1){return e-Math.abs($v(t,e*2)-e)}function K$(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function Y$(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function Z$(t,e){return t+Math.floor(Math.random()*(e-t+1))}function J$(t,e){return t+Math.random()*(e-t)}function Q$(t){return t*(.5-Math.random())}function eB(t){t!==void 0&&(Jw=t);let e=Jw+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function tB(t){return t*Pu}function nB(t){return t*rc}function sB(t){return(t&t-1)===0&&t!==0}function iB(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function rB(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function oB(t,e,n,s,i){const r=Math.cos,o=Math.sin,a=r(n/2),l=o(n/2),c=r((e+s)/2),u=o((e+s)/2),d=r((e-s)/2),f=o((e-s)/2),h=r((s-e)/2),v=o((s-e)/2);switch(i){case"XYX":t.set(a*u,l*d,l*f,a*c);break;case"YZY":t.set(l*f,a*u,l*d,a*c);break;case"ZXZ":t.set(l*d,l*f,a*u,a*c);break;case"XZX":t.set(a*u,l*v,l*h,a*c);break;case"YXY":t.set(l*h,a*u,l*v,a*c);break;case"ZYZ":t.set(l*v,l*h,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Qs(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Pt(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const aB={DEG2RAD:Pu,RAD2DEG:rc,generateUUID:si,clamp:Fn,euclideanModulo:$v,mapLinear:W$,inverseLerp:j$,lerp:Iu,damp:q$,pingpong:X$,smoothstep:K$,smootherstep:Y$,randInt:Z$,randFloat:J$,randFloatSpread:Q$,seededRandom:eB,degToRad:tB,radToDeg:nB,isPowerOfTwo:sB,ceilPowerOfTwo:iB,floorPowerOfTwo:rB,setQuaternionFromProperEuler:oB,normalize:Pt,denormalize:Qs};class yt{constructor(e=0,n=0){yt.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,s=this.y,i=e.elements;return this.x=i[0]*n+i[3]*s+i[6],this.y=i[1]*n+i[4]*s+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(n,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const s=this.dot(e)/n;return Math.acos(Fn(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,s=this.y-e.y;return n*n+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,s){return this.x=e.x+(n.x-e.x)*s,this.y=e.y+(n.y-e.y)*s,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const s=Math.cos(n),i=Math.sin(n),r=this.x-e.x,o=this.y-e.y;return this.x=r*s-o*i+e.x,this.y=r*i+o*s+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class pt{constructor(e,n,s,i,r,o,a,l,c){pt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,s,i,r,o,a,l,c)}set(e,n,s,i,r,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=n,u[4]=r,u[5]=l,u[6]=s,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,s=e.elements;return n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n[4]=s[4],n[5]=s[5],n[6]=s[6],n[7]=s[7],n[8]=s[8],this}extractBasis(e,n,s){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const s=e.elements,i=n.elements,r=this.elements,o=s[0],a=s[3],l=s[6],c=s[1],u=s[4],d=s[7],f=s[2],h=s[5],v=s[8],_=i[0],m=i[3],g=i[6],y=i[1],b=i[4],w=i[7],T=i[2],S=i[5],A=i[8];return r[0]=o*_+a*y+l*T,r[3]=o*m+a*b+l*S,r[6]=o*g+a*w+l*A,r[1]=c*_+u*y+d*T,r[4]=c*m+u*b+d*S,r[7]=c*g+u*w+d*A,r[2]=f*_+h*y+v*T,r[5]=f*m+h*b+v*S,r[8]=f*g+h*w+v*A,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],s=e[1],i=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return n*o*u-n*a*c-s*r*u+s*a*l+i*r*c-i*o*l}invert(){const e=this.elements,n=e[0],s=e[1],i=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=u*o-a*c,f=a*l-u*r,h=c*r-o*l,v=n*d+s*f+i*h;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/v;return e[0]=d*_,e[1]=(i*c-u*s)*_,e[2]=(a*s-i*o)*_,e[3]=f*_,e[4]=(u*n-i*l)*_,e[5]=(i*r-a*n)*_,e[6]=h*_,e[7]=(s*l-c*n)*_,e[8]=(o*n-s*r)*_,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,s,i,r,o,a){const l=Math.cos(r),c=Math.sin(r);return this.set(s*l,s*c,-s*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+n,0,0,1),this}scale(e,n){return this.premultiply(ag.makeScale(e,n)),this}rotate(e){return this.premultiply(ag.makeRotation(-e)),this}translate(e,n){return this.premultiply(ag.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),s=Math.sin(e);return this.set(n,-s,0,s,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,s=e.elements;for(let i=0;i<9;i++)if(n[i]!==s[i])return!1;return!0}fromArray(e,n=0){for(let s=0;s<9;s++)this.elements[s]=e[s+n];return this}toArray(e=[],n=0){const s=this.elements;return e[n]=s[0],e[n+1]=s[1],e[n+2]=s[2],e[n+3]=s[3],e[n+4]=s[4],e[n+5]=s[5],e[n+6]=s[6],e[n+7]=s[7],e[n+8]=s[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const ag=new pt;function i4(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function od(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function lB(){const t=od("canvas");return t.style.display="block",t}const Qw={};function Fl(t){t in Qw||(Qw[t]=!0,console.warn(t))}function cB(t,e,n){return new Promise(function(s,i){function r(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:i();break;case t.TIMEOUT_EXPIRED:setTimeout(r,n);break;default:s()}}setTimeout(r,n)})}const e2=new pt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),t2=new pt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Gc={[kn]:{transfer:Jh,primaries:Qh,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t,fromReference:t=>t},[Zn]:{transfer:Gt,primaries:Qh,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[am]:{transfer:Jh,primaries:ep,luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.applyMatrix3(t2),fromReference:t=>t.applyMatrix3(e2)},[Fv]:{transfer:Gt,primaries:ep,luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.convertSRGBToLinear().applyMatrix3(t2),fromReference:t=>t.applyMatrix3(e2).convertLinearToSRGB()}},uB=new Set([kn,am]),Et={enabled:!0,_workingColorSpace:kn,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!uB.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(this.enabled===!1||e===n||!e||!n)return t;const s=Gc[e].toReference,i=Gc[n].fromReference;return i(s(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return Gc[t].primaries},getTransfer:function(t){return t===io?Jh:Gc[t].transfer},getLuminanceCoefficients:function(t,e=this._workingColorSpace){return t.fromArray(Gc[e].luminanceCoefficients)}};function $l(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function lg(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let za;class dB{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{za===void 0&&(za=od("canvas")),za.width=e.width,za.height=e.height;const s=za.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),n=za}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=od("canvas");n.width=e.width,n.height=e.height;const s=n.getContext("2d");s.drawImage(e,0,0,e.width,e.height);const i=s.getImageData(0,0,e.width,e.height),r=i.data;for(let o=0;o0&&(s.userData=this.userData),n||(e.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==VM)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case nc:e.x=e.x-Math.floor(e.x);break;case ro:e.x=e.x<0?0:1;break;case Zh:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case nc:e.y=e.y-Math.floor(e.y);break;case ro:e.y=e.y<0?0:1;break;case Zh:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Sn.DEFAULT_IMAGE=null;Sn.DEFAULT_MAPPING=VM;Sn.DEFAULT_ANISOTROPY=1;class Lt{constructor(e=0,n=0,s=0,i=1){Lt.prototype.isVector4=!0,this.x=e,this.y=n,this.z=s,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,s,i){return this.x=e,this.y=n,this.z=s,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,s=this.y,i=this.z,r=this.w,o=e.elements;return this.x=o[0]*n+o[4]*s+o[8]*i+o[12]*r,this.y=o[1]*n+o[5]*s+o[9]*i+o[13]*r,this.z=o[2]*n+o[6]*s+o[10]*i+o[14]*r,this.w=o[3]*n+o[7]*s+o[11]*i+o[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,s,i,r;const l=e.elements,c=l[0],u=l[4],d=l[8],f=l[1],h=l[5],v=l[9],_=l[2],m=l[6],g=l[10];if(Math.abs(u-f)<.01&&Math.abs(d-_)<.01&&Math.abs(v-m)<.01){if(Math.abs(u+f)<.1&&Math.abs(d+_)<.1&&Math.abs(v+m)<.1&&Math.abs(c+h+g-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const b=(c+1)/2,w=(h+1)/2,T=(g+1)/2,S=(u+f)/4,A=(d+_)/4,R=(v+m)/4;return b>w&&b>T?b<.01?(s=0,i=.707106781,r=.707106781):(s=Math.sqrt(b),i=S/s,r=A/s):w>T?w<.01?(s=.707106781,i=0,r=.707106781):(i=Math.sqrt(w),s=S/i,r=R/i):T<.01?(s=.707106781,i=.707106781,r=0):(r=Math.sqrt(T),s=A/r,i=R/r),this.set(s,i,r,n),this}let y=Math.sqrt((m-v)*(m-v)+(d-_)*(d-_)+(f-u)*(f-u));return Math.abs(y)<.001&&(y=1),this.x=(m-v)/y,this.y=(d-_)/y,this.z=(f-u)/y,this.w=Math.acos((c+h+g-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(n,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,s){return this.x=e.x+(n.x-e.x)*s,this.y=e.y+(n.y-e.y)*s,this.z=e.z+(n.z-e.z)*s,this.w=e.w+(n.w-e.w)*s,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class pB extends Ac{constructor(e=1,n=1,s={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new Lt(0,0,e,n),this.scissorTest=!1,this.viewport=new Lt(0,0,e,n);const i={width:e,height:n,depth:1};s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Ss,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},s);const r=new Sn(i,s.mapping,s.wrapS,s.wrapT,s.magFilter,s.minFilter,s.format,s.type,s.anisotropy,s.colorSpace);r.flipY=!1,r.generateMipmaps=s.generateMipmaps,r.internalFormat=s.internalFormat,this.textures=[];const o=s.count;for(let a=0;a=0?1:-1,b=1-g*g;if(b>Number.EPSILON){const T=Math.sqrt(b),S=Math.atan2(T,g*y);m=Math.sin(m*S)/T,a=Math.sin(a*S)/T}const w=a*y;if(l=l*m+f*w,c=c*m+h*w,u=u*m+v*w,d=d*m+_*w,m===1-a){const T=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=T,c*=T,u*=T,d*=T}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d}static multiplyQuaternionsFlat(e,n,s,i,r,o){const a=s[i],l=s[i+1],c=s[i+2],u=s[i+3],d=r[o],f=r[o+1],h=r[o+2],v=r[o+3];return e[n]=a*v+u*d+l*h-c*f,e[n+1]=l*v+u*f+c*d-a*h,e[n+2]=c*v+u*h+a*f-l*d,e[n+3]=u*v-a*d-l*f-c*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,s,i){return this._x=e,this._y=n,this._z=s,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const s=e._x,i=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(s/2),u=a(i/2),d=a(r/2),f=l(s/2),h=l(i/2),v=l(r/2);switch(o){case"XYZ":this._x=f*u*d+c*h*v,this._y=c*h*d-f*u*v,this._z=c*u*v+f*h*d,this._w=c*u*d-f*h*v;break;case"YXZ":this._x=f*u*d+c*h*v,this._y=c*h*d-f*u*v,this._z=c*u*v-f*h*d,this._w=c*u*d+f*h*v;break;case"ZXY":this._x=f*u*d-c*h*v,this._y=c*h*d+f*u*v,this._z=c*u*v+f*h*d,this._w=c*u*d-f*h*v;break;case"ZYX":this._x=f*u*d-c*h*v,this._y=c*h*d+f*u*v,this._z=c*u*v-f*h*d,this._w=c*u*d+f*h*v;break;case"YZX":this._x=f*u*d+c*h*v,this._y=c*h*d+f*u*v,this._z=c*u*v-f*h*d,this._w=c*u*d-f*h*v;break;case"XZY":this._x=f*u*d-c*h*v,this._y=c*h*d-f*u*v,this._z=c*u*v+f*h*d,this._w=c*u*d+f*h*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const s=n/2,i=Math.sin(s);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,s=n[0],i=n[4],r=n[8],o=n[1],a=n[5],l=n[9],c=n[2],u=n[6],d=n[10],f=s+a+d;if(f>0){const h=.5/Math.sqrt(f+1);this._w=.25/h,this._x=(u-l)*h,this._y=(r-c)*h,this._z=(o-i)*h}else if(s>a&&s>d){const h=2*Math.sqrt(1+s-a-d);this._w=(u-l)/h,this._x=.25*h,this._y=(i+o)/h,this._z=(r+c)/h}else if(a>d){const h=2*Math.sqrt(1+a-s-d);this._w=(r-c)/h,this._x=(i+o)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+d-s-a);this._w=(o-i)/h,this._x=(r+c)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let s=e.dot(n)+1;return sMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=s):(this._x=0,this._y=-e.z,this._z=e.y,this._w=s)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=s),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Fn(this.dot(e),-1,1)))}rotateTowards(e,n){const s=this.angleTo(e);if(s===0)return this;const i=Math.min(1,n/s);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const s=e._x,i=e._y,r=e._z,o=e._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=s*u+o*a+i*c-r*l,this._y=i*u+o*l+r*a-s*c,this._z=r*u+o*c+s*l-i*a,this._w=o*u-s*a-i*l-r*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const s=this._x,i=this._y,r=this._z,o=this._w;let a=o*e._w+s*e._x+i*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=s,this._y=i,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const h=1-n;return this._w=h*o+n*this._w,this._x=h*s+n*this._x,this._y=h*i+n*this._y,this._z=h*r+n*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),d=Math.sin((1-n)*u)/c,f=Math.sin(n*u)/c;return this._w=o*d+this._w*f,this._x=s*d+this._x*f,this._y=i*d+this._y*f,this._z=r*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,n,s){return this.copy(e).slerp(n,s)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),s=Math.random(),i=Math.sqrt(1-s),r=Math.sqrt(s);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(n),r*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ie{constructor(e=0,n=0,s=0){ie.prototype.isVector3=!0,this.x=e,this.y=n,this.z=s}set(e,n,s){return s===void 0&&(s=this.z),this.x=e,this.y=n,this.z=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(n2.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(n2.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,s=this.y,i=this.z,r=e.elements;return this.x=r[0]*n+r[3]*s+r[6]*i,this.y=r[1]*n+r[4]*s+r[7]*i,this.z=r[2]*n+r[5]*s+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,s=this.y,i=this.z,r=e.elements,o=1/(r[3]*n+r[7]*s+r[11]*i+r[15]);return this.x=(r[0]*n+r[4]*s+r[8]*i+r[12])*o,this.y=(r[1]*n+r[5]*s+r[9]*i+r[13])*o,this.z=(r[2]*n+r[6]*s+r[10]*i+r[14])*o,this}applyQuaternion(e){const n=this.x,s=this.y,i=this.z,r=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*i-a*s),u=2*(a*n-r*i),d=2*(r*s-o*n);return this.x=n+l*c+o*d-a*u,this.y=s+l*u+a*c-r*d,this.z=i+l*d+r*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,s=this.y,i=this.z,r=e.elements;return this.x=r[0]*n+r[4]*s+r[8]*i,this.y=r[1]*n+r[5]*s+r[9]*i,this.z=r[2]*n+r[6]*s+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(n,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,s){return this.x=e.x+(n.x-e.x)*s,this.y=e.y+(n.y-e.y)*s,this.z=e.z+(n.z-e.z)*s,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const s=e.x,i=e.y,r=e.z,o=n.x,a=n.y,l=n.z;return this.x=i*l-r*a,this.y=r*o-s*l,this.z=s*a-i*o,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const s=e.dot(this)/n;return this.copy(e).multiplyScalar(s)}projectOnPlane(e){return ug.copy(this).projectOnVector(e),this.sub(ug)}reflect(e){return this.sub(ug.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const s=this.dot(e)/n;return Math.acos(Fn(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,s=this.y-e.y,i=this.z-e.z;return n*n+s*s+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,s){const i=Math.sin(n)*e;return this.x=i*Math.sin(s),this.y=Math.cos(n)*e,this.z=i*Math.cos(s),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,s){return this.x=e*Math.sin(n),this.y=s,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),s=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=s,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,s=Math.sqrt(1-n*n);return this.x=s*Math.cos(e),this.y=n,this.z=s*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const ug=new ie,n2=new Mr;class Rr{constructor(e=new ie(1/0,1/0,1/0),n=new ie(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,s=e.length;n=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,qs),qs.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,s;return e.normal.x>0?(n=e.normal.x*this.min.x,s=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,s=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,s+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,s+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,s+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,s+=e.normal.z*this.min.z),n<=-e.constant&&s>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(zc),ef.subVectors(this.max,zc),Va.subVectors(e.a,zc),Wa.subVectors(e.b,zc),ja.subVectors(e.c,zc),Lr.subVectors(Wa,Va),Dr.subVectors(ja,Wa),Do.subVectors(Va,ja);let n=[0,-Lr.z,Lr.y,0,-Dr.z,Dr.y,0,-Do.z,Do.y,Lr.z,0,-Lr.x,Dr.z,0,-Dr.x,Do.z,0,-Do.x,-Lr.y,Lr.x,0,-Dr.y,Dr.x,0,-Do.y,Do.x,0];return!dg(n,Va,Wa,ja,ef)||(n=[1,0,0,0,1,0,0,0,1],!dg(n,Va,Wa,ja,ef))?!1:(tf.crossVectors(Lr,Dr),n=[tf.x,tf.y,tf.z],dg(n,Va,Wa,ja,ef))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,qs).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(qs).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Wi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Wi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Wi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Wi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Wi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Wi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Wi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Wi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Wi),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Wi=[new ie,new ie,new ie,new ie,new ie,new ie,new ie,new ie],qs=new ie,Qd=new Rr,Va=new ie,Wa=new ie,ja=new ie,Lr=new ie,Dr=new ie,Do=new ie,zc=new ie,ef=new ie,tf=new ie,No=new ie;function dg(t,e,n,s,i){for(let r=0,o=t.length-3;r<=o;r+=3){No.fromArray(t,r);const a=i.x*Math.abs(No.x)+i.y*Math.abs(No.y)+i.z*Math.abs(No.z),l=e.dot(No),c=n.dot(No),u=s.dot(No);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const gB=new Rr,Vc=new ie,fg=new ie;class Fi{constructor(e=new ie,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const s=this.center;n!==void 0?s.copy(n):gB.setFromPoints(e).getCenter(s);let i=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Vc.subVectors(e,this.center);const n=Vc.lengthSq();if(n>this.radius*this.radius){const s=Math.sqrt(n),i=(s-this.radius)*.5;this.center.addScaledVector(Vc,i/s),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(fg.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Vc.copy(e.center).add(fg)),this.expandByPoint(Vc.copy(e.center).sub(fg))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ji=new ie,hg=new ie,nf=new ie,Nr=new ie,pg=new ie,sf=new ie,mg=new ie;class lm{constructor(e=new ie,n=new ie(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ji)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const s=n.dot(this.direction);return s<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=ji.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(ji.copy(this.origin).addScaledVector(this.direction,n),ji.distanceToSquared(e))}distanceSqToSegment(e,n,s,i){hg.copy(e).add(n).multiplyScalar(.5),nf.copy(n).sub(e).normalize(),Nr.copy(this.origin).sub(hg);const r=e.distanceTo(n)*.5,o=-this.direction.dot(nf),a=Nr.dot(this.direction),l=-Nr.dot(nf),c=Nr.lengthSq(),u=Math.abs(1-o*o);let d,f,h,v;if(u>0)if(d=o*l-a,f=o*a-l,v=r*u,d>=0)if(f>=-v)if(f<=v){const _=1/u;d*=_,f*=_,h=d*(d+o*f+2*a)+f*(o*d+f+2*l)+c}else f=r,d=Math.max(0,-(o*f+a)),h=-d*d+f*(f+2*l)+c;else f=-r,d=Math.max(0,-(o*f+a)),h=-d*d+f*(f+2*l)+c;else f<=-v?(d=Math.max(0,-(-o*r+a)),f=d>0?-r:Math.min(Math.max(-r,-l),r),h=-d*d+f*(f+2*l)+c):f<=v?(d=0,f=Math.min(Math.max(-r,-l),r),h=f*(f+2*l)+c):(d=Math.max(0,-(o*r+a)),f=d>0?r:Math.min(Math.max(-r,-l),r),h=-d*d+f*(f+2*l)+c);else f=o>0?-r:r,d=Math.max(0,-(o*f+a)),h=-d*d+f*(f+2*l)+c;return s&&s.copy(this.origin).addScaledVector(this.direction,d),i&&i.copy(hg).addScaledVector(nf,f),h}intersectSphere(e,n){ji.subVectors(e.center,this.origin);const s=ji.dot(this.direction),i=ji.dot(ji)-s*s,r=e.radius*e.radius;if(i>r)return null;const o=Math.sqrt(r-i),a=s-o,l=s+o;return l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(e.normal)+e.constant)/n;return s>=0?s:null}intersectPlane(e,n){const s=this.distanceToPlane(e);return s===null?null:this.at(s,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let s,i,r,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(s=(e.min.x-f.x)*c,i=(e.max.x-f.x)*c):(s=(e.max.x-f.x)*c,i=(e.min.x-f.x)*c),u>=0?(r=(e.min.y-f.y)*u,o=(e.max.y-f.y)*u):(r=(e.max.y-f.y)*u,o=(e.min.y-f.y)*u),s>o||r>i||((r>s||isNaN(s))&&(s=r),(o=0?(a=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(a=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),s>l||a>i)||((a>s||s!==s)&&(s=a),(l=0?s:i,n)}intersectsBox(e){return this.intersectBox(e,ji)!==null}intersectTriangle(e,n,s,i,r){pg.subVectors(n,e),sf.subVectors(s,e),mg.crossVectors(pg,sf);let o=this.direction.dot(mg),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Nr.subVectors(this.origin,e);const l=a*this.direction.dot(sf.crossVectors(Nr,sf));if(l<0)return null;const c=a*this.direction.dot(pg.cross(Nr));if(c<0||l+c>o)return null;const u=-a*Nr.dot(mg);return u<0?null:this.at(u/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class mt{constructor(e,n,s,i,r,o,a,l,c,u,d,f,h,v,_,m){mt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,s,i,r,o,a,l,c,u,d,f,h,v,_,m)}set(e,n,s,i,r,o,a,l,c,u,d,f,h,v,_,m){const g=this.elements;return g[0]=e,g[4]=n,g[8]=s,g[12]=i,g[1]=r,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=d,g[14]=f,g[3]=h,g[7]=v,g[11]=_,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new mt().fromArray(this.elements)}copy(e){const n=this.elements,s=e.elements;return n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n[4]=s[4],n[5]=s[5],n[6]=s[6],n[7]=s[7],n[8]=s[8],n[9]=s[9],n[10]=s[10],n[11]=s[11],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15],this}copyPosition(e){const n=this.elements,s=e.elements;return n[12]=s[12],n[13]=s[13],n[14]=s[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,s){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this}makeBasis(e,n,s){return this.set(e.x,n.x,s.x,0,e.y,n.y,s.y,0,e.z,n.z,s.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,s=e.elements,i=1/qa.setFromMatrixColumn(e,0).length(),r=1/qa.setFromMatrixColumn(e,1).length(),o=1/qa.setFromMatrixColumn(e,2).length();return n[0]=s[0]*i,n[1]=s[1]*i,n[2]=s[2]*i,n[3]=0,n[4]=s[4]*r,n[5]=s[5]*r,n[6]=s[6]*r,n[7]=0,n[8]=s[8]*o,n[9]=s[9]*o,n[10]=s[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,s=e.x,i=e.y,r=e.z,o=Math.cos(s),a=Math.sin(s),l=Math.cos(i),c=Math.sin(i),u=Math.cos(r),d=Math.sin(r);if(e.order==="XYZ"){const f=o*u,h=o*d,v=a*u,_=a*d;n[0]=l*u,n[4]=-l*d,n[8]=c,n[1]=h+v*c,n[5]=f-_*c,n[9]=-a*l,n[2]=_-f*c,n[6]=v+h*c,n[10]=o*l}else if(e.order==="YXZ"){const f=l*u,h=l*d,v=c*u,_=c*d;n[0]=f+_*a,n[4]=v*a-h,n[8]=o*c,n[1]=o*d,n[5]=o*u,n[9]=-a,n[2]=h*a-v,n[6]=_+f*a,n[10]=o*l}else if(e.order==="ZXY"){const f=l*u,h=l*d,v=c*u,_=c*d;n[0]=f-_*a,n[4]=-o*d,n[8]=v+h*a,n[1]=h+v*a,n[5]=o*u,n[9]=_-f*a,n[2]=-o*c,n[6]=a,n[10]=o*l}else if(e.order==="ZYX"){const f=o*u,h=o*d,v=a*u,_=a*d;n[0]=l*u,n[4]=v*c-h,n[8]=f*c+_,n[1]=l*d,n[5]=_*c+f,n[9]=h*c-v,n[2]=-c,n[6]=a*l,n[10]=o*l}else if(e.order==="YZX"){const f=o*l,h=o*c,v=a*l,_=a*c;n[0]=l*u,n[4]=_-f*d,n[8]=v*d+h,n[1]=d,n[5]=o*u,n[9]=-a*u,n[2]=-c*u,n[6]=h*d+v,n[10]=f-_*d}else if(e.order==="XZY"){const f=o*l,h=o*c,v=a*l,_=a*c;n[0]=l*u,n[4]=-d,n[8]=c*u,n[1]=f*d+_,n[5]=o*u,n[9]=h*d-v,n[2]=v*d-h,n[6]=a*u,n[10]=_*d+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(_B,e,vB)}lookAt(e,n,s){const i=this.elements;return _s.subVectors(e,n),_s.lengthSq()===0&&(_s.z=1),_s.normalize(),Ur.crossVectors(s,_s),Ur.lengthSq()===0&&(Math.abs(s.z)===1?_s.x+=1e-4:_s.z+=1e-4,_s.normalize(),Ur.crossVectors(s,_s)),Ur.normalize(),rf.crossVectors(_s,Ur),i[0]=Ur.x,i[4]=rf.x,i[8]=_s.x,i[1]=Ur.y,i[5]=rf.y,i[9]=_s.y,i[2]=Ur.z,i[6]=rf.z,i[10]=_s.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const s=e.elements,i=n.elements,r=this.elements,o=s[0],a=s[4],l=s[8],c=s[12],u=s[1],d=s[5],f=s[9],h=s[13],v=s[2],_=s[6],m=s[10],g=s[14],y=s[3],b=s[7],w=s[11],T=s[15],S=i[0],A=i[4],R=i[8],x=i[12],E=i[1],k=i[5],U=i[9],H=i[13],D=i[2],I=i[6],P=i[10],B=i[14],L=i[3],Y=i[7],q=i[11],de=i[15];return r[0]=o*S+a*E+l*D+c*L,r[4]=o*A+a*k+l*I+c*Y,r[8]=o*R+a*U+l*P+c*q,r[12]=o*x+a*H+l*B+c*de,r[1]=u*S+d*E+f*D+h*L,r[5]=u*A+d*k+f*I+h*Y,r[9]=u*R+d*U+f*P+h*q,r[13]=u*x+d*H+f*B+h*de,r[2]=v*S+_*E+m*D+g*L,r[6]=v*A+_*k+m*I+g*Y,r[10]=v*R+_*U+m*P+g*q,r[14]=v*x+_*H+m*B+g*de,r[3]=y*S+b*E+w*D+T*L,r[7]=y*A+b*k+w*I+T*Y,r[11]=y*R+b*U+w*P+T*q,r[15]=y*x+b*H+w*B+T*de,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],s=e[4],i=e[8],r=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],d=e[6],f=e[10],h=e[14],v=e[3],_=e[7],m=e[11],g=e[15];return v*(+r*l*d-i*c*d-r*a*f+s*c*f+i*a*h-s*l*h)+_*(+n*l*h-n*c*f+r*o*f-i*o*h+i*c*u-r*l*u)+m*(+n*c*d-n*a*h-r*o*d+s*o*h+r*a*u-s*c*u)+g*(-i*a*u-n*l*d+n*a*f+i*o*d-s*o*f+s*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,s){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=s),this}invert(){const e=this.elements,n=e[0],s=e[1],i=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],h=e[11],v=e[12],_=e[13],m=e[14],g=e[15],y=d*m*c-_*f*c+_*l*h-a*m*h-d*l*g+a*f*g,b=v*f*c-u*m*c-v*l*h+o*m*h+u*l*g-o*f*g,w=u*_*c-v*d*c+v*a*h-o*_*h-u*a*g+o*d*g,T=v*d*l-u*_*l-v*a*f+o*_*f+u*a*m-o*d*m,S=n*y+s*b+i*w+r*T;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/S;return e[0]=y*A,e[1]=(_*f*r-d*m*r-_*i*h+s*m*h+d*i*g-s*f*g)*A,e[2]=(a*m*r-_*l*r+_*i*c-s*m*c-a*i*g+s*l*g)*A,e[3]=(d*l*r-a*f*r-d*i*c+s*f*c+a*i*h-s*l*h)*A,e[4]=b*A,e[5]=(u*m*r-v*f*r+v*i*h-n*m*h-u*i*g+n*f*g)*A,e[6]=(v*l*r-o*m*r-v*i*c+n*m*c+o*i*g-n*l*g)*A,e[7]=(o*f*r-u*l*r+u*i*c-n*f*c-o*i*h+n*l*h)*A,e[8]=w*A,e[9]=(v*d*r-u*_*r-v*s*h+n*_*h+u*s*g-n*d*g)*A,e[10]=(o*_*r-v*a*r+v*s*c-n*_*c-o*s*g+n*a*g)*A,e[11]=(u*a*r-o*d*r-u*s*c+n*d*c+o*s*h-n*a*h)*A,e[12]=T*A,e[13]=(u*_*i-v*d*i+v*s*f-n*_*f-u*s*m+n*d*m)*A,e[14]=(v*a*i-o*_*i-v*s*l+n*_*l+o*s*m-n*a*m)*A,e[15]=(o*d*i-u*a*i+u*s*l-n*d*l-o*s*f+n*a*f)*A,this}scale(e){const n=this.elements,s=e.x,i=e.y,r=e.z;return n[0]*=s,n[4]*=i,n[8]*=r,n[1]*=s,n[5]*=i,n[9]*=r,n[2]*=s,n[6]*=i,n[10]*=r,n[3]*=s,n[7]*=i,n[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],s=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,s,i))}makeTranslation(e,n,s){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,s,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),s=Math.sin(e);return this.set(1,0,0,0,0,n,-s,0,0,s,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),s=Math.sin(e);return this.set(n,0,s,0,0,1,0,0,-s,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),s=Math.sin(e);return this.set(n,-s,0,0,s,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const s=Math.cos(n),i=Math.sin(n),r=1-s,o=e.x,a=e.y,l=e.z,c=r*o,u=r*a;return this.set(c*o+s,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+s,u*l-i*o,0,c*l-i*a,u*l+i*o,r*l*l+s,0,0,0,0,1),this}makeScale(e,n,s){return this.set(e,0,0,0,0,n,0,0,0,0,s,0,0,0,0,1),this}makeShear(e,n,s,i,r,o){return this.set(1,s,r,0,e,1,o,0,n,i,1,0,0,0,0,1),this}compose(e,n,s){const i=this.elements,r=n._x,o=n._y,a=n._z,l=n._w,c=r+r,u=o+o,d=a+a,f=r*c,h=r*u,v=r*d,_=o*u,m=o*d,g=a*d,y=l*c,b=l*u,w=l*d,T=s.x,S=s.y,A=s.z;return i[0]=(1-(_+g))*T,i[1]=(h+w)*T,i[2]=(v-b)*T,i[3]=0,i[4]=(h-w)*S,i[5]=(1-(f+g))*S,i[6]=(m+y)*S,i[7]=0,i[8]=(v+b)*A,i[9]=(m-y)*A,i[10]=(1-(f+_))*A,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,s){const i=this.elements;let r=qa.set(i[0],i[1],i[2]).length();const o=qa.set(i[4],i[5],i[6]).length(),a=qa.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],Xs.copy(this);const c=1/r,u=1/o,d=1/a;return Xs.elements[0]*=c,Xs.elements[1]*=c,Xs.elements[2]*=c,Xs.elements[4]*=u,Xs.elements[5]*=u,Xs.elements[6]*=u,Xs.elements[8]*=d,Xs.elements[9]*=d,Xs.elements[10]*=d,n.setFromRotationMatrix(Xs),s.x=r,s.y=o,s.z=a,this}makePerspective(e,n,s,i,r,o,a=fr){const l=this.elements,c=2*r/(n-e),u=2*r/(s-i),d=(n+e)/(n-e),f=(s+i)/(s-i);let h,v;if(a===fr)h=-(o+r)/(o-r),v=-2*o*r/(o-r);else if(a===tp)h=-o/(o-r),v=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=u,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=h,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,s,i,r,o,a=fr){const l=this.elements,c=1/(n-e),u=1/(s-i),d=1/(o-r),f=(n+e)*c,h=(s+i)*u;let v,_;if(a===fr)v=(o+r)*d,_=-2*d;else if(a===tp)v=r*d,_=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-h,l[2]=0,l[6]=0,l[10]=_,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,s=e.elements;for(let i=0;i<16;i++)if(n[i]!==s[i])return!1;return!0}fromArray(e,n=0){for(let s=0;s<16;s++)this.elements[s]=e[s+n];return this}toArray(e=[],n=0){const s=this.elements;return e[n]=s[0],e[n+1]=s[1],e[n+2]=s[2],e[n+3]=s[3],e[n+4]=s[4],e[n+5]=s[5],e[n+6]=s[6],e[n+7]=s[7],e[n+8]=s[8],e[n+9]=s[9],e[n+10]=s[10],e[n+11]=s[11],e[n+12]=s[12],e[n+13]=s[13],e[n+14]=s[14],e[n+15]=s[15],e}}const qa=new ie,Xs=new mt,_B=new ie(0,0,0),vB=new ie(1,1,1),Ur=new ie,rf=new ie,_s=new ie,s2=new mt,i2=new Mr;class Ni{constructor(e=0,n=0,s=0,i=Ni.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=s,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,s,i=this._order){return this._x=e,this._y=n,this._z=s,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,s=!0){const i=e.elements,r=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],d=i[2],f=i[6],h=i[10];switch(n){case"XYZ":this._y=Math.asin(Fn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Fn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,r),this._z=0);break;case"ZXY":this._x=Math.asin(Fn(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,h),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-Fn(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,h),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Fn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,r)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-Fn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,s===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,s){return s2.makeRotationFromQuaternion(e),this.setFromRotationMatrix(s2,n,s)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return i2.setFromEuler(this),this.setFromQuaternion(i2,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Ni.DEFAULT_ORDER="XYZ";let a4=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let s=0;s0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(s.geometries=a),l.length>0&&(s.materials=l),c.length>0&&(s.textures=c),u.length>0&&(s.images=u),d.length>0&&(s.shapes=d),f.length>0&&(s.skeletons=f),h.length>0&&(s.animations=h),v.length>0&&(s.nodes=v)}return s.object=i,s;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let s=0;s0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,n,s,i,r){Ks.subVectors(i,n),Xi.subVectors(s,n),_g.subVectors(e,n);const o=Ks.dot(Ks),a=Ks.dot(Xi),l=Ks.dot(_g),c=Xi.dot(Xi),u=Xi.dot(_g),d=o*c-a*a;if(d===0)return r.set(0,0,0),null;const f=1/d,h=(c*l-a*u)*f,v=(o*u-a*l)*f;return r.set(1-h-v,v,h)}static containsPoint(e,n,s,i){return this.getBarycoord(e,n,s,i,Ki)===null?!1:Ki.x>=0&&Ki.y>=0&&Ki.x+Ki.y<=1}static getInterpolation(e,n,s,i,r,o,a,l){return this.getBarycoord(e,n,s,i,Ki)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,Ki.x),l.addScaledVector(o,Ki.y),l.addScaledVector(a,Ki.z),l)}static isFrontFacing(e,n,s,i){return Ks.subVectors(s,n),Xi.subVectors(e,n),Ks.cross(Xi).dot(i)<0}set(e,n,s){return this.a.copy(e),this.b.copy(n),this.c.copy(s),this}setFromPointsAndIndices(e,n,s,i){return this.a.copy(e[n]),this.b.copy(e[s]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,s,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,s),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ks.subVectors(this.c,this.b),Xi.subVectors(this.a,this.b),Ks.cross(Xi).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ei.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Ei.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,s,i,r){return Ei.getInterpolation(e,this.a,this.b,this.c,n,s,i,r)}containsPoint(e){return Ei.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ei.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const s=this.a,i=this.b,r=this.c;let o,a;Ya.subVectors(i,s),Za.subVectors(r,s),vg.subVectors(e,s);const l=Ya.dot(vg),c=Za.dot(vg);if(l<=0&&c<=0)return n.copy(s);yg.subVectors(e,i);const u=Ya.dot(yg),d=Za.dot(yg);if(u>=0&&d<=u)return n.copy(i);const f=l*d-u*c;if(f<=0&&l>=0&&u<=0)return o=l/(l-u),n.copy(s).addScaledVector(Ya,o);bg.subVectors(e,r);const h=Ya.dot(bg),v=Za.dot(bg);if(v>=0&&h<=v)return n.copy(r);const _=h*c-l*v;if(_<=0&&c>=0&&v<=0)return a=c/(c-v),n.copy(s).addScaledVector(Za,a);const m=u*v-h*d;if(m<=0&&d-u>=0&&h-v>=0)return u2.subVectors(r,i),a=(d-u)/(d-u+(h-v)),n.copy(i).addScaledVector(u2,a);const g=1/(m+_+f);return o=_*g,a=f*g,n.copy(s).addScaledVector(Ya,o).addScaledVector(Za,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const l4={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,darkgreen:25600,darkgrey:11119017,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,green:32768,greenyellow:11403055,grey:8421504,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,lightgreen:9498256,lightgrey:13882323,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},Fr={h:0,s:0,l:0},af={h:0,s:0,l:0};function wg(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let ft=class{constructor(e,n,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,s)}set(e,n,s){if(n===void 0&&s===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,s);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Zn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Et.toWorkingColorSpace(this,n),this}setRGB(e,n,s,i=Et.workingColorSpace){return this.r=e,this.g=n,this.b=s,Et.toWorkingColorSpace(this,i),this}setHSL(e,n,s,i=Et.workingColorSpace){if(e=$v(e,1),n=Fn(n,0,1),s=Fn(s,0,1),n===0)this.r=this.g=this.b=s;else{const r=s<=.5?s*(1+n):s+n-s*n,o=2*s-r;this.r=wg(o,r,e+1/3),this.g=wg(o,r,e),this.b=wg(o,r,e-1/3)}return Et.toWorkingColorSpace(this,i),this}setStyle(e,n=Zn){function s(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,n);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,n);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=i[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,n);if(o===6)return this.setHex(parseInt(r,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Zn){const s=l4[e.toLowerCase()];return s!==void 0?this.setHex(s,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=$l(e.r),this.g=$l(e.g),this.b=$l(e.b),this}copyLinearToSRGB(e){return this.r=lg(e.r),this.g=lg(e.g),this.b=lg(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Zn){return Et.fromWorkingColorSpace(On.copy(this),e),Math.round(Fn(On.r*255,0,255))*65536+Math.round(Fn(On.g*255,0,255))*256+Math.round(Fn(On.b*255,0,255))}getHexString(e=Zn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Et.workingColorSpace){Et.fromWorkingColorSpace(On.copy(this),n);const s=On.r,i=On.g,r=On.b,o=Math.max(s,i,r),a=Math.min(s,i,r);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const d=o-a;switch(c=u<=.5?d/(o+a):d/(2-o-a),o){case s:l=(i-r)/d+(i0!=e>0&&this.version++,this._alphaTest=e}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const s=e[n];if(s===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(s):i&&i.isVector3&&s&&s.isVector3?i.copy(s):this[n]=s}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const s={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(s.dispersion=this.dispersion),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(e).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(e).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(e).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(e).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(e).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapRotation!==void 0&&(s.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==Nl&&(s.blending=this.blending),this.side!==yr&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==Q_&&(s.blendSrc=this.blendSrc),this.blendDst!==e0&&(s.blendDst=this.blendDst),this.blendEquation!==ta&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==Yh&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Yw&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ga&&(s.stencilFail=this.stencilFail),this.stencilZFail!==Ga&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==Ga&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function i(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(n){const r=i(e.textures),o=i(e.images);r.length>0&&(s.textures=r),o.length>0&&(s.images=o)}return s}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let s=null;if(n!==null){const i=n.length;s=new Array(i);for(let r=0;r!==i;++r)s[r]=n[r].clone()}return this.clippingPlanes=s,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}onBeforeRender(){console.warn("Material: onBeforeRender() has been removed.")}}class oo extends Pi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ft(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ni,this.combine=zM,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const fn=new ie,lf=new yt;class ns{constructor(e,n,s=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=s,this.usage=k0,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=ei,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return Fl("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,s){e*=this.itemSize,s*=n.itemSize;for(let i=0,r=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const s=this.attributes;for(const l in s){const c=s[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let d=0,f=c.length;d0&&(i[l]=u,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const s=e.index;s!==null&&this.setIndex(s.clone(n));const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const r=e.morphAttributes;for(const c in r){const u=[],d=r[c];for(let f=0,h=d.length;f0){const i=n[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;r(e.far-e.near)**2))&&(d2.copy(r).invert(),Uo.copy(e.ray).applyMatrix4(d2),!(s.boundingBox!==null&&Uo.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(e,n,Uo)))}_computeIntersections(e,n,s){let i;const r=this.geometry,o=this.material,a=r.index,l=r.attributes.position,c=r.attributes.uv,u=r.attributes.uv1,d=r.attributes.normal,f=r.groups,h=r.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,_=f.length;v<_;v++){const m=f[v],g=o[m.materialIndex],y=Math.max(m.start,h.start),b=Math.min(a.count,Math.min(m.start+m.count,h.start+h.count));for(let w=y,T=b;wn.far?null:{distance:c,point:mf.clone(),object:t}}function gf(t,e,n,s,i,r,o,a,l,c){t.getVertexPosition(a,Qa),t.getVertexPosition(l,el),t.getVertexPosition(c,tl);const u=TB(t,e,n,s,Qa,el,tl,pf);if(u){i&&(df.fromBufferAttribute(i,a),ff.fromBufferAttribute(i,l),hf.fromBufferAttribute(i,c),u.uv=Ei.getInterpolation(pf,Qa,el,tl,df,ff,hf,new yt)),r&&(df.fromBufferAttribute(r,a),ff.fromBufferAttribute(r,l),hf.fromBufferAttribute(r,c),u.uv1=Ei.getInterpolation(pf,Qa,el,tl,df,ff,hf,new yt)),o&&(h2.fromBufferAttribute(o,a),p2.fromBufferAttribute(o,l),m2.fromBufferAttribute(o,c),u.normal=Ei.getInterpolation(pf,Qa,el,tl,h2,p2,m2,new ie),u.normal.dot(s.direction)>0&&u.normal.multiplyScalar(-1));const d={a,b:l,c,normal:new ie,materialIndex:0};Ei.getNormal(Qa,el,tl,d.normal),u.face=d}return u}class Mc extends $i{constructor(e=1,n=1,s=1,i=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:s,widthSegments:i,heightSegments:r,depthSegments:o};const a=this;i=Math.floor(i),r=Math.floor(r),o=Math.floor(o);const l=[],c=[],u=[],d=[];let f=0,h=0;v("z","y","x",-1,-1,s,n,e,o,r,0),v("z","y","x",1,-1,s,n,-e,o,r,1),v("x","z","y",1,1,e,s,n,i,o,2),v("x","z","y",1,-1,e,s,-n,i,o,3),v("x","y","z",1,-1,e,n,s,i,r,4),v("x","y","z",-1,-1,e,n,-s,i,r,5),this.setIndex(l),this.setAttribute("position",new mr(c,3)),this.setAttribute("normal",new mr(u,3)),this.setAttribute("uv",new mr(d,2));function v(_,m,g,y,b,w,T,S,A,R,x){const E=w/A,k=T/R,U=w/2,H=T/2,D=S/2,I=A+1,P=R+1;let B=0,L=0;const Y=new ie;for(let q=0;q0?1:-1,u.push(Y.x,Y.y,Y.z),d.push(fe/A),d.push(1-q/R),B+=1}}for(let q=0;q0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const s={};for(const i in this.extensions)this.extensions[i]===!0&&(s[i]=!0);return Object.keys(s).length>0&&(n.extensions=s),n}}class f4 extends Kt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new mt,this.projectionMatrix=new mt,this.projectionMatrixInverse=new mt,this.coordinateSystem=fr}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const $r=new ie,g2=new yt,_2=new yt;class $n extends f4{constructor(e=50,n=1,s=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=s,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=rc*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Pu*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return rc*2*Math.atan(Math.tan(Pu*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,s){$r.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set($r.x,$r.y).multiplyScalar(-e/$r.z),$r.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),s.set($r.x,$r.y).multiplyScalar(-e/$r.z)}getViewSize(e,n){return this.getViewBounds(e,g2,_2),n.subVectors(_2,g2)}setViewOffset(e,n,s,i,r,o){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=s,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Pu*.5*this.fov)/this.zoom,s=2*n,i=this.aspect*s,r=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;r+=o.offsetX*i/l,n-=o.offsetY*s/c,i*=o.width/l,s*=o.height/c}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,n,n-s,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const nl=-90,sl=1;class kB extends Kt{constructor(e,n,s){super(),this.type="CubeCamera",this.renderTarget=s,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new $n(nl,sl,e,n);i.layers=this.layers,this.add(i);const r=new $n(nl,sl,e,n);r.layers=this.layers,this.add(r);const o=new $n(nl,sl,e,n);o.layers=this.layers,this.add(o);const a=new $n(nl,sl,e,n);a.layers=this.layers,this.add(a);const l=new $n(nl,sl,e,n);l.layers=this.layers,this.add(l);const c=new $n(nl,sl,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[s,i,r,o,a,l]=n;for(const c of n)this.remove(c);if(e===fr)s.up.set(0,1,0),s.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===tp)s.up.set(0,-1,0),s.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:s,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,o,a,l,c,u]=this.children,d=e.getRenderTarget(),f=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const _=s.texture.generateMipmaps;s.texture.generateMipmaps=!1,e.setRenderTarget(s,0,i),e.render(n,r),e.setRenderTarget(s,1,i),e.render(n,o),e.setRenderTarget(s,2,i),e.render(n,a),e.setRenderTarget(s,3,i),e.render(n,l),e.setRenderTarget(s,4,i),e.render(n,c),s.texture.generateMipmaps=_,e.setRenderTarget(s,5,i),e.render(n,u),e.setRenderTarget(d,f,h),e.xr.enabled=v,s.texture.needsPMREMUpdate=!0}}class h4 extends Sn{constructor(e,n,s,i,r,o,a,l,c,u){e=e!==void 0?e:[],n=n!==void 0?n:ec,super(e,n,s,i,r,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class PB extends Ta{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const s={width:e,height:e,depth:1},i=[s,s,s,s,s,s];this.texture=new h4(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Ss}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const s={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},i=new Mc(5,5,5),r=new bo({name:"CubemapFromEquirect",uniforms:oc(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,side:hs,blending:ho});r.uniforms.tEquirect.value=n;const o=new fs(i,r),a=n.minFilter;return n.minFilter===dr&&(n.minFilter=Ss),new kB(1,10,this).update(e,o),n.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,n,s,i){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(n,s,i);e.setRenderTarget(r)}}const Sg=new ie,IB=new ie,OB=new pt;class Xo{constructor(e=new ie(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,s,i){return this.normal.set(e,n,s),this.constant=i,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,s){const i=Sg.subVectors(s,n).cross(IB.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const s=e.delta(Sg),i=this.normal.dot(s);if(i===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:n.copy(e.start).addScaledVector(s,r)}intersectsLine(e){const n=this.distanceToPoint(e.start),s=this.distanceToPoint(e.end);return n<0&&s>0||s<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const s=n||OB.getNormalMatrix(e),i=this.coplanarPoint(Sg).applyMatrix4(e),r=this.normal.applyMatrix3(s).normalize();return this.constant=-i.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Fo=new Fi,_f=new ie;class Bv{constructor(e=new Xo,n=new Xo,s=new Xo,i=new Xo,r=new Xo,o=new Xo){this.planes=[e,n,s,i,r,o]}set(e,n,s,i,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(s),a[3].copy(i),a[4].copy(r),a[5].copy(o),this}copy(e){const n=this.planes;for(let s=0;s<6;s++)n[s].copy(e.planes[s]);return this}setFromProjectionMatrix(e,n=fr){const s=this.planes,i=e.elements,r=i[0],o=i[1],a=i[2],l=i[3],c=i[4],u=i[5],d=i[6],f=i[7],h=i[8],v=i[9],_=i[10],m=i[11],g=i[12],y=i[13],b=i[14],w=i[15];if(s[0].setComponents(l-r,f-c,m-h,w-g).normalize(),s[1].setComponents(l+r,f+c,m+h,w+g).normalize(),s[2].setComponents(l+o,f+u,m+v,w+y).normalize(),s[3].setComponents(l-o,f-u,m-v,w-y).normalize(),s[4].setComponents(l-a,f-d,m-_,w-b).normalize(),n===fr)s[5].setComponents(l+a,f+d,m+_,w+b).normalize();else if(n===tp)s[5].setComponents(a,d,_,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Fo.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Fo.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Fo)}intersectsSprite(e){return Fo.center.set(0,0,0),Fo.radius=.7071067811865476,Fo.applyMatrix4(e.matrixWorld),this.intersectsSphere(Fo)}intersectsSphere(e){const n=this.planes,s=e.center,i=-e.radius;for(let r=0;r<6;r++)if(n[r].distanceToPoint(s)0?e.max.x:e.min.x,_f.y=i.normal.y>0?e.max.y:e.min.y,_f.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(_f)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let s=0;s<6;s++)if(n[s].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function p4(){let t=null,e=!1,n=null,s=null;function i(r,o){n(r,o),s=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(s=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(s),e=!1},setAnimationLoop:function(r){n=r},setContext:function(r){t=r}}}function LB(t){const e=new WeakMap;function n(a,l){const c=a.array,u=a.usage,d=c.byteLength,f=t.createBuffer();t.bindBuffer(l,f),t.bufferData(l,c,u),a.onUploadCallback();let h;if(c instanceof Float32Array)h=t.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?h=t.HALF_FLOAT:h=t.UNSIGNED_SHORT;else if(c instanceof Int16Array)h=t.SHORT;else if(c instanceof Uint32Array)h=t.UNSIGNED_INT;else if(c instanceof Int32Array)h=t.INT;else if(c instanceof Int8Array)h=t.BYTE;else if(c instanceof Uint8Array)h=t.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)h=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:f,type:h,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:d}}function s(a,l,c){const u=l.array,d=l._updateRange,f=l.updateRanges;if(t.bindBuffer(c,a),d.count===-1&&f.length===0&&t.bufferSubData(c,0,u),f.length!==0){for(let h=0,v=f.length;h 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,ZB=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,JB=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,QB=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,eH=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,tH=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,nH=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,sH=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,iH=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,rH=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,oH=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,aH=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,lH=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,cH=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,uH=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,dH="gl_FragColor = linearToOutputTexel( gl_FragColor );",fH=` +const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( + vec3( 0.8224621, 0.177538, 0.0 ), + vec3( 0.0331941, 0.9668058, 0.0 ), + vec3( 0.0170827, 0.0723974, 0.9105199 ) +); +const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( + vec3( 1.2249401, - 0.2249404, 0.0 ), + vec3( - 0.0420569, 1.0420571, 0.0 ), + vec3( - 0.0196376, - 0.0786361, 1.0982735 ) +); +vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { + return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); +} +vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { + return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); +} +vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,hH=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,pH=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,mH=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,gH=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,_H=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,vH=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,yH=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,bH=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,wH=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,xH=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,EH=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,SH=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,TH=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,AH=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,MH=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,RH=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,CH=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,kH=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,PH=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,IH=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,OH=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,LH=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,DH=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,NH=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,UH=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,FH=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,$H=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,BH=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,HH=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); + + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,GH=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,zH=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,VH=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,WH=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,jH=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,qH=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,XH=`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,KH=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,YH=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,ZH=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,JH=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,QH=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,eG=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,tG=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,nG=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,sG=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,iG=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,rG=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,oG=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,aG=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,lG=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,cG=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,uG=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,dG=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,fG=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,hG=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,pG=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,mG=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,gG=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,_G=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,vG=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,yG=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,bG=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,wG=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,xG=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,EG=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,SG=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,TG=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,AG=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,MG=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 OptimizedCineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,RG=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,CG=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + + #else + + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,kG=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,PG=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,IG=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,OG=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const LG=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,DG=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,NG=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,UG=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,FG=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,$G=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,BG=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,HG=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,GG=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,zG=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,VG=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,WG=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,jG=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,qG=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,XG=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,KG=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,YG=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,ZG=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,JG=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,QG=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,ez=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,tz=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,nz=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,sz=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,iz=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,rz=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,oz=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,az=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,lz=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,cz=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,uz=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,dz=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,fz=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,hz=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,ht={alphahash_fragment:DB,alphahash_pars_fragment:NB,alphamap_fragment:UB,alphamap_pars_fragment:FB,alphatest_fragment:$B,alphatest_pars_fragment:BB,aomap_fragment:HB,aomap_pars_fragment:GB,batching_pars_vertex:zB,batching_vertex:VB,begin_vertex:WB,beginnormal_vertex:jB,bsdfs:qB,iridescence_fragment:XB,bumpmap_pars_fragment:KB,clipping_planes_fragment:YB,clipping_planes_pars_fragment:ZB,clipping_planes_pars_vertex:JB,clipping_planes_vertex:QB,color_fragment:eH,color_pars_fragment:tH,color_pars_vertex:nH,color_vertex:sH,common:iH,cube_uv_reflection_fragment:rH,defaultnormal_vertex:oH,displacementmap_pars_vertex:aH,displacementmap_vertex:lH,emissivemap_fragment:cH,emissivemap_pars_fragment:uH,colorspace_fragment:dH,colorspace_pars_fragment:fH,envmap_fragment:hH,envmap_common_pars_fragment:pH,envmap_pars_fragment:mH,envmap_pars_vertex:gH,envmap_physical_pars_fragment:MH,envmap_vertex:_H,fog_vertex:vH,fog_pars_vertex:yH,fog_fragment:bH,fog_pars_fragment:wH,gradientmap_pars_fragment:xH,lightmap_pars_fragment:EH,lights_lambert_fragment:SH,lights_lambert_pars_fragment:TH,lights_pars_begin:AH,lights_toon_fragment:RH,lights_toon_pars_fragment:CH,lights_phong_fragment:kH,lights_phong_pars_fragment:PH,lights_physical_fragment:IH,lights_physical_pars_fragment:OH,lights_fragment_begin:LH,lights_fragment_maps:DH,lights_fragment_end:NH,logdepthbuf_fragment:UH,logdepthbuf_pars_fragment:FH,logdepthbuf_pars_vertex:$H,logdepthbuf_vertex:BH,map_fragment:HH,map_pars_fragment:GH,map_particle_fragment:zH,map_particle_pars_fragment:VH,metalnessmap_fragment:WH,metalnessmap_pars_fragment:jH,morphinstance_vertex:qH,morphcolor_vertex:XH,morphnormal_vertex:KH,morphtarget_pars_vertex:YH,morphtarget_vertex:ZH,normal_fragment_begin:JH,normal_fragment_maps:QH,normal_pars_fragment:eG,normal_pars_vertex:tG,normal_vertex:nG,normalmap_pars_fragment:sG,clearcoat_normal_fragment_begin:iG,clearcoat_normal_fragment_maps:rG,clearcoat_pars_fragment:oG,iridescence_pars_fragment:aG,opaque_fragment:lG,packing:cG,premultiplied_alpha_fragment:uG,project_vertex:dG,dithering_fragment:fG,dithering_pars_fragment:hG,roughnessmap_fragment:pG,roughnessmap_pars_fragment:mG,shadowmap_pars_fragment:gG,shadowmap_pars_vertex:_G,shadowmap_vertex:vG,shadowmask_pars_fragment:yG,skinbase_vertex:bG,skinning_pars_vertex:wG,skinning_vertex:xG,skinnormal_vertex:EG,specularmap_fragment:SG,specularmap_pars_fragment:TG,tonemapping_fragment:AG,tonemapping_pars_fragment:MG,transmission_fragment:RG,transmission_pars_fragment:CG,uv_pars_fragment:kG,uv_pars_vertex:PG,uv_vertex:IG,worldpos_vertex:OG,background_vert:LG,background_frag:DG,backgroundCube_vert:NG,backgroundCube_frag:UG,cube_vert:FG,cube_frag:$G,depth_vert:BG,depth_frag:HG,distanceRGBA_vert:GG,distanceRGBA_frag:zG,equirect_vert:VG,equirect_frag:WG,linedashed_vert:jG,linedashed_frag:qG,meshbasic_vert:XG,meshbasic_frag:KG,meshlambert_vert:YG,meshlambert_frag:ZG,meshmatcap_vert:JG,meshmatcap_frag:QG,meshnormal_vert:ez,meshnormal_frag:tz,meshphong_vert:nz,meshphong_frag:sz,meshphysical_vert:iz,meshphysical_frag:rz,meshtoon_vert:oz,meshtoon_frag:az,points_vert:lz,points_frag:cz,shadow_vert:uz,shadow_frag:dz,sprite_vert:fz,sprite_frag:hz},Be={common:{diffuse:{value:new ft(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new pt},alphaMap:{value:null},alphaMapTransform:{value:new pt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new pt}},envmap:{envMap:{value:null},envMapRotation:{value:new pt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new pt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new pt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new pt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new pt},normalScale:{value:new yt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new pt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new pt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new pt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new pt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ft(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ft(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new pt},alphaTest:{value:0},uvTransform:{value:new pt}},sprite:{diffuse:{value:new ft(16777215)},opacity:{value:1},center:{value:new yt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new pt},alphaMap:{value:null},alphaMapTransform:{value:new pt},alphaTest:{value:0}}},wi={basic:{uniforms:qn([Be.common,Be.specularmap,Be.envmap,Be.aomap,Be.lightmap,Be.fog]),vertexShader:ht.meshbasic_vert,fragmentShader:ht.meshbasic_frag},lambert:{uniforms:qn([Be.common,Be.specularmap,Be.envmap,Be.aomap,Be.lightmap,Be.emissivemap,Be.bumpmap,Be.normalmap,Be.displacementmap,Be.fog,Be.lights,{emissive:{value:new ft(0)}}]),vertexShader:ht.meshlambert_vert,fragmentShader:ht.meshlambert_frag},phong:{uniforms:qn([Be.common,Be.specularmap,Be.envmap,Be.aomap,Be.lightmap,Be.emissivemap,Be.bumpmap,Be.normalmap,Be.displacementmap,Be.fog,Be.lights,{emissive:{value:new ft(0)},specular:{value:new ft(1118481)},shininess:{value:30}}]),vertexShader:ht.meshphong_vert,fragmentShader:ht.meshphong_frag},standard:{uniforms:qn([Be.common,Be.envmap,Be.aomap,Be.lightmap,Be.emissivemap,Be.bumpmap,Be.normalmap,Be.displacementmap,Be.roughnessmap,Be.metalnessmap,Be.fog,Be.lights,{emissive:{value:new ft(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ht.meshphysical_vert,fragmentShader:ht.meshphysical_frag},toon:{uniforms:qn([Be.common,Be.aomap,Be.lightmap,Be.emissivemap,Be.bumpmap,Be.normalmap,Be.displacementmap,Be.gradientmap,Be.fog,Be.lights,{emissive:{value:new ft(0)}}]),vertexShader:ht.meshtoon_vert,fragmentShader:ht.meshtoon_frag},matcap:{uniforms:qn([Be.common,Be.bumpmap,Be.normalmap,Be.displacementmap,Be.fog,{matcap:{value:null}}]),vertexShader:ht.meshmatcap_vert,fragmentShader:ht.meshmatcap_frag},points:{uniforms:qn([Be.points,Be.fog]),vertexShader:ht.points_vert,fragmentShader:ht.points_frag},dashed:{uniforms:qn([Be.common,Be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ht.linedashed_vert,fragmentShader:ht.linedashed_frag},depth:{uniforms:qn([Be.common,Be.displacementmap]),vertexShader:ht.depth_vert,fragmentShader:ht.depth_frag},normal:{uniforms:qn([Be.common,Be.bumpmap,Be.normalmap,Be.displacementmap,{opacity:{value:1}}]),vertexShader:ht.meshnormal_vert,fragmentShader:ht.meshnormal_frag},sprite:{uniforms:qn([Be.sprite,Be.fog]),vertexShader:ht.sprite_vert,fragmentShader:ht.sprite_frag},background:{uniforms:{uvTransform:{value:new pt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ht.background_vert,fragmentShader:ht.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new pt}},vertexShader:ht.backgroundCube_vert,fragmentShader:ht.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ht.cube_vert,fragmentShader:ht.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ht.equirect_vert,fragmentShader:ht.equirect_frag},distanceRGBA:{uniforms:qn([Be.common,Be.displacementmap,{referencePosition:{value:new ie},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ht.distanceRGBA_vert,fragmentShader:ht.distanceRGBA_frag},shadow:{uniforms:qn([Be.lights,Be.fog,{color:{value:new ft(0)},opacity:{value:1}}]),vertexShader:ht.shadow_vert,fragmentShader:ht.shadow_frag}};wi.physical={uniforms:qn([wi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new pt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new pt},clearcoatNormalScale:{value:new yt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new pt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new pt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new pt},sheen:{value:0},sheenColor:{value:new ft(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new pt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new pt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new pt},transmissionSamplerSize:{value:new yt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new pt},attenuationDistance:{value:0},attenuationColor:{value:new ft(0)},specularColor:{value:new ft(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new pt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new pt},anisotropyVector:{value:new yt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new pt}}]),vertexShader:ht.meshphysical_vert,fragmentShader:ht.meshphysical_frag};const vf={r:0,b:0,g:0},$o=new Ni,pz=new mt;function mz(t,e,n,s,i,r,o){const a=new ft(0);let l=r===!0?0:1,c,u,d=null,f=0,h=null;function v(y){let b=y.isScene===!0?y.background:null;return b&&b.isTexture&&(b=(y.backgroundBlurriness>0?n:e).get(b)),b}function _(y){let b=!1;const w=v(y);w===null?g(a,l):w&&w.isColor&&(g(w,1),b=!0);const T=t.xr.getEnvironmentBlendMode();T==="additive"?s.buffers.color.setClear(0,0,0,1,o):T==="alpha-blend"&&s.buffers.color.setClear(0,0,0,0,o),(t.autoClear||b)&&(s.buffers.depth.setTest(!0),s.buffers.depth.setMask(!0),s.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function m(y,b){const w=v(b);w&&(w.isCubeTexture||w.mapping===om)?(u===void 0&&(u=new fs(new Mc(1,1,1),new bo({name:"BackgroundCubeMaterial",uniforms:oc(wi.backgroundCube.uniforms),vertexShader:wi.backgroundCube.vertexShader,fragmentShader:wi.backgroundCube.fragmentShader,side:hs,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(T,S,A){this.matrixWorld.copyPosition(A.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),$o.copy(b.backgroundRotation),$o.x*=-1,$o.y*=-1,$o.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&($o.y*=-1,$o.z*=-1),u.material.uniforms.envMap.value=w,u.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=b.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(pz.makeRotationFromEuler($o)),u.material.toneMapped=Et.getTransfer(w.colorSpace)!==Gt,(d!==w||f!==w.version||h!==t.toneMapping)&&(u.material.needsUpdate=!0,d=w,f=w.version,h=t.toneMapping),u.layers.enableAll(),y.unshift(u,u.geometry,u.material,0,0,null)):w&&w.isTexture&&(c===void 0&&(c=new fs(new cm(2,2),new bo({name:"BackgroundMaterial",uniforms:oc(wi.background.uniforms),vertexShader:wi.background.vertexShader,fragmentShader:wi.background.fragmentShader,side:yr,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=w,c.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,c.material.toneMapped=Et.getTransfer(w.colorSpace)!==Gt,w.matrixAutoUpdate===!0&&w.updateMatrix(),c.material.uniforms.uvTransform.value.copy(w.matrix),(d!==w||f!==w.version||h!==t.toneMapping)&&(c.material.needsUpdate=!0,d=w,f=w.version,h=t.toneMapping),c.layers.enableAll(),y.unshift(c,c.geometry,c.material,0,0,null))}function g(y,b){y.getRGB(vf,d4(t)),s.buffers.color.setClear(vf.r,vf.g,vf.b,b,o)}return{getClearColor:function(){return a},setClearColor:function(y,b=1){a.set(y),l=b,g(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(y){l=y,g(a,l)},render:_,addToRenderList:m}}function gz(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),s={},i=f(null);let r=i,o=!1;function a(E,k,U,H,D){let I=!1;const P=d(H,U,k);r!==P&&(r=P,c(r.object)),I=h(E,H,U,D),I&&v(E,H,U,D),D!==null&&e.update(D,t.ELEMENT_ARRAY_BUFFER),(I||o)&&(o=!1,w(E,k,U,H),D!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(D).buffer))}function l(){return t.createVertexArray()}function c(E){return t.bindVertexArray(E)}function u(E){return t.deleteVertexArray(E)}function d(E,k,U){const H=U.wireframe===!0;let D=s[E.id];D===void 0&&(D={},s[E.id]=D);let I=D[k.id];I===void 0&&(I={},D[k.id]=I);let P=I[H];return P===void 0&&(P=f(l()),I[H]=P),P}function f(E){const k=[],U=[],H=[];for(let D=0;D=0){const q=D[L];let de=I[L];if(de===void 0&&(L==="instanceMatrix"&&E.instanceMatrix&&(de=E.instanceMatrix),L==="instanceColor"&&E.instanceColor&&(de=E.instanceColor)),q===void 0||q.attribute!==de||de&&q.data!==de.data)return!0;P++}return r.attributesNum!==P||r.index!==H}function v(E,k,U,H){const D={},I=k.attributes;let P=0;const B=U.getAttributes();for(const L in B)if(B[L].location>=0){let q=I[L];q===void 0&&(L==="instanceMatrix"&&E.instanceMatrix&&(q=E.instanceMatrix),L==="instanceColor"&&E.instanceColor&&(q=E.instanceColor));const de={};de.attribute=q,q&&q.data&&(de.data=q.data),D[L]=de,P++}r.attributes=D,r.attributesNum=P,r.index=H}function _(){const E=r.newAttributes;for(let k=0,U=E.length;k=0){let Y=D[B];if(Y===void 0&&(B==="instanceMatrix"&&E.instanceMatrix&&(Y=E.instanceMatrix),B==="instanceColor"&&E.instanceColor&&(Y=E.instanceColor)),Y!==void 0){const q=Y.normalized,de=Y.itemSize,fe=e.get(Y);if(fe===void 0)continue;const Re=fe.buffer,oe=fe.type,me=fe.bytesPerElement,ke=oe===t.INT||oe===t.UNSIGNED_INT||Y.gpuType===Pv;if(Y.isInterleavedBufferAttribute){const J=Y.data,Ae=J.stride,Ee=Y.offset;if(J.isInstancedInterleavedBuffer){for(let Ce=0;Ce0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";S="mediump"}return S==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const d=n.logarithmicDepthBuffer===!0,f=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),h=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=t.getParameter(t.MAX_TEXTURE_SIZE),_=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),m=t.getParameter(t.MAX_VERTEX_ATTRIBS),g=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),y=t.getParameter(t.MAX_VARYING_VECTORS),b=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),w=h>0,T=t.getParameter(t.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:d,maxTextures:f,maxVertexTextures:h,maxTextureSize:v,maxCubemapSize:_,maxAttributes:m,maxVertexUniforms:g,maxVaryings:y,maxFragmentUniforms:b,vertexTextures:w,maxSamples:T}}function yz(t){const e=this;let n=null,s=0,i=!1,r=!1;const o=new Xo,a=new pt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const h=d.length!==0||f||s!==0||i;return i=f,s=d.length,h},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(d,f){n=u(d,f,0)},this.setState=function(d,f,h){const v=d.clippingPlanes,_=d.clipIntersection,m=d.clipShadows,g=t.get(d);if(!i||v===null||v.length===0||r&&!m)r?u(null):c();else{const y=r?0:s,b=y*4;let w=g.clippingState||null;l.value=w,w=u(v,f,b,h);for(let T=0;T!==b;++T)w[T]=n[T];g.clippingState=w,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=s>0),e.numPlanes=s,e.numIntersection=0}function u(d,f,h,v){const _=d!==null?d.length:0;let m=null;if(_!==0){if(m=l.value,v!==!0||m===null){const g=h+_*4,y=f.matrixWorldInverse;a.getNormalMatrix(y),(m===null||m.length0){const c=new PB(l.height);return c.fromEquirectangularTexture(t,o),e.set(o,c),o.addEventListener("dispose",i),n(c.texture,o.mapping)}else return null}}return o}function i(o){const a=o.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function r(){e=new WeakMap}return{get:s,dispose:r}}class Hv extends f4{constructor(e=-1,n=1,s=1,i=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=s,this.bottom=i,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,s,i,r,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=s,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=s-e,o=s+e,a=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,o=r+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(r,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const wl=4,v2=[.125,.215,.35,.446,.526,.582],na=20,Tg=new Hv,y2=new ft;let Ag=null,Mg=0,Rg=0,Cg=!1;const Ko=(1+Math.sqrt(5))/2,il=1/Ko,b2=[new ie(-Ko,il,0),new ie(Ko,il,0),new ie(-il,0,Ko),new ie(il,0,Ko),new ie(0,Ko,-il),new ie(0,Ko,il),new ie(-1,1,-1),new ie(1,1,-1),new ie(-1,1,1),new ie(1,1,1)];class w2{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,s=.1,i=100){Ag=this._renderer.getRenderTarget(),Mg=this._renderer.getActiveCubeFace(),Rg=this._renderer.getActiveMipmapLevel(),Cg=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,s,i,r),n>0&&this._blur(r,0,0,n),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=S2(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=E2(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?b:0,b,b),u.setRenderTarget(i),_&&u.render(v,a),u.render(e,a)}v.geometry.dispose(),v.material.dispose(),u.toneMapping=f,u.autoClear=d,e.background=m}_textureToCubeUV(e,n){const s=this._renderer,i=e.mapping===ec||e.mapping===tc;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=S2()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=E2());const r=i?this._cubemapMaterial:this._equirectMaterial,o=new fs(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;yf(n,0,0,3*l,2*l),s.setRenderTarget(n),s.render(o,Tg)}_applyPMREM(e){const n=this._renderer,s=n.autoClear;n.autoClear=!1;const i=this._lodPlanes.length;for(let r=1;rna&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${na}`);const g=[];let y=0;for(let A=0;Ab-wl?i-b+wl:0),S=4*(this._cubeSize-w);yf(n,T,S,3*w,2*w),l.setRenderTarget(n),l.render(d,Tg)}}function wz(t){const e=[],n=[],s=[];let i=t;const r=t-wl+1+v2.length;for(let o=0;ot-wl?l=v2[o-t+wl-1]:o===0&&(l=0),s.push(l);const c=1/(a-2),u=-c,d=1+c,f=[u,u,d,u,d,d,u,u,d,d,u,d],h=6,v=6,_=3,m=2,g=1,y=new Float32Array(_*v*h),b=new Float32Array(m*v*h),w=new Float32Array(g*v*h);for(let S=0;S2?0:-1,x=[A,R,0,A+2/3,R,0,A+2/3,R+1,0,A,R,0,A+2/3,R+1,0,A,R+1,0];y.set(x,_*v*S),b.set(f,m*v*S);const E=[S,S,S,S,S,S];w.set(E,g*v*S)}const T=new $i;T.setAttribute("position",new ns(y,_)),T.setAttribute("uv",new ns(b,m)),T.setAttribute("faceIndex",new ns(w,g)),e.push(T),i>wl&&i--}return{lodPlanes:e,sizeLods:n,sigmas:s}}function x2(t,e,n){const s=new Ta(t,e,n);return s.texture.mapping=om,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function yf(t,e,n,s,i){t.viewport.set(e,n,s,i),t.scissor.set(e,n,s,i)}function xz(t,e,n){const s=new Float32Array(na),i=new ie(0,1,0);return new bo({name:"SphericalGaussianBlur",defines:{n:na,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Gv(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:ho,depthTest:!1,depthWrite:!1})}function E2(){return new bo({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Gv(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:ho,depthTest:!1,depthWrite:!1})}function S2(){return new bo({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Gv(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:ho,depthTest:!1,depthWrite:!1})}function Gv(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function Ez(t){let e=new WeakMap,n=null;function s(a){if(a&&a.isTexture){const l=a.mapping,c=l===t0||l===n0,u=l===ec||l===tc;if(c||u){let d=e.get(a);const f=d!==void 0?d.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==f)return n===null&&(n=new w2(t)),d=c?n.fromEquirectangular(a,d):n.fromCubemap(a,d),d.texture.pmremVersion=a.pmremVersion,e.set(a,d),d.texture;if(d!==void 0)return d.texture;{const h=a.image;return c&&h&&h.height>0||u&&h&&i(h)?(n===null&&(n=new w2(t)),d=c?n.fromEquirectangular(a):n.fromCubemap(a),d.texture.pmremVersion=a.pmremVersion,e.set(a,d),a.addEventListener("dispose",r),d.texture):null}}}return a}function i(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(T=Math.ceil(w/e.maxTextureSize),w=e.maxTextureSize);const S=new Float32Array(w*T*4*d),A=new o4(S,w,T,d);A.type=ei,A.needsUpdate=!0;const R=b*4;for(let E=0;E0)return t;const i=e*n;let r=A2[i];if(r===void 0&&(r=new Float32Array(i),A2[i]=r),e!==0){s.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=n,t[o].toArray(r,a)}return r}function gn(t,e){if(t.length!==e.length)return!1;for(let n=0,s=t.length;n":" "} ${a}: ${n[o]}`)}return s.join(` +`)}function EV(t){const e=Et.getPrimaries(Et.workingColorSpace),n=Et.getPrimaries(t);let s;switch(e===n?s="":e===ep&&n===Qh?s="LinearDisplayP3ToLinearSRGB":e===Qh&&n===ep&&(s="LinearSRGBToLinearDisplayP3"),t){case kn:case am:return[s,"LinearTransferOETF"];case Zn:case Fv:return[s,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[s,"LinearTransferOETF"]}}function O2(t,e,n){const s=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(s&&i==="")return"";const r=/ERROR: 0:(\d+)/.exec(i);if(r){const o=parseInt(r[1]);return n.toUpperCase()+` + +`+i+` + +`+xV(t.getShaderSource(e),o)}else return i}function SV(t,e){const n=EV(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function TV(t,e){let n;switch(e){case T$:n="Linear";break;case A$:n="Reinhard";break;case M$:n="OptimizedCineon";break;case R$:n="ACESFilmic";break;case k$:n="AgX";break;case P$:n="Neutral";break;case C$:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const bf=new ie;function AV(){Et.getLuminanceCoefficients(bf);const t=bf.x.toFixed(4),e=bf.y.toFixed(4),n=bf.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${t}, ${e}, ${n} );`," return dot( weights, rgb );","}"].join(` +`)}function MV(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(pu).join(` +`)}function RV(t){const e=[];for(const n in t){const s=t[n];s!==!1&&e.push("#define "+n+" "+s)}return e.join(` +`)}function CV(t,e){const n={},s=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function P0(t){return t.replace(kV,IV)}const PV=new Map;function IV(t,e){let n=ht[e];if(n===void 0){const s=PV.get(e);if(s!==void 0)n=ht[s],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,s);else throw new Error("Can not resolve #include <"+e+">")}return P0(n)}const OV=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function N2(t){return t.replace(OV,LV)}function LV(t,e,n,s){let i="";for(let r=parseInt(e);r0&&(m+=` +`),g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(pu).join(` +`),g.length>0&&(g+=` +`)):(m=[U2(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(pu).join(` +`),g=[U2(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==po?"#define TONE_MAPPING":"",n.toneMapping!==po?ht.tonemapping_pars_fragment:"",n.toneMapping!==po?TV("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",ht.colorspace_pars_fragment,SV("linearToOutputTexel",n.outputColorSpace),AV(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`].filter(pu).join(` +`)),o=P0(o),o=L2(o,n),o=D2(o,n),a=P0(a),a=L2(a,n),a=D2(a,n),o=N2(o),a=N2(a),n.isRawShaderMaterial!==!0&&(y=`#version 300 es +`,m=[h,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+m,g=["#define varying in",n.glslVersion===Zw?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Zw?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+g);const b=y+m+o,w=y+g+a,T=I2(i,i.VERTEX_SHADER,b),S=I2(i,i.FRAGMENT_SHADER,w);i.attachShader(_,T),i.attachShader(_,S),n.index0AttributeName!==void 0?i.bindAttribLocation(_,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_);function A(k){if(t.debug.checkShaderErrors){const U=i.getProgramInfoLog(_).trim(),H=i.getShaderInfoLog(T).trim(),D=i.getShaderInfoLog(S).trim();let I=!0,P=!0;if(i.getProgramParameter(_,i.LINK_STATUS)===!1)if(I=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,_,T,S);else{const B=O2(i,T,"vertex"),L=O2(i,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(_,i.VALIDATE_STATUS)+` + +Material Name: `+k.name+` +Material Type: `+k.type+` + +Program Info Log: `+U+` +`+B+` +`+L)}else U!==""?console.warn("THREE.WebGLProgram: Program Info Log:",U):(H===""||D==="")&&(P=!1);P&&(k.diagnostics={runnable:I,programLog:U,vertexShader:{log:H,prefix:m},fragmentShader:{log:D,prefix:g}})}i.deleteShader(T),i.deleteShader(S),R=new wh(i,_),x=CV(i,_)}let R;this.getUniforms=function(){return R===void 0&&A(this),R};let x;this.getAttributes=function(){return x===void 0&&A(this),x};let E=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=i.getProgramParameter(_,bV)),E},this.destroy=function(){s.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=wV++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=T,this.fragmentShader=S,this}let HV=0;class GV{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,s=e.fragmentShader,i=this._getShaderStage(n),r=this._getShaderStage(s),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const s of n)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let s=n.get(e);return s===void 0&&(s=new Set,n.set(e,s)),s}_getShaderStage(e){const n=this.shaderCache;let s=n.get(e);return s===void 0&&(s=new zV(e),n.set(e,s)),s}}class zV{constructor(e){this.id=HV++,this.code=e,this.usedTimes=0}}function VV(t,e,n,s,i,r,o){const a=new a4,l=new GV,c=new Set,u=[],d=i.logarithmicDepthBuffer,f=i.vertexTextures;let h=i.precision;const v={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(x){return c.add(x),x===0?"uv":`uv${x}`}function m(x,E,k,U,H){const D=U.fog,I=H.geometry,P=x.isMeshStandardMaterial?U.environment:null,B=(x.isMeshStandardMaterial?n:e).get(x.envMap||P),L=B&&B.mapping===om?B.image.height:null,Y=v[x.type];x.precision!==null&&(h=i.getMaxPrecision(x.precision),h!==x.precision&&console.warn("THREE.WebGLProgram.getParameters:",x.precision,"not supported, using",h,"instead."));const q=I.morphAttributes.position||I.morphAttributes.normal||I.morphAttributes.color,de=q!==void 0?q.length:0;let fe=0;I.morphAttributes.position!==void 0&&(fe=1),I.morphAttributes.normal!==void 0&&(fe=2),I.morphAttributes.color!==void 0&&(fe=3);let Re,oe,me,ke;if(Y){const Tt=wi[Y];Re=Tt.vertexShader,oe=Tt.fragmentShader}else Re=x.vertexShader,oe=x.fragmentShader,l.update(x),me=l.getVertexShaderID(x),ke=l.getFragmentShaderID(x);const J=t.getRenderTarget(),Ae=H.isInstancedMesh===!0,Ee=H.isBatchedMesh===!0,Ce=!!x.map,Ge=!!x.matcap,M=!!B,z=!!x.aoMap,K=!!x.lightMap,ce=!!x.bumpMap,te=!!x.normalMap,we=!!x.displacementMap,Me=!!x.emissiveMap,Se=!!x.metalnessMap,N=!!x.roughnessMap,C=x.anisotropy>0,Q=x.clearcoat>0,ae=x.dispersion>0,_e=x.iridescence>0,pe=x.sheen>0,De=x.transmission>0,Pe=C&&!!x.anisotropyMap,Oe=Q&&!!x.clearcoatMap,Xe=Q&&!!x.clearcoatNormalMap,he=Q&&!!x.clearcoatRoughnessMap,j=_e&&!!x.iridescenceMap,O=_e&&!!x.iridescenceThicknessMap,ee=pe&&!!x.sheenColorMap,$=pe&&!!x.sheenRoughnessMap,V=!!x.specularMap,W=!!x.specularColorMap,ne=!!x.specularIntensityMap,G=De&&!!x.transmissionMap,ge=De&&!!x.thicknessMap,ue=!!x.gradientMap,Te=!!x.alphaMap,Ne=x.alphaTest>0,Je=!!x.alphaHash,bt=!!x.extensions;let Zt=po;x.toneMapped&&(J===null||J.isXRRenderTarget===!0)&&(Zt=t.toneMapping);const An={shaderID:Y,shaderType:x.type,shaderName:x.name,vertexShader:Re,fragmentShader:oe,defines:x.defines,customVertexShaderID:me,customFragmentShaderID:ke,isRawShaderMaterial:x.isRawShaderMaterial===!0,glslVersion:x.glslVersion,precision:h,batching:Ee,batchingColor:Ee&&H._colorsTexture!==null,instancing:Ae,instancingColor:Ae&&H.instanceColor!==null,instancingMorph:Ae&&H.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:J===null?t.outputColorSpace:J.isXRRenderTarget===!0?J.texture.colorSpace:kn,alphaToCoverage:!!x.alphaToCoverage,map:Ce,matcap:Ge,envMap:M,envMapMode:M&&B.mapping,envMapCubeUVHeight:L,aoMap:z,lightMap:K,bumpMap:ce,normalMap:te,displacementMap:f&&we,emissiveMap:Me,normalMapObjectSpace:te&&x.normalMapType===U$,normalMapTangentSpace:te&&x.normalMapType===n4,metalnessMap:Se,roughnessMap:N,anisotropy:C,anisotropyMap:Pe,clearcoat:Q,clearcoatMap:Oe,clearcoatNormalMap:Xe,clearcoatRoughnessMap:he,dispersion:ae,iridescence:_e,iridescenceMap:j,iridescenceThicknessMap:O,sheen:pe,sheenColorMap:ee,sheenRoughnessMap:$,specularMap:V,specularColorMap:W,specularIntensityMap:ne,transmission:De,transmissionMap:G,thicknessMap:ge,gradientMap:ue,opaque:x.transparent===!1&&x.blending===Nl&&x.alphaToCoverage===!1,alphaMap:Te,alphaTest:Ne,alphaHash:Je,combine:x.combine,mapUv:Ce&&_(x.map.channel),aoMapUv:z&&_(x.aoMap.channel),lightMapUv:K&&_(x.lightMap.channel),bumpMapUv:ce&&_(x.bumpMap.channel),normalMapUv:te&&_(x.normalMap.channel),displacementMapUv:we&&_(x.displacementMap.channel),emissiveMapUv:Me&&_(x.emissiveMap.channel),metalnessMapUv:Se&&_(x.metalnessMap.channel),roughnessMapUv:N&&_(x.roughnessMap.channel),anisotropyMapUv:Pe&&_(x.anisotropyMap.channel),clearcoatMapUv:Oe&&_(x.clearcoatMap.channel),clearcoatNormalMapUv:Xe&&_(x.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:he&&_(x.clearcoatRoughnessMap.channel),iridescenceMapUv:j&&_(x.iridescenceMap.channel),iridescenceThicknessMapUv:O&&_(x.iridescenceThicknessMap.channel),sheenColorMapUv:ee&&_(x.sheenColorMap.channel),sheenRoughnessMapUv:$&&_(x.sheenRoughnessMap.channel),specularMapUv:V&&_(x.specularMap.channel),specularColorMapUv:W&&_(x.specularColorMap.channel),specularIntensityMapUv:ne&&_(x.specularIntensityMap.channel),transmissionMapUv:G&&_(x.transmissionMap.channel),thicknessMapUv:ge&&_(x.thicknessMap.channel),alphaMapUv:Te&&_(x.alphaMap.channel),vertexTangents:!!I.attributes.tangent&&(te||C),vertexColors:x.vertexColors,vertexAlphas:x.vertexColors===!0&&!!I.attributes.color&&I.attributes.color.itemSize===4,pointsUvs:H.isPoints===!0&&!!I.attributes.uv&&(Ce||Te),fog:!!D,useFog:x.fog===!0,fogExp2:!!D&&D.isFogExp2,flatShading:x.flatShading===!0,sizeAttenuation:x.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:H.isSkinnedMesh===!0,morphTargets:I.morphAttributes.position!==void 0,morphNormals:I.morphAttributes.normal!==void 0,morphColors:I.morphAttributes.color!==void 0,morphTargetsCount:de,morphTextureStride:fe,numDirLights:E.directional.length,numPointLights:E.point.length,numSpotLights:E.spot.length,numSpotLightMaps:E.spotLightMap.length,numRectAreaLights:E.rectArea.length,numHemiLights:E.hemi.length,numDirLightShadows:E.directionalShadowMap.length,numPointLightShadows:E.pointShadowMap.length,numSpotLightShadows:E.spotShadowMap.length,numSpotLightShadowsWithMaps:E.numSpotLightShadowsWithMaps,numLightProbes:E.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:x.dithering,shadowMapEnabled:t.shadowMap.enabled&&k.length>0,shadowMapType:t.shadowMap.type,toneMapping:Zt,decodeVideoTexture:Ce&&x.map.isVideoTexture===!0&&Et.getTransfer(x.map.colorSpace)===Gt,premultipliedAlpha:x.premultipliedAlpha,doubleSided:x.side===xi,flipSided:x.side===hs,useDepthPacking:x.depthPacking>=0,depthPacking:x.depthPacking||0,index0AttributeName:x.index0AttributeName,extensionClipCullDistance:bt&&x.extensions.clipCullDistance===!0&&s.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(bt&&x.extensions.multiDraw===!0||Ee)&&s.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:s.has("KHR_parallel_shader_compile"),customProgramCacheKey:x.customProgramCacheKey()};return An.vertexUv1s=c.has(1),An.vertexUv2s=c.has(2),An.vertexUv3s=c.has(3),c.clear(),An}function g(x){const E=[];if(x.shaderID?E.push(x.shaderID):(E.push(x.customVertexShaderID),E.push(x.customFragmentShaderID)),x.defines!==void 0)for(const k in x.defines)E.push(k),E.push(x.defines[k]);return x.isRawShaderMaterial===!1&&(y(E,x),b(E,x),E.push(t.outputColorSpace)),E.push(x.customProgramCacheKey),E.join()}function y(x,E){x.push(E.precision),x.push(E.outputColorSpace),x.push(E.envMapMode),x.push(E.envMapCubeUVHeight),x.push(E.mapUv),x.push(E.alphaMapUv),x.push(E.lightMapUv),x.push(E.aoMapUv),x.push(E.bumpMapUv),x.push(E.normalMapUv),x.push(E.displacementMapUv),x.push(E.emissiveMapUv),x.push(E.metalnessMapUv),x.push(E.roughnessMapUv),x.push(E.anisotropyMapUv),x.push(E.clearcoatMapUv),x.push(E.clearcoatNormalMapUv),x.push(E.clearcoatRoughnessMapUv),x.push(E.iridescenceMapUv),x.push(E.iridescenceThicknessMapUv),x.push(E.sheenColorMapUv),x.push(E.sheenRoughnessMapUv),x.push(E.specularMapUv),x.push(E.specularColorMapUv),x.push(E.specularIntensityMapUv),x.push(E.transmissionMapUv),x.push(E.thicknessMapUv),x.push(E.combine),x.push(E.fogExp2),x.push(E.sizeAttenuation),x.push(E.morphTargetsCount),x.push(E.morphAttributeCount),x.push(E.numDirLights),x.push(E.numPointLights),x.push(E.numSpotLights),x.push(E.numSpotLightMaps),x.push(E.numHemiLights),x.push(E.numRectAreaLights),x.push(E.numDirLightShadows),x.push(E.numPointLightShadows),x.push(E.numSpotLightShadows),x.push(E.numSpotLightShadowsWithMaps),x.push(E.numLightProbes),x.push(E.shadowMapType),x.push(E.toneMapping),x.push(E.numClippingPlanes),x.push(E.numClipIntersection),x.push(E.depthPacking)}function b(x,E){a.disableAll(),E.supportsVertexTextures&&a.enable(0),E.instancing&&a.enable(1),E.instancingColor&&a.enable(2),E.instancingMorph&&a.enable(3),E.matcap&&a.enable(4),E.envMap&&a.enable(5),E.normalMapObjectSpace&&a.enable(6),E.normalMapTangentSpace&&a.enable(7),E.clearcoat&&a.enable(8),E.iridescence&&a.enable(9),E.alphaTest&&a.enable(10),E.vertexColors&&a.enable(11),E.vertexAlphas&&a.enable(12),E.vertexUv1s&&a.enable(13),E.vertexUv2s&&a.enable(14),E.vertexUv3s&&a.enable(15),E.vertexTangents&&a.enable(16),E.anisotropy&&a.enable(17),E.alphaHash&&a.enable(18),E.batching&&a.enable(19),E.dispersion&&a.enable(20),E.batchingColor&&a.enable(21),x.push(a.mask),a.disableAll(),E.fog&&a.enable(0),E.useFog&&a.enable(1),E.flatShading&&a.enable(2),E.logarithmicDepthBuffer&&a.enable(3),E.skinning&&a.enable(4),E.morphTargets&&a.enable(5),E.morphNormals&&a.enable(6),E.morphColors&&a.enable(7),E.premultipliedAlpha&&a.enable(8),E.shadowMapEnabled&&a.enable(9),E.doubleSided&&a.enable(10),E.flipSided&&a.enable(11),E.useDepthPacking&&a.enable(12),E.dithering&&a.enable(13),E.transmission&&a.enable(14),E.sheen&&a.enable(15),E.opaque&&a.enable(16),E.pointsUvs&&a.enable(17),E.decodeVideoTexture&&a.enable(18),E.alphaToCoverage&&a.enable(19),x.push(a.mask)}function w(x){const E=v[x.type];let k;if(E){const U=wi[E];k=MB.clone(U.uniforms)}else k=x.uniforms;return k}function T(x,E){let k;for(let U=0,H=u.length;U0?s.push(g):h.transparent===!0?i.push(g):n.push(g)}function l(d,f,h,v,_,m){const g=o(d,f,h,v,_,m);h.transmission>0?s.unshift(g):h.transparent===!0?i.unshift(g):n.unshift(g)}function c(d,f){n.length>1&&n.sort(d||jV),s.length>1&&s.sort(f||F2),i.length>1&&i.sort(f||F2)}function u(){for(let d=e,f=t.length;d=r.length?(o=new $2,r.push(o)):o=r[i],o}function n(){t=new WeakMap}return{get:e,dispose:n}}function XV(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new ie,color:new ft};break;case"SpotLight":n={position:new ie,direction:new ie,color:new ft,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ie,color:new ft,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ie,skyColor:new ft,groundColor:new ft};break;case"RectAreaLight":n={color:new ft,position:new ie,halfWidth:new ie,halfHeight:new ie};break}return t[e.id]=n,n}}}function KV(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new yt};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new yt};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new yt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let YV=0;function ZV(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function JV(t){const e=new XV,n=KV(),s={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)s.probe.push(new ie);const i=new ie,r=new mt,o=new mt;function a(c){let u=0,d=0,f=0;for(let x=0;x<9;x++)s.probe[x].set(0,0,0);let h=0,v=0,_=0,m=0,g=0,y=0,b=0,w=0,T=0,S=0,A=0;c.sort(ZV);for(let x=0,E=c.length;x0&&(t.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Be.LTC_FLOAT_1,s.rectAreaLTC2=Be.LTC_FLOAT_2):(s.rectAreaLTC1=Be.LTC_HALF_1,s.rectAreaLTC2=Be.LTC_HALF_2)),s.ambient[0]=u,s.ambient[1]=d,s.ambient[2]=f;const R=s.hash;(R.directionalLength!==h||R.pointLength!==v||R.spotLength!==_||R.rectAreaLength!==m||R.hemiLength!==g||R.numDirectionalShadows!==y||R.numPointShadows!==b||R.numSpotShadows!==w||R.numSpotMaps!==T||R.numLightProbes!==A)&&(s.directional.length=h,s.spot.length=_,s.rectArea.length=m,s.point.length=v,s.hemi.length=g,s.directionalShadow.length=y,s.directionalShadowMap.length=y,s.pointShadow.length=b,s.pointShadowMap.length=b,s.spotShadow.length=w,s.spotShadowMap.length=w,s.directionalShadowMatrix.length=y,s.pointShadowMatrix.length=b,s.spotLightMatrix.length=w+T-S,s.spotLightMap.length=T,s.numSpotLightShadowsWithMaps=S,s.numLightProbes=A,R.directionalLength=h,R.pointLength=v,R.spotLength=_,R.rectAreaLength=m,R.hemiLength=g,R.numDirectionalShadows=y,R.numPointShadows=b,R.numSpotShadows=w,R.numSpotMaps=T,R.numLightProbes=A,s.version=YV++)}function l(c,u){let d=0,f=0,h=0,v=0,_=0;const m=u.matrixWorldInverse;for(let g=0,y=c.length;g=o.length?(a=new B2(t),o.push(a)):a=o[r],a}function s(){e=new WeakMap}return{get:n,dispose:s}}class eW extends Pi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=D$,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class tW extends Pi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const nW=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,sW=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function iW(t,e,n){let s=new Bv;const i=new yt,r=new yt,o=new Lt,a=new eW({depthPacking:N$}),l=new tW,c={},u=n.maxTextureSize,d={[yr]:hs,[hs]:yr,[xi]:xi},f=new bo({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new yt},radius:{value:4}},vertexShader:nW,fragmentShader:sW}),h=f.clone();h.defines.HORIZONTAL_PASS=1;const v=new $i;v.setAttribute("position",new ns(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new fs(v,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=GM;let g=this.type;this.render=function(S,A,R){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||S.length===0)return;const x=t.getRenderTarget(),E=t.getActiveCubeFace(),k=t.getActiveMipmapLevel(),U=t.state;U.setBlending(ho),U.buffers.color.setClear(1,1,1,1),U.buffers.depth.setTest(!0),U.setScissorTest(!1);const H=g!==Qi&&this.type===Qi,D=g===Qi&&this.type!==Qi;for(let I=0,P=S.length;Iu||i.y>u)&&(i.x>u&&(r.x=Math.floor(u/Y.x),i.x=r.x*Y.x,L.mapSize.x=r.x),i.y>u&&(r.y=Math.floor(u/Y.y),i.y=r.y*Y.y,L.mapSize.y=r.y)),L.map===null||H===!0||D===!0){const de=this.type!==Qi?{minFilter:ts,magFilter:ts}:{};L.map!==null&&L.map.dispose(),L.map=new Ta(i.x,i.y,de),L.map.texture.name=B.name+".shadowMap",L.camera.updateProjectionMatrix()}t.setRenderTarget(L.map),t.clear();const q=L.getViewportCount();for(let de=0;de0||A.map&&A.alphaTest>0){const U=E.uuid,H=A.uuid;let D=c[U];D===void 0&&(D={},c[U]=D);let I=D[H];I===void 0&&(I=E.clone(),D[H]=I,A.addEventListener("dispose",T)),E=I}if(E.visible=A.visible,E.wireframe=A.wireframe,x===Qi?E.side=A.shadowSide!==null?A.shadowSide:A.side:E.side=A.shadowSide!==null?A.shadowSide:d[A.side],E.alphaMap=A.alphaMap,E.alphaTest=A.alphaTest,E.map=A.map,E.clipShadows=A.clipShadows,E.clippingPlanes=A.clippingPlanes,E.clipIntersection=A.clipIntersection,E.displacementMap=A.displacementMap,E.displacementScale=A.displacementScale,E.displacementBias=A.displacementBias,E.wireframeLinewidth=A.wireframeLinewidth,E.linewidth=A.linewidth,R.isPointLight===!0&&E.isMeshDistanceMaterial===!0){const U=t.properties.get(E);U.light=R}return E}function w(S,A,R,x,E){if(S.visible===!1)return;if(S.layers.test(A.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&E===Qi)&&(!S.frustumCulled||s.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(R.matrixWorldInverse,S.matrixWorld);const H=e.update(S),D=S.material;if(Array.isArray(D)){const I=H.groups;for(let P=0,B=I.length;P=1):B.indexOf("OpenGL ES")!==-1&&(P=parseFloat(/^OpenGL ES (\d)/.exec(B)[1]),I=P>=2);let L=null,Y={};const q=t.getParameter(t.SCISSOR_BOX),de=t.getParameter(t.VIEWPORT),fe=new Lt().fromArray(q),Re=new Lt().fromArray(de);function oe(G,ge,ue,Te){const Ne=new Uint8Array(4),Je=t.createTexture();t.bindTexture(G,Je),t.texParameteri(G,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(G,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let bt=0;bt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new yt,u=new WeakMap;let d;const f=new WeakMap;let h=!1;try{h=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(N,C){return h?new OffscreenCanvas(N,C):od("canvas")}function _(N,C,Q){let ae=1;const _e=Se(N);if((_e.width>Q||_e.height>Q)&&(ae=Q/Math.max(_e.width,_e.height)),ae<1)if(typeof HTMLImageElement<"u"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&N instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&N instanceof ImageBitmap||typeof VideoFrame<"u"&&N instanceof VideoFrame){const pe=Math.floor(ae*_e.width),De=Math.floor(ae*_e.height);d===void 0&&(d=v(pe,De));const Pe=C?v(pe,De):d;return Pe.width=pe,Pe.height=De,Pe.getContext("2d").drawImage(N,0,0,pe,De),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+_e.width+"x"+_e.height+") to ("+pe+"x"+De+")."),Pe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+_e.width+"x"+_e.height+")."),N;return N}function m(N){return N.generateMipmaps&&N.minFilter!==ts&&N.minFilter!==Ss}function g(N){t.generateMipmap(N)}function y(N,C,Q,ae,_e=!1){if(N!==null){if(t[N]!==void 0)return t[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let pe=C;if(C===t.RED&&(Q===t.FLOAT&&(pe=t.R32F),Q===t.HALF_FLOAT&&(pe=t.R16F),Q===t.UNSIGNED_BYTE&&(pe=t.R8)),C===t.RED_INTEGER&&(Q===t.UNSIGNED_BYTE&&(pe=t.R8UI),Q===t.UNSIGNED_SHORT&&(pe=t.R16UI),Q===t.UNSIGNED_INT&&(pe=t.R32UI),Q===t.BYTE&&(pe=t.R8I),Q===t.SHORT&&(pe=t.R16I),Q===t.INT&&(pe=t.R32I)),C===t.RG&&(Q===t.FLOAT&&(pe=t.RG32F),Q===t.HALF_FLOAT&&(pe=t.RG16F),Q===t.UNSIGNED_BYTE&&(pe=t.RG8)),C===t.RG_INTEGER&&(Q===t.UNSIGNED_BYTE&&(pe=t.RG8UI),Q===t.UNSIGNED_SHORT&&(pe=t.RG16UI),Q===t.UNSIGNED_INT&&(pe=t.RG32UI),Q===t.BYTE&&(pe=t.RG8I),Q===t.SHORT&&(pe=t.RG16I),Q===t.INT&&(pe=t.RG32I)),C===t.RGB&&Q===t.UNSIGNED_INT_5_9_9_9_REV&&(pe=t.RGB9_E5),C===t.RGBA){const De=_e?Jh:Et.getTransfer(ae);Q===t.FLOAT&&(pe=t.RGBA32F),Q===t.HALF_FLOAT&&(pe=t.RGBA16F),Q===t.UNSIGNED_BYTE&&(pe=De===Gt?t.SRGB8_ALPHA8:t.RGBA8),Q===t.UNSIGNED_SHORT_4_4_4_4&&(pe=t.RGBA4),Q===t.UNSIGNED_SHORT_5_5_5_1&&(pe=t.RGB5_A1)}return(pe===t.R16F||pe===t.R32F||pe===t.RG16F||pe===t.RG32F||pe===t.RGBA16F||pe===t.RGBA32F)&&e.get("EXT_color_buffer_float"),pe}function b(N,C){let Q;return N?C===null||C===Sa||C===sc?Q=t.DEPTH24_STENCIL8:C===ei?Q=t.DEPTH32F_STENCIL8:C===sd&&(Q=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):C===null||C===Sa||C===sc?Q=t.DEPTH_COMPONENT24:C===ei?Q=t.DEPTH_COMPONENT32F:C===sd&&(Q=t.DEPTH_COMPONENT16),Q}function w(N,C){return m(N)===!0||N.isFramebufferTexture&&N.minFilter!==ts&&N.minFilter!==Ss?Math.log2(Math.max(C.width,C.height))+1:N.mipmaps!==void 0&&N.mipmaps.length>0?N.mipmaps.length:N.isCompressedTexture&&Array.isArray(N.image)?C.mipmaps.length:1}function T(N){const C=N.target;C.removeEventListener("dispose",T),A(C),C.isVideoTexture&&u.delete(C)}function S(N){const C=N.target;C.removeEventListener("dispose",S),x(C)}function A(N){const C=s.get(N);if(C.__webglInit===void 0)return;const Q=N.source,ae=f.get(Q);if(ae){const _e=ae[C.__cacheKey];_e.usedTimes--,_e.usedTimes===0&&R(N),Object.keys(ae).length===0&&f.delete(Q)}s.remove(N)}function R(N){const C=s.get(N);t.deleteTexture(C.__webglTexture);const Q=N.source,ae=f.get(Q);delete ae[C.__cacheKey],o.memory.textures--}function x(N){const C=s.get(N);if(N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ae=0;ae<6;ae++){if(Array.isArray(C.__webglFramebuffer[ae]))for(let _e=0;_e=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+i.maxTextures),E+=1,N}function H(N){const C=[];return C.push(N.wrapS),C.push(N.wrapT),C.push(N.wrapR||0),C.push(N.magFilter),C.push(N.minFilter),C.push(N.anisotropy),C.push(N.internalFormat),C.push(N.format),C.push(N.type),C.push(N.generateMipmaps),C.push(N.premultiplyAlpha),C.push(N.flipY),C.push(N.unpackAlignment),C.push(N.colorSpace),C.join()}function D(N,C){const Q=s.get(N);if(N.isVideoTexture&&we(N),N.isRenderTargetTexture===!1&&N.version>0&&Q.__version!==N.version){const ae=N.image;if(ae===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ae.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Re(Q,N,C);return}}n.bindTexture(t.TEXTURE_2D,Q.__webglTexture,t.TEXTURE0+C)}function I(N,C){const Q=s.get(N);if(N.version>0&&Q.__version!==N.version){Re(Q,N,C);return}n.bindTexture(t.TEXTURE_2D_ARRAY,Q.__webglTexture,t.TEXTURE0+C)}function P(N,C){const Q=s.get(N);if(N.version>0&&Q.__version!==N.version){Re(Q,N,C);return}n.bindTexture(t.TEXTURE_3D,Q.__webglTexture,t.TEXTURE0+C)}function B(N,C){const Q=s.get(N);if(N.version>0&&Q.__version!==N.version){oe(Q,N,C);return}n.bindTexture(t.TEXTURE_CUBE_MAP,Q.__webglTexture,t.TEXTURE0+C)}const L={[nc]:t.REPEAT,[ro]:t.CLAMP_TO_EDGE,[Zh]:t.MIRRORED_REPEAT},Y={[ts]:t.NEAREST,[WM]:t.NEAREST_MIPMAP_NEAREST,[hu]:t.NEAREST_MIPMAP_LINEAR,[Ss]:t.LINEAR,[mh]:t.LINEAR_MIPMAP_NEAREST,[dr]:t.LINEAR_MIPMAP_LINEAR},q={[F$]:t.NEVER,[V$]:t.ALWAYS,[$$]:t.LESS,[s4]:t.LEQUAL,[B$]:t.EQUAL,[z$]:t.GEQUAL,[H$]:t.GREATER,[G$]:t.NOTEQUAL};function de(N,C){if(C.type===ei&&e.has("OES_texture_float_linear")===!1&&(C.magFilter===Ss||C.magFilter===mh||C.magFilter===hu||C.magFilter===dr||C.minFilter===Ss||C.minFilter===mh||C.minFilter===hu||C.minFilter===dr)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(N,t.TEXTURE_WRAP_S,L[C.wrapS]),t.texParameteri(N,t.TEXTURE_WRAP_T,L[C.wrapT]),(N===t.TEXTURE_3D||N===t.TEXTURE_2D_ARRAY)&&t.texParameteri(N,t.TEXTURE_WRAP_R,L[C.wrapR]),t.texParameteri(N,t.TEXTURE_MAG_FILTER,Y[C.magFilter]),t.texParameteri(N,t.TEXTURE_MIN_FILTER,Y[C.minFilter]),C.compareFunction&&(t.texParameteri(N,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(N,t.TEXTURE_COMPARE_FUNC,q[C.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(C.magFilter===ts||C.minFilter!==hu&&C.minFilter!==dr||C.type===ei&&e.has("OES_texture_float_linear")===!1)return;if(C.anisotropy>1||s.get(C).__currentAnisotropy){const Q=e.get("EXT_texture_filter_anisotropic");t.texParameterf(N,Q.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(C.anisotropy,i.getMaxAnisotropy())),s.get(C).__currentAnisotropy=C.anisotropy}}}function fe(N,C){let Q=!1;N.__webglInit===void 0&&(N.__webglInit=!0,C.addEventListener("dispose",T));const ae=C.source;let _e=f.get(ae);_e===void 0&&(_e={},f.set(ae,_e));const pe=H(C);if(pe!==N.__cacheKey){_e[pe]===void 0&&(_e[pe]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,Q=!0),_e[pe].usedTimes++;const De=_e[N.__cacheKey];De!==void 0&&(_e[N.__cacheKey].usedTimes--,De.usedTimes===0&&R(C)),N.__cacheKey=pe,N.__webglTexture=_e[pe].texture}return Q}function Re(N,C,Q){let ae=t.TEXTURE_2D;(C.isDataArrayTexture||C.isCompressedArrayTexture)&&(ae=t.TEXTURE_2D_ARRAY),C.isData3DTexture&&(ae=t.TEXTURE_3D);const _e=fe(N,C),pe=C.source;n.bindTexture(ae,N.__webglTexture,t.TEXTURE0+Q);const De=s.get(pe);if(pe.version!==De.__version||_e===!0){n.activeTexture(t.TEXTURE0+Q);const Pe=Et.getPrimaries(Et.workingColorSpace),Oe=C.colorSpace===io?null:Et.getPrimaries(C.colorSpace),Xe=C.colorSpace===io||Pe===Oe?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,C.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,C.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Xe);let he=_(C.image,!1,i.maxTextureSize);he=Me(C,he);const j=r.convert(C.format,C.colorSpace),O=r.convert(C.type);let ee=y(C.internalFormat,j,O,C.colorSpace,C.isVideoTexture);de(ae,C);let $;const V=C.mipmaps,W=C.isVideoTexture!==!0,ne=De.__version===void 0||_e===!0,G=pe.dataReady,ge=w(C,he);if(C.isDepthTexture)ee=b(C.format===ic,C.type),ne&&(W?n.texStorage2D(t.TEXTURE_2D,1,ee,he.width,he.height):n.texImage2D(t.TEXTURE_2D,0,ee,he.width,he.height,0,j,O,null));else if(C.isDataTexture)if(V.length>0){W&&ne&&n.texStorage2D(t.TEXTURE_2D,ge,ee,V[0].width,V[0].height);for(let ue=0,Te=V.length;ue0){const Ne=H2($.width,$.height,C.format,C.type);for(const Je of C.layerUpdates){const bt=$.data.subarray(Je*Ne/$.data.BYTES_PER_ELEMENT,(Je+1)*Ne/$.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,ue,0,0,Je,$.width,$.height,1,j,bt,0,0)}C.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,ue,0,0,0,$.width,$.height,he.depth,j,$.data,0,0)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,ue,ee,$.width,$.height,he.depth,0,$.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else W?G&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,ue,0,0,0,$.width,$.height,he.depth,j,O,$.data):n.texImage3D(t.TEXTURE_2D_ARRAY,ue,ee,$.width,$.height,he.depth,0,j,O,$.data)}else{W&&ne&&n.texStorage2D(t.TEXTURE_2D,ge,ee,V[0].width,V[0].height);for(let ue=0,Te=V.length;ue0){const ue=H2(he.width,he.height,C.format,C.type);for(const Te of C.layerUpdates){const Ne=he.data.subarray(Te*ue/he.data.BYTES_PER_ELEMENT,(Te+1)*ue/he.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,Te,he.width,he.height,1,j,O,Ne)}C.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,he.width,he.height,he.depth,j,O,he.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,ee,he.width,he.height,he.depth,0,j,O,he.data);else if(C.isData3DTexture)W?(ne&&n.texStorage3D(t.TEXTURE_3D,ge,ee,he.width,he.height,he.depth),G&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,he.width,he.height,he.depth,j,O,he.data)):n.texImage3D(t.TEXTURE_3D,0,ee,he.width,he.height,he.depth,0,j,O,he.data);else if(C.isFramebufferTexture){if(ne)if(W)n.texStorage2D(t.TEXTURE_2D,ge,ee,he.width,he.height);else{let ue=he.width,Te=he.height;for(let Ne=0;Ne>=1,Te>>=1}}else if(V.length>0){if(W&&ne){const ue=Se(V[0]);n.texStorage2D(t.TEXTURE_2D,ge,ee,ue.width,ue.height)}for(let ue=0,Te=V.length;ue0&&ge++;const Te=Se(j[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,ge,V,Te.width,Te.height)}for(let Te=0;Te<6;Te++)if(he){W?G&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Te,0,0,0,j[Te].width,j[Te].height,ee,$,j[Te].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Te,0,V,j[Te].width,j[Te].height,0,ee,$,j[Te].data);for(let Ne=0;Ne>pe),j=Math.max(1,C.height>>pe);_e===t.TEXTURE_3D||_e===t.TEXTURE_2D_ARRAY?n.texImage3D(_e,pe,Oe,he,j,C.depth,0,De,Pe,null):n.texImage2D(_e,pe,Oe,he,j,0,De,Pe,null)}n.bindFramebuffer(t.FRAMEBUFFER,N),te(C)?a.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,ae,_e,s.get(Q).__webglTexture,0,ce(C)):(_e===t.TEXTURE_2D||_e>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&_e<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,ae,_e,s.get(Q).__webglTexture,pe),n.bindFramebuffer(t.FRAMEBUFFER,null)}function ke(N,C,Q){if(t.bindRenderbuffer(t.RENDERBUFFER,N),C.depthBuffer){const ae=C.depthTexture,_e=ae&&ae.isDepthTexture?ae.type:null,pe=b(C.stencilBuffer,_e),De=C.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Pe=ce(C);te(C)?a.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Pe,pe,C.width,C.height):Q?t.renderbufferStorageMultisample(t.RENDERBUFFER,Pe,pe,C.width,C.height):t.renderbufferStorage(t.RENDERBUFFER,pe,C.width,C.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,De,t.RENDERBUFFER,N)}else{const ae=C.textures;for(let _e=0;_e1;if(De||(ae.__webglTexture===void 0&&(ae.__webglTexture=t.createTexture()),ae.__version=C.version,o.memory.textures++),pe){Q.__webglFramebuffer=[];for(let Pe=0;Pe<6;Pe++)if(C.mipmaps&&C.mipmaps.length>0){Q.__webglFramebuffer[Pe]=[];for(let Oe=0;Oe0){Q.__webglFramebuffer=[];for(let Pe=0;Pe0&&te(N)===!1){Q.__webglMultisampledFramebuffer=t.createFramebuffer(),Q.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,Q.__webglMultisampledFramebuffer);for(let Pe=0;Pe<_e.length;Pe++){const Oe=_e[Pe];Q.__webglColorRenderbuffer[Pe]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,Q.__webglColorRenderbuffer[Pe]);const Xe=r.convert(Oe.format,Oe.colorSpace),he=r.convert(Oe.type),j=y(Oe.internalFormat,Xe,he,Oe.colorSpace,N.isXRRenderTarget===!0),O=ce(N);t.renderbufferStorageMultisample(t.RENDERBUFFER,O,j,N.width,N.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Pe,t.RENDERBUFFER,Q.__webglColorRenderbuffer[Pe])}t.bindRenderbuffer(t.RENDERBUFFER,null),N.depthBuffer&&(Q.__webglDepthRenderbuffer=t.createRenderbuffer(),ke(Q.__webglDepthRenderbuffer,N,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(pe){n.bindTexture(t.TEXTURE_CUBE_MAP,ae.__webglTexture),de(t.TEXTURE_CUBE_MAP,C);for(let Pe=0;Pe<6;Pe++)if(C.mipmaps&&C.mipmaps.length>0)for(let Oe=0;Oe0)for(let Oe=0;Oe0){if(te(N)===!1){const C=N.textures,Q=N.width,ae=N.height;let _e=t.COLOR_BUFFER_BIT;const pe=N.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,De=s.get(N),Pe=C.length>1;if(Pe)for(let Oe=0;Oe0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&C.__useRenderToTexture!==!1}function we(N){const C=o.render.frame;u.get(N)!==C&&(u.set(N,C),N.update())}function Me(N,C){const Q=N.colorSpace,ae=N.format,_e=N.type;return N.isCompressedTexture===!0||N.isVideoTexture===!0||Q!==kn&&Q!==io&&(Et.getTransfer(Q)===Gt?(ae!==Ns||_e!==br)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",Q)),C}function Se(N){return typeof HTMLImageElement<"u"&&N instanceof HTMLImageElement?(c.width=N.naturalWidth||N.width,c.height=N.naturalHeight||N.height):typeof VideoFrame<"u"&&N instanceof VideoFrame?(c.width=N.displayWidth,c.height=N.displayHeight):(c.width=N.width,c.height=N.height),c}this.allocateTextureUnit=U,this.resetTextureUnits=k,this.setTexture2D=D,this.setTexture2DArray=I,this.setTexture3D=P,this.setTextureCube=B,this.rebindTextures=Ee,this.setupRenderTarget=Ce,this.updateRenderTargetMipmap=Ge,this.updateMultisampleRenderTarget=K,this.setupDepthRenderbuffer=Ae,this.setupFrameBufferTexture=me,this.useMultisampledRTT=te}function lW(t,e){function n(s,i=io){let r;const o=Et.getTransfer(i);if(s===br)return t.UNSIGNED_BYTE;if(s===Iv)return t.UNSIGNED_SHORT_4_4_4_4;if(s===Ov)return t.UNSIGNED_SHORT_5_5_5_1;if(s===XM)return t.UNSIGNED_INT_5_9_9_9_REV;if(s===jM)return t.BYTE;if(s===qM)return t.SHORT;if(s===sd)return t.UNSIGNED_SHORT;if(s===Pv)return t.INT;if(s===Sa)return t.UNSIGNED_INT;if(s===ei)return t.FLOAT;if(s===kd)return t.HALF_FLOAT;if(s===KM)return t.ALPHA;if(s===YM)return t.RGB;if(s===Ns)return t.RGBA;if(s===ZM)return t.LUMINANCE;if(s===JM)return t.LUMINANCE_ALPHA;if(s===Ul)return t.DEPTH_COMPONENT;if(s===ic)return t.DEPTH_STENCIL;if(s===Lv)return t.RED;if(s===Dv)return t.RED_INTEGER;if(s===QM)return t.RG;if(s===Nv)return t.RG_INTEGER;if(s===Uv)return t.RGBA_INTEGER;if(s===gh||s===_h||s===vh||s===yh)if(o===Gt)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(s===gh)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===_h)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===vh)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===yh)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(s===gh)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===_h)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===vh)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===yh)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===s0||s===i0||s===r0||s===o0)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(s===s0)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===i0)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===r0)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===o0)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===a0||s===l0||s===c0)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(s===a0||s===l0)return o===Gt?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(s===c0)return o===Gt?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===u0||s===d0||s===f0||s===h0||s===p0||s===m0||s===g0||s===_0||s===v0||s===y0||s===b0||s===w0||s===x0||s===E0)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(s===u0)return o===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===d0)return o===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===f0)return o===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===h0)return o===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===p0)return o===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===m0)return o===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===g0)return o===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===_0)return o===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===v0)return o===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===y0)return o===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===b0)return o===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===w0)return o===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===x0)return o===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===E0)return o===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===bh||s===S0||s===T0)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(s===bh)return o===Gt?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===S0)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===T0)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===e4||s===A0||s===M0||s===R0)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(s===bh)return r.COMPRESSED_RED_RGTC1_EXT;if(s===A0)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===M0)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===R0)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===sc?t.UNSIGNED_INT_24_8:t[s]!==void 0?t[s]:null}return{convert:n}}class cW extends $n{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class ca extends Kt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const uW={type:"move"};class Pg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ca,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ca,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ie,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ie),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ca,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ie,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ie),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const s of e.hand.values())this._getHandJoint(n,s)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,s){let i=null,r=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const _ of e.hand.values()){const m=n.getJointPose(_,s),g=this._getHandJoint(c,_);m!==null&&(g.matrix.fromArray(m.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=m.radius),g.visible=m!==null}const u=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],f=u.position.distanceTo(d.position),h=.02,v=.005;c.inputState.pinching&&f>h+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=h-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=n.getPose(e.gripSpace,s),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=n.getPose(e.targetRaySpace,s),i===null&&r!==null&&(i=r),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(uW)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const s=new ca;s.matrixAutoUpdate=!1,s.visible=!1,e.joints[n.jointName]=s,e.add(s)}return e.joints[n.jointName]}}const dW=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,fW=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class hW{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n,s){if(this.texture===null){const i=new Sn,r=e.properties.get(i);r.__webglTexture=n.texture,(n.depthNear!=s.depthNear||n.depthFar!=s.depthFar)&&(this.depthNear=n.depthNear,this.depthFar=n.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,s=new bo({vertexShader:dW,fragmentShader:fW,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new fs(new cm(20,20),s)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class pW extends Ac{constructor(e,n){super();const s=this;let i=null,r=1,o=null,a="local-floor",l=1,c=null,u=null,d=null,f=null,h=null,v=null;const _=new hW,m=n.getContextAttributes();let g=null,y=null;const b=[],w=[],T=new yt;let S=null;const A=new $n;A.layers.enable(1),A.viewport=new Lt;const R=new $n;R.layers.enable(2),R.viewport=new Lt;const x=[A,R],E=new cW;E.layers.enable(1),E.layers.enable(2);let k=null,U=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(oe){let me=b[oe];return me===void 0&&(me=new Pg,b[oe]=me),me.getTargetRaySpace()},this.getControllerGrip=function(oe){let me=b[oe];return me===void 0&&(me=new Pg,b[oe]=me),me.getGripSpace()},this.getHand=function(oe){let me=b[oe];return me===void 0&&(me=new Pg,b[oe]=me),me.getHandSpace()};function H(oe){const me=w.indexOf(oe.inputSource);if(me===-1)return;const ke=b[me];ke!==void 0&&(ke.update(oe.inputSource,oe.frame,c||o),ke.dispatchEvent({type:oe.type,data:oe.inputSource}))}function D(){i.removeEventListener("select",H),i.removeEventListener("selectstart",H),i.removeEventListener("selectend",H),i.removeEventListener("squeeze",H),i.removeEventListener("squeezestart",H),i.removeEventListener("squeezeend",H),i.removeEventListener("end",D),i.removeEventListener("inputsourceschange",I);for(let oe=0;oe=0&&(w[J]=null,b[J].disconnect(ke))}for(let me=0;me=w.length){w.push(ke),J=Ee;break}else if(w[Ee]===null){w[Ee]=ke,J=Ee;break}if(J===-1)break}const Ae=b[J];Ae&&Ae.connect(ke)}}const P=new ie,B=new ie;function L(oe,me,ke){P.setFromMatrixPosition(me.matrixWorld),B.setFromMatrixPosition(ke.matrixWorld);const J=P.distanceTo(B),Ae=me.projectionMatrix.elements,Ee=ke.projectionMatrix.elements,Ce=Ae[14]/(Ae[10]-1),Ge=Ae[14]/(Ae[10]+1),M=(Ae[9]+1)/Ae[5],z=(Ae[9]-1)/Ae[5],K=(Ae[8]-1)/Ae[0],ce=(Ee[8]+1)/Ee[0],te=Ce*K,we=Ce*ce,Me=J/(-K+ce),Se=Me*-K;me.matrixWorld.decompose(oe.position,oe.quaternion,oe.scale),oe.translateX(Se),oe.translateZ(Me),oe.matrixWorld.compose(oe.position,oe.quaternion,oe.scale),oe.matrixWorldInverse.copy(oe.matrixWorld).invert();const N=Ce+Me,C=Ge+Me,Q=te-Se,ae=we+(J-Se),_e=M*Ge/C*N,pe=z*Ge/C*N;oe.projectionMatrix.makePerspective(Q,ae,_e,pe,N,C),oe.projectionMatrixInverse.copy(oe.projectionMatrix).invert()}function Y(oe,me){me===null?oe.matrixWorld.copy(oe.matrix):oe.matrixWorld.multiplyMatrices(me.matrixWorld,oe.matrix),oe.matrixWorldInverse.copy(oe.matrixWorld).invert()}this.updateCamera=function(oe){if(i===null)return;_.texture!==null&&(oe.near=_.depthNear,oe.far=_.depthFar),E.near=R.near=A.near=oe.near,E.far=R.far=A.far=oe.far,(k!==E.near||U!==E.far)&&(i.updateRenderState({depthNear:E.near,depthFar:E.far}),k=E.near,U=E.far,A.near=k,A.far=U,R.near=k,R.far=U,A.updateProjectionMatrix(),R.updateProjectionMatrix(),oe.updateProjectionMatrix());const me=oe.parent,ke=E.cameras;Y(E,me);for(let J=0;J0&&(m.alphaTest.value=g.alphaTest);const y=e.get(g),b=y.envMap,w=y.envMapRotation;b&&(m.envMap.value=b,Bo.copy(w),Bo.x*=-1,Bo.y*=-1,Bo.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(Bo.y*=-1,Bo.z*=-1),m.envMapRotation.value.setFromMatrix4(mW.makeRotationFromEuler(Bo)),m.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=g.reflectivity,m.ior.value=g.ior,m.refractionRatio.value=g.refractionRatio),g.lightMap&&(m.lightMap.value=g.lightMap,m.lightMapIntensity.value=g.lightMapIntensity,n(g.lightMap,m.lightMapTransform)),g.aoMap&&(m.aoMap.value=g.aoMap,m.aoMapIntensity.value=g.aoMapIntensity,n(g.aoMap,m.aoMapTransform))}function o(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,g.map&&(m.map.value=g.map,n(g.map,m.mapTransform))}function a(m,g){m.dashSize.value=g.dashSize,m.totalSize.value=g.dashSize+g.gapSize,m.scale.value=g.scale}function l(m,g,y,b){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.size.value=g.size*y,m.scale.value=b*.5,g.map&&(m.map.value=g.map,n(g.map,m.uvTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,n(g.alphaMap,m.alphaMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest)}function c(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.rotation.value=g.rotation,g.map&&(m.map.value=g.map,n(g.map,m.mapTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,n(g.alphaMap,m.alphaMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest)}function u(m,g){m.specular.value.copy(g.specular),m.shininess.value=Math.max(g.shininess,1e-4)}function d(m,g){g.gradientMap&&(m.gradientMap.value=g.gradientMap)}function f(m,g){m.metalness.value=g.metalness,g.metalnessMap&&(m.metalnessMap.value=g.metalnessMap,n(g.metalnessMap,m.metalnessMapTransform)),m.roughness.value=g.roughness,g.roughnessMap&&(m.roughnessMap.value=g.roughnessMap,n(g.roughnessMap,m.roughnessMapTransform)),g.envMap&&(m.envMapIntensity.value=g.envMapIntensity)}function h(m,g,y){m.ior.value=g.ior,g.sheen>0&&(m.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),m.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(m.sheenColorMap.value=g.sheenColorMap,n(g.sheenColorMap,m.sheenColorMapTransform)),g.sheenRoughnessMap&&(m.sheenRoughnessMap.value=g.sheenRoughnessMap,n(g.sheenRoughnessMap,m.sheenRoughnessMapTransform))),g.clearcoat>0&&(m.clearcoat.value=g.clearcoat,m.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(m.clearcoatMap.value=g.clearcoatMap,n(g.clearcoatMap,m.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,n(g.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(m.clearcoatNormalMap.value=g.clearcoatNormalMap,n(g.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===hs&&m.clearcoatNormalScale.value.negate())),g.dispersion>0&&(m.dispersion.value=g.dispersion),g.iridescence>0&&(m.iridescence.value=g.iridescence,m.iridescenceIOR.value=g.iridescenceIOR,m.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(m.iridescenceMap.value=g.iridescenceMap,n(g.iridescenceMap,m.iridescenceMapTransform)),g.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=g.iridescenceThicknessMap,n(g.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),g.transmission>0&&(m.transmission.value=g.transmission,m.transmissionSamplerMap.value=y.texture,m.transmissionSamplerSize.value.set(y.width,y.height),g.transmissionMap&&(m.transmissionMap.value=g.transmissionMap,n(g.transmissionMap,m.transmissionMapTransform)),m.thickness.value=g.thickness,g.thicknessMap&&(m.thicknessMap.value=g.thicknessMap,n(g.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=g.attenuationDistance,m.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(m.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(m.anisotropyMap.value=g.anisotropyMap,n(g.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=g.specularIntensity,m.specularColor.value.copy(g.specularColor),g.specularColorMap&&(m.specularColorMap.value=g.specularColorMap,n(g.specularColorMap,m.specularColorMapTransform)),g.specularIntensityMap&&(m.specularIntensityMap.value=g.specularIntensityMap,n(g.specularIntensityMap,m.specularIntensityMapTransform))}function v(m,g){g.matcap&&(m.matcap.value=g.matcap)}function _(m,g){const y=e.get(g).light;m.referencePosition.value.setFromMatrixPosition(y.matrixWorld),m.nearDistance.value=y.shadow.camera.near,m.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:i}}function _W(t,e,n,s){let i={},r={},o=[];const a=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,b){const w=b.program;s.uniformBlockBinding(y,w)}function c(y,b){let w=i[y.id];w===void 0&&(v(y),w=u(y),i[y.id]=w,y.addEventListener("dispose",m));const T=b.program;s.updateUBOMapping(y,T);const S=e.render.frame;r[y.id]!==S&&(f(y),r[y.id]=S)}function u(y){const b=d();y.__bindingPointIndex=b;const w=t.createBuffer(),T=y.__size,S=y.usage;return t.bindBuffer(t.UNIFORM_BUFFER,w),t.bufferData(t.UNIFORM_BUFFER,T,S),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,b,w),w}function d(){for(let y=0;y0&&(w+=T-S),y.__size=w,y.__cache={},this}function _(y){const b={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(b.boundary=4,b.storage=4):y.isVector2?(b.boundary=8,b.storage=8):y.isVector3||y.isColor?(b.boundary=16,b.storage=12):y.isVector4?(b.boundary=16,b.storage=16):y.isMatrix3?(b.boundary=48,b.storage=48):y.isMatrix4?(b.boundary=64,b.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),b}function m(y){const b=y.target;b.removeEventListener("dispose",m);const w=o.indexOf(b.__bindingPointIndex);o.splice(w,1),t.deleteBuffer(i[b.id]),delete i[b.id],delete r[b.id]}function g(){for(const y in i)t.deleteBuffer(i[y]);o=[],i={},r={}}return{bind:l,update:c,dispose:g}}class G2{constructor(e={}){const{canvas:n=lB(),context:s=null,depth:i=!0,stencil:r=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let f;if(s!==null){if(typeof WebGLRenderingContext<"u"&&s instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=s.getContextAttributes().alpha}else f=o;const h=new Uint32Array(4),v=new Int32Array(4);let _=null,m=null;const g=[],y=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Zn,this.toneMapping=po,this.toneMappingExposure=1;const b=this;let w=!1,T=0,S=0,A=null,R=-1,x=null;const E=new Lt,k=new Lt;let U=null;const H=new ft(0);let D=0,I=n.width,P=n.height,B=1,L=null,Y=null;const q=new Lt(0,0,I,P),de=new Lt(0,0,I,P);let fe=!1;const Re=new Bv;let oe=!1,me=!1;const ke=new mt,J=new ie,Ae=new Lt,Ee={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ce=!1;function Ge(){return A===null?B:1}let M=s;function z(F,se){return n.getContext(F,se)}try{const F={alpha:!0,depth:i,stencil:r,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${kv}`),n.addEventListener("webglcontextlost",ue,!1),n.addEventListener("webglcontextrestored",Te,!1),n.addEventListener("webglcontextcreationerror",Ne,!1),M===null){const se="webgl2";if(M=z(se,F),M===null)throw z(se)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(F){throw console.error("THREE.WebGLRenderer: "+F.message),F}let K,ce,te,we,Me,Se,N,C,Q,ae,_e,pe,De,Pe,Oe,Xe,he,j,O,ee,$,V,W,ne;function G(){K=new Sz(M),K.init(),V=new lW(M,K),ce=new vz(M,K,e,V),te=new rW(M),we=new Mz(M),Me=new WV,Se=new aW(M,K,te,Me,ce,V,we),N=new bz(b),C=new Ez(b),Q=new LB(M),W=new gz(M,Q),ae=new Tz(M,Q,we,W),_e=new Cz(M,ae,Q,we),O=new Rz(M,ce,Se),Xe=new yz(Me),pe=new VV(b,N,C,K,ce,W,Xe),De=new gW(b,Me),Pe=new qV,Oe=new QV(K),j=new mz(b,N,C,te,_e,f,l),he=new iW(b,_e,ce),ne=new _W(M,we,ce,te),ee=new _z(M,K,we),$=new Az(M,K,we),we.programs=pe.programs,b.capabilities=ce,b.extensions=K,b.properties=Me,b.renderLists=Pe,b.shadowMap=he,b.state=te,b.info=we}G();const ge=new pW(b,M);this.xr=ge,this.getContext=function(){return M},this.getContextAttributes=function(){return M.getContextAttributes()},this.forceContextLoss=function(){const F=K.get("WEBGL_lose_context");F&&F.loseContext()},this.forceContextRestore=function(){const F=K.get("WEBGL_lose_context");F&&F.restoreContext()},this.getPixelRatio=function(){return B},this.setPixelRatio=function(F){F!==void 0&&(B=F,this.setSize(I,P,!1))},this.getSize=function(F){return F.set(I,P)},this.setSize=function(F,se,ve=!0){if(ge.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}I=F,P=se,n.width=Math.floor(F*B),n.height=Math.floor(se*B),ve===!0&&(n.style.width=F+"px",n.style.height=se+"px"),this.setViewport(0,0,F,se)},this.getDrawingBufferSize=function(F){return F.set(I*B,P*B).floor()},this.setDrawingBufferSize=function(F,se,ve){I=F,P=se,B=ve,n.width=Math.floor(F*ve),n.height=Math.floor(se*ve),this.setViewport(0,0,F,se)},this.getCurrentViewport=function(F){return F.copy(E)},this.getViewport=function(F){return F.copy(q)},this.setViewport=function(F,se,ve,be){F.isVector4?q.set(F.x,F.y,F.z,F.w):q.set(F,se,ve,be),te.viewport(E.copy(q).multiplyScalar(B).round())},this.getScissor=function(F){return F.copy(de)},this.setScissor=function(F,se,ve,be){F.isVector4?de.set(F.x,F.y,F.z,F.w):de.set(F,se,ve,be),te.scissor(k.copy(de).multiplyScalar(B).round())},this.getScissorTest=function(){return fe},this.setScissorTest=function(F){te.setScissorTest(fe=F)},this.setOpaqueSort=function(F){L=F},this.setTransparentSort=function(F){Y=F},this.getClearColor=function(F){return F.copy(j.getClearColor())},this.setClearColor=function(){j.setClearColor.apply(j,arguments)},this.getClearAlpha=function(){return j.getClearAlpha()},this.setClearAlpha=function(){j.setClearAlpha.apply(j,arguments)},this.clear=function(F=!0,se=!0,ve=!0){let be=0;if(F){let le=!1;if(A!==null){const Fe=A.texture.format;le=Fe===Uv||Fe===Nv||Fe===Dv}if(le){const Fe=A.texture.type,ze=Fe===br||Fe===Sa||Fe===sd||Fe===sc||Fe===Iv||Fe===Ov,je=j.getClearColor(),qe=j.getClearAlpha(),rt=je.r,ot=je.g,st=je.b;ze?(h[0]=rt,h[1]=ot,h[2]=st,h[3]=qe,M.clearBufferuiv(M.COLOR,0,h)):(v[0]=rt,v[1]=ot,v[2]=st,v[3]=qe,M.clearBufferiv(M.COLOR,0,v))}else be|=M.COLOR_BUFFER_BIT}se&&(be|=M.DEPTH_BUFFER_BIT),ve&&(be|=M.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),M.clear(be)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",ue,!1),n.removeEventListener("webglcontextrestored",Te,!1),n.removeEventListener("webglcontextcreationerror",Ne,!1),Pe.dispose(),Oe.dispose(),Me.dispose(),N.dispose(),C.dispose(),_e.dispose(),W.dispose(),ne.dispose(),pe.dispose(),ge.dispose(),ge.removeEventListener("sessionstart",ui),ge.removeEventListener("sessionend",zy),Po.stop()};function ue(F){F.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),w=!0}function Te(){console.log("THREE.WebGLRenderer: Context Restored."),w=!1;const F=we.autoReset,se=he.enabled,ve=he.autoUpdate,be=he.needsUpdate,le=he.type;G(),we.autoReset=F,he.enabled=se,he.autoUpdate=ve,he.needsUpdate=be,he.type=le}function Ne(F){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",F.statusMessage)}function Je(F){const se=F.target;se.removeEventListener("dispose",Je),bt(se)}function bt(F){Zt(F),Me.remove(F)}function Zt(F){const se=Me.get(F).programs;se!==void 0&&(se.forEach(function(ve){pe.releaseProgram(ve)}),F.isShaderMaterial&&pe.releaseShaderCache(F))}this.renderBufferDirect=function(F,se,ve,be,le,Fe){se===null&&(se=Ee);const ze=le.isMesh&&le.matrixWorld.determinant()<0,je=s8(F,se,ve,be,le);te.setMaterial(be,ze);let qe=ve.index,rt=1;if(be.wireframe===!0){if(qe=ae.getWireframeAttribute(ve),qe===void 0)return;rt=2}const ot=ve.drawRange,st=ve.attributes.position;let At=ot.start*rt,nn=(ot.start+ot.count)*rt;Fe!==null&&(At=Math.max(At,Fe.start*rt),nn=Math.min(nn,(Fe.start+Fe.count)*rt)),qe!==null?(At=Math.max(At,0),nn=Math.min(nn,qe.count)):st!=null&&(At=Math.max(At,0),nn=Math.min(nn,st.count));const sn=nn-At;if(sn<0||sn===1/0)return;W.setup(le,be,je,ve,qe);let ms,Mt=ee;if(qe!==null&&(ms=Q.get(qe),Mt=$,Mt.setIndex(ms)),le.isMesh)be.wireframe===!0?(te.setLineWidth(be.wireframeLinewidth*Ge()),Mt.setMode(M.LINES)):Mt.setMode(M.TRIANGLES);else if(le.isLine){let Ze=be.linewidth;Ze===void 0&&(Ze=1),te.setLineWidth(Ze*Ge()),le.isLineSegments?Mt.setMode(M.LINES):le.isLineLoop?Mt.setMode(M.LINE_LOOP):Mt.setMode(M.LINE_STRIP)}else le.isPoints?Mt.setMode(M.POINTS):le.isSprite&&Mt.setMode(M.TRIANGLES);if(le.isBatchedMesh)if(le._multiDrawInstances!==null)Mt.renderMultiDrawInstances(le._multiDrawStarts,le._multiDrawCounts,le._multiDrawCount,le._multiDrawInstances);else if(K.get("WEBGL_multi_draw"))Mt.renderMultiDraw(le._multiDrawStarts,le._multiDrawCounts,le._multiDrawCount);else{const Ze=le._multiDrawStarts,Mn=le._multiDrawCounts,Rt=le._multiDrawCount,Ws=qe?Q.get(qe).bytesPerElement:1,Da=Me.get(be).currentProgram.getUniforms();for(let gs=0;gs{function Fe(){if(be.forEach(function(ze){Me.get(ze).currentProgram.isReady()&&be.delete(ze)}),be.size===0){le(F);return}setTimeout(Fe,10)}K.get("KHR_parallel_shader_compile")!==null?Fe():setTimeout(Fe,10)})};let Tt=null;function Gi(F){Tt&&Tt(F)}function ui(){Po.stop()}function zy(){Po.start()}const Po=new p4;Po.setAnimationLoop(Gi),typeof self<"u"&&Po.setContext(self),this.setAnimationLoop=function(F){Tt=F,ge.setAnimationLoop(F),F===null?Po.stop():Po.start()},ge.addEventListener("sessionstart",ui),ge.addEventListener("sessionend",zy),this.render=function(F,se){if(se!==void 0&&se.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;if(F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),se.parent===null&&se.matrixWorldAutoUpdate===!0&&se.updateMatrixWorld(),ge.enabled===!0&&ge.isPresenting===!0&&(ge.cameraAutoUpdate===!0&&ge.updateCamera(se),se=ge.getCamera()),F.isScene===!0&&F.onBeforeRender(b,F,se,A),m=Oe.get(F,y.length),m.init(se),y.push(m),ke.multiplyMatrices(se.projectionMatrix,se.matrixWorldInverse),Re.setFromProjectionMatrix(ke),me=this.localClippingEnabled,oe=Xe.init(this.clippingPlanes,me),_=Pe.get(F,g.length),_.init(),g.push(_),ge.enabled===!0&&ge.isPresenting===!0){const Fe=b.xr.getDepthSensingMesh();Fe!==null&&Tm(Fe,se,-1/0,b.sortObjects)}Tm(F,se,0,b.sortObjects),_.finish(),b.sortObjects===!0&&_.sort(L,Y),Ce=ge.enabled===!1||ge.isPresenting===!1||ge.hasDepthSensing()===!1,Ce&&j.addToRenderList(_,F),this.info.render.frame++,oe===!0&&Xe.beginShadows();const ve=m.state.shadowsArray;he.render(ve,F,se),oe===!0&&Xe.endShadows(),this.info.autoReset===!0&&this.info.reset();const be=_.opaque,le=_.transmissive;if(m.setupLights(),se.isArrayCamera){const Fe=se.cameras;if(le.length>0)for(let ze=0,je=Fe.length;ze0&&Wy(be,le,F,se),Ce&&j.render(F),Vy(_,F,se);A!==null&&(Se.updateMultisampleRenderTarget(A),Se.updateRenderTargetMipmap(A)),F.isScene===!0&&F.onAfterRender(b,F,se),W.resetDefaultState(),R=-1,x=null,y.pop(),y.length>0?(m=y[y.length-1],oe===!0&&Xe.setGlobalState(b.clippingPlanes,m.state.camera)):m=null,g.pop(),g.length>0?_=g[g.length-1]:_=null};function Tm(F,se,ve,be){if(F.visible===!1)return;if(F.layers.test(se.layers)){if(F.isGroup)ve=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(se);else if(F.isLight)m.pushLight(F),F.castShadow&&m.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||Re.intersectsSprite(F)){be&&Ae.setFromMatrixPosition(F.matrixWorld).applyMatrix4(ke);const ze=_e.update(F),je=F.material;je.visible&&_.push(F,ze,je,ve,Ae.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||Re.intersectsObject(F))){const ze=_e.update(F),je=F.material;if(be&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),Ae.copy(F.boundingSphere.center)):(ze.boundingSphere===null&&ze.computeBoundingSphere(),Ae.copy(ze.boundingSphere.center)),Ae.applyMatrix4(F.matrixWorld).applyMatrix4(ke)),Array.isArray(je)){const qe=ze.groups;for(let rt=0,ot=qe.length;rt0&&Fd(le,se,ve),Fe.length>0&&Fd(Fe,se,ve),ze.length>0&&Fd(ze,se,ve),te.buffers.depth.setTest(!0),te.buffers.depth.setMask(!0),te.buffers.color.setMask(!0),te.setPolygonOffset(!1)}function Wy(F,se,ve,be){if((ve.isScene===!0?ve.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[be.id]===void 0&&(m.state.transmissionRenderTarget[be.id]=new Ta(1,1,{generateMipmaps:!0,type:K.has("EXT_color_buffer_half_float")||K.has("EXT_color_buffer_float")?kd:br,minFilter:dr,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Et.workingColorSpace}));const Fe=m.state.transmissionRenderTarget[be.id],ze=be.viewport||E;Fe.setSize(ze.z,ze.w);const je=b.getRenderTarget();b.setRenderTarget(Fe),b.getClearColor(H),D=b.getClearAlpha(),D<1&&b.setClearColor(16777215,.5),b.clear(),Ce&&j.render(ve);const qe=b.toneMapping;b.toneMapping=po;const rt=be.viewport;if(be.viewport!==void 0&&(be.viewport=void 0),m.setupLightsView(be),oe===!0&&Xe.setGlobalState(b.clippingPlanes,be),Fd(F,ve,be),Se.updateMultisampleRenderTarget(Fe),Se.updateRenderTargetMipmap(Fe),K.has("WEBGL_multisampled_render_to_texture")===!1){let ot=!1;for(let st=0,At=se.length;st0),st=!!ve.morphAttributes.position,At=!!ve.morphAttributes.normal,nn=!!ve.morphAttributes.color;let sn=po;be.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(sn=b.toneMapping);const ms=ve.morphAttributes.position||ve.morphAttributes.normal||ve.morphAttributes.color,Mt=ms!==void 0?ms.length:0,Ze=Me.get(be),Mn=m.state.lights;if(oe===!0&&(me===!0||F!==x)){const Rs=F===x&&be.id===R;Xe.setState(be,F,Rs)}let Rt=!1;be.version===Ze.__version?(Ze.needsLights&&Ze.lightsStateVersion!==Mn.state.version||Ze.outputColorSpace!==je||le.isBatchedMesh&&Ze.batching===!1||!le.isBatchedMesh&&Ze.batching===!0||le.isBatchedMesh&&Ze.batchingColor===!0&&le.colorTexture===null||le.isBatchedMesh&&Ze.batchingColor===!1&&le.colorTexture!==null||le.isInstancedMesh&&Ze.instancing===!1||!le.isInstancedMesh&&Ze.instancing===!0||le.isSkinnedMesh&&Ze.skinning===!1||!le.isSkinnedMesh&&Ze.skinning===!0||le.isInstancedMesh&&Ze.instancingColor===!0&&le.instanceColor===null||le.isInstancedMesh&&Ze.instancingColor===!1&&le.instanceColor!==null||le.isInstancedMesh&&Ze.instancingMorph===!0&&le.morphTexture===null||le.isInstancedMesh&&Ze.instancingMorph===!1&&le.morphTexture!==null||Ze.envMap!==qe||be.fog===!0&&Ze.fog!==Fe||Ze.numClippingPlanes!==void 0&&(Ze.numClippingPlanes!==Xe.numPlanes||Ze.numIntersection!==Xe.numIntersection)||Ze.vertexAlphas!==rt||Ze.vertexTangents!==ot||Ze.morphTargets!==st||Ze.morphNormals!==At||Ze.morphColors!==nn||Ze.toneMapping!==sn||Ze.morphTargetsCount!==Mt)&&(Rt=!0):(Rt=!0,Ze.__version=be.version);let Ws=Ze.currentProgram;Rt===!0&&(Ws=$d(be,se,le));let Da=!1,gs=!1,Am=!1;const dn=Ws.getUniforms(),Pr=Ze.uniforms;if(te.useProgram(Ws.program)&&(Da=!0,gs=!0,Am=!0),be.id!==R&&(R=be.id,gs=!0),Da||x!==F){dn.setValue(M,"projectionMatrix",F.projectionMatrix),dn.setValue(M,"viewMatrix",F.matrixWorldInverse);const Rs=dn.map.cameraPosition;Rs!==void 0&&Rs.setValue(M,J.setFromMatrixPosition(F.matrixWorld)),ce.logarithmicDepthBuffer&&dn.setValue(M,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(be.isMeshPhongMaterial||be.isMeshToonMaterial||be.isMeshLambertMaterial||be.isMeshBasicMaterial||be.isMeshStandardMaterial||be.isShaderMaterial)&&dn.setValue(M,"isOrthographic",F.isOrthographicCamera===!0),x!==F&&(x=F,gs=!0,Am=!0)}if(le.isSkinnedMesh){dn.setOptional(M,le,"bindMatrix"),dn.setOptional(M,le,"bindMatrixInverse");const Rs=le.skeleton;Rs&&(Rs.boneTexture===null&&Rs.computeBoneTexture(),dn.setValue(M,"boneTexture",Rs.boneTexture,Se))}le.isBatchedMesh&&(dn.setOptional(M,le,"batchingTexture"),dn.setValue(M,"batchingTexture",le._matricesTexture,Se),dn.setOptional(M,le,"batchingIdTexture"),dn.setValue(M,"batchingIdTexture",le._indirectTexture,Se),dn.setOptional(M,le,"batchingColorTexture"),le._colorsTexture!==null&&dn.setValue(M,"batchingColorTexture",le._colorsTexture,Se));const Mm=ve.morphAttributes;if((Mm.position!==void 0||Mm.normal!==void 0||Mm.color!==void 0)&&O.update(le,ve,Ws),(gs||Ze.receiveShadow!==le.receiveShadow)&&(Ze.receiveShadow=le.receiveShadow,dn.setValue(M,"receiveShadow",le.receiveShadow)),be.isMeshGouraudMaterial&&be.envMap!==null&&(Pr.envMap.value=qe,Pr.flipEnvMap.value=qe.isCubeTexture&&qe.isRenderTargetTexture===!1?-1:1),be.isMeshStandardMaterial&&be.envMap===null&&se.environment!==null&&(Pr.envMapIntensity.value=se.environmentIntensity),gs&&(dn.setValue(M,"toneMappingExposure",b.toneMappingExposure),Ze.needsLights&&i8(Pr,Am),Fe&&be.fog===!0&&De.refreshFogUniforms(Pr,Fe),De.refreshMaterialUniforms(Pr,be,B,P,m.state.transmissionRenderTarget[F.id]),wh.upload(M,qy(Ze),Pr,Se)),be.isShaderMaterial&&be.uniformsNeedUpdate===!0&&(wh.upload(M,qy(Ze),Pr,Se),be.uniformsNeedUpdate=!1),be.isSpriteMaterial&&dn.setValue(M,"center",le.center),dn.setValue(M,"modelViewMatrix",le.modelViewMatrix),dn.setValue(M,"normalMatrix",le.normalMatrix),dn.setValue(M,"modelMatrix",le.matrixWorld),be.isShaderMaterial||be.isRawShaderMaterial){const Rs=be.uniformsGroups;for(let Rm=0,o8=Rs.length;Rm0&&Se.useMultisampledRTT(F)===!1?le=Me.get(F).__webglMultisampledFramebuffer:Array.isArray(ot)?le=ot[ve]:le=ot,E.copy(F.viewport),k.copy(F.scissor),U=F.scissorTest}else E.copy(q).multiplyScalar(B).floor(),k.copy(de).multiplyScalar(B).floor(),U=fe;if(te.bindFramebuffer(M.FRAMEBUFFER,le)&&be&&te.drawBuffers(F,le),te.viewport(E),te.scissor(k),te.setScissorTest(U),Fe){const qe=Me.get(F.texture);M.framebufferTexture2D(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0,M.TEXTURE_CUBE_MAP_POSITIVE_X+se,qe.__webglTexture,ve)}else if(ze){const qe=Me.get(F.texture),rt=se||0;M.framebufferTextureLayer(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0,qe.__webglTexture,ve||0,rt)}R=-1},this.readRenderTargetPixels=function(F,se,ve,be,le,Fe,ze){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let je=Me.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&ze!==void 0&&(je=je[ze]),je){te.bindFramebuffer(M.FRAMEBUFFER,je);try{const qe=F.texture,rt=qe.format,ot=qe.type;if(!ce.textureFormatReadable(rt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!ce.textureTypeReadable(ot)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}se>=0&&se<=F.width-be&&ve>=0&&ve<=F.height-le&&M.readPixels(se,ve,be,le,V.convert(rt),V.convert(ot),Fe)}finally{const qe=A!==null?Me.get(A).__webglFramebuffer:null;te.bindFramebuffer(M.FRAMEBUFFER,qe)}}},this.readRenderTargetPixelsAsync=async function(F,se,ve,be,le,Fe,ze){if(!(F&&F.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let je=Me.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&ze!==void 0&&(je=je[ze]),je){te.bindFramebuffer(M.FRAMEBUFFER,je);try{const qe=F.texture,rt=qe.format,ot=qe.type;if(!ce.textureFormatReadable(rt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ce.textureTypeReadable(ot))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(se>=0&&se<=F.width-be&&ve>=0&&ve<=F.height-le){const st=M.createBuffer();M.bindBuffer(M.PIXEL_PACK_BUFFER,st),M.bufferData(M.PIXEL_PACK_BUFFER,Fe.byteLength,M.STREAM_READ),M.readPixels(se,ve,be,le,V.convert(rt),V.convert(ot),0),M.flush();const At=M.fenceSync(M.SYNC_GPU_COMMANDS_COMPLETE,0);await cB(M,At,4);try{M.bindBuffer(M.PIXEL_PACK_BUFFER,st),M.getBufferSubData(M.PIXEL_PACK_BUFFER,0,Fe)}finally{M.deleteBuffer(st),M.deleteSync(At)}return Fe}}finally{const qe=A!==null?Me.get(A).__webglFramebuffer:null;te.bindFramebuffer(M.FRAMEBUFFER,qe)}}},this.copyFramebufferToTexture=function(F,se=null,ve=0){F.isTexture!==!0&&(Fl("WebGLRenderer: copyFramebufferToTexture function signature has changed."),se=arguments[0]||null,F=arguments[1]);const be=Math.pow(2,-ve),le=Math.floor(F.image.width*be),Fe=Math.floor(F.image.height*be),ze=se!==null?se.x:0,je=se!==null?se.y:0;Se.setTexture2D(F,0),M.copyTexSubImage2D(M.TEXTURE_2D,ve,0,0,ze,je,le,Fe),te.unbindTexture()},this.copyTextureToTexture=function(F,se,ve=null,be=null,le=0){F.isTexture!==!0&&(Fl("WebGLRenderer: copyTextureToTexture function signature has changed."),be=arguments[0]||null,F=arguments[1],se=arguments[2],le=arguments[3]||0,ve=null);let Fe,ze,je,qe,rt,ot;ve!==null?(Fe=ve.max.x-ve.min.x,ze=ve.max.y-ve.min.y,je=ve.min.x,qe=ve.min.y):(Fe=F.image.width,ze=F.image.height,je=0,qe=0),be!==null?(rt=be.x,ot=be.y):(rt=0,ot=0);const st=V.convert(se.format),At=V.convert(se.type);Se.setTexture2D(se,0),M.pixelStorei(M.UNPACK_FLIP_Y_WEBGL,se.flipY),M.pixelStorei(M.UNPACK_PREMULTIPLY_ALPHA_WEBGL,se.premultiplyAlpha),M.pixelStorei(M.UNPACK_ALIGNMENT,se.unpackAlignment);const nn=M.getParameter(M.UNPACK_ROW_LENGTH),sn=M.getParameter(M.UNPACK_IMAGE_HEIGHT),ms=M.getParameter(M.UNPACK_SKIP_PIXELS),Mt=M.getParameter(M.UNPACK_SKIP_ROWS),Ze=M.getParameter(M.UNPACK_SKIP_IMAGES),Mn=F.isCompressedTexture?F.mipmaps[le]:F.image;M.pixelStorei(M.UNPACK_ROW_LENGTH,Mn.width),M.pixelStorei(M.UNPACK_IMAGE_HEIGHT,Mn.height),M.pixelStorei(M.UNPACK_SKIP_PIXELS,je),M.pixelStorei(M.UNPACK_SKIP_ROWS,qe),F.isDataTexture?M.texSubImage2D(M.TEXTURE_2D,le,rt,ot,Fe,ze,st,At,Mn.data):F.isCompressedTexture?M.compressedTexSubImage2D(M.TEXTURE_2D,le,rt,ot,Mn.width,Mn.height,st,Mn.data):M.texSubImage2D(M.TEXTURE_2D,le,rt,ot,Fe,ze,st,At,Mn),M.pixelStorei(M.UNPACK_ROW_LENGTH,nn),M.pixelStorei(M.UNPACK_IMAGE_HEIGHT,sn),M.pixelStorei(M.UNPACK_SKIP_PIXELS,ms),M.pixelStorei(M.UNPACK_SKIP_ROWS,Mt),M.pixelStorei(M.UNPACK_SKIP_IMAGES,Ze),le===0&&se.generateMipmaps&&M.generateMipmap(M.TEXTURE_2D),te.unbindTexture()},this.copyTextureToTexture3D=function(F,se,ve=null,be=null,le=0){F.isTexture!==!0&&(Fl("WebGLRenderer: copyTextureToTexture3D function signature has changed."),ve=arguments[0]||null,be=arguments[1]||null,F=arguments[2],se=arguments[3],le=arguments[4]||0);let Fe,ze,je,qe,rt,ot,st,At,nn;const sn=F.isCompressedTexture?F.mipmaps[le]:F.image;ve!==null?(Fe=ve.max.x-ve.min.x,ze=ve.max.y-ve.min.y,je=ve.max.z-ve.min.z,qe=ve.min.x,rt=ve.min.y,ot=ve.min.z):(Fe=sn.width,ze=sn.height,je=sn.depth,qe=0,rt=0,ot=0),be!==null?(st=be.x,At=be.y,nn=be.z):(st=0,At=0,nn=0);const ms=V.convert(se.format),Mt=V.convert(se.type);let Ze;if(se.isData3DTexture)Se.setTexture3D(se,0),Ze=M.TEXTURE_3D;else if(se.isDataArrayTexture||se.isCompressedArrayTexture)Se.setTexture2DArray(se,0),Ze=M.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}M.pixelStorei(M.UNPACK_FLIP_Y_WEBGL,se.flipY),M.pixelStorei(M.UNPACK_PREMULTIPLY_ALPHA_WEBGL,se.premultiplyAlpha),M.pixelStorei(M.UNPACK_ALIGNMENT,se.unpackAlignment);const Mn=M.getParameter(M.UNPACK_ROW_LENGTH),Rt=M.getParameter(M.UNPACK_IMAGE_HEIGHT),Ws=M.getParameter(M.UNPACK_SKIP_PIXELS),Da=M.getParameter(M.UNPACK_SKIP_ROWS),gs=M.getParameter(M.UNPACK_SKIP_IMAGES);M.pixelStorei(M.UNPACK_ROW_LENGTH,sn.width),M.pixelStorei(M.UNPACK_IMAGE_HEIGHT,sn.height),M.pixelStorei(M.UNPACK_SKIP_PIXELS,qe),M.pixelStorei(M.UNPACK_SKIP_ROWS,rt),M.pixelStorei(M.UNPACK_SKIP_IMAGES,ot),F.isDataTexture||F.isData3DTexture?M.texSubImage3D(Ze,le,st,At,nn,Fe,ze,je,ms,Mt,sn.data):se.isCompressedArrayTexture?M.compressedTexSubImage3D(Ze,le,st,At,nn,Fe,ze,je,ms,sn.data):M.texSubImage3D(Ze,le,st,At,nn,Fe,ze,je,ms,Mt,sn),M.pixelStorei(M.UNPACK_ROW_LENGTH,Mn),M.pixelStorei(M.UNPACK_IMAGE_HEIGHT,Rt),M.pixelStorei(M.UNPACK_SKIP_PIXELS,Ws),M.pixelStorei(M.UNPACK_SKIP_ROWS,Da),M.pixelStorei(M.UNPACK_SKIP_IMAGES,gs),le===0&&se.generateMipmaps&&M.generateMipmap(Ze),te.unbindTexture()},this.initRenderTarget=function(F){Me.get(F).__webglFramebuffer===void 0&&Se.setupRenderTarget(F)},this.initTexture=function(F){F.isCubeTexture?Se.setTextureCube(F,0):F.isData3DTexture?Se.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?Se.setTexture2DArray(F,0):Se.setTexture2D(F,0),te.unbindTexture()},this.resetState=function(){T=0,S=0,A=null,te.reset(),W.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return fr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=e===Fv?"display-p3":"srgb",n.unpackColorSpace=Et.workingColorSpace===am?"display-p3":"srgb"}}class z2 extends Kt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Ni,this.environmentIntensity=1,this.environmentRotation=new Ni,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class vW{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=k0,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=si()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return Fl("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,s){e*=this.stride,s*=n.stride;for(let i=0,r=this.stride;i0){const i=n[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;rs)return;Lg.applyMatrix4(t.matrixWorld);const l=e.ray.origin.distanceTo(Lg);if(!(le.far))return{distance:l,point:Q2.clone().applyMatrix4(t.matrixWorld),index:i,face:null,faceIndex:null,object:t}}const ex=new ie,tx=new ie;class SW extends Wv{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,s=[];for(let i=0,r=n.count;i0){const i=n[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;ri.far)return;r.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class jv extends Pi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new ft(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ft(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=n4,this.normalScale=new yt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ni,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Bi extends jv{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new yt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Fn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(n){this.ior=(1+.4*n)/(1-.4*n)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new ft(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new ft(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new ft(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function Mf(t,e,n){return!t||!n&&t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function MW(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function RW(t){function e(i,r){return t[i]-t[r]}const n=t.length,s=new Array(n);for(let i=0;i!==n;++i)s[i]=i;return s.sort(e),s}function ix(t,e,n){const s=t.length,i=new t.constructor(s);for(let r=0,o=0;o!==s;++r){const a=n[r]*e;for(let l=0;l!==e;++l)i[o++]=t[a+l]}return i}function S4(t,e,n,s){let i=1,r=t[0];for(;r!==void 0&&r[s]===void 0;)r=t[i++];if(r===void 0)return;let o=r[s];if(o!==void 0)if(Array.isArray(o))do o=r[s],o!==void 0&&(e.push(r.time),n.push.apply(n,o)),r=t[i++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[s],o!==void 0&&(e.push(r.time),o.toArray(n,n.length)),r=t[i++];while(r!==void 0);else do o=r[s],o!==void 0&&(e.push(r.time),n.push(o)),r=t[i++];while(r!==void 0)}class Pd{constructor(e,n,s,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new n.constructor(s),this.sampleValues=n,this.valueSize=s,this.settings=null,this.DefaultSettings_={}}evaluate(e){const n=this.parameterPositions;let s=this._cachedIndex,i=n[s],r=n[s-1];e:{t:{let o;n:{s:if(!(e=r)){const a=n[1];e=r)break t}o=s,s=0;break n}break e}for(;s>>1;en;)--o;if(++o,r!==0||o!==i){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=s.slice(r,o),this.values=this.values.slice(r*a,o*a)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const s=this.times,i=this.values,r=s.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const l=s[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&MW(i))for(let a=0,l=i.length;a!==l;++a){const c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),s=this.getValueSize(),i=this.getInterpolation()===og,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*s,l=o*s,c=0;c!==s;++c)n[l+c]=n[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=n.slice(0,o*s)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),s=this.constructor,i=new s(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}}Hi.prototype.TimeBufferType=Float32Array;Hi.prototype.ValueBufferType=Float32Array;Hi.prototype.DefaultInterpolation=rd;class Cc extends Hi{constructor(e,n,s){super(e,n,s)}}Cc.prototype.ValueTypeName="bool";Cc.prototype.ValueBufferType=Array;Cc.prototype.DefaultInterpolation=id;Cc.prototype.InterpolantFactoryMethodLinear=void 0;Cc.prototype.InterpolantFactoryMethodSmooth=void 0;class T4 extends Hi{}T4.prototype.ValueTypeName="color";class ac extends Hi{}ac.prototype.ValueTypeName="number";class IW extends Pd{constructor(e,n,s,i){super(e,n,s,i)}interpolate_(e,n,s,i){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(s-n)/(i-n);let c=e*a;for(let u=c+a;c!==u;c+=4)Mr.slerpFlat(r,0,o,c-a,o,c,l);return r}}class lc extends Hi{InterpolantFactoryMethodLinear(e){return new IW(this.times,this.values,this.getValueSize(),e)}}lc.prototype.ValueTypeName="quaternion";lc.prototype.InterpolantFactoryMethodSmooth=void 0;class kc extends Hi{constructor(e,n,s){super(e,n,s)}}kc.prototype.ValueTypeName="string";kc.prototype.ValueBufferType=Array;kc.prototype.DefaultInterpolation=id;kc.prototype.InterpolantFactoryMethodLinear=void 0;kc.prototype.InterpolantFactoryMethodSmooth=void 0;class cc extends Hi{}cc.prototype.ValueTypeName="vector";class OW{constructor(e="",n=-1,s=[],i=O$){this.name=e,this.tracks=s,this.duration=n,this.blendMode=i,this.uuid=si(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],s=e.tracks,i=1/(e.fps||1);for(let o=0,a=s.length;o!==a;++o)n.push(DW(s[o]).scale(i));const r=new this(e.name,e.duration,n,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const n=[],s=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=s.length;r!==o;++r)n.push(Hi.toJSON(s[r]));return i}static CreateFromMorphTargetSequence(e,n,s,i){const r=n.length,o=[];for(let a=0;a1){const d=u[1];let f=i[d];f||(i[d]=f=[]),f.push(c)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],n,s));return o}static parseAnimation(e,n){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const s=function(d,f,h,v,_){if(h.length!==0){const m=[],g=[];S4(h,m,g,v),m.length!==0&&_.push(new d(f,m,g))}},i=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let d=0;d{n&&n(r),this.manager.itemEnd(e)},0),r;if(Yi[e]!==void 0){Yi[e].push({onLoad:n,onProgress:s,onError:i});return}Yi[e]=[],Yi[e].push({onLoad:n,onProgress:s,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Yi[e],d=c.body.getReader(),f=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),h=f?parseInt(f):0,v=h!==0;let _=0;const m=new ReadableStream({start(g){y();function y(){d.read().then(({done:b,value:w})=>{if(b)g.close();else{_+=w.byteLength;const T=new ProgressEvent("progress",{lengthComputable:v,loaded:_,total:h});for(let S=0,A=u.length;S{g.error(b)})}}});return new Response(m)}else throw new FW(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const d=/charset="?([^;"\s]*)"?/i.exec(a),f=d&&d[1]?d[1].toLowerCase():void 0,h=new TextDecoder(f);return c.arrayBuffer().then(v=>h.decode(v))}}}).then(c=>{ao.add(e,c);const u=Yi[e];delete Yi[e];for(let d=0,f=u.length;d{const u=Yi[e];if(u===void 0)throw this.manager.itemError(e),c;delete Yi[e];for(let d=0,f=u.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class $W extends Pc{constructor(e){super(e)}load(e,n,s,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=ao.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){n&&n(o),r.manager.itemEnd(e)},0),o;const a=od("img");function l(){u(),ao.add(e,this),n&&n(this),r.manager.itemEnd(e)}function c(d){u(),i&&i(d),r.manager.itemError(e),r.manager.itemEnd(e)}function u(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(e),a.src=e,a}}class BW extends Pc{constructor(e){super(e)}load(e,n,s,i){const r=new Sn,o=new $W(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,n!==void 0&&n(r)},s,i),r}}class dm extends Kt{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new ft(e),this.intensity=n}dispose(){}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,this.groundColor!==void 0&&(n.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(n.object.distance=this.distance),this.angle!==void 0&&(n.object.angle=this.angle),this.decay!==void 0&&(n.object.decay=this.decay),this.penumbra!==void 0&&(n.object.penumbra=this.penumbra),this.shadow!==void 0&&(n.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(n.object.target=this.target.uuid),n}}class HW extends dm{constructor(e,n,s){super(e,s),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Kt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ft(n)}copy(e,n){return super.copy(e,n),this.groundColor.copy(e.groundColor),this}}const Dg=new mt,rx=new ie,ox=new ie;class qv{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new yt(512,512),this.map=null,this.mapPass=null,this.matrix=new mt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Bv,this._frameExtents=new yt(1,1),this._viewportCount=1,this._viewports=[new Lt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,s=this.matrix;rx.setFromMatrixPosition(e.matrixWorld),n.position.copy(rx),ox.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(ox),n.updateMatrixWorld(),Dg.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Dg),s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(Dg)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class GW extends qv{constructor(){super(new $n(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const n=this.camera,s=rc*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=e.distance||n.far;(s!==n.fov||i!==n.aspect||r!==n.far)&&(n.fov=s,n.aspect=i,n.far=r,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class zW extends dm{constructor(e,n,s=0,i=Math.PI/3,r=0,o=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Kt.DEFAULT_UP),this.updateMatrix(),this.target=new Kt,this.distance=s,this.angle=i,this.penumbra=r,this.decay=o,this.map=null,this.shadow=new GW}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const ax=new mt,Yc=new ie,Ng=new ie;class VW extends qv{constructor(){super(new $n(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new yt(4,2),this._viewportCount=6,this._viewports=[new Lt(2,1,1,1),new Lt(0,1,1,1),new Lt(3,1,1,1),new Lt(1,1,1,1),new Lt(3,0,1,1),new Lt(1,0,1,1)],this._cubeDirections=[new ie(1,0,0),new ie(-1,0,0),new ie(0,0,1),new ie(0,0,-1),new ie(0,1,0),new ie(0,-1,0)],this._cubeUps=[new ie(0,1,0),new ie(0,1,0),new ie(0,1,0),new ie(0,1,0),new ie(0,0,1),new ie(0,0,-1)]}updateMatrices(e,n=0){const s=this.camera,i=this.matrix,r=e.distance||s.far;r!==s.far&&(s.far=r,s.updateProjectionMatrix()),Yc.setFromMatrixPosition(e.matrixWorld),s.position.copy(Yc),Ng.copy(s.position),Ng.add(this._cubeDirections[n]),s.up.copy(this._cubeUps[n]),s.lookAt(Ng),s.updateMatrixWorld(),i.makeTranslation(-Yc.x,-Yc.y,-Yc.z),ax.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ax)}}class WW extends dm{constructor(e,n,s=0,i=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=s,this.decay=i,this.shadow=new VW}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class jW extends qv{constructor(){super(new Hv(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class M4 extends dm{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Kt.DEFAULT_UP),this.updateMatrix(),this.target=new Kt,this.shadow=new jW}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Ou{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let n="";for(let s=0,i=e.length;s"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,n,s,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=ao.get(e);if(o!==void 0){if(r.manager.itemStart(e),o.then){o.then(c=>{n&&n(c),r.manager.itemEnd(e)}).catch(c=>{i&&i(c)});return}return setTimeout(function(){n&&n(o),r.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(c){return ao.add(e,c),n&&n(c),r.manager.itemEnd(e),c}).catch(function(c){i&&i(c),ao.remove(e),r.manager.itemError(e),r.manager.itemEnd(e)});ao.add(e,l),r.manager.itemStart(e)}}const Xv="\\[\\]\\.:\\/",XW=new RegExp("["+Xv+"]","g"),Kv="[^"+Xv+"]",KW="[^"+Xv.replace("\\.","")+"]",YW=/((?:WC+[\/:])*)/.source.replace("WC",Kv),ZW=/(WCOD+)?/.source.replace("WCOD",KW),JW=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Kv),QW=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Kv),ej=new RegExp("^"+YW+ZW+JW+QW+"$"),tj=["material","materials","bones","map"];class nj{constructor(e,n,s){const i=s||It.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();const s=this._targetGroup.nCachedObjects_,i=this._bindings[s];i!==void 0&&i.getValue(e,n)}setValue(e,n){const s=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=s.length;i!==r;++i)s[i].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,s=e.length;n!==s;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,s=e.length;n!==s;++n)e[n].unbind()}}class It{constructor(e,n,s){this.path=n,this.parsedPath=s||It.parseTrackName(n),this.node=It.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,s){return e&&e.isAnimationObjectGroup?new It.Composite(e,n,s):new It(e,n,s)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(XW,"")}static parseTrackName(e){const n=ej.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const s={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=s.nodeName&&s.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const r=s.nodeName.substring(i+1);tj.indexOf(r)!==-1&&(s.nodeName=s.nodeName.substring(0,i),s.objectName=r)}if(s.propertyName===null||s.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return s}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const s=e.skeleton.getBoneByName(n);if(s!==void 0)return s}if(e.children){const s=function(r){for(let o=0;o=2.0 are supported."));return}const c=new Nj(r,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(s,i)}parseAsync(e,n){const s=this;return new Promise(function(i,r){s.parse(e,n,i,r)})}}function ij(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const vt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class rj{constructor(e){this.parser=e,this.name=vt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let s=0,i=n.length;s=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,r.source,o)}}class yj{constructor(e){this.parser=e,this.name=vt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const n=this.name,s=this.parser,i=s.json,r=i.textures[e];if(!r.extensions||!r.extensions[n])return null;const o=r.extensions[n],a=i.images[o.source];let l=s.textureLoader;if(a.uri){const c=s.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return s.loadTextureImage(e,o.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class bj{constructor(e){this.parser=e,this.name=vt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const n=this.name,s=this.parser,i=s.json,r=i.textures[e];if(!r.extensions||!r.extensions[n])return null;const o=r.extensions[n],a=i.images[o.source];let l=s.textureLoader;if(a.uri){const c=s.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return s.loadTextureImage(e,o.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class wj{constructor(e){this.name=vt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,s=n.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const i=s.extensions[this.name],r=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){const l=i.byteOffset||0,c=i.byteLength||0,u=i.count,d=i.byteStride,f=new Uint8Array(a,l,c);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(u,d,f,i.mode,i.filter).then(function(h){return h.buffer}):o.ready.then(function(){const h=new ArrayBuffer(u*d);return o.decodeGltfBuffer(new Uint8Array(h),u,d,f,i.mode,i.filter),h})})}else return null}}class xj{constructor(e){this.name=vt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,s=n.nodes[e];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const i=n.meshes[s.mesh];for(const c of i.primitives)if(c.mode!==Ls.TRIANGLES&&c.mode!==Ls.TRIANGLE_STRIP&&c.mode!==Ls.TRIANGLE_FAN&&c.mode!==void 0)return null;const o=s.extensions[this.name].attributes,a=[],l={};for(const c in o)a.push(this.parser.getDependency("accessor",o[c]).then(u=>(l[c]=u,l[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(c=>{const u=c.pop(),d=u.isGroup?u.children:[u],f=c[0].count,h=[];for(const v of d){const _=new mt,m=new ie,g=new Mr,y=new ie(1,1,1),b=new EW(v.geometry,v.material,f);for(let w=0;w0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const Dj=new mt;class Nj{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new ij,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let s=!1,i=-1,r=!1,o=-1;if(typeof navigator<"u"){const a=navigator.userAgent;s=/^((?!chrome|android).)*safari/i.test(a)===!0;const l=a.match(/Version\/(\d+)/);i=s&&l?parseInt(l[1],10):-1,r=a.indexOf("Firefox")>-1,o=r?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||s&&i<17||r&&o<98?this.textureLoader=new BW(this.options.manager):this.textureLoader=new qW(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new A4(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const s=this,i=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(o){const a={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:s,userData:{}};return Ho(r,a,i),sr(a,i),Promise.all(s._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],s=this.json.meshes||[];for(let i=0,r=n.length;i{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[c,u]of o.children.entries())r(u,a.children[c])};return r(s,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let s=0;s=2&&m.setY(x,S[A*l+1]),l>=3&&m.setZ(x,S[A*l+2]),l>=4&&m.setW(x,S[A*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return m})}loadTexture(e){const n=this.json,s=this.options,r=n.textures[e].source,o=n.images[r];let a=this.textureLoader;if(o.uri){const l=s.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,n,s){const i=this,r=this.json,o=r.textures[e],a=r.images[n],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(n,s).then(function(u){u.flipY=!1,u.name=o.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const f=(r.samplers||{})[o.sampler]||{};return u.magFilter=ux[f.magFilter]||Ss,u.minFilter=ux[f.minFilter]||dr,u.wrapS=dx[f.wrapS]||nc,u.wrapT=dx[f.wrapT]||nc,i.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,n){const s=this,i=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const o=i.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",c=!1;if(o.bufferView!==void 0)l=s.getDependency("bufferView",o.bufferView).then(function(d){c=!0;const f=new Blob([d],{type:o.mimeType});return l=a.createObjectURL(f),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then(function(d){return new Promise(function(f,h){let v=f;n.isImageBitmapLoader===!0&&(v=function(_){const m=new Sn(_);m.needsUpdate=!0,f(m)}),n.load(Ou.resolveURL(d,r.path),v,void 0,h)})}).then(function(d){return c===!0&&a.revokeObjectURL(l),sr(d,o),d.userData.mimeType=o.mimeType||Lj(o.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=u,u}assignTexture(e,n,s,i){const r=this;return this.getDependency("texture",s.index).then(function(o){if(!o)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(o=o.clone(),o.channel=s.texCoord),r.extensions[vt.KHR_TEXTURE_TRANSFORM]){const a=s.extensions!==void 0?s.extensions[vt.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=r.associations.get(o);o=r.extensions[vt.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,l)}}return i!==void 0&&(o.colorSpace=i),e[n]=o,o})}assignFinalMaterial(e){const n=e.geometry;let s=e.material;const i=n.attributes.tangent===void 0,r=n.attributes.color!==void 0,o=n.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+s.uuid;let l=this.cache.get(a);l||(l=new E4,Pi.prototype.copy.call(l,s),l.color.copy(s.color),l.map=s.map,l.sizeAttenuation=!1,this.cache.add(a,l)),s=l}else if(e.isLine){const a="LineBasicMaterial:"+s.uuid;let l=this.cache.get(a);l||(l=new x4,Pi.prototype.copy.call(l,s),l.color.copy(s.color),l.map=s.map,this.cache.add(a,l)),s=l}if(i||r||o){let a="ClonedMaterial:"+s.uuid+":";i&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=s.clone(),r&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(s))),s=l}e.material=s}getMaterialType(){return jv}loadMaterial(e){const n=this,s=this.json,i=this.extensions,r=s.materials[e];let o;const a={},l=r.extensions||{},c=[];if(l[vt.KHR_MATERIALS_UNLIT]){const d=i[vt.KHR_MATERIALS_UNLIT];o=d.getMaterialType(),c.push(d.extendParams(a,r,n))}else{const d=r.pbrMetallicRoughness||{};if(a.color=new ft(1,1,1),a.opacity=1,Array.isArray(d.baseColorFactor)){const f=d.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],kn),a.opacity=f[3]}d.baseColorTexture!==void 0&&c.push(n.assignTexture(a,"map",d.baseColorTexture,Zn)),a.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,a.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(c.push(n.assignTexture(a,"metalnessMap",d.metallicRoughnessTexture)),c.push(n.assignTexture(a,"roughnessMap",d.metallicRoughnessTexture))),o=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,a)})))}r.doubleSided===!0&&(a.side=xi);const u=r.alphaMode||Fg.OPAQUE;if(u===Fg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===Fg.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==oo&&(c.push(n.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new yt(1,1),r.normalTexture.scale!==void 0)){const d=r.normalTexture.scale;a.normalScale.set(d,d)}if(r.occlusionTexture!==void 0&&o!==oo&&(c.push(n.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==oo){const d=r.emissiveFactor;a.emissive=new ft().setRGB(d[0],d[1],d[2],kn)}return r.emissiveTexture!==void 0&&o!==oo&&c.push(n.assignTexture(a,"emissiveMap",r.emissiveTexture,Zn)),Promise.all(c).then(function(){const d=new o(a);return r.name&&(d.name=r.name),sr(d,r),n.associations.set(d,{materials:e}),r.extensions&&Ho(i,d,r),d})}createUniqueName(e){const n=It.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,s=this.extensions,i=this.primitiveCache;function r(a){return s[vt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,n).then(function(l){return fx(l,a,n)})}const o=[];for(let a=0,l=e.length;a0&&Ij(g,r),g.name=n.createUniqueName(r.name||"mesh_"+e),sr(g,r),m.extensions&&Ho(i,g,m),n.assignFinalMaterial(g),d.push(g)}for(let h=0,v=d.length;h1?u=new ca:c.length===1?u=c[0]:u=new Kt,u!==c[0])for(let d=0,f=c.length;d{const d=new Map;for(const[f,h]of i.associations)(f instanceof Pi||f instanceof Sn)&&d.set(f,h);return u.traverse(f=>{const h=i.associations.get(f);h!=null&&d.set(f,h)}),d};return i.associations=c(r),r})}_createAnimationTracks(e,n,s,i,r){const o=[],a=e.name?e.name:e.uuid,l=[];Br[r.path]===Br.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(a);let c;switch(Br[r.path]){case Br.weights:c=ac;break;case Br.rotation:c=lc;break;case Br.position:case Br.scale:c=cc;break;default:switch(s.itemSize){case 1:c=ac;break;case 2:case 3:default:c=cc;break}break}const u=i.interpolation!==void 0?Cj[i.interpolation]:rd,d=this._getArrayFromAccessor(s);for(let f=0,h=l.length;ft.root.cal_imu())},{default:tt(()=>e[1]||(e[1]=[ye(" calibrate ")])),_:1})]),e[3]||(e[3]=p("div",{class:"card-content"},[p("div",{class:"content"},[p("div",{id:"container",style:{height:"30vh",width:"100%"}}),p("small",{class:"float-right"},"Model: TKS GT20 by Tarkusx")])],-1))])}const k4=lt(Fj,[["render",Hj]]),Gj=nt({name:"Home",components:{Motor:R9,Voltage:PU,Serial:tF,VTX:XF,GyroModel:k4},setup(){return{profile:Dt()}}}),zj={class:"columns is-multiline"},Vj={class:"column is-12"},Wj={class:"column is-12"},jj={class:"columns"},qj={class:"column is-6"},Xj={class:"column is-6"},Kj={class:"columns"},Yj={class:"column is-12"};function Zj(t,e,n,s,i,r){const o=Ie("GyroModel"),a=Ie("Motor"),l=Ie("Voltage"),c=Ie("Serial"),u=Ie("VTX");return Z(),re(it,null,[p("div",zj,[p("div",Vj,[X(o)]),p("div",Wj,[X(a)])]),p("div",jj,[p("div",qj,[X(l)]),p("div",Xj,[X(c)])]),p("div",Kj,[p("div",Yj,[t.profile.serial.smart_audio!=0||t.profile.serial.hdzero!=0?(Z(),Bt(u,{key:0})):He("",!0)])])],64)}const Jj=lt(Gj,[["render",Zj]]);/*! + * @kurkle/color v0.3.4 + * https://github.com/kurkle/color#readme + * (c) 2024 Jukka Kurkela + * Released under the MIT License + */function Id(t){return t+.5|0}const lo=(t,e,n)=>Math.max(Math.min(t,n),e);function mu(t){return lo(Id(t*2.55),0,255)}function mo(t){return lo(Id(t*255),0,255)}function rr(t){return lo(Id(t/2.55)/100,0,1)}function hx(t){return lo(Id(t*100),0,100)}const Ps={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},N0=[..."0123456789ABCDEF"],Qj=t=>N0[t&15],eq=t=>N0[(t&240)>>4]+N0[t&15],Rf=t=>(t&240)>>4===(t&15),tq=t=>Rf(t.r)&&Rf(t.g)&&Rf(t.b)&&Rf(t.a);function nq(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&Ps[t[1]]*17,g:255&Ps[t[2]]*17,b:255&Ps[t[3]]*17,a:e===5?Ps[t[4]]*17:255}:(e===7||e===9)&&(n={r:Ps[t[1]]<<4|Ps[t[2]],g:Ps[t[3]]<<4|Ps[t[4]],b:Ps[t[5]]<<4|Ps[t[6]],a:e===9?Ps[t[7]]<<4|Ps[t[8]]:255})),n}const sq=(t,e)=>t<255?e(t):"";function iq(t){var e=tq(t)?Qj:eq;return t?"#"+e(t.r)+e(t.g)+e(t.b)+sq(t.a,e):void 0}const rq=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function P4(t,e,n){const s=e*Math.min(n,1-n),i=(r,o=(r+t/30)%12)=>n-s*Math.max(Math.min(o-3,9-o,1),-1);return[i(0),i(8),i(4)]}function oq(t,e,n){const s=(i,r=(i+t/60)%6)=>n-n*e*Math.max(Math.min(r,4-r,1),0);return[s(5),s(3),s(1)]}function aq(t,e,n){const s=P4(t,1,.5);let i;for(e+n>1&&(i=1/(e+n),e*=i,n*=i),i=0;i<3;i++)s[i]*=1-e-n,s[i]+=e;return s}function lq(t,e,n,s,i){return t===i?(e-n)/s+(e.5?u/(2-r-o):u/(r+o),l=lq(n,s,i,u,r),l=l*60+.5),[l|0,c||0,a]}function Zv(t,e,n,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,s)).map(mo)}function Jv(t,e,n){return Zv(P4,t,e,n)}function cq(t,e,n){return Zv(aq,t,e,n)}function uq(t,e,n){return Zv(oq,t,e,n)}function I4(t){return(t%360+360)%360}function dq(t){const e=rq.exec(t);let n=255,s;if(!e)return;e[5]!==s&&(n=e[6]?mu(+e[5]):mo(+e[5]));const i=I4(+e[2]),r=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?s=cq(i,r,o):e[1]==="hsv"?s=uq(i,r,o):s=Jv(i,r,o),{r:s[0],g:s[1],b:s[2],a:n}}function fq(t,e){var n=Yv(t);n[0]=I4(n[0]+e),n=Jv(n),t.r=n[0],t.g=n[1],t.b=n[2]}function hq(t){if(!t)return;const e=Yv(t),n=e[0],s=hx(e[1]),i=hx(e[2]);return t.a<255?`hsla(${n}, ${s}%, ${i}%, ${rr(t.a)})`:`hsl(${n}, ${s}%, ${i}%)`}const px={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},mx={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function pq(){const t={},e=Object.keys(mx),n=Object.keys(px);let s,i,r,o,a;for(s=0;s>16&255,r>>8&255,r&255]}return t}let Cf;function mq(t){Cf||(Cf=pq(),Cf.transparent=[0,0,0,0]);const e=Cf[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const gq=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function _q(t){const e=gq.exec(t);let n=255,s,i,r;if(e){if(e[7]!==s){const o=+e[7];n=e[8]?mu(o):lo(o*255,0,255)}return s=+e[1],i=+e[3],r=+e[5],s=255&(e[2]?mu(s):lo(s,0,255)),i=255&(e[4]?mu(i):lo(i,0,255)),r=255&(e[6]?mu(r):lo(r,0,255)),{r:s,g:i,b:r,a:n}}}function vq(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${rr(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Bg=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,ol=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function yq(t,e,n){const s=ol(rr(t.r)),i=ol(rr(t.g)),r=ol(rr(t.b));return{r:mo(Bg(s+n*(ol(rr(e.r))-s))),g:mo(Bg(i+n*(ol(rr(e.g))-i))),b:mo(Bg(r+n*(ol(rr(e.b))-r))),a:t.a+n*(e.a-t.a)}}function kf(t,e,n){if(t){let s=Yv(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*n,e===0?360:1)),s=Jv(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function O4(t,e){return t&&Object.assign(e||{},t)}function gx(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=mo(t[3]))):(e=O4(t,{r:0,g:0,b:0,a:1}),e.a=mo(e.a)),e}function bq(t){return t.charAt(0)==="r"?_q(t):dq(t)}class ad{constructor(e){if(e instanceof ad)return e;const n=typeof e;let s;n==="object"?s=gx(e):n==="string"&&(s=nq(e)||mq(e)||bq(e)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var e=O4(this._rgb);return e&&(e.a=rr(e.a)),e}set rgb(e){this._rgb=gx(e)}rgbString(){return this._valid?vq(this._rgb):void 0}hexString(){return this._valid?iq(this._rgb):void 0}hslString(){return this._valid?hq(this._rgb):void 0}mix(e,n){if(e){const s=this.rgb,i=e.rgb;let r;const o=n===r?.5:n,a=2*o-1,l=s.a-i.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,s.r=255&c*s.r+r*i.r+.5,s.g=255&c*s.g+r*i.g+.5,s.b=255&c*s.b+r*i.b+.5,s.a=o*s.a+(1-o)*i.a,this.rgb=s}return this}interpolate(e,n){return e&&(this._rgb=yq(this._rgb,e._rgb,n)),this}clone(){return new ad(this.rgb)}alpha(e){return this._rgb.a=mo(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=Id(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return kf(this._rgb,2,e),this}darken(e){return kf(this._rgb,2,-e),this}saturate(e){return kf(this._rgb,1,e),this}desaturate(e){return kf(this._rgb,1,-e),this}rotate(e){return fq(this._rgb,e),this}}/*! + * Chart.js v4.4.7 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */function Zi(){}const wq=(()=>{let t=0;return()=>t++})();function Qt(t){return t==null}function En(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function St(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function zs(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function fi(t,e){return zs(t)?t:e}function wt(t,e){return typeof t>"u"?e:t}const xq=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Vt(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function Ot(t,e,n,s){let i,r,o;if(En(t))for(r=t.length,i=0;it,x:t=>t.x,y:t=>t.y};function Tq(t){const e=t.split("."),n=[];let s="";for(const i of e)s+=i,s.endsWith("\\")?s=s.slice(0,-1)+".":(n.push(s),s="");return n}function Aq(t){const e=Tq(t);return n=>{for(const s of e){if(s==="")break;n=n&&n[s]}return n}}function op(t,e){return(_x[e]||(_x[e]=Aq(e)))(t)}function Qv(t){return t.charAt(0).toUpperCase()+t.slice(1)}const ap=t=>typeof t<"u",wo=t=>typeof t=="function",vx=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function Mq(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Tn=Math.PI,Ii=2*Tn,Rq=Ii+Tn,lp=Number.POSITIVE_INFINITY,Cq=Tn/180,ti=Tn/2,Go=Tn/4,yx=Tn*2/3,U0=Math.log10,uc=Math.sign;function Du(t,e,n){return Math.abs(t-e)i-r).pop(),e}function dc(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Pq(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function Iq(t,e,n){let s,i,r;for(s=0,i=t.length;sl&&c=Math.min(e,n)-s&&t<=Math.max(e,n)+s}function ey(t,e,n){n=n||(o=>t[o]1;)r=i+s>>1,n(r)?i=r:s=r;return{lo:i,hi:s}}const da=(t,e,n,s)=>ey(t,n,s?i=>{const r=t[i][e];return rt[i][e]ey(t,n,s=>t[s][e]>=n);function Fq(t,e,n){let s=0,i=t.length;for(;ss&&t[i-1]>n;)i--;return s>0||i{const s="_onData"+Qv(n),i=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...r){const o=i.apply(this,r);return t._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...r)}),o}})})}function xx(t,e){const n=t._chartjs;if(!n)return;const s=n.listeners,i=s.indexOf(e);i!==-1&&s.splice(i,1),!(s.length>0)&&(N4.forEach(r=>{delete t[r]}),delete t._chartjs)}function Bq(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const U4=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function F4(t,e){let n=[],s=!1;return function(...i){n=i,s||(s=!0,U4.call(window,()=>{s=!1,t.apply(e,n)}))}}function Hq(t,e){let n;return function(...s){return e?(clearTimeout(n),n=setTimeout(t,e,s)):t.apply(this,s),e}}const ty=t=>t==="start"?"left":t==="end"?"right":"center",Ln=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,Gq=(t,e,n,s)=>t===(s?"left":"right")?n:t==="center"?(e+n)/2:e;function $4(t,e,n){const s=e.length;let i=0,r=s;if(t._sorted){const{iScale:o,_parsed:a}=t,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:f}=o.getUserBounds();d&&(i=Us(Math.min(da(a,l,c).lo,n?s:da(e,l,o.getPixelForValue(c)).lo),0,s-1)),f?r=Us(Math.max(da(a,o.axis,u,!0).hi+1,n?0:da(e,l,o.getPixelForValue(u),!0).hi+1),i,s)-i:r=s-i}return{start:i,count:r}}function B4(t){const{xScale:e,yScale:n,_scaleRanges:s}=t,i={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!s)return t._scaleRanges=i,!0;const r=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==n.min||s.ymax!==n.max;return Object.assign(s,i),r}const Pf=t=>t===0||t===1,Ex=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*Ii/n)),Sx=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*Ii/n)+1,Nu={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*ti)+1,easeOutSine:t=>Math.sin(t*ti),easeInOutSine:t=>-.5*(Math.cos(Tn*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Pf(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Pf(t)?t:Ex(t,.075,.3),easeOutElastic:t=>Pf(t)?t:Sx(t,.075,.3),easeInOutElastic(t){return Pf(t)?t:t<.5?.5*Ex(t*2,.1125,.45):.5+.5*Sx(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-Nu.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Nu.easeInBounce(t*2)*.5:Nu.easeOutBounce(t*2-1)*.5+.5};function ny(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Tx(t){return ny(t)?t:new ad(t)}function Hg(t){return ny(t)?t:new ad(t).saturate(.5).darken(.1).hexString()}const zq=["x","y","borderWidth","radius","tension"],Vq=["color","borderColor","backgroundColor"];function Wq(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:Vq},numbers:{type:"number",properties:zq}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function jq(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ax=new Map;function qq(t,e){e=e||{};const n=t+JSON.stringify(e);let s=Ax.get(n);return s||(s=new Intl.NumberFormat(t,e),Ax.set(n,s)),s}function H4(t,e,n){return qq(e,n).format(t)}const G4={values(t){return En(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const s=this.chart.options.locale;let i,r=t;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),r=Xq(t,n)}const o=U0(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),H4(t,s,l)},logarithmic(t,e,n){if(t===0)return"0";const s=n[e].significand||t/Math.pow(10,Math.floor(U0(t)));return[1,2,3,5,10,15].includes(s)||e>.8*n.length?G4.numeric.call(this,t,e,n):""}};function Xq(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var z4={formatters:G4};function Kq(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:z4.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Aa=Object.create(null),$0=Object.create(null);function Uu(t,e){if(!e)return t;const n=e.split(".");for(let s=0,i=n.length;ss.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,i)=>Hg(i.backgroundColor),this.hoverBorderColor=(s,i)=>Hg(i.borderColor),this.hoverColor=(s,i)=>Hg(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(n)}set(e,n){return Gg(this,e,n)}get(e){return Uu(this,e)}describe(e,n){return Gg($0,e,n)}override(e,n){return Gg(Aa,e,n)}route(e,n,s,i){const r=Uu(this,e),o=Uu(this,s),a="_"+n;Object.defineProperties(r,{[a]:{value:r[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[i];return St(l)?Object.assign({},c,l):wt(l,c)},set(l){this[a]=l}}})}apply(e){e.forEach(n=>n(this))}}var cn=new Yq({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Wq,jq,Kq]);function Zq(t){return!t||Qt(t.size)||Qt(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Mx(t,e,n,s,i){let r=e[i];return r||(r=e[i]=t.measureText(i).width,n.push(i)),r>s&&(s=r),s}function zo(t,e,n){const s=t.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((e-i)*s)/s+i}function Rx(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function B0(t,e,n,s){V4(t,e,n,s,null)}function V4(t,e,n,s,i){let r,o,a,l,c,u,d,f;const h=e.pointStyle,v=e.rotation,_=e.radius;let m=(v||0)*Cq;if(h&&typeof h=="object"&&(r=h.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){t.save(),t.translate(n,s),t.rotate(m),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),t.restore();return}if(!(isNaN(_)||_<=0)){switch(t.beginPath(),h){default:i?t.ellipse(n,s,i/2,_,0,0,Ii):t.arc(n,s,_,0,Ii),t.closePath();break;case"triangle":u=i?i/2:_,t.moveTo(n+Math.sin(m)*u,s-Math.cos(m)*_),m+=yx,t.lineTo(n+Math.sin(m)*u,s-Math.cos(m)*_),m+=yx,t.lineTo(n+Math.sin(m)*u,s-Math.cos(m)*_),t.closePath();break;case"rectRounded":c=_*.516,l=_-c,o=Math.cos(m+Go)*l,d=Math.cos(m+Go)*(i?i/2-c:l),a=Math.sin(m+Go)*l,f=Math.sin(m+Go)*(i?i/2-c:l),t.arc(n-d,s-a,c,m-Tn,m-ti),t.arc(n+f,s-o,c,m-ti,m),t.arc(n+d,s+a,c,m,m+ti),t.arc(n-f,s+o,c,m+ti,m+Tn),t.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*_,u=i?i/2:l,t.rect(n-u,s-l,2*u,2*l);break}m+=Go;case"rectRot":d=Math.cos(m)*(i?i/2:_),o=Math.cos(m)*_,a=Math.sin(m)*_,f=Math.sin(m)*(i?i/2:_),t.moveTo(n-d,s-a),t.lineTo(n+f,s-o),t.lineTo(n+d,s+a),t.lineTo(n-f,s+o),t.closePath();break;case"crossRot":m+=Go;case"cross":d=Math.cos(m)*(i?i/2:_),o=Math.cos(m)*_,a=Math.sin(m)*_,f=Math.sin(m)*(i?i/2:_),t.moveTo(n-d,s-a),t.lineTo(n+d,s+a),t.moveTo(n+f,s-o),t.lineTo(n-f,s+o);break;case"star":d=Math.cos(m)*(i?i/2:_),o=Math.cos(m)*_,a=Math.sin(m)*_,f=Math.sin(m)*(i?i/2:_),t.moveTo(n-d,s-a),t.lineTo(n+d,s+a),t.moveTo(n+f,s-o),t.lineTo(n-f,s+o),m+=Go,d=Math.cos(m)*(i?i/2:_),o=Math.cos(m)*_,a=Math.sin(m)*_,f=Math.sin(m)*(i?i/2:_),t.moveTo(n-d,s-a),t.lineTo(n+d,s+a),t.moveTo(n+f,s-o),t.lineTo(n-f,s+o);break;case"line":o=i?i/2:Math.cos(m)*_,a=Math.sin(m)*_,t.moveTo(n-o,s-a),t.lineTo(n+o,s+a);break;case"dash":t.moveTo(n,s),t.lineTo(n+Math.cos(m)*(i?i/2:_),s+Math.sin(m)*_);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function cd(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.xe.top-n&&t.y0&&r.strokeColor!=="";let l,c;for(t.save(),t.font=i.string,eX(t,r),l=0;l+t||0;function W4(t,e){const n={},s=St(e),i=s?Object.keys(e):e,r=St(t)?s?o=>wt(t[o],t[e[o]]):o=>t[o]:()=>t;for(const o of i)n[o]=oX(r(o));return n}function aX(t){return W4(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Fu(t){return W4(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Vs(t){const e=aX(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Hn(t,e){t=t||{},e=e||cn.font;let n=wt(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let s=wt(t.style,e.style);s&&!(""+s).match(iX)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const i={family:wt(t.family,e.family),lineHeight:rX(wt(t.lineHeight,e.lineHeight),n),size:n,style:s,weight:wt(t.weight,e.weight),string:""};return i.string=Zq(i),i}function If(t,e,n,s){let i,r,o;for(i=0,r=t.length;in&&a===0?0:a+l;return{min:o(s,-Math.abs(r)),max:o(i,r)}}function Oa(t,e){return Object.assign(Object.create(t),e)}function ry(t,e=[""],n,s,i=()=>t[0]){const r=n||t;typeof s>"u"&&(s=K4("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:r,_fallback:s,_getTarget:i,override:a=>ry([a,...t],e,r,s)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete t[0][l],!0},get(a,l){return q4(a,l,()=>gX(l,e,t,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,l){return kx(a).includes(l)},ownKeys(a){return kx(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function fc(t,e,n,s){const i={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:j4(t,s),setContext:r=>fc(t,r,n,s),override:r=>fc(t.override(r),e,n,s)};return new Proxy(i,{deleteProperty(r,o){return delete r[o],delete t[o],!0},get(r,o,a){return q4(r,o,()=>uX(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(t,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,o)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(r,o){return Reflect.has(t,o)},ownKeys(){return Reflect.ownKeys(t)},set(r,o,a){return t[o]=a,delete r[o],!0}})}function j4(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:s=e.indexable,_allKeys:i=e.allKeys}=t;return{allKeys:i,scriptable:n,indexable:s,isScriptable:wo(n)?n:()=>n,isIndexable:wo(s)?s:()=>s}}const cX=(t,e)=>t?t+Qv(e):e,oy=(t,e)=>St(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function q4(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const s=n();return t[e]=s,s}function uX(t,e,n){const{_proxy:s,_context:i,_subProxy:r,_descriptors:o}=t;let a=s[e];return wo(a)&&o.isScriptable(e)&&(a=dX(e,a,t,n)),En(a)&&a.length&&(a=fX(e,a,t,o.isIndexable)),oy(e,a)&&(a=fc(a,i,r&&r[e],o)),a}function dX(t,e,n,s){const{_proxy:i,_context:r,_subProxy:o,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(r,o||s);return a.delete(t),oy(t,l)&&(l=ay(i._scopes,i,t,l)),l}function fX(t,e,n,s){const{_proxy:i,_context:r,_subProxy:o,_descriptors:a}=n;if(typeof r.index<"u"&&s(t))return e[r.index%e.length];if(St(e[0])){const l=e,c=i._scopes.filter(u=>u!==l);e=[];for(const u of l){const d=ay(c,i,t,u);e.push(fc(d,r,o&&o[t],a))}}return e}function X4(t,e,n){return wo(t)?t(e,n):t}const hX=(t,e)=>t===!0?e:typeof t=="string"?op(e,t):void 0;function pX(t,e,n,s,i){for(const r of e){const o=hX(n,r);if(o){t.add(o);const a=X4(o._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==s)return a}else if(o===!1&&typeof s<"u"&&n!==s)return null}return!1}function ay(t,e,n,s){const i=e._rootScopes,r=X4(e._fallback,n,s),o=[...t,...i],a=new Set;a.add(s);let l=Cx(a,o,n,r||n,s);return l===null||typeof r<"u"&&r!==n&&(l=Cx(a,o,r,l,s),l===null)?!1:ry(Array.from(a),[""],i,r,()=>mX(e,n,s))}function Cx(t,e,n,s,i){for(;n;)n=pX(t,e,n,s,i);return n}function mX(t,e,n){const s=t._getTarget();e in s||(s[e]={});const i=s[e];return En(i)&&St(n)?n:i||{}}function gX(t,e,n,s){let i;for(const r of e)if(i=K4(cX(r,t),n),typeof i<"u")return oy(t,i)?ay(n,s,t,i):i}function K4(t,e){for(const n of e){if(!n)continue;const s=n[t];if(typeof s<"u")return s}}function kx(t){let e=t._keys;return e||(e=t._keys=_X(t._scopes)),e}function _X(t){const e=new Set;for(const n of t)for(const s of Object.keys(n).filter(i=>!i.startsWith("_")))e.add(s);return Array.from(e)}const vX=Number.EPSILON||1e-14,hc=(t,e)=>et==="x"?"y":"x";function yX(t,e,n,s){const i=t.skip?e:t,r=e,o=n.skip?e:n,a=F0(r,i),l=F0(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=s*c,f=s*u;return{previous:{x:r.x-d*(o.x-i.x),y:r.y-d*(o.y-i.y)},next:{x:r.x+f*(o.x-i.x),y:r.y+f*(o.y-i.y)}}}function bX(t,e,n){const s=t.length;let i,r,o,a,l,c=hc(t,0);for(let u=0;u!c.skip)),e.cubicInterpolationMode==="monotone")xX(t,i);else{let c=s?t[t.length-1]:t[0];for(r=0,o=t.length;rt.ownerDocument.defaultView.getComputedStyle(t,null);function TX(t,e){return fm(t).getPropertyValue(e)}const AX=["top","right","bottom","left"];function ga(t,e,n){const s={};n=n?"-"+n:"";for(let i=0;i<4;i++){const r=AX[i];s[r]=parseFloat(t[e+"-"+r+n])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const MX=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function RX(t,e){const n=t.touches,s=n&&n.length?n[0]:t,{offsetX:i,offsetY:r}=s;let o=!1,a,l;if(MX(i,r,t.target))a=i,l=r;else{const c=e.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function Yo(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:s}=e,i=fm(n),r=i.boxSizing==="border-box",o=ga(i,"padding"),a=ga(i,"border","width"),{x:l,y:c,box:u}=RX(t,n),d=o.left+(u&&a.left),f=o.top+(u&&a.top);let{width:h,height:v}=e;return r&&(h-=o.width+a.width,v-=o.height+a.height),{x:Math.round((l-d)/h*n.width/s),y:Math.round((c-f)/v*n.height/s)}}function CX(t,e,n){let s,i;if(e===void 0||n===void 0){const r=t&&cy(t);if(!r)e=t.clientWidth,n=t.clientHeight;else{const o=r.getBoundingClientRect(),a=fm(r),l=ga(a,"border","width"),c=ga(a,"padding");e=o.width-c.width-l.width,n=o.height-c.height-l.height,s=cp(a.maxWidth,r,"clientWidth"),i=cp(a.maxHeight,r,"clientHeight")}}return{width:e,height:n,maxWidth:s||lp,maxHeight:i||lp}}const Lf=t=>Math.round(t*10)/10;function kX(t,e,n,s){const i=fm(t),r=ga(i,"margin"),o=cp(i.maxWidth,t,"clientWidth")||lp,a=cp(i.maxHeight,t,"clientHeight")||lp,l=CX(t,e,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const f=ga(i,"border","width"),h=ga(i,"padding");c-=h.width+f.width,u-=h.height+f.height}return c=Math.max(0,c-r.width),u=Math.max(0,s?c/s:u-r.height),c=Lf(Math.min(c,o,l.maxWidth)),u=Lf(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Lf(c/2)),(e!==void 0||n!==void 0)&&s&&l.height&&u>l.height&&(u=l.height,c=Lf(Math.floor(u*s))),{width:c,height:u}}function Px(t,e,n){const s=e||1,i=Math.floor(t.height*s),r=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const o=t.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),t.currentDevicePixelRatio!==s||o.height!==i||o.width!==r?(t.currentDevicePixelRatio=s,o.height=i,o.width=r,t.ctx.setTransform(s,0,0,s,0,0),!0):!1}const PX=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};ly()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function Ix(t,e){const n=TX(t,e),s=n&&n.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Zo(t,e,n,s){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function IX(t,e,n,s){return{x:t.x+n*(e.x-t.x),y:s==="middle"?n<.5?t.y:e.y:s==="after"?n<1?t.y:e.y:n>0?e.y:t.y}}function OX(t,e,n,s){const i={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},o=Zo(t,i,n),a=Zo(i,r,n),l=Zo(r,e,n),c=Zo(o,a,n),u=Zo(a,l,n);return Zo(c,u,n)}const LX=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,s){return n-s},leftForLtr(n,s){return n-s}}},DX=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Hl(t,e,n){return t?LX(e,n):DX()}function Z4(t,e){let n,s;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,s=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=s)}function J4(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Q4(t){return t==="angle"?{between:D4,compare:Dq,normalize:Xr}:{between:gu,compare:(e,n)=>e-n,normalize:e=>e}}function Ox({start:t,end:e,count:n,loop:s,style:i}){return{start:t%n,end:e%n,loop:s&&(e-t+1)%n===0,style:i}}function NX(t,e,n){const{property:s,start:i,end:r}=n,{between:o,normalize:a}=Q4(s),l=e.length;let{start:c,end:u,loop:d}=t,f,h;if(d){for(c+=l,u+=l,f=0,h=l;fl(i,b,g)&&a(i,b)!==0,T=()=>a(r,g)===0||l(r,b,g),S=()=>_||w(),A=()=>!_||T();for(let R=u,x=u;R<=d;++R)y=e[R%o],!y.skip&&(g=c(y[s]),g!==b&&(_=l(g,i,r),m===null&&S()&&(m=a(g,i)===0?R:x),m!==null&&A()&&(v.push(Ox({start:m,end:R,loop:f,count:o,style:h})),m=null),x=R,b=g));return m!==null&&v.push(Ox({start:m,end:d,loop:f,count:o,style:h})),v}function FX(t,e){const n=[],s=t.segments;for(let i=0;ii&&t[r%e].skip;)r--;return r%=e,{start:i,end:r}}function BX(t,e,n,s){const i=t.length,r=[];let o=e,a=t[e],l;for(l=e+1;l<=n;++l){const c=t[l%i];c.skip||c.stop?a.skip||(s=!1,r.push({start:e%i,end:(l-1)%i,loop:s}),e=o=c.stop?l:null):(o=l,a.skip&&(e=l)),a=c}return o!==null&&r.push({start:e%i,end:o%i,loop:s}),r}function HX(t,e){const n=t.points,s=t.options.spanGaps,i=n.length;if(!i)return[];const r=!!t._loop,{start:o,end:a}=$X(n,i,r,s);if(s===!0)return Lx(t,[{start:o,end:a,loop:r}],n,e);const l=aa({chart:e,initial:n.initial,numSteps:o,currentStep:Math.min(s-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=U4.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((s,i)=>{if(!s.running||!s.items.length)return;const r=s.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(e),a=!0):(r[o]=r[r.length-1],r.pop());a&&(i.draw(),this._notify(i,s,e,"progress")),r.length||(s.running=!1,this._notify(i,s,e,"complete"),s.initial=!1),n+=r.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let s=n.get(e);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,s)),s}listen(e,n,s){this._getAnims(e).listeners[n].push(s)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((s,i)=>Math.max(s,i._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const s=n.items;let i=s.length-1;for(;i>=0;--i)s[i].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var er=new VX;const Nx="transparent",WX={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const s=Tx(t||Nx),i=s.valid&&Tx(e||Nx);return i&&i.valid?i.mix(s,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class jX{constructor(e,n,s,i){const r=n[s];i=If([e.to,i,r,e.from]);const o=If([e.from,r,i]);this._active=!0,this._fn=e.fn||WX[e.type||typeof o],this._easing=Nu[e.easing]||Nu.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=s,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(e,n,s){if(this._active){this._notify(!1);const i=this._target[this._prop],r=s-this._start,o=this._duration-r;this._start=s,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=r,this._loop=!!e.loop,this._to=If([e.to,n,i,e.from]),this._from=If([e.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,s=this._duration,i=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(r,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,s)=>{e.push({res:n,rej:s})})}_notify(e){const n=e?"res":"rej",s=this._promises||[];for(let i=0;i{const r=e[i];if(!St(r))return;const o={};for(const a of n)o[a]=r[a];(En(r.properties)&&r.properties||[i]).forEach(a=>{(a===i||!s.has(a))&&s.set(a,o)})})}_animateOptions(e,n){const s=n.options,i=XX(e,s);if(!i)return[];const r=this._createAnimations(i,s);return s.$shared&&qX(e.options.$animations,s).then(()=>{e.options=s},()=>{}),r}_createAnimations(e,n){const s=this._properties,i=[],r=e.$animations||(e.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(e,n));continue}const u=n[c];let d=r[c];const f=s.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){e[c]=u;continue}r[c]=d=new jX(f,e,c,u),i.push(d)}return i}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const s=this._createAnimations(e,n);if(s.length)return er.add(this._chart,s),!0}}function qX(t,e){const n=[],s=Object.keys(e);for(let i=0;i0||!n&&r<0)return i.index}return null}function Bx(t,e){const{chart:n,_cachedMeta:s}=t,i=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=s,l=r.axis,c=o.axis,u=JX(r,o,s),d=e.length;let f;for(let h=0;hn[s].axis===e).shift()}function tK(t,e){return Oa(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function nK(t,e,n){return Oa(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function Jc(t,e){const n=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const i of e){const r=i._stacks;if(!r||r[s]===void 0||r[s][n]===void 0)return;delete r[s][n],r[s]._visualValues!==void 0&&r[s]._visualValues[n]!==void 0&&delete r[s]._visualValues[n]}}}const Wg=t=>t==="reset"||t==="none",Hx=(t,e)=>e?t:Object.assign({},t),sK=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:tR(n,!0),values:null};class Gl{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=zg(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&Jc(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,s=this.getDataset(),i=(d,f,h,v)=>d==="x"?f:d==="r"?v:h,r=n.xAxisID=wt(s.xAxisID,Vg(e,"x")),o=n.yAxisID=wt(s.yAxisID,Vg(e,"y")),a=n.rAxisID=wt(s.rAxisID,Vg(e,"r")),l=n.indexAxis,c=n.iAxisID=i(l,r,o,a),u=n.vAxisID=i(l,o,r,a);n.xScale=this.getScaleForId(r),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&xx(this._data,this),e._stacked&&Jc(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),s=this._data;if(St(n)){const i=this._cachedMeta;this._data=ZX(n,i)}else if(s!==n){if(s){xx(s,this);const i=this._cachedMeta;Jc(i),i._parsed=[]}n&&Object.isExtensible(n)&&$q(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,s=this.getDataset();let i=!1;this._dataCheck();const r=n._stacked;n._stacked=zg(n.vScale,n),n.stack!==s.stack&&(i=!0,Jc(n),n.stack=s.stack),this._resyncElements(e),(i||r!==n._stacked)&&(Bx(this,n._parsed),n._stacked=zg(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),s=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:s,_data:i}=this,{iScale:r,_stacked:o}=s,a=r.axis;let l=e===0&&n===i.length?!0:s._sorted,c=e>0&&s._parsed[e-1],u,d,f;if(this._parsing===!1)s._parsed=i,s._sorted=!0,f=i;else{En(i[e])?f=this.parseArrayData(s,i,e,n):St(i[e])?f=this.parseObjectData(s,i,e,n):f=this.parsePrimitiveData(s,i,e,n);const h=()=>d[a]===null||c&&d[a]_||d<_}for(f=0;f=0;--f)if(!v()){this.updateRangeFromParsed(c,e,h,l);break}}return c}getAllParsedValues(e){const n=this._cachedMeta._parsed,s=[];let i,r,o;for(i=0,r=n.length;i=0&&ethis.getContext(s,i,n),_=c.resolveNamedOptions(f,h,v,d);return _.$shared&&(_.$shared=l,r[o]=Object.freeze(Hx(_,l))),_}_resolveAnimations(e,n,s){const i=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(e,s,n))}const c=new eR(i,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||Wg(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const s=this.resolveDataElementOptions(e,n),i=this._sharedOptions,r=this.getSharedOptions(s),o=this.includeOptions(n,r)||r!==i;return this.updateSharedOptions(r,n,s),{sharedOptions:r,includeOptions:o}}updateElement(e,n,s,i){Wg(i)?Object.assign(e,s):this._resolveAnimations(n,i).update(e,s)}updateSharedOptions(e,n,s){e&&!Wg(n)&&this._resolveAnimations(void 0,n).update(e,s)}_setStyle(e,n,s,i){e.active=i;const r=this.getStyle(n,i);this._resolveAnimations(n,s,i).update(e,{options:!i&&this.getSharedOptions(r)||r})}removeHoverStyle(e,n,s){this._setStyle(e,s,"active",!1)}setHoverStyle(e,n,s){this._setStyle(e,s,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=s.length,r=n.length,o=Math.min(r,i);o&&this.parse(0,o),r>i?this._insertElements(i,r-i,e):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=e;a0&&this.getParsed(n-1);for(let T=0;T=y){A.skip=!0;continue}const R=this.getParsed(T),x=Qt(R[h]),E=A[f]=o.getPixelForValue(R[f],T),k=A[h]=r||x?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,R,l):R[h],T);A.skip=isNaN(E)||isNaN(k)||x,A.stop=T>0&&Math.abs(R[f]-w[f])>m,_&&(A.parsed=R,A.raw=c.data[T]),d&&(A.options=u||this.resolveDataElementOptions(T,S.active?"active":i)),g||this.updateElement(S,T,A,i),w=R}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,s=n.options&&n.options.borderWidth||0,i=e.data||[];if(!i.length)return s;const r=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(s,r,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}xe(xh,"id","line"),xe(xh,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),xe(xh,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Eh extends Gl{getLabelAndValue(e){const n=this._cachedMeta,s=this.chart.data.labels||[],{xScale:i,yScale:r}=n,o=this.getParsed(e),a=i.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:s[e]||"",value:"("+a+", "+l+")"}}update(e){const n=this._cachedMeta,{data:s=[]}=n,i=this.chart._animationsDisabled;let{start:r,count:o}=$4(n,s,i);if(this._drawStart=r,this._drawCount=o,B4(n)&&(r=0,o=s.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=s;const c=this.resolveDatasetElementOptions(e);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},e)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(s,r,o,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,n,s,i){const r=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,i),d=this.getSharedOptions(u),f=this.includeOptions(i,d),h=o.axis,v=a.axis,{spanGaps:_,segment:m}=this.options,g=dc(_)?_:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||i==="none";let b=n>0&&this.getParsed(n-1);for(let w=n;w0&&Math.abs(S[h]-b[h])>g,m&&(A.parsed=S,A.raw=c.data[w]),f&&(A.options=d||this.resolveDataElementOptions(w,T.active?"active":i)),y||this.updateElement(T,w,A,i),b=S}this.updateSharedOptions(d,i,u)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const s=e.dataset,i=s.options&&s.options.borderWidth||0;if(!n.length)return i;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,o)/2}}xe(Eh,"id","scatter"),xe(Eh,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),xe(Eh,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});function Vo(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class uy{constructor(e){xe(this,"options");this.options=e||{}}static override(e){Object.assign(uy.prototype,e)}init(){}formats(){return Vo()}parse(){return Vo()}format(){return Vo()}add(){return Vo()}diff(){return Vo()}startOf(){return Vo()}endOf(){return Vo()}}var nR={_date:uy};function iK(t,e,n,s){const{controller:i,data:r,_sorted:o}=t,a=i._cachedMeta.iScale;if(a&&e===a.axis&&e!=="r"&&o&&r.length){const l=a._reversePixels?Uq:da;if(s){if(i._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(e);if(u){const d=l(r,e,n-u),f=l(r,e,n+u);return{lo:d.lo,hi:f.hi}}}}else return l(r,e,n)}return{lo:0,hi:r.length-1}}function Od(t,e,n,s,i){const r=t.getSortedVisibleDatasetMetas(),o=n[e];for(let a=0,l=r.length;a{l[o]&&l[o](e[n],i)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(e.x,e.y,i))}),s&&!a?[]:r}var lK={evaluateInteractionItems:Od,modes:{index(t,e,n,s){const i=Yo(e,t),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?jg(t,i,r,s,o):qg(t,i,r,!1,s,o),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(t,e,n,s){const i=Yo(e,t),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?jg(t,i,r,s,o):qg(t,i,r,!1,s,o);if(a.length>0){const l=a[0].datasetIndex,c=t.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===e)}function zx(t,e){return t.filter(n=>sR.indexOf(n.pos)===-1&&n.box.axis===e)}function eu(t,e){return t.sort((n,s)=>{const i=e?s:n,r=e?n:s;return i.weight===r.weight?i.index-r.index:i.weight-r.weight})}function cK(t){const e=[];let n,s,i,r,o,a;for(n=0,s=(t||[]).length;nc.box.fullSize),!0),s=eu(Qc(e,"left"),!0),i=eu(Qc(e,"right")),r=eu(Qc(e,"top"),!0),o=eu(Qc(e,"bottom")),a=zx(e,"x"),l=zx(e,"y");return{fullSize:n,leftAndTop:s.concat(r),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:Qc(e,"chartArea"),vertical:s.concat(i).concat(l),horizontal:r.concat(o).concat(a)}}function Vx(t,e,n,s){return Math.max(t[n],e[n])+Math.max(t[s],e[s])}function iR(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function hK(t,e,n,s){const{pos:i,box:r}=n,o=t.maxPadding;if(!St(i)){n.size&&(t[i]-=n.size);const d=s[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,t[i]+=n.size}r.getPadding&&iR(o,r.getPadding());const a=Math.max(0,e.outerWidth-Vx(o,t,"left","right")),l=Math.max(0,e.outerHeight-Vx(o,t,"top","bottom")),c=a!==t.w,u=l!==t.h;return t.w=a,t.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function pK(t){const e=t.maxPadding;function n(s){const i=Math.max(e[s]-t[s],0);return t[s]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function mK(t,e){const n=e.maxPadding;function s(i){const r={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{r[o]=Math.max(e[o],n[o])}),r}return s(t?["left","right"]:["top","bottom"])}function _u(t,e,n,s){const i=[];let r,o,a,l,c,u;for(r=0,o=t.length,c=0;r{typeof _.beforeLayout=="function"&&_.beforeLayout()});const u=l.reduce((_,m)=>m.box.options&&m.box.options.display===!1?_:_+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);iR(f,Vs(s));const h=Object.assign({maxPadding:f,w:r,h:o,x:i.left,y:i.top},i),v=dK(l.concat(c),d);_u(a.fullSize,h,d,v),_u(l,h,d,v),_u(c,h,d,v)&&_u(l,h,d,v),pK(h),Wx(a.leftAndTop,h,d,v),h.x+=h.w,h.y+=h.h,Wx(a.rightAndBottom,h,d,v),t.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ot(a.chartArea,_=>{const m=_.box;Object.assign(m,t.chartArea),m.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class rR{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,s){}removeEventListener(e,n,s){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,s,i){return n=Math.max(0,n||e.width),s=s||e.height,{width:n,height:Math.max(0,i?Math.floor(n/i):s)}}isAttached(e){return!0}updateConfig(e){}}class gK extends rR{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Sh="$chartjs",_K={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},jx=t=>t===null||t==="";function vK(t,e){const n=t.style,s=t.getAttribute("height"),i=t.getAttribute("width");if(t[Sh]={initial:{height:s,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",jx(i)){const r=Ix(t,"width");r!==void 0&&(t.width=r)}if(jx(s))if(t.style.height==="")t.height=t.width/(e||2);else{const r=Ix(t,"height");r!==void 0&&(t.height=r)}return t}const oR=PX?{passive:!0}:!1;function yK(t,e,n){t&&t.addEventListener(e,n,oR)}function bK(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,oR)}function wK(t,e){const n=_K[t.type]||t.type,{x:s,y:i}=Yo(t,e);return{type:n,chart:e,native:t,x:s!==void 0?s:null,y:i!==void 0?i:null}}function up(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function xK(t,e,n){const s=t.canvas,i=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||up(a.addedNodes,s),o=o&&!up(a.removedNodes,s);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function EK(t,e,n){const s=t.canvas,i=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||up(a.removedNodes,s),o=o&&!up(a.addedNodes,s);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const dd=new Map;let qx=0;function aR(){const t=window.devicePixelRatio;t!==qx&&(qx=t,dd.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function SK(t,e){dd.size||window.addEventListener("resize",aR),dd.set(t,e)}function TK(t){dd.delete(t),dd.size||window.removeEventListener("resize",aR)}function AK(t,e,n){const s=t.canvas,i=s&&cy(s);if(!i)return;const r=F4((a,l)=>{const c=i.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(i),SK(t,r),o}function Xg(t,e,n){n&&n.disconnect(),e==="resize"&&TK(t)}function MK(t,e,n){const s=t.canvas,i=F4(r=>{t.ctx!==null&&n(wK(r,t))},t);return yK(s,e,i),i}class RK extends rR{acquireContext(e,n){const s=e&&e.getContext&&e.getContext("2d");return s&&s.canvas===e?(vK(e,n),s):null}releaseContext(e){const n=e.canvas;if(!n[Sh])return!1;const s=n[Sh].initial;["height","width"].forEach(r=>{const o=s[r];Qt(o)?n.removeAttribute(r):n.setAttribute(r,o)});const i=s.style||{};return Object.keys(i).forEach(r=>{n.style[r]=i[r]}),n.width=n.width,delete n[Sh],!0}addEventListener(e,n,s){this.removeEventListener(e,n);const i=e.$proxies||(e.$proxies={}),o={attach:xK,detach:EK,resize:AK}[n]||MK;i[n]=o(e,n,s)}removeEventListener(e,n){const s=e.$proxies||(e.$proxies={}),i=s[n];if(!i)return;({attach:Xg,detach:Xg,resize:Xg}[n]||bK)(e,n,i),s[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,s,i){return kX(e,n,s,i)}isAttached(e){const n=e&&cy(e);return!!(n&&n.isConnected)}}function CK(t){return!ly()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?gK:RK}var th;let La=(th=class{constructor(){xe(this,"x");xe(this,"y");xe(this,"active",!1);xe(this,"options");xe(this,"$animations")}tooltipPosition(e){const{x:n,y:s}=this.getProps(["x","y"],e);return{x:n,y:s}}hasValue(){return dc(this.x)&&dc(this.y)}getProps(e,n){const s=this.$animations;if(!n||!s)return this;const i={};return e.forEach(r=>{i[r]=s[r]&&s[r].active()?s[r]._to:this[r]}),i}},xe(th,"defaults",{}),xe(th,"defaultRoutes"),th);function kK(t,e){const n=t.options.ticks,s=PK(t),i=Math.min(n.maxTicksLimit||s,s),r=n.major.enabled?OK(e):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>i)return LK(e,c,r,o/i),c;const u=IK(r,e,i);if(o>0){let d,f;const h=o>1?Math.round((l-a)/(o-1)):null;for(Nf(e,c,u,Qt(h)?0:a-h,a),d=0,f=o-1;di)return l}return Math.max(i,1)}function OK(t){const e=[];let n,s;for(n=0,s=t.length;nt==="left"?"right":t==="right"?"left":t,Xx=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,Kx=(t,e)=>Math.min(e||t,t);function Yx(t,e){const n=[],s=t.length/e,i=t.length;let r=0;for(;ro+a)))return l}function FK(t,e){Ot(t,n=>{const s=n.gc,i=s.length/2;let r;if(i>e){for(r=0;rs?s:n,s=i&&n>s?n:s,{min:fi(n,fi(s,n)),max:fi(s,fi(n,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Vt(this.options.beforeUpdate,[this])}update(e,n,s){const{beginAtZero:i,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=lX(this,r,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||s<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,h=Us(this.chart.width-d,0,this.maxWidth);a=e.offset?this.maxWidth/s:h/(s-1),d+6>a&&(a=h/(s-(e.offset?.5:1)),l=this.maxHeight-tu(e.grid)-n.padding-Zx(e.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=Oq(Math.min(Math.asin(Us((u.highest.height+6)/a,-1,1)),Math.asin(Us(l/c,-1,1))-Math.asin(Us(f/c,-1,1)))),o=Math.max(i,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){Vt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Vt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:s,title:i,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Zx(i,n.options.font);if(a?(e.width=this.maxWidth,e.height=tu(r)+l):(e.height=this.maxHeight,e.width=tu(r)+l),s.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),h=s.padding*2,v=ua(this.labelRotation),_=Math.cos(v),m=Math.sin(v);if(a){const g=s.mirror?0:m*d.width+_*f.height;e.height=Math.min(this.maxHeight,e.height+g+h)}else{const g=s.mirror?0:_*d.width+m*f.height;e.width=Math.min(this.maxWidth,e.width+g+h)}this._calculatePadding(c,u,m,_)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,s,i){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?c?(f=i*e.width,h=s*n.height):(f=s*e.height,h=i*n.width):r==="start"?h=n.width:r==="end"?f=e.width:r!=="inner"&&(f=e.width/2,h=n.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=e.height/2;r==="start"?(u=0,d=e.height):r==="end"&&(u=n.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Vt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,s;for(n=0,s=e.length;n({width:o[x]||0,height:a[x]||0});return{first:R(0),last:R(n-1),widest:R(S),highest:R(A),widths:o,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return Nq(this._alignToPixels?zo(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&ea*i?a/s:l/i:l*i0}_computeGridLineItems(e){const n=this.axis,s=this.chart,i=this.options,{grid:r,position:o,border:a}=i,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=tu(r),h=[],v=a.setContext(this.getContext()),_=v.display?v.width:0,m=_/2,g=function(P){return zo(s,P,_)};let y,b,w,T,S,A,R,x,E,k,U,H;if(o==="top")y=g(this.bottom),A=this.bottom-f,x=y-m,k=g(e.top)+m,H=e.bottom;else if(o==="bottom")y=g(this.top),k=e.top,H=g(e.bottom)-m,A=y+m,x=this.top+f;else if(o==="left")y=g(this.right),S=this.right-f,R=y-m,E=g(e.left)+m,U=e.right;else if(o==="right")y=g(this.left),E=e.left,U=g(e.right)-m,S=y+m,R=this.left+f;else if(n==="x"){if(o==="center")y=g((e.top+e.bottom)/2+.5);else if(St(o)){const P=Object.keys(o)[0],B=o[P];y=g(this.chart.scales[P].getPixelForValue(B))}k=e.top,H=e.bottom,A=y+m,x=A+f}else if(n==="y"){if(o==="center")y=g((e.left+e.right)/2);else if(St(o)){const P=Object.keys(o)[0],B=o[P];y=g(this.chart.scales[P].getPixelForValue(B))}S=y-m,R=S-f,E=e.left,U=e.right}const D=wt(i.ticks.maxTicksLimit,d),I=Math.max(1,Math.ceil(d/D));for(b=0;b0&&(ke-=oe/2);break}de={left:ke,top:me,width:oe+fe.width,height:Re+fe.height,color:I.backdropColor}}m.push({label:w,font:x,textOffset:U,options:{rotation:_,color:B,strokeColor:L,strokeWidth:Y,textAlign:q,textBaseline:H,translation:[T,S],backdrop:de}})}return m}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-ua(this.labelRotation))return e==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:s,mirror:i,padding:r}}=this.options,o=this._getLabelSizes(),a=e+r,l=o.widest.width;let c,u;return n==="left"?i?(u=this.right+r,s==="near"?c="left":s==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,s==="near"?c="right":s==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+r,s==="near"?c="right":s==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,s==="near"?c="left":s==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:s,top:i,width:r,height:o}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(s,i,r,o),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(r=>r.value===e);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(e){const n=this.options.grid,s=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(s.save(),s.lineWidth=u.width,s.strokeStyle=u.color,s.setLineDash(u.borderDash||[]),s.lineDashOffset=u.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(n.display)for(r=0,o=i.length;r{this.draw(r)}}]:[{z:s,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",i=[];let r,o;for(r=0,o=n.length;r{const s=n.split("."),i=s.pop(),r=[t].concat(s).join("."),o=e[n].split("."),a=o.pop(),l=o.join(".");cn.route(r,i,l,a)})}function WK(t){return"id"in t&&"defaults"in t}class jK{constructor(){this.controllers=new Uf(Gl,"datasets",!0),this.elements=new Uf(La,"elements"),this.plugins=new Uf(Object,"plugins"),this.scales=new Uf(Ic,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,s){[...n].forEach(i=>{const r=s||this._getRegistryForType(i);s||r.isForType(i)||r===this.plugins&&i.id?this._exec(e,r,i):Ot(i,o=>{const a=s||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,n,s){const i=Qv(e);Vt(s["before"+i],[],s),n[e](s),Vt(s["after"+i],[],s)}_getRegistryForType(e){for(let n=0;nr.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,s),e,"stop"),this._notify(i(s,n),e,"start")}}function XK(t){const e={},n=[],s=Object.keys(vi.plugins.items);for(let r=0;r1&&Jx(t[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Qx(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function tY(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(s=>s.xAxisID===t||s.yAxisID===t);if(n.length)return Qx(t,"x",n[0])||Qx(t,"y",n[0])}return{}}function nY(t,e){const n=Aa[t.type]||{scales:{}},s=e.scales||{},i=G0(t.type,e),r=Object.create(null);return Object.keys(s).forEach(o=>{const a=s[o];if(!St(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=z0(o,a,tY(o,t),cn.scales[a.type]),c=QK(l,i),u=n.scales||{};r[o]=Lu(Object.create(null),[{axis:l},a,u[l],u[c]])}),t.data.datasets.forEach(o=>{const a=o.type||t.type,l=o.indexAxis||G0(a,e),u=(Aa[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=JK(d,l),h=o[f+"AxisID"]||f;r[h]=r[h]||Object.create(null),Lu(r[h],[{axis:f},s[h],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];Lu(a,[cn.scales[a.type],cn.scale])}),r}function lR(t){const e=t.options||(t.options={});e.plugins=wt(e.plugins,{}),e.scales=nY(t,e)}function cR(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function sY(t){return t=t||{},t.data=cR(t.data),lR(t),t}const eE=new Map,uR=new Set;function Ff(t,e){let n=eE.get(t);return n||(n=e(),eE.set(t,n),uR.add(n)),n}const nu=(t,e,n)=>{const s=op(e,n);s!==void 0&&t.add(s)};let iY=class{constructor(e){this._config=sY(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=cR(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),lR(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Ff(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return Ff(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return Ff(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,s=this.type;return Ff(`${s}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const s=this._scopeCache;let i=s.get(e);return(!i||n)&&(i=new Map,s.set(e,i)),i}getOptionScopes(e,n,s){const{options:i,type:r}=this,o=this._cachedScopes(e,s),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{e&&(l.add(e),u.forEach(d=>nu(l,e,d))),u.forEach(d=>nu(l,i,d)),u.forEach(d=>nu(l,Aa[r]||{},d)),u.forEach(d=>nu(l,cn,d)),u.forEach(d=>nu(l,$0,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),uR.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:e,type:n}=this;return[e,Aa[n]||{},cn.datasets[n]||{},{type:n},cn,$0]}resolveNamedOptions(e,n,s,i=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=tE(this._resolverCache,e,i);let l=o;if(oY(o,n)){r.$shared=!1,s=wo(s)?s():s;const c=this.createResolver(e,s,a);l=fc(o,s,c)}for(const c of n)r[c]=l[c];return r}createResolver(e,n,s=[""],i){const{resolver:r}=tE(this._resolverCache,e,s);return St(n)?fc(r,n,void 0,i):r}};function tE(t,e,n){let s=t.get(e);s||(s=new Map,t.set(e,s));const i=n.join();let r=s.get(i);return r||(r={resolver:ry(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},s.set(i,r)),r}const rY=t=>St(t)&&Object.getOwnPropertyNames(t).some(e=>wo(t[e]));function oY(t,e){const{isScriptable:n,isIndexable:s}=j4(t);for(const i of e){const r=n(i),o=s(i),a=(o||r)&&t[i];if(r&&(wo(a)||rY(a))||o&&En(a))return!0}return!1}var aY="4.4.7";const lY=["top","bottom","left","right","chartArea"];function nE(t,e){return t==="top"||t==="bottom"||lY.indexOf(t)===-1&&e==="x"}function sE(t,e){return function(n,s){return n[t]===s[t]?n[e]-s[e]:n[t]-s[t]}}function iE(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Vt(n&&n.onComplete,[t],e)}function cY(t){const e=t.chart,n=e.options.animation;Vt(n&&n.onProgress,[t],e)}function dR(t){return ly()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Th={},rE=t=>{const e=dR(t);return Object.values(Th).filter(n=>n.canvas===e).pop()};function uY(t,e,n){const s=Object.keys(t);for(const i of s){const r=+i;if(r>=e){const o=t[i];delete t[i],(n>0||r>e)&&(t[r+n]=o)}}}function dY(t,e,n,s){return!n||t.type==="mouseout"?null:s?e:t}function $f(t,e,n){return t.options.clip?t[n]:e[n]}function fY(t,e){const{xScale:n,yScale:s}=t;return n&&s?{left:$f(n,e,"left"),right:$f(n,e,"right"),top:$f(s,e,"top"),bottom:$f(s,e,"bottom")}:e}var Wr;let hm=(Wr=class{static register(...e){vi.add(...e),oE()}static unregister(...e){vi.remove(...e),oE()}constructor(e,n){const s=this.config=new iY(n),i=dR(e),r=rE(i);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||CK(i)),this.platform.updateConfig(s);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=wq(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new qK,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Hq(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Th[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}er.listen(this,"complete",iE),er.listen(this,"progress",cY),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:s,height:i,_aspectRatio:r}=this;return Qt(e)?n&&r?r:i?s/i:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return vi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Px(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Rx(this.canvas,this.ctx),this}stop(){return er.stop(this),this}resize(e,n){er.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const s=this.options,i=this.canvas,r=s.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,e,n,r),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Px(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Vt(s.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ot(n,(s,i)=>{s.id=i})}buildOrUpdateScales(){const e=this.options,n=e.scales,s=this.scales,i=Object.keys(s).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=z0(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ot(r,o=>{const a=o.options,l=a.id,c=z0(l,a),u=wt(a.type,o.dtype);(a.position===void 0||nE(a.position,c)!==nE(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in s&&s[l].type===u)d=s[l];else{const f=vi.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,e)}),Ot(i,(o,a)=>{o||delete s[a]}),Ot(s,o=>{Fs.configure(this,o,o.options),Fs.addBox(this,o)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,s=e.length;if(e.sort((i,r)=>i.index-r.index),s>n){for(let i=n;in.length&&delete this._stacks,e.forEach((s,i)=>{n.filter(r=>r===s._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let s,i;for(this._removeUnreferencedMetasets(),s=0,i=n.length;s{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const s=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(sE("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ot(this.scales,e=>{Fs.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),s=new Set(e.events);(!vx(n,s)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:s,start:i,count:r}of n){const o=s==="_removeElements"?-r:r;uY(e,i,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,s=r=>new Set(e.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),i=s(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Fs.update(this,this.width,this.height,e);const n=this.chartArea,s=n.width<=0||n.height<=0;this._layers=[],Ot(this.boxes,i=>{s&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,r)=>{i._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,s=this.data.datasets.length;n=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,s=e._clip,i=!s.disabled,r=fY(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(i&&sy(n,{left:s.left===!1?0:r.left-s.left,right:s.right===!1?this.width:r.right+s.right,top:s.top===!1?0:r.top-s.top,bottom:s.bottom===!1?this.height:r.bottom+s.bottom}),e.controller.draw(),i&&iy(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return cd(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,s,i){const r=lK.modes[n];return typeof r=="function"?r(this,e,s,i):[]}getDatasetMeta(e){const n=this.data.datasets[e],s=this._metasets;let i=s.filter(r=>r&&r._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},s.push(i)),i}getContext(){return this.$context||(this.$context=Oa(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const s=this.getDatasetMeta(e);return typeof s.hidden=="boolean"?!s.hidden:!n.hidden}setDatasetVisibility(e,n){const s=this.getDatasetMeta(e);s.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,s){const i=s?"show":"hide",r=this.getDatasetMeta(e),o=r.controller._resolveAnimations(void 0,i);ap(n)?(r.data[n].hidden=!s,this.update()):(this.setDatasetVisibility(e,s),o.update(r,{visible:s}),this.update(a=>a.datasetIndex===e?i:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),er.remove(this),e=0,n=this.data.datasets.length;e{n.addEventListener(this,r,o),e[r]=o},i=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Ot(this.options.events,r=>s(r,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,s=(l,c)=>{n.addEventListener(this,l,c),e[l]=c},i=(l,c)=>{e[l]&&(n.removeEventListener(this,l,c),delete e[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),s("resize",r),s("detach",o)};o=()=>{this.attached=!1,i("resize",r),this._stop(),this._resize(0,0),s("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Ot(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},Ot(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,s){const i=s?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(e[0].datasetIndex),r.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=e.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!ip(s,n)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,n))}notifyPlugins(e,n,s){return this._plugins.notify(this,e,n,s)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,s){const i=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,e),a=s?e:r(e,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(e,n){const s={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},i=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",s,i)===!1)return;const r=this._handleEvent(e,n,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,i),(r||s.changed)&&this.render(),this}_handleEvent(e,n,s){const{_active:i=[],options:r}=this,o=n,a=this._getActiveElements(e,i,s,o),l=Mq(e),c=dY(e,this._lastEvent,s,l);s&&(this._lastEvent=null,Vt(r.onHover,[e,a,this],this),l&&Vt(r.onClick,[e,a,this],this));const u=!ip(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(e,n,s,i){if(e.type==="mouseout")return[];if(!s)return n;const r=this.options.hover;return this.getElementsAtEventForMode(e,r.mode,r,i)}},xe(Wr,"defaults",cn),xe(Wr,"instances",Th),xe(Wr,"overrides",Aa),xe(Wr,"registry",vi),xe(Wr,"version",aY),xe(Wr,"getChart",rE),Wr);function oE(){return Ot(hm.instances,t=>t._plugins.invalidate())}function fR(t,e,n=e){t.lineCap=wt(n.borderCapStyle,e.borderCapStyle),t.setLineDash(wt(n.borderDash,e.borderDash)),t.lineDashOffset=wt(n.borderDashOffset,e.borderDashOffset),t.lineJoin=wt(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=wt(n.borderWidth,e.borderWidth),t.strokeStyle=wt(n.borderColor,e.borderColor)}function hY(t,e,n){t.lineTo(n.x,n.y)}function pY(t){return t.stepped?Jq:t.tension||t.cubicInterpolationMode==="monotone"?Qq:hY}function hR(t,e,n={}){const s=t.length,{start:i=0,end:r=s-1}=n,{start:o,end:a}=e,l=Math.max(i,o),c=Math.min(r,a),u=ia&&r>a;return{count:s,start:l,loop:e.loop,ilen:c(o+(c?a-w:w))%r,b=()=>{_!==m&&(t.lineTo(u,m),t.lineTo(u,_),t.lineTo(u,g))};for(l&&(h=i[y(0)],t.moveTo(h.x,h.y)),f=0;f<=a;++f){if(h=i[y(f)],h.skip)continue;const w=h.x,T=h.y,S=w|0;S===v?(T<_?_=T:T>m&&(m=T),u=(d*u+w)/++d):(b(),t.lineTo(w,T),v=S,d=0,_=m=T),g=T}b()}function V0(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?gY:mY}function _Y(t){return t.stepped?IX:t.tension||t.cubicInterpolationMode==="monotone"?OX:Zo}function vY(t,e,n,s){let i=e._path;i||(i=e._path=new Path2D,e.path(i,n,s)&&i.closePath()),fR(t,e.options),t.stroke(i)}function yY(t,e,n,s){const{segments:i,options:r}=e,o=V0(e);for(const a of i)fR(t,r,a.style),t.beginPath(),o(t,e,a,{start:n,end:n+s-1})&&t.closePath(),t.stroke()}const bY=typeof Path2D=="function";function wY(t,e,n,s){bY&&!e.options.segment?vY(t,e,n,s):yY(t,e,n,s)}class vu extends La{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,n){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const i=s.spanGaps?this._loop:this._fullLoop;SX(this._points,s,e,i,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=HX(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,s=e.length;return s&&n[e[s-1].end]}interpolate(e,n){const s=this.options,i=e[n],r=this.points,o=FX(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=_Y(s);let c,u;for(c=0,u=o.length;ce!=="borderDash"&&e!=="fill"});function aE(t,e,n,s){const i=t.options,{[n]:r}=t.getProps([n],s);return Math.abs(e-r){let{boxHeight:n=e,boxWidth:s=e}=t;return t.usePointStyle&&(n=Math.min(n,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:n,itemHeight:Math.max(e,n)}},xY=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class cE extends La{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n,s){this.maxWidth=e,this.maxHeight=n,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let n=Vt(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(s=>e.filter(s,this.chart.data))),e.sort&&(n=n.sort((s,i)=>e.sort(s,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const s=e.labels,i=Hn(s.font),r=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=lE(s,r);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,i,a,l)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,s,i){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let d=e;r.textAlign="left",r.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((v,_)=>{const m=s+n/2+r.measureText(v.text).width;(_===0||c[c.length-1]+m+2*a>o)&&(d+=u,c[c.length-(_>0?0:1)]=0,h+=u,f++),l[_]={left:0,top:h,row:f,width:m,height:i},c[c.length-1]+=m+a}),d}_fitCols(e,n,s,i){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-e;let d=a,f=0,h=0,v=0,_=0;return this.legendItems.forEach((m,g)=>{const{itemWidth:y,itemHeight:b}=EY(s,n,r,m,i);g>0&&h+b+2*a>u&&(d+=f+a,c.push({width:f,height:h}),v+=f+a,_++,f=h=0),l[g]={left:v,top:h,col:_,width:y,height:b},f=Math.max(f,y),h+=b+a}),d+=f,c.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:s,labels:{padding:i},rtl:r}}=this,o=Hl(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ln(s,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Ln(s,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+e+i,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+i}else{let a=0,l=Ln(s,this.top+e+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Ln(s,this.top+e+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;sy(e,this),this._draw(),iy(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:s,ctx:i}=this,{align:r,labels:o}=e,a=cn.color,l=Hl(e.rtl,this.left,this.width),c=Hn(o.font),{padding:u}=o,d=c.size,f=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:v,boxHeight:_,itemHeight:m}=lE(o,d),g=function(S,A,R){if(isNaN(v)||v<=0||isNaN(_)||_<0)return;i.save();const x=wt(R.lineWidth,1);if(i.fillStyle=wt(R.fillStyle,a),i.lineCap=wt(R.lineCap,"butt"),i.lineDashOffset=wt(R.lineDashOffset,0),i.lineJoin=wt(R.lineJoin,"miter"),i.lineWidth=x,i.strokeStyle=wt(R.strokeStyle,a),i.setLineDash(wt(R.lineDash,[])),o.usePointStyle){const E={radius:_*Math.SQRT2/2,pointStyle:R.pointStyle,rotation:R.rotation,borderWidth:x},k=l.xPlus(S,v/2),U=A+f;V4(i,E,k,U,o.pointStyleWidth&&v)}else{const E=A+Math.max((d-_)/2,0),k=l.leftForLtr(S,v),U=Fu(R.borderRadius);i.beginPath(),Object.values(U).some(H=>H!==0)?H0(i,{x:k,y:E,w:v,h:_,radius:U}):i.rect(k,E,v,_),i.fill(),x!==0&&i.stroke()}i.restore()},y=function(S,A,R){ud(i,R.text,S,A+m/2,c,{strikethrough:R.hidden,textAlign:l.textAlign(R.textAlign)})},b=this.isHorizontal(),w=this._computeTitleHeight();b?h={x:Ln(r,this.left+u,this.right-s[0]),y:this.top+u+w,line:0}:h={x:this.left+u,y:Ln(r,this.top+w+u,this.bottom-n[0].height),line:0},Z4(this.ctx,e.textDirection);const T=m+u;this.legendItems.forEach((S,A)=>{i.strokeStyle=S.fontColor,i.fillStyle=S.fontColor;const R=i.measureText(S.text).width,x=l.textAlign(S.textAlign||(S.textAlign=o.textAlign)),E=v+f+R;let k=h.x,U=h.y;l.setWidth(this.width),b?A>0&&k+E+u>this.right&&(U=h.y+=T,h.line++,k=h.x=Ln(r,this.left+u,this.right-s[h.line])):A>0&&U+T>this.bottom&&(k=h.x=k+n[h.line].width+u,h.line++,U=h.y=Ln(r,this.top+w+u,this.bottom-n[h.line].height));const H=l.x(k);if(g(H,U,S),k=Gq(x,k+v+f,b?k+E:this.right,e.rtl),y(l.x(k),U,S),b)h.x+=E+u;else if(typeof S.text!="string"){const D=c.lineHeight;h.y+=pR(S,D)+u}else h.y+=T}),J4(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,s=Hn(n.font),i=Vs(n.padding);if(!n.display)return;const r=Hl(e.rtl,this.left,this.width),o=this.ctx,a=n.position,l=s.size/2,c=i.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=Ln(e.align,d,this.right-f);else{const v=this.columnSizes.reduce((_,m)=>Math.max(_,m.height),0);u=c+Ln(e.align,this.top,this.bottom-v-e.labels.padding-this._computeTitleHeight())}const h=Ln(a,d,d+f);o.textAlign=r.textAlign(ty(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=s.string,ud(o,n.text,h,u,s)}_computeTitleHeight(){const e=this.options.title,n=Hn(e.font),s=Vs(e.padding);return e.display?n.lineHeight+s.height:0}_getLegendItemAt(e,n){let s,i,r;if(gu(e,this.left,this.right)&&gu(n,this.top,this.bottom)){for(r=this.legendHitBoxes,s=0;sr.length>o.length?r:o)),e+n.size/2+s.measureText(i).width}function TY(t,e,n){let s=t;return typeof e.text!="string"&&(s=pR(e,n)),s}function pR(t,e){const n=t.text?t.text.length:0;return e*n}function AY(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var MY={id:"legend",_element:cE,start(t,e,n){const s=t.legend=new cE({ctx:t.ctx,options:n,chart:t});Fs.configure(t,s,n),Fs.addBox(t,s)},stop(t){Fs.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const s=t.legend;Fs.configure(t,s,n),s.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const s=e.datasetIndex,i=n.chart;i.isDatasetVisible(s)?(i.hide(s),e.hidden=!0):(i.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:s,textAlign:i,color:r,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Vs(c.borderWidth);return{text:e[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class mR extends La{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const i=En(s.text)?s.text.length:1;this._padding=Vs(s.padding);const r=i*Hn(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:s,bottom:i,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Ln(a,s,r),d=n+e,c=r-s):(o.position==="left"?(u=s+e,d=Ln(a,i,n),l=Tn*-.5):(u=r-e,d=Ln(a,n,i),l=Tn*.5),c=i-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const s=Hn(n.font),r=s.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);ud(e,n.text,0,0,s,{color:n.color,maxWidth:l,rotation:c,textAlign:ty(n.align),textBaseline:"middle",translation:[o,a]})}}function RY(t,e){const n=new mR({ctx:t.ctx,options:e,chart:t});Fs.configure(t,n,e),Fs.addBox(t,n),t.titleBlock=n}var CY={id:"title",_element:mR,start(t,e,n){RY(t,n)},stop(t){const e=t.titleBlock;Fs.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const s=t.titleBlock;Fs.configure(t,s,n),s.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const yu={average(t){if(!t.length)return!1;let e,n,s=new Set,i=0,r=0;for(e=0,n=t.length;ea+l)/s.size,y:i/r}},nearest(t,e){if(!t.length)return!1;let n=e.x,s=e.y,i=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=t.length;r-1?t.split(` +`):t}function kY(t,e){const{element:n,datasetIndex:s,index:i}=e,r=t.getDatasetMeta(s).controller,{label:o,value:a}=r.getLabelAndValue(i);return{chart:t,label:o,parsed:r.getParsed(i),raw:t.data.datasets[s].data[i],formattedValue:a,dataset:r.getDataset(),dataIndex:i,datasetIndex:s,element:n}}function uE(t,e){const n=t.chart.ctx,{body:s,footer:i,title:r}=t,{boxWidth:o,boxHeight:a}=e,l=Hn(e.bodyFont),c=Hn(e.titleFont),u=Hn(e.footerFont),d=r.length,f=i.length,h=s.length,v=Vs(e.padding);let _=v.height,m=0,g=s.reduce((w,T)=>w+T.before.length+T.lines.length+T.after.length,0);if(g+=t.beforeBody.length+t.afterBody.length,d&&(_+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),g){const w=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;_+=h*w+(g-h)*l.lineHeight+(g-1)*e.bodySpacing}f&&(_+=e.footerMarginTop+f*u.lineHeight+(f-1)*e.footerSpacing);let y=0;const b=function(w){m=Math.max(m,n.measureText(w).width+y)};return n.save(),n.font=c.string,Ot(t.title,b),n.font=l.string,Ot(t.beforeBody.concat(t.afterBody),b),y=e.displayColors?o+2+e.boxPadding:0,Ot(s,w=>{Ot(w.before,b),Ot(w.lines,b),Ot(w.after,b)}),y=0,n.font=u.string,Ot(t.footer,b),n.restore(),m+=v.width,{width:m,height:_}}function PY(t,e){const{y:n,height:s}=e;return nt.height-s/2?"bottom":"center"}function IY(t,e,n,s){const{x:i,width:r}=s,o=n.caretSize+n.caretPadding;if(t==="left"&&i+r+o>e.width||t==="right"&&i-r-o<0)return!0}function OY(t,e,n,s){const{x:i,width:r}=n,{width:o,chartArea:{left:a,right:l}}=t;let c="center";return s==="center"?c=i<=(a+l)/2?"left":"right":i<=r/2?c="left":i>=o-r/2&&(c="right"),IY(c,t,e,n)&&(c="center"),c}function dE(t,e,n){const s=n.yAlign||e.yAlign||PY(t,n);return{xAlign:n.xAlign||e.xAlign||OY(t,e,n,s),yAlign:s}}function LY(t,e){let{x:n,width:s}=t;return e==="right"?n-=s:e==="center"&&(n-=s/2),n}function DY(t,e,n){let{y:s,height:i}=t;return e==="top"?s+=n:e==="bottom"?s-=i+n:s-=i/2,s}function fE(t,e,n,s){const{caretSize:i,caretPadding:r,cornerRadius:o}=t,{xAlign:a,yAlign:l}=n,c=i+r,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=Fu(o);let v=LY(e,a);const _=DY(e,l,c);return l==="center"?a==="left"?v+=c:a==="right"&&(v-=c):a==="left"?v-=Math.max(u,f)+i:a==="right"&&(v+=Math.max(d,h)+i),{x:Us(v,0,s.width-e.width),y:Us(_,0,s.height-e.height)}}function Bf(t,e,n){const s=Vs(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-s.right:t.x+s.left}function hE(t){return gi([],tr(t))}function NY(t,e,n){return Oa(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function pE(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const gR={beforeTitle:Zi,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,s=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex"u"?gR[e].call(n,s):i}var x_;let mE=(x_=class extends La{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,s=this.options.setContext(this.getContext()),i=s.enabled&&n.options.animation&&s.animations,r=new eR(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=NY(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:s}=n,i=rs(s,"beforeTitle",this,e),r=rs(s,"title",this,e),o=rs(s,"afterTitle",this,e);let a=[];return a=gi(a,tr(i)),a=gi(a,tr(r)),a=gi(a,tr(o)),a}getBeforeBody(e,n){return hE(rs(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:s}=n,i=[];return Ot(e,r=>{const o={before:[],lines:[],after:[]},a=pE(s,r);gi(o.before,tr(rs(a,"beforeLabel",this,r))),gi(o.lines,rs(a,"label",this,r)),gi(o.after,tr(rs(a,"afterLabel",this,r))),i.push(o)}),i}getAfterBody(e,n){return hE(rs(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:s}=n,i=rs(s,"beforeFooter",this,e),r=rs(s,"footer",this,e),o=rs(s,"afterFooter",this,e);let a=[];return a=gi(a,tr(i)),a=gi(a,tr(r)),a=gi(a,tr(o)),a}_createItems(e){const n=this._active,s=this.chart.data,i=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;le.filter(u,d,f,s))),e.itemSort&&(a=a.sort((u,d)=>e.itemSort(u,d,s))),Ot(a,u=>{const d=pE(e.callbacks,u);i.push(rs(d,"labelColor",this,u)),r.push(rs(d,"labelPointStyle",this,u)),o.push(rs(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(e,n){const s=this.options.setContext(this.getContext()),i=this._active;let r,o=[];if(!i.length)this.opacity!==0&&(r={opacity:0});else{const a=yu[s.position].call(this,i,this._eventPosition);o=this._createItems(s),this.title=this.getTitle(o,s),this.beforeBody=this.getBeforeBody(o,s),this.body=this.getBody(o,s),this.afterBody=this.getAfterBody(o,s),this.footer=this.getFooter(o,s);const l=this._size=uE(this,s),c=Object.assign({},a,l),u=dE(this.chart,s,c),d=fE(s,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),e&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,s,i){const r=this.getCaretPosition(e,s,i);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(e,n,s){const{xAlign:i,yAlign:r}=this,{caretSize:o,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Fu(a),{x:f,y:h}=e,{width:v,height:_}=n;let m,g,y,b,w,T;return r==="center"?(w=h+_/2,i==="left"?(m=f,g=m-o,b=w+o,T=w-o):(m=f+v,g=m+o,b=w-o,T=w+o),y=m):(i==="left"?g=f+Math.max(l,u)+o:i==="right"?g=f+v-Math.max(c,d)-o:g=this.caretX,r==="top"?(b=h,w=b-o,m=g-o,y=g+o):(b=h+_,w=b+o,m=g+o,y=g-o),T=b),{x1:m,x2:g,x3:y,y1:b,y2:w,y3:T}}drawTitle(e,n,s){const i=this.title,r=i.length;let o,a,l;if(r){const c=Hl(s.rtl,this.x,this.width);for(e.x=Bf(this,s.titleAlign,s),n.textAlign=c.textAlign(s.titleAlign),n.textBaseline="middle",o=Hn(s.titleFont),a=s.titleSpacing,n.fillStyle=s.titleColor,n.font=o.string,l=0;ly!==0)?(e.beginPath(),e.fillStyle=r.multiKeyBackground,H0(e,{x:_,y:v,w:c,h:l,radius:g}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),H0(e,{x:m,y:v+1,w:c-2,h:l-2,radius:g}),e.fill()):(e.fillStyle=r.multiKeyBackground,e.fillRect(_,v,c,l),e.strokeRect(_,v,c,l),e.fillStyle=o.backgroundColor,e.fillRect(m,v+1,c-2,l-2))}e.fillStyle=this.labelTextColors[s]}drawBody(e,n,s){const{body:i}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=s,d=Hn(s.bodyFont);let f=d.lineHeight,h=0;const v=Hl(s.rtl,this.x,this.width),_=function(R){n.fillText(R,v.x(e.x+h),e.y+f/2),e.y+=f+r},m=v.textAlign(o);let g,y,b,w,T,S,A;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,e.x=Bf(this,m,s),n.fillStyle=s.bodyColor,Ot(this.beforeBody,_),h=a&&m!=="right"?o==="center"?c/2+u:c+2+u:0,w=0,S=i.length;w0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,s=this.$animations,i=s&&s.x,r=s&&s.y;if(i||r){const o=yu[e.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=uE(this,e),l=Object.assign({},o,this._size),c=dE(n,e,l),u=fE(e,l,c,n);(i._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},r={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const o=Vs(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=s,this.drawBackground(r,e,i,n),Z4(e,n.textDirection),r.y+=o.top,this.drawTitle(r,e,n),this.drawBody(r,e,n),this.drawFooter(r,e,n),J4(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const s=this._active,i=e.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!ip(s,i),o=this._positionChanged(i,n);(r||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,s=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,r=this._active||[],o=this._getActiveElements(e,r,n,s),a=this._positionChanged(o,e),l=n||!ip(o,r)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),l}_getActiveElements(e,n,s,i){const r=this.options;if(e.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,r.mode,r,s);return r.reverse&&o.reverse(),o}_positionChanged(e,n){const{caretX:s,caretY:i,options:r}=this,o=yu[r.position].call(this,e,n);return o!==!1&&(s!==o.x||i!==o.y)}},xe(x_,"positioners",yu),x_);var UY={id:"tooltip",_element:mE,positioners:yu,afterInit(t,e,n){n&&(t.tooltip=new mE({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:gR},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const FY=(t,e,n,s)=>(typeof e=="string"?(n=t.push(e)-1,s.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function $Y(t,e,n,s){const i=t.indexOf(e);if(i===-1)return FY(t,e,n,s);const r=t.lastIndexOf(e);return i!==r?n:i}const BY=(t,e)=>t===null?null:Us(Math.round(t),0,e);function gE(t){const e=this.getLabels();return t>=0&&tn.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}xe(W0,"id","category"),xe(W0,"defaults",{ticks:{callback:gE}});function HY(t,e){const n=[],{bounds:i,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=t,h=r||1,v=u-1,{min:_,max:m}=e,g=!Qt(o),y=!Qt(a),b=!Qt(c),w=(m-_)/(d+1);let T=bx((m-_)/v/h)*h,S,A,R,x;if(T<1e-14&&!g&&!y)return[{value:_},{value:m}];x=Math.ceil(m/T)-Math.floor(_/T),x>v&&(T=bx(x*T/v/h)*h),Qt(l)||(S=Math.pow(10,l),T=Math.ceil(T*S)/S),i==="ticks"?(A=Math.floor(_/T)*T,R=Math.ceil(m/T)*T):(A=_,R=m),g&&y&&r&&Pq((a-o)/r,T/1e3)?(x=Math.round(Math.min((a-o)/T,u)),T=(a-o)/x,A=o,R=a):b?(A=g?o:A,R=y?a:R,x=c-1,T=(R-A)/x):(x=(R-A)/T,Du(x,Math.round(x),T/1e3)?x=Math.round(x):x=Math.ceil(x));const E=Math.max(wx(T),wx(A));S=Math.pow(10,Qt(l)?E:l),A=Math.round(A*S)/S,R=Math.round(R*S)/S;let k=0;for(g&&(f&&A!==o?(n.push({value:o}),Aa)break;n.push({value:U})}return y&&f&&R!==a?n.length&&Du(n[n.length-1].value,a,_E(a,w,t))?n[n.length-1].value=a:n.push({value:a}):(!y||R===a)&&n.push({value:R}),n}function _E(t,e,{horizontal:n,minRotation:s}){const i=ua(s),r=(n?Math.sin(i):Math.cos(i))||.001,o=.75*e*(""+t).length;return Math.min(e/r,o)}class GY extends Ic{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return Qt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:s}=this.getUserBounds();let{min:i,max:r}=this;const o=l=>i=n?i:l,a=l=>r=s?r:l;if(e){const l=uc(i),c=uc(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(i===r){let l=r===0?1:Math.abs(r*.05);a(r+l),e||o(i-l)}this.min=i,this.max=r}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:s}=e,i;return s?(i=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let s=this.getTickLimit();s=Math.max(2,s);const i={maxTicks:s,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},r=this._range||this,o=HY(i,r);return e.bounds==="ticks"&&Iq(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let n=this.min,s=this.max;if(super.configure(),this.options.offset&&e.length){const i=(s-n)/Math.max(e.length-1,1)/2;n-=i,s+=i}this._startValue=n,this._endValue=s,this._valueRange=s-n}getLabelForValue(e){return H4(e,this.chart.options.locale,this.options.ticks.format)}}class j0 extends GY{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=zs(e)?e:0,this.max=zs(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,s=ua(this.options.ticks.minRotation),i=(e?Math.sin(s):Math.cos(s))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/i))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}xe(j0,"id","linear"),xe(j0,"defaults",{ticks:{callback:z4.formatters.numeric}});const pm={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},us=Object.keys(pm);function vE(t,e){return t-e}function yE(t,e){if(Qt(e))return null;const n=t._adapter,{parser:s,round:i,isoWeekday:r}=t._parseOpts;let o=e;return typeof s=="function"&&(o=s(o)),zs(o)||(o=typeof s=="string"?n.parse(o,s):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(dc(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,i)),+o)}function bE(t,e,n,s){const i=us.length;for(let r=us.indexOf(t);r=us.indexOf(n);r--){const o=us[r];if(pm[o].common&&t._adapter.diff(i,s,o)>=e-1)return o}return us[n?us.indexOf(n):0]}function VY(t){for(let e=us.indexOf(t)+1,n=us.length;e=e?n[s]:n[i];t[r]=!0}}function WY(t,e,n,s){const i=t._adapter,r=+i.startOf(e[0].value,s),o=e[e.length-1].value;let a,l;for(a=r;a<=o;a=+i.add(a,1,s))l=n[a],l>=0&&(e[l].major=!0);return e}function xE(t,e,n){const s=[],i={},r=e.length;let o,a;for(o=0;o+e.value))}initOffsets(e=[]){let n=0,s=0,i,r;this.options.offset&&e.length&&(i=this.getDecimalForValue(e[0]),e.length===1?n=1-i:n=(this.getDecimalForValue(e[1])-i)/2,r=this.getDecimalForValue(e[e.length-1]),e.length===1?s=r:s=(r-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;n=Us(n,0,o),s=Us(s,0,o),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const e=this._adapter,n=this.min,s=this.max,i=this.options,r=i.time,o=r.unit||bE(r.minUnit,n,s,this._getLabelCapacity(n)),a=wt(i.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=dc(l)||l===!0,u={};let d=n,f,h;if(c&&(d=+e.startOf(d,"isoWeek",l)),d=+e.startOf(d,c?"day":o),e.diff(s,n,o)>1e5*a)throw new Error(n+" and "+s+" are too far apart with stepSize of "+a+" "+o);const v=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f+_)}getLabelForValue(e){const n=this._adapter,s=this.options.time;return s.tooltipFormat?n.format(e,s.tooltipFormat):n.format(e,s.displayFormats.datetime)}format(e,n){const i=this.options.time.displayFormats,r=this._unit,o=n||i[r];return this._adapter.format(e,o)}_tickFormatFunction(e,n,s,i){const r=this.options,o=r.ticks.callback;if(o)return Vt(o,[e,n,s],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=s[n],h=c&&d&&f&&f.major;return this._adapter.format(e,i||(h?d:u))}generateTickLabels(e){let n,s,i;for(n=0,s=e.length;n0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,s;if(e.length)return e;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,s=i.length;n=t[s].pos&&e<=t[i].pos&&({lo:s,hi:i}=da(t,"pos",e)),{pos:r,time:a}=t[s],{pos:o,time:l}=t[i]):(e>=t[s].time&&e<=t[i].time&&({lo:s,hi:i}=da(t,"time",e)),{time:r,pos:a}=t[s],{time:o,pos:l}=t[i]);const c=o-r;return c?a+(l-a)*(e-r)/c:a}class EE extends fd{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=Hf(n,this.min),this._tableRange=Hf(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:s}=this,i=[],r=[];let o,a,l,c,u;for(o=0,a=e.length;o=n&&c<=s&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:s,pos:1}];for(o=0,a=i.length;oi-r)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),s=this.getLabelTimestamps();return n.length&&s.length?e=this.normalize(n.concat(s)):e=n.length?n:s,e=this._cache.all=e,e}getDecimalForValue(e){return(Hf(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,s=this.getDecimalForPixel(e)/n.factor-n.end;return Hf(this._table,s*this._tableRange+this._minPos,!0)}}xe(EE,"id","timeseries"),xe(EE,"defaults",fd.defaults);const _R={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},jY={ariaLabel:{type:String},ariaDescribedby:{type:String}},qY={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},..._R,...jY},XY=z3[0]==="2"?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function al(t){return wd(t)?_t(t):t}function KY(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t;return wd(e)?new Proxy(t,{}):t}function YY(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function vR(t,e){t.labels=e}function yR(t,e,n){const s=[];t.datasets=e.map(i=>{const r=t.datasets.find(o=>o[n]===i[n]);return!r||!i.data||s.includes(r)?{...i}:(s.push(r),Object.assign(r,i),r)})}function ZY(t,e){const n={labels:[],datasets:[]};return vR(n,t.labels),yR(n,t.datasets,e),n}const JY=nt({props:qY,setup(t,e){let{expose:n,slots:s}=e;const i=Cp(null),r=kp(null);n({chart:r});const o=()=>{if(!i.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:h}=t,v=ZY(u,h),_=KY(v,u);r.value=new hm(i.value,{type:c,data:_,options:{...d},plugins:f})},a=()=>{const c=_t(r.value);c&&(t.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},t.destroyDelay):(c.destroy(),r.value=null))},l=c=>{c.update(t.updateMode)};return K1(o),Y1(a),ma([()=>t.options,()=>t.data],(c,u)=>{let[d,f]=c,[h,v]=u;const _=_t(r.value);if(!_)return;let m=!1;if(d){const g=al(d),y=al(h);g&&g!==y&&(YY(_,g),m=!0)}if(f){const g=al(f.labels),y=al(v.labels),b=al(f.datasets),w=al(v.datasets);g!==y&&(vR(_.config.data,g),m=!0),b&&b!==w&&(yR(_.config.data,b,t.datasetIdKey),m=!0)}m&&Ed(()=>{l(_)})},{deep:!0}),()=>wa("canvas",{role:"img",ariaLabel:t.ariaLabel,ariaDescribedby:t.ariaDescribedby,ref:i},[wa("p",{},[s.default?s.default():""])])}});function bR(t,e){return hm.register(e),nt({props:_R,setup(n,s){let{expose:i}=s;const r=kp(null),o=a=>{r.value=a==null?void 0:a.chart};return i({chart:r}),()=>wa(JY,XY({ref:o},{type:t,...n}))}})}const QY=bR("line",xh),eZ=bR("scatter",Eh),tZ=nt({name:"line-chart",components:{LineChart:QY},props:["title","axis","labels"],data(){return{colors:["#1f77b4","#ff7f0e","#2ca02c","#d62728"]}},computed:{chartData(){return{labels:this.labels,datasets:this.axis.map((t,e)=>({label:t.label,data:t.data,borderColor:this.colors[e],fill:!1,radius:1,pointRadius:0,lineTension:.1}))}},chartOptions(){return{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},scales:{x:{type:"linear"}},plugins:{title:{display:!0,text:this.title},tooltip:{enabled:!0,position:"average",mode:"index",intersect:!1}}}}}});function nZ(t,e,n,s,i,r){const o=Ie("LineChart",!0);return Z(),Bt(o,{data:t.chartData,options:t.chartOptions,ref:"chart"},null,8,["data","options"])}const dy=lt(tZ,[["render",nZ]]),sZ=nt({name:"StickRates",components:{LineChart:dy},setup(){return{profile:Dt()}},computed:{fileRef(){return this.$refs.file},downloadAnchorRef(){return this.$refs.downloadAnchor},currentProfile(){return this.profile.rate.rates[this.profile.rate.profile]},currentMode:{get(){return this.currentProfile.mode},set(t){const e=this.profile.rate.rates[this.profile.rate.profile].mode;this.rateBackup[e]=JSON.parse(JSON.stringify(this.profile.rate.rates[this.profile.rate.profile].rate)),this.profile.rate.rates[this.profile.rate.profile].mode=t;const n=[...this.rateBackup[t]||this.rateDefaults[t]];this.profile.rate.rates[this.profile.rate.profile].rate=n}},currentModeText(){return this.rateModes[this.currentProfile.mode].text},rateLabel(){return this.rateLabels[this.currentProfile.mode]}},data(){return{rateProfiles:[{value:0,text:"Rate Profile 1"},{value:1,text:"Rate Profile 2"}],MODE_SILVERWARE:0,MODE_BETAFLIGHT:1,MODE_ACTUAL:2,rateBackup:{},rateDefaults:[[[860,860,500],[.8,.8,.6],[.55,0,.55]],[[1.3,1.3,1.3],[.7,.7,.7],[.4,.4,.4]],[[70,70,70],[670,670,670],[0,0,0]]],rateStep:[[5,.05,.05],[.05,.05,.05],[5,5,.05]],rateLimits:[[{min:0,max:1800},{min:0,max:1},{min:0,max:1}],[{min:0,max:3},{min:0,max:3},{min:0,max:1}],[{min:0,max:500},{min:0,max:1800},{min:0,max:1}]],rateModes:[{value:0,text:"Silverware"},{value:1,text:"Betaflight"},{value:2,text:"Actual"}],plot:{axis:[],labels:[]},SILVERWARE_MAX_RATE:0,SILVERWARE_ACRO_EXPO:1,SILVERWARE_ANGLE_EXPO:2,BETAFLIGHT_RC_RATE:0,BETAFLIGHT_SUPER_RATE:1,BETAFLIGHT_EXPO:2,ACTUAL_CENTER_SENSITIVITY:0,ACTUAL_MAX_RATE:1,ACTUAL_EXPO:2,rateLabels:[["MAX_RATE","ACRO_EXPO","ANGLE_EXPO"],["RC_RATE","SUPER_RATE","EXPO"],["CENTER_SENSITIVITY","MAX_RATE","EXPO"]]}},methods:{constrain(t,e,n){return t>n?n:t2&&(r+=14.54*(r-2));let o=200*r*e;const a=this.currentProfile.rate[this.BETAFLIGHT_SUPER_RATE][t];if(a){const l=1/this.constrain(1-i*a,.01,1);o*=l}return o},calcActual(t,e){const n=this.currentProfile.rate[this.ACTUAL_EXPO][t],i=Math.abs(e)*(Math.pow(e,5)*n+e*(1-n)),r=this.currentProfile.rate[this.ACTUAL_CENTER_SENSITIVITY][t],o=this.currentProfile.rate[this.ACTUAL_MAX_RATE][t],a=Math.max(0,o-r);return e*r+a*i},update(){const t=[{label:"Roll",data:[]},{label:"Pitch",data:[]},{label:"Yaw",data:[]}],e=[];for(let n=-100;n<=100;n++){const s=n/100;e.push(""+n.toString());for(let i=0;i<3;i++)switch(this.currentProfile.mode){case this.MODE_SILVERWARE:t[i].data.push({x:n,y:this.calcSilverware(i,s)});break;case this.MODE_BETAFLIGHT:t[i].data.push({x:n,y:this.calcBetatflight(i,s)});break;case this.MODE_ACTUAL:t[i].data.push({x:n,y:this.calcActual(i,s)});break}}this.plot={labels:e,axis:t}},uploadRates(){const t=new FileReader;t.addEventListener("load",e=>{var n,s;if((n=e==null?void 0:e.target)!=null&&n.result){const i=vr.parse((s=e==null?void 0:e.target)==null?void 0:s.result);this.profile.rate.rates=[...i]}}),this.fileRef.oninput=()=>{var e,n;(n=(e=this.fileRef)==null?void 0:e.files)!=null&&n.length&&t.readAsText(this.fileRef.files[0])},this.fileRef.click()},downloadRates(){const t=vr.stringify(this.profile.rate.rates),n="data:text/yaml;charset=utf-8,"+encodeURIComponent(t),s=new Date().toISOString().substring(0,10),r=`Rates_${this.profile.meta.name.replace(/\0/g,"")}_${s}.yaml`;this.downloadAnchorRef.setAttribute("href",n),this.downloadAnchorRef.setAttribute("download",r),this.downloadAnchorRef.click()}},mounted(){this.update()}}),iZ={class:"card"},rZ={class:"card-content"},oZ={class:"content column-narrow field-is-5"},aZ={class:"columns"},lZ={class:"column is-6"},cZ={class:"field is-horizontal"},uZ={class:"field-label"},dZ={class:"label",for:"profile"},fZ={class:"field-body"},hZ={class:"field"},pZ={class:"control is-expanded"},mZ={class:"field is-horizontal"},gZ={class:"field-label"},_Z={class:"label",for:"rate-mode"},vZ={class:"field-body"},yZ={class:"field"},bZ={class:"control is-expanded"},wZ={class:"card mt-5 mb-6"},xZ={class:"card-header"},EZ={class:"card-header-title"},SZ={class:"card-content"},TZ={class:"content"},AZ={class:"column is-4"},MZ=["for"],RZ={class:"column field-body"},CZ={class:"field"},kZ={class:"control is-expanded"},PZ={class:"columns is-mobile is-multiline"},IZ={class:"column is-4"},OZ=["id","step","min","max","onUpdate:modelValue"],LZ={class:"column is-4"},DZ=["id","step","min","max","onUpdate:modelValue"],NZ={class:"column is-4"},UZ=["id","step","min","max","onUpdate:modelValue"],FZ={class:"field is-horizontal"},$Z={class:"field-label"},BZ={class:"label",for:"level-max-angle"},HZ={class:"field-body"},GZ={class:"field"},zZ={class:"control is-expanded"},VZ={class:"field is-horizontal"},WZ={class:"field-label"},jZ={class:"label",for:"sticks-deadband"},qZ={class:"field-body"},XZ={class:"field"},KZ={class:"control is-expanded"},YZ={class:"column is-6"},ZZ={class:"card-footer"},JZ={accept:".yaml",type:"file",ref:"file",style:{display:"none"}},QZ={ref:"downloadAnchor",target:"_blank"};function eJ(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("input-select"),l=Ie("LineChart"),c=Ie("spinner-btn");return Z(),re("div",iZ,[e[16]||(e[16]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Rates")],-1)),p("div",rZ,[p("div",oZ,[p("div",aZ,[p("div",lZ,[p("div",cZ,[p("div",uZ,[p("label",dZ,[e[9]||(e[9]=ye(" Profile ")),X(o,{entry:"rate.profile"})])]),p("div",fZ,[p("div",hZ,[p("div",pZ,[X(a,{id:"profile",class:"is-fullwidth",modelValue:t.profile.rate.profile,"onUpdate:modelValue":e[0]||(e[0]=u=>t.profile.rate.profile=u),modelModifiers:{number:!0},options:t.rateProfiles,onChange:e[1]||(e[1]=u=>t.update())},null,8,["modelValue","options"])])])])]),p("div",mZ,[p("div",gZ,[p("label",_Z,[e[10]||(e[10]=ye(" Mode ")),X(o,{entry:"rate.mode"})])]),p("div",vZ,[p("div",yZ,[p("div",bZ,[X(a,{id:"rate-mode",class:"is-fullwidth",modelValue:t.currentMode,"onUpdate:modelValue":e[2]||(e[2]=u=>t.currentMode=u),modelModifiers:{number:!0},options:t.rateModes,onChange:e[3]||(e[3]=u=>t.update())},null,8,["modelValue","options"])])])])]),p("div",wZ,[p("header",xZ,[p("p",EZ,$e(t.currentModeText),1)]),p("div",SZ,[p("div",TZ,[e[11]||(e[11]=_o('
Roll
Pitch
Yaw
',1)),(Z(!0),re(it,null,Ht(t.currentProfile.rate,(u,d)=>(Z(),re("div",{class:"columns is-mobile is-multiline",key:t.rateLabel[d]},[p("div",AZ,[p("label",{for:`${t.currentModeText}-${t.rateLabel[d]}`},$e(t.rateLabel[d]),9,MZ)]),p("div",RZ,[p("div",CZ,[p("div",kZ,[p("div",PZ,[p("div",IZ,[We(p("input",{class:"input",id:`${t.currentModeText}-${t.rateLabel[d]}-roll`,type:"number",step:t.rateStep[t.currentMode][d],min:t.rateLimits[t.currentMode][d].min,max:t.rateLimits[t.currentMode][d].max,"onUpdate:modelValue":f=>t.currentProfile.rate[d][0]=f,onInput:e[4]||(e[4]=f=>t.update())},null,40,OZ),[[et,t.currentProfile.rate[d][0],void 0,{number:!0}]])]),p("div",LZ,[We(p("input",{class:"input",id:`${t.currentModeText}-${t.rateLabel[d]}-pitch`,type:"number",step:t.rateStep[t.currentMode][d],min:t.rateLimits[t.currentMode][d].min,max:t.rateLimits[t.currentMode][d].max,"onUpdate:modelValue":f=>t.currentProfile.rate[d][1]=f,onInput:e[5]||(e[5]=f=>t.update())},null,40,DZ),[[et,t.currentProfile.rate[d][1],void 0,{number:!0}]])]),p("div",NZ,[We(p("input",{class:"input",id:`${t.currentModeText}-${t.rateLabel[d]}-yaw`,type:"number",step:t.rateStep[t.currentMode][d],min:t.rateLimits[t.currentMode][d].min,max:t.rateLimits[t.currentMode][d].max,"onUpdate:modelValue":f=>t.currentProfile.rate[d][2]=f,onInput:e[6]||(e[6]=f=>t.update())},null,40,UZ),[[et,t.currentProfile.rate[d][2],void 0,{number:!0}]])])])])])])]))),128))])])]),p("div",FZ,[p("div",$Z,[p("label",BZ,[e[12]||(e[12]=ye(" LevelMaxAngle ")),X(o,{entry:"rate.level_max_angle"})])]),p("div",HZ,[p("div",GZ,[p("div",zZ,[We(p("input",{class:"input",id:"level-max-angle",type:"number",step:"5","onUpdate:modelValue":e[7]||(e[7]=u=>t.profile.rate.level_max_angle=u)},null,512),[[et,t.profile.rate.level_max_angle,void 0,{number:!0}]])])])])]),p("div",VZ,[p("div",WZ,[p("label",jZ,[e[13]||(e[13]=ye(" SticksDeadband ")),X(o,{entry:"rate.sticks_deadband"})])]),p("div",qZ,[p("div",XZ,[p("div",KZ,[We(p("input",{class:"input",step:"0.01",id:"sticks-deadband",type:"number","onUpdate:modelValue":e[8]||(e[8]=u=>t.profile.rate.sticks_deadband=u)},null,512),[[et,t.profile.rate.sticks_deadband,void 0,{number:!0}]])])])])])]),p("div",YZ,[X(l,{title:"Rates",labels:t.plot.labels,axis:t.plot.axis},null,8,["labels","axis"])])])])]),p("footer",ZZ,[X(c,{class:"card-footer-item",onClick:t.downloadRates},{default:tt(()=>e[14]||(e[14]=[ye(" Save Rates ")])),_:1},8,["onClick"]),X(c,{class:"card-footer-item",onClick:t.uploadRates},{default:tt(()=>e[15]||(e[15]=[ye(" Load Rates ")])),_:1},8,["onClick"])]),p("input",JZ,null,512),p("a",QZ,null,512)])}const tJ=lt(sZ,[["render",eJ]]),nJ=nt({name:"StickRatesLegacy",components:{LineChart:dy},setup(){return{profile:Dt()}},data(){return{plotLowRates:!1,rateModes:[{value:0,text:"Silverware"},{value:1,text:"Betaflight"}],plot:{axis:[],labels:[]}}},computed:{currentMode(){return this.rateModes[this.profile.rate.mode]}},watch:{"profile.rate":{handler(t){this.update()},deep:!0},plotLowRates(){this.update()}},methods:{constrainf(t,e,n){return t>n?n:t1&&(e=1),e<-1&&(e=-1);const n=t*t*t*e+t*(1-e);return this.limitf(n,1)},calcSilverware(t,e){const n=this.profile.rate.silverware.acro_expo[t],s=this.profile.rate.silverware.max_rate[t];return this.rcexpo(e,n)*s},calcBetatflight(t,e){const i=this.profile.rate.betaflight.expo[t];e=this.rcexpo(e,i);let r=this.profile.rate.betaflight.rc_rate[t];r>2&&(r+=14.54*(r-2));const o=e>0?e:-e;let a=200*r*e;const l=this.profile.rate.betaflight.super_rate[t];if(l){const c=1/this.constrainf(1-o*l,.01,1);a*=c}return this.constrainf(a,-1998,1998)},update(){const t=[{label:"Roll",data:[]},{label:"Pitch",data:[]},{label:"Yaw",data:[]}],e=[],n=this.plotLowRates?this.profile.rate.low_rate_mulitplier:1;for(let s=-100;s<=100;s++){const i=s/100;e.push(""+s);for(let r=0;r<3;r++)this.currentMode.text=="Silverware"?t[r].data.push({x:s,y:this.calcSilverware(r,i)*n}):this.currentMode.text=="Betaflight"&&t[r].data.push({x:s,y:this.calcBetatflight(r,i)*n})}this.plot={labels:e,axis:t}}},mounted(){this.update()}}),sJ={class:"card"},iJ={class:"card-content"},rJ={class:"content column-narrow field-is-5"},oJ={class:"columns"},aJ={class:"column is-6"},lJ={class:"field is-horizontal"},cJ={class:"field-label"},uJ={class:"label",for:"rate-mode"},dJ={class:"field-body"},fJ={class:"field"},hJ={class:"control is-expanded"},pJ={class:"card mt-5 mb-6"},mJ={class:"card-header"},gJ={class:"card-header-title"},_J={class:"card-content"},vJ={class:"content"},yJ={class:"column is-4"},bJ=["for"],wJ={class:"field-body"},xJ={class:"field"},EJ={class:"control is-expanded"},SJ={class:"columns is-multiline"},TJ={class:"column is-4"},AJ=["id","onUpdate:modelValue"],MJ={class:"column is-4"},RJ=["id","onUpdate:modelValue"],CJ={class:"column is-4"},kJ=["id","onUpdate:modelValue"],PJ={class:"field is-horizontal"},IJ={class:"field-label"},OJ={class:"label",for:"level-max-angle"},LJ={class:"field-body"},DJ={class:"field"},NJ={class:"control is-expanded"},UJ={class:"field is-horizontal"},FJ={class:"field-label"},$J={class:"label",for:"low-rate-mulitplier"},BJ={class:"field-body"},HJ={class:"field"},GJ={class:"control is-expanded"},zJ={class:"field is-horizontal"},VJ={class:"field-label"},WJ={class:"label",for:"sticks-deadband"},jJ={class:"field-body"},qJ={class:"field"},XJ={class:"control is-expanded"},KJ={class:"column is-6"};function YJ(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("input-select"),l=Ie("LineChart");return Z(),re("div",sJ,[e[12]||(e[12]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Rates")],-1)),p("div",iJ,[p("div",rJ,[p("div",oJ,[p("div",aJ,[p("div",lJ,[p("div",cJ,[p("label",uJ,[e[6]||(e[6]=ye(" Mode ")),X(o,{entry:"rate.mode"})])]),p("div",dJ,[p("div",fJ,[p("div",hJ,[X(a,{id:"rate-mode",class:"is-fullwidth",modelValue:t.profile.rate.mode,"onUpdate:modelValue":e[0]||(e[0]=c=>t.profile.rate.mode=c),modelModifiers:{number:!0},options:t.rateModes,onChange:e[1]||(e[1]=c=>t.update())},null,8,["modelValue","options"])])])])]),p("div",pJ,[p("header",mJ,[p("p",gJ,$e(t.currentMode.text),1)]),p("div",_J,[p("div",vJ,[e[7]||(e[7]=_o('
Roll
Pitch
Yaw
',1)),(Z(!0),re(it,null,Ht(t.profile.rate[t.currentMode.text.toLowerCase()],(c,u)=>(Z(),re("div",{class:"columns is-multiline",key:u},[p("div",yJ,[p("label",{for:`${t.currentMode.text}-${u}`},$e(u),9,bJ)]),p("div",wJ,[p("div",xJ,[p("div",EJ,[p("div",SJ,[p("div",TJ,[We(p("input",{class:"input",id:`${t.currentMode.text}-${u}-roll`,type:"number",step:"10","onUpdate:modelValue":d=>t.profile.rate[t.currentMode.text.toLowerCase()][u][0]=d},null,8,AJ),[[et,t.profile.rate[t.currentMode.text.toLowerCase()][u][0],void 0,{number:!0}]])]),p("div",MJ,[We(p("input",{class:"input",id:`${t.currentMode.text}-${u}-pitch`,type:"number",step:"10","onUpdate:modelValue":d=>t.profile.rate[t.currentMode.text.toLowerCase()][u][1]=d},null,8,RJ),[[et,t.profile.rate[t.currentMode.text.toLowerCase()][u][1],void 0,{number:!0}]])]),p("div",CJ,[We(p("input",{class:"input",id:`${t.currentMode.text}-${u}-yaw`,type:"number",step:"10","onUpdate:modelValue":d=>t.profile.rate[t.currentMode.text.toLowerCase()][u][2]=d},null,8,kJ),[[et,t.profile.rate[t.currentMode.text.toLowerCase()][u][2],void 0,{number:!0}]])])])])])])]))),128))])])]),p("div",PJ,[p("div",IJ,[p("label",OJ,[e[8]||(e[8]=ye(" LevelMaxAngle ")),X(o,{entry:"rate.level_max_angle"})])]),p("div",LJ,[p("div",DJ,[p("div",NJ,[We(p("input",{class:"input",id:"level-max-angle",type:"number",step:"5","onUpdate:modelValue":e[2]||(e[2]=c=>t.profile.rate.level_max_angle=c)},null,512),[[et,t.profile.rate.level_max_angle,void 0,{number:!0}]])])])])]),p("div",UJ,[p("div",FJ,[p("label",$J,[e[9]||(e[9]=ye(" LowRateMulitplier ")),X(o,{entry:"rate.low_rate_mulitplier"})])]),p("div",BJ,[p("div",HJ,[p("div",GJ,[We(p("input",{class:"input",id:"low-rate-mulitplier",type:"number",step:"0.05","onUpdate:modelValue":e[3]||(e[3]=c=>t.profile.rate.low_rate_mulitplier=c)},null,512),[[et,t.profile.rate.low_rate_mulitplier,void 0,{number:!0}]])])])])]),p("div",zJ,[p("div",VJ,[p("label",WJ,[e[10]||(e[10]=ye(" SticksDeadband ")),X(o,{entry:"rate.sticks_deadband"})])]),p("div",jJ,[p("div",qJ,[p("div",XJ,[We(p("input",{class:"input",step:"0.01",id:"sticks-deadband",type:"number","onUpdate:modelValue":e[4]||(e[4]=c=>t.profile.rate.sticks_deadband=c)},null,512),[[et,t.profile.rate.sticks_deadband,void 0,{number:!0}]])])])])])]),p("div",KJ,[t.profile.rate.silverware.acro_expo?(Z(),Bt(l,{key:0,title:(t.plotLowRates?"Low ":"")+"Rates",labels:t.plot.labels,axis:t.plot.axis},null,8,["title","labels","axis"])):He("",!0),We(p("input",{id:"plotLowRates",name:"plotLowRates",type:"checkbox",class:"switch","onUpdate:modelValue":e[5]||(e[5]=c=>t.plotLowRates=c)},null,512),[[J3,t.plotLowRates]]),e[11]||(e[11]=p("label",{for:"plotLowRates"},"Plot LowRates",-1))])])])])])}const ZJ=lt(nJ,[["render",YJ]]),JJ=nt({name:"PIDRates",setup(){return{root:Xt(),profile:Dt()}},data(){return{pidProfiles:[{value:0,text:"PID Profile 1"},{value:1,text:"PID Profile 2"}],stickProfiles:[{value:0,text:"Stick Boost Profile AUX Off"},{value:1,text:"Stick Boost Profile AUX On"}],tdaOptions:[{value:0,text:"Off"},{value:1,text:"On"}],current_preset:-1}},computed:{pid_rates:{get(){return this.profile.current_pid_rate},set(t){this.profile.set_current_pid_rate(t)}},stick_rates:{get(){return this.profile.current_stick_rate},set(t){this.profile.set_current_stick_rate(t)}},presets(){return[{index:-1,name:"Choose..."},...this.root.pid_rate_presets].map(t=>({value:t.index,text:t.name}))}},methods:{load_preset(t){this.pid_rates=this.root.pid_rate_presets[t].rate}}}),QJ={class:"card"},eQ={class:"card-content"},tQ={class:"content column-narrow field-is-5"},nQ={class:"columns"},sQ={class:"column is-6"},iQ={class:"field field-is-2 is-horizontal"},rQ={class:"field-label"},oQ={class:"label",for:"pid-preset"},aQ={class:"field-body"},lQ={class:"field has-addons"},cQ={class:"control is-expanded"},uQ={class:"control"},dQ={class:"field field-is-2 is-horizontal"},fQ={class:"field-label"},hQ={class:"label",for:"pid-profile"},pQ={class:"field-body"},mQ={class:"field"},gQ={class:"control is-expanded"},_Q={class:"field-label"},vQ={class:"label"},yQ={class:"field-body"},bQ={class:"field"},wQ={class:"control is-expanded"},xQ=["id","onUpdate:modelValue"],EQ={class:"field"},SQ={class:"control is-expanded"},TQ=["id","onUpdate:modelValue"],AQ={class:"field"},MQ={class:"control is-expanded"},RQ=["id","onUpdate:modelValue"],CQ={class:"field is-horizontal mt-6"},kQ={class:"field-label"},PQ={class:"label",for:"throttle_dterm_attenuation-enable"},IQ={class:"field-body"},OQ={class:"field"},LQ={class:"control is-expanded"},DQ={class:"field is-horizontal"},NQ={class:"field-label"},UQ={class:"label",for:"throttle_dterm_attenuation-breakpoint"},FQ={class:"field-body"},$Q={class:"field"},BQ={class:"control is-expanded"},HQ={class:"field is-horizontal"},GQ={class:"field-label"},zQ={class:"label",for:"throttle_dterm_attenuation-percent"},VQ={class:"field-body"},WQ={class:"field"},jQ={class:"control is-expanded"},qQ={class:"column is-6"},XQ={class:"field field-is-2 is-horizontal"},KQ={class:"field-label"},YQ={class:"label",for:"stick-profile"},ZQ={class:"field-body"},JQ={class:"field"},QQ={class:"control is-expanded"},eee={class:"field-label"},tee={class:"label"},nee={class:"field-body"},see={class:"field"},iee={class:"control is-expanded"},ree=["id","onUpdate:modelValue"],oee={class:"field"},aee={class:"control is-expanded"},lee=["id","onUpdate:modelValue"],cee={class:"field"},uee={class:"control is-expanded"},dee=["id","onUpdate:modelValue"],fee={class:"columns mt-6 mb-1"},hee={class:"column is-4"},pee={class:"has-text-right"},mee={class:"field-label"},gee={class:"label"},_ee={class:"field-body"},vee={class:"field"},yee={class:"control is-expanded"},bee=["id","onUpdate:modelValue"],wee={class:"field"},xee={class:"control is-expanded"},Eee=["id","onUpdate:modelValue"];function See(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("input-select"),l=Ie("spinner-btn");return Z(),re("div",QJ,[e[19]||(e[19]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"PID")],-1)),p("div",eQ,[p("div",tQ,[p("div",nQ,[p("div",sQ,[p("div",iQ,[p("div",rQ,[p("label",oQ,[e[7]||(e[7]=ye(" PID Preset ")),X(o,{entry:"pid.preset"})])]),p("div",aQ,[p("div",lQ,[p("div",cQ,[X(a,{id:"pid-preset",modelValue:t.current_preset,"onUpdate:modelValue":e[0]||(e[0]=c=>t.current_preset=c),modelModifiers:{number:!0},class:"is-fullwidth",options:t.presets},null,8,["modelValue","options"])]),p("div",uQ,[X(l,{disabled:t.current_preset==-1,onClick:e[1]||(e[1]=c=>t.load_preset(t.current_preset))},{default:tt(()=>e[8]||(e[8]=[ye(" Load ")])),_:1},8,["disabled"])])])])]),p("div",dQ,[p("div",fQ,[p("label",hQ,[e[9]||(e[9]=ye(" PIDProfile ")),X(o,{entry:"pid.profile"})])]),p("div",pQ,[p("div",mQ,[p("div",gQ,[X(a,{id:"pid-profile",modelValue:t.profile.pid.pid_profile,"onUpdate:modelValue":e[2]||(e[2]=c=>t.profile.pid.pid_profile=c),modelModifiers:{number:!0},class:"is-fullwidth",options:t.pidProfiles},null,8,["modelValue","options"])])])])]),e[13]||(e[13]=_o('
Roll
Pitch
Yaw
',1)),(Z(!0),re(it,null,Ht(t.pid_rates,(c,u)=>(Z(),re("div",{key:u,class:"field field-is-2 is-horizontal"},[p("div",_Q,[p("label",vQ,$e(u),1)]),p("div",yQ,[p("div",bQ,[p("p",wQ,[We(p("input",{id:`pid-${u}-roll`,"onUpdate:modelValue":d=>t.pid_rates[u][0]=d,class:"input",type:"number",step:"1.0",min:"0"},null,8,xQ),[[et,t.pid_rates[u][0],void 0,{number:!0}]])])]),p("div",EQ,[p("p",SQ,[We(p("input",{id:`pid-${u}-pitch`,"onUpdate:modelValue":d=>t.pid_rates[u][1]=d,class:"input",type:"number",step:"1.0",min:"0"},null,8,TQ),[[et,t.pid_rates[u][1],void 0,{number:!0}]])])]),p("div",AQ,[p("p",MQ,[We(p("input",{id:`pid-${u}-yaw`,"onUpdate:modelValue":d=>t.pid_rates[u][2]=d,class:"input",type:"number",step:"1.0",min:"0"},null,8,RQ),[[et,t.pid_rates[u][2],void 0,{number:!0}]])])])])]))),128)),p("div",CQ,[p("div",kQ,[p("label",PQ,[e[10]||(e[10]=ye(" Throttle DTerm Attenuation ")),X(o,{entry:"pid.tda_active"})])]),p("div",IQ,[p("div",OQ,[p("div",LQ,[X(a,{id:"throttle_dterm_attenuation-enable",modelValue:t.profile.pid.throttle_dterm_attenuation.tda_active,"onUpdate:modelValue":e[3]||(e[3]=c=>t.profile.pid.throttle_dterm_attenuation.tda_active=c),modelModifiers:{number:!0},class:"is-fullwidth",options:t.tdaOptions},null,8,["modelValue","options"])])])])]),p("div",DQ,[p("div",NQ,[p("label",UQ,[e[11]||(e[11]=ye(" TDA Breakpoint ")),X(o,{entry:"pid.tda_breakpoint"})])]),p("div",FQ,[p("div",$Q,[p("div",BQ,[We(p("input",{id:"throttle_dterm_attenuation-breakpoint","onUpdate:modelValue":e[4]||(e[4]=c=>t.profile.pid.throttle_dterm_attenuation.tda_breakpoint=c),class:"input",type:"number",step:"0.05",min:"0"},null,512),[[et,t.profile.pid.throttle_dterm_attenuation.tda_breakpoint,void 0,{number:!0}]])])])])]),p("div",HQ,[p("div",GQ,[p("label",zQ,[e[12]||(e[12]=ye(" TDA Percent ")),X(o,{entry:"pid.tda_percent"})])]),p("div",VQ,[p("div",WQ,[p("div",jQ,[We(p("input",{id:"throttle_dterm_attenuation-percent","onUpdate:modelValue":e[5]||(e[5]=c=>t.profile.pid.throttle_dterm_attenuation.tda_percent=c),class:"input",type:"number",step:"0.05",min:"0"},null,512),[[et,t.profile.pid.throttle_dterm_attenuation.tda_percent,void 0,{number:!0}]])])])])])]),p("div",qQ,[p("div",XQ,[p("div",KQ,[p("label",YQ,[e[14]||(e[14]=ye(" Stick Boost Profile ")),X(o,{entry:"pid.stick_profile"})])]),p("div",ZQ,[p("div",JQ,[p("div",QQ,[X(a,{id:"stick-profile",modelValue:t.profile.pid.stick_profile,"onUpdate:modelValue":e[6]||(e[6]=c=>t.profile.pid.stick_profile=c),modelModifiers:{number:!0},class:"is-fullwidth",options:t.stickProfiles},null,8,["modelValue","options"])])])])]),e[18]||(e[18]=_o('
Roll
Pitch
Yaw
',1)),(Z(!0),re(it,null,Ht(t.stick_rates,(c,u)=>(Z(),re("div",{key:u,class:"field field-is-2 is-horizontal"},[p("div",eee,[p("label",tee,$e(u),1)]),p("div",nee,[p("div",see,[p("p",iee,[We(p("input",{id:`stick-${u}-roll`,"onUpdate:modelValue":d=>t.stick_rates[u][0]=d,class:"input",type:"number",step:"0.01"},null,8,ree),[[et,t.stick_rates[u][0],void 0,{number:!0}]])])]),p("div",oee,[p("p",aee,[We(p("input",{id:`stick-${u}-pitch`,"onUpdate:modelValue":d=>t.stick_rates[u][1]=d,class:"input",type:"number",step:"0.01"},null,8,lee),[[et,t.stick_rates[u][1],void 0,{number:!0}]])])]),p("div",cee,[p("p",uee,[We(p("input",{id:`stick-${u}-yaw`,"onUpdate:modelValue":d=>t.stick_rates[u][2]=d,class:"input",type:"number",step:"0.01"},null,8,dee),[[et,t.stick_rates[u][2],void 0,{number:!0}]])])])])]))),128)),p("div",fee,[p("div",hee,[p("h6",pee,[e[15]||(e[15]=ye(" Angle Strength ")),X(o,{entry:"pid.angle_strength"})])]),e[16]||(e[16]=p("div",{class:"column is-4"},[p("h6",null,"Small")],-1)),e[17]||(e[17]=p("div",{class:"column is-4"},[p("h6",null,"Big")],-1))]),(Z(),re(it,null,Ht(["kp","kd"],(c,u)=>p("div",{key:u,class:"field field-is-2 is-horizontal"},[p("div",mee,[p("label",gee,$e(c),1)]),p("div",_ee,[p("div",vee,[p("p",yee,[We(p("input",{id:`small-angle-${c}`,"onUpdate:modelValue":d=>t.profile.pid.small_angle[c]=d,class:"input",type:"number",step:"0.01"},null,8,bee),[[et,t.profile.pid.small_angle[c],void 0,{number:!0}]])])]),p("div",wee,[p("p",xee,[We(p("input",{id:`big-angle-${c}`,"onUpdate:modelValue":d=>t.profile.pid.big_angle[c]=d,class:"input",type:"number",step:"0.01"},null,8,Eee),[[et,t.profile.pid.big_angle[c],void 0,{number:!0}]])])])])])),64))])])])])])}const Tee=lt(JJ,[["render",See]]),Aee=nt({name:"FilterSettings",setup(){return{profile:Dt()}},data(){return{filterTypeOptions:[{value:0,text:"None"},{value:1,text:"PT1"},{value:2,text:"PT2"},{value:3,text:"PT3"},{value:4,text:"LULU"}],toggleOptions:[{value:0,text:"Off"},{value:1,text:"On"}]}}}),Mee={class:"card"},Ree={class:"card-header"},Cee={class:"card-content"},kee={class:"content column-narrow field-is-5"},Pee={key:0,class:"columns"},Iee={key:0,class:"column is-6"},Oee={class:"field is-horizontal"},Lee={class:"field-label"},Dee={class:"label",for:"gyro-1-type"},Nee={class:"field-body"},Uee={class:"field"},Fee={class:"control is-expanded"},$ee={class:"field is-horizontal"},Bee={class:"field-label"},Hee={class:"label",for:"gyro-1-freq"},Gee={class:"field-body"},zee={class:"field"},Vee={class:"control is-expanded"},Wee={class:"field is-horizontal mt-6"},jee={class:"field-label"},qee={class:"label",for:"gyro-2-type"},Xee={class:"field-body"},Kee={class:"field"},Yee={class:"control is-expanded"},Zee={class:"field is-horizontal"},Jee={class:"field-label"},Qee={class:"label",for:"gyro-2-freq"},ete={class:"field-body"},tte={class:"field"},nte={class:"control is-expanded"},ste={key:0,class:"field is-horizontal mt-6"},ite={class:"field-label"},rte={class:"label",for:"gyro-dynamic-enable"},ote={class:"field-body"},ate={class:"field"},lte={class:"control is-expanded"},cte={key:1,class:"column is-6"},ute={class:"field is-horizontal"},dte={class:"field-label"},fte={class:"label",for:"dterm-1-type"},hte={class:"field-body"},pte={class:"field"},mte={class:"control is-expanded"},gte={class:"field is-horizontal"},_te={class:"field-label"},vte={class:"label",for:"dterm-1-freq"},yte={class:"field-body"},bte={class:"field"},wte={class:"control is-expanded"},xte={class:"field is-horizontal mt-6"},Ete={class:"field-label"},Ste={class:"label",for:"dterm-2-type"},Tte={class:"field-body"},Ate={class:"field"},Mte={class:"control is-expanded"},Rte={class:"field is-horizontal"},Cte={class:"field-label"},kte={class:"label",for:"dterm-2-freq"},Pte={class:"field-body"},Ite={class:"field"},Ote={class:"control is-expanded"},Lte={class:"field is-horizontal mt-6"},Dte={class:"field-label"},Nte={class:"label",for:"dterm-dynamic-enable"},Ute={class:"field-body"},Fte={class:"field"},$te={class:"control is-expanded"},Bte={class:"field is-horizontal"},Hte={class:"field-label"},Gte={class:"label",for:"dterm-dynamic-min"},zte={class:"field-body"},Vte={class:"field"},Wte={class:"control is-expanded"},jte={class:"field is-horizontal"},qte={class:"field-label"},Xte={class:"label",for:"dterm-dynamic-max"},Kte={class:"field-body"},Yte={class:"field"},Zte={class:"control is-expanded"};function Jte(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("input-select");return Z(),re("div",Mee,[p("header",Ree,[e[12]||(e[12]=p("p",{class:"card-header-title"},"Filter",-1)),X(o,{class:"card-header-icon",entry:"filter.settings",size:"lg"})]),p("div",Cee,[p("div",kee,[t.profile?(Z(),re("div",Pee,[t.profile.filter.gyro?(Z(),re("div",Iee,[p("div",Oee,[p("div",Lee,[p("label",Dee,[e[13]||(e[13]=ye(" Gyro Pass 1 Type ")),X(o,{entry:"filter.gyro_1_type"})])]),p("div",Nee,[p("div",Uee,[p("div",Fee,[X(a,{id:"gyro-1-type",modelValue:t.profile.filter.gyro[0].type,"onUpdate:modelValue":e[0]||(e[0]=l=>t.profile.filter.gyro[0].type=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.filterTypeOptions},null,8,["modelValue","options"])])])])]),p("div",$ee,[p("div",Bee,[p("label",Hee,[e[14]||(e[14]=ye(" Gyro Pass 1 Freq ")),X(o,{entry:"filter.gyro_1_freq"})])]),p("div",Gee,[p("div",zee,[p("div",Vee,[We(p("input",{id:"gyro-1-freq","onUpdate:modelValue":e[1]||(e[1]=l=>t.profile.filter.gyro[0].cutoff_freq=l),class:"input",type:"number",step:"5",min:"0"},null,512),[[et,t.profile.filter.gyro[0].cutoff_freq,void 0,{number:!0}]])])])])]),p("div",Wee,[p("div",jee,[p("label",qee,[e[15]||(e[15]=ye(" Gyro Pass 2 Type ")),X(o,{entry:"filter.gyro_2_type"})])]),p("div",Xee,[p("div",Kee,[p("div",Yee,[X(a,{id:"gyro-2-type",modelValue:t.profile.filter.gyro[1].type,"onUpdate:modelValue":e[2]||(e[2]=l=>t.profile.filter.gyro[1].type=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.filterTypeOptions},null,8,["modelValue","options"])])])])]),p("div",Zee,[p("div",Jee,[p("label",Qee,[e[16]||(e[16]=ye(" Gyro Pass 2 Freq ")),X(o,{entry:"filter.gyro_2_freq"})])]),p("div",ete,[p("div",tte,[p("div",nte,[We(p("input",{id:"gyro-2-freq","onUpdate:modelValue":e[3]||(e[3]=l=>t.profile.filter.gyro[1].cutoff_freq=l),class:"input",type:"number",step:"5",min:"0"},null,512),[[et,t.profile.filter.gyro[1].cutoff_freq,void 0,{number:!0}]])])])])]),t.profile.profileVersionGt("0.2.2")?(Z(),re("div",ste,[p("div",ite,[p("label",rte,[e[17]||(e[17]=ye(" Gyro Dynamic Notch ")),X(o,{entry:"filter.gyro_dynamic_notch_enable"})])]),p("div",ote,[p("div",ate,[p("div",lte,[X(a,{id:"gyro-dynamic-enable",modelValue:t.profile.filter.gyro_dynamic_notch_enable,"onUpdate:modelValue":e[4]||(e[4]=l=>t.profile.filter.gyro_dynamic_notch_enable=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.toggleOptions},null,8,["modelValue","options"])])])])])):He("",!0)])):He("",!0),t.profile.filter.dterm?(Z(),re("div",cte,[p("div",ute,[p("div",dte,[p("label",fte,[e[18]||(e[18]=ye(" DTerm Pass 1 Type ")),X(o,{entry:"filter.dterm_1_type"})])]),p("div",hte,[p("div",pte,[p("div",mte,[X(a,{id:"dterm-1-type",modelValue:t.profile.filter.dterm[0].type,"onUpdate:modelValue":e[5]||(e[5]=l=>t.profile.filter.dterm[0].type=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.filterTypeOptions},null,8,["modelValue","options"])])])])]),p("div",gte,[p("div",_te,[p("label",vte,[e[19]||(e[19]=ye(" DTerm Pass 1 Freq ")),X(o,{entry:"filter.dterm_1_freq"})])]),p("div",yte,[p("div",bte,[p("div",wte,[We(p("input",{id:"dterm-1-freq","onUpdate:modelValue":e[6]||(e[6]=l=>t.profile.filter.dterm[0].cutoff_freq=l),class:"input",type:"number",step:"5",min:"0"},null,512),[[et,t.profile.filter.dterm[0].cutoff_freq,void 0,{number:!0}]])])])])]),p("div",xte,[p("div",Ete,[p("label",Ste,[e[20]||(e[20]=ye(" DTerm Pass 2 Type ")),X(o,{entry:"filter.dterm_2_type"})])]),p("div",Tte,[p("div",Ate,[p("div",Mte,[X(a,{id:"dterm-2-type",modelValue:t.profile.filter.dterm[1].type,"onUpdate:modelValue":e[7]||(e[7]=l=>t.profile.filter.dterm[1].type=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.filterTypeOptions},null,8,["modelValue","options"])])])])]),p("div",Rte,[p("div",Cte,[p("label",kte,[e[21]||(e[21]=ye(" DTerm Pass 2 Freq ")),X(o,{entry:"filter.dterm_2_freq"})])]),p("div",Pte,[p("div",Ite,[p("div",Ote,[We(p("input",{id:"dterm-2-freq","onUpdate:modelValue":e[8]||(e[8]=l=>t.profile.filter.dterm[1].cutoff_freq=l),class:"input",type:"number",step:"5",min:"0"},null,512),[[et,t.profile.filter.dterm[1].cutoff_freq,void 0,{number:!0}]])])])])]),p("div",Lte,[p("div",Dte,[p("label",Nte,[e[22]||(e[22]=ye(" DTerm Dynamic ")),X(o,{entry:"filter.dterm_dynamic_enable"})])]),p("div",Ute,[p("div",Fte,[p("div",$te,[X(a,{id:"dterm-dynamic-enable",modelValue:t.profile.filter.dterm_dynamic_enable,"onUpdate:modelValue":e[9]||(e[9]=l=>t.profile.filter.dterm_dynamic_enable=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.toggleOptions},null,8,["modelValue","options"])])])])]),p("div",Bte,[p("div",Hte,[p("label",Gte,[e[23]||(e[23]=ye(" DTerm Dynamic Min ")),X(o,{entry:"filter.dterm_dynamic_min"})])]),p("div",zte,[p("div",Vte,[p("div",Wte,[We(p("input",{id:"dterm-dynamic-min","onUpdate:modelValue":e[10]||(e[10]=l=>t.profile.filter.dterm_dynamic_min=l),class:"input",type:"number",step:"5",min:"0"},null,512),[[et,t.profile.filter.dterm_dynamic_min,void 0,{number:!0}]])])])])]),p("div",jte,[p("div",qte,[p("label",Xte,[e[24]||(e[24]=ye(" DTerm Dynamic Max ")),X(o,{entry:"filter.dterm_dynamic_max"})])]),p("div",Kte,[p("div",Yte,[p("div",Zte,[We(p("input",{id:"dterm-dynamic-max","onUpdate:modelValue":e[11]||(e[11]=l=>t.profile.filter.dterm_dynamic_max=l),class:"input",type:"number",step:"5",min:"0"},null,512),[[et,t.profile.filter.dterm_dynamic_max,void 0,{number:!0}]])])])])])])):He("",!0)])):He("",!0)])])])}const Qte=lt(Aee,[["render",Jte]]),ene=nt({name:"ThrottleSettings",components:{LineChart:dy},setup(){return{profile:Dt()}},data(){return{plot:{labels:["Throttle"],axis:[{label:"Throttle",data:[]}]}}},watch:{"profile.rate.throttle_expo"(){this.update()},"profile.rate.throttle_mid"(){this.update()}},methods:{constrainf(t,e,n){return t>n?n:tt.profile.rate.throttle_mid=l)},null,512),[[et,t.profile.rate.throttle_mid,void 0,{number:!0}]])])])])]),p("div",fne,[p("div",hne,[p("label",pne,[e[3]||(e[3]=ye(" Throttle Expo ")),X(o,{entry:"rate.throttle_expo"})])]),p("div",mne,[p("div",gne,[p("div",_ne,[We(p("input",{class:"input",step:"0.01",id:"throttle_expo",type:"number",min:"0",max:"1","onUpdate:modelValue":e[1]||(e[1]=l=>t.profile.rate.throttle_expo=l)},null,512),[[et,t.profile.rate.throttle_expo,void 0,{number:!0}]])])])])])]),p("div",vne,[X(a,{title:"Throttle",labels:t.plot.labels,axis:t.plot.axis},null,8,["labels","axis"])])])])])])}const bne=lt(ene,[["render",yne]]),wne=nt({name:"Rate",components:{StickRates:tJ,PIDRates:Tee,FilterSettings:Qte,StickRatesLegacy:ZJ,ThrottleSettings:bne},setup(){return{profile:Dt(),default_profile:vc()}}}),xne={class:"columns is-multiline"},Ene={class:"column is-12"},Sne={key:0,class:"column is-12"},Tne={class:"column is-12"},Ane={class:"column is-12"};function Mne(t,e,n,s,i,r){const o=Ie("StickRatesLegacy"),a=Ie("StickRates"),l=Ie("ThrottleSettings"),c=Ie("PIDRates"),u=Ie("FilterSettings");return Z(),re("div",xne,[p("div",Ene,[t.default_profile.has_legacy_stickrates?(Z(),Bt(o,{key:0})):(Z(),Bt(a,{key:1}))]),t.profile.profileVersionGt("0.2.0")?(Z(),re("div",Sne,[X(l)])):He("",!0),p("div",Tne,[X(c)]),p("div",Ane,[X(u)])])}const Rne=lt(wne,[["render",Mne]]);var wR={exports:{}},xR={exports:{}};(function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(n,s){return n<>>32-s},rotr:function(n,s){return n<<32-s|n>>>s},endian:function(n){if(n.constructor==Number)return e.rotl(n,8)&16711935|e.rotl(n,24)&4278255360;for(var s=0;s0;n--)s.push(Math.floor(Math.random()*256));return s},bytesToWords:function(n){for(var s=[],i=0,r=0;i>>5]|=n[i]<<24-r%32;return s},wordsToBytes:function(n){for(var s=[],i=0;i>>5]>>>24-i%32&255);return s},bytesToHex:function(n){for(var s=[],i=0;i>>4).toString(16)),s.push((n[i]&15).toString(16));return s.join("")},hexToBytes:function(n){for(var s=[],i=0;i>>6*(3-o)&63)):s.push("=");return s.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/ig,"");for(var s=[],i=0,r=0;i>>6-r*2);return s}};xR.exports=e})();var Cne=xR.exports,q0={utf8:{stringToBytes:function(t){return q0.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(q0.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],n=0;n + * @license MIT + */var kne=function(t){return t!=null&&(ER(t)||Pne(t)||!!t._isBuffer)};function ER(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Pne(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&ER(t.slice(0,0))}(function(){var t=Cne,e=SE.utf8,n=kne,s=SE.bin,i=function(r,o){r.constructor==String?o&&o.encoding==="binary"?r=s.stringToBytes(r):r=e.stringToBytes(r):n(r)?r=Array.prototype.slice.call(r,0):!Array.isArray(r)&&r.constructor!==Uint8Array&&(r=r.toString());for(var a=t.bytesToWords(r),l=r.length*8,c=1732584193,u=-271733879,d=-1732584194,f=271733878,h=0;h>>24)&16711935|(a[h]<<24|a[h]>>>8)&4278255360;a[l>>>5]|=128<>>9<<4)+14]=l;for(var v=i._ff,_=i._gg,m=i._hh,g=i._ii,h=0;h>>0,u=u+b>>>0,d=d+w>>>0,f=f+T>>>0}return t.endian([c,u,d,f])};i._ff=function(r,o,a,l,c,u,d){var f=r+(o&a|~o&l)+(c>>>0)+d;return(f<>>32-u)+o},i._gg=function(r,o,a,l,c,u,d){var f=r+(o&l|a&~l)+(c>>>0)+d;return(f<>>32-u)+o},i._hh=function(r,o,a,l,c,u,d){var f=r+(o^a^l)+(c>>>0)+d;return(f<>>32-u)+o},i._ii=function(r,o,a,l,c,u,d){var f=r+(a^(o|~l))+(c>>>0)+d;return(f<>>32-u)+o},i._blocksize=16,i._digestsize=16,wR.exports=function(r,o){if(r==null)throw new Error("Illegal argument "+r);var a=t.wordsToBytes(i(r,o));return o&&o.asBytes?a:o&&o.asString?s.bytesToString(a):t.bytesToHex(a)}})();var Ine=wR.exports;const SR=Ui(Ine),One=nt({name:"ReceiverSettings",data(){return{serialProto:0,elrsBindPhraseInput:""}},setup(){return{profile:Dt(),info:rn(),bind:Cv(),state:ps(),root:Xt()}},computed:{...sv(Ro,{serialProtoNames:t=>Cn(t.RXSerialProtocol).getKeys(),serialProtoOptions:t=>Cn(t.RXSerialProtocol).getKeys().map((e,n)=>({value:n,text:n==0?"AUTO":e})),RXProtocol:t=>t.RXProtocol,protoNames:t=>Cn(t.RXProtocol).getKeys(),lqiSourceNames:t=>Cn(t.LQISource).getKeys().map((e,n)=>({value:n,text:e}))}),date(){return new Date(this.profile.meta.datetime*1e3)},rx_protocol(){return this.profile.receiver.protocol||this.info.rx_protocol},protocolOptions(){return(this.info.rx_protocols||[]).filter(t=>t>0).map(t=>({value:t,text:this.protoNames[t]}))},isSpiProtocol(){return[this.RXProtocol.FRSKY_D8,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_FCC,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_LBT,this.RXProtocol.REDPINE,this.RXProtocol.FLYSKY_AFHDS,this.RXProtocol.FLYSKY_AFHDS2A].includes(this.rx_protocol)},protoStatus(){return[this.RXProtocol.FRSKY_D8,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_FCC,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_LBT,this.RXProtocol.REDPINE,this.RXProtocol.EXPRESS_LRS,this.RXProtocol.FLYSKY_AFHDS,this.RXProtocol.FLYSKY_AFHDS2A].includes(this.rx_protocol)?["RX_STATUS_NONE","RX_STATUS_BINDING","RX_STATUS_BOUND"][this.state.rx_status]:""},serialProtoStatus(){let t=0;return this.state.rx_status>=100&&this.state.rx_status<200?t=this.state.rx_status-100:this.state.rx_status>=200&&this.state.rx_status<300&&(t=this.state.rx_status-200),this.state.rx_status>=200&&this.state.rx_status<300?this.serialProtoNames[t]+" detected":"trying "+this.serialProtoNames[t]},elrsBindPhrase(){var t,e,n;return(n=(e=(t=this.bind)==null?void 0:t.info)==null?void 0:e.raw)==null?void 0:n.slice(1,7).join(", ")},elrsSwitchMode(){var t,e;return(e=(t=this.bind)==null?void 0:t.info)!=null&&e.raw[8]?"Hybrid Switches":"Wide Switches"},downloadAnchor(){return this.$refs.downloadAnchor},fileRef(){return this.$refs.file}},watch:{"profile.receiver.protocol"(){this.reset()}},methods:{async applyBindInfo(t){await this.profile.apply_profile(this.profile.$state),await this.bind.apply_bind_info(t)},parseHexString(t){const e=[];for(;t.length>=2;)e.push(parseInt(t.substring(0,2),16)),t=t.substring(2,t.length);return e},applyElrsBindPhrase(t){var i;const e=SR(`-DMY_BINDING_PHRASE="${t}"`),n=this.parseHexString(e).slice(0,6),s={...(i=this.bind)==null?void 0:i.info};s.bind_saved=1,s.raw[0]=1;for(let r=0;r<6;r++)s.raw[r+1]=n[r];return s.raw[7]=55,this.applyBindInfo(s)},applySerialBindInfo(){var n;this.serialProto==0&&this.state.rx_status>=200&&(this.serialProto=this.state.rx_status-200);const t=this.serialProto,e={...(n=this.bind)==null?void 0:n.info};for(let s=0;s0?1:0,e.raw[0]=t,this.applyBindInfo(e)},downloadBindData(){const t=window.btoa(String.fromCharCode(...new Uint8Array(this.bind.info.raw))),n="data:application/octet-stream;charset=utf-8,"+encodeURIComponent(t),s=this.date.toISOString().substring(0,10),r=`BindData_${this.profile.meta.name.replace(/\0/g,"")}_${s}.base64`;this.downloadAnchor.setAttribute("href",n),this.downloadAnchor.setAttribute("download",r),this.downloadAnchor.click()},uploadBindData(){const t=new FileReader;t.addEventListener("load",e=>{var s,i;const n={...(s=this.bind)==null?void 0:s.info};n.bind_saved=1,n.raw=Uint8Array.from(window.atob((i=e==null?void 0:e.target)==null?void 0:i.result),r=>r.charCodeAt(0)),this.applyBindInfo(n)}),this.fileRef.oninput=()=>{var e,n;(n=(e=this.fileRef)==null?void 0:e.files)!=null&&n.length&&t.readAsText(this.fileRef.files[0])},this.fileRef.click()},reset(){var e;const t={...(e=this.bind)==null?void 0:e.info};t.bind_saved=0;for(let n=0;n=200&&(this.serialProto=this.state.rx_status-200))}}),Lne={class:"card"},Dne={class:"card-header"},Nne={class:"card-content"},Une={class:"content field-is-2"},Fne={class:"field is-horizontal"},$ne={class:"field-label"},Bne={class:"label"},Hne={class:"field-body"},Gne={class:"field"},zne={class:"control is-expanded"},Vne={class:"field is-horizontal"},Wne={class:"field-label"},jne={class:"label"},qne={class:"field-body"},Xne={class:"field"},Kne={class:"control is-expanded"},Yne={class:"field is-horizontal"},Zne={class:"field-label"},Jne={class:"label"},Qne={class:"field-body"},ese={class:"field"},tse={class:"control is-expanded"},nse={class:"field is-horizontal"},sse={class:"field-body"},ise={class:"field"},rse={class:"control is-expanded"},ose={key:0,class:"card mt-4"},ase={class:"card-content"},lse={key:0,class:"content"},cse={class:"field is-horizontal"},use={class:"field-body"},dse={class:"field"},fse={class:"control is-expanded"},hse={key:0,class:"field is-horizontal"},pse={class:"field-body"},mse={class:"field"},gse={class:"control is-expanded"},_se={key:1,class:"content has-text-centered"},vse={class:"card-footer"},yse={key:1,class:"card mt-4"},bse={class:"card-content"},wse={class:"field is-horizontal"},xse={class:"field-body"},Ese={class:"field"},Sse={class:"control is-expanded"},Tse={class:"content"},Ase={class:"field is-horizontal"},Mse={class:"field-body"},Rse={class:"field"},Cse={class:"control is-expanded"},kse={class:"field is-horizontal"},Pse={class:"field-body"},Ise={class:"field"},Ose={class:"control is-expanded"},Lse={class:"field is-horizontal"},Dse={class:"field-body"},Nse={class:"field"},Use={class:"control is-expanded"},Fse={class:"card-footer"},$se={key:2,class:"card mt-4"},Bse={class:"card-content"},Hse={class:"field is-horizontal"},Gse={class:"field-body"},zse={class:"field"},Vse={class:"control is-expanded"},Wse={class:"card-footer"},jse={class:"input",accept:".base64",type:"file",ref:"file",style:{display:"none"}},qse={ref:"downloadAnchor",target:"_blank"};function Xse(t,e,n,s,i,r){const o=Ie("spinner-btn"),a=Ie("tooltip"),l=Ie("input-select");return Z(),re("div",Lne,[p("header",Dne,[e[7]||(e[7]=p("p",{class:"card-header-title"},"Receiver",-1)),X(o,{class:"card-header-button is-warning",onClick:t.reset},{default:tt(()=>e[6]||(e[6]=[ye(" Reset ")])),_:1},8,["onClick"])]),p("div",Nne,[p("div",Une,[p("div",Fne,[p("div",$ne,[p("label",Bne,[e[8]||(e[8]=ye(" Protocol ")),X(a,{entry:"receiver.protocol"})])]),p("div",Hne,[p("div",Gne,[p("div",zne,[X(l,{class:"is-fullwidth",modelValue:t.profile.receiver.protocol,"onUpdate:modelValue":e[0]||(e[0]=c=>t.profile.receiver.protocol=c),modelModifiers:{number:!0},options:t.protocolOptions},null,8,["modelValue","options"])])])])]),p("div",Vne,[p("div",Wne,[p("label",jne,[e[9]||(e[9]=ye(" LQI Source ")),X(a,{entry:"receiver.lqi_source"})])]),p("div",qne,[p("div",Xne,[p("div",Kne,[X(l,{class:"is-fullwidth",modelValue:t.profile.receiver.lqi_source,"onUpdate:modelValue":e[1]||(e[1]=c=>t.profile.receiver.lqi_source=c),modelModifiers:{number:!0},options:t.lqiSourceNames},null,8,["modelValue","options"])])])])]),p("div",Yne,[p("div",Zne,[p("label",Jne,[e[10]||(e[10]=ye(" Bind Saved ")),X(a,{entry:"receiver.bind_saved"})])]),p("div",Qne,[p("div",ese,[p("div",tse,$e(t.bind.info.bind_saved?"yes":"no"),1)])])]),p("div",nse,[e[11]||(e[11]=p("div",{class:"field-label"},[p("label",{class:"label"},"RSSI")],-1)),p("div",sse,[p("div",ise,[p("div",rse,$e(t.state.rx_rssi),1)])])]),t.bind.info.raw&&t.rx_protocol==t.RXProtocol.UNIFIED_SERIAL?(Z(),re("div",ose,[e[16]||(e[16]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Serial Protocol")],-1)),p("div",ase,[t.profile.serial.rx?(Z(),re("div",lse,[p("div",cse,[e[12]||(e[12]=p("div",{class:"field-label"},[p("label",{class:"label"}," Protocol ")],-1)),p("div",use,[p("div",dse,[p("div",fse,[X(l,{class:"is-fullwidth",modelValue:t.serialProto,"onUpdate:modelValue":e[2]||(e[2]=c=>t.serialProto=c),modelModifiers:{number:!0},options:t.serialProtoOptions},null,8,["modelValue","options"])])])])]),t.serialProto==0?(Z(),re("div",hse,[e[13]||(e[13]=p("div",{class:"field-label"},[p("label",{class:"label"},"Status")],-1)),p("div",pse,[p("div",mse,[p("div",gse,$e(t.serialProtoStatus),1)])])])):He("",!0)])):(Z(),re("div",_se," No rx serial port selected. Check setup tab. "))]),p("footer",vse,[e[15]||(e[15]=p("span",{class:"card-footer-item"},null,-1)),X(o,{class:"card-footer-item",onClick:e[3]||(e[3]=c=>t.applySerialBindInfo())},{default:tt(()=>e[14]||(e[14]=[ye(" Apply ")])),_:1})])])):He("",!0),t.bind.info.raw&&t.rx_protocol==t.RXProtocol.EXPRESS_LRS?(Z(),re("div",yse,[e[23]||(e[23]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"ExpressLRS")],-1)),p("div",bse,[p("div",wse,[e[17]||(e[17]=p("div",{class:"field-label"},[p("label",{class:"label"},"Status")],-1)),p("div",xse,[p("div",Ese,[p("div",Sse,$e(t.protoStatus),1)])])]),p("div",Tse,[p("div",Ase,[e[18]||(e[18]=p("div",{class:"field-label"},[p("label",{class:"label"},"Switch Mode")],-1)),p("div",Mse,[p("div",Rse,[p("div",Cse,$e(t.elrsSwitchMode),1)])])]),p("div",kse,[e[19]||(e[19]=p("div",{class:"field-label"},[p("label",{class:"label"},"Current Bind Phrase")],-1)),p("div",Pse,[p("div",Ise,[p("div",Ose,$e(t.elrsBindPhrase),1)])])]),p("div",Lse,[e[20]||(e[20]=p("div",{class:"field-label"},[p("label",{class:"label"},"New Bind Phrase")],-1)),p("div",Dse,[p("div",Nse,[p("div",Use,[We(p("input",{class:"input",id:"name",type:"text","onUpdate:modelValue":e[4]||(e[4]=c=>t.elrsBindPhraseInput=c)},null,512),[[et,t.elrsBindPhraseInput]])])])])])])]),p("footer",Fse,[e[22]||(e[22]=p("span",{class:"card-footer-item"},null,-1)),X(o,{class:"card-footer-item",onClick:e[5]||(e[5]=c=>t.applyElrsBindPhrase(t.elrsBindPhraseInput)),disabled:t.elrsBindPhraseInput.length<2},{default:tt(()=>e[21]||(e[21]=[ye(" Apply ")])),_:1},8,["disabled"])])])):He("",!0),t.bind.info.raw&&t.isSpiProtocol?(Z(),re("div",$se,[e[28]||(e[28]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Bind Data")],-1)),p("div",Bse,[p("div",Hse,[e[24]||(e[24]=p("div",{class:"field-label"},[p("label",{class:"label"},"Status")],-1)),p("div",Gse,[p("div",zse,[p("div",Vse,$e(t.protoStatus),1)])])]),e[25]||(e[25]=p("div",{class:"content has-text-centered"},[ye(" Save and load bind information for spi protocols."),p("br"),ye(" Requires reboot after load. ")],-1))]),p("footer",Wse,[X(o,{class:"card-footer-item",onClick:t.downloadBindData},{default:tt(()=>e[26]||(e[26]=[ye(" Save Bind Data ")])),_:1},8,["onClick"]),X(o,{class:"card-footer-item",onClick:t.uploadBindData},{default:tt(()=>e[27]||(e[27]=[ye(" Load Bind Data ")])),_:1},8,["onClick"])]),p("input",jse,null,512),p("a",qse,null,512)])):He("",!0)])])])}const Kse=lt(One,[["render",Xse]]),Yse=nt({name:"ReceiverSettingsLegacy",data(){return{lqiSourceNames:[{value:0,text:"PACKET_RATE"},{value:1,text:"CHANNEL"},{value:2,text:"DIRECT"}],elrsBindPhraseInput:""}},setup(){return{profile:Dt(),info:rn(),bind:Cv(),state:ps(),root:Xt()}},computed:{...sv(Ro,{serialProtoNames:t=>Cn(t.RXSerialProtocol).getKeys(),RXProtocol:t=>t.RXProtocol}),date(){return new Date(this.profile.meta.datetime*1e3)},protoNames(){return Cn(this.RXProtocol).getKeys()},rx_protocol(){return this.profile.receiver.protocol||this.info.rx_protocol},protocolOptions(){return(this.info.rx_protocols||[]).filter(t=>t>0).map(t=>({value:t,text:this.protoNames[t]}))},serialProto(){return this.serialProtoNames.reduce((t,e,n)=>(t[e]=n,t),{})},isSpiProtocol(){return[this.RXProtocol.FRSKY_D8,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_FCC,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_LBT,this.RXProtocol.REDPINE,this.RXProtocol.FLYSKY_AFHDS,this.RXProtocol.FLYSKY_AFHDS2A].includes(this.rx_protocol)},protoStatus(){if([this.RXProtocol.FRSKY_D8,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_FCC,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_LBT,this.RXProtocol.REDPINE,this.RXProtocol.EXPRESS_LRS,this.RXProtocol.FLYSKY_AFHDS,this.RXProtocol.FLYSKY_AFHDS2A].includes(this.rx_protocol))return["RX_STATUS_NONE","RX_STATUS_BINDING","RX_STATUS_BOUND"][this.state.rx_status];if(this.rx_protocol==this.RXProtocol.UNIFIED_SERIAL){if(this.state.rx_status<100)return"RX_STATUS_NONE";if(this.state.rx_status>=100&&this.state.rx_status<200)return"RX_STATUS_DETECTING";if(this.state.rx_status>=200&&this.state.rx_status<300)return"RX_STATUS_DETECTED"}return""},serialProtoStatus(){let t=0;return this.state.rx_status>=100&&this.state.rx_status<200?t=this.state.rx_status-100:this.state.rx_status>=200&&this.state.rx_status<300&&(t=this.state.rx_status-200),this.serialProtoNames[t]},elrsBindPhrase(){var t,e,n;return(n=(e=(t=this.bind)==null?void 0:t.info)==null?void 0:e.raw)==null?void 0:n.slice(1,7).join(", ")},elrsSwitchMode(){var t,e;return(e=(t=this.bind)==null?void 0:t.info)!=null&&e.raw[8]?"Hybrid Switches":"Wide Switches"},downloadAnchor(){return this.$refs.downloadAnchor},fileRef(){return this.$refs.file}},watch:{"profile.receiver.protocol"(){this.reset()}},methods:{async applyBindInfo(t){await this.profile.apply_profile(this.profile.$state),await this.bind.apply_bind_info(t)},parseHexString(t){const e=[];for(;t.length>=2;)e.push(parseInt(t.substring(0,2),16)),t=t.substring(2,t.length);return e},apply_elrs_bind_phrase(t){var i;const e=SR(`-DMY_BINDING_PHRASE="${t}"`),n=this.parseHexString(e).slice(0,6),s={...(i=this.bind)==null?void 0:i.info};s.bind_saved=1,s.raw[0]=1;for(let r=0;r<6;r++)s.raw[r+1]=n[r];return s.raw[7]=55,this.applyBindInfo(s)},downloadBindData(){const t=window.btoa(String.fromCharCode(...new Uint8Array(this.bind.info.raw))),n="data:application/octet-stream;charset=utf-8,"+encodeURIComponent(t),s=this.date.toISOString().substring(0,10),r=`BindData_${this.profile.meta.name.replace(/\0/g,"")}_${s}.base64`;this.downloadAnchor.setAttribute("href",n),this.downloadAnchor.setAttribute("download",r),this.downloadAnchor.click()},uploadBindData(){const t=new FileReader;t.addEventListener("load",e=>{var s,i;const n={...(s=this.bind)==null?void 0:s.info};n.bind_saved=1,n.raw=Uint8Array.from(window.atob((i=e==null?void 0:e.target)==null?void 0:i.result),r=>r.charCodeAt(0)),this.applyBindInfo(n)}),this.fileRef.oninput=()=>{var e,n;(n=(e=this.fileRef)==null?void 0:e.files)!=null&&n.length&&t.readAsText(this.fileRef.files[0])},this.fileRef.click()},reset(){var e;const t={...(e=this.bind)==null?void 0:e.info};t.bind_saved=0;for(let n=0;ne[4]||(e[4]=[ye("Reset")])),_:1},8,["onClick"])]),p("div",Qse,[p("div",eie,[t.info.rx_protocol&&!t.profile.receiver.protocol?(Z(),re("div",tie,[p("div",nie,[p("label",sie,[e[6]||(e[6]=ye(" Protocol ")),X(a,{entry:"receiver.protocol"})])]),p("div",iie,[p("div",rie,[p("div",oie,$e(t.protoNames[t.info.rx_protocol]),1)])])])):He("",!0),t.profile.receiver.protocol?(Z(),re("div",aie,[p("div",lie,[p("label",cie,[e[7]||(e[7]=ye(" Protocol ")),X(a,{entry:"receiver.protocol"})])]),p("div",uie,[p("div",die,[p("div",fie,[X(l,{class:"is-fullwidth",modelValue:t.profile.receiver.protocol,"onUpdate:modelValue":e[0]||(e[0]=c=>t.profile.receiver.protocol=c),modelModifiers:{number:!0},options:t.protocolOptions},null,8,["modelValue","options"])])])])])):He("",!0),t.info.quic_protocol_version>3?(Z(),re("div",hie,[p("div",pie,[p("label",mie,[e[8]||(e[8]=ye(" LQI Source ")),X(a,{entry:"receiver.lqi_source"})])]),p("div",gie,[p("div",_ie,[p("div",vie,[X(l,{class:"is-fullwidth",modelValue:t.profile.receiver.lqi_source,"onUpdate:modelValue":e[1]||(e[1]=c=>t.profile.receiver.lqi_source=c),modelModifiers:{number:!0},options:t.lqiSourceNames},null,8,["modelValue","options"])])])])])):He("",!0),t.info.quic_protocol_version>2?(Z(),re("div",yie,[p("div",bie,[p("label",wie,[e[9]||(e[9]=ye(" Bind Saved ")),X(a,{entry:"receiver.bind_saved"})])]),p("div",xie,[p("div",Eie,[p("div",Sie,$e(t.bind.info.bind_saved?"yes":"no"),1)])])])):He("",!0),t.info.quic_protocol_version>2?(Z(),re("div",Tie,[e[10]||(e[10]=p("div",{class:"field-label"},[p("label",{class:"label"},"RSSI")],-1)),p("div",Aie,[p("div",Mie,[p("div",Rie,$e(t.state.rx_rssi),1)])])])):He("",!0),t.info.quic_protocol_version>2?(Z(),re("div",Cie,[e[11]||(e[11]=p("div",{class:"field-label"},[p("label",{class:"label"},"Status")],-1)),p("div",kie,[p("div",Pie,[p("div",Iie,$e(t.protoStatus),1)])])])):He("",!0),t.info.quic_protocol_version>2&&t.rx_protocol==t.RXProtocol.UNIFIED_SERIAL?(Z(),re("div",Oie,[e[12]||(e[12]=p("div",{class:"field-label"},[p("label",{class:"label"},"Serial Protocol")],-1)),p("div",Lie,[p("div",Die,[p("div",Nie,$e(t.serialProtoStatus),1)])])])):He("",!0),t.bind.info.raw&&t.rx_protocol==t.RXProtocol.EXPRESS_LRS?(Z(),re("div",Uie,[e[18]||(e[18]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"ExpressLRS")],-1)),p("div",Fie,[p("div",$ie,[p("div",Bie,[e[13]||(e[13]=p("div",{class:"field-label"},[p("label",{class:"label"},"Switch Mode")],-1)),p("div",Hie,[p("div",Gie,[p("div",zie,$e(t.elrsSwitchMode),1)])])]),p("div",Vie,[e[14]||(e[14]=p("div",{class:"field-label"},[p("label",{class:"label"},"Current Bind Phrase")],-1)),p("div",Wie,[p("div",jie,[p("div",qie,$e(t.elrsBindPhrase),1)])])]),p("div",Xie,[e[15]||(e[15]=p("div",{class:"field-label"},[p("label",{class:"label"},"New Bind Phrase")],-1)),p("div",Kie,[p("div",Yie,[p("div",Zie,[We(p("input",{class:"input",id:"name",type:"text","onUpdate:modelValue":e[2]||(e[2]=c=>t.elrsBindPhraseInput=c)},null,512),[[et,t.elrsBindPhraseInput]])])])])])])]),p("footer",Jie,[e[17]||(e[17]=p("span",{class:"card-footer-item"},null,-1)),X(o,{class:"card-footer-item",onClick:e[3]||(e[3]=c=>t.apply_elrs_bind_phrase(t.elrsBindPhraseInput)),disabled:t.elrsBindPhraseInput.length<2},{default:tt(()=>e[16]||(e[16]=[ye(" Apply ")])),_:1},8,["disabled"])])])):He("",!0),t.bind.info.raw&&t.isSpiProtocol?(Z(),re("div",Qie,[e[21]||(e[21]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Bind Data")],-1)),e[22]||(e[22]=p("div",{class:"card-content"},[p("div",{class:"content has-text-centered"},[ye(" Save and load bind information for spi protocols."),p("br"),ye(" Requires reboot after load. ")])],-1)),p("footer",ere,[X(o,{class:"card-footer-item",onClick:t.downloadBindData},{default:tt(()=>e[19]||(e[19]=[ye(" Save Bind Data ")])),_:1},8,["onClick"]),X(o,{class:"card-footer-item",onClick:t.uploadBindData},{default:tt(()=>e[20]||(e[20]=[ye(" Load Bind Data ")])),_:1},8,["onClick"])]),p("input",tre,null,512),p("a",nre,null,512)])):He("",!0),e[23]||(e[23]=p("div",{class:"columns mt-4"},[p("div",{class:"column is-12 has-text-centered"},[p("small",null," When binding via your transmitter, save bind by moving your right transmitter stick UP-UP-UP followed by DOWN-DOWN-DOWN, to toggle the Bind Saved flag above. When binding via passphrase or bind data this is not required. ")])],-1))])])])}const ire=lt(Yse,[["render",sre]]),rre=nt({name:"RCChannels",setup(){return{root:Xt(),state:ps(),profile:Dt()}},data(){return{timerCount:0,timerTimeout:0,receiverChannelMappingOptions:[{value:0,text:"AETR"},{value:1,text:"TAER"}],channelNames:["Roll","Pitch","Yaw","Throttle"],wizardStates:["","Succeeded","Failed","","Recording, move sticks to extents","Testing calibration, move sticks again to extents","",""]}},computed:{channelStyle(){return this.state.rx_filtered.map((t,e)=>{if(e==3)return{"margin-left":"0%",width:2+Math.abs(t)*98+"%"};const n=2+Math.abs(t)*49;return{"margin-left":t<0?51-n+"%":"49%",width:n+"%"}})}},watch:{timerCount:{handler(t){clearTimeout(this.timerTimeout),t>0&&(this.timerTimeout=window.setTimeout(()=>{this.timerCount--},1e3))},immediate:!0},"state.stick_calibration_wizard":{handler(t){switch(t){case bl.STICK_WIZARD_SUCCESS:case bl.STICK_WIZARD_FAILED:this.timerCount=0,setTimeout(()=>this.profile.fetch_profile(),500);break;case bl.STICK_WIZARD_CAPTURE_STICKS:case bl.STICK_WIZARD_WAIT_FOR_CONFIRM:this.timerCount=19;break}},immediate:!0}}}),ore={class:"card"},are={class:"card-content"},lre={class:"content"},cre={class:"field field-is-2 is-horizontal mb-6"},ure={class:"field-label"},dre={class:"label"},fre={class:"field-body"},hre={class:"field"},pre={class:"control is-expanded"},mre={class:"field-label",style:{"align-self":"unset"}},gre={class:"label"},_re={class:"field-body columns is-mobile"},vre={class:"column field has-addons"},yre={class:"control my-0"},bre=["id","onUpdate:modelValue"],wre={class:"column field has-addons"},xre={class:"control my-0"},Ere=["id","onUpdate:modelValue"],Sre={class:"column is-6 py-0"},Tre={class:"channel-container"},Are={class:"columns is-mobile mt-5"},Mre={class:"column is-8 wizard"},Rre={key:0},Cre={class:"column is-4"};function kre(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("input-select"),l=Ie("spinner-btn");return Z(),re("div",ore,[e[9]||(e[9]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"RC Channels")],-1)),p("div",are,[p("div",lre,[p("div",cre,[p("div",ure,[p("label",dre,[e[2]||(e[2]=ye(" Channel Mapping ")),X(o,{entry:"receiver.channel_mapping"})])]),p("div",fre,[p("div",hre,[p("div",pre,[X(a,{modelValue:t.profile.receiver.channel_mapping,"onUpdate:modelValue":e[0]||(e[0]=c=>t.profile.receiver.channel_mapping=c),modelModifiers:{number:!0},class:"is-fullwidth",options:t.receiverChannelMappingOptions},null,8,["modelValue","options"])])])])]),(Z(!0),re(it,null,Ht(t.channelStyle,(c,u)=>(Z(),re("div",{key:"channel-"+u,class:"field is-horizontal"},[p("div",mre,[p("label",gre,$e(t.channelNames[u]),1)]),p("div",_re,[p("div",vre,[p("p",yre,[We(p("input",{id:`limit-${t.channelNames[u]}-min`,"onUpdate:modelValue":d=>t.profile.receiver.stick_calibration_limits[u].min=d,class:"input is-small",type:"number",step:"0.1"},null,8,bre),[[et,t.profile.receiver.stick_calibration_limits[u].min,void 0,{number:!0}]])]),e[3]||(e[3]=p("p",{class:"control"},[p("a",{class:"button is-small is-static"}," min ")],-1))]),p("div",wre,[p("p",xre,[We(p("input",{id:`limit-${t.channelNames[u]}-max`,"onUpdate:modelValue":d=>t.profile.receiver.stick_calibration_limits[u].max=d,class:"input is-small",type:"number",step:"0.1"},null,8,Ere),[[et,t.profile.receiver.stick_calibration_limits[u].max,void 0,{number:!0}]])]),e[4]||(e[4]=p("p",{class:"control"},[p("a",{class:"button is-small is-static"}," max ")],-1))])]),p("div",Sre,[p("div",Tre,[p("div",{class:"channel-bar",style:Mp(c)},$e(Math.floor(t.state.rx_filtered[u]*(u!=3?50:100))),5)])])]))),128)),p("div",Are,[p("div",Mre,[e[5]||(e[5]=ye(" Stick Calibration Wizard ")),e[6]||(e[6]=p("br",null,null,-1)),ye(" "+$e(t.wizardStates[t.state.stick_calibration_wizard])+" ",1),e[7]||(e[7]=p("br",null,null,-1)),t.timerCount?(Z(),re("span",Rre,"Continuing in "+$e(t.timerCount)+"s..",1)):He("",!0)]),p("div",Cre,[X(l,{class:"is-pulled-right is-primary",onClick:e[1]||(e[1]=c=>t.root.cal_sticks())},{default:tt(()=>e[8]||(e[8]=[ye(" Calibrate ")])),_:1})])])])])])}const Pre=lt(rre,[["render",kre],["__scopeId","data-v-762b786e"]]),Ire=nt({name:"AuxChannels",setup(){return{state:ps(),profile:Dt()}},computed:{...sv(Ro,{auxChannels:t=>Cn(t.AuxChannels).map((e,n)=>({text:n,value:e})),auxFunctions:t=>Cn(t.AuxFunctions).getKeys().map((e,n)=>({index:n,key:e})).filter(e=>!e.key.startsWith("_"))})},methods:{valueForIndex(t){return this.state.aux[t]},classForIndex(t){return this.profile.receiver.aux?this.profile.receiver.aux[t]==12?"has-text-danger":this.profile.receiver.aux[t]==13||this.valueForIndex(this.profile.receiver.aux[t])?"has-text-success":"has-text-danger":""}}}),Ore={class:"card"},Lre={class:"card-content"},Dre={class:"content"},Nre={class:"columns"},Ure={class:"column is-8"},Fre={class:"field-label"},$re=["for"],Bre={class:"field-body"},Hre={class:"field"},Gre={class:"control is-expanded"},zre={class:"column is-4 is-hidden-mobile"},Vre={class:"card"},Wre={class:"card-content"},jre={class:"content"},qre={class:"column is-6 py-1"},Xre={class:"column is-6 py-1"},Kre=["id","name","checked"],Yre=["for"];function Zre(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("input-select");return Z(),re("div",Ore,[e[1]||(e[1]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Aux Channels")],-1)),p("div",Lre,[p("div",Dre,[p("div",Nre,[p("div",Ure,[(Z(!0),re(it,null,Ht(t.auxFunctions,l=>(Z(),re("div",{key:l.key,class:"field field-is-3 is-horizontal mr-4"},[p("div",Fre,[p("label",{class:ds(["label",t.classForIndex(l.index)]),for:l.key},[ye($e(l.key)+" ",1),X(o,{entry:"channel."+l.key.toLowerCase()},null,8,["entry"])],10,$re)]),p("div",Bre,[p("div",Hre,[p("div",Gre,[X(a,{id:l.key,modelValue:t.profile.receiver.aux[l.index],"onUpdate:modelValue":c=>t.profile.receiver.aux[l.index]=c,modelModifiers:{number:!0},class:"is-fullwidth",options:t.auxChannels},null,8,["id","modelValue","onUpdate:modelValue","options"])])])])]))),128))]),p("div",zre,[p("div",Vre,[e[0]||(e[0]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Current AUX State")],-1)),p("div",Wre,[p("div",jre,[(Z(!0),re(it,null,Ht(t.auxChannels,(l,c)=>(Z(),re("div",{key:l.text,class:"columns"},[p("div",qre,$e(l.text),1),p("div",Xre,[p("input",{type:"checkbox",class:"switch is-rounded",id:"active-"+c,name:"active-"+c,checked:t.valueForIndex(c),onclick:"return false;"},null,8,Kre),p("label",{class:"py-0",for:"active-"+c,style:{height:"2em",cursor:"default"}},null,8,Yre)])]))),128))])])])])])])])])}const Jre=lt(Ire,[["render",Zre]]),Qre=nt({name:"Receiver",components:{ReceiverSettings:Kse,ReceiverSettingsLegacy:ire,RCChannels:Pre,AuxChannels:Jre},setup(){return{info:rn()}}}),eoe={class:"columns is-multiline"},toe={class:"column is-12"},noe={key:0,class:"column is-12"},soe={class:"column is-12"};function ioe(t,e,n,s,i,r){const o=Ie("ReceiverSettings"),a=Ie("ReceiverSettingsLegacy"),l=Ie("RCChannels"),c=Ie("AuxChannels");return Z(),re("div",eoe,[p("div",toe,[t.info.quic_semver_gt("0.1.0")?(Z(),Bt(o,{key:0})):(Z(),Bt(a,{key:1}))]),t.info.quic_semver_gt("0.1.0")?(Z(),re("div",noe,[X(l)])):He("",!0),p("div",soe,[X(c)])])}const roe=lt(Qre,[["render",ioe]]),fy=Vn("osd",{state:()=>({font_raw:void 0,font_bitmap:void 0,font_bitmap_inverted:void 0}),actions:{async fetch_sd_osd_font(){if(!rn().quic_semver_gte("0.2.0"))return gt.get(en.OSDFont).then(n=>{this.font_raw=n,this.font_bitmap=Ve.unpackFontBitmap(n),this.font_bitmap_inverted=Ve.unpackFontBitmap(n,!0)});const e=[];for(let n=0;n<256;n++){const s=await gt.command(xn.OSD,H_.ReadChar,n);e[n]=s.payload[0]}this.font_raw=e,this.font_bitmap=Ve.unpackFontBitmap(e),this.font_bitmap_inverted=Ve.unpackFontBitmap(e,!0)},async apply_font(t){if(!rn().quic_semver_gte("0.2.0"))return gt.set(en.OSDFont,...t);for(let n=0;n<256;n++)await gt.command(xn.OSD,H_.WriteChar,n,t[n])},fetch_hd_osd_font(){return new Promise((t,e)=>{const n=new Image;n.onload=()=>{t(n)},n.src="osd/hdzero_quic.png"}).then(t=>createImageBitmap(t)).then(t=>{this.font_raw=void 0,this.font_bitmap=t,this.font_bitmap_inverted=void 0})}}});function ooe(t,e,n,s,i,r){return s<2*r&&(r=s/2),i<2*r&&(r=i/2),t.beginPath(),t.moveTo(e+r,n),t.arcTo(e+s,n,e+s,n+i,r),t.arcTo(e+s,n+i,e,n+i,r),t.arcTo(e,n+i,e,n,r),t.arcTo(e,n,e+s,n,r),t.closePath(),t}const aoe=nt({name:"OSDElements",setup(){return{profile:Dt(),osd:fy()}},data(){return{preview:"NTSC",osdProfile:0,osdProfileOptions:[{text:"Profile 1",value:0},{text:"Profile 2",value:1}],drag:{element:-1,colOffset:0,coord:{x:0,y:0}}}},computed:{is_hd(){return this.profile.serial.hdzero>0},currentProfile(){return this.profile.osd.profiles[this.osdProfile]},limits(){return{width:this.is_hd?50:30,height:this.is_hd?18:15}},screen(){const t={...this.limits};return!this.is_hd&&this.preview=="NTSC"&&(t.height-=2),t},canvas(){return this.$refs.canvas},canvasWidth(){return this.screen.width*Ve.CHAR_WIDTH},canvasHeight(){return this.screen.height*Ve.CHAR_HEIGHT},elementOptions(){const t=[{name:"CALLSIGN",enabled:!0,text:this.callsign},{name:"CELL COUNT",enabled:!0,text:"1S"},{name:"FUELGAUGE VOLTS",enabled:!0,text:" 4.3p"},{name:"FILTERED VOLTS",enabled:!0,text:" 4.3"},{name:"GYRO TEMP",enabled:!0,text:" 40"},{name:"FLIGHT MODE",enabled:!0,text:" ACRO "},{name:"RSSI",enabled:!0,text:" 90"},{name:"STOPWATCH",enabled:!0,text:"01:20"},{name:"SYSTEM STATUS",enabled:!0,text:" **FAILSAFE** "},{name:"THROTTLE",enabled:!0,text:" 50"},{name:"VTX CHANNEL",enabled:!0,text:"R:7:1"},{name:"CURRENT",enabled:!0,text:"0.00š"}];return this.profile.profileVersionGt("0.2.2")&&t.push({name:"CROSSHAIR",enabled:!0,text:"rst"}),this.profile.profileVersionGt("0.2.3")&&t.push({name:"CURRENT DRAWN",enabled:!0,text:"0.00\x07"}),t},elements(){return this.currentProfile.elements.filter((t,e)=>this.elementOptions[e]).map((t,e)=>({index:e,...this.elementOptions[e],active:Ve.elementDecode(t,"active"),invert:Ve.elementDecode(t,"invert"),pos:{x:Ve.elementDecode(t,this.is_hd?"pos_hd_x":"pos_sd_x"),y:Ve.elementDecode(t,this.is_hd?"pos_hd_y":"pos_sd_y")},value:t}))},callsign:{set(t){let e=t.toUpperCase();for(let n=t.length;n<36;n++)e+="\0";this.profile.osd.profiles[this.osdProfile].callsign=e},get(){return this.profile.osd.profiles[this.osdProfile].callsign.replace(/\0/g,"")}}},watch:{elements(){this.draw_canvas()},drag(){this.draw_canvas()},canvasWidth(){this.$nextTick(()=>{this.draw_canvas()})},canvasHeight(){this.$nextTick(()=>{this.draw_canvas()})},"osd.font_bitmap"(){this.$nextTick(()=>{this.draw_canvas()})}},methods:{translateMouse(t){return{x:t.offsetX*(this.canvasWidth/this.canvas.clientWidth),y:t.offsetY*(this.canvasHeight/this.canvas.clientHeight)}},translateElemement(t){return!this.is_hd&&this.preview=="NTSC"&&t.y>12&&(t.y-=2),{x:t.x*Ve.CHAR_WIDTH,y:Ve.CHAR_HEIGHT-2+(t.y-1)*Ve.CHAR_HEIGHT}},normalizeCoords(t,e=0){return{x:Math.min(Math.max(Math.floor((t.x-e)/Ve.CHAR_WIDTH),0),this.limits.width-1),y:Math.min(Math.max(Math.floor(t.y/Ve.CHAR_HEIGHT),0),this.limits.height-1)}},drag_start(t){t.preventDefault(),t.stopPropagation();const e=this.translateMouse(t),n=this.findElement(e);if(n!=null){const s=this.translateElemement(n.pos),i=e.x-s.x;this.drag={element:n.index,colOffset:i,coord:this.normalizeCoords(e,i)},this.canvas.style.cursor="grab"}},drag_move(t){t.preventDefault(),t.stopPropagation();const e=this.translateMouse(t);if(this.drag.element==-1){const n=this.findElement(e);this.canvas.style.cursor=n!=null?"pointer":"initial";return}this.drag={...this.drag,coord:this.normalizeCoords(e,this.drag.colOffset)}},drag_drop(t){t.preventDefault(),t.stopPropagation();const e=this.translateMouse(t);if(this.drag.element==-1)return;const n=this.normalizeCoords(e,this.drag.colOffset);this.osd_set(this.drag.element,this.is_hd?"pos_hd_x":"pos_sd_x",n.x),this.osd_set(this.drag.element,this.is_hd?"pos_hd_y":"pos_sd_y",n.y),this.canvas.style.cursor="initial",this.drag={element:-1,colOffset:0,coord:{x:0,y:0}}},osd_set(t,e,n){const s=this.currentProfile.elements,i=[...s];i[t]=Ve.elementEncode(s[t],e,n),this.profile.osd.profiles[this.osdProfile]={...this.profile.osd.profiles[this.osdProfile],elements:i}},draw_canvas_text(t,e,n,s){let i=0;for(let r=0;rn.y+Ve.CHAR_HEIGHT)continue;let s=e.text.indexOf("\0");if(s==-1&&(s=e.text.length),!(t.xn.x+s*Ve.CHAR_WIDTH))return e}return null}},mounted(){Promise.resolve().then(()=>{if(this.is_hd)return this.osd.fetch_hd_osd_font()}).then(t=>this.draw_canvas())}}),loe={class:"card"},coe={class:"card-header"},uoe={class:"card-content"},doe={class:"content"},foe={class:"columns is-multiline"},hoe={class:"column is-6"},poe={class:"field field-is-2 is-horizontal"},moe={class:"field-body"},goe={class:"field"},_oe={class:"control is-expanded"},voe={class:"field field-is-2 is-horizontal"},yoe={class:"field-body"},boe={class:"field"},woe={class:"control is-expanded"},xoe={key:0,class:"field mb-2 field-is-2 is-horizontal"},Eoe={class:"field-label"},Soe={class:"label",for:"pid-preset"},Toe={class:"field-body columns is-mobile"},Aoe={class:"column field"},Moe={class:"control is-expanded"},Roe=["id","name","checked","onInput"],Coe=["for"],koe={class:"column field"},Poe={class:"control is-expanded"},Ioe=["id","name","checked","onInput"],Ooe=["for"],Loe={class:"column field",style:{"align-self":"center"}},Doe={class:"control is-expanded"},Noe=["value","max","onInput"],Uoe={class:"column field",style:{"align-self":"center"}},Foe={class:"control is-expanded"},$oe=["value","max","onInput"],Boe={class:"column is-6"},Hoe={class:"card"},Goe={class:"card-header"},zoe={class:"card-header-title"},Voe={key:0,class:"select ml-4"},Woe={class:"card-content"},joe={class:"content"},qoe=["width","height"];function Xoe(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("input-select");return Z(),re("div",loe,[p("header",coe,[e[7]||(e[7]=p("p",{class:"card-header-title"},"Elements",-1)),X(o,{class:"card-header-icon",entry:"osd.elements",size:"lg"})]),p("div",uoe,[p("div",doe,[p("div",foe,[p("div",hoe,[p("div",poe,[e[8]||(e[8]=p("div",{class:"field-label"},[p("label",{class:"label"}," Profile ")],-1)),p("div",moe,[p("div",goe,[p("div",_oe,[X(a,{id:"font-file",class:"is-fullwidth",modelValue:t.osdProfile,"onUpdate:modelValue":e[0]||(e[0]=l=>t.osdProfile=l),options:t.osdProfileOptions},null,8,["modelValue","options"])])])])]),p("div",voe,[e[9]||(e[9]=p("div",{class:"field-label"},[p("label",{class:"label"}," Callsign Text ")],-1)),p("div",yoe,[p("div",boe,[p("div",woe,[We(p("input",{class:"input",type:"text","onUpdate:modelValue":e[1]||(e[1]=l=>t.callsign=l)},null,512),[[et,t.callsign]])])])])]),e[10]||(e[10]=_o('
Element
Active
Invert
X
Y
',1)),(Z(!0),re(it,null,Ht(t.elements,(l,c)=>(Z(),re(it,{key:c},[l.enabled?(Z(),re("div",xoe,[p("div",Eoe,[p("label",Soe,$e(l.name),1)]),p("div",Toe,[p("div",Aoe,[p("div",Moe,[p("input",{id:"active-"+c,name:"active-"+c,type:"checkbox",class:"switch",checked:l.active==1,onInput:u=>t.osd_set(c,"active",!l.active)},null,40,Roe),p("label",{class:"py-0",style:{height:"2em"},for:"active-"+c},null,8,Coe)])]),p("div",koe,[p("div",Poe,[p("input",{id:"invert-"+c,name:"invert-"+c,type:"checkbox",class:"switch",checked:l.invert==1,onInput:u=>t.osd_set(c,"invert",!l.invert)},null,40,Ioe),p("label",{class:"py-0",style:{height:"2em"},for:"invert-"+c},null,8,Ooe)])]),p("div",Loe,[p("div",Doe,[p("input",{class:"input",type:"number",step:"1",value:l.pos.x,min:"0",max:t.limits.width-1,onInput:u=>{var d;return t.osd_set(c,"pos_x",(d=u==null?void 0:u.target)==null?void 0:d.value)}},null,40,Noe)])]),p("div",Uoe,[p("div",Foe,[p("input",{class:"input",type:"number",step:"1",value:l.pos.y,min:"0",max:t.limits.height-1,onInput:u=>{var d;return t.osd_set(c,"pos_y",(d=u==null?void 0:u.target)==null?void 0:d.value)}},null,40,$oe)])])])])):He("",!0)],64))),128))]),p("div",Boe,[p("div",Hoe,[p("header",Goe,[p("div",zoe,[e[12]||(e[12]=ye(" Preview ")),t.is_hd?He("",!0):(Z(),re("div",Voe,[We(p("select",{"onUpdate:modelValue":e[2]||(e[2]=l=>t.preview=l)},e[11]||(e[11]=[p("option",null,"NTSC",-1),p("option",null,"PAL",-1)]),512),[[Td,t.preview]])]))])]),p("div",Woe,[p("div",joe,[p("canvas",{width:t.canvasWidth,height:t.canvasHeight,ref:"canvas",class:"osd-canvas",onMousedown:e[3]||(e[3]=(...l)=>t.drag_start&&t.drag_start(...l)),onMousemove:e[4]||(e[4]=(...l)=>t.drag_move&&t.drag_move(...l)),onMouseup:e[5]||(e[5]=(...l)=>t.drag_drop&&t.drag_drop(...l)),onMouseleave:e[6]||(e[6]=(...l)=>t.drag_drop&&t.drag_drop(...l))},null,40,qoe)])])])])])])])])}const Koe=lt(aoe,[["render",Xoe],["__scopeId","data-v-66826aed"]]);function Yoe(t,e,n,s,i,r){return s<2*r&&(r=s/2),i<2*r&&(r=i/2),t.beginPath(),t.moveTo(e+r,n),t.arcTo(e+s,n,e+s,n+i,r),t.arcTo(e+s,n+i,e,n+i,r),t.arcTo(e,n+i,e,n,r),t.arcTo(e,n,e+s,n,r),t.closePath(),t}const Zoe=nt({name:"OSDElements",setup(){return{profile:Dt(),osd:fy()}},data(){return{preview:"NTSC",drag:{element:-1,colOffset:0,coord:{x:0,y:0}}}},computed:{is_hd(){return this.profile.serial.hdzero>0},currentElements(){return this.is_hd?this.profile.osd.elements_hd:this.profile.osd.elements},limits(){return{width:this.is_hd?50:30,height:this.is_hd?18:15}},screen(){const t={...this.limits};return!this.is_hd&&this.preview=="NTSC"&&(t.height-=2),t},canvas(){return this.$refs.canvas},canvasWidth(){return this.screen.width*Ve.CHAR_WIDTH},canvasHeight(){return this.screen.height*Ve.CHAR_HEIGHT},elementOptions(){const t=[{name:"CALLSIGN",enabled:!0,text:this.profile.osd.callsign},{name:"CELL COUNT",enabled:!0,text:"1S"},{name:"FUELGAUGE VOLTS",enabled:!0,text:" 4.3p"},{name:"FILTERED VOLTS",enabled:!0,text:" 4.3"},{name:"GYRO TEMP",enabled:!0,text:" 40"},{name:"FLIGHT MODE",enabled:!0,text:" ACRO "},{name:"RSSI",enabled:!0,text:" 90"},{name:"STOPWATCH",enabled:!0,text:"01:20"},{name:"SYSTEM STATUS",enabled:!0,text:" **FAILSAFE** "},{name:"THROTTLE",enabled:!0,text:" 50"},{name:"VTX CHANNEL",enabled:!0,text:"R:7:1"},{name:"CURRENT",enabled:!0,text:"0.00š"}];return this.profile.profileVersionGt("0.2.2")&&t.push({name:"CROSSHAIR",enabled:!0,text:"rst"}),this.profile.profileVersionGt("0.2.3")&&t.push({name:"CURRENT DRAWN",enabled:!0,text:"0.00\x07"}),t},elements(){return this.currentElements.filter((t,e)=>this.elementOptions[e]).map((t,e)=>({index:e,...this.elementOptions[e],active:Ve.elementDecodeLegacy(t,"active"),invert:Ve.elementDecodeLegacy(t,"invert"),pos:{x:Ve.elementDecodeLegacy(t,"pos_x"),y:Ve.elementDecodeLegacy(t,"pos_y")},value:t}))},callsign:{set(t){let e=t.toUpperCase();for(let n=t.length;n<36;n++)e+="\0";this.profile.osd.callsign=e},get(){return this.profile.osd.callsign.replace(/\0/g,"")}}},watch:{elements(){this.draw_canvas()},drag(){this.draw_canvas()},canvasWidth(){this.$nextTick(()=>{this.draw_canvas()})},canvasHeight(){this.$nextTick(()=>{this.draw_canvas()})},"osd.font_bitmap"(){this.$nextTick(()=>{this.draw_canvas()})}},methods:{translateMouse(t){return{x:t.offsetX*(this.canvasWidth/this.canvas.clientWidth),y:t.offsetY*(this.canvasHeight/this.canvas.clientHeight)}},translateElemement(t){return!this.is_hd&&this.preview=="NTSC"&&t.y>12&&(t.y-=2),{x:t.x*Ve.CHAR_WIDTH,y:Ve.CHAR_HEIGHT-2+(t.y-1)*Ve.CHAR_HEIGHT}},normalizeCoords(t,e=0){return{x:Math.min(Math.max(Math.floor((t.x-e)/Ve.CHAR_WIDTH),0),this.limits.width-1),y:Math.min(Math.max(Math.floor(t.y/Ve.CHAR_HEIGHT),0),this.limits.height-1)}},drag_start(t){t.preventDefault(),t.stopPropagation();const e=this.translateMouse(t),n=this.findElement(e);if(n!=null){const s=this.translateElemement(n.pos),i=e.x-s.x;this.drag={element:n.index,colOffset:i,coord:this.normalizeCoords(e,i)},this.canvas.style.cursor="grab"}},drag_move(t){t.preventDefault(),t.stopPropagation();const e=this.translateMouse(t);if(this.drag.element==-1){const n=this.findElement(e);this.canvas.style.cursor=n!=null?"pointer":"initial";return}this.drag={...this.drag,coord:this.normalizeCoords(e,this.drag.colOffset)}},drag_drop(t){t.preventDefault(),t.stopPropagation();const e=this.translateMouse(t);if(this.drag.element==-1)return;const n=this.normalizeCoords(e,this.drag.colOffset);this.osd_set(this.drag.element,"pos_x",n.x),this.osd_set(this.drag.element,"pos_y",n.y),this.canvas.style.cursor="initial",this.drag={element:-1,colOffset:0,coord:{x:0,y:0}}},osd_set(t,e,n){const s=this.is_hd?this.profile.osd.elements_hd:this.profile.osd.elements,i=[...s];i[t]=Ve.elementEncodeLegacy(s[t],e,n),this.is_hd?this.profile.set_osd_elements_hd(i):this.profile.set_osd_elements(i)},draw_canvas_text(t,e,n,s){let i=0;for(let r=0;rn.y+Ve.CHAR_HEIGHT)continue;let s=e.text.indexOf("\0");if(s==-1&&(s=e.text.length),!(t.xn.x+s*Ve.CHAR_WIDTH))return e}return null}},mounted(){Promise.resolve().then(()=>{if(this.is_hd)return this.osd.fetch_hd_osd_font()}).then(t=>this.draw_canvas())}}),Joe={class:"card"},Qoe={class:"card-header"},eae={class:"card-content"},tae={class:"content"},nae={class:"columns is-multiline"},sae={class:"column is-6"},iae={class:"field field-is-2 is-horizontal"},rae={class:"field-body"},oae={class:"field"},aae={class:"control is-expanded"},lae={key:0,class:"field mb-2 field-is-2 is-horizontal"},cae={class:"field-label"},uae={class:"label",for:"pid-preset"},dae={class:"field-body"},fae={class:"field"},hae={class:"control is-expanded"},pae=["id","name","checked","onInput"],mae=["for"],gae={class:"field"},_ae={class:"control is-expanded"},vae=["id","name","checked","onInput"],yae=["for"],bae={class:"field",style:{"align-self":"center"}},wae={class:"control is-expanded"},xae=["value","max","onInput"],Eae={class:"field",style:{"align-self":"center"}},Sae={class:"control is-expanded"},Tae=["value","max","onInput"],Aae={class:"column is-6"},Mae={class:"card"},Rae={class:"card-header"},Cae={class:"card-header-title"},kae={key:0,class:"select ml-4"},Pae={class:"card-content"},Iae={class:"content"},Oae=["width","height"];function Lae(t,e,n,s,i,r){const o=Ie("tooltip");return Z(),re("div",Joe,[p("header",Qoe,[e[6]||(e[6]=p("p",{class:"card-header-title"},"Elements",-1)),X(o,{class:"card-header-icon",entry:"osd.elements",size:"lg"})]),p("div",eae,[p("div",tae,[p("div",nae,[p("div",sae,[p("div",iae,[e[7]||(e[7]=p("div",{class:"field-label"},[p("label",{class:"label"}," Callsign Text ")],-1)),p("div",rae,[p("div",oae,[p("div",aae,[We(p("input",{class:"input",type:"text","onUpdate:modelValue":e[0]||(e[0]=a=>t.callsign=a)},null,512),[[et,t.callsign]])])])])]),e[8]||(e[8]=_o('
Element
Active
Invert
X
Y
',1)),(Z(!0),re(it,null,Ht(t.elements,(a,l)=>(Z(),re(it,{key:l},[a.enabled?(Z(),re("div",lae,[p("div",cae,[p("label",uae,$e(a.name),1)]),p("div",dae,[p("div",fae,[p("div",hae,[p("input",{id:"active-"+l,name:"active-"+l,type:"checkbox",class:"switch",checked:a.active==1,onInput:c=>t.osd_set(l,"active",!a.active)},null,40,pae),p("label",{class:"py-0",style:{height:"2em"},for:"active-"+l},null,8,mae)])]),p("div",gae,[p("div",_ae,[p("input",{id:"invert-"+l,name:"invert-"+l,type:"checkbox",class:"switch",checked:a.invert==1,onInput:c=>t.osd_set(l,"invert",!a.invert)},null,40,vae),p("label",{class:"py-0",style:{height:"2em"},for:"invert-"+l},null,8,yae)])]),p("div",bae,[p("div",wae,[p("input",{class:"input",type:"number",step:"1",value:a.pos.x,min:"0",max:t.limits.width-1,onInput:c=>{var u;return t.osd_set(l,"pos_x",(u=c==null?void 0:c.target)==null?void 0:u.value)}},null,40,xae)])]),p("div",Eae,[p("div",Sae,[p("input",{class:"input",type:"number",step:"1",value:a.pos.y,min:"0",max:t.limits.height-1,onInput:c=>{var u;return t.osd_set(l,"pos_y",(u=c==null?void 0:c.target)==null?void 0:u.value)}},null,40,Tae)])])])])):He("",!0)],64))),128))]),p("div",Aae,[p("div",Mae,[p("header",Rae,[p("div",Cae,[e[10]||(e[10]=ye(" Preview ")),t.is_hd?He("",!0):(Z(),re("div",kae,[We(p("select",{"onUpdate:modelValue":e[1]||(e[1]=a=>t.preview=a)},e[9]||(e[9]=[p("option",null,"NTSC",-1),p("option",null,"PAL",-1)]),512),[[Td,t.preview]])]))])]),p("div",Pae,[p("div",Iae,[p("canvas",{width:t.canvasWidth,height:t.canvasHeight,ref:"canvas",class:"osd-canvas",onMousedown:e[2]||(e[2]=(...a)=>t.drag_start&&t.drag_start(...a)),onMousemove:e[3]||(e[3]=(...a)=>t.drag_move&&t.drag_move(...a)),onMouseup:e[4]||(e[4]=(...a)=>t.drag_drop&&t.drag_drop(...a)),onMouseleave:e[5]||(e[5]=(...a)=>t.drag_drop&&t.drag_drop(...a))},null,40,Oae)])])])])])])])])}const Dae=lt(Zoe,[["render",Lae],["__scopeId","data-v-7704d1bb"]]),Nae=t=>new Promise((e,n)=>{const s=new Image;s.onload=()=>e(s),s.onerror=i=>n(i),s.src=t}),Uae=nt({name:"OSDFont",data(){return{fontFiles:[{text:"betaflight",value:"betaflight.png"},{text:"bold",value:"bold.png"},{text:"clarity",value:"clarity.png"},{text:"default",value:"default.png"},{text:"digital",value:"digital.png"},{text:"extra_large",value:"extra_large.png"},{text:"impact_mini",value:"impact_mini.png"},{text:"impact",value:"impact.png"},{text:"large",value:"large.png"},{text:"vision",value:"vision.png"}],current_font_file:"clarity.png",imageSource:void 0}},setup(){return{root:Xt(),profile:Dt(),osd:fy()}},methods:{apply_osd_font(t){return Nae("osd/"+t).then(e=>{const n=Ve.packFont(this.$refs.canvas,e);return this.osd.apply_font(n)}).then(()=>this.get_osd_font()).then(()=>this.root.append_alert({type:"success",msg:"Font updated!"})).catch(()=>{this.root.append_alert({type:"danger",msg:"Font update failed!"})})},async get_osd_font(){await this.osd.fetch_sd_osd_font(),this.imageSource=Ve.unpackFont(this.$refs.canvas,this.osd.font_raw)},uploadLogo(){const t=n=>new Promise((s,i)=>{const r=new FileReader;r.onerror=i,r.onabort=i,r.onload=o=>{var l;const a=new Image;a.onerror=i,a.onabort=i,a.onload=function(){s(a)},a.src=((l=o==null?void 0:o.target)==null?void 0:l.result)||""},r.readAsDataURL(n)});return(async()=>{const n={types:[{description:"Images",accept:{"image/*":[".png"]}}],excludeAcceptAllOption:!0,multiple:!1},[s]=await window.showOpenFilePicker(n);return await s.getFile()})().then(n=>t(n)).then(n=>{if(n.width!=288&&n.height!=72)throw new Error("Invalid logo dimensions");const s=Ve.packLogo(this.$refs.canvas,this.$refs.logoCanvas,n);return this.osd.apply_font(s)}).then(()=>this.get_osd_font()).then(()=>this.root.append_alert({type:"success",msg:"Logo updated!"})).catch(n=>{this.root.append_alert({type:"danger",msg:"Logo update failed! "+n.message})}).finally(()=>this.$refs.form.reset())}},created(){this.get_osd_font()}}),Fae={class:"card"},$ae={class:"card-header"},Bae={class:"card-content"},Hae={class:"content"},Gae={class:"field field-is-4 is-horizontal"},zae={class:"field-body"},Vae={class:"field has-addons"},Wae={class:"control is-expanded"},jae={class:"control"},qae={ref:"form"},Xae={class:"field field-is-4 is-horizontal"},Kae={class:"field-body"},Yae={class:"field has-addons"},Zae={class:"control"},Jae={class:"columns mt-5"},Qae={class:"column is-6"},ele={class:"card"},tle={class:"card-content"},nle={class:"content"},sle={class:"image m-0"},ile=["src"],rle={class:"column is-6"},ole={class:"card"},ale={class:"card-content"},lle={class:"content"},cle={class:"image m-0"},ule=["src"],dle={ref:"canvas",class:"mx-5 mt-3 is-hidden",width:"209",height:"305"},fle={ref:"logoCanvas",class:"mx-5 mt-3 is-hidden",width:"288",height:"72"};function hle(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("input-select"),l=Ie("spinner-btn");return Z(),re("div",Fae,[p("header",$ae,[e[3]||(e[3]=p("p",{class:"card-header-title"},"Font",-1)),X(o,{class:"card-header-icon",entry:"osd.font",size:"lg"})]),p("div",Bae,[p("div",Hae,[p("div",Gae,[e[5]||(e[5]=p("div",{class:"field-label"},[p("label",{class:"label"}," Full OSD font to upload ")],-1)),p("div",zae,[p("div",Vae,[p("p",Wae,[X(a,{id:"font-file",class:"is-fullwidth",modelValue:t.current_font_file,"onUpdate:modelValue":e[0]||(e[0]=c=>t.current_font_file=c),options:t.fontFiles},null,8,["modelValue","options"])]),p("p",jae,[X(l,{class:"float-right",onClick:e[1]||(e[1]=c=>t.apply_osd_font(t.current_font_file))},{default:tt(()=>e[4]||(e[4]=[ye(" Upload Font ")])),_:1})])])])]),p("form",qae,[p("div",Xae,[e[8]||(e[8]=p("div",{class:"field-label"},[p("label",{class:"label"},[ye(" Custom Logo "),p("br"),ye(" 288x72 Black/White/Transparent PNG ")])],-1)),p("div",Kae,[p("div",Yae,[e[7]||(e[7]=p("p",{class:"control is-expanded"},null,-1)),p("p",Zae,[X(l,{onClick:e[2]||(e[2]=c=>t.uploadLogo())},{default:tt(()=>e[6]||(e[6]=[ye(" Upload Logo ")])),_:1})])])])])],512),p("div",Jae,[p("div",Qae,[p("div",ele,[e[9]||(e[9]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Preview")],-1)),p("div",tle,[p("div",nle,[p("figure",sle,[p("img",{src:"osd/"+t.current_font_file},null,8,ile)])])])])]),p("div",rle,[p("div",ole,[e[10]||(e[10]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Current")],-1)),p("div",ale,[p("div",lle,[p("figure",cle,[p("img",{src:t.imageSource},null,8,ule)]),p("canvas",dle,null,512),p("canvas",fle,null,512)])])])])])])])])}const ple=lt(Uae,[["render",hle]]),mle=nt({name:"OSD",components:{OSDElements:Koe,OSDElementsLegacy:Dae,OSDFont:ple},setup(){return{profile:Dt(),default_profile:vc()}},computed:{is_hd(){return this.profile.serial.hdzero}}}),gle={class:"columns is-multiline"},_le={class:"column is-12"},vle={class:"column is-12"};function yle(t,e,n,s,i,r){const o=Ie("OSDElementsLegacy"),a=Ie("OSDElements"),l=Ie("OSDFont");return Z(),re("div",gle,[p("div",_le,[t.default_profile.has_legacy_osd?(Z(),Bt(o,{key:0})):(Z(),Bt(a,{key:1}))]),p("div",vle,[t.is_hd?He("",!0):(Z(),Bt(l,{key:0}))])])}const ble=lt(mle,[["render",yle]]),mm=Vn("motor",{state:()=>({loading:!1,test:{active:0,value:new Array},settings:null,_pins:[{index:1,id:"MOTOR_FL",label:"Front Left"},{index:3,id:"MOTOR_FR",label:"Front Right"},{index:0,id:"MOTOR_BL",label:"Back Left"},{index:2,id:"MOTOR_BR",label:"Back Right"}]}),getters:{pins(t){const e=Dt();return t._pins.map(n=>({...n,pin:e.motor.motor_pins[n.index]}))}},actions:{fetch_motor_test(){return gt.command(xn.Motor,du.TestStatus).then(t=>{this.test=t.payload[0]})},fetch_motor_settings(){const t=Xt();return this.loading=!0,gt.get(en.BLHeliSettings).then(e=>{this.settings=e}).catch(e=>{t.append_alert({type:"danger",msg:"Loading motor settings failed!"}),at.error("motor",e)}).finally(()=>{this.loading=!1})},apply_motor_settings(t){const e=Xt();return this.loading=!0,gt.set(en.BLHeliSettings,...t).then(()=>{this.settings=t,e.append_alert({type:"success",msg:"Motor settings applied!"})}).catch(n=>{at.error("motor",n),e.append_alert({type:"danger",msg:"Failed to apply motor settings!"})}).finally(()=>{this.loading=!1})},async motor_test_toggle(){return await this.fetch_motor_test(),gt.command(xn.Motor,this.test.active?du.TestDisable:du.TestEnable).then(()=>{this.test.active=this.test.active?0:1})},motor_test_set_value(t){return gt.command(xn.Motor,du.TestSetValue,t).then(e=>{this.test.value=e.payload[0]})}}}),wle=nt({name:"MotorTest",setup(){return{motor:mm(),state:ps()}},computed:{value(){return this.motor.test.value.map(t=>(t<0&&(t=0),t*100))}},created(){this.motor.fetch_motor_test()},methods:{update(){return this.motor.motor_test_set_value(this.value.map(t=>t/100))}}}),xle={key:0,class:"card"},Ele={class:"card-header"},Sle={class:"card-header-icon"},Tle={class:"card-content"},Ale={class:"content"},Mle={key:0,class:"columns is-multiline"},Rle={class:"field field-is-2 is-horizontal"},Cle={class:"field-label"},kle={class:"label",for:"pid-preset"},Ple={class:"field-body"},Ile={class:"field has-addons"},Ole={class:"control is-expanded"},Lle=["id","onUpdate:modelValue"],Dle={class:"control"},Nle=["id","onUpdate:modelValue"],Ule={key:1,class:"is-size-5 has-text-centered has-text-weight-semibold"},Fle={class:"card-footer"};function $le(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("spinner-btn");return t.motor.test?(Z(),re("div",xle,[p("header",Ele,[e[4]||(e[4]=p("p",{class:"card-header-title"},"Motor Test",-1)),p("small",Sle,[ye($e(t.state.vbat.toFixed(2))+"V ",1),e[3]||(e[3]=p("br",null,null,-1)),ye(" "+$e(t.state.ibat_filtered.toFixed(2))+"mA ",1)]),X(o,{class:"card-header-icon",entry:"motor.test",size:"lg"})]),p("div",Tle,[p("div",Ale,[t.motor.test.active?(Z(),re("div",Mle,[(Z(!0),re(it,null,Ht(t.motor.pins,l=>(Z(),re("div",{key:l.index,class:"column is-6"},[p("div",Rle,[p("div",Cle,[p("label",kle,$e(l.label),1)]),p("div",Ple,[p("div",Ile,[p("div",Ole,[We(p("input",{id:l.id,"onUpdate:modelValue":c=>t.value[l.index]=c,class:"input",type:"range",step:"1",min:"0",max:"50",onInput:e[0]||(e[0]=c=>t.update())},null,40,Lle),[[et,t.value[l.index],void 0,{number:!0}]])]),p("div",Dle,[We(p("input",{id:l.id,"onUpdate:modelValue":c=>t.value[l.index]=c,class:"input",type:"number",step:"1",min:"0",max:"50",onChange:e[1]||(e[1]=c=>t.update())},null,40,Nle),[[et,t.value[l.index],void 0,{number:!0}]])])])])])]))),128))])):(Z(),re("div",Ule," Motor Test disabled "))])]),p("footer",Fle,[e[5]||(e[5]=p("span",{class:"card-footer-item"},null,-1)),e[6]||(e[6]=p("span",{class:"card-footer-item"},null,-1)),X(a,{class:"card-footer-item",onClick:e[2]||(e[2]=l=>t.motor.motor_test_toggle())},{default:tt(()=>[ye($e(t.motor.test.active?"Disable":"Enable"),1)]),_:1})])])):He("",!0)}const Ble=lt(wle,[["render",$le]]),Hle=nt({name:"MotorPins",setup(){return{motor:mm(),target:Tc(),profile:Dt()}},computed:{motorPins(){return this.target.motor_pin_names.map((t,e)=>({value:e,text:`Pin ${e} (${t})`}))}}}),Gle={class:"card"},zle={class:"card-header"},Vle={class:"card-content"},Wle={class:"content"},jle={class:"columns is-multiline my-2"},qle={class:"field field-is-2 is-horizontal"},Xle={class:"field-label"},Kle={class:"label",for:"pid-profile"},Yle={class:"text-muted"},Zle={class:"field-body"},Jle={class:"field"},Qle={class:"control is-expanded"};function ece(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("input-select");return Z(),re("div",Gle,[p("header",zle,[e[0]||(e[0]=p("p",{class:"card-header-title"},"Motor Pins",-1)),X(o,{class:"card-header-icon",entry:"motor_pins",size:"lg"})]),p("div",Vle,[p("div",Wle,[p("div",jle,[(Z(!0),re(it,null,Ht(t.motor.pins,l=>(Z(),re("div",{key:"motor-pin-"+l.index,class:"column is-6"},[p("div",qle,[p("div",Xle,[p("label",Kle,[ye($e(l.label)+" ",1),e[1]||(e[1]=p("br",null,null,-1)),p("span",Yle,"Motor "+$e(l.index),1)])]),p("div",Zle,[p("div",Jle,[p("div",Qle,[X(a,{id:"motor-pin-"+l.index,modelValue:t.profile.motor.motor_pins[l.index],"onUpdate:modelValue":c=>t.profile.motor.motor_pins[l.index]=c,class:"is-fullwidth",options:t.motorPins},null,8,["id","modelValue","onUpdate:modelValue","options"])])])])])]))),128))])])])])}const tce=lt(Hle,[["render",ece]]),nce=nt({name:"ESCSettings",setup(){return{motor:mm(),info:rn()}},data(){return{motor_direction_options:[{value:1,text:"Normal"},{value:2,text:"Reversed"},{value:3,text:"Bidirectional"},{value:4,text:"Bidirectional Reversed"}]}},methods:{trim(t){return t.replace(/#/g,"").replace(/\$/g," ")},mapPin(t){return Bn.gt(this.info.quic_protocol_semver,"0.2.1")?t.index:t.pin}}}),sce={class:"card"},ice={class:"card-header"},rce={class:"card-content"},oce={class:"content"},ace={key:0,class:"columns is-multiline"},lce={class:"columns is-multiline my-2"},cce={class:"column is-4"},uce={class:"column is-8"},dce={class:"column is-4 pt-0 mt-0"},fce=["for"],hce={class:"column is-8 pt-0 mt-0"},pce={key:1,class:"is-size-5 has-text-centered has-text-weight-semibold"},mce={class:"card-footer"};function gce(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("input-select"),l=Ie("spinner-btn");return Z(),re("div",sce,[p("header",ice,[e[2]||(e[2]=p("p",{class:"card-header-title"},"ESC Settings",-1)),X(o,{class:"card-header-icon",entry:"motor_settings",size:"lg"})]),p("div",rce,[p("div",oce,[t.motor.settings&&t.motor.settings.length?(Z(),re("div",ace,[(Z(!0),re(it,null,Ht(t.motor.pins,c=>(Z(),re("div",{key:"motor-settings-"+c.index,class:"column is-6 px-5"},[p("div",lce,[p("div",cce,[p("h6",null,$e(c.label),1)]),p("div",uce,$e(t.trim(t.motor.settings[t.mapPin(c)].LAYOUT))+" - "+$e(t.trim(t.motor.settings[t.mapPin(c)].NAME))+", "+$e(t.motor.settings[t.mapPin(c)].MAIN_REVISION)+"."+$e(t.motor.settings[t.mapPin(c)].SUB_REVISION),1),p("div",dce,[p("label",{for:"motor-direction-"+c.index},"Direction",8,fce)]),p("div",hce,[X(a,{id:"motor-direction-"+c.index,modelValue:t.motor.settings[t.mapPin(c)].MOTOR_DIRECTION,"onUpdate:modelValue":u=>t.motor.settings[t.mapPin(c)].MOTOR_DIRECTION=u,modelModifiers:{number:!0},options:t.motor_direction_options},null,8,["id","modelValue","onUpdate:modelValue","options"])])])]))),128))])):(Z(),re("div",pce," Settings not loaded "))])]),p("footer",mce,[e[5]||(e[5]=p("span",{class:"card-footer-item"},null,-1)),e[6]||(e[6]=p("span",{class:"card-footer-item"},null,-1)),t.motor.settings&&t.motor.settings.length?(Z(),Bt(l,{key:0,class:"card-footer-item",disabled:t.motor.loading,onClick:e[0]||(e[0]=c=>t.motor.apply_motor_settings(t.motor.settings))},{default:tt(()=>e[3]||(e[3]=[ye(" Apply ")])),_:1},8,["disabled"])):(Z(),Bt(l,{key:1,class:"card-footer-item",disabled:t.motor.loading,onClick:e[1]||(e[1]=c=>t.motor.fetch_motor_settings())},{default:tt(()=>e[4]||(e[4]=[ye(" Load ")])),_:1},8,["disabled"]))])])}const _ce=lt(nce,[["render",gce]]),vce=nt({name:"Motor",components:{MotorTest:Ble,MotorPins:tce,ESCSettings:_ce},setup(){return{info:rn(),constants:Ro()}}}),yce={class:"columns is-multiline"},bce={class:"column is-12"},wce={class:"column is-12"},xce={key:0,class:"column is-12"};function Ece(t,e,n,s,i,r){const o=Ie("MotorTest"),a=Ie("MotorPins"),l=Ie("ESCSettings");return Z(),re("div",yce,[p("div",bce,[X(o)]),p("div",wce,[X(a)]),t.info.has_feature(t.constants.Features.BRUSHLESS)?(Z(),re("div",xce,[X(l)])):He("",!0)])}const Sce=lt(vce,[["render",Ece]]);function Ji(t){return e=>t*e*1/1e3*180/Math.PI}function Kg(t){return e=>t+e}const Tce=[{name:"loopIteration",blackbox_field:Ke.LOOP,advance:1,signed:!1},{name:"time",blackbox_field:Ke.TIME,advance:1,signed:!1},{name:"axisP",array_index:0,blackbox_field:Ke.PID_P_TERM,advance:0,signed:!0},{name:"axisP",array_index:1,blackbox_field:Ke.PID_P_TERM,advance:0,signed:!0},{name:"axisP",array_index:2,blackbox_field:Ke.PID_P_TERM,advance:1,signed:!0},{name:"axisI",array_index:0,blackbox_field:Ke.PID_I_TERM,advance:0,signed:!0},{name:"axisI",array_index:1,blackbox_field:Ke.PID_I_TERM,advance:0,signed:!0},{name:"axisI",array_index:2,blackbox_field:Ke.PID_I_TERM,advance:1,signed:!0},{name:"axisD",array_index:0,blackbox_field:Ke.PID_D_TERM,advance:0,signed:!0},{name:"axisD",array_index:1,blackbox_field:Ke.PID_D_TERM,advance:0,signed:!0},{name:"axisD",array_index:2,blackbox_field:Ke.PID_D_TERM,advance:1,signed:!0},{name:"rcCommand",array_index:0,signed:!0,blackbox_field:Ke.RX,advance:0,convert:t=>t/2},{name:"rcCommand",array_index:1,signed:!0,blackbox_field:Ke.RX,advance:0,convert:t=>t/2},{name:"rcCommand",array_index:2,signed:!0,blackbox_field:Ke.RX,advance:0,convert:t=>-t/2},{name:"rcCommand",array_index:3,signed:!0,blackbox_field:Ke.RX,advance:1,convert:Kg(1e3)},{name:"setpoint",array_index:0,blackbox_field:Ke.SETPOINT,advance:0,signed:!0,convert:Ji(1)},{name:"setpoint",array_index:1,blackbox_field:Ke.SETPOINT,advance:0,signed:!0,convert:Ji(1)},{name:"setpoint",array_index:2,blackbox_field:Ke.SETPOINT,advance:0,signed:!0,convert:Ji(-1)},{name:"setpoint",array_index:3,blackbox_field:Ke.SETPOINT,advance:1,signed:!0},{name:"accRaw",array_index:0,blackbox_field:Ke.ACCEL_RAW,advance:0,signed:!0},{name:"accRaw",array_index:1,blackbox_field:Ke.ACCEL_RAW,advance:0,signed:!0},{name:"accRaw",array_index:2,blackbox_field:Ke.ACCEL_RAW,advance:1,signed:!0,convert:Kg(1e3)},{name:"accSmooth",array_index:0,blackbox_field:Ke.ACCEL_FILTER,advance:0,signed:!0},{name:"accSmooth",array_index:1,blackbox_field:Ke.ACCEL_FILTER,advance:0,signed:!0},{name:"accSmooth",array_index:2,blackbox_field:Ke.ACCEL_FILTER,advance:1,signed:!0,convert:Kg(1e3)},{name:"gyroRaw",array_index:0,blackbox_field:Ke.GYRO_RAW,advance:0,signed:!0,convert:Ji(1)},{name:"gyroRaw",array_index:1,blackbox_field:Ke.GYRO_RAW,advance:0,signed:!0,convert:Ji(1)},{name:"gyroRaw",array_index:2,blackbox_field:Ke.GYRO_RAW,advance:1,signed:!0,convert:Ji(-1)},{name:"gyroADC",array_index:0,blackbox_field:Ke.GYRO_FILTER,advance:0,signed:!0,convert:Ji(1)},{name:"gyroADC",array_index:1,blackbox_field:Ke.GYRO_FILTER,advance:0,signed:!0,convert:Ji(1)},{name:"gyroADC",array_index:2,blackbox_field:Ke.GYRO_FILTER,advance:1,signed:!0,convert:Ji(-1)},{name:"motor",array_index:0,blackbox_field:Ke.MOTOR,advance:0,signed:!0},{name:"motor",array_index:1,blackbox_field:Ke.MOTOR,advance:0,signed:!0},{name:"motor",array_index:2,blackbox_field:Ke.MOTOR,advance:0,signed:!0},{name:"motor",array_index:3,blackbox_field:Ke.MOTOR,advance:1,signed:!0},{name:"cpuload",blackbox_field:Ke.CPU_LOAD,advance:1,signed:!1},{name:"debug[0]",array_index:0,blackbox_field:Ke.DEBUG,advance:0,signed:!0},{name:"debug[1]",array_index:1,blackbox_field:Ke.DEBUG,advance:0,signed:!0},{name:"debug[2]",array_index:2,blackbox_field:Ke.DEBUG,advance:0,signed:!0},{name:"debug[3]",array_index:3,blackbox_field:Ke.DEBUG,advance:1,signed:!0}];let Ace=class{constructor(e){xe(this,"buffer",new fv);xe(this,"defs",Tce);xe(this,"fieldflags");this.file=e,this.fieldflags=hy(e.field_flags)}writeHeaders(e){this.writeHeaderRaw("Product","Blackbox flight data recorder by Nicholas Sherlock"),this.writeHeaderRaw("Data version","2"),this.writeHeaderRaw("Firmware type","Cleanflight"),this.writeHeaderRaw("Firmware revision","Betaflight 4.3.0"),this.writeHeaderRaw("gyro_scale","0x3f800000"),this.writeHeaderRaw("acc_1G","1000"),this.writeHeaderRaw("motorOutput","0,1000"),this.writeHeaderRaw("looptime",this.file.looptime.toString()),this.writeHeaderRaw("gyro_sync_denom","1"),this.writeHeaderRaw("pid_process_denom","1"),this.writeHeaderRaw("rates","78,78,78"),this.writeHeaderRaw("rates_type","3"),this.writeHeaderRaw("minthrottle","1000"),this.writeHeaderRaw("maxthrottle","2000"),this.writeHeaderRaw("gyro_notch_hz","0,0"),this.writeHeaderRaw("gyro_notch_cutoff","0,0"),this.writeHeaderRaw("Craft name",e.meta.name.replace(/\0/g,"")),this.writeHeaderRaw("rollPID",[e.pid.pid_rates[e.pid.pid_profile].kp[0],e.pid.pid_rates[e.pid.pid_profile].ki[0],e.pid.pid_rates[e.pid.pid_profile].kd[0]].join(",")),this.writeHeaderRaw("pitchPID",[e.pid.pid_rates[e.pid.pid_profile].kp[1],e.pid.pid_rates[e.pid.pid_profile].ki[1],e.pid.pid_rates[e.pid.pid_profile].kd[1]].join(",")),this.writeHeaderRaw("yawPID",[e.pid.pid_rates[e.pid.pid_profile].kp[2],e.pid.pid_rates[e.pid.pid_profile].ki[2],e.pid.pid_rates[e.pid.pid_profile].kd[2]].join(","));const n={1:0,2:2,3:3};e.filter.gyro[0].type>0&&(this.writeHeaderRaw("gyro_lpf1_type",n[e.filter.gyro[0].type].toString()),this.writeHeaderRaw("gyro_lpf1_static_hz",e.filter.gyro[0].cutoff_freq.toString())),e.filter.gyro[1].type>0&&(this.writeHeaderRaw("gyro_lpf2_type",n[e.filter.gyro[1].type].toString()),this.writeHeaderRaw("gyro_lpf2_static_hz",e.filter.gyro[1].cutoff_freq.toString())),e.filter.dterm[0].type>0&&(this.writeHeaderRaw("dterm_lpf1_type",n[e.filter.dterm[0].type].toString()),this.writeHeaderRaw("dterm_lpf1_static_hz",e.filter.dterm[0].cutoff_freq.toString())),e.filter.dterm_dynamic_enable&&this.writeHeaderRaw("dterm_lpf1_dyn_hz",[e.filter.dterm_dynamic_min,e.filter.dterm_dynamic_max].join(",")),e.filter.dterm[1].type>0&&(this.writeHeaderRaw("dterm_lpf2_type",n[e.filter.dterm[1].type].toString()),this.writeHeaderRaw("dterm_lpf2_static_hz",e.filter.dterm[1].cutoff_freq.toString())),this.writeHeaderRaw("I interval",""+this.file.blackbox_rate),this.writeHeaderRaw("P interval","1/"+this.file.blackbox_rate),this.writeHeaderJoin("Field I name",s=>{let i=s.name;return s.array_index!=null&&(i+="["+s.array_index+"]"),i}),this.writeHeaderJoin("Field I signed",s=>s.signed?"1":"0"),this.writeHeaderJoin("Field I predictor",s=>"0"),this.writeHeaderJoin("Field I encoding",s=>s.signed?"0":"1"),this.writeHeaderJoin("Field P predictor",s=>"0"),this.writeHeaderJoin("Field P encoding",s=>s.signed?"0":"1")}writeValue(e){if(!e[0]){at.warn("blackbox","skipping blackbox entry");return}this.buffer.writeUint8(73);let n=1,s=0;for(const i of this.defs){if(n&this.fieldflags&1<127;)this.buffer.writeUint8((e&255|128)&255),e>>>=7;this.buffer.writeUint8(e)}writeSigned(e){const n=e<<1^e>>31;return this.writeUnsigned(n)}};const Kr=["Roll","Pitch","Yaw"],TE=[...Kr,"Throttle"],AE=t=>Array.from(Array(t).keys()).map(e=>e.toString()),X0={[Ke.LOOP]:{name:"loop",title:"Loop",scale:1,unit:"none"},[Ke.TIME]:{name:"time",title:"Time",scale:1,unit:"us"},[Ke.PID_P_TERM]:{name:"pid_pterm",title:"PID P-Term",axis:Kr,scale:1e3,unit:"none"},[Ke.PID_I_TERM]:{name:"pid_iterm",title:"PID I-Term",axis:Kr,scale:1e3,unit:"none"},[Ke.PID_D_TERM]:{name:"pid_dterm",title:"PID D-Term",axis:Kr,scale:1e3,unit:"none"},[Ke.RX]:{name:"rx",title:"RX",axis:TE,scale:1e3,unit:"none"},[Ke.SETPOINT]:{name:"setpoint",title:"Setpoint",axis:TE,scale:1e3,unit:"rad"},[Ke.ACCEL_RAW]:{name:"accel_raw",title:"Accel Raw",axis:Kr,scale:1e3,unit:"rad"},[Ke.ACCEL_FILTER]:{name:"accel_filter",title:"Accel Filter",axis:Kr,scale:1e3,unit:"rad"},[Ke.GYRO_RAW]:{name:"gyro_raw",title:"Gyro Raw",axis:Kr,scale:1e3,unit:"rad"},[Ke.GYRO_FILTER]:{name:"gyro_filter",title:"Gyro Filter",axis:Kr,scale:1e3,unit:"rad"},[Ke.MOTOR]:{name:"motor",title:"Motor",axis:AE(4),scale:1e3,unit:"none"},[Ke.CPU_LOAD]:{name:"cpu_load",title:"CPU Load",scale:1,unit:"us"},[Ke.DEBUG]:{name:"debug",title:"Debug",axis:AE(10),scale:1,unit:"none"}};function hy(t){return(t??-1)|1<({busy:!1,speed:void 0,progress:void 0,list:{flash_size:0,files:[]},presets:[]}),actions:{reset_blackbox(){const t=Xt();return gt.command(xn.Blackbox,uu.Reset).then(()=>{t.append_alert({type:"success",msg:"Blackbox successfully reset"})}).catch(e=>{t.append_alert({type:"danger",msg:e})})},list_blackbox(){return gt.command(xn.Blackbox,uu.List).then(t=>this.list=t.payload[0])},fetch_presets(){return gt.get(en.BlackboxPresets).then(t=>this.presets=t)},download_blackbox_quic(t){const e=Xt(),n=this.list.files[t],s=hy(n.field_flags),i=performance.now();return gt.commandProgress(xn.Blackbox,r=>{const o=(performance.now()-i)/1e3;this.progress=r/n.size,this.speed=r/o},uu.Get,t).then(r=>{const o=Object.keys(X0).filter((c,u)=>(s&1<0).map(c=>X0[c]),a={...n,fields:o,entries:r.payload};return"data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(a))}).then(r=>(e.append_alert({type:"success",msg:"Blackbox successfully downloaded!"}),r)).catch(r=>{throw e.append_alert({type:"danger",msg:"Blackbox download failed"}),r}).finally(()=>{this.progress=void 0,this.speed=void 0})},download_blackbox_btfl(t){const e=Xt(),n=this.list.files[t],s=performance.now();return gt.commandProgress(xn.Blackbox,i=>{const r=(performance.now()-s)/1e3;this.progress=i/n.size,this.speed=i/r},uu.Get,t).then(i=>{const r=Dt(),o=new Ace(n);o.writeHeaders(r);for(const a of i.payload)o.writeValue(a);return o.toUrl()}).then(i=>(e.append_alert({type:"success",msg:"Blackbox successfully downloaded!"}),i)).catch(i=>{throw e.append_alert({type:"danger",msg:"Blackbox download failed"}),i}).finally(()=>{this.progress=void 0,this.speed=void 0})}}}),Mce=nt({name:"blackbox",setup(){return{blackbox:TR(),profile:Dt(),state:ps(),info:rn()}},data(){return{current_preset:-1}},computed:{usedSize(){var t,e;return(((e=(t=this.blackbox)==null?void 0:t.list)==null?void 0:e.files)||[]).reduce((n,s)=>n+s.size,0)},blackboxRate(){return this.profile.blackbox.sample_rate_hz.toString()+" Hz"},blackboxFields(){const t=hy(this.profile.blackbox.field_flags),e=Cn(Ke).getEntries().map((n,s)=>({val:s,title:X0[s].title,active:(t&1<0}));return e.every(n=>n.active)?["All"]:e.filter(n=>n.active).map(n=>n.title)},blackboxPresets(){return[{value:-1,text:"Choose..."},...this.blackbox.presets.map((t,e)=>({value:e,text:t.name}))]}},methods:{humanFileSize:HD,reset(){return this.blackbox.reset_blackbox().then(()=>this.blackbox.list_blackbox())},download_quic(t){return this.blackbox.download_blackbox_quic(t).then(e=>{const n=new Date().toISOString().substring(0,10),i=`${this.profile.meta.name.replace(/\0/g,"")}_${n}_file_${t}.json`;this.$refs.downloadAnchor.setAttribute("href",e),this.$refs.downloadAnchor.setAttribute("download",i),this.$refs.downloadAnchor.click()})},download_btfl(t){return this.blackbox.download_blackbox_btfl(t).then(e=>{const n=new Date().toISOString().substring(0,10),i=`${this.profile.meta.name.replace(/\0/g,"")}_${n}_file_${t}.bfl`;this.$refs.downloadAnchor.setAttribute("href",e),this.$refs.downloadAnchor.setAttribute("download",i),this.$refs.downloadAnchor.click()})},load_preset(t){this.profile.blackbox.field_flags=this.blackbox.presets[t].field_flags,this.profile.blackbox.sample_rate_hz=this.blackbox.presets[t].sample_rate_hz,this.current_preset=-1}},created(){this.blackbox.list_blackbox(),this.info.quic_semver_gt("0.1.2")&&this.blackbox.fetch_presets()}}),Rce={class:"columns is-multiline"},Cce={class:"column is-12"},kce={key:0,class:"card"},Pce={class:"card-content"},Ice={class:"content column-narrow"},Oce={class:"field field-is-2 is-horizontal"},Lce={class:"field-body"},Dce={class:"field has-addons"},Nce={class:"control"},Uce={class:"control"},Fce={class:"field field-is-2 is-horizontal"},$ce={class:"field-body"},Bce={class:"field"},Hce={class:"control is-expanded"},Gce=["value"],zce={class:"field field-is-2 is-horizontal"},Vce={class:"field-body"},Wce={class:"field"},jce={class:"control is-expanded"},qce=["value"],Xce={class:"column is-12"},Kce={key:0,class:"card"},Yce={class:"card-header"},Zce={class:"blackbox-progress has-text-right"},Jce=["value","max"],Qce={class:"card-content"},eue={class:"content"},tue={class:"mr-4 is-size-6"},nue={ref:"downloadAnchor",target:"_blank"},sue={key:0},iue=["value"],rue={class:"card-footer"},oue={class:"card-footer-item"};function aue(t,e,n,s,i,r){var c,u,d;const o=Ie("input-select"),a=Ie("spinner-btn"),l=Ie("font-awesome-icon");return Z(),re("div",Rce,[p("div",Cce,[t.info.quic_semver_gt("0.1.2")?(Z(),re("div",kce,[e[7]||(e[7]=p("div",{class:"card-header"},[p("p",{class:"card-header-title"},"Blackbox Settings")],-1)),p("div",Pce,[p("div",Ice,[p("div",Oce,[e[4]||(e[4]=p("div",{class:"field-label"},[p("label",{class:"label",for:"pid-preset"}," Preset ")],-1)),p("div",Lce,[p("div",Dce,[p("div",Nce,[X(o,{id:"blackbox-preset",modelValue:t.current_preset,"onUpdate:modelValue":e[0]||(e[0]=f=>t.current_preset=f),modelModifiers:{number:!0},options:t.blackboxPresets},null,8,["modelValue","options"])]),p("div",Uce,[X(a,{onClick:e[1]||(e[1]=f=>t.load_preset(t.current_preset)),disabled:t.current_preset==-1},{default:tt(()=>e[3]||(e[3]=[ye(" Load ")])),_:1},8,["disabled"])])])])]),p("div",Fce,[e[5]||(e[5]=p("div",{class:"field-label"},[p("label",{class:"label"},"Log Rate")],-1)),p("div",$ce,[p("div",Bce,[p("div",Hce,[p("input",{class:"input is-static",value:t.blackboxRate,readonly:""},null,8,Gce)])])])]),p("div",zce,[e[6]||(e[6]=p("div",{class:"field-label is-align-self-flex-start pt-2"},[p("label",{class:"label"},"Fields")],-1)),p("div",Vce,[p("div",Wce,[p("div",jce,[(Z(!0),re(it,null,Ht(t.blackboxFields,f=>(Z(),re("input",{key:f,class:"input is-static",value:f,readonly:""},null,8,qce))),128))])])])])])])])):He("",!0)]),p("div",Xce,[t.blackbox.list?(Z(),re("div",Kce,[p("div",Yce,[e[8]||(e[8]=p("p",{class:"card-header-title"},"Blackbox Files",-1)),p("div",Zce,[p("progress",{class:"progress my-0 is-danger",value:t.usedSize,max:(t.blackbox.list.flash_size||1)*1024},null,8,Jce),p("h6",null," Used: "+$e(t.humanFileSize(t.usedSize))+" / "+$e(t.humanFileSize(t.blackbox.list.flash_size*1024)),1)])]),p("div",Qce,[p("div",eue,[(Z(!0),re(it,null,Ht(t.blackbox.list.files,(f,h)=>(Z(),re("div",{key:h,class:"is-flex is-align-items-center"},[p("div",tue," File "+$e(h+1)+": "+$e(t.humanFileSize(f.size)),1),X(a,{class:"is-small my-2 mx-2",onClick:v=>t.download_btfl(h)},{default:tt(()=>[X(l,{icon:"fa-solid fa-download",size:"lg",class:"mr-2","fixed-width":""}),e[9]||(e[9]=ye(" BTFL "))]),_:2},1032,["onClick"]),X(a,{class:"is-small my-2 mx-2",onClick:v=>t.download_quic(h)},{default:tt(()=>[X(l,{icon:"fa-solid fa-download",size:"lg",class:"mr-2","fixed-width":""}),e[10]||(e[10]=ye(" QUIC "))]),_:2},1032,["onClick"])]))),128)),p("a",nue,null,512),t.blackbox.progress?(Z(),re("div",sue,[ye(" Downloading "+$e(t.humanFileSize(t.blackbox.speed||0))+"/s... ",1),p("progress",{class:"progress is-info my-0",value:t.blackbox.progress,max:"1"},null,8,iue)])):He("",!0)])]),p("footer",rue,[p("span",oue,$e(((d=(u=(c=t.blackbox)==null?void 0:c.list)==null?void 0:u.files)==null?void 0:d.length)||0)+" Files ",1),e[12]||(e[12]=p("span",{class:"card-footer-item"},null,-1)),X(a,{class:"card-footer-item is-danger",onClick:e[2]||(e[2]=f=>t.reset())},{default:tt(()=>e[11]||(e[11]=[ye(" Reset ")])),_:1})])])):He("",!0)])])}const lue=lt(Mce,[["render",aue]]),cue=nt({name:"RealtimePlot",components:{Scatter:eZ},props:["title","time","input","axis","transform"],data(){return{colors:["#1f77b4","#ff7f0e","#2ca02c","#d62728"],lastUpdate:0,chartData:void 0,datasets:[]}},computed:{chartOptions(){return{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},elements:{line:{tension:0}},scales:{x:{type:"time",time:{unit:"second",displayFormats:{second:"HH:mm:ss"}}}},plugins:{title:{display:!0,text:this.title},tooltip:{enabled:!0,mode:"index",position:"average",intersect:!1,callbacks:{label:t=>{let e=t.dataset.label||"";return e&&(e+=": "),e+=t.formattedValue,e}}}}}}},methods:{updateChartData(){let t=[];Array.isArray(this.axis)?t=this.axis.map((e,n)=>({label:e,data:this.datasets[n]||[],fill:!1,borderColor:this.colors[n],showLine:!0,interpolate:!0})):t=[{label:this.axis,data:this.datasets[0]||[],fill:!1,borderColor:this.colors[0],showLine:!0,interpolate:!0}],this.chartData={labels:[],datasets:t}}},watch:{input(t){const e=this.transform||(s=>s),n=this.time||Date.now();if(Array.isArray(this.axis))for(let s=0;s=60;)this.datasets[s].shift()}else for(this.datasets[0]=[...this.datasets[0]||[],{x:n,y:e(t)}];this.datasets[0].length>=60;)this.datasets[0].shift();Date.now()-this.lastUpdate>250&&this.updateChartData()},title(){this.updateChartData()},time(){this.updateChartData()},axis(){this.updateChartData()},transform(){this.updateChartData()}}});function uue(t,e,n,s,i,r){const o=Ie("Scatter");return t.chartData?(Z(),Bt(o,{key:0,data:t.chartData,options:t.chartOptions,ref:"chart"},null,8,["data","options"])):He("",!0)}const AR=lt(cue,[["render",uue]]),due=nt({name:"State",components:{RealtimePlot:AR,GyroModel:k4},setup(){return{state:ps()}},data(){return{plots:[{name:"rx_filtered",size:12,title:"Rx Channels",axis:["Roll","Pitch","Yaw","Throttle"]},{name:"cpu_load",size:12,title:"CPU Load",axis:"us"},{name:"gyro_raw",size:6,title:"Gyro Raw",axis:["Roll","Pitch","Yaw"]},{name:"gyro",size:6,title:"Gyro Filter",axis:["Roll","Pitch","Yaw"]},{name:"gyro_temp",size:12,title:"Gyro Temperature",axis:"°C"},{name:"GEstG",size:12,title:"Gyro Vector",axis:["Roll","Pitch","Yaw"]},{name:"accel_raw",size:6,title:"AccelRaw",axis:["Roll","Pitch","Yaw"]},{name:"accel",size:6,title:"AccelFilter",axis:["Roll","Pitch","Yaw"]},{name:"pidoutput",size:12,title:"Pid Output",axis:["Roll","Pitch","Yaw"]}]}}}),fue={class:"columns is-multiline"},hue={class:"column is-12"};function pue(t,e,n,s,i,r){const o=Ie("GyroModel"),a=Ie("RealtimePlot");return Z(),re("div",fue,[p("div",hue,[X(o)]),(Z(!0),re(it,null,Ht(t.plots,l=>(Z(),re("div",{key:l.name,class:ds(["column",["is-"+l.size]]),style:{height:"40vh"}},[X(a,{title:l.title,axis:l.axis,input:t.state[l.name]},null,8,["title","axis","input"])],2))),128))])}const mue=lt(due,[["render",pue]]),gue=nt({name:"Perf",components:{RealtimePlot:AR},setup(){return{perf:HM()}}}),_ue={class:"columns is-multiline"};function vue(t,e,n,s,i,r){const o=Ie("RealtimePlot");return Z(),re("div",_ue,[(Z(!0),re(it,null,Ht(t.perf.counters,(a,l)=>(Z(),re("div",{key:"counter"+l,class:"column is-6 my-3",style:{height:"35vw"}},[X(o,{title:a.name,axis:Object.keys(a).slice(1),input:a},null,8,["title","axis","input"])]))),128))])}const yue=lt(gue,[["render",vue]]),bue=nt({name:"ProlfileMetadata",setup(){return{state:ps(),info:rn(),profile:Dt(),serial:Lc()}},computed:{date(){return new Date(this.profile.meta.datetime*1e3)},fileRef(){return this.$refs.file},downloadAnchorRef(){return this.$refs.downloadAnchor},versionLink(){return/^(v\d\..*)/.test(this.info.git_version)?"https://github.com/BossHobby/QUICKSILVER/releases/tag/"+this.info.git_version:"https://github.com/BossHobby/QUICKSILVER/commit/"+this.info.git_version}},methods:{uploadProfile(){const t=new FileReader;t.addEventListener("load",e=>{var n,s;if((n=e==null?void 0:e.target)!=null&&n.result){const i=vr.parse((s=e==null?void 0:e.target)==null?void 0:s.result);this.profile.apply_profile(i)}}),this.fileRef.oninput=()=>{var e,n;(n=(e=this.fileRef)==null?void 0:e.files)!=null&&n.length&&t.readAsText(this.fileRef.files[0])},this.fileRef.click()},downloadProfile(){return gt.get(en.Profile).then(t=>{const n="data:text/yaml;charset=utf-8,"+encodeURIComponent(vr.stringify(t)),s=this.date.toISOString().substring(0,10),r=`Profile_${t.meta.name.replace(/\0/g,"")}_${s}.yaml`;this.downloadAnchorRef.setAttribute("href",n),this.downloadAnchorRef.setAttribute("download",r),this.downloadAnchorRef.click()})}}}),wue={class:"card"},xue={class:"card-content"},Eue={class:"content column-narrow field-is-2"},Sue={class:"field is-horizontal"},Tue={class:"field-body"},Aue={class:"field"},Mue={class:"control is-expanded"},Rue={class:"field is-horizontal"},Cue={class:"field-body"},kue={class:"field"},Pue={class:"control is-expanded"},Iue=["value"],Oue={class:"field is-horizontal"},Lue={class:"field-body"},Due={class:"field"},Nue={class:"control is-expanded"},Uue=["href"],Fue={class:"card-footer"},$ue={accept:".yaml",type:"file",ref:"file",style:{display:"none"}},Bue={ref:"downloadAnchor",target:"_blank"};function Hue(t,e,n,s,i,r){const o=Ie("spinner-btn");return Z(),re("div",wue,[e[7]||(e[7]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Profile")],-1)),p("div",xue,[p("div",Eue,[p("div",Sue,[e[1]||(e[1]=p("div",{class:"field-label"},[p("label",{class:"label",for:"name"},"Name")],-1)),p("div",Tue,[p("div",Aue,[p("div",Mue,[We(p("input",{class:"input",type:"text","onUpdate:modelValue":e[0]||(e[0]=a=>t.profile.meta.name=a)},null,512),[[et,t.profile.meta.name]])])])])]),p("div",Rue,[e[2]||(e[2]=p("div",{class:"field-label"},[p("label",{class:"label"},"Last Modified")],-1)),p("div",Cue,[p("div",kue,[p("div",Pue,[p("input",{class:"input is-static",value:t.profile.modified,readonly:""},null,8,Iue)])])])]),p("div",Oue,[e[3]||(e[3]=p("div",{class:"field-label"},[p("label",{class:"label"},"Version")],-1)),p("div",Lue,[p("div",Due,[p("div",Nue,[p("a",{href:t.versionLink,target:"_blank"},$e(t.info.git_version),9,Uue)])])])])])]),p("footer",Fue,[X(o,{class:"card-footer-item",onClick:t.downloadProfile},{default:tt(()=>e[4]||(e[4]=[ye(" Save Profile ")])),_:1},8,["onClick"]),X(o,{class:"card-footer-item",onClick:t.uploadProfile,disabled:t.info.is_read_only},{default:tt(()=>e[5]||(e[5]=[ye(" Load Profile ")])),_:1},8,["onClick","disabled"]),X(o,{class:"card-footer-item is-warning",onClick:t.profile.reset},{default:tt(()=>e[6]||(e[6]=[ye(" Reset Profile ")])),_:1},8,["onClick"])]),p("input",$ue,null,512),p("a",Bue,null,512)])}const Gue=lt(bue,[["render",Hue]]),zue={xmlns:"http://www.w3.org/2000/svg","xml:space":"preserve",width:"512",height:"512",viewBox:"0 0 135.467 135.467"};function Vue(t,e){return Z(),re("svg",zue,e[0]||(e[0]=[_o('',1)]))}const MR={render:Vue},Wue=nt({name:"Info",components:{LogoClean:MR},data(){return{updateAvailable:null,appVersion:"0.9.0"}},created(){ra.updatePending()||ra.checkForUpdate(this.appVersion,t=>this.updateAvailable=t)},methods:{doUpdate(){return ra.update(this.updateAvailable)}}}),jue={class:"hero is-primary"},que={class:"hero-body"},Xue={class:"columns"},Kue={class:"column is-2 p-0"},Yue={class:"column"},Zue={class:"title"},Jue={class:"text-muted"},Que={key:0,class:"subtitle"};function ede(t,e,n,s,i,r){const o=Ie("LogoClean"),a=Ie("spinner-btn");return Z(),re("section",jue,[p("div",que,[p("div",Xue,[p("div",Kue,[X(o,{class:"logo logo-animation",viewBox:"-5 -5 160 160"})]),p("div",Yue,[p("p",Zue,[e[0]||(e[0]=ye(" QUICKSILVER ")),p("small",Jue,$e(t.appVersion),1)]),e[2]||(e[2]=p("p",{class:"subtitle"},[ye(" Checkout our "),p("a",{target:"_blank",href:"https://docs.bosshobby.com/",style:{"font-weight":"bold"}}," Docs"),ye(" for help on getting started. ")],-1)),t.updateAvailable?(Z(),re("p",Que,"New Version available!")):He("",!0),t.updateAvailable?(Z(),Bt(a,{key:1,onClick:t.doUpdate},{default:tt(()=>e[1]||(e[1]=[ye(" Update Now ")])),_:1},8,["onClick"])):He("",!0)])])])])}const RR=lt(Wue,[["render",ede]]),tde=nt({name:"SerialPassthrough",setup(){return{target:Tc(),serial:Lc()}},data(){return{serial_port:0,preset:null,presetOptions:[{value:null,text:"Please select an option"},{text:"ExpressLRS",value:{baudrate:42e4,half_duplex:!1,stop_bits:1}},{text:"OpenVTX",value:{baudrate:4800,half_duplex:!0,stop_bits:2}}]}},computed:{serialPorts(){const t=[{value:0,text:"SERIAL_PORT_INVALID"}];for(const[e,n]of Object.entries(this.target.serial_port_names))t.push({value:n,text:e});return t}},methods:{start_passthrough(){return this.serial.serial_passthrough({port:this.serial_port,...this.preset||{}})}}}),nde={class:"card"},sde={class:"card-header"},ide={class:"card-content"},rde={class:"content"},ode={class:"columns"},ade={class:"column is-6"},lde={class:"field"},cde={class:"control is-expanded"},ude={class:"column is-6"},dde={class:"field"},fde={class:"control is-expanded"},hde={class:"card-footer"};function pde(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("input-select"),l=Ie("spinner-btn");return Z(),re("div",nde,[p("header",sde,[e[2]||(e[2]=p("p",{class:"card-header-title"},"Serial Passthrough",-1)),X(o,{class:"card-header-icon",entry:"serial_passthrough",size:"lg"})]),p("div",ide,[p("div",rde,[p("div",ode,[p("div",ade,[p("div",lde,[e[3]||(e[3]=p("label",{class:"label"},"Serial Port",-1)),p("div",cde,[X(a,{modelValue:t.serial_port,"onUpdate:modelValue":e[0]||(e[0]=c=>t.serial_port=c),modelModifiers:{number:!0},class:"is-fullwidth",options:t.serialPorts},null,8,["modelValue","options"])])])]),p("div",ude,[p("div",dde,[e[4]||(e[4]=p("label",{class:"label"},"Preset",-1)),p("div",fde,[X(a,{modelValue:t.preset,"onUpdate:modelValue":e[1]||(e[1]=c=>t.preset=c),class:"is-fullwidth",options:t.presetOptions},null,8,["modelValue","options"])])])])])])]),p("footer",hde,[e[6]||(e[6]=p("span",{class:"card-footer-item"},null,-1)),e[7]||(e[7]=p("span",{class:"card-footer-item"},null,-1)),X(l,{class:"card-footer-item",disabled:t.serial_port==0||t.preset==null,onClick:t.start_passthrough},{default:tt(()=>e[5]||(e[5]=[ye(" Start ")])),_:1},8,["disabled","onClick"])])])}const mde=lt(tde,[["render",pde]]),gde=nt({name:"Target",setup(){const t=Ro();return{info:rn(),target:Tc(),Features:ln(()=>t.Features),GyroType:ln(()=>t.GyroType)}},computed:{fileRef(){return this.$refs.file},downloadAnchorRef(){return this.$refs.downloadAnchor},features(){return Cn(this.Features).getKeys().filter((t,e)=>this.info.features&1<{var n,s;if((n=e==null?void 0:e.target)!=null&&n.result){const i=vr.parse((s=e==null?void 0:e.target)==null?void 0:s.result);this.target.apply(i)}}),this.fileRef.oninput=()=>{var e,n;(n=(e=this.fileRef)==null?void 0:e.files)!=null&&n.length&&t.readAsText(this.fileRef.files[0])},this.fileRef.click()},downloadTarget(){const e="data:text/yaml;charset=utf-8,"+encodeURIComponent(this.target.yaml),n=new Date().toISOString().substring(0,10),s=`Target_${this.target.name}_${n}.yaml`;this.downloadAnchorRef.setAttribute("href",e),this.downloadAnchorRef.setAttribute("download",s),this.downloadAnchorRef.click()}}}),_de={class:"card"},vde={class:"card-content"},yde={class:"content column-narrow field-is-2"},bde={class:"field is-horizontal"},wde={class:"field-body"},xde={class:"field"},Ede={class:"control"},Sde=["value"],Tde={class:"field is-horizontal"},Ade={class:"field-body"},Mde={class:"field"},Rde={class:"control"},Cde=["value"],kde={key:1,class:"field is-horizontal"},Pde={class:"field-body"},Ide={class:"field"},Ode={class:"control"},Lde=["value"],Dde={key:2,class:"field is-horizontal"},Nde={class:"field-body"},Ude={class:"field"},Fde={class:"control is-expanded"},$de=["value"],Bde={key:3,class:"field is-horizontal"},Hde={class:"field-body"},Gde={class:"field"},zde={class:"control is-expanded"},Vde=["value"],Wde={key:0,class:"card-footer"},jde={accept:".yaml",type:"file",ref:"file",style:{display:"none"}},qde={ref:"downloadAnchor",target:"_blank"};function Xde(t,e,n,s,i,r){const o=Ie("spinner-btn");return Z(),re("div",_de,[e[7]||(e[7]=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Target")],-1)),p("div",vde,[p("div",yde,[t.info.quic_semver_gte("0.2.0")?(Z(),re(it,{key:0},[p("div",bde,[e[0]||(e[0]=p("div",{class:"field-label"},[p("label",{class:"label",for:"name"},"Name")],-1)),p("div",wde,[p("div",xde,[p("div",Ede,[p("input",{class:"input is-static",value:t.target.name,readonly:""},null,8,Sde)])])])]),p("div",Tde,[e[1]||(e[1]=p("div",{class:"field-label"},[p("label",{class:"label",for:"name"},"MCU")],-1)),p("div",Ade,[p("div",Mde,[p("div",Rde,[p("input",{class:"input is-static",value:t.info.mcu,readonly:""},null,8,Cde)])])])])],64)):(Z(),re("div",kde,[e[2]||(e[2]=p("div",{class:"field-label"},[p("label",{class:"label",for:"name"},"Name")],-1)),p("div",Pde,[p("div",Ide,[p("div",Ode,[p("input",{class:"input is-static",value:t.info.target_name,readonly:""},null,8,Lde)])])])])),t.info.gyro_id!=null?(Z(),re("div",Dde,[e[3]||(e[3]=p("div",{class:"field-label"},[p("label",{class:"label"},"Gyro")],-1)),p("div",Nde,[p("div",Ude,[p("div",Fde,[p("input",{class:"input is-static",value:t.info.gyro_name,readonly:""},null,8,$de)])])])])):He("",!0),t.info.features!=null?(Z(),re("div",Bde,[e[4]||(e[4]=p("div",{class:"field-label"},[p("label",{class:"label"},"Features")],-1)),p("div",Hde,[p("div",Gde,[p("div",zde,[p("input",{class:"input is-static",value:t.features,readonly:""},null,8,Vde)])])])])):He("",!0)])]),t.info.quic_semver_gte("0.2.0")?(Z(),re("footer",Wde,[X(o,{class:"card-footer-item",onClick:t.downloadTarget},{default:tt(()=>e[5]||(e[5]=[ye(" Save Target ")])),_:1},8,["onClick"]),X(o,{class:"card-footer-item",onClick:t.uploadTarget},{default:tt(()=>e[6]||(e[6]=[ye(" Load Target ")])),_:1},8,["onClick"])])):He("",!0),p("input",jde,null,512),p("a",qde,null,512)])}const Kde=lt(gde,[["render",Xde],["__scopeId","data-v-862bd597"]]),Yde=nt({name:"Profile",components:{Info:RR,ProfileMetadata:Gue,SerialPassthrough:mde,Target:Kde},setup(){return{info:rn(),state:ps()}}}),Zde={class:"columns is-multiline"},Jde={class:"column is-12 is-hidden-mobile"},Qde={class:"column is-12"},efe={class:"notification is-warning"},tfe={class:"notification is-danger"},nfe={class:"column is-12"},sfe={class:"column is-12"},ife={class:"column is-12"};function rfe(t,e,n,s,i,r){const o=Ie("Info"),a=Ie("ProfileMetadata"),l=Ie("Target"),c=Ie("SerialPassthrough");return Z(),re("div",Zde,[p("div",Jde,[X(o)]),p("div",Qde,[We(p("div",efe,e[0]||(e[0]=[ye(" Incompatible Firmware! "),p("br",null,null,-1),ye(" Please update to be able to change settings. "),p("br",null,null,-1),ye(" Your current profile can be exported and loaded. ")]),512),[[zh,t.info.version_too_old]]),We(p("div",tfe,[ye(" Faillop "+$e(t.state.failloopMessage)+" ("+$e(t.state.failloop)+") Detected! ",1),e[1]||(e[1]=p("br",null,null,-1)),e[2]||(e[2]=ye(" Please fix the issue to be able to change settings. ")),e[3]||(e[3]=p("br",null,null,-1))],512),[[zh,t.state.failloop>0]])]),p("div",nfe,[X(a)]),p("div",sfe,[X(l)]),p("div",ife,[X(c)])])}const ofe=lt(Yde,[["render",rfe]]);class afe{constructor(e){xe(this,"progressCallback");this.device=e}onProgress(e){this.progressCallback=e}async open(){await this.device.open(),await this.device.claimInterface(0)}async close(){try{await this.device.close()}catch(e){at.warn("flash","Close failed",e)}}progress(e,n,s){this.progressCallback&&this.progressCallback({task:e,current:n,total:s})}async getString(e){const n=await this.device.controlTransferIn({recipient:"device",requestType:"standard",request:6,value:768|e,index:0},255);if((n==null?void 0:n.status)!="ok")throw new Error(n.status);const s=n.data,i=s.getUint8(0);let r="";for(let o=2;o{const s=await this.controlTransferIn(3,0,0,6);if(s[4]==2)return s;const i=s[1]|s[2]<<8|s[3]<<16;return await bi(i),n()},n=async()=>(await this.controlTransferOut(4,0,0),e());return e()}async getChipInfo(){const e=s=>{s=="@External Flash /0x90000000/1001*128Kg,3*128Kg,20*128Ka"&&(s="@External Flash /0x90000000/998*128Kg,1*128Kg,4*128Kg,21*128Ka"),s=s.replace("@Option byte","@Option Bytes");const r=s.replace(/[^\x20-\x7E]+/g,"").split("/");if(r.length>3&&(at.info("flash",'parseDescriptor: shrinking long descriptor "'+s+'"'),r.length=3),!r[0].startsWith("@"))return null;const o=r[0].trim().replace("@",""),a=parseInt(r[1]),l=[];let c=0;const u=r[2].split(",");if(u.length<1)return null;for(let f=0;f>8&255,e>>16&255,e>>24&255];await this.controlTransferOut(1,0,0,s);const i=await this.controlTransferIn(3,0,0,6);if(i[4]!=4)throw new Error("Failed to request address load");const r=i[1]|i[2]<<8|i[3]<<16;await bi(r);const o=await this.controlTransferIn(3,0,0,6);if(o[4]!=5&&n)throw new Error("Failed to request address load");return o}async unlockOptionBytes(e,n){const s=async()=>{at.info("flash","Initiate read unprotect"),await this.controlTransferOut(1,0,0,[146]);const o=await this.controlTransferIn(3,0,0,6);if(o[4]!=4)throw new Error("Failed to initiate unprotect memory command");const l=(o[1]|o[2]<<8|o[3]<<16)+2e4;await bi(l);try{const c=await this.controlTransferIn(3,0,0,6);throw at.info("flash","Failed to execute unprotect memory command"),at.info("flash",c),new Error("Failed to execute unprotect memory command")}catch{at.info("flash","Unprotect memory command ran successfully. Unplug flight controller. Connect again in DFU mode and try flashing again.")}},i=async()=>{const o=await this.controlTransferIn(2,2,0,n);return(await this.controlTransferIn(3,0,0,6))[4]==9&&o.length==n?(at.info("flash","Option bytes read successfully"),at.info("flash","Chip does not appear read protected"),this.clearStatus()):(at.info("flash","Option bytes could not be read. Quite possibly read protected."),await this.clearStatus(),s())};await this.clearStatus();const r=await this.loadAddress(e,!1);if(r[4]==10&&r[0]==11)return await this.clearStatus(),s();if(r[4]==5)return at.info("flash","Address load for option bytes sector succeeded."),await this.clearStatus(),i();throw new Error("Address load failed")}async erasePages(e){const n=[];for(let i=0;i>8&255,r>>16&255,r>>24&255];at.info("flash","Erasing. sector "+i.sector+", page "+i.page+" @ 0x"+r.toString(16)),await this.controlTransferOut(1,0,0,o);const a=await this.controlTransferIn(3,0,0,6);if(a[4]!=4)throw new Error("Failed to initiate page erase, page 0x"+r.toString(16));const l=a[1]|a[2]<<8|a[3]<<16;await bi(l);const c=await this.controlTransferIn(3,0,0,6);if(c[4]!=5)if(c[4]==4){if(at.info("flash","erase_page: dfuDNBUSY after timeout, clearing"),await this.clearStatus(),(await this.controlTransferIn(3,0,0,6))[4]!=2)throw new Error("Failed to erase page 0x"+r.toString(16)+" (did not reach dfuIDLE after clearing")}else throw new Error("Failed to erase page 0x"+r.toString(16))}}async upload(e,n){at.info("flash","Writing data...");const s=e.segment_bytes_total;let i=0;for(const r of e.segments){let o=r.address,a=2,l=0;for(await this.loadAddress(o);lr.data.length&&(c=r.data.length-l);const u=r.data.slice(l,l+c);o+=c,l+=c,i+=c,this.progress("write",i,s),this.controlTransferOut(1,a++,0,[...u]);const d=await this.controlTransferIn(3,0,0,6);if(d[4]!=4)throw new Error("Failed to initiate write "+c+"bytes to 0x"+o.toString(16));const f=d[1]|d[2]<<8|d[3]<<16;if(await bi(f),(await this.controlTransferIn(3,0,0,6))[4]!=5)throw new Error("Failed to write "+c+"bytes to 0x"+o.toString(16))}}}async verify(e,n){at.info("flash","Verifying data...");const s=e.segment_bytes_total;let i=0;for(const r of e.segments){let o=r.address,a=2,l=0;for(await this.clearStatus(),await this.loadAddress(o),await this.clearStatus();lr.data.length&&(c=r.data.length-l);const u=await this.controlTransferIn(2,a++,0,c);for(let d=0;di)throw new Error("Not Enough flash space "+e.linear_bytes_total+"> "+i);let r=2048;try{r=(await this.getFunctionalDescriptor()).wTransferSize}catch{}await this.clearStatus(),n.internal_flash&&await this.unlockOptionBytes(n.option_bytes.start_address,n.option_bytes.total_size),await this.erasePages(s),await this.upload(e,r),await this.verify(e,r),await bi(500),await this.leave(e)}}const lfe=new Uint8Array([1,0,170,18]),cfe={stm32f411:134266880,stm32f765:134316032,stm32f745:134316032,stm32h743:134348800,stm32f405:134266880,stm32g473:134266880,stm32f722:134266880,at32f435:135200768,at32f435m:135200768};class dp{constructor(e,n){xe(this,"start_linear_address");xe(this,"start_segment_address");xe(this,"segments",[]);this.start_linear_address=e,this.start_segment_address=n}get linear_bytes_total(){return this.end_address-this.start_address}get segment_bytes_total(){return this.segments.reduce((e,n)=>e+=n.data.length,0)}get start_address(){return this.segments[0].address}get end_address(){return this.segments[this.segments.length-1].address+this.segments[this.segments.length-1].data.length}findSegment(e){for(let n=0;n=e&&e<=this.segments[n].address+this.segments[n].data.byteLength)return this.segments[n];return this.segments.push({address:e,data:new Uint8Array}),this.segments[this.segments.length-1]}patch(e,n){n=Cu(lfe,n);const s=this.findSegment(e),i=s.address-e,r=i+n.byteLength;s.data.byteLength>8)+c+u&255;for(let _=0;_{this.progressCallback&&this.progressCallback(s)}),await n.open(),await n.flash(e),await n.close()}}function Cr(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}function py(t,e,n,s){if(typeof n!="function")throw new Error("method for before hook must be a function");return s||(s={}),Array.isArray(e)?e.reverse().reduce((i,r)=>py.bind(null,t,r,i,s),n)():Promise.resolve().then(()=>t.registry[e]?t.registry[e].reduce((i,r)=>r.hook.bind(null,i,s),n)():n(s))}function ffe(t,e,n,s){const i=s;t.registry[n]||(t.registry[n]=[]),e==="before"&&(s=(r,o)=>Promise.resolve().then(i.bind(null,o)).then(r.bind(null,o))),e==="after"&&(s=(r,o)=>{let a;return Promise.resolve().then(r.bind(null,o)).then(l=>(a=l,i(a,o))).then(()=>a)}),e==="error"&&(s=(r,o)=>Promise.resolve().then(r.bind(null,o)).catch(a=>i(a,o))),t.registry[n].push({hook:s,orig:i})}function hfe(t,e,n){if(!t.registry[e])return;const s=t.registry[e].map(i=>i.orig).indexOf(n);s!==-1&&t.registry[e].splice(s,1)}const ME=Function.bind,RE=ME.bind(ME);function CR(t,e,n){const s=RE(hfe,null).apply(null,n?[e,n]:[e]);t.api={remove:s},t.remove=s,["before","error","after","wrap"].forEach(i=>{const r=n?[e,i,n]:[e,i];t[i]=t.api[i]=RE(ffe,null).apply(null,r)})}function pfe(){const t=Symbol("Singular"),e={registry:{}},n=py.bind(null,e,t);return CR(n,e,t),n}function mfe(){const t={registry:{}},e=py.bind(null,t);return CR(e,t),e}const gfe={Singular:pfe,Collection:mfe};var _fe="0.0.0-development",vfe=`octokit-endpoint.js/${_fe} ${Cr()}`,yfe={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":vfe},mediaType:{format:""}};function bfe(t){return t?Object.keys(t).reduce((e,n)=>(e[n.toLowerCase()]=t[n],e),{}):{}}function wfe(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);if(e===null)return!0;const n=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(t)}function kR(t,e){const n=Object.assign({},t);return Object.keys(e).forEach(s=>{wfe(e[s])?s in t?n[s]=kR(t[s],e[s]):Object.assign(n,{[s]:e[s]}):Object.assign(n,{[s]:e[s]})}),n}function CE(t){for(const e in t)t[e]===void 0&&delete t[e];return t}function K0(t,e,n){var i;if(typeof e=="string"){let[r,o]=e.split(" ");n=Object.assign(o?{method:r,url:o}:{url:r},n)}else n=Object.assign({},e);n.headers=bfe(n.headers),CE(n),CE(n.headers);const s=kR(t||{},n);return n.url==="/graphql"&&(t&&((i=t.mediaType.previews)!=null&&i.length)&&(s.mediaType.previews=t.mediaType.previews.filter(r=>!s.mediaType.previews.includes(r)).concat(s.mediaType.previews)),s.mediaType.previews=(s.mediaType.previews||[]).map(r=>r.replace(/-preview/,""))),s}function xfe(t,e){const n=/\?/.test(t)?"&":"?",s=Object.keys(e);return s.length===0?t:t+n+s.map(i=>i==="q"?"q="+e.q.split("+").map(encodeURIComponent).join("+"):`${i}=${encodeURIComponent(e[i])}`).join("&")}var Efe=/\{[^}]+\}/g;function Sfe(t){return t.replace(/^\W+|\W+$/g,"").split(/,/)}function Tfe(t){const e=t.match(Efe);return e?e.map(Sfe).reduce((n,s)=>n.concat(s),[]):[]}function kE(t,e){const n={__proto__:null};for(const s of Object.keys(t))e.indexOf(s)===-1&&(n[s]=t[s]);return n}function PR(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")),e}).join("")}function xl(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function su(t,e,n){return e=t==="+"||t==="#"?PR(e):xl(e),n?xl(n)+"="+e:e}function ll(t){return t!=null}function Yg(t){return t===";"||t==="&"||t==="?"}function Afe(t,e,n,s){var i=t[n],r=[];if(ll(i)&&i!=="")if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")i=i.toString(),s&&s!=="*"&&(i=i.substring(0,parseInt(s,10))),r.push(su(e,i,Yg(e)?n:""));else if(s==="*")Array.isArray(i)?i.filter(ll).forEach(function(o){r.push(su(e,o,Yg(e)?n:""))}):Object.keys(i).forEach(function(o){ll(i[o])&&r.push(su(e,i[o],o))});else{const o=[];Array.isArray(i)?i.filter(ll).forEach(function(a){o.push(su(e,a))}):Object.keys(i).forEach(function(a){ll(i[a])&&(o.push(xl(a)),o.push(su(e,i[a].toString())))}),Yg(e)?r.push(xl(n)+"="+o.join(",")):o.length!==0&&r.push(o.join(","))}else e===";"?ll(i)&&r.push(xl(n)):i===""&&(e==="&"||e==="?")?r.push(xl(n)+"="):i===""&&r.push("");return r}function Mfe(t){return{expand:Rfe.bind(null,t)}}function Rfe(t,e){var n=["+","#",".","/",";","?","&"];return t=t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(s,i,r){if(i){let a="";const l=[];if(n.indexOf(i.charAt(0))!==-1&&(a=i.charAt(0),i=i.substr(1)),i.split(/,/g).forEach(function(c){var u=/([^:\*]*)(?::(\d+)|(\*))?/.exec(c);l.push(Afe(e,a,u[1],u[2]||u[3]))}),a&&a!=="+"){var o=",";return a==="?"?o="&":a!=="#"&&(o=a),(l.length!==0?a:"")+l.join(o)}else return l.join(",")}else return PR(r)}),t==="/"?t:t.replace(/\/$/,"")}function IR(t){var u;let e=t.method.toUpperCase(),n=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),s=Object.assign({},t.headers),i,r=kE(t,["method","baseUrl","url","headers","request","mediaType"]);const o=Tfe(n);n=Mfe(n).expand(r),/^http/.test(n)||(n=t.baseUrl+n);const a=Object.keys(t).filter(d=>o.includes(d)).concat("baseUrl"),l=kE(r,a);if(!/application\/octet-stream/i.test(s.accept)&&(t.mediaType.format&&(s.accept=s.accept.split(/,/).map(d=>d.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${t.mediaType.format}`)).join(",")),n.endsWith("/graphql")&&(u=t.mediaType.previews)!=null&&u.length)){const d=s.accept.match(/[\w-]+(?=-preview)/g)||[];s.accept=d.concat(t.mediaType.previews).map(f=>{const h=t.mediaType.format?`.${t.mediaType.format}`:"+json";return`application/vnd.github.${f}-preview${h}`}).join(",")}return["GET","HEAD"].includes(e)?n=xfe(n,l):"data"in l?i=l.data:Object.keys(l).length&&(i=l),!s["content-type"]&&typeof i<"u"&&(s["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(e)&&typeof i>"u"&&(i=""),Object.assign({method:e,url:n,headers:s},typeof i<"u"?{body:i}:null,t.request?{request:t.request}:null)}function Cfe(t,e,n){return IR(K0(t,e,n))}function OR(t,e){const n=K0(t,e),s=Cfe.bind(null,n);return Object.assign(s,{DEFAULTS:n,defaults:OR.bind(null,n),merge:K0.bind(null,n),parse:IR})}var kfe=OR(null,yfe);const my=function(){};my.prototype=Object.create(null);const PE=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,IE=/\\([\v\u0020-\u00ff])/gu,Pfe=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,El={type:"",parameters:new my};Object.freeze(El.parameters);Object.freeze(El);function Ife(t){if(typeof t!="string")return El;let e=t.indexOf(";");const n=e!==-1?t.slice(0,e).trim():t.trim();if(Pfe.test(n)===!1)return El;const s={type:n.toLowerCase(),parameters:new my};if(e===-1)return s;let i,r,o;for(PE.lastIndex=e;r=PE.exec(t);){if(r.index!==e)return El;e+=r[0].length,i=r[1].toLowerCase(),o=r[2],o[0]==='"'&&(o=o.slice(1,o.length-1),IE.test(o)&&(o=o.replace(IE,"$1"))),s.parameters[i]=o}return e!==t.length?El:s}var Ofe=Ife;class Sl extends Error{constructor(n,s,i){super(n);xe(this,"name");xe(this,"status");xe(this,"request");xe(this,"response");this.name="HttpError",this.status=Number.parseInt(s),Number.isNaN(this.status)&&(this.status=0),"response"in i&&(this.response=i.response);const r=Object.assign({},i.request);i.request.headers.authorization&&(r.headers=Object.assign({},i.request.headers,{authorization:i.request.headers.authorization.replace(/ .*$/," [REDACTED]")})),r.url=r.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=r}}var Lfe="0.0.0-development",Dfe={headers:{"user-agent":`octokit-request.js/${Lfe} ${Cr()}`}};function Nfe(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);if(e===null)return!0;const n=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(t)}async function OE(t){var d,f,h,v,_;const e=((d=t.request)==null?void 0:d.fetch)||globalThis.fetch;if(!e)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");const n=((f=t.request)==null?void 0:f.log)||console,s=((h=t.request)==null?void 0:h.parseSuccessResponseBody)!==!1,i=Nfe(t.body)||Array.isArray(t.body)?JSON.stringify(t.body):t.body,r=Object.fromEntries(Object.entries(t.headers).map(([m,g])=>[m,String(g)]));let o;try{o=await e(t.url,{method:t.method,body:i,redirect:(v=t.request)==null?void 0:v.redirect,headers:r,signal:(_=t.request)==null?void 0:_.signal,...t.body&&{duplex:"half"}})}catch(m){let g="Unknown Error";if(m instanceof Error){if(m.name==="AbortError")throw m.status=500,m;g=m.message,m.name==="TypeError"&&"cause"in m&&(m.cause instanceof Error?g=m.cause.message:typeof m.cause=="string"&&(g=m.cause))}const y=new Sl(g,500,{request:t});throw y.cause=m,y}const a=o.status,l=o.url,c={};for(const[m,g]of o.headers)c[m]=g;const u={url:l,status:a,headers:c,data:""};if("deprecation"in c){const m=c.link&&c.link.match(/<([^>]+)>; rel="deprecation"/),g=m&&m.pop();n.warn(`[@octokit/request] "${t.method} ${t.url}" is deprecated. It is scheduled to be removed on ${c.sunset}${g?`. See ${g}`:""}`)}if(a===204||a===205)return u;if(t.method==="HEAD"){if(a<400)return u;throw new Sl(o.statusText,a,{response:u,request:t})}if(a===304)throw u.data=await Zg(o),new Sl("Not modified",a,{response:u,request:t});if(a>=400)throw u.data=await Zg(o),new Sl(Ufe(u.data),a,{response:u,request:t});return u.data=s?await Zg(o):o.body,u}async function Zg(t){var s;const e=t.headers.get("content-type");if(!e)return t.text().catch(()=>"");const n=Ofe(e);if(n.type==="application/json"){let i="";try{return i=await t.text(),JSON.parse(i)}catch{return i}}else return n.type.startsWith("text/")||((s=n.parameters.charset)==null?void 0:s.toLowerCase())==="utf-8"?t.text().catch(()=>""):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}function Ufe(t){if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return"Unknown error";if("message"in t){const e="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map(n=>JSON.stringify(n)).join(", ")}${e}`:`${t.message}${e}`}return`Unknown error: ${JSON.stringify(t)}`}function Y0(t,e){const n=t.defaults(e);return Object.assign(function(i,r){const o=n.merge(i,r);if(!o.request||!o.request.hook)return OE(n.parse(o));const a=(l,c)=>OE(n.parse(n.merge(l,c)));return Object.assign(a,{endpoint:n,defaults:Y0.bind(null,n)}),o.request.hook(a,o)},{endpoint:n,defaults:Y0.bind(null,n)})}var Pn=Y0(kfe,Dfe),Ffe="0.0.0-development";function $fe(t){return`Request failed due to following response errors: +`+t.errors.map(e=>` - ${e.message}`).join(` +`)}var Bfe=class extends Error{constructor(e,n,s){super($fe(s));xe(this,"name","GraphqlResponseError");xe(this,"errors");xe(this,"data");this.request=e,this.headers=n,this.response=s,this.errors=s.errors,this.data=s.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Hfe=["method","baseUrl","url","headers","request","query","mediaType"],Gfe=["query","method","url"],LE=/\/api\/v3\/?$/;function zfe(t,e,n){if(n){if(typeof e=="string"&&"query"in n)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(const o in n)if(Gfe.includes(o))return Promise.reject(new Error(`[@octokit/graphql] "${o}" cannot be used as variable name`))}const s=typeof e=="string"?Object.assign({query:e},n):e,i=Object.keys(s).reduce((o,a)=>Hfe.includes(a)?(o[a]=s[a],o):(o.variables||(o.variables={}),o.variables[a]=s[a],o),{}),r=s.baseUrl||t.endpoint.DEFAULTS.baseUrl;return LE.test(r)&&(i.url=r.replace(LE,"/api/graphql")),t(i).then(o=>{if(o.data.errors){const a={};for(const l of Object.keys(o.headers))a[l]=o.headers[l];throw new Bfe(i,a,o.data)}return o.data.data})}function gy(t,e){const n=t.defaults(e);return Object.assign((i,r)=>zfe(n,i,r),{defaults:gy.bind(null,n),endpoint:n.endpoint})}gy(Pn,{headers:{"user-agent":`octokit-graphql.js/${Ffe} ${Cr()}`},method:"POST",url:"/graphql"});function Vfe(t){return gy(t,{method:"POST",url:"/graphql"})}var Wfe=/^v1\./,jfe=/^ghs_/,qfe=/^ghu_/;async function Xfe(t){const e=t.split(/\./).length===3,n=Wfe.test(t)||jfe.test(t),s=qfe.test(t);return{type:"token",token:t,tokenType:e?"app":n?"installation":s?"user-to-server":"oauth"}}function Kfe(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}async function Yfe(t,e,n,s){const i=e.endpoint.merge(n,s);return i.headers.authorization=Kfe(t),e(i)}var Zfe=function(e){if(!e)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof e!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return e=e.replace(/^(token|bearer) +/i,""),Object.assign(Xfe.bind(null,e),{hook:Yfe.bind(null,e)})};const LR="6.1.2",DE=()=>{},Jfe=console.warn.bind(console),Qfe=console.error.bind(console),NE=`octokit-core.js/${LR} ${Cr()}`;var nh;let _y=(nh=class{constructor(e={}){xe(this,"request");xe(this,"graphql");xe(this,"log");xe(this,"hook");xe(this,"auth");const n=new gfe.Collection,s={baseUrl:Pn.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:n.bind(null,"request")}),mediaType:{previews:[],format:""}};if(s.headers["user-agent"]=e.userAgent?`${e.userAgent} ${NE}`:NE,e.baseUrl&&(s.baseUrl=e.baseUrl),e.previews&&(s.mediaType.previews=e.previews),e.timeZone&&(s.headers["time-zone"]=e.timeZone),this.request=Pn.defaults(s),this.graphql=Vfe(this.request).defaults(s),this.log=Object.assign({debug:DE,info:DE,warn:Jfe,error:Qfe},e.log),this.hook=n,e.authStrategy){const{authStrategy:r,...o}=e,a=r(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:o},e.auth));n.wrap("request",a.hook),this.auth=a}else if(!e.auth)this.auth=async()=>({type:"unauthenticated"});else{const r=Zfe(e.auth);n.wrap("request",r.hook),this.auth=r}const i=this.constructor;for(let r=0;r!n.includes(r)))),i}},xe(nh,"VERSION",LR),xe(nh,"plugins",[]),nh);var ehe="0.0.0-development";function the(t){if(!t.data)return{...t,data:[]};if(!("total_count"in t.data&&!("url"in t.data)))return t;const n=t.data.incomplete_results,s=t.data.repository_selection,i=t.data.total_count;delete t.data.incomplete_results,delete t.data.repository_selection,delete t.data.total_count;const r=Object.keys(t.data)[0],o=t.data[r];return t.data=o,typeof n<"u"&&(t.data.incomplete_results=n),typeof s<"u"&&(t.data.repository_selection=s),t.data.total_count=i,t}function vy(t,e,n){const s=typeof e=="function"?e.endpoint(n):t.request.endpoint(e,n),i=typeof e=="function"?e:t.request,r=s.method,o=s.headers;let a=s.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!a)return{done:!0};try{const l=await i({method:r,url:a,headers:o}),c=the(l);return a=((c.headers.link||"").match(/<([^>]+)>;\s*rel="next"/)||[])[1],{value:c}}catch(l){if(l.status!==409)throw l;return a="",{value:{status:200,headers:{},data:[]}}}}})}}function DR(t,e,n,s){return typeof n=="function"&&(s=n,n=void 0),NR(t,[],vy(t,e,n)[Symbol.asyncIterator](),s)}function NR(t,e,n,s){return n.next().then(i=>{if(i.done)return e;let r=!1;function o(){r=!0}return e=e.concat(s?s(i.value,o):i.value.data),r?e:NR(t,e,n,s)})}var UR=Object.assign(DR,{iterator:vy});function FR(t){return{paginate:Object.assign(DR.bind(null,t),{iterator:vy.bind(null,t)})}}FR.VERSION=ehe;var nhe=(t,e)=>`The cursor at "${t.join(",")}" did not change its value "${e}" after a page transition. Please make sure your that your query is set up correctly.`,she=class extends Error{constructor(e,n){super(nhe(e.pathInQuery,n));xe(this,"name","MissingCursorChangeError");this.pageInfo=e,this.cursorValue=n,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},ihe=class extends Error{constructor(e){super(`No pageInfo property found in response. Please make sure to specify the pageInfo in your query. Response-Data: ${JSON.stringify(e,null,2)}`);xe(this,"name","MissingPageInfo");this.response=e,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},rhe=t=>Object.prototype.toString.call(t)==="[object Object]";function $R(t){const e=BR(t,"pageInfo");if(e.length===0)throw new ihe(t);return e}var BR=(t,e,n=[])=>{for(const s of Object.keys(t)){const i=[...n,s],r=t[s];if(rhe(r)){if(r.hasOwnProperty(e))return i;const o=BR(r,e,i);if(o.length>0)return o}}return[]},$u=(t,e)=>e.reduce((n,s)=>n[s],t),Jg=(t,e,n)=>{const s=e[e.length-1],i=[...e].slice(0,-1),r=$u(t,i);typeof n=="function"?r[s]=n(r[s]):r[s]=n},ohe=t=>{const e=$R(t);return{pathInQuery:e,pageInfo:$u(t,[...e,"pageInfo"])}},HR=t=>t.hasOwnProperty("hasNextPage"),ahe=t=>HR(t)?t.endCursor:t.startCursor,lhe=t=>HR(t)?t.hasNextPage:t.hasPreviousPage,GR=t=>(e,n={})=>{let s=!0,i={...n};return{[Symbol.asyncIterator]:()=>({async next(){if(!s)return{done:!0,value:{}};const r=await t.graphql(e,i),o=ohe(r),a=ahe(o.pageInfo);if(s=lhe(o.pageInfo),s&&a===i.cursor)throw new she(o,a);return i={...i,cursor:a},{done:!1,value:r}}})}},che=(t,e)=>{if(Object.keys(t).length===0)return Object.assign(t,e);const n=$R(t),s=[...n,"nodes"],i=$u(e,s);i&&Jg(t,s,l=>[...l,...i]);const r=[...n,"edges"],o=$u(e,r);o&&Jg(t,r,l=>[...l,...o]);const a=[...n,"pageInfo"];return Jg(t,a,$u(e,a)),t},uhe=t=>{const e=GR(t);return async(n,s={})=>{let i={};for await(const r of e(n,s))i=che(i,r);return i}};function dhe(t){return{graphql:Object.assign(t.graphql,{paginate:Object.assign(uhe(t),{iterator:GR(t)})})}}const fhe="13.2.6",hhe={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"],usageMetricsForEnterprise:["GET /enterprises/{enterprise}/copilot/usage"],usageMetricsForOrg:["GET /orgs/{org}/copilot/usage"],usageMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/usage"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}"],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createCustomOrganizationRole:["POST /orgs/{org}/organization-roles"],createInvitation:["POST /orgs/{org}/invitations"],createOrUpdateCustomProperties:["PATCH /orgs/{org}/properties/schema"],createOrUpdateCustomPropertiesValuesForRepos:["PATCH /orgs/{org}/properties/values"],createOrUpdateCustomProperty:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],createWebhook:["POST /orgs/{org}/hooks"],delete:["DELETE /orgs/{org}"],deleteCustomOrganizationRole:["DELETE /orgs/{org}/organization-roles/{role_id}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],enableOrDisableSecurityProductOnAllOrgRepos:["POST /orgs/{org}/{security_product}/{enablement}"],get:["GET /orgs/{org}"],getAllCustomProperties:["GET /orgs/{org}/properties/schema"],getCustomProperty:["GET /orgs/{org}/properties/schema/{custom_property_name}"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listBlockedUsers:["GET /orgs/{org}/blocks"],listCustomPropertiesValuesForRepos:["GET /orgs/{org}/properties/values"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers"],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],patchCustomOrganizationRole:["PATCH /orgs/{org}/organization-roles/{role_id}"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeCustomProperty:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}"],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},projects:{addCollaborator:["PUT /projects/{project_id}/collaborators/{username}"],createCard:["POST /projects/columns/{column_id}/cards"],createColumn:["POST /projects/{project_id}/columns"],createForAuthenticatedUser:["POST /user/projects"],createForOrg:["POST /orgs/{org}/projects"],createForRepo:["POST /repos/{owner}/{repo}/projects"],delete:["DELETE /projects/{project_id}"],deleteCard:["DELETE /projects/columns/cards/{card_id}"],deleteColumn:["DELETE /projects/columns/{column_id}"],get:["GET /projects/{project_id}"],getCard:["GET /projects/columns/cards/{card_id}"],getColumn:["GET /projects/columns/{column_id}"],getPermissionForUser:["GET /projects/{project_id}/collaborators/{username}/permission"],listCards:["GET /projects/columns/{column_id}/cards"],listCollaborators:["GET /projects/{project_id}/collaborators"],listColumns:["GET /projects/{project_id}/columns"],listForOrg:["GET /orgs/{org}/projects"],listForRepo:["GET /repos/{owner}/{repo}/projects"],listForUser:["GET /users/{username}/projects"],moveCard:["POST /projects/columns/cards/{card_id}/moves"],moveColumn:["POST /projects/columns/{column_id}/moves"],removeCollaborator:["DELETE /projects/{project_id}/collaborators/{username}"],update:["PATCH /projects/{project_id}"],updateCard:["PATCH /projects/columns/cards/{card_id}"],updateColumn:["PATCH /projects/columns/{column_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateCustomPropertiesValues:["PATCH /repos/{owner}/{repo}/properties/values"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createTagProtection:["POST /repos/{owner}/{repo}/tags/protection"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteTagProtection:["DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getCustomPropertiesValues:["GET /repos/{owner}/{repo}/properties/values"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTagProtection:["GET /repos/{owner}/{repo}/tags/protection"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/secret-scanning/alerts"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateProjectPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForProjectInOrg:["GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listProjectsInOrg:["GET /orgs/{org}/teams/{team_slug}/projects"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeProjectInOrg:["DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}};var phe=hhe;const _a=new Map;for(const[t,e]of Object.entries(phe))for(const[n,s]of Object.entries(e)){const[i,r,o]=s,[a,l]=i.split(/ /),c=Object.assign({method:a,url:l},r);_a.has(t)||_a.set(t,new Map),_a.get(t).set(n,{scope:t,methodName:n,endpointDefaults:c,decorations:o})}const mhe={has({scope:t},e){return _a.get(t).has(e)},getOwnPropertyDescriptor(t,e){return{value:this.get(t,e),configurable:!0,writable:!0,enumerable:!0}},defineProperty(t,e,n){return Object.defineProperty(t.cache,e,n),!0},deleteProperty(t,e){return delete t.cache[e],!0},ownKeys({scope:t}){return[..._a.get(t).keys()]},set(t,e,n){return t.cache[e]=n},get({octokit:t,scope:e,cache:n},s){if(n[s])return n[s];const i=_a.get(e).get(s);if(!i)return;const{endpointDefaults:r,decorations:o}=i;return o?n[s]=_he(t,e,s,r,o):n[s]=t.request.defaults(r),n[s]}};function ghe(t){const e={};for(const n of _a.keys())e[n]=new Proxy({octokit:t,scope:n,cache:{}},mhe);return e}function _he(t,e,n,s,i){const r=t.request.defaults(s);function o(...a){let l=r.endpoint.merge(...a);if(i.mapToData)return l=Object.assign({},l,{data:l[i.mapToData],[i.mapToData]:void 0}),r(l);if(i.renamed){const[c,u]=i.renamed;t.log.warn(`octokit.${e}.${n}() has been renamed to octokit.${c}.${u}()`)}if(i.deprecated&&t.log.warn(i.deprecated),i.renamedParameters){const c=r.endpoint.merge(...a);for(const[u,d]of Object.entries(i.renamedParameters))u in c&&(t.log.warn(`"${u}" parameter is deprecated for "octokit.${e}.${n}()". Use "${d}" instead`),d in c||(c[d]=c[u]),delete c[u]);return r(c)}return r(...a)}return Object.assign(o,r)}function zR(t){return{rest:ghe(t)}}zR.VERSION=fhe;var VR={exports:{}};(function(t,e){(function(n,s){t.exports=s()})(Ci,function(){var n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Ci<"u"?Ci:typeof self<"u"?self:{};function s(he){return he&&he.default||he}var i=function(he,j,O={}){var ee,$,V;for(ee in j)V=j[ee],O[ee]=($=he[ee])!=null?$:V;return O},r=function(he,j,O={}){var ee,$;for(ee in he)$=he[ee],j[ee]!==void 0&&(O[ee]=$);return O},o={load:i,overwrite:r},a;a=class{constructor(j,O){this.incr=j,this.decr=O,this._first=null,this._last=null,this.length=0}push(j){var O;this.length++,typeof this.incr=="function"&&this.incr(),O={value:j,prev:this._last,next:null},this._last!=null?(this._last.next=O,this._last=O):this._first=this._last=O}shift(){var j;if(this._first!=null)return this.length--,typeof this.decr=="function"&&this.decr(),j=this._first.value,(this._first=this._first.next)!=null?this._first.prev=null:this._last=null,j}first(){if(this._first!=null)return this._first.value}getArray(){var j,O,ee;for(j=this._first,ee=[];j!=null;)ee.push((O=j,j=j.next,O.value));return ee}forEachShift(j){var O;for(O=this.shift();O!=null;)j(O),O=this.shift()}debug(){var j,O,ee,$,V;for(j=this._first,V=[];j!=null;)V.push((O=j,j=j.next,{value:O.value,prev:(ee=O.prev)!=null?ee.value:void 0,next:($=O.next)!=null?$.value:void 0}));return V}};var l=a,c;c=class{constructor(j){if(this.instance=j,this._events={},this.instance.on!=null||this.instance.once!=null||this.instance.removeAllListeners!=null)throw new Error("An Emitter already exists for this object");this.instance.on=(O,ee)=>this._addListener(O,"many",ee),this.instance.once=(O,ee)=>this._addListener(O,"once",ee),this.instance.removeAllListeners=(O=null)=>O!=null?delete this._events[O]:this._events={}}_addListener(j,O,ee){var $;return($=this._events)[j]==null&&($[j]=[]),this._events[j].push({cb:ee,status:O}),this.instance}listenerCount(j){return this._events[j]!=null?this._events[j].length:0}async trigger(j,...O){var ee,$;try{return j!=="debug"&&this.trigger("debug",`Event triggered: ${j}`,O),this._events[j]==null?void 0:(this._events[j]=this._events[j].filter(function(V){return V.status!=="none"}),$=this._events[j].map(async V=>{var W,ne;if(V.status!=="none"){V.status==="once"&&(V.status="none");try{return ne=typeof V.cb=="function"?V.cb(...O):void 0,typeof(ne!=null?ne.then:void 0)=="function"?await ne:ne}catch(G){return W=G,this.trigger("error",W),null}}}),(await Promise.all($)).find(function(V){return V!=null}))}catch(V){return ee=V,this.trigger("error",ee),null}}};var u=c,d,f,h;d=l,f=u,h=class{constructor(j){this.Events=new f(this),this._length=0,this._lists=(function(){var O,ee,$;for($=[],O=1,ee=j;1<=ee?O<=ee:O>=ee;1<=ee?++O:--O)$.push(new d(()=>this.incr(),()=>this.decr()));return $}).call(this)}incr(){if(this._length++===0)return this.Events.trigger("leftzero")}decr(){if(--this._length===0)return this.Events.trigger("zero")}push(j){return this._lists[j.options.priority].push(j)}queued(j){return j!=null?this._lists[j].length:this._length}shiftAll(j){return this._lists.forEach(function(O){return O.forEachShift(j)})}getFirst(j=this._lists){var O,ee,$;for(O=0,ee=j.length;O0)return $;return[]}shiftLastFrom(j){return this.getFirst(this._lists.slice(j).reverse()).shift()}};var v=h,_;_=class extends Error{};var m=_,g,y,b,w,T;w=10,y=5,T=o,g=m,b=class{constructor(j,O,ee,$,V,W,ne,G){this.task=j,this.args=O,this.rejectOnDrop=V,this.Events=W,this._states=ne,this.Promise=G,this.options=T.load(ee,$),this.options.priority=this._sanitizePriority(this.options.priority),this.options.id===$.id&&(this.options.id=`${this.options.id}-${this._randomIndex()}`),this.promise=new this.Promise((ge,ue)=>{this._resolve=ge,this._reject=ue}),this.retryCount=0}_sanitizePriority(j){var O;return O=~~j!==j?y:j,O<0?0:O>w-1?w-1:O}_randomIndex(){return Math.random().toString(36).slice(2)}doDrop({error:j,message:O="This job has been dropped by Bottleneck"}={}){return this._states.remove(this.options.id)?(this.rejectOnDrop&&this._reject(j??new g(O)),this.Events.trigger("dropped",{args:this.args,options:this.options,task:this.task,promise:this.promise}),!0):!1}_assertStatus(j){var O;if(O=this._states.jobStatus(this.options.id),!(O===j||j==="DONE"&&O===null))throw new g(`Invalid job status ${O}, expected ${j}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`)}doReceive(){return this._states.start(this.options.id),this.Events.trigger("received",{args:this.args,options:this.options})}doQueue(j,O){return this._assertStatus("RECEIVED"),this._states.next(this.options.id),this.Events.trigger("queued",{args:this.args,options:this.options,reachedHWM:j,blocked:O})}doRun(){return this.retryCount===0?(this._assertStatus("QUEUED"),this._states.next(this.options.id)):this._assertStatus("EXECUTING"),this.Events.trigger("scheduled",{args:this.args,options:this.options})}async doExecute(j,O,ee,$){var V,W,ne;this.retryCount===0?(this._assertStatus("RUNNING"),this._states.next(this.options.id)):this._assertStatus("EXECUTING"),W={args:this.args,options:this.options,retryCount:this.retryCount},this.Events.trigger("executing",W);try{if(ne=await(j!=null?j.schedule(this.options,this.task,...this.args):this.task(...this.args)),O())return this.doDone(W),await $(this.options,W),this._assertStatus("DONE"),this._resolve(ne)}catch(G){return V=G,this._onFailure(V,W,O,ee,$)}}doExpire(j,O,ee){var $,V;return this._states.jobStatus(this.options.id==="RUNNING")&&this._states.next(this.options.id),this._assertStatus("EXECUTING"),V={args:this.args,options:this.options,retryCount:this.retryCount},$=new g(`This job timed out after ${this.options.expiration} ms.`),this._onFailure($,V,j,O,ee)}async _onFailure(j,O,ee,$,V){var W,ne;if(ee())return W=await this.Events.trigger("failed",j,O),W!=null?(ne=~~W,this.Events.trigger("retry",`Retrying ${this.options.id} after ${ne} ms`,O),this.retryCount++,$(ne)):(this.doDone(O),await V(this.options,O),this._assertStatus("DONE"),this._reject(j))}doDone(j){return this._assertStatus("EXECUTING"),this._states.next(this.options.id),this.Events.trigger("done",j)}};var S=b,A,R,x;x=o,A=m,R=class{constructor(j,O,ee){this.instance=j,this.storeOptions=O,this.clientId=this.instance._randomIndex(),x.load(ee,ee,this),this._nextRequest=this._lastReservoirRefresh=this._lastReservoirIncrease=Date.now(),this._running=0,this._done=0,this._unblockTime=0,this.ready=this.Promise.resolve(),this.clients={},this._startHeartbeat()}_startHeartbeat(){var j;return this.heartbeat==null&&(this.storeOptions.reservoirRefreshInterval!=null&&this.storeOptions.reservoirRefreshAmount!=null||this.storeOptions.reservoirIncreaseInterval!=null&&this.storeOptions.reservoirIncreaseAmount!=null)?typeof(j=this.heartbeat=setInterval(()=>{var O,ee,$,V,W;if(V=Date.now(),this.storeOptions.reservoirRefreshInterval!=null&&V>=this._lastReservoirRefresh+this.storeOptions.reservoirRefreshInterval&&(this._lastReservoirRefresh=V,this.storeOptions.reservoir=this.storeOptions.reservoirRefreshAmount,this.instance._drainAll(this.computeCapacity())),this.storeOptions.reservoirIncreaseInterval!=null&&V>=this._lastReservoirIncrease+this.storeOptions.reservoirIncreaseInterval&&({reservoirIncreaseAmount:O,reservoirIncreaseMaximum:$,reservoir:W}=this.storeOptions,this._lastReservoirIncrease=V,ee=$!=null?Math.min(O,$-W):O,ee>0))return this.storeOptions.reservoir+=ee,this.instance._drainAll(this.computeCapacity())},this.heartbeatInterval)).unref=="function"?j.unref():void 0:clearInterval(this.heartbeat)}async __publish__(j){return await this.yieldLoop(),this.instance.Events.trigger("message",j.toString())}async __disconnect__(j){return await this.yieldLoop(),clearInterval(this.heartbeat),this.Promise.resolve()}yieldLoop(j=0){return new this.Promise(function(O,ee){return setTimeout(O,j)})}computePenalty(){var j;return(j=this.storeOptions.penalty)!=null?j:15*this.storeOptions.minTime||5e3}async __updateSettings__(j){return await this.yieldLoop(),x.overwrite(j,j,this.storeOptions),this._startHeartbeat(),this.instance._drainAll(this.computeCapacity()),!0}async __running__(){return await this.yieldLoop(),this._running}async __queued__(){return await this.yieldLoop(),this.instance.queued()}async __done__(){return await this.yieldLoop(),this._done}async __groupCheck__(j){return await this.yieldLoop(),this._nextRequest+this.timeout=j}check(j,O){return this.conditionsCheck(j)&&this._nextRequest-O<=0}async __check__(j){var O;return await this.yieldLoop(),O=Date.now(),this.check(j,O)}async __register__(j,O,ee){var $,V;return await this.yieldLoop(),$=Date.now(),this.conditionsCheck(O)?(this._running+=O,this.storeOptions.reservoir!=null&&(this.storeOptions.reservoir-=O),V=Math.max(this._nextRequest-$,0),this._nextRequest=$+V+this.storeOptions.minTime,{success:!0,wait:V,reservoir:this.storeOptions.reservoir}):{success:!1}}strategyIsBlock(){return this.storeOptions.strategy===3}async __submit__(j,O){var ee,$,V;if(await this.yieldLoop(),this.storeOptions.maxConcurrent!=null&&O>this.storeOptions.maxConcurrent)throw new A(`Impossible to add a job having a weight of ${O} to a limiter having a maxConcurrent setting of ${this.storeOptions.maxConcurrent}`);return $=Date.now(),V=this.storeOptions.highWater!=null&&j===this.storeOptions.highWater&&!this.check(O,$),ee=this.strategyIsBlock()&&(V||this.isBlocked($)),ee&&(this._unblockTime=$+this.computePenalty(),this._nextRequest=this._unblockTime+this.storeOptions.minTime,this.instance._dropAllQueued()),{reachedHWM:V,blocked:ee,strategy:this.storeOptions.strategy}}async __free__(j,O){return await this.yieldLoop(),this._running-=O,this._done+=O,this.instance._drainAll(this.computeCapacity()),{running:this._running}}};var E=R,k,U;k=m,U=class{constructor(j){this.status=j,this._jobs={},this.counts=this.status.map(function(){return 0})}next(j){var O,ee;if(O=this._jobs[j],ee=O+1,O!=null&&ee(j[this.status[ee]]=O,j),{})}};var H=U,D,I;D=l,I=class{constructor(j,O){this.schedule=this.schedule.bind(this),this.name=j,this.Promise=O,this._running=0,this._queue=new D}isEmpty(){return this._queue.length===0}async _tryToRun(){var j,O,ee,$,V,W,ne;if(this._running<1&&this._queue.length>0)return this._running++,{task:ne,args:j,resolve:V,reject:$}=this._queue.shift(),O=await async function(){try{return W=await ne(...j),function(){return V(W)}}catch(G){return ee=G,function(){return $(ee)}}}(),this._running--,this._tryToRun(),O()}schedule(j,...O){var ee,$,V;return V=$=null,ee=new this.Promise(function(W,ne){return V=W,$=ne}),this._queue.push({task:j,args:O,resolve:V,reject:$}),this._tryToRun(),ee}};var P=I,B="2.19.5",L={version:B},Y=Object.freeze({version:B,default:L}),q=()=>console.log("You must import the full version of Bottleneck in order to use this feature."),de=()=>console.log("You must import the full version of Bottleneck in order to use this feature."),fe=()=>console.log("You must import the full version of Bottleneck in order to use this feature."),Re,oe,me,ke,J,Ae;Ae=o,Re=u,ke=q,me=de,J=fe,oe=(function(){class he{constructor(O={}){this.deleteKey=this.deleteKey.bind(this),this.limiterOptions=O,Ae.load(this.limiterOptions,this.defaults,this),this.Events=new Re(this),this.instances={},this.Bottleneck=Oe,this._startAutoCleanup(),this.sharedConnection=this.connection!=null,this.connection==null&&(this.limiterOptions.datastore==="redis"?this.connection=new ke(Object.assign({},this.limiterOptions,{Events:this.Events})):this.limiterOptions.datastore==="ioredis"&&(this.connection=new me(Object.assign({},this.limiterOptions,{Events:this.Events}))))}key(O=""){var ee;return(ee=this.instances[O])!=null?ee:(()=>{var $;return $=this.instances[O]=new this.Bottleneck(Object.assign(this.limiterOptions,{id:`${this.id}-${O}`,timeout:this.timeout,connection:this.connection})),this.Events.trigger("created",$,O),$})()}async deleteKey(O=""){var ee,$;return $=this.instances[O],this.connection&&(ee=await this.connection.__runCommand__(["del",...J.allKeys(`${this.id}-${O}`)])),$!=null&&(delete this.instances[O],await $.disconnect()),$!=null||ee>0}limiters(){var O,ee,$,V;ee=this.instances,$=[];for(O in ee)V=ee[O],$.push({key:O,limiter:V});return $}keys(){return Object.keys(this.instances)}async clusterKeys(){var O,ee,$,V,W,ne,G,ge,ue;if(this.connection==null)return this.Promise.resolve(this.keys());for(ne=[],O=null,ue=`b_${this.id}-`.length,ee=9;O!==0;)for([ge,$]=await this.connection.__runCommand__(["scan",O??0,"match",`b_${this.id}-*_settings`,"count",1e4]),O=~~ge,V=0,G=$.length;V{var ee,$,V,W,ne,G;ne=Date.now(),V=this.instances,W=[];for($ in V){G=V[$];try{await G._store.__groupCheck__(ne)?W.push(this.deleteKey($)):W.push(void 0)}catch(ge){ee=ge,W.push(G.Events.trigger("error",ee))}}return W},this.timeout/2)).unref=="function"?O.unref():void 0}updateSettings(O={}){if(Ae.overwrite(O,this.defaults,this),Ae.overwrite(O,O,this.limiterOptions),O.timeout!=null)return this._startAutoCleanup()}disconnect(O=!0){var ee;if(!this.sharedConnection)return(ee=this.connection)!=null?ee.disconnect(O):void 0}}return he.prototype.defaults={timeout:1e3*60*5,connection:null,Promise,id:"group-key"},he}).call(n);var Ee=oe,Ce,Ge,M;M=o,Ge=u,Ce=(function(){class he{constructor(O={}){this.options=O,M.load(this.options,this.defaults,this),this.Events=new Ge(this),this._arr=[],this._resetPromise(),this._lastFlush=Date.now()}_resetPromise(){return this._promise=new this.Promise((O,ee)=>this._resolve=O)}_flush(){return clearTimeout(this._timeout),this._lastFlush=Date.now(),this._resolve(),this.Events.trigger("batch",this._arr),this._arr=[],this._resetPromise()}add(O){var ee;return this._arr.push(O),ee=this._promise,this._arr.length===this.maxSize?this._flush():this.maxTime!=null&&this._arr.length===1&&(this._timeout=setTimeout(()=>this._flush(),this.maxTime)),ee}}return he.prototype.defaults={maxTime:null,maxSize:null,Promise},he}).call(n);var z=Ce,K=()=>console.log("You must import the full version of Bottleneck in order to use this feature."),ce=s(Y),te,we,Me,Se,N,C,Q,ae,_e,pe,De,Pe=[].splice;C=10,we=5,De=o,Q=v,Se=S,N=E,ae=K,Me=u,_e=H,pe=P,te=(function(){class he{constructor(O={},...ee){var $,V;this._addToQueue=this._addToQueue.bind(this),this._validateOptions(O,ee),De.load(O,this.instanceDefaults,this),this._queues=new Q(C),this._scheduled={},this._states=new _e(["RECEIVED","QUEUED","RUNNING","EXECUTING"].concat(this.trackDoneStatus?["DONE"]:[])),this._limiter=null,this.Events=new Me(this),this._submitLock=new pe("submit",this.Promise),this._registerLock=new pe("register",this.Promise),V=De.load(O,this.storeDefaults,{}),this._store=(function(){if(this.datastore==="redis"||this.datastore==="ioredis"||this.connection!=null)return $=De.load(O,this.redisStoreDefaults,{}),new ae(this,V,$);if(this.datastore==="local")return $=De.load(O,this.localStoreDefaults,{}),new N(this,V,$);throw new he.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`)}).call(this),this._queues.on("leftzero",()=>{var W;return(W=this._store.heartbeat)!=null&&typeof W.ref=="function"?W.ref():void 0}),this._queues.on("zero",()=>{var W;return(W=this._store.heartbeat)!=null&&typeof W.unref=="function"?W.unref():void 0})}_validateOptions(O,ee){if(!(O!=null&&typeof O=="object"&&ee.length===0))throw new he.prototype.BottleneckError("Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1.")}ready(){return this._store.ready}clients(){return this._store.clients}channel(){return`b_${this.id}`}channel_client(){return`b_${this.id}_${this._store.clientId}`}publish(O){return this._store.__publish__(O)}disconnect(O=!0){return this._store.__disconnect__(O)}chain(O){return this._limiter=O,this}queued(O){return this._queues.queued(O)}clusterQueued(){return this._store.__queued__()}empty(){return this.queued()===0&&this._submitLock.isEmpty()}running(){return this._store.__running__()}done(){return this._store.__done__()}jobStatus(O){return this._states.jobStatus(O)}jobs(O){return this._states.statusJobs(O)}counts(){return this._states.statusCounts()}_randomIndex(){return Math.random().toString(36).slice(2)}check(O=1){return this._store.__check__(O)}_clearGlobalState(O){return this._scheduled[O]!=null?(clearTimeout(this._scheduled[O].expiration),delete this._scheduled[O],!0):!1}async _free(O,ee,$,V){var W,ne;try{if({running:ne}=await this._store.__free__(O,$.weight),this.Events.trigger("debug",`Freed ${$.id}`,V),ne===0&&this.empty())return this.Events.trigger("idle")}catch(G){return W=G,this.Events.trigger("error",W)}}_run(O,ee,$){var V,W,ne;return ee.doRun(),V=this._clearGlobalState.bind(this,O),ne=this._run.bind(this,O,ee),W=this._free.bind(this,O,ee),this._scheduled[O]={timeout:setTimeout(()=>ee.doExecute(this._limiter,V,ne,W),$),expiration:ee.options.expiration!=null?setTimeout(function(){return ee.doExpire(V,ne,W)},$+ee.options.expiration):void 0,job:ee}}_drainOne(O){return this._registerLock.schedule(()=>{var ee,$,V,W,ne;return this.queued()===0?this.Promise.resolve(null):(ne=this._queues.getFirst(),{options:W,args:ee}=V=ne.first(),O!=null&&W.weight>O?this.Promise.resolve(null):(this.Events.trigger("debug",`Draining ${W.id}`,{args:ee,options:W}),$=this._randomIndex(),this._store.__register__($,W.weight,W.expiration).then(({success:G,wait:ge,reservoir:ue})=>{var Te;return this.Events.trigger("debug",`Drained ${W.id}`,{success:G,args:ee,options:W}),G?(ne.shift(),Te=this.empty(),Te&&this.Events.trigger("empty"),ue===0&&this.Events.trigger("depleted",Te),this._run($,V,ge),this.Promise.resolve(W.weight)):this.Promise.resolve(null)})))})}_drainAll(O,ee=0){return this._drainOne(O).then($=>{var V;return $!=null?(V=O!=null?O-$:O,this._drainAll(V,ee+$)):this.Promise.resolve(ee)}).catch($=>this.Events.trigger("error",$))}_dropAllQueued(O){return this._queues.shiftAll(function(ee){return ee.doDrop({message:O})})}stop(O={}){var ee,$;return O=De.load(O,this.stopDefaults),$=V=>{var W;return W=()=>{var ne;return ne=this._states.counts,ne[0]+ne[1]+ne[2]+ne[3]===V},new this.Promise((ne,G)=>W()?ne():this.on("done",()=>{if(W())return this.removeAllListeners("done"),ne()}))},ee=O.dropWaitingJobs?(this._run=function(V,W){return W.doDrop({message:O.dropErrorMessage})},this._drainOne=()=>this.Promise.resolve(null),this._registerLock.schedule(()=>this._submitLock.schedule(()=>{var V,W,ne;W=this._scheduled;for(V in W)ne=W[V],this.jobStatus(ne.job.options.id)==="RUNNING"&&(clearTimeout(ne.timeout),clearTimeout(ne.expiration),ne.job.doDrop({message:O.dropErrorMessage}));return this._dropAllQueued(O.dropErrorMessage),$(0)}))):this.schedule({priority:C-1,weight:0},()=>$(1)),this._receive=function(V){return V._reject(new he.prototype.BottleneckError(O.enqueueErrorMessage))},this.stop=()=>this.Promise.reject(new he.prototype.BottleneckError("stop() has already been called")),ee}async _addToQueue(O){var ee,$,V,W,ne,G,ge;({args:ee,options:W}=O);try{({reachedHWM:ne,blocked:$,strategy:ge}=await this._store.__submit__(this.queued(),W.weight))}catch(ue){return V=ue,this.Events.trigger("debug",`Could not queue ${W.id}`,{args:ee,options:W,error:V}),O.doDrop({error:V}),!1}return $?(O.doDrop(),!0):ne&&(G=ge===he.prototype.strategy.LEAK?this._queues.shiftLastFrom(W.priority):ge===he.prototype.strategy.OVERFLOW_PRIORITY?this._queues.shiftLastFrom(W.priority+1):ge===he.prototype.strategy.OVERFLOW?O:void 0,G!=null&&G.doDrop(),G==null||ge===he.prototype.strategy.OVERFLOW)?(G==null&&O.doDrop(),ne):(O.doQueue(ne,$),this._queues.push(O),await this._drainAll(),ne)}_receive(O){return this._states.jobStatus(O.options.id)!=null?(O._reject(new he.prototype.BottleneckError(`A job with the same id already exists (id=${O.options.id})`)),!1):(O.doReceive(),this._submitLock.schedule(this._addToQueue,O))}submit(...O){var ee,$,V,W,ne,G,ge;return typeof O[0]=="function"?(ne=O,[$,...O]=ne,[ee]=Pe.call(O,-1),W=De.load({},this.jobDefaults)):(G=O,[W,$,...O]=G,[ee]=Pe.call(O,-1),W=De.load(W,this.jobDefaults)),ge=(...ue)=>new this.Promise(function(Te,Ne){return $(...ue,function(...Je){return(Je[0]!=null?Ne:Te)(Je)})}),V=new Se(ge,O,W,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise),V.promise.then(function(ue){return typeof ee=="function"?ee(...ue):void 0}).catch(function(ue){return Array.isArray(ue)?typeof ee=="function"?ee(...ue):void 0:typeof ee=="function"?ee(ue):void 0}),this._receive(V)}schedule(...O){var ee,$,V;return typeof O[0]=="function"?([V,...O]=O,$={}):[$,V,...O]=O,ee=new Se(V,O,$,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise),this._receive(ee),ee.promise}wrap(O){var ee,$;return ee=this.schedule.bind(this),$=function(...V){return ee(O.bind(this),...V)},$.withOptions=function(V,...W){return ee(V,O,...W)},$}async updateSettings(O={}){return await this._store.__updateSettings__(De.overwrite(O,this.storeDefaults)),De.overwrite(O,this.instanceDefaults,this),this}currentReservoir(){return this._store.__currentReservoir__()}incrementReservoir(O=0){return this._store.__incrementReservoir__(O)}}return he.default=he,he.Events=Me,he.version=he.prototype.version=ce.version,he.strategy=he.prototype.strategy={LEAK:1,OVERFLOW:2,OVERFLOW_PRIORITY:4,BLOCK:3},he.BottleneckError=he.prototype.BottleneckError=m,he.Group=he.prototype.Group=Ee,he.RedisConnection=he.prototype.RedisConnection=q,he.IORedisConnection=he.prototype.IORedisConnection=de,he.Batcher=he.prototype.Batcher=z,he.prototype.jobDefaults={priority:we,weight:1,expiration:null,id:""},he.prototype.storeDefaults={maxConcurrent:null,minTime:0,highWater:null,strategy:he.prototype.strategy.LEAK,penalty:null,reservoir:null,reservoirRefreshInterval:null,reservoirRefreshAmount:null,reservoirIncreaseInterval:null,reservoirIncreaseAmount:null,reservoirIncreaseMaximum:null},he.prototype.localStoreDefaults={Promise,timeout:null,heartbeatInterval:250},he.prototype.redisStoreDefaults={Promise,timeout:null,heartbeatInterval:5e3,clientTimeout:1e4,Redis:null,clientOptions:{},clusterNodes:null,clearDatastore:!1,connection:null},he.prototype.instanceDefaults={datastore:"local",connection:null,id:"",rejectOnDrop:!0,trackDoneStatus:!1,Promise},he.prototype.stopDefaults={enqueueErrorMessage:"This limiter has been stopped and cannot accept new jobs.",dropWaitingJobs:!0,dropErrorMessage:"This limiter has been stopped."},he}).call(n);var Oe=te,Xe=Oe;return Xe})})(VR);var vhe=VR.exports;const WR=Ui(vhe);var yhe="0.0.0-development";async function jR(t,e,n,s){if(!n.request||!n.request.request)throw n;if(n.status>=400&&!t.doNotRetry.includes(n.status)){const i=s.request.retries!=null?s.request.retries:t.retries,r=Math.pow((s.request.retryCount||0)+1,2);throw e.retry.retryRequest(n,i,r)}throw n}async function bhe(t,e,n,s){const i=new WR;return i.on("failed",function(r,o){const a=~~r.request.request.retries,l=~~r.request.request.retryAfter;if(s.request.retryCount=o.retryCount+1,a>o.retryCount)return l*t.retryAfterBaseValue}),i.schedule(whe.bind(null,t,e,n),s)}async function whe(t,e,n,s){const i=await n(n,s);if(i.data&&i.data.errors&&i.data.errors.length>0&&/Something went wrong while executing your query/.test(i.data.errors[0].message)){const r=new Sl(i.data.errors[0].message,500,{request:s,response:i});return jR(t,e,r,s)}return i}function qR(t,e){const n=Object.assign({enabled:!0,retryAfterBaseValue:1e3,doNotRetry:[400,401,403,404,422,451],retries:3},e.retry);return n.enabled&&(t.hook.error("request",jR.bind(null,n,t)),t.hook.wrap("request",bhe.bind(null,n,t))),{retry:{retryRequest:(s,i,r)=>(s.request.request=Object.assign({},s.request.request,{retries:i,retryAfter:r}),s)}}}qR.VERSION=yhe;var xhe="0.0.0-development",Qg=()=>Promise.resolve();function Ehe(t,e,n){return t.retryLimiter.schedule(She,t,e,n)}async function She(t,e,n){const s=n.method!=="GET"&&n.method!=="HEAD",{pathname:i}=new URL(n.url,"http://github.test"),r=n.method==="GET"&&i.startsWith("/search/"),o=i.startsWith("/graphql"),l=~~e.retryCount>0?{priority:0,weight:0}:{};t.clustering&&(l.expiration=1e3*60),(s||o)&&await t.write.key(t.id).schedule(l,Qg),s&&t.triggersNotification(i)&&await t.notifications.key(t.id).schedule(l,Qg),r&&await t.search.key(t.id).schedule(l,Qg);const c=t.global.key(t.id).schedule(l,e,n);if(o){const u=await c;if(u.data.errors!=null&&u.data.errors.some(d=>d.type==="RATE_LIMITED"))throw Object.assign(new Error("GraphQL Rate Limit Exceeded"),{response:u,data:u.data})}return c}var The=["/orgs/{org}/invitations","/orgs/{org}/invitations/{invitation_id}","/orgs/{org}/teams/{team_slug}/discussions","/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments","/repos/{owner}/{repo}/collaborators/{username}","/repos/{owner}/{repo}/commits/{commit_sha}/comments","/repos/{owner}/{repo}/issues","/repos/{owner}/{repo}/issues/{issue_number}/comments","/repos/{owner}/{repo}/pulls","/repos/{owner}/{repo}/pulls/{pull_number}/comments","/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies","/repos/{owner}/{repo}/pulls/{pull_number}/merge","/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers","/repos/{owner}/{repo}/pulls/{pull_number}/reviews","/repos/{owner}/{repo}/releases","/teams/{team_id}/discussions","/teams/{team_id}/discussions/{discussion_number}/comments"];function Ahe(t){const n=`^(?:${t.map(s=>s.split("/").map(i=>i.startsWith("{")?"(?:.+?)":i).join("/")).map(s=>`(?:${s})`).join("|")})[^/]*$`;return new RegExp(n,"i")}var UE=Ahe(The),XR=UE.test.bind(UE),Tl={},Mhe=function(t,e){Tl.global=new t.Group({id:"octokit-global",maxConcurrent:10,...e}),Tl.search=new t.Group({id:"octokit-search",maxConcurrent:1,minTime:2e3,...e}),Tl.write=new t.Group({id:"octokit-write",maxConcurrent:1,minTime:1e3,...e}),Tl.notifications=new t.Group({id:"octokit-notifications",maxConcurrent:1,minTime:3e3,...e})};function yy(t,e){const{enabled:n=!0,Bottleneck:s=WR,id:i="no-id",timeout:r=1e3*60*2,connection:o}=e.throttle||{};if(!n)return{};const a={timeout:r};typeof o<"u"&&(a.connection=o),Tl.global==null&&Mhe(s,a);const l=Object.assign({clustering:o!=null,triggersNotification:XR,fallbackSecondaryRateRetryAfter:60,retryAfterBaseValue:1e3,retryLimiter:new s,id:i,...Tl},e.throttle);if(typeof l.onSecondaryRateLimit!="function"||typeof l.onRateLimit!="function")throw new Error(`octokit/plugin-throttling error: + You must pass the onSecondaryRateLimit and onRateLimit error handlers. + See https://octokit.github.io/rest.js/#throttling + + const octokit = new Octokit({ + throttle: { + onSecondaryRateLimit: (retryAfter, options) => {/* ... */}, + onRateLimit: (retryAfter, options) => {/* ... */} + } + }) + `);const c={},u=new s.Events(c);return c.on("secondary-limit",l.onSecondaryRateLimit),c.on("rate-limit",l.onRateLimit),c.on("error",d=>t.log.warn("Error in throttling-plugin limit handler",d)),l.retryLimiter.on("failed",async function(d,f){const[h,v,_]=f.args,{pathname:m}=new URL(_.url,"http://github.test");if(!(m.startsWith("/graphql")&&d.status!==401||d.status===403||d.status===429))return;const y=~~v.retryCount;v.retryCount=y,_.request.retryCount=y;const{wantRetry:b,retryAfter:w=0}=await async function(){var T;if(/\bsecondary rate\b/i.test(d.message)){const S=Number(d.response.headers["retry-after"])||h.fallbackSecondaryRateRetryAfter;return{wantRetry:await u.trigger("secondary-limit",S,_,t,y),retryAfter:S}}if(d.response.headers!=null&&d.response.headers["x-ratelimit-remaining"]==="0"||(((T=d.response.data)==null?void 0:T.errors)??[]).some(S=>S.type==="RATE_LIMITED")){const S=new Date(~~d.response.headers["x-ratelimit-reset"]*1e3).getTime(),A=Math.max(Math.ceil((S-Date.now())/1e3)+1,0);return{wantRetry:await u.trigger("rate-limit",A,_,t,y),retryAfter:A}}return{}}();if(b)return v.retryCount++,w*h.retryAfterBaseValue}),t.hook.wrap("request",Ehe.bind(null,l)),{}}yy.VERSION=xhe;yy.triggersNotification=XR;function Rhe(t){const e=t.clientType||"oauth-app",n=t.baseUrl||"https://github.com",s={clientType:e,allowSignup:t.allowSignup!==!1,clientId:t.clientId,login:t.login||null,redirectUrl:t.redirectUrl||null,state:t.state||Math.random().toString(36).substr(2),url:""};if(e==="oauth-app"){const i="scopes"in t?t.scopes:[];s.scopes=typeof i=="string"?i.split(/[,\s]+/).filter(Boolean):i}return s.url=Che(`${n}/login/oauth/authorize`,s),s}function Che(t,e){const n={allowSignup:"allow_signup",clientId:"client_id",login:"login",redirectUrl:"redirect_uri",scopes:"scope",state:"state"};let s=t;return Object.keys(n).filter(i=>e[i]!==null).filter(i=>i!=="scopes"?!0:e.clientType==="github-app"?!1:!Array.isArray(e[i])||e[i].length>0).map(i=>[n[i],`${e[i]}`]).forEach(([i,r],o)=>{s+=o===0?"?":"&",s+=`${i}=${encodeURIComponent(r)}`}),s}function KR(t){const e=t.endpoint.DEFAULTS;return/^https:\/\/(api\.)?github\.com$/.test(e.baseUrl)?"https://github.com":e.baseUrl.replace("/api/v3","")}async function gm(t,e,n){const s={baseUrl:KR(t),headers:{accept:"application/json"},...n},i=await t(e,s);if("error"in i.data){const r=new Sl(`${i.data.error_description} (${i.data.error}, ${i.data.error_uri})`,400,{request:t.endpoint.merge(e,s)});throw r.response=i,r}return i}function khe({request:t=Pn,...e}){const n=KR(t);return Rhe({...e,baseUrl:n})}async function Phe(t){const e=t.request||Pn,n=await gm(e,"POST /login/oauth/access_token",{client_id:t.clientId,client_secret:t.clientSecret,code:t.code,redirect_uri:t.redirectUrl}),s={clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:n.data.access_token,scopes:n.data.scope.split(/\s+/).filter(Boolean)};if(t.clientType==="github-app"){if("refresh_token"in n.data){const i=new Date(n.headers.date).getTime();s.refreshToken=n.data.refresh_token,s.expiresAt=FE(i,n.data.expires_in),s.refreshTokenExpiresAt=FE(i,n.data.refresh_token_expires_in)}delete s.scopes}return{...n,authentication:s}}function FE(t,e){return new Date(t+e*1e3).toISOString()}async function Ihe(t){const e=t.request||Pn,n={client_id:t.clientId};return"scopes"in t&&Array.isArray(t.scopes)&&(n.scope=t.scopes.join(" ")),gm(e,"POST /login/device/code",n)}async function $E(t){const e=t.request||Pn,n=await gm(e,"POST /login/oauth/access_token",{client_id:t.clientId,device_code:t.code,grant_type:"urn:ietf:params:oauth:grant-type:device_code"}),s={clientType:t.clientType,clientId:t.clientId,token:n.data.access_token,scopes:n.data.scope.split(/\s+/).filter(Boolean)};if("clientSecret"in t&&(s.clientSecret=t.clientSecret),t.clientType==="github-app"){if("refresh_token"in n.data){const i=new Date(n.headers.date).getTime();s.refreshToken=n.data.refresh_token,s.expiresAt=BE(i,n.data.expires_in),s.refreshTokenExpiresAt=BE(i,n.data.refresh_token_expires_in)}delete s.scopes}return{...n,authentication:s}}function BE(t,e){return new Date(t+e*1e3).toISOString()}async function YR(t){const n=await(t.request||Pn)("POST /applications/{client_id}/token",{headers:{authorization:`basic ${btoa(`${t.clientId}:${t.clientSecret}`)}`},client_id:t.clientId,access_token:t.token}),s={clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:t.token,scopes:n.data.scopes};return n.data.expires_at&&(s.expiresAt=n.data.expires_at),t.clientType==="github-app"&&delete s.scopes,{...n,authentication:s}}async function ZR(t){const e=t.request||Pn,n=await gm(e,"POST /login/oauth/access_token",{client_id:t.clientId,client_secret:t.clientSecret,grant_type:"refresh_token",refresh_token:t.refreshToken}),s=new Date(n.headers.date).getTime(),i={clientType:"github-app",clientId:t.clientId,clientSecret:t.clientSecret,token:n.data.access_token,refreshToken:n.data.refresh_token,expiresAt:HE(s,n.data.expires_in),refreshTokenExpiresAt:HE(s,n.data.refresh_token_expires_in)};return{...n,authentication:i}}function HE(t,e){return new Date(t+e*1e3).toISOString()}async function Ohe(t){const{request:e,clientType:n,clientId:s,clientSecret:i,token:r,...o}=t,l=await(e||Pn)("POST /applications/{client_id}/token/scoped",{headers:{authorization:`basic ${btoa(`${s}:${i}`)}`},client_id:s,access_token:r,...o}),c=Object.assign({clientType:n,clientId:s,clientSecret:i,token:l.data.token},l.data.expires_at?{expiresAt:l.data.expires_at}:{});return{...l,authentication:c}}async function Z0(t){const e=t.request||Pn,n=btoa(`${t.clientId}:${t.clientSecret}`),s=await e("PATCH /applications/{client_id}/token",{headers:{authorization:`basic ${n}`},client_id:t.clientId,access_token:t.token}),i={clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:s.data.token,scopes:s.data.scopes};return s.data.expires_at&&(i.expiresAt=s.data.expires_at),t.clientType==="github-app"&&delete i.scopes,{...s,authentication:i}}async function J0(t){const e=t.request||Pn,n=btoa(`${t.clientId}:${t.clientSecret}`);return e("DELETE /applications/{client_id}/token",{headers:{authorization:`basic ${n}`},client_id:t.clientId,access_token:t.token})}async function Q0(t){const e=t.request||Pn,n=btoa(`${t.clientId}:${t.clientSecret}`);return e("DELETE /applications/{client_id}/grant",{headers:{authorization:`basic ${n}`},client_id:t.clientId,access_token:t.token})}async function JR(t,e){const n=Lhe(t,e.auth);if(n)return n;const{data:s}=await Ihe({clientType:t.clientType,clientId:t.clientId,request:e.request||t.request,scopes:e.auth.scopes||t.scopes});await t.onVerification(s);const i=await e1(e.request||t.request,t.clientId,t.clientType,s);return t.authentication=i,i}function Lhe(t,e){if(e.refresh===!0||!t.authentication)return!1;if(t.clientType==="github-app")return t.authentication;const n=t.authentication,s=("scopes"in e&&e.scopes||t.scopes).join(" "),i=n.scopes.join(" ");return s===i?n:!1}async function GE(t){await new Promise(e=>setTimeout(e,t*1e3))}async function e1(t,e,n,s){try{const i={clientId:e,request:t,code:s.device_code},{authentication:r}=n==="oauth-app"?await $E({...i,clientType:"oauth-app"}):await $E({...i,clientType:"github-app"});return{type:"token",tokenType:"oauth",...r}}catch(i){if(!i.response)throw i;const r=i.response.data.error;if(r==="authorization_pending")return await GE(s.interval),e1(t,e,n,s);if(r==="slow_down")return await GE(s.interval+5),e1(t,e,n,s);throw i}}async function Dhe(t,e){return JR(t,{auth:e})}async function Nhe(t,e,n,s){let i=e.endpoint.merge(n,s);if(/\/login\/(oauth\/access_token|device\/code)$/.test(i.url))return e(i);const{token:r}=await JR(t,{request:e,auth:{type:"oauth"}});return i.headers.authorization=`token ${r}`,e(i)}var Uhe="0.0.0-development";function Fhe(t){const e=t.request||Pn.defaults({headers:{"user-agent":`octokit-auth-oauth-device.js/${Uhe} ${Cr()}`}}),{request:n=e,...s}=t,i=t.clientType==="github-app"?{...s,clientType:"github-app",request:n}:{...s,clientType:"oauth-app",request:n,scopes:t.scopes||[]};if(!t.clientId)throw new Error('[@octokit/auth-oauth-device] "clientId" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');if(!t.onVerification)throw new Error('[@octokit/auth-oauth-device] "onVerification" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');return Object.assign(Dhe.bind(null,i),{hook:Nhe.bind(null,i)})}var QR="0.0.0-development";async function zE(t){if("code"in t.strategyOptions){const{authentication:e}=await Phe({clientId:t.clientId,clientSecret:t.clientSecret,clientType:t.clientType,onTokenCreated:t.onTokenCreated,...t.strategyOptions,request:t.request});return{type:"token",tokenType:"oauth",...e}}if("onVerification"in t.strategyOptions){const n=await Fhe({clientType:t.clientType,clientId:t.clientId,onTokenCreated:t.onTokenCreated,...t.strategyOptions,request:t.request})({type:"oauth"});return{clientSecret:t.clientSecret,...n}}if("token"in t.strategyOptions)return{type:"token",tokenType:"oauth",clientId:t.clientId,clientSecret:t.clientSecret,clientType:t.clientType,onTokenCreated:t.onTokenCreated,...t.strategyOptions};throw new Error("[@octokit/auth-oauth-user] Invalid strategy options")}async function t1(t,e={}){var s,i;if(t.authentication||(t.authentication=t.clientType==="oauth-app"?await zE(t):await zE(t)),t.authentication.invalid)throw new Error("[@octokit/auth-oauth-user] Token is invalid");const n=t.authentication;if("expiresAt"in n&&(e.type==="refresh"||new Date(n.expiresAt) + * @license MIT + * @version 3.7.0 + */class Zhe{constructor(e=1e3,n=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(n)||n<0)throw new Error("Invalid ttl value");this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this.max=e,this.ttl=n}bumpLru(e){if(this.last===e)return;const n=this.last,s=e.next,i=e.prev;this.first===e&&(this.first=s),e.next=null,e.prev=n,n.next=e,i!==null&&(i.next=s),s!==null&&(s.prev=i),this.last=e}clear(){this.items=Object.create(null),this.first=null,this.last=null,this.size=0}delete(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){const n=this.items[e];delete this.items[e],this.size--,n.prev!==null&&(n.prev.next=n.next),n.next!==null&&(n.next.prev=n.prev),this.first===n&&(this.first=n.next),this.last===n&&(this.last=n.prev)}}deleteMany(e){for(var n=0;n0){const e=this.first;delete this.items[e.key],--this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(Object.prototype.hasOwnProperty.call(this.items,e))return this.items[e].expiry}get(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){const n=this.items[e];if(this.ttl>0&&n.expiry<=Date.now()){this.delete(e);return}return this.bumpLru(n),n.value}}getMany(e){const n=[];for(var s=0;s0?Date.now()+this.ttl:this.ttl,this.last!==i&&this.bumpLru(i);return}this.max>0&&this.size===this.max&&this.evict();const s={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:n};this.items[e]=s,++this.size===1?this.first=s:this.last.next=s,this.last=s}}async function fp({appId:t,privateKey:e,timeDifference:n}){try{const s={id:t,privateKey:e};n&&Object.assign(s,{now:Math.floor(Date.now()/1e3)+n});const i=await Yhe(s);return{type:"app",token:i.token,appId:i.appId,expiresAt:new Date(i.expiration*1e3).toISOString()}}catch(s){throw e==="-----BEGIN RSA PRIVATE KEY-----"?new Error("The 'privateKey` option contains only the first line '-----BEGIN RSA PRIVATE KEY-----'. If you are setting it using a `.env` file, make sure it is set on a single line with newlines replaced by '\n'"):s}}function Jhe(){return new Zhe(15e3,1e3*60*59)}async function Qhe(t,e){const n=s5(e),s=await t.get(n);if(!s)return;const[i,r,o,a,l,c]=s.split("|"),u=e.permissions||l.split(/,/).reduce((d,f)=>(/!$/.test(f)?d[f.slice(0,-1)]="write":d[f]="read",d),{});return{token:i,createdAt:r,expiresAt:o,permissions:u,repositoryIds:e.repositoryIds,repositoryNames:e.repositoryNames,singleFileName:c,repositorySelection:a}}async function epe(t,e,n){const s=s5(e),i=e.permissions?"":Object.keys(n.permissions).map(o=>`${o}${n.permissions[o]==="write"?"!":""}`).join(","),r=[n.token,n.createdAt,n.expiresAt,n.repositorySelection,i,n.singleFileName].join("|");await t.set(s,r)}function s5({installationId:t,permissions:e={},repositoryIds:n=[],repositoryNames:s=[]}){const i=Object.keys(e).sort().map(a=>e[a]==="read"?a:`${a}!`).join(","),r=n.sort().join(","),o=s.join(",");return[t,r,o,i].filter(Boolean).join("|")}function jE({installationId:t,token:e,createdAt:n,expiresAt:s,repositorySelection:i,permissions:r,repositoryIds:o,repositoryNames:a,singleFileName:l}){return Object.assign({type:"token",tokenType:"installation",token:e,installationId:t,permissions:r,createdAt:n,expiresAt:s,repositorySelection:i},o?{repositoryIds:o}:null,a?{repositoryNames:a}:null,l?{singleFileName:l}:null)}async function i5(t,e,n){const s=Number(e.installationId||t.installationId);if(!s)throw new Error("[@octokit/auth-app] installationId option is required for installation authentication.");if(e.factory){const{type:T,factory:S,oauthApp:A,...R}={...t,...e};return S(R)}const i=Object.assign({installationId:s},e);if(!e.refresh){const T=await Qhe(t.cache,i);if(T){const{token:S,createdAt:A,expiresAt:R,permissions:x,repositoryIds:E,repositoryNames:k,singleFileName:U,repositorySelection:H}=T;return jE({installationId:s,token:S,createdAt:A,expiresAt:R,permissions:x,repositorySelection:H,repositoryIds:E,repositoryNames:k,singleFileName:U})}}const r=await fp(t),o=n||t.request,a={installation_id:s,mediaType:{previews:["machine-man"]},headers:{authorization:`bearer ${r.token}`}};e.repositoryIds&&Object.assign(a,{repository_ids:e.repositoryIds}),e.repositoryNames&&Object.assign(a,{repositories:e.repositoryNames}),e.permissions&&Object.assign(a,{permissions:e.permissions});const{data:{token:l,expires_at:c,repositories:u,permissions:d,repository_selection:f,single_file:h}}=await o("POST /app/installations/{installation_id}/access_tokens",a),v=d||{},_=f||"all",m=u?u.map(T=>T.id):void 0,g=u?u.map(T=>T.name):void 0,y=new Date().toISOString(),b={token:l,createdAt:y,expiresAt:c,repositorySelection:_,permissions:v,repositoryIds:m,repositoryNames:g};h&&Object.assign(a,{singleFileName:h}),await epe(t.cache,i,b);const w={installationId:s,token:l,createdAt:y,expiresAt:c,repositorySelection:_,permissions:v,repositoryIds:m,repositoryNames:g};return h&&Object.assign(w,{singleFileName:h}),jE(w)}async function tpe(t,e){switch(e.type){case"app":return fp(t);case"oauth-app":return t.oauthApp({type:"oauth-app"});case"installation":return i5(t,{...e,type:"installation"});case"oauth-user":return t.oauthApp(e);default:throw new Error(`Invalid auth type: ${e.type}`)}}var npe=["/app","/app/hook/config","/app/hook/deliveries","/app/hook/deliveries/{delivery_id}","/app/hook/deliveries/{delivery_id}/attempts","/app/installations","/app/installations/{installation_id}","/app/installations/{installation_id}/access_tokens","/app/installations/{installation_id}/suspended","/app/installation-requests","/marketplace_listing/accounts/{account_id}","/marketplace_listing/plan","/marketplace_listing/plans","/marketplace_listing/plans/{plan_id}/accounts","/marketplace_listing/stubbed/accounts/{account_id}","/marketplace_listing/stubbed/plan","/marketplace_listing/stubbed/plans","/marketplace_listing/stubbed/plans/{plan_id}/accounts","/orgs/{org}/installation","/repos/{owner}/{repo}/installation","/users/{username}/installation"];function spe(t){const n=`^(?:${t.map(s=>s.split("/").map(i=>i.startsWith("{")?"(?:.+?)":i).join("/")).map(s=>`(?:${s})`).join("|")})$`;return new RegExp(n,"i")}var ipe=spe(npe);function rpe(t){return!!t&&ipe.test(t.split("?")[0])}var ope=5*1e3;function ape(t){return!(t.message.match(/'Expiration time' claim \('exp'\) must be a numeric value representing the future time at which the assertion expires/)||t.message.match(/'Issued at' claim \('iat'\) must be an Integer representing the time that the assertion was issued/))}async function lpe(t,e,n,s){const i=e.endpoint.merge(n,s),r=i.url;if(/\/login\/oauth\/access_token$/.test(r))return e(i);if(rpe(r.replace(e.endpoint.DEFAULTS.baseUrl,""))){const{token:l}=await fp(t);i.headers.authorization=`bearer ${l}`;let c;try{c=await e(i)}catch(u){if(ape(u)||typeof u.response.headers.date>"u")throw u;const d=Math.floor((Date.parse(u.response.headers.date)-Date.parse(new Date().toString()))/1e3);t.log.warn(u.message),t.log.warn(`[@octokit/auth-app] GitHub API time and system time are different by ${d} seconds. Retrying request with the difference accounted for.`);const{token:f}=await fp({...t,timeDifference:d});return i.headers.authorization=`bearer ${f}`,e(i)}return c}if(by(r)){const l=await t.oauthApp({type:"oauth-app"});return i.headers.authorization=l.headers.authorization,e(i)}const{token:o,createdAt:a}=await i5(t,{},e.defaults({baseUrl:i.baseUrl}));return i.headers.authorization=`token ${o}`,r5(t,e,i,a)}async function r5(t,e,n,s,i=0){const r=+new Date-+new Date(s);try{return await e(n)}catch(o){if(o.status!==401)throw o;if(r>=ope)throw i>0&&(o.message=`After ${i} retries within ${r/1e3}s of creating the installation access token, the response remains 401. At this point, the cause may be an authentication problem or a system outage. Please check https://www.githubstatus.com for status information`),o;++i;const a=i*1e3;return t.log.warn(`[@octokit/auth-app] Retrying after 401 response to account for token replication delay (retry: ${i}, wait: ${a/1e3}s)`),await new Promise(l=>setTimeout(l,a)),r5(t,e,n,s,i)}}var cpe="7.1.3";function wy(t){if(!t.appId)throw new Error("[@octokit/auth-app] appId option is required");if(!t.privateKey)throw new Error("[@octokit/auth-app] privateKey option is required");if("installationId"in t&&!t.installationId)throw new Error("[@octokit/auth-app] installationId is set to a falsy value");const e=Object.assign({warn:console.warn.bind(console)},t.log),n=t.request||Pn.defaults({headers:{"user-agent":`octokit-auth-app.js/${cpe} ${Cr()}`}}),s=Object.assign({request:n,cache:Jhe()},t,t.installationId?{installationId:Number(t.installationId)}:{},{log:e,oauthApp:e5({clientType:"github-app",clientId:t.clientId||"",clientSecret:t.clientSecret||"",request:n})});return Object.assign(tpe.bind(null,s),{hook:lpe.bind(null,s)})}async function upe(t){return{type:"unauthenticated",reason:t}}function dpe(t){return t.status!==403||!t.response?!1:t.response.headers["x-ratelimit-remaining"]==="0"}var fpe=/\babuse\b/i;function hpe(t){return t.status!==403?!1:fpe.test(t.message)}async function ppe(t,e,n,s){const i=e.endpoint.merge(n,s);return e(i).catch(r=>{throw r.status===404?(r.message=`Not found. May be due to lack of authentication. Reason: ${t}`,r):dpe(r)?(r.message=`API rate limit exceeded. This maybe caused by the lack of authentication. Reason: ${t}`,r):hpe(r)?(r.message=`You have triggered an abuse detection mechanism. This maybe caused by the lack of authentication. Reason: ${t}`,r):r.status===401?(r.message=`Unauthorized. "${i.method} ${i.url}" failed most likely due to lack of authentication. Reason: ${t}`,r):(r.status>=400&&r.status<500&&(r.message=r.message.replace(/\.?$/,`. May be caused by lack of authentication (${t}).`)),r)})}var hp=function(e){if(!e||!e.reason)throw new Error("[@octokit/auth-unauthenticated] No reason passed to createUnauthenticatedAuth");return Object.assign(upe.bind(null,e.reason),{hook:ppe.bind(null,e.reason)})},o5="7.1.4";function a5(t,e,n){if(Array.isArray(e)){for(const s of e)a5(t,s,n);return}t.eventHandlers[e]||(t.eventHandlers[e]=[]),t.eventHandlers[e].push(n)}var mpe=_y.defaults({userAgent:`octokit-oauth-app.js/${o5} ${Cr()}`});async function xr(t,e){const{name:n,action:s}=e;if(t.eventHandlers[`${n}.${s}`])for(const i of t.eventHandlers[`${n}.${s}`])await i(e);if(t.eventHandlers[n])for(const i of t.eventHandlers[n])await i(e)}async function gpe(t,e){return t.octokit.auth({type:"oauth-user",...e,async factory(n){const s=new t.Octokit({authStrategy:wr,auth:n}),i=await s.auth({type:"get"});return await xr(t,{name:"token",action:"created",token:i.token,scopes:i.scopes,authentication:i,octokit:s}),s}})}function _pe(t,e){const n={clientId:t.clientId,request:t.octokit.request,...e,allowSignup:t.allowSignup??e.allowSignup,redirectUrl:e.redirectUrl??t.redirectUrl,scopes:e.scopes??t.defaultScopes};return khe({clientType:t.clientType,...n})}async function vpe(t,e){const n=await t.octokit.auth({type:"oauth-user",...e});return await xr(t,{name:"token",action:"created",token:n.token,scopes:n.scopes,authentication:n,octokit:new t.Octokit({authStrategy:wr,auth:{clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:n.token,scopes:n.scopes,refreshToken:n.refreshToken,expiresAt:n.expiresAt,refreshTokenExpiresAt:n.refreshTokenExpiresAt}})}),{authentication:n}}async function ype(t,e){const n=await YR({clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,request:t.octokit.request,...e});return Object.assign(n.authentication,{type:"token",tokenType:"oauth"}),n}async function bpe(t,e){const n={clientId:t.clientId,clientSecret:t.clientSecret,request:t.octokit.request,...e};if(t.clientType==="oauth-app"){const r=await Z0({clientType:"oauth-app",...n}),o=Object.assign(r.authentication,{type:"token",tokenType:"oauth"});return await xr(t,{name:"token",action:"reset",token:r.authentication.token,scopes:r.authentication.scopes||void 0,authentication:o,octokit:new t.Octokit({authStrategy:wr,auth:{clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:r.authentication.token,scopes:r.authentication.scopes}})}),{...r,authentication:o}}const s=await Z0({clientType:"github-app",...n}),i=Object.assign(s.authentication,{type:"token",tokenType:"oauth"});return await xr(t,{name:"token",action:"reset",token:s.authentication.token,authentication:i,octokit:new t.Octokit({authStrategy:wr,auth:{clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:s.authentication.token}})}),{...s,authentication:i}}async function wpe(t,e){if(t.clientType==="oauth-app")throw new Error("[@octokit/oauth-app] app.refreshToken() is not supported for OAuth Apps");const n=await ZR({clientType:"github-app",clientId:t.clientId,clientSecret:t.clientSecret,request:t.octokit.request,refreshToken:e.refreshToken}),s=Object.assign(n.authentication,{type:"token",tokenType:"oauth"});return await xr(t,{name:"token",action:"refreshed",token:n.authentication.token,authentication:s,octokit:new t.Octokit({authStrategy:wr,auth:{clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:n.authentication.token}})}),{...n,authentication:s}}async function xpe(t,e){if(t.clientType==="oauth-app")throw new Error("[@octokit/oauth-app] app.scopeToken() is not supported for OAuth Apps");const n=await Ohe({clientType:"github-app",clientId:t.clientId,clientSecret:t.clientSecret,request:t.octokit.request,...e}),s=Object.assign(n.authentication,{type:"token",tokenType:"oauth"});return await xr(t,{name:"token",action:"scoped",token:n.authentication.token,authentication:s,octokit:new t.Octokit({authStrategy:wr,auth:{clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:n.authentication.token}})}),{...n,authentication:s}}async function Epe(t,e){const n={clientId:t.clientId,clientSecret:t.clientSecret,request:t.octokit.request,...e},s=t.clientType==="oauth-app"?await J0({clientType:"oauth-app",...n}):await J0({clientType:"github-app",...n});return await xr(t,{name:"token",action:"deleted",token:e.token,octokit:new t.Octokit({authStrategy:hp,auth:{reason:'Handling "token.deleted" event. The access for the token has been revoked.'}})}),s}async function Spe(t,e){const n={clientId:t.clientId,clientSecret:t.clientSecret,request:t.octokit.request,...e},s=t.clientType==="oauth-app"?await Q0({clientType:"oauth-app",...n}):await Q0({clientType:"github-app",...n});return await xr(t,{name:"token",action:"deleted",token:e.token,octokit:new t.Octokit({authStrategy:hp,auth:{reason:'Handling "token.deleted" event. The access for the token has been revoked.'}})}),await xr(t,{name:"authorization",action:"deleted",token:e.token,octokit:new t.Octokit({authStrategy:hp,auth:{reason:'Handling "authorization.deleted" event. The access for the app has been revoked.'}})}),s}var E_,Tpe=(E_=class{constructor(t){xe(this,"type");xe(this,"on");xe(this,"octokit");xe(this,"getUserOctokit");xe(this,"getWebFlowAuthorizationUrl");xe(this,"createToken");xe(this,"checkToken");xe(this,"resetToken");xe(this,"refreshToken");xe(this,"scopeToken");xe(this,"deleteToken");xe(this,"deleteAuthorization");const e=t.Octokit||mpe;this.type=t.clientType||"oauth-app";const n=new e({authStrategy:e5,auth:{clientType:this.type,clientId:t.clientId,clientSecret:t.clientSecret}}),s={clientType:this.type,clientId:t.clientId,clientSecret:t.clientSecret,defaultScopes:t.defaultScopes||[],allowSignup:t.allowSignup,baseUrl:t.baseUrl,redirectUrl:t.redirectUrl,log:t.log,Octokit:e,octokit:n,eventHandlers:{}};this.on=a5.bind(null,s),this.octokit=n,this.getUserOctokit=gpe.bind(null,s),this.getWebFlowAuthorizationUrl=_pe.bind(null,s),this.createToken=vpe.bind(null,s),this.checkToken=ype.bind(null,s),this.resetToken=bpe.bind(null,s),this.refreshToken=wpe.bind(null,s),this.scopeToken=xpe.bind(null,s),this.deleteToken=Epe.bind(null,s),this.deleteAuthorization=Spe.bind(null,s)}static defaults(t){return class extends this{constructor(...n){super({...t,...n[0]})}}}},xe(E_,"VERSION",o5),E_),xy=new TextEncoder;function Ape(t){const n=t.match(/[\dA-F]{2}/gi).map(function(s){return parseInt(s,16)});return new Uint8Array(n)}function Mpe(t){return Array.prototype.map.call(new Uint8Array(t),e=>e.toString(16).padStart(2,"0")).join("")}async function l5(t){return crypto.subtle.importKey("raw",xy.encode(t),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"])}async function Rpe(t,e){if(!t||!e)throw new TypeError("[@octokit/webhooks-methods] secret & payload required for sign()");if(typeof e!="string")throw new TypeError("[@octokit/webhooks-methods] payload must be a string");const n="sha256",s=await crypto.subtle.sign("HMAC",await l5(t),xy.encode(e));return`${n}=${Mpe(s)}`}async function c5(t,e,n){if(!t||!e||!n)throw new TypeError("[@octokit/webhooks-methods] secret, eventPayload & signature required");if(typeof e!="string")throw new TypeError("[@octokit/webhooks-methods] eventPayload must be a string");return await crypto.subtle.verify("HMAC",await l5(t),Ape(n.replace("sha256=","")),xy.encode(e))}var u5=t=>({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console),...t}),Cpe=["branch_protection_configuration","branch_protection_configuration.disabled","branch_protection_configuration.enabled","branch_protection_rule","branch_protection_rule.created","branch_protection_rule.deleted","branch_protection_rule.edited","check_run","check_run.completed","check_run.created","check_run.requested_action","check_run.rerequested","check_suite","check_suite.completed","check_suite.requested","check_suite.rerequested","code_scanning_alert","code_scanning_alert.appeared_in_branch","code_scanning_alert.closed_by_user","code_scanning_alert.created","code_scanning_alert.fixed","code_scanning_alert.reopened","code_scanning_alert.reopened_by_user","commit_comment","commit_comment.created","create","custom_property","custom_property.created","custom_property.deleted","custom_property.updated","custom_property_values","custom_property_values.updated","delete","dependabot_alert","dependabot_alert.auto_dismissed","dependabot_alert.auto_reopened","dependabot_alert.created","dependabot_alert.dismissed","dependabot_alert.fixed","dependabot_alert.reintroduced","dependabot_alert.reopened","deploy_key","deploy_key.created","deploy_key.deleted","deployment","deployment.created","deployment_protection_rule","deployment_protection_rule.requested","deployment_review","deployment_review.approved","deployment_review.rejected","deployment_review.requested","deployment_status","deployment_status.created","discussion","discussion.answered","discussion.category_changed","discussion.closed","discussion.created","discussion.deleted","discussion.edited","discussion.labeled","discussion.locked","discussion.pinned","discussion.reopened","discussion.transferred","discussion.unanswered","discussion.unlabeled","discussion.unlocked","discussion.unpinned","discussion_comment","discussion_comment.created","discussion_comment.deleted","discussion_comment.edited","fork","github_app_authorization","github_app_authorization.revoked","gollum","installation","installation.created","installation.deleted","installation.new_permissions_accepted","installation.suspend","installation.unsuspend","installation_repositories","installation_repositories.added","installation_repositories.removed","installation_target","installation_target.renamed","issue_comment","issue_comment.created","issue_comment.deleted","issue_comment.edited","issues","issues.assigned","issues.closed","issues.deleted","issues.demilestoned","issues.edited","issues.labeled","issues.locked","issues.milestoned","issues.opened","issues.pinned","issues.reopened","issues.transferred","issues.unassigned","issues.unlabeled","issues.unlocked","issues.unpinned","label","label.created","label.deleted","label.edited","marketplace_purchase","marketplace_purchase.cancelled","marketplace_purchase.changed","marketplace_purchase.pending_change","marketplace_purchase.pending_change_cancelled","marketplace_purchase.purchased","member","member.added","member.edited","member.removed","membership","membership.added","membership.removed","merge_group","merge_group.checks_requested","merge_group.destroyed","meta","meta.deleted","milestone","milestone.closed","milestone.created","milestone.deleted","milestone.edited","milestone.opened","org_block","org_block.blocked","org_block.unblocked","organization","organization.deleted","organization.member_added","organization.member_invited","organization.member_removed","organization.renamed","package","package.published","package.updated","page_build","personal_access_token_request","personal_access_token_request.approved","personal_access_token_request.cancelled","personal_access_token_request.created","personal_access_token_request.denied","ping","project","project.closed","project.created","project.deleted","project.edited","project.reopened","project_card","project_card.converted","project_card.created","project_card.deleted","project_card.edited","project_card.moved","project_column","project_column.created","project_column.deleted","project_column.edited","project_column.moved","projects_v2","projects_v2.closed","projects_v2.created","projects_v2.deleted","projects_v2.edited","projects_v2.reopened","projects_v2_item","projects_v2_item.archived","projects_v2_item.converted","projects_v2_item.created","projects_v2_item.deleted","projects_v2_item.edited","projects_v2_item.reordered","projects_v2_item.restored","projects_v2_status_update","projects_v2_status_update.created","projects_v2_status_update.deleted","projects_v2_status_update.edited","public","pull_request","pull_request.assigned","pull_request.auto_merge_disabled","pull_request.auto_merge_enabled","pull_request.closed","pull_request.converted_to_draft","pull_request.demilestoned","pull_request.dequeued","pull_request.edited","pull_request.enqueued","pull_request.labeled","pull_request.locked","pull_request.milestoned","pull_request.opened","pull_request.ready_for_review","pull_request.reopened","pull_request.review_request_removed","pull_request.review_requested","pull_request.synchronize","pull_request.unassigned","pull_request.unlabeled","pull_request.unlocked","pull_request_review","pull_request_review.dismissed","pull_request_review.edited","pull_request_review.submitted","pull_request_review_comment","pull_request_review_comment.created","pull_request_review_comment.deleted","pull_request_review_comment.edited","pull_request_review_thread","pull_request_review_thread.resolved","pull_request_review_thread.unresolved","push","registry_package","registry_package.published","registry_package.updated","release","release.created","release.deleted","release.edited","release.prereleased","release.published","release.released","release.unpublished","repository","repository.archived","repository.created","repository.deleted","repository.edited","repository.privatized","repository.publicized","repository.renamed","repository.transferred","repository.unarchived","repository_advisory","repository_advisory.published","repository_advisory.reported","repository_dispatch","repository_dispatch.sample.collected","repository_import","repository_ruleset","repository_ruleset.created","repository_ruleset.deleted","repository_ruleset.edited","repository_vulnerability_alert","repository_vulnerability_alert.create","repository_vulnerability_alert.dismiss","repository_vulnerability_alert.reopen","repository_vulnerability_alert.resolve","secret_scanning_alert","secret_scanning_alert.created","secret_scanning_alert.reopened","secret_scanning_alert.resolved","secret_scanning_alert.validated","secret_scanning_alert_location","secret_scanning_alert_location.created","security_advisory","security_advisory.published","security_advisory.updated","security_advisory.withdrawn","security_and_analysis","sponsorship","sponsorship.cancelled","sponsorship.created","sponsorship.edited","sponsorship.pending_cancellation","sponsorship.pending_tier_change","sponsorship.tier_changed","star","star.created","star.deleted","status","sub_issues","sub_issues.parent_issue_added","sub_issues.parent_issue_removed","sub_issues.sub_issue_added","sub_issues.sub_issue_removed","team","team.added_to_repository","team.created","team.deleted","team.edited","team.removed_from_repository","team_add","watch","watch.started","workflow_dispatch","workflow_job","workflow_job.completed","workflow_job.in_progress","workflow_job.queued","workflow_job.waiting","workflow_run","workflow_run.completed","workflow_run.in_progress","workflow_run.requested"];function Ey(t,e,n){t.hooks[e]||(t.hooks[e]=[]),t.hooks[e].push(n)}function d5(t,e,n){if(Array.isArray(e)){e.forEach(s=>d5(t,s,n));return}if(["*","error"].includes(e)){const s=e==="*"?"any":e,i=`Using the "${e}" event with the regular Webhooks.on() function is not supported. Please use the Webhooks.on${s.charAt(0).toUpperCase()+s.slice(1)}() method instead`;throw new Error(i)}Cpe.includes(e)||t.log.warn(`"${e}" is not a known webhook name (https://developer.github.com/v3/activity/events/types/)`),Ey(t,e,n)}function kpe(t,e){Ey(t,"*",e)}function Ppe(t,e){Ey(t,"error",e)}function qE(t,e){let n;try{n=t(e)}catch(s){console.log('FATAL: Error occurred in "error" event handler'),console.log(s)}n&&n.catch&&n.catch(s=>{console.log('FATAL: Error occurred in "error" event handler'),console.log(s)})}function Ipe(t,e,n){const s=[t.hooks[n],t.hooks["*"]];return e&&s.unshift(t.hooks[`${n}.${e}`]),[].concat(...s.filter(Boolean))}function Ope(t,e){const n=t.hooks.error||[];if(e instanceof Error){const o=Object.assign(new AggregateError([e],e.message),{event:e});return n.forEach(a=>qE(a,o)),Promise.reject(o)}if(!e||!e.name){const o=new Error("Event name not passed");throw new AggregateError([o],o.message)}if(!e.payload){const o=new Error("Event name not passed");throw new AggregateError([o],o.message)}const s=Ipe(t,"action"in e.payload?e.payload.action:null,e.name);if(s.length===0)return Promise.resolve();const i=[],r=s.map(o=>{let a=Promise.resolve(e);return t.transform&&(a=a.then(t.transform)),a.then(l=>o(l)).catch(l=>i.push(Object.assign(l,{event:e})))});return Promise.all(r).then(()=>{if(i.length===0)return;const o=new AggregateError(i,i.map(a=>a.message).join(` +`));throw Object.assign(o,{event:e}),n.forEach(a=>qE(a,o)),o})}function f5(t,e,n){if(Array.isArray(e)){e.forEach(s=>f5(t,s,n));return}if(t.hooks[e]){for(let s=t.hooks[e].length-1;s>=0;s--)if(t.hooks[e][s]===n){t.hooks[e].splice(s,1);return}}}function Lpe(t){const e={hooks:{},log:u5(t&&t.log)};return t&&t.transform&&(e.transform=t.transform),{on:d5.bind(null,e),onAny:kpe.bind(null,e),onError:Ppe.bind(null,e),removeListener:f5.bind(null,e),receive:Ope.bind(null,e)}}async function Dpe(t,e){if(!await c5(t.secret,e.payload,e.signature).catch(()=>!1)){const i=new Error("[@octokit/webhooks] signature does not match event payload and secret");return t.eventHandler.receive(Object.assign(i,{event:e,status:400}))}let s;try{s=JSON.parse(e.payload)}catch(i){throw i.message="Invalid JSON",i.status=400,new AggregateError([i],i.message)}return t.eventHandler.receive({id:e.id,name:e.name,payload:s})}var Npe=class{constructor(t){xe(this,"sign");xe(this,"verify");xe(this,"on");xe(this,"onAny");xe(this,"onError");xe(this,"removeListener");xe(this,"receive");xe(this,"verifyAndReceive");if(!t||!t.secret)throw new Error("[@octokit/webhooks] options.secret required");const e={eventHandler:Lpe(t),secret:t.secret,hooks:{},log:u5(t.log)};this.sign=Rpe.bind(null,t.secret),this.verify=c5.bind(null,t.secret),this.on=e.eventHandler.on,this.onAny=e.eventHandler.onAny,this.onError=e.eventHandler.onError,this.removeListener=e.eventHandler.removeListener,this.receive=e.eventHandler.receive,this.verifyAndReceive=Dpe.bind(null,e)}},Upe="15.1.1";function Fpe(t,e){return new Npe({secret:e.secret,transform:async n=>{if(!("installation"in n.payload)||typeof n.payload.installation!="object"){const r=new t.constructor({authStrategy:hp,auth:{reason:'"installation" key missing in webhook event payload'}});return{...n,octokit:r}}const s=n.payload.installation.id,i=await t.auth({type:"installation",installationId:s,factory(r){return new r.octokit.constructor({...r.octokitOptions,authStrategy:wy,auth:{...r,installationId:s}})}});return i.hook.before("request",r=>{r.headers["x-github-delivery"]=n.id}),{...n,octokit:i}}})}async function h5(t,e){return t.octokit.auth({type:"installation",installationId:e,factory(n){const s={...n.octokitOptions,authStrategy:wy,auth:{...n,installationId:e}};return new n.octokit.constructor(s)}})}function $pe(t){return Object.assign(Bpe.bind(null,t),{iterator:p5.bind(null,t)})}async function Bpe(t,e){const n=p5(t)[Symbol.asyncIterator]();let s=await n.next();for(;!s.done;)await e(s.value),s=await n.next()}function p5(t){return{async*[Symbol.asyncIterator](){const e=UR.iterator(t.octokit,"GET /app/installations");for await(const{data:n}of e)for(const s of n)yield{octokit:await h5(t,s.id),installation:s}}}}function Hpe(t){return Object.assign(Gpe.bind(null,t),{iterator:m5.bind(null,t)})}async function Gpe(t,e,n){const s=m5(t,n?e:void 0)[Symbol.asyncIterator]();let i=await s.next();for(;!i.done;)n?await n(i.value):await e(i.value),i=await s.next()}function zpe(t,e){return{async*[Symbol.asyncIterator](){yield{octokit:await t.getInstallationOctokit(e)}}}}function m5(t,e){return{async*[Symbol.asyncIterator](){const n=e?zpe(t,e.installationId):t.eachInstallation.iterator();for await(const{octokit:s}of n){const i=UR.iterator(s,"GET /installation/repositories");for await(const{data:r}of i)for(const o of r)yield{octokit:s,repository:o}}}}}function Vpe(t){let e;return async function(s={}){e||(e=Wpe(t));const i=await e,r=new URL(i);return s.target_id!==void 0&&(r.pathname+="/permissions",r.searchParams.append("target_id",s.target_id.toFixed())),s.state!==void 0&&r.searchParams.append("state",s.state),r.href}}async function Wpe(t){const{data:e}=await t.octokit.request("GET /app");if(!e)throw new Error("[@octokit/app] unable to fetch metadata for app");return`${e.html_url}/installations/new`}var S_,jpe=(S_=class{constructor(e){xe(this,"octokit");xe(this,"webhooks");xe(this,"oauth");xe(this,"getInstallationOctokit");xe(this,"eachInstallation");xe(this,"eachRepository");xe(this,"getInstallationUrl");xe(this,"log");const n=e.Octokit||_y,s=Object.assign({appId:e.appId,privateKey:e.privateKey},e.oauth?{clientId:e.oauth.clientId,clientSecret:e.oauth.clientSecret}:{}),i={authStrategy:wy,auth:s};"log"in e&&typeof e.log<"u"&&(i.log=e.log),this.octokit=new n(i),this.log=Object.assign({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console)},e.log),e.webhooks?this.webhooks=Fpe(this.octokit,e.webhooks):Object.defineProperty(this,"webhooks",{get(){throw new Error("[@octokit/app] webhooks option not set")}}),e.oauth?this.oauth=new Tpe({...e.oauth,clientType:"github-app",Octokit:n}):Object.defineProperty(this,"oauth",{get(){throw new Error("[@octokit/app] oauth.clientId / oauth.clientSecret options are not set")}}),this.getInstallationOctokit=h5.bind(null,this),this.eachInstallation=$pe(this),this.eachRepository=Hpe(this),this.getInstallationUrl=Vpe(this)}static defaults(e){return class extends this{constructor(...s){super({...e,...s[0]})}}}},xe(S_,"VERSION",Upe),S_),qpe="0.0.0-development",Xpe=_y.plugin(zR,FR,dhe,qR,yy).defaults({userAgent:`octokit.js/${qpe}`,throttle:{onRateLimit:Kpe,onSecondaryRateLimit:Ype}});function Kpe(t,e,n){if(n.log.warn(`Request quota exhausted for request ${e.method} ${e.url}`),e.request.retryCount===0)return n.log.info(`Retrying after ${t} seconds!`),!0}function Ype(t,e,n){if(n.log.warn(`SecondaryRateLimit detected for request ${e.method} ${e.url}`),e.request.retryCount===0)return n.log.info(`Retrying after ${t} seconds!`),!0}var Zpe=jpe.defaults({Octokit:Xpe});const hd=15,n1=30,s1=19,Jpe=29,pp=256,Sy=pp+1+Jpe,XE=2*Sy+1,iu=256,Qpe=7,KE=16,YE=17,ZE=18,e_=8*2,mp=-1,eme=1,Gf=2,tme=0,pl=0,JE=1,nme=3,os=4,Zs=0,g5=1,zf=2,Js=-2,sme=-3,cl=-5;function _m(t){return vm(t.map(([e,n])=>new Array(e).fill(n,0,e)))}function vm(t){return t.reduce((e,n)=>e.concat(Array.isArray(n)?vm(n):n),[])}const QE=[0,1,2,3].concat(..._m([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function zt(){const t=this;function e(i){const r=t.dyn_tree,o=t.stat_desc.static_tree,a=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,d,f,h,v,_,m=0;for(h=0;h<=hd;h++)i.bl_count[h]=0;for(r[i.heap[i.heap_max]*2+1]=0,u=i.heap_max+1;uc&&(h=c,m++),r[d*2+1]=h,!(d>t.max_code)&&(i.bl_count[h]++,v=0,d>=l&&(v=a[d-l]),_=r[d*2],i.opt_len+=_*(h+v),o&&(i.static_len+=_*(o[d*2+1]+v)));if(m!==0){do{for(h=c-1;i.bl_count[h]===0;)h--;i.bl_count[h]--,i.bl_count[h+1]+=2,i.bl_count[c]--,m-=2}while(m>0);for(h=c;h!==0;h--)for(d=i.bl_count[h];d!==0;)f=i.heap[--u],!(f>t.max_code)&&(r[f*2+1]!=h&&(i.opt_len+=(h-r[f*2+1])*r[f*2],r[f*2+1]=h),d--)}}function n(i,r){let o=0;do o|=i&1,i>>>=1,o<<=1;while(--r>0);return o>>>1}function s(i,r,o){const a=[];let l=0,c,u,d;for(c=1;c<=hd;c++)a[c]=l=l+o[c-1]<<1;for(u=0;u<=r;u++)d=i[u*2+1],d!==0&&(i[u*2]=n(a[d]++,d))}t.build_tree=function(i){const r=t.dyn_tree,o=t.stat_desc.static_tree,a=t.stat_desc.elems;let l,c,u=-1,d;for(i.heap_len=0,i.heap_max=XE,l=0;l=1;l--)i.pqdownheap(r,l);d=a;do l=i.heap[1],i.heap[1]=i.heap[i.heap_len--],i.pqdownheap(r,1),c=i.heap[1],i.heap[--i.heap_max]=l,i.heap[--i.heap_max]=c,r[d*2]=r[l*2]+r[c*2],i.depth[d]=Math.max(i.depth[l],i.depth[c])+1,r[l*2+1]=r[c*2+1]=d,i.heap[1]=d++,i.pqdownheap(r,1);while(i.heap_len>=2);i.heap[--i.heap_max]=i.heap[1],e(i),s(r,t.max_code,i.bl_count)}}zt._length_code=[0,1,2,3,4,5,6,7].concat(..._m([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));zt.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];zt.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];zt.d_code=function(t){return t<256?QE[t]:QE[256+(t>>>7)]};zt.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];zt.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];zt.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];zt.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Rn(t,e,n,s,i){const r=this;r.static_tree=t,r.extra_bits=e,r.extra_base=n,r.elems=s,r.max_length=i}const ime=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],rme=_m([[144,8],[112,9],[24,7],[8,8]]);Rn.static_ltree=vm(ime.map((t,e)=>[t,rme[e]]));const ome=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],ame=_m([[30,5]]);Rn.static_dtree=vm(ome.map((t,e)=>[t,ame[e]]));Rn.static_l_desc=new Rn(Rn.static_ltree,zt.extra_lbits,pp+1,Sy,hd);Rn.static_d_desc=new Rn(Rn.static_dtree,zt.extra_dbits,0,n1,hd);Rn.static_bl_desc=new Rn(null,zt.extra_blbits,0,s1,Qpe);const lme=9,cme=8;function hi(t,e,n,s,i){const r=this;r.good_length=t,r.max_lazy=e,r.nice_length=n,r.max_chain=s,r.func=i}const _5=0,Mh=1,Jo=2,Ys=[new hi(0,0,0,0,_5),new hi(4,4,8,4,Mh),new hi(4,5,16,8,Mh),new hi(4,6,32,32,Mh),new hi(4,4,16,16,Jo),new hi(8,16,32,32,Jo),new hi(8,16,128,128,Jo),new hi(8,32,128,256,Jo),new hi(32,128,258,1024,Jo),new hi(32,258,258,4096,Jo)],Vf=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],Is=0,Wf=1,ru=2,jf=3,ume=32,t_=42,qf=113,ou=666,n_=8,dme=0,s_=1,fme=2,qt=3,Rh=258,ys=Rh+qt+1;function eS(t,e,n,s){const i=t[e*2],r=t[n*2];return i=3&&B[zt.bl_order[$]*2+1]===0;$--);return t.opt_len+=3*($+1)+5+5+4,$}function M($){t.pending_buf[t.pending++]=$}function z($){M($&255),M($>>>8&255)}function K($){M($>>8&255),M($&255&255)}function ce($,V){let W;const ne=V;ke>e_-ne?(W=$,me|=W<>>e_-ke,ke+=ne-e_):(me|=$<=8&&(M(me&255),me>>>=8,ke-=8)}function N(){ce(s_<<1,3),te(iu,Rn.static_ltree),Se(),1+oe+10-ke<9&&(ce(s_<<1,3),te(iu,Rn.static_ltree),Se()),oe=7}function C($,V){let W,ne,G;if(t.dist_buf[fe]=$,t.lc_buf[fe]=V&255,fe++,$===0?I[V*2]++:(Re++,$--,I[(zt._length_code[V]+pp+1)*2]++,P[zt.d_code($)*2]++),!(fe&8191)&&k>2){for(W=fe*8,ne=T-g,G=0;G>>=3,Re8?z(me):ke>0&&M(me&255),me=0,ke=0}function _e($,V,W){ae(),oe=8,z(V),z(~V),t.pending_buf.set(l.subarray($,$+V),t.pending),t.pending+=V}function pe($,V,W){ce((dme<<1)+(W?1:0),3),_e($,V)}function De($,V,W){let ne,G,ge=0;k>0?(L.build_tree(t),Y.build_tree(t),ge=Ge(),ne=t.opt_len+3+7>>>3,G=t.static_len+3+7>>>3,G<=ne&&(ne=G)):ne=G=V+5,V+4<=ne&&$!=-1?pe($,V,W):G==ne?(ce((s_<<1)+(W?1:0),3),Q(Rn.static_ltree,Rn.static_dtree)):(ce((fme<<1)+(W?1:0),3),Me(L.max_code+1,Y.max_code+1,ge+1),Q(I,P)),Ae(),W&&ae()}function Pe($){De(g>=0?g:-1,T-g,$),g=T,e.flush_pending()}function Oe(){let $,V,W,ne;do{if(ne=c-A-T,ne===0&&T===0&&A===0)ne=r;else if(ne==-1)ne--;else if(T>=r+r-ys){l.set(l.subarray(r,r+r),0),S-=r,T-=r,g-=r,$=h,W=$;do V=d[--W]&65535,d[W]=V>=r?V-r:0;while(--$!==0);$=r,W=$;do V=u[--W]&65535,u[W]=V>=r?V-r:0;while(--$!==0);ne+=r}if(e.avail_in===0)return;$=e.read_buf(l,T+A,ne),A+=$,A>=qt&&(f=l[T]&255,f=(f<s-5&&(V=s-5);;){if(A<=1){if(Oe(),A===0&&$==pl)return Is;if(A===0)break}if(T+=A,A=0,W=g+V,(T===0||T>=W)&&(A=T-W,T=W,Pe(!1),e.avail_out===0)||T-g>=r-ys&&(Pe(!1),e.avail_out===0))return Is}return Pe($==os),e.avail_out===0?$==os?ru:Is:$==os?jf:Wf}function he($){let V=x,W=T,ne,G,ge=R;const ue=T>r-ys?T-(r-ys):0;let Te=D;const Ne=a,Je=T+Rh;let bt=l[W+ge-1],Zt=l[W+ge];R>=H&&(V>>=2),Te>A&&(Te=A);do if(ne=$,!(l[ne+ge]!=Zt||l[ne+ge-1]!=bt||l[ne]!=l[W]||l[++ne]!=l[W+1])){W+=2,ne++;do;while(l[++W]==l[++ne]&&l[++W]==l[++ne]&&l[++W]==l[++ne]&&l[++W]==l[++ne]&&l[++W]==l[++ne]&&l[++W]==l[++ne]&&l[++W]==l[++ne]&&l[++W]==l[++ne]&&Wge){if(S=$,ge=G,G>=Te)break;bt=l[W+ge-1],Zt=l[W+ge]}}while(($=u[$&Ne]&65535)>ue&&--V!==0);return ge<=A?ge:A}function j($){let V=0,W;for(;;){if(A=qt&&(f=(f<=qt)if(W=C(T-S,y-qt),A-=y,y<=E&&A>=qt){y--;do T++,f=(f<=qt&&(f=(f<4096)&&(y=qt-1)),R>=qt&&y<=R){ne=T+A-qt,W=C(T-1-b,R-qt),A-=R-1,R-=2;do++T<=ne&&(f=(f<lme||ne!=n_||W<9||W>15||V<0||V>9||ge<0||ge>Gf?Js:($.dstate=t,o=W,r=1<9||W<0||W>Gf?Js:(Ys[k].func!=Ys[V].func&&$.total_in!==0&&(ne=$.deflate(JE)),k!=V&&(k=V,E=Ys[k].max_lazy,H=Ys[k].good_length,D=Ys[k].nice_length,x=Ys[k].max_chain),U=W,ne)},t.deflateSetDictionary=function($,V,W){let ne=W,G,ge=0;if(!V||n!=t_)return Js;if(ner-ys&&(ne=r-ys,ge=W-ne),l.set(V.subarray(ge,ge+ne),0),T=ne,g=ne,f=l[0]&255,f=(f<os||V<0)return Js;if(!$.next_out||!$.next_in&&$.avail_in!==0||n==ou&&V!=os)return $.msg=Vf[zf-Js],Js;if($.avail_out===0)return $.msg=Vf[zf-cl],cl;if(e=$,ge=i,i=V,n==t_&&(ne=n_+(o-8<<4)<<8,G=(k-1&255)>>1,G>3&&(G=3),ne|=G<<6,T!==0&&(ne|=ume),ne+=31-ne%31,n=qf,K(ne)),t.pending!==0){if(e.flush_pending(),e.avail_out===0)return i=-1,Zs}else if(e.avail_in===0&&V<=ge&&V!=os)return e.msg=Vf[zf-cl],cl;if(n==ou&&e.avail_in!==0)return $.msg=Vf[zf-cl],cl;if(e.avail_in!==0||A!==0||V!=pl&&n!=ou){switch(ue=-1,Ys[k].func){case _5:ue=Xe(V);break;case Mh:ue=j(V);break;case Jo:ue=O(V);break}if((ue==ru||ue==jf)&&(n=ou),ue==Is||ue==ru)return e.avail_out===0&&(i=-1),Zs;if(ue==Wf){if(V==JE)N();else if(pe(0,0,!1),V==nme)for(W=0;Wn&&(i=n),i===0?0:(s.avail_in-=i,t.set(s.next_in.subarray(s.next_in_index,s.next_in_index+i),e),s.next_in_index+=i,s.total_in+=i,i)},flush_pending(){const t=this;let e=t.dstate.pending;e>t.avail_out&&(e=t.avail_out),e!==0&&(t.next_out.set(t.dstate.pending_buf.subarray(t.dstate.pending_out,t.dstate.pending_out+e),t.next_out_index),t.next_out_index+=e,t.dstate.pending_out+=e,t.total_out+=e,t.avail_out-=e,t.dstate.pending-=e,t.dstate.pending===0&&(t.dstate.pending_out=0))}};function pme(t){const e=this,n=new v5,s=mme(t&&t.chunkSize?t.chunkSize:64*1024),i=pl,r=new Uint8Array(s);let o=t?t.level:mp;typeof o>"u"&&(o=mp),n.deflateInit(o),n.next_out=r,e.append=function(a,l){let c,u,d=0,f=0,h=0;const v=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=s,c=n.deflate(i),c!=Zs)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==s?v.push(new Uint8Array(r)):v.push(r.subarray(0,n.next_out_index))),h+=n.next_out_index,l&&n.next_in_index>0&&n.next_in_index!=d&&(l(n.next_in_index),d=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return v.length>1?(u=new Uint8Array(h),v.forEach(function(_){u.set(_,f),f+=_.length})):u=v[0]?new Uint8Array(v[0]):new Uint8Array,u}},e.flush=function(){let a,l,c=0,u=0;const d=[];do{if(n.next_out_index=0,n.avail_out=s,a=n.deflate(os),a!=g5&&a!=Zs)throw new Error("deflating: "+n.msg);s-n.avail_out>0&&d.push(r.slice(0,n.next_out_index)),u+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),l=new Uint8Array(u),d.forEach(function(f){l.set(f,c),c+=f.length}),l}}function mme(t){return t+5*(Math.floor(t/16383)+1)}const gme=15,xt=0,gr=1,_me=2,ls=-2,Wt=-3,tS=-4,_r=-5,ws=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],y5=1440,vme=0,yme=4,bme=9,wme=5,xme=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],Eme=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],Sme=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Tme=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],Ame=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Mme=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Hr=15;function i1(){const t=this;let e,n,s,i,r,o;function a(c,u,d,f,h,v,_,m,g,y,b){let w,T,S,A,R,x,E,k,U,H,D,I,P,B,L;H=0,R=d;do s[c[u+H]]++,H++,R--;while(R!==0);if(s[0]==d)return _[0]=-1,m[0]=0,xt;for(k=m[0],x=1;x<=Hr&&s[x]===0;x++);for(E=x,kR&&(k=R),m[0]=k,B=1<I+k;){if(A++,I+=k,L=S-I,L=L>k?k:L,(T=1<<(x=E-I))>w+1&&(T-=w+1,P=E,xy5)return Wt;r[A]=D=y[0],y[0]+=L,A!==0?(o[A]=R,i[0]=x,i[1]=k,x=R>>>I-k,i[2]=D-r[A-1]-x,g.set(i,(r[A-1]+x)*3)):_[0]=D}for(i[1]=E-I,H>=d?i[0]=192:b[H]>>I;x>>=1)R^=x;for(R^=x,U=(1<257?(y==Wt?g.msg="oversubscribed distance tree":y==_r?(g.msg="incomplete distance tree",y=Wt):y!=tS&&(g.msg="empty distance tree with lengths",y=Wt),y):xt)}}i1.inflate_trees_fixed=function(t,e,n,s){return t[0]=bme,e[0]=wme,n[0]=xme,s[0]=Eme,xt};const Xf=0,nS=1,sS=2,iS=3,rS=4,oS=5,aS=6,i_=7,lS=8,Kf=9;function Rme(){const t=this;let e,n=0,s,i=0,r=0,o=0,a=0,l=0,c=0,u=0,d,f=0,h,v=0;function _(m,g,y,b,w,T,S,A){let R,x,E,k,U,H,D,I,P,B,L,Y,q,de,fe,Re;D=A.next_in_index,I=A.avail_in,U=S.bitb,H=S.bitk,P=S.write,B=P>=x[Re+1],H-=x[Re+1],S.win[P++]=x[Re+2],B--;continue}do{if(U>>=x[Re+1],H-=x[Re+1],k&16){for(k&=15,q=x[Re+2]+(U&ws[k]),U>>=k,H-=k;H<15;)I--,U|=(A.read_byte(D++)&255)<>=x[Re+1],H-=x[Re+1],k&16){for(k&=15;H>=k,H-=k,B-=q,P>=de)fe=P-de,P-fe>0&&2>P-fe?(S.win[P++]=S.win[fe++],S.win[P++]=S.win[fe++],q-=2):(S.win.set(S.win.subarray(fe,fe+2),P),P+=2,fe+=2,q-=2);else{fe=P-de;do fe+=S.end;while(fe<0);if(k=S.end-fe,q>k){if(q-=k,P-fe>0&&k>P-fe)do S.win[P++]=S.win[fe++];while(--k!==0);else S.win.set(S.win.subarray(fe,fe+k),P),P+=k,fe+=k,k=0;fe=0}}if(P-fe>0&&q>P-fe)do S.win[P++]=S.win[fe++];while(--q!==0);else S.win.set(S.win.subarray(fe,fe+q),P),P+=q,fe+=q,q=0;break}else if(!(k&64))R+=x[Re+2],R+=U&ws[k],Re=(E+R)*3,k=x[Re];else return A.msg="invalid distance code",q=A.avail_in-I,q=H>>3>3:q,I+=q,D-=q,H-=q<<3,S.bitb=U,S.bitk=H,A.avail_in=I,A.total_in+=D-A.next_in_index,A.next_in_index=D,S.write=P,Wt;while(!0);break}if(k&64)return k&32?(q=A.avail_in-I,q=H>>3>3:q,I+=q,D-=q,H-=q<<3,S.bitb=U,S.bitk=H,A.avail_in=I,A.total_in+=D-A.next_in_index,A.next_in_index=D,S.write=P,gr):(A.msg="invalid literal/length code",q=A.avail_in-I,q=H>>3>3:q,I+=q,D-=q,H-=q<<3,S.bitb=U,S.bitk=H,A.avail_in=I,A.total_in+=D-A.next_in_index,A.next_in_index=D,S.write=P,Wt);if(R+=x[Re+2],R+=U&ws[k],Re=(E+R)*3,(k=x[Re])===0){U>>=x[Re+1],H-=x[Re+1],S.win[P++]=x[Re+2],B--;break}}while(!0)}while(B>=258&&I>=10);return q=A.avail_in-I,q=H>>3>3:q,I+=q,D-=q,H-=q<<3,S.bitb=U,S.bitk=H,A.avail_in=I,A.total_in+=D-A.next_in_index,A.next_in_index=D,S.write=P,xt}t.init=function(m,g,y,b,w,T){e=Xf,c=m,u=g,d=y,f=b,h=w,v=T,s=null},t.proc=function(m,g,y){let b,w,T,S=0,A=0,R=0,x,E,k,U;for(R=g.next_in_index,x=g.avail_in,S=m.bitb,A=m.bitk,E=m.write,k=E=258&&x>=10&&(m.bitb=S,m.bitk=A,g.avail_in=x,g.total_in+=R-g.next_in_index,g.next_in_index=R,m.write=E,y=_(c,u,d,f,h,v,m,g),R=g.next_in_index,x=g.avail_in,S=m.bitb,A=m.bitk,E=m.write,k=E>>=s[w+1],A-=s[w+1],T=s[w],T===0){o=s[w+2],e=aS;break}if(T&16){a=T&15,n=s[w+2],e=sS;break}if(!(T&64)){r=T,i=w/3+s[w+2];break}if(T&32){e=i_;break}return e=Kf,g.msg="invalid literal/length code",y=Wt,m.bitb=S,m.bitk=A,g.avail_in=x,g.total_in+=R-g.next_in_index,g.next_in_index=R,m.write=E,m.inflate_flush(g,y);case sS:for(b=a;A>=b,A-=b,r=u,s=h,i=v,e=iS;case iS:for(b=r;A>=s[w+1],A-=s[w+1],T=s[w],T&16){a=T&15,l=s[w+2],e=rS;break}if(!(T&64)){r=T,i=w/3+s[w+2];break}return e=Kf,g.msg="invalid distance code",y=Wt,m.bitb=S,m.bitk=A,g.avail_in=x,g.total_in+=R-g.next_in_index,g.next_in_index=R,m.write=E,m.inflate_flush(g,y);case rS:for(b=a;A>=b,A-=b,e=oS;case oS:for(U=E-l;U<0;)U+=m.end;for(;n!==0;){if(k===0&&(E==m.end&&m.read!==0&&(E=0,k=E7&&(A-=8,x++,R--),m.write=E,y=m.inflate_flush(g,y),E=m.write,k=E_.avail_out&&(g=_.avail_out),g!==0&&m==_r&&(m=xt),_.avail_out-=g,_.total_out+=g,_.next_out.set(n.win.subarray(b,b+g),y),y+=g,b+=g,b==n.end&&(b=0,n.write==n.end&&(n.write=0),g=n.write-b,g>_.avail_out&&(g=_.avail_out),g!==0&&m==_r&&(m=xt),_.avail_out-=g,_.total_out+=g,_.next_out.set(n.win.subarray(b,b+g),y),y+=g,b+=g),_.next_out_index=y,n.read=b,m},n.proc=function(_,m){let g,y,b,w,T,S,A,R;for(w=_.next_in_index,T=_.avail_in,y=n.bitb,b=n.bitk,S=n.write,A=S>>1){case 0:y>>>=3,b-=3,g=b&7,y>>>=g,b-=g,s=r_;break;case 1:x=[],E=[],k=[[]],U=[[]],i1.inflate_trees_fixed(x,E,k,U),u.init(x[0],E[0],k[0],0,U[0],0),y>>>=3,b-=3,s=Yf;break;case 2:y>>>=3,b-=3,s=dS;break;case 3:return y>>>=3,b-=3,s=Wo,_.msg="invalid block type",m=Wt,n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=S,n.inflate_flush(_,m)}break;case r_:for(;b<32;){if(T!==0)m=xt;else return n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=S,n.inflate_flush(_,m);T--,y|=(_.read_byte(w++)&255)<>>16&65535)!=(y&65535))return s=Wo,_.msg="invalid stored block lengths",m=Wt,n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=S,n.inflate_flush(_,m);i=y&65535,y=b=0,s=i!==0?uS:d!==0?Zf:ul;break;case uS:if(T===0||A===0&&(S==n.end&&n.read!==0&&(S=0,A=ST&&(g=T),g>A&&(g=A),n.win.set(_.read_buf(w,g),S),w+=g,T-=g,S+=g,A-=g,(i-=g)!==0)break;s=d!==0?Zf:ul;break;case dS:for(;b<14;){if(T!==0)m=xt;else return n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=S,n.inflate_flush(_,m);T--,y|=(_.read_byte(w++)&255)<29||(g>>5&31)>29)return s=Wo,_.msg="too many length or distance symbols",m=Wt,n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=S,n.inflate_flush(_,m);if(g=258+(g&31)+(g>>5&31),!a||a.length>>=14,b-=14,o=0,s=fS;case fS:for(;o<4+(r>>>10);){for(;b<3;){if(T!==0)m=xt;else return n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=S,n.inflate_flush(_,m);T--,y|=(_.read_byte(w++)&255)<>>=3,b-=3}for(;o<19;)a[cS[o++]]=0;if(l[0]=7,g=v.inflate_trees_bits(a,l,c,f,_),g!=xt)return m=g,m==Wt&&(a=null,s=Wo),n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=S,n.inflate_flush(_,m);o=0,s=hS;case hS:for(;g=r,!(o>=258+(g&31)+(g>>5&31));){let B,L;for(g=l[0];b>>=g,b-=g,a[o++]=L;else{for(R=L==18?7:L-14,B=L==18?11:3;b>>=g,b-=g,B+=y&ws[R],y>>>=R,b-=R,R=o,g=r,R+B>258+(g&31)+(g>>5&31)||L==16&&R<1)return a=null,s=Wo,_.msg="invalid bit length repeat",m=Wt,n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=S,n.inflate_flush(_,m);L=L==16?a[R-1]:0;do a[R++]=L;while(--B!==0);o=R}}if(c[0]=-1,H=[],D=[],I=[],P=[],H[0]=9,D[0]=6,g=r,g=v.inflate_trees_dynamic(257+(g&31),1+(g>>5&31),a,H,D,I,P,f,_),g!=xt)return g==Wt&&(a=null,s=Wo),m=g,n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=S,n.inflate_flush(_,m);u.init(H[0],D[0],f,I[0],f,P[0]),s=Yf;case Yf:if(n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=S,(m=u.proc(n,_,m))!=gr)return n.inflate_flush(_,m);if(m=xt,u.free(_),w=_.next_in_index,T=_.avail_in,y=n.bitb,b=n.bitk,S=n.write,A=S15?(t.inflateEnd(n),ls):(t.wbits=s,n.istate.blocks=new Cme(n,1<>4)+8>o.wbits){o.mode=Gr,n.msg="invalid win size",o.marker=5;break}o.mode=mS;case mS:if(n.avail_in===0)return i;if(i=s,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((o.method<<8)+r)%31!==0){o.mode=Gr,n.msg="incorrect header check",o.marker=5;break}if(!(r&kme)){o.mode=au;break}o.mode=gS;case gS:if(n.avail_in===0)return i;i=s,n.avail_in--,n.total_in++,o.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,o.mode=_S;case _S:if(n.avail_in===0)return i;i=s,n.avail_in--,n.total_in++,o.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,o.mode=vS;case vS:if(n.avail_in===0)return i;i=s,n.avail_in--,n.total_in++,o.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,o.mode=yS;case yS:return n.avail_in===0?i:(i=s,n.avail_in--,n.total_in++,o.need+=n.read_byte(n.next_in_index++)&255,o.mode=o_,_me);case o_:return o.mode=Gr,n.msg="need dictionary",o.marker=0,ls;case au:if(i=o.blocks.proc(n,i),i==Wt){o.mode=Gr,o.marker=0;break}if(i==xt&&(i=s),i!=gr)return i;i=s,o.blocks.reset(n,o.was),o.mode=bS;case bS:return n.avail_in=0,gr;case Gr:return Wt;default:return ls}},t.inflateSetDictionary=function(n,s,i){let r=0,o=i;if(!n||!n.istate||n.istate.mode!=o_)return ls;const a=n.istate;return o>=1<0&&n.next_in_index!=f&&(l(n.next_in_index),f=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return c.length>1?(d=new Uint8Array(v),c.forEach(function(_){d.set(_,h),h+=_.length})):d=c[0]?new Uint8Array(c[0]):new Uint8Array,d}},e.flush=function(){n.inflateEnd()}}const va=4294967295,to=65535,Nme=8,Ume=0,Fme=99,$me=67324752,Bme=134695760,wS=33639248,Hme=101010256,xS=101075792,Gme=117853008,dl=22,a_=20,l_=56,zme=1,Vme=39169,Wme=10,jme=1,qme=21589,Xme=28789,Kme=25461,Yme=6534,ES=1,Zme=6,SS=8,TS=2048,AS=16,Jme="/",ss=void 0,xo="undefined",Ld="function";class MS{constructor(e){return class extends TransformStream{constructor(n,s){const i=new e(s);super({transform(r,o){o.enqueue(i.append(r))},flush(r){const o=i.flush();o&&r.enqueue(o)}})}}}}const Qme=64;let w5=2;try{typeof navigator!=xo&&navigator.hardwareConcurrency&&(w5=navigator.hardwareConcurrency)}catch{}const ege={chunkSize:512*1024,maxWorkers:w5,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:ss,CompressionStreamNative:typeof CompressionStream!=xo&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=xo&&DecompressionStream},no=Object.assign({},ege);function tge(){return no}function nge(t){return Math.max(t.chunkSize,Qme)}function Ty(t){const{baseURL:e,chunkSize:n,maxWorkers:s,terminateWorkerTimeout:i,useCompressionStream:r,useWebWorkers:o,Deflate:a,Inflate:l,CompressionStream:c,DecompressionStream:u,workerScripts:d}=t;if(zr("baseURL",e),zr("chunkSize",n),zr("maxWorkers",s),zr("terminateWorkerTimeout",i),zr("useCompressionStream",r),zr("useWebWorkers",o),a&&(no.CompressionStream=new MS(a)),l&&(no.DecompressionStream=new MS(l)),zr("CompressionStream",c),zr("DecompressionStream",u),d!==ss){const{deflate:f,inflate:h}=d;if((f||h)&&(no.workerScripts||(no.workerScripts={})),f){if(!Array.isArray(f))throw new Error("workerScripts.deflate must be an array");no.workerScripts.deflate=f}if(h){if(!Array.isArray(h))throw new Error("workerScripts.inflate must be an array");no.workerScripts.inflate=h}}}function zr(t,e){e!==ss&&(no[t]=e)}const c_={application:{"andrew-inset":"ez",annodex:"anx","atom+xml":"atom","atomcat+xml":"atomcat","atomserv+xml":"atomsrv",bbolin:"lin","cu-seeme":"cu","davmount+xml":"davmount",dsptype:"tsp",ecmascript:["es","ecma"],futuresplash:"spl",hta:"hta","java-archive":"jar","java-serialized-object":"ser","java-vm":"class",m3g:"m3g","mac-binhex40":"hqx",mathematica:["nb","ma","mb"],msaccess:"mdb",msword:["doc","dot","wiz"],mxf:"mxf",oda:"oda",ogg:"ogx",pdf:"pdf","pgp-keys":"key","pgp-signature":["asc","sig"],"pics-rules":"prf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],rar:"rar","rdf+xml":"rdf","rss+xml":"rss",rtf:"rtf","xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","xpdl"],"xspf+xml":"xspf",zip:"zip","vnd.android.package-archive":"apk","vnd.cinderella":"cdy","vnd.google-earth.kml+xml":"kml","vnd.google-earth.kmz":"kmz","vnd.mozilla.xul+xml":"xul","vnd.ms-excel":["xls","xlb","xlt","xlm","xla","xlc","xlw"],"vnd.ms-pki.seccat":"cat","vnd.ms-pki.stl":"stl","vnd.ms-powerpoint":["ppt","pps","pot","ppa","pwz"],"vnd.oasis.opendocument.chart":"odc","vnd.oasis.opendocument.database":"odb","vnd.oasis.opendocument.formula":"odf","vnd.oasis.opendocument.graphics":"odg","vnd.oasis.opendocument.graphics-template":"otg","vnd.oasis.opendocument.image":"odi","vnd.oasis.opendocument.presentation":"odp","vnd.oasis.opendocument.presentation-template":"otp","vnd.oasis.opendocument.spreadsheet":"ods","vnd.oasis.opendocument.spreadsheet-template":"ots","vnd.oasis.opendocument.text":"odt","vnd.oasis.opendocument.text-master":["odm","otm"],"vnd.oasis.opendocument.text-template":"ott","vnd.oasis.opendocument.text-web":"oth","vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","vnd.openxmlformats-officedocument.presentationml.template":"potx","vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","vnd.smaf":"mmf","vnd.stardivision.calc":"sdc","vnd.stardivision.chart":"sds","vnd.stardivision.draw":"sda","vnd.stardivision.impress":"sdd","vnd.stardivision.math":["sdf","smf"],"vnd.stardivision.writer":["sdw","vor"],"vnd.stardivision.writer-global":"sgl","vnd.sun.xml.calc":"sxc","vnd.sun.xml.calc.template":"stc","vnd.sun.xml.draw":"sxd","vnd.sun.xml.draw.template":"std","vnd.sun.xml.impress":"sxi","vnd.sun.xml.impress.template":"sti","vnd.sun.xml.math":"sxm","vnd.sun.xml.writer":"sxw","vnd.sun.xml.writer.global":"sxg","vnd.sun.xml.writer.template":"stw","vnd.symbian.install":["sis","sisx"],"vnd.visio":["vsd","vst","vss","vsw","vsdx","vssx","vstx","vssm","vstm"],"vnd.wap.wbxml":"wbxml","vnd.wap.wmlc":"wmlc","vnd.wap.wmlscriptc":"wmlsc","vnd.wordperfect":"wpd","vnd.wordperfect5.1":"wp5","x-123":"wk","x-7z-compressed":"7z","x-abiword":"abw","x-apple-diskimage":"dmg","x-bcpio":"bcpio","x-bittorrent":"torrent","x-cbr":["cbr","cba","cbt","cb7"],"x-cbz":"cbz","x-cdf":["cdf","cda"],"x-cdlink":"vcd","x-chess-pgn":"pgn","x-cpio":"cpio","x-csh":"csh","x-director":["dir","dxr","cst","cct","cxt","w3d","fgd","swa"],"x-dms":"dms","x-doom":"wad","x-dvi":"dvi","x-httpd-eruby":"rhtml","x-font":"pcf.Z","x-freemind":"mm","x-gnumeric":"gnumeric","x-go-sgf":"sgf","x-graphing-calculator":"gcf","x-gtar":["gtar","taz"],"x-hdf":"hdf","x-httpd-php":["phtml","pht","php"],"x-httpd-php-source":"phps","x-httpd-php3":"php3","x-httpd-php3-preprocessed":"php3p","x-httpd-php4":"php4","x-httpd-php5":"php5","x-ica":"ica","x-info":"info","x-internet-signup":["ins","isp"],"x-iphone":"iii","x-iso9660-image":"iso","x-java-jnlp-file":"jnlp","x-jmol":"jmz","x-killustrator":"kil","x-latex":"latex","x-lyx":"lyx","x-lzx":"lzx","x-maker":["frm","fb","fbdoc"],"x-ms-wmd":"wmd","x-msdos-program":["com","exe","bat","dll"],"x-netcdf":["nc"],"x-ns-proxy-autoconfig":["pac","dat"],"x-nwc":"nwc","x-object":"o","x-oz-application":"oza","x-pkcs7-certreqresp":"p7r","x-python-code":["pyc","pyo"],"x-qgis":["qgs","shp","shx"],"x-quicktimeplayer":"qtl","x-redhat-package-manager":["rpm","rpa"],"x-ruby":"rb","x-sh":"sh","x-shar":"shar","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","x-stuffit":"sit","x-sv4cpio":"sv4cpio","x-sv4crc":"sv4crc","x-tar":"tar","x-tex-gf":"gf","x-tex-pk":"pk","x-texinfo":["texinfo","texi"],"x-trash":["~","%","bak","old","sik"],"x-ustar":"ustar","x-wais-source":"src","x-wingz":"wz","x-x509-ca-cert":["crt","der","cer"],"x-xcf":"xcf","x-xfig":"fig","x-xpinstall":"xpi",applixware:"aw","atomsvc+xml":"atomsvc","ccxml+xml":"ccxml","cdmi-capability":"cdmia","cdmi-container":"cdmic","cdmi-domain":"cdmid","cdmi-object":"cdmio","cdmi-queue":"cdmiq","docbook+xml":"dbk","dssc+der":"dssc","dssc+xml":"xdssc","emma+xml":"emma","epub+zip":"epub",exi:"exi","font-tdpfr":"pfr","gml+xml":"gml","gpx+xml":"gpx",gxf:"gxf",hyperstudio:"stk","inkml+xml":["ink","inkml"],ipfix:"ipfix","jsonml+json":"jsonml","lost+xml":"lostxml","mads+xml":"mads",marc:"mrc","marcxml+xml":"mrcx","mathml+xml":["mathml","mml"],mbox:"mbox","mediaservercontrol+xml":"mscml","metalink+xml":"metalink","metalink4+xml":"meta4","mets+xml":"mets","mods+xml":"mods",mp21:["m21","mp21"],mp4:"mp4s","oebps-package+xml":"opf","omdoc+xml":"omdoc",onenote:["onetoc","onetoc2","onetmp","onepkg"],oxps:"oxps","patch-ops-error+xml":"xer","pgp-encrypted":"pgp",pkcs10:"p10","pkcs7-mime":["p7m","p7c"],"pkcs7-signature":"p7s",pkcs8:"p8","pkix-attr-cert":"ac","pkix-crl":"crl","pkix-pkipath":"pkipath",pkixcmp:"pki","pls+xml":"pls","prs.cww":"cww","pskc+xml":"pskcxml","reginfo+xml":"rif","relax-ng-compact-syntax":"rnc","resource-lists+xml":"rl","resource-lists-diff+xml":"rld","rls-services+xml":"rs","rpki-ghostbusters":"gbr","rpki-manifest":"mft","rpki-roa":"roa","rsd+xml":"rsd","sbml+xml":"sbml","scvp-cv-request":"scq","scvp-cv-response":"scs","scvp-vp-request":"spq","scvp-vp-response":"spp",sdp:"sdp","set-payment-initiation":"setpay","set-registration-initiation":"setreg","shf+xml":"shf","sparql-query":"rq","sparql-results+xml":"srx",srgs:"gram","srgs+xml":"grxml","sru+xml":"sru","ssdl+xml":"ssdl","ssml+xml":"ssml","tei+xml":["tei","teicorpus"],"thraud+xml":"tfi","timestamped-data":"tsd","vnd.3gpp.pic-bw-large":"plb","vnd.3gpp.pic-bw-small":"psb","vnd.3gpp.pic-bw-var":"pvb","vnd.3gpp2.tcap":"tcap","vnd.3m.post-it-notes":"pwn","vnd.accpac.simply.aso":"aso","vnd.accpac.simply.imp":"imp","vnd.acucobol":"acu","vnd.acucorp":["atc","acutc"],"vnd.adobe.air-application-installer-package+zip":"air","vnd.adobe.formscentral.fcdt":"fcdt","vnd.adobe.fxp":["fxp","fxpl"],"vnd.adobe.xdp+xml":"xdp","vnd.adobe.xfdf":"xfdf","vnd.ahead.space":"ahead","vnd.airzip.filesecure.azf":"azf","vnd.airzip.filesecure.azs":"azs","vnd.amazon.ebook":"azw","vnd.americandynamics.acc":"acc","vnd.amiga.ami":"ami","vnd.anser-web-certificate-issue-initiation":"cii","vnd.anser-web-funds-transfer-initiation":"fti","vnd.antix.game-component":"atx","vnd.apple.installer+xml":"mpkg","vnd.apple.mpegurl":"m3u8","vnd.aristanetworks.swi":"swi","vnd.astraea-software.iota":"iota","vnd.audiograph":"aep","vnd.blueice.multipass":"mpm","vnd.bmi":"bmi","vnd.businessobjects":"rep","vnd.chemdraw+xml":"cdxml","vnd.chipnuts.karaoke-mmd":"mmd","vnd.claymore":"cla","vnd.cloanto.rp9":"rp9","vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"vnd.cluetrust.cartomobile-config":"c11amc","vnd.cluetrust.cartomobile-config-pkg":"c11amz","vnd.commonspace":"csp","vnd.contact.cmsg":"cdbcmsg","vnd.cosmocaller":"cmc","vnd.crick.clicker":"clkx","vnd.crick.clicker.keyboard":"clkk","vnd.crick.clicker.palette":"clkp","vnd.crick.clicker.template":"clkt","vnd.crick.clicker.wordbank":"clkw","vnd.criticaltools.wbs+xml":"wbs","vnd.ctc-posml":"pml","vnd.cups-ppd":"ppd","vnd.curl.car":"car","vnd.curl.pcurl":"pcurl","vnd.dart":"dart","vnd.data-vision.rdz":"rdz","vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"vnd.dece.ttml+xml":["uvt","uvvt"],"vnd.dece.unspecified":["uvx","uvvx"],"vnd.dece.zip":["uvz","uvvz"],"vnd.denovo.fcselayout-link":"fe_launch","vnd.dna":"dna","vnd.dolby.mlp":"mlp","vnd.dpgraph":"dpg","vnd.dreamfactory":"dfac","vnd.ds-keypoint":"kpxx","vnd.dvb.ait":"ait","vnd.dvb.service":"svc","vnd.dynageo":"geo","vnd.ecowin.chart":"mag","vnd.enliven":"nml","vnd.epson.esf":"esf","vnd.epson.msf":"msf","vnd.epson.quickanime":"qam","vnd.epson.salt":"slt","vnd.epson.ssf":"ssf","vnd.eszigno3+xml":["es3","et3"],"vnd.ezpix-album":"ez2","vnd.ezpix-package":"ez3","vnd.fdf":"fdf","vnd.fdsn.mseed":"mseed","vnd.fdsn.seed":["seed","dataless"],"vnd.flographit":"gph","vnd.fluxtime.clip":"ftc","vnd.framemaker":["fm","frame","maker","book"],"vnd.frogans.fnc":"fnc","vnd.frogans.ltf":"ltf","vnd.fsc.weblaunch":"fsc","vnd.fujitsu.oasys":"oas","vnd.fujitsu.oasys2":"oa2","vnd.fujitsu.oasys3":"oa3","vnd.fujitsu.oasysgp":"fg5","vnd.fujitsu.oasysprs":"bh2","vnd.fujixerox.ddd":"ddd","vnd.fujixerox.docuworks":"xdw","vnd.fujixerox.docuworks.binder":"xbd","vnd.fuzzysheet":"fzs","vnd.genomatix.tuxedo":"txd","vnd.geogebra.file":"ggb","vnd.geogebra.tool":"ggt","vnd.geometry-explorer":["gex","gre"],"vnd.geonext":"gxt","vnd.geoplan":"g2w","vnd.geospace":"g3w","vnd.gmx":"gmx","vnd.grafeq":["gqf","gqs"],"vnd.groove-account":"gac","vnd.groove-help":"ghf","vnd.groove-identity-message":"gim","vnd.groove-injector":"grv","vnd.groove-tool-message":"gtm","vnd.groove-tool-template":"tpl","vnd.groove-vcard":"vcg","vnd.hal+xml":"hal","vnd.handheld-entertainment+xml":"zmm","vnd.hbci":"hbci","vnd.hhe.lesson-player":"les","vnd.hp-hpgl":"hpgl","vnd.hp-hpid":"hpid","vnd.hp-hps":"hps","vnd.hp-jlyt":"jlt","vnd.hp-pcl":"pcl","vnd.hp-pclxl":"pclxl","vnd.hydrostatix.sof-data":"sfd-hdstx","vnd.ibm.minipay":"mpy","vnd.ibm.modcap":["afp","listafp","list3820"],"vnd.ibm.rights-management":"irm","vnd.ibm.secure-container":"sc","vnd.iccprofile":["icc","icm"],"vnd.igloader":"igl","vnd.immervision-ivp":"ivp","vnd.immervision-ivu":"ivu","vnd.insors.igm":"igm","vnd.intercon.formnet":["xpw","xpx"],"vnd.intergeo":"i2g","vnd.intu.qbo":"qbo","vnd.intu.qfx":"qfx","vnd.ipunplugged.rcprofile":"rcprofile","vnd.irepository.package+xml":"irp","vnd.is-xpr":"xpr","vnd.isac.fcs":"fcs","vnd.jam":"jam","vnd.jcp.javame.midlet-rms":"rms","vnd.jisp":"jisp","vnd.joost.joda-archive":"joda","vnd.kahootz":["ktz","ktr"],"vnd.kde.karbon":"karbon","vnd.kde.kchart":"chrt","vnd.kde.kformula":"kfo","vnd.kde.kivio":"flw","vnd.kde.kontour":"kon","vnd.kde.kpresenter":["kpr","kpt"],"vnd.kde.kspread":"ksp","vnd.kde.kword":["kwd","kwt"],"vnd.kenameaapp":"htke","vnd.kidspiration":"kia","vnd.kinar":["kne","knp"],"vnd.koan":["skp","skd","skt","skm"],"vnd.kodak-descriptor":"sse","vnd.las.las+xml":"lasxml","vnd.llamagraphics.life-balance.desktop":"lbd","vnd.llamagraphics.life-balance.exchange+xml":"lbe","vnd.lotus-1-2-3":"123","vnd.lotus-approach":"apr","vnd.lotus-freelance":"pre","vnd.lotus-notes":"nsf","vnd.lotus-organizer":"org","vnd.lotus-screencam":"scm","vnd.lotus-wordpro":"lwp","vnd.macports.portpkg":"portpkg","vnd.mcd":"mcd","vnd.medcalcdata":"mc1","vnd.mediastation.cdkey":"cdkey","vnd.mfer":"mwf","vnd.mfmp":"mfm","vnd.micrografx.flo":"flo","vnd.micrografx.igx":"igx","vnd.mif":"mif","vnd.mobius.daf":"daf","vnd.mobius.dis":"dis","vnd.mobius.mbk":"mbk","vnd.mobius.mqy":"mqy","vnd.mobius.msl":"msl","vnd.mobius.plc":"plc","vnd.mobius.txf":"txf","vnd.mophun.application":"mpn","vnd.mophun.certificate":"mpc","vnd.ms-artgalry":"cil","vnd.ms-cab-compressed":"cab","vnd.ms-excel.addin.macroenabled.12":"xlam","vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","vnd.ms-excel.sheet.macroenabled.12":"xlsm","vnd.ms-excel.template.macroenabled.12":"xltm","vnd.ms-fontobject":"eot","vnd.ms-htmlhelp":"chm","vnd.ms-ims":"ims","vnd.ms-lrm":"lrm","vnd.ms-officetheme":"thmx","vnd.ms-powerpoint.addin.macroenabled.12":"ppam","vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","vnd.ms-powerpoint.slide.macroenabled.12":"sldm","vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","vnd.ms-powerpoint.template.macroenabled.12":"potm","vnd.ms-project":["mpp","mpt"],"vnd.ms-word.document.macroenabled.12":"docm","vnd.ms-word.template.macroenabled.12":"dotm","vnd.ms-works":["wps","wks","wcm","wdb"],"vnd.ms-wpl":"wpl","vnd.ms-xpsdocument":"xps","vnd.mseq":"mseq","vnd.musician":"mus","vnd.muvee.style":"msty","vnd.mynfc":"taglet","vnd.neurolanguage.nlu":"nlu","vnd.nitf":["ntf","nitf"],"vnd.noblenet-directory":"nnd","vnd.noblenet-sealer":"nns","vnd.noblenet-web":"nnw","vnd.nokia.n-gage.data":"ngdat","vnd.nokia.n-gage.symbian.install":"n-gage","vnd.nokia.radio-preset":"rpst","vnd.nokia.radio-presets":"rpss","vnd.novadigm.edm":"edm","vnd.novadigm.edx":"edx","vnd.novadigm.ext":"ext","vnd.oasis.opendocument.chart-template":"otc","vnd.oasis.opendocument.formula-template":"odft","vnd.oasis.opendocument.image-template":"oti","vnd.olpc-sugar":"xo","vnd.oma.dd2+xml":"dd2","vnd.openofficeorg.extension":"oxt","vnd.openxmlformats-officedocument.presentationml.slide":"sldx","vnd.osgeo.mapguide.package":"mgp","vnd.osgi.dp":"dp","vnd.osgi.subsystem":"esa","vnd.palm":["pdb","pqa","oprc"],"vnd.pawaafile":"paw","vnd.pg.format":"str","vnd.pg.osasli":"ei6","vnd.picsel":"efif","vnd.pmi.widget":"wg","vnd.pocketlearn":"plf","vnd.powerbuilder6":"pbd","vnd.previewsystems.box":"box","vnd.proteus.magazine":"mgz","vnd.publishare-delta-tree":"qps","vnd.pvi.ptid1":"ptid","vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"vnd.realvnc.bed":"bed","vnd.recordare.musicxml":"mxl","vnd.recordare.musicxml+xml":"musicxml","vnd.rig.cryptonote":"cryptonote","vnd.rn-realmedia":"rm","vnd.rn-realmedia-vbr":"rmvb","vnd.route66.link66+xml":"link66","vnd.sailingtracker.track":"st","vnd.seemail":"see","vnd.sema":"sema","vnd.semd":"semd","vnd.semf":"semf","vnd.shana.informed.formdata":"ifm","vnd.shana.informed.formtemplate":"itp","vnd.shana.informed.interchange":"iif","vnd.shana.informed.package":"ipk","vnd.simtech-mindmapper":["twd","twds"],"vnd.smart.teacher":"teacher","vnd.solent.sdkm+xml":["sdkm","sdkd"],"vnd.spotfire.dxp":"dxp","vnd.spotfire.sfs":"sfs","vnd.stepmania.package":"smzip","vnd.stepmania.stepchart":"sm","vnd.sus-calendar":["sus","susp"],"vnd.svd":"svd","vnd.syncml+xml":"xsm","vnd.syncml.dm+wbxml":"bdm","vnd.syncml.dm+xml":"xdm","vnd.tao.intent-module-archive":"tao","vnd.tcpdump.pcap":["pcap","cap","dmp"],"vnd.tmobile-livetv":"tmo","vnd.trid.tpt":"tpt","vnd.triscape.mxs":"mxs","vnd.trueapp":"tra","vnd.ufdl":["ufd","ufdl"],"vnd.uiq.theme":"utz","vnd.umajin":"umj","vnd.unity":"unityweb","vnd.uoml+xml":"uoml","vnd.vcx":"vcx","vnd.visionary":"vis","vnd.vsf":"vsf","vnd.webturbo":"wtb","vnd.wolfram.player":"nbp","vnd.wqd":"wqd","vnd.wt.stf":"stf","vnd.xara":"xar","vnd.xfdl":"xfdl","vnd.yamaha.hv-dic":"hvd","vnd.yamaha.hv-script":"hvs","vnd.yamaha.hv-voice":"hvp","vnd.yamaha.openscoreformat":"osf","vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","vnd.yamaha.smaf-audio":"saf","vnd.yamaha.smaf-phrase":"spf","vnd.yellowriver-custom-menu":"cmp","vnd.zul":["zir","zirz"],"vnd.zzazz.deck+xml":"zaz","voicexml+xml":"vxml",widget:"wgt",winhlp:"hlp","wsdl+xml":"wsdl","wspolicy+xml":"wspolicy","x-ace-compressed":"ace","x-authorware-bin":["aab","x32","u32","vox"],"x-authorware-map":"aam","x-authorware-seg":"aas","x-blorb":["blb","blorb"],"x-bzip":"bz","x-bzip2":["bz2","boz"],"x-cfs-compressed":"cfs","x-chat":"chat","x-conference":"nsc","x-dgc-compressed":"dgc","x-dtbncx+xml":"ncx","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-eva":"eva","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-freearc":"arc","x-gca-compressed":"gca","x-glulx":"ulx","x-gramps-xml":"gramps","x-install-instructions":"install","x-lzh-compressed":["lzh","lha"],"x-mie":"mie","x-mobipocket-ebook":["prc","mobi"],"x-ms-application":"application","x-ms-shortcut":"lnk","x-ms-xbap":"xbap","x-msbinder":"obd","x-mscardfile":"crd","x-msclip":"clp","application/x-ms-installer":"msi","x-msmediaview":["mvb","m13","m14"],"x-msmetafile":["wmf","wmz","emf","emz"],"x-msmoney":"mny","x-mspublisher":"pub","x-msschedule":"scd","x-msterminal":"trm","x-mswrite":"wri","x-nzb":"nzb","x-pkcs12":["p12","pfx"],"x-pkcs7-certificates":["p7b","spc"],"x-research-info-systems":"ris","x-silverlight-app":"xap","x-sql":"sql","x-stuffitx":"sitx","x-subrip":"srt","x-t3vm-image":"t3","x-tex-tfm":"tfm","x-tgif":"obj","x-xliff+xml":"xlf","x-xz":"xz","x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"xaml+xml":"xaml","xcap-diff+xml":"xdf","xenc+xml":"xenc","xml-dtd":"dtd","xop+xml":"xop","xproc+xml":"xpl","xslt+xml":"xslt","xv+xml":["mxml","xhvml","xvml","xvm"],yang:"yang","yin+xml":"yin",envoy:"evy",fractals:"fif","internet-property-stream":"acx",olescript:"axs","vnd.ms-outlook":"msg","vnd.ms-pkicertstore":"sst","x-compress":"z","x-perfmon":["pma","pmc","pmr","pmw"],"ynd.ms-pkipko":"pko",gzip:["gz","tgz"],"smil+xml":["smi","smil"],"vnd.debian.binary-package":["deb","udeb"],"vnd.hzn-3d-crossword":"x3d","vnd.sqlite3":["db","sqlite","sqlite3","db-wal","sqlite-wal","db-shm","sqlite-shm"],"vnd.wap.sic":"sic","vnd.wap.slc":"slc","x-krita":["kra","krz"],"x-perl":["pm","pl"],yaml:["yaml","yml"]},audio:{amr:"amr","amr-wb":"awb",annodex:"axa",basic:["au","snd"],flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"prs.sid":"sid","x-aiff":"aifc","x-gsm":"gsm","x-ms-wma":"wma","x-ms-wax":"wax","x-pn-realaudio":"ram","x-realaudio":"ra","x-sd2":"sd2",adpcm:"adp",mp4:"mp4a",s3m:"s3m",silk:"sil","vnd.dece.audio":["uva","uvva"],"vnd.digital-winds":"eol","vnd.dra":"dra","vnd.dts":"dts","vnd.dts.hd":"dtshd","vnd.lucent.voice":"lvp","vnd.ms-playready.media.pya":"pya","vnd.nuera.ecelp4800":"ecelp4800","vnd.nuera.ecelp7470":"ecelp7470","vnd.nuera.ecelp9600":"ecelp9600","vnd.rip":"rip",webm:"weba","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",aac:"aac",aiff:["aiff","aif","aff"],opus:"opus",wav:"wav"},chemical:{"x-alchemy":"alc","x-cache":["cac","cache"],"x-cache-csf":"csf","x-cactvs-binary":["cbin","cascii","ctab"],"x-cdx":"cdx","x-chem3d":"c3d","x-cif":"cif","x-cmdf":"cmdf","x-cml":"cml","x-compass":"cpa","x-crossfire":"bsd","x-csml":["csml","csm"],"x-ctx":"ctx","x-cxf":["cxf","cef"],"x-embl-dl-nucleotide":["emb","embl"],"x-gamess-input":["inp","gam","gamin"],"x-gaussian-checkpoint":["fch","fchk"],"x-gaussian-cube":"cub","x-gaussian-input":["gau","gjc","gjf"],"x-gaussian-log":"gal","x-gcg8-sequence":"gcg","x-genbank":"gen","x-hin":"hin","x-isostar":["istr","ist"],"x-jcamp-dx":["jdx","dx"],"x-kinemage":"kin","x-macmolecule":"mcm","x-macromodel-input":"mmod","x-mdl-molfile":"mol","x-mdl-rdfile":"rd","x-mdl-rxnfile":"rxn","x-mdl-sdfile":"sd","x-mdl-tgf":"tgf","x-mmcif":"mcif","x-mol2":"mol2","x-molconn-Z":"b","x-mopac-graph":"gpt","x-mopac-input":["mop","mopcrt","zmt"],"x-mopac-out":"moo","x-ncbi-asn1":"asn","x-ncbi-asn1-ascii":["prt","ent"],"x-ncbi-asn1-binary":"val","x-rosdal":"ros","x-swissprot":"sw","x-vamas-iso14976":"vms","x-vmd":"vmd","x-xtel":"xtel","x-xyz":"xyz"},font:{otf:"otf",woff:"woff",woff2:"woff2"},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe","jfif","jfif-tbnl","jif"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"vnd.djvu":["djvu","djv"],"vnd.wap.wbmp":"wbmp","x-canon-cr2":"cr2","x-canon-crw":"crw","x-cmu-raster":"ras","x-coreldraw":"cdr","x-coreldrawpattern":"pat","x-coreldrawtemplate":"cdt","x-corelphotopaint":"cpt","x-epson-erf":"erf","x-icon":"ico","x-jg":"art","x-jng":"jng","x-nikon-nef":"nef","x-olympus-orf":"orf","x-portable-anymap":"pnm","x-portable-bitmap":"pbm","x-portable-graymap":"pgm","x-portable-pixmap":"ppm","x-rgb":"rgb","x-xbitmap":"xbm","x-xpixmap":"xpm","x-xwindowdump":"xwd",bmp:"bmp",cgm:"cgm",g3fax:"g3",ktx:"ktx","prs.btif":"btif",sgi:"sgi","vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"vnd.dwg":"dwg","vnd.dxf":"dxf","vnd.fastbidsheet":"fbs","vnd.fpx":"fpx","vnd.fst":"fst","vnd.fujixerox.edmics-mmr":"mmr","vnd.fujixerox.edmics-rlc":"rlc","vnd.ms-modi":"mdi","vnd.ms-photo":"wdp","vnd.net-fpx":"npx","vnd.xiff":"xif",webp:"webp","x-3ds":"3ds","x-cmx":"cmx","x-freehand":["fh","fhc","fh4","fh5","fh7"],"x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod",avif:"avifs",heic:["heif","heic"],pjpeg:["pjpg"],"vnd.adobe.photoshop":"psd","x-adobe-dng":"dng","x-fuji-raf":"raf","x-icns":"icns","x-kodak-dcr":"dcr","x-kodak-k25":"k25","x-kodak-kdc":"kdc","x-minolta-mrw":"mrw","x-panasonic-raw":["raw","rw2","rwl"],"x-pentax-pef":["pef","ptx"],"x-sigma-x3f":"x3f","x-sony-arw":"arw","x-sony-sr2":"sr2","x-sony-srf":"srf"},message:{rfc822:["eml","mime","mht","mhtml","nws"]},model:{iges:["igs","iges"],mesh:["msh","mesh","silo"],vrml:["wrl","vrml"],"x3d+vrml":["x3dv","x3dvz"],"x3d+xml":"x3dz","x3d+binary":["x3db","x3dbz"],"vnd.collada+xml":"dae","vnd.dwf":"dwf","vnd.gdl":"gdl","vnd.gtw":"gtw","vnd.mts":"mts","vnd.usdz+zip":"usdz","vnd.vtu":"vtu"},text:{"cache-manifest":["manifest","appcache"],calendar:["ics","icz","ifb"],css:"css",csv:"csv",h323:"323",html:["html","htm","shtml","stm"],iuls:"uls",plain:["txt","text","brf","conf","def","list","log","in","bas","diff","ksh"],richtext:"rtx",scriptlet:["sct","wsc"],texmacs:"tm","tab-separated-values":"tsv","vnd.sun.j2me.app-descriptor":"jad","vnd.wap.wml":"wml","vnd.wap.wmlscript":"wmls","x-bibtex":"bib","x-boo":"boo","x-c++hdr":["h++","hpp","hxx","hh"],"x-c++src":["c++","cpp","cxx","cc"],"x-component":"htc","x-dsrc":"d","x-diff":"patch","x-haskell":"hs","x-java":"java","x-literate-haskell":"lhs","x-moc":"moc","x-pascal":["p","pas","pp","inc"],"x-pcs-gcd":"gcd","x-python":"py","x-scala":"scala","x-setext":"etx","x-tcl":["tcl","tk"],"x-tex":["tex","ltx","sty","cls"],"x-vcalendar":"vcs","x-vcard":"vcf",n3:"n3","prs.lines.tag":"dsc",sgml:["sgml","sgm"],troff:["t","tr","roff","man","me","ms"],turtle:"ttl","uri-list":["uri","uris","urls"],vcard:"vcard","vnd.curl":"curl","vnd.curl.dcurl":"dcurl","vnd.curl.scurl":"scurl","vnd.curl.mcurl":"mcurl","vnd.dvb.subtitle":"sub","vnd.fly":"fly","vnd.fmi.flexstor":"flx","vnd.graphviz":"gv","vnd.in3d.3dml":"3dml","vnd.in3d.spot":"spot","x-asm":["s","asm"],"x-c":["c","h","dic"],"x-fortran":["f","for","f77","f90"],"x-opml":"opml","x-nfo":"nfo","x-sfv":"sfv","x-uuencode":"uu",webviewhtml:"htt",javascript:"js",json:"json",markdown:["md","markdown","mdown","markdn"],"vnd.wap.si":"si","vnd.wap.sl":"sl"},video:{avif:"avif","3gpp":"3gp",annodex:"axv",dl:"dl",dv:["dif","dv"],fli:"fli",gl:"gl",mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.dece.hd":["uvh","uvvh"],"vnd.dece.mobile":["uvm","uvvm"],"vnd.dece.pd":["uvp","uvvp"],"vnd.dece.sd":["uvs","uvvs"],"vnd.dece.video":["uvv","uvvv"],"vnd.dvb.file":"dvb","vnd.fvt":"fvt","vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv",mp2t:"ts"},"x-conference":{"x-cooltalk":"ice"},"x-world":{"x-vrml":["vrm","flr","wrz","xaf","xof"]}};(()=>{const t={};for(const e of Object.keys(c_))for(const n of Object.keys(c_[e])){const s=c_[e][n];if(typeof s=="string")t[s]=e+"/"+n;else for(let i=0;i>>1^3988292384:e=e>>>1;x5[t]=e}class gp{constructor(e){this.crc=e||-1}append(e){let n=this.crc|0;for(let s=0,i=e.length|0;s>>8^x5[(n^e[s])&255];this.crc=n}get(){return~this.crc}}class E5 extends TransformStream{constructor(){let e;const n=new gp;super({transform(s,i){n.append(s),i.enqueue(s)},flush(){const s=new Uint8Array(4);new DataView(s.buffer).setUint32(0,n.get()),e.value=s}}),e=this}}function sge(t){if(typeof TextEncoder==xo){t=unescape(encodeURIComponent(t));const e=new Uint8Array(t.length);for(let n=0;n0&&e&&(t[n-1]=Qn.partial(e,t[n-1]&2147483648>>e-1,1)),t},partial(t,e,n){return t===32?e:(n?e|0:e<<32-t)+t*1099511627776},getPartial(t){return Math.round(t/1099511627776)||32},_shiftRight(t,e,n,s){for(s===void 0&&(s=[]);e>=32;e-=32)s.push(n),n=0;if(e===0)return s.concat(t);for(let o=0;o>>e),n=t[o]<<32-e;const i=t.length?t[t.length-1]:0,r=Qn.getPartial(i);return s.push(Qn.partial(e+r&31,e+r>32?n:s.pop(),1)),s}},_p={bytes:{fromBits(t){const n=Qn.bitLength(t)/8,s=new Uint8Array(n);let i;for(let r=0;r>>24,i<<=8;return s},toBits(t){const e=[];let n,s=0;for(n=0;n9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const r=new Uint32Array(n);let o=0;for(let a=e.blockSize+s-(e.blockSize+s&e.blockSize-1);a<=i;a+=e.blockSize)e._block(r.subarray(16*o,16*(o+1))),o+=1;return n.splice(0,16*o),e}finalize(){const t=this;let e=t._buffer;const n=t._h;e=Qn.concat(e,[Qn.partial(1,1)]);for(let s=e.length+2;s&15;s++)e.push(0);for(e.push(Math.floor(t._length/4294967296)),e.push(t._length|0);e.length;)t._block(e.splice(0,16));return t.reset(),n}_f(t,e,n,s){if(t<=19)return e&n|~e&s;if(t<=39)return e^n^s;if(t<=59)return e&n|e&s|n&s;if(t<=79)return e^n^s}_S(t,e){return e<>>32-t}_block(t){const e=this,n=e._h,s=Array(80);for(let c=0;c<16;c++)s[c]=t[c];let i=n[0],r=n[1],o=n[2],a=n[3],l=n[4];for(let c=0;c<=79;c++){c>=16&&(s[c]=e._S(1,s[c-3]^s[c-8]^s[c-14]^s[c-16]));const u=e._S(5,i)+e._f(c,r,o,a)+l+s[c]+e._key[Math.floor(c/20)]|0;l=a,a=o,o=e._S(30,r),r=i,i=u}n[0]=n[0]+i|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+l|0}};const T5={};T5.aes=class{constructor(t){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const n=e._tables[0][4],s=e._tables[1],i=t.length;let r,o,a,l=1;if(i!==4&&i!==6&&i!==8)throw new Error("invalid aes key size");for(e._key=[o=t.slice(0),a=[]],r=i;r<4*i+28;r++){let c=o[r-1];(r%i===0||i===8&&r%i===4)&&(c=n[c>>>24]<<24^n[c>>16&255]<<16^n[c>>8&255]<<8^n[c&255],r%i===0&&(c=c<<8^c>>>24^l<<24,l=l<<1^(l>>7)*283)),o[r]=o[r-i]^c}for(let c=0;r;c++,r--){const u=o[c&3?r:r-4];r<=4||c<4?a[c]=u:a[c]=s[0][n[u>>>24]]^s[1][n[u>>16&255]]^s[2][n[u>>8&255]]^s[3][n[u&255]]}}encrypt(t){return this._crypt(t,0)}decrypt(t){return this._crypt(t,1)}_precompute(){const t=this._tables[0],e=this._tables[1],n=t[4],s=e[4],i=[],r=[];let o,a,l,c;for(let u=0;u<256;u++)r[(i[u]=u<<1^(u>>7)*283)^u]=u;for(let u=o=0;!n[u];u^=a||1,o=r[o]||1){let d=o^o<<1^o<<2^o<<3^o<<4;d=d>>8^d&255^99,n[u]=d,s[d]=u,c=i[l=i[a=i[u]]];let f=c*16843009^l*65537^a*257^u*16843008,h=i[d]*257^d*16843008;for(let v=0;v<4;v++)t[v][u]=h=h<<24^h>>>8,e[v][d]=f=f<<24^f>>>8}for(let u=0;u<5;u++)t[u]=t[u].slice(0),e[u]=e[u].slice(0)}_crypt(t,e){if(t.length!==4)throw new Error("invalid aes block size");const n=this._key[e],s=n.length/4-2,i=[0,0,0,0],r=this._tables[e],o=r[0],a=r[1],l=r[2],c=r[3],u=r[4];let d=t[0]^n[0],f=t[e?3:1]^n[1],h=t[2]^n[2],v=t[e?1:3]^n[3],_=4,m,g,y;for(let b=0;b>>24]^a[f>>16&255]^l[h>>8&255]^c[v&255]^n[_],g=o[f>>>24]^a[h>>16&255]^l[v>>8&255]^c[d&255]^n[_+1],y=o[h>>>24]^a[v>>16&255]^l[d>>8&255]^c[f&255]^n[_+2],v=o[v>>>24]^a[d>>16&255]^l[f>>8&255]^c[h&255]^n[_+3],_+=4,d=m,f=g,h=y;for(let b=0;b<4;b++)i[e?3&-b:b]=u[d>>>24]<<24^u[f>>16&255]<<16^u[h>>8&255]<<8^u[v&255]^n[_++],m=d,d=f,f=h,h=v,v=m;return i}};const ige={getRandomValues(t){const e=new Uint32Array(t.buffer),n=s=>{let i=987654321;const r=4294967295;return function(){return i=36969*(i&65535)+(i>>16)&r,s=18e3*(s&65535)+(s>>16)&r,(((i<<16)+s&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let s=0,i;s>24&255)===255){let e=t>>16&255,n=t>>8&255,s=t&255;e===255?(e=0,n===255?(n=0,s===255?s=0:++s):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=s}else t+=1<<24;return t}incCounter(t){(t[0]=this.incWord(t[0]))===0&&(t[1]=this.incWord(t[1]))}calculate(t,e,n){let s;if(!(s=e.length))return[];const i=Qn.bitLength(e);for(let r=0;r>5)+1<<2;let r,o,a,l,c;const u=new ArrayBuffer(i),d=new DataView(u);let f=0;const h=Qn;for(e=_p.bytes.toBits(e),c=1;f<(i||1);c++){for(r=o=t.encrypt(h.concat(e,[c])),a=1;ai&&(t=new n().update(t).finalize());for(let r=0;rthis.resolveReady=o),password:L5(e,n),signed:s,strength:i-1,pending:new Uint8Array})},async transform(o,a){const l=this,{password:c,strength:u,resolveReady:d,ready:f}=l;c?(await _ge(l,u,c,Ds(o,0,pd[u]+2)),o=Ds(o,pd[u]+2),r?a.error(new Error(Ay)):d()):await f;const h=new Uint8Array(o.length-Yr-(o.length-Yr)%Al);a.enqueue(I5(l,o,h,0,Yr,!0))},async flush(o){const{signed:a,ctr:l,hmac:c,pending:u,ready:d}=this;if(c&&l){await d;const f=Ds(u,0,u.length-Yr),h=Ds(u,u.length-Yr);let v=new Uint8Array;if(f.length){const _=gd(Oi,f);c.update(_);const m=l.update(_);v=md(Oi,m)}if(a){const _=Ds(md(Oi,c.digest()),0,Yr);for(let m=0;mthis.resolveReady=r),password:L5(e,n),strength:s-1,pending:new Uint8Array})},async transform(r,o){const a=this,{password:l,strength:c,resolveReady:u,ready:d}=a;let f=new Uint8Array;l?(f=await vge(a,c,l),u()):await d;const h=new Uint8Array(f.length+r.length-r.length%Al);h.set(f,0),o.enqueue(I5(a,r,h,f.length,0))},async flush(r){const{ctr:o,hmac:a,pending:l,ready:c}=this;if(a&&o){await c;let u=new Uint8Array;if(l.length){const d=o.update(gd(Oi,l));a.update(d),u=md(Oi,d)}i.signature=md(Oi,a.digest()).slice(0,Yr),r.enqueue(My(u,i.signature))}}}),i=this}}function I5(t,e,n,s,i,r){const{ctr:o,hmac:a,pending:l}=t,c=e.length-i;l.length&&(e=My(l,e),n=wge(n,c-c%Al));let u;for(u=0;u<=c-Al;u+=Al){const d=gd(Oi,Ds(e,u,u+Al));r&&a.update(d);const f=o.update(d);r||a.update(f),n.set(md(Oi,f),u+s)}return t.pending=Ds(e,u),n}async function _ge(t,e,n,s){const i=await O5(t,e,n,Ds(s,0,pd[e])),r=Ds(s,pd[e]);if(i[0]!=r[0]||i[1]!=r[1])throw new Error(M5)}async function vge(t,e,n){const s=C5(new Uint8Array(pd[e])),i=await O5(t,e,n,s);return My(s,i)}async function O5(t,e,n,s){t.password=null;const i=await yge(oge,n,cge,!1,uge),r=await bge(Object.assign({salt:s},r1),i,8*(lu[e]*2+2)),o=new Uint8Array(r),a=gd(Oi,Ds(o,0,lu[e])),l=gd(Oi,Ds(o,lu[e],lu[e]*2)),c=Ds(o,lu[e]*2);return Object.assign(t,{keys:{key:a,authentication:l,passwordVerification:c},ctr:new hge(new fge(a),Array.from(dge)),hmac:new pge(l)}),c}async function yge(t,e,n,s,i){if(RS)try{return await Dd.importKey(t,e,n,s,i)}catch{return RS=!1,Ma.importKey(e)}else return Ma.importKey(e)}async function bge(t,e,n){if(CS)try{return await Dd.deriveBits(t,e,n)}catch{return CS=!1,Ma.pbkdf2(e,t.salt,r1.iterations,n)}else return Ma.pbkdf2(e,t.salt,r1.iterations,n)}function L5(t,e){return e===ss?sge(t):e}function My(t,e){let n=t;return t.length+e.length&&(n=new Uint8Array(t.length+e.length),n.set(t,0),n.set(e,t.length)),n}function wge(t,e){if(e&&e>t.length){const n=t;t=new Uint8Array(e),t.set(n,0)}return t}function Ds(t,e,n){return t.subarray(e,n)}function md(t,e){return t.fromBits(e)}function gd(t,e){return t.toBits(e)}const zl=12;class xge extends TransformStream{constructor({password:e,passwordVerification:n,checkPasswordOnly:s}){super({start(){Object.assign(this,{password:e,passwordVerification:n}),D5(this,e)},transform(i,r){const o=this;if(o.password){const a=kS(o,i.subarray(0,zl));if(o.password=null,a[zl-1]!=o.passwordVerification)throw new Error(M5);i=i.subarray(zl)}s?r.error(new Error(Ay)):r.enqueue(kS(o,i))}})}}class Ege extends TransformStream{constructor({password:e,passwordVerification:n}){super({start(){Object.assign(this,{password:e,passwordVerification:n}),D5(this,e)},transform(s,i){const r=this;let o,a;if(r.password){r.password=null;const l=C5(new Uint8Array(zl));l[zl-1]=r.passwordVerification,o=new Uint8Array(s.length+l.length),o.set(PS(r,l),0),a=zl}else o=new Uint8Array(s.length),a=0;o.set(PS(r,s),a),i.enqueue(o)}})}}function kS(t,e){const n=new Uint8Array(e.length);for(let s=0;s>>24]),i=~t.crcKey2.get(),t.keys=[n,s,i]}function N5(t){const e=t.keys[2]|2;return U5(Math.imul(e,e^1)>>>8)}function U5(t){return t&255}function IS(t){return t&4294967295}const OS="deflate-raw";class Sge extends TransformStream{constructor(e,{chunkSize:n,CompressionStream:s,CompressionStreamNative:i}){super({});const{compressed:r,encrypted:o,useCompressionStream:a,zipCrypto:l,signed:c,level:u}=e,d=this;let f,h,v=F5(super.readable);(!o||l)&&c&&(f=new E5,v=Li(v,f)),r&&(v=B5(v,a,{level:u,chunkSize:n},i,s)),o&&(l?v=Li(v,new Ege(e)):(h=new gge(e),v=Li(v,h))),$5(d,v,()=>{let _;o&&!l&&(_=h.signature),(!o||l)&&c&&(_=new DataView(f.value.buffer).getUint32(0)),d.signature=_})}}class Tge extends TransformStream{constructor(e,{chunkSize:n,DecompressionStream:s,DecompressionStreamNative:i}){super({});const{zipCrypto:r,encrypted:o,signed:a,signature:l,compressed:c,useCompressionStream:u}=e;let d,f,h=F5(super.readable);o&&(r?h=Li(h,new xge(e)):(f=new mge(e),h=Li(h,f))),c&&(h=B5(h,u,{chunkSize:n},i,s)),(!o||r)&&a&&(d=new E5,h=Li(h,d)),$5(this,h,()=>{if((!o||r)&&a){const v=new DataView(d.value.buffer);if(l!=v.getUint32(0,!1))throw new Error(R5)}})}}function F5(t){return Li(t,new TransformStream({transform(e,n){e&&e.length&&n.enqueue(e)}}))}function $5(t,e,n){e=Li(e,new TransformStream({flush:n})),Object.defineProperty(t,"readable",{get(){return e}})}function B5(t,e,n,s,i){try{const r=e&&s?s:i;t=Li(t,new r(OS,n))}catch{if(e)try{t=Li(t,new i(OS,n))}catch{return t}else return t}return t}function Li(t,e){return t.pipeThrough(e)}const Age="message",Mge="start",Rge="pull",LS="data",Cge="ack",DS="close",kge="deflate",H5="inflate";class Pge extends TransformStream{constructor(e,n){super({});const s=this,{codecType:i}=e;let r;i.startsWith(kge)?r=Sge:i.startsWith(H5)&&(r=Tge);let o=0,a=0;const l=new r(e,n),c=super.readable,u=new TransformStream({transform(f,h){f&&f.length&&(a+=f.length,h.enqueue(f))},flush(){Object.assign(s,{inputSize:a})}}),d=new TransformStream({transform(f,h){f&&f.length&&(o+=f.length,h.enqueue(f))},flush(){const{signature:f}=l;Object.assign(s,{signature:f,outputSize:o,inputSize:a})}});Object.defineProperty(s,"readable",{get(){return c.pipeThrough(u).pipeThrough(l).pipeThrough(d)}})}}class Ige extends TransformStream{constructor(e){let n;super({transform:s,flush(i){n&&n.length&&i.enqueue(n)}});function s(i,r){if(n){const o=new Uint8Array(n.length+i.length);o.set(n),o.set(i,n.length),i=o,n=null}i.length>e?(r.enqueue(i.slice(0,e)),s(i.slice(e),r)):n=i}}}let G5=typeof Worker!=xo;class u_{constructor(e,{readable:n,writable:s},{options:i,config:r,streamOptions:o,useWebWorkers:a,transferStreams:l,scripts:c},u){const{signal:d}=o;return Object.assign(e,{busy:!0,readable:n.pipeThrough(new Ige(r.chunkSize)).pipeThrough(new Oge(n,o),{signal:d}),writable:s,options:Object.assign({},i),scripts:c,transferStreams:l,terminate(){return new Promise(f=>{const{worker:h,busy:v}=e;h?(v?e.resolveTerminated=f:(h.terminate(),f()),e.interface=null):f()})},onTaskFinished(){const{resolveTerminated:f}=e;f&&(e.resolveTerminated=null,e.terminated=!0,e.worker.terminate(),f()),e.busy=!1,u(e)}}),(a&&G5?Lge:z5)(e,r)}}class Oge extends TransformStream{constructor(e,{onstart:n,onprogress:s,size:i,onend:r}){let o=0;super({async start(){n&&await d_(n,i)},async transform(a,l){o+=a.length,s&&await d_(s,o,i),l.enqueue(a)},async flush(){e.size=o,r&&await d_(r,o)}})}}async function d_(t,...e){try{await t(...e)}catch{}}function z5(t,e){return{run:()=>Dge(t,e)}}function Lge(t,e){const{baseURL:n,chunkSize:s}=e;if(!t.interface){let i;try{i=Fge(t.scripts[0],n,t)}catch{return G5=!1,z5(t,e)}Object.assign(t,{worker:i,interface:{run:()=>Nge(t,{chunkSize:s})}})}return t.interface}async function Dge({options:t,readable:e,writable:n,onTaskFinished:s},i){try{const r=new Pge(t,i);await e.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});const{signature:o,inputSize:a,outputSize:l}=r;return{signature:o,inputSize:a,outputSize:l}}finally{s()}}async function Nge(t,e){let n,s;const i=new Promise((f,h)=>{n=f,s=h});Object.assign(t,{reader:null,writer:null,resolveResult:n,rejectResult:s,result:i});const{readable:r,options:o,scripts:a}=t,{writable:l,closed:c}=Uge(t.writable),u=Ch({type:Mge,scripts:a.slice(1),options:o,config:e,readable:r,writable:l},t);u||Object.assign(t,{reader:r.getReader(),writer:l.getWriter()});const d=await i;return u||await l.getWriter().close(),await c,d}function Uge(t){let e;const n=new Promise(i=>e=i);return{writable:new WritableStream({async write(i){const r=t.getWriter();await r.ready,await r.write(i),r.releaseLock()},close(){e()},abort(i){return t.getWriter().abort(i)}}),closed:n}}let NS=!0,US=!0;function Fge(t,e,n){const s={type:"module"};let i,r;typeof t==Ld&&(t=t());try{i=new URL(t,e)}catch{i=t}if(NS)try{r=new Worker(i)}catch{NS=!1,r=new Worker(i,s)}else r=new Worker(i,s);return r.addEventListener(Age,o=>$ge(o,n)),r}function Ch(t,{worker:e,writer:n,onTaskFinished:s,transferStreams:i}){try{const{value:r,readable:o,writable:a}=t,l=[];if(r&&(r.byteLength!g.busy);if(m)return $S(m),new u_(m,t,e,_);if(sa.lengthf_.push({resolve:g,stream:t,workerOptions:e}))}function _(m){if(f_.length){const[{resolve:g,stream:y,workerOptions:b}]=f_.splice(0,1);g(new u_(m,y,b,_))}else m.worker?($S(m),Hge(m,e)):sa=sa.filter(g=>g!=m)}}function Hge(t,e){const{config:n}=e,{terminateWorkerTimeout:s}=n;Number.isFinite(s)&&s>=0&&(t.terminated?t.terminated=!1:t.terminateTimeout=setTimeout(async()=>{sa=sa.filter(i=>i!=t);try{await t.terminate()}catch{}},s))}function $S(t){const{terminateTimeout:e}=t;e&&(clearTimeout(e),t.terminateTimeout=null)}function Gge(t,e={}){const n=`const{Array:e,Object:t,Number:n,Math:r,Error:s,Uint8Array:i,Uint16Array:o,Uint32Array:c,Int32Array:f,Map:a,DataView:l,Promise:u,TextEncoder:w,crypto:h,postMessage:d,TransformStream:p,ReadableStream:y,WritableStream:m,CompressionStream:b,DecompressionStream:g}=self,k=void 0,v="undefined",S="function";class z{constructor(e){return class extends p{constructor(t,n){const r=new e(n);super({transform(e,t){t.enqueue(r.append(e))},flush(e){const t=r.flush();t&&e.enqueue(t)}})}}}}const C=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;C[e]=t}class x{constructor(e){this.t=e||-1}append(e){let t=0|this.t;for(let n=0,r=0|e.length;r>n;n++)t=t>>>8^C[255&(t^e[n])];this.t=t}get(){return~this.t}}class A extends p{constructor(){let e;const t=new x;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new i(4);new l(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}const _={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],r=_.i(n);return 32===r?e.concat(t):_.o(t,r,0|n,e.slice(0,e.length-1))},l(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+_.i(n)},u(e,t){if(32*e.length0&&t&&(e[n-1]=_.h(t,e[n-1]&2147483648>>t-1,1)),e},h:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,i:e=>r.round(e/1099511627776)||32,o(e,t,n,r){for(void 0===r&&(r=[]);t>=32;t-=32)r.push(n),n=0;if(0===t)return r.concat(e);for(let s=0;s>>t),n=e[s]<<32-t;const s=e.length?e[e.length-1]:0,i=_.i(s);return r.push(_.h(t+i&31,t+i>32?n:r.pop(),1)),r}},I={bytes:{p(e){const t=_.l(e)/8,n=new i(t);let r;for(let s=0;t>s;s++)3&s||(r=e[s/4]),n[s]=r>>>24,r<<=8;return n},m(e){const t=[];let n,r=0;for(n=0;n9007199254740991)throw new s("Cannot hash more than 2^53 - 1 bits");const o=new c(n);let f=0;for(let e=t.blockSize+r-(t.blockSize+r&t.blockSize-1);i>=e;e+=t.blockSize)t.I(o.subarray(16*f,16*(f+1))),f+=1;return n.splice(0,16*f),t}P(){const e=this;let t=e.C;const n=e.S;t=_.concat(t,[_.h(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(r.floor(e.A/4294967296)),t.push(0|e.A);t.length;)e.I(t.splice(0,16));return e.reset(),n}D(e,t,n,r){return e>19?e>39?e>59?e>79?void 0:t^n^r:t&n|t&r|n&r:t^n^r:t&n|~t&r}V(e,t){return t<>>32-e}I(t){const n=this,s=n.S,i=e(80);for(let e=0;16>e;e++)i[e]=t[e];let o=s[0],c=s[1],f=s[2],a=s[3],l=s[4];for(let e=0;79>=e;e++){16>e||(i[e]=n.V(1,i[e-3]^i[e-8]^i[e-14]^i[e-16]));const t=n.V(5,o)+n.D(e,c,f,a)+l+i[e]+n.v[r.floor(e/20)]|0;l=a,a=f,f=n.V(30,c),c=o,o=t}s[0]=s[0]+o|0,s[1]=s[1]+c|0,s[2]=s[2]+f|0,s[3]=s[3]+a|0,s[4]=s[4]+l|0}},D={getRandomValues(e){const t=new c(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(r.random()>.5?1:-1))};for(let s,i=0;inew V.R(I.bytes.m(e)),B(e,t,n,r){if(n=n||1e4,0>r||0>n)throw new s("invalid params to pbkdf2");const i=1+(r>>5)<<2;let o,c,f,a,u;const w=new ArrayBuffer(i),h=new l(w);let d=0;const p=_;for(t=I.bytes.m(t),u=1;(i||1)>d;u++){for(o=c=e.encrypt(p.concat(t,[u])),f=1;n>f;f++)for(c=e.encrypt(c),a=0;ad&&fs&&(e=(new n).update(e).P());for(let t=0;s>t;t++)r[0][t]=909522486^e[t],r[1][t]=1549556828^e[t];t.U[0].update(r[0]),t.U[1].update(r[1]),t.K=new n(t.U[0])}reset(){const e=this;e.K=new e.M(e.U[0]),e.N=!1}update(e){this.N=!0,this.K.update(e)}digest(){const e=this,t=e.K.P(),n=new e.M(e.U[1]).update(t).P();return e.reset(),n}encrypt(e){if(this.N)throw new s("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},R=typeof h!=v&&typeof h.getRandomValues==S,B="Invalid password",E="Invalid signature",M="zipjs-abort-check-password";function U(e){return R?h.getRandomValues(e):D.getRandomValues(e)}const K=16,N={name:"PBKDF2"},O=t.assign({hash:{name:"HMAC"}},N),T=t.assign({iterations:1e3,hash:{name:"SHA-1"}},N),W=["deriveBits"],j=[8,12,16],H=[16,24,32],L=10,F=[0,0,0,0],q=typeof h!=v,G=q&&h.subtle,J=q&&typeof G!=v,Q=I.bytes,X=class{constructor(e){const t=this;t.O=[[[],[],[],[],[]],[[],[],[],[],[]]],t.O[0][0][0]||t.T();const n=t.O[0][4],r=t.O[1],i=e.length;let o,c,f,a=1;if(4!==i&&6!==i&&8!==i)throw new s("invalid aes key size");for(t.v=[c=e.slice(0),f=[]],o=i;4*i+28>o;o++){let e=c[o-1];(o%i==0||8===i&&o%i==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],o%i==0&&(e=e<<8^e>>>24^a<<24,a=a<<1^283*(a>>7))),c[o]=c[o-i]^e}for(let e=0;o;e++,o--){const t=c[3&e?o:o-4];f[e]=4>=o||4>e?t:r[0][n[t>>>24]]^r[1][n[t>>16&255]]^r[2][n[t>>8&255]]^r[3][n[255&t]]}}encrypt(e){return this.W(e,0)}decrypt(e){return this.W(e,1)}T(){const e=this.O[0],t=this.O[1],n=e[4],r=t[4],s=[],i=[];let o,c,f,a;for(let e=0;256>e;e++)i[(s[e]=e<<1^283*(e>>7))^e]=e;for(let l=o=0;!n[l];l^=c||1,o=i[o]||1){let i=o^o<<1^o<<2^o<<3^o<<4;i=i>>8^255&i^99,n[l]=i,r[i]=l,a=s[f=s[c=s[l]]];let u=16843009*a^65537*f^257*c^16843008*l,w=257*s[i]^16843008*i;for(let n=0;4>n;n++)e[n][l]=w=w<<24^w>>>8,t[n][i]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}W(e,t){if(4!==e.length)throw new s("invalid aes block size");const n=this.v[t],r=n.length/4-2,i=[0,0,0,0],o=this.O[t],c=o[0],f=o[1],a=o[2],l=o[3],u=o[4];let w,h,d,p=e[0]^n[0],y=e[t?3:1]^n[1],m=e[2]^n[2],b=e[t?1:3]^n[3],g=4;for(let e=0;r>e;e++)w=c[p>>>24]^f[y>>16&255]^a[m>>8&255]^l[255&b]^n[g],h=c[y>>>24]^f[m>>16&255]^a[b>>8&255]^l[255&p]^n[g+1],d=c[m>>>24]^f[b>>16&255]^a[p>>8&255]^l[255&y]^n[g+2],b=c[b>>>24]^f[p>>16&255]^a[y>>8&255]^l[255&m]^n[g+3],g+=4,p=w,y=h,m=d;for(let e=0;4>e;e++)i[t?3&-e:e]=u[p>>>24]<<24^u[y>>16&255]<<16^u[m>>8&255]<<8^u[255&b]^n[g++],w=p,p=y,y=m,m=b,b=w;return i}},Y=class{constructor(e,t){this.j=e,this.H=t,this.L=t}reset(){this.L=this.H}update(e){return this.F(this.j,e,this.L)}q(e){if(255&~(e>>24))e+=1<<24;else{let t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}return e}G(e){0===(e[0]=this.q(e[0]))&&(e[1]=this.q(e[1]))}F(e,t,n){let r;if(!(r=t.length))return[];const s=_.l(t);for(let s=0;r>s;s+=4){this.G(n);const r=e.encrypt(n);t[s]^=r[0],t[s+1]^=r[1],t[s+2]^=r[2],t[s+3]^=r[3]}return _.u(t,s)}},Z=V.R;let $=q&&J&&typeof G.importKey==S,ee=q&&J&&typeof G.deriveBits==S;class te extends p{constructor({password:e,rawPassword:n,signed:r,encryptionStrength:o,checkPasswordOnly:c}){super({start(){t.assign(this,{ready:new u((e=>this.J=e)),password:ie(e,n),signed:r,X:o-1,pending:new i})},async transform(e,t){const n=this,{password:r,X:o,J:f,ready:a}=n;r?(await(async(e,t,n,r)=>{const i=await se(e,t,n,ce(r,0,j[t])),o=ce(r,j[t]);if(i[0]!=o[0]||i[1]!=o[1])throw new s(B)})(n,o,r,ce(e,0,j[o]+2)),e=ce(e,j[o]+2),c?t.error(new s(M)):f()):await a;const l=new i(e.length-L-(e.length-L)%K);t.enqueue(re(n,e,l,0,L,!0))},async flush(e){const{signed:t,Y:n,Z:r,pending:o,ready:c}=this;if(r&&n){await c;const f=ce(o,0,o.length-L),a=ce(o,o.length-L);let l=new i;if(f.length){const e=ae(Q,f);r.update(e);const t=n.update(e);l=fe(Q,t)}if(t){const e=ce(fe(Q,r.digest()),0,L);for(let t=0;L>t;t++)if(e[t]!=a[t])throw new s(E)}e.enqueue(l)}}})}}class ne extends p{constructor({password:e,rawPassword:n,encryptionStrength:r}){let s;super({start(){t.assign(this,{ready:new u((e=>this.J=e)),password:ie(e,n),X:r-1,pending:new i})},async transform(e,t){const n=this,{password:r,X:s,J:o,ready:c}=n;let f=new i;r?(f=await(async(e,t,n)=>{const r=U(new i(j[t]));return oe(r,await se(e,t,n,r))})(n,s,r),o()):await c;const a=new i(f.length+e.length-e.length%K);a.set(f,0),t.enqueue(re(n,e,a,f.length,0))},async flush(e){const{Y:t,Z:n,pending:r,ready:o}=this;if(n&&t){await o;let c=new i;if(r.length){const e=t.update(ae(Q,r));n.update(e),c=fe(Q,e)}s.signature=fe(Q,n.digest()).slice(0,L),e.enqueue(oe(c,s.signature))}}}),s=this}}function re(e,t,n,r,s,o){const{Y:c,Z:f,pending:a}=e,l=t.length-s;let u;for(a.length&&(t=oe(a,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new i(t)).set(n,0)}return e})(n,l-l%K)),u=0;l-K>=u;u+=K){const e=ae(Q,ce(t,u,u+K));o&&f.update(e);const s=c.update(e);o||f.update(s),n.set(fe(Q,s),u+r)}return e.pending=ce(t,u),n}async function se(n,r,s,o){n.password=null;const c=await(async(e,t,n,r,s)=>{if(!$)return V.importKey(t);try{return await G.importKey("raw",t,n,!1,s)}catch(e){return $=!1,V.importKey(t)}})(0,s,O,0,W),f=await(async(e,t,n)=>{if(!ee)return V.B(t,e.salt,T.iterations,n);try{return await G.deriveBits(e,t,n)}catch(r){return ee=!1,V.B(t,e.salt,T.iterations,n)}})(t.assign({salt:o},T),c,8*(2*H[r]+2)),a=new i(f),l=ae(Q,ce(a,0,H[r])),u=ae(Q,ce(a,H[r],2*H[r])),w=ce(a,2*H[r]);return t.assign(n,{keys:{key:l,$:u,passwordVerification:w},Y:new Y(new X(l),e.from(F)),Z:new Z(u)}),w}function ie(e,t){return t===k?(e=>{if(typeof w==v){const t=new i((e=unescape(encodeURIComponent(e))).length);for(let n=0;n>>24]),i=~e.te.get(),e.keys=[n,s,i]}function ye(e){const t=2|e.keys[2];return me(r.imul(t,1^t)>>>8)}function me(e){return 255&e}function be(e){return 4294967295&e}const ge="deflate-raw";class ke extends p{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:r}){super({});const{compressed:s,encrypted:i,useCompressionStream:o,zipCrypto:c,signed:f,level:a}=e,u=this;let w,h,d=Se(super.readable);i&&!c||!f||(w=new A,d=xe(d,w)),s&&(d=Ce(d,o,{level:a,chunkSize:t},r,n)),i&&(c?d=xe(d,new ue(e)):(h=new ne(e),d=xe(d,h))),ze(u,d,(()=>{let e;i&&!c&&(e=h.signature),i&&!c||!f||(e=new l(w.value.buffer).getUint32(0)),u.signature=e}))}}class ve extends p{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:r}){super({});const{zipCrypto:i,encrypted:o,signed:c,signature:f,compressed:a,useCompressionStream:u}=e;let w,h,d=Se(super.readable);o&&(i?d=xe(d,new le(e)):(h=new te(e),d=xe(d,h))),a&&(d=Ce(d,u,{chunkSize:t},r,n)),o&&!i||!c||(w=new A,d=xe(d,w)),ze(this,d,(()=>{if((!o||i)&&c){const e=new l(w.value.buffer);if(f!=e.getUint32(0,!1))throw new s(E)}}))}}function Se(e){return xe(e,new p({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function ze(e,n,r){n=xe(n,new p({flush:r})),t.defineProperty(e,"readable",{get:()=>n})}function Ce(e,t,n,r,s){try{e=xe(e,new(t&&r?r:s)(ge,n))}catch(r){if(!t)return e;try{e=xe(e,new s(ge,n))}catch(t){return e}}return e}function xe(e,t){return e.pipeThrough(t)}const Ae="data",_e="close";class Ie extends p{constructor(e,n){super({});const r=this,{codecType:s}=e;let i;s.startsWith("deflate")?i=ke:s.startsWith("inflate")&&(i=ve);let o=0,c=0;const f=new i(e,n),a=super.readable,l=new p({transform(e,t){e&&e.length&&(c+=e.length,t.enqueue(e))},flush(){t.assign(r,{inputSize:c})}}),u=new p({transform(e,t){e&&e.length&&(o+=e.length,t.enqueue(e))},flush(){const{signature:e}=f;t.assign(r,{signature:e,outputSize:o,inputSize:c})}});t.defineProperty(r,"readable",{get:()=>a.pipeThrough(l).pipeThrough(f).pipeThrough(u)})}}class Pe extends p{constructor(e){let t;super({transform:function n(r,s){if(t){const e=new i(t.length+r.length);e.set(t),e.set(r,t.length),r=e,t=null}r.length>e?(s.enqueue(r.slice(0,e)),n(r.slice(e),s)):t=r},flush(e){t&&t.length&&e.enqueue(t)}})}}const De=new a,Ve=new a;let Re,Be=0,Ee=!0;async function Me(e){try{const{options:t,scripts:r,config:s}=e;if(r&&r.length)try{Ee?importScripts.apply(k,r):await Ue(r)}catch(e){Ee=!1,await Ue(r)}self.initCodec&&self.initCodec(),s.CompressionStreamNative=self.CompressionStream,s.DecompressionStreamNative=self.DecompressionStream,self.Deflate&&(s.CompressionStream=new z(self.Deflate)),self.Inflate&&(s.DecompressionStream=new z(self.Inflate));const i={highWaterMark:1},o=e.readable||new y({async pull(e){const t=new u((e=>De.set(Be,e)));Ke({type:"pull",messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER;const{value:r,done:s}=await t;e.enqueue(r),s&&e.close()}},i),c=e.writable||new m({async write(e){let t;const r=new u((e=>t=e));Ve.set(Be,t),Ke({type:Ae,value:e,messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER,await r}},i),f=new Ie(t,s);Re=new AbortController;const{signal:a}=Re;await o.pipeThrough(f).pipeThrough(new Pe(s.chunkSize)).pipeTo(c,{signal:a,preventClose:!0,preventAbort:!0}),await c.getWriter().close();const{signature:l,inputSize:w,outputSize:h}=f;Ke({type:_e,result:{signature:l,inputSize:w,outputSize:h}})}catch(e){Ne(e)}}async function Ue(e){for(const t of e)await import(t)}function Ke(e){let{value:t}=e;if(t)if(t.length)try{t=new i(t),e.value=t.buffer,d(e,[e.value])}catch(t){d(e)}else d(e);else d(e)}function Ne(e=new s("Unknown error")){const{message:t,stack:n,code:r,name:i}=e;d({error:{message:t,stack:n,code:r,name:i}})}addEventListener("message",(({data:e})=>{const{type:t,messageId:n,value:r,done:s}=e;try{if("start"==t&&Me(e),t==Ae){const e=De.get(n);De.delete(n),e({value:new i(r),done:s})}if("ack"==t){const e=Ve.get(n);Ve.delete(n),e()}t==_e&&Re.abort()}catch(e){Ne(e)}}));const Oe=-2;function Te(t){return We(t.map((([t,n])=>new e(t).fill(n,0,t))))}function We(t){return t.reduce(((t,n)=>t.concat(e.isArray(n)?We(n):n)),[])}const je=[0,1,2,3].concat(...Te([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function He(){const e=this;function t(e,t){let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}e.ne=n=>{const s=e.re,i=e.ie.se,o=e.ie.oe;let c,f,a,l=-1;for(n.ce=0,n.fe=573,c=0;o>c;c++)0!==s[2*c]?(n.ae[++n.ce]=l=c,n.le[c]=0):s[2*c+1]=0;for(;2>n.ce;)a=n.ae[++n.ce]=2>l?++l:0,s[2*a]=1,n.le[a]=0,n.ue--,i&&(n.we-=i[2*a+1]);for(e.he=l,c=r.floor(n.ce/2);c>=1;c--)n.de(s,c);a=o;do{c=n.ae[1],n.ae[1]=n.ae[n.ce--],n.de(s,1),f=n.ae[1],n.ae[--n.fe]=c,n.ae[--n.fe]=f,s[2*a]=s[2*c]+s[2*f],n.le[a]=r.max(n.le[c],n.le[f])+1,s[2*c+1]=s[2*f+1]=a,n.ae[1]=a++,n.de(s,1)}while(n.ce>=2);n.ae[--n.fe]=n.ae[1],(t=>{const n=e.re,r=e.ie.se,s=e.ie.pe,i=e.ie.ye,o=e.ie.me;let c,f,a,l,u,w,h=0;for(l=0;15>=l;l++)t.be[l]=0;for(n[2*t.ae[t.fe]+1]=0,c=t.fe+1;573>c;c++)f=t.ae[c],l=n[2*n[2*f+1]+1]+1,l>o&&(l=o,h++),n[2*f+1]=l,f>e.he||(t.be[l]++,u=0,i>f||(u=s[f-i]),w=n[2*f],t.ue+=w*(l+u),r&&(t.we+=w*(r[2*f+1]+u)));if(0!==h){do{for(l=o-1;0===t.be[l];)l--;t.be[l]--,t.be[l+1]+=2,t.be[o]--,h-=2}while(h>0);for(l=o;0!==l;l--)for(f=t.be[l];0!==f;)a=t.ae[--c],a>e.he||(n[2*a+1]!=l&&(t.ue+=(l-n[2*a+1])*n[2*a],n[2*a+1]=l),f--)}})(n),((e,n,r)=>{const s=[];let i,o,c,f=0;for(i=1;15>=i;i++)s[i]=f=f+r[i-1]<<1;for(o=0;n>=o;o++)c=e[2*o+1],0!==c&&(e[2*o]=t(s[c]++,c))})(s,e.he,n.be)}}function Le(e,t,n,r,s){const i=this;i.se=e,i.pe=t,i.ye=n,i.oe=r,i.me=s}He.ge=[0,1,2,3,4,5,6,7].concat(...Te([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),He.ke=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],He.ve=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],He.Se=e=>256>e?je[e]:je[256+(e>>>7)],He.ze=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],He.Ce=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],He.xe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],He.Ae=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];const Fe=Te([[144,8],[112,9],[24,7],[8,8]]);Le._e=We([12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227].map(((e,t)=>[e,Fe[t]])));const qe=Te([[30,5]]);function Ge(e,t,n,r,s){const i=this;i.Ie=e,i.Pe=t,i.De=n,i.Ve=r,i.Re=s}Le.Be=We([0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23].map(((e,t)=>[e,qe[t]]))),Le.Ee=new Le(Le._e,He.ze,257,286,15),Le.Me=new Le(Le.Be,He.Ce,0,30,15),Le.Ue=new Le(null,He.xe,0,19,7);const Je=[new Ge(0,0,0,0,0),new Ge(4,4,8,4,1),new Ge(4,5,16,8,1),new Ge(4,6,32,32,1),new Ge(4,4,16,16,2),new Ge(8,16,32,32,2),new Ge(8,16,128,128,2),new Ge(8,32,128,256,2),new Ge(32,128,258,1024,2),new Ge(32,258,258,4096,2)],Qe=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],Xe=113,Ye=666,Ze=262;function $e(e,t,n,r){const s=e[2*t],i=e[2*n];return i>s||s==i&&r[t]<=r[n]}function et(){const e=this;let t,n,s,c,f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z,C,x,A,_,I,P,D,V,R,B,E,M,U;const K=new He,N=new He,O=new He;let T,W,j,H,L,F;function q(){let t;for(t=0;286>t;t++)E[2*t]=0;for(t=0;30>t;t++)M[2*t]=0;for(t=0;19>t;t++)U[2*t]=0;E[512]=1,e.ue=e.we=0,W=j=0}function G(e,t){let n,r=-1,s=e[1],i=0,o=7,c=4;0===s&&(o=138,c=3),e[2*(t+1)+1]=65535;for(let f=0;t>=f;f++)n=s,s=e[2*(f+1)+1],++ii?U[2*n]+=i:0!==n?(n!=r&&U[2*n]++,U[32]++):i>10?U[36]++:U[34]++,i=0,r=n,0===s?(o=138,c=3):n==s?(o=6,c=3):(o=7,c=4))}function J(t){e.Ke[e.pending++]=t}function Q(e){J(255&e),J(e>>>8&255)}function X(e,t){let n;const r=t;F>16-r?(n=e,L|=n<>>16-F,F+=r-16):(L|=e<=n;n++)if(r=i,i=e[2*(n+1)+1],++o>=c||r!=i){if(f>o)do{Y(r,U)}while(0!=--o);else 0!==r?(r!=s&&(Y(r,U),o--),Y(16,U),X(o-3,2)):o>10?(Y(18,U),X(o-11,7)):(Y(17,U),X(o-3,3));o=0,s=r,0===i?(c=138,f=3):r==i?(c=6,f=3):(c=7,f=4)}}function $(){16==F?(Q(L),L=0,F=0):8>F||(J(255&L),L>>>=8,F-=8)}function ee(t,n){let s,i,o;if(e.Ne[W]=t,e.Oe[W]=255&n,W++,0===t?E[2*n]++:(j++,t--,E[2*(He.ge[n]+256+1)]++,M[2*He.Se(t)]++),!(8191&W)&&D>2){for(s=8*W,i=C-k,o=0;30>o;o++)s+=M[2*o]*(5+He.Ce[o]);if(s>>>=3,jc);Y(256,t),H=t[513]}function ne(){F>8?Q(L):F>0&&J(255&L),L=0,F=0}function re(t,n,r){X(0+(r?1:0),3),((t,n)=>{ne(),H=8,Q(n),Q(~n),e.Ke.set(u.subarray(t,t+n),e.pending),e.pending+=n})(t,n)}function se(n){((t,n,r)=>{let s,i,o=0;D>0?(K.ne(e),N.ne(e),o=(()=>{let t;for(G(E,K.he),G(M,N.he),O.ne(e),t=18;t>=3&&0===U[2*He.Ae[t]+1];t--);return e.ue+=14+3*(t+1),t})(),s=e.ue+3+7>>>3,i=e.we+3+7>>>3,i>s||(s=i)):s=i=n+5,n+4>s||-1==t?i==s?(X(2+(r?1:0),3),te(Le._e,Le.Be)):(X(4+(r?1:0),3),((e,t,n)=>{let r;for(X(e-257,5),X(t-1,5),X(n-4,4),r=0;n>r;r++)X(U[2*He.Ae[r]+1],3);Z(E,e-1),Z(M,t-1)})(K.he+1,N.he+1,o+1),te(E,M)):re(t,n,r),q(),r&&ne()})(0>k?-1:k,C-k,n),k=C,t.Te()}function ie(){let e,n,r,s;do{if(s=w-A-C,0===s&&0===C&&0===A)s=f;else if(-1==s)s--;else if(C>=f+f-Ze){u.set(u.subarray(f,f+f),0),x-=f,C-=f,k-=f,e=y,r=e;do{n=65535&d[--r],d[r]=f>n?0:n-f}while(0!=--e);e=f,r=e;do{n=65535&h[--r],h[r]=f>n?0:n-f}while(0!=--e);s+=f}if(0===t.We)return;e=t.je(u,C+A,s),A+=e,3>A||(p=255&u[C],p=(p<A&&0!==t.We)}function oe(e){let t,n,r=I,s=C,i=_;const o=C>f-Ze?C-(f-Ze):0;let c=B;const a=l,w=C+258;let d=u[s+i-1],p=u[s+i];R>_||(r>>=2),c>A&&(c=A);do{if(t=e,u[t+i]==p&&u[t+i-1]==d&&u[t]==u[s]&&u[++t]==u[s+1]){s+=2,t++;do{}while(u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&w>s);if(n=258-(w-s),s=w-258,n>i){if(x=e,i=n,n>=c)break;d=u[s+i-1],p=u[s+i]}}}while((e=65535&h[e&a])>o&&0!=--r);return i>A?A:i}e.le=[],e.be=[],e.ae=[],E=[],M=[],U=[],e.de=(t,n)=>{const r=e.ae,s=r[n];let i=n<<1;for(;i<=e.ce&&(i(W||(W=8),j||(j=8),G||(G=0),t.Le=null,-1==S&&(S=6),1>j||j>9||8!=W||9>x||x>15||0>S||S>9||0>G||G>2?Oe:(t.Fe=e,a=x,f=1<(t.qe=t.Ge=0,t.Le=null,e.pending=0,e.Je=0,n=Xe,c=0,K.re=E,K.ie=Le.Ee,N.re=M,N.ie=Le.Me,O.re=U,O.ie=Le.Ue,L=0,F=0,H=8,q(),(()=>{w=2*f,d[y-1]=0;for(let e=0;y-1>e;e++)d[e]=0;P=Je[D].Pe,R=Je[D].Ie,B=Je[D].De,I=Je[D].Ve,C=0,k=0,A=0,v=_=2,z=0,p=0})(),0))(t))),e.Qe=()=>42!=n&&n!=Xe&&n!=Ye?Oe:(e.Oe=null,e.Ne=null,e.Ke=null,d=null,h=null,u=null,e.Fe=null,n==Xe?-3:0),e.Xe=(e,t,n)=>{let r=0;return-1==t&&(t=6),0>t||t>9||0>n||n>2?Oe:(Je[D].Re!=Je[t].Re&&0!==e.qe&&(r=e.Ye(1)),D!=t&&(D=t,P=Je[D].Pe,R=Je[D].Ie,B=Je[D].De,I=Je[D].Ve),V=n,r)},e.Ze=(e,t,r)=>{let s,i=r,o=0;if(!t||42!=n)return Oe;if(3>i)return 0;for(i>f-Ze&&(i=f-Ze,o=r-i),u.set(t.subarray(o,o+i),0),C=i,k=i,p=255&u[0],p=(p<=s;s++)p=(p<{let o,w,m,I,R;if(i>4||0>i)return Oe;if(!r.$e||!r.et&&0!==r.We||n==Ye&&4!=i)return r.Le=Qe[4],Oe;if(0===r.tt)return r.Le=Qe[7],-5;var B;if(t=r,I=c,c=i,42==n&&(w=8+(a-8<<4)<<8,m=(D-1&255)>>1,m>3&&(m=3),w|=m<<6,0!==C&&(w|=32),w+=31-w%31,n=Xe,J((B=w)>>8&255),J(255&B)),0!==e.pending){if(t.Te(),0===t.tt)return c=-1,0}else if(0===t.We&&I>=i&&4!=i)return t.Le=Qe[7],-5;if(n==Ye&&0!==t.We)return r.Le=Qe[7],-5;if(0!==t.We||0!==A||0!=i&&n!=Ye){switch(R=-1,Je[D].Re){case 0:R=(e=>{let n,r=65535;for(r>s-5&&(r=s-5);;){if(1>=A){if(ie(),0===A&&0==e)return 0;if(0===A)break}if(C+=A,A=0,n=k+r,(0===C||C>=n)&&(A=C-n,C=n,se(!1),0===t.tt))return 0;if(C-k>=f-Ze&&(se(!1),0===t.tt))return 0}return se(4==e),0===t.tt?4==e?2:0:4==e?3:1})(i);break;case 1:R=(e=>{let n,r=0;for(;;){if(Ze>A){if(ie(),Ze>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<f-Ze||2!=V&&(v=oe(r)),3>v)n=ee(0,255&u[C]),A--,C++;else if(n=ee(C-x,v-3),A-=v,v>P||3>A)C+=v,v=0,p=255&u[C],p=(p<{let n,r,s=0;for(;;){if(Ze>A){if(ie(),Ze>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<_&&f-Ze>=(C-s&65535)&&(2!=V&&(v=oe(s)),5>=v&&(1==V||3==v&&C-x>4096)&&(v=2)),3>_||v>_)if(0!==z){if(n=ee(0,255&u[C-1]),n&&se(!1),C++,A--,0===t.tt)return 0}else z=1,C++,A--;else{r=C+A-3,n=ee(C-1-S,_-3),A-=_-1,_-=2;do{++C>r||(p=(p<1+H+10-F&&(X(2,3),Y(256,Le._e),$()),H=7;else if(re(0,0,!1),3==i)for(o=0;y>o;o++)d[o]=0;if(t.Te(),0===t.tt)return c=-1,0}}return 4!=i?0:1}}function tt(){const e=this;e.nt=0,e.rt=0,e.We=0,e.qe=0,e.tt=0,e.Ge=0}function nt(e){const t=new tt,n=(o=e&&e.chunkSize?e.chunkSize:65536)+5*(r.floor(o/16383)+1);var o;const c=new i(n);let f=e?e.level:-1;void 0===f&&(f=-1),t.He(f),t.$e=c,this.append=(e,r)=>{let o,f,a=0,l=0,u=0;const w=[];if(e.length){t.nt=0,t.et=e,t.We=e.length;do{if(t.rt=0,t.tt=n,o=t.Ye(0),0!=o)throw new s("deflating: "+t.Le);t.rt&&(t.rt==n?w.push(new i(c)):w.push(c.subarray(0,t.rt))),u+=t.rt,r&&t.nt>0&&t.nt!=a&&(r(t.nt),a=t.nt)}while(t.We>0||0===t.tt);return w.length>1?(f=new i(u),w.forEach((e=>{f.set(e,l),l+=e.length}))):f=w[0]?new i(w[0]):new i,f}},this.flush=()=>{let e,r,o=0,f=0;const a=[];do{if(t.rt=0,t.tt=n,e=t.Ye(4),1!=e&&0!=e)throw new s("deflating: "+t.Le);n-t.tt>0&&a.push(c.slice(0,t.rt)),f+=t.rt}while(t.We>0||0===t.tt);return t.Qe(),r=new i(f),a.forEach((e=>{r.set(e,o),o+=e.length})),r}}tt.prototype={He(e,t){const n=this;return n.Fe=new et,t||(t=15),n.Fe.He(n,e,t)},Ye(e){const t=this;return t.Fe?t.Fe.Ye(t,e):Oe},Qe(){const e=this;if(!e.Fe)return Oe;const t=e.Fe.Qe();return e.Fe=null,t},Xe(e,t){const n=this;return n.Fe?n.Fe.Xe(n,e,t):Oe},Ze(e,t){const n=this;return n.Fe?n.Fe.Ze(n,e,t):Oe},je(e,t,n){const r=this;let s=r.We;return s>n&&(s=n),0===s?0:(r.We-=s,e.set(r.et.subarray(r.nt,r.nt+s),t),r.nt+=s,r.qe+=s,s)},Te(){const e=this;let t=e.Fe.pending;t>e.tt&&(t=e.tt),0!==t&&(e.$e.set(e.Fe.Ke.subarray(e.Fe.Je,e.Fe.Je+t),e.rt),e.rt+=t,e.Fe.Je+=t,e.Ge+=t,e.tt-=t,e.Fe.pending-=t,0===e.Fe.pending&&(e.Fe.Je=0))}};const rt=-2,st=-3,it=-5,ot=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],ct=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],ft=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],at=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],lt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],ut=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],wt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function ht(){let e,t,n,r,s,i;function o(e,t,o,c,f,a,l,u,w,h,d){let p,y,m,b,g,k,v,S,z,C,x,A,_,I,P;C=0,g=o;do{n[e[t+C]]++,C++,g--}while(0!==g);if(n[0]==o)return l[0]=-1,u[0]=0,0;for(S=u[0],k=1;15>=k&&0===n[k];k++);for(v=k,k>S&&(S=k),g=15;0!==g&&0===n[g];g--);for(m=g,S>g&&(S=g),u[0]=S,I=1<k;k++,I<<=1)if(0>(I-=n[k]))return st;if(0>(I-=n[g]))return st;for(n[g]+=I,i[1]=k=0,C=1,_=2;0!=--g;)i[_]=k+=n[C],_++,C++;g=0,C=0;do{0!==(k=e[t+C])&&(d[i[k]++]=g),C++}while(++g=v;v++)for(p=n[v];0!=p--;){for(;v>A+S;){if(b++,A+=S,P=m-A,P=P>S?S:P,(y=1<<(k=v-A))>p+1&&(y-=p+1,_=v,P>k))for(;++kn[++_];)y-=n[_];if(P=1<1440)return st;s[b]=x=h[0],h[0]+=P,0!==b?(i[b]=g,r[0]=k,r[1]=S,k=g>>>A-S,r[2]=x-s[b-1]-k,w.set(r,3*(s[b-1]+k))):l[0]=x}for(r[1]=v-A,o>C?d[C]d[C]?0:96,r[2]=d[C++]):(r[0]=a[d[C]-c]+16+64,r[2]=f[d[C++]-c]):r[0]=192,y=1<>>A;P>k;k+=y)w.set(r,3*(x+k));for(k=1<>>=1)g^=k;for(g^=k,z=(1<c;c++)t[c]=0;for(c=0;16>c;c++)n[c]=0;for(c=0;3>c;c++)r[c]=0;s.set(n.subarray(0,15),0),i.set(n.subarray(0,16),0)}this.st=(n,r,s,i,f)=>{let a;return c(19),e[0]=0,a=o(n,0,19,19,null,null,s,r,i,e,t),a==st?f.Le="oversubscribed dynamic bit lengths tree":a!=it&&0!==r[0]||(f.Le="incomplete dynamic bit lengths tree",a=st),a},this.it=(n,r,s,i,f,a,l,u,w)=>{let h;return c(288),e[0]=0,h=o(s,0,n,257,at,lt,a,i,u,e,t),0!=h||0===i[0]?(h==st?w.Le="oversubscribed literal/length tree":-4!=h&&(w.Le="incomplete literal/length tree",h=st),h):(c(288),h=o(s,n,r,0,ut,wt,l,f,u,e,t),0!=h||0===f[0]&&n>257?(h==st?w.Le="oversubscribed distance tree":h==it?(w.Le="incomplete distance tree",h=st):-4!=h&&(w.Le="empty distance tree with lengths",h=st),h):0)}}function dt(){const e=this;let t,n,r,s,i=0,o=0,c=0,f=0,a=0,l=0,u=0,w=0,h=0,d=0;function p(e,t,n,r,s,i,o,c){let f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z;d=c.nt,p=c.We,w=o.ot,h=o.ct,y=o.write,m=yh;)p--,w|=(255&c.ft(d++))<>=a[z+1],h-=a[z+1],16&u){for(u&=15,k=a[z+2]+(w&ot[u]),w>>=u,h-=u;15>h;)p--,w|=(255&c.ft(d++))<>=a[z+1],h-=a[z+1],16&u){for(u&=15;u>h;)p--,w|=(255&c.ft(d++))<>=u,h-=u,m-=k,v>y){S=y-v;do{S+=o.end}while(0>S);if(u=o.end-S,k>u){if(k-=u,y-S>0&&u>y-S)do{o.lt[y++]=o.lt[S++]}while(0!=--u);else o.lt.set(o.lt.subarray(S,S+u),y),y+=u,S+=u,u=0;S=0}}else S=y-v,y-S>0&&2>y-S?(o.lt[y++]=o.lt[S++],o.lt[y++]=o.lt[S++],k-=2):(o.lt.set(o.lt.subarray(S,S+2),y),y+=2,S+=2,k-=2);if(y-S>0&&k>y-S)do{o.lt[y++]=o.lt[S++]}while(0!=--k);else o.lt.set(o.lt.subarray(S,S+k),y),y+=k,S+=k,k=0;break}if(64&u)return c.Le="invalid distance code",k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,st;f+=a[z+2],f+=w&ot[u],z=3*(l+f),u=a[z]}break}if(64&u)return 32&u?(k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,1):(c.Le="invalid literal/length code",k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,st);if(f+=a[z+2],f+=w&ot[u],z=3*(l+f),0===(u=a[z])){w>>=a[z+1],h-=a[z+1],o.lt[y++]=a[z+2],m--;break}}else w>>=a[z+1],h-=a[z+1],o.lt[y++]=a[z+2],m--}while(m>=258&&p>=10);return k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,0}e.init=(e,i,o,c,f,a)=>{t=0,u=e,w=i,r=o,h=c,s=f,d=a,n=null},e.ut=(e,y,m)=>{let b,g,k,v,S,z,C,x=0,A=0,_=0;for(_=y.nt,v=y.We,x=e.ot,A=e.ct,S=e.write,z=S=258&&v>=10&&(e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,m=p(u,w,r,h,s,d,e,y),_=y.nt,v=y.We,x=e.ot,A=e.ct,S=e.write,z=SA;){if(0===v)return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(_++))<>>=n[g+1],A-=n[g+1],k=n[g],0===k){f=n[g+2],t=6;break}if(16&k){a=15&k,i=n[g+2],t=2;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}if(32&k){t=7;break}return t=9,y.Le="invalid literal/length code",m=st,e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);case 2:for(b=a;b>A;){if(0===v)return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(_++))<>=b,A-=b,c=w,n=s,o=d,t=3;case 3:for(b=c;b>A;){if(0===v)return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(_++))<>=n[g+1],A-=n[g+1],k=n[g],16&k){a=15&k,l=n[g+2],t=4;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}return t=9,y.Le="invalid distance code",m=st,e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);case 4:for(b=a;b>A;){if(0===v)return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(_++))<>=b,A-=b,t=5;case 5:for(C=S-l;0>C;)C+=e.end;for(;0!==i;){if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S7&&(A-=8,v++,_--),e.write=S,m=e.wt(y,m),S=e.write,z=S{}}ht.dt=(e,t,n,r)=>(e[0]=9,t[0]=5,n[0]=ct,r[0]=ft,0);const pt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function yt(e,t){const n=this;let r,s=0,o=0,c=0,a=0;const l=[0],u=[0],w=new dt;let h=0,d=new f(4320);const p=new ht;n.ct=0,n.ot=0,n.lt=new i(t),n.end=t,n.read=0,n.write=0,n.reset=(e,t)=>{t&&(t[0]=0),6==s&&w.ht(e),s=0,n.ct=0,n.ot=0,n.read=n.write=0},n.reset(e,null),n.wt=(e,t)=>{let r,s,i;return s=e.rt,i=n.read,r=(i>n.write?n.end:n.write)-i,r>e.tt&&(r=e.tt),0!==r&&t==it&&(t=0),e.tt-=r,e.Ge+=r,e.$e.set(n.lt.subarray(i,i+r),s),s+=r,i+=r,i==n.end&&(i=0,n.write==n.end&&(n.write=0),r=n.write-i,r>e.tt&&(r=e.tt),0!==r&&t==it&&(t=0),e.tt-=r,e.Ge+=r,e.$e.set(n.lt.subarray(i,i+r),s),s+=r,i+=r),e.rt=s,n.read=i,t},n.ut=(e,t)=>{let i,f,y,m,b,g,k,v;for(m=e.nt,b=e.We,f=n.ot,y=n.ct,g=n.write,k=gy;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<>>1){case 0:f>>>=3,y-=3,i=7&y,f>>>=i,y-=i,s=1;break;case 1:S=[],z=[],C=[[]],x=[[]],ht.dt(S,z,C,x),w.init(S[0],z[0],C[0],0,x[0],0),f>>>=3,y-=3,s=6;break;case 2:f>>>=3,y-=3,s=3;break;case 3:return f>>>=3,y-=3,s=9,e.Le="invalid block type",t=st,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t)}break;case 1:for(;32>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<>>16&65535)!=(65535&f))return s=9,e.Le="invalid stored block lengths",t=st,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);o=65535&f,f=y=0,s=0!==o?2:0!==h?7:0;break;case 2:if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);if(0===k&&(g==n.end&&0!==n.read&&(g=0,k=gb&&(i=b),i>k&&(i=k),n.lt.set(e.je(m,i),g),m+=i,b-=i,g+=i,k-=i,0!=(o-=i))break;s=0!==h?7:0;break;case 3:for(;14>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<29||(i>>5&31)>29)return s=9,e.Le="too many length or distance symbols",t=st,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);if(i=258+(31&i)+(i>>5&31),!r||r.lengthv;v++)r[v]=0;f>>>=14,y-=14,a=0,s=4;case 4:for(;4+(c>>>10)>a;){for(;3>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<>>=3,y-=3}for(;19>a;)r[pt[a++]]=0;if(l[0]=7,i=p.st(r,l,u,d,e),0!=i)return(t=i)==st&&(r=null,s=9),n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);a=0,s=5;case 5:for(;i=c,258+(31&i)+(i>>5&31)>a;){let o,w;for(i=l[0];i>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<w)f>>>=i,y-=i,r[a++]=w;else{for(v=18==w?7:w-14,o=18==w?11:3;i+v>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<>>=i,y-=i,o+=f&ot[v],f>>>=v,y-=v,v=a,i=c,v+o>258+(31&i)+(i>>5&31)||16==w&&1>v)return r=null,s=9,e.Le="invalid bit length repeat",t=st,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);w=16==w?r[v-1]:0;do{r[v++]=w}while(0!=--o);a=v}}if(u[0]=-1,A=[],_=[],I=[],P=[],A[0]=9,_[0]=6,i=c,i=p.it(257+(31&i),1+(i>>5&31),r,A,_,I,P,d,e),0!=i)return i==st&&(r=null,s=9),t=i,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);w.init(A[0],_[0],d,I[0],d,P[0]),s=6;case 6:if(n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,1!=(t=w.ut(n,e,t)))return n.wt(e,t);if(t=0,w.ht(e),m=e.nt,b=e.We,f=n.ot,y=n.ct,g=n.write,k=g{n.reset(e,null),n.lt=null,d=null},n.yt=(e,t,r)=>{n.lt.set(e.subarray(t,t+r),0),n.read=n.write=r},n.bt=()=>1==s?1:0}const mt=13,bt=[0,0,255,255];function gt(){const e=this;function t(e){return e&&e.gt?(e.qe=e.Ge=0,e.Le=null,e.gt.mode=7,e.gt.kt.reset(e,null),0):rt}e.mode=0,e.method=0,e.vt=[0],e.St=0,e.marker=0,e.zt=0,e.Ct=t=>(e.kt&&e.kt.ht(t),e.kt=null,0),e.xt=(n,r)=>(n.Le=null,e.kt=null,8>r||r>15?(e.Ct(n),rt):(e.zt=r,n.gt.kt=new yt(n,1<{let n,r;if(!e||!e.gt||!e.et)return rt;const s=e.gt;for(t=4==t?it:0,n=it;;)switch(s.mode){case 0:if(0===e.We)return n;if(n=t,e.We--,e.qe++,8!=(15&(s.method=e.ft(e.nt++)))){s.mode=mt,e.Le="unknown compression method",s.marker=5;break}if(8+(s.method>>4)>s.zt){s.mode=mt,e.Le="invalid win size",s.marker=5;break}s.mode=1;case 1:if(0===e.We)return n;if(n=t,e.We--,e.qe++,r=255&e.ft(e.nt++),((s.method<<8)+r)%31!=0){s.mode=mt,e.Le="incorrect header check",s.marker=5;break}if(!(32&r)){s.mode=7;break}s.mode=2;case 2:if(0===e.We)return n;n=t,e.We--,e.qe++,s.St=(255&e.ft(e.nt++))<<24&4278190080,s.mode=3;case 3:if(0===e.We)return n;n=t,e.We--,e.qe++,s.St+=(255&e.ft(e.nt++))<<16&16711680,s.mode=4;case 4:if(0===e.We)return n;n=t,e.We--,e.qe++,s.St+=(255&e.ft(e.nt++))<<8&65280,s.mode=5;case 5:return 0===e.We?n:(n=t,e.We--,e.qe++,s.St+=255&e.ft(e.nt++),s.mode=6,2);case 6:return s.mode=mt,e.Le="need dictionary",s.marker=0,rt;case 7:if(n=s.kt.ut(e,n),n==st){s.mode=mt,s.marker=0;break}if(0==n&&(n=t),1!=n)return n;n=t,s.kt.reset(e,s.vt),s.mode=12;case 12:return e.We=0,1;case mt:return st;default:return rt}},e._t=(e,t,n)=>{let r=0,s=n;if(!e||!e.gt||6!=e.gt.mode)return rt;const i=e.gt;return s<1<{let n,r,s,i,o;if(!e||!e.gt)return rt;const c=e.gt;if(c.mode!=mt&&(c.mode=mt,c.marker=0),0===(n=e.We))return it;for(r=e.nt,s=c.marker;0!==n&&4>s;)e.ft(r)==bt[s]?s++:s=0!==e.ft(r)?0:4-s,r++,n--;return e.qe+=r-e.nt,e.nt=r,e.We=n,c.marker=s,4!=s?st:(i=e.qe,o=e.Ge,t(e),e.qe=i,e.Ge=o,c.mode=7,0)},e.Pt=e=>e&&e.gt&&e.gt.kt?e.gt.kt.bt():rt}function kt(){}function vt(e){const t=new kt,n=e&&e.chunkSize?r.floor(2*e.chunkSize):131072,o=new i(n);let c=!1;t.xt(),t.$e=o,this.append=(e,r)=>{const f=[];let a,l,u=0,w=0,h=0;if(0!==e.length){t.nt=0,t.et=e,t.We=e.length;do{if(t.rt=0,t.tt=n,0!==t.We||c||(t.nt=0,c=!0),a=t.At(0),c&&a===it){if(0!==t.We)throw new s("inflating: bad input")}else if(0!==a&&1!==a)throw new s("inflating: "+t.Le);if((c||1===a)&&t.We===e.length)throw new s("inflating: bad input");t.rt&&(t.rt===n?f.push(new i(o)):f.push(o.subarray(0,t.rt))),h+=t.rt,r&&t.nt>0&&t.nt!=u&&(r(t.nt),u=t.nt)}while(t.We>0||0===t.tt);return f.length>1?(l=new i(h),f.forEach((e=>{l.set(e,w),w+=e.length}))):l=f[0]?new i(f[0]):new i,l}},this.flush=()=>{t.Ct()}}kt.prototype={xt(e){const t=this;return t.gt=new gt,e||(e=15),t.gt.xt(t,e)},At(e){const t=this;return t.gt?t.gt.At(t,e):rt},Ct(){const e=this;if(!e.gt)return rt;const t=e.gt.Ct(e);return e.gt=null,t},It(){const e=this;return e.gt?e.gt.It(e):rt},_t(e,t){const n=this;return n.gt?n.gt._t(n,e,t):rt},ft(e){return this.et[e]},je(e,t){return this.et.subarray(e,e+t)}},self.initCodec=()=>{self.Deflate=nt,self.Inflate=vt}; +`,s=()=>e.useDataURI?"data:text/javascript,"+encodeURIComponent(n):URL.createObjectURL(new Blob([n],{type:"text/javascript"}));t({workerScripts:{inflate:[s],deflate:[s]}})}const zge="Writer iterator completed too soon",Vge="Content-Type",Wge=64*1024,V5="writable";class Cy{constructor(){this.size=0}init(){this.initialized=!0}}class ky extends Cy{get readable(){const e=this,{chunkSize:n=Wge}=e,s=new ReadableStream({start(){this.chunkOffset=0},async pull(i){const{offset:r=0,size:o,diskNumberStart:a}=s,{chunkOffset:l}=this;i.enqueue(await Dn(e,r+l,Math.min(n,o-l),a)),l+n>o?i.close():this.chunkOffset+=n}});return s}}class jge extends ky{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,n){const s=this,i=e+n;let o=await(e||in&&(o=o.slice(e,i)),new Uint8Array(o)}}class qge extends Cy{constructor(e){super();const n=this,s=new TransformStream,i=[];e&&i.push([Vge,e]),Object.defineProperty(n,V5,{get(){return s.writable}}),n.blob=new Response(s.readable,{headers:i}).blob()}getData(){return this.blob}}class Xge extends qge{constructor(e){super(e),Object.assign(this,{encoding:e,utf8:!e||e.toLowerCase()=="utf-8"})}async getData(){const{encoding:e,utf8:n}=this,s=await super.getData();if(s.text&&n)return s.text();{const i=new FileReader;return new Promise((r,o)=>{Object.assign(i,{onload:({target:a})=>r(a.result),onerror:()=>o(i.error)}),i.readAsText(s,e)})}}}class Kge extends ky{constructor(e){super(),Object.assign(this,{array:e,size:e.length})}readUint8Array(e,n){return this.array.slice(e,e+n)}}class Yge extends ky{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:n}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await Promise.all(n.map(async(s,i)=>{await s.init(),i!=n.length-1&&(e.lastDiskOffset+=s.size),e.size+=s.size})),super.init()}async readUint8Array(e,n,s=0){const i=this,{readers:r}=this;let o,a=s;a==-1&&(a=r.length-1);let l=e;for(;l>=r[a].size;)l-=r[a].size,a++;const c=r[a],u=c.size;if(l+n<=u)o=await Dn(c,l,n);else{const d=u-l;o=new Uint8Array(n),o.set(await Dn(c,l,d)),o.set(await i.readUint8Array(e+d,n-d,s),d)}return i.lastDiskNumber=Math.max(a,i.lastDiskNumber),o}}class BS extends Cy{constructor(e,n=4294967295){super();const s=this;Object.assign(s,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let i,r,o;const a=new WritableStream({async write(u){const{availableSize:d}=s;if(o)u.length>=d?(await l(u.slice(0,d)),await c(),s.diskOffset+=i.size,s.diskNumber++,o=null,await this.write(u.slice(d))):await l(u);else{const{value:f,done:h}=await e.next();if(h&&!f)throw new Error(zge);i=f,i.size=0,i.maxSize&&(s.maxSize=i.maxSize),s.availableSize=s.maxSize,await vp(i),r=f.writable,o=r.getWriter(),await this.write(u)}},async close(){await o.ready,await c()}});Object.defineProperty(s,V5,{get(){return a}});async function l(u){const d=u.length;d&&(await o.ready,await o.write(u),i.size+=d,s.size+=d,s.availableSize-=d)}async function c(){r.size=i.size,await o.close()}}}async function vp(t,e){if(t.init&&!t.initialized)await t.init(e);else return Promise.resolve()}function Zge(t){return Array.isArray(t)&&(t=new Yge(t)),t instanceof ReadableStream&&(t={readable:t}),t}function Jge(t){t.writable===ss&&typeof t.next==Ld&&(t=new BS(t)),t instanceof WritableStream&&(t={writable:t});const{writable:e}=t;return e.size===ss&&(e.size=0),t instanceof BS||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),t}function Dn(t,e,n,s){return t.readUint8Array(e,n,s)}const W5="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),Qge=W5.length==256;function e_e(t){if(Qge){let e="";for(let n=0;nthis[n]=e[n])}}const h_="File format is not recognized",f_e="End of central directory not found",h_e="End of Zip64 central directory locator not found",p_e="Central directory header not found",m_e="Local file header not found",g_e="Zip64 extra field not found",__e="File contains encrypted entry",v_e="Encryption method not supported",GS="Compression method not supported",zS="Split zip file",VS="utf-8",WS="cp437",y_e=[[Y5,va],[Z5,va],[J5,va],[o1,to]],b_e={[to]:{getValue:an,bytes:4},[va]:{getValue:Ph,bytes:8}};class w_e{constructor(e,n={}){Object.assign(this,{reader:Zge(e),options:n,config:tge()})}async*getEntriesGenerator(e={}){const n=this;let{reader:s}=n;const{config:i}=n;if(await vp(s),(s.size===ss||!s.readUint8Array)&&(s=new jge(await new Response(s.readable).blob()),await vp(s)),s.size=s.size&&(m=s.size-l-a-dl,l=s.size-a-dl),h!=f)throw new Error(zS);if(l<0)throw new Error(h_);let y=0,b=await Dn(s,l,a,v),w=bn(b);if(a){const E=r.offset-a;if(an(w,y)!=wS&&l!=E){const k=l;l=E,m+=l-k,b=await Dn(s,l,a,v),w=bn(b)}}const T=r.offset-l-(s.lastDiskOffset||0);if(a!=T&&T>=0&&(a=T,b=await Dn(s,l,a,v),w=bn(b)),l<0||l>=s.size)throw new Error(h_);const S=Xn(n,e,"filenameEncoding"),A=Xn(n,e,"commentEncoding");for(let E=0;E<_;E++){const k=new x_e(s,i,n.options);if(an(w,y)!=wS)throw new Error(p_e);tC(k,w,y+6);const U=!!k.bitFlag.languageEncodingFlag,H=y+46,D=H+k.filenameLength,I=D+k.extraFieldLength,P=yn(w,y+4),B=(P&0)==0,L=b.subarray(H,D),Y=yn(w,y+32),q=I+Y,de=b.subarray(I,q),fe=U,Re=U,oe=B&&(Vl(w,y+38)&AS)==AS,me=an(w,y+42)+m;Object.assign(k,{versionMadeBy:P,msDosCompatible:B,compressedSize:0,uncompressedSize:0,commentLength:Y,directory:oe,offset:me,diskNumberStart:yn(w,y+34),internalFileAttribute:yn(w,y+36),externalFileAttribute:an(w,y+38),rawFilename:L,filenameUTF8:fe,commentUTF8:Re,rawExtraField:b.subarray(D,I)});const ke=Xn(n,e,"decodeText")||kh,J=fe?VS:S||WS,Ae=Re?VS:A||WS;let Ee=ke(L,J);Ee===ss&&(Ee=kh(L,J));let Ce=ke(de,Ae);Ce===ss&&(Ce=kh(de,Ae)),Object.assign(k,{rawComment:de,filename:Ee,comment:Ce,directory:oe||Ee.endsWith(Jme)}),g=Math.max(me,g),nC(k,k,w,y+6),k.zipCrypto=k.encrypted&&!k.extraFieldAES;const Ge=new HS(k);Ge.getData=(z,K)=>k.getData(z,Ge,K),y=q;const{onprogress:M}=e;if(M)try{await M(E+1,_,new HS(k))}catch{}yield Ge}const R=Xn(n,e,"extractPrependedData"),x=Xn(n,e,"extractAppendedData");return R&&(n.prependedData=g>0?await Dn(s,0,g):new Uint8Array),n.comment=u?await Dn(s,c+dl,u):new Uint8Array,x&&(n.appendedData=d>>8&255:f>>>24&255),signature:f,compressed:c!=0&&!T,encrypted:i.encrypted&&!T,useWebWorkers:Xn(i,s,"useWebWorkers"),useCompressionStream:Xn(i,s,"useCompressionStream"),transferStreams:Xn(i,s,"transferStreams"),checkPasswordOnly:U},config:u,streamOptions:{signal:k,size:x,onstart:D,onprogress:I,onend:P}};let L=0;try{({outputSize:L}=await Bge({readable:E,writable:H},B))}catch(Y){if(!U||Y.message!=Ay)throw Y}finally{const Y=Xn(i,s,"preventClose");H.size+=L,!Y&&!H.locked&&await H.getWriter().close()}return U?ss:e.getData?e.getData():H}}function tC(t,e,n){const s=t.rawBitFlag=yn(e,n+2),i=(s&ES)==ES,r=an(e,n+6);Object.assign(t,{encrypted:i,version:yn(e,n),bitFlag:{level:(s&Zme)>>1,dataDescriptor:(s&SS)==SS,languageEncodingFlag:(s&TS)==TS},rawLastModDate:r,lastModDate:R_e(r),filenameLength:yn(e,n+22),extraFieldLength:yn(e,n+24)})}function nC(t,e,n,s,i){const{rawExtraField:r}=e,o=e.extraField=new Map,a=bn(new Uint8Array(r));let l=0;try{for(;le[i]==r);for(let i=0,r=0;i=5&&(r.push(a1),o.push(l1));let a=1;r.forEach((l,c)=>{if(t.data.length>=a+4){const u=an(s,a);e[l]=t[l]=new Date(u*1e3);const d=o[c];t[d]=u}a+=4})}async function M_e(t,e,n,s,i){const r=new Uint8Array(4),o=bn(r);C_e(o,0,e);const a=s+i;return await l(s)||await l(Math.min(a,n));async function l(c){const u=n-c,d=await Dn(t,u,c);for(let f=d.length-s;f>=0;f--)if(d[f]==r[0]&&d[f+1]==r[1]&&d[f+2]==r[2]&&d[f+3]==r[3])return{offset:u+f,buffer:d.slice(f,f+s).buffer}}}function Xn(t,e,n){return e[n]===ss?t.options[n]:e[n]}function R_e(t){const e=(t&4294901760)>>16,n=t&65535;try{return new Date(1980+((e&65024)>>9),((e&480)>>5)-1,e&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function p_(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function Vl(t,e){return t.getUint8(e)}function yn(t,e){return t.getUint16(e,!0)}function an(t,e){return t.getUint32(e,!0)}function Ph(t,e){return Number(t.getBigUint64(e,!0))}function C_e(t,e,n){t.setUint32(e,n,!0)}function bn(t){return new DataView(t.buffer)}let sC;try{sC=import.meta.url}catch{}Ty({baseURL:sC});Gge(Ty);Ty({Deflate:pme,Inflate:Dme});const jo={owner:"BossHobby",repo:"QUICKSILVER"},k_e={owner:"BossHobby",repo:"Configurator"},P_e="https://cors.bubblesort.me/?",I_e=[["Origin","http://localhost"],["X-Requested-With","XMLHttpRequest"]],O_e=336407,L_e=`-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCjm+/HBlaUmeHs +JuPNoLR/llQ+HmyZEdkP7ia6hF232WKRyGtwKAWWI1mAFle/m4L1I6FQQhh4uCqn +8uG01Ex+bBd6C6ecu214tx3xMTnmyh4MqUzjUYmEdcSZ3VjGJwU8J8yyXpfu7H8O +JgK5ibk6AX5qh45VvhjYRbZKLnILrMvOPJ6Y0H31FnucO6SZo7ZZnRK3C6O+Qi/w +0cHmtuQCVk4QOL+oCJIW0QNM2NYVrZY5OJc0lpbMuXmaEG8tIb2qUP0kwcX2oGMg +p68amMS3TXTH3Odc2mYhtLIoPhVyrVXyYHjcdp67vHJfomXcvW4E+TcxckBFwgI5 +iHIDIr+XAgMBAAECggEAB8LtBA8L6m7GZfKOWgHmrirOgkflNPnAx12v3qdK3t7k +KzBL0H1FjpLMuyPUM9XHx6NSEsGf8ZIjC+acyHxNyK2OC48j+250ygY92GRSb91k +wYsCh8IlePAxTG9Qt83AFNN6hXexU3dKq7wn4u9ipxrNCXa2zOCAwznDZQ+A/4a2 +jlIkMN9hqkwnTttkdGDo1gDO/U5lWIHO513vXhqvMXt76j2ekAShs2gGBpBvs+wn +/tyBJDIrSXcMCy4nwE4sDpPTpBcR2NF4wgxkjGBRphQzzBM2q0eNftlRmOlzNe/V +AdldCElnQNYvVmASMcKi+Iz6D7rgpCNU4AU/u8mGcQKBgQDX97mOPHM9Ox9a33RC +P10ifubVzQORBop2rkHsDGGWqTH/06ygUXF/OkPljVWJLhYGrXExiUnO9F7y0+lI +TsVLeqdgUwHqnrR+A78J+2kOQZHe2zD9dSgjrNhANL7lJfNMbat1d9m89a6Cc4cJ +gEpiShocw2T6DLs1+AQ2z0KPvwKBgQDB76as+S2IY9nYxR65E8LlTCAhPOrz7gzp +075MQb/+Ch7WnenX5UWpNtIAI5orXLGBTKoAP7x6eWLiJ4vxjj/C5szBI4nYjZT6 +JkiGGRqhmD8DVWi+eG9Ah5FlK1IOLa4vQdCwlhBx7xtYM/UbfWZjKUu+ZWk4JB0x +luUAvLTGKQKBgDR3+Nq3kP/FR17afvJBVq00y3wR7NXlEuq2d0mT0Hm77WvLz1q7 +rqlMTIaOicNkMPG6XY+9XPMsp4yzMy/gA0rNJ7DdOc/4cr1Sx6zzKZjPEVNlSUeq +mO/h5D/lEKO3Tp643jkRvxKLVbRXwOzsACZU/ncSeYvOYAVCljOCsxcdAoGBAI5a +A4UJ7gMkD96Oaku9lpxKsXbUST29qVrlItTEmlG1SgeMp/3h+60GYUTa3SohAuX+ +yPYf0pAvk4afMpifKmw8j2ThWihLXGP1P9y2hpbAstgWlCjjK/44xF93WeawXx+u +9qj3raCDuxWWJb8E3+e/gyqBM6eS0p74vKU63pJpAoGBAJVWaujxxkojAoVwbs0R +n/vvwY6snT2EgTGFaHllXtQAHkhoonqPQ0W+4NoM7KnZPDQcKERNrYJQkK+YKTnl +p9r9s032bxaycq7WAPoQAisit0zIt0iZzS6xDew0PIq0g4DjH0GG/y25gtx5MFcr +zM39Lg5JAtecNMRkjep4XQdR +-----END PRIVATE KEY-----`;class D_e{constructor(){xe(this,"_octokit")}async kit(){if(this._octokit)return this._octokit;const n=await new Zpe({appId:O_e,privateKey:L_e}).getInstallationOctokit(37707080);return this._octokit=n}async fetchReleases(){const s=(await(await this.kit()).rest.repos.listReleases(jo)).data.filter(r=>r.assets.length>0),i={};for(const r of s)i[r.tag_name]=r.assets;return i}async fetchArtifacts(e){const n=await this.kit();return n.rest.actions.listWorkflowRunsForRepo({...jo,branch:e,per_page:1,status:"success"}).then(s=>s.data.total_count==0?[]:n.rest.actions.listWorkflowRunArtifacts({...jo,run_id:s.data.workflow_runs[0].id,per_page:100}).then(i=>i.data.artifacts))}async fetchVersion(e,n){return(await this.kit()).rest.repos.getContent({...e,path:"VERSION",ref:n}).then(i=>{var r,o;return(r=i==null?void 0:i.data)!=null&&r.content?atob((o=i.data)==null?void 0:o.content).trim():"v0.0.0"}).catch(()=>"v0.0.0")}async fetchBranches(){const s=(await(await this.kit()).rest.repos.listBranches(jo)).data.map(r=>Promise.all([this.fetchArtifacts(r.name),this.fetchVersion(jo,r.name)]).then(([o,a])=>({name:r.name,commit:r.commit.sha,version:a,artifacts:o}))),i={};for(const r of await Promise.all(s))r.artifacts.length!=0&&(i[r.name]=r);return i}async fetchPullRequests(){const s=(await(await this.kit()).rest.pulls.list({...jo,state:"open"})).data.map(r=>Promise.all([this.fetchArtifacts(r.head.ref),this.fetchVersion({owner:r.head.repo.owner.login,repo:r.head.repo.name},r.head.ref)]).then(([o,a])=>({name:r.head.label,commit:r.head.sha,version:a,artifacts:o}))),i={};for(const r of await Promise.all(s))r.artifacts.length!=0&&(i[r.name]=r);return i}findNewVersion(e,n){for(const s of e)if(Bn.gt(s,n))return s;return null}async checkForUpdate(e){const i=(await(await this.kit()).rest.repos.listReleases(k_e)).data.filter(a=>a.assets.length>0&&Bn.valid(a.tag_name)),r=i.map(a=>a.tag_name),o=this.findNewVersion(r,e);return o?i.find(a=>a.tag_name==o):null}fetchAsset(e){const n=`${P_e}${e.browser_download_url}`;return fetch(n,{headers:I_e})}async fetchArtifact(e){const s=await(await this.kit()).rest.actions.downloadArtifact({...jo,artifact_id:e.id,archive_format:"zip"}),i=new w_e(new Kge(new Uint8Array(s.data))),r=(await i.getEntries()).shift();if(!r)return;const o=await r.getData(new Xge);return await i.close(),o}}const or=new D_e,qS="https://raw.githubusercontent.com/BossHobby/Targets/targets/",N_e=Vn("flash",{state:()=>({releases:{},branches:{},pullRequests:{},targets:[],manufacturers:{}}),actions:{fetchTargets(){return fetch(qS+"_index.json").then(t=>t.json()).then(t=>{this.targets=t.targets,this.manufacturers=t.manufacturers})},fetchReleases(){return or.fetchReleases().then(t=>this.releases=t)},fetchBranches(){return or.fetchBranches().then(t=>this.branches=t)},fetchPullRequests(){return or.fetchPullRequests().then(t=>this.pullRequests=t)},async fetch(t){switch(this.targets.length==0&&await this.fetchTargets(),t){case"release":return this.fetchReleases();case"branch":return this.fetchBranches();case"pull_request":return this.fetchPullRequests()}},fetchRuntimeConfig(t){return fetch(qS+t+".yaml").then(e=>e.ok?e.text():Promise.reject(e)).then(e=>vr.parse(e)).then(e=>uh.encode(e))}}});function Er(t){return Array.isArray?Array.isArray(t):oC(t)==="[object Array]"}const U_e=1/0;function F_e(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-U_e?"-0":e}function $_e(t){return t==null?"":F_e(t)}function Si(t){return typeof t=="string"}function iC(t){return typeof t=="number"}function B_e(t){return t===!0||t===!1||H_e(t)&&oC(t)=="[object Boolean]"}function rC(t){return typeof t=="object"}function H_e(t){return rC(t)&&t!==null}function xs(t){return t!=null}function m_(t){return!t.trim().length}function oC(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const G_e="Incorrect 'index' type",z_e=t=>`Invalid value for key ${t}`,V_e=t=>`Pattern length exceeds max of ${t}.`,W_e=t=>`Missing ${t} property in key`,j_e=t=>`Property 'weight' in key '${t}' must be a positive integer`,XS=Object.prototype.hasOwnProperty;class q_e{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(s=>{let i=aC(s);this._keys.push(i),this._keyMap[i.id]=i,n+=i.weight}),this._keys.forEach(s=>{s.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function aC(t){let e=null,n=null,s=null,i=1,r=null;if(Si(t)||Er(t))s=t,e=KS(t),n=c1(t);else{if(!XS.call(t,"name"))throw new Error(W_e("name"));const o=t.name;if(s=o,XS.call(t,"weight")&&(i=t.weight,i<=0))throw new Error(j_e(o));e=KS(o),n=c1(o),r=t.getFn}return{path:e,id:n,weight:i,src:s,getFn:r}}function KS(t){return Er(t)?t:t.split(".")}function c1(t){return Er(t)?t.join("."):t}function X_e(t,e){let n=[],s=!1;const i=(r,o,a)=>{if(xs(r))if(!o[a])n.push(r);else{let l=o[a];const c=r[l];if(!xs(c))return;if(a===o.length-1&&(Si(c)||iC(c)||B_e(c)))n.push($_e(c));else if(Er(c)){s=!0;for(let u=0,d=c.length;ut.score===e.score?t.idx{this._keysMap[n.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Si(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();Si(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,s=this.size();n{let o=i.getFn?i.getFn(e):this.getFn(e,i.path);if(xs(o)){if(Er(o)){let a=[];const l=[{nestedArrIndex:-1,value:o}];for(;l.length;){const{nestedArrIndex:c,value:u}=l.pop();if(xs(u))if(Si(u)&&!m_(u)){let d={v:u,i:c,n:this.norm.get(u)};a.push(d)}else Er(u)&&u.forEach((d,f)=>{l.push({nestedArrIndex:f,value:d})})}s.$[r]=a}else if(Si(o)&&!m_(o)){let a={v:o,n:this.norm.get(o)};s.$[r]=a}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function lC(t,e,{getFn:n=ct.getFn,fieldNormWeight:s=ct.fieldNormWeight}={}){const i=new Py({getFn:n,fieldNormWeight:s});return i.setKeys(t.map(aC)),i.setSources(e),i.create(),i}function t0e(t,{getFn:e=ct.getFn,fieldNormWeight:n=ct.fieldNormWeight}={}){const{keys:s,records:i}=t,r=new Py({getFn:e,fieldNormWeight:n});return r.setKeys(s),r.setIndexRecords(i),r}function Jf(t,{errors:e=0,currentLocation:n=0,expectedLocation:s=0,distance:i=ct.distance,ignoreLocation:r=ct.ignoreLocation}={}){const o=e/t.length;if(r)return o;const a=Math.abs(s-n);return i?o+a/i:a?1:o}function n0e(t=[],e=ct.minMatchCharLength){let n=[],s=-1,i=-1,r=0;for(let o=t.length;r=e&&n.push([s,i]),s=-1)}return t[r-1]&&r-s>=e&&n.push([s,r-1]),n}const ia=32;function s0e(t,e,n,{location:s=ct.location,distance:i=ct.distance,threshold:r=ct.threshold,findAllMatches:o=ct.findAllMatches,minMatchCharLength:a=ct.minMatchCharLength,includeMatches:l=ct.includeMatches,ignoreLocation:c=ct.ignoreLocation}={}){if(e.length>ia)throw new Error(V_e(ia));const u=e.length,d=t.length,f=Math.max(0,Math.min(s,d));let h=r,v=f;const _=a>1||l,m=_?Array(d):[];let g;for(;(g=t.indexOf(e,v))>-1;){let A=Jf(e,{currentLocation:g,expectedLocation:f,distance:i,ignoreLocation:c});if(h=Math.min(A,h),v=g+u,_){let R=0;for(;R=E;D-=1){let I=D-1,P=n[t.charAt(I)];if(_&&(m[I]=+!!P),U[D]=(U[D+1]<<1|1)&P,A&&(U[D]|=(y[D+1]|y[D])<<1|1|y[D+1]),U[D]&T&&(b=Jf(e,{errors:A,currentLocation:I,expectedLocation:f,distance:i,ignoreLocation:c}),b<=h)){if(h=b,v=I,v<=f)break;E=Math.max(1,2*f-v)}}if(Jf(e,{errors:A+1,currentLocation:f,expectedLocation:f,distance:i,ignoreLocation:c})>h)break;y=U}const S={isMatch:v>=0,score:Math.max(.001,b)};if(_){const A=n0e(m,a);A.length?l&&(S.indices=A):S.isMatch=!1}return S}function i0e(t){let e={};for(let n=0,s=t.length;n{this.chunks.push({pattern:f,alphabet:i0e(f),startIndex:h})},d=this.pattern.length;if(d>ia){let f=0;const h=d%ia,v=d-h;for(;f{const{isMatch:g,score:y,indices:b}=s0e(e,v,_,{location:i+m,distance:r,threshold:o,findAllMatches:a,minMatchCharLength:l,includeMatches:s,ignoreLocation:c});g&&(f=!0),d+=y,g&&b&&(u=[...u,...b])});let h={isMatch:f,score:f?d/this.chunks.length:1};return f&&s&&(h.indices=u),h}}class Co{constructor(e){this.pattern=e}static isMultiMatch(e){return YS(e,this.multiRegex)}static isSingleMatch(e){return YS(e,this.singleRegex)}search(){}}function YS(t,e){const n=t.match(e);return n?n[1]:null}class r0e extends Co{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class o0e extends Co{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const s=e.indexOf(this.pattern)===-1;return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}}class a0e extends Co{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class l0e extends Co{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class c0e extends Co{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class u0e extends Co{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class uC extends Co{constructor(e,{location:n=ct.location,threshold:s=ct.threshold,distance:i=ct.distance,includeMatches:r=ct.includeMatches,findAllMatches:o=ct.findAllMatches,minMatchCharLength:a=ct.minMatchCharLength,isCaseSensitive:l=ct.isCaseSensitive,ignoreLocation:c=ct.ignoreLocation}={}){super(e),this._bitapSearch=new cC(e,{location:n,threshold:s,distance:i,includeMatches:r,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class dC extends Co{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,s;const i=[],r=this.pattern.length;for(;(s=e.indexOf(this.pattern,n))>-1;)n=s+r,i.push([s,n-1]);const o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}}const u1=[r0e,dC,a0e,l0e,u0e,c0e,o0e,uC],ZS=u1.length,d0e=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,f0e="|";function h0e(t,e={}){return t.split(f0e).map(n=>{let s=n.trim().split(d0e).filter(r=>r&&!!r.trim()),i=[];for(let r=0,o=s.length;r!!(t[yp.AND]||t[yp.OR]),_0e=t=>!!t[h1.PATH],v0e=t=>!Er(t)&&rC(t)&&!p1(t),JS=t=>({[yp.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function fC(t,e,{auto:n=!0}={}){const s=i=>{let r=Object.keys(i);const o=_0e(i);if(!o&&r.length>1&&!p1(i))return s(JS(i));if(v0e(i)){const l=o?i[h1.PATH]:r[0],c=o?i[h1.PATTERN]:i[l];if(!Si(c))throw new Error(z_e(l));const u={keyId:c1(l),pattern:c};return n&&(u.searcher=f1(c,e)),u}let a={children:[],operator:r[0]};return r.forEach(l=>{const c=i[l];Er(c)&&c.forEach(u=>{a.children.push(s(u))})}),a};return p1(t)||(t=JS(t)),s(t)}function y0e(t,{ignoreFieldNorm:e=ct.ignoreFieldNorm}){t.forEach(n=>{let s=1;n.matches.forEach(({key:i,norm:r,score:o})=>{const a=i?i.weight:null;s*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:r))}),n.score=s})}function b0e(t,e){const n=t.matches;e.matches=[],xs(n)&&n.forEach(s=>{if(!xs(s.indices)||!s.indices.length)return;const{indices:i,value:r}=s;let o={indices:i,value:r};s.key&&(o.key=s.key.src),s.idx>-1&&(o.refIndex=s.idx),e.matches.push(o)})}function w0e(t,e){e.score=t.score}function x0e(t,e,{includeMatches:n=ct.includeMatches,includeScore:s=ct.includeScore}={}){const i=[];return n&&i.push(b0e),s&&i.push(w0e),t.map(r=>{const{idx:o}=r,a={item:e[o],refIndex:o};return i.length&&i.forEach(l=>{l(r,a)}),a})}class Oc{constructor(e,n={},s){this.options={...ct,...n},this.options.useExtendedSearch,this._keyStore=new q_e(this.options.keys),this.setCollection(e,s)}setCollection(e,n){if(this._docs=e,n&&!(n instanceof Py))throw new Error(G_e);this._myIndex=n||lC(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){xs(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const n=[];for(let s=0,i=this._docs.length;s-1&&(l=l.slice(0,n)),x0e(l,this._docs,{includeMatches:s,includeScore:i})}_searchStringList(e){const n=f1(e,this.options),{records:s}=this._myIndex,i=[];return s.forEach(({v:r,i:o,n:a})=>{if(!xs(r))return;const{isMatch:l,score:c,indices:u}=n.searchIn(r);l&&i.push({item:r,idx:o,matches:[{score:c,value:r,norm:a,indices:u}]})}),i}_searchLogical(e){const n=fC(e,this.options),s=(a,l,c)=>{if(!a.children){const{keyId:d,searcher:f}=a,h=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(l,d),searcher:f});return h&&h.length?[{idx:c,item:l,matches:h}]:[]}const u=[];for(let d=0,f=a.children.length;d{if(xs(a)){let c=s(n,a,l);c.length&&(r[l]||(r[l]={idx:l,item:a,matches:[]},o.push(r[l])),c.forEach(({matches:u})=>{r[l].matches.push(...u)}))}}),o}_searchObjectList(e){const n=f1(e,this.options),{keys:s,records:i}=this._myIndex,r=[];return i.forEach(({$:o,i:a})=>{if(!xs(o))return;let l=[];s.forEach((c,u)=>{l.push(...this._findMatches({key:c,value:o[u],searcher:n}))}),l.length&&r.push({idx:a,item:o,matches:l})}),r}_findMatches({key:e,value:n,searcher:s}){if(!xs(n))return[];let i=[];if(Er(n))n.forEach(({v:r,i:o,n:a})=>{if(!xs(r))return;const{isMatch:l,score:c,indices:u}=s.searchIn(r);l&&i.push({score:c,key:e,value:r,idx:o,norm:a,indices:u})});else{const{v:r,n:o}=n,{isMatch:a,score:l,indices:c}=s.searchIn(r);a&&i.push({score:l,key:e,value:r,norm:o,indices:c})}return i}}Oc.version="7.0.0";Oc.createIndex=lC;Oc.parseIndex=t0e;Oc.config=ct;Oc.parseQuery=fC;g0e(m0e);const E0e=nt({name:"Flash",setup(){return{root:Xt(),flash:N_e(),serial:Lc()}},data(){return{loading:!0,dropdownHover:!1,dropdownActive:!1,sourceOptions:[{value:"release",text:"Release"},{value:"branch",text:"Development Branch"},{value:"pull_request",text:"Pull Request"},{value:"local",text:"Local"}],progress:[],source:"",release:void 0,branch:void 0,pullRequest:void 0,targetSearch:"",currentTarget:void 0,target:void 0,file:void 0}},watch:{async source(){this.loading=!0,await this.flash.fetch(this.source),this.loading=!1,this.release=this.pickRelease(),this.branch=this.branchOptions[0],this.pullRequest=this.pullRequestOptions[0],this.targetSearch="",this.target=void 0,this.file=void 0},release(){this.targetSearch="",this.target=void 0,this.file=void 0},branch(){this.targetSearch="",this.target=void 0,this.file=void 0},pullRequest(){this.targetSearch="",this.target=void 0,this.file=void 0}},computed:{branchOptions(){return Object.keys(this.flash.branches)},pullRequestOptions(){return Object.keys(this.flash.pullRequests)},releaseOptions(){return Object.keys(this.flash.releases)},commitHash(){const t=this.source=="branch"?this.flash.branches[this.branch||""]:this.flash.pullRequests[this.pullRequest||""];return t?t.commit.slice(0,8):""},isRuntimeTarget(){if(this.source=="release"&&this.release)return ch.satisfies(this.release,">=0.10.0-dev",{includePrerelease:!0});if(this.source=="branch"&&this.branch){const t=this.flash.branches[this.branch];return ch.satisfies(t.version,">=0.10.0-dev",{includePrerelease:!0})}if(this.source=="pull_request"&&this.pullRequest){const t=this.flash.pullRequests[this.pullRequest];return ch.satisfies(t.version,">=0.10.0-dev",{includePrerelease:!0})}return!1},targetOptions(){let t=[];if(this.isRuntimeTarget)t=this.flash.targets.map(n=>{const s=this.flash.manufacturers[n.manufacturer||"CUST"];return{value:n,text:`${s.name} / ${n.name}`}});else{let n=[];this.source=="release"&&this.release?n=this.flash.releases[this.release]||[]:this.source=="branch"&&this.branch?n=this.flash.branches[this.branch].artifacts||[]:this.source=="pull_request"&&this.pullRequest&&(n=this.flash.pullRequests[this.pullRequest].artifacts||[]),t=n.map(s=>({value:s,text:s.name.replace("quicksilver.","")}))}return this.targetSearch.length==0?t:new Oc(t,{includeScore:!1,keys:["text"]}).search(this.targetSearch).map(n=>n.item)},canFlash(){return this.loading?!1:this.source=="local"?!!this.file:!!this.target}},methods:{async resetToBootloader(){this.currentTarget=await this.serial.hard_reboot()},pickRelease(){return this.releaseOptions.find(t=>!t.endsWith("-dev")&&!t.includes("-rc"))},selectTarget(t){this.target=t.value,this.targetSearch=t.text,this.dropdownHover=!1,this.dropdownActive=!1},updateFile(){const t=this.$refs.file;t.files&&t.files.length?this.file=t.files[0]:this.file=void 0},fetchFirmware(){switch(this.source){case"local":return new Promise((t,e)=>{if(!this.file)return e();const n=new FileReader;n.addEventListener("load",s=>{var i;(i=s==null?void 0:s.target)!=null&&i.result?t(s.target.result):e()}),n.readAsText(this.file)});case"release":if(this.isRuntimeTarget&&this.release){const e=this.flash.releases[this.release].sort((n,s)=>n.name.length-s.name.length).find(n=>{var s;return n.name.includes((s=this.target)==null?void 0:s.mcu)});return or.fetchAsset(e).then(n=>n.text())}return or.fetchAsset(this.target).then(t=>t.text());case"branch":if(this.isRuntimeTarget&&this.branch){const e=this.flash.branches[this.branch].artifacts.sort((n,s)=>n.name.length-s.name.length).find(n=>{var s;return n.name.includes((s=this.target)==null?void 0:s.mcu)});return or.fetchArtifact(e)}return or.fetchArtifact(this.target);case"pull_request":if(this.isRuntimeTarget&&this.pullRequest){const e=this.flash.pullRequests[this.pullRequest].artifacts.sort((n,s)=>n.name.length-s.name.length).find(n=>{var s;return n.name.includes((s=this.target)==null?void 0:s.mcu)});return or.fetchArtifact(e)}return or.fetchArtifact(this.target);default:return Promise.resolve(void 0)}},updateProgress(t){const e={...this.progress};e[t.task]=t,this.progress=e},onSubmit(t){t.preventDefault(),this.loading=!0;const e=new dfe;return e.onProgress(n=>this.updateProgress(n)),e.connect().then(()=>(this.updateProgress({task:"download",current:10,total:100}),this.fetchFirmware())).then(async n=>{if(!n)throw new Error("firmware not found");this.updateProgress({task:"download",current:90,total:100});const s=dp.parse(n);if(this.isRuntimeTarget){const i=await this.flash.fetchRuntimeConfig(this.target.target);at.info("Flash","injecting target ",this.target.target),s.patch(cfe[this.target.mcu],i)}return this.updateProgress({task:"download",current:100,total:100}),e.flash(s)}).then(()=>this.root.append_alert({type:"success",msg:"Firmware flashed!"})).catch(n=>{at.error("Flash",n),this.root.append_alert({type:"danger",msg:"Flash failed!"})}).finally(()=>{this.progress=[],this.loading=!1})}},async created(){this.source="release"}}),S0e={class:"card"},T0e={class:"card-header"},A0e={class:"card-header-title"},M0e={class:"card-content field-is-3"},R0e={key:0,class:"field is-horizontal"},C0e={class:"field-body"},k0e={class:"field"},P0e={class:"control is-expanded"},I0e=["value"],O0e={class:"field is-horizontal"},L0e={class:"field-label is-normal"},D0e={class:"label"},N0e={class:"field-body"},U0e={class:"field is-narrow"},F0e={class:"control"},$0e={class:"select is-fullwidth"},B0e={key:1,class:"field is-horizontal"},H0e={class:"field-label is-medium"},G0e={class:"label"},z0e={class:"field-body"},V0e={class:"field"},W0e={class:"file-label"},j0e={class:"file-cta"},q0e={class:"file-icon"},X0e=["disabled"],K0e={key:0,class:"file-name"},Y0e={key:2,class:"field is-horizontal"},Z0e={class:"field-label is-normal"},J0e={class:"label"},Q0e={class:"field-body"},e1e={class:"field is-narrow"},t1e={class:"control"},n1e={class:"select is-fullwidth"},s1e={key:3,class:"field is-horizontal"},i1e={class:"field-label is-normal"},r1e={class:"label"},o1e={class:"field-body"},a1e={class:"field is-narrow"},l1e={class:"control"},c1e={class:"select is-fullwidth"},u1e={key:4,class:"field is-horizontal"},d1e={class:"field-label is-normal"},f1e={class:"label"},h1e={class:"field-body"},p1e={class:"field is-narrow"},m1e={class:"control"},g1e=["value"],_1e={key:5,class:"field is-horizontal"},v1e={class:"field-label is-normal"},y1e={class:"label"},b1e={class:"field-body"},w1e={class:"field is-narrow"},x1e={class:"control"},E1e={class:"select is-fullwidth"},S1e={key:6,class:"field is-horizontal"},T1e={class:"field-label is-normal"},A1e={class:"label"},M1e={class:"field-body"},R1e={class:"field is-narrow"},C1e={class:"control"},k1e={class:"select is-fullwidth"},P1e={class:"dropdown-trigger"},I1e={class:"field"},O1e={class:"control is-expanded has-icons-right"},L1e=["disabled"],D1e={class:"dropdown-content"},N1e=["value","onClick"],U1e={class:"column is-2"},F1e={class:"column is-10"},$1e=["value","max"],B1e={class:"card-footer"};function H1e(t,e,n,s,i,r){const o=Ie("tooltip"),a=Ie("spinner-btn"),l=Ie("input-select"),c=Ie("font-awesome-icon");return Z(),re("form",{onSubmit:e[11]||(e[11]=(...u)=>t.onSubmit&&t.onSubmit(...u))},[p("div",S0e,[p("div",T0e,[p("p",A0e,[e[12]||(e[12]=ye(" Flash ")),X(o,{entry:"flash.reset"})]),X(a,{class:"card-header-button is-info",type:"button",onClick:e[0]||(e[0]=u=>t.resetToBootloader())},{default:tt(()=>e[13]||(e[13]=[ye(" Reset to Bootloader ")])),_:1})]),p("div",M0e,[t.currentTarget?(Z(),re("div",R0e,[e[14]||(e[14]=p("div",{class:"field-label is-normal"},[p("label",{class:"label"}," Current Target ")],-1)),p("div",C0e,[p("div",k0e,[p("div",P0e,[p("input",{class:"input is-static",value:t.currentTarget,readonly:""},null,8,I0e)])])])])):He("",!0),p("div",O0e,[p("div",L0e,[p("label",D0e,[e[15]||(e[15]=ye(" Source ")),X(o,{entry:"flash.source"})])]),p("div",N0e,[p("div",U0e,[p("div",F0e,[p("div",$0e,[X(l,{modelValue:t.source,"onUpdate:modelValue":e[1]||(e[1]=u=>t.source=u),options:t.sourceOptions,disabled:t.loading},null,8,["modelValue","options","disabled"])])])])])]),t.source=="local"?(Z(),re("div",B0e,[p("div",H0e,[p("label",G0e,[e[16]||(e[16]=ye(" File ")),X(o,{entry:"flash.file-local"})])]),p("div",z0e,[p("div",V0e,[p("div",{class:ds(["file is-boxed is-medium",{"has-name":t.file}])},[p("label",W0e,[p("span",j0e,[p("span",q0e,[X(c,{icon:"fa-solid fa-upload"})]),e[17]||(e[17]=p("span",{class:"file-label"}," Choose a file… ",-1))]),p("input",{class:"file-input",type:"file",onChange:e[2]||(e[2]=u=>t.updateFile()),ref:"file",accept:".hex",disabled:t.loading},null,40,X0e),t.file?(Z(),re("span",K0e,$e(t.file.name),1)):He("",!0)])],2)])])])):He("",!0),t.source=="branch"?(Z(),re("div",Y0e,[p("div",Z0e,[p("label",J0e,[e[18]||(e[18]=ye(" Branch ")),X(o,{entry:"flash.file-branch"})])]),p("div",Q0e,[p("div",e1e,[p("div",t1e,[p("div",n1e,[X(l,{modelValue:t.branch,"onUpdate:modelValue":e[3]||(e[3]=u=>t.branch=u),options:t.branchOptions,disabled:t.loading},null,8,["modelValue","options","disabled"])])])])])])):He("",!0),t.source=="pull_request"?(Z(),re("div",s1e,[p("div",i1e,[p("label",r1e,[e[19]||(e[19]=ye(" Pull Request ")),X(o,{entry:"flash.file-pull-request"})])]),p("div",o1e,[p("div",a1e,[p("div",l1e,[p("div",c1e,[X(l,{modelValue:t.pullRequest,"onUpdate:modelValue":e[4]||(e[4]=u=>t.pullRequest=u),options:t.pullRequestOptions,disabled:t.loading},null,8,["modelValue","options","disabled"])])])])])])):He("",!0),t.source=="branch"||t.source=="pull_request"?(Z(),re("div",u1e,[p("div",d1e,[p("label",f1e,[e[20]||(e[20]=ye(" Commit ")),X(o,{entry:"flash.file-commit"})])]),p("div",h1e,[p("div",p1e,[p("div",m1e,[p("input",{class:"input is-fullwidth is-static",type:"text",value:t.commitHash},null,8,g1e)])])])])):He("",!0),t.source=="release"?(Z(),re("div",_1e,[p("div",v1e,[p("label",y1e,[e[21]||(e[21]=ye(" Release ")),X(o,{entry:"flash.file-release"})])]),p("div",b1e,[p("div",w1e,[p("div",x1e,[p("div",E1e,[X(l,{modelValue:t.release,"onUpdate:modelValue":e[5]||(e[5]=u=>t.release=u),options:t.releaseOptions,disabled:t.loading},null,8,["modelValue","options","disabled"])])])])])])):He("",!0),t.source!="local"?(Z(),re("div",S1e,[p("div",T1e,[p("label",A1e,[e[22]||(e[22]=ye(" Target ")),X(o,{entry:"flash.file-remote"})])]),p("div",M1e,[p("div",R1e,[p("div",C1e,[p("div",k1e,[p("div",{class:ds(["dropdown",{"is-active":t.dropdownActive||t.dropdownHover}])},[p("div",P1e,[p("div",I1e,[p("p",O1e,[We(p("input",{class:"input is-fullwidth",type:"search",placeholder:"Search...","onUpdate:modelValue":e[6]||(e[6]=u=>t.targetSearch=u),onFocus:e[7]||(e[7]=u=>t.dropdownActive=!0),onBlur:e[8]||(e[8]=u=>t.dropdownActive=!1),disabled:t.loading},null,40,L1e),[[et,t.targetSearch]])])])]),p("div",{class:"dropdown-menu",style:{"overflow-y":"auto","max-height":"50vh"},role:"menu",onMouseover:e[9]||(e[9]=u=>t.dropdownHover=!0),onMouseleave:e[10]||(e[10]=u=>t.dropdownHover=!1)},[p("div",D1e,[(Z(!0),re(it,null,Ht(t.targetOptions,u=>(Z(),re("a",{key:u.value,value:u.value,class:ds(["dropdown-item",{"is-active":t.target==u}]),onClick:OP(d=>t.selectTarget(u),["prevent"])},$e(u.text),11,N1e))),128))])],32)],2)])])])])])):He("",!0),(Z(!0),re(it,null,Ht(t.progress,(u,d)=>(Z(),re("div",{key:d,class:"columns my-2 mx-2"},[p("div",U1e,$e(d),1),p("div",F1e,[p("progress",{class:"progress is-primary",height:"20px",value:u.current,max:u.total},null,8,$1e)])]))),128))]),p("footer",B1e,[X(a,{class:ds(["card-footer-item",{"is-loading":t.loading}]),disabled:!t.canFlash,type:"submit"},{default:tt(()=>e[23]||(e[23]=[ye(" Flash ")])),_:1},8,["class","disabled"])])])],32)}const G1e=lt(E0e,[["render",H1e]]),z1e=nt({name:"Home",components:{Info:RR,Flash:G1e}}),V1e={class:"columns is-multiline"},W1e={class:"column is-12"},j1e={class:"column is-12"};function q1e(t,e,n,s,i,r){const o=Ie("Info"),a=Ie("Flash");return Z(),re("div",V1e,[p("div",W1e,[X(o)]),p("div",j1e,[X(a)])])}const X1e=lt(z1e,[["render",q1e]]),hC="https://raw.githubusercontent.com/BossHobby/Templates/develop-deploy/";function m1(t){return hC+t}const K1e=Vn("templates",{state:()=>({index:[]}),actions:{fetch_templates(){return fetch(hC+"index.json").then(e=>e.json()).then(e=>{this.index=e.map(n=>(n.image&&(n.image=m1(n.image)),n.profile=m1(n.profile),n))})}}}),Y1e=nt({name:"TemplateModal",props:["template"],setup(){return{info:rn(),profile:Dt()}},data(){return{selected:{},tmpl:void 0}},watch:{template(t){this.updateTemplate(t)}},computed:{formValid(){var t;for(const e of((t=this.tmpl)==null?void 0:t.options)||[])if(!this.selected[e.name])return!1;return!0},selectedValues(){var e,n;const t={};for(const s of Object.keys(this.selected)){const i=(n=(e=this.tmpl)==null?void 0:e.options)==null?void 0:n.find(r=>r.name==s);i&&(t[s]=i.entries.find(r=>r.name==this.selected[s]))}return t}},methods:{updateTemplate(t){if(!t){this.tmpl=void 0;return}const e=JSON.parse(JSON.stringify(t)),n={};for(const s of e.options||[]){for(const i of s.entries)for(const r of Object.keys(i.selector||{}))if(i.selector[r].includes(this.info[r])){i.title+=" (auto-selected)",n[s.name]=i.name;break}if(!n[s.name]){const i=s.entries.find(r=>r.name==s.default);i&&(n[s.name]=s.default,i.title+=" (auto-selected)")}}this.tmpl=e,this.selected=n},async applyTemplate(){var e,n;if(!this.tmpl)return;const t=await fetch((e=this.tmpl)==null?void 0:e.profile).then(s=>s.text()).then(s=>vr.parse(s));for(const s of this.tmpl.options||[]){const i=s.entries.find(o=>o.name==this.selected[s.name]);if(!i)continue;const r=await fetch(m1(i.file)).then(o=>o.text()).then(o=>vr.parse(o));at.info("template","applying option",i.name),Kh(t,r.profile)}if((n=this.tmpl)!=null&&n.mutations)for(const s of this.tmpl.mutations){const i=s.options.find(r=>Object.entries(r.selector).every(([o,a])=>a.includes(this.selected[o])));i&&(at.info("template","applying mutation",i.name),Kh(t,i.profile))}return this.profile.merge_profile(t)}},created(){this.updateTemplate(this.template)}}),Z1e={key:0,class:"card my-5"},J1e={class:"card-content"},Q1e={class:"title"},eve={class:"is-3"},tve={class:"is-size-5 has-text-weight-normal has-text-grey-lighter is-pulled-right"},nve={class:"media"},sve={class:"media-left"},ive={class:"image",style:{width:"300px"}},rve=["src"],ove={class:"media-content"},ave={class:"m-2"},lve={class:"field is-horizontal"},cve={class:"field-label is-medium is-align-self-flex-start"},uve={class:"label"},dve={class:"is-size-5"},fve={class:"field-body is-flex-grow-2"},hve={class:"field"},pve={class:"control mb-2"},mve={class:"select is-fullwidth"},gve=["onUpdate:modelValue"],_ve=["value"],vve={key:0,class:"help is-danger"},yve={key:1,class:"help has-text-grey-light"},bve={class:"card-footer"};function wve(t,e,n,s,i,r){const o=Ie("font-awesome-icon"),a=Ie("tooltip"),l=Ie("spinner-btn");return t.tmpl?(Z(),re("div",Z1e,[p("div",J1e,[p("p",Q1e,[p("span",eve,$e(t.tmpl.name),1),p("span",tve,[X(o,{icon:"fa-regular fa-pen-to-square","fixed-width":""}),ye(" by "+$e(t.tmpl.author),1)])]),p("article",nve,[p("figure",sve,[p("p",ive,[p("img",{src:t.tmpl.image},null,8,rve)])]),p("div",ove,[p("p",ave,$e(t.tmpl.desc),1),e[1]||(e[1]=p("hr",null,null,-1)),(Z(!0),re(it,null,Ht(t.tmpl.options,c=>{var u,d;return Z(),re("div",lve,[p("div",cve,[p("label",uve,[p("span",dve,$e(c.title),1),X(a,{text:c.desc},null,8,["text"])])]),p("div",fve,[p("div",hve,[p("div",pve,[p("div",mve,[We(p("select",{"onUpdate:modelValue":f=>t.selected[c.name]=f},[(Z(!0),re(it,null,Ht(c.entries,f=>(Z(),re("option",{value:f.name},$e(f.title),9,_ve))),256))],8,gve),[[Td,t.selected[c.name]]])])]),t.selected[c.name]?He("",!0):(Z(),re("p",vve," Please select an option! ")),(u=t.selectedValues[c.name])!=null&&u.desc?(Z(),re("p",yve,$e((d=t.selectedValues[c.name])==null?void 0:d.desc),1)):He("",!0)])])])}),256))])])]),p("footer",bve,[e[3]||(e[3]=p("span",{class:"card-footer-item"},null,-1)),e[4]||(e[4]=p("span",{class:"card-footer-item"},null,-1)),e[5]||(e[5]=p("span",{class:"card-footer-item"},null,-1)),X(l,{class:"card-footer-item is-primary",onClick:e[0]||(e[0]=c=>t.applyTemplate()),disabled:!t.formValid},{default:tt(()=>e[2]||(e[2]=[ye(" Apply ")])),_:1},8,["disabled"])])])):He("",!0)}const xve=lt(Y1e,[["render",wve]]),Eve=nt({name:"Templates",components:{TemplateCard:xve},setup(){return{templates:K1e(),profile:Dt()}},created(){this.templates.fetch_templates()}});function Sve(t,e,n,s,i,r){const o=Ie("TemplateCard");return Z(),re(it,null,[e[0]||(e[0]=p("section",{class:"hero is-primary"},[p("div",{class:"hero-body"},[p("h5",{class:"title is-5"}," Templates provide a way to apply configurations supplied by the community. ")])],-1)),(Z(!0),re(it,null,Ht(t.templates.index,a=>(Z(),Bt(o,{key:a.name,template:a},null,8,["template"]))),128))],64)}const Tve=lt(Eve,[["render",Sve],["__scopeId","data-v-c380dbc8"]]),ir=VI({history:wI("/develop/"),routes:[{path:"/",redirect:()=>Lc().is_connected?"/profile":"/home"},{path:"/home",name:"home",component:X1e},{path:"/templates",name:"templates",component:Tve},{path:"/profile",name:"profile",component:ofe},{path:"/setup",name:"setup",component:Jj},{path:"/rates",name:"rates",component:Rne},{path:"/receiver",name:"receiver",component:roe},{path:"/osd",name:"osd",component:ble},{path:"/motor",name:"motor",component:Sce},{path:"/blackbox",name:"blackbox",component:lue},{path:"/state",name:"state",component:mue},{path:"/perf",name:"perf",component:yue}]});ir.beforeEach((t,e,n)=>{Lc().is_connected?t.name==="home"?n({name:"profile"}):n():t.name!=="home"&&t.name!=="flash"&&t.name!=="log"?n({name:"home"}):n()});let g1=null,_1=0;function pC(){clearInterval(g1),g1=null,_1=0}function Ave(t){pC(),g1=setInterval(async()=>{await t(_1),_1++},ml.serial.updateInterval)}const Lc=Vn("serial",{state:()=>({is_connected:!1,is_connecting:!1}),actions:{async poll_serial(t){if(!this.is_connected)return;const e=Cv(),n=HM(),s=ps(),i=J_();await s.fetch_state(),t%4&&(ir.currentRoute.value.fullPath=="/receiver"&&await e.fetch_bind_info(),ir.currentRoute.value.fullPath=="/perf"&&await n.fetch_perf_counters(),ir.currentRoute.value.fullPath=="/setup"&&await i.update_vtx_settings())},async soft_reboot(){await this.disconnect(),this.is_connecting=!0,await gt.softReboot();for(let t=0;t<10&&(await Ol.getPorts()).length;t++)await bi(100);for(let t=0;t<10&&!(await Ol.getPorts()).length;t++)await bi(100);await this.connect(gt.connectFirstPort(t=>(at.error("serial",t),this.disconnect(),gt.close())))},serial_passthrough({port:t,baudrate:e,half_duplex:n,stop_bits:s}){const i=Xt();return gt.command(xn.Serial,0,t,e,n?1:0,s).then(()=>gt.close()).then(()=>this.toggle_connection()).then(()=>{i.append_alert({type:"success",msg:"Serial passthrough successful!"})}).catch(r=>{at.error("serial",r),i.append_alert({type:"danger",msg:"Serial passthrough failed"})})},hard_reboot(){const t=Xt();return gt.hardReboot().then(e=>(t.append_alert({type:"success",msg:"Reset to bootloader successful!"}),e)).catch(e=>{at.error("serial",e),t.append_alert({type:"danger",msg:"Reset to bootloader failed"})})},disconnect(){const t=Xt();pC(),this.is_connected=!1,this.is_connecting=!1,t.reset_needs_reboot(),ir.currentRoute.value.fullPath!="/home"&&ir.push("/home")},async connect(t){const e=TR(),n=vc(),s=rn(),i=mm(),r=Dt(),o=Xt(),a=Tc(),l=J_();try{const c=await t;s.$reset(),i.$reset(),l.$reset(),e.$reset(),n.$reset(),r.$reset(),a.$reset(),this.is_connected=!0,s.set_info(c),s.quic_semver_gte("0.2.0")&&a.fetch(),n.fetch_default_profile(),o.fetch_pid_rate_presets(),r.fetch_profile(),l.update_vtx_settings(),Ave(u=>this.poll_serial(u)),ir.currentRoute.value.fullPath!="/profile"&&ir.push("/profile")}catch(c){at.error("serial",c),this.is_connected=!1,o.reset_needs_reboot(),o.append_alert({type:"danger",msg:"Connection to the board failed"})}finally{this.is_connecting=!1}},async toggle_connection(){return this.is_connected?(this.disconnect(),gt.close()):(this.is_connecting=!0,this.connect(gt.connect(t=>(at.error("serial",t),this.disconnect(),gt.close()))))}}}),Mve={xmlns:"http://www.w3.org/2000/svg","xml:space":"preserve",width:"512",height:"82"};function Rve(t,e){return Z(),re("svg",Mve,e[0]||(e[0]=[p("g",{class:"tagline"},[p("path",{d:"M136.296 482.246c-3.928-4.12-4.077-8.114-.683-18.244 3.19-9.522 8.952-17.058 13.143-17.193 9.668-.311 18.425 10.55 16.774 20.804-.755 4.687-.449 5.607 2.558 7.673 6.313 4.338 3.485 8.076-3.563 4.708-2.557-1.223-4.29-.844-9.544 2.086-8.256 4.604-14.401 4.659-18.685.166m15.716-4.63c1.995-2.313 1.83-2.74-2.447-6.32-6.633-5.55-6.138-8.303 1.381-7.676 3.283.274 5.968-.001 5.968-.61 0-2.224-5.394-12.128-6.604-12.128-1.917 0-7.981 7.296-8.782 10.566-.393 1.603-.523 5.354-.29 8.335.325 4.158 1.041 5.523 3.076 5.861 5.595.93 6.82 1.887 3.98 3.112-1.957.844-2.098 1.17-.538 1.242 1.164.054 3.079-1.018 4.256-2.383m23.435-9.629c-1.804-1.304-4.04-3.338-4.97-4.52-2.498-3.18-8.271-15.06-10.414-21.43-2.197-6.53-1.186-7.814 6.136-7.792 4.606.014 4.676.108 9.11 12.151 4.476 12.157 6.273 15.615 8.117 15.615 1.234 0-1.904-14.511-4.603-21.287-2.441-6.128-2.617-12.966-.356-13.818.912-.343 3.52-.1 5.795.54 4.447 1.25 5.648 4.152 8.488 20.496 1.953 11.242 1.652 13.381-2.546 18.095-4.42 4.963-9.637 5.652-14.757 1.95m27.697-11.888c-2.765-5.371-17.05-35.946-17.05-36.494 0-1.53 4.494-4.892 6.539-4.892 4.898 0 18.661 26.952 18.661 36.545 0 7.683-5.12 10.725-8.15 4.84m13.574-7.875c-7.038-7.382-6.52-34.394.808-42.08 5.32-5.58 17.642-6.01 17.642-.614 0 2.81-6.538 5.432-8.747 3.509-1.442-1.256-2.13-.76-3.318 2.393-2.653 7.04-3.055 21.514-.757 27.282 1.827 4.586 2.623 5.213 6.624 5.213 2.509 0 5.32-.977 6.271-2.179 2.28-2.881 8.656-6.287 9.707-5.185 1.814 1.903.505 3.472-7.333 8.785-9.377 6.357-16.627 7.355-20.897 2.876m32.998-13.046c-4.76-8.202-12.098-29.165-11.33-32.373.852-3.563 7.223-5.934 8.791-3.272.66 1.12 1.658.312 3.015-2.439 3.844-7.796 10.167-12.986 15.824-12.986h5.144l-2.75 4.05c-1.512 2.228-4.19 7.312-5.951 11.3l-3.202 7.25 6.193 5.61c8.412 7.622 14.258 16.055 12.447 17.955-.98 1.027-3.623.131-8.834-2.996l-7.435-4.462.365 6.566c.36 6.46.285 6.595-4.66 8.415-4.969 1.828-5.053 1.8-7.617-2.618m38.038-15.437c1.54-3.388 1.888-6.477 1.24-11.008l-.9-6.297-6.712-.969c-6.928-.999-11.729-4.478-11.729-8.5 0-5.248 8.236-14.996 14.845-17.573 1.235-.481 4.1-.317 6.367.365 3.658 1.1 4.034.952 3.346-1.32-.91-3.01 2.435-7.024 5.855-7.024 4.932 0 18.662 26.966 18.662 36.652 0 5.01-2.77 8.648-5.69 7.473-.959-.386-4.968-7.673-8.91-16.193-4.987-10.784-7.72-15.268-8.991-14.756-1.005.404-2.661.735-3.68.735-2.211 0-7.676 10.642-6.756 13.156.353.966 3.312 2.462 6.575 3.323 6.661 1.76 7.964 3.896 6.82 11.183-1.684 10.715-4.886 15.463-10.429 15.463-1.839 0-1.83-.495.087-4.71m37.76-16.656c-1.415-1.789-6.44-15.67-7.435-20.542-.254-1.244-1.73-5.355-3.282-9.136-2.232-5.442-2.538-7.653-1.467-10.607 1.759-4.85 7.422-5.238 8.806-.602.514 1.722 3.308 8.451 6.209 14.955s5.804 13.275 6.451 15.048c.907 2.486 1.82 3.009 3.993 2.285 2.634-.876 5.065 1 5.119 3.95.028 1.541-10.633 6.471-14.076 6.509-1.552.016-3.495-.82-4.317-1.86m17.868-16.303c-12.8-14.501-15.169-23.045-7.13-25.72 2.349-.783 3.845.105 7.464 4.426l4.527 5.405-.7-6.911c-.874-8.61.149-15.658 2.402-16.565.944-.38 3.377-.225 5.406.344l3.69 1.035.45 22.35c.448 22.286.44 22.352-2.583 23.201-5.22 1.467-5.88 1.098-13.526-7.565m29.36-10.13c-5.437-8.588-12.008-26.864-11.354-31.575.325-2.341 2.951-4.634 9.73-8.497 9.392-5.352 17.088-7.242 14.097-3.462-.815 1.03-3.872 3.002-6.795 4.384-5.834 2.76-6.03 3.408-3.745 12.373l1.568 6.148 6.393-3.621c9.344-5.293 10.982-2.385 2.631 4.67l-6.462 5.46 3.296 5.224c1.813 2.873 3.561 5.223 3.885 5.223s3.76-2.382 7.638-5.294l7.048-5.294-1.866-4.655c-1.026-2.56-2.526-8.844-3.332-13.965-1.272-8.08-1.159-9.987.857-14.443 2.997-6.624 6.157-8.287 14.206-7.476 9.264.933 11.045 3.23 9.377 12.081l-1.33 7.051 5.447 1.52c6.165 1.722 9.868 4.691 11.53 9.249 2.477 6.794-2.384 9.956-6.118 3.979-1.147-1.836-3.966-4.293-6.265-5.46-3.88-1.972-4.448-1.925-7.893.647-3.008 2.247-3.46 3.265-2.386 5.37.729 1.428 1.325 5.155 1.325 8.282 0 4.713-.567 5.957-3.31 7.268-2.671 1.276-3.76 1.157-5.637-.62-2.154-2.037-3.02-1.643-11.611 5.282-12.23 9.856-14.769 9.874-20.925.15m37.97-48.188c-1.053-2.487-2.791 3.916-2.832 10.433-.022 3.624.22 3.35 1.846-2.087 1.03-3.443 1.473-7.199.987-8.346",style:{display:"inline",fill:"#000","fill-opacity":".29819","stroke-width":"1.35834"},transform:"matrix(1.43639 .63307 -.61952 1.40565 104.251 -703.335)"}),p("path",{d:"M137.121 482.059c-2.47-2.18-4.08-4.92-4.08-6.941 0-5.546 6.51-20.81 10.647-24.969 3.663-3.68 4.177-3.807 9.12-2.254 7.956 2.5 12.065 8.494 12.065 17.6 0 6.41.491 7.849 3.543 10.366 4.981 4.11 2.376 6.75-3.512 3.556-3.827-2.075-4.477-2.092-6.5-.171-2.887 2.74-11.256 6.414-14.609 6.414-1.426 0-4.43-1.62-6.674-3.601m14.575-3.403c3.613-2.028 3.228-3.6-2.076-8.485-2.554-2.351-4.643-4.836-4.643-5.522 0-1.744 7.576-1.56 10.824.264 2.425 1.361 2.6 1.19 1.763-1.74-1.603-5.614-5.35-11.569-7.561-12.016-3.63-.733-8.936 8.16-9.198 15.416-.228 6.32 2.002 11.452 4.323 9.947.647-.419 1.882-.304 2.746.256 1.079.7.768 1.347-.995 2.07-2.35.966-2.363 1.062-.156 1.152 1.324.054 3.562-.55 4.973-1.342m22.096-12.384c-5.114-4.709-13.165-21.055-13.401-27.205-.151-3.936.161-4.207 5.297-4.601 5.067-.389 5.512-.134 6.215 3.552 1.374 7.206 10.065 25.643 11.615 24.64 1.711-1.11 1.15-4.135-3.637-19.582-1.923-6.206-3.121-12.31-2.662-13.563.987-2.698 6.145-3.001 9.202-.541 2.203 1.773 5.4 13.165 7.025 25.024.853 6.23.647 6.86-3.755 11.477-5.766 6.047-9.971 6.258-15.9.8m30.6-9.478c-2.671-3.238-16.972-34.543-16.972-37.153 0-1.919 3.8-4.931 6.213-4.925 2.73.007 16.018 25.946 17.173 33.522.743 4.874-1.111 10.99-3.332 10.99-.59 0-1.978-1.095-3.082-2.434m13.153-7.887c-3.39-2.696-4.924-9.601-4.924-22.15 0-11.816 2.253-18.965 7.1-22.525 3.085-2.267 11.094-2.685 14.036-.733 3.16 2.098-.9 6.018-5.502 5.31-2.061-.318-4.364.201-5.116 1.152-1.812 2.29-3.157 19.762-2.014 26.152 1.235 6.901 5.95 10.177 11.303 7.852 2.131-.926 4.906-2.879 6.166-4.339 2.469-2.861 7.731-3.677 6.902-1.07-.277.872-4.314 4.002-8.972 6.956-8.898 5.643-14.822 6.703-18.98 3.395m32.48-12.847c-.709-1.412-3.795-8.925-6.859-16.696-4.437-11.255-5.286-14.686-4.174-16.867 1.793-3.513 6.696-4.955 7.682-2.26.5 1.367 1.899.074 4.403-4.068 4.373-7.231 10.41-12.06 15.077-12.06h3.387l-5.378 10.85-5.377 10.85 9.412 9.873c5.7 5.978 9.413 11.027 9.413 12.798 0 1.61-.24 2.927-.536 2.927-.294 0-4.174-2.158-8.62-4.794-4.448-2.636-8.06-4.358-8.028-3.825.031.532.55 3.641 1.153 6.91 1.233 6.684 1.247 6.663-5.418 7.975-3.942.775-5.09.474-6.137-1.613m37.602-14.74c.573-1.72 1.09-6.572 1.15-10.78l.108-7.651-5.305-1.205c-13.561-3.08-15.987-6.1-11.296-14.06 5.709-9.689 13.438-13.849 20.472-11.018 2.952 1.188 2.618 4.72-.447 4.72-2.914 0-8.066 7.863-8.066 12.31 0 2.08 1.065 3.179 3.647 3.758 9.508 2.133 9.981 2.741 9.342 12.01-.492 7.133-1.174 9.04-4.21 11.779-4.643 4.19-6.76 4.244-5.395.138m24.198-11.824c-2.671-3.238-16.971-34.543-16.971-37.153 0-1.919 3.8-4.931 6.212-4.925 2.73.007 16.018 25.946 17.173 33.522.743 4.874-1.111 10.99-3.331 10.99-.591 0-1.978-1.095-3.083-2.434m14.426-7.038c-2.73-3.164-12.82-33.08-12.825-38.024-.003-3.344 2.048-5.366 5.444-5.366.688 0 3.226 4.539 5.64 10.086 12.351 28.384 11.803 27.38 14.212 26.028 1.545-.867 2.744-.685 3.736.569 1.835 2.32-1.225 5.362-7.68 7.636-5.831 2.054-5.966 2.04-8.527-.93m19.382-13.133c-7.945-8.574-14.818-20.125-13.979-23.493.385-1.542 2.205-3.404 4.044-4.138 2.953-1.177 3.826-.72 7.446 3.897l4.1 5.231.663-11.08c.708-11.832 1.635-13.077 8.395-11.286 2.801.742 2.879 1.352 2.879 22.584 0 20.53-.157 21.885-2.653 22.911-4.443 1.827-5.222 1.496-10.895-4.626m29.094-10.433c-5.288-7.058-7.452-11.757-10.904-23.68-2.427-8.385-2.634-10.488-1.21-12.29 1.815-2.292 18.75-11.676 21.072-11.676 3.34 0 .809 3.028-5.204 6.224l-6.564 3.488 2.058 7.316c1.131 4.024 2.199 7.477 2.371 7.673s3.042-1.165 6.376-3.024c5.518-3.077 7.628-3.309 7.628-.837 0 .495-2.664 2.994-5.92 5.553l-5.92 4.652 2.273 4.06c4.122 7.366 5.033 7.492 12.92 1.794 3.992-2.883 7.258-5.466 7.258-5.74s-.881-2.858-1.958-5.743c-2.83-7.582-4.345-19.877-3.08-24.995 2.219-8.983 10.753-12.342 20.502-8.07 4.546 1.993 4.73 2.334 3.937 7.304-.457 2.868-1.178 6.534-1.601 8.148-.67 2.555-.058 3.054 4.732 3.857 6.469 1.085 11.952 6.2 11.952 11.148 0 5.168-2.678 5.979-5.643 1.71-1.425-2.051-4.399-4.71-6.61-5.91-3.756-2.037-4.245-1.997-7.488.611-1.908 1.535-3.243 3.629-2.967 4.654.277 1.024.8 4.827 1.162 8.45.596 5.961.359 6.709-2.492 7.85-2.43.973-3.802.636-5.993-1.473-1.563-1.504-3.055-2.183-3.316-1.51-.928 2.398-18.816 15.672-21.119 15.672-1.289 0-4.102-2.347-6.252-5.216m36.223-45.126c.53-3.287.335-6.159-.475-7.008-1.366-1.433-2.004 1.03-3.288 12.702-.454 4.122-.302 4.42 1.172 2.306.932-1.337 2.098-4.936 2.591-8",style:{display:"inline",fill:"#000","fill-opacity":".600917","stroke-width":"1.35834"},transform:"matrix(1.43639 .63307 -.61952 1.40565 104.251 -703.335)"}),p("path",{d:"M140.023 484.133c-1.567-.608-3.834-2.682-5.038-4.61-2.039-3.263-2.032-4.007.103-10.855 2.897-9.297 4.858-13.333 8.805-18.126 2.741-3.327 3.67-3.659 7.235-2.587 10.133 3.048 14.54 9.177 13.341 18.552-.602 4.708-.183 5.912 3.133 9.011 4.874 4.555 3.785 6.536-2.16 3.93-4.225-1.85-4.967-1.782-9.237.86-5.932 3.672-12.548 5.235-16.182 3.825m12.165-5.608 3.59-2.961-4.737-4.096c-5.847-5.054-6.376-8.76-1.09-7.641 2.006.424 4.692 1.195 5.969 1.713 4.62 1.875 1.553-8.396-4.113-13.775-2.68-2.544-2.794-2.51-6.724 2.002-7.053 8.1-6.926 23.397.198 23.656 1.657.06 2.263.427 1.346.815-1.712.724-1.01 3.249.903 3.249.588 0 2.684-1.333 4.658-2.962m19.956-14.358c-3.78-4.204-12.577-23.114-12.577-27.036 0-1.85 9.176-3.665 10.48-2.073.547.67 1.751 3.749 2.675 6.843 2.603 8.723 8.528 20.63 10.59 21.284 2.463.782 1.412-6.071-3.322-21.664-2.036-6.707-3.044-12.171-2.368-12.834.647-.636 3.092-.842 5.432-.46 4.803.786 5.562 2.462 8.922 19.692 1.499 7.684 1.634 10.994.54 13.215-2.977 6.05-5.43 7.833-10.782 7.833-4.295 0-6.076-.891-9.59-4.8m23.886-24.544c-4.736-10.018-8.61-19.083-8.61-20.144 0-1.062 1.575-2.345 3.499-2.852 4.338-1.142 6.364 1.346 13.782 16.927 6.675 14.02 7.461 24.284 1.861 24.284-1.144 0-5.413-7.383-10.532-18.215m21.82 8.692c-2.258-1.918-3.19-4.47-3.683-10.086-1.374-15.658-.86-24.065 1.755-28.693 3.73-6.603 14.366-9.748 17.893-5.291 2.322 2.935-3.734 5.869-7.616 3.69-2.292-1.287-2.884-.961-4.154 2.29-.815 2.086-1.627 8.904-1.805 15.151-.277 9.69.085 11.94 2.461 15.303 3.892 5.51 7.752 5.665 14.498.584 6.543-4.929 10.28-5.785 6.592-1.511-2.85 3.303-17.354 11.13-20.625 11.13-1.261 0-3.654-1.155-5.316-2.567m29.3-19.975c-7.07-16.514-9.128-24.042-7.293-26.673 1.806-2.592 4.753-2.926 6.806-.773 1.001 1.05 2.418-.314 4.853-4.672 3.9-6.981 9.24-11.253 14.264-11.41l3.422-.108-4.337 7.701c-7.115 12.634-7.073 13.996.65 20.777 6.436 5.651 12.096 13.43 12.096 16.623 0 .852-3.91-.705-8.688-3.46l-8.688-5.009.879 6.944c.945 7.477.7 7.89-5.514 9.286-4.037.907-4.18.752-8.45-9.226m39.746-4.654c0-.42.927-2.645 2.06-4.943 1.456-2.954 1.803-5.977 1.182-10.318-.925-6.473-1.16-6.657-10.537-8.322-9.626-1.708-11.047-5.914-5.061-14.973 4.597-6.958 9.718-9.752 15.708-8.574 5.204 1.024 6.383 4.77 1.503 4.77-2.041 0-3.632 1.217-4.648 3.556-.85 1.956-1.99 3.268-2.534 2.916-1.357-.88-1.258 6.926.106 8.357.603.632 3.587 1.78 6.632 2.55 4.748 1.202 5.599 1.977 5.976 5.447.719 6.61-1.069 13.434-4.447 16.977-2.927 3.07-5.94 4.367-5.94 2.557m16.567-31.36c-4.735-10.019-8.61-19.084-8.61-20.146 0-1.061 1.575-2.344 3.5-2.85 4.338-1.143 6.363 1.345 13.781 16.926 6.675 14.02 7.462 24.284 1.861 24.284-1.143 0-5.412-7.383-10.532-18.215m21.452 7.433c-2.708-5.637-10.349-29.474-10.894-33.987-.33-2.734.276-4.315 2.031-5.3 3.537-1.985 3.383-2.116 6.534 5.565 9.993 24.366 13.094 30.148 16.1 30.022 4.908-.207 4.553 3.214-.567 5.458-7.264 3.183-11.073 2.676-13.204-1.758m21.208-10.554c-10.82-11.469-15.525-21.196-12.389-25.616 2.16-3.042 5.816-1.887 10.057 3.179l4.116 4.917v-9.672c0-11.708.752-14.08 4.453-14.052 5.681.042 6.023 1.268 6.266 22.469.129 11.176-.133 20.941-.58 21.7s-2.073 1.726-3.613 2.148c-2.074.57-4.227-.745-8.31-5.073m27.89-11.704c-5.978-9.082-13.192-29.422-11.858-33.436.787-2.37 18.557-11.704 21.242-11.159 1.168.237-.943 1.92-4.758 3.794-3.772 1.853-6.858 4.089-6.858 4.97 0 2.697 4.173 14.62 5.099 14.567.478-.027 2.362-.944 4.185-2.038 1.824-1.093 4.784-2.01 6.579-2.037 2.834-.043 2.444.544-2.971 4.472-3.429 2.486-6.24 5.158-6.247 5.937s1.522 3.785 3.398 6.681l3.411 5.265 4.215-2.964c2.319-1.63 5.886-4.01 7.927-5.29 2.665-1.67 3.52-3.11 3.03-5.108-5.395-22.04-5.755-27.471-2.22-33.55 3.01-5.18 7.676-6.692 14.606-4.735 7.18 2.027 8.559 4.19 6.831 10.715-2.066 7.806-1.949 8.065 4.472 9.866 6.642 1.863 11.35 6.334 11.35 10.779 0 4.995-1.545 5.03-6.078.134-5.49-5.928-10.084-7.232-14.585-4.139-2.566 1.764-3.186 3.06-2.508 5.245.494 1.597 1.202 4.946 1.571 7.443 1.1 7.428-4.005 11.241-8.868 6.625-1.932-1.833-2.85-1.453-8.67 3.592-12.852 11.138-17.27 12.004-22.295 4.37m35.636-37.168c2.177-5.464 2.535-12.7.688-13.897-1.847-1.196-2.455.565-3.481 10.075-1.045 9.686-.073 11.016 2.793 3.822",style:{display:"inline",fill:"#000200","stroke-width":"1.35834"},transform:"matrix(1.43639 .63307 -.61952 1.40565 104.251 -703.335)"})],-1)]))}const Cve={render:Rve},kve={xmlns:"http://www.w3.org/2000/svg","xml:space":"preserve",width:"512",height:"130"};function Pve(t,e){return Z(),re("svg",kve,e[0]||(e[0]=[_o('DEVELOP',2)]))}const Ive={render:Pve},Ove=nt({name:"app",components:{LogoClean:MR,LogoText:Cve,LogoTextDevelop:Ive,RouterLink:hA,RouterView:pA,AlertPortal:yD,ModalPortal:SD},setup(){const t=Ro();return{info:rn(),profile:Dt(),state:ps(),serial:Lc(),root:Xt(),Features:ln(()=>t.Features)}},data(){return{darkMode:!0,branch:"develop",showMenuItem:!1}},watch:{darkMode(t,e){t!=e&&document.firstElementChild&&(t?document.firstElementChild.className="theme-dark":document.firstElementChild.className="theme-light")}},computed:{date(){return new Date(this.profile.meta.datetime*1e3)},connectButtonText(){return this.serial.is_connecting?"Connecting...":this.serial.is_connected?"Disconnect":"Connect"},canConnect(){return!this.serial.is_connecting},updateProcessing(){return ra.updatePreparing()||ra.updatePending()},hasBrowserSupport(){return ml.websocketUrl()?!0:navigator.usb&&Ol},logDownloadAnchorRef(){return this.$refs.logDownloadAnchor}},methods:{getDarkMode(){return localStorage.getItem("dark-mode")?localStorage.getItem("dark-mode")=="true":!window.matchMedia("(prefers-color-scheme: light)").matches},setDarkMode(t){localStorage.setItem("dark-mode",t?"true":"false"),this.darkMode=t},selectSerial(t,e){this.$modal.show(Cw,{title:"Serial",options:e.map(n=>({text:n.displayName+" "+n.portName,value:n.portId}))}).then(n=>{var s;return(s=window.electron)==null?void 0:s.ipcRenderer.send("serial",n)})},selectUSBDevice(t,e){this.$modal.show(Cw,{title:"USB Device",options:e.map(n=>({text:n.productName,value:n.deviceId}))}).then(n=>{var s;return(s=window.electron)==null?void 0:s.ipcRenderer.send("usb-device",n)})},downloadLog(){const t=at.history.join(` +`),e="data:text/plain;charset=utf-8,"+encodeURIComponent(t),n=`Log_${new Date().toISOString()}.txt`;this.logDownloadAnchorRef.setAttribute("href",e),this.logDownloadAnchorRef.setAttribute("download",n),this.logDownloadAnchorRef.click()}},created(){var t,e;this.darkMode=this.getDarkMode(),ra.updatePending()&&ra.finishUpdate(),(t=window.electron)==null||t.ipcRenderer.on("select-serial",this.selectSerial),(e=window.electron)==null||e.ipcRenderer.on("select-usb-device",this.selectUSBDevice)},unmounted(){var t,e;clearInterval(this.interval),(t=window.electron)==null||t.ipcRenderer.removeAllListeners("select-serial"),(e=window.electron)==null||e.ipcRenderer.removeAllListeners("select-usb-device")}}),Lve={key:0,class:"modal is-active","z-index":"9999"},Dve={class:"modal-content"},Nve={class:"text-center"},Uve={class:"m-1"},Fve={key:1,class:"modal is-active","z-index":"9999"},$ve={class:"navbar is-fixed-top is-primary",role:"navigation","aria-label":"main navigation"},Bve={class:"navbar-brand"},Hve={class:"navbar-end"},Gve={class:"navbar-item"},zve={class:"buttons"},Vve={class:"router-outlet-container"},Wve={class:"container"},jve={key:2,class:"navbar is-fixed-bottom has-shadow"},qve={class:"navbar-brand is-hidden-touch"},Xve={class:"navbar-item is-size-4"},Kve={class:"navbar-start is-hidden-touch"},Yve={class:"navbar-item"},Zve={class:"navbar-item",style:{"font-size":"70%"}},Jve={class:"navbar-item",style:{"font-size":"60%"}},Qve={ref:"logDownloadAnchor",style:{display:"none"}},eye={class:"navbar-end"},tye={class:"navbar-item"},nye={class:"notification is-warning"},sye={class:"notification is-warning"},iye={class:"navbar-item pt-0"},rye={class:"buttons"},oye={class:"ml-3 mb-3 is-hidden-desktop",style:{"max-width":"40%"}},aye={class:"is-size-5"},lye={class:"is-size-7"};function cye(t,e,n,s,i,r){const o=Ie("font-awesome-icon"),a=Ie("LogoTextDevelop"),l=Ie("LogoText"),c=Ie("router-link"),u=Ie("spinner-btn"),d=Ie("AlertPortal"),f=Ie("ModalPortal"),h=Ie("router-view");return Z(),re(it,null,[t.updateProcessing?(Z(),re("div",Lve,[e[7]||(e[7]=p("div",{class:"modal-background"},null,-1)),p("div",Dve,[p("div",Nve,[p("h1",Uve,[X(o,{icon:"fa-solid fa-spinner",size:"lg","spin-pulse":""}),e[6]||(e[6]=ye(" Updating... "))])])])])):He("",!0),t.hasBrowserSupport?He("",!0):(Z(),re("div",Fve,e[8]||(e[8]=[p("div",{class:"modal-background"},null,-1),p("div",{class:"modal-content"},[p("div",{class:"notification is-danger"},[p("h1",{class:"is-size-3"},"Unsuported Browser!"),ye(" Your Browser does not support the APIs necessary to use this application. Please use Chrome, Chromium or Edge! ")])],-1)]))),p("nav",$ve,[p("div",Bve,[X(c,{class:"navbar-item py-1",to:"/"},{default:tt(()=>[t.branch=="develop"?(Z(),Bt(a,{key:0,viewBox:"0 0 512 130",class:"text"})):(Z(),Bt(l,{key:1,viewBox:"0 0 512 82",class:"text"}))]),_:1}),p("a",{role:"button",class:"navbar-burger","aria-label":"menu","aria-expanded":"false","data-target":"mainMavbar",onClick:e[0]||(e[0]=v=>t.showMenuItem=!t.showMenuItem)},e[9]||(e[9]=[p("span",{"aria-hidden":"true"},null,-1),p("span",{"aria-hidden":"true"},null,-1),p("span",{"aria-hidden":"true"},null,-1)]))]),p("div",{id:"mainMavbar",class:ds(["navbar-menu",{"is-active":t.showMenuItem}])},[t.serial.is_connected?(Z(),re("div",{key:0,class:"navbar-start",onClick:e[1]||(e[1]=v=>t.showMenuItem=!1)},[X(c,{"active-class":"is-active",class:"navbar-item",to:"/templates"},{default:tt(()=>e[10]||(e[10]=[ye(" Templates ")])),_:1}),X(c,{"active-class":"is-active",class:"navbar-item",to:"/profile"},{default:tt(()=>e[11]||(e[11]=[ye(" Profile ")])),_:1}),X(c,{"active-class":"is-active",class:"navbar-item",to:"/setup"},{default:tt(()=>e[12]||(e[12]=[ye(" Setup ")])),_:1}),X(c,{"active-class":"is-active",class:"navbar-item",to:"/rates"},{default:tt(()=>e[13]||(e[13]=[ye(" Rates ")])),_:1}),X(c,{"active-class":"is-active",class:"navbar-item",to:"/receiver"},{default:tt(()=>e[14]||(e[14]=[ye(" Receiver ")])),_:1}),t.info.has_feature(t.Features.OSD)?(Z(),Bt(c,{key:0,"active-class":"is-active",class:"navbar-item",to:"/osd"},{default:tt(()=>e[15]||(e[15]=[ye(" OSD ")])),_:1})):He("",!0),X(c,{"active-class":"is-active",class:"navbar-item",to:"/motor"},{default:tt(()=>e[16]||(e[16]=[ye(" Motor ")])),_:1}),t.info.has_feature(t.Features.BLACKBOX)&&t.info.quic_protocol_version>1?(Z(),Bt(c,{key:1,"active-class":"is-active",class:"navbar-item",to:"/blackbox"},{default:tt(()=>e[17]||(e[17]=[ye(" Blackbox ")])),_:1})):He("",!0),X(c,{"active-class":"is-active",class:"navbar-item",to:"/state"},{default:tt(()=>e[18]||(e[18]=[ye(" State ")])),_:1}),t.info.has_feature(t.Features.DEBUG)&&t.info.quic_protocol_version>1?(Z(),Bt(c,{key:2,"active-class":"is-active",class:"navbar-item",to:"/perf"},{default:tt(()=>e[19]||(e[19]=[ye(" Perf ")])),_:1})):He("",!0)])):He("",!0),p("div",Hve,[p("div",Gve,[p("div",zve,[p("button",{class:"button is-primary",onClick:e[2]||(e[2]=v=>t.setDarkMode(!t.darkMode))},[t.darkMode?(Z(),Bt(o,{key:1,icon:"fa-solid fa-cloud-sun",size:"lg","fixed-width":""})):(Z(),Bt(o,{key:0,icon:"fa-solid fa-cloud-moon",size:"lg","fixed-width":""}))]),X(u,{class:"is-primary ml-auto",onClick:t.serial.toggle_connection,disabled:!t.canConnect},{default:tt(()=>[ye($e(t.connectButtonText),1)]),_:1},8,["onClick","disabled"])])])])],2)]),X(d),X(f),p("div",Vve,[p("div",Wve,[X(h)])]),t.serial.is_connected?(Z(),re("div",jve,[p("div",qve,[p("span",Xve,$e(t.profile.meta.name),1)]),p("div",Kve,[p("span",Yve,"Modified "+$e(t.profile.modified),1),p("span",Zve," Looptime "+$e(t.state.looptime_autodetect)+" CPU Load "+$e(t.state.cpu_load),1),p("span",Jve," CPU Temp "+$e(t.state.cpu_temp.toFixed(2))+"°C ",1),p("button",{class:"navbar-item is-small",onClick:e[3]||(e[3]=v=>t.downloadLog())},[X(o,{icon:"fa-solid fa-file-export",size:"sm","fixed-width":""}),p("a",Qve,null,512)])]),p("div",eye,[p("span",tye,[We(p("div",nye,[X(o,{icon:"fa-solid fa-triangle-exclamation"}),e[20]||(e[20]=ye(" Unsaved changes "))],512),[[zh,t.root.needs_apply]]),We(p("div",sye,[X(o,{icon:"fa-solid fa-triangle-exclamation"}),e[21]||(e[21]=ye(" Reboot required "))],512),[[zh,!t.root.needs_apply&&t.root.needs_reboot]])]),p("div",iye,[p("div",rye,[X(u,{class:"is-warning mx-2",onClick:e[4]||(e[4]=v=>t.serial.soft_reboot())},{default:tt(()=>e[22]||(e[22]=[ye(" Reboot ")])),_:1}),p("div",oye,[p("div",aye,$e(t.profile.meta.name),1),p("div",lye,"Modified "+$e(t.profile.modified),1)]),X(u,{class:"is-primary ml-auto",onClick:e[5]||(e[5]=v=>t.profile.apply_profile(t.profile.$state)),disabled:t.info.is_read_only},{default:tt(()=>e[23]||(e[23]=[ye(" Apply ")])),_:1},8,["disabled"])])])])])):He("",!0)],64)}const uye=lt(Ove,[["render",cye],["__scopeId","data-v-160629d4"]]),mC=qI(),dye=["profile"];mC.use(({store:t})=>{dye.includes(t.$id)&&t.$subscribe(e=>{if(e.type!="direct")return;Xt().set_needs_apply()})});const fye=nt({inheritAttrs:!1,data(){return{loading:!1}},computed:{filteredAttrs(){const t=/^on[^a-z]/,e={},{$attrs:n}=this;for(const s in n)t.test(s)||(e[s]=n[s]);return e}},methods:{clickHandler(t){const e=this.$attrs.onClick;this.loading=!0,Promise.resolve().then(()=>e?e(t):null).finally(()=>this.loading=!1)}}});function hye(t,e,n,s,i,r){return Z(),re("button",Np({class:["button",{"is-loading":t.loading}]},t.filteredAttrs,{onClick:e[0]||(e[0]=(...o)=>t.clickHandler&&t.clickHandler(...o))}),[v3(t.$slots,"default")],16)}const pye=lt(fye,[["render",hye]]),mye={text:"Use this section to change motor positions, useful when using an fc in non standard configuration"},gye={text:"Connect a lipo to access esc settings. Change direction of rotation. Not all esc are supported, Blheli-32 does not work"},_ye={text:"Can be used to flash serial receivers via passthrough, set correct uart and Start"},vye={"channel.aux_arming":{text:"Arm the craft, default is to also activate Idle-up"},"channel.aux_blackbox":{text:"Start/stop blackbox recording"},"channel.aux_buzzer_enable":{disabled:!0},"channel.aux_fpv_switch":{text:"Vtx Pit mode on a switch. If you are not using this leave as ON"},"channel.aux_horizon":{text:"Self levelling up to a specific angle then Acro on both Roll and Pitch, requires Level mode active"},"channel.aux_idle_up":{text:"Ensures props never stop spinning, similar to airmode, default is to use the same channel as ARM"},"channel.aux_levelmode":{text:"Accelerometer data is used to self level, needed for Racemode and Horizon"},"channel.aux_motor_test":{text:"Activate the motor test function, useful to check individual motors in the field"},"channel.aux_prearm":{text:"Allows for a separate AUX channel to be set as a safety for arming, the set AUX should be ON before the ARM switch is activated. If not used leave this as ON"},"channel.aux_racemode":{text:"Uses self levelling only on the roll axis, acro on pitch, requires Level mode active"},"channel.aux_rate_profile":{disabled:!0},"channel.aux_rssi":{text:"For fcs that can send rssi on a channel"},"channel.aux_stick_boost_profile":{disabled:!0},"channel.aux_turtle":{text:"Set this to ON and the fc will detect when landed inverted and activate Turtle when ARM is active, optional to set to an Aux switch",link:"https://docs.bosshobby.com/Features/#turtle-mode"},"filter.dterm_1_freq":{disabled:!0},"filter.dterm_1_type":{disabled:!0},"filter.dterm_2_freq":{disabled:!0},"filter.dterm_2_type":{disabled:!0},"filter.dterm_dynamic_enable":{text:"Enable a dynamic D-term filtercut, you almost always want to leave this ON",link:"https://docs.bosshobby.com/Features/#dynamic-d-term"},"filter.dterm_dynamic_max":{disabled:!0},"filter.dterm_dynamic_min":{disabled:!0},"filter.gyro_1_freq":{disabled:!0},"filter.gyro_1_type":{disabled:!0},"filter.gyro_2_freq":{disabled:!0},"filter.gyro_2_type":{disabled:!0},"filter.settings":{text:"The default filter setting are designed to be safe, before making adjustments refer to the wiki",link:"https://docs.bosshobby.com/Features/#filters"},"flash.file-branch":{text:"Development branch to flash a hex from"},"flash.file-pull-request":{text:"Pull request to flash a hex from"},"flash.file-local":{text:"Choose a self built hex"},"flash.file-release":{text:"The default selection is the latest `stable` release, dev versions are available as testers"},"flash.file-commit":{text:"The latest commit hash on the selected branch"},"flash.file-remote":{text:"Targets are named `board_name.motor_type` choose serial if your rx is separate and attatched to a uart. If you don't see your fc listed exactly then don't flash, please ask for a target in our Discord server",link:"https://discord.gg/qzyvewaCnP"},"flash.reset":{text:"Pressing the `Reset To Bootloader` button should force the fc into DFU mode for flashing, if it doesn't work use the button on the fc while connecting USB"},"flash.source":{text:"If you compile your own hex select `local` and choose it in the next box"},"motor.digital_idle":{text:"Adjust in small ammounts if needed to achieve smooth idle"},"motor.dshot_time":{text:"On some fcs this might need set to 300 to avoid failloops, Default 600"},"motor.flip_gyro":{disabled:!0},"motor.gyro_orientation":{text:"Change this if the fc is mounted in a non standard way, use with the flip-gyro option until the preview model moves correctly"},"motor.invert_yaw":{text:"Default is props out"},"motor.motor_limit":{text:"Set a cap on the maximum throttle"},"motor.test":{text:"Connect a lipo, PROPS OFF, use sliders to confirm motor operation and direction"},"motor.throttle_boost":{text:"Experimental, use with caution, can rob motors of power if set too high"},"motor.torque_boost":{text:"A very experimental feature for more advanced use",link:"https://docs.bosshobby.com/Features/#torque-boost"},"motor.turtle_throttle_percent":{text:"For whoops set to 100% larger craft start at 10% and increase by 10 to suit needs",link:"https://docs.bosshobby.com/Features/#turtle-mode"},motor_pins:mye,motor_settings:gye,"osd.elements":{text:"Select and position OSD elements, callsign must use upper case",link:"https://docs.bosshobby.com/Features/#osd"},"osd.font":{text:"A choice of fonts are available, select and upload. You can also upload your own custom boot logo as long as it a 288x72 Black/White/Transparent PNG"},"pid.angle_strength":{text:"Angle Strength adjusts how your craft responds to external forces from bumps to stick inputs",link:"https://docs.bosshobby.com/Features/#angle-strength"},"pid.preset":{text:"Select by thrust to weight ratio or props size, these presets give a safe starting point to further tune if needed"},"pid.profile":{text:"You can have 2 different sets of pids loaded in 2 profiles"},"pid.stick_profile":{text:"Allows for adjustment to stick feel",link:"https://docs.bosshobby.com/Features/#stick-boost"},"pid.tda_active":{text:"As higher throttle levels are reached D-term gain is reduced allowing the D-term notch filter to work safely",link:"https://docs.bosshobby.com/Features/#throttle-d-term-attenuation-tda"},"pid.tda_breakpoint":{text:"Throttle percentage before TDA starts to act"},"pid.tda_percent":{text:"Percentage reduction of D-term at max throttle"},"rate.level_max_angle":{text:"Increase to give a higher velocity for racing, combined with high camera angle, to a max of 90"},"rate.low_rate_mulitplier":{disabled:!0},"rate.mode":{text:"Silverware, Betaflight and Actual rates option"},"rate.profile":{text:"2 slots available for different profiles"},"rate.sticks_deadband":{text:"If your radio has `jitter` on Pitch/Roll stick center raising this a little can help"},"rate.throttle_expo":{text:"Adding some expo will soften the stick feel around the set `Throttle Mid`"},"rate.throttle_mid":{text:"Can be set to about where your `hover point` is, maximum throttle value will be affected if set below 0.5"},"receiver.bind_saved":{text:"Once you have bind and issued stick gesture up,up,up followed by down,down,down on Pitch this will show YES"},"receiver.channel_mapping":{text:"Quicksilver default is AETR the other option is TAER"},"receiver.lqi_source":{text:"Select the source for your rssi/lqi OSD display. Direct is best for ELRS, others can use Packet-Rate"},"receiver.protocol":{text:"Serial or spi connected rx will be detected automatically here"},"serial.digital_vtx":{text:"MSP serial port for digital systems like HDZero, DJI WTF and Walksnail. HDZero requires TX and RX connected to use msp, define the UART here"},"serial.rx":{text:"Enter the UART number the serial RX is connected to (for spi RX leave as NONE)"},"serial.smart_audio":{text:"Enter the UART the VTX TX line is connected to"},serial_passthrough:_ye,"voltage.actual_battery_voltage":{text:"Default is 4.2V, set to whatever value you get from a multimeter or lipo tester for a full lipo."},"voltage.vbat_scale":{text:"Use the value provided by the FC manufacturer"},"voltage.ibat_scale":{text:"Use the value provided by the FC manufacturer"},"voltage.lipo_cell_count":{text:"Enter the number of cells, leave at 0 to use autodetect"},"voltage.pid_voltage_compensation":{text:"Adjusts the pids to compensate for lipo voltage drop, default ON"},"voltage.reported_telemetry_voltage":{text:"Set to the value received by your tx or in the OSD view with a full lipo"},"voltage.vbattlow":{text:"Set the desired voltage to trigger a warning, single cell voltage is used Default 3.3V (uses Fuel gauge volts by default)",link:"https://docs.bosshobby.com/Features/#voltage"},"voltage.use_filtered_voltage_for_warnings":{text:"Use filtered voltage instead Fuel gauge volts for Warnings"}},yye={updated(t,{value:e,oldValue:n},{transition:s}){e!==n&&(e?(s.beforeEnter(t),t.style.visibility="visible",s.enter(t)):s.leave(t,()=>{t.style.visibility="hidden"}))}},bye=nt({props:{text:String,entry:String,size:String},directives:{visible:yye},setup(){return{}},data(){return{placmentClass:{},visbleClick:!1,visbleHover:!1}},computed:{tooltip(){return this.text?{text:this.text}:vye[this.entry]},danger(){return!this.tooltip||!this.tooltip.text},visible(){return this.visbleClick||this.visbleHover},active(){return(this.text||this.entry)&&(!this.tooltip||!this.tooltip.disabled)}},methods:{onClick(){this.$slots.default||(this.visbleClick=!this.visbleClick)}},mounted(){if(!this.$refs.tooltipContainer||!this.$refs.tooltipContent)return;const{offsetTop:t,offsetLeft:e}=this.$refs.tooltipContainer,{clientHeight:n,clientWidth:s}=this.$refs.tooltipContent,i=t>=n,r=window.innerWidth-et.visbleHover=!0),onMouseleave:e[1]||(e[1]=l=>t.visbleHover=!1),onClick:e[2]||(e[2]=(...l)=>t.onClick&&t.onClick(...l))},[v3(t.$slots,"default",{},()=>[p("span",{class:ds(["tooltip-icon",{"has-text-danger":t.danger,"has-text-grey-light":!t.danger}]),id:"tooltip-"+t.entry},[X(o,{icon:"fa-solid fa-circle-question",size:t.size,"fixed-width":""},null,8,["size"])],10,wye)]),X(oP,{name:"tooltip"},{default:tt(()=>[We((Z(),re("span",xye,[t.danger?(Z(),re("span",Aye," Missing tooltip entry "+$e(t.entry),1)):(Z(),re("span",Eye,[ye($e(t.tooltip.text)+" ",1),t.tooltip.link?(Z(),re("div",Sye,[p("a",{target:"_blank",href:t.tooltip.link},"read more",8,Tye)])):He("",!0)]))])),[[a,t.visible]])]),_:1})],34)):He("",!0)}const Rye=lt(bye,[["render",Mye]]),Cye=nt({props:["modelValue","options"],emits:["update:modelValue"],computed:{inputVal:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}},optionMap(){return(this.options||[]).map(t=>typeof t=="string"?{text:t,value:t}:t)}}}),kye={class:"select"},Pye=["value"];function Iye(t,e,n,s,i,r){return Z(),re("div",kye,[We(p("select",Np({"onUpdate:modelValue":e[0]||(e[0]=o=>t.inputVal=o)},t.$attrs),[(Z(!0),re(it,null,Ht(t.optionMap,o=>(Z(),re("option",{key:o.value,value:o.value},$e(o.text),9,Pye))),128))],16),[[Td,t.inputVal]])])}const Oye=lt(Cye,[["render",Iye]]);/*! + * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2024 Fonticons, Inc. + */function Lye(t,e,n){return(e=Nye(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function QS(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,s)}return n}function Ue(t){for(var e=1;e{};let Iy={},gC={},_C=null,vC={mark:eT,measure:eT};try{typeof window<"u"&&(Iy=window),typeof document<"u"&&(gC=document),typeof MutationObserver<"u"&&(_C=MutationObserver),typeof performance<"u"&&(vC=performance)}catch{}const{userAgent:tT=""}=Iy.navigator||{},Eo=Iy,jt=gC,nT=_C,Qf=vC;Eo.document;const kr=!!jt.documentElement&&!!jt.head&&typeof jt.addEventListener=="function"&&typeof jt.createElement=="function",yC=~tT.indexOf("MSIE")||~tT.indexOf("Trident/");var Uye=/fa(s|r|l|t|d|dr|dl|dt|b|k|kd|ss|sr|sl|st|sds|sdr|sdl|sdt)?[\-\ ]/,Fye=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,bC={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fab:"brands","fa-brands":"brands"},duotone:{fa:"solid",fad:"solid","fa-solid":"solid","fa-duotone":"solid",fadr:"regular","fa-regular":"regular",fadl:"light","fa-light":"light",fadt:"thin","fa-thin":"thin"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid",fasdr:"regular","fa-regular":"regular",fasdl:"light","fa-light":"light",fasdt:"thin","fa-thin":"thin"}},$ye={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},wC=["fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone"],zn="classic",bm="duotone",Bye="sharp",Hye="sharp-duotone",xC=[zn,bm,Bye,Hye],Gye={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},duotone:{900:"fad",400:"fadr",300:"fadl",100:"fadt"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds",400:"fasdr",300:"fasdl",100:"fasdt"}},zye={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad",400:"fadr",normal:"fadr",300:"fadl",100:"fadt"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds",400:"fasdr",normal:"fasdr",300:"fasdl",100:"fasdt"}},Vye=new Map([["classic",{defaultShortPrefixId:"fas",defaultStyleId:"solid",styleIds:["solid","regular","light","thin","brands"],futureStyleIds:[],defaultFontWeight:900}],["sharp",{defaultShortPrefixId:"fass",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["duotone",{defaultShortPrefixId:"fad",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["sharp-duotone",{defaultShortPrefixId:"fasds",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}]]),Wye={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",brands:"fab"},duotone:{solid:"fad",regular:"fadr",light:"fadl",thin:"fadt"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds",regular:"fasdr",light:"fasdl",thin:"fasdt"}},jye=["fak","fa-kit","fakd","fa-kit-duotone"],sT={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},qye=["kit"],Xye={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},Kye=["fak","fakd"],Yye={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},iT={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}},eh={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Zye=["fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone"],Jye=["fak","fa-kit","fakd","fa-kit-duotone"],Qye={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},ebe={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},duotone:{"fa-regular":"fadr","fa-light":"fadl","fa-thin":"fadt"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds","fa-regular":"fasdr","fa-light":"fasdl","fa-thin":"fasdt"}},tbe={classic:["fas","far","fal","fat","fad"],duotone:["fadr","fadl","fadt"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds","fasdr","fasdl","fasdt"]},v1={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},duotone:{fadr:"fa-regular",fadl:"fa-light",fadt:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid",fasdr:"fa-regular",fasdl:"fa-light",fasdt:"fa-thin"}},nbe=["fa-solid","fa-regular","fa-light","fa-thin","fa-duotone","fa-brands"],y1=["fa","fas","far","fal","fat","fad","fadr","fadl","fadt","fab","fass","fasr","fasl","fast","fasds","fasdr","fasdl","fasdt",...Zye,...nbe],sbe=["solid","regular","light","thin","duotone","brands"],EC=[1,2,3,4,5,6,7,8,9,10],ibe=EC.concat([11,12,13,14,15,16,17,18,19,20]),rbe=[...Object.keys(tbe),...sbe,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",eh.GROUP,eh.SWAP_OPACITY,eh.PRIMARY,eh.SECONDARY].concat(EC.map(t=>"".concat(t,"x"))).concat(ibe.map(t=>"w-".concat(t))),obe={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}};const Sr="___FONT_AWESOME___",b1=16,SC="fa",TC="svg-inline--fa",Ra="data-fa-i2svg",w1="data-fa-pseudo-element",abe="data-fa-pseudo-element-pending",Oy="data-prefix",Ly="data-icon",rT="fontawesome-i2svg",lbe="async",cbe=["HTML","HEAD","STYLE","SCRIPT"],AC=(()=>{try{return!0}catch{return!1}})();function Nd(t){return new Proxy(t,{get(e,n){return n in e?e[n]:e[zn]}})}const MC=Ue({},bC);MC[zn]=Ue(Ue(Ue(Ue({},{"fa-duotone":"duotone"}),bC[zn]),sT.kit),sT["kit-duotone"]);const ube=Nd(MC),x1=Ue({},Wye);x1[zn]=Ue(Ue(Ue(Ue({},{duotone:"fad"}),x1[zn]),iT.kit),iT["kit-duotone"]);const oT=Nd(x1),E1=Ue({},v1);E1[zn]=Ue(Ue({},E1[zn]),Yye.kit);const Dy=Nd(E1),S1=Ue({},ebe);S1[zn]=Ue(Ue({},S1[zn]),Xye.kit);Nd(S1);const dbe=Uye,RC="fa-layers-text",fbe=Fye,hbe=Ue({},Gye);Nd(hbe);const pbe=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],g_=$ye,mbe=[...qye,...rbe],Bu=Eo.FontAwesomeConfig||{};function gbe(t){var e=jt.querySelector("script["+t+"]");if(e)return e.getAttribute(t)}function _be(t){return t===""?!0:t==="false"?!1:t==="true"?!0:t}jt&&typeof jt.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(e=>{let[n,s]=e;const i=_be(gbe(n));i!=null&&(Bu[s]=i)});const CC={styleDefault:"solid",familyDefault:zn,cssPrefix:SC,replacementClass:TC,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};Bu.familyPrefix&&(Bu.cssPrefix=Bu.familyPrefix);const pc=Ue(Ue({},CC),Bu);pc.autoReplaceSvg||(pc.observeMutations=!1);const Ye={};Object.keys(CC).forEach(t=>{Object.defineProperty(Ye,t,{enumerable:!0,set:function(e){pc[t]=e,Hu.forEach(n=>n(Ye))},get:function(){return pc[t]}})});Object.defineProperty(Ye,"familyPrefix",{enumerable:!0,set:function(t){pc.cssPrefix=t,Hu.forEach(e=>e(Ye))},get:function(){return pc.cssPrefix}});Eo.FontAwesomeConfig=Ye;const Hu=[];function vbe(t){return Hu.push(t),()=>{Hu.splice(Hu.indexOf(t),1)}}const Vr=b1,Ti={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function ybe(t){if(!t||!kr)return;const e=jt.createElement("style");e.setAttribute("type","text/css"),e.innerHTML=t;const n=jt.head.childNodes;let s=null;for(let i=n.length-1;i>-1;i--){const r=n[i],o=(r.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(o)>-1&&(s=r)}return jt.head.insertBefore(e,s),t}const bbe="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function _d(){let t=12,e="";for(;t-- >0;)e+=bbe[Math.random()*62|0];return e}function Dc(t){const e=[];for(let n=(t||[]).length>>>0;n--;)e[n]=t[n];return e}function Ny(t){return t.classList?Dc(t.classList):(t.getAttribute("class")||"").split(" ").filter(e=>e)}function kC(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function wbe(t){return Object.keys(t||{}).reduce((e,n)=>e+"".concat(n,'="').concat(kC(t[n]),'" '),"").trim()}function wm(t){return Object.keys(t||{}).reduce((e,n)=>e+"".concat(n,": ").concat(t[n].trim(),";"),"")}function Uy(t){return t.size!==Ti.size||t.x!==Ti.x||t.y!==Ti.y||t.rotate!==Ti.rotate||t.flipX||t.flipY}function xbe(t){let{transform:e,containerWidth:n,iconWidth:s}=t;const i={transform:"translate(".concat(n/2," 256)")},r="translate(".concat(e.x*32,", ").concat(e.y*32,") "),o="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),a="rotate(".concat(e.rotate," 0 0)"),l={transform:"".concat(r," ").concat(o," ").concat(a)},c={transform:"translate(".concat(s/2*-1," -256)")};return{outer:i,inner:l,path:c}}function Ebe(t){let{transform:e,width:n=b1,height:s=b1,startCentered:i=!1}=t,r="";return i&&yC?r+="translate(".concat(e.x/Vr-n/2,"em, ").concat(e.y/Vr-s/2,"em) "):i?r+="translate(calc(-50% + ".concat(e.x/Vr,"em), calc(-50% + ").concat(e.y/Vr,"em)) "):r+="translate(".concat(e.x/Vr,"em, ").concat(e.y/Vr,"em) "),r+="scale(".concat(e.size/Vr*(e.flipX?-1:1),", ").concat(e.size/Vr*(e.flipY?-1:1),") "),r+="rotate(".concat(e.rotate,"deg) "),r}var Sbe=`:root, :host { + --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free"; + --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free"; + --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro"; + --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro"; + --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone"; + --fa-font-duotone-regular: normal 400 1em/1 "Font Awesome 6 Duotone"; + --fa-font-duotone-light: normal 300 1em/1 "Font Awesome 6 Duotone"; + --fa-font-duotone-thin: normal 100 1em/1 "Font Awesome 6 Duotone"; + --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands"; + --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone"; + --fa-font-sharp-duotone-regular: normal 400 1em/1 "Font Awesome 6 Sharp Duotone"; + --fa-font-sharp-duotone-light: normal 300 1em/1 "Font Awesome 6 Sharp Duotone"; + --fa-font-sharp-duotone-thin: normal 100 1em/1 "Font Awesome 6 Sharp Duotone"; +} + +svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { + overflow: visible; + box-sizing: content-box; +} + +.svg-inline--fa { + display: var(--fa-display, inline-block); + height: 1em; + overflow: visible; + vertical-align: -0.125em; +} +.svg-inline--fa.fa-2xs { + vertical-align: 0.1em; +} +.svg-inline--fa.fa-xs { + vertical-align: 0em; +} +.svg-inline--fa.fa-sm { + vertical-align: -0.0714285705em; +} +.svg-inline--fa.fa-lg { + vertical-align: -0.2em; +} +.svg-inline--fa.fa-xl { + vertical-align: -0.25em; +} +.svg-inline--fa.fa-2xl { + vertical-align: -0.3125em; +} +.svg-inline--fa.fa-pull-left { + margin-right: var(--fa-pull-margin, 0.3em); + width: auto; +} +.svg-inline--fa.fa-pull-right { + margin-left: var(--fa-pull-margin, 0.3em); + width: auto; +} +.svg-inline--fa.fa-li { + width: var(--fa-li-width, 2em); + top: 0.25em; +} +.svg-inline--fa.fa-fw { + width: var(--fa-fw-width, 1.25em); +} + +.fa-layers svg.svg-inline--fa { + bottom: 0; + left: 0; + margin: auto; + position: absolute; + right: 0; + top: 0; +} + +.fa-layers-counter, .fa-layers-text { + display: inline-block; + position: absolute; + text-align: center; +} + +.fa-layers { + display: inline-block; + height: 1em; + position: relative; + text-align: center; + vertical-align: -0.125em; + width: 1em; +} +.fa-layers svg.svg-inline--fa { + transform-origin: center center; +} + +.fa-layers-text { + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + transform-origin: center center; +} + +.fa-layers-counter { + background-color: var(--fa-counter-background-color, #ff253a); + border-radius: var(--fa-counter-border-radius, 1em); + box-sizing: border-box; + color: var(--fa-inverse, #fff); + line-height: var(--fa-counter-line-height, 1); + max-width: var(--fa-counter-max-width, 5em); + min-width: var(--fa-counter-min-width, 1.5em); + overflow: hidden; + padding: var(--fa-counter-padding, 0.25em 0.5em); + right: var(--fa-right, 0); + text-overflow: ellipsis; + top: var(--fa-top, 0); + transform: scale(var(--fa-counter-scale, 0.25)); + transform-origin: top right; +} + +.fa-layers-bottom-right { + bottom: var(--fa-bottom, 0); + right: var(--fa-right, 0); + top: auto; + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: bottom right; +} + +.fa-layers-bottom-left { + bottom: var(--fa-bottom, 0); + left: var(--fa-left, 0); + right: auto; + top: auto; + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: bottom left; +} + +.fa-layers-top-right { + top: var(--fa-top, 0); + right: var(--fa-right, 0); + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: top right; +} + +.fa-layers-top-left { + left: var(--fa-left, 0); + right: auto; + top: var(--fa-top, 0); + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: top left; +} + +.fa-1x { + font-size: 1em; +} + +.fa-2x { + font-size: 2em; +} + +.fa-3x { + font-size: 3em; +} + +.fa-4x { + font-size: 4em; +} + +.fa-5x { + font-size: 5em; +} + +.fa-6x { + font-size: 6em; +} + +.fa-7x { + font-size: 7em; +} + +.fa-8x { + font-size: 8em; +} + +.fa-9x { + font-size: 9em; +} + +.fa-10x { + font-size: 10em; +} + +.fa-2xs { + font-size: 0.625em; + line-height: 0.1em; + vertical-align: 0.225em; +} + +.fa-xs { + font-size: 0.75em; + line-height: 0.0833333337em; + vertical-align: 0.125em; +} + +.fa-sm { + font-size: 0.875em; + line-height: 0.0714285718em; + vertical-align: 0.0535714295em; +} + +.fa-lg { + font-size: 1.25em; + line-height: 0.05em; + vertical-align: -0.075em; +} + +.fa-xl { + font-size: 1.5em; + line-height: 0.0416666682em; + vertical-align: -0.125em; +} + +.fa-2xl { + font-size: 2em; + line-height: 0.03125em; + vertical-align: -0.1875em; +} + +.fa-fw { + text-align: center; + width: 1.25em; +} + +.fa-ul { + list-style-type: none; + margin-left: var(--fa-li-margin, 2.5em); + padding-left: 0; +} +.fa-ul > li { + position: relative; +} + +.fa-li { + left: calc(-1 * var(--fa-li-width, 2em)); + position: absolute; + text-align: center; + width: var(--fa-li-width, 2em); + line-height: inherit; +} + +.fa-border { + border-color: var(--fa-border-color, #eee); + border-radius: var(--fa-border-radius, 0.1em); + border-style: var(--fa-border-style, solid); + border-width: var(--fa-border-width, 0.08em); + padding: var(--fa-border-padding, 0.2em 0.25em 0.15em); +} + +.fa-pull-left { + float: left; + margin-right: var(--fa-pull-margin, 0.3em); +} + +.fa-pull-right { + float: right; + margin-left: var(--fa-pull-margin, 0.3em); +} + +.fa-beat { + animation-name: fa-beat; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, ease-in-out); +} + +.fa-bounce { + animation-name: fa-bounce; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); +} + +.fa-fade { + animation-name: fa-fade; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); +} + +.fa-beat-fade { + animation-name: fa-beat-fade; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); +} + +.fa-flip { + animation-name: fa-flip; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, ease-in-out); +} + +.fa-shake { + animation-name: fa-shake; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, linear); +} + +.fa-spin { + animation-name: fa-spin; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 2s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, linear); +} + +.fa-spin-reverse { + --fa-animation-direction: reverse; +} + +.fa-pulse, +.fa-spin-pulse { + animation-name: fa-spin; + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, steps(8)); +} + +@media (prefers-reduced-motion: reduce) { + .fa-beat, +.fa-bounce, +.fa-fade, +.fa-beat-fade, +.fa-flip, +.fa-pulse, +.fa-shake, +.fa-spin, +.fa-spin-pulse { + animation-delay: -1ms; + animation-duration: 1ms; + animation-iteration-count: 1; + transition-delay: 0s; + transition-duration: 0s; + } +} +@keyframes fa-beat { + 0%, 90% { + transform: scale(1); + } + 45% { + transform: scale(var(--fa-beat-scale, 1.25)); + } +} +@keyframes fa-bounce { + 0% { + transform: scale(1, 1) translateY(0); + } + 10% { + transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + } + 30% { + transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + } + 50% { + transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + } + 57% { + transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + } + 64% { + transform: scale(1, 1) translateY(0); + } + 100% { + transform: scale(1, 1) translateY(0); + } +} +@keyframes fa-fade { + 50% { + opacity: var(--fa-fade-opacity, 0.4); + } +} +@keyframes fa-beat-fade { + 0%, 100% { + opacity: var(--fa-beat-fade-opacity, 0.4); + transform: scale(1); + } + 50% { + opacity: 1; + transform: scale(var(--fa-beat-fade-scale, 1.125)); + } +} +@keyframes fa-flip { + 50% { + transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + } +} +@keyframes fa-shake { + 0% { + transform: rotate(-15deg); + } + 4% { + transform: rotate(15deg); + } + 8%, 24% { + transform: rotate(-18deg); + } + 12%, 28% { + transform: rotate(18deg); + } + 16% { + transform: rotate(-22deg); + } + 20% { + transform: rotate(22deg); + } + 32% { + transform: rotate(-12deg); + } + 36% { + transform: rotate(12deg); + } + 40%, 100% { + transform: rotate(0deg); + } +} +@keyframes fa-spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} +.fa-rotate-90 { + transform: rotate(90deg); +} + +.fa-rotate-180 { + transform: rotate(180deg); +} + +.fa-rotate-270 { + transform: rotate(270deg); +} + +.fa-flip-horizontal { + transform: scale(-1, 1); +} + +.fa-flip-vertical { + transform: scale(1, -1); +} + +.fa-flip-both, +.fa-flip-horizontal.fa-flip-vertical { + transform: scale(-1, -1); +} + +.fa-rotate-by { + transform: rotate(var(--fa-rotate-angle, 0)); +} + +.fa-stack { + display: inline-block; + vertical-align: middle; + height: 2em; + position: relative; + width: 2.5em; +} + +.fa-stack-1x, +.fa-stack-2x { + bottom: 0; + left: 0; + margin: auto; + position: absolute; + right: 0; + top: 0; + z-index: var(--fa-stack-z-index, auto); +} + +.svg-inline--fa.fa-stack-1x { + height: 1em; + width: 1.25em; +} +.svg-inline--fa.fa-stack-2x { + height: 2em; + width: 2.5em; +} + +.fa-inverse { + color: var(--fa-inverse, #fff); +} + +.sr-only, +.fa-sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; +} + +.sr-only-focusable:not(:focus), +.fa-sr-only-focusable:not(:focus) { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; +} + +.svg-inline--fa .fa-primary { + fill: var(--fa-primary-color, currentColor); + opacity: var(--fa-primary-opacity, 1); +} + +.svg-inline--fa .fa-secondary { + fill: var(--fa-secondary-color, currentColor); + opacity: var(--fa-secondary-opacity, 0.4); +} + +.svg-inline--fa.fa-swap-opacity .fa-primary { + opacity: var(--fa-secondary-opacity, 0.4); +} + +.svg-inline--fa.fa-swap-opacity .fa-secondary { + opacity: var(--fa-primary-opacity, 1); +} + +.svg-inline--fa mask .fa-primary, +.svg-inline--fa mask .fa-secondary { + fill: black; +}`;function PC(){const t=SC,e=TC,n=Ye.cssPrefix,s=Ye.replacementClass;let i=Sbe;if(n!==t||s!==e){const r=new RegExp("\\.".concat(t,"\\-"),"g"),o=new RegExp("\\--".concat(t,"\\-"),"g"),a=new RegExp("\\.".concat(e),"g");i=i.replace(r,".".concat(n,"-")).replace(o,"--".concat(n,"-")).replace(a,".".concat(s))}return i}let aT=!1;function __(){Ye.autoAddCss&&!aT&&(ybe(PC()),aT=!0)}var Tbe={mixout(){return{dom:{css:PC,insertCss:__}}},hooks(){return{beforeDOMElementCreation(){__()},beforeI2svg(){__()}}}};const Tr=Eo||{};Tr[Sr]||(Tr[Sr]={});Tr[Sr].styles||(Tr[Sr].styles={});Tr[Sr].hooks||(Tr[Sr].hooks={});Tr[Sr].shims||(Tr[Sr].shims=[]);var Ai=Tr[Sr];const IC=[],OC=function(){jt.removeEventListener("DOMContentLoaded",OC),bp=1,IC.map(t=>t())};let bp=!1;kr&&(bp=(jt.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(jt.readyState),bp||jt.addEventListener("DOMContentLoaded",OC));function Abe(t){kr&&(bp?setTimeout(t,0):IC.push(t))}function Ud(t){const{tag:e,attributes:n={},children:s=[]}=t;return typeof t=="string"?kC(t):"<".concat(e," ").concat(wbe(n),">").concat(s.map(Ud).join(""),"")}function lT(t,e,n){if(t&&t[e]&&t[e][n])return{prefix:e,iconName:n,icon:t[e][n]}}var v_=function(e,n,s,i){var r=Object.keys(e),o=r.length,a=n,l,c,u;for(s===void 0?(l=1,u=e[r[0]]):(l=0,u=s);l=55296&&i<=56319&&n=55296&&s<=56319&&n>e+1&&(i=t.charCodeAt(e+1),i>=56320&&i<=57343)?(s-55296)*1024+i-56320+65536:s}function cT(t){return Object.keys(t).reduce((e,n)=>{const s=t[n];return!!s.icon?e[s.iconName]=s.icon:e[n]=s,e},{})}function A1(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{skipHooks:s=!1}=n,i=cT(e);typeof Ai.hooks.addPack=="function"&&!s?Ai.hooks.addPack(t,cT(e)):Ai.styles[t]=Ue(Ue({},Ai.styles[t]||{}),i),t==="fas"&&A1("fa",e)}const{styles:vd,shims:Cbe}=Ai,LC=Object.keys(Dy),kbe=LC.reduce((t,e)=>(t[e]=Object.keys(Dy[e]),t),{});let Fy=null,DC={},NC={},UC={},FC={},$C={};function Pbe(t){return~mbe.indexOf(t)}function Ibe(t,e){const n=e.split("-"),s=n[0],i=n.slice(1).join("-");return s===t&&i!==""&&!Pbe(i)?i:null}const BC=()=>{const t=s=>v_(vd,(i,r,o)=>(i[o]=v_(r,s,{}),i),{});DC=t((s,i,r)=>(i[3]&&(s[i[3]]=r),i[2]&&i[2].filter(a=>typeof a=="number").forEach(a=>{s[a.toString(16)]=r}),s)),NC=t((s,i,r)=>(s[r]=r,i[2]&&i[2].filter(a=>typeof a=="string").forEach(a=>{s[a]=r}),s)),$C=t((s,i,r)=>{const o=i[2];return s[r]=r,o.forEach(a=>{s[a]=r}),s});const e="far"in vd||Ye.autoFetchSvg,n=v_(Cbe,(s,i)=>{const r=i[0];let o=i[1];const a=i[2];return o==="far"&&!e&&(o="fas"),typeof r=="string"&&(s.names[r]={prefix:o,iconName:a}),typeof r=="number"&&(s.unicodes[r.toString(16)]={prefix:o,iconName:a}),s},{names:{},unicodes:{}});UC=n.names,FC=n.unicodes,Fy=xm(Ye.styleDefault,{family:Ye.familyDefault})};vbe(t=>{Fy=xm(t.styleDefault,{family:Ye.familyDefault})});BC();function $y(t,e){return(DC[t]||{})[e]}function Obe(t,e){return(NC[t]||{})[e]}function fa(t,e){return($C[t]||{})[e]}function HC(t){return UC[t]||{prefix:null,iconName:null}}function Lbe(t){const e=FC[t],n=$y("fas",t);return e||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function So(){return Fy}const GC=()=>({prefix:null,iconName:null,rest:[]});function Dbe(t){let e=zn;const n=LC.reduce((s,i)=>(s[i]="".concat(Ye.cssPrefix,"-").concat(i),s),{});return xC.forEach(s=>{(t.includes(n[s])||t.some(i=>kbe[s].includes(i)))&&(e=s)}),e}function xm(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{family:n=zn}=e,s=ube[n][t];if(n===bm&&!t)return"fad";const i=oT[n][t]||oT[n][s],r=t in Ai.styles?t:null;return i||r||null}function Nbe(t){let e=[],n=null;return t.forEach(s=>{const i=Ibe(Ye.cssPrefix,s);i?n=i:s&&e.push(s)}),{iconName:n,rest:e}}function uT(t){return t.sort().filter((e,n,s)=>s.indexOf(e)===n)}function Em(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{skipLookups:n=!1}=e;let s=null;const i=y1.concat(Jye),r=uT(t.filter(d=>i.includes(d))),o=uT(t.filter(d=>!y1.includes(d))),a=r.filter(d=>(s=d,!wC.includes(d))),[l=null]=a,c=Dbe(r),u=Ue(Ue({},Nbe(o)),{},{prefix:xm(l,{family:c})});return Ue(Ue(Ue({},u),Bbe({values:t,family:c,styles:vd,config:Ye,canonical:u,givenPrefix:s})),Ube(n,s,u))}function Ube(t,e,n){let{prefix:s,iconName:i}=n;if(t||!s||!i)return{prefix:s,iconName:i};const r=e==="fa"?HC(i):{},o=fa(s,i);return i=r.iconName||o||i,s=r.prefix||s,s==="far"&&!vd.far&&vd.fas&&!Ye.autoFetchSvg&&(s="fas"),{prefix:s,iconName:i}}const Fbe=xC.filter(t=>t!==zn||t!==bm),$be=Object.keys(v1).filter(t=>t!==zn).map(t=>Object.keys(v1[t])).flat();function Bbe(t){const{values:e,family:n,canonical:s,givenPrefix:i="",styles:r={},config:o={}}=t,a=n===bm,l=e.includes("fa-duotone")||e.includes("fad"),c=o.familyDefault==="duotone",u=s.prefix==="fad"||s.prefix==="fa-duotone";if(!a&&(l||c||u)&&(s.prefix="fad"),(e.includes("fa-brands")||e.includes("fab"))&&(s.prefix="fab"),!s.prefix&&Fbe.includes(n)&&(Object.keys(r).find(f=>$be.includes(f))||o.autoFetchSvg)){const f=Vye.get(n).defaultShortPrefixId;s.prefix=f,s.iconName=fa(s.prefix,s.iconName)||s.iconName}return(s.prefix==="fa"||i==="fa")&&(s.prefix=So()||"fas"),s}class Hbe{constructor(){this.definitions={}}add(){for(var e=arguments.length,n=new Array(e),s=0;s{this.definitions[r]=Ue(Ue({},this.definitions[r]||{}),i[r]),A1(r,i[r]);const o=Dy[zn][r];o&&A1(o,i[r]),BC()})}reset(){this.definitions={}}_pullDefinitions(e,n){const s=n.prefix&&n.iconName&&n.icon?{0:n}:n;return Object.keys(s).map(i=>{const{prefix:r,iconName:o,icon:a}=s[i],l=a[2];e[r]||(e[r]={}),l.length>0&&l.forEach(c=>{typeof c=="string"&&(e[r][c]=a)}),e[r][o]=a}),e}}let dT=[],Ml={};const Wl={},Gbe=Object.keys(Wl);function zbe(t,e){let{mixoutsTo:n}=e;return dT=t,Ml={},Object.keys(Wl).forEach(s=>{Gbe.indexOf(s)===-1&&delete Wl[s]}),dT.forEach(s=>{const i=s.mixout?s.mixout():{};if(Object.keys(i).forEach(r=>{typeof i[r]=="function"&&(n[r]=i[r]),typeof i[r]=="object"&&Object.keys(i[r]).forEach(o=>{n[r]||(n[r]={}),n[r][o]=i[r][o]})}),s.hooks){const r=s.hooks();Object.keys(r).forEach(o=>{Ml[o]||(Ml[o]=[]),Ml[o].push(r[o])})}s.provides&&s.provides(Wl)}),n}function M1(t,e){for(var n=arguments.length,s=new Array(n>2?n-2:0),i=2;i{e=o.apply(null,[e,...s])}),e}function Ca(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s{r.apply(null,n)})}function To(){const t=arguments[0],e=Array.prototype.slice.call(arguments,1);return Wl[t]?Wl[t].apply(null,e):void 0}function R1(t){t.prefix==="fa"&&(t.prefix="fas");let{iconName:e}=t;const n=t.prefix||So();if(e)return e=fa(n,e)||e,lT(zC.definitions,n,e)||lT(Ai.styles,n,e)}const zC=new Hbe,Vbe=()=>{Ye.autoReplaceSvg=!1,Ye.observeMutations=!1,Ca("noAuto")},Wbe={i2svg:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return kr?(Ca("beforeI2svg",t),To("pseudoElements2svg",t),To("i2svg",t)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:e}=t;Ye.autoReplaceSvg===!1&&(Ye.autoReplaceSvg=!0),Ye.observeMutations=!0,Abe(()=>{qbe({autoReplaceSvgRoot:e}),Ca("watch",t)})}},jbe={icon:t=>{if(t===null)return null;if(typeof t=="object"&&t.prefix&&t.iconName)return{prefix:t.prefix,iconName:fa(t.prefix,t.iconName)||t.iconName};if(Array.isArray(t)&&t.length===2){const e=t[1].indexOf("fa-")===0?t[1].slice(3):t[1],n=xm(t[0]);return{prefix:n,iconName:fa(n,e)||e}}if(typeof t=="string"&&(t.indexOf("".concat(Ye.cssPrefix,"-"))>-1||t.match(dbe))){const e=Em(t.split(" "),{skipLookups:!0});return{prefix:e.prefix||So(),iconName:fa(e.prefix,e.iconName)||e.iconName}}if(typeof t=="string"){const e=So();return{prefix:e,iconName:fa(e,t)||t}}}},Ms={noAuto:Vbe,config:Ye,dom:Wbe,parse:jbe,library:zC,findIconDefinition:R1,toHtml:Ud},qbe=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:e=jt}=t;(Object.keys(Ai.styles).length>0||Ye.autoFetchSvg)&&kr&&Ye.autoReplaceSvg&&Ms.dom.i2svg({node:e})};function Sm(t,e){return Object.defineProperty(t,"abstract",{get:e}),Object.defineProperty(t,"html",{get:function(){return t.abstract.map(n=>Ud(n))}}),Object.defineProperty(t,"node",{get:function(){if(!kr)return;const n=jt.createElement("div");return n.innerHTML=t.html,n.children}}),t}function Xbe(t){let{children:e,main:n,mask:s,attributes:i,styles:r,transform:o}=t;if(Uy(o)&&n.found&&!s.found){const{width:a,height:l}=n,c={x:a/l/2,y:.5};i.style=wm(Ue(Ue({},r),{},{"transform-origin":"".concat(c.x+o.x/16,"em ").concat(c.y+o.y/16,"em")}))}return[{tag:"svg",attributes:i,children:e}]}function Kbe(t){let{prefix:e,iconName:n,children:s,attributes:i,symbol:r}=t;const o=r===!0?"".concat(e,"-").concat(Ye.cssPrefix,"-").concat(n):r;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:Ue(Ue({},i),{},{id:o}),children:s}]}]}function By(t){const{icons:{main:e,mask:n},prefix:s,iconName:i,transform:r,symbol:o,title:a,maskId:l,titleId:c,extra:u,watchable:d=!1}=t,{width:f,height:h}=n.found?n:e,v=Kye.includes(s),_=[Ye.replacementClass,i?"".concat(Ye.cssPrefix,"-").concat(i):""].filter(T=>u.classes.indexOf(T)===-1).filter(T=>T!==""||!!T).concat(u.classes).join(" ");let m={children:[],attributes:Ue(Ue({},u.attributes),{},{"data-prefix":s,"data-icon":i,class:_,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(f," ").concat(h)})};const g=v&&!~u.classes.indexOf("fa-fw")?{width:"".concat(f/h*16*.0625,"em")}:{};d&&(m.attributes[Ra]=""),a&&(m.children.push({tag:"title",attributes:{id:m.attributes["aria-labelledby"]||"title-".concat(c||_d())},children:[a]}),delete m.attributes.title);const y=Ue(Ue({},m),{},{prefix:s,iconName:i,main:e,mask:n,maskId:l,transform:r,symbol:o,styles:Ue(Ue({},g),u.styles)}),{children:b,attributes:w}=n.found&&e.found?To("generateAbstractMask",y)||{children:[],attributes:{}}:To("generateAbstractIcon",y)||{children:[],attributes:{}};return y.children=b,y.attributes=w,o?Kbe(y):Xbe(y)}function fT(t){const{content:e,width:n,height:s,transform:i,title:r,extra:o,watchable:a=!1}=t,l=Ue(Ue(Ue({},o.attributes),r?{title:r}:{}),{},{class:o.classes.join(" ")});a&&(l[Ra]="");const c=Ue({},o.styles);Uy(i)&&(c.transform=Ebe({transform:i,startCentered:!0,width:n,height:s}),c["-webkit-transform"]=c.transform);const u=wm(c);u.length>0&&(l.style=u);const d=[];return d.push({tag:"span",attributes:l,children:[e]}),r&&d.push({tag:"span",attributes:{class:"sr-only"},children:[r]}),d}function Ybe(t){const{content:e,title:n,extra:s}=t,i=Ue(Ue(Ue({},s.attributes),n?{title:n}:{}),{},{class:s.classes.join(" ")}),r=wm(s.styles);r.length>0&&(i.style=r);const o=[];return o.push({tag:"span",attributes:i,children:[e]}),n&&o.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),o}const{styles:y_}=Ai;function C1(t){const e=t[0],n=t[1],[s]=t.slice(4);let i=null;return Array.isArray(s)?i={tag:"g",attributes:{class:"".concat(Ye.cssPrefix,"-").concat(g_.GROUP)},children:[{tag:"path",attributes:{class:"".concat(Ye.cssPrefix,"-").concat(g_.SECONDARY),fill:"currentColor",d:s[0]}},{tag:"path",attributes:{class:"".concat(Ye.cssPrefix,"-").concat(g_.PRIMARY),fill:"currentColor",d:s[1]}}]}:i={tag:"path",attributes:{fill:"currentColor",d:s}},{found:!0,width:e,height:n,icon:i}}const Zbe={found:!1,width:512,height:512};function Jbe(t,e){!AC&&!Ye.showMissingIcons&&t&&console.error('Icon with name "'.concat(t,'" and prefix "').concat(e,'" is missing.'))}function k1(t,e){let n=e;return e==="fa"&&Ye.styleDefault!==null&&(e=So()),new Promise((s,i)=>{if(n==="fa"){const r=HC(t);t=r.iconName||t,e=r.prefix||e}if(t&&e&&y_[e]&&y_[e][t]){const r=y_[e][t];return s(C1(r))}Jbe(t,e),s(Ue(Ue({},Zbe),{},{icon:Ye.showMissingIcons&&t?To("missingIconAbstract")||{}:{}}))})}const hT=()=>{},P1=Ye.measurePerformance&&Qf&&Qf.mark&&Qf.measure?Qf:{mark:hT,measure:hT},bu='FA "6.7.2"',Qbe=t=>(P1.mark("".concat(bu," ").concat(t," begins")),()=>VC(t)),VC=t=>{P1.mark("".concat(bu," ").concat(t," ends")),P1.measure("".concat(bu," ").concat(t),"".concat(bu," ").concat(t," begins"),"".concat(bu," ").concat(t," ends"))};var Hy={begin:Qbe,end:VC};const Ih=()=>{};function pT(t){return typeof(t.getAttribute?t.getAttribute(Ra):null)=="string"}function ewe(t){const e=t.getAttribute?t.getAttribute(Oy):null,n=t.getAttribute?t.getAttribute(Ly):null;return e&&n}function twe(t){return t&&t.classList&&t.classList.contains&&t.classList.contains(Ye.replacementClass)}function nwe(){return Ye.autoReplaceSvg===!0?Oh.replace:Oh[Ye.autoReplaceSvg]||Oh.replace}function swe(t){return jt.createElementNS("http://www.w3.org/2000/svg",t)}function iwe(t){return jt.createElement(t)}function WC(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{ceFn:n=t.tag==="svg"?swe:iwe}=e;if(typeof t=="string")return jt.createTextNode(t);const s=n(t.tag);return Object.keys(t.attributes||[]).forEach(function(r){s.setAttribute(r,t.attributes[r])}),(t.children||[]).forEach(function(r){s.appendChild(WC(r,{ceFn:n}))}),s}function rwe(t){let e=" ".concat(t.outerHTML," ");return e="".concat(e,"Font Awesome fontawesome.com "),e}const Oh={replace:function(t){const e=t[0];if(e.parentNode)if(t[1].forEach(n=>{e.parentNode.insertBefore(WC(n),e)}),e.getAttribute(Ra)===null&&Ye.keepOriginalSource){let n=jt.createComment(rwe(e));e.parentNode.replaceChild(n,e)}else e.remove()},nest:function(t){const e=t[0],n=t[1];if(~Ny(e).indexOf(Ye.replacementClass))return Oh.replace(t);const s=new RegExp("".concat(Ye.cssPrefix,"-.*"));if(delete n[0].attributes.id,n[0].attributes.class){const r=n[0].attributes.class.split(" ").reduce((o,a)=>(a===Ye.replacementClass||a.match(s)?o.toSvg.push(a):o.toNode.push(a),o),{toNode:[],toSvg:[]});n[0].attributes.class=r.toSvg.join(" "),r.toNode.length===0?e.removeAttribute("class"):e.setAttribute("class",r.toNode.join(" "))}const i=n.map(r=>Ud(r)).join(` +`);e.setAttribute(Ra,""),e.innerHTML=i}};function mT(t){t()}function jC(t,e){const n=typeof e=="function"?e:Ih;if(t.length===0)n();else{let s=mT;Ye.mutateApproach===lbe&&(s=Eo.requestAnimationFrame||mT),s(()=>{const i=nwe(),r=Hy.begin("mutate");t.map(i),r(),n()})}}let Gy=!1;function qC(){Gy=!0}function I1(){Gy=!1}let wp=null;function gT(t){if(!nT||!Ye.observeMutations)return;const{treeCallback:e=Ih,nodeCallback:n=Ih,pseudoElementsCallback:s=Ih,observeMutationsRoot:i=jt}=t;wp=new nT(r=>{if(Gy)return;const o=So();Dc(r).forEach(a=>{if(a.type==="childList"&&a.addedNodes.length>0&&!pT(a.addedNodes[0])&&(Ye.searchPseudoElements&&s(a.target),e(a.target)),a.type==="attributes"&&a.target.parentNode&&Ye.searchPseudoElements&&s(a.target.parentNode),a.type==="attributes"&&pT(a.target)&&~pbe.indexOf(a.attributeName))if(a.attributeName==="class"&&ewe(a.target)){const{prefix:l,iconName:c}=Em(Ny(a.target));a.target.setAttribute(Oy,l||o),c&&a.target.setAttribute(Ly,c)}else twe(a.target)&&n(a.target)})}),kr&&wp.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function owe(){wp&&wp.disconnect()}function awe(t){const e=t.getAttribute("style");let n=[];return e&&(n=e.split(";").reduce((s,i)=>{const r=i.split(":"),o=r[0],a=r.slice(1);return o&&a.length>0&&(s[o]=a.join(":").trim()),s},{})),n}function lwe(t){const e=t.getAttribute("data-prefix"),n=t.getAttribute("data-icon"),s=t.innerText!==void 0?t.innerText.trim():"";let i=Em(Ny(t));return i.prefix||(i.prefix=So()),e&&n&&(i.prefix=e,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&s.length>0&&(i.iconName=Obe(i.prefix,t.innerText)||$y(i.prefix,T1(t.innerText))),!i.iconName&&Ye.autoFetchSvg&&t.firstChild&&t.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=t.firstChild.data)),i}function cwe(t){const e=Dc(t.attributes).reduce((i,r)=>(i.name!=="class"&&i.name!=="style"&&(i[r.name]=r.value),i),{}),n=t.getAttribute("title"),s=t.getAttribute("data-fa-title-id");return Ye.autoA11y&&(n?e["aria-labelledby"]="".concat(Ye.replacementClass,"-title-").concat(s||_d()):(e["aria-hidden"]="true",e.focusable="false")),e}function uwe(){return{iconName:null,title:null,titleId:null,prefix:null,transform:Ti,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function _T(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0};const{iconName:n,prefix:s,rest:i}=lwe(t),r=cwe(t),o=M1("parseNodeAttributes",{},t);let a=e.styleParser?awe(t):[];return Ue({iconName:n,title:t.getAttribute("title"),titleId:t.getAttribute("data-fa-title-id"),prefix:s,transform:Ti,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:i,styles:a,attributes:r}},o)}const{styles:dwe}=Ai;function XC(t){const e=Ye.autoReplaceSvg==="nest"?_T(t,{styleParser:!1}):_T(t);return~e.extra.classes.indexOf(RC)?To("generateLayersText",t,e):To("generateSvgReplacementMutation",t,e)}function fwe(){return[...jye,...y1]}function vT(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!kr)return Promise.resolve();const n=jt.documentElement.classList,s=u=>n.add("".concat(rT,"-").concat(u)),i=u=>n.remove("".concat(rT,"-").concat(u)),r=Ye.autoFetchSvg?fwe():wC.concat(Object.keys(dwe));r.includes("fa")||r.push("fa");const o=[".".concat(RC,":not([").concat(Ra,"])")].concat(r.map(u=>".".concat(u,":not([").concat(Ra,"])"))).join(", ");if(o.length===0)return Promise.resolve();let a=[];try{a=Dc(t.querySelectorAll(o))}catch{}if(a.length>0)s("pending"),i("complete");else return Promise.resolve();const l=Hy.begin("onTree"),c=a.reduce((u,d)=>{try{const f=XC(d);f&&u.push(f)}catch(f){AC||f.name==="MissingIcon"&&console.error(f)}return u},[]);return new Promise((u,d)=>{Promise.all(c).then(f=>{jC(f,()=>{s("active"),s("complete"),i("pending"),typeof e=="function"&&e(),l(),u()})}).catch(f=>{l(),d(f)})})}function hwe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;XC(t).then(n=>{n&&jC([n],e)})}function pwe(t){return function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=(e||{}).icon?e:R1(e||{});let{mask:i}=n;return i&&(i=(i||{}).icon?i:R1(i||{})),t(s,Ue(Ue({},n),{},{mask:i}))}}const mwe=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:n=Ti,symbol:s=!1,mask:i=null,maskId:r=null,title:o=null,titleId:a=null,classes:l=[],attributes:c={},styles:u={}}=e;if(!t)return;const{prefix:d,iconName:f,icon:h}=t;return Sm(Ue({type:"icon"},t),()=>(Ca("beforeDOMElementCreation",{iconDefinition:t,params:e}),Ye.autoA11y&&(o?c["aria-labelledby"]="".concat(Ye.replacementClass,"-title-").concat(a||_d()):(c["aria-hidden"]="true",c.focusable="false")),By({icons:{main:C1(h),mask:i?C1(i.icon):{found:!1,width:null,height:null,icon:{}}},prefix:d,iconName:f,transform:Ue(Ue({},Ti),n),symbol:s,title:o,maskId:r,titleId:a,extra:{attributes:c,styles:u,classes:l}})))};var gwe={mixout(){return{icon:pwe(mwe)}},hooks(){return{mutationObserverCallbacks(t){return t.treeCallback=vT,t.nodeCallback=hwe,t}}},provides(t){t.i2svg=function(e){const{node:n=jt,callback:s=()=>{}}=e;return vT(n,s)},t.generateSvgReplacementMutation=function(e,n){const{iconName:s,title:i,titleId:r,prefix:o,transform:a,symbol:l,mask:c,maskId:u,extra:d}=n;return new Promise((f,h)=>{Promise.all([k1(s,o),c.iconName?k1(c.iconName,c.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(v=>{let[_,m]=v;f([e,By({icons:{main:_,mask:m},prefix:o,iconName:s,transform:a,symbol:l,maskId:u,title:i,titleId:r,extra:d,watchable:!0})])}).catch(h)})},t.generateAbstractIcon=function(e){let{children:n,attributes:s,main:i,transform:r,styles:o}=e;const a=wm(o);a.length>0&&(s.style=a);let l;return Uy(r)&&(l=To("generateAbstractTransformGrouping",{main:i,transform:r,containerWidth:i.width,iconWidth:i.width})),n.push(l||i.icon),{children:n,attributes:s}}}},_we={mixout(){return{layer(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{classes:n=[]}=e;return Sm({type:"layer"},()=>{Ca("beforeDOMElementCreation",{assembler:t,params:e});let s=[];return t(i=>{Array.isArray(i)?i.map(r=>{s=s.concat(r.abstract)}):s=s.concat(i.abstract)}),[{tag:"span",attributes:{class:["".concat(Ye.cssPrefix,"-layers"),...n].join(" ")},children:s}]})}}}},vwe={mixout(){return{counter(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{title:n=null,classes:s=[],attributes:i={},styles:r={}}=e;return Sm({type:"counter",content:t},()=>(Ca("beforeDOMElementCreation",{content:t,params:e}),Ybe({content:t.toString(),title:n,extra:{attributes:i,styles:r,classes:["".concat(Ye.cssPrefix,"-layers-counter"),...s]}})))}}}},ywe={mixout(){return{text(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:n=Ti,title:s=null,classes:i=[],attributes:r={},styles:o={}}=e;return Sm({type:"text",content:t},()=>(Ca("beforeDOMElementCreation",{content:t,params:e}),fT({content:t,transform:Ue(Ue({},Ti),n),title:s,extra:{attributes:r,styles:o,classes:["".concat(Ye.cssPrefix,"-layers-text"),...i]}})))}}},provides(t){t.generateLayersText=function(e,n){const{title:s,transform:i,extra:r}=n;let o=null,a=null;if(yC){const l=parseInt(getComputedStyle(e).fontSize,10),c=e.getBoundingClientRect();o=c.width/l,a=c.height/l}return Ye.autoA11y&&!s&&(r.attributes["aria-hidden"]="true"),Promise.resolve([e,fT({content:e.innerHTML,width:o,height:a,transform:i,title:s,extra:r,watchable:!0})])}}};const bwe=new RegExp('"',"ug"),yT=[1105920,1112319],bT=Ue(Ue(Ue(Ue({},{FontAwesome:{normal:"fas",400:"fas"}}),zye),obe),Qye),O1=Object.keys(bT).reduce((t,e)=>(t[e.toLowerCase()]=bT[e],t),{}),wwe=Object.keys(O1).reduce((t,e)=>{const n=O1[e];return t[e]=n[900]||[...Object.entries(n)][0][1],t},{});function xwe(t){const e=t.replace(bwe,""),n=Rbe(e,0),s=n>=yT[0]&&n<=yT[1],i=e.length===2?e[0]===e[1]:!1;return{value:T1(i?e[0]:e),isSecondary:s||i}}function Ewe(t,e){const n=t.replace(/^['"]|['"]$/g,"").toLowerCase(),s=parseInt(e),i=isNaN(s)?"normal":s;return(O1[n]||{})[i]||wwe[n]}function wT(t,e){const n="".concat(abe).concat(e.replace(":","-"));return new Promise((s,i)=>{if(t.getAttribute(n)!==null)return s();const o=Dc(t.children).filter(f=>f.getAttribute(w1)===e)[0],a=Eo.getComputedStyle(t,e),l=a.getPropertyValue("font-family"),c=l.match(fbe),u=a.getPropertyValue("font-weight"),d=a.getPropertyValue("content");if(o&&!c)return t.removeChild(o),s();if(c&&d!=="none"&&d!==""){const f=a.getPropertyValue("content");let h=Ewe(l,u);const{value:v,isSecondary:_}=xwe(f),m=c[0].startsWith("FontAwesome");let g=$y(h,v),y=g;if(m){const b=Lbe(v);b.iconName&&b.prefix&&(g=b.iconName,h=b.prefix)}if(g&&!_&&(!o||o.getAttribute(Oy)!==h||o.getAttribute(Ly)!==y)){t.setAttribute(n,y),o&&t.removeChild(o);const b=uwe(),{extra:w}=b;w.attributes[w1]=e,k1(g,h).then(T=>{const S=By(Ue(Ue({},b),{},{icons:{main:T,mask:GC()},prefix:h,iconName:y,extra:w,watchable:!0})),A=jt.createElementNS("http://www.w3.org/2000/svg","svg");e==="::before"?t.insertBefore(A,t.firstChild):t.appendChild(A),A.outerHTML=S.map(R=>Ud(R)).join(` +`),t.removeAttribute(n),s()}).catch(i)}else s()}else s()})}function Swe(t){return Promise.all([wT(t,"::before"),wT(t,"::after")])}function Twe(t){return t.parentNode!==document.head&&!~cbe.indexOf(t.tagName.toUpperCase())&&!t.getAttribute(w1)&&(!t.parentNode||t.parentNode.tagName!=="svg")}function xT(t){if(kr)return new Promise((e,n)=>{const s=Dc(t.querySelectorAll("*")).filter(Twe).map(Swe),i=Hy.begin("searchPseudoElements");qC(),Promise.all(s).then(()=>{i(),I1(),e()}).catch(()=>{i(),I1(),n()})})}var Awe={hooks(){return{mutationObserverCallbacks(t){return t.pseudoElementsCallback=xT,t}}},provides(t){t.pseudoElements2svg=function(e){const{node:n=jt}=e;Ye.searchPseudoElements&&xT(n)}}};let ET=!1;var Mwe={mixout(){return{dom:{unwatch(){qC(),ET=!0}}}},hooks(){return{bootstrap(){gT(M1("mutationObserverCallbacks",{}))},noAuto(){owe()},watch(t){const{observeMutationsRoot:e}=t;ET?I1():gT(M1("mutationObserverCallbacks",{observeMutationsRoot:e}))}}}};const ST=t=>{let e={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return t.toLowerCase().split(" ").reduce((n,s)=>{const i=s.toLowerCase().split("-"),r=i[0];let o=i.slice(1).join("-");if(r&&o==="h")return n.flipX=!0,n;if(r&&o==="v")return n.flipY=!0,n;if(o=parseFloat(o),isNaN(o))return n;switch(r){case"grow":n.size=n.size+o;break;case"shrink":n.size=n.size-o;break;case"left":n.x=n.x-o;break;case"right":n.x=n.x+o;break;case"up":n.y=n.y-o;break;case"down":n.y=n.y+o;break;case"rotate":n.rotate=n.rotate+o;break}return n},e)};var Rwe={mixout(){return{parse:{transform:t=>ST(t)}}},hooks(){return{parseNodeAttributes(t,e){const n=e.getAttribute("data-fa-transform");return n&&(t.transform=ST(n)),t}}},provides(t){t.generateAbstractTransformGrouping=function(e){let{main:n,transform:s,containerWidth:i,iconWidth:r}=e;const o={transform:"translate(".concat(i/2," 256)")},a="translate(".concat(s.x*32,", ").concat(s.y*32,") "),l="scale(".concat(s.size/16*(s.flipX?-1:1),", ").concat(s.size/16*(s.flipY?-1:1),") "),c="rotate(".concat(s.rotate," 0 0)"),u={transform:"".concat(a," ").concat(l," ").concat(c)},d={transform:"translate(".concat(r/2*-1," -256)")},f={outer:o,inner:u,path:d};return{tag:"g",attributes:Ue({},f.outer),children:[{tag:"g",attributes:Ue({},f.inner),children:[{tag:n.icon.tag,children:n.icon.children,attributes:Ue(Ue({},n.icon.attributes),f.path)}]}]}}}};const b_={x:0,y:0,width:"100%",height:"100%"};function TT(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.attributes&&(t.attributes.fill||e)&&(t.attributes.fill="black"),t}function Cwe(t){return t.tag==="g"?t.children:[t]}var kwe={hooks(){return{parseNodeAttributes(t,e){const n=e.getAttribute("data-fa-mask"),s=n?Em(n.split(" ").map(i=>i.trim())):GC();return s.prefix||(s.prefix=So()),t.mask=s,t.maskId=e.getAttribute("data-fa-mask-id"),t}}},provides(t){t.generateAbstractMask=function(e){let{children:n,attributes:s,main:i,mask:r,maskId:o,transform:a}=e;const{width:l,icon:c}=i,{width:u,icon:d}=r,f=xbe({transform:a,containerWidth:u,iconWidth:l}),h={tag:"rect",attributes:Ue(Ue({},b_),{},{fill:"white"})},v=c.children?{children:c.children.map(TT)}:{},_={tag:"g",attributes:Ue({},f.inner),children:[TT(Ue({tag:c.tag,attributes:Ue(Ue({},c.attributes),f.path)},v))]},m={tag:"g",attributes:Ue({},f.outer),children:[_]},g="mask-".concat(o||_d()),y="clip-".concat(o||_d()),b={tag:"mask",attributes:Ue(Ue({},b_),{},{id:g,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[h,m]},w={tag:"defs",children:[{tag:"clipPath",attributes:{id:y},children:Cwe(d)},b]};return n.push(w,{tag:"rect",attributes:Ue({fill:"currentColor","clip-path":"url(#".concat(y,")"),mask:"url(#".concat(g,")")},b_)}),{children:n,attributes:s}}}},Pwe={provides(t){let e=!1;Eo.matchMedia&&(e=Eo.matchMedia("(prefers-reduced-motion: reduce)").matches),t.missingIconAbstract=function(){const n=[],s={fill:"currentColor"},i={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};n.push({tag:"path",attributes:Ue(Ue({},s),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});const r=Ue(Ue({},i),{},{attributeName:"opacity"}),o={tag:"circle",attributes:Ue(Ue({},s),{},{cx:"256",cy:"364",r:"28"}),children:[]};return e||o.children.push({tag:"animate",attributes:Ue(Ue({},i),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:Ue(Ue({},r),{},{values:"1;0;1;1;0;1;"})}),n.push(o),n.push({tag:"path",attributes:Ue(Ue({},s),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:e?[]:[{tag:"animate",attributes:Ue(Ue({},r),{},{values:"1;0;0;0;0;1;"})}]}),e||n.push({tag:"path",attributes:Ue(Ue({},s),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:Ue(Ue({},r),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:n}}}},Iwe={hooks(){return{parseNodeAttributes(t,e){const n=e.getAttribute("data-fa-symbol"),s=n===null?!1:n===""?!0:n;return t.symbol=s,t}}}},Owe=[Tbe,gwe,_we,vwe,ywe,Awe,Mwe,Rwe,kwe,Pwe,Iwe];zbe(Owe,{mixoutsTo:Ms});Ms.noAuto;Ms.config;const Lwe=Ms.library;Ms.dom;const L1=Ms.parse;Ms.findIconDefinition;Ms.toHtml;const Dwe=Ms.icon;Ms.layer;Ms.text;Ms.counter;function AT(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,s)}return n}function cr(t){for(var e=1;e=0)continue;n[s]=t[s]}return n}function $we(t,e){if(t==null)return{};var n=Fwe(t,e),s,i;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,s)&&(n[s]=t[s])}return n}var Bwe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},KC={exports:{}};(function(t){(function(e){var n=function(g,y,b){if(!c(y)||d(y)||f(y)||h(y)||l(y))return y;var w,T=0,S=0;if(u(y))for(w=[],S=y.length;T1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof t=="string")return t;var s=(t.children||[]).map(function(l){return YC(l)}),i=Object.keys(t.attributes||{}).reduce(function(l,c){var u=t.attributes[c];switch(c){case"class":l.class=Vwe(u);break;case"style":l.style=zwe(u);break;default:l.attrs[c]=u}return l},{attrs:{},class:{},style:{}});n.class;var r=n.style,o=r===void 0?{}:r,a=$we(n,Gwe);return wa(t.tag,cr(cr(cr({},e),{},{class:i.class,style:cr(cr({},i.style),o)},i.attrs),a),s)}var ZC=!1;try{ZC=!0}catch{}function Wwe(){if(!ZC&&console&&typeof console.error=="function"){var t;(t=console).error.apply(t,arguments)}}function w_(t,e){return Array.isArray(e)&&e.length>0||!Array.isArray(e)&&e?as({},t,e):{}}function jwe(t){var e,n=(e={"fa-spin":t.spin,"fa-pulse":t.pulse,"fa-fw":t.fixedWidth,"fa-border":t.border,"fa-li":t.listItem,"fa-inverse":t.inverse,"fa-flip":t.flip===!0,"fa-flip-horizontal":t.flip==="horizontal"||t.flip==="both","fa-flip-vertical":t.flip==="vertical"||t.flip==="both"},as(as(as(as(as(as(as(as(as(as(e,"fa-".concat(t.size),t.size!==null),"fa-rotate-".concat(t.rotation),t.rotation!==null),"fa-pull-".concat(t.pull),t.pull!==null),"fa-swap-opacity",t.swapOpacity),"fa-bounce",t.bounce),"fa-shake",t.shake),"fa-beat",t.beat),"fa-fade",t.fade),"fa-beat-fade",t.beatFade),"fa-flash",t.flash),as(as(e,"fa-spin-pulse",t.spinPulse),"fa-spin-reverse",t.spinReverse));return Object.keys(n).map(function(s){return n[s]?s:null}).filter(function(s){return s})}function MT(t){if(t&&xp(t)==="object"&&t.prefix&&t.iconName&&t.icon)return t;if(L1.icon)return L1.icon(t);if(t===null)return null;if(xp(t)==="object"&&t.prefix&&t.iconName)return t;if(Array.isArray(t)&&t.length===2)return{prefix:t[0],iconName:t[1]};if(typeof t=="string")return{prefix:"fas",iconName:t}}var qwe=nt({name:"FontAwesomeIcon",props:{border:{type:Boolean,default:!1},fixedWidth:{type:Boolean,default:!1},flip:{type:[Boolean,String],default:!1,validator:function(e){return[!0,!1,"horizontal","vertical","both"].indexOf(e)>-1}},icon:{type:[Object,Array,String],required:!0},mask:{type:[Object,Array,String],default:null},maskId:{type:String,default:null},listItem:{type:Boolean,default:!1},pull:{type:String,default:null,validator:function(e){return["right","left"].indexOf(e)>-1}},pulse:{type:Boolean,default:!1},rotation:{type:[String,Number],default:null,validator:function(e){return[90,180,270].indexOf(Number.parseInt(e,10))>-1}},swapOpacity:{type:Boolean,default:!1},size:{type:String,default:null,validator:function(e){return["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"].indexOf(e)>-1}},spin:{type:Boolean,default:!1},transform:{type:[String,Object],default:null},symbol:{type:[Boolean,String],default:!1},title:{type:String,default:null},titleId:{type:String,default:null},inverse:{type:Boolean,default:!1},bounce:{type:Boolean,default:!1},shake:{type:Boolean,default:!1},beat:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},beatFade:{type:Boolean,default:!1},flash:{type:Boolean,default:!1},spinPulse:{type:Boolean,default:!1},spinReverse:{type:Boolean,default:!1}},setup:function(e,n){var s=n.attrs,i=ln(function(){return MT(e.icon)}),r=ln(function(){return w_("classes",jwe(e))}),o=ln(function(){return w_("transform",typeof e.transform=="string"?L1.transform(e.transform):e.transform)}),a=ln(function(){return w_("mask",MT(e.mask))}),l=ln(function(){return Dwe(i.value,cr(cr(cr(cr({},r.value),o.value),a.value),{},{symbol:e.symbol,title:e.title,titleId:e.titleId,maskId:e.maskId}))});ma(l,function(u){if(!u)return Wwe("Could not find one or more icon(s)",i.value,a.value)},{immediate:!0});var c=ln(function(){return l.value?YC(l.value.abstract[0],{},s):null});return function(){return c.value}}});/*! + * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2024 Fonticons, Inc. + */const Xwe={prefix:"fas",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3l58.3 0c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24l0-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1l-58.3 0c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},Kwe={prefix:"fas",iconName:"download",icon:[512,512,[],"f019","M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]},Ywe={prefix:"fas",iconName:"upload",icon:[512,512,[],"f093","M288 109.3L288 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-242.7-73.4 73.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0l128 128c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L288 109.3zM64 352l128 0c0 35.3 28.7 64 64 64s64-28.7 64-64l128 0c35.3 0 64 28.7 64 64l0 32c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64l0-32c0-35.3 28.7-64 64-64zM432 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]},Zwe={prefix:"fas",iconName:"spinner",icon:[512,512,[],"f110","M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z"]},Jwe={prefix:"fas",iconName:"file-export",icon:[576,512,["arrow-right-from-file"],"f56e","M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 128-168 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l168 0 0 112c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM384 336l0-48 110.1 0-39-39c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l80 80c9.4 9.4 9.4 24.6 0 33.9l-80 80c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l39-39L384 336zm0-208l-128 0L256 0 384 128z"]},Qwe={prefix:"fas",iconName:"cloud-moon",icon:[640,512,[],"f6c3","M495.8 0c5.5 0 10.9 .2 16.3 .7c7 .6 12.8 5.7 14.3 12.5s-1.6 13.9-7.7 17.3c-44.4 25.2-74.4 73-74.4 127.8c0 81 65.5 146.6 146.2 146.6c8.6 0 17-.7 25.1-2.1c6.9-1.2 13.8 2.2 17 8.5s1.9 13.8-3.1 18.7c-34.5 33.6-81.7 54.4-133.6 54.4c-9.3 0-18.4-.7-27.4-1.9c-11.2-22.6-29.8-40.9-52.6-51.7c-2.7-58.5-50.3-105.3-109.2-106.7c-1.7-10.4-2.6-21-2.6-31.8C304 86.1 389.8 0 495.8 0zM447.9 431.9c0 44.2-35.8 80-80 80L96 511.9c-53 0-96-43-96-96c0-47.6 34.6-87 80-94.6l0-1.3c0-53 43-96 96-96c34.9 0 65.4 18.6 82.2 46.4c13-9.1 28.8-14.4 45.8-14.4c44.2 0 80 35.8 80 80c0 5.9-.6 11.7-1.9 17.2c37.4 6.7 65.8 39.4 65.8 78.7z"]},e2e={prefix:"fas",iconName:"triangle-exclamation",icon:[512,512,[9888,"exclamation-triangle","warning"],"f071","M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},t2e={prefix:"fas",iconName:"cloud-sun",icon:[640,512,[9925],"f6c4","M294.2 1.2c5.1 2.1 8.7 6.7 9.6 12.1l14.1 84.7 84.7 14.1c5.4 .9 10 4.5 12.1 9.6s1.5 10.9-1.6 15.4l-38.5 55c-2.2-.1-4.4-.2-6.7-.2c-23.3 0-45.1 6.2-64 17.1l0-1.1c0-53-43-96-96-96s-96 43-96 96s43 96 96 96c8.1 0 15.9-1 23.4-2.9c-36.6 18.1-63.3 53.1-69.8 94.9l-24.4 17c-4.5 3.2-10.3 3.8-15.4 1.6s-8.7-6.7-9.6-12.1L98.1 317.9 13.4 303.8c-5.4-.9-10-4.5-12.1-9.6s-1.5-10.9 1.6-15.4L52.5 208 2.9 137.2c-3.2-4.5-3.8-10.3-1.6-15.4s6.7-8.7 12.1-9.6L98.1 98.1l14.1-84.7c.9-5.4 4.5-10 9.6-12.1s10.9-1.5 15.4 1.6L208 52.5 278.8 2.9c4.5-3.2 10.3-3.8 15.4-1.6zM144 208a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM639.9 431.9c0 44.2-35.8 80-80 80l-271.9 0c-53 0-96-43-96-96c0-47.6 34.6-87 80-94.6l0-1.3c0-53 43-96 96-96c34.9 0 65.4 18.6 82.2 46.4c13-9.1 28.8-14.4 45.8-14.4c44.2 0 80 35.8 80 80c0 5.9-.6 11.7-1.9 17.2c37.4 6.7 65.8 39.4 65.8 78.7z"]};/*! + * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2024 Fonticons, Inc. + */const n2e={prefix:"far",iconName:"pen-to-square",icon:[512,512,["edit"],"f044","M441 58.9L453.1 71c9.4 9.4 9.4 24.6 0 33.9L424 134.1 377.9 88 407 58.9c9.4-9.4 24.6-9.4 33.9 0zM209.8 256.2L344 121.9 390.1 168 255.8 302.2c-2.9 2.9-6.5 5-10.4 6.1l-58.5 16.7 16.7-58.5c1.1-3.9 3.2-7.5 6.1-10.4zM373.1 25L175.8 222.2c-8.7 8.7-15 19.4-18.3 31.1l-28.6 100c-2.4 8.4-.1 17.4 6.1 23.6s15.2 8.5 23.6 6.1l100-28.6c11.8-3.4 22.5-9.7 31.1-18.3L487 138.9c28.1-28.1 28.1-73.7 0-101.8L474.9 25C446.8-3.1 401.2-3.1 373.1 25zM88 64C39.4 64 0 103.4 0 152L0 424c0 48.6 39.4 88 88 88l272 0c48.6 0 88-39.4 88-88l0-112c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 112c0 22.1-17.9 40-40 40L88 464c-22.1 0-40-17.9-40-40l0-272c0-22.1 17.9-40 40-40l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L88 64z"]};Lwe.add(Xwe,e2e,Ywe,Qwe,t2e,Kwe,n2e,Jwe,Zwe);class s2e{constructor(){xe(this,"state",gc({isShown:!1,resolve:void 0,component:void 0,props:{}}))}get isShown(){return this.state.isShown}get component(){return this.state.component}get props(){return this.state.props}show(e,n){return this.state.props=n||{},this.state.component=kp(e),this.state.isShown=!0,new Promise(s=>{this.state.resolve=s})}close(e){this.state.resolve&&this.state.resolve(e),this.state.isShown=!1,this.state.component=void 0,this.state.resolve=void 0,this.state.props={}}}const i2e={install(t){t.config.globalProperties.$modal=new s2e}};var JC={exports:{}};(function(t,e){(function(n,s){t.exports=s()})(Ci,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},s=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,r=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},c=function(m){return(m=+m)+(m>68?1900:2e3)},u=function(m){return function(g){this[m]=+g}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=function(g){if(!g||g==="Z")return 0;var y=g.match(/([+-]|\d\d)/g),b=60*y[1]+(+y[2]||0);return b===0?0:y[0]==="+"?-b:b}(m)}],f=function(m){var g=l[m];return g&&(g.indexOf?g:g.s.concat(g.f))},h=function(m,g){var y,b=l.meridiem;if(b){for(var w=1;w<=24;w+=1)if(m.indexOf(b(w,0,g))>-1){y=w>12;break}}else y=m===(g?"pm":"PM");return y},v={A:[a,function(m){this.afternoon=h(m,!1)}],a:[a,function(m){this.afternoon=h(m,!0)}],Q:[i,function(m){this.month=3*(m-1)+1}],S:[i,function(m){this.milliseconds=100*+m}],SS:[r,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[o,u("seconds")],ss:[o,u("seconds")],m:[o,u("minutes")],mm:[o,u("minutes")],H:[o,u("hours")],h:[o,u("hours")],HH:[o,u("hours")],hh:[o,u("hours")],D:[o,u("day")],DD:[r,u("day")],Do:[a,function(m){var g=l.ordinal,y=m.match(/\d+/);if(this.day=y[0],g)for(var b=1;b<=31;b+=1)g(b).replace(/\[|\]/g,"")===m&&(this.day=b)}],w:[o,u("week")],ww:[r,u("week")],M:[o,u("month")],MM:[r,u("month")],MMM:[a,function(m){var g=f("months"),y=(f("monthsShort")||g.map(function(b){return b.slice(0,3)})).indexOf(m)+1;if(y<1)throw new Error;this.month=y%12||y}],MMMM:[a,function(m){var g=f("months").indexOf(m)+1;if(g<1)throw new Error;this.month=g%12||g}],Y:[/[+-]?\d+/,u("year")],YY:[r,function(m){this.year=c(m)}],YYYY:[/\d{4}/,u("year")],Z:d,ZZ:d};function _(m){var g,y;g=m,y=l&&l.formats;for(var b=(m=g.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(E,k,U){var H=U&&U.toUpperCase();return k||y[U]||n[U]||y[H].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(D,I,P){return I||P.slice(1)})})).match(s),w=b.length,T=0;T-1)return new Date((L==="X"?1e3:1)*B);var de=_(L)(B),fe=de.year,Re=de.month,oe=de.day,me=de.hours,ke=de.minutes,J=de.seconds,Ae=de.milliseconds,Ee=de.zone,Ce=de.week,Ge=new Date,M=oe||(fe||Re?1:Ge.getDate()),z=fe||Ge.getFullYear(),K=0;fe&&!Re||(K=Re>0?Re-1:Ge.getMonth());var ce,te=me||0,we=ke||0,Me=J||0,Se=Ae||0;return Ee?new Date(Date.UTC(z,K,M,te,we,Me,Se+60*Ee.offset*1e3)):Y?new Date(Date.UTC(z,K,M,te,we,Me,Se)):(ce=new Date(z,K,M,te,we,Me,Se),Ce&&(ce=q(ce).week(Ce).toDate()),ce)}catch{return new Date("")}}(S,x,A,y),this.init(),H&&H!==!0&&(this.$L=this.locale(H).$L),U&&S!=this.format(x)&&(this.$d=new Date("")),l={}}else if(x instanceof Array)for(var D=x.length,I=1;I<=D;I+=1){R[1]=x[I-1];var P=y.apply(this,R);if(P.isValid()){this.$d=P.$d,this.$L=P.$L,this.init();break}I===D&&(this.$d=new Date(""))}else w.call(this,T)}}})})(JC);var r2e=JC.exports;const o2e=Ui(r2e);var QC={exports:{}};(function(t,e){(function(n,s){t.exports=s()})(Ci,function(){return function(n,s){var i=s.prototype,r=i.format;i.format=function(o){var a=this,l=this.$locale();if(!this.isValid())return r.bind(this)(o);var c=this.$utils(),u=(o||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(d){switch(d){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return l.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return l.ordinal(a.week(),"W");case"w":case"ww":return c.s(a.week(),d==="w"?1:2,"0");case"W":case"WW":return c.s(a.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return c.s(String(a.$H===0?24:a.$H),d==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return d}});return r.bind(this)(u)}}})})(QC);var a2e=QC.exports;const l2e=Ui(a2e);var e8={exports:{}};(function(t,e){(function(n,s){t.exports=s()})(Ci,function(){var n="month",s="quarter";return function(i,r){var o=r.prototype;o.quarter=function(c){return this.$utils().u(c)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(c-1))};var a=o.add;o.add=function(c,u){return c=Number(c),this.$utils().p(u)===s?this.add(3*c,n):a.bind(this)(c,u)};var l=o.startOf;o.startOf=function(c,u){var d=this.$utils(),f=!!d.u(u)||u;if(d.p(c)===s){var h=this.quarter()-1;return f?this.month(3*h).startOf(n).startOf("day"):this.month(3*h+2).endOf(n).endOf("day")}return l.bind(this)(c,u)}}})})(e8);var c2e=e8.exports;const u2e=Ui(c2e);var t8={exports:{}};(function(t,e){(function(n,s){t.exports=s()})(Ci,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(s,i,r){var o=i.prototype,a=o.format;r.en.formats=n,o.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var c=this.$locale().formats,u=function(d,f){return d.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(h,v,_){var m=_&&_.toUpperCase();return v||f[_]||n[_]||f[m].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(g,y,b){return y||b.slice(1)})})}(l,c===void 0?{}:c);return a.call(this,u)}}})})(t8);var d2e=t8.exports;const f2e=Ui(d2e);var n8={exports:{}};(function(t,e){(function(n,s){t.exports=s()})(Ci,function(){var n="day";return function(s,i,r){var o=function(c){return c.add(4-c.isoWeekday(),n)},a=i.prototype;a.isoWeekYear=function(){return o(this).year()},a.isoWeek=function(c){if(!this.$utils().u(c))return this.add(7*(c-this.isoWeek()),n);var u,d,f,h,v=o(this),_=(u=this.isoWeekYear(),d=this.$u,f=(d?r.utc:r)().year(u).startOf("year"),h=4-f.isoWeekday(),f.isoWeekday()>4&&(h+=7),f.add(h,n));return v.diff(_,"week")+1},a.isoWeekday=function(c){return this.$utils().u(c)?this.day()||7:this.day(this.day()%7?c:c-7)};var l=a.startOf;a.startOf=function(c,u){var d=this.$utils(),f=!!d.u(u)||u;return d.p(c)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(c,u)}}})})(n8);var h2e=n8.exports;const p2e=Ui(h2e);hn.extend(l2e);hn.extend(u2e);hn.extend(f2e);hn.extend(o2e);hn.extend(p2e);var m2e={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};nR._date.override({formats:function(){return m2e},parse:function(e,n){var s=typeof e;return e===null||s==="undefined"?null:s==="string"&&typeof n=="string"?hn(e,n).isValid()?hn(e,n).valueOf():null:e instanceof hn?null:hn(e).isValid()?hn(e).valueOf():null},format:function(e,n){return hn(e).format(n)},add:function(e,n,s){return hn(e).add(n,s).valueOf()},diff:function(e,n,s){return hn(e).diff(hn(n),s)},startOf:function(e,n,s){if(n==="isoWeek"){var i=typeof s=="number"&&s>0&&s<7?s:1;return hn(e).isoWeekday(i).startOf("day").valueOf()}return hn(e).startOf(n).valueOf()},endOf:function(e,n){return hn(e).endOf(n).valueOf()}});hm.register(CY,MY,UY,Ah,vu,fd,j0,W0);const ko=NP(uye);ko.component("spinner-btn",pye);ko.component("tooltip",Rye);ko.component("input-select",Oye);ko.component("FontAwesomeIcon",qwe);ko.use(mC);ko.use(ir);ko.use(i2e);ko.mount("#app");export{HP as _}; diff --git a/develop/assets/virtual_pwa-register-T0LD5wEJ.js b/develop/assets/virtual_pwa-register-T0LD5wEJ.js new file mode 100644 index 0000000..e7e5056 --- /dev/null +++ b/develop/assets/virtual_pwa-register-T0LD5wEJ.js @@ -0,0 +1 @@ +import{_}from"./index-BJxQEF3L.js";function m(p={}){const{immediate:u=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:o,onRegisteredSW:d,onRegisterError:s}=p;let t,c,r;const w=async(e=!0)=>{await c,await(r==null?void 0:r())};async function v(){if("serviceWorker"in navigator){if(t=await _(async()=>{const{Workbox:e}=await import("./workbox-window.prod.es5-B9K5rw8f.js");return{Workbox:e}},[]).then(({Workbox:e})=>new e("/develop/sw.js",{scope:"/develop/",type:"classic"})).catch(e=>{s==null||s(e)}),!t)return;r=async()=>{await(t==null?void 0:t.messageSkipWaiting())};{let e=!1;const l=()=>{e=!0,t==null||t.addEventListener("controlling",a=>{a.isUpdate&&window.location.reload()}),n==null||n()};t.addEventListener("installed",a=>{typeof a.isUpdate>"u"?typeof a.isExternal<"u"?a.isExternal?l():!e&&(i==null||i()):a.isExternal?window.location.reload():!e&&(i==null||i()):a.isUpdate||i==null||i()}),t.addEventListener("waiting",l),t.addEventListener("externalwaiting",l)}t.register({immediate:u}).then(e=>{d?d("/develop/sw.js",e):o==null||o(e)}).catch(e=>{s==null||s(e)})}}return c=v(),w}export{m as registerSW}; diff --git a/develop/index.html b/develop/index.html index af8547d..944ed03 100644 --- a/develop/index.html +++ b/develop/index.html @@ -21,7 +21,7 @@ - + diff --git a/develop/sw.js b/develop/sw.js index 2bada5f..86f18b4 100644 --- a/develop/sw.js +++ b/develop/sw.js @@ -1,2 +1,2 @@ (function(){"use strict";try{self["workbox:core:7.2.0"]&&_()}catch{}const We=null,G=(s,...e)=>{let t=s;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t};class l extends Error{constructor(e,t){const n=G(e,t);super(n),this.name=e,this.details=t}}const N=new Set;function Q(s){N.add(s)}const d={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},E=s=>[d.prefix,s,d.suffix].filter(e=>e&&e.length>0).join("-"),z=s=>{for(const e of Object.keys(d))s(e)},g={updateDetails:s=>{z(e=>{typeof s[e]=="string"&&(d[e]=s[e])})},getGoogleAnalyticsName:s=>s||E(d.googleAnalytics),getPrecacheName:s=>s||E(d.precache),getPrefix:()=>d.prefix,getRuntimeName:s=>s||E(d.runtime),getSuffix:()=>d.suffix};function M(s,e){const t=new URL(s);for(const n of e)t.searchParams.delete(n);return t.href}async function J(s,e,t,n){const a=M(e.url,t);if(e.url===a)return s.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),i=await s.keys(e,r);for(const c of i){const o=M(c.url,t);if(a===o)return s.match(c,n)}}let m;function X(){if(m===void 0){const s=new Response("");if("body"in s)try{new Response(s.body),m=!0}catch{m=!1}m=!1}return m}function v(s){s.then(()=>{})}class Y{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}async function Z(){for(const s of N)await s()}const ee=s=>new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),"");function te(s){return new Promise(e=>setTimeout(e,s))}function K(s,e){const t=e();return s.waitUntil(t),t}async function se(s,e){let t=null;if(s.url&&(t=new URL(s.url).origin),t!==self.location.origin)throw new l("cross-origin-copy-response",{origin:t});const n=s.clone(),r={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},i=X()?n.body:await n.blob();return new Response(i,r)}function ne(){self.addEventListener("activate",()=>self.clients.claim())}try{self["workbox:routing:7.2.0"]&&_()}catch{}const A="GET",C=s=>s&&typeof s=="object"?s:{handle:s};class y{constructor(e,t,n=A){this.handler=C(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=C(e)}}class ae extends y{constructor(e,t,n){const a=({url:r})=>{const i=e.exec(r.href);if(i&&!(r.origin!==location.origin&&i.index!==0))return i.slice(1)};super(a,t,n)}}class re{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const r=new Request(...a);return this.handleRequest({request:r,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:n});let c=i&&i.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let h;try{h=c.handle({url:n,request:e,event:t,params:r})}catch(u){h=Promise.reject(u)}const b=i&&i.catchHandler;return h instanceof Promise&&(this._catchHandler||b)&&(h=h.catch(async u=>{if(b)try{return await b.handle({url:n,request:e,event:t,params:r})}catch($){$ instanceof Error&&(u=$)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:n,event:a}){const r=this._routes.get(n.method)||[];for(const i of r){let c;const o=i.match({url:e,sameOrigin:t,request:n,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:i,params:c}}return{}}setDefaultHandler(e,t=A){this._defaultHandlerMap.set(t,C(e))}setCatchHandler(e){this._catchHandler=C(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let w;const ie=()=>(w||(w=new re,w.addFetchListener(),w.addCacheListener()),w);function O(s,e,t){let n;if(typeof s=="string"){const r=new URL(s,location.href),i=({url:c})=>c.href===r.href;n=new y(i,e,t)}else if(s instanceof RegExp)n=new ae(s,e,t);else if(typeof s=="function")n=new y(s,e,t);else if(s instanceof y)n=s;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return ie().registerRoute(n),n}try{self["workbox:strategies:7.2.0"]&&_()}catch{}function x(s){return typeof s=="string"?new Request(s):s}class ce{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new Y,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const n of this._plugins)this._pluginStateMap.set(n,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let n=x(e);if(n.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const i=await t.preloadResponse;if(i)return i}const a=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const i of this.iterateCallbacks("requestWillFetch"))n=await i({request:n.clone(),event:t})}catch(i){if(i instanceof Error)throw new l("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const r=n.clone();try{let i;i=await fetch(n,n.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const c of this.iterateCallbacks("fetchDidSucceed"))i=await c({event:t,request:r,response:i});return i}catch(i){throw a&&await this.runCallbacks("fetchDidFail",{error:i,event:t,originalRequest:a.clone(),request:r.clone()}),i}}async fetchAndCachePut(e){const t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){const t=x(e);let n;const{cacheName:a,matchOptions:r}=this._strategy,i=await this.getCacheKey(t,"read"),c=Object.assign(Object.assign({},r),{cacheName:a});n=await caches.match(i,c);for(const o of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await o({cacheName:a,matchOptions:r,cachedResponse:n,request:i,event:this.event})||void 0;return n}async cachePut(e,t){const n=x(e);await te(0);const a=await this.getCacheKey(n,"write");if(!t)throw new l("cache-put-with-no-response",{url:ee(a.url)});const r=await this._ensureResponseSafeToCache(t);if(!r)return!1;const{cacheName:i,matchOptions:c}=this._strategy,o=await self.caches.open(i),h=this.hasCallback("cacheDidUpdate"),b=h?await J(o,a.clone(),["__WB_REVISION__"],c):null;try{await o.put(a,h?r.clone():r)}catch(u){if(u instanceof Error)throw u.name==="QuotaExceededError"&&await Z(),u}for(const u of this.iterateCallbacks("cacheDidUpdate"))await u({cacheName:i,oldResponse:b,newResponse:r.clone(),request:a,event:this.event});return!0}async getCacheKey(e,t){const n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let a=e;for(const r of this.iterateCallbacks("cacheKeyWillBeUsed"))a=x(await r({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[n]=a}return this._cacheKeys[n]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const n=this._pluginStateMap.get(t);yield r=>{const i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(const a of this.iterateCallbacks("cacheWillUpdate"))if(t=await a({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}}class S{constructor(e={}){this.cacheName=g.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,n=typeof e.request=="string"?new Request(e.request):e.request,a="params"in e?e.params:void 0,r=new ce(this,{event:t,request:n,params:a}),i=this._getResponse(r,n,t),c=this._awaitComplete(i,r,n,t);return[i,c]}async _getResponse(e,t,n){await e.runCallbacks("handlerWillStart",{event:n,request:t});let a;try{if(a=await this._handle(t,e),!a||a.type==="error")throw new l("no-response",{url:t.url})}catch(r){if(r instanceof Error){for(const i of e.iterateCallbacks("handlerDidError"))if(a=await i({error:r,event:n,request:t}),a)break}if(!a)throw r}for(const r of e.iterateCallbacks("handlerWillRespond"))a=await r({event:n,request:t,response:a});return a}async _awaitComplete(e,t,n,a){let r,i;try{r=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:a,request:n,response:r}),await t.doneWaiting()}catch(c){c instanceof Error&&(i=c)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:n,response:r,error:i}),t.destroy(),i)throw i}}class oe extends S{async _handle(e,t){let n=await t.cacheMatch(e),a;if(!n)try{n=await t.fetchAndCachePut(e)}catch(r){r instanceof Error&&(a=r)}if(!n)throw new l("no-response",{url:e.url,error:a});return n}}const he=(s,e)=>e.some(t=>s instanceof t);let B,W;function le(){return B||(B=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ue(){return W||(W=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const j=new WeakMap,D=new WeakMap,F=new WeakMap,L=new WeakMap,U=new WeakMap;function de(s){const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("success",r),s.removeEventListener("error",i)},r=()=>{t(f(s.result)),a()},i=()=>{n(s.error),a()};s.addEventListener("success",r),s.addEventListener("error",i)});return e.then(t=>{t instanceof IDBCursor&&j.set(t,s)}).catch(()=>{}),U.set(e,s),e}function fe(s){if(D.has(s))return;const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("complete",r),s.removeEventListener("error",i),s.removeEventListener("abort",i)},r=()=>{t(),a()},i=()=>{n(s.error||new DOMException("AbortError","AbortError")),a()};s.addEventListener("complete",r),s.addEventListener("error",i),s.addEventListener("abort",i)});D.set(s,e)}let T={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return D.get(s);if(e==="objectStoreNames")return s.objectStoreNames||F.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return f(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function pe(s){T=s(T)}function ge(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const n=s.call(k(this),e,...t);return F.set(n,e.sort?e.sort():[e]),f(n)}:ue().includes(s)?function(...e){return s.apply(k(this),e),f(j.get(this))}:function(...e){return f(s.apply(k(this),e))}}function me(s){return typeof s=="function"?ge(s):(s instanceof IDBTransaction&&fe(s),he(s,le())?new Proxy(s,T):s)}function f(s){if(s instanceof IDBRequest)return de(s);if(L.has(s))return L.get(s);const e=me(s);return e!==s&&(L.set(s,e),U.set(e,s)),e}const k=s=>U.get(s);function ye(s,e,{blocked:t,upgrade:n,blocking:a,terminated:r}={}){const i=indexedDB.open(s,e),c=f(i);return n&&i.addEventListener("upgradeneeded",o=>{n(f(i.result),o.oldVersion,o.newVersion,f(i.transaction),o)}),t&&i.addEventListener("blocked",o=>t(o.oldVersion,o.newVersion,o)),c.then(o=>{r&&o.addEventListener("close",()=>r()),a&&o.addEventListener("versionchange",h=>a(h.oldVersion,h.newVersion,h))}).catch(()=>{}),c}function we(s,{blocked:e}={}){const t=indexedDB.deleteDatabase(s);return e&&t.addEventListener("blocked",n=>e(n.oldVersion,n)),f(t).then(()=>{})}const _e=["get","getKey","getAll","getAllKeys","count"],Re=["put","add","delete","clear"],P=new Map;function q(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(P.get(e))return P.get(e);const t=e.replace(/FromIndex$/,""),n=e!==t,a=Re.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||_e.includes(t)))return;const r=async function(i,...c){const o=this.transaction(i,a?"readwrite":"readonly");let h=o.store;return n&&(h=h.index(c.shift())),(await Promise.all([h[t](...c),a&&o.done]))[0]};return P.set(e,r),r}pe(s=>({...s,get:(e,t,n)=>q(e,t)||s.get(e,t,n),has:(e,t)=>!!q(e,t)||s.has(e,t)}));try{self["workbox:expiration:7.2.0"]&&_()}catch{}const be="workbox-expiration",R="cache-entries",H=s=>{const e=new URL(s,location.href);return e.hash="",e.href};class Ce{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(R,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&we(this._cacheName)}async setTimestamp(e,t){e=H(e);const n={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},r=(await this.getDb()).transaction(R,"readwrite",{durability:"relaxed"});await r.store.put(n),await r.done}async getTimestamp(e){const n=await(await this.getDb()).get(R,this._getId(e));return n==null?void 0:n.timestamp}async expireEntries(e,t){const n=await this.getDb();let a=await n.transaction(R).store.index("timestamp").openCursor(null,"prev");const r=[];let i=0;for(;a;){const o=a.value;o.cacheName===this._cacheName&&(e&&o.timestamp=t?r.push(a.value):i++),a=await a.continue()}const c=[];for(const o of r)await n.delete(R,o.id),c.push(o.url);return c}_getId(e){return this._cacheName+"|"+H(e)}async getDb(){return this._db||(this._db=await ye(be,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class xe{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new Ce(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-this._maxAgeSeconds*1e3:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),n=await self.caches.open(this._cacheName);for(const a of t)await n.delete(a,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,v(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),n=Date.now()-this._maxAgeSeconds*1e3;return t!==void 0?t{if(!r)return null;const i=this._isResponseDateFresh(r),c=this._getCacheExpiration(a);v(c.expireEntries());const o=c.updateTimestamp(n.url);if(t)try{t.waitUntil(o)}catch{}return i?r:null},this.cacheDidUpdate=async({cacheName:t,request:n})=>{const a=this._getCacheExpiration(t);await a.updateTimestamp(n.url),await a.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&Q(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===g.getRuntimeName())throw new l("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new xe(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(t===null)return!0;const n=Date.now();return t>=n-this._maxAgeSeconds*1e3}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),a=new Date(t).getTime();return isNaN(a)?null:a}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}try{self["workbox:precaching:7.2.0"]&&_()}catch{}const De="__WB_REVISION__";function Le(s){if(!s)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(typeof s=="string"){const r=new URL(s,location.href);return{cacheKey:r.href,url:r.href}}const{revision:e,url:t}=s;if(!t)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(!e){const r=new URL(t,location.href);return{cacheKey:r.href,url:r.href}}const n=new URL(t,location.href),a=new URL(t,location.href);return n.searchParams.set(De,e),{cacheKey:n.href,url:a.href}}class Ue{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type==="install"&&t&&t.originalRequest&&t.originalRequest instanceof Request){const a=t.originalRequest.url;n?this.notUpdatedURLs.push(a):this.updatedURLs.push(a)}return n}}}class Te{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:t,params:n})=>{const a=(n==null?void 0:n.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return a?new Request(a,{headers:t.headers}):t},this._precacheController=e}}class p extends S{constructor(e={}){e.cacheName=g.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=e.fallbackToNetwork!==!1,this.plugins.push(p.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const n=await t.cacheMatch(e);return n||(t.event&&t.event.type==="install"?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let n;const a=t.params||{};if(this._fallbackToNetwork){const r=a.integrity,i=e.integrity,c=!i||i===r;n=await t.fetch(new Request(e,{integrity:e.mode!=="no-cors"?i||r:void 0})),r&&c&&e.mode!=="no-cors"&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,n.clone()))}else throw new l("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return n}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const n=await t.fetch(e);if(!await t.cachePut(e,n.clone()))throw new l("bad-precaching-response",{url:e.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[n,a]of this.plugins.entries())a!==p.copyRedirectedCacheableResponsesPlugin&&(a===p.defaultPrecacheCacheabilityPlugin&&(e=n),a.cacheWillUpdate&&t++);t===0?this.plugins.push(p.defaultPrecacheCacheabilityPlugin):t>1&&e!==null&&this.plugins.splice(e,1)}}p.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:s}){return!s||s.status>=400?null:s}},p.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:s}){return s.redirected?await se(s):s}};class ke{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new p({cacheName:g.getPrecacheName(e),plugins:[...t,new Te({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const t=[];for(const n of e){typeof n=="string"?t.push(n):n&&n.revision===void 0&&t.push(n.url);const{cacheKey:a,url:r}=Le(n),i=typeof n!="string"&&n.revision?"reload":"default";if(this._urlsToCacheKeys.has(r)&&this._urlsToCacheKeys.get(r)!==a)throw new l("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(r),secondEntry:a});if(typeof n!="string"&&n.integrity){if(this._cacheKeysToIntegrities.has(a)&&this._cacheKeysToIntegrities.get(a)!==n.integrity)throw new l("add-to-cache-list-conflicting-integrities",{url:r});this._cacheKeysToIntegrities.set(a,n.integrity)}if(this._urlsToCacheKeys.set(r,a),this._urlsToCacheModes.set(r,i),t.length>0){const c=`Workbox is precaching URLs without revision info: ${t.join(", ")} -This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return K(e,async()=>{const t=new Ue;this.strategy.plugins.push(t);for(const[r,i]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(i),o=this._urlsToCacheModes.get(r),h=new Request(r,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:h,event:e}))}const{updatedURLs:n,notUpdatedURLs:a}=t;return{updatedURLs:n,notUpdatedURLs:a}})}activate(e){return K(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),a=new Set(this._urlsToCacheKeys.values()),r=[];for(const i of n)a.has(i.url)||(await t.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let I;const V=()=>(I||(I=new ke),I);function Pe(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*Ie(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:a}={}){const r=new URL(s,location.href);r.hash="",yield r.href;const i=Pe(r,e);if(yield i.href,t&&i.pathname.endsWith("/")){const c=new URL(i.href);c.pathname+=t,yield c.href}if(n){const c=new URL(i.href);c.pathname+=".html",yield c.href}if(a){const c=a({url:r});for(const o of c)yield o.href}}class Ne extends y{constructor(e,t){const n=({request:a})=>{const r=e.getURLsToCacheKeys();for(const i of Ie(a.url,t)){const c=r.get(i);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(n,e.strategy)}}function Me(s){const e=V(),t=new Ne(e,s);O(t)}const ve="-precache-",Ke=async(s,e=ve)=>{const n=(await self.caches.keys()).filter(a=>a.includes(e)&&a.includes(self.registration.scope)&&a!==s);return await Promise.all(n.map(a=>self.caches.delete(a))),n};function Ae(){self.addEventListener("activate",s=>{const e=g.getPrecacheName();s.waitUntil(Ke(e).then(t=>{}))})}function Oe(s){V().precache(s)}function Se(s,e){Oe(s),Me(e)}const Be=["raw.githubusercontent.com","api.github.com","cors.bubblesort.me"];self.__WB_DISABLE_DEV_LOGS=!0,self.addEventListener("message",s=>{s.data&&s.data.type==="SKIP_WAITING"&&self.skipWaiting()}),ne(),Ae(),O(({url:s})=>Be.includes(s.hostname),new oe({cacheName:"github-cache",matchOptions:{ignoreVary:!0},plugins:[new Ee({maxAgeSeconds:5*60})]})),Se([{"revision":null,"url":"assets/index-DOiCjgQw.css"},{"revision":null,"url":"assets/index-H0XOl9id.js"},{"revision":null,"url":"assets/KFOlCnqEu92Fr1MmWUlfABc4EsA-jruQITdB.woff2"},{"revision":null,"url":"assets/KFOlCnqEu92Fr1MmWUlfBBc4-CbYYDfWS.woff2"},{"revision":null,"url":"assets/KFOlCnqEu92Fr1MmWUlfBxc4EsA-Bs05n1ZH.woff2"},{"revision":null,"url":"assets/KFOlCnqEu92Fr1MmWUlfCBc4EsA-CqebB7cL.woff2"},{"revision":null,"url":"assets/KFOlCnqEu92Fr1MmWUlfChc4EsA-DchBbzVz.woff2"},{"revision":null,"url":"assets/KFOlCnqEu92Fr1MmWUlfCRc4EsA-CyZgh00P.woff2"},{"revision":null,"url":"assets/KFOlCnqEu92Fr1MmWUlfCxc4EsA-CBbheh0s.woff2"},{"revision":null,"url":"assets/KFOmCnqEu92Fr1Mu4mxK-DXyFPIdK.woff2"},{"revision":null,"url":"assets/KFOmCnqEu92Fr1Mu4WxKOzY-LPh2sqOm.woff2"},{"revision":null,"url":"assets/KFOmCnqEu92Fr1Mu5mxKOzY-BiRJyiea.woff2"},{"revision":null,"url":"assets/KFOmCnqEu92Fr1Mu72xKOzY-D76n7Daw.woff2"},{"revision":null,"url":"assets/KFOmCnqEu92Fr1Mu7GxKOzY-DgXbz5gU.woff2"},{"revision":null,"url":"assets/KFOmCnqEu92Fr1Mu7mxKOzY-Dduq6i1a.woff2"},{"revision":null,"url":"assets/KFOmCnqEu92Fr1Mu7WxKOzY-DhTUfTw_.woff2"},{"revision":null,"url":"assets/virtual_pwa-register-Bx2ilWUr.js"},{"revision":null,"url":"assets/workbox-window.prod.es5-B9K5rw8f.js"},{"revision":"6ce0e5a8d9a0d3c0c9ace2f223b7068a","url":"favicon.ico"},{"revision":"d4bc03e2017da139e2a4603eaf8195a1","url":"favicon.svg"},{"revision":"988ee9f256c3b730bb4e7771e18b4848","url":"gt20.glb"},{"revision":"3bf85313fcf8a20fe0f894c7a1c49544","url":"index.html"},{"revision":"ae1e7c12dbec082dc4101ce77ff08e34","url":"manifest.webmanifest"},{"revision":"c5616857dd9f8ee730a159f701da92f6","url":"osd_background.jpg"},{"revision":"4c1e1e57346542f8fd4747cd88283300","url":"osd_logo.png"},{"revision":"2de77aadd0392a044c8954b4c51557b6","url":"osd/betaflight.png"},{"revision":"7f4ba3bdccda9ca69f2440e3f8938d05","url":"osd/bold.png"},{"revision":"772349aafae91d4ffb4593623bd43eb3","url":"osd/clarity.png"},{"revision":"499dabcf42c7daa9f57df69d9226b9c7","url":"osd/default.png"},{"revision":"85ae0a13d466af533c71f0c77a33f7c9","url":"osd/digital.png"},{"revision":"d33a8a1111380b4d8695c07f2f3e8d52","url":"osd/extra_large.png"},{"revision":"5ca8a29e5c03412804f56f909df13b4c","url":"osd/hdzero_quic.png"},{"revision":"760b7aeba8f52775bcfd391930192408","url":"osd/impact_mini.png"},{"revision":"063bfdbdd6c093259ec3734081fa6df9","url":"osd/impact.png"},{"revision":"a9a4c1e13773eb117a552408f1f6f4ae","url":"osd/large.png"},{"revision":"d86544fadae762bde5a852b71dc5df91","url":"osd/vision.png"},{"revision":"d616d98486a4b04ce126936035465084","url":"pwa.png"},{"revision":"f77c87f977e0fcce05a6df46c885a129","url":"robots.txt"},{"revision":"d616d98486a4b04ce126936035465084","url":"pwa.png"},{"revision":"ae1e7c12dbec082dc4101ce77ff08e34","url":"manifest.webmanifest"}])})(); +This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return K(e,async()=>{const t=new Ue;this.strategy.plugins.push(t);for(const[r,i]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(i),o=this._urlsToCacheModes.get(r),h=new Request(r,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:h,event:e}))}const{updatedURLs:n,notUpdatedURLs:a}=t;return{updatedURLs:n,notUpdatedURLs:a}})}activate(e){return K(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),a=new Set(this._urlsToCacheKeys.values()),r=[];for(const i of n)a.has(i.url)||(await t.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let I;const V=()=>(I||(I=new ke),I);function Pe(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*Ie(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:a}={}){const r=new URL(s,location.href);r.hash="",yield r.href;const i=Pe(r,e);if(yield i.href,t&&i.pathname.endsWith("/")){const c=new URL(i.href);c.pathname+=t,yield c.href}if(n){const c=new URL(i.href);c.pathname+=".html",yield c.href}if(a){const c=a({url:r});for(const o of c)yield o.href}}class Ne extends y{constructor(e,t){const n=({request:a})=>{const r=e.getURLsToCacheKeys();for(const i of Ie(a.url,t)){const c=r.get(i);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(n,e.strategy)}}function Me(s){const e=V(),t=new Ne(e,s);O(t)}const ve="-precache-",Ke=async(s,e=ve)=>{const n=(await self.caches.keys()).filter(a=>a.includes(e)&&a.includes(self.registration.scope)&&a!==s);return await Promise.all(n.map(a=>self.caches.delete(a))),n};function Ae(){self.addEventListener("activate",s=>{const e=g.getPrecacheName();s.waitUntil(Ke(e).then(t=>{}))})}function Oe(s){V().precache(s)}function Se(s,e){Oe(s),Me(e)}const Be=["raw.githubusercontent.com","api.github.com","cors.bubblesort.me"];self.__WB_DISABLE_DEV_LOGS=!0,self.addEventListener("message",s=>{s.data&&s.data.type==="SKIP_WAITING"&&self.skipWaiting()}),ne(),Ae(),O(({url:s})=>Be.includes(s.hostname),new oe({cacheName:"github-cache",matchOptions:{ignoreVary:!0},plugins:[new Ee({maxAgeSeconds:5*60})]})),Se([{"revision":null,"url":"assets/index-BJxQEF3L.js"},{"revision":null,"url":"assets/index-DOiCjgQw.css"},{"revision":null,"url":"assets/KFOlCnqEu92Fr1MmWUlfABc4EsA-jruQITdB.woff2"},{"revision":null,"url":"assets/KFOlCnqEu92Fr1MmWUlfBBc4-CbYYDfWS.woff2"},{"revision":null,"url":"assets/KFOlCnqEu92Fr1MmWUlfBxc4EsA-Bs05n1ZH.woff2"},{"revision":null,"url":"assets/KFOlCnqEu92Fr1MmWUlfCBc4EsA-CqebB7cL.woff2"},{"revision":null,"url":"assets/KFOlCnqEu92Fr1MmWUlfChc4EsA-DchBbzVz.woff2"},{"revision":null,"url":"assets/KFOlCnqEu92Fr1MmWUlfCRc4EsA-CyZgh00P.woff2"},{"revision":null,"url":"assets/KFOlCnqEu92Fr1MmWUlfCxc4EsA-CBbheh0s.woff2"},{"revision":null,"url":"assets/KFOmCnqEu92Fr1Mu4mxK-DXyFPIdK.woff2"},{"revision":null,"url":"assets/KFOmCnqEu92Fr1Mu4WxKOzY-LPh2sqOm.woff2"},{"revision":null,"url":"assets/KFOmCnqEu92Fr1Mu5mxKOzY-BiRJyiea.woff2"},{"revision":null,"url":"assets/KFOmCnqEu92Fr1Mu72xKOzY-D76n7Daw.woff2"},{"revision":null,"url":"assets/KFOmCnqEu92Fr1Mu7GxKOzY-DgXbz5gU.woff2"},{"revision":null,"url":"assets/KFOmCnqEu92Fr1Mu7mxKOzY-Dduq6i1a.woff2"},{"revision":null,"url":"assets/KFOmCnqEu92Fr1Mu7WxKOzY-DhTUfTw_.woff2"},{"revision":null,"url":"assets/virtual_pwa-register-T0LD5wEJ.js"},{"revision":null,"url":"assets/workbox-window.prod.es5-B9K5rw8f.js"},{"revision":"6ce0e5a8d9a0d3c0c9ace2f223b7068a","url":"favicon.ico"},{"revision":"d4bc03e2017da139e2a4603eaf8195a1","url":"favicon.svg"},{"revision":"988ee9f256c3b730bb4e7771e18b4848","url":"gt20.glb"},{"revision":"3d7d0661d6212bfff230877ed7290052","url":"index.html"},{"revision":"ae1e7c12dbec082dc4101ce77ff08e34","url":"manifest.webmanifest"},{"revision":"c5616857dd9f8ee730a159f701da92f6","url":"osd_background.jpg"},{"revision":"4c1e1e57346542f8fd4747cd88283300","url":"osd_logo.png"},{"revision":"2de77aadd0392a044c8954b4c51557b6","url":"osd/betaflight.png"},{"revision":"7f4ba3bdccda9ca69f2440e3f8938d05","url":"osd/bold.png"},{"revision":"772349aafae91d4ffb4593623bd43eb3","url":"osd/clarity.png"},{"revision":"499dabcf42c7daa9f57df69d9226b9c7","url":"osd/default.png"},{"revision":"85ae0a13d466af533c71f0c77a33f7c9","url":"osd/digital.png"},{"revision":"d33a8a1111380b4d8695c07f2f3e8d52","url":"osd/extra_large.png"},{"revision":"5ca8a29e5c03412804f56f909df13b4c","url":"osd/hdzero_quic.png"},{"revision":"760b7aeba8f52775bcfd391930192408","url":"osd/impact_mini.png"},{"revision":"063bfdbdd6c093259ec3734081fa6df9","url":"osd/impact.png"},{"revision":"a9a4c1e13773eb117a552408f1f6f4ae","url":"osd/large.png"},{"revision":"d86544fadae762bde5a852b71dc5df91","url":"osd/vision.png"},{"revision":"d616d98486a4b04ce126936035465084","url":"pwa.png"},{"revision":"f77c87f977e0fcce05a6df46c885a129","url":"robots.txt"},{"revision":"d616d98486a4b04ce126936035465084","url":"pwa.png"},{"revision":"ae1e7c12dbec082dc4101ce77ff08e34","url":"manifest.webmanifest"}])})();