@gjsify/example-dom-three-geometry-teapot 0.54.0 → 0.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +8176 -3044
- package/dist/gjs.js +31 -31
- package/dist/gjs.node.mjs +32 -32
- package/dist/index.html +0 -1
- package/dist/webgl.css +3 -3
- package/package.json +7 -7
- package/src/browser/browser.ts +36 -123
- package/src/browser/index.html +0 -1
- package/src/browser/webgl.css +3 -3
package/dist/gjs.node.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{createRequire as e}from"node:module";import"@gjsify/node-gi/globals";import t from"@gjsify/node-gi/cairo";import n from"@gjsify/node-gi/system";import{Blob as r,Buffer as i,File as a}from"node:buffer";import o,{PassThrough as s,Readable as c,Stream as l,pipeline as u}from"node:stream";import{isIP as d}from"node:net";var f=Object.create,p=Object.defineProperty,__name$1=(e,t)=>p(e,`name`,{value:t,configurable:!0}),m=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,g=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty,__esmMin=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},__commonJSMin=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),__exportAll$1=(e,t)=>{let n={};for(var r in e)p(n,r,{get:e[r],enumerable:!0});return t||p(n,Symbol.toStringTag,{value:`Module`}),n},__copyProps=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=h(t),a=0,o=i.length,s;a<o;a++)s=i[a],!_.call(e,s)&&s!==n&&p(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=m(t,s))||r.enumerable});return e},__toESM=(e,t,n)=>(n=e==null?{}:f(g(e)),__copyProps(t||!e||!e.__esModule?p(n,`default`,{value:e,enumerable:!0}):n,e));for(let e of[`Headers`,`Request`,`Response`,`fetch`])try{delete globalThis[e]}catch{}var v=Object.defineProperty,__exportAll=(e,t)=>{let n={};for(var r in e)v(n,r,{get:e[r],enumerable:!0});return t||v(n,Symbol.toStringTag,{value:`Module`}),n};__exportAll({attributes:()=>O,childNodesList:()=>x,elementChildren:()=>S,isConnected:()=>C,localName:()=>T,name:()=>A,namespaceURI:()=>E,nodeType:()=>y,ownerElement:()=>te,parentNode:()=>b,prefix:()=>D,propertyEventListeners:()=>k,tagName:()=>w,value:()=>ee});const y=Symbol(`nodeType`),b=Symbol(`parentNode`),x=Symbol(`childNodesList`),S=Symbol(`elementChildren`),C=Symbol(`isConnected`),w=Symbol(`tagName`),T=Symbol(`localName`),E=Symbol(`namespaceURI`),D=Symbol(`prefix`),O=Symbol(`attributes`),k=Symbol(`propertyEventListeners`),A=Symbol(`name`),ee=Symbol(`value`),te=Symbol(`ownerElement`),j={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11};var NodeList=class{constructor(e){this._items=e}get length(){return this._items.length}item(e){return this._items[e]??null}forEach(e,t){for(let n=0;n<this._items.length;n++)e.call(t,this._items[n],n,this)}entries(){return this._items.entries()}keys(){return this._items.keys()}values(){return this._items.values()}[Symbol.iterator](){return this._items[Symbol.iterator]()}get[Symbol.toStringTag](){return`NodeList`}};const ne=globalThis.DOMException,re=Symbol(`type`),ie=Symbol(`bubbles`),ae=Symbol(`cancelable`),oe=Symbol(`composed`),se=Symbol(`target`),ce=Symbol(`currentTarget`),le=Symbol(`eventPhase`),ue=Symbol(`defaultPrevented`),de=Symbol(`isTrusted`),fe=Symbol(`timeStamp`),pe=Symbol(`stop`),me=Symbol(`immediateStop`),he=Symbol(`dispatching`),ge=Symbol(`inPassiveListener`);var Event=class{[re];[ie];[ae];[oe];[se]=null;[ce]=null;[le]=0;[ue]=!1;[de]=!1;[fe];[pe]=!1;[me]=!1;[he]=!1;[ge]=!1;get type(){return this[re]}get bubbles(){return this[ie]}get cancelable(){return this[ae]}get composed(){return this[oe]}get target(){return this[se]}get currentTarget(){return this[ce]}get eventPhase(){return this[le]}get defaultPrevented(){return this[ue]}get timeStamp(){return this[fe]}get cancelBubble(){return this[pe]}set cancelBubble(e){e&&this.stopPropagation()}get returnValue(){return!this[ue]}set returnValue(e){e||this.preventDefault()}get srcElement(){return this[se]}static NONE=0;static CAPTURING_PHASE=1;static AT_TARGET=2;static BUBBLING_PHASE=3;get[Symbol.toStringTag](){return`Event`}constructor(e,t){this[re]=e,this[ie]=t?.bubbles??!1,this[ae]=t?.cancelable??!1,this[oe]=t?.composed??!1,this[fe]=Date.now(),Object.defineProperty(this,"isTrusted",{get:()=>this[de],enumerable:!0,configurable:!1})}composedPath(){return this[ce]?[this[ce]]:[]}preventDefault(){this[ae]&&!this[ge]&&(this[ue]=!0)}stopPropagation(){this[pe]=!0}stopImmediatePropagation(){this[pe]=!0,this[me]=!0}},CustomEvent$1=class extends Event{static{__name$1(this,`CustomEvent`)}detail;constructor(e,t){super(e,t),this.detail=t?.detail}},MessageEvent=class extends Event{data;origin;lastEventId;source;ports;constructor(e,t){super(e,t),this.data=t?.data??null,this.origin=t?.origin??``,this.lastEventId=t?.lastEventId??``,this.source=t?.source??null,this.ports=t?.ports??[]}get[Symbol.toStringTag](){return`MessageEvent`}},ErrorEvent=class extends Event{message;filename;lineno;colno;error;constructor(e,t){super(e,t),this.message=t?.message??``,this.filename=t?.filename??``,this.lineno=t?.lineno??0,this.colno=t?.colno??0,this.error=t?.error??null}get[Symbol.toStringTag](){return`ErrorEvent`}},CloseEvent=class extends Event{code;reason;wasClean;constructor(e,t){super(e,t),this.code=t?.code??0,this.reason=t?.reason??``,this.wasClean=t?.wasClean??!1}get[Symbol.toStringTag](){return`CloseEvent`}},ProgressEvent$1=class extends Event{static{__name$1(this,`ProgressEvent`)}lengthComputable;loaded;total;constructor(e,t){super(e,t),this.lengthComputable=t?.lengthComputable??!1,this.loaded=t?.loaded??0,this.total=t?.total??0}get[Symbol.toStringTag](){return`ProgressEvent`}},EventTarget=class{#e=new Map;get[Symbol.toStringTag](){return`EventTarget`}addEventListener(e,t,n){if(t===null)return;let r=typeof n==`boolean`?n:n?.capture??!1,i=typeof n==`object`?n?.once??!1:!1,a=typeof n==`object`?n?.passive??!1:!1,o=this.#e.get(e);o||(o=[],this.#e.set(e,o));for(let e of o)if(e.listener===t&&e.capture===r)return;let s={listener:t,capture:r,once:i,passive:a,removed:!1};o.push(s),typeof n==`object`&&n?.signal&&n.signal.addEventListener(`abort`,()=>{this.removeEventListener(e,t,{capture:r})},{once:!0})}removeEventListener(e,t,n){if(t===null)return;let r=typeof n==`boolean`?n:n?.capture??!1,i=this.#e.get(e);if(!i)return;let a=i.findIndex(e=>e.listener===t&&e.capture===r);a!==-1&&(i[a].removed=!0,i.splice(a,1),i.length===0&&this.#e.delete(e))}dispatchEvent(e){let t=e;if(t[he])throw new ne(`The event is already being dispatched.`,`InvalidStateError`);t[he]=!0,t[se]=this,t[ce]=this,t[le]=Event.AT_TARGET;try{let n=this.#e.get(e.type);if(n){let r=[...n];for(let n of r)if(!n.removed){if(t[me]||t[pe])break;n.once&&this.removeEventListener(e.type,n.listener,{capture:n.capture});try{n.passive&&(t[ge]=!0),typeof n.listener==`function`?n.listener.call(this,e):typeof n.listener.handleEvent==`function`&&n.listener.handleEvent.call(n.listener,e)}catch(e){reportListenerException(e)}finally{t[ge]=!1}}}}finally{t[le]=Event.NONE,t[ce]=null,t[he]=!1}return!e.defaultPrevented}};function reportListenerException(e){try{let t=globalThis;if(typeof t.reportError==`function`)t.reportError(e);else if(e instanceof Error){let t=`${e.name}: ${e.message}`;console.error(e.stack?`${t}\n${e.stack}`:t)}else console.error(String(e))}catch{}}for(let[e,t]of[[`NONE`,0],[`CAPTURING_PHASE`,1],[`AT_TARGET`,2],[`BUBBLING_PHASE`,3]])Object.defineProperty(Event.prototype,e,{value:t,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(Event,e,{value:t,writable:!1,enumerable:!0,configurable:!1});var UIEvent=class extends Event{detail;view;constructor(e,t){super(e,t),this.detail=t?.detail??0,this.view=null}get[Symbol.toStringTag](){return`UIEvent`}},MouseEvent=class extends UIEvent{altKey;button;buttons;clientX;clientY;ctrlKey;metaKey;movementX;movementY;offsetX;offsetY;screenX;screenY;shiftKey;relatedTarget;get pageX(){return this.clientX}get pageY(){return this.clientY}get x(){return this.clientX}get y(){return this.clientY}constructor(e,t){super(e,t),this.altKey=t?.altKey??!1,this.button=t?.button??0,this.buttons=t?.buttons??0,this.clientX=t?.clientX??0,this.clientY=t?.clientY??0,this.ctrlKey=t?.ctrlKey??!1,this.metaKey=t?.metaKey??!1,this.movementX=t?.movementX??0,this.movementY=t?.movementY??0,this.offsetX=t?.offsetX??0,this.offsetY=t?.offsetY??0,this.screenX=t?.screenX??0,this.screenY=t?.screenY??0,this.shiftKey=t?.shiftKey??!1,this.relatedTarget=t?.relatedTarget??null}getModifierState(e){switch(e){case`Alt`:return this.altKey;case`Control`:return this.ctrlKey;case`Meta`:return this.metaKey;case`Shift`:return this.shiftKey;default:return!1}}get[Symbol.toStringTag](){return`MouseEvent`}},PointerEvent=class extends MouseEvent{pointerId;width;height;pressure;tangentialPressure;tiltX;tiltY;twist;altitudeAngle;azimuthAngle;pointerType;isPrimary;constructor(e,t){super(e,t),this.pointerId=t?.pointerId??0,this.width=t?.width??1,this.height=t?.height??1,this.pressure=t?.pressure??0,this.tangentialPressure=t?.tangentialPressure??0,this.tiltX=t?.tiltX??0,this.tiltY=t?.tiltY??0,this.twist=t?.twist??0,this.altitudeAngle=t?.altitudeAngle??Math.PI/2,this.azimuthAngle=t?.azimuthAngle??0,this.pointerType=t?.pointerType??``,this.isPrimary=t?.isPrimary??!1}getCoalescedEvents(){return[]}getPredictedEvents(){return[]}get[Symbol.toStringTag](){return`PointerEvent`}},KeyboardEvent=class extends UIEvent{altKey;code;ctrlKey;isComposing;key;location;metaKey;repeat;shiftKey;keyCode;which;static DOM_KEY_LOCATION_STANDARD=0;static DOM_KEY_LOCATION_LEFT=1;static DOM_KEY_LOCATION_RIGHT=2;static DOM_KEY_LOCATION_NUMPAD=3;constructor(e,t){super(e,t),this.altKey=t?.altKey??!1,this.code=t?.code??``,this.ctrlKey=t?.ctrlKey??!1,this.isComposing=t?.isComposing??!1,this.key=t?.key??``,this.location=t?.location??0,this.metaKey=t?.metaKey??!1,this.repeat=t?.repeat??!1,this.shiftKey=t?.shiftKey??!1,this.keyCode=t?.keyCode??0,this.which=t?.which??0}getModifierState(e){switch(e){case`Alt`:return this.altKey;case`Control`:return this.ctrlKey;case`Meta`:return this.metaKey;case`Shift`:return this.shiftKey;default:return!1}}get[Symbol.toStringTag](){return`KeyboardEvent`}},WheelEvent=class extends MouseEvent{deltaX;deltaY;deltaZ;deltaMode;static DOM_DELTA_PIXEL=0;static DOM_DELTA_LINE=1;static DOM_DELTA_PAGE=2;constructor(e,t){super(e,t),this.deltaX=t?.deltaX??0,this.deltaY=t?.deltaY??0,this.deltaZ=t?.deltaZ??0,this.deltaMode=t?.deltaMode??0}get[Symbol.toStringTag](){return`WheelEvent`}},FocusEvent=class extends UIEvent{relatedTarget;constructor(e,t){super(e,t),this.relatedTarget=t?.relatedTarget??null}get[Symbol.toStringTag](){return`FocusEvent`}};let _e,ve,ye,be,xe;var Se=class Node extends EventTarget{constructor(...e){super(...e),this.ELEMENT_NODE=j.ELEMENT_NODE,this.ATTRIBUTE_NODE=j.ATTRIBUTE_NODE,this.TEXT_NODE=j.TEXT_NODE,this.CDATA_SECTION_NODE=j.CDATA_SECTION_NODE,this.PROCESSING_INSTRUCTION_NODE=j.PROCESSING_INSTRUCTION_NODE,this.COMMENT_NODE=j.COMMENT_NODE,this.DOCUMENT_NODE=j.DOCUMENT_NODE,this.DOCUMENT_TYPE_NODE=j.DOCUMENT_TYPE_NODE,this.DOCUMENT_FRAGMENT_NODE=j.DOCUMENT_FRAGMENT_NODE,this[_e]=j.ELEMENT_NODE,this[ve]=null,this[ye]=[],this[be]=[],this[xe]=!1}static{this.ELEMENT_NODE=j.ELEMENT_NODE}static{this.ATTRIBUTE_NODE=j.ATTRIBUTE_NODE}static{this.TEXT_NODE=j.TEXT_NODE}static{this.CDATA_SECTION_NODE=j.CDATA_SECTION_NODE}static{this.PROCESSING_INSTRUCTION_NODE=j.PROCESSING_INSTRUCTION_NODE}static{this.COMMENT_NODE=j.COMMENT_NODE}static{this.DOCUMENT_NODE=j.DOCUMENT_NODE}static{this.DOCUMENT_TYPE_NODE=j.DOCUMENT_TYPE_NODE}static{this.DOCUMENT_FRAGMENT_NODE=j.DOCUMENT_FRAGMENT_NODE}static{this.DOCUMENT_POSITION_DISCONNECTED=1}static{this.DOCUMENT_POSITION_PRECEDING=2}static{this.DOCUMENT_POSITION_FOLLOWING=4}static{this.DOCUMENT_POSITION_CONTAINS=8}static{this.DOCUMENT_POSITION_CONTAINED_BY=16}static{this.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32}get nodeType(){return this[y]}get nodeName(){return``}get parentNode(){return this[b]}get parentElement(){let e=this[b];return e&&e[y]===j.ELEMENT_NODE?e:null}get childNodes(){return new NodeList(this[x])}get firstChild(){return this[x][0]??null}get lastChild(){let e=this[x];return e[e.length-1]??null}get previousSibling(){let e=this[b];if(!e)return null;let t=e[x],n=t.indexOf(this);return n>0?t[n-1]:null}get nextSibling(){let e=this[b];if(!e)return null;let t=e[x],n=t.indexOf(this);return n!==-1&&n<t.length-1?t[n+1]:null}get textContent(){return null}set textContent(e){}get nodeValue(){return null}set nodeValue(e){}get ownerDocument(){let e=this;for(;e[b];)e=e[b];let t=globalThis.document;return e===t?t:null}get isConnected(){return this[C]}hasChildNodes(){return this[x].length>0}contains(e){if(e===null)return!1;if(e===this)return!0;let t=e;for(;t;){if(t===this)return!0;t=t[b]}return!1}getRootNode(){let e=this;for(;e[b];)e=e[b];return e}appendChild(e){return e[b]&&e[b].removeChild(e),e[b]=this,this[x].push(e),e[y]===j.ELEMENT_NODE&&this[S].push(e),e}removeChild(e){let t=this[x],n=t.indexOf(e);if(n===-1)throw new DOMException(`Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.`,`NotFoundError`);if(t.splice(n,1),e[b]=null,e[y]===j.ELEMENT_NODE){let t=this[S].indexOf(e);t!==-1&&this[S].splice(t,1)}return e}insertBefore(e,t){if(t===null)return this.appendChild(e);let n=this[x],r=n.indexOf(t);if(r===-1)throw new DOMException(`Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.`,`NotFoundError`);if(e[b]&&e[b].removeChild(e),e[b]=this,n.splice(r,0,e),e[y]===j.ELEMENT_NODE){let t=this[S],i=t.length;for(let a=r;a<n.length;a++)if(n[a][y]===j.ELEMENT_NODE&&n[a]!==e){i=t.indexOf(n[a]);break}t.splice(i,0,e)}return e}replaceChild(e,t){return this.insertBefore(e,t),this.removeChild(t),t}_createCloneTarget(){return new this.constructor}cloneNode(e=!1){let t=this._createCloneTarget();if(t[y]=this[y],e)for(let e of this[x])t.appendChild(e.cloneNode(!0));return t}dispatchEvent(e){let t=super.dispatchEvent(e);if(e.bubbles&&!e.cancelBubble){let t=this[b];for(;t&&(Object.getPrototypeOf(Node.prototype).dispatchEvent.call(t,e),!e.cancelBubble);)t=t[b]}return t}get[(_e=y,ve=b,ye=x,be=S,xe=C,Symbol.toStringTag)](){return`Node`}};const Ce={isTag(e){return e[y]===j.ELEMENT_NODE},getName(e){return e[T]??``},getParent(e){return e.parentNode},getChildren(e){return e[x]},getSiblings(e){let t=e.parentNode;return t?t[x]:[e]},getAttributeValue(e,t){return e[y]===j.ELEMENT_NODE?e.getAttribute(t):null},getText(e){return e.textContent??``},caseSensitive:!1},we={html:`http://www.w3.org/1999/xhtml`,svg:`http://www.w3.org/2000/svg`,mathML:`http://www.w3.org/1998/Math/MathML`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};var Attr=class{constructor(e,t,n=null,r=null,i=null){this.specified=!0,this[A]=e,this[ee]=t,this[te]=i,this.namespaceURI=n,this.prefix=r;let a=e.indexOf(`:`);this.localName=a===-1?e:e.slice(a+1)}get name(){return this[A]}get value(){return this[ee]}set value(e){this[ee]=e}get ownerElement(){return this[te]}get[Symbol.toStringTag](){return`Attr`}},NamedNodeMap=class{constructor(e){this._items=[],this._ownerElement=e}get length(){return this._items.length}item(e){return this._items[e]??null}getNamedItem(e){return this._findByName(e)}getNamedItemNS(e,t){let n=e===``?null:e;for(let e of this._items)if(e.namespaceURI===n&&e.localName===t)return e;return null}setNamedItem(e){return this._setAttr(e)}setNamedItemNS(e){return this._setAttr(e)}removeNamedItem(e){let t=this._findByName(e);if(!t)throw new DOMException(`Failed to execute 'removeNamedItem' on 'NamedNodeMap': No item with name '${e}' was found.`,`NotFoundError`);return this._removeAttr(t),t}removeNamedItemNS(e,t){let n=this.getNamedItemNS(e,t);if(!n)throw new DOMException(`Failed to execute 'removeNamedItemNS' on 'NamedNodeMap': No item with namespace '${e}' and localName '${t}' was found.`,`NotFoundError`);return this._removeAttr(n),n}[Symbol.iterator](){return this._items[Symbol.iterator]()}get[Symbol.toStringTag](){return`NamedNodeMap`}_setNamedItem(e,t,n=null,r=null){let i=n===null?this._findByName(e):this.getNamedItemNS(n,e.includes(`:`)?e.split(`:`)[1]:e);if(i)i.value=t;else{let i=new Attr(e,t,n,r,this._ownerElement);this._items.push(i)}}_removeNamedItem(e){let t=this._findByName(e);return t?(this._removeAttr(t),!0):!1}_removeNamedItemNS(e,t){let n=this.getNamedItemNS(e,t);return n?(this._removeAttr(n),!0):!1}_findByName(e){let t=this._ownerElement.namespaceURI===we.html,n=t?e.toLowerCase():e;for(let e of this._items)if((t?e.name.toLowerCase():e.name)===n)return e;return null}_setAttr(e){let t=null;if(t=e.namespaceURI===null?this._findByName(e.name):this.getNamedItemNS(e.namespaceURI,e.localName),t){let n=new Attr(t.name,t.value,t.namespaceURI,t.prefix,t.ownerElement);return t.value=e.value,n}return this._items.push(e),null}_removeAttr(e){let t=this._items.indexOf(e);t!==-1&&this._items.splice(t,1)}};const M=/^([+-]?\d*)n\s*(?:([+-])\s*(\d+))?$/,Te=/^[+-]?\d+$/;function parseNth(e){let t=e.trim().toLowerCase();if(t===`odd`)return{a:2,b:1};if(t===`even`)return{a:2,b:0};let n=M.exec(t);if(n!==null){let e=n[1];return{a:e===``||e===`+`?1:e===`-`?-1:Number(e),b:n[3]===void 0?0:Number(n[2]+n[3])}}if(Te.test(t))return{a:0,b:Number(t)};throw SyntaxError(`'`+e+`' is not a valid An+B argument`)}function matchesNth(e,t){if(e.a===0)return t===e.b;let n=t-e.b;return e.a>0?n>=0&&n%e.a===0:n<=0&&n%e.a===0}const Ee=new Set([` `,` `,`
|
|
2
|
-
`,`\r`,`\f`]),N={"~":`element`,"|":`hyphen`,"^":`start`,$:`end`,"*":`any`,"!":`not`},De={"nth-child":`child`,"nth-last-child":`last-child`,"nth-of-type":`of-type`,"nth-last-of-type":`last-of-type`},Oe={"any-link":`:is(a, area, link)[href]`,disabled:`:is(:is(button, input, select, textarea, optgroup, option, fieldset)[disabled], optgroup[disabled] > option, fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *))`,enabled:`:is(button, input, select, textarea, optgroup, option, fieldset):not(:disabled)`,checked:`:is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)`,required:`:is(input, select, textarea)[required]`,optional:`:is(input, select, textarea):not([required])`,selected:`option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)`},ke=new Set([`before`,`after`,`first-line`,`first-letter`,`selection`,`placeholder`]),Ae=new Set([`hover`,`active`,`focus`,`focus-visible`,`focus-within`,`visited`,`link`,`target`,`target-within`,`playing`,`paused`,`current`,`past`,`future`]);function isNameChar(e){if(e===``)return!1;let t=e.codePointAt(0);return e===`-`||e===`_`||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t>127}function isNameStart(e){return e===`\\`||e!==`-`&&isNameChar(e)&&!(e>=`0`&&e<=`9`)}function isHexDigit(e){return e>=`0`&&e<=`9`||e>=`a`&&e<=`f`||e>=`A`&&e<=`F`}function isNthChar(e){return e>=`0`&&e<=`9`||e===`n`||e===`N`||e===`+`||e===`-`||Ee.has(e)}var SelectorParser=class{input;pos=0;constructor(e){this.input=e}parseSelectorList(e){let t=[this.parseComplex(e)];for(;this.peek()===`,`;)this.pos++,t.push(this.parseComplex(e));return t}atEnd(){return this.pos>=this.input.length}fail(e){throw SyntaxError(`Failed to parse selector '`+this.input+`': `+e)}peek(e=0){return this.input[this.pos+e]??``}skipWhitespace(){let e=this.pos;for(;Ee.has(this.peek());)this.pos++;return this.pos>e}expect(e){this.peek()!==e&&this.fail(`expected '`+e+`' at offset `+this.pos),this.pos++}parseComplex(e){this.skipWhitespace();let t=e?this.readLeadingCombinator():null,n=[this.parseCompound()],r=[];for(;;){let e=this.readCombinator();if(e===null)break;r.push(e),n.push(this.parseCompound())}return{compounds:n,combinators:r,leading:t}}readLeadingCombinator(){let e=this.peek();return e!==`>`&&e!==`+`&&e!==`~`?`descendant`:(this.pos++,this.skipWhitespace(),e===`>`?`child`:e===`+`?`adjacent`:`sibling`)}readCombinator(){let e=this.skipWhitespace(),t=this.peek();if(t===`>`||t===`+`||t===`~`)return this.pos++,this.skipWhitespace(),t===`>`?`child`:t===`+`?`adjacent`:`sibling`;if(t===`|`&&this.peek(1)===`|`&&this.fail(`the column combinator '||' needs a table layout`),t===``||t===`,`||t===`)`)return null;if(e)return`descendant`;this.fail(`unexpected '`+t+`' at offset `+this.pos)}parseCompound(){let e=[];for(;;){let t=this.peek();if(t===`*`)this.pos++,this.rejectNamespace(),e.push({kind:`universal`});else if(t===`#`)this.pos++,e.push({kind:`attribute`,name:`id`,action:`equals`,value:this.readName(),ignoreCase:!1});else if(t===`.`)this.pos++,e.push({kind:`attribute`,name:`class`,action:`element`,value:this.readName(),ignoreCase:!1});else if(t===`[`)e.push(this.parseAttribute());else if(t===`:`)for(let t of this.parsePseudo())e.push(t);else if(t===`|`)this.fail(`namespace selectors need a namespace map this parser is not given`);else if(isNameStart(t)){let t=this.readName();this.rejectNamespace(),e.push({kind:`type`,name:t})}else break}return e.length===0&&this.fail(`expected a selector at offset `+this.pos),e}rejectNamespace(){this.peek()===`|`&&this.peek(1)!==`=`&&this.fail(`namespace selectors need a namespace map this parser is not given`)}readName(){let e=``;for(;;){let t=this.peek();if(t===`\\`){e+=this.readEscape();continue}if(!isNameChar(t))break;e+=t,this.pos++}return e===``&&this.fail(`expected an identifier at offset `+this.pos),e}readEscape(){this.pos++;let e=``;for(;e.length<6&&isHexDigit(this.peek());)e+=this.peek(),this.pos++;if(e===``){let e=this.peek();return e===``&&this.fail(`a trailing backslash escapes nothing`),this.pos++,e}Ee.has(this.peek())&&this.pos++;let t=Number.parseInt(e,16);return t===0||t>1114111||t>=55296&&t<=57343?`�`:String.fromCodePoint(t)}readString(e){this.pos++;let t=``;for(;;){let n=this.peek();if(n===``&&this.fail(`unterminated string`),n===e)return this.pos++,t;if(n===`\\`){t+=this.readEscape();continue}t+=n,this.pos++}}parseAttribute(){this.expect(`[`),this.skipWhitespace(),(this.peek()===`|`||this.peek()===`*`)&&this.fail(`namespace selectors need a namespace map this parser is not given`);let e=this.readName();if(this.rejectNamespace(),this.skipWhitespace(),this.peek()===`]`)return this.pos++,{kind:`attribute`,name:e,action:`exists`,value:``,ignoreCase:null};let t;this.peek()===`=`?(t=`equals`,this.pos++):this.peek(1)===`=`&&Object.hasOwn(N,this.peek())?(t=N[this.peek()],this.pos+=2):this.fail(`'`+this.peek()+`' is not an attribute operator`),this.skipWhitespace();let n=this.peek(),r=n===`"`||n===`'`?this.readString(n):this.readName();this.skipWhitespace();let i=null,a=this.peek().toLowerCase();return(a===`i`||a===`s`)&&(i=a===`i`,this.pos++,this.skipWhitespace()),this.expect(`]`),{kind:`attribute`,name:e,action:t,value:r,ignoreCase:i}}parsePseudo(){this.pos++,this.peek()===`:`&&(this.pos++,this.fail(`pseudo-element '::`+this.readName()+`' has no meaning without rendering`));let e=this.readName().toLowerCase();if(e===`not`||e===`is`||e===`where`||e===`matches`||e===`has`){this.expect(`(`);let t=this.parseSelectorList(e===`has`);return this.expect(`)`),[{kind:e===`not`?`not`:e===`has`?`has`:`is`,selectors:t}]}if(Object.hasOwn(De,e))return[this.parseNthPseudo(De[e])];if(e===`first-child`)return[positional(`child`,1)];if(e===`last-child`)return[positional(`last-child`,1)];if(e===`only-child`)return[positional(`child`,1),positional(`last-child`,1)];if(e===`first-of-type`)return[positional(`of-type`,1)];if(e===`last-of-type`)return[positional(`last-of-type`,1)];if(e===`only-of-type`)return[positional(`of-type`,1),positional(`last-of-type`,1)];if(e===`empty`)return[{kind:`empty`}];if(e===`root`)return[{kind:`root`}];if(e===`scope`)return[{kind:`scope`}];if(Object.hasOwn(Oe,e))return[{kind:`is`,selectors:parseSelectorList(Oe[e])}];Ae.has(e)&&this.fail(`':`+e+`' is a user-state pseudo-class and needs a live document`),ke.has(e)&&this.fail(`pseudo-element ':`+e+`' has no meaning without rendering`),this.fail(`unknown pseudo-class ':`+e+`'`)}parseNthPseudo(e){this.expect(`(`);let t=parseNth(this.readNthArgument()),n=null;return this.readKeyword(`of`)&&(n=this.parseSelectorList(!1)),this.expect(`)`),{kind:`nth`,axis:e,formula:t,of:n}}readNthArgument(){if(this.skipWhitespace(),this.readKeyword(`odd`))return`odd`;if(this.readKeyword(`even`))return`even`;let e=this.pos;for(;isNthChar(this.peek());)this.pos++;return this.input.slice(e,this.pos)}readKeyword(e){return this.input.slice(this.pos,this.pos+e.length).toLowerCase()!==e||isNameChar(this.peek(e.length))?!1:(this.pos+=e.length,this.skipWhitespace(),!0)}};function positional(e,t){return{kind:`nth`,axis:e,formula:{a:0,b:t},of:null}}function parseSelectorList(e){let t=new SelectorParser(e),n=t.parseSelectorList(!1);return t.atEnd()||t.fail(`unexpected trailing input`),n}const je=new Set(`accept.accept-charset.align.alink.axis.bgcolor.charset.checked.clear.codetype.color.compact.declare.defer.dir.direction.disabled.enctype.face.frame.hreflang.http-equiv.lang.language.link.media.method.multiple.nohref.noresize.noshade.nowrap.readonly.rel.rev.rules.scope.scrolling.selected.shape.target.text.type.valign.valuetype.vlink`.split(`.`)),Me=/\s+/,Ne={universal:0,attribute:1,type:2,nth:3,empty:3,root:3,scope:3,is:4,not:4,has:5};function cost(e){return e.kind===`attribute`?e.name===`id`&&e.action===`equals`?0:e.action===`exists`?2:1:Ne[e.kind]}function compileAttribute(e,t){let n=t.caseSensitive?e.name:e.name.toLowerCase(),r=e.ignoreCase===null?!t.caseSensitive&&je.has(n):e.ignoreCase,i=r?e.value.toLowerCase():e.value,read=e=>{let i=t.getAttributeValue(e,n);return i===null||!r?i:i.toLowerCase()},noMatch=()=>!1;switch(e.action){case`exists`:return e=>t.getAttributeValue(e,n)!==null;case`equals`:return e=>read(e)===i;case`not`:return i===``?e=>(read(e)??``)!==``:e=>read(e)!==i;case`start`:return i===``?noMatch:e=>read(e)?.startsWith(i)===!0;case`end`:return i===``?noMatch:e=>read(e)?.endsWith(i)===!0;case`any`:return i===``?noMatch:e=>read(e)?.includes(i)===!0;case`hyphen`:return e=>{let t=read(e);return t!==null&&(t===i||t.startsWith(i+`-`))};default:return i===``||Me.test(i)?noMatch:e=>read(e)?.split(Me).includes(i)===!0}}function compileNth(e,t){let n=e.axis===`last-child`||e.axis===`last-of-type`,r=e.axis===`of-type`||e.axis===`last-of-type`,i=e.of===null?null:compileList(e.of,t);return(a,o)=>{let s=t.getSiblings(a),c=r?t.getName(a):``,l=n?-1:1,u=0;for(let d=n?s.length-1:0;d>=0&&d<s.length;d+=l){let n=s[d];if(t.isTag(n)&&!(r&&t.getName(n)!==c)&&!(i!==null&&!i(n,o))&&(u++,n===a))return matchesNth(e.formula,u)}return!1}}function collectDescendants(e,t,n){for(let r of t.getChildren(e))t.isTag(r)&&n.push(r),collectDescendants(r,t,n)}function followingSiblings(e,t){let n=t.getSiblings(e),r=n.indexOf(e);return r===-1?[]:n.slice(r+1).filter(e=>t.isTag(e))}function compileHas(e,t){let n=e.selectors.map(e=>compileComplex(e,t)),r=e.selectors.some(e=>e.leading===`adjacent`||e.leading===`sibling`),i=new Map;return(e,a)=>{let o=i.get(e);if(o!==void 0)return o;let s=[];if(collectDescendants(e,t,s),r)for(let n of followingSiblings(e,t))s.push(n);let c=a.scope;a.scope=e;let l=!1;for(let e of s)if(n.some(t=>t(e,a))){l=!0;break}return a.scope=c,i.set(e,l),l}}function compileSimple(e,t){switch(e.kind){case`universal`:return()=>!0;case`type`:{let n=t.caseSensitive?e.name:e.name.toLowerCase();return e=>t.getName(e)===n}case`attribute`:return compileAttribute(e,t);case`nth`:return compileNth(e,t);case`empty`:return e=>!t.getChildren(e).some(e=>t.isTag(e)||t.getText(e)!==``);case`root`:return e=>{let n=t.getParent(e);return n===null||!t.isTag(n)};case`scope`:return(e,t)=>e===t.scope;case`is`:return compileList(e.selectors,t);case`not`:{let n=compileList(e.selectors,t);return(e,t)=>!n(e,t)}default:return compileHas(e,t)}}function compileCompound(e,t){let n=e.slice().sort((e,t)=>cost(e)-cost(t)).map(e=>compileSimple(e,t));return n.length===1?n[0]:(e,t)=>{for(let r of n)if(!r(e,t))return!1;return!0}}function compileCombinator(e,t,n){switch(e){case`child`:return(e,r)=>{let i=n.getParent(e);return i!==null&&t(i,r)};case`descendant`:return(e,r)=>{let i=n.getParent(e);for(;i!==null;){if(t(i,r))return!0;i=n.getParent(i)}return!1};case`adjacent`:return(e,r)=>{let i=n.getSiblings(e);for(let a=i.indexOf(e)-1;a>=0;a--)if(n.isTag(i[a]))return t(i[a],r);return!1};default:return(e,r)=>{let i=n.getSiblings(e);for(let a=i.indexOf(e)-1;a>=0;a--)if(n.isTag(i[a])&&t(i[a],r))return!0;return!1}}}function compileComplex(e,t){let next=e.leading===null?()=>!0:compileCombinator(e.leading,(e,t)=>e===t.scope,t);for(let n=0;n<e.compounds.length;n++){n>0&&(next=compileCombinator(e.combinators[n-1],next,t));let r=compileCompound(e.compounds[n],t),i=next;next=(e,t)=>r(e,t)&&i(e,t)}return next}function compileList(e,t){let n=e.map(e=>compileComplex(e,t));return n.length===1?n[0]:(e,t)=>n.some(n=>n(e,t))}function compile(e,t){return compileList(parseSelectorList(e),t)}function walk(e,t,n){for(let r of t.getChildren(e))if(t.isTag(r)&&n(r)||walk(r,t,n))return!0;return!1}function selectAll(e,t,n){let r=compile(e,n),i={scope:t},a=[];return walk(t,n,e=>(r(e,i)&&a.push(e),!1)),a}function selectOne(e,t,n){let r=compile(e,n),i={scope:t},a=null;return walk(t,n,e=>r(e,i)?(a=e,!0):!1),a}function matchesSelector(e,t,n){return compile(e,n)(t,{scope:t})}function closestSelector(e,t,n){let r=compile(e,n),i={scope:t},a=t;for(;a!==null&&n.isTag(a);){if(r(a,i))return a;a=n.getParent(a)}return null}let Pe,Fe,Ie,Le,Re,ze;var Element=class extends Se{constructor(){super(),this[Pe]=``,this[Fe]=``,this[Ie]=we.html,this[Le]=null,this[Re]=new NamedNodeMap(this),this[ze]=new Map,this._resizeSubscribers=null,this._allocatedClientWidth=0,this._allocatedClientHeight=0,this._pointerCaptures=new Set,this[y]=j.ELEMENT_NODE}get tagName(){return this[w]}get localName(){return this[T]}get namespaceURI(){return this[E]}get prefix(){return this[D]}get nodeName(){return this[w]}get attributes(){return this[O]}get id(){return this.getAttribute(`id`)??``}set id(e){this.setAttribute(`id`,e)}get className(){return this.getAttribute(`class`)??``}set className(e){this.setAttribute(`class`,e)}get children(){return this[S]}get childElementCount(){return this[S].length}get firstElementChild(){return this[S][0]??null}get lastElementChild(){let e=this[S];return e[e.length-1]??null}get previousElementSibling(){let e=this[b];if(!e)return null;let t=e[S],n=t.indexOf(this);return n>0?t[n-1]:null}get nextElementSibling(){let e=this[b];if(!e)return null;let t=e[S],n=t.indexOf(this);return n!==-1&&n<t.length-1?t[n+1]:null}get textContent(){let e=``;for(let t of this[x])t.textContent!==null&&(e+=t.textContent);return e}set textContent(e){let t=this[x];for(;t.length>0;)this.removeChild(t[0])}getAttribute(e){let t=this[O].getNamedItem(e);return t?t.value:null}getAttributeNS(e,t){let n=this[O].getNamedItemNS(e,t);return n?n.value:null}setAttribute(e,t){this[O]._setNamedItem(e,String(t))}setAttributeNS(e,t,n){let r=e===``?null:e,i=t.split(`:`),a=i.length>1?i[0]:null;this[O]._setNamedItem(t,String(n),r,a)}removeAttribute(e){this[O]._removeNamedItem(e)}removeAttributeNS(e,t){let n=e===``?null:e;this[O]._removeNamedItemNS(n,t)}hasAttribute(e){return this[O].getNamedItem(e)!==null}hasAttributeNS(e,t){return this[O].getNamedItemNS(e,t)!==null}getAttributeNode(e){return this[O].getNamedItem(e)}setAttributeNode(e){return this[O].setNamedItem(e)}removeAttributeNode(e){let t=this[O].getNamedItem(e.name);if(!t)throw new DOMException(`Failed to execute 'removeAttributeNode' on 'Element': The attribute is not owned by this element.`,`NotFoundError`);return this[O].removeNamedItem(t.name),t}toggleAttribute(e,t){return t===void 0?this.hasAttribute(e)?(this.removeAttribute(e),!1):(this.setAttribute(e,``),!0):t?(this.setAttribute(e,``),!0):(this.removeAttribute(e),!1)}hasAttributes(){return this[O].length>0}dispatchEvent(e){let t=super.dispatchEvent(e),n=this[k].get(`on`+e.type);return typeof n==`function`&&n.call(this,e),t}querySelector(e){return selectOne(e,this,Ce)}querySelectorAll(e){return selectAll(e,this,Ce)}matches(e){return matchesSelector(e,this,Ce)}closest(e){return closestSelector(e,this,Ce)}getElementsByTagName(e){let t=[],n=e.toUpperCase(),walk=r=>{for(let i of r[x])if(i[y]===j.ELEMENT_NODE){let r=i;(e===`*`||r[w]===n)&&t.push(r),walk(r)}};return walk(this),t}getElementsByClassName(e){let t=[],n=e.split(/\s+/).filter(Boolean),walk=e=>{for(let r of e[x])if(r[y]===j.ELEMENT_NODE){let e=r,i=e.className.split(/\s+/);n.every(e=>i.includes(e))&&t.push(e),walk(e)}};return walk(this),t}cloneNode(e=!1){let t=super.cloneNode(!1);t[w]=this[w],t[T]=this[T],t[E]=this[E],t[D]=this[D];for(let e of this[O])t.setAttributeNS(e.namespaceURI,e.name,e.value);if(e)for(let e of this[x])t.appendChild(e.cloneNode(!0));return t}_onResize(e){let t=this._resizeSubscribers??=new Set;return t.add(e),()=>{t.delete(e),t.size===0&&(this._resizeSubscribers=null)}}_fireResizeSubscribers(e,t){let n=this._resizeSubscribers;if(!(!n||n.size===0))for(let r of[...n])try{r(e,t)}catch(e){console.error(`ResizeObserver subscriber threw:`,e)}}setPointerCapture(e){this._pointerCaptures.add(e)}releasePointerCapture(e){this._pointerCaptures.delete(e)}hasPointerCapture(e){return this._pointerCaptures.has(e)}get[(Pe=w,Fe=T,Ie=E,Le=D,Re=O,ze=k,Symbol.toStringTag)](){return`Element`}},CSSStyleDeclaration=class{constructor(){this._cssText=``}get cssText(){return this._cssText}set cssText(e){this._cssText=e;for(let t of e.split(`;`)){let e=t.indexOf(`:`);if(e===-1)continue;let n=t.slice(0,e).trim(),r=t.slice(e+1).trim();if(!n)continue;let i=n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());this[i]=r}}setProperty(e,t,n){this[e]=t}getPropertyValue(e){let t=this[e];return typeof t==`string`?t:``}removeProperty(e){let t=this[e];return delete this[e],typeof t==`string`?t:``}getPropertyPriority(e){return``}},HTMLElement=class extends Element{constructor(...e){super(...e),this.style=new CSSStyleDeclaration}get dataset(){let e=this;return new Proxy({},{get(t,n){if(typeof n!=`string`)return;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.getAttribute(r)??void 0},set(t,n,r){if(typeof n!=`string`)return!1;let i=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.setAttribute(i,String(r)),!0},deleteProperty(t,n){if(typeof n!=`string`)return!1;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.removeAttribute(r),!0},has(t,n){if(typeof n!=`string`)return!1;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.hasAttribute(r)}})}get title(){return this.getAttribute(`title`)??``}set title(e){this.setAttribute(`title`,e)}get lang(){return this.getAttribute(`lang`)??``}set lang(e){this.setAttribute(`lang`,e)}get dir(){return this.getAttribute(`dir`)??``}set dir(e){this.setAttribute(`dir`,e)}get accessKey(){return this.getAttribute(`accesskey`)??``}set accessKey(e){this.setAttribute(`accesskey`,e)}get accessKeyLabel(){return this.getAttribute(`accesskey`)??``}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}get draggable(){return this.getAttribute(`draggable`)===`true`}set draggable(e){this.setAttribute(`draggable`,String(e))}get spellcheck(){let e=this.getAttribute(`spellcheck`);return e===`false`?!1:e!==null}set spellcheck(e){this.setAttribute(`spellcheck`,String(e))}get translate(){return this.getAttribute(`translate`)!==`no`}set translate(e){this.setAttribute(`translate`,e?`yes`:`no`)}get tabIndex(){let e=this.getAttribute(`tabindex`);return e===null?-1:Number(e)}set tabIndex(e){this.setAttribute(`tabindex`,String(e))}get contentEditable(){let e=this.getAttribute(`contenteditable`);return e===``||e===`true`?`true`:e===`false`?`false`:`inherit`}set contentEditable(e){e===`inherit`?this.removeAttribute(`contenteditable`):this.setAttribute(`contenteditable`,e)}get isContentEditable(){return this.contentEditable===`true`}get offsetHeight(){return this._allocatedClientHeight}get offsetWidth(){return this._allocatedClientWidth}get offsetLeft(){return 0}get offsetTop(){return 0}get offsetParent(){return null}get clientHeight(){return this._allocatedClientHeight}get clientWidth(){return this._allocatedClientWidth}get clientLeft(){return 0}get clientTop(){return 0}get scrollHeight(){return this._allocatedClientHeight}get scrollWidth(){return this._allocatedClientWidth}get scrollTop(){return 0}set scrollTop(e){}get scrollLeft(){return 0}set scrollLeft(e){}getBoundingClientRect(){let e=this.clientWidth,t=this.clientHeight;return{x:0,y:0,top:0,left:0,right:e,bottom:t,width:e,height:t,toJSON(){return this}}}click(){this.dispatchEvent(new Event(`click`,{bubbles:!0,cancelable:!0}))}blur(){this.dispatchEvent(new Event(`blur`))}focus(){this.dispatchEvent(new Event(`focus`))}get onclick(){return this[k].get(`onclick`)??null}set onclick(e){this[k].set(`onclick`,e)}get ondblclick(){return this[k].get(`ondblclick`)??null}set ondblclick(e){this[k].set(`ondblclick`,e)}get onload(){return this[k].get(`onload`)??null}set onload(e){this[k].set(`onload`,e)}get onerror(){return this[k].get(`onerror`)??null}set onerror(e){this[k].set(`onerror`,e)}get onabort(){return this[k].get(`onabort`)??null}set onabort(e){this[k].set(`onabort`,e)}get onfocus(){return this[k].get(`onfocus`)??null}set onfocus(e){this[k].set(`onfocus`,e)}get onblur(){return this[k].get(`onblur`)??null}set onblur(e){this[k].set(`onblur`,e)}get onchange(){return this[k].get(`onchange`)??null}set onchange(e){this[k].set(`onchange`,e)}get oninput(){return this[k].get(`oninput`)??null}set oninput(e){this[k].set(`oninput`,e)}get onsubmit(){return this[k].get(`onsubmit`)??null}get onreset(){return this[k].get(`onreset`)??null}set onreset(e){this[k].set(`onreset`,e)}get onscroll(){return this[k].get(`onscroll`)??null}set onscroll(e){this[k].set(`onscroll`,e)}get onresize(){return this[k].get(`onresize`)??null}set onresize(e){this[k].set(`onresize`,e)}get onmousedown(){return this[k].get(`onmousedown`)??null}set onmousedown(e){this[k].set(`onmousedown`,e)}get onmouseup(){return this[k].get(`onmouseup`)??null}set onmouseup(e){this[k].set(`onmouseup`,e)}get onmousemove(){return this[k].get(`onmousemove`)??null}set onmousemove(e){this[k].set(`onmousemove`,e)}get onmouseover(){return this[k].get(`onmouseover`)??null}set onmouseover(e){this[k].set(`onmouseover`,e)}get onmouseout(){return this[k].get(`onmouseout`)??null}set onmouseout(e){this[k].set(`onmouseout`,e)}get onmouseenter(){return this[k].get(`onmouseenter`)??null}set onmouseenter(e){this[k].set(`onmouseenter`,e)}get onmouseleave(){return this[k].get(`onmouseleave`)??null}set onmouseleave(e){this[k].set(`onmouseleave`,e)}get oncontextmenu(){return this[k].get(`oncontextmenu`)??null}set oncontextmenu(e){this[k].set(`oncontextmenu`,e)}get onwheel(){return this[k].get(`onwheel`)??null}set onwheel(e){this[k].set(`onwheel`,e)}get onkeydown(){return this[k].get(`onkeydown`)??null}set onkeydown(e){this[k].set(`onkeydown`,e)}get onkeyup(){return this[k].get(`onkeyup`)??null}set onkeyup(e){this[k].set(`onkeyup`,e)}get ontouchstart(){return this[k].get(`ontouchstart`)??null}set ontouchstart(e){this[k].set(`ontouchstart`,e)}get ontouchend(){return this[k].get(`ontouchend`)??null}set ontouchend(e){this[k].set(`ontouchend`,e)}get ontouchmove(){return this[k].get(`ontouchmove`)??null}set ontouchmove(e){this[k].set(`ontouchmove`,e)}get onpointerdown(){return this[k].get(`onpointerdown`)??null}set onpointerdown(e){this[k].set(`onpointerdown`,e)}get onpointerup(){return this[k].get(`onpointerup`)??null}set onpointerup(e){this[k].set(`onpointerup`,e)}get onpointermove(){return this[k].get(`onpointermove`)??null}set onpointermove(e){this[k].set(`onpointermove`,e)}cloneNode(e=!1){return super.cloneNode(e)}get[Symbol.toStringTag](){return`HTMLElement`}},Be=class HTMLCanvasElement extends HTMLElement{constructor(...e){super(...e),this.oncontextlost=null,this.oncontextrestored=null,this.onwebglcontextcreationerror=null,this.onwebglcontextlost=null,this.onwebglcontextrestored=null}static{this._contextFactories=new Map}static registerContextFactory(e,t){HTMLCanvasElement._contextFactories.set(e,t)}get width(){let e=this.getAttribute(`width`);return e===null?300:Number(e)}set width(e){this.setAttribute(`width`,String(e))}get height(){let e=this.getAttribute(`height`);return e===null?150:Number(e)}set height(e){this.setAttribute(`height`,String(e))}getContext(e,t){let n=HTMLCanvasElement._contextFactories.get(e);return n?n(this,t):null}toDataURL(e,t){let n=this.getContext(`2d`);return n&&typeof n._toDataURL==`function`?n._toDataURL(e,t):``}toBlob(e,t,n){let r=this.toDataURL(t,n);if(!r){e(null);return}let[i,a]=r.split(`,`),o=i.split(`:`)[1].split(`;`)[0],s=atob(a),c=new Uint8Array(s.length);for(let e=0;e<s.length;e++)c[e]=s.charCodeAt(e);e(new Blob([c],{type:o}))}captureStream(e){return{}}},Ve=class DOMMatrix{constructor(e){this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this.m11=1,this.m12=0,this.m13=0,this.m14=0,this.m21=0,this.m22=1,this.m23=0,this.m24=0,this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m41=0,this.m42=0,this.m43=0,this.m44=1,this.is2D=!0,this.isIdentity=!0,Array.isArray(e)&&(e.length===6?(this.a=this.m11=e[0],this.b=this.m12=e[1],this.c=this.m21=e[2],this.d=this.m22=e[3],this.e=this.m41=e[4],this.f=this.m42=e[5],this.is2D=!0):e.length===16&&(this.m11=e[0],this.m12=e[1],this.m13=e[2],this.m14=e[3],this.m21=e[4],this.m22=e[5],this.m23=e[6],this.m24=e[7],this.m31=e[8],this.m32=e[9],this.m33=e[10],this.m34=e[11],this.m41=e[12],this.m42=e[13],this.m43=e[14],this.m44=e[15],this.a=this.m11,this.b=this.m12,this.c=this.m21,this.d=this.m22,this.e=this.m41,this.f=this.m42,this.is2D=!1),this.isIdentity=this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.e===0&&this.f===0)}multiply(e){let t=this.a*e.a+this.c*e.b,n=this.b*e.a+this.d*e.b,r=this.a*e.c+this.c*e.d,i=this.b*e.c+this.d*e.d,a=this.a*e.e+this.c*e.f+this.e,o=this.b*e.e+this.d*e.f+this.f;return new DOMMatrix([t,n,r,i,a,o])}multiplySelf(e){let t=this.multiply(e);return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.e=t.e,this.f=t.f,this.m11=this.a,this.m12=this.b,this.m21=this.c,this.m22=this.d,this.m41=this.e,this.m42=this.f,this.isIdentity=!1,this}inverse(){let e=this.a*this.d-this.b*this.c;if(e===0)return new DOMMatrix([1,0,0,1,0,0]);let t=1/e;return new DOMMatrix([this.d*t,-this.b*t,-this.c*t,this.a*t,(this.c*this.f-this.d*this.e)*t,(this.b*this.e-this.a*this.f)*t])}translate(e=0,t=0){return this.multiply({a:1,b:0,c:0,d:1,e,f:t})}scale(e=1,t=e){return this.multiply({a:e,b:0,c:0,d:t,e:0,f:0})}};const He=Ve;function defineGlobal(e,t){Object.defineProperty(globalThis,e,{value:t,writable:!0,configurable:!0})}function defineGlobalIfMissing(e,t){globalThis[e]===void 0&&defineGlobal(e,t)}const Ue={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,gold:`#ffd700`,goldenrod:`#daa520`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavender:`#e6e6fa`,lavenderblush:`#fff0f5`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`,transparent:`#00000000`};function parseColor(e){if(!e||typeof e!=`string`)return null;let t=e.trim().toLowerCase(),n=Ue[t];if(n)return parseHex(n);if(t.startsWith(`#`))return parseHex(t);let r=t.match(/^rgba?\(\s*(\d+(?:\.\d+)?%?)\s*[,\s]\s*(\d+(?:\.\d+)?%?)\s*[,\s]\s*(\d+(?:\.\d+)?%?)\s*(?:[,/]\s*(\d+(?:\.\d+)?%?))?\s*\)$/);if(r)return{r:parseComponent(r[1],255)/255,g:parseComponent(r[2],255)/255,b:parseComponent(r[3],255)/255,a:r[4]===void 0?1:parseComponent(r[4],1)};let i=t.match(/^hsla?\(\s*(\d+(?:\.\d+)?)\s*[,\s]\s*(\d+(?:\.\d+)?)(%)?\s*[,\s]\s*(\d+(?:\.\d+)?)(%)?\s*(?:[,/]\s*(\d+(?:\.\d+)?%?))?\s*\)$/);if(i){let e=parseFloat(i[1]),t=parseFloat(i[2]),n=i[3]===`%`,r=parseFloat(i[4]),a=i[5]===`%`,o=i[6]===void 0?1:parseComponent(i[6],1);return e>1&&(e/=360),(n||t>1)&&(t/=100),(a||r>1)&&(r/=100),hslToRGBA(e,t,r,Math.max(0,Math.min(1,o)))}return null}function parseHex(e){let t=e.slice(1),n,r,i,a=1;if(t.length===3)n=parseInt(t[0]+t[0],16)/255,r=parseInt(t[1]+t[1],16)/255,i=parseInt(t[2]+t[2],16)/255;else if(t.length===4)n=parseInt(t[0]+t[0],16)/255,r=parseInt(t[1]+t[1],16)/255,i=parseInt(t[2]+t[2],16)/255,a=parseInt(t[3]+t[3],16)/255;else if(t.length===6)n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,i=parseInt(t.slice(4,6),16)/255;else if(t.length===8)n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,i=parseInt(t.slice(4,6),16)/255,a=parseInt(t.slice(6,8),16)/255;else return null;return{r:n,g:r,b:i,a}}function parseComponent(e,t){return e.endsWith(`%`)?parseFloat(e)/100*t:parseFloat(e)}function hue2rgb$1(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}__name$1(hue2rgb$1,`hue2rgb`);function hslToRGBA(e,t,n,r){let i,a,o;if(t===0)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=hue2rgb$1(s,r,e+1/3),a=hue2rgb$1(s,r,e),o=hue2rgb$1(s,r,e-1/3)}return{r:i,g:a,b:o,a:r}}const We={r:0,g:0,b:0,a:1};var CanvasGradient=class{constructor(e,n,r,i,a,o,s){e===`radial`?this._pattern=new t.RadialGradient(n,r,o,i,a,s):this._pattern=new t.LinearGradient(n,r,i,a)}addColorStop(e,t){let n=parseColor(t);n&&this._pattern.addColorStopRGBA(e,n.r,n.g,n.b,n.a)}_getCairoPattern(){return this._pattern}};function quadraticToCubic(e,t,n,r,i,a){return{cp1x:e+2/3*(n-e),cp1y:t+2/3*(r-t),cp2x:i+2/3*(n-i),cp2y:a+2/3*(r-a)}}function computeArcTo(e,t,n,r,i,a,o){let s=e-n,c=t-r,l=i-n,u=a-r,d=Math.sqrt(s*s+c*c),f=Math.sqrt(l*l+u*u);if(d===0||f===0)return null;let p=s/d,m=c/d,h=l/f,g=u/f,_=p*g-m*h;if(Math.abs(_)<1e-10)return null;let v=p*h+m*g,y=Math.acos(Math.max(-1,Math.min(1,v)))/2,b=o/Math.tan(y),x=n+p*b,S=r+m*b,C=n+h*b,w=r+g*b,T=o/Math.sin(y),E=(p+h)/2,D=(m+g)/2,O=Math.sqrt(E*E+D*D),k=n+E/O*T,A=r+D/O*T;return{tx0:x,ty0:S,tx1:C,ty1:w,cx:k,cy:A,startAngle:Math.atan2(S-A,x-k),endAngle:Math.atan2(w-A,C-k),counterclockwise:_>0}}function cairoArcTo(e,t,n,r,i,a,o,s){let c=computeArcTo(t,n,r,i,a,o,s);if(!c){e.lineTo(r,i);return}let{tx0:l,ty0:u,cx:d,cy:f,startAngle:p,endAngle:m,counterclockwise:h}=c;e.lineTo(l,u),h?e.arcNegative(d,f,s,p,m):e.arc(d,f,s,p,m)}function cairoEllipse(e,t,n,r,i,a,o,s,c){e.save(),e.translate(t,n),e.rotate(a),e.scale(r,i),c?e.arcNegative(0,0,1,o,s):e.arc(0,0,1,o,s),e.restore()}function cairoRoundRect(e,t,n,r,i,a){let o,s,c,l;typeof a==`number`?o=s=c=l=a:a.length===1?o=s=c=l=a[0]:a.length===2?(o=c=a[0],s=l=a[1]):a.length===3?(o=a[0],s=l=a[1],c=a[2]):(o=a[0],s=a[1],c=a[2],l=a[3]);let u=Math.min(r/2,i/2);o=Math.min(o,u),s=Math.min(s,u),c=Math.min(c,u),l=Math.min(l,u);let d=Math.PI/2;e.newSubPath(),e.arc(t+o,n+o,o,Math.PI,Math.PI+d),e.arc(t+r-s,n+s,s,-d,0),e.arc(t+r-c,n+i-c,c,0,d),e.arc(t+l,n+i-l,l,d,Math.PI),e.closePath()}const Ge={"source-over":2,"source-in":3,"source-out":4,"source-atop":5,"destination-over":7,"destination-in":8,"destination-out":9,"destination-atop":10,lighter:12,copy:1,xor:11,multiply:14,screen:15,overlay:16,darken:17,lighten:18,"color-dodge":19,"color-burn":20,"hard-light":21,"soft-light":22,difference:23,exclusion:24,hue:25,saturation:26,color:27,luminosity:28},Ke={butt:0,round:1,square:2},qe={miter:0,round:1,bevel:2};var Je=class Path2D{constructor(e){this._ops=[],e instanceof Path2D&&(this._ops=[...e._ops])}addPath(e){this._ops.push(...e._ops)}moveTo(e,t){this._ops.push({type:`moveTo`,x:e,y:t})}lineTo(e,t){this._ops.push({type:`lineTo`,x:e,y:t})}closePath(){this._ops.push({type:`closePath`})}bezierCurveTo(e,t,n,r,i,a){this._ops.push({type:`bezierCurveTo`,cp1x:e,cp1y:t,cp2x:n,cp2y:r,x:i,y:a})}quadraticCurveTo(e,t,n,r){this._ops.push({type:`quadraticCurveTo`,cpx:e,cpy:t,x:n,y:r})}arc(e,t,n,r,i,a=!1){this._ops.push({type:`arc`,x:e,y:t,radius:n,startAngle:r,endAngle:i,ccw:a})}ellipse(e,t,n,r,i,a,o,s=!1){if(n<0||r<0)throw RangeError(`The radii provided are negative`);this._ops.push({type:`ellipse`,x:e,y:t,rx:n,ry:r,rotation:i,startAngle:a,endAngle:o,ccw:s})}rect(e,t,n,r){this._ops.push({type:`rect`,x:e,y:t,w:n,h:r})}roundRect(e,t,n,r,i=0){this._ops.push({type:`roundRect`,x:e,y:t,w:n,h:r,radii:i})}_replayOnCairo(e){let t=0,n=0;for(let r of this._ops)switch(r.type){case`moveTo`:e.moveTo(r.x,r.y),t=r.x,n=r.y;break;case`lineTo`:e.lineTo(r.x,r.y),t=r.x,n=r.y;break;case`closePath`:e.closePath();break;case`bezierCurveTo`:e.curveTo(r.cp1x,r.cp1y,r.cp2x,r.cp2y,r.x,r.y),t=r.x,n=r.y;break;case`quadraticCurveTo`:{let{cp1x:i,cp1y:a,cp2x:o,cp2y:s}=quadraticToCubic(t,n,r.cpx,r.cpy,r.x,r.y);e.curveTo(i,a,o,s,r.x,r.y),t=r.x,n=r.y;break}case`arc`:r.ccw?e.arcNegative(r.x,r.y,r.radius,r.startAngle,r.endAngle):e.arc(r.x,r.y,r.radius,r.startAngle,r.endAngle);break;case`ellipse`:e.save(),e.translate(r.x,r.y),e.rotate(r.rotation),e.scale(r.rx,r.ry),r.ccw?e.arcNegative(0,0,1,r.startAngle,r.endAngle):e.arc(0,0,1,r.startAngle,r.endAngle),e.restore();break;case`rect`:e.rectangle(r.x,r.y,r.w,r.h);break;case`roundRect`:cairoRoundRect(e,r.x,r.y,r.w,r.h,r.radii);break}}};function asCairoPattern(e){if(!e)return null;let t=e;return typeof t.setFilter!=`function`||typeof t.setExtend!=`function`?null:t}function isPixbufImageSource(e){return typeof e!=`object`||!e?!1:typeof e.isPixbuf==`function`&&e.isPixbuf()}function isCanvasImageSource(e){return typeof e!=`object`||!e?!1:typeof e.getContext==`function`}let Ye=null;function setCanvasPixelBridge(e){Ye=e}function getCanvasPixelBridge(){if(!Ye)throw TypeError(`@gjsify/canvas2d-core: no pixel bridge registered — pixel operations (getImageData / putImageData / drawImage / createPattern) need a platform backend. On GJS, import '@gjsify/canvas2d-core/gdk' (or use '@gjsify/dom-elements' / '@gjsify/canvas2d', which register it for you).`);return Ye}var Xe=class CanvasPattern{constructor(e,n){let r=asCairoPattern(new t.SurfacePattern(e));if(!r)throw TypeError(`CanvasPattern: cairo SurfacePattern is missing setExtend at runtime — incompatible Cairo binding`);switch(this._pattern=r,n){case`repeat`:case``:case null:r.setExtend(t.Extend.REPEAT);break;case`repeat-x`:case`repeat-y`:r.setExtend(t.Extend.REPEAT);break;case`no-repeat`:r.setExtend(t.Extend.NONE);break}}static create(e,n){if(isPixbufImageSource(e)){let r=e._pixbuf,i=r.get_width(),a=r.get_height(),o=new t.ImageSurface(t.Format.ARGB32,i,a),s=new t.Context(o);return getCanvasPixelBridge().setSourceImage(s,r,0,0),s.paint(),s.$dispose(),new CanvasPattern(o,n)}if(isCanvasImageSource(e)){let r=e.getContext(`2d`);if(r&&typeof r._getSurface==`function`){let e=r._getSurface(),i=e.getWidth(),a=e.getHeight(),o=new t.ImageSurface(t.Format.ARGB32,i,a),s=new t.Context(o);return s.setSourceSurface(e,0,0),s.paint(),s.$dispose(),new CanvasPattern(o,n)}}return null}_getCairoPattern(){return this._pattern}},OurImageData=class{constructor(e,t,n){if(this.colorSpace=`srgb`,typeof e==`number`)this.width=e,this.height=t,this.data=new Uint8ClampedArray(this.width*this.height*4);else if(this.data=e,this.width=t,this.height=n??this.data.length/(4*this.width),this.data.length!==this.width*this.height*4)throw RangeError(`Source data length ${this.data.length} is not a multiple of (4 * width=${this.width})`)}};const Ze={translate(e,t){this._ensureSurface(),!(!Number.isFinite(e)||!Number.isFinite(t))&&this._ctx.translate(e,t)},rotate(e){this._ensureSurface(),Number.isFinite(e)&&this._ctx.rotate(e)},scale(e,t){if(this._ensureSurface(),!(!Number.isFinite(e)||!Number.isFinite(t))){if(e===0||t===0){this._state.transformIsSingular=!0;return}this._ctx.scale(e,t)}},transform(e,t,n,r,i,a){if(this._ensureSurface(),!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))return;if(e*r-t*n===0){this._state.transformIsSingular=!0;return}let o=i,s=a,c=Math.hypot(e,t),l=Math.hypot(n,r),u=Math.atan2(t,e);this._ctx.translate(o,s),u!==0&&this._ctx.rotate(u),(c!==1||l!==1)&&this._ctx.scale(c,l)},setTransform(e,t,n,r,i,a){if(this._ensureSurface(),this._state.transformIsSingular=!1,typeof e==`object`&&e){let t=e;this._ctx.identityMatrix(),this.transform(t.a??t.m11??1,t.b??t.m12??0,t.c??t.m21??0,t.d??t.m22??1,t.e??t.m41??0,t.f??t.m42??0)}else typeof e==`number`?(this._ctx.identityMatrix(),this.transform(e,t,n,r,i,a)):this._ctx.identityMatrix()},getTransform(){if(this._state.transformIsSingular){let e=this._ctx.userToDevice(0,0);return makeMatrix(0,0,0,0,e[0]??0,e[1]??0)}let e=this._ctx.userToDevice(0,0),t=this._ctx.userToDevice(1,0),n=this._ctx.userToDevice(0,1),r=e[0]??0,i=e[1]??0;return makeMatrix((t[0]??0)-r,(t[1]??0)-i,(n[0]??0)-r,(n[1]??0)-i,r,i)},resetTransform(){this._ensureSurface(),this._state.transformIsSingular=!1,this._ctx.identityMatrix()}};function makeMatrix(e,t,n,r,i,a){let o=globalThis.DOMMatrix;return typeof o==`function`?new o([e,t,n,r,i,a]):{a:e,b:t,c:n,d:r,e:i,f:a,m11:e,m12:t,m13:0,m14:0,m21:n,m22:r,m23:0,m24:0,m31:0,m32:0,m33:1,m34:0,m41:i,m42:a,m43:0,m44:1,is2D:!0,isIdentity:e===1&&t===0&&n===0&&r===1&&i===0&&a===0}}function installTransformMethods(e){Object.assign(e,Ze)}const Qe={beginPath(){this._ensureSurface(),this._ctx.newPath()},moveTo(e,t){this._ensureSurface(),this._ctx.moveTo(e,t)},lineTo(e,t){this._ensureSurface(),this._ctx.lineTo(e,t)},closePath(){this._ensureSurface(),this._ctx.closePath()},bezierCurveTo(e,t,n,r,i,a){this._ensureSurface(),this._ctx.curveTo(e,t,n,r,i,a)},quadraticCurveTo(e,t,n,r){this._ensureSurface();let i,a;this._ctx.hasCurrentPoint()?[i,a]=this._ctx.getCurrentPoint():(i=e,a=t);let{cp1x:o,cp1y:s,cp2x:c,cp2y:l}=quadraticToCubic(i,a,e,t,n,r);this._ctx.curveTo(o,s,c,l,n,r)},arc(e,t,n,r,i,a=!1){if(this._ensureSurface(),Math.abs(i-r)>=2*Math.PI){this._ctx.arc(e,t,n,0,2*Math.PI);return}a?this._ctx.arcNegative(e,t,n,r,i):this._ctx.arc(e,t,n,r,i)},arcTo(e,t,n,r,i){this._ensureSurface();let a,o;this._ctx.hasCurrentPoint()?[a,o]=this._ctx.getCurrentPoint():(a=e,o=t,this._ctx.moveTo(e,t)),cairoArcTo(this._ctx,a,o,e,t,n,r,i)},ellipse(e,t,n,r,i,a,o,s=!1){if(this._ensureSurface(),n<0||r<0)throw RangeError(`The radii provided are negative`);cairoEllipse(this._ctx,e,t,n,r,i,a,o,s)},rect(e,t,n,r){this._ensureSurface(),this._ctx.rectangle(e,t,n,r)},roundRect(e,t,n,r,i=0){this._ensureSurface(),cairoRoundRect(this._ctx,e,t,n,r,i)}};function installPathMethods(e){Object.assign(e,Qe)}function getDrawImageSource(e){if(isPixbufImageSource(e)){let t=e._pixbuf;return{pixbuf:t,imgWidth:t.get_width(),imgHeight:t.get_height()}}if(isCanvasImageSource(e)){let t=e.width??0,n=e.height??0;if(!Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0)return null;let r=e.getContext(`2d`);if(r&&typeof r._getSurface==`function`){let e=r._getSurface();e.flush();let i=getCanvasPixelBridge().imageFromSurface(e,0,0,t,n);if(i)return{pixbuf:i,imgWidth:t,imgHeight:n}}}return null}const $e={fill(e,n){if(this._ensureSurface(),this._state.transformIsSingular)return;this._applyCompositing(),this._applyFillStyle();let r;e instanceof Je?(this._ctx.newPath(),e._replayOnCairo(this._ctx),r=n):r=e,this._ctx.setFillRule(r===`evenodd`?t.FillRule.EVEN_ODD:t.FillRule.WINDING),this._ctx.fillPreserve()},stroke(e){this._ensureSurface(),!this._state.transformIsSingular&&(this._applyCompositing(),this._applyStrokeStyle(),this._applyLineStyle(),e instanceof Je&&(this._ctx.newPath(),e._replayOnCairo(this._ctx)),this._ctx.strokePreserve())},fillRect(e,t,n,r){if(this._ensureSurface(),this._state.transformIsSingular)return;this._applyCompositing();let i=this._ctx.copyPath();this._hasShadow()&&this._renderShadow(()=>{this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.fill()}),this._applyFillStyle(),this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.fill(),this._ctx.newPath(),this._ctx.appendPath(i)},strokeRect(e,t,n,r){if(this._ensureSurface(),this._state.transformIsSingular)return;this._applyCompositing();let i=this._ctx.copyPath();this._hasShadow()&&this._renderShadow(()=>{this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.stroke()}),this._applyStrokeStyle(),this._applyLineStyle(),this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.stroke(),this._ctx.newPath(),this._ctx.appendPath(i)},clearRect(e,n,r,i){if(this._ensureSurface(),this._state.transformIsSingular)return;let a=this._ctx.copyPath();this._ctx.save(),this._ctx.setOperator(t.Operator.CLEAR),this._ctx.newPath(),this._ctx.rectangle(e,n,r,i),this._ctx.fill(),this._ctx.restore(),this._ctx.newPath(),this._ctx.appendPath(a)},clip(e,n){if(this._ensureSurface(),this._state.transformIsSingular)return;let r;e instanceof Je?(this._ctx.newPath(),e._replayOnCairo(this._ctx),r=n):r=e,this._ctx.setFillRule(r===`evenodd`?t.FillRule.EVEN_ODD:t.FillRule.WINDING),this._ctx.clip()},isPointInPath(e,n,r,i){this._ensureSurface();let a,o,s;return e instanceof Je?(this._ctx.newPath(),e._replayOnCairo(this._ctx),a=n,o=r,s=i):(a=e,o=n,s=r),this._ctx.setFillRule(s===`evenodd`?t.FillRule.EVEN_ODD:t.FillRule.WINDING),this._ctx.inFill(a,o)},isPointInStroke(e,t,n){return this._ensureSurface(),this._applyLineStyle(),e instanceof Je?(this._ctx.newPath(),e._replayOnCairo(this._ctx),this._ctx.inStroke(t,n)):this._ctx.inStroke(e,t)},drawImage(e,n,r,i,a,o,s,c,l){if(this._ensureSurface(),this._state.transformIsSingular)return;this._applyCompositing();let u,d,f,p,m,h,g,_,v=getDrawImageSource(e);if(!v)return;let{pixbuf:y,imgWidth:b,imgHeight:x}=v;if(i===void 0?(u=0,d=0,f=b,p=x,m=n,h=r,g=b,_=x):o===void 0?(u=0,d=0,f=b,p=x,m=n,h=r,g=i,_=a):(u=n,d=r,f=i,p=a,m=o,h=s,g=c,_=l),!Number.isFinite(u)||!Number.isFinite(d)||!Number.isFinite(f)||!Number.isFinite(p)||!Number.isFinite(m)||!Number.isFinite(h)||!Number.isFinite(g)||!Number.isFinite(_)||f===0||p===0||g===0||_===0)return;this._ctx.save(),this._ctx.rectangle(m,h,g,_),this._ctx.clip(),this._ctx.translate(m,h),this._ctx.scale(g/f,_/p),this._ctx.translate(-u,-d),getCanvasPixelBridge().setSourceImage(this._ctx,y,0,0);let S=asCairoPattern(this._ctx.getSource?.());if(S){let e;e=this._state.imageSmoothingEnabled?this._state.imageSmoothingQuality===`high`?t.Filter.BEST:t.Filter.BILINEAR:t.Filter.NEAREST,S.setFilter(e)}this._state.globalAlpha<1?this._ctx.paintWithAlpha(this._state.globalAlpha):this._ctx.paint(),this._ctx.restore()}};function installDrawingMethods$1(e){Object.assign(e,$e)}__name$1(installDrawingMethods$1,`installDrawingMethods`);const et={createImageData(e,t){return typeof e==`number`?new OurImageData(Math.abs(e),Math.abs(t)):new OurImageData(e.width,e.height)},getImageData(e,t,n,r){this._ensureSurface(),this._surface.flush();let i=getCanvasPixelBridge().imageFromSurface(this._surface,e,t,n,r);if(!i)return new OurImageData(n,r);let a=i.get_pixels(),o=i.get_has_alpha(),s=i.get_rowstride(),c=i.get_n_channels(),l=new Uint8ClampedArray(n*r*4);for(let e=0;e<r;e++)for(let t=0;t<n;t++){let r=e*s+t*c,i=(e*n+t)*4;l[i]=a[r],l[i+1]=a[r+1],l[i+2]=a[r+2],l[i+3]=o?a[r+3]:255}return new OurImageData(l,n,r)},putImageData(e,n,r,i,a,o,s){this._ensureSurface();let c=i??0,l=a??0,u=o??e.width,d=s??e.height,f=e.data,p=e.width,m=new Uint8Array(u*d*4);for(let e=0;e<d;e++)for(let t=0;t<u;t++){let n=((l+e)*p+(c+t))*4,r=(e*u+t)*4;m[r]=f[n],m[r+1]=f[n+1],m[r+2]=f[n+2],m[r+3]=f[n+3]}this._ctx.save(),this._ctx.setOperator(t.Operator.SOURCE),getCanvasPixelBridge().setSourcePixels(this._ctx,m,u,d,n+c,r+l),this._ctx.rectangle(n+c,r+l,u,d),this._ctx.fill(),this._ctx.restore()}};function installPixelMethods(e){Object.assign(e,et)}const tt=e(import.meta.url);let nt;function load$11(){return nt===void 0&&(nt=tt(`@gjsify/node-gi/gi`).requireGi(`Pango`,`1.0`)),nt}__name$1(load$11,`load`);var rt=new Proxy(Object.create(null),{get(e,t){return load$11()[t]},has(e,t){return t in load$11()}});const it=e(import.meta.url);let at;function load$10(){return at===void 0&&(at=it(`@gjsify/node-gi/gi`).requireGi(`PangoCairo`,`1.0`)),at}__name$1(load$10,`load`);var ot=new Proxy(Object.create(null),{get(e,t){return load$10()[t]},has(e,t){return t in load$10()}});function parseFontToDescription(e){let t=e.match(/^\s*(italic|oblique|normal)?\s*(small-caps|normal)?\s*(bold|bolder|lighter|[1-9]00|normal)?\s*(\d+(?:\.\d+)?)(px|pt|em|rem|%)?\s*(?:\/\S+)?\s*(.+)?$/i);if(!t)return rt.font_description_from_string(e);let n=t[1]||``,r=t[3]||``,i=parseFloat(t[4])||10,a=(t[5]||`px`).toLowerCase(),o=(t[6]||`sans-serif`).replace(/['"]/g,``).trim();a===`pt`?i=i*96/72:a===`em`||a===`rem`?i*=16:a===`%`&&(i=i/100*16);let s=o;n===`italic`?s+=` Italic`:n===`oblique`&&(s+=` Oblique`),r===`bold`||r===`bolder`||parseInt(r)>=600?s+=` Bold`:(r===`lighter`||parseInt(r)>0&&parseInt(r)<=300)&&(s+=` Light`);let c=rt.font_description_from_string(s);return c.set_absolute_size(i*rt.SCALE),c}function createTextLayout(e,t){let n=ot.create_layout(e._ctx);n.set_text(t,-1),n.get_context().set_base_dir(rt.Direction.LTR),n.context_changed();let r=parseFontToDescription(e._state.font);return n.set_font_description(r),n}function getTextAlignOffset(e,t){let[,n]=t.get_pixel_extents(),r=n.width;switch(e._state.textAlign){case`center`:return-r/2;case`right`:case`end`:return-r;default:return 0}}function getTextBaselineOffset(e,t){let n=t.get_font_description()||parseFontToDescription(e._state.font),r=t.get_context().get_metrics(n,null),i=r.get_ascent()/rt.SCALE,a=r.get_descent()/rt.SCALE,o=i+a;switch(e._state.textBaseline){case`top`:return 0;case`hanging`:return-(i*.2);case`middle`:return-(o/2);case`alphabetic`:return-i;case`ideographic`:return-(i+a*.5);case`bottom`:return-o;default:return-i}}const st={fillText(e,n,r,i){if(this._ensureSurface(),this._state.transformIsSingular)return;this._applyCompositing();let a=createTextLayout(this,e),o=getTextAlignOffset(this,a),s=getTextBaselineOffset(this,a);if(this._hasShadow()){let e=parseColor(this._state.shadowColor);if(e){let[i,c]=this._deviceToUserDistance(this._state.shadowOffsetX,this._state.shadowOffsetY),l=this._state.shadowBlur,u;if(l>0){let[t]=this._deviceToUserDistance(l,0),[,n]=this._deviceToUserDistance(0,l);u=[[i,c,e.a],[i+t,c,e.a*.5],[i-t,c,e.a*.5],[i,c+n,e.a*.5],[i,c-n,e.a*.5]]}else u=[[i,c,e.a]];let d=this._state.imageSmoothingEnabled?t.Antialias.DEFAULT:t.Antialias.NONE;for(let[t,i,c]of u)this._ctx.save(),this._ctx.setAntialias(d),this._ctx.setSourceRGBA(e.r,e.g,e.b,c),this._ctx.moveTo(n+o+t,r+s+i),ot.show_layout(this._ctx,a),this._ctx.restore()}}this._applyFillStyle(),this._ctx.save(),this._ctx.setAntialias(this._state.imageSmoothingEnabled?t.Antialias.DEFAULT:t.Antialias.NONE),this._ctx.moveTo(n+o,r+s),ot.show_layout(this._ctx,a),this._ctx.restore()},strokeText(e,n,r,i){if(this._ensureSurface(),this._state.transformIsSingular)return;this._applyCompositing(),this._applyStrokeStyle(),this._applyLineStyle();let a=createTextLayout(this,e),o=getTextAlignOffset(this,a),s=getTextBaselineOffset(this,a);this._ctx.save(),this._ctx.setAntialias(this._state.imageSmoothingEnabled?t.Antialias.DEFAULT:t.Antialias.NONE),this._ctx.moveTo(n+o,r+s),ot.layout_path(this._ctx,a),this._ctx.stroke(),this._ctx.restore()},measureText(e){this._ensureSurface();let t=createTextLayout(this,e),[n,r]=t.get_pixel_extents(),i=t.get_baseline()/rt.SCALE,a=Math.max(0,i-n.y),o=Math.max(0,n.y+n.height-i),s=t.get_font_description()||parseFontToDescription(this._state.font),c=t.get_context().get_metrics(s,null),l=c.get_ascent()/rt.SCALE,u=c.get_descent()/rt.SCALE;return{width:r.width,actualBoundingBoxAscent:a,actualBoundingBoxDescent:o,actualBoundingBoxLeft:Math.max(0,-n.x),actualBoundingBoxRight:n.x+n.width,fontBoundingBoxAscent:l,fontBoundingBoxDescent:u,alphabeticBaseline:0,emHeightAscent:l,emHeightDescent:u,hangingBaseline:l*.8,ideographicBaseline:-u}}};function installTextMethods(e){Object.assign(e,st)}const ct={createLinearGradient(e,t,n,r){return new CanvasGradient(`linear`,e,t,n,r)},createRadialGradient(e,t,n,r,i,a){return new CanvasGradient(`radial`,e,t,r,i,n,a)},createPattern(e,t){return Xe.create(e,t)}};function installFactoryMethods(e){Object.assign(e,ct)}function installAllContextMethods$1(e){installTransformMethods(e),installPathMethods(e),installDrawingMethods$1(e),installPixelMethods(e),installTextMethods(e),installFactoryMethods(e)}__name$1(installAllContextMethods$1,`installAllContextMethods`);function createDefaultState(){return{fillStyle:`#000000`,fillColor:{...We},strokeStyle:`#000000`,strokeColor:{...We},lineWidth:1,lineCap:`butt`,lineJoin:`miter`,miterLimit:10,lineDash:[],lineDashOffset:0,globalAlpha:1,globalCompositeOperation:`source-over`,shadowColor:`rgba(0, 0, 0, 0)`,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,font:`10px sans-serif`,textAlign:`start`,textBaseline:`alphabetic`,direction:`ltr`,imageSmoothingEnabled:!0,imageSmoothingQuality:`low`,transformIsSingular:!1}}function cloneState(e){return{...e,fillColor:{...e.fillColor},strokeColor:{...e.strokeColor},lineDash:[...e.lineDash]}}const lt=e(import.meta.url);let ut;function load$9(){return ut===void 0&&(ut=lt(`@gjsify/node-gi/gi`).requireGi(`Gio`,`2.0`)),ut}__name$1(load$9,`load`);var dt=new Proxy(Object.create(null),{get(e,t){return load$9()[t]},has(e,t){return t in load$9()}});const ft=e(import.meta.url);let pt;function load$8(){return pt===void 0&&(pt=ft(`@gjsify/node-gi/gi`).requireGi(`GLib`,`2.0`)),pt}__name$1(load$8,`load`);var mt=new Proxy(Object.create(null),{get(e,t){return load$8()[t]},has(e,t){return t in load$8()}}),CanvasRenderingContext2D=class{constructor(e,n){this._stateStack=[],this.canvas=e,this._surfaceWidth=e.width||300,this._surfaceHeight=e.height||150,this._surface=new t.ImageSurface(t.Format.ARGB32,this._surfaceWidth,this._surfaceHeight),this._ctx=new t.Context(this._surface),this._state=createDefaultState()}_ensureSurface(){let e=this.canvas.width||300,n=this.canvas.height||150;(e!==this._surfaceWidth||n!==this._surfaceHeight)&&(this._ctx.$dispose(),this._surface.finish(),this._surfaceWidth=e,this._surfaceHeight=n,this._surface=new t.ImageSurface(t.Format.ARGB32,e,n),this._ctx=new t.Context(this._surface),this._stateStack=[])}_resetState(){this._state=createDefaultState(),this._stateStack=[]}_applyFillStyle(){let e=this._state.fillStyle;if(typeof e==`string`){let e=this._state.fillColor,t=e.a*this._state.globalAlpha;this._ctx.setSourceRGBA(e.r,e.g,e.b,t)}else e instanceof CanvasGradient?this._ctx.setSource(e._getCairoPattern()):e instanceof Xe&&(this._ctx.setSource(e._getCairoPattern()),this._applyPatternFilter())}_applyStrokeStyle(){let e=this._state.strokeStyle;if(typeof e==`string`){let e=this._state.strokeColor,t=e.a*this._state.globalAlpha;this._ctx.setSourceRGBA(e.r,e.g,e.b,t)}else e instanceof CanvasGradient?this._ctx.setSource(e._getCairoPattern()):e instanceof Xe&&(this._ctx.setSource(e._getCairoPattern()),this._applyPatternFilter())}_applyPatternFilter(){let e=asCairoPattern(this._ctx.getSource?.());if(!e)return;let n;n=this._state.imageSmoothingEnabled?this._state.imageSmoothingQuality===`high`?t.Filter.BEST:t.Filter.BILINEAR:t.Filter.NEAREST,e.setFilter(n)}_applyLineStyle(){this._ctx.setLineWidth(this._state.lineWidth),this._ctx.setLineCap(Ke[this._state.lineCap]),this._ctx.setLineJoin(qe[this._state.lineJoin]),this._ctx.setMiterLimit(this._state.miterLimit),this._ctx.setDash(this._state.lineDash,this._state.lineDashOffset)}_applyCompositing(){let e=Ge[this._state.globalCompositeOperation];e!==void 0&&this._ctx.setOperator(e)}_getSurface(){return this._surface}_hasShadow(){if(this._state.shadowBlur===0&&this._state.shadowOffsetX===0&&this._state.shadowOffsetY===0)return!1;let e=parseColor(this._state.shadowColor);return e!==null&&e.a>0}_deviceToUserDistance(e,t){let n=this._ctx.userToDevice(0,0),r=this._ctx.userToDevice(1,0),i=this._ctx.userToDevice(0,1),a=(r[0]??0)-(n[0]??0),o=(r[1]??0)-(n[1]??0),s=(i[0]??0)-(n[0]??0),c=(i[1]??0)-(n[1]??0),l=a*c-o*s;return Math.abs(l)<1e-10?[e,t]:[(c*e-s*t)/l,(-o*e+a*t)/l]}_renderShadow(e){}save(){this._ensureSurface(),this._stateStack.push(cloneState(this._state)),this._ctx.save()}restore(){this._ensureSurface();let e=this._stateStack.pop();e&&(this._state=e,this._ctx.restore())}get fillStyle(){return this._state.fillStyle}set fillStyle(e){if(typeof e==`string`){let t=parseColor(e);t&&(this._state.fillStyle=e,this._state.fillColor=t)}else this._state.fillStyle=e}get strokeStyle(){return this._state.strokeStyle}set strokeStyle(e){if(typeof e==`string`){let t=parseColor(e);t&&(this._state.strokeStyle=e,this._state.strokeColor=t)}else this._state.strokeStyle=e}get lineWidth(){return this._state.lineWidth}set lineWidth(e){e>0&&isFinite(e)&&(this._state.lineWidth=e)}get lineCap(){return this._state.lineCap}set lineCap(e){(e===`butt`||e===`round`||e===`square`)&&(this._state.lineCap=e)}get lineJoin(){return this._state.lineJoin}set lineJoin(e){(e===`miter`||e===`round`||e===`bevel`)&&(this._state.lineJoin=e)}get miterLimit(){return this._state.miterLimit}set miterLimit(e){e>0&&isFinite(e)&&(this._state.miterLimit=e)}get globalAlpha(){return this._state.globalAlpha}set globalAlpha(e){e>=0&&e<=1&&isFinite(e)&&(this._state.globalAlpha=e)}get globalCompositeOperation(){return this._state.globalCompositeOperation}set globalCompositeOperation(e){Ge[e]!==void 0&&(this._state.globalCompositeOperation=e)}get imageSmoothingEnabled(){return this._state.imageSmoothingEnabled}set imageSmoothingEnabled(e){this._state.imageSmoothingEnabled=!!e}get imageSmoothingQuality(){return this._state.imageSmoothingQuality}set imageSmoothingQuality(e){(e===`low`||e===`medium`||e===`high`)&&(this._state.imageSmoothingQuality=e)}setLineDash(e){e.some(e=>e<0||!isFinite(e))||(this._state.lineDash=[...e])}getLineDash(){return[...this._state.lineDash]}get lineDashOffset(){return this._state.lineDashOffset}set lineDashOffset(e){isFinite(e)&&(this._state.lineDashOffset=e)}get shadowColor(){return this._state.shadowColor}set shadowColor(e){this._state.shadowColor=e}get shadowBlur(){return this._state.shadowBlur}set shadowBlur(e){e>=0&&isFinite(e)&&(this._state.shadowBlur=e)}get shadowOffsetX(){return this._state.shadowOffsetX}set shadowOffsetX(e){isFinite(e)&&(this._state.shadowOffsetX=e)}get shadowOffsetY(){return this._state.shadowOffsetY}set shadowOffsetY(e){isFinite(e)&&(this._state.shadowOffsetY=e)}get font(){return this._state.font}set font(e){this._state.font=e}get textAlign(){return this._state.textAlign}set textAlign(e){this._state.textAlign=e}get textBaseline(){return this._state.textBaseline}set textBaseline(e){this._state.textBaseline=e}get direction(){return this._state.direction}set direction(e){this._state.direction=e}_toDataURL(e,t){this._surface.flush();let[,n]=mt.file_open_tmp(`canvas-XXXXXX.png`);try{this._surface.writeToPNG(n);let[,e]=dt.File.new_for_path(n).load_contents(null);return`data:image/png;base64,${mt.base64_encode(e)}`}finally{mt.unlink(n)}}_dispose(){this._ctx.$dispose(),this._surface.finish()}};installAllContextMethods$1(CanvasRenderingContext2D.prototype);const ht=e(import.meta.url);let gt;function load$7(){return gt===void 0&&(gt=ht(`@gjsify/node-gi/gi`).requireGi(`Gdk`,`4.0`)),gt}__name$1(load$7,`load`);var _t=new Proxy(Object.create(null),{get(e,t){return load$7()[t]},has(e,t){return t in load$7()}});const vt=e(import.meta.url);let yt;function load$6(){return yt===void 0&&(yt=vt(`@gjsify/node-gi/gi`).requireGi(`GdkPixbuf`,`2.0`)),yt}__name$1(load$6,`load`);var bt=new Proxy(Object.create(null),{get(e,t){return load$6()[t]},has(e,t){return t in load$6()}});setCanvasPixelBridge({imageFromSurface(e,t,n,r,i){return _t.pixbuf_get_from_surface(e,t,n,r,i)},setSourceImage(e,t,n,r){_t.cairo_set_source_pixbuf(e,t,n,r)},setSourcePixels(e,t,n,r,i,a){let o=bt.Pixbuf.new_from_bytes(t,bt.Colorspace.RGB,!0,8,n,r,n*4);_t.cairo_set_source_pixbuf(e,o,i,a)}}),defineGlobal(`HTMLCanvasElement`,Be),defineGlobal(`CanvasRenderingContext2D`,CanvasRenderingContext2D),defineGlobal(`DOMMatrix`,Ve),defineGlobal(`DOMMatrixReadOnly`,He);const xt=Symbol.for(`gjsify_canvas2d_context`);Be.registerContextFactory(`2d`,(e,t)=>{let n=e,r=n[xt];if(r)return r;let i=new CanvasRenderingContext2D(e,t);return n[xt]=i,i});var CharacterData=class extends Se{constructor(e=``){super(),this[y]=j.TEXT_NODE,this._data=e}get data(){return this._data}set data(e){this._data=e}get textContent(){return this._data}set textContent(e){this._data=e}get nodeValue(){return this._data}set nodeValue(e){this._data=e}get length(){return this._data.length}appendData(e){this._data+=e}deleteData(e,t){this._data=this._data.substring(0,e)+this._data.substring(e+t)}insertData(e,t){this._data=this._data.substring(0,e)+t+this._data.substring(e)}replaceData(e,t,n){this._data=this._data.substring(0,e)+n+this._data.substring(e+t)}substringData(e,t){return this._data.substring(e,e+t)}cloneNode(e=!1){return new this.constructor(this._data)}get[Symbol.toStringTag](){return`CharacterData`}},St=class Comment extends CharacterData{constructor(e=``){super(e),this[y]=j.COMMENT_NODE}get nodeName(){return`#comment`}cloneNode(e=!1){return new Comment(this.data)}get[Symbol.toStringTag](){return`Comment`}},Ct=class Text extends CharacterData{constructor(e=``){super(e),this[y]=j.TEXT_NODE}get nodeName(){return`#text`}get wholeText(){let e=this.data,t=this.previousSibling;for(;t&&t instanceof Text;)e=t.data+e,t=t.previousSibling;let n=this.nextSibling;for(;n&&n instanceof Text;)e+=n.data,n=n.nextSibling;return e}splitText(e){let t=this.data.substring(e);this.data=this.data.substring(0,e);let n=new Text(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}cloneNode(e=!1){return new Text(this.data)}get[Symbol.toStringTag](){return`Text`}},wt=class DocumentFragment extends Se{constructor(){super(),this[y]=j.DOCUMENT_FRAGMENT_NODE}get nodeName(){return`#document-fragment`}get children(){return this[S]}get childElementCount(){return this[S].length}get firstElementChild(){return this[S][0]??null}get lastElementChild(){let e=this[S];return e[e.length-1]??null}get textContent(){let e=``;for(let t of this.childNodes)t.textContent!==null&&(e+=t.textContent);return e}set textContent(e){for(;this.firstChild;)this.removeChild(this.firstChild);e&&this.appendChild(new Ct(e))}append(...e){for(let t of e)typeof t==`string`?this.appendChild(new Ct(t)):this.appendChild(t)}prepend(...e){let t=this.firstChild;for(let n of e)typeof n==`string`?this.insertBefore(new Ct(n),t):this.insertBefore(n,t)}replaceChildren(...e){for(;this.firstChild;)this.removeChild(this.firstChild);this.append(...e)}getElementById(e){for(let t of this.children){if(t.id===e)return t;let n=this._findById(t,e);if(n)return n}return null}_findById(e,t){for(let n of e.children){if(n.id===t)return n;let e=this._findById(n,t);if(e)return e}return null}cloneNode(e=!1){let t=new DocumentFragment;if(e)for(let e of this.childNodes)t.appendChild(e.cloneNode(!0));return t}get[Symbol.toStringTag](){return`DocumentFragment`}},HTMLImageElement$1=class extends HTMLElement{static{__name$1(this,`HTMLImageElement`)}constructor(){super(),this._complete=!1,this._naturalHeight=0,this._naturalWidth=0,this[w]=`IMG`,this[T]=`img`,this[E]=we.html}get complete(){return this._complete}get naturalHeight(){return this._naturalHeight}get naturalWidth(){return this._naturalWidth}get currentSrc(){return this.src}get x(){return 0}get y(){return 0}get alt(){return this.getAttribute(`alt`)??``}set alt(e){this.setAttribute(`alt`,e)}get crossOrigin(){return this.getAttribute(`crossorigin`)}set crossOrigin(e){e===null?this.removeAttribute(`crossorigin`):this.setAttribute(`crossorigin`,e)}get decoding(){return this.getAttribute(`decoding`)??`auto`}set decoding(e){this.setAttribute(`decoding`,e)}get loading(){let e=this.getAttribute(`loading`);return e===`lazy`||e===`eager`?e:`auto`}set loading(e){this.setAttribute(`loading`,e)}get referrerPolicy(){return this.getAttribute(`referrerpolicy`)??``}set referrerPolicy(e){this.setAttribute(`referrerpolicy`,e)}get sizes(){return this.getAttribute(`sizes`)??``}set sizes(e){this.setAttribute(`sizes`,e)}get src(){return this.getAttribute(`src`)??``}set src(e){this.setAttribute(`src`,e);let t=globalThis.__GJSIFY_DEBUG_IMG===!0;if(e.startsWith(`data:`)){let n=e.indexOf(`,`);if(n===-1){this._complete=!0,this.dispatchEvent(new Event(`error`));return}let r=e.slice(5,n),i=e.slice(n+1),a=r.includes(`;base64`);try{let e;e=a?mt.base64_decode(i):new TextEncoder().encode(decodeURIComponent(i));let n=mt.Bytes.new(e),r=dt.MemoryInputStream.new_from_bytes(n);this._pixbuf=bt.Pixbuf.new_from_stream(r,null),this._naturalWidth=this._pixbuf.get_width(),this._naturalHeight=this._pixbuf.get_height(),this._complete=!0,t&&console.log(`[img] ok data: (${this._naturalWidth}x${this._naturalHeight})`),this.dispatchEvent(new Event(`load`))}catch(e){t&&console.warn(`[img] error data:: ${e instanceof Error?e.message:String(e)}`),this._complete=!0,this.dispatchEvent(new Event(`error`))}return}let r;if(e.startsWith(`file://`))r=mt.filename_from_uri(e)[0];else if(e.startsWith(`http://`)||e.startsWith(`https://`)){this._complete=!0,this.dispatchEvent(new Event(`error`));return}else{let t=mt.path_get_dirname(n.programInvocationName);r=mt.build_filenamev([t,e])}try{t&&console.log(`[img] load ${r}`),this._pixbuf=bt.Pixbuf.new_from_file(r),this._naturalWidth=this._pixbuf.get_width(),this._naturalHeight=this._pixbuf.get_height(),this._complete=!0,t&&console.log(`[img] ok ${r} (${this._naturalWidth}x${this._naturalHeight})`),this.dispatchEvent(new Event(`load`))}catch(e){t&&console.warn(`[img] error ${r}: ${e instanceof Error?e.message:String(e)}`),this._complete=!0,this.dispatchEvent(new Event(`error`))}}get srcset(){return this.getAttribute(`srcset`)??``}set srcset(e){this.setAttribute(`srcset`,e)}get useMap(){return this.getAttribute(`usemap`)??``}set useMap(e){this.setAttribute(`usemap`,e)}get height(){if(this._pixbuf)return this._pixbuf.get_height();let e=this.getAttribute(`height`);return e===null?0:Number(e)}set height(e){this.setAttribute(`height`,String(e))}get width(){if(this._pixbuf)return this._pixbuf.get_width();let e=this.getAttribute(`width`);return e===null?0:Number(e)}set width(e){this.setAttribute(`width`,String(e))}get isMap(){return this.hasAttribute(`ismap`)}set isMap(e){e?this.setAttribute(`ismap`,``):this.removeAttribute(`ismap`)}decode(){return Promise.resolve()}cloneNode(e=!1){return super.cloneNode(e)}getImageData(){if(!this._pixbuf)return null;let e=this._pixbuf.get_has_alpha()?this._pixbuf:this._pixbuf.add_alpha(!1,0,0,0)??this._pixbuf;return{colorSpace:`srgb`,data:new Uint8ClampedArray(e.get_pixels()),height:e.get_height(),width:e.get_width()}}isPixbuf(){return!!this._pixbuf}get[Symbol.toStringTag](){return`HTMLImageElement`}},HTMLMediaElement=class extends HTMLElement{constructor(...e){super(...e),this._src=``,this._srcObject=null,this.currentTime=0,this.duration=NaN,this.paused=!0,this.ended=!1,this.volume=1,this.muted=!1,this.defaultMuted=!1,this.loop=!1,this.autoplay=!1,this.preload=``,this.playbackRate=1,this.defaultPlaybackRate=1,this.readyState=0,this.networkState=0}get buffered(){return{length:0,start:()=>0,end:()=>0}}get seekable(){return{length:0,start:()=>0,end:()=>0}}get played(){return{length:0,start:()=>0,end:()=>0}}get src(){return this._src}set src(e){this._src=e,this._srcObject=null,this.dispatchEvent(new Event(`srcchange`))}get srcObject(){return this._srcObject}set srcObject(e){this._srcObject=e,this._src=``,this.dispatchEvent(new Event(`srcobjectchange`))}play(){return this.paused=!1,this.ended=!1,this.dispatchEvent(new Event(`play`)),Promise.resolve()}pause(){this.paused=!0,this.dispatchEvent(new Event(`pause`))}load(){this.readyState=0,this.networkState=2,this.dispatchEvent(new Event(`loadstart`))}canPlayType(e){return``}static{this.HAVE_NOTHING=0}static{this.HAVE_METADATA=1}static{this.HAVE_CURRENT_DATA=2}static{this.HAVE_FUTURE_DATA=3}static{this.HAVE_ENOUGH_DATA=4}static{this.NETWORK_EMPTY=0}static{this.NETWORK_IDLE=1}static{this.NETWORK_LOADING=2}static{this.NETWORK_NO_SOURCE=3}get[Symbol.toStringTag](){return`HTMLMediaElement`}};const Tt=1e9;function secondsToGstTime(e){return BigInt(Math.round(e*Tt))}function gstTimeToSeconds(e){return Number(e)/Tt}var HTMLVideoElement$1=class extends HTMLMediaElement{static{__name$1(this,`HTMLVideoElement`)}constructor(){super(),this._pipeline=null,this._videoWidth=0,this._videoHeight=0,this.poster=``,this[w]=`VIDEO`,this[T]=`video`,this[E]=we.html;let e=this;Object.defineProperty(this,"paused",{get(){if(!e._pipeline)return!0;let[,t]=e._pipeline.get_state(0n);return t!==4},configurable:!0,enumerable:!0}),Object.defineProperty(this,"currentTime",{get(){if(!e._pipeline)return 0;let[t,n]=e._pipeline.query_position(3);return t?gstTimeToSeconds(n):0},set(t){e._pipeline?.seek(1,3,5,1,secondsToGstTime(t),0,-1n)},configurable:!0,enumerable:!0}),Object.defineProperty(this,"duration",{get(){if(!e._pipeline)return NaN;let[t,n]=e._pipeline.query_duration(3);return t&&Number(n)>0?gstTimeToSeconds(n):NaN},configurable:!0,enumerable:!0}),Object.defineProperty(this,"volume",{get(){return e._playbin()?.volume??1},set(t){let n=e._playbin();n&&(n.volume=Math.max(0,Math.min(1,t)))},configurable:!0,enumerable:!0}),Object.defineProperty(this,"muted",{get(){return e._playbin()?.mute??!1},set(t){let n=e._playbin();n&&(n.mute=t)},configurable:!0,enumerable:!0})}async play(){this._pipeline?.set_state(4),this.dispatchEvent(new Event(`play`)),this.dispatchEvent(new Event(`playing`))}pause(){this._pipeline?.set_state(3),this.dispatchEvent(new Event(`pause`))}get videoWidth(){return this._videoWidth}set videoWidth(e){this._videoWidth=e}get videoHeight(){return this._videoHeight}set videoHeight(e){this._videoHeight=e}get[Symbol.toStringTag](){return`HTMLVideoElement`}_playbin(){return this._pipeline?.get_by_name(`playbin`)??null}};const Et=new class Document extends Se{static{this._elementFactories=new Map}constructor(){super(),this.body=new HTMLElement,this.head=new HTMLElement,this.documentElement=new HTMLElement,this.appendChild(this.documentElement),this.documentElement.appendChild(this.body)}static registerElementFactory(e,t){Document._elementFactories.set(e.toLowerCase(),t)}createElementNS(e,t){let n=t.toLowerCase(),r=(()=>{switch(n){case`img`:return new HTMLImageElement$1;case`video`:return new HTMLVideoElement$1;case`canvas`:return new Be;default:{let e=Document._elementFactories.get(n);return e?e():new HTMLElement}}})();return r[T]=n,r[w]=n.toUpperCase(),r[E]=e??we.html,r}createElement(e){return this.createElementNS(`http://www.w3.org/1999/xhtml`,e)}createTextNode(e){return new Ct(e)}createComment(e){return new St(e)}createDocumentFragment(){return new wt}createEvent(e){return new Event(e)}getElementById(e){return this._findById(this.body,e)}_findById(e,t){if(e.id===t)return e;for(let n of e.children){let e=this._findById(n,t);if(e)return e}return null}get[Symbol.toStringTag](){return`Document`}};var DOMTokenList=class{constructor(e,t){this._ownerElement=e,this._attributeName=t}_getTokens(){let e=this._ownerElement.getAttribute(this._attributeName);return e?e.split(/\s+/).filter(e=>e.length>0):[]}_setTokens(e){let t=e.join(` `);t?this._ownerElement.setAttribute(this._attributeName,t):this._ownerElement.removeAttribute(this._attributeName)}get length(){return this._getTokens().length}get value(){return this._ownerElement.getAttribute(this._attributeName)??``}set value(e){e?this._ownerElement.setAttribute(this._attributeName,e):this._ownerElement.removeAttribute(this._attributeName)}item(e){let t=this._getTokens();return e>=0&&e<t.length?t[e]:null}contains(e){return this._getTokens().includes(e)}add(...e){let t=this._getTokens();for(let n of e)n&&!t.includes(n)&&t.push(n);this._setTokens(t)}remove(...e){let t=this._getTokens().filter(t=>!e.includes(t));this._setTokens(t)}toggle(e,t){let n=this.contains(e);return t===void 0?n?(this.remove(e),!1):(this.add(e),!0):t?(this.add(e),!0):(this.remove(e),!1)}replace(e,t){let n=this._getTokens(),r=n.indexOf(e);return r===-1?!1:(n[r]=t,this._setTokens(n),!0)}supports(e){return!0}forEach(e){let t=this._getTokens();for(let n=0;n<t.length;n++)e(t[n],n,this)}keys(){return this._getTokens().keys()}values(){return this._getTokens().values()}entries(){return this._getTokens().entries()}[Symbol.iterator](){return this._getTokens().values()}toString(){return this.value}get[Symbol.toStringTag](){return`DOMTokenList`}};function installWindowEventBus(e){if(e.__gjsify_globalEventTarget)return e.__gjsify_globalEventTarget;let t=new EventTarget,n=typeof e.addEventListener==`function`?e.addEventListener.bind(e):null,r=typeof e.removeEventListener==`function`?e.removeEventListener.bind(e):null;e.__gjsify_globalEventTarget=t;let define=(t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0});return define(`addEventListener`,(e,r,i)=>{t.addEventListener(e,r,i),n?.(e,r,i)}),define(`removeEventListener`,(e,n,i)=>{t.removeEventListener(e,n,i),r?.(e,n,i)}),define(`dispatchEvent`,e=>t.dispatchEvent(e)),t}installWindowEventBus(globalThis),defineGlobal(`Text`,Ct),defineGlobal(`Comment`,St),defineGlobal(`DocumentFragment`,wt),defineGlobal(`DOMTokenList`,DOMTokenList),defineGlobal(`document`,Et),defineGlobalIfMissing(`self`,globalThis);var Window=class{static[Symbol.hasInstance](e){return e===globalThis}};defineGlobalIfMissing(`Window`,Window),defineGlobalIfMissing(`window`,globalThis),defineGlobalIfMissing(`focus`,()=>{}),defineGlobalIfMissing(`blur`,()=>{}),defineGlobalIfMissing(`devicePixelRatio`,1),defineGlobalIfMissing(`scrollX`,0),defineGlobalIfMissing(`scrollY`,0),defineGlobalIfMissing(`pageXOffset`,0),defineGlobalIfMissing(`pageYOffset`,0),defineGlobalIfMissing(`alert`,(...e)=>console.error(`alert:`,...e)),globalThis.top===void 0&&Object.defineProperty(globalThis,"top",{get:()=>globalThis,configurable:!0});function fontMapNamespace(){let e=ot.FontMap;if(e!=null&&typeof e.get_default==`function`&&typeof e.new_for_font_type==`function`)return e}function isUnsupportedByFontMap(e){let t=mt.Error,n=dt.io_error_quark,r=dt.IOErrorEnum?.NOT_SUPPORTED;return typeof t!=`function`||typeof n!=`function`||r===void 0||!(e instanceof t)?!1:e.matches(n(),r)}function fontErrorMessage(e){let t=mt.Error;return typeof t==`function`&&e instanceof t?e.message??String(e):e instanceof Error?e.message:String(e)}function fontMapFamilies(e){return e.list_families().map(e=>e.get_name())}function fontMapHasFamily(e,t){return e.get_family(t)!==null}function layoutSize(e,t){let n=new rt.FontDescription;n.set_family(t),n.set_size(40*rt.SCALE);let r=rt.Layout.new(e.create_context());return r.set_font_description(n),r.set_text(`Wg`,-1),r.get_pixel_size().join(`x`)}function fontMapServesFamily(e,t,n=layoutSize){return n(e,t)!==n(e,`ZzzGjsifySubstitutionControlQx`)}const Dt={map:null,before:[],failed:new Map,adopted:!1};function probeFontconfigMap(e,t,n,r=[]){if(n.length===0||mt.getenv(`PANGOCAIRO_BACKEND`)!==null)return Dt;let i=e.new_for_font_type(1);if(i==null)return Dt;let a=fontMapFamilies(i);if(a.length===0)return Dt;let o=new Map;for(let e of n)try{i.add_font_file(e)}catch(t){o.set(e,fontErrorMessage(t))}let s=fontMapFamilies(i).filter(e=>!a.includes(e));if(s.length===0)return{map:i,before:a,failed:o,adopted:!1};let alreadyReached=e=>!r.includes(e)&&t.get_family(e)!==null;if(s.every(alreadyReached))return{map:i,before:a,failed:o,adopted:!1};let c=i.set_default;return typeof c==`function`?(c.call(i),{map:i,before:a,failed:o,adopted:!0}):{map:i,before:a,failed:o,adopted:!1}}function noRegistration(){return{available:!1,map:void 0,before:[],registered:[],declined:[],unreachable:[],failed:[],fontconfigFallback:!1}}function registerFontFaces(e,t){let n=fontMapNamespace();if(n===void 0)return noRegistration();let r=t??n.get_default();if(e.length===0)return{...noRegistration(),available:!0,map:r,before:fontMapFamilies(r)};let i=fontMapFamilies(r),a=[],o=[],s=[],c=[];for(let t of e)try{r.add_font_file(t),a.push(t)}catch(e){if(isUnsupportedByFontMap(e)){o.push(t);continue}c.push({path:t,message:fontErrorMessage(e)})}let l=[];a.length>0&&(l=fontMapFamilies(r).filter(e=>!i.includes(e)).filter(e=>!fontMapServesFamily(r,e)),l.length>0&&s.push(...a));let u=[...o,...s];if(u.length>0){let e=probeFontconfigMap(n,r,u,l),t=[];for(let n of o){let r=e.failed.get(n);r===void 0?e.adopted?a.push(n):t.push(n):c.push({path:n,message:r})}if(o.length=0,o.push(...t),e.adopted)s.length=0;else{let t=s.filter(t=>!e.failed.has(t));for(let t of s){let n=e.failed.get(t);n!==void 0&&c.push({path:t,message:n})}s.length=0,s.push(...t)}if(e.adopted&&e.map!==null)return{available:!0,map:e.map,before:e.before,registered:a,declined:o,unreachable:s,failed:c,fontconfigFallback:!0}}return{available:!0,map:r,before:i,registered:a,declined:o,unreachable:s,failed:c,fontconfigFallback:!1}}var FontFace=class{constructor(e,t,n){this.status=`unloaded`,this.display=`auto`,this.style=`normal`,this.weight=`normal`,this.stretch=`normal`,this.unicodeRange=`U+0-10FFFF`,this.variant=`normal`,this.featureSettings=`normal`,this.family=e,this.source=typeof t==`string`?t:`[binary]`,this.loaded=Promise.resolve(this)}_extractFilePath(){let e=this.source.match(/url\s*\(\s*["']?(file:\/\/\/[^"')]+)["']?\s*\)/i);return e?e[1].replace(/^file:\/\//,``):null}async load(){this.status=`loading`;let e=this._extractFilePath();if(e){let t=registerFontFaces([e]);t.available&&reportRegistration(this.family,t)}return this.status=`loaded`,this}};function reportRegistration(e,t){for(let n of t.failed)console.warn(`FontFace.load: ${n.path} could not be read as a font (${n.message}), so text asking for "${e}" will render in a substituted one.`);for(let e of t.declined)console.warn(`FontFace.load: no font map in this process would take ${e} — Pango answers a family it does not hold with the default sans, and nothing else says so. A shipped .app reaches its faces through ATSApplicationFontsPath; a bare \`gjsify run\` needs initFonts() first.`);for(let n of t.unreachable)console.warn(`FontFace.load: ${n} is registered and "${e}" is a family this font map holds, but text asking for it will still render in a substituted one: the map had already resolved that family to the fallback, and that cached answer cannot be asked again. Register the face before anything lays text out.`);t.registered.length!==0&&t.map!==void 0&&(fontMapHasFamily(t.map,e)||console.warn(`FontFace.load: ${t.registered[0]} is registered, but "${e}" is not a family on the font map — it may be registered under a different name, and text asking for it will render in a substituted one.`))}var FontFaceSet=class{constructor(){this.status=`loaded`,this.ready=Promise.resolve(this),this._faces=new Set}addEventListener(e,t){}removeEventListener(e,t){}dispatchEvent(e){return!0}add(e){return this._faces.add(e),this}delete(e){return this._faces.delete(e)}clear(){this._faces.clear()}has(e){return this._faces.has(e)}check(e,t){return!1}load(e,t){return Promise.resolve([])}forEach(e){this._faces.forEach(t=>e(t,t,this))}values(){return this._faces.values()}keys(){return this._faces.values()}entries(){return Array.from(this._faces).map(e=>[e,e])[Symbol.iterator]()}[Symbol.iterator](){return this._faces[Symbol.iterator]()}get size(){return this._faces.size}};const Ot=globalThis;defineGlobalIfMissing(`FontFace`,FontFace),Ot.FontFace===void 0&&(Ot.FontFace=FontFace);const kt=Ot.document;kt&&kt.fonts===void 0&&Object.defineProperty(kt,"fonts",{value:new FontFaceSet,configurable:!0,writable:!0});var Image=class extends HTMLImageElement$1{constructor(e=null,t=null){super(),e!==null&&(this.width=e),t!==null&&(this.height=t)}};defineGlobal(`HTMLImageElement`,HTMLImageElement$1),defineGlobal(`Image`,Image),defineGlobalIfMissing(`location`,{href:`file://`,origin:`file://`,protocol:`file:`,host:``,hostname:``,port:``,pathname:`/`,search:``,hash:``,assign(e){},replace(e){},reload(){},toString(){return this.href},ancestorOrigins:{length:0,item:()=>null,contains:()=>!1,[Symbol.iterator]:function*(){}}});var MediaQueryList=class extends EventTarget{constructor(e){super(),this.onchange=null,this.media=e,this.matches=!1}addListener(e){}removeListener(e){}};function matchMedia(e){return new MediaQueryList(e)}defineGlobalIfMissing(`matchMedia`,matchMedia);var MutationObserver=class{constructor(e){}observe(e,t){}disconnect(){}takeRecords(){return[]}};const At=new Set;let jt=!1;function scheduleFlush(){jt||(jt=!0,queueMicrotask(()=>{jt=!1;let e=Array.from(At);At.clear();for(let t of e)t._deliver()}))}var ResizeObserver=class{constructor(e){this._observed=new Map,this._pending=new Map,this._callback=e}observe(e,t){if(this._observed.has(e))return;let n=e._onResize((t,n)=>{this._enqueue(e,t,n)});this._observed.set(e,n),queueMicrotask(()=>{if(!this._observed.has(e))return;let t=readClientRect(e);this._enqueue(e,t.width,t.height)})}unobserve(e){let t=this._observed.get(e);t&&(t(),this._observed.delete(e),this._pending.delete(e))}disconnect(){for(let e of this._observed.values())e();this._observed.clear(),this._pending.clear(),At.delete(this)}_deliver(){if(this._pending.size===0)return;let e=Array.from(this._pending.values());this._pending.clear();try{this._callback(e,this)}catch(e){console.error(`ResizeObserver callback threw:`,e)}}_enqueue(e,t,n){let r={inlineSize:t,blockSize:n};this._pending.set(e,{target:e,contentRect:{x:0,y:0,width:t,height:n,top:0,right:t,bottom:n,left:0},borderBoxSize:[r],contentBoxSize:[r],devicePixelContentBoxSize:[r]}),At.add(this),scheduleFlush()}};function readClientRect(e){let t=e.getBoundingClientRect;if(typeof t==`function`){let n=t.call(e);return{width:n.width??0,height:n.height??0}}return{width:0,height:0}}var IntersectionObserver=class{constructor(e,t){this.root=t?.root??null,this.rootMargin=t?.rootMargin??`0px`,this.thresholds=Array.isArray(t?.threshold)?t.threshold:[t?.threshold??0]}observe(e){}unobserve(e){}disconnect(){}takeRecords(){return[]}};defineGlobal(`MutationObserver`,MutationObserver),defineGlobal(`ResizeObserver`,ResizeObserver),defineGlobal(`IntersectionObserver`,IntersectionObserver);const Mt={CustomEvent:CustomEvent$1,MessageEvent,ErrorEvent,CloseEvent,ProgressEvent:ProgressEvent$1};for(let[e,t]of Object.entries(Mt))globalThis[e]===void 0&&Object.defineProperty(globalThis,e,{value:t,writable:!0,configurable:!0});const Nt={UIEvent,MouseEvent,PointerEvent,KeyboardEvent,WheelEvent,FocusEvent};for(let[e,t]of Object.entries(Nt))globalThis[e]===void 0&&Object.defineProperty(globalThis,e,{value:t,writable:!0,configurable:!0});var Pt,__name,Ft=__esmMin((()=>{Pt=Object.defineProperty,__name=(e,t)=>Pt(e,`name`,{value:t,configurable:!0})}));function validateHeaderName(e){if(typeof e!=`string`||!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let t=TypeError(`Header name must be a valid HTTP token ["${e}"]`);throw Object.defineProperty(t,"code",{value:`ERR_INVALID_HTTP_TOKEN`}),t}}function validateHeaderValue(e,t){if(t===void 0){let t=TypeError(`Header "${e}" value must not be undefined`);throw Object.defineProperty(t,"code",{value:`ERR_HTTP_INVALID_HEADER_VALUE`}),t}if(typeof t==`string`&&/[^\t -~-ÿ]/.test(t)){let t=TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(t,"code",{value:`ERR_INVALID_CHAR`}),t}}const It=Symbol(`Headers.headers`);function isBoxedPrimitive(e){return e instanceof String||e instanceof Number||e instanceof Boolean||typeof Symbol<`u`&&e instanceof Symbol||typeof BigInt<`u`&&e instanceof BigInt}var Lt=class Headers{[It];constructor(e){if(this[It]=new Map,e!=null){if(e instanceof Headers){for(let[t,n]of e[It])this[It].set(t,[...n]);return}if(typeof e==`object`&&!isBoxedPrimitive(e)){let t=e[Symbol.iterator];if(t==null)for(let[t,n]of Object.entries(e))validateHeaderName(t),validateHeaderValue(t,String(n)),this.append(t,String(n));else{if(typeof t!=`function`)throw TypeError(`Header pairs must be iterable`);for(let t of e){if(typeof t!=`object`||isBoxedPrimitive(t))throw TypeError(`Each header pair must be an iterable object`);let e=[...t];if(e.length!==2)throw TypeError(`Each header pair must be a name/value tuple`);validateHeaderName(e[0]),validateHeaderValue(e[0],String(e[1])),this.append(e[0],String(e[1]))}}}else throw TypeError(`Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)'`)}}append(e,t){validateHeaderName(e),validateHeaderValue(e,t);let n=String(e).toLowerCase(),r=String(t),i=this[It].get(n);i?i.push(r):this[It].set(n,[r])}set(e,t){validateHeaderName(e),validateHeaderValue(e,t);let n=String(e).toLowerCase();this[It].set(n,[String(t)])}delete(e){this[It].delete(String(e).toLowerCase())}has(e){return this[It].has(String(e).toLowerCase())}get(e){let t=this[It].get(String(e).toLowerCase());if(!t||t.length===0)return null;let n=t.join(`, `);return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}getAll(e){return this[It].get(String(e).toLowerCase())??[]}getSetCookie(){return this[It].get(`set-cookie`)??[]}forEach(e,t){for(let n of this.keys())Reflect.apply(e,t,[this.get(n),n,this])}*keys(){let e=[...this[It].keys()].sort(),t=new Set;for(let n of e)t.has(n)||(t.add(n),yield n)}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return`Headers`}toString(){return Object.prototype.toString.call(this)}raw(){let e={};for(let t of this.keys())e[t]=this.getAll(t);return e}_appendToSoupMessage(e,t,n=e.MessageHeadersType.REQUEST){let r=t?t.get_request_headers():new e.MessageHeaders(n);for(let[e,t]of this.entries())r.append(e,t);return r}static _newFromSoupMessage(e,t,n=e.MessageHeadersType.RESPONSE){let r=new Headers,i;return i=n===e.MessageHeadersType.RESPONSE?t.get_response_headers():t.get_request_headers(),i.foreach((e,t)=>{r.append(e,t)}),r}[Symbol.for(`nodejs.util.inspect.custom`)](){let e={};for(let t of this.keys()){let n=this.getAll(t);t===`host`?e[t]=n[0]:e[t]=n.length>1?n:n[0]}return e}};Object.defineProperties(Lt.prototype,[`get`,`entries`,`forEach`,`values`].reduce((e,t)=>(e[t]={enumerable:!0},e),{}));var Rt=__esmMin((()=>{}));Rt();var FetchBaseError=class extends Error{type;constructor(e,t){super(e),typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,this.constructor),this.type=t}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},FetchError=class extends FetchBaseError{code;errno;erroredSysCall;constructor(e,t,n){super(e,t),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}};const zt=globalThis.URL,Bt=globalThis.URLSearchParams,Vt=Symbol.toStringTag,isURLSearchParameters=e=>typeof e==`object`&&typeof e.append==`function`&&typeof e.delete==`function`&&typeof e.get==`function`&&typeof e.getAll==`function`&&typeof e.has==`function`&&typeof e.set==`function`&&typeof e.sort==`function`&&e[Vt]===`URLSearchParams`,isBlob=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.arrayBuffer==`function`&&typeof t.type==`string`&&typeof t.stream==`function`&&typeof t.constructor==`function`&&/^(Blob|File)$/.test(t[Vt])},isAbortSignal=e=>{if(typeof e!=`object`||!e)return!1;let t=e;return t[Vt]===`AbortSignal`||t[Vt]===`EventTarget`},isDomainOrSubdomain=(e,t)=>{let n=new zt(t).hostname,r=new zt(e).hostname;return n===r||n.endsWith(`.${r}`)},isSameProtocol=(e,t)=>new zt(t).protocol===new zt(e).protocol;function formDataToBlob(e){let t=`----FormDataBoundary`+Math.random().toString(36).slice(2),n=[];for(let[r,i]of e.entries())typeof i==`string`?n.push(`--${t}\r\nContent-Disposition: form-data; name="${r}"\r\n\r\n${i}\r\n`):(n.push(`--${t}\r\nContent-Disposition: form-data; name="${r}"; filename="${i.name}"\r\nContent-Type: ${i.type||`application/octet-stream`}\r\n\r\n`),n.push(i),n.push(`\r
|
|
3
|
-
`));return n.push(`--${t}--\r\n`),new Blob(n,{type:`multipart/form-data; boundary=${t}`})}var
|
|
4
|
-
--`+e;let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n),this.boundaryChars[t[n]]=!0;this.boundary=t,this.lookbehind=new Uint8Array(this.boundary.length+8)}write(e){let t=0,n=e.length,r=this.index,{lookbehind:i,boundary:a,boundaryChars:o,index:s,state:c,flags:l}=this,u=this.boundary.length,d=u-1,f=e.length,p,m,mark=e=>{this[e+`Mark`]=t},clear=e=>{delete this[e+`Mark`]},callback=(e,t,n,r)=>{(t===void 0||t!==n)&&this[e](r&&r.subarray(t,n))},dataCallback=(n,r=!1)=>{let i=n+`Mark`;i in this&&(r?(callback(n,this[i],t,e),delete this[i]):(callback(n,this[i],e.length,e),this[i]=0))};for(t=0;t<n;t++)switch(p=e[t],c){case 0:if(s===a.length-2){if(p===45)l|=Kt.LAST_BOUNDARY;else if(p!==13)return;s++;break}else if(s-1==a.length-2){if(l&Kt.LAST_BOUNDARY&&p===45)c=9,l=0;else if(!(l&Kt.LAST_BOUNDARY)&&p===10)s=0,callback(`onPartBegin`),c=1;else return;break}p!==a[s+2]&&(s=-2),p===a[s+2]&&s++;break;case 1:c=2,mark(`onHeaderField`),s=0;case 2:if(p===13){clear(`onHeaderField`),c=6;break}if(s++,p===45)break;if(p===58){if(s===1)return;dataCallback(`onHeaderField`,!0),c=3;break}if(m=lower(p),m<97||m>122)return;break;case 3:if(p===32)break;mark(`onHeaderValue`),c=4;case 4:p===13&&(dataCallback(`onHeaderValue`,!0),callback(`onHeaderEnd`),c=5);break;case 5:if(p!==10)return;c=1;break;case 6:if(p!==10)return;callback(`onHeadersEnd`),c=7;break;case 7:c=8,mark(`onPartData`);case 8:if(r=s,s===0){for(t+=d;t<f&&!(e[t]in o);)t+=u;t-=d,p=e[t]}if(s<a.length)a[s]===p?(s===0&&dataCallback(`onPartData`,!0),s++):s=0;else if(s===a.length)s++,p===13?l|=Kt.PART_BOUNDARY:p===45?l|=Kt.LAST_BOUNDARY:s=0;else if(s-1===a.length)if(l&Kt.PART_BOUNDARY){if(s=0,p===10){l&=~Kt.PART_BOUNDARY,callback(`onPartEnd`),callback(`onPartBegin`),c=1;break}}else l&Kt.LAST_BOUNDARY&&p===45?(callback(`onPartEnd`),c=9,l=0):s=0;if(s>0)i[s-1]=p;else if(r>0){let e=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);callback(`onPartData`,0,r,e),r=0,mark(`onPartData`),t--}break;case 9:break;default:throw Error(`Unexpected state entered: ${c}`)}dataCallback(`onHeaderField`),dataCallback(`onHeaderValue`),dataCallback(`onPartData`),this.index=s,this.state=c,this.flags=l}end(){if(this.state===1&&this.index===0||this.state===8&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==9)throw Error(`MultipartParser.end(): stream ended unexpectedly`)}}}));Ft(),Rt(),Ut(),__name((e,t)=>new Promise((n,r)=>{u(e,t,e=>{e?r(e):n()})}),`pipeline`);const Jt=Symbol(`Body internals`);function isAnyArrayBuffer(e){return e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer}var Body=class{[Jt]={body:null,stream:null,webStream:null,boundary:``,disturbed:!1,error:null};size=0;constructor(e,t={size:0}){if(this.size=t.size||0,e==null)this[Jt].body=null;else if(isURLSearchParameters(e))this[Jt].body=i.from(e.toString());else if(isBlob(e))this[Jt].body=e;else if(i.isBuffer(e))this[Jt].body=e;else if(isAnyArrayBuffer(e))this[Jt].body=i.from(e);else if(ArrayBuffer.isView(e))this[Jt].body=i.from(e.buffer,e.byteOffset,e.byteLength);else if(e instanceof c)this[Jt].body=e;else if(typeof ReadableStream<`u`&&e instanceof ReadableStream)this[Jt].body=readableStreamToReadable(e);else if(e instanceof Ht){let t=formDataToBlob(e);this[Jt].body=t,this[Jt].boundary=t.type?.split(`boundary=`)?.[1]??``}else typeof e==`string`?this[Jt].body=i.from(e):e instanceof Bt?this[Jt].body=i.from(e.toString()):(console.warn(`Unknown body type "${typeof e}", try to parse the body to string!`),this[Jt].body=i.from(String(e)));let n=this[Jt].body;i.isBuffer(n)?this[Jt].stream=c.from(n):isBlob(n)?this[Jt].stream=c.from(blobToAsyncIterable(n)):n instanceof c&&(this[Jt].stream=n),n instanceof l&&n.on(`error`,e=>{let t=e instanceof FetchBaseError?e:new FetchError(`Invalid response body while trying to fetch ${this.url}: ${e.message}`,`system`,e);this[Jt].error=t})}get body(){let e=this[Jt].stream;if(!e)return null;let t=this[Jt].webStream;if(t)return t;if(typeof ReadableStream<`u`){let t=!1,n=new ReadableStream({start(n){e.on(`data`,e=>{if(!t)try{n.enqueue(e instanceof Uint8Array?e:new Uint8Array(e))}catch{}}),e.on(`end`,()=>{if(!t){t=!0;try{n.close()}catch{}}}),e.on(`error`,e=>{if(!t){t=!0;try{n.error(e)}catch{}}})},cancel(){t=!0,e.destroy()}});return this[Jt].webStream=n,n}return null}get _stream(){return this[Jt].stream}get _rawBodyBuffer(){let e=this[Jt].body;return e===null?null:i.isBuffer(e)?e:e instanceof Uint8Array?i.from(e.buffer,e.byteOffset,e.byteLength):null}get bodyUsed(){return this[Jt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:t,byteLength:n}=await consumeBody(this);return e.slice(t,t+n)}async formData(){let e=this.headers?.get(`content-type`);if(e?.startsWith(`application/x-www-form-urlencoded`)){let e=new Ht,t=new Bt(await this.text());for(let[n,r]of t)e.append(n,r);return e}let{toFormData:t}=await Promise.resolve().then(()=>(qt(),Wt));return t(this.body,e)}async blob(){let e=this.headers?.get(`content-type`)||this[Jt].body&&this[Jt].body.type||``;return new r([await this.arrayBuffer()],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await consumeBody(this);return new TextDecoder().decode(e)}};Object.defineProperties(Body.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});async function consumeBody(e){if(e[Jt].disturbed)throw TypeError(`body used already for: ${e.url}`);if(e[Jt].disturbed=!0,e[Jt].error)throw e[Jt].error;let{_stream:t}=e;if(t===null||!(t instanceof l))return i.alloc(0);let n=[],r=0;try{for await(let i of t){if(e.size>0&&r+i.length>e.size){let n=new FetchError(`content size at ${e.url} over limit: ${e.size}`,`max-size`);throw t.destroy(n),n}r+=i.length,n.push(i)}}catch(t){let n=t instanceof Error?t:Error(String(t));throw t instanceof FetchBaseError?t:new FetchError(`Invalid response body while trying to fetch ${e.url}: ${n.message}`,`system`,n)}try{return n.every(e=>typeof e==`string`)?i.from(n.join(``)):i.concat(n,r)}catch(t){let n=t instanceof Error?t:Error(String(t));throw new FetchError(`Could not create Buffer from response body for ${e.url}: ${n.message}`,`system`,n)}}const clone=(e,t)=>{let n,r,{body:i}=e[Jt];if(e.bodyUsed)throw Error(`cannot clone body after it is used`);return i instanceof l&&typeof i.getBoundary!=`function`&&(n=new s({highWaterMark:t}),r=new s({highWaterMark:t}),i.pipe(n),i.pipe(r),e[Jt].stream=n,i=r),i},extractContentType=(e,t)=>e===null?null:typeof e==`string`?`text/plain;charset=UTF-8`:isURLSearchParameters(e)?`application/x-www-form-urlencoded;charset=UTF-8`:isBlob(e)?e.type||null:i.isBuffer(e)||isAnyArrayBuffer(e)||ArrayBuffer.isView(e)?null:e instanceof Ht?`multipart/form-data; boundary=${t[Jt].boundary}`:e instanceof l?null:`text/plain;charset=UTF-8`,getTotalBytes=e=>{let{body:t}=e[Jt];if(t===null)return 0;if(isBlob(t))return t.size;if(i.isBuffer(t))return t.length;if(t&&typeof t.getLengthSync==`function`){let e=t;return e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null}return null};function readableStreamToReadable(e){let t=e.getReader();return new c({async read(){try{let{done:e,value:n}=await t.read();e?this.push(null):this.push(i.from(n))}catch(e){this.destroy(e)}},destroy(e,n){t.cancel().then(()=>n(null),n)}})}async function*blobToAsyncIterable(e){if(typeof e.stream==`function`){let t=e.stream().getReader();for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}else yield new Uint8Array(await e.arrayBuffer())}const Yt=new Set([301,302,303,307,308]),isRedirect=e=>Yt.has(e);var Xt=mt,Zt=dt;const Qt=Symbol(`Response internals`);var $t=class Response extends Body{[Qt];_inputStream=null;constructor(e=null,t={}){super(e,t);let n=t.status==null?200:t.status,r=new Lt(t.headers);if(e!==null&&!r.has(`Content-Type`)){let t=extractContentType(e,this);t&&r.append(`Content-Type`,t)}this[Qt]={type:`default`,url:t.url,status:n,statusText:t.statusText||``,headers:r,counter:t.counter,highWaterMark:t.highWaterMark}}get type(){return this[Qt].type}get url(){return this[Qt].url||``}get status(){return this[Qt].status}get ok(){return this[Qt].status>=200&&this[Qt].status<300}get redirected(){return this[Qt].counter>0}get statusText(){return this[Qt].statusText}get headers(){return this[Qt].headers}get highWaterMark(){return this[Qt].highWaterMark}clone(){return new Response(clone(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,t=302){if(!isRedirect(t))throw RangeError(`Failed to execute "redirect" on "response": Invalid status code`);return new Response(null,{headers:{location:new zt(e).toString()},status:t})}static error(){let e=new Response(null,{status:0,statusText:``});return e[Qt].type=`error`,e}static json(e,t){let n=JSON.stringify(e),r={...t},i=new Lt(r.headers);return i.has(`content-type`)||i.set(`content-type`,`application/json`),r.headers=i,new Response(n,r)}get[Symbol.toStringTag](){return`Response`}async text(){if(!this._inputStream)return super.text();let e=Zt.MemoryOutputStream.new_resizable();await new Promise((t,n)=>{e.splice_async(this._inputStream,Zt.OutputStreamSpliceFlags.CLOSE_TARGET|Zt.OutputStreamSpliceFlags.CLOSE_SOURCE,Xt.PRIORITY_DEFAULT,null,(r,i)=>{try{t(e.splice_finish(i))}catch(e){n(e)}})});let t=e.steal_as_bytes();return new TextDecoder().decode(t.toArray())}};Object.defineProperties($t.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});function gbytesToUint8Array(e){return e.toArray()}const warnNotImplemented=e=>{let t=e?`Not implemented: ${e}`:`Not implemented`;return console.warn(t),t};function isWindowsPath(e){return/^[A-Za-z]:[\\/]/.test(e)||e.startsWith(`\\\\`)}function lastPathSeparatorIndex(e){let t=e.lastIndexOf(`/`);return isWindowsPath(e)?Math.max(t,e.lastIndexOf(`\\`)):t}function pathToFileUrlHref(e,t){let n=t?.windows??isWindowsPath(e),r=n?e.replace(/\\/g,`/`):e;if(n&&r.startsWith(`//`)){let e=r.indexOf(`/`,2);return`file://${e===-1?r.slice(2):r.slice(2,e)}${encodePathForFileUrl(e===-1?``:r.slice(e))}`}return`${r.startsWith(`/`)?`file://`:`file:///`}${encodePathForFileUrl(r)}`}function encodePathForFileUrl(e){let t=``;for(let n of e)t+=en.test(n)?n:percentEncode(n);return t}const en=/^[A-Za-z0-9!$&'()*+,\-./:;=@_]$/;function percentEncode(e){let t=``;for(let n of new TextEncoder().encode(e))t+=`%${n.toString(16).toUpperCase().padStart(2,`0`)}`;return t}function hostGi(){return globalThis.imports?.gi}function directoryOf(e){return/^(.*)[\\/][^\\/]*$/.exec(e)?.[1]}function colocateNativeLibrary(e,t=hostGi()){try{let n=t?.GIRepository?.Repository?.dup_default?.(),r=n?.get_typelib_path(e),i=r?directoryOf(r):void 0;return!n||!i?!1:(n.prepend_library_path(i),!0)}catch{return!1}}function probeNativeLibrary(e,t=hostGi()){try{let n=t?.GIRepository?.Repository?.dup_default?.(),r=n?.get_typelib_path(e);if(!t||!n||!r)return null;let i=firstSymbol(n,e);if(!i||(t.GModule?.module_error(),i.info.get_typelib().symbol(i.name)[0]))return null;let a=directoryOf(r)??`.`,o=r.includes(`\\`)&&!r.includes(`/`)?`\\`:`/`;for(let s of n.get_shared_libraries(e)??[]){let n=`${a}${o}${s}`,c=t.GLib?.file_test(n,t.GLib.FileTest.EXISTS)?n:s,l=loaderError(t,e,r,c,i.name);if(l!==void 0)return{namespace:e,library:c,reason:l,missingDependency:missingLibraryDependency(l,c)}}let s=(n.get_shared_libraries(e)??[]).join(`, `)||`(none named)`;return{namespace:e,library:s,reason:`symbol ${i.name} not found in ${s}, and the loader reported no error`}}catch{return null}}function firstSymbol(e,t){let n=e.get_n_infos(t),r=null;for(let i=0;i<n;i++){let n=e.get_info(t,i),a=n.get_type_init_function_name?.();if(a)return{info:n,name:a};let o=n.get_symbol?.();o&&!r&&(r={info:n,name:o})}return r}function loaderError(e,t,n,r,i){let{GIRepository:a,GLib:o,GModule:s}=e;if(!a?.Repository||!a.Typelib||!o||!s)return;let[,c]=o.file_get_contents(n),l=new TextEncoder().encode(`${r}\0`),u=new Uint8Array(c.length+l.length);u.set(c),u.set(l,c.length);let d=new DataView(u.buffer);d.setUint32(40,u.length,!0),d.setUint32(52,c.length,!0);let f=new a.Repository,p=firstSymbol(f,f.load_typelib(a.Typelib.new_from_bytes(new o.Bytes(u)),0));if(p&&(s.module_error(),!p.info.get_typelib().symbol(i)[0]))return s.module_error()??`${t}: ${r} could not be opened (the loader reported no error)`}function missingLibraryDependency(e,t){let n=/Library not loaded: (\S+)/.exec(e)?.[1]??/Error loading shared library ([^\s:]+): .*\(needed by /.exec(e)?.[1]??/(?:^|\s)([^\s:]+): cannot open shared object file/.exec(e)?.[1];if(!n)return;let r=n.replace(/^.*[\\/]/,``);if(!(t&&r===t.replace(/^.*[\\/]/,``)))return r}var NativeLibraryLoadError=class extends Error{failure;constructor(e,t){let n=e.missingDependency?`It needs ${e.missingDependency}, which the loader could not find: not installed, or not on its search path.`:`The loader could not open it.`;super(`${e.namespace}: the native library ${e.library} could not be loaded. ${n}\nLoader: ${e.reason.trim()}\n`+(t??"`gjsify system-check` lists the system libraries the installed @gjsify packages need, with the install command for this host.")),this.name=`NativeLibraryLoadError`,this.failure=e}};function openNativeLibrary(e,t=hostGi()){colocateNativeLibrary(e,t);let n=probeNativeLibrary(e,t);return n?new NativeLibraryLoadError(n):null}async function readBytesAsync(e,t=4096,n=Xt.PRIORITY_DEFAULT,r=null){return new Promise((i,a)=>{e.read_bytes_async(t,n,r,(t,n)=>{try{let t=e.read_bytes_finish(n);return t.get_size()===0?i(null):i(gbytesToUint8Array(t))}catch(e){let t=e;if(typeof t.matches==`function`&&(t.matches(Zt.IOErrorEnum,Zt.IOErrorEnum.PARTIAL_INPUT)||t.matches(Zt.IOErrorEnum,Zt.IOErrorEnum.CONNECTION_CLOSED)||t.matches(Zt.IOErrorEnum,Zt.IOErrorEnum.BROKEN_PIPE)||t.matches(Zt.IOErrorEnum,Zt.IOErrorEnum.CLOSED)))return i(null);a(e)}})})}async function*inputStreamAsyncIterator(e,t=4096,n=Xt.PRIORITY_DEFAULT,r=null){let i;for(;(i=await readBytesAsync(e,t,n,r))!==null;)yield i}async function soupSendAsync(e,t,n=Xt.PRIORITY_DEFAULT,r=null){return new Promise((i,a)=>{let o=!1,onCancel=()=>{o||(o=!0,a(new Zt.IOErrorEnum({code:Zt.IOErrorEnum.CANCELLED,message:`Operation was cancelled`})))},s=r?r.connect(onCancel):0;o||e.send_async(t,n,r,(t,n)=>{s&&r.disconnect(s);let c;try{c=e.send_finish(n)}catch(e){o||(o=!0,a(e));return}if(o){closeInputStream(c);return}o=!0,i(c)})})}function closeInputStream(e){return new Promise(t=>{e.close_async(Xt.PRIORITY_DEFAULT,null,(n,r)=>{try{e.close_finish(r)}catch{}t()})})}function inputStreamToReadable(e,t={}){let n=new Zt.Cancellable,r=null,close=()=>r||(e.has_pending()?Promise.resolve():(r=closeInputStream(e),r));async function*chunks(){try{yield*inputStreamAsyncIterator(e,4096,Xt.PRIORITY_DEFAULT,n)}finally{await close()}}let i=c.from(chunks(),t);return i.once(`close`,()=>{e.has_pending()?n.cancel():close()}),i}var tn=__exportAll$1({default:()=>an});function load$5(){return rn===void 0&&(rn=nn(`@gjsify/node-gi/gi`).requireGi(`Soup`,`3.0`)),rn}var nn,rn,an,on=__esmMin((()=>{nn=e(import.meta.url),__name$1(load$5,`load`),an=new Proxy(Object.create(null),{get(e,t){return load$5()[t]},has(e,t){return t in load$5()}})}));let sn=null;async function loadSoup(){return sn??=(await Promise.resolve().then(()=>(on(),tn))).default}function stripURLForUseAsAReferrer(e,t=!1){if(e==null||e===`no-referrer`)return`no-referrer`;let n=new zt(e);return/^(about|blob|data):$/.test(n.protocol)?`no-referrer`:(n.username=``,n.password=``,n.hash=``,t&&(n.pathname=``,n.search=``),n)}const cn=new Set([``,`no-referrer`,`no-referrer-when-downgrade`,`same-origin`,`origin`,`strict-origin`,`origin-when-cross-origin`,`strict-origin-when-cross-origin`,`unsafe-url`]);function validateReferrerPolicy(e){if(!cn.has(e))throw TypeError(`Invalid referrerPolicy: ${e}`);return e}function isOriginPotentiallyTrustworthy(e){if(/^(http|ws)s:$/.test(e.protocol))return!0;let t=e.host.replace(/(^\[)|(]$)/g,``),n=d(t);return n===4&&t.startsWith(`127.`)||n===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(t)?!0:e.host===`localhost`||e.host.endsWith(`.localhost`)?!1:e.protocol===`file:`}function isUrlPotentiallyTrustworthy(e){return/^about:(blank|srcdoc)$/.test(e.toString())||(typeof e==`string`&&(e=new zt(e)),e.protocol===`data:`)||/^(blob|filesystem):$/.test(e.protocol)?!0:isOriginPotentiallyTrustworthy(e)}function determineRequestsReferrer(e,t={}){let{referrerURLCallback:n,referrerOriginCallback:r}=t;if(e.referrer===`no-referrer`||e.referrerPolicy===``)return null;let i=e.referrerPolicy;if(e.referrer===`about:client`)return`no-referrer`;let a=new zt(e.referrer),o=stripURLForUseAsAReferrer(a),s=stripURLForUseAsAReferrer(a,!0);o.toString().length>4096&&(o=s),n&&(o=n(o)),r&&(s=r(s));let c=new zt(e.url);switch(i){case`no-referrer`:return`no-referrer`;case`origin`:return s;case`unsafe-url`:return o;case`strict-origin`:return isUrlPotentiallyTrustworthy(o)&&!isUrlPotentiallyTrustworthy(c)?`no-referrer`:s.toString();case`strict-origin-when-cross-origin`:return o.origin===c.origin?o:isUrlPotentiallyTrustworthy(o)&&!isUrlPotentiallyTrustworthy(c)?`no-referrer`:s;case`same-origin`:return o.origin===c.origin?o:`no-referrer`;case`origin-when-cross-origin`:return o.origin===c.origin?o:s;case`no-referrer-when-downgrade`:return isUrlPotentiallyTrustworthy(o)&&!isUrlPotentiallyTrustworthy(c)?`no-referrer`:o;default:throw TypeError(`Invalid referrerPolicy: ${i}`)}}function parseReferrerPolicyFromHeader(e){let t=(e.get(`referrer-policy`)||``).split(/[,\s]+/),n=``;for(let e of t)e&&cn.has(e)&&(n=e);return n}const ln=Symbol(`Request internals`);let un=null;function envPositiveInt(e,t){let n=Xt.getenv(e);if(!n)return t;let r=Number.parseInt(n,10);return Number.isFinite(r)&&r>0?r:t}function shouldAcceptAnyCert(e){return e===!1?!0:e===!0?!1:Xt.getenv(`NODE_TLS_REJECT_UNAUTHORIZED`)===`0`}function getSharedSession(e){if(un===null){let t=envPositiveInt(`GJSIFY_FETCH_MAX_CONNS_PER_HOST`,16),n=Math.max(envPositiveInt(`GJSIFY_FETCH_MAX_CONNS`,64),t);un=new e.Session({maxConns:n,maxConnsPerHost:t}),un.remove_feature_by_type(e.ContentDecoder.$gtype)}return un}const isRequest=e=>typeof e==`object`&&typeof e.url==`string`;var dn=class Request extends Body{cache;credentials;destination;get headers(){return this[ln].headers}integrity;keepalive;get method(){return this[ln].method}mode;get redirect(){return this[ln].redirect}get referrer(){if(this[ln].referrer===`no-referrer`)return``;if(this[ln].referrer===`client`)return`about:client`;if(this[ln].referrer)return this[ln].referrer.toString()}get referrerPolicy(){return this[ln].referrerPolicy}set referrerPolicy(e){this[ln].referrerPolicy=validateReferrerPolicy(e)}get signal(){return this[ln].signal}get url(){return this[ln].parsedURL.toString()}get _uri(){return Xt.Uri.parse(this.url,Xt.UriFlags.ENCODED)}get _session(){return this[ln].session}get _message(){return this[ln].message}get _inputStream(){return this[ln].inputStream}get[Symbol.toStringTag](){return`Request`}[ln];follow;compress=!1;counter=0;agent=``;highWaterMark=16384;insecureHTTPParser=!1;rejectUnauthorized;constructor(e,t){let n=e,r=t||{},i,a={};if(isRequest(e)?(i=new zt(n.url),a=n):i=new zt(e),i.username!==``||i.password!==``)throw TypeError(`${i} is an url with embedded credentials.`);let o=r.method||a.method||`GET`;if(/^(delete|get|head|options|post|put)$/i.test(o)&&(o=o.toUpperCase()),(t?.body!=null||isRequest(e)&&n.body!==null)&&(o===`GET`||o===`HEAD`))throw TypeError(`Request with GET/HEAD method cannot have body`);let s=t?.body?t.body:isRequest(e)&&n.body!==null?clone(e):null;super(s,{size:r.size||0});let c=new Lt(t?.headers||n.headers||{});if(s!==null&&!c.has(`Content-Type`)){let e=extractContentType(s,this);e&&c.set(`Content-Type`,e)}let l=isRequest(e)?n.signal:null;if(t&&`signal`in t&&(l=t.signal),l!=null&&!isAbortSignal(l))throw TypeError(`Expected signal to be an instanceof AbortSignal or EventTarget`);let u=t?.referrer==null?n.referrer:t.referrer;if(u===``)u=`no-referrer`;else if(u){let e=new zt(u);u=/^about:(\/\/)?client$/.test(e.toString())?`client`:e}else u=void 0;this[ln]={method:o,redirect:t?.redirect||n.redirect||`follow`,headers:c,parsedURL:i,signal:l,referrer:u,referrerPolicy:``,session:null,message:null},this.follow=r.follow===void 0?n.follow===void 0?20:n.follow:r.follow,this.compress=r.compress===void 0?n.compress===void 0?!0:n.compress:r.compress,this.counter=r.counter||n.counter||0,this.agent=r.agent||n.agent,this.highWaterMark=r.highWaterMark||n.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||n.insecureHTTPParser||!1,this.rejectUnauthorized=r.rejectUnauthorized??n.rejectUnauthorized,this.referrerPolicy=t?.referrerPolicy||n.referrerPolicy||``}async _send(e){let{signal:t,parsedURL:n}=this[ln],r=n.protocol;if(r!==`http:`&&r!==`https:`)throw Error(`Cannot send request: no Soup session (non-HTTP URL?)`);let i=await loadSoup(),a=getSharedSession(i),o=new i.Message({method:this[ln].method,uri:Xt.Uri.parse(n.toString(),Xt.UriFlags.ENCODED)});this[ln].session=a,this[ln].message=o,e.headers._appendToSoupMessage(i,o);let s=this._rawBodyBuffer;if(s!==null&&s.byteLength>0){let t=e.headers.get(`content-type`)||null;o.set_request_body_from_bytes(t,new Xt.Bytes(s))}n.protocol===`https:`&&shouldAcceptAnyCert(this.rejectUnauthorized)&&o.connect(`accept-certificate`,(e,t,n)=>!0);let c=new Zt.Cancellable;return t&&(t.aborted?c.cancel():t.addEventListener(`abort`,()=>c.cancel(),{once:!0})),this[ln].inputStream=await soupSendAsync(a,o,Xt.PRIORITY_DEFAULT,c),this[ln].readable=inputStreamToReadable(this[ln].inputStream),{inputStream:this[ln].inputStream,readable:this[ln].readable,cancellable:c}}clone(){return new Request(this)}async arrayBuffer(){return super.arrayBuffer()}async blob(){return super.blob()}async formData(){return super.formData()}async json(){return super.json()}async text(){return super.text()}};Object.defineProperties(dn.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});const getSoupRequestOptions=e=>{let{parsedURL:t}=e[ln],n=new Lt(e[ln].headers);n.has(`Accept`)||n.set(`Accept`,`*/*`);let r=null;if(e.body===null&&/^(post|put)$/i.test(e.method)&&(r=`0`),e.body!==null){let t=getTotalBytes(e);typeof t==`number`&&!Number.isNaN(t)&&(r=String(t))}r&&n.set(`Content-Length`,r),e.referrerPolicy===``&&(e.referrerPolicy=`strict-origin-when-cross-origin`),e.referrer&&e.referrer!==`no-referrer`?e[ln].referrer=determineRequestsReferrer(e):e[ln].referrer=`no-referrer`,e[ln].referrer instanceof zt&&n.set(`Referer`,e.referrer),n.has(`User-Agent`)||n.set(`User-Agent`,`gjsify-fetch`),e.compress&&!n.has(`Accept-Encoding`)&&n.set(`Accept-Encoding`,`gzip, deflate`);let{agent:i}=e;return typeof i==`function`&&(i=i(t)),!n.has(`Connection`)&&!i&&n.set(`Connection`,`close`),{parsedURL:t,options:{headers:n}}};var AbortError=class extends FetchBaseError{constructor(e,t=`aborted`){super(e,t)}};function parseDataUri(e){let t=e.match(/^data:([^,]*?)(;base64)?,(.*)$/s);if(!t)throw TypeError(`Invalid data URI: ${e.slice(0,50)}...`);let n=t[1]||`text/plain;charset=US-ASCII`,r=!!t[2],i=t[3],a;if(r){let e=atob(i);a=new Uint8Array(e.length);for(let t=0;t<e.length;t++)a[t]=e.charCodeAt(t)}else a=new TextEncoder().encode(decodeURIComponent(i));return{buffer:a,typeFull:n}}function rewriteRootRelativeUrl(e,t){if(!e.startsWith(`/`)||e.startsWith(`//`))return e;let n=lastPathSeparatorIndex(t);return n<=0?e:`${pathToFileUrlHref(t.slice(0,n))}${e}`}function resolveRootRelativeUrl(e){return rewriteRootRelativeUrl(e,n.programPath??n.programInvocationName??``)}let fn=0;function guessBlobExt(e){let t=e.toLowerCase().split(`?`)[0],n=t.lastIndexOf(`.`),r=n>-1?t.slice(n):``;switch(r){case`.png`:case`.jpg`:case`.jpeg`:case`.gif`:case`.webp`:case`.svg`:case`.bmp`:case`.ttf`:case`.otf`:case`.woff`:case`.woff2`:case`.mp3`:case`.wav`:case`.ogg`:case`.flac`:case`.m4a`:case`.mp4`:case`.webm`:case`.mkv`:case`.xml`:case`.tmx`:case`.json`:return r;default:return`.bin`}}function writeBlobToTempFile(e,t){let n=mt.build_filenamev([mt.get_tmp_dir(),`gjsify-blob-${fn++}${guessBlobExt(t)}`]);return mt.file_set_contents(n,e),n}var XMLHttpRequest=class extends EventTarget{static UNSENT=0;static OPENED=1;static HEADERS_RECEIVED=2;static LOADING=3;static DONE=4;UNSENT=0;OPENED=1;HEADERS_RECEIVED=2;LOADING=3;DONE=4;readyState=0;status=0;statusText=``;responseType=``;responseText=``;response=null;responseURL=``;withCredentials=!1;timeout=0;upload=new XMLHttpRequestUpload;onreadystatechange=null;onload=null;onerror=null;onabort=null;ontimeout=null;onloadstart=null;onloadend=null;onprogress=null;_method=`GET`;_url=``;_headers=new Map;_responseHeaders=new Map;_controller=new AbortController;_aborted=!1;_timeoutId=null;open(e,t,n=!0,r,i){this._method=e.toUpperCase(),this._url=t,this._headers.clear(),this._responseHeaders.clear(),this._aborted=!1,this._controller=new AbortController,this._setReadyState(1)}setRequestHeader(e,t){if(this.readyState<1)throw new DOMException(`Must open first`,`InvalidStateError`);this._headers.set(e.toLowerCase(),t)}getResponseHeader(e){return this._responseHeaders.get(e.toLowerCase())??null}getAllResponseHeaders(){let e=[];return this._responseHeaders.forEach((t,n)=>e.push(`${n}: ${t}`)),e.join(`\r
|
|
5
|
-
`)}send(e){if(this.readyState!==1)throw new DOMException(`Must open first`,`InvalidStateError`);if(this._aborted)return;let t={};this._headers.forEach((e,n)=>{t[n]=e});let n={method:this._method,headers:t,credentials:this.withCredentials?`include`:`omit`,signal:this._controller.signal};e!=null&&this._method!==`GET`&&this._method!==`HEAD`&&(n.body=e),this.timeout>0&&(this._timeoutId=setTimeout(()=>{this._controller.abort(),this._onTimeout()},this.timeout)),this.dispatchEvent(new Event(`loadstart`)),this.onloadstart&&this.onloadstart(new ProgressEvent$1(`loadstart`)),fetch$1(this._url,n).then(async e=>{if(!this._aborted){switch(this._timeoutId&&=(clearTimeout(this._timeoutId),null),this.status=e.status,this.statusText=e.statusText,this.responseURL=e.url,e.headers.forEach((e,t)=>{this._responseHeaders.set(t.toLowerCase(),e)}),this._setReadyState(2),this._setReadyState(3),this.responseType){case`arraybuffer`:{let t=await e.arrayBuffer();this.response=t,this.responseText=``;break}case`blob`:{let t=await e.arrayBuffer(),n=writeBlobToTempFile(new Uint8Array(t),this._url),r=new Blob([t],{type:this._responseHeaders.get(`content-type`)??``});r._tmpPath=n,this.response=r,this.responseText=``;break}case`json`:{let t=await e.text();this.responseText=``;try{this.response=t.length>0?JSON.parse(t):null}catch{this.response=null}break}case`document`:{let t=await e.text();this.responseText=t,this.response=t;break}default:{let t=await e.text(),n=t.charCodeAt(0)===65279?t.slice(1):t;this.responseText=n,this.response=n;break}}this._setReadyState(4),this.dispatchEvent(new ProgressEvent$1(`load`)),this.dispatchEvent(new ProgressEvent$1(`loadend`)),this.onload&&this.onload(new ProgressEvent$1(`load`)),this.onloadend&&this.onloadend(new ProgressEvent$1(`loadend`))}}).catch(e=>{if(this._timeoutId&&=(clearTimeout(this._timeoutId),null),this._aborted)return;this._setReadyState(4);let t=new ProgressEvent$1(`error`);this.dispatchEvent(t),this.onerror&&this.onerror(t),this.onloadend&&this.onloadend(new ProgressEvent$1(`loadend`))})}abort(){if(this._aborted)return;this._aborted=!0,this._timeoutId&&=(clearTimeout(this._timeoutId),null),this._controller.abort(),this.readyState!==0&&this.readyState!==4&&(this._setReadyState(4),this.status=0);let e=new ProgressEvent$1(`abort`);this.dispatchEvent(e),this.onabort&&this.onabort(e),this.onloadend&&this.onloadend(new ProgressEvent$1(`loadend`))}overrideMimeType(e){}_onTimeout(){if(this._aborted)return;this._aborted=!0,this._setReadyState(4);let e=new ProgressEvent$1(`timeout`);this.dispatchEvent(e),this.ontimeout&&this.ontimeout(e)}_setReadyState(e){this.readyState=e;let t=new Event(`readystatechange`);this.dispatchEvent(t),this.onreadystatechange&&this.onreadystatechange(t)}},XMLHttpRequestUpload=class extends EventTarget{onprogress=null;onloadstart=null;onloadend=null;onload=null;onerror=null;onabort=null;ontimeout=null};Rt(),Ut();const pn=new Set([`data:`,`http:`,`https:`,`file:`]);function rewriteFetchInput(e){if(typeof e!=`string`)return e;let t=resolveRootRelativeUrl(e);return t!==e&&globalThis.__GJSIFY_DEBUG_FETCH===!0&&console.log(`[fetch] rewrite ${e} → ${t}`),t}async function fetch$1(e,t={}){e=rewriteFetchInput(e);let n=new dn(e,t),{parsedURL:i,options:a}=getSoupRequestOptions(n);if(!pn.has(i.protocol))throw TypeError(`@gjsify/fetch cannot load ${e}. URL scheme "${i.protocol.replace(/:$/,``)}" is not supported.`);if(i.protocol===`data:`){let{buffer:e,typeFull:t}=parseDataUri(n.url);return new $t(Buffer.from(e),{headers:{"Content-Type":t}})}if(i.protocol===`file:`){let e=globalThis.__GJSIFY_DEBUG_FETCH===!0;e&&console.log(`[fetch] file:// ${n.url}`);try{let t=Xt.filename_from_uri(n.url)[0];e&&console.log(`[fetch] file:// path=${t}`);let[r,i]=Xt.file_get_contents(t);if(e&&console.log(`[fetch] file:// ok=${r} bytes=${i?.byteLength??`?`}`),!r)throw new FetchError(`Failed to read file: ${t}`,`system`);let a=i,o=new Uint8Array(a.byteLength);o.set(a);let s=new $t(o);return e&&console.log(`[fetch] file:// response created`),s}catch(t){let r=t instanceof Error?t:Error(String(t));throw e&&console.warn(`[fetch] file:// FAIL: ${r.message}`),new FetchError(`request to ${n.url} failed, reason: ${r.message}`,`system`,r)}}let{signal:s}=n;if(s&&s.aborted)throw new AbortError(`The operation was aborted.`);let c,l;try{let e=await n._send(a);c=e.readable,l=e.cancellable}catch(e){if(s&&s.aborted)throw new AbortError(`The operation was aborted.`);let t=e instanceof Error?e:Error(String(e));throw new FetchError(`request to ${n.url} failed, reason: ${t.message}`,`system`,t)}let abortHandler=()=>{l.cancel()};s&&s.addEventListener(`abort`,abortHandler,{once:!0});let finalize=()=>{s&&s.removeEventListener(`abort`,abortHandler)};l.connect(()=>{c.destroy(new AbortError(`The operation was aborted.`))}),c.on(`error`,e=>{finalize()});let u=n._message,d=await loadSoup(),f=Lt._newFromSoupMessage(d,u),p=u.status_code,m=u.get_reason_phrase();if(isRedirect(p)){let e=f.get(`Location`),r=null;try{r=e===null?null:new zt(e,n.url)}catch{if(n.redirect!==`manual`)throw c.destroy(),finalize(),new FetchError(`uri requested responds with an invalid redirect URL: ${e}`,`invalid-redirect`)}switch(n.redirect){case`error`:throw c.destroy(),finalize(),new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${n.url}`,`no-redirect`);case`manual`:break;case`follow`:{if(r===null)break;if(n.counter>=n.follow)throw c.destroy(),finalize(),new FetchError(`maximum redirect reached at: ${n.url}`,`max-redirect`);let e={headers:new Lt(n.headers),follow:n.follow,counter:n.counter+1,agent:n.agent,compress:n.compress,method:n.method,body:clone(n),signal:n.signal,size:n.size,referrer:n.referrer,referrerPolicy:n.referrerPolicy};if(!isDomainOrSubdomain(n.url,r)||!isSameProtocol(n.url,r))for(let t of[`authorization`,`www-authenticate`,`cookie`,`cookie2`])e.headers.delete(t);if(p!==303&&n.body&&t.body instanceof o.Readable)throw c.destroy(),finalize(),new FetchError(`Cannot follow redirect with body being a readable stream`,`unsupported-redirect`);(p===303||(p===301||p===302)&&n.method===`POST`)&&(e.method=`GET`,e.body=void 0,e.headers.delete(`content-length`));let i=parseReferrerPolicyFromHeader(f);return i&&(e.referrerPolicy=i),await new Promise(e=>{c.once(`close`,()=>e()),c.resume()}),finalize(),fetch$1(new dn(r,e))}default:throw c.destroy(),finalize(),TypeError(`Redirect option '${n.redirect}' is not a valid value of RequestRedirect`)}}let h={url:n.url,status:p,statusText:m,headers:f,size:n.size,counter:n.counter,highWaterMark:n.highWaterMark},g=f.get(`Content-Encoding`);if(!n.compress||n.method===`HEAD`||g===null||p===204||p===304)return finalize(),new $t(c,h);if(typeof DecompressionStream<`u`){let e=null;if(g===`gzip`||g===`x-gzip`?e=`gzip`:(g===`deflate`||g===`x-deflate`)&&(e=`deflate`),e){let t=new r([await new $t(c,h).arrayBuffer()]).stream().pipeThrough(new DecompressionStream(e));return finalize(),new $t(t,h)}}return finalize(),new $t(c,h)}__name$1(fetch$1,`fetch`);const mn=globalThis;globalThis.fetch===void 0&&(mn.fetch=fetch$1),globalThis.Headers===void 0&&(mn.Headers=Lt),globalThis.Request===void 0&&(mn.Request=dn),globalThis.Response===void 0&&(mn.Response=$t),globalThis.XMLHttpRequest===void 0&&(globalThis.XMLHttpRequest=XMLHttpRequest),globalThis.XMLHttpRequestUpload===void 0&&(globalThis.XMLHttpRequestUpload=XMLHttpRequestUpload);const hn=globalThis.URL;if(hn&&hn.__gjsify_objecturl!==!0){let e=new Map,t=hn.createObjectURL?.bind(hn),n=hn.revokeObjectURL?.bind(hn);hn.createObjectURL=n=>{let r=n?._tmpPath;if(typeof r==`string`&&r.length>0){let t=`file://${r}`;return e.set(t,r),t}return t?t(n):`file:///dev/null`},hn.revokeObjectURL=t=>{let r=e.get(t);r?(mt.unlink(r),e.delete(t)):n&&n(t)},hn.__gjsify_objecturl=!0}const gn=e(import.meta.url);let _n;function load$4(){return _n===void 0&&(_n=gn(`@gjsify/node-gi/gi`).requireGi(`Adw`,`1`)),_n}__name$1(load$4,`load`);var vn=new Proxy(Object.create(null),{get(e,t){return load$4()[t]},has(e,t){return t in load$4()}});function variantKindFor(e,t){switch(e){case`s`:case`b`:case`i`:case`u`:case`d`:return e}if(typeof t==`string`)return`s`;if(typeof t==`boolean`)return`b`;if(typeof t==`number`)return Number.isInteger(t)?`i`:`d`;throw Error(`Cannot build a GLib.Variant from ${typeof t}`)}function buildVariant(e,t){switch(variantKindFor(e?.dup_string()??null,t)){case`s`:return mt.Variant.new_string(String(t));case`b`:return mt.Variant.new_boolean(!!t);case`i`:return mt.Variant.new_int32(Number(t));case`u`:return mt.Variant.new_uint32(Number(t));case`d`:return mt.Variant.new_double(Number(t))}}function describeActions(e){return e?e.list_actions().sort((e,t)=>e.localeCompare(t)).map(t=>({name:t,enabled:e.get_action_enabled(t),parameterType:e.get_action_parameter_type(t)?.dup_string()??null,stateType:e.get_action_state_type(t)?.dup_string()??null})):[]}function activateAction(e,t,n){let r=e.get_action_parameter_type(t),i=n==null?null:buildVariant(r,n);e.activate_action(t,i)}function changeActionState(e,t,n){e.change_action_state(t,buildVariant(e.get_action_state_type(t),n))}const yn=e(import.meta.url);let bn;function load$3(){return bn===void 0&&(bn=yn(`@gjsify/node-gi/gi`).requireGi(`Gtk`,`4.0`)),bn}__name$1(load$3,`load`);var xn=new Proxy(Object.create(null),{get(e,t){return load$3()[t]},has(e,t){return t in load$3()}});const Sn=new Map;function swapCss(e,t){let n=_t.Display.get_default();if(!n)return!1;let r=Sn.get(e);return r||(r=new xn.CssProvider,xn.StyleContext.add_provider_for_display(n,r,xn.STYLE_PROVIDER_PRIORITY_USER+1),Sn.set(e,r)),r.load_from_string(t),!0}function dumpCss(){return{providers:[...Sn.keys()]}}const Cn=`org.gjsify.Devtools`;function formatDbusErrorMessage(e,t){return`${e}: ${t}`}const wn={GetStatus:`read-only`,Screenshot:`read-only`,ListActions:`read-only`,ActivateAction:`mutating`,ChangeActionState:`mutating`,PresentWindow:`read-only`,ResizeWindow:`mutating`,ListToplevels:`read-only`,DumpTree:`read-only`,GetProperty:`read-only`,GetFocused:`read-only`,FindWidget:`read-only`,SendKey:`mutating`,ActivateWidget:`mutating`,DumpGSettings:`read-only`,DumpCss:`read-only`,SwapCss:`mutating`};function sanitizeInstanceId(e){let t=e.toLowerCase().replace(/[^a-z0-9]/g,``);return/^[a-z]/.test(t)?t:`i${t||`0`}`}function appIdToObjectPath(e){return`/${e.replace(/\./g,`/`).replace(/-/g,`_`)}`}function resolveBusAddress(e,t){let n=appIdToObjectPath(e),r=t&&t!=="default"?sanitizeInstanceId(t):`default`;return r==="default"?{busName:e,objectPath:`${n}/devtools`,instance:`default`}:{busName:`${e}.${r}`,objectPath:`${n}/${r}/devtools`,instance:r}}const Tn=`GJSIFY_DEVTOOLS_ADDRESS`;function isDevtoolsEnabledValue(e){if(e==null)return!1;let t=e.toLowerCase();return t!==``&&t!==`0`&&t!==`false`}function devtoolsAddressFilePath(e,t,n){let{busName:r}=resolveBusAddress(t,n);return`${e}/gjsify-devtools/${r}.address`}function buildDevtoolsIfaceXml(e=[]){return`<node>
|
|
6
|
-
<interface name="${
|
|
1
|
+
import{createRequire as e}from"node:module";import"@gjsify/node-gi/globals";import t from"@gjsify/node-gi/cairo";import n from"@gjsify/node-gi/system";import{Blob as r,Buffer as i,File as a}from"node:buffer";import o,{PassThrough as s,Readable as c,Stream as l,pipeline as u}from"node:stream";import{isIP as d}from"node:net";var f=Object.create,p=Object.defineProperty,__name$1=(e,t)=>p(e,`name`,{value:t,configurable:!0}),m=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,g=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty,__esmMin=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},__commonJSMin=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),__exportAll$1=(e,t)=>{let n={};for(var r in e)p(n,r,{get:e[r],enumerable:!0});return t||p(n,Symbol.toStringTag,{value:`Module`}),n},__copyProps=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=h(t),a=0,o=i.length,s;a<o;a++)s=i[a],!_.call(e,s)&&s!==n&&p(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=m(t,s))||r.enumerable});return e},__toESM=(e,t,n)=>(n=e==null?{}:f(g(e)),__copyProps(t||!e||!e.__esModule?p(n,`default`,{value:e,enumerable:!0}):n,e));for(let e of[`Headers`,`Request`,`Response`,`fetch`])try{delete globalThis[e]}catch{}var v=Object.defineProperty,__exportAll=(e,t)=>{let n={};for(var r in e)v(n,r,{get:e[r],enumerable:!0});return t||v(n,Symbol.toStringTag,{value:`Module`}),n};__exportAll({attributes:()=>O,childNodesList:()=>x,elementChildren:()=>S,isConnected:()=>C,localName:()=>T,name:()=>A,namespaceURI:()=>E,nodeType:()=>y,ownerElement:()=>j,parentNode:()=>b,prefix:()=>D,propertyEventListeners:()=>k,tagName:()=>w,value:()=>ee});const y=Symbol(`nodeType`),b=Symbol(`parentNode`),x=Symbol(`childNodesList`),S=Symbol(`elementChildren`),C=Symbol(`isConnected`),w=Symbol(`tagName`),T=Symbol(`localName`),E=Symbol(`namespaceURI`),D=Symbol(`prefix`),O=Symbol(`attributes`),k=Symbol(`propertyEventListeners`),A=Symbol(`name`),ee=Symbol(`value`),j=Symbol(`ownerElement`),M={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11};var NodeList=class{constructor(e){this._items=e}get length(){return this._items.length}item(e){return this._items[e]??null}forEach(e,t){for(let n=0;n<this._items.length;n++)e.call(t,this._items[n],n,this)}entries(){return this._items.entries()}keys(){return this._items.keys()}values(){return this._items.values()}[Symbol.iterator](){return this._items[Symbol.iterator]()}get[Symbol.toStringTag](){return`NodeList`}};const N=globalThis.DOMException,te=Symbol(`type`),P=Symbol(`bubbles`),ne=Symbol(`cancelable`),re=Symbol(`composed`),ie=Symbol(`target`),ae=Symbol(`currentTarget`),oe=Symbol(`eventPhase`),se=Symbol(`defaultPrevented`),ce=Symbol(`isTrusted`),le=Symbol(`timeStamp`),ue=Symbol(`stop`),de=Symbol(`immediateStop`),fe=Symbol(`dispatching`),pe=Symbol(`inPassiveListener`);var Event=class{[te];[P];[ne];[re];[ie]=null;[ae]=null;[oe]=0;[se]=!1;[ce]=!1;[le];[ue]=!1;[de]=!1;[fe]=!1;[pe]=!1;get type(){return this[te]}get bubbles(){return this[P]}get cancelable(){return this[ne]}get composed(){return this[re]}get target(){return this[ie]}get currentTarget(){return this[ae]}get eventPhase(){return this[oe]}get defaultPrevented(){return this[se]}get timeStamp(){return this[le]}get cancelBubble(){return this[ue]}set cancelBubble(e){e&&this.stopPropagation()}get returnValue(){return!this[se]}set returnValue(e){e||this.preventDefault()}get srcElement(){return this[ie]}static NONE=0;static CAPTURING_PHASE=1;static AT_TARGET=2;static BUBBLING_PHASE=3;get[Symbol.toStringTag](){return`Event`}constructor(e,t){this[te]=e,this[P]=t?.bubbles??!1,this[ne]=t?.cancelable??!1,this[re]=t?.composed??!1,this[le]=Date.now(),Object.defineProperty(this,"isTrusted",{get:()=>this[ce],enumerable:!0,configurable:!1})}composedPath(){return this[ae]?[this[ae]]:[]}preventDefault(){this[ne]&&!this[pe]&&(this[se]=!0)}stopPropagation(){this[ue]=!0}stopImmediatePropagation(){this[ue]=!0,this[de]=!0}},CustomEvent$1=class extends Event{static{__name$1(this,`CustomEvent`)}detail;constructor(e,t){super(e,t),this.detail=t?.detail}},MessageEvent=class extends Event{data;origin;lastEventId;source;ports;constructor(e,t){super(e,t),this.data=t?.data??null,this.origin=t?.origin??``,this.lastEventId=t?.lastEventId??``,this.source=t?.source??null,this.ports=t?.ports??[]}get[Symbol.toStringTag](){return`MessageEvent`}},ErrorEvent=class extends Event{message;filename;lineno;colno;error;constructor(e,t){super(e,t),this.message=t?.message??``,this.filename=t?.filename??``,this.lineno=t?.lineno??0,this.colno=t?.colno??0,this.error=t?.error??null}get[Symbol.toStringTag](){return`ErrorEvent`}},CloseEvent=class extends Event{code;reason;wasClean;constructor(e,t){super(e,t),this.code=t?.code??0,this.reason=t?.reason??``,this.wasClean=t?.wasClean??!1}get[Symbol.toStringTag](){return`CloseEvent`}},ProgressEvent$1=class extends Event{static{__name$1(this,`ProgressEvent`)}lengthComputable;loaded;total;constructor(e,t){super(e,t),this.lengthComputable=t?.lengthComputable??!1,this.loaded=t?.loaded??0,this.total=t?.total??0}get[Symbol.toStringTag](){return`ProgressEvent`}},EventTarget=class{#e=new Map;get[Symbol.toStringTag](){return`EventTarget`}addEventListener(e,t,n){if(t===null)return;let r=typeof n==`boolean`?n:n?.capture??!1,i=typeof n==`object`?n?.once??!1:!1,a=typeof n==`object`?n?.passive??!1:!1,o=this.#e.get(e);o||(o=[],this.#e.set(e,o));for(let e of o)if(e.listener===t&&e.capture===r)return;let s={listener:t,capture:r,once:i,passive:a,removed:!1};o.push(s),typeof n==`object`&&n?.signal&&n.signal.addEventListener(`abort`,()=>{this.removeEventListener(e,t,{capture:r})},{once:!0})}removeEventListener(e,t,n){if(t===null)return;let r=typeof n==`boolean`?n:n?.capture??!1,i=this.#e.get(e);if(!i)return;let a=i.findIndex(e=>e.listener===t&&e.capture===r);a!==-1&&(i[a].removed=!0,i.splice(a,1),i.length===0&&this.#e.delete(e))}dispatchEvent(e){let t=e;if(t[fe])throw new N(`The event is already being dispatched.`,`InvalidStateError`);t[fe]=!0,t[ie]=this,t[ae]=this,t[oe]=Event.AT_TARGET;try{let n=this.#e.get(e.type);if(n){let r=[...n];for(let n of r)if(!n.removed){if(t[de]||t[ue])break;n.once&&this.removeEventListener(e.type,n.listener,{capture:n.capture});try{n.passive&&(t[pe]=!0),typeof n.listener==`function`?n.listener.call(this,e):typeof n.listener.handleEvent==`function`&&n.listener.handleEvent.call(n.listener,e)}catch(e){reportListenerException(e)}finally{t[pe]=!1}}}}finally{t[oe]=Event.NONE,t[ae]=null,t[fe]=!1}return!e.defaultPrevented}};function reportListenerException(e){try{let t=globalThis;if(typeof t.reportError==`function`)t.reportError(e);else if(e instanceof Error){let t=`${e.name}: ${e.message}`;console.error(e.stack?`${t}\n${e.stack}`:t)}else console.error(String(e))}catch{}}for(let[e,t]of[[`NONE`,0],[`CAPTURING_PHASE`,1],[`AT_TARGET`,2],[`BUBBLING_PHASE`,3]])Object.defineProperty(Event.prototype,e,{value:t,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(Event,e,{value:t,writable:!1,enumerable:!0,configurable:!1});var UIEvent=class extends Event{detail;view;constructor(e,t){super(e,t),this.detail=t?.detail??0,this.view=null}get[Symbol.toStringTag](){return`UIEvent`}},MouseEvent=class extends UIEvent{altKey;button;buttons;clientX;clientY;ctrlKey;metaKey;movementX;movementY;offsetX;offsetY;screenX;screenY;shiftKey;relatedTarget;get pageX(){return this.clientX}get pageY(){return this.clientY}get x(){return this.clientX}get y(){return this.clientY}constructor(e,t){super(e,t),this.altKey=t?.altKey??!1,this.button=t?.button??0,this.buttons=t?.buttons??0,this.clientX=t?.clientX??0,this.clientY=t?.clientY??0,this.ctrlKey=t?.ctrlKey??!1,this.metaKey=t?.metaKey??!1,this.movementX=t?.movementX??0,this.movementY=t?.movementY??0,this.offsetX=t?.offsetX??0,this.offsetY=t?.offsetY??0,this.screenX=t?.screenX??0,this.screenY=t?.screenY??0,this.shiftKey=t?.shiftKey??!1,this.relatedTarget=t?.relatedTarget??null}getModifierState(e){switch(e){case`Alt`:return this.altKey;case`Control`:return this.ctrlKey;case`Meta`:return this.metaKey;case`Shift`:return this.shiftKey;default:return!1}}get[Symbol.toStringTag](){return`MouseEvent`}},PointerEvent=class extends MouseEvent{pointerId;width;height;pressure;tangentialPressure;tiltX;tiltY;twist;altitudeAngle;azimuthAngle;pointerType;isPrimary;constructor(e,t){super(e,t),this.pointerId=t?.pointerId??0,this.width=t?.width??1,this.height=t?.height??1,this.pressure=t?.pressure??0,this.tangentialPressure=t?.tangentialPressure??0,this.tiltX=t?.tiltX??0,this.tiltY=t?.tiltY??0,this.twist=t?.twist??0,this.altitudeAngle=t?.altitudeAngle??Math.PI/2,this.azimuthAngle=t?.azimuthAngle??0,this.pointerType=t?.pointerType??``,this.isPrimary=t?.isPrimary??!1}getCoalescedEvents(){return[]}getPredictedEvents(){return[]}get[Symbol.toStringTag](){return`PointerEvent`}},KeyboardEvent=class extends UIEvent{altKey;code;ctrlKey;isComposing;key;location;metaKey;repeat;shiftKey;keyCode;which;static DOM_KEY_LOCATION_STANDARD=0;static DOM_KEY_LOCATION_LEFT=1;static DOM_KEY_LOCATION_RIGHT=2;static DOM_KEY_LOCATION_NUMPAD=3;constructor(e,t){super(e,t),this.altKey=t?.altKey??!1,this.code=t?.code??``,this.ctrlKey=t?.ctrlKey??!1,this.isComposing=t?.isComposing??!1,this.key=t?.key??``,this.location=t?.location??0,this.metaKey=t?.metaKey??!1,this.repeat=t?.repeat??!1,this.shiftKey=t?.shiftKey??!1,this.keyCode=t?.keyCode??0,this.which=t?.which??0}getModifierState(e){switch(e){case`Alt`:return this.altKey;case`Control`:return this.ctrlKey;case`Meta`:return this.metaKey;case`Shift`:return this.shiftKey;default:return!1}}get[Symbol.toStringTag](){return`KeyboardEvent`}},WheelEvent=class extends MouseEvent{deltaX;deltaY;deltaZ;deltaMode;static DOM_DELTA_PIXEL=0;static DOM_DELTA_LINE=1;static DOM_DELTA_PAGE=2;constructor(e,t){super(e,t),this.deltaX=t?.deltaX??0,this.deltaY=t?.deltaY??0,this.deltaZ=t?.deltaZ??0,this.deltaMode=t?.deltaMode??0}get[Symbol.toStringTag](){return`WheelEvent`}},FocusEvent=class extends UIEvent{relatedTarget;constructor(e,t){super(e,t),this.relatedTarget=t?.relatedTarget??null}get[Symbol.toStringTag](){return`FocusEvent`}};let me,he,ge,_e,ve;var ye=class Node extends EventTarget{constructor(...e){super(...e),this.ELEMENT_NODE=M.ELEMENT_NODE,this.ATTRIBUTE_NODE=M.ATTRIBUTE_NODE,this.TEXT_NODE=M.TEXT_NODE,this.CDATA_SECTION_NODE=M.CDATA_SECTION_NODE,this.PROCESSING_INSTRUCTION_NODE=M.PROCESSING_INSTRUCTION_NODE,this.COMMENT_NODE=M.COMMENT_NODE,this.DOCUMENT_NODE=M.DOCUMENT_NODE,this.DOCUMENT_TYPE_NODE=M.DOCUMENT_TYPE_NODE,this.DOCUMENT_FRAGMENT_NODE=M.DOCUMENT_FRAGMENT_NODE,this[me]=M.ELEMENT_NODE,this[he]=null,this[ge]=[],this[_e]=[],this[ve]=!1}static{this.ELEMENT_NODE=M.ELEMENT_NODE}static{this.ATTRIBUTE_NODE=M.ATTRIBUTE_NODE}static{this.TEXT_NODE=M.TEXT_NODE}static{this.CDATA_SECTION_NODE=M.CDATA_SECTION_NODE}static{this.PROCESSING_INSTRUCTION_NODE=M.PROCESSING_INSTRUCTION_NODE}static{this.COMMENT_NODE=M.COMMENT_NODE}static{this.DOCUMENT_NODE=M.DOCUMENT_NODE}static{this.DOCUMENT_TYPE_NODE=M.DOCUMENT_TYPE_NODE}static{this.DOCUMENT_FRAGMENT_NODE=M.DOCUMENT_FRAGMENT_NODE}static{this.DOCUMENT_POSITION_DISCONNECTED=1}static{this.DOCUMENT_POSITION_PRECEDING=2}static{this.DOCUMENT_POSITION_FOLLOWING=4}static{this.DOCUMENT_POSITION_CONTAINS=8}static{this.DOCUMENT_POSITION_CONTAINED_BY=16}static{this.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32}get nodeType(){return this[y]}get nodeName(){return``}get parentNode(){return this[b]}get parentElement(){let e=this[b];return e&&e[y]===M.ELEMENT_NODE?e:null}get childNodes(){return new NodeList(this[x])}get firstChild(){return this[x][0]??null}get lastChild(){let e=this[x];return e[e.length-1]??null}get previousSibling(){let e=this[b];if(!e)return null;let t=e[x],n=t.indexOf(this);return n>0?t[n-1]:null}get nextSibling(){let e=this[b];if(!e)return null;let t=e[x],n=t.indexOf(this);return n!==-1&&n<t.length-1?t[n+1]:null}get textContent(){return null}set textContent(e){}get nodeValue(){return null}set nodeValue(e){}get ownerDocument(){let e=this;for(;e[b];)e=e[b];let t=globalThis.document;return e===t?t:null}get isConnected(){return this[C]}hasChildNodes(){return this[x].length>0}contains(e){if(e===null)return!1;if(e===this)return!0;let t=e;for(;t;){if(t===this)return!0;t=t[b]}return!1}getRootNode(){let e=this;for(;e[b];)e=e[b];return e}appendChild(e){return e[b]&&e[b].removeChild(e),e[b]=this,this[x].push(e),e[y]===M.ELEMENT_NODE&&this[S].push(e),e}removeChild(e){let t=this[x],n=t.indexOf(e);if(n===-1)throw new DOMException(`Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.`,`NotFoundError`);if(t.splice(n,1),e[b]=null,e[y]===M.ELEMENT_NODE){let t=this[S].indexOf(e);t!==-1&&this[S].splice(t,1)}return e}insertBefore(e,t){if(t===null)return this.appendChild(e);let n=this[x],r=n.indexOf(t);if(r===-1)throw new DOMException(`Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.`,`NotFoundError`);if(e[b]&&e[b].removeChild(e),e[b]=this,n.splice(r,0,e),e[y]===M.ELEMENT_NODE){let t=this[S],i=t.length;for(let a=r;a<n.length;a++)if(n[a][y]===M.ELEMENT_NODE&&n[a]!==e){i=t.indexOf(n[a]);break}t.splice(i,0,e)}return e}replaceChild(e,t){return this.insertBefore(e,t),this.removeChild(t),t}_createCloneTarget(){return new this.constructor}cloneNode(e=!1){let t=this._createCloneTarget();if(t[y]=this[y],e)for(let e of this[x])t.appendChild(e.cloneNode(!0));return t}dispatchEvent(e){let t=super.dispatchEvent(e);if(e.bubbles&&!e.cancelBubble){let t=this[b];for(;t&&(Object.getPrototypeOf(Node.prototype).dispatchEvent.call(t,e),!e.cancelBubble);)t=t[b]}return t}get[(me=y,he=b,ge=x,_e=S,ve=C,Symbol.toStringTag)](){return`Node`}};const be={isTag(e){return e[y]===M.ELEMENT_NODE},getName(e){return e[T]??``},getParent(e){return e.parentNode},getChildren(e){return e[x]},getSiblings(e){let t=e.parentNode;return t?t[x]:[e]},getAttributeValue(e,t){return e[y]===M.ELEMENT_NODE?e.getAttribute(t):null},getText(e){return e.textContent??``},caseSensitive:!1},xe={html:`http://www.w3.org/1999/xhtml`,svg:`http://www.w3.org/2000/svg`,mathML:`http://www.w3.org/1998/Math/MathML`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};var Attr=class{constructor(e,t,n=null,r=null,i=null){this.specified=!0,this[A]=e,this[ee]=t,this[j]=i,this.namespaceURI=n,this.prefix=r;let a=e.indexOf(`:`);this.localName=a===-1?e:e.slice(a+1)}get name(){return this[A]}get value(){return this[ee]}set value(e){this[ee]=e}get ownerElement(){return this[j]}get[Symbol.toStringTag](){return`Attr`}},NamedNodeMap=class{constructor(e){this._items=[],this._ownerElement=e}get length(){return this._items.length}item(e){return this._items[e]??null}getNamedItem(e){return this._findByName(e)}getNamedItemNS(e,t){let n=e===``?null:e;for(let e of this._items)if(e.namespaceURI===n&&e.localName===t)return e;return null}setNamedItem(e){return this._setAttr(e)}setNamedItemNS(e){return this._setAttr(e)}removeNamedItem(e){let t=this._findByName(e);if(!t)throw new DOMException(`Failed to execute 'removeNamedItem' on 'NamedNodeMap': No item with name '${e}' was found.`,`NotFoundError`);return this._removeAttr(t),t}removeNamedItemNS(e,t){let n=this.getNamedItemNS(e,t);if(!n)throw new DOMException(`Failed to execute 'removeNamedItemNS' on 'NamedNodeMap': No item with namespace '${e}' and localName '${t}' was found.`,`NotFoundError`);return this._removeAttr(n),n}[Symbol.iterator](){return this._items[Symbol.iterator]()}get[Symbol.toStringTag](){return`NamedNodeMap`}_setNamedItem(e,t,n=null,r=null){let i=n===null?this._findByName(e):this.getNamedItemNS(n,e.includes(`:`)?e.split(`:`)[1]:e);if(i)i.value=t;else{let i=new Attr(e,t,n,r,this._ownerElement);this._items.push(i)}}_removeNamedItem(e){let t=this._findByName(e);return t?(this._removeAttr(t),!0):!1}_removeNamedItemNS(e,t){let n=this.getNamedItemNS(e,t);return n?(this._removeAttr(n),!0):!1}_findByName(e){let t=this._ownerElement.namespaceURI===xe.html,n=t?e.toLowerCase():e;for(let e of this._items)if((t?e.name.toLowerCase():e.name)===n)return e;return null}_setAttr(e){let t=null;if(t=e.namespaceURI===null?this._findByName(e.name):this.getNamedItemNS(e.namespaceURI,e.localName),t){let n=new Attr(t.name,t.value,t.namespaceURI,t.prefix,t.ownerElement);return t.value=e.value,n}return this._items.push(e),null}_removeAttr(e){let t=this._items.indexOf(e);t!==-1&&this._items.splice(t,1)}};const F=/^([+-]?\d*)n\s*(?:([+-])\s*(\d+))?$/,Se=/^[+-]?\d+$/;function parseNth(e){let t=e.trim().toLowerCase();if(t===`odd`)return{a:2,b:1};if(t===`even`)return{a:2,b:0};let n=F.exec(t);if(n!==null){let e=n[1];return{a:e===``||e===`+`?1:e===`-`?-1:Number(e),b:n[3]===void 0?0:Number(n[2]+n[3])}}if(Se.test(t))return{a:0,b:Number(t)};throw SyntaxError(`'`+e+`' is not a valid An+B argument`)}function matchesNth(e,t){if(e.a===0)return t===e.b;let n=t-e.b;return e.a>0?n>=0&&n%e.a===0:n<=0&&n%e.a===0}const Ce=new Set([` `,` `,`
|
|
2
|
+
`,`\r`,`\f`]),I={"~":`element`,"|":`hyphen`,"^":`start`,$:`end`,"*":`any`,"!":`not`},we={"nth-child":`child`,"nth-last-child":`last-child`,"nth-of-type":`of-type`,"nth-last-of-type":`last-of-type`},L={"any-link":`:is(a, area, link)[href]`,disabled:`:is(:is(button, input, select, textarea, optgroup, option, fieldset)[disabled], optgroup[disabled] > option, fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *))`,enabled:`:is(button, input, select, textarea, optgroup, option, fieldset):not(:disabled)`,checked:`:is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)`,required:`:is(input, select, textarea)[required]`,optional:`:is(input, select, textarea):not([required])`,selected:`option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)`},R=new Set([`before`,`after`,`first-line`,`first-letter`,`selection`,`placeholder`]),Te=new Set([`hover`,`active`,`focus`,`focus-visible`,`focus-within`,`visited`,`link`,`target`,`target-within`,`playing`,`paused`,`current`,`past`,`future`]);function isNameChar(e){if(e===``)return!1;let t=e.codePointAt(0);return e===`-`||e===`_`||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t>127}function isNameStart(e){return e===`\\`||e!==`-`&&isNameChar(e)&&!(e>=`0`&&e<=`9`)}function isHexDigit(e){return e>=`0`&&e<=`9`||e>=`a`&&e<=`f`||e>=`A`&&e<=`F`}function isNthChar(e){return e>=`0`&&e<=`9`||e===`n`||e===`N`||e===`+`||e===`-`||Ce.has(e)}var SelectorParser=class{input;pos=0;constructor(e){this.input=e}parseSelectorList(e){let t=[this.parseComplex(e)];for(;this.peek()===`,`;)this.pos++,t.push(this.parseComplex(e));return t}atEnd(){return this.pos>=this.input.length}fail(e){throw SyntaxError(`Failed to parse selector '`+this.input+`': `+e)}peek(e=0){return this.input[this.pos+e]??``}skipWhitespace(){let e=this.pos;for(;Ce.has(this.peek());)this.pos++;return this.pos>e}expect(e){this.peek()!==e&&this.fail(`expected '`+e+`' at offset `+this.pos),this.pos++}parseComplex(e){this.skipWhitespace();let t=e?this.readLeadingCombinator():null,n=[this.parseCompound()],r=[];for(;;){let e=this.readCombinator();if(e===null)break;r.push(e),n.push(this.parseCompound())}return{compounds:n,combinators:r,leading:t}}readLeadingCombinator(){let e=this.peek();return e!==`>`&&e!==`+`&&e!==`~`?`descendant`:(this.pos++,this.skipWhitespace(),e===`>`?`child`:e===`+`?`adjacent`:`sibling`)}readCombinator(){let e=this.skipWhitespace(),t=this.peek();if(t===`>`||t===`+`||t===`~`)return this.pos++,this.skipWhitespace(),t===`>`?`child`:t===`+`?`adjacent`:`sibling`;if(t===`|`&&this.peek(1)===`|`&&this.fail(`the column combinator '||' needs a table layout`),t===``||t===`,`||t===`)`)return null;if(e)return`descendant`;this.fail(`unexpected '`+t+`' at offset `+this.pos)}parseCompound(){let e=[];for(;;){let t=this.peek();if(t===`*`)this.pos++,this.rejectNamespace(),e.push({kind:`universal`});else if(t===`#`)this.pos++,e.push({kind:`attribute`,name:`id`,action:`equals`,value:this.readName(),ignoreCase:!1});else if(t===`.`)this.pos++,e.push({kind:`attribute`,name:`class`,action:`element`,value:this.readName(),ignoreCase:!1});else if(t===`[`)e.push(this.parseAttribute());else if(t===`:`)for(let t of this.parsePseudo())e.push(t);else if(t===`|`)this.fail(`namespace selectors need a namespace map this parser is not given`);else if(isNameStart(t)){let t=this.readName();this.rejectNamespace(),e.push({kind:`type`,name:t})}else break}return e.length===0&&this.fail(`expected a selector at offset `+this.pos),e}rejectNamespace(){this.peek()===`|`&&this.peek(1)!==`=`&&this.fail(`namespace selectors need a namespace map this parser is not given`)}readName(){let e=``;for(;;){let t=this.peek();if(t===`\\`){e+=this.readEscape();continue}if(!isNameChar(t))break;e+=t,this.pos++}return e===``&&this.fail(`expected an identifier at offset `+this.pos),e}readEscape(){this.pos++;let e=``;for(;e.length<6&&isHexDigit(this.peek());)e+=this.peek(),this.pos++;if(e===``){let e=this.peek();return e===``&&this.fail(`a trailing backslash escapes nothing`),this.pos++,e}Ce.has(this.peek())&&this.pos++;let t=Number.parseInt(e,16);return t===0||t>1114111||t>=55296&&t<=57343?`�`:String.fromCodePoint(t)}readString(e){this.pos++;let t=``;for(;;){let n=this.peek();if(n===``&&this.fail(`unterminated string`),n===e)return this.pos++,t;if(n===`\\`){t+=this.readEscape();continue}t+=n,this.pos++}}parseAttribute(){this.expect(`[`),this.skipWhitespace(),(this.peek()===`|`||this.peek()===`*`)&&this.fail(`namespace selectors need a namespace map this parser is not given`);let e=this.readName();if(this.rejectNamespace(),this.skipWhitespace(),this.peek()===`]`)return this.pos++,{kind:`attribute`,name:e,action:`exists`,value:``,ignoreCase:null};let t;this.peek()===`=`?(t=`equals`,this.pos++):this.peek(1)===`=`&&Object.hasOwn(I,this.peek())?(t=I[this.peek()],this.pos+=2):this.fail(`'`+this.peek()+`' is not an attribute operator`),this.skipWhitespace();let n=this.peek(),r=n===`"`||n===`'`?this.readString(n):this.readName();this.skipWhitespace();let i=null,a=this.peek().toLowerCase();return(a===`i`||a===`s`)&&(i=a===`i`,this.pos++,this.skipWhitespace()),this.expect(`]`),{kind:`attribute`,name:e,action:t,value:r,ignoreCase:i}}parsePseudo(){this.pos++,this.peek()===`:`&&(this.pos++,this.fail(`pseudo-element '::`+this.readName()+`' has no meaning without rendering`));let e=this.readName().toLowerCase();if(e===`not`||e===`is`||e===`where`||e===`matches`||e===`has`){this.expect(`(`);let t=this.parseSelectorList(e===`has`);return this.expect(`)`),[{kind:e===`not`?`not`:e===`has`?`has`:`is`,selectors:t}]}if(Object.hasOwn(we,e))return[this.parseNthPseudo(we[e])];if(e===`first-child`)return[positional(`child`,1)];if(e===`last-child`)return[positional(`last-child`,1)];if(e===`only-child`)return[positional(`child`,1),positional(`last-child`,1)];if(e===`first-of-type`)return[positional(`of-type`,1)];if(e===`last-of-type`)return[positional(`last-of-type`,1)];if(e===`only-of-type`)return[positional(`of-type`,1),positional(`last-of-type`,1)];if(e===`empty`)return[{kind:`empty`}];if(e===`root`)return[{kind:`root`}];if(e===`scope`)return[{kind:`scope`}];if(Object.hasOwn(L,e))return[{kind:`is`,selectors:parseSelectorList(L[e])}];Te.has(e)&&this.fail(`':`+e+`' is a user-state pseudo-class and needs a live document`),R.has(e)&&this.fail(`pseudo-element ':`+e+`' has no meaning without rendering`),this.fail(`unknown pseudo-class ':`+e+`'`)}parseNthPseudo(e){this.expect(`(`);let t=parseNth(this.readNthArgument()),n=null;return this.readKeyword(`of`)&&(n=this.parseSelectorList(!1)),this.expect(`)`),{kind:`nth`,axis:e,formula:t,of:n}}readNthArgument(){if(this.skipWhitespace(),this.readKeyword(`odd`))return`odd`;if(this.readKeyword(`even`))return`even`;let e=this.pos;for(;isNthChar(this.peek());)this.pos++;return this.input.slice(e,this.pos)}readKeyword(e){return this.input.slice(this.pos,this.pos+e.length).toLowerCase()!==e||isNameChar(this.peek(e.length))?!1:(this.pos+=e.length,this.skipWhitespace(),!0)}};function positional(e,t){return{kind:`nth`,axis:e,formula:{a:0,b:t},of:null}}function parseSelectorList(e){let t=new SelectorParser(e),n=t.parseSelectorList(!1);return t.atEnd()||t.fail(`unexpected trailing input`),n}const Ee=new Set(`accept.accept-charset.align.alink.axis.bgcolor.charset.checked.clear.codetype.color.compact.declare.defer.dir.direction.disabled.enctype.face.frame.hreflang.http-equiv.lang.language.link.media.method.multiple.nohref.noresize.noshade.nowrap.readonly.rel.rev.rules.scope.scrolling.selected.shape.target.text.type.valign.valuetype.vlink`.split(`.`)),De=/\s+/,Oe={universal:0,attribute:1,type:2,nth:3,empty:3,root:3,scope:3,is:4,not:4,has:5};function cost(e){return e.kind===`attribute`?e.name===`id`&&e.action===`equals`?0:e.action===`exists`?2:1:Oe[e.kind]}function compileAttribute(e,t){let n=t.caseSensitive?e.name:e.name.toLowerCase(),r=e.ignoreCase===null?!t.caseSensitive&&Ee.has(n):e.ignoreCase,i=r?e.value.toLowerCase():e.value,read=e=>{let i=t.getAttributeValue(e,n);return i===null||!r?i:i.toLowerCase()},noMatch=()=>!1;switch(e.action){case`exists`:return e=>t.getAttributeValue(e,n)!==null;case`equals`:return e=>read(e)===i;case`not`:return i===``?e=>(read(e)??``)!==``:e=>read(e)!==i;case`start`:return i===``?noMatch:e=>read(e)?.startsWith(i)===!0;case`end`:return i===``?noMatch:e=>read(e)?.endsWith(i)===!0;case`any`:return i===``?noMatch:e=>read(e)?.includes(i)===!0;case`hyphen`:return e=>{let t=read(e);return t!==null&&(t===i||t.startsWith(i+`-`))};default:return i===``||De.test(i)?noMatch:e=>read(e)?.split(De).includes(i)===!0}}function compileNth(e,t){let n=e.axis===`last-child`||e.axis===`last-of-type`,r=e.axis===`of-type`||e.axis===`last-of-type`,i=e.of===null?null:compileList(e.of,t);return(a,o)=>{let s=t.getSiblings(a),c=r?t.getName(a):``,l=n?-1:1,u=0;for(let d=n?s.length-1:0;d>=0&&d<s.length;d+=l){let n=s[d];if(t.isTag(n)&&!(r&&t.getName(n)!==c)&&!(i!==null&&!i(n,o))&&(u++,n===a))return matchesNth(e.formula,u)}return!1}}function collectDescendants(e,t,n){for(let r of t.getChildren(e))t.isTag(r)&&n.push(r),collectDescendants(r,t,n)}function followingSiblings(e,t){let n=t.getSiblings(e),r=n.indexOf(e);return r===-1?[]:n.slice(r+1).filter(e=>t.isTag(e))}function compileHas(e,t){let n=e.selectors.map(e=>compileComplex(e,t)),r=e.selectors.some(e=>e.leading===`adjacent`||e.leading===`sibling`),i=new Map;return(e,a)=>{let o=i.get(e);if(o!==void 0)return o;let s=[];if(collectDescendants(e,t,s),r)for(let n of followingSiblings(e,t))s.push(n);let c=a.scope;a.scope=e;let l=!1;for(let e of s)if(n.some(t=>t(e,a))){l=!0;break}return a.scope=c,i.set(e,l),l}}function compileSimple(e,t){switch(e.kind){case`universal`:return()=>!0;case`type`:{let n=t.caseSensitive?e.name:e.name.toLowerCase();return e=>t.getName(e)===n}case`attribute`:return compileAttribute(e,t);case`nth`:return compileNth(e,t);case`empty`:return e=>!t.getChildren(e).some(e=>t.isTag(e)||t.getText(e)!==``);case`root`:return e=>{let n=t.getParent(e);return n===null||!t.isTag(n)};case`scope`:return(e,t)=>e===t.scope;case`is`:return compileList(e.selectors,t);case`not`:{let n=compileList(e.selectors,t);return(e,t)=>!n(e,t)}default:return compileHas(e,t)}}function compileCompound(e,t){let n=e.slice().sort((e,t)=>cost(e)-cost(t)).map(e=>compileSimple(e,t));return n.length===1?n[0]:(e,t)=>{for(let r of n)if(!r(e,t))return!1;return!0}}function compileCombinator(e,t,n){switch(e){case`child`:return(e,r)=>{let i=n.getParent(e);return i!==null&&t(i,r)};case`descendant`:return(e,r)=>{let i=n.getParent(e);for(;i!==null;){if(t(i,r))return!0;i=n.getParent(i)}return!1};case`adjacent`:return(e,r)=>{let i=n.getSiblings(e);for(let a=i.indexOf(e)-1;a>=0;a--)if(n.isTag(i[a]))return t(i[a],r);return!1};default:return(e,r)=>{let i=n.getSiblings(e);for(let a=i.indexOf(e)-1;a>=0;a--)if(n.isTag(i[a])&&t(i[a],r))return!0;return!1}}}function compileComplex(e,t){let next=e.leading===null?()=>!0:compileCombinator(e.leading,(e,t)=>e===t.scope,t);for(let n=0;n<e.compounds.length;n++){n>0&&(next=compileCombinator(e.combinators[n-1],next,t));let r=compileCompound(e.compounds[n],t),i=next;next=(e,t)=>r(e,t)&&i(e,t)}return next}function compileList(e,t){let n=e.map(e=>compileComplex(e,t));return n.length===1?n[0]:(e,t)=>n.some(n=>n(e,t))}function compile(e,t){return compileList(parseSelectorList(e),t)}function walk(e,t,n){for(let r of t.getChildren(e))if(t.isTag(r)&&n(r)||walk(r,t,n))return!0;return!1}function selectAll(e,t,n){let r=compile(e,n),i={scope:t},a=[];return walk(t,n,e=>(r(e,i)&&a.push(e),!1)),a}function selectOne(e,t,n){let r=compile(e,n),i={scope:t},a=null;return walk(t,n,e=>r(e,i)?(a=e,!0):!1),a}function matchesSelector(e,t,n){return compile(e,n)(t,{scope:t})}function closestSelector(e,t,n){let r=compile(e,n),i={scope:t},a=t;for(;a!==null&&n.isTag(a);){if(r(a,i))return a;a=n.getParent(a)}return null}let ke,Ae,je,Me,Ne,Pe;var Element=class extends ye{constructor(){super(),this[ke]=``,this[Ae]=``,this[je]=xe.html,this[Me]=null,this[Ne]=new NamedNodeMap(this),this[Pe]=new Map,this._resizeSubscribers=null,this._allocatedClientWidth=0,this._allocatedClientHeight=0,this._pointerCaptures=new Set,this[y]=M.ELEMENT_NODE}get tagName(){return this[w]}get localName(){return this[T]}get namespaceURI(){return this[E]}get prefix(){return this[D]}get nodeName(){return this[w]}get attributes(){return this[O]}get id(){return this.getAttribute(`id`)??``}set id(e){this.setAttribute(`id`,e)}get className(){return this.getAttribute(`class`)??``}set className(e){this.setAttribute(`class`,e)}get children(){return this[S]}get childElementCount(){return this[S].length}get firstElementChild(){return this[S][0]??null}get lastElementChild(){let e=this[S];return e[e.length-1]??null}get previousElementSibling(){let e=this[b];if(!e)return null;let t=e[S],n=t.indexOf(this);return n>0?t[n-1]:null}get nextElementSibling(){let e=this[b];if(!e)return null;let t=e[S],n=t.indexOf(this);return n!==-1&&n<t.length-1?t[n+1]:null}get textContent(){let e=``;for(let t of this[x])t.textContent!==null&&(e+=t.textContent);return e}set textContent(e){let t=this[x];for(;t.length>0;)this.removeChild(t[0])}getAttribute(e){let t=this[O].getNamedItem(e);return t?t.value:null}getAttributeNS(e,t){let n=this[O].getNamedItemNS(e,t);return n?n.value:null}setAttribute(e,t){this[O]._setNamedItem(e,String(t))}setAttributeNS(e,t,n){let r=e===``?null:e,i=t.split(`:`),a=i.length>1?i[0]:null;this[O]._setNamedItem(t,String(n),r,a)}removeAttribute(e){this[O]._removeNamedItem(e)}removeAttributeNS(e,t){let n=e===``?null:e;this[O]._removeNamedItemNS(n,t)}hasAttribute(e){return this[O].getNamedItem(e)!==null}hasAttributeNS(e,t){return this[O].getNamedItemNS(e,t)!==null}getAttributeNode(e){return this[O].getNamedItem(e)}setAttributeNode(e){return this[O].setNamedItem(e)}removeAttributeNode(e){let t=this[O].getNamedItem(e.name);if(!t)throw new DOMException(`Failed to execute 'removeAttributeNode' on 'Element': The attribute is not owned by this element.`,`NotFoundError`);return this[O].removeNamedItem(t.name),t}toggleAttribute(e,t){return t===void 0?this.hasAttribute(e)?(this.removeAttribute(e),!1):(this.setAttribute(e,``),!0):t?(this.setAttribute(e,``),!0):(this.removeAttribute(e),!1)}hasAttributes(){return this[O].length>0}dispatchEvent(e){let t=super.dispatchEvent(e),n=this[k].get(`on`+e.type);return typeof n==`function`&&n.call(this,e),t}querySelector(e){return selectOne(e,this,be)}querySelectorAll(e){return selectAll(e,this,be)}matches(e){return matchesSelector(e,this,be)}closest(e){return closestSelector(e,this,be)}getElementsByTagName(e){let t=[],n=e.toUpperCase(),walk=r=>{for(let i of r[x])if(i[y]===M.ELEMENT_NODE){let r=i;(e===`*`||r[w]===n)&&t.push(r),walk(r)}};return walk(this),t}getElementsByClassName(e){let t=[],n=e.split(/\s+/).filter(Boolean),walk=e=>{for(let r of e[x])if(r[y]===M.ELEMENT_NODE){let e=r,i=e.className.split(/\s+/);n.every(e=>i.includes(e))&&t.push(e),walk(e)}};return walk(this),t}cloneNode(e=!1){let t=super.cloneNode(!1);t[w]=this[w],t[T]=this[T],t[E]=this[E],t[D]=this[D];for(let e of this[O])t.setAttributeNS(e.namespaceURI,e.name,e.value);if(e)for(let e of this[x])t.appendChild(e.cloneNode(!0));return t}_onResize(e){let t=this._resizeSubscribers??=new Set;return t.add(e),()=>{t.delete(e),t.size===0&&(this._resizeSubscribers=null)}}_fireResizeSubscribers(e,t){let n=this._resizeSubscribers;if(!(!n||n.size===0))for(let r of[...n])try{r(e,t)}catch(e){console.error(`ResizeObserver subscriber threw:`,e)}}setPointerCapture(e){this._pointerCaptures.add(e)}releasePointerCapture(e){this._pointerCaptures.delete(e)}hasPointerCapture(e){return this._pointerCaptures.has(e)}get[(ke=w,Ae=T,je=E,Me=D,Ne=O,Pe=k,Symbol.toStringTag)](){return`Element`}},CSSStyleDeclaration=class{constructor(){this._cssText=``}get cssText(){return this._cssText}set cssText(e){this._cssText=e;for(let t of e.split(`;`)){let e=t.indexOf(`:`);if(e===-1)continue;let n=t.slice(0,e).trim(),r=t.slice(e+1).trim();if(!n)continue;let i=n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());this[i]=r}}setProperty(e,t,n){this[e]=t}getPropertyValue(e){let t=this[e];return typeof t==`string`?t:``}removeProperty(e){let t=this[e];return delete this[e],typeof t==`string`?t:``}getPropertyPriority(e){return``}},HTMLElement=class extends Element{constructor(...e){super(...e),this.style=new CSSStyleDeclaration}get dataset(){let e=this;return new Proxy({},{get(t,n){if(typeof n!=`string`)return;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.getAttribute(r)??void 0},set(t,n,r){if(typeof n!=`string`)return!1;let i=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.setAttribute(i,String(r)),!0},deleteProperty(t,n){if(typeof n!=`string`)return!1;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.removeAttribute(r),!0},has(t,n){if(typeof n!=`string`)return!1;let r=`data-`+n.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return e.hasAttribute(r)}})}get title(){return this.getAttribute(`title`)??``}set title(e){this.setAttribute(`title`,e)}get lang(){return this.getAttribute(`lang`)??``}set lang(e){this.setAttribute(`lang`,e)}get dir(){return this.getAttribute(`dir`)??``}set dir(e){this.setAttribute(`dir`,e)}get accessKey(){return this.getAttribute(`accesskey`)??``}set accessKey(e){this.setAttribute(`accesskey`,e)}get accessKeyLabel(){return this.getAttribute(`accesskey`)??``}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}get draggable(){return this.getAttribute(`draggable`)===`true`}set draggable(e){this.setAttribute(`draggable`,String(e))}get spellcheck(){let e=this.getAttribute(`spellcheck`);return e===`false`?!1:e!==null}set spellcheck(e){this.setAttribute(`spellcheck`,String(e))}get translate(){return this.getAttribute(`translate`)!==`no`}set translate(e){this.setAttribute(`translate`,e?`yes`:`no`)}get tabIndex(){let e=this.getAttribute(`tabindex`);return e===null?-1:Number(e)}set tabIndex(e){this.setAttribute(`tabindex`,String(e))}get contentEditable(){let e=this.getAttribute(`contenteditable`);return e===``||e===`true`?`true`:e===`false`?`false`:`inherit`}set contentEditable(e){e===`inherit`?this.removeAttribute(`contenteditable`):this.setAttribute(`contenteditable`,e)}get isContentEditable(){return this.contentEditable===`true`}get offsetHeight(){return this._allocatedClientHeight}get offsetWidth(){return this._allocatedClientWidth}get offsetLeft(){return 0}get offsetTop(){return 0}get offsetParent(){return null}get clientHeight(){return this._allocatedClientHeight}get clientWidth(){return this._allocatedClientWidth}get clientLeft(){return 0}get clientTop(){return 0}get scrollHeight(){return this._allocatedClientHeight}get scrollWidth(){return this._allocatedClientWidth}get scrollTop(){return 0}set scrollTop(e){}get scrollLeft(){return 0}set scrollLeft(e){}getBoundingClientRect(){let e=this.clientWidth,t=this.clientHeight;return{x:0,y:0,top:0,left:0,right:e,bottom:t,width:e,height:t,toJSON(){return this}}}click(){this.dispatchEvent(new Event(`click`,{bubbles:!0,cancelable:!0}))}blur(){this.dispatchEvent(new Event(`blur`))}focus(){this.dispatchEvent(new Event(`focus`))}get onclick(){return this[k].get(`onclick`)??null}set onclick(e){this[k].set(`onclick`,e)}get ondblclick(){return this[k].get(`ondblclick`)??null}set ondblclick(e){this[k].set(`ondblclick`,e)}get onload(){return this[k].get(`onload`)??null}set onload(e){this[k].set(`onload`,e)}get onerror(){return this[k].get(`onerror`)??null}set onerror(e){this[k].set(`onerror`,e)}get onabort(){return this[k].get(`onabort`)??null}set onabort(e){this[k].set(`onabort`,e)}get onfocus(){return this[k].get(`onfocus`)??null}set onfocus(e){this[k].set(`onfocus`,e)}get onblur(){return this[k].get(`onblur`)??null}set onblur(e){this[k].set(`onblur`,e)}get onchange(){return this[k].get(`onchange`)??null}set onchange(e){this[k].set(`onchange`,e)}get oninput(){return this[k].get(`oninput`)??null}set oninput(e){this[k].set(`oninput`,e)}get onsubmit(){return this[k].get(`onsubmit`)??null}get onreset(){return this[k].get(`onreset`)??null}set onreset(e){this[k].set(`onreset`,e)}get onscroll(){return this[k].get(`onscroll`)??null}set onscroll(e){this[k].set(`onscroll`,e)}get onresize(){return this[k].get(`onresize`)??null}set onresize(e){this[k].set(`onresize`,e)}get onmousedown(){return this[k].get(`onmousedown`)??null}set onmousedown(e){this[k].set(`onmousedown`,e)}get onmouseup(){return this[k].get(`onmouseup`)??null}set onmouseup(e){this[k].set(`onmouseup`,e)}get onmousemove(){return this[k].get(`onmousemove`)??null}set onmousemove(e){this[k].set(`onmousemove`,e)}get onmouseover(){return this[k].get(`onmouseover`)??null}set onmouseover(e){this[k].set(`onmouseover`,e)}get onmouseout(){return this[k].get(`onmouseout`)??null}set onmouseout(e){this[k].set(`onmouseout`,e)}get onmouseenter(){return this[k].get(`onmouseenter`)??null}set onmouseenter(e){this[k].set(`onmouseenter`,e)}get onmouseleave(){return this[k].get(`onmouseleave`)??null}set onmouseleave(e){this[k].set(`onmouseleave`,e)}get oncontextmenu(){return this[k].get(`oncontextmenu`)??null}set oncontextmenu(e){this[k].set(`oncontextmenu`,e)}get onwheel(){return this[k].get(`onwheel`)??null}set onwheel(e){this[k].set(`onwheel`,e)}get onkeydown(){return this[k].get(`onkeydown`)??null}set onkeydown(e){this[k].set(`onkeydown`,e)}get onkeyup(){return this[k].get(`onkeyup`)??null}set onkeyup(e){this[k].set(`onkeyup`,e)}get ontouchstart(){return this[k].get(`ontouchstart`)??null}set ontouchstart(e){this[k].set(`ontouchstart`,e)}get ontouchend(){return this[k].get(`ontouchend`)??null}set ontouchend(e){this[k].set(`ontouchend`,e)}get ontouchmove(){return this[k].get(`ontouchmove`)??null}set ontouchmove(e){this[k].set(`ontouchmove`,e)}get onpointerdown(){return this[k].get(`onpointerdown`)??null}set onpointerdown(e){this[k].set(`onpointerdown`,e)}get onpointerup(){return this[k].get(`onpointerup`)??null}set onpointerup(e){this[k].set(`onpointerup`,e)}get onpointermove(){return this[k].get(`onpointermove`)??null}set onpointermove(e){this[k].set(`onpointermove`,e)}cloneNode(e=!1){return super.cloneNode(e)}get[Symbol.toStringTag](){return`HTMLElement`}},Fe=class HTMLCanvasElement extends HTMLElement{constructor(...e){super(...e),this.oncontextlost=null,this.oncontextrestored=null,this.onwebglcontextcreationerror=null,this.onwebglcontextlost=null,this.onwebglcontextrestored=null}static{this._contextFactories=new Map}static registerContextFactory(e,t){HTMLCanvasElement._contextFactories.set(e,t)}get width(){let e=this.getAttribute(`width`);return e===null?300:Number(e)}set width(e){this.setAttribute(`width`,String(e))}get height(){let e=this.getAttribute(`height`);return e===null?150:Number(e)}set height(e){this.setAttribute(`height`,String(e))}getContext(e,t){let n=HTMLCanvasElement._contextFactories.get(e);return n?n(this,t):null}toDataURL(e,t){let n=this.getContext(`2d`);return n&&typeof n._toDataURL==`function`?n._toDataURL(e,t):``}toBlob(e,t,n){let r=this.toDataURL(t,n);if(!r){e(null);return}let[i,a]=r.split(`,`),o=i.split(`:`)[1].split(`;`)[0],s=atob(a),c=new Uint8Array(s.length);for(let e=0;e<s.length;e++)c[e]=s.charCodeAt(e);e(new Blob([c],{type:o}))}captureStream(e){return{}}},Ie=class DOMMatrix{constructor(e){this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this.m11=1,this.m12=0,this.m13=0,this.m14=0,this.m21=0,this.m22=1,this.m23=0,this.m24=0,this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m41=0,this.m42=0,this.m43=0,this.m44=1,this.is2D=!0,this.isIdentity=!0,Array.isArray(e)&&(e.length===6?(this.a=this.m11=e[0],this.b=this.m12=e[1],this.c=this.m21=e[2],this.d=this.m22=e[3],this.e=this.m41=e[4],this.f=this.m42=e[5],this.is2D=!0):e.length===16&&(this.m11=e[0],this.m12=e[1],this.m13=e[2],this.m14=e[3],this.m21=e[4],this.m22=e[5],this.m23=e[6],this.m24=e[7],this.m31=e[8],this.m32=e[9],this.m33=e[10],this.m34=e[11],this.m41=e[12],this.m42=e[13],this.m43=e[14],this.m44=e[15],this.a=this.m11,this.b=this.m12,this.c=this.m21,this.d=this.m22,this.e=this.m41,this.f=this.m42,this.is2D=!1),this.isIdentity=this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.e===0&&this.f===0)}multiply(e){let t=this.a*e.a+this.c*e.b,n=this.b*e.a+this.d*e.b,r=this.a*e.c+this.c*e.d,i=this.b*e.c+this.d*e.d,a=this.a*e.e+this.c*e.f+this.e,o=this.b*e.e+this.d*e.f+this.f;return new DOMMatrix([t,n,r,i,a,o])}multiplySelf(e){let t=this.multiply(e);return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.e=t.e,this.f=t.f,this.m11=this.a,this.m12=this.b,this.m21=this.c,this.m22=this.d,this.m41=this.e,this.m42=this.f,this.isIdentity=!1,this}inverse(){let e=this.a*this.d-this.b*this.c;if(e===0)return new DOMMatrix([1,0,0,1,0,0]);let t=1/e;return new DOMMatrix([this.d*t,-this.b*t,-this.c*t,this.a*t,(this.c*this.f-this.d*this.e)*t,(this.b*this.e-this.a*this.f)*t])}translate(e=0,t=0){return this.multiply({a:1,b:0,c:0,d:1,e,f:t})}scale(e=1,t=e){return this.multiply({a:e,b:0,c:0,d:t,e:0,f:0})}};const Le=Ie;function defineGlobal(e,t){Object.defineProperty(globalThis,e,{value:t,writable:!0,configurable:!0})}function defineGlobalIfMissing(e,t){globalThis[e]===void 0&&defineGlobal(e,t)}const Re={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,gold:`#ffd700`,goldenrod:`#daa520`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavender:`#e6e6fa`,lavenderblush:`#fff0f5`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`,transparent:`#00000000`};function parseColor(e){if(!e||typeof e!=`string`)return null;let t=e.trim().toLowerCase(),n=Re[t];if(n)return parseHex(n);if(t.startsWith(`#`))return parseHex(t);let r=t.match(/^rgba?\(\s*(\d+(?:\.\d+)?%?)\s*[,\s]\s*(\d+(?:\.\d+)?%?)\s*[,\s]\s*(\d+(?:\.\d+)?%?)\s*(?:[,/]\s*(\d+(?:\.\d+)?%?))?\s*\)$/);if(r)return{r:parseComponent(r[1],255)/255,g:parseComponent(r[2],255)/255,b:parseComponent(r[3],255)/255,a:r[4]===void 0?1:parseComponent(r[4],1)};let i=t.match(/^hsla?\(\s*(\d+(?:\.\d+)?)\s*[,\s]\s*(\d+(?:\.\d+)?)(%)?\s*[,\s]\s*(\d+(?:\.\d+)?)(%)?\s*(?:[,/]\s*(\d+(?:\.\d+)?%?))?\s*\)$/);if(i){let e=parseFloat(i[1]),t=parseFloat(i[2]),n=i[3]===`%`,r=parseFloat(i[4]),a=i[5]===`%`,o=i[6]===void 0?1:parseComponent(i[6],1);return e>1&&(e/=360),(n||t>1)&&(t/=100),(a||r>1)&&(r/=100),hslToRGBA(e,t,r,Math.max(0,Math.min(1,o)))}return null}function parseHex(e){let t=e.slice(1),n,r,i,a=1;if(t.length===3)n=parseInt(t[0]+t[0],16)/255,r=parseInt(t[1]+t[1],16)/255,i=parseInt(t[2]+t[2],16)/255;else if(t.length===4)n=parseInt(t[0]+t[0],16)/255,r=parseInt(t[1]+t[1],16)/255,i=parseInt(t[2]+t[2],16)/255,a=parseInt(t[3]+t[3],16)/255;else if(t.length===6)n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,i=parseInt(t.slice(4,6),16)/255;else if(t.length===8)n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,i=parseInt(t.slice(4,6),16)/255,a=parseInt(t.slice(6,8),16)/255;else return null;return{r:n,g:r,b:i,a}}function parseComponent(e,t){return e.endsWith(`%`)?parseFloat(e)/100*t:parseFloat(e)}function hue2rgb$1(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}__name$1(hue2rgb$1,`hue2rgb`);function hslToRGBA(e,t,n,r){let i,a,o;if(t===0)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=hue2rgb$1(s,r,e+1/3),a=hue2rgb$1(s,r,e),o=hue2rgb$1(s,r,e-1/3)}return{r:i,g:a,b:o,a:r}}const ze={r:0,g:0,b:0,a:1};var CanvasGradient=class{constructor(e,n,r,i,a,o,s){e===`radial`?this._pattern=new t.RadialGradient(n,r,o,i,a,s):this._pattern=new t.LinearGradient(n,r,i,a)}addColorStop(e,t){let n=parseColor(t);n&&this._pattern.addColorStopRGBA(e,n.r,n.g,n.b,n.a)}_getCairoPattern(){return this._pattern}};function quadraticToCubic(e,t,n,r,i,a){return{cp1x:e+2/3*(n-e),cp1y:t+2/3*(r-t),cp2x:i+2/3*(n-i),cp2y:a+2/3*(r-a)}}function computeArcTo(e,t,n,r,i,a,o){let s=e-n,c=t-r,l=i-n,u=a-r,d=Math.sqrt(s*s+c*c),f=Math.sqrt(l*l+u*u);if(d===0||f===0)return null;let p=s/d,m=c/d,h=l/f,g=u/f,_=p*g-m*h;if(Math.abs(_)<1e-10)return null;let v=p*h+m*g,y=Math.acos(Math.max(-1,Math.min(1,v)))/2,b=o/Math.tan(y),x=n+p*b,S=r+m*b,C=n+h*b,w=r+g*b,T=o/Math.sin(y),E=(p+h)/2,D=(m+g)/2,O=Math.sqrt(E*E+D*D),k=n+E/O*T,A=r+D/O*T;return{tx0:x,ty0:S,tx1:C,ty1:w,cx:k,cy:A,startAngle:Math.atan2(S-A,x-k),endAngle:Math.atan2(w-A,C-k),counterclockwise:_>0}}function cairoArcTo(e,t,n,r,i,a,o,s){let c=computeArcTo(t,n,r,i,a,o,s);if(!c){e.lineTo(r,i);return}let{tx0:l,ty0:u,cx:d,cy:f,startAngle:p,endAngle:m,counterclockwise:h}=c;e.lineTo(l,u),h?e.arcNegative(d,f,s,p,m):e.arc(d,f,s,p,m)}function cairoEllipse(e,t,n,r,i,a,o,s,c){e.save(),e.translate(t,n),e.rotate(a),e.scale(r,i),c?e.arcNegative(0,0,1,o,s):e.arc(0,0,1,o,s),e.restore()}function cairoRoundRect(e,t,n,r,i,a){let o,s,c,l;typeof a==`number`?o=s=c=l=a:a.length===1?o=s=c=l=a[0]:a.length===2?(o=c=a[0],s=l=a[1]):a.length===3?(o=a[0],s=l=a[1],c=a[2]):(o=a[0],s=a[1],c=a[2],l=a[3]);let u=Math.min(r/2,i/2);o=Math.min(o,u),s=Math.min(s,u),c=Math.min(c,u),l=Math.min(l,u);let d=Math.PI/2;e.newSubPath(),e.arc(t+o,n+o,o,Math.PI,Math.PI+d),e.arc(t+r-s,n+s,s,-d,0),e.arc(t+r-c,n+i-c,c,0,d),e.arc(t+l,n+i-l,l,d,Math.PI),e.closePath()}const Be={"source-over":2,"source-in":3,"source-out":4,"source-atop":5,"destination-over":7,"destination-in":8,"destination-out":9,"destination-atop":10,lighter:12,copy:1,xor:11,multiply:14,screen:15,overlay:16,darken:17,lighten:18,"color-dodge":19,"color-burn":20,"hard-light":21,"soft-light":22,difference:23,exclusion:24,hue:25,saturation:26,color:27,luminosity:28},Ve={butt:0,round:1,square:2},He={miter:0,round:1,bevel:2};var Ue=class Path2D{constructor(e){this._ops=[],e instanceof Path2D&&(this._ops=[...e._ops])}addPath(e){this._ops.push(...e._ops)}moveTo(e,t){this._ops.push({type:`moveTo`,x:e,y:t})}lineTo(e,t){this._ops.push({type:`lineTo`,x:e,y:t})}closePath(){this._ops.push({type:`closePath`})}bezierCurveTo(e,t,n,r,i,a){this._ops.push({type:`bezierCurveTo`,cp1x:e,cp1y:t,cp2x:n,cp2y:r,x:i,y:a})}quadraticCurveTo(e,t,n,r){this._ops.push({type:`quadraticCurveTo`,cpx:e,cpy:t,x:n,y:r})}arc(e,t,n,r,i,a=!1){this._ops.push({type:`arc`,x:e,y:t,radius:n,startAngle:r,endAngle:i,ccw:a})}ellipse(e,t,n,r,i,a,o,s=!1){if(n<0||r<0)throw RangeError(`The radii provided are negative`);this._ops.push({type:`ellipse`,x:e,y:t,rx:n,ry:r,rotation:i,startAngle:a,endAngle:o,ccw:s})}rect(e,t,n,r){this._ops.push({type:`rect`,x:e,y:t,w:n,h:r})}roundRect(e,t,n,r,i=0){this._ops.push({type:`roundRect`,x:e,y:t,w:n,h:r,radii:i})}_replayOnCairo(e){let t=0,n=0;for(let r of this._ops)switch(r.type){case`moveTo`:e.moveTo(r.x,r.y),t=r.x,n=r.y;break;case`lineTo`:e.lineTo(r.x,r.y),t=r.x,n=r.y;break;case`closePath`:e.closePath();break;case`bezierCurveTo`:e.curveTo(r.cp1x,r.cp1y,r.cp2x,r.cp2y,r.x,r.y),t=r.x,n=r.y;break;case`quadraticCurveTo`:{let{cp1x:i,cp1y:a,cp2x:o,cp2y:s}=quadraticToCubic(t,n,r.cpx,r.cpy,r.x,r.y);e.curveTo(i,a,o,s,r.x,r.y),t=r.x,n=r.y;break}case`arc`:r.ccw?e.arcNegative(r.x,r.y,r.radius,r.startAngle,r.endAngle):e.arc(r.x,r.y,r.radius,r.startAngle,r.endAngle);break;case`ellipse`:e.save(),e.translate(r.x,r.y),e.rotate(r.rotation),e.scale(r.rx,r.ry),r.ccw?e.arcNegative(0,0,1,r.startAngle,r.endAngle):e.arc(0,0,1,r.startAngle,r.endAngle),e.restore();break;case`rect`:e.rectangle(r.x,r.y,r.w,r.h);break;case`roundRect`:cairoRoundRect(e,r.x,r.y,r.w,r.h,r.radii);break}}};function asCairoPattern(e){if(!e)return null;let t=e;return typeof t.setFilter!=`function`||typeof t.setExtend!=`function`?null:t}function isPixbufImageSource(e){return typeof e!=`object`||!e?!1:typeof e.isPixbuf==`function`&&e.isPixbuf()}function isCanvasImageSource(e){return typeof e!=`object`||!e?!1:typeof e.getContext==`function`}let We=null;function setCanvasPixelBridge(e){We=e}function getCanvasPixelBridge(){if(!We)throw TypeError(`@gjsify/canvas2d-core: no pixel bridge registered — pixel operations (getImageData / putImageData / drawImage / createPattern) need a platform backend. On GJS, import '@gjsify/canvas2d-core/gdk' (or use '@gjsify/dom-elements' / '@gjsify/canvas2d', which register it for you).`);return We}var Ge=class CanvasPattern{constructor(e,n){let r=asCairoPattern(new t.SurfacePattern(e));if(!r)throw TypeError(`CanvasPattern: cairo SurfacePattern is missing setExtend at runtime — incompatible Cairo binding`);switch(this._pattern=r,n){case`repeat`:case``:case null:r.setExtend(t.Extend.REPEAT);break;case`repeat-x`:case`repeat-y`:r.setExtend(t.Extend.REPEAT);break;case`no-repeat`:r.setExtend(t.Extend.NONE);break}}static create(e,n){if(isPixbufImageSource(e)){let r=e._pixbuf,i=r.get_width(),a=r.get_height(),o=new t.ImageSurface(t.Format.ARGB32,i,a),s=new t.Context(o);return getCanvasPixelBridge().setSourceImage(s,r,0,0),s.paint(),s.$dispose(),new CanvasPattern(o,n)}if(isCanvasImageSource(e)){let r=e.getContext(`2d`);if(r&&typeof r._getSurface==`function`){let e=r._getSurface(),i=e.getWidth(),a=e.getHeight(),o=new t.ImageSurface(t.Format.ARGB32,i,a),s=new t.Context(o);return s.setSourceSurface(e,0,0),s.paint(),s.$dispose(),new CanvasPattern(o,n)}}return null}_getCairoPattern(){return this._pattern}},OurImageData=class{constructor(e,t,n){if(this.colorSpace=`srgb`,typeof e==`number`)this.width=e,this.height=t,this.data=new Uint8ClampedArray(this.width*this.height*4);else if(this.data=e,this.width=t,this.height=n??this.data.length/(4*this.width),this.data.length!==this.width*this.height*4)throw RangeError(`Source data length ${this.data.length} is not a multiple of (4 * width=${this.width})`)}};const Ke={translate(e,t){this._ensureSurface(),!(!Number.isFinite(e)||!Number.isFinite(t))&&this._ctx.translate(e,t)},rotate(e){this._ensureSurface(),Number.isFinite(e)&&this._ctx.rotate(e)},scale(e,t){if(this._ensureSurface(),!(!Number.isFinite(e)||!Number.isFinite(t))){if(e===0||t===0){this._state.transformIsSingular=!0;return}this._ctx.scale(e,t)}},transform(e,t,n,r,i,a){if(this._ensureSurface(),!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))return;if(e*r-t*n===0){this._state.transformIsSingular=!0;return}let o=i,s=a,c=Math.hypot(e,t),l=Math.hypot(n,r),u=Math.atan2(t,e);this._ctx.translate(o,s),u!==0&&this._ctx.rotate(u),(c!==1||l!==1)&&this._ctx.scale(c,l)},setTransform(e,t,n,r,i,a){if(this._ensureSurface(),this._state.transformIsSingular=!1,typeof e==`object`&&e){let t=e;this._ctx.identityMatrix(),this.transform(t.a??t.m11??1,t.b??t.m12??0,t.c??t.m21??0,t.d??t.m22??1,t.e??t.m41??0,t.f??t.m42??0)}else typeof e==`number`?(this._ctx.identityMatrix(),this.transform(e,t,n,r,i,a)):this._ctx.identityMatrix()},getTransform(){if(this._state.transformIsSingular){let e=this._ctx.userToDevice(0,0);return makeMatrix(0,0,0,0,e[0]??0,e[1]??0)}let e=this._ctx.userToDevice(0,0),t=this._ctx.userToDevice(1,0),n=this._ctx.userToDevice(0,1),r=e[0]??0,i=e[1]??0;return makeMatrix((t[0]??0)-r,(t[1]??0)-i,(n[0]??0)-r,(n[1]??0)-i,r,i)},resetTransform(){this._ensureSurface(),this._state.transformIsSingular=!1,this._ctx.identityMatrix()}};function makeMatrix(e,t,n,r,i,a){let o=globalThis.DOMMatrix;return typeof o==`function`?new o([e,t,n,r,i,a]):{a:e,b:t,c:n,d:r,e:i,f:a,m11:e,m12:t,m13:0,m14:0,m21:n,m22:r,m23:0,m24:0,m31:0,m32:0,m33:1,m34:0,m41:i,m42:a,m43:0,m44:1,is2D:!0,isIdentity:e===1&&t===0&&n===0&&r===1&&i===0&&a===0}}function installTransformMethods(e){Object.assign(e,Ke)}const qe={beginPath(){this._ensureSurface(),this._ctx.newPath()},moveTo(e,t){this._ensureSurface(),this._ctx.moveTo(e,t)},lineTo(e,t){this._ensureSurface(),this._ctx.lineTo(e,t)},closePath(){this._ensureSurface(),this._ctx.closePath()},bezierCurveTo(e,t,n,r,i,a){this._ensureSurface(),this._ctx.curveTo(e,t,n,r,i,a)},quadraticCurveTo(e,t,n,r){this._ensureSurface();let i,a;this._ctx.hasCurrentPoint()?[i,a]=this._ctx.getCurrentPoint():(i=e,a=t);let{cp1x:o,cp1y:s,cp2x:c,cp2y:l}=quadraticToCubic(i,a,e,t,n,r);this._ctx.curveTo(o,s,c,l,n,r)},arc(e,t,n,r,i,a=!1){if(this._ensureSurface(),Math.abs(i-r)>=2*Math.PI){this._ctx.arc(e,t,n,0,2*Math.PI);return}a?this._ctx.arcNegative(e,t,n,r,i):this._ctx.arc(e,t,n,r,i)},arcTo(e,t,n,r,i){this._ensureSurface();let a,o;this._ctx.hasCurrentPoint()?[a,o]=this._ctx.getCurrentPoint():(a=e,o=t,this._ctx.moveTo(e,t)),cairoArcTo(this._ctx,a,o,e,t,n,r,i)},ellipse(e,t,n,r,i,a,o,s=!1){if(this._ensureSurface(),n<0||r<0)throw RangeError(`The radii provided are negative`);cairoEllipse(this._ctx,e,t,n,r,i,a,o,s)},rect(e,t,n,r){this._ensureSurface(),this._ctx.rectangle(e,t,n,r)},roundRect(e,t,n,r,i=0){this._ensureSurface(),cairoRoundRect(this._ctx,e,t,n,r,i)}};function installPathMethods(e){Object.assign(e,qe)}function getDrawImageSource(e){if(isPixbufImageSource(e)){let t=e._pixbuf;return{pixbuf:t,imgWidth:t.get_width(),imgHeight:t.get_height()}}if(isCanvasImageSource(e)){let t=e.width??0,n=e.height??0;if(!Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0)return null;let r=e.getContext(`2d`);if(r&&typeof r._getSurface==`function`){let e=r._getSurface();e.flush();let i=getCanvasPixelBridge().imageFromSurface(e,0,0,t,n);if(i)return{pixbuf:i,imgWidth:t,imgHeight:n}}}return null}const Je={fill(e,n){if(this._ensureSurface(),this._state.transformIsSingular)return;this._applyCompositing(),this._applyFillStyle();let r;e instanceof Ue?(this._ctx.newPath(),e._replayOnCairo(this._ctx),r=n):r=e,this._ctx.setFillRule(r===`evenodd`?t.FillRule.EVEN_ODD:t.FillRule.WINDING),this._ctx.fillPreserve()},stroke(e){this._ensureSurface(),!this._state.transformIsSingular&&(this._applyCompositing(),this._applyStrokeStyle(),this._applyLineStyle(),e instanceof Ue&&(this._ctx.newPath(),e._replayOnCairo(this._ctx)),this._ctx.strokePreserve())},fillRect(e,t,n,r){if(this._ensureSurface(),this._state.transformIsSingular)return;this._applyCompositing();let i=this._ctx.copyPath();this._hasShadow()&&this._renderShadow(()=>{this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.fill()}),this._applyFillStyle(),this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.fill(),this._ctx.newPath(),this._ctx.appendPath(i)},strokeRect(e,t,n,r){if(this._ensureSurface(),this._state.transformIsSingular)return;this._applyCompositing();let i=this._ctx.copyPath();this._hasShadow()&&this._renderShadow(()=>{this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.stroke()}),this._applyStrokeStyle(),this._applyLineStyle(),this._ctx.newPath(),this._ctx.rectangle(e,t,n,r),this._ctx.stroke(),this._ctx.newPath(),this._ctx.appendPath(i)},clearRect(e,n,r,i){if(this._ensureSurface(),this._state.transformIsSingular)return;let a=this._ctx.copyPath();this._ctx.save(),this._ctx.setOperator(t.Operator.CLEAR),this._ctx.newPath(),this._ctx.rectangle(e,n,r,i),this._ctx.fill(),this._ctx.restore(),this._ctx.newPath(),this._ctx.appendPath(a)},clip(e,n){if(this._ensureSurface(),this._state.transformIsSingular)return;let r;e instanceof Ue?(this._ctx.newPath(),e._replayOnCairo(this._ctx),r=n):r=e,this._ctx.setFillRule(r===`evenodd`?t.FillRule.EVEN_ODD:t.FillRule.WINDING),this._ctx.clip()},isPointInPath(e,n,r,i){this._ensureSurface();let a,o,s;return e instanceof Ue?(this._ctx.newPath(),e._replayOnCairo(this._ctx),a=n,o=r,s=i):(a=e,o=n,s=r),this._ctx.setFillRule(s===`evenodd`?t.FillRule.EVEN_ODD:t.FillRule.WINDING),this._ctx.inFill(a,o)},isPointInStroke(e,t,n){return this._ensureSurface(),this._applyLineStyle(),e instanceof Ue?(this._ctx.newPath(),e._replayOnCairo(this._ctx),this._ctx.inStroke(t,n)):this._ctx.inStroke(e,t)},drawImage(e,n,r,i,a,o,s,c,l){if(this._ensureSurface(),this._state.transformIsSingular)return;this._applyCompositing();let u,d,f,p,m,h,g,_,v=getDrawImageSource(e);if(!v)return;let{pixbuf:y,imgWidth:b,imgHeight:x}=v;if(i===void 0?(u=0,d=0,f=b,p=x,m=n,h=r,g=b,_=x):o===void 0?(u=0,d=0,f=b,p=x,m=n,h=r,g=i,_=a):(u=n,d=r,f=i,p=a,m=o,h=s,g=c,_=l),!Number.isFinite(u)||!Number.isFinite(d)||!Number.isFinite(f)||!Number.isFinite(p)||!Number.isFinite(m)||!Number.isFinite(h)||!Number.isFinite(g)||!Number.isFinite(_)||f===0||p===0||g===0||_===0)return;this._ctx.save(),this._ctx.rectangle(m,h,g,_),this._ctx.clip(),this._ctx.translate(m,h),this._ctx.scale(g/f,_/p),this._ctx.translate(-u,-d),getCanvasPixelBridge().setSourceImage(this._ctx,y,0,0);let S=asCairoPattern(this._ctx.getSource?.());if(S){let e;e=this._state.imageSmoothingEnabled?this._state.imageSmoothingQuality===`high`?t.Filter.BEST:t.Filter.BILINEAR:t.Filter.NEAREST,S.setFilter(e)}this._state.globalAlpha<1?this._ctx.paintWithAlpha(this._state.globalAlpha):this._ctx.paint(),this._ctx.restore()}};function installDrawingMethods$1(e){Object.assign(e,Je)}__name$1(installDrawingMethods$1,`installDrawingMethods`);const Ye={createImageData(e,t){return typeof e==`number`?new OurImageData(Math.abs(e),Math.abs(t)):new OurImageData(e.width,e.height)},getImageData(e,t,n,r){this._ensureSurface(),this._surface.flush();let i=getCanvasPixelBridge().imageFromSurface(this._surface,e,t,n,r);if(!i)return new OurImageData(n,r);let a=i.get_pixels(),o=i.get_has_alpha(),s=i.get_rowstride(),c=i.get_n_channels(),l=new Uint8ClampedArray(n*r*4);for(let e=0;e<r;e++)for(let t=0;t<n;t++){let r=e*s+t*c,i=(e*n+t)*4;l[i]=a[r],l[i+1]=a[r+1],l[i+2]=a[r+2],l[i+3]=o?a[r+3]:255}return new OurImageData(l,n,r)},putImageData(e,n,r,i,a,o,s){this._ensureSurface();let c=i??0,l=a??0,u=o??e.width,d=s??e.height,f=e.data,p=e.width,m=new Uint8Array(u*d*4);for(let e=0;e<d;e++)for(let t=0;t<u;t++){let n=((l+e)*p+(c+t))*4,r=(e*u+t)*4;m[r]=f[n],m[r+1]=f[n+1],m[r+2]=f[n+2],m[r+3]=f[n+3]}this._ctx.save(),this._ctx.setOperator(t.Operator.SOURCE),getCanvasPixelBridge().setSourcePixels(this._ctx,m,u,d,n+c,r+l),this._ctx.rectangle(n+c,r+l,u,d),this._ctx.fill(),this._ctx.restore()}};function installPixelMethods(e){Object.assign(e,Ye)}const Xe=e(import.meta.url);let Ze;function load$11(){return Ze===void 0&&(Ze=Xe(`@gjsify/node-gi/gi`).requireGi(`Pango`,`1.0`)),Ze}__name$1(load$11,`load`);var Qe=new Proxy(Object.create(null),{get(e,t){return load$11()[t]},has(e,t){return t in load$11()}});const $e=e(import.meta.url);let et;function load$10(){return et===void 0&&(et=$e(`@gjsify/node-gi/gi`).requireGi(`PangoCairo`,`1.0`)),et}__name$1(load$10,`load`);var tt=new Proxy(Object.create(null),{get(e,t){return load$10()[t]},has(e,t){return t in load$10()}});function parseFontToDescription(e){let t=e.match(/^\s*(italic|oblique|normal)?\s*(small-caps|normal)?\s*(bold|bolder|lighter|[1-9]00|normal)?\s*(\d+(?:\.\d+)?)(px|pt|em|rem|%)?\s*(?:\/\S+)?\s*(.+)?$/i);if(!t)return Qe.font_description_from_string(e);let n=t[1]||``,r=t[3]||``,i=parseFloat(t[4])||10,a=(t[5]||`px`).toLowerCase(),o=(t[6]||`sans-serif`).replace(/['"]/g,``).trim();a===`pt`?i=i*96/72:a===`em`||a===`rem`?i*=16:a===`%`&&(i=i/100*16);let s=o;n===`italic`?s+=` Italic`:n===`oblique`&&(s+=` Oblique`),r===`bold`||r===`bolder`||parseInt(r)>=600?s+=` Bold`:(r===`lighter`||parseInt(r)>0&&parseInt(r)<=300)&&(s+=` Light`);let c=Qe.font_description_from_string(s);return c.set_absolute_size(i*Qe.SCALE),c}function createTextLayout(e,t){let n=tt.create_layout(e._ctx);n.set_text(t,-1),n.get_context().set_base_dir(Qe.Direction.LTR),n.context_changed();let r=parseFontToDescription(e._state.font);return n.set_font_description(r),n}function getTextAlignOffset(e,t){let[,n]=t.get_pixel_extents(),r=n.width;switch(e._state.textAlign){case`center`:return-r/2;case`right`:case`end`:return-r;default:return 0}}function getTextBaselineOffset(e,t){let n=t.get_font_description()||parseFontToDescription(e._state.font),r=t.get_context().get_metrics(n,null),i=r.get_ascent()/Qe.SCALE,a=r.get_descent()/Qe.SCALE,o=i+a;switch(e._state.textBaseline){case`top`:return 0;case`hanging`:return-(i*.2);case`middle`:return-(o/2);case`alphabetic`:return-i;case`ideographic`:return-(i+a*.5);case`bottom`:return-o;default:return-i}}const nt={fillText(e,n,r,i){if(this._ensureSurface(),this._state.transformIsSingular)return;this._applyCompositing();let a=createTextLayout(this,e),o=getTextAlignOffset(this,a),s=getTextBaselineOffset(this,a);if(this._hasShadow()){let e=parseColor(this._state.shadowColor);if(e){let[i,c]=this._deviceToUserDistance(this._state.shadowOffsetX,this._state.shadowOffsetY),l=this._state.shadowBlur,u;if(l>0){let[t]=this._deviceToUserDistance(l,0),[,n]=this._deviceToUserDistance(0,l);u=[[i,c,e.a],[i+t,c,e.a*.5],[i-t,c,e.a*.5],[i,c+n,e.a*.5],[i,c-n,e.a*.5]]}else u=[[i,c,e.a]];let d=this._state.imageSmoothingEnabled?t.Antialias.DEFAULT:t.Antialias.NONE;for(let[t,i,c]of u)this._ctx.save(),this._ctx.setAntialias(d),this._ctx.setSourceRGBA(e.r,e.g,e.b,c),this._ctx.moveTo(n+o+t,r+s+i),tt.show_layout(this._ctx,a),this._ctx.restore()}}this._applyFillStyle(),this._ctx.save(),this._ctx.setAntialias(this._state.imageSmoothingEnabled?t.Antialias.DEFAULT:t.Antialias.NONE),this._ctx.moveTo(n+o,r+s),tt.show_layout(this._ctx,a),this._ctx.restore()},strokeText(e,n,r,i){if(this._ensureSurface(),this._state.transformIsSingular)return;this._applyCompositing(),this._applyStrokeStyle(),this._applyLineStyle();let a=createTextLayout(this,e),o=getTextAlignOffset(this,a),s=getTextBaselineOffset(this,a);this._ctx.save(),this._ctx.setAntialias(this._state.imageSmoothingEnabled?t.Antialias.DEFAULT:t.Antialias.NONE),this._ctx.moveTo(n+o,r+s),tt.layout_path(this._ctx,a),this._ctx.stroke(),this._ctx.restore()},measureText(e){this._ensureSurface();let t=createTextLayout(this,e),[n,r]=t.get_pixel_extents(),i=t.get_baseline()/Qe.SCALE,a=Math.max(0,i-n.y),o=Math.max(0,n.y+n.height-i),s=t.get_font_description()||parseFontToDescription(this._state.font),c=t.get_context().get_metrics(s,null),l=c.get_ascent()/Qe.SCALE,u=c.get_descent()/Qe.SCALE;return{width:r.width,actualBoundingBoxAscent:a,actualBoundingBoxDescent:o,actualBoundingBoxLeft:Math.max(0,-n.x),actualBoundingBoxRight:n.x+n.width,fontBoundingBoxAscent:l,fontBoundingBoxDescent:u,alphabeticBaseline:0,emHeightAscent:l,emHeightDescent:u,hangingBaseline:l*.8,ideographicBaseline:-u}}};function installTextMethods(e){Object.assign(e,nt)}const rt={createLinearGradient(e,t,n,r){return new CanvasGradient(`linear`,e,t,n,r)},createRadialGradient(e,t,n,r,i,a){return new CanvasGradient(`radial`,e,t,r,i,n,a)},createPattern(e,t){return Ge.create(e,t)}};function installFactoryMethods(e){Object.assign(e,rt)}function installAllContextMethods$1(e){installTransformMethods(e),installPathMethods(e),installDrawingMethods$1(e),installPixelMethods(e),installTextMethods(e),installFactoryMethods(e)}__name$1(installAllContextMethods$1,`installAllContextMethods`);function createDefaultState(){return{fillStyle:`#000000`,fillColor:{...ze},strokeStyle:`#000000`,strokeColor:{...ze},lineWidth:1,lineCap:`butt`,lineJoin:`miter`,miterLimit:10,lineDash:[],lineDashOffset:0,globalAlpha:1,globalCompositeOperation:`source-over`,shadowColor:`rgba(0, 0, 0, 0)`,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,font:`10px sans-serif`,textAlign:`start`,textBaseline:`alphabetic`,direction:`ltr`,imageSmoothingEnabled:!0,imageSmoothingQuality:`low`,transformIsSingular:!1}}function cloneState(e){return{...e,fillColor:{...e.fillColor},strokeColor:{...e.strokeColor},lineDash:[...e.lineDash]}}const it=e(import.meta.url);let at;function load$9(){return at===void 0&&(at=it(`@gjsify/node-gi/gi`).requireGi(`Gio`,`2.0`)),at}__name$1(load$9,`load`);var z=new Proxy(Object.create(null),{get(e,t){return load$9()[t]},has(e,t){return t in load$9()}});const ot=e(import.meta.url);let st;function load$8(){return st===void 0&&(st=ot(`@gjsify/node-gi/gi`).requireGi(`GLib`,`2.0`)),st}__name$1(load$8,`load`);var B=new Proxy(Object.create(null),{get(e,t){return load$8()[t]},has(e,t){return t in load$8()}}),CanvasRenderingContext2D=class{constructor(e,n){this._stateStack=[],this.canvas=e,this._surfaceWidth=e.width||300,this._surfaceHeight=e.height||150,this._surface=new t.ImageSurface(t.Format.ARGB32,this._surfaceWidth,this._surfaceHeight),this._ctx=new t.Context(this._surface),this._state=createDefaultState()}_ensureSurface(){let e=this.canvas.width||300,n=this.canvas.height||150;(e!==this._surfaceWidth||n!==this._surfaceHeight)&&(this._ctx.$dispose(),this._surface.finish(),this._surfaceWidth=e,this._surfaceHeight=n,this._surface=new t.ImageSurface(t.Format.ARGB32,e,n),this._ctx=new t.Context(this._surface),this._stateStack=[])}_resetState(){this._state=createDefaultState(),this._stateStack=[]}_applyFillStyle(){let e=this._state.fillStyle;if(typeof e==`string`){let e=this._state.fillColor,t=e.a*this._state.globalAlpha;this._ctx.setSourceRGBA(e.r,e.g,e.b,t)}else e instanceof CanvasGradient?this._ctx.setSource(e._getCairoPattern()):e instanceof Ge&&(this._ctx.setSource(e._getCairoPattern()),this._applyPatternFilter())}_applyStrokeStyle(){let e=this._state.strokeStyle;if(typeof e==`string`){let e=this._state.strokeColor,t=e.a*this._state.globalAlpha;this._ctx.setSourceRGBA(e.r,e.g,e.b,t)}else e instanceof CanvasGradient?this._ctx.setSource(e._getCairoPattern()):e instanceof Ge&&(this._ctx.setSource(e._getCairoPattern()),this._applyPatternFilter())}_applyPatternFilter(){let e=asCairoPattern(this._ctx.getSource?.());if(!e)return;let n;n=this._state.imageSmoothingEnabled?this._state.imageSmoothingQuality===`high`?t.Filter.BEST:t.Filter.BILINEAR:t.Filter.NEAREST,e.setFilter(n)}_applyLineStyle(){this._ctx.setLineWidth(this._state.lineWidth),this._ctx.setLineCap(Ve[this._state.lineCap]),this._ctx.setLineJoin(He[this._state.lineJoin]),this._ctx.setMiterLimit(this._state.miterLimit),this._ctx.setDash(this._state.lineDash,this._state.lineDashOffset)}_applyCompositing(){let e=Be[this._state.globalCompositeOperation];e!==void 0&&this._ctx.setOperator(e)}_getSurface(){return this._surface}_hasShadow(){if(this._state.shadowBlur===0&&this._state.shadowOffsetX===0&&this._state.shadowOffsetY===0)return!1;let e=parseColor(this._state.shadowColor);return e!==null&&e.a>0}_deviceToUserDistance(e,t){let n=this._ctx.userToDevice(0,0),r=this._ctx.userToDevice(1,0),i=this._ctx.userToDevice(0,1),a=(r[0]??0)-(n[0]??0),o=(r[1]??0)-(n[1]??0),s=(i[0]??0)-(n[0]??0),c=(i[1]??0)-(n[1]??0),l=a*c-o*s;return Math.abs(l)<1e-10?[e,t]:[(c*e-s*t)/l,(-o*e+a*t)/l]}_renderShadow(e){}save(){this._ensureSurface(),this._stateStack.push(cloneState(this._state)),this._ctx.save()}restore(){this._ensureSurface();let e=this._stateStack.pop();e&&(this._state=e,this._ctx.restore())}get fillStyle(){return this._state.fillStyle}set fillStyle(e){if(typeof e==`string`){let t=parseColor(e);t&&(this._state.fillStyle=e,this._state.fillColor=t)}else this._state.fillStyle=e}get strokeStyle(){return this._state.strokeStyle}set strokeStyle(e){if(typeof e==`string`){let t=parseColor(e);t&&(this._state.strokeStyle=e,this._state.strokeColor=t)}else this._state.strokeStyle=e}get lineWidth(){return this._state.lineWidth}set lineWidth(e){e>0&&isFinite(e)&&(this._state.lineWidth=e)}get lineCap(){return this._state.lineCap}set lineCap(e){(e===`butt`||e===`round`||e===`square`)&&(this._state.lineCap=e)}get lineJoin(){return this._state.lineJoin}set lineJoin(e){(e===`miter`||e===`round`||e===`bevel`)&&(this._state.lineJoin=e)}get miterLimit(){return this._state.miterLimit}set miterLimit(e){e>0&&isFinite(e)&&(this._state.miterLimit=e)}get globalAlpha(){return this._state.globalAlpha}set globalAlpha(e){e>=0&&e<=1&&isFinite(e)&&(this._state.globalAlpha=e)}get globalCompositeOperation(){return this._state.globalCompositeOperation}set globalCompositeOperation(e){Be[e]!==void 0&&(this._state.globalCompositeOperation=e)}get imageSmoothingEnabled(){return this._state.imageSmoothingEnabled}set imageSmoothingEnabled(e){this._state.imageSmoothingEnabled=!!e}get imageSmoothingQuality(){return this._state.imageSmoothingQuality}set imageSmoothingQuality(e){(e===`low`||e===`medium`||e===`high`)&&(this._state.imageSmoothingQuality=e)}setLineDash(e){e.some(e=>e<0||!isFinite(e))||(this._state.lineDash=[...e])}getLineDash(){return[...this._state.lineDash]}get lineDashOffset(){return this._state.lineDashOffset}set lineDashOffset(e){isFinite(e)&&(this._state.lineDashOffset=e)}get shadowColor(){return this._state.shadowColor}set shadowColor(e){this._state.shadowColor=e}get shadowBlur(){return this._state.shadowBlur}set shadowBlur(e){e>=0&&isFinite(e)&&(this._state.shadowBlur=e)}get shadowOffsetX(){return this._state.shadowOffsetX}set shadowOffsetX(e){isFinite(e)&&(this._state.shadowOffsetX=e)}get shadowOffsetY(){return this._state.shadowOffsetY}set shadowOffsetY(e){isFinite(e)&&(this._state.shadowOffsetY=e)}get font(){return this._state.font}set font(e){this._state.font=e}get textAlign(){return this._state.textAlign}set textAlign(e){this._state.textAlign=e}get textBaseline(){return this._state.textBaseline}set textBaseline(e){this._state.textBaseline=e}get direction(){return this._state.direction}set direction(e){this._state.direction=e}_toDataURL(e,t){this._surface.flush();let[,n]=B.file_open_tmp(`canvas-XXXXXX.png`);try{this._surface.writeToPNG(n);let[,e]=z.File.new_for_path(n).load_contents(null);return`data:image/png;base64,${B.base64_encode(e)}`}finally{B.unlink(n)}}_dispose(){this._ctx.$dispose(),this._surface.finish()}};installAllContextMethods$1(CanvasRenderingContext2D.prototype);const ct=e(import.meta.url);let lt;function load$7(){return lt===void 0&&(lt=ct(`@gjsify/node-gi/gi`).requireGi(`Gdk`,`4.0`)),lt}__name$1(load$7,`load`);var V=new Proxy(Object.create(null),{get(e,t){return load$7()[t]},has(e,t){return t in load$7()}});const ut=e(import.meta.url);let dt;function load$6(){return dt===void 0&&(dt=ut(`@gjsify/node-gi/gi`).requireGi(`GdkPixbuf`,`2.0`)),dt}__name$1(load$6,`load`);var ft=new Proxy(Object.create(null),{get(e,t){return load$6()[t]},has(e,t){return t in load$6()}});setCanvasPixelBridge({imageFromSurface(e,t,n,r,i){return V.pixbuf_get_from_surface(e,t,n,r,i)},setSourceImage(e,t,n,r){V.cairo_set_source_pixbuf(e,t,n,r)},setSourcePixels(e,t,n,r,i,a){let o=ft.Pixbuf.new_from_bytes(t,ft.Colorspace.RGB,!0,8,n,r,n*4);V.cairo_set_source_pixbuf(e,o,i,a)}}),defineGlobal(`HTMLCanvasElement`,Fe),defineGlobal(`CanvasRenderingContext2D`,CanvasRenderingContext2D),defineGlobal(`DOMMatrix`,Ie),defineGlobal(`DOMMatrixReadOnly`,Le);const pt=Symbol.for(`gjsify_canvas2d_context`);Fe.registerContextFactory(`2d`,(e,t)=>{let n=e,r=n[pt];if(r)return r;let i=new CanvasRenderingContext2D(e,t);return n[pt]=i,i});var CharacterData=class extends ye{constructor(e=``){super(),this[y]=M.TEXT_NODE,this._data=e}get data(){return this._data}set data(e){this._data=e}get textContent(){return this._data}set textContent(e){this._data=e}get nodeValue(){return this._data}set nodeValue(e){this._data=e}get length(){return this._data.length}appendData(e){this._data+=e}deleteData(e,t){this._data=this._data.substring(0,e)+this._data.substring(e+t)}insertData(e,t){this._data=this._data.substring(0,e)+t+this._data.substring(e)}replaceData(e,t,n){this._data=this._data.substring(0,e)+n+this._data.substring(e+t)}substringData(e,t){return this._data.substring(e,e+t)}cloneNode(e=!1){return new this.constructor(this._data)}get[Symbol.toStringTag](){return`CharacterData`}},mt=class Comment extends CharacterData{constructor(e=``){super(e),this[y]=M.COMMENT_NODE}get nodeName(){return`#comment`}cloneNode(e=!1){return new Comment(this.data)}get[Symbol.toStringTag](){return`Comment`}},ht=class Text extends CharacterData{constructor(e=``){super(e),this[y]=M.TEXT_NODE}get nodeName(){return`#text`}get wholeText(){let e=this.data,t=this.previousSibling;for(;t&&t instanceof Text;)e=t.data+e,t=t.previousSibling;let n=this.nextSibling;for(;n&&n instanceof Text;)e+=n.data,n=n.nextSibling;return e}splitText(e){let t=this.data.substring(e);this.data=this.data.substring(0,e);let n=new Text(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}cloneNode(e=!1){return new Text(this.data)}get[Symbol.toStringTag](){return`Text`}},gt=class DocumentFragment extends ye{constructor(){super(),this[y]=M.DOCUMENT_FRAGMENT_NODE}get nodeName(){return`#document-fragment`}get children(){return this[S]}get childElementCount(){return this[S].length}get firstElementChild(){return this[S][0]??null}get lastElementChild(){let e=this[S];return e[e.length-1]??null}get textContent(){let e=``;for(let t of this.childNodes)t.textContent!==null&&(e+=t.textContent);return e}set textContent(e){for(;this.firstChild;)this.removeChild(this.firstChild);e&&this.appendChild(new ht(e))}append(...e){for(let t of e)typeof t==`string`?this.appendChild(new ht(t)):this.appendChild(t)}prepend(...e){let t=this.firstChild;for(let n of e)typeof n==`string`?this.insertBefore(new ht(n),t):this.insertBefore(n,t)}replaceChildren(...e){for(;this.firstChild;)this.removeChild(this.firstChild);this.append(...e)}getElementById(e){for(let t of this.children){if(t.id===e)return t;let n=this._findById(t,e);if(n)return n}return null}_findById(e,t){for(let n of e.children){if(n.id===t)return n;let e=this._findById(n,t);if(e)return e}return null}cloneNode(e=!1){let t=new DocumentFragment;if(e)for(let e of this.childNodes)t.appendChild(e.cloneNode(!0));return t}get[Symbol.toStringTag](){return`DocumentFragment`}},HTMLImageElement$1=class extends HTMLElement{static{__name$1(this,`HTMLImageElement`)}constructor(){super(),this._complete=!1,this._naturalHeight=0,this._naturalWidth=0,this[w]=`IMG`,this[T]=`img`,this[E]=xe.html}get complete(){return this._complete}get naturalHeight(){return this._naturalHeight}get naturalWidth(){return this._naturalWidth}get currentSrc(){return this.src}get x(){return 0}get y(){return 0}get alt(){return this.getAttribute(`alt`)??``}set alt(e){this.setAttribute(`alt`,e)}get crossOrigin(){return this.getAttribute(`crossorigin`)}set crossOrigin(e){e===null?this.removeAttribute(`crossorigin`):this.setAttribute(`crossorigin`,e)}get decoding(){return this.getAttribute(`decoding`)??`auto`}set decoding(e){this.setAttribute(`decoding`,e)}get loading(){let e=this.getAttribute(`loading`);return e===`lazy`||e===`eager`?e:`auto`}set loading(e){this.setAttribute(`loading`,e)}get referrerPolicy(){return this.getAttribute(`referrerpolicy`)??``}set referrerPolicy(e){this.setAttribute(`referrerpolicy`,e)}get sizes(){return this.getAttribute(`sizes`)??``}set sizes(e){this.setAttribute(`sizes`,e)}get src(){return this.getAttribute(`src`)??``}set src(e){this.setAttribute(`src`,e);let t=globalThis.__GJSIFY_DEBUG_IMG===!0;if(e.startsWith(`data:`)){let n=e.indexOf(`,`);if(n===-1){this._complete=!0,this.dispatchEvent(new Event(`error`));return}let r=e.slice(5,n),i=e.slice(n+1),a=r.includes(`;base64`);try{let e;e=a?B.base64_decode(i):new TextEncoder().encode(decodeURIComponent(i));let n=B.Bytes.new(e),r=z.MemoryInputStream.new_from_bytes(n);this._pixbuf=ft.Pixbuf.new_from_stream(r,null),this._naturalWidth=this._pixbuf.get_width(),this._naturalHeight=this._pixbuf.get_height(),this._complete=!0,t&&console.log(`[img] ok data: (${this._naturalWidth}x${this._naturalHeight})`),this.dispatchEvent(new Event(`load`))}catch(e){t&&console.warn(`[img] error data:: ${e instanceof Error?e.message:String(e)}`),this._complete=!0,this.dispatchEvent(new Event(`error`))}return}let r;if(e.startsWith(`file://`))r=B.filename_from_uri(e)[0];else if(e.startsWith(`http://`)||e.startsWith(`https://`)){this._complete=!0,this.dispatchEvent(new Event(`error`));return}else{let t=B.path_get_dirname(n.programInvocationName);r=B.build_filenamev([t,e])}try{t&&console.log(`[img] load ${r}`),this._pixbuf=ft.Pixbuf.new_from_file(r),this._naturalWidth=this._pixbuf.get_width(),this._naturalHeight=this._pixbuf.get_height(),this._complete=!0,t&&console.log(`[img] ok ${r} (${this._naturalWidth}x${this._naturalHeight})`),this.dispatchEvent(new Event(`load`))}catch(e){t&&console.warn(`[img] error ${r}: ${e instanceof Error?e.message:String(e)}`),this._complete=!0,this.dispatchEvent(new Event(`error`))}}get srcset(){return this.getAttribute(`srcset`)??``}set srcset(e){this.setAttribute(`srcset`,e)}get useMap(){return this.getAttribute(`usemap`)??``}set useMap(e){this.setAttribute(`usemap`,e)}get height(){if(this._pixbuf)return this._pixbuf.get_height();let e=this.getAttribute(`height`);return e===null?0:Number(e)}set height(e){this.setAttribute(`height`,String(e))}get width(){if(this._pixbuf)return this._pixbuf.get_width();let e=this.getAttribute(`width`);return e===null?0:Number(e)}set width(e){this.setAttribute(`width`,String(e))}get isMap(){return this.hasAttribute(`ismap`)}set isMap(e){e?this.setAttribute(`ismap`,``):this.removeAttribute(`ismap`)}decode(){return Promise.resolve()}cloneNode(e=!1){return super.cloneNode(e)}getImageData(){if(!this._pixbuf)return null;let e=this._pixbuf.get_has_alpha()?this._pixbuf:this._pixbuf.add_alpha(!1,0,0,0)??this._pixbuf;return{colorSpace:`srgb`,data:new Uint8ClampedArray(e.get_pixels()),height:e.get_height(),width:e.get_width()}}isPixbuf(){return!!this._pixbuf}get[Symbol.toStringTag](){return`HTMLImageElement`}},HTMLMediaElement=class extends HTMLElement{constructor(...e){super(...e),this._src=``,this._srcObject=null,this.currentTime=0,this.duration=NaN,this.paused=!0,this.ended=!1,this.volume=1,this.muted=!1,this.defaultMuted=!1,this.loop=!1,this.autoplay=!1,this.preload=``,this.playbackRate=1,this.defaultPlaybackRate=1,this.readyState=0,this.networkState=0}get buffered(){return{length:0,start:()=>0,end:()=>0}}get seekable(){return{length:0,start:()=>0,end:()=>0}}get played(){return{length:0,start:()=>0,end:()=>0}}get src(){return this._src}set src(e){this._src=e,this._srcObject=null,this.dispatchEvent(new Event(`srcchange`))}get srcObject(){return this._srcObject}set srcObject(e){this._srcObject=e,this._src=``,this.dispatchEvent(new Event(`srcobjectchange`))}play(){return this.paused=!1,this.ended=!1,this.dispatchEvent(new Event(`play`)),Promise.resolve()}pause(){this.paused=!0,this.dispatchEvent(new Event(`pause`))}load(){this.readyState=0,this.networkState=2,this.dispatchEvent(new Event(`loadstart`))}canPlayType(e){return``}static{this.HAVE_NOTHING=0}static{this.HAVE_METADATA=1}static{this.HAVE_CURRENT_DATA=2}static{this.HAVE_FUTURE_DATA=3}static{this.HAVE_ENOUGH_DATA=4}static{this.NETWORK_EMPTY=0}static{this.NETWORK_IDLE=1}static{this.NETWORK_LOADING=2}static{this.NETWORK_NO_SOURCE=3}get[Symbol.toStringTag](){return`HTMLMediaElement`}};const _t=1e9;function secondsToGstTime(e){return BigInt(Math.round(e*_t))}function gstTimeToSeconds(e){return Number(e)/_t}var HTMLVideoElement$1=class extends HTMLMediaElement{static{__name$1(this,`HTMLVideoElement`)}constructor(){super(),this._pipeline=null,this._videoWidth=0,this._videoHeight=0,this.poster=``,this[w]=`VIDEO`,this[T]=`video`,this[E]=xe.html;let e=this;Object.defineProperty(this,"paused",{get(){if(!e._pipeline)return!0;let[,t]=e._pipeline.get_state(0n);return t!==4},configurable:!0,enumerable:!0}),Object.defineProperty(this,"currentTime",{get(){if(!e._pipeline)return 0;let[t,n]=e._pipeline.query_position(3);return t?gstTimeToSeconds(n):0},set(t){e._pipeline?.seek(1,3,5,1,secondsToGstTime(t),0,-1n)},configurable:!0,enumerable:!0}),Object.defineProperty(this,"duration",{get(){if(!e._pipeline)return NaN;let[t,n]=e._pipeline.query_duration(3);return t&&Number(n)>0?gstTimeToSeconds(n):NaN},configurable:!0,enumerable:!0}),Object.defineProperty(this,"volume",{get(){return e._playbin()?.volume??1},set(t){let n=e._playbin();n&&(n.volume=Math.max(0,Math.min(1,t)))},configurable:!0,enumerable:!0}),Object.defineProperty(this,"muted",{get(){return e._playbin()?.mute??!1},set(t){let n=e._playbin();n&&(n.mute=t)},configurable:!0,enumerable:!0})}async play(){this._pipeline?.set_state(4),this.dispatchEvent(new Event(`play`)),this.dispatchEvent(new Event(`playing`))}pause(){this._pipeline?.set_state(3),this.dispatchEvent(new Event(`pause`))}get videoWidth(){return this._videoWidth}set videoWidth(e){this._videoWidth=e}get videoHeight(){return this._videoHeight}set videoHeight(e){this._videoHeight=e}get[Symbol.toStringTag](){return`HTMLVideoElement`}_playbin(){return this._pipeline?.get_by_name(`playbin`)??null}};const vt=new class Document extends ye{static{this._elementFactories=new Map}constructor(){super(),this.body=new HTMLElement,this.head=new HTMLElement,this.documentElement=new HTMLElement,this.appendChild(this.documentElement),this.documentElement.appendChild(this.body)}static registerElementFactory(e,t){Document._elementFactories.set(e.toLowerCase(),t)}createElementNS(e,t){let n=t.toLowerCase(),r=(()=>{switch(n){case`img`:return new HTMLImageElement$1;case`video`:return new HTMLVideoElement$1;case`canvas`:return new Fe;default:{let e=Document._elementFactories.get(n);return e?e():new HTMLElement}}})();return r[T]=n,r[w]=n.toUpperCase(),r[E]=e??xe.html,r}createElement(e){return this.createElementNS(`http://www.w3.org/1999/xhtml`,e)}createTextNode(e){return new ht(e)}createComment(e){return new mt(e)}createDocumentFragment(){return new gt}createEvent(e){return new Event(e)}getElementById(e){return this._findById(this.body,e)}_findById(e,t){if(e.id===t)return e;for(let n of e.children){let e=this._findById(n,t);if(e)return e}return null}get[Symbol.toStringTag](){return`Document`}};var DOMTokenList=class{constructor(e,t){this._ownerElement=e,this._attributeName=t}_getTokens(){let e=this._ownerElement.getAttribute(this._attributeName);return e?e.split(/\s+/).filter(e=>e.length>0):[]}_setTokens(e){let t=e.join(` `);t?this._ownerElement.setAttribute(this._attributeName,t):this._ownerElement.removeAttribute(this._attributeName)}get length(){return this._getTokens().length}get value(){return this._ownerElement.getAttribute(this._attributeName)??``}set value(e){e?this._ownerElement.setAttribute(this._attributeName,e):this._ownerElement.removeAttribute(this._attributeName)}item(e){let t=this._getTokens();return e>=0&&e<t.length?t[e]:null}contains(e){return this._getTokens().includes(e)}add(...e){let t=this._getTokens();for(let n of e)n&&!t.includes(n)&&t.push(n);this._setTokens(t)}remove(...e){let t=this._getTokens().filter(t=>!e.includes(t));this._setTokens(t)}toggle(e,t){let n=this.contains(e);return t===void 0?n?(this.remove(e),!1):(this.add(e),!0):t?(this.add(e),!0):(this.remove(e),!1)}replace(e,t){let n=this._getTokens(),r=n.indexOf(e);return r===-1?!1:(n[r]=t,this._setTokens(n),!0)}supports(e){return!0}forEach(e){let t=this._getTokens();for(let n=0;n<t.length;n++)e(t[n],n,this)}keys(){return this._getTokens().keys()}values(){return this._getTokens().values()}entries(){return this._getTokens().entries()}[Symbol.iterator](){return this._getTokens().values()}toString(){return this.value}get[Symbol.toStringTag](){return`DOMTokenList`}};function installWindowEventBus(e){if(e.__gjsify_globalEventTarget)return e.__gjsify_globalEventTarget;let t=new EventTarget,n=typeof e.addEventListener==`function`?e.addEventListener.bind(e):null,r=typeof e.removeEventListener==`function`?e.removeEventListener.bind(e):null;e.__gjsify_globalEventTarget=t;let define=(t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0});return define(`addEventListener`,(e,r,i)=>{t.addEventListener(e,r,i),n?.(e,r,i)}),define(`removeEventListener`,(e,n,i)=>{t.removeEventListener(e,n,i),r?.(e,n,i)}),define(`dispatchEvent`,e=>t.dispatchEvent(e)),t}installWindowEventBus(globalThis),defineGlobal(`Text`,ht),defineGlobal(`Comment`,mt),defineGlobal(`DocumentFragment`,gt),defineGlobal(`DOMTokenList`,DOMTokenList),defineGlobal(`document`,vt),defineGlobalIfMissing(`self`,globalThis);var Window=class{static[Symbol.hasInstance](e){return e===globalThis}};defineGlobalIfMissing(`Window`,Window),defineGlobalIfMissing(`window`,globalThis),defineGlobalIfMissing(`focus`,()=>{}),defineGlobalIfMissing(`blur`,()=>{}),defineGlobalIfMissing(`devicePixelRatio`,1),defineGlobalIfMissing(`scrollX`,0),defineGlobalIfMissing(`scrollY`,0),defineGlobalIfMissing(`pageXOffset`,0),defineGlobalIfMissing(`pageYOffset`,0),defineGlobalIfMissing(`alert`,(...e)=>console.error(`alert:`,...e)),globalThis.top===void 0&&Object.defineProperty(globalThis,"top",{get:()=>globalThis,configurable:!0});function fontMapNamespace(){let e=tt.FontMap;if(e!=null&&typeof e.get_default==`function`&&typeof e.new_for_font_type==`function`)return e}function isUnsupportedByFontMap(e){let t=B.Error,n=z.io_error_quark,r=z.IOErrorEnum?.NOT_SUPPORTED;return typeof t!=`function`||typeof n!=`function`||r===void 0||!(e instanceof t)?!1:e.matches(n(),r)}function fontErrorMessage(e){let t=B.Error;return typeof t==`function`&&e instanceof t?e.message??String(e):e instanceof Error?e.message:String(e)}function fontMapFamilies(e){return e.list_families().map(e=>e.get_name())}function fontMapHasFamily(e,t){return e.get_family(t)!==null}function layoutSize(e,t){let n=new Qe.FontDescription;n.set_family(t),n.set_size(40*Qe.SCALE);let r=Qe.Layout.new(e.create_context());return r.set_font_description(n),r.set_text(`Wg`,-1),r.get_pixel_size().join(`x`)}function fontMapServesFamily(e,t,n=layoutSize){return n(e,t)!==n(e,`ZzzGjsifySubstitutionControlQx`)}const yt={map:null,before:[],failed:new Map,adopted:!1};function probeFontconfigMap(e,t,n,r=[]){if(n.length===0||B.getenv(`PANGOCAIRO_BACKEND`)!==null)return yt;let i=e.new_for_font_type(1);if(i==null)return yt;let a=fontMapFamilies(i);if(a.length===0)return yt;let o=new Map;for(let e of n)try{i.add_font_file(e)}catch(t){o.set(e,fontErrorMessage(t))}let s=fontMapFamilies(i).filter(e=>!a.includes(e));if(s.length===0)return{map:i,before:a,failed:o,adopted:!1};let alreadyReached=e=>!r.includes(e)&&t.get_family(e)!==null;if(s.every(alreadyReached))return{map:i,before:a,failed:o,adopted:!1};let c=i.set_default;return typeof c==`function`?(c.call(i),{map:i,before:a,failed:o,adopted:!0}):{map:i,before:a,failed:o,adopted:!1}}function noRegistration(){return{available:!1,map:void 0,before:[],registered:[],declined:[],unreachable:[],failed:[],fontconfigFallback:!1}}function registerFontFaces(e,t){let n=fontMapNamespace();if(n===void 0)return noRegistration();let r=t??n.get_default();if(e.length===0)return{...noRegistration(),available:!0,map:r,before:fontMapFamilies(r)};let i=fontMapFamilies(r),a=[],o=[],s=[],c=[];for(let t of e)try{r.add_font_file(t),a.push(t)}catch(e){if(isUnsupportedByFontMap(e)){o.push(t);continue}c.push({path:t,message:fontErrorMessage(e)})}let l=[];a.length>0&&(l=fontMapFamilies(r).filter(e=>!i.includes(e)).filter(e=>!fontMapServesFamily(r,e)),l.length>0&&s.push(...a));let u=[...o,...s];if(u.length>0){let e=probeFontconfigMap(n,r,u,l),t=[];for(let n of o){let r=e.failed.get(n);r===void 0?e.adopted?a.push(n):t.push(n):c.push({path:n,message:r})}if(o.length=0,o.push(...t),e.adopted)s.length=0;else{let t=s.filter(t=>!e.failed.has(t));for(let t of s){let n=e.failed.get(t);n!==void 0&&c.push({path:t,message:n})}s.length=0,s.push(...t)}if(e.adopted&&e.map!==null)return{available:!0,map:e.map,before:e.before,registered:a,declined:o,unreachable:s,failed:c,fontconfigFallback:!0}}return{available:!0,map:r,before:i,registered:a,declined:o,unreachable:s,failed:c,fontconfigFallback:!1}}var FontFace=class{constructor(e,t,n){this.status=`unloaded`,this.display=`auto`,this.style=`normal`,this.weight=`normal`,this.stretch=`normal`,this.unicodeRange=`U+0-10FFFF`,this.variant=`normal`,this.featureSettings=`normal`,this.family=e,this.source=typeof t==`string`?t:`[binary]`,this.loaded=Promise.resolve(this)}_extractFilePath(){let e=this.source.match(/url\s*\(\s*["']?(file:\/\/\/[^"')]+)["']?\s*\)/i);return e?e[1].replace(/^file:\/\//,``):null}async load(){this.status=`loading`;let e=this._extractFilePath();if(e){let t=registerFontFaces([e]);t.available&&reportRegistration(this.family,t)}return this.status=`loaded`,this}};function reportRegistration(e,t){for(let n of t.failed)console.warn(`FontFace.load: ${n.path} could not be read as a font (${n.message}), so text asking for "${e}" will render in a substituted one.`);for(let e of t.declined)console.warn(`FontFace.load: no font map in this process would take ${e} — Pango answers a family it does not hold with the default sans, and nothing else says so. A shipped .app reaches its faces through ATSApplicationFontsPath; a bare \`gjsify run\` needs initFonts() first.`);for(let n of t.unreachable)console.warn(`FontFace.load: ${n} is registered and "${e}" is a family this font map holds, but text asking for it will still render in a substituted one: the map had already resolved that family to the fallback, and that cached answer cannot be asked again. Register the face before anything lays text out.`);t.registered.length!==0&&t.map!==void 0&&(fontMapHasFamily(t.map,e)||console.warn(`FontFace.load: ${t.registered[0]} is registered, but "${e}" is not a family on the font map — it may be registered under a different name, and text asking for it will render in a substituted one.`))}var FontFaceSet=class{constructor(){this.status=`loaded`,this.ready=Promise.resolve(this),this._faces=new Set}addEventListener(e,t){}removeEventListener(e,t){}dispatchEvent(e){return!0}add(e){return this._faces.add(e),this}delete(e){return this._faces.delete(e)}clear(){this._faces.clear()}has(e){return this._faces.has(e)}check(e,t){return!1}load(e,t){return Promise.resolve([])}forEach(e){this._faces.forEach(t=>e(t,t,this))}values(){return this._faces.values()}keys(){return this._faces.values()}entries(){return Array.from(this._faces).map(e=>[e,e])[Symbol.iterator]()}[Symbol.iterator](){return this._faces[Symbol.iterator]()}get size(){return this._faces.size}};const bt=globalThis;defineGlobalIfMissing(`FontFace`,FontFace),bt.FontFace===void 0&&(bt.FontFace=FontFace);const xt=bt.document;xt&&xt.fonts===void 0&&Object.defineProperty(xt,"fonts",{value:new FontFaceSet,configurable:!0,writable:!0});var Image=class extends HTMLImageElement$1{constructor(e=null,t=null){super(),e!==null&&(this.width=e),t!==null&&(this.height=t)}};defineGlobal(`HTMLImageElement`,HTMLImageElement$1),defineGlobal(`Image`,Image),defineGlobalIfMissing(`location`,{href:`file://`,origin:`file://`,protocol:`file:`,host:``,hostname:``,port:``,pathname:`/`,search:``,hash:``,assign(e){},replace(e){},reload(){},toString(){return this.href},ancestorOrigins:{length:0,item:()=>null,contains:()=>!1,[Symbol.iterator]:function*(){}}});var MediaQueryList=class extends EventTarget{constructor(e){super(),this.onchange=null,this.media=e,this.matches=!1}addListener(e){}removeListener(e){}};function matchMedia(e){return new MediaQueryList(e)}defineGlobalIfMissing(`matchMedia`,matchMedia);var MutationObserver=class{constructor(e){}observe(e,t){}disconnect(){}takeRecords(){return[]}};const St=new Set;let Ct=!1;function scheduleFlush(){Ct||(Ct=!0,queueMicrotask(()=>{Ct=!1;let e=Array.from(St);St.clear();for(let t of e)t._deliver()}))}var ResizeObserver=class{constructor(e){this._observed=new Map,this._pending=new Map,this._callback=e}observe(e,t){if(this._observed.has(e))return;let n=e._onResize((t,n)=>{this._enqueue(e,t,n)});this._observed.set(e,n),queueMicrotask(()=>{if(!this._observed.has(e))return;let t=readClientRect(e);this._enqueue(e,t.width,t.height)})}unobserve(e){let t=this._observed.get(e);t&&(t(),this._observed.delete(e),this._pending.delete(e))}disconnect(){for(let e of this._observed.values())e();this._observed.clear(),this._pending.clear(),St.delete(this)}_deliver(){if(this._pending.size===0)return;let e=Array.from(this._pending.values());this._pending.clear();try{this._callback(e,this)}catch(e){console.error(`ResizeObserver callback threw:`,e)}}_enqueue(e,t,n){let r={inlineSize:t,blockSize:n};this._pending.set(e,{target:e,contentRect:{x:0,y:0,width:t,height:n,top:0,right:t,bottom:n,left:0},borderBoxSize:[r],contentBoxSize:[r],devicePixelContentBoxSize:[r]}),St.add(this),scheduleFlush()}};function readClientRect(e){let t=e.getBoundingClientRect;if(typeof t==`function`){let n=t.call(e);return{width:n.width??0,height:n.height??0}}return{width:0,height:0}}var IntersectionObserver=class{constructor(e,t){this.root=t?.root??null,this.rootMargin=t?.rootMargin??`0px`,this.thresholds=Array.isArray(t?.threshold)?t.threshold:[t?.threshold??0]}observe(e){}unobserve(e){}disconnect(){}takeRecords(){return[]}};defineGlobal(`MutationObserver`,MutationObserver),defineGlobal(`ResizeObserver`,ResizeObserver),defineGlobal(`IntersectionObserver`,IntersectionObserver);const wt={CustomEvent:CustomEvent$1,MessageEvent,ErrorEvent,CloseEvent,ProgressEvent:ProgressEvent$1};for(let[e,t]of Object.entries(wt))globalThis[e]===void 0&&Object.defineProperty(globalThis,e,{value:t,writable:!0,configurable:!0});const Tt={UIEvent,MouseEvent,PointerEvent,KeyboardEvent,WheelEvent,FocusEvent};for(let[e,t]of Object.entries(Tt))globalThis[e]===void 0&&Object.defineProperty(globalThis,e,{value:t,writable:!0,configurable:!0});var Et,__name,Dt=__esmMin((()=>{Et=Object.defineProperty,__name=(e,t)=>Et(e,`name`,{value:t,configurable:!0})}));function validateHeaderName(e){if(typeof e!=`string`||!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let t=TypeError(`Header name must be a valid HTTP token ["${e}"]`);throw Object.defineProperty(t,"code",{value:`ERR_INVALID_HTTP_TOKEN`}),t}}function validateHeaderValue(e,t){if(t===void 0){let t=TypeError(`Header "${e}" value must not be undefined`);throw Object.defineProperty(t,"code",{value:`ERR_HTTP_INVALID_HEADER_VALUE`}),t}if(typeof t==`string`&&/[^\t -~-ÿ]/.test(t)){let t=TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(t,"code",{value:`ERR_INVALID_CHAR`}),t}}const Ot=Symbol(`Headers.headers`);function isBoxedPrimitive(e){return e instanceof String||e instanceof Number||e instanceof Boolean||typeof Symbol<`u`&&e instanceof Symbol||typeof BigInt<`u`&&e instanceof BigInt}var kt=class Headers{[Ot];constructor(e){if(this[Ot]=new Map,e!=null){if(e instanceof Headers){for(let[t,n]of e[Ot])this[Ot].set(t,[...n]);return}if(typeof e==`object`&&!isBoxedPrimitive(e)){let t=e[Symbol.iterator];if(t==null)for(let[t,n]of Object.entries(e))validateHeaderName(t),validateHeaderValue(t,String(n)),this.append(t,String(n));else{if(typeof t!=`function`)throw TypeError(`Header pairs must be iterable`);for(let t of e){if(typeof t!=`object`||isBoxedPrimitive(t))throw TypeError(`Each header pair must be an iterable object`);let e=[...t];if(e.length!==2)throw TypeError(`Each header pair must be a name/value tuple`);validateHeaderName(e[0]),validateHeaderValue(e[0],String(e[1])),this.append(e[0],String(e[1]))}}}else throw TypeError(`Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)'`)}}append(e,t){validateHeaderName(e),validateHeaderValue(e,t);let n=String(e).toLowerCase(),r=String(t),i=this[Ot].get(n);i?i.push(r):this[Ot].set(n,[r])}set(e,t){validateHeaderName(e),validateHeaderValue(e,t);let n=String(e).toLowerCase();this[Ot].set(n,[String(t)])}delete(e){this[Ot].delete(String(e).toLowerCase())}has(e){return this[Ot].has(String(e).toLowerCase())}get(e){let t=this[Ot].get(String(e).toLowerCase());if(!t||t.length===0)return null;let n=t.join(`, `);return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}getAll(e){return this[Ot].get(String(e).toLowerCase())??[]}getSetCookie(){return this[Ot].get(`set-cookie`)??[]}forEach(e,t){for(let n of this.keys())Reflect.apply(e,t,[this.get(n),n,this])}*keys(){let e=[...this[Ot].keys()].sort(),t=new Set;for(let n of e)t.has(n)||(t.add(n),yield n)}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return`Headers`}toString(){return Object.prototype.toString.call(this)}raw(){let e={};for(let t of this.keys())e[t]=this.getAll(t);return e}_appendToSoupMessage(e,t,n=e.MessageHeadersType.REQUEST){let r=t?t.get_request_headers():new e.MessageHeaders(n);for(let[e,t]of this.entries())r.append(e,t);return r}static _newFromSoupMessage(e,t,n=e.MessageHeadersType.RESPONSE){let r=new Headers,i;return i=n===e.MessageHeadersType.RESPONSE?t.get_response_headers():t.get_request_headers(),i.foreach((e,t)=>{r.append(e,t)}),r}[Symbol.for(`nodejs.util.inspect.custom`)](){let e={};for(let t of this.keys()){let n=this.getAll(t);t===`host`?e[t]=n[0]:e[t]=n.length>1?n:n[0]}return e}};Object.defineProperties(kt.prototype,[`get`,`entries`,`forEach`,`values`].reduce((e,t)=>(e[t]={enumerable:!0},e),{}));var At=__esmMin((()=>{}));At();var FetchBaseError=class extends Error{type;constructor(e,t){super(e),typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,this.constructor),this.type=t}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},FetchError=class extends FetchBaseError{code;errno;erroredSysCall;constructor(e,t,n){super(e,t),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}};const jt=globalThis.URL,Mt=globalThis.URLSearchParams,Nt=Symbol.toStringTag,isURLSearchParameters=e=>typeof e==`object`&&typeof e.append==`function`&&typeof e.delete==`function`&&typeof e.get==`function`&&typeof e.getAll==`function`&&typeof e.has==`function`&&typeof e.set==`function`&&typeof e.sort==`function`&&e[Nt]===`URLSearchParams`,isBlob=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.arrayBuffer==`function`&&typeof t.type==`string`&&typeof t.stream==`function`&&typeof t.constructor==`function`&&/^(Blob|File)$/.test(t[Nt])},isAbortSignal=e=>{if(typeof e!=`object`||!e)return!1;let t=e;return t[Nt]===`AbortSignal`||t[Nt]===`EventTarget`},isDomainOrSubdomain=(e,t)=>{let n=new jt(t).hostname,r=new jt(e).hostname;return n===r||n.endsWith(`.${r}`)},isSameProtocol=(e,t)=>new jt(t).protocol===new jt(e).protocol;function formDataToBlob(e){let t=`----FormDataBoundary`+Math.random().toString(36).slice(2),n=[];for(let[r,i]of e.entries())typeof i==`string`?n.push(`--${t}\r\nContent-Disposition: form-data; name="${r}"\r\n\r\n${i}\r\n`):(n.push(`--${t}\r\nContent-Disposition: form-data; name="${r}"; filename="${i.name}"\r\nContent-Type: ${i.type||`application/octet-stream`}\r\n\r\n`),n.push(i),n.push(`\r
|
|
3
|
+
`));return n.push(`--${t}--\r\n`),new Blob(n,{type:`multipart/form-data; boundary=${t}`})}var Pt,Ft=__esmMin((()=>{Pt=globalThis.FormData,globalThis.File})),It=__exportAll$1({toFormData:()=>toFormData});function _fileName(e){let t=e.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!t)return;let n=t[2]||t[3]||``,r=n.slice(n.lastIndexOf(`\\`)+1);return r=r.replace(/%22/g,`"`),r=r.replace(/&#(\d{4});/g,(e,t)=>String.fromCharCode(t)),r}async function toFormData(e,t){if(!/multipart/i.test(t))throw TypeError(`Failed to fetch`);let n=t.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!n)throw TypeError(`no or bad content-type header, no multipart boundary`);let r=new MultipartParser(n[1]||n[2]),i,o,s,c,l,u,d=[],f=new Pt,onPartData=e=>{s+=p.decode(e,{stream:!0})},appendToFile=e=>{d.push(e)},appendFileToFormData=()=>{let e=new a(d,u,{type:l});f.append(c,e)},appendEntryToFormData=()=>{f.append(c,s)},p=new TextDecoder(`utf-8`);p.decode(),r.onPartBegin=function(){r.onPartData=onPartData,r.onPartEnd=appendEntryToFormData,i=``,o=``,s=``,c=``,l=``,u=null,d.length=0},r.onHeaderField=function(e){i+=p.decode(e,{stream:!0})},r.onHeaderValue=function(e){o+=p.decode(e,{stream:!0})},r.onHeaderEnd=function(){if(o+=p.decode(),i=i.toLowerCase(),i===`content-disposition`){let e=o.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);e&&(c=e[2]||e[3]||``),u=_fileName(o),u&&(r.onPartData=appendToFile,r.onPartEnd=appendFileToFormData)}else i===`content-type`&&(l=o);o=``,i=``};for await(let t of e)r.write(t);return r.end(),f}var Lt,Rt,lower,noop,MultipartParser,zt=__esmMin((()=>{Ft(),Lt=1,Rt={PART_BOUNDARY:Lt,LAST_BOUNDARY:Lt*=2},lower=e=>e|32,noop=(...e)=>{},MultipartParser=class{index=0;flags=0;boundary;lookbehind;state=0;onHeaderEnd=noop;onHeaderField=noop;onHeadersEnd=noop;onHeaderValue=noop;onPartBegin=noop;onPartData=noop;onPartEnd=noop;boundaryChars={};constructor(e){e=`\r
|
|
4
|
+
--`+e;let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n),this.boundaryChars[t[n]]=!0;this.boundary=t,this.lookbehind=new Uint8Array(this.boundary.length+8)}write(e){let t=0,n=e.length,r=this.index,{lookbehind:i,boundary:a,boundaryChars:o,index:s,state:c,flags:l}=this,u=this.boundary.length,d=u-1,f=e.length,p,m,mark=e=>{this[e+`Mark`]=t},clear=e=>{delete this[e+`Mark`]},callback=(e,t,n,r)=>{(t===void 0||t!==n)&&this[e](r&&r.subarray(t,n))},dataCallback=(n,r=!1)=>{let i=n+`Mark`;i in this&&(r?(callback(n,this[i],t,e),delete this[i]):(callback(n,this[i],e.length,e),this[i]=0))};for(t=0;t<n;t++)switch(p=e[t],c){case 0:if(s===a.length-2){if(p===45)l|=Rt.LAST_BOUNDARY;else if(p!==13)return;s++;break}else if(s-1==a.length-2){if(l&Rt.LAST_BOUNDARY&&p===45)c=9,l=0;else if(!(l&Rt.LAST_BOUNDARY)&&p===10)s=0,callback(`onPartBegin`),c=1;else return;break}p!==a[s+2]&&(s=-2),p===a[s+2]&&s++;break;case 1:c=2,mark(`onHeaderField`),s=0;case 2:if(p===13){clear(`onHeaderField`),c=6;break}if(s++,p===45)break;if(p===58){if(s===1)return;dataCallback(`onHeaderField`,!0),c=3;break}if(m=lower(p),m<97||m>122)return;break;case 3:if(p===32)break;mark(`onHeaderValue`),c=4;case 4:p===13&&(dataCallback(`onHeaderValue`,!0),callback(`onHeaderEnd`),c=5);break;case 5:if(p!==10)return;c=1;break;case 6:if(p!==10)return;callback(`onHeadersEnd`),c=7;break;case 7:c=8,mark(`onPartData`);case 8:if(r=s,s===0){for(t+=d;t<f&&!(e[t]in o);)t+=u;t-=d,p=e[t]}if(s<a.length)a[s]===p?(s===0&&dataCallback(`onPartData`,!0),s++):s=0;else if(s===a.length)s++,p===13?l|=Rt.PART_BOUNDARY:p===45?l|=Rt.LAST_BOUNDARY:s=0;else if(s-1===a.length)if(l&Rt.PART_BOUNDARY){if(s=0,p===10){l&=~Rt.PART_BOUNDARY,callback(`onPartEnd`),callback(`onPartBegin`),c=1;break}}else l&Rt.LAST_BOUNDARY&&p===45?(callback(`onPartEnd`),c=9,l=0):s=0;if(s>0)i[s-1]=p;else if(r>0){let e=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);callback(`onPartData`,0,r,e),r=0,mark(`onPartData`),t--}break;case 9:break;default:throw Error(`Unexpected state entered: ${c}`)}dataCallback(`onHeaderField`),dataCallback(`onHeaderValue`),dataCallback(`onPartData`),this.index=s,this.state=c,this.flags=l}end(){if(this.state===1&&this.index===0||this.state===8&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==9)throw Error(`MultipartParser.end(): stream ended unexpectedly`)}}}));Dt(),At(),Ft(),__name((e,t)=>new Promise((n,r)=>{u(e,t,e=>{e?r(e):n()})}),`pipeline`);const H=Symbol(`Body internals`);function isAnyArrayBuffer(e){return e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer}var Body=class{[H]={body:null,stream:null,webStream:null,boundary:``,disturbed:!1,error:null};size=0;constructor(e,t={size:0}){if(this.size=t.size||0,e==null)this[H].body=null;else if(isURLSearchParameters(e))this[H].body=i.from(e.toString());else if(isBlob(e))this[H].body=e;else if(i.isBuffer(e))this[H].body=e;else if(isAnyArrayBuffer(e))this[H].body=i.from(e);else if(ArrayBuffer.isView(e))this[H].body=i.from(e.buffer,e.byteOffset,e.byteLength);else if(e instanceof c)this[H].body=e;else if(typeof ReadableStream<`u`&&e instanceof ReadableStream)this[H].body=readableStreamToReadable(e);else if(e instanceof Pt){let t=formDataToBlob(e);this[H].body=t,this[H].boundary=t.type?.split(`boundary=`)?.[1]??``}else typeof e==`string`?this[H].body=i.from(e):e instanceof Mt?this[H].body=i.from(e.toString()):(console.warn(`Unknown body type "${typeof e}", try to parse the body to string!`),this[H].body=i.from(String(e)));let n=this[H].body;i.isBuffer(n)?this[H].stream=c.from(n):isBlob(n)?this[H].stream=c.from(blobToAsyncIterable(n)):n instanceof c&&(this[H].stream=n),n instanceof l&&n.on(`error`,e=>{let t=e instanceof FetchBaseError?e:new FetchError(`Invalid response body while trying to fetch ${this.url}: ${e.message}`,`system`,e);this[H].error=t})}get body(){let e=this[H].stream;if(!e)return null;let t=this[H].webStream;if(t)return t;if(typeof ReadableStream<`u`){let t=!1,n=new ReadableStream({start(n){e.on(`data`,e=>{if(!t)try{n.enqueue(e instanceof Uint8Array?e:new Uint8Array(e))}catch{}}),e.on(`end`,()=>{if(!t){t=!0;try{n.close()}catch{}}}),e.on(`error`,e=>{if(!t){t=!0;try{n.error(e)}catch{}}})},cancel(){t=!0,e.destroy()}});return this[H].webStream=n,n}return null}get _stream(){return this[H].stream}get _rawBodyBuffer(){let e=this[H].body;return e===null?null:i.isBuffer(e)?e:e instanceof Uint8Array?i.from(e.buffer,e.byteOffset,e.byteLength):null}get bodyUsed(){return this[H].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:t,byteLength:n}=await consumeBody(this);return e.slice(t,t+n)}async formData(){let e=this.headers?.get(`content-type`);if(e?.startsWith(`application/x-www-form-urlencoded`)){let e=new Pt,t=new Mt(await this.text());for(let[n,r]of t)e.append(n,r);return e}let{toFormData:t}=await Promise.resolve().then(()=>(zt(),It));return t(this.body,e)}async blob(){let e=this.headers?.get(`content-type`)||this[H].body&&this[H].body.type||``;return new r([await this.arrayBuffer()],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await consumeBody(this);return new TextDecoder().decode(e)}};Object.defineProperties(Body.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});async function consumeBody(e){if(e[H].disturbed)throw TypeError(`body used already for: ${e.url}`);if(e[H].disturbed=!0,e[H].error)throw e[H].error;let{_stream:t}=e;if(t===null||!(t instanceof l))return i.alloc(0);let n=[],r=0;try{for await(let i of t){if(e.size>0&&r+i.length>e.size){let n=new FetchError(`content size at ${e.url} over limit: ${e.size}`,`max-size`);throw t.destroy(n),n}r+=i.length,n.push(i)}}catch(t){let n=t instanceof Error?t:Error(String(t));throw t instanceof FetchBaseError?t:new FetchError(`Invalid response body while trying to fetch ${e.url}: ${n.message}`,`system`,n)}try{return n.every(e=>typeof e==`string`)?i.from(n.join(``)):i.concat(n,r)}catch(t){let n=t instanceof Error?t:Error(String(t));throw new FetchError(`Could not create Buffer from response body for ${e.url}: ${n.message}`,`system`,n)}}const clone=(e,t)=>{let n,r,{body:i}=e[H];if(e.bodyUsed)throw Error(`cannot clone body after it is used`);return i instanceof l&&typeof i.getBoundary!=`function`&&(n=new s({highWaterMark:t}),r=new s({highWaterMark:t}),i.pipe(n),i.pipe(r),e[H].stream=n,i=r),i},extractContentType=(e,t)=>e===null?null:typeof e==`string`?`text/plain;charset=UTF-8`:isURLSearchParameters(e)?`application/x-www-form-urlencoded;charset=UTF-8`:isBlob(e)?e.type||null:i.isBuffer(e)||isAnyArrayBuffer(e)||ArrayBuffer.isView(e)?null:e instanceof Pt?`multipart/form-data; boundary=${t[H].boundary}`:e instanceof l?null:`text/plain;charset=UTF-8`,getTotalBytes=e=>{let{body:t}=e[H];if(t===null)return 0;if(isBlob(t))return t.size;if(i.isBuffer(t))return t.length;if(t&&typeof t.getLengthSync==`function`){let e=t;return e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null}return null};function readableStreamToReadable(e){let t=e.getReader();return new c({async read(){try{let{done:e,value:n}=await t.read();e?this.push(null):this.push(i.from(n))}catch(e){this.destroy(e)}},destroy(e,n){t.cancel().then(()=>n(null),n)}})}async function*blobToAsyncIterable(e){if(typeof e.stream==`function`){let t=e.stream().getReader();for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}else yield new Uint8Array(await e.arrayBuffer())}const Bt=new Set([301,302,303,307,308]),isRedirect=e=>Bt.has(e);var Vt=B,Ht=z;const Ut=Symbol(`Response internals`);var Wt=class Response extends Body{[Ut];_inputStream=null;constructor(e=null,t={}){super(e,t);let n=t.status==null?200:t.status,r=new kt(t.headers);if(e!==null&&!r.has(`Content-Type`)){let t=extractContentType(e,this);t&&r.append(`Content-Type`,t)}this[Ut]={type:`default`,url:t.url,status:n,statusText:t.statusText||``,headers:r,counter:t.counter,highWaterMark:t.highWaterMark}}get type(){return this[Ut].type}get url(){return this[Ut].url||``}get status(){return this[Ut].status}get ok(){return this[Ut].status>=200&&this[Ut].status<300}get redirected(){return this[Ut].counter>0}get statusText(){return this[Ut].statusText}get headers(){return this[Ut].headers}get highWaterMark(){return this[Ut].highWaterMark}clone(){return new Response(clone(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,t=302){if(!isRedirect(t))throw RangeError(`Failed to execute "redirect" on "response": Invalid status code`);return new Response(null,{headers:{location:new jt(e).toString()},status:t})}static error(){let e=new Response(null,{status:0,statusText:``});return e[Ut].type=`error`,e}static json(e,t){let n=JSON.stringify(e),r={...t},i=new kt(r.headers);return i.has(`content-type`)||i.set(`content-type`,`application/json`),r.headers=i,new Response(n,r)}get[Symbol.toStringTag](){return`Response`}async text(){if(!this._inputStream)return super.text();let e=Ht.MemoryOutputStream.new_resizable();await new Promise((t,n)=>{e.splice_async(this._inputStream,Ht.OutputStreamSpliceFlags.CLOSE_TARGET|Ht.OutputStreamSpliceFlags.CLOSE_SOURCE,Vt.PRIORITY_DEFAULT,null,(r,i)=>{try{t(e.splice_finish(i))}catch(e){n(e)}})});let t=e.steal_as_bytes();return new TextDecoder().decode(t.toArray())}};Object.defineProperties(Wt.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});function gbytesToUint8Array(e){return e.toArray()}const warnNotImplemented=e=>{let t=e?`Not implemented: ${e}`:`Not implemented`;return console.warn(t),t};function isWindowsPath(e){return/^[A-Za-z]:[\\/]/.test(e)||e.startsWith(`\\\\`)}function lastPathSeparatorIndex(e){let t=e.lastIndexOf(`/`);return isWindowsPath(e)?Math.max(t,e.lastIndexOf(`\\`)):t}function pathToFileUrlHref(e,t){let n=t?.windows??isWindowsPath(e),r=n?e.replace(/\\/g,`/`):e;if(n&&r.startsWith(`//`)){let e=r.indexOf(`/`,2);return`file://${e===-1?r.slice(2):r.slice(2,e)}${encodePathForFileUrl(e===-1?``:r.slice(e))}`}return`${r.startsWith(`/`)?`file://`:`file:///`}${encodePathForFileUrl(r)}`}function encodePathForFileUrl(e){let t=``;for(let n of e)t+=Gt.test(n)?n:percentEncode(n);return t}const Gt=/^[A-Za-z0-9!$&'()*+,\-./:;=@_]$/;function percentEncode(e){let t=``;for(let n of new TextEncoder().encode(e))t+=`%${n.toString(16).toUpperCase().padStart(2,`0`)}`;return t}function hostGi(){return globalThis.imports?.gi}function directoryOf(e){return/^(.*)[\\/][^\\/]*$/.exec(e)?.[1]}function colocateNativeLibrary(e,t=hostGi()){try{let n=t?.GIRepository?.Repository?.dup_default?.(),r=n?.get_typelib_path(e),i=r?directoryOf(r):void 0;return!n||!i?!1:(n.prepend_library_path(i),!0)}catch{return!1}}function probeNativeLibrary(e,t=hostGi()){try{let n=t?.GIRepository?.Repository?.dup_default?.(),r=n?.get_typelib_path(e);if(!t||!n||!r)return null;let i=firstSymbol(n,e);if(!i||(t.GModule?.module_error(),i.info.get_typelib().symbol(i.name)[0]))return null;let a=directoryOf(r)??`.`,o=r.includes(`\\`)&&!r.includes(`/`)?`\\`:`/`;for(let s of n.get_shared_libraries(e)??[]){let n=`${a}${o}${s}`,c=t.GLib?.file_test(n,t.GLib.FileTest.EXISTS)?n:s,l=loaderError(t,e,r,c,i.name);if(l!==void 0)return{namespace:e,library:c,reason:l,missingDependency:missingLibraryDependency(l,c)}}let s=(n.get_shared_libraries(e)??[]).join(`, `)||`(none named)`;return{namespace:e,library:s,reason:`symbol ${i.name} not found in ${s}, and the loader reported no error`}}catch{return null}}function firstSymbol(e,t){let n=e.get_n_infos(t),r=null;for(let i=0;i<n;i++){let n=e.get_info(t,i),a=n.get_type_init_function_name?.();if(a)return{info:n,name:a};let o=n.get_symbol?.();o&&!r&&(r={info:n,name:o})}return r}function loaderError(e,t,n,r,i){let{GIRepository:a,GLib:o,GModule:s}=e;if(!a?.Repository||!a.Typelib||!o||!s)return;let[,c]=o.file_get_contents(n),l=new TextEncoder().encode(`${r}\0`),u=new Uint8Array(c.length+l.length);u.set(c),u.set(l,c.length);let d=new DataView(u.buffer);d.setUint32(40,u.length,!0),d.setUint32(52,c.length,!0);let f=new a.Repository,p=firstSymbol(f,f.load_typelib(a.Typelib.new_from_bytes(new o.Bytes(u)),0));if(p&&(s.module_error(),!p.info.get_typelib().symbol(i)[0]))return s.module_error()??`${t}: ${r} could not be opened (the loader reported no error)`}function missingLibraryDependency(e,t){let n=/Library not loaded: (\S+)/.exec(e)?.[1]??/Error loading shared library ([^\s:]+): .*\(needed by /.exec(e)?.[1]??/(?:^|\s)([^\s:]+): cannot open shared object file/.exec(e)?.[1];if(!n)return;let r=n.replace(/^.*[\\/]/,``);if(!(t&&r===t.replace(/^.*[\\/]/,``)))return r}var NativeLibraryLoadError=class extends Error{failure;constructor(e,t){let n=e.missingDependency?`It needs ${e.missingDependency}, which the loader could not find: not installed, or not on its search path.`:`The loader could not open it.`;super(`${e.namespace}: the native library ${e.library} could not be loaded. ${n}\nLoader: ${e.reason.trim()}\n`+(t??"`gjsify system-check` lists the system libraries the installed @gjsify packages need, with the install command for this host.")),this.name=`NativeLibraryLoadError`,this.failure=e}};function openNativeLibrary(e,t=hostGi()){colocateNativeLibrary(e,t);let n=probeNativeLibrary(e,t);return n?new NativeLibraryLoadError(n):null}async function readBytesAsync(e,t=4096,n=Vt.PRIORITY_DEFAULT,r=null){return new Promise((i,a)=>{e.read_bytes_async(t,n,r,(t,n)=>{try{let t=e.read_bytes_finish(n);return t.get_size()===0?i(null):i(gbytesToUint8Array(t))}catch(e){let t=e;if(typeof t.matches==`function`&&(t.matches(Ht.IOErrorEnum,Ht.IOErrorEnum.PARTIAL_INPUT)||t.matches(Ht.IOErrorEnum,Ht.IOErrorEnum.CONNECTION_CLOSED)||t.matches(Ht.IOErrorEnum,Ht.IOErrorEnum.BROKEN_PIPE)||t.matches(Ht.IOErrorEnum,Ht.IOErrorEnum.CLOSED)))return i(null);a(e)}})})}async function*inputStreamAsyncIterator(e,t=4096,n=Vt.PRIORITY_DEFAULT,r=null){let i;for(;(i=await readBytesAsync(e,t,n,r))!==null;)yield i}async function soupSendAsync(e,t,n=Vt.PRIORITY_DEFAULT,r=null){return new Promise((i,a)=>{let o=!1,onCancel=()=>{o||(o=!0,a(new Ht.IOErrorEnum({code:Ht.IOErrorEnum.CANCELLED,message:`Operation was cancelled`})))},s=r?r.connect(onCancel):0;o||e.send_async(t,n,r,(t,n)=>{s&&r.disconnect(s);let c;try{c=e.send_finish(n)}catch(e){o||(o=!0,a(e));return}if(o){closeInputStream(c);return}o=!0,i(c)})})}function closeInputStream(e){return new Promise(t=>{e.close_async(Vt.PRIORITY_DEFAULT,null,(n,r)=>{try{e.close_finish(r)}catch{}t()})})}function inputStreamToReadable(e,t={}){let n=new Ht.Cancellable,r=null,close=()=>r||(e.has_pending()?Promise.resolve():(r=closeInputStream(e),r));async function*chunks(){try{yield*inputStreamAsyncIterator(e,4096,Vt.PRIORITY_DEFAULT,n)}finally{await close()}}let i=c.from(chunks(),t);return i.once(`close`,()=>{e.has_pending()?n.cancel():close()}),i}var Kt=__exportAll$1({default:()=>Yt});function load$5(){return Jt===void 0&&(Jt=qt(`@gjsify/node-gi/gi`).requireGi(`Soup`,`3.0`)),Jt}var qt,Jt,Yt,Xt=__esmMin((()=>{qt=e(import.meta.url),__name$1(load$5,`load`),Yt=new Proxy(Object.create(null),{get(e,t){return load$5()[t]},has(e,t){return t in load$5()}})}));let Zt=null;async function loadSoup(){return Zt??=(await Promise.resolve().then(()=>(Xt(),Kt))).default}function stripURLForUseAsAReferrer(e,t=!1){if(e==null||e===`no-referrer`)return`no-referrer`;let n=new jt(e);return/^(about|blob|data):$/.test(n.protocol)?`no-referrer`:(n.username=``,n.password=``,n.hash=``,t&&(n.pathname=``,n.search=``),n)}const Qt=new Set([``,`no-referrer`,`no-referrer-when-downgrade`,`same-origin`,`origin`,`strict-origin`,`origin-when-cross-origin`,`strict-origin-when-cross-origin`,`unsafe-url`]);function validateReferrerPolicy(e){if(!Qt.has(e))throw TypeError(`Invalid referrerPolicy: ${e}`);return e}function isOriginPotentiallyTrustworthy(e){if(/^(http|ws)s:$/.test(e.protocol))return!0;let t=e.host.replace(/(^\[)|(]$)/g,``),n=d(t);return n===4&&t.startsWith(`127.`)||n===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(t)?!0:e.host===`localhost`||e.host.endsWith(`.localhost`)?!1:e.protocol===`file:`}function isUrlPotentiallyTrustworthy(e){return/^about:(blank|srcdoc)$/.test(e.toString())||(typeof e==`string`&&(e=new jt(e)),e.protocol===`data:`)||/^(blob|filesystem):$/.test(e.protocol)?!0:isOriginPotentiallyTrustworthy(e)}function determineRequestsReferrer(e,t={}){let{referrerURLCallback:n,referrerOriginCallback:r}=t;if(e.referrer===`no-referrer`||e.referrerPolicy===``)return null;let i=e.referrerPolicy;if(e.referrer===`about:client`)return`no-referrer`;let a=new jt(e.referrer),o=stripURLForUseAsAReferrer(a),s=stripURLForUseAsAReferrer(a,!0);o.toString().length>4096&&(o=s),n&&(o=n(o)),r&&(s=r(s));let c=new jt(e.url);switch(i){case`no-referrer`:return`no-referrer`;case`origin`:return s;case`unsafe-url`:return o;case`strict-origin`:return isUrlPotentiallyTrustworthy(o)&&!isUrlPotentiallyTrustworthy(c)?`no-referrer`:s.toString();case`strict-origin-when-cross-origin`:return o.origin===c.origin?o:isUrlPotentiallyTrustworthy(o)&&!isUrlPotentiallyTrustworthy(c)?`no-referrer`:s;case`same-origin`:return o.origin===c.origin?o:`no-referrer`;case`origin-when-cross-origin`:return o.origin===c.origin?o:s;case`no-referrer-when-downgrade`:return isUrlPotentiallyTrustworthy(o)&&!isUrlPotentiallyTrustworthy(c)?`no-referrer`:o;default:throw TypeError(`Invalid referrerPolicy: ${i}`)}}function parseReferrerPolicyFromHeader(e){let t=(e.get(`referrer-policy`)||``).split(/[,\s]+/),n=``;for(let e of t)e&&Qt.has(e)&&(n=e);return n}const U=Symbol(`Request internals`);let $t=null;function envPositiveInt(e,t){let n=Vt.getenv(e);if(!n)return t;let r=Number.parseInt(n,10);return Number.isFinite(r)&&r>0?r:t}function shouldAcceptAnyCert(e){return e===!1?!0:e===!0?!1:Vt.getenv(`NODE_TLS_REJECT_UNAUTHORIZED`)===`0`}function getSharedSession(e){if($t===null){let t=envPositiveInt(`GJSIFY_FETCH_MAX_CONNS_PER_HOST`,16),n=Math.max(envPositiveInt(`GJSIFY_FETCH_MAX_CONNS`,64),t);$t=new e.Session({maxConns:n,maxConnsPerHost:t}),$t.remove_feature_by_type(e.ContentDecoder.$gtype)}return $t}const isRequest=e=>typeof e==`object`&&typeof e.url==`string`;var en=class Request extends Body{cache;credentials;destination;get headers(){return this[U].headers}integrity;keepalive;get method(){return this[U].method}mode;get redirect(){return this[U].redirect}get referrer(){if(this[U].referrer===`no-referrer`)return``;if(this[U].referrer===`client`)return`about:client`;if(this[U].referrer)return this[U].referrer.toString()}get referrerPolicy(){return this[U].referrerPolicy}set referrerPolicy(e){this[U].referrerPolicy=validateReferrerPolicy(e)}get signal(){return this[U].signal}get url(){return this[U].parsedURL.toString()}get _uri(){return Vt.Uri.parse(this.url,Vt.UriFlags.ENCODED)}get _session(){return this[U].session}get _message(){return this[U].message}get _inputStream(){return this[U].inputStream}get[Symbol.toStringTag](){return`Request`}[U];follow;compress=!1;counter=0;agent=``;highWaterMark=16384;insecureHTTPParser=!1;rejectUnauthorized;constructor(e,t){let n=e,r=t||{},i,a={};if(isRequest(e)?(i=new jt(n.url),a=n):i=new jt(e),i.username!==``||i.password!==``)throw TypeError(`${i} is an url with embedded credentials.`);let o=r.method||a.method||`GET`;if(/^(delete|get|head|options|post|put)$/i.test(o)&&(o=o.toUpperCase()),(t?.body!=null||isRequest(e)&&n.body!==null)&&(o===`GET`||o===`HEAD`))throw TypeError(`Request with GET/HEAD method cannot have body`);let s=t?.body?t.body:isRequest(e)&&n.body!==null?clone(e):null;super(s,{size:r.size||0});let c=new kt(t?.headers||n.headers||{});if(s!==null&&!c.has(`Content-Type`)){let e=extractContentType(s,this);e&&c.set(`Content-Type`,e)}let l=isRequest(e)?n.signal:null;if(t&&`signal`in t&&(l=t.signal),l!=null&&!isAbortSignal(l))throw TypeError(`Expected signal to be an instanceof AbortSignal or EventTarget`);let u=t?.referrer==null?n.referrer:t.referrer;if(u===``)u=`no-referrer`;else if(u){let e=new jt(u);u=/^about:(\/\/)?client$/.test(e.toString())?`client`:e}else u=void 0;this[U]={method:o,redirect:t?.redirect||n.redirect||`follow`,headers:c,parsedURL:i,signal:l,referrer:u,referrerPolicy:``,session:null,message:null},this.follow=r.follow===void 0?n.follow===void 0?20:n.follow:r.follow,this.compress=r.compress===void 0?n.compress===void 0?!0:n.compress:r.compress,this.counter=r.counter||n.counter||0,this.agent=r.agent||n.agent,this.highWaterMark=r.highWaterMark||n.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||n.insecureHTTPParser||!1,this.rejectUnauthorized=r.rejectUnauthorized??n.rejectUnauthorized,this.referrerPolicy=t?.referrerPolicy||n.referrerPolicy||``}async _send(e){let{signal:t,parsedURL:n}=this[U],r=n.protocol;if(r!==`http:`&&r!==`https:`)throw Error(`Cannot send request: no Soup session (non-HTTP URL?)`);let i=await loadSoup(),a=getSharedSession(i),o=new i.Message({method:this[U].method,uri:Vt.Uri.parse(n.toString(),Vt.UriFlags.ENCODED)});this[U].session=a,this[U].message=o,e.headers._appendToSoupMessage(i,o);let s=this._rawBodyBuffer;if(s!==null&&s.byteLength>0){let t=e.headers.get(`content-type`)||null;o.set_request_body_from_bytes(t,new Vt.Bytes(s))}n.protocol===`https:`&&shouldAcceptAnyCert(this.rejectUnauthorized)&&o.connect(`accept-certificate`,(e,t,n)=>!0);let c=new Ht.Cancellable;return t&&(t.aborted?c.cancel():t.addEventListener(`abort`,()=>c.cancel(),{once:!0})),this[U].inputStream=await soupSendAsync(a,o,Vt.PRIORITY_DEFAULT,c),this[U].readable=inputStreamToReadable(this[U].inputStream),{inputStream:this[U].inputStream,readable:this[U].readable,cancellable:c}}clone(){return new Request(this)}async arrayBuffer(){return super.arrayBuffer()}async blob(){return super.blob()}async formData(){return super.formData()}async json(){return super.json()}async text(){return super.text()}};Object.defineProperties(en.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});const getSoupRequestOptions=e=>{let{parsedURL:t}=e[U],n=new kt(e[U].headers);n.has(`Accept`)||n.set(`Accept`,`*/*`);let r=null;if(e.body===null&&/^(post|put)$/i.test(e.method)&&(r=`0`),e.body!==null){let t=getTotalBytes(e);typeof t==`number`&&!Number.isNaN(t)&&(r=String(t))}r&&n.set(`Content-Length`,r),e.referrerPolicy===``&&(e.referrerPolicy=`strict-origin-when-cross-origin`),e.referrer&&e.referrer!==`no-referrer`?e[U].referrer=determineRequestsReferrer(e):e[U].referrer=`no-referrer`,e[U].referrer instanceof jt&&n.set(`Referer`,e.referrer),n.has(`User-Agent`)||n.set(`User-Agent`,`gjsify-fetch`),e.compress&&!n.has(`Accept-Encoding`)&&n.set(`Accept-Encoding`,`gzip, deflate`);let{agent:i}=e;return typeof i==`function`&&(i=i(t)),!n.has(`Connection`)&&!i&&n.set(`Connection`,`close`),{parsedURL:t,options:{headers:n}}};var AbortError=class extends FetchBaseError{constructor(e,t=`aborted`){super(e,t)}};function parseDataUri(e){let t=e.match(/^data:([^,]*?)(;base64)?,(.*)$/s);if(!t)throw TypeError(`Invalid data URI: ${e.slice(0,50)}...`);let n=t[1]||`text/plain;charset=US-ASCII`,r=!!t[2],i=t[3],a;if(r){let e=atob(i);a=new Uint8Array(e.length);for(let t=0;t<e.length;t++)a[t]=e.charCodeAt(t)}else a=new TextEncoder().encode(decodeURIComponent(i));return{buffer:a,typeFull:n}}function rewriteRootRelativeUrl(e,t){if(!e.startsWith(`/`)||e.startsWith(`//`))return e;let n=lastPathSeparatorIndex(t);return n<=0?e:`${pathToFileUrlHref(t.slice(0,n))}${e}`}function resolveRootRelativeUrl(e){return rewriteRootRelativeUrl(e,n.programPath??n.programInvocationName??``)}let tn=0;function guessBlobExt(e){let t=e.toLowerCase().split(`?`)[0],n=t.lastIndexOf(`.`),r=n>-1?t.slice(n):``;switch(r){case`.png`:case`.jpg`:case`.jpeg`:case`.gif`:case`.webp`:case`.svg`:case`.bmp`:case`.ttf`:case`.otf`:case`.woff`:case`.woff2`:case`.mp3`:case`.wav`:case`.ogg`:case`.flac`:case`.m4a`:case`.mp4`:case`.webm`:case`.mkv`:case`.xml`:case`.tmx`:case`.json`:return r;default:return`.bin`}}function writeBlobToTempFile(e,t){let n=B.build_filenamev([B.get_tmp_dir(),`gjsify-blob-${tn++}${guessBlobExt(t)}`]);return B.file_set_contents(n,e),n}var XMLHttpRequest=class extends EventTarget{static UNSENT=0;static OPENED=1;static HEADERS_RECEIVED=2;static LOADING=3;static DONE=4;UNSENT=0;OPENED=1;HEADERS_RECEIVED=2;LOADING=3;DONE=4;readyState=0;status=0;statusText=``;responseType=``;responseText=``;response=null;responseURL=``;withCredentials=!1;timeout=0;upload=new XMLHttpRequestUpload;onreadystatechange=null;onload=null;onerror=null;onabort=null;ontimeout=null;onloadstart=null;onloadend=null;onprogress=null;_method=`GET`;_url=``;_headers=new Map;_responseHeaders=new Map;_controller=new AbortController;_aborted=!1;_timeoutId=null;open(e,t,n=!0,r,i){this._method=e.toUpperCase(),this._url=t,this._headers.clear(),this._responseHeaders.clear(),this._aborted=!1,this._controller=new AbortController,this._setReadyState(1)}setRequestHeader(e,t){if(this.readyState<1)throw new DOMException(`Must open first`,`InvalidStateError`);this._headers.set(e.toLowerCase(),t)}getResponseHeader(e){return this._responseHeaders.get(e.toLowerCase())??null}getAllResponseHeaders(){let e=[];return this._responseHeaders.forEach((t,n)=>e.push(`${n}: ${t}`)),e.join(`\r
|
|
5
|
+
`)}send(e){if(this.readyState!==1)throw new DOMException(`Must open first`,`InvalidStateError`);if(this._aborted)return;let t={};this._headers.forEach((e,n)=>{t[n]=e});let n={method:this._method,headers:t,credentials:this.withCredentials?`include`:`omit`,signal:this._controller.signal};e!=null&&this._method!==`GET`&&this._method!==`HEAD`&&(n.body=e),this.timeout>0&&(this._timeoutId=setTimeout(()=>{this._controller.abort(),this._onTimeout()},this.timeout)),this.dispatchEvent(new Event(`loadstart`)),this.onloadstart&&this.onloadstart(new ProgressEvent$1(`loadstart`)),fetch$1(this._url,n).then(async e=>{if(!this._aborted){switch(this._timeoutId&&=(clearTimeout(this._timeoutId),null),this.status=e.status,this.statusText=e.statusText,this.responseURL=e.url,e.headers.forEach((e,t)=>{this._responseHeaders.set(t.toLowerCase(),e)}),this._setReadyState(2),this._setReadyState(3),this.responseType){case`arraybuffer`:{let t=await e.arrayBuffer();this.response=t,this.responseText=``;break}case`blob`:{let t=await e.arrayBuffer(),n=writeBlobToTempFile(new Uint8Array(t),this._url),r=new Blob([t],{type:this._responseHeaders.get(`content-type`)??``});r._tmpPath=n,this.response=r,this.responseText=``;break}case`json`:{let t=await e.text();this.responseText=``;try{this.response=t.length>0?JSON.parse(t):null}catch{this.response=null}break}case`document`:{let t=await e.text();this.responseText=t,this.response=t;break}default:{let t=await e.text(),n=t.charCodeAt(0)===65279?t.slice(1):t;this.responseText=n,this.response=n;break}}this._setReadyState(4),this.dispatchEvent(new ProgressEvent$1(`load`)),this.dispatchEvent(new ProgressEvent$1(`loadend`)),this.onload&&this.onload(new ProgressEvent$1(`load`)),this.onloadend&&this.onloadend(new ProgressEvent$1(`loadend`))}}).catch(e=>{if(this._timeoutId&&=(clearTimeout(this._timeoutId),null),this._aborted)return;this._setReadyState(4);let t=new ProgressEvent$1(`error`);this.dispatchEvent(t),this.onerror&&this.onerror(t),this.onloadend&&this.onloadend(new ProgressEvent$1(`loadend`))})}abort(){if(this._aborted)return;this._aborted=!0,this._timeoutId&&=(clearTimeout(this._timeoutId),null),this._controller.abort(),this.readyState!==0&&this.readyState!==4&&(this._setReadyState(4),this.status=0);let e=new ProgressEvent$1(`abort`);this.dispatchEvent(e),this.onabort&&this.onabort(e),this.onloadend&&this.onloadend(new ProgressEvent$1(`loadend`))}overrideMimeType(e){}_onTimeout(){if(this._aborted)return;this._aborted=!0,this._setReadyState(4);let e=new ProgressEvent$1(`timeout`);this.dispatchEvent(e),this.ontimeout&&this.ontimeout(e)}_setReadyState(e){this.readyState=e;let t=new Event(`readystatechange`);this.dispatchEvent(t),this.onreadystatechange&&this.onreadystatechange(t)}},XMLHttpRequestUpload=class extends EventTarget{onprogress=null;onloadstart=null;onloadend=null;onload=null;onerror=null;onabort=null;ontimeout=null};At(),Ft();const nn=new Set([`data:`,`http:`,`https:`,`file:`]);function rewriteFetchInput(e){if(typeof e!=`string`)return e;let t=resolveRootRelativeUrl(e);return t!==e&&globalThis.__GJSIFY_DEBUG_FETCH===!0&&console.log(`[fetch] rewrite ${e} → ${t}`),t}async function fetch$1(e,t={}){e=rewriteFetchInput(e);let n=new en(e,t),{parsedURL:i,options:a}=getSoupRequestOptions(n);if(!nn.has(i.protocol))throw TypeError(`@gjsify/fetch cannot load ${e}. URL scheme "${i.protocol.replace(/:$/,``)}" is not supported.`);if(i.protocol===`data:`){let{buffer:e,typeFull:t}=parseDataUri(n.url);return new Wt(Buffer.from(e),{headers:{"Content-Type":t}})}if(i.protocol===`file:`){let e=globalThis.__GJSIFY_DEBUG_FETCH===!0;e&&console.log(`[fetch] file:// ${n.url}`);try{let t=Vt.filename_from_uri(n.url)[0];e&&console.log(`[fetch] file:// path=${t}`);let[r,i]=Vt.file_get_contents(t);if(e&&console.log(`[fetch] file:// ok=${r} bytes=${i?.byteLength??`?`}`),!r)throw new FetchError(`Failed to read file: ${t}`,`system`);let a=i,o=new Uint8Array(a.byteLength);o.set(a);let s=new Wt(o);return e&&console.log(`[fetch] file:// response created`),s}catch(t){let r=t instanceof Error?t:Error(String(t));throw e&&console.warn(`[fetch] file:// FAIL: ${r.message}`),new FetchError(`request to ${n.url} failed, reason: ${r.message}`,`system`,r)}}let{signal:s}=n;if(s&&s.aborted)throw new AbortError(`The operation was aborted.`);let c,l;try{let e=await n._send(a);c=e.readable,l=e.cancellable}catch(e){if(s&&s.aborted)throw new AbortError(`The operation was aborted.`);let t=e instanceof Error?e:Error(String(e));throw new FetchError(`request to ${n.url} failed, reason: ${t.message}`,`system`,t)}let abortHandler=()=>{l.cancel()};s&&s.addEventListener(`abort`,abortHandler,{once:!0});let finalize=()=>{s&&s.removeEventListener(`abort`,abortHandler)};l.connect(()=>{c.destroy(new AbortError(`The operation was aborted.`))}),c.on(`error`,e=>{finalize()});let u=n._message,d=await loadSoup(),f=kt._newFromSoupMessage(d,u),p=u.status_code,m=u.get_reason_phrase();if(isRedirect(p)){let e=f.get(`Location`),r=null;try{r=e===null?null:new jt(e,n.url)}catch{if(n.redirect!==`manual`)throw c.destroy(),finalize(),new FetchError(`uri requested responds with an invalid redirect URL: ${e}`,`invalid-redirect`)}switch(n.redirect){case`error`:throw c.destroy(),finalize(),new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${n.url}`,`no-redirect`);case`manual`:break;case`follow`:{if(r===null)break;if(n.counter>=n.follow)throw c.destroy(),finalize(),new FetchError(`maximum redirect reached at: ${n.url}`,`max-redirect`);let e={headers:new kt(n.headers),follow:n.follow,counter:n.counter+1,agent:n.agent,compress:n.compress,method:n.method,body:clone(n),signal:n.signal,size:n.size,referrer:n.referrer,referrerPolicy:n.referrerPolicy};if(!isDomainOrSubdomain(n.url,r)||!isSameProtocol(n.url,r))for(let t of[`authorization`,`www-authenticate`,`cookie`,`cookie2`])e.headers.delete(t);if(p!==303&&n.body&&t.body instanceof o.Readable)throw c.destroy(),finalize(),new FetchError(`Cannot follow redirect with body being a readable stream`,`unsupported-redirect`);(p===303||(p===301||p===302)&&n.method===`POST`)&&(e.method=`GET`,e.body=void 0,e.headers.delete(`content-length`));let i=parseReferrerPolicyFromHeader(f);return i&&(e.referrerPolicy=i),await new Promise(e=>{c.once(`close`,()=>e()),c.resume()}),finalize(),fetch$1(new en(r,e))}default:throw c.destroy(),finalize(),TypeError(`Redirect option '${n.redirect}' is not a valid value of RequestRedirect`)}}let h={url:n.url,status:p,statusText:m,headers:f,size:n.size,counter:n.counter,highWaterMark:n.highWaterMark},g=f.get(`Content-Encoding`);if(!n.compress||n.method===`HEAD`||g===null||p===204||p===304)return finalize(),new Wt(c,h);if(typeof DecompressionStream<`u`){let e=null;if(g===`gzip`||g===`x-gzip`?e=`gzip`:(g===`deflate`||g===`x-deflate`)&&(e=`deflate`),e){let t=new r([await new Wt(c,h).arrayBuffer()]).stream().pipeThrough(new DecompressionStream(e));return finalize(),new Wt(t,h)}}return finalize(),new Wt(c,h)}__name$1(fetch$1,`fetch`);const rn=globalThis;globalThis.fetch===void 0&&(rn.fetch=fetch$1),globalThis.Headers===void 0&&(rn.Headers=kt),globalThis.Request===void 0&&(rn.Request=en),globalThis.Response===void 0&&(rn.Response=Wt),globalThis.XMLHttpRequest===void 0&&(globalThis.XMLHttpRequest=XMLHttpRequest),globalThis.XMLHttpRequestUpload===void 0&&(globalThis.XMLHttpRequestUpload=XMLHttpRequestUpload);const an=globalThis.URL;if(an&&an.__gjsify_objecturl!==!0){let e=new Map,t=an.createObjectURL?.bind(an),n=an.revokeObjectURL?.bind(an);an.createObjectURL=n=>{let r=n?._tmpPath;if(typeof r==`string`&&r.length>0){let t=`file://${r}`;return e.set(t,r),t}return t?t(n):`file:///dev/null`},an.revokeObjectURL=t=>{let r=e.get(t);r?(B.unlink(r),e.delete(t)):n&&n(t)},an.__gjsify_objecturl=!0}const on=e(import.meta.url);let sn;function load$4(){return sn===void 0&&(sn=on(`@gjsify/node-gi/gi`).requireGi(`Adw`,`1`)),sn}__name$1(load$4,`load`);var cn=new Proxy(Object.create(null),{get(e,t){return load$4()[t]},has(e,t){return t in load$4()}});function variantKindFor(e,t){switch(e){case`s`:case`b`:case`i`:case`u`:case`d`:return e}if(typeof t==`string`)return`s`;if(typeof t==`boolean`)return`b`;if(typeof t==`number`)return Number.isInteger(t)?`i`:`d`;throw Error(`Cannot build a GLib.Variant from ${typeof t}`)}function buildVariant(e,t){switch(variantKindFor(e?.dup_string()??null,t)){case`s`:return B.Variant.new_string(String(t));case`b`:return B.Variant.new_boolean(!!t);case`i`:return B.Variant.new_int32(Number(t));case`u`:return B.Variant.new_uint32(Number(t));case`d`:return B.Variant.new_double(Number(t))}}function describeActions(e){return e?e.list_actions().sort((e,t)=>e.localeCompare(t)).map(t=>({name:t,enabled:e.get_action_enabled(t),parameterType:e.get_action_parameter_type(t)?.dup_string()??null,stateType:e.get_action_state_type(t)?.dup_string()??null})):[]}function activateAction(e,t,n){let r=e.get_action_parameter_type(t),i=n==null?null:buildVariant(r,n);e.activate_action(t,i)}function changeActionState(e,t,n){e.change_action_state(t,buildVariant(e.get_action_state_type(t),n))}const ln=e(import.meta.url);let un;function load$3(){return un===void 0&&(un=ln(`@gjsify/node-gi/gi`).requireGi(`Gtk`,`4.0`)),un}__name$1(load$3,`load`);var W=new Proxy(Object.create(null),{get(e,t){return load$3()[t]},has(e,t){return t in load$3()}});const dn=new Map;function swapCss(e,t){let n=V.Display.get_default();if(!n)return!1;let r=dn.get(e);return r||(r=new W.CssProvider,W.StyleContext.add_provider_for_display(n,r,W.STYLE_PROVIDER_PRIORITY_USER+1),dn.set(e,r)),r.load_from_string(t),!0}function dumpCss(){return{providers:[...dn.keys()]}}const fn=`org.gjsify.Devtools`;function formatDbusErrorMessage(e,t){return`${e}: ${t}`}const pn={GetStatus:`read-only`,Screenshot:`read-only`,ListActions:`read-only`,ActivateAction:`mutating`,ChangeActionState:`mutating`,PresentWindow:`read-only`,ResizeWindow:`mutating`,ListToplevels:`read-only`,DumpTree:`read-only`,GetProperty:`read-only`,GetFocused:`read-only`,FindWidget:`read-only`,SendKey:`mutating`,ActivateWidget:`mutating`,DumpGSettings:`read-only`,DumpCss:`read-only`,SwapCss:`mutating`};function sanitizeInstanceId(e){let t=e.toLowerCase().replace(/[^a-z0-9]/g,``);return/^[a-z]/.test(t)?t:`i${t||`0`}`}function appIdToObjectPath(e){return`/${e.replace(/\./g,`/`).replace(/-/g,`_`)}`}function resolveBusAddress(e,t){let n=appIdToObjectPath(e),r=t&&t!=="default"?sanitizeInstanceId(t):`default`;return r==="default"?{busName:e,objectPath:`${n}/devtools`,instance:`default`}:{busName:`${e}.${r}`,objectPath:`${n}/${r}/devtools`,instance:r}}const mn=`GJSIFY_DEVTOOLS_ADDRESS`;function isDevtoolsEnabledValue(e){if(e==null)return!1;let t=e.toLowerCase();return t!==``&&t!==`0`&&t!==`false`}function devtoolsAddressFilePath(e,t,n){let{busName:r}=resolveBusAddress(t,n);return`${e}/gjsify-devtools/${r}.address`}function buildDevtoolsIfaceXml(e=[]){return`<node>
|
|
6
|
+
<interface name="${fn}">
|
|
7
7
|
<method name="GetStatus">
|
|
8
8
|
<arg type="s" direction="out" name="status_json"/>
|
|
9
9
|
</method>
|
|
@@ -74,16 +74,16 @@ import{createRequire as e}from"node:module";import"@gjsify/node-gi/globals";impo
|
|
|
74
74
|
</method>${e.length>0?`\n${e.join(`
|
|
75
75
|
`)}`:``}
|
|
76
76
|
</interface>
|
|
77
|
-
</node>`}function isWin32(){return mt.DIR_SEPARATOR===92}function defaultListenAddress(){return isWin32()?`nonce-tcp:host=127.0.0.1`:`unix:tmpdir=${mt.get_tmp_dir()}`}var DevtoolsPeerServerError=class extends Error{constructor(e,t,n,r){super(e),this.address=t,this.reason=n,this.name=`DevtoolsPeerServerError`,this.cause=r}};function isAddressInUse(e){return e instanceof mt.Error&&e.matches(dt.io_error_quark(),dt.IOErrorEnum.ADDRESS_IN_USE)}function unixSocketPath(e){if(!e.startsWith(`unix:`))return null;for(let t of e.slice(5).split(`,`)){let e=t.indexOf(`=`);if(!(e<0||t.slice(0,e)!==`path`))try{return decodeURIComponent(t.slice(e+1))}catch{return null}}return null}function inspectExistingSocket(e){try{if((dt.File.new_for_path(e).query_info(`unix::mode`,dt.FileQueryInfoFlags.NONE,null).get_attribute_uint32(`unix::mode`)&61440)!=49152)return`not-a-socket`}catch{return`not-a-socket`}let t=new dt.SocketClient;t.set_timeout(2);let n;try{n=t.connect(dt.UnixSocketAddress.new(e),null)}catch{return`dead`}return n.close(null),`live`}function clearReclaimableSocket(e){let t=unixSocketPath(e);if(!t||!mt.file_test(t,mt.FileTest.EXISTS))return;let n=inspectExistingSocket(t);if(n===`live`)throw new DevtoolsPeerServerError(`cannot listen on ${e}: another process is already listening there. Stop it, or point ${Tn} (or options.address) at a different socket — GJSIFY_DEVTOOLS_INSTANCE=<label> lets two devtools-enabled apps run side by side.`,e,`address-in-use`);if(n===`not-a-socket`)throw new DevtoolsPeerServerError(`cannot listen on ${e}: ${t} already exists and is not a socket, so it will NOT be removed. Point ${Tn} (or options.address) at a free path.`,e,`occupied-by-other-file`);try{dt.File.new_for_path(t).delete(null)}catch(n){throw new DevtoolsPeerServerError(`cannot listen on ${e}: ${t} is a socket nothing listens on, but removing it failed (${n}). Delete it by hand, or point ${Tn} at a free path.`,e,`address-in-use`,n)}console.log(`[gjsify-devtools] reclaimed the stale socket ${t}: nothing was listening on it (an abnormal exit — Ctrl-C, SIGKILL, a crash — leaves the inode behind).`)}function flagsForAddress(e){return e.startsWith(`tcp:`)||e.startsWith(`nonce-tcp:`)?dt.DBusServerFlags.NONE:dt.DBusServerFlags.AUTHENTICATION_REQUIRE_SAME_USER}function startDevtoolsPeerServer(e,t,n){let r=n&&n!==``?n:defaultListenAddress();clearReclaimableSocket(r);let i;try{i=dt.DBusServer.new_sync(r,flagsForAddress(r),dt.dbus_generate_guid(),null,null)}catch(e){let t=isAddressInUse(e);throw new DevtoolsPeerServerError(t?`cannot listen on ${r}: the address is already in use (${e}). Stop whatever holds it, or point ${Tn} (or options.address) at a different address.`:`cannot listen on ${r}: ${e}. Check the address form — \`unix:path=/tmp/app.sock\`, \`unix:tmpdir=/tmp\` or \`nonce-tcp:host=127.0.0.1\`.`,r,t?`address-in-use`:`listen-failed`,e)}let a=new Set;i.connect(`new-connection`,(n,r)=>(a.add(r),r.connect(`closed`,()=>{e.unexport(r),a.delete(r)}),e.export(r,t),!0)),i.start();let o=!1;return{address:i.get_client_address(),objectPath:t,get connectionCount(){return a.size},stop(){if(!o){o=!0,i.stop();for(let t of a)e.unexport(t),!t.is_closed()&&t.close(null,(e,t)=>{try{e.close_finish(t)}catch{}});a.clear()}}}}function writeDevtoolsAddressFile(e,t){try{if(mt.mkdir_with_parents(mt.path_get_dirname(e),448),!mt.file_set_contents(e,`${t}\n`))return null}catch(t){return console.error(`[gjsify-devtools] could not publish the peer address to ${e}: ${t}`),null}try{dt.File.new_for_path(e).set_attribute_uint32(`unix::mode`,384,dt.FileQueryInfoFlags.NONE,null)}catch(t){console.error(`[gjsify-devtools] could not restrict ${e} to the current user: ${t}`)}return e}function removeDevtoolsAddressFile(e){try{dt.File.new_for_path(e).delete(null)}catch{}}const En=e(import.meta.url);let Dn;function load$2(){return Dn===void 0&&(Dn=En(`@gjsify/node-gi/gi`).requireGi(`Graphene`,`1.0`)),Dn}__name$1(load$2,`load`);var On=new Proxy(Object.create(null),{get(e,t){return load$2()[t]},has(e,t){return t in load$2()}});function captureWidget(e){let t=e.get_native()?.get_renderer();if(!t)return{png:null,blocker:`no-renderer`};let n=e.get_width(),r=e.get_height();if(n<=0||r<=0)return{png:null,blocker:`zero-size`};let i=xn.WidgetPaintable.new(e),a=xn.Snapshot.new();i.snapshot(a,n,r);let o=a.to_node();if(!o)return{png:null,blocker:`empty-snapshot`};let s=new On.Rect;s.init(0,0,n,r);let c=t.render_texture(o,s).save_to_png_bytes().get_data();return c?{png:new Uint8Array(c)}:{png:null,blocker:`empty-png`}}function dumpGSettings(e){let t=dt.SettingsSchemaSource.get_default()?.lookup(e,!0);if(!t)throw Error(formatDbusErrorMessage(`not-found`,`GSettings schema '${e}' is not installed`));let n=new dt.Settings({settings_schema:t}),r={};for(let e of t.list_keys())r[e]=n.get_value(e).recursiveUnpack();return r}const kn=e(import.meta.url);let An;function load$1(){return An===void 0&&(An=kn(`@gjsify/node-gi/gi`).requireGi(`GObject`,`2.0`)),An}__name$1(load$1,`load`);var jn=new Proxy(Object.create(null),{get(e,t){return load$1()[t]},has(e,t){return t in load$1()}});function parseWidgetPath(e){let t=e.split(`/`).filter(e=>e.length>0);if(t.length===0)return null;let n=t[0].match(/^toplevel:(\d+)$/);if(!n)return null;let r=[];for(let e of t.slice(1)){let t=e.match(/^child:(\d+)$/);if(!t)return null;r.push(Number(t[1]))}return{toplevel:Number(n[1]),children:r}}function buildWidgetPath(e,t){return[`toplevel:${e}`,...t.map(e=>`child:${e}`)].join(`/`)}function widgetType(e){return gtypeName(e)??`GtkWidget`}function gtypeName(e){let t=e;return typeof t?.$typeName==`string`&&t.$typeName.length>0?t.$typeName:t?.constructor?.$gtype?.name??null}function widgetIsA(e,t){let n=gtypeName(e);if(n===null||!t)return!1;if(n===t)return!0;let r=jn.type_from_name(n),i=jn.type_from_name(t);return!r||!i?!1:jn.type_is_a(r,i)}function activateWidget(e){let t=e;if(typeof t.activate==`function`&&t.activate()===!0)return!0;let n=typeof t.get_parent==`function`?t.get_parent():null;if(n&&widgetIsA(n,`GtkListBox`)){let t=n,r=!1;return typeof t.select_row==`function`&&(t.select_row(e),r=!0),typeof t.emit==`function`&&(t.emit(`row-activated`,e),r=!0),r}return!1}function sendKeyToWidget(e,t,n){let r=e.observe_controllers(),i=!1;for(let e=0;e<r.get_n_items();e++){let a=r.get_item(e);widgetIsA(a,`GtkEventControllerKey`)&&(a.emit(`key-pressed`,t,0,n),i=!0)}return i}function nthChild(e,t){let n=e.get_first_child(),r=0;for(;n&&r<t;)n=n.get_next_sibling(),r++;return r===t?n:null}function listToplevels(){let e=xn.Window.get_toplevels(),t=e.get_n_items(),n=[];for(let r=0;r<t;r++){let t=e.get_item(r);t&&n.push({path:`toplevel:${r}`,type:widgetType(t),title:t.get_title?.()??null,mapped:t.get_mapped(),focused:t.is_active??!1})}return n}function resolveWidgetPath(e){let t=parseWidgetPath(e);if(!t)return null;let n=xn.Window.get_toplevels().get_item(t.toplevel);if(!n)return null;for(let e of t.children)if(n=nthChild(n,e),!n)return null;return n}function parseWidgetSelector(e){let t=e.indexOf(`:`),n=(t<0?e:e.slice(0,t)).trim(),r=(t<0?``:e.slice(t+1)).trim();return!n&&!r?null:{type:n,cssClass:r}}function findWidgetPath(e,t,n){let r={path:null};return walkForSelector(e,t,n,r)??r.path}function walkForSelector(e,t,n,r){if(!e.get_visible()||!e.get_mapped())return null;if(!t.cssClass||e.get_css_classes().includes(t.cssClass)){if(!t.type||widgetType(e)===t.type)return n;r.path===null&&widgetIsA(e,t.type)&&(r.path=n)}let i=e.get_first_child(),a=0;for(;i;){let e=walkForSelector(i,t,`${n}/child:${a}`,r);if(e)return e;i=i.get_next_sibling(),a++}return null}function geometryOf(e){if(!e.get_mapped())return;let t=e.get_allocation(),n=t.width+e.get_margin_start()+e.get_margin_end(),r=t.height+e.get_margin_top()+e.get_margin_bottom(),[i,a]=e.measure(xn.Orientation.HORIZONTAL,-1),o=n>0?Math.max(n,i):-1,[s,c]=e.measure(xn.Orientation.VERTICAL,o),l={width:n,height:r,widthRequest:[i,a],heightRequest:[s,c]};return(n<i||r<s)&&(l.short=!0),l}function dumpTree(e,t,n){let r={path:n,type:widgetType(e),name:e.get_name()||null,cssClasses:e.get_css_classes(),mapped:e.get_mapped(),visible:e.get_visible(),children:[]},i=geometryOf(e);if(i!==void 0&&(r.geometry=i),t<=0)return e.get_first_child()&&(r.truncated=!0),r;let a=e.get_first_child(),o=0;for(;a;)r.children.push(dumpTree(a,t-1,`${n}/child:${o}`)),a=a.get_next_sibling(),o++;return r}function jsonSafe(e){let t=typeof e;return e==null||t===`string`||t===`number`||t===`boolean`?e??null:`[${t}]`}function getWidgetProperty(e,t){let n=e,r=t.replace(/-/g,`_`),i=t.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase());for(let e of[t,r,i])if(e in n)return jsonSafe(n[e])}function childIndex(e,t){let n=e.get_first_child(),r=0;for(;n;){if(n===t)return r;n=n.get_next_sibling(),r++}return-1}function pathOfWidget(e){let t=[],n=e,r=n.get_parent();for(;r;){let e=childIndex(r,n);if(e<0)return null;t.unshift(e),n=r,r=n.get_parent()}let i=xn.Window.get_toplevels(),a=i.get_n_items();for(let e=0;e<a;e++)if(i.get_item(e)===n)return buildWidgetPath(e,t);return null}function isActiveWindowScope(e){return!e||e===`window`||e===`active`}function frameDelay(e){return new Promise(t=>{mt.timeout_add(mt.PRIORITY_DEFAULT,e,()=>(t(),mt.SOURCE_REMOVE))})}async function captureWidgetWhenRenderable(e,t=12,n=50){let r=null;for(let i=0;i<t;i++){let t=captureWidget(e);if(t.png)return{png:t.png,blocker:null};r=t.blocker,await frameDelay(n)}let i=captureWidget(e);return{png:i.png,blocker:i.png?null:i.blocker??r}}var DevtoolsService=class{constructor(e,t){this._app=e,this._options=t,this._exported=new Map,this._peer=null,this._addressFile=null,this._kinds=new Map,this._extensions=t.extend??[];for(let[e,t]of Object.entries(wn))this._kinds.set(e,t);for(let e of this._extensions){for(let[t,n]of Object.entries(e.methodKinds))this._kinds.set(t,n);for(let[t,n]of Object.entries(e.handlers)){let e=n;this[t]=(...n)=>(this._guard(t),e(...n))}}}export(e,t){if(this._exported.has(e))return;let n=buildDevtoolsIfaceXml(this._extensions.flatMap(e=>e.methodsXml??[])),r=dt.DBusExportedObject.wrapJSObject(n,this);r.export(e,t),this._exported.set(e,r)}unexport(e){if(e){this._exported.get(e)?.unexport(),this._exported.delete(e);return}for(let e of this._exported.values())e.unexport();this._exported.clear(),this._peer?.stop(),this._peer=null,this._addressFile&&=(removeDevtoolsAddressFile(this._addressFile),null)}attachPeerServer(e,t){this._peer=e,this._addressFile=t??null}get peerAddress(){return this._peer?.address??null}get addressFile(){return this._addressFile}GetStatus(){let e=this._app.get_active_window(),t={appId:this._app.get_application_id()??`unknown`,instance:this._options.instance??`default`,activeWindow:e?{id:e.get_name()||`window`,title:e.get_title()??``,mapped:e.get_mapped()}:null,toplevelCount:xn.Window.get_toplevels().get_n_items(),focusedWidget:null,paused:this._isPaused()};for(let e of this._extensions){let n=e.contributeStatus?.();n&&Object.assign(t,n)}return JSON.stringify(t)}async ScreenshotAsync(e,t){try{let n=typeof e?.[0]==`string`?e[0]:``,r=await this._captureScopePng(n);t.return_value(new mt.Variant(`(ay)`,[r]))}catch(e){t.return_dbus_error(`org.gjsify.Devtools.Error.Screenshot`,e instanceof Error?e.message:String(e))}}async _captureScopePng(e){let t=this._resolveRootWidget(e);if(!t){if(isActiveWindowScope(e))return new Uint8Array;throw Error(formatDbusErrorMessage(`not-found`,`no widget at '${e}'`))}let n=captureWidget(t.widget);if(n.png)return n.png;let r=t.widget.get_root();r instanceof xn.Window&&r.present();let i=await captureWidgetWhenRenderable(t.widget);return i.png?i.png:(console.warn(`[devtools] Screenshot('${e}') has no image: ${i.blocker??`unknown`} after 12 tries. Empty bytes follow.`),new Uint8Array)}ListActions(){let e={app:describeActions(this._actionGroup(`app`)),win:describeActions(this._actionGroup(`win`))};return JSON.stringify(e)}ActivateAction(e,t,n){this._guard(`ActivateAction`);let r=this._scope(e);activateAction(this._requireGroup(r,t),t,this._parseValue(n))}ChangeActionState(e,t,n){this._guard(`ChangeActionState`);let r=this._scope(e);changeActionState(this._requireGroup(r,t),t,this._parseValue(n))}PresentWindow(){this._app.get_active_window()?.present()}ResizeWindow(e,t){this._guard(`ResizeWindow`);let n=this._app.get_active_window();if(!n)throw Error(formatDbusErrorMessage(`unavailable`,`no active window to resize`));let r=Math.max(1,Math.round(e)),i=Math.max(1,Math.round(t));return n.is_maximized()&&n.unmaximize(),n.is_fullscreen()&&n.unfullscreen(),n.set_default_size(r,i),[r,i]}ListToplevels(){return JSON.stringify(listToplevels())}DumpTree(e,t){let n=this._resolveRootWidget(e);if(!n)throw Error(formatDbusErrorMessage(`not-found`,`no widget at '${e||`active window`}'`));return JSON.stringify(dumpTree(n.widget,t>0?t:40,n.path))}GetProperty(e,t){let n=this._resolveRootWidget(e);if(!n)throw Error(formatDbusErrorMessage(`not-found`,`no widget at '${e}'`));let r=getWidgetProperty(n.widget,t);if(r===void 0)throw Error(formatDbusErrorMessage(`not-found`,`widget has no property '${t}'`));return JSON.stringify(r)}GetFocused(){let e=this._app.get_active_window(),t=e?e.get_focus():null;return JSON.stringify(t?{path:pathOfWidget(t),name:t.get_name()||null,type:widgetType(t)}:null)}ActivateWidget(e){this._guard(`ActivateWidget`);let t=this._resolveRootWidget(e);if(!t)throw Error(formatDbusErrorMessage(`not-found`,`no widget at '${e}'`));return activateWidget(t.widget)}FindWidget(e){let t=parseWidgetSelector(e);if(!t)throw Error(formatDbusErrorMessage(`invalid-params`,`empty selector '${e}'`));let n=this._resolveRootWidget(``);return n?findWidgetPath(n.widget,t,n.path)??``:``}SendKey(e,t){this._guard(`SendKey`);let[n,r,i]=xn.accelerator_parse(e);if(!n)throw Error(formatDbusErrorMessage(`invalid-params`,`cannot parse accelerator '${e}'`));let a;if(a=t?this._resolveRootWidget(t)?.widget??null:this._app.get_active_window()?.get_focus()??null,!a)throw Error(formatDbusErrorMessage(`not-found`,`no widget at '${t||`focus`}'`));return sendKeyToWidget(a,r,i??0)}DumpGSettings(e){return JSON.stringify(dumpGSettings(e))}DumpCss(){return JSON.stringify(dumpCss())}SwapCss(e,t){return this._guard(`SwapCss`),swapCss(e,t)}_resolveRootWidget(e){if(isActiveWindowScope(e)){let e=this._app.get_active_window();return e?{widget:e,path:pathOfWidget(e)??`toplevel:0`}:null}let t=resolveWidgetPath(e);return t?{widget:t,path:e}:null}_isPaused(){return this._options.paused?.()??!1}_guard(e){let t=this._kinds.get(e);if(!t)throw Error(formatDbusErrorMessage(`internal`,`unclassified devtools method '${e}'`));if(t===`mutating`&&this._isPaused())throw Error(formatDbusErrorMessage(`paused`,`${e} rejected — external control is paused. Read-only methods keep working.`))}_scope(e){return e===`app`?`app`:`win`}_actionGroup(e){if(e===`app`)return this._app;if(this._options.winActionGroup)return this._options.winActionGroup;let t=this._app.get_active_window();return t instanceof xn.ApplicationWindow?t:null}_requireGroup(e,t){let n=this._actionGroup(e);if(!n)throw Error(formatDbusErrorMessage(`unavailable`,`no '${e}' action group`));if(!n.has_action(t))throw Error(formatDbusErrorMessage(`not-found`,`unknown action ${e}.${t}`));return n}_parseValue(e){if(!e||e===`null`)return null;try{return JSON.parse(e)}catch{throw Error(formatDbusErrorMessage(`invalid-params`,`value_json is not valid JSON: ${e}`))}}};const Mn=`DBUS_SESSION_BUS_ADDRESS`,Nn=new Set;function envEnabled(){return isDevtoolsEnabledValue(mt.getenv(`GJSIFY_DEVTOOLS`))}function envValue(e){let t=mt.getenv(e);return t&&t!==``?t:null}function sessionBusUsable(){if(!envValue(Mn))return!1;try{return dt.bus_get_sync(dt.BusType.SESSION,null),!0}catch{return!1}}function chooseDevtoolsTransport(e){return e.requestedAddress?{kind:`peer`,address:e.requestedAddress,reason:`requested`}:e.hasAppConnection?{kind:`session-bus`}:e.sessionBusUsable?{kind:`unregistered`}:{kind:`peer`,address:null,reason:`no-session-bus`}}function describeMissingConnection(e,t){return e?t?`[gjsify-devtools] the session bus answers but this application is not registered on it yet — call installDevtools() from the GtkApplication "startup" handler (the bus connection and object path exist only after registration).`:`[gjsify-devtools] ${Mn} is set (${e}) but no bus answers there — using the bus-less peer transport instead. On macOS this is the usual state: Homebrew's dbus listens on launchd, so the advertised address only works while that socket is live.`:`[gjsify-devtools] this machine has no session bus (${Mn} is unset) — using the bus-less peer transport instead. Point the bridge at the address below, or set ${Tn} on both the app and \`gjsify debug\` to pin it yourself.`}function installDevtools(e,t={}){if(!(t.enabled??envEnabled()))return null;let n=t.instance??envValue(`GJSIFY_DEVTOOLS_INSTANCE`)??void 0,r=new DevtoolsService(e,{...t,instance:n});try{return exportDevtools(e,r,t,n)}catch(e){return r.unexport(),console.error(`[gjsify-devtools] devtools stayed OFF, the app is unaffected — ${describeInstallFailure(e)}`),null}}function describeInstallFailure(e){return e instanceof DevtoolsPeerServerError||e instanceof Error?e.message:String(e)}function exportDevtools(e,t,n,r){let i=e.get_is_registered(),a=i?e.get_dbus_connection():null,o=i?e.get_dbus_object_path():null,s=envValue(Mn),c=!!(a&&o),l=c||sessionBusUsable(),u=chooseDevtoolsTransport({requestedAddress:n.address??envValue(Tn),hasAppConnection:c,sessionBusUsable:l}),d=e.get_application_id()??`unknown`,f=`${o??appIdToObjectPath(d)}/devtools`;if((u.kind===`unregistered`||u.kind===`peer`&&u.reason===`no-session-bus`)&&console.error(describeMissingConnection(s,l)),u.kind===`session-bus`&&a)t.export(a,f),console.log(`[gjsify-devtools] exported ${Cn} at ${f} (dest ${d})`);else if(u.kind===`peer`){let n=startDevtoolsPeerServer(t,f,u.address??void 0),i=writeDevtoolsAddressFile(devtoolsAddressFilePath(mt.get_user_runtime_dir(),d,r),n.address);t.attachPeerServer(n,i),console.log(`[gjsify-devtools] exported ${Cn} at ${f} (peer address ${n.address}${i?`, published to ${i}`:``})`),i&&e.connect(`shutdown`,()=>removeDevtoolsAddressFile(i))}return Nn.add(t),t}const Pn=`&(?![a-zA-Z][a-zA-Z0-9]*;|#\\d+;|#x[0-9a-fA-F]+;)|<(?![a-zA-Z/!?])`;RegExp(Pn),RegExp(Pn,`g`);var Linkable=class{constructor(e){this._=0,this._references=[],this._refCount=0,this._pendingDelete=!1,this._binding=0,this._=e,this._references=[],this._refCount=0,this._pendingDelete=!1,this._binding=0}_link(e){return this._references.push(e),e._refCount+=1,!0}_unlink(e){let t=this._references.indexOf(e);if(t<0)return!1;for(;t>=0;)this._references[t]=this._references[this._references.length-1],this._references.pop(),--e._refCount,e._checkDelete(),t=this._references.indexOf(e);return!0}_linked(e){return this._references.indexOf(e)>=0}_checkDelete(){if(this._refCount<=0&&this._pendingDelete&&this._!==0){for(;this._references.length>0;)this._unlink(this._references[0]);this._performDelete(),this._=0}}_performDelete(){}},WebGLBuffer=class extends Linkable{constructor(e,t){super(e),this._size=0,this._elements=new Uint8Array,this._ctx=t}_performDelete(){let e=this._ctx;delete e._buffers[this._|0],e._gl.deleteBuffer(this._)}},WebGLUniformLocation=class{constructor(e,t,n){this._linkCount=0,this._array=null,this._=e,this._program=t,this._linkCount=t._linkCount,this._activeInfo=n,this._array=null}},WebGLDrawingBufferWrapper=class{constructor(e,t,n){this._framebuffer=e,this._color=t,this._depthStencil=n}},WebGLFramebuffer=class extends Linkable{constructor(e,t){if(super(e),this._binding=0,this._width=0,this._height=0,this._status=null,this._ctx=t,this._attachments={},this._attachments[t.COLOR_ATTACHMENT0]=null,this._attachments[t.DEPTH_ATTACHMENT]=null,this._attachments[t.STENCIL_ATTACHMENT]=null,this._attachments[t.DEPTH_STENCIL_ATTACHMENT]=null,this._attachmentLevel={},this._attachmentLevel[t.COLOR_ATTACHMENT0]=0,this._attachmentLevel[t.DEPTH_ATTACHMENT]=0,this._attachmentLevel[t.STENCIL_ATTACHMENT]=0,this._attachmentLevel[t.DEPTH_STENCIL_ATTACHMENT]=0,this._attachmentFace={},this._attachmentFace[t.COLOR_ATTACHMENT0]=0,this._attachmentFace[t.DEPTH_ATTACHMENT]=0,this._attachmentFace[t.STENCIL_ATTACHMENT]=0,this._attachmentFace[t.DEPTH_STENCIL_ATTACHMENT]=0,t._extensions.webgl_draw_buffers){let e=t._extensions.webgl_draw_buffers;this._attachments[e.COLOR_ATTACHMENT1_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT2_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT3_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT4_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT5_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT6_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT7_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT8_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT9_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT10_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT11_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT12_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT13_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT14_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT15_WEBGL]=null,this._attachments[t.NONE]=null,this._attachments[t.BACK]=null,this._attachmentLevel[e.COLOR_ATTACHMENT1_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT2_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT3_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT4_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT5_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT6_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT7_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT8_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT9_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT10_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT11_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT12_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT13_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT14_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT15_WEBGL]=0,this._attachmentLevel[t.NONE]=null,this._attachmentLevel[t.BACK]=null,this._attachmentFace[e.COLOR_ATTACHMENT1_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT2_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT3_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT4_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT5_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT6_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT7_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT8_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT9_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT10_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT11_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT12_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT13_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT14_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT15_WEBGL]=0,this._attachmentFace[t.NONE]=null,this._attachmentFace[t.BACK]=null}}_clearAttachment(e){let t=this._attachments[e];t&&(this._attachments[e]=null,this._unlink(t))}_setAttachment(e,t){this._attachments[t]!==e&&(this._clearAttachment(t),e&&(this._attachments[t]=e,this._link(e)))}_performDelete(){let e=this._ctx;delete e._framebuffers[this._|0],e._gl.deleteFramebuffer(this._|0)}},WebGLRenderbuffer=class extends Linkable{constructor(e,t){super(e),this._binding=0,this._width=0,this._height=0,this._format=0,this._ctx=t,this._binding=0,this._width=0,this._height=0,this._format=0}_performDelete(){let e=this._ctx;delete e._renderbuffers[this._|0],e._gl.deleteRenderbuffer(this._)}},WebGLTexture=class extends Linkable{constructor(e,t){super(e),this._binding=0,this._levelWidth=new Int32Array(32),this._levelHeight=new Int32Array(32),this._format=0,this._type=0,this._complete=!0,this._swizzled=!1,this._ctx=t}_performDelete(){let e=this._ctx;delete e._textures[this._|0],e._gl.deleteTexture(this._|0)}},WebGLProgram$1=class extends Linkable{static{__name$1(this,`WebGLProgram`)}constructor(e,t){super(e),this._linkCount=0,this._linkStatus=!1,this._linkInfoLog=`not linked`,this._attributes=[],this._uniforms=[],this._ctx=t,this._linkCount=0,this._linkStatus=!1,this._linkInfoLog=`not linked`,this._attributes=[],this._uniforms=[]}_performDelete(){let e=this._ctx;delete e._programs[this._|0],e._gl.deleteProgram(this._|0)}},WebGLShader$1=class extends Linkable{static{__name$1(this,`WebGLShader`)}constructor(e,t,n){super(e),this._source=``,this._userSource=``,this._needsDesktop=!1,this._desktopSpelled=!1,this._compileStatus=!1,this._compileInfo=``,this._needsRecompile=!1,this._type=n,this._ctx=t,this._source=``,this._compileStatus=!1,this._compileInfo=``}_performDelete(){let e=this._ctx;delete e._shaders[this._|0],e._gl.deleteShader(this._|0)}},WebGLShaderPrecisionFormat=class{constructor(e){this.rangeMin=e.rangeMin,this.rangeMax=e.rangeMax,this.precision=e.precision}},WebGLActiveInfo=class{constructor(e){this.size=e.size,this.type=e.type,this.name=e.name}},EXTBlendMinMax=class{constructor(){this.MIN_EXT=32775,this.MAX_EXT=32776}};function getEXTBlendMinMax(e){let t=null,n=e.getSupportedExtensions();return n&&n.indexOf(`EXT_blend_minmax`)>=0&&(t=new EXTBlendMinMax),t}var EXTColorBufferFloat=class{};function getEXTColorBufferFloat(e){let t=e.getSupportedExtensions();return t&&t.indexOf(`EXT_color_buffer_float`)>=0?new EXTColorBufferFloat:null}var EXTColorBufferHalfFloat=class{};function getEXTColorBufferHalfFloat(e){let t=e.getSupportedExtensions();return t&&t.indexOf(`EXT_color_buffer_half_float`)>=0?new EXTColorBufferHalfFloat:null}var EXTTextureFilterAnisotropic=class{constructor(){this.TEXTURE_MAX_ANISOTROPY_EXT=34046,this.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047}};function getEXTTextureFilterAnisotropic(e){let t=null,n=e.getSupportedExtensions();return n&&n.indexOf(`EXT_texture_filter_anisotropic`)>=0&&(t=new EXTTextureFilterAnisotropic),t}var OESElementIndexUint=class{};function getOESElementIndexUint(e){let t=null,n=e.getSupportedExtensions();return n&&n.indexOf(`OES_element_index_uint`)>=0&&(t=new OESElementIndexUint),t}var OESStandardDerivatives=class{constructor(){this.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723}};function getOESStandardDerivatives(e){let t=null,n=e.getSupportedExtensions();return n&&n.indexOf(`OES_standard_derivatives`)>=0&&(t=new OESStandardDerivatives),t}var OESTextureFloatLinear=class{};function getOESTextureFloatLinear(e){let t=null,n=e.getSupportedExtensions();return n&&n.indexOf(`OES_texture_float_linear`)>=0&&(t=new OESTextureFloatLinear),t}var OESTextureFloat=class{};function getOESTextureFloat(e){let t=null,n=e.getSupportedExtensions();return n&&n.indexOf(`OES_texture_float`)>=0&&(t=new OESTextureFloat),t}var OESTextureHalfFloat=class{constructor(){this.HALF_FLOAT_OES=36193}};function getOESTextureHalfFloat(e){let t=e.getSupportedExtensions();return t&&t.indexOf(`OES_texture_half_float`)>=0||e._native2?new OESTextureHalfFloat:null}var STACKGLDestroyContext=class{constructor(e){this.destroy=e.destroy.bind(e)}};function getSTACKGLDestroyContext(e){return new STACKGLDestroyContext(e)}var STACKGLResizeDrawingBuffer=class{constructor(e){this.resize=e.resize.bind(e)}};function getSTACKGLResizeDrawingBuffer(e){return new STACKGLResizeDrawingBuffer(e)}var WEBGLDebugRendererInfo=class{constructor(){this.UNMASKED_VENDOR_WEBGL=37445,this.UNMASKED_RENDERER_WEBGL=37446}};function getWEBGLDebugRendererInfo(e){return new WEBGLDebugRendererInfo}var WebGLContextAttributes=class{constructor(e,t,n,r,i,a,o,s){this.alpha=e,this.depth=t,this.stencil=n,this.antialias=r,this.premultipliedAlpha=i,this.preserveDrawingBuffer=a,this.preferLowPowerToHighPerformance=o,this.failIfMajorPerformanceCaveat=s}},WebGLTextureUnit=class{constructor(e,t){this._mode=0,this._bind2D=null,this._bindCube=null,this._ctx=e,this._idx=t}},WebGLVertexArrayObjectAttribute=class{constructor(e,t){this._isPointer=!1,this._pointerBuffer=null,this._pointerOffset=0,this._pointerSize=0,this._pointerStride=0,this._pointerType=0,this._pointerNormal=!1,this._divisor=0,this._inputSize=4,this._inputStride=0,this._ctx=e,this._idx=t,this._pointerType=e.FLOAT,this._clear()}_clear(){this._isPointer=!1,this._pointerBuffer=null,this._pointerOffset=0,this._pointerSize=0,this._pointerStride=0,this._pointerType=this._ctx.FLOAT,this._pointerNormal=!1,this._divisor=0,this._inputSize=4,this._inputStride=0}},WebGLVertexArrayGlobalAttribute=class{constructor(e){this._idx=0,this._idx=e,this._data=new Float32Array([0,0,0,1])}},WebGLVertexArrayObjectState=class{constructor(e){this._elementArrayBufferBinding=null;let t=e.getParameter(e.MAX_VERTEX_ATTRIBS);this._attribs=Array.from({length:t});for(let n=0;n<t;++n)this._attribs[n]=new WebGLVertexArrayObjectAttribute(e,n);this._elementArrayBufferBinding=null}setElementArrayBuffer(e){if(e!==null&&!(e instanceof WebGLBuffer))throw TypeError(`setElementArrayBuffer(WebGLBuffer?)`);let t=this._elementArrayBufferBinding;t!==e&&(t&&(--t._refCount,t._checkDelete()),e&&(e._refCount+=1),this._elementArrayBufferBinding=e)}cleanUp(){let e=this._elementArrayBufferBinding;e&&(--e._refCount,e._checkDelete(),this._elementArrayBufferBinding=null);for(let e=0;e<this._attribs.length;++e){let t=this._attribs[e];t._pointerBuffer&&(--t._pointerBuffer._refCount,t._pointerBuffer._checkDelete()),t._clear()}}releaseArrayBuffer(e){if(e)for(let t=0;t<this._attribs.length;++t){let n=this._attribs[t];n._pointerBuffer===e&&(--n._pointerBuffer._refCount,n._pointerBuffer._checkDelete(),n._clear())}}setVertexAttribPointer(e,t,n,r,i,a,o,s,c){let l=this._attribs[t];e!==l._pointerBuffer&&(l._pointerBuffer&&(--l._pointerBuffer._refCount,l._pointerBuffer._checkDelete()),e&&(e._refCount+=1),l._pointerBuffer=e),l._pointerSize=n,l._pointerOffset=r,l._pointerStride=i,l._pointerType=a,l._pointerNormal=o,l._inputStride=s,l._inputSize=c}},WebGLVertexArrayGlobalState=class{constructor(e){this._arrayBufferBinding=null;let t=e.getParameter(e.MAX_VERTEX_ATTRIBS);this._attribs=Array.from({length:t});for(let e=0;e<t;++e)this._attribs[e]=new WebGLVertexArrayGlobalAttribute(e);this._arrayBufferBinding=null}setArrayBuffer(e){if(e!==null&&!(e instanceof WebGLBuffer))throw TypeError(`setArrayBuffer(WebGLBuffer?)`);let t=this._arrayBufferBinding;t!==e&&(t&&(--t._refCount,t._checkDelete()),e&&(e._refCount+=1),this._arrayBufferBinding=e)}};function checkObject(e){return typeof e==`object`||e===void 0}function checkUniform(e,t){return t instanceof WebGLUniformLocation&&t._program===e&&t._linkCount===e._linkCount}function isTypedArray$1(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Uint32Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array}__name$1(isTypedArray$1,`isTypedArray`);function isValidString(e){let t=e.replace(/(?:\/\*(?:[\s\S]*?)\*\/)|(?:([\s;])+\/\/(?:.*)$)/gm,``);return!/["$`@\\'\0]/.test(t)}function vertexCount(e,t,n){switch(t){case e.TRIANGLES:return n-n%3;case e.LINES:return n-n%2;case e.LINE_LOOP:case e.POINTS:return n;case e.TRIANGLE_FAN:case e.LINE_STRIP:return n<2?0:n;case e.TRIANGLE_STRIP:return n<3?0:n;default:return-1}}function typeSize(e,t){switch(t){case e.UNSIGNED_BYTE:case e.BYTE:return 1;case e.UNSIGNED_SHORT:case e.SHORT:return 2;case e.UNSIGNED_INT:case e.INT:case e.FLOAT:return 4}return 0}function uniformTypeSize(e,t){switch(t){case e.BOOL_VEC4:case e.INT_VEC4:case e.FLOAT_VEC4:return 4;case e.BOOL_VEC3:case e.INT_VEC3:case e.FLOAT_VEC3:return 3;case e.BOOL_VEC2:case e.INT_VEC2:case e.FLOAT_VEC2:return 2;case e.BOOL:case e.INT:case e.FLOAT:case e.SAMPLER_2D:case e.SAMPLER_CUBE:return 1;default:return 0}}const listToArray=e=>{let t=[];for(let n of e.values())t.push(n);return t};function arrayToUint8Array(e){if(isTypedArray$1(e))return new Uint8Array(e.buffer).subarray(e.byteOffset,e.byteLength+e.byteOffset);if(Array.isArray(e)||e instanceof ArrayBuffer)return new Uint8Array(e);if(typeof e.values==`function`)return new Uint8Array(listToArray(e));throw Error(`Can't unpack typed array!`)}function Uint8ArrayToVariant(e){return new Xt.Variant(`ay`,e)}const extractImageData=e=>{let t=e.width,n=e.height;if(typeof e==`object`&&t!==void 0&&n!==void 0){if(e.data!==void 0)return e;let r=null;if(typeof e.getContext==`function`)r=e.getContext(`2d`);else if(typeof e.isPixbuf==`function`&&e.isPixbuf())return e.getImageData();else if(e.src!==void 0&&typeof document==`object`&&typeof document.createElement==`function`){let i=document.createElement(`canvas`);typeof i==`object`&&typeof i.getContext==`function`&&(i.width=t,i.height=n,r=i.getContext(`2d`),r!==null&&r.drawImage(e,0,0))}if(r!==null)return r.getImageData(0,0,t,n)}return null};function formatSize(e,t){switch(t){case e.ALPHA:case e.LUMINANCE:return 1;case e.LUMINANCE_ALPHA:return 2;case e.RGB:return 3;case e.RGBA:return 4}return 0}function convertPixels(e){if(typeof e==`object`&&e){if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint8ClampedArray||e instanceof Float32Array)return arrayToUint8Array(e);if(e instanceof Buffer)return new Uint8Array(e)}return null}function checkFormat(e,t){return t===e.ALPHA||t===e.LUMINANCE_ALPHA||t===e.LUMINANCE||t===e.RGB||t===e.RGBA}function validCubeTarget(e,t){return t===e.TEXTURE_CUBE_MAP_POSITIVE_X||t===e.TEXTURE_CUBE_MAP_NEGATIVE_X||t===e.TEXTURE_CUBE_MAP_POSITIVE_Y||t===e.TEXTURE_CUBE_MAP_NEGATIVE_Y||t===e.TEXTURE_CUBE_MAP_POSITIVE_Z||t===e.TEXTURE_CUBE_MAP_NEGATIVE_Z}function flag(e,t,n){return!e||typeof e!=`object`||!(t in e)?n:!!e[t]}function premultiplyAlpha(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=4){let r=e[n+3]/255;t[n]=Math.round(e[n]*r),t[n+1]=Math.round(e[n+1]*r),t[n+2]=Math.round(e[n+2]*r),t[n+3]=e[n+3]}return t}const Fn=6406,In=6409,Ln=6410,Rn=6403,zn=6404,Bn=[36418,36419,36420,36421],Vn=[Rn,zn,6405,Fn];function isLegacyFormat(e){return e===Fn||e===In||e===Ln}function coreStorageForLegacyFormat(e,t){if(!isLegacyFormat(e))return null;let n=e===Ln,r;switch(t){case 5121:r=n?33323:33321;break;case 5126:r=n?33328:33326;break;case 5131:case 36193:r=n?33327:33325;break;default:return null}return{internalFormat:r,format:n?33319:Rn,swizzle:legacySwizzle(e)}}function legacySwizzle(e){return e===Fn?[0,0,0,Rn]:e===In?[Rn,Rn,Rn,1]:[Rn,Rn,Rn,zn]}function textureParameterTarget(e){return e>=34069&&e<=34074?34067:e}function extractLegacyChannels(e,t){let n=e.length>>2;if(t===Ln){let t=new Uint8Array(n*2);for(let r=0;r<n;++r)t[2*r]=e[4*r],t[2*r+1]=e[4*r+3];return t}let r=t===Fn?3:0,i=new Uint8Array(n);for(let t=0;t<n;++t)i[t]=e[4*t+r];return i}const Hn={bindBuffer(e=0,t){if(!checkObject(t))throw TypeError(`bindBuffer(GLenum, WebGLBuffer)`);if(e!==this.ARRAY_BUFFER&&e!==this.ELEMENT_ARRAY_BUFFER){this.setError(this.INVALID_ENUM);return}if(!t)t=null,this._gl.bindBuffer(e,0);else if(t._pendingDelete)return;else if(this._checkWrapper(t,WebGLBuffer)){if(t._binding&&t._binding!==e){this.setError(this.INVALID_OPERATION);return}t._binding=e|0,this._gl.bindBuffer(e,t._|0)}else return;e===this.ARRAY_BUFFER?this._vertexGlobalState.setArrayBuffer(t):this._vertexObjectState.setElementArrayBuffer(t)},bufferData(e=0,t,n=0){let r=0,i=null;if(typeof t==`number`?r=t:typeof t==`object`&&(i=t),n!==this.STREAM_DRAW&&n!==this.STATIC_DRAW&&n!==this.DYNAMIC_DRAW){this.setError(this.INVALID_ENUM);return}if(e!==this.ARRAY_BUFFER&&e!==this.ELEMENT_ARRAY_BUFFER){this.setError(this.INVALID_ENUM);return}let a=this._getActiveBuffer(e);if(!a){this.setError(this.INVALID_OPERATION);return}if(i){let t=null;if(isTypedArray$1(i)||i instanceof DataView||i instanceof ArrayBuffer)t=arrayToUint8Array(i);else{this.setError(this.INVALID_VALUE);return}this._saveError(),this._gl.bufferData(e,Uint8ArrayToVariant(t),n);let r=this.getError();if(this._restoreError(r),r!==this.NO_ERROR)return;a._size=t.length,e===this.ELEMENT_ARRAY_BUFFER&&(a._elements=new Uint8Array(t))}else if(typeof t==`number`){if(r<0){this.setError(this.INVALID_VALUE);return}this._saveError(),this._gl.bufferDataSizeOnly(e,r,n);let t=this.getError();if(this._restoreError(t),t!==this.NO_ERROR)return;a._size=r,e===this.ELEMENT_ARRAY_BUFFER&&(a._elements=new Uint8Array(r))}else this.setError(this.INVALID_VALUE)},bufferSubData(e=0,t=0,n){if(e!==this.ARRAY_BUFFER&&e!==this.ELEMENT_ARRAY_BUFFER){this.setError(this.INVALID_ENUM);return}if(typeof n!=`object`||!n)throw TypeError(`bufferSubData: data must be a BufferSource`);let r=this._getActiveBuffer(e);if(!r){this.setError(this.INVALID_OPERATION);return}if(t<0||t>=r._size){this.setError(this.INVALID_VALUE);return}let i=null;if(isTypedArray$1(n)||n instanceof DataView||n instanceof ArrayBuffer)i=arrayToUint8Array(n);else{this.setError(this.INVALID_VALUE);return}if(t+i.length>r._size){this.setError(this.INVALID_VALUE);return}e===this.ELEMENT_ARRAY_BUFFER&&r._elements.set(i,t),this._gl.bufferSubData(e,t,Uint8ArrayToVariant(i))},createBuffer(){let e=this._gl.createBuffer();if(!e||e<=0)return null;let t=new WebGLBuffer(e,this);return this._buffers[e]=t,t},deleteBuffer(e){if(!checkObject(e)||e!==null&&!(e instanceof WebGLBuffer))throw TypeError(`deleteBuffer(WebGLBuffer)`);if(!(e instanceof WebGLBuffer&&this._checkOwns(e))){this.setError(this.INVALID_OPERATION);return}this._vertexGlobalState._arrayBufferBinding===e&&this.bindBuffer(this.ARRAY_BUFFER,null),this._vertexObjectState._elementArrayBufferBinding===e&&this.bindBuffer(this.ELEMENT_ARRAY_BUFFER,null),this._vertexObjectState===this._defaultVertexObjectState&&this._vertexObjectState.releaseArrayBuffer(e),e._pendingDelete=!0,e._checkDelete()},getBufferParameter(e=0,t=0){if(e!==this.ARRAY_BUFFER&&e!==this.ELEMENT_ARRAY_BUFFER)return this.setError(this.INVALID_ENUM),null;switch(t){case this.BUFFER_SIZE:case this.BUFFER_USAGE:return this._gl.getBufferParameteriv(e|0,t|0)[0];default:return this.setError(this.INVALID_ENUM),null}},_getActiveBuffer(e){return e===this.ARRAY_BUFFER?this._vertexGlobalState._arrayBufferBinding:e===this.ELEMENT_ARRAY_BUFFER?this._vertexObjectState._elementArrayBufferBinding:null}};function installBufferBindingMethods(e){Object.assign(e,Hn)}const Un={drawArrays(e=0,t=0,n=0){if(t<0||n<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let r=vertexCount(this,e,n);if(r<0){this.setError(this.INVALID_ENUM);return}if(!this._framebufferOk()||n===0)return;let i=t;n>0&&(i=n+t-1>>>0),this._checkVertexAttribState(i)&&this._gl.drawArrays(e,t,r)},drawElements(e=0,t=0,n=0,r=0){if(t<0||r<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let i=this._vertexObjectState._elementArrayBufferBinding;if(!i){this.setError(this.INVALID_OPERATION);return}let a=null,o=r;if(n===this.UNSIGNED_SHORT){if(o%2){this.setError(this.INVALID_OPERATION);return}o>>=1,a=new Uint16Array(i._elements.buffer)}else if(this._extensions.oes_element_index_uint&&n===this.UNSIGNED_INT){if(o%4){this.setError(this.INVALID_OPERATION);return}o>>=2,a=new Uint32Array(i._elements.buffer)}else if(n===this.UNSIGNED_BYTE)a=i._elements;else{this.setError(this.INVALID_ENUM);return}let s=t;switch(e){case this.TRIANGLES:t%3&&(s-=t%3);break;case this.LINES:t%2&&(s-=t%2);break;case this.POINTS:break;case this.LINE_LOOP:case this.LINE_STRIP:if(t<2){this.setError(this.INVALID_OPERATION);return}break;case this.TRIANGLE_FAN:case this.TRIANGLE_STRIP:if(t<3){this.setError(this.INVALID_OPERATION);return}break;default:this.setError(this.INVALID_ENUM);return}if(!this._framebufferOk())return;if(t===0){this._checkVertexAttribState(0);return}if(t+o>>>0>a.length){this.setError(this.INVALID_OPERATION);return}let c=-1;for(let e=o;e<o+t;++e)c=Math.max(c,a[e]);if(c<0){this._checkVertexAttribState(0);return}this._checkVertexAttribState(c)&&s>0&&this._gl.drawElements(e,s,n,r)},viewport(e,t,n,r){this._viewport[0]=e|0,this._viewport[1]=t|0,this._viewport[2]=n|0,this._viewport[3]=r|0,this._gl.viewport(e,t,n,r)},scissor(e,t,n,r){this._scissorBox[0]=e|0,this._scissorBox[1]=t|0,this._scissorBox[2]=n|0,this._scissorBox[3]=r|0,this._gl.scissor(e|0,t|0,n|0,r|0)},readPixels(e=0,t=0,n=0,r=0,i=0,a=0,o){if(!o)return;if(!(this._extensions.oes_texture_float&&a===this.FLOAT&&i===this.RGBA)){if(i===this.RGB||i===this.ALPHA||a!==this.UNSIGNED_BYTE){this.setError(this.INVALID_OPERATION);return}else if(i!==this.RGBA){this.setError(this.INVALID_ENUM);return}else if(n<0||r<0||!(o instanceof Uint8Array)){this.setError(this.INVALID_VALUE);return}}if(!this._framebufferOk()){console.error(`framebuffer is not okay!`);return}let s=n*4;s%this._packAlignment!==0&&(s+=this._packAlignment-s%this._packAlignment);let c=s*(r-1)+n*4;if(c<=0)return;if((o.length||o.byteLength||0)<c){this.setError(this.INVALID_VALUE);return}let l=this.drawingBufferWidth,u=this.drawingBufferHeight;this._activeFramebuffer&&(l=this._activeFramebuffer._width,u=this._activeFramebuffer._height);let d=arrayToUint8Array(o);if(e>=l||e+n<=0||t>=u||t+r<=0)for(let e=0;e<d.length;++e)d[e]=0;else if(e<0||e+n>l||t<0||t+r>u){for(let e=0;e<d.length;++e)d[e]=0;let o=e,c=n;e<0&&(c+=e,o=0),o+n>l&&(c=l-o);let f=t,p=r;t<0&&(p+=t,f=0),f+r>u&&(p=u-f);let m=c*4;if(m%this._packAlignment!==0&&(m+=this._packAlignment-m%this._packAlignment),c>0&&p>0){let n=new Uint8Array(m*p),r=this._gl.readPixels(o,f,c,p,i,a,Uint8ArrayToVariant(n)),l=r&&r.length>0?r:n,u=4*(o-e)+(f-t)*s;for(let e=0;e<p;++e)for(let t=0;t<c;++t)for(let n=0;n<4;++n)d[u+e*s+4*t+n]=l[e*m+4*t+n]}}else{let o=this._gl.readPixels(e,t,n,r,i,a,Uint8ArrayToVariant(d));o&&o.length>0&&d.set(o)}},enableVertexAttribArray(e){if(e<0||e>=this._vertexObjectState._attribs.length){this.setError(this.INVALID_VALUE);return}this._gl.enableVertexAttribArray(e),this._vertexObjectState._attribs[e]._isPointer=!0},disableVertexAttribArray(e=0){if(e<0||e>=this._vertexObjectState._attribs.length){this.setError(this.INVALID_VALUE);return}this._gl.disableVertexAttribArray(e),this._vertexObjectState._attribs[e]._isPointer=!1},vertexAttrib1f(e,t){if(e|=0,!this._checkVertexIndex(e))return;let n=this._vertexGlobalState._attribs[e]._data;n[3]=1,n[1]=n[2]=0,n[0]=t,this._gl.vertexAttrib1f(e|0,+t)},vertexAttrib1fv(e,t){if(e|=0,!this._checkVertexIndex(e))return;if(typeof t!=`object`||!t||t.length<1){this.setError(this.INVALID_OPERATION);return}let n=this._vertexGlobalState._attribs[e]._data;n[3]=1,n[2]=0,n[1]=0,n[0]=t[0],this._gl.vertexAttrib1f(e|0,+t[0])},vertexAttrib2f(e,t,n){if(e|=0,!this._checkVertexIndex(e))return;let r=this._vertexGlobalState._attribs[e]._data;r[3]=1,r[2]=0,r[1]=n,r[0]=t,this._gl.vertexAttrib2f(e|0,+t,+n)},vertexAttrib2fv(e,t){if(e|=0,!this._checkVertexIndex(e))return;if(typeof t!=`object`||!t||t.length<2){this.setError(this.INVALID_OPERATION);return}let n=this._vertexGlobalState._attribs[e]._data;n[3]=1,n[2]=0,n[1]=t[1],n[0]=t[0],this._gl.vertexAttrib2f(e|0,+t[0],+t[1])},vertexAttrib3f(e,t,n,r){if(e|=0,!this._checkVertexIndex(e))return;let i=this._vertexGlobalState._attribs[e]._data;i[3]=1,i[2]=r,i[1]=n,i[0]=t,this._gl.vertexAttrib3f(e|0,+t,+n,+r)},vertexAttrib3fv(e,t){if(e|=0,!this._checkVertexIndex(e))return;if(typeof t!=`object`||!t||t.length<3){this.setError(this.INVALID_OPERATION);return}let n=this._vertexGlobalState._attribs[e]._data;n[3]=1,n[2]=t[2],n[1]=t[1],n[0]=t[0],this._gl.vertexAttrib3f(e|0,+t[0],+t[1],+t[2])},vertexAttrib4f(e=0,t,n,r,i){if(!this._checkVertexIndex(e))return;let a=this._vertexGlobalState._attribs[e]._data;a[3]=i,a[2]=r,a[1]=n,a[0]=t,this._gl.vertexAttrib4f(e|0,+t,+n,+r,+i)},vertexAttrib4fv(e,t){if(e|=0,!this._checkVertexIndex(e))return;if(typeof t!=`object`||!t||t.length<4){this.setError(this.INVALID_OPERATION);return}let n=this._vertexGlobalState._attribs[e]._data;n[3]=t[3],n[2]=t[2],n[1]=t[1],n[0]=t[0],this._gl.vertexAttrib4f(e|0,+t[0],+t[1],+t[2],+t[3])},vertexAttribPointer(e=0,t=0,n=0,r=!1,i=0,a=0){if(i<0||a<0){this.setError(this.INVALID_VALUE);return}if(i<0||a<0||e<0||e>=this._vertexObjectState._attribs.length||!(t===1||t===2||t===3||t===4)){this.setError(this.INVALID_VALUE);return}if(this._vertexGlobalState._arrayBufferBinding===null){this.setError(this.INVALID_OPERATION);return}let o=typeSize(this,n);if(o===0||n===this.INT||n===this.UNSIGNED_INT){this.setError(this.INVALID_ENUM);return}if(i>255||i<0){this.setError(this.INVALID_VALUE);return}if(i%o!==0||a%o!==0){this.setError(this.INVALID_OPERATION);return}this._gl.vertexAttribPointer(e,t,n,r,i,a),this._vertexObjectState.setVertexAttribPointer(this._vertexGlobalState._arrayBufferBinding,e,t*o,a,i||t*o,n,r,i,t)},getVertexAttrib(e=0,t=0){if(e<0||e>=this._vertexObjectState._attribs.length)return this.setError(this.INVALID_VALUE),null;let n=this._vertexObjectState._attribs[e],r=this._vertexGlobalState._attribs[e]._data,i=this._extensions.angle_instanced_arrays;if(i&&t===i.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE||t===this.VERTEX_ATTRIB_ARRAY_DIVISOR)return n._divisor;switch(t){case this.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:return n._pointerBuffer;case this.VERTEX_ATTRIB_ARRAY_ENABLED:return n._isPointer;case this.VERTEX_ATTRIB_ARRAY_SIZE:return n._inputSize;case this.VERTEX_ATTRIB_ARRAY_STRIDE:return n._inputStride;case this.VERTEX_ATTRIB_ARRAY_TYPE:return n._pointerType;case this.VERTEX_ATTRIB_ARRAY_NORMALIZED:return n._pointerNormal;case this.CURRENT_VERTEX_ATTRIB:return new Float32Array(r);default:return this.setError(this.INVALID_ENUM),null}},getVertexAttribOffset(e=0,t=0){return e<0||e>=this._vertexObjectState._attribs.length?(this.setError(this.INVALID_VALUE),-1):t===this.VERTEX_ATTRIB_ARRAY_POINTER?this._vertexObjectState._attribs[e]._pointerOffset:(this.setError(this.INVALID_ENUM),-1)},_checkVertexAttribState(e){let t=this._activeProgram;if(!t)return this.setError(this.INVALID_OPERATION),!1;let n=this._vertexObjectState._attribs;for(let r=0;r<n.length;++r){let i=n[r];if(i._isPointer){let n=i._pointerBuffer;if(!n)return this.setError(this.INVALID_OPERATION),!1;if(t._attributes.indexOf(r)>=0){let t=0;if(t=i._divisor?i._pointerSize+i._pointerOffset:i._pointerStride*e+i._pointerSize+i._pointerOffset,t>n._size)return this.setError(this.INVALID_OPERATION),!1}}}return!0},_checkVertexIndex(e){return e<0||e>=this._vertexObjectState._attribs.length?(this.setError(this.INVALID_VALUE),!1):!0}};function installDrawingMethods(e){Object.assign(e,Un)}const Wn={bindFramebuffer(e,t){if(!checkObject(t))throw TypeError(`bindFramebuffer(GLenum, WebGLFramebuffer)`);if(e!==this.FRAMEBUFFER){this.setError(this.INVALID_ENUM);return}if(!t)this._gl.bindFramebuffer(this.FRAMEBUFFER,this._gtkFboId);else if(t._pendingDelete)return;else if(this._checkWrapper(t,WebGLFramebuffer))this._gl.bindFramebuffer(this.FRAMEBUFFER,t._|0);else return;let n=this._activeFramebuffer;n!==t&&(n&&(--n._refCount,n._checkDelete()),t&&(t._refCount+=1)),this._activeFramebuffer=t,t&&this._updateFramebufferAttachments(t)},bindRenderbuffer(e,t){if(!checkObject(t))throw TypeError(`bindRenderbuffer(GLenum, WebGLRenderbuffer)`);if(e!==this.RENDERBUFFER){this.setError(this.INVALID_ENUM);return}if(!t)this._gl.bindRenderbuffer(e|0,0);else if(t._pendingDelete)return;else if(this._checkWrapper(t,WebGLRenderbuffer))this._gl.bindRenderbuffer(e|0,t._|0);else return;let n=this._activeRenderbuffer;n!==t&&(n&&(--n._refCount,n._checkDelete()),t&&(t._refCount+=1)),this._activeRenderbuffer=t},framebufferRenderbuffer(e,t,n,r){if(!checkObject(r))throw TypeError(`framebufferRenderbuffer(GLenum, GLenum, GLenum, WebGLRenderbuffer)`);if(e!==this.FRAMEBUFFER||!this._validFramebufferAttachment(t)||n!==this.RENDERBUFFER){this.setError(this.INVALID_ENUM);return}let i=this._activeFramebuffer;if(!i){this.setError(this.INVALID_OPERATION);return}r&&!this._checkWrapper(r,WebGLRenderbuffer)||(i._setAttachment(r,t),this._updateFramebufferAttachments(i))},framebufferTexture2D(e,t,n,r,i=0){if(e|=0,t|=0,n|=0,i|=0,!checkObject(r))throw TypeError(`framebufferTexture2D(GLenum, GLenum, GLenum, WebGLTexture, GLint)`);if(e!==this.FRAMEBUFFER||!this._validFramebufferAttachment(t)){this.setError(this.INVALID_ENUM);return}if(i!==0){this.setError(this.INVALID_VALUE);return}if(r&&!this._checkWrapper(r,WebGLTexture))return;if(n===this.TEXTURE_2D){if(r&&r._binding!==this.TEXTURE_2D){this.setError(this.INVALID_OPERATION);return}}else if(this._validCubeTarget(n)){if(r&&r._binding!==this.TEXTURE_CUBE_MAP){this.setError(this.INVALID_OPERATION);return}}else{this.setError(this.INVALID_ENUM);return}let a=this._activeFramebuffer;if(!a){this.setError(this.INVALID_OPERATION);return}a._attachmentLevel[t]=i,a._attachmentFace[t]=n,a._setAttachment(r,t),this._updateFramebufferAttachments(a)},createFramebuffer(){let e=this._gl.createFramebuffer();if(e<=0)return null;let t=new WebGLFramebuffer(e,this);return this._framebuffers[e]=t,t},deleteFramebuffer(e){if(!checkObject(e))throw TypeError(`deleteFramebuffer(WebGLFramebuffer)`);if(!(e instanceof WebGLFramebuffer&&this._checkOwns(e))){this.setError(this.INVALID_OPERATION);return}this._activeFramebuffer===e&&this.bindFramebuffer(this.FRAMEBUFFER,null),e._pendingDelete=!0,e._checkDelete()},createRenderbuffer(){let e=this._gl.createRenderbuffer();if(e<=0)return null;let t=new WebGLRenderbuffer(e,this);return this._renderbuffers[e]=t,t},deleteRenderbuffer(e){if(!checkObject(e))throw TypeError(`deleteRenderbuffer(WebGLRenderbuffer)`);if(!(e instanceof WebGLRenderbuffer&&this._checkOwns(e))){this.setError(this.INVALID_OPERATION);return}this._activeRenderbuffer===e&&this.bindRenderbuffer(this.RENDERBUFFER,null),this._detachRenderbufferFromAllFramebuffers(e),e._pendingDelete=!0,e._checkDelete()},renderbufferStorage(e=0,t=0,n=0,r=0){if(e!==this.RENDERBUFFER){this.setError(this.INVALID_ENUM);return}let i=this._activeRenderbuffer;if(!i){this.setError(this.INVALID_OPERATION);return}if(t!==this.RGBA4&&t!==this.RGB565&&t!==this.RGB5_A1&&t!==this.DEPTH_COMPONENT16&&t!==this.STENCIL_INDEX&&t!==this.STENCIL_INDEX8&&t!==this.DEPTH_STENCIL){this.setError(this.INVALID_ENUM);return}this._saveError(),this._gl.renderbufferStorage(e,t,n,r);let a=this.getError();if(this._restoreError(a),a!==this.NO_ERROR)return;i._width=n,i._height=r,i._format=t;let o=this._activeFramebuffer;if(o){let e=!1,t=this._getAttachments();for(let n=0;n<t.length;++n)if(o._attachments[t[n]]===i){e=!0;break}e&&this._updateFramebufferAttachments(this._activeFramebuffer)}},getFramebufferAttachmentParameter(e=0,t=0,n=0){if(e!==this.FRAMEBUFFER||!this._validFramebufferAttachment(t))return this.setError(this.INVALID_ENUM),null;let r=this._activeFramebuffer;if(!r)return this.setError(this.INVALID_OPERATION),null;let i=r._attachments[t];if(i===null){if(n===this.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)return this.NONE}else if(i instanceof WebGLTexture)switch(n){case this.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:return i;case this.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:return this.TEXTURE;case this.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:return r._attachmentLevel[t];case this.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:{let e=r._attachmentFace[t];return e===this.TEXTURE_2D?0:e}}else if(i instanceof WebGLRenderbuffer)switch(n){case this.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:return i;case this.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:return this.RENDERBUFFER}return this.setError(this.INVALID_ENUM),null},getRenderbufferParameter(e=0,t=0){if(e!==this.RENDERBUFFER)return this.setError(this.INVALID_ENUM),null;let n=this._activeRenderbuffer;if(!n)return this.setError(this.INVALID_OPERATION),null;switch(t){case this.RENDERBUFFER_INTERNAL_FORMAT:return n._format;case this.RENDERBUFFER_WIDTH:return n._width;case this.RENDERBUFFER_HEIGHT:return n._height;case this.MAX_RENDERBUFFER_SIZE:return this._maxRenderbufferSize;case this.RENDERBUFFER_RED_SIZE:case this.RENDERBUFFER_GREEN_SIZE:case this.RENDERBUFFER_BLUE_SIZE:case this.RENDERBUFFER_ALPHA_SIZE:case this.RENDERBUFFER_DEPTH_SIZE:case this.RENDERBUFFER_STENCIL_SIZE:return this._gl.getRenderbufferParameter(e,t)}return this.setError(this.INVALID_ENUM),null},checkFramebufferStatus(e){if(e!==this.FRAMEBUFFER)return this.setError(this.INVALID_ENUM),0;let t=this._activeFramebuffer;return t?this._preCheckFramebufferStatus(t):this.FRAMEBUFFER_COMPLETE},_preCheckFramebufferStatus(e){let t=e._attachments,n=[],r=[],i=t[this.DEPTH_ATTACHMENT],a=t[this.DEPTH_STENCIL_ATTACHMENT],o=t[this.STENCIL_ATTACHMENT];if(a&&(o||i)||o&&i)return this.FRAMEBUFFER_UNSUPPORTED;let s=this._getColorAttachments(),c=0;for(let e in t)t[e]&&s.indexOf(Number(e))!==-1&&c++;if(c===0)return this.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;if(a instanceof WebGLTexture)return this.FRAMEBUFFER_UNSUPPORTED;if(a instanceof WebGLRenderbuffer){if(a._format!==this.DEPTH_STENCIL)return this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;n.push(a._width),r.push(a._height)}if(i instanceof WebGLTexture)return this.FRAMEBUFFER_UNSUPPORTED;if(i instanceof WebGLRenderbuffer){if(i._format!==this.DEPTH_COMPONENT16)return this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;n.push(i._width),r.push(i._height)}if(o instanceof WebGLTexture)return this.FRAMEBUFFER_UNSUPPORTED;if(o instanceof WebGLRenderbuffer){if(o._format!==this.STENCIL_INDEX8)return this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;n.push(o._width),r.push(o._height)}let l=!1;for(let i=0;i<s.length;++i){let a=t[s[i]];if(a instanceof WebGLTexture){if(a._format!==this.RGBA||!(a._type===this.UNSIGNED_BYTE||a._type===this.FLOAT))return this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;l=!0;let t=e._attachmentLevel[this.COLOR_ATTACHMENT0];if(t===null)throw TypeError(`level is null!`);n.push(a._levelWidth[t]),r.push(a._levelHeight[t])}else if(a instanceof WebGLRenderbuffer){let e=a._format;if(e!==this.RGBA4&&e!==this.RGB565&&e!==this.RGB5_A1)return this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;l=!0,n.push(a._width),r.push(a._height)}}if(!l&&!o&&!i&&!a)return this.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;if(n.length<=0||r.length<=0)return this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;for(let e=1;e<n.length;++e)if(n[e-1]!==n[e]||r[e-1]!==r[e])return this.FRAMEBUFFER_INCOMPLETE_DIMENSIONS;return n[0]===0||r[0]===0?this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:(e._width=n[0],e._height=r[0],this.FRAMEBUFFER_COMPLETE)},_framebufferOk(){let e=this._activeFramebuffer;return e&&this._preCheckFramebufferStatus(e)!==this.FRAMEBUFFER_COMPLETE?(this.setError(this.INVALID_FRAMEBUFFER_OPERATION),!1):!0},_validFramebufferAttachment(e){switch(e){case this.DEPTH_ATTACHMENT:case this.STENCIL_ATTACHMENT:case this.DEPTH_STENCIL_ATTACHMENT:case this.COLOR_ATTACHMENT0:return!0}if(this._extensions.webgl_draw_buffers){let t=this._extensions.webgl_draw_buffers;return e<t.COLOR_ATTACHMENT0_WEBGL+t._maxDrawBuffers}return!1},_updateFramebufferAttachments(e){if(!e)return;let t=e._status,n=this._getAttachments();if(e._status=this._preCheckFramebufferStatus(e),e._status!==this.FRAMEBUFFER_COMPLETE){if(t===this.FRAMEBUFFER_COMPLETE)for(let t=0;t<n.length;++t){let r=n[t];this._gl.framebufferTexture2D(this.FRAMEBUFFER,r,e._attachmentFace[r]||0,0,e._attachmentLevel[r]||0)}return}for(let t=0;t<n.length;++t){let r=n[t];this._gl.framebufferTexture2D(this.FRAMEBUFFER,r,e._attachmentFace[r]||0,0,e._attachmentLevel[r]||0)}for(let t=0;t<n.length;++t){let r=n[t],i=e._attachments[r];i instanceof WebGLTexture?this._gl.framebufferTexture2D(this.FRAMEBUFFER,r,e._attachmentFace[r]||0,i._|0,e._attachmentLevel[r]||0):i instanceof WebGLRenderbuffer&&this._gl.framebufferRenderbuffer(this.FRAMEBUFFER,r,this.RENDERBUFFER,i._|0)}},_tryDetachFramebuffer(e,t){if(e&&e._linked(t)){let n=this._getAttachments();for(let r=0;r<n.length;++r)e._attachments[n[r]]===t&&this.framebufferTexture2D(this.FRAMEBUFFER,n[r]|0,this.TEXTURE_2D,null)}},_detachRenderbufferFromAllFramebuffers(e){let t=this._activeFramebuffer,n=this._getAttachments(),r=!1;for(let i in this._framebuffers){let a=this._framebuffers[i];if(!(!a||!a._linked(e))){a!==t&&(this._gl.bindFramebuffer(this.FRAMEBUFFER,a._|0),r=!0);for(let t=0;t<n.length;++t){let r=n[t];a._attachments[r]===e&&(this._gl.framebufferRenderbuffer(this.FRAMEBUFFER,r,this.RENDERBUFFER,0),a._setAttachment(null,r))}}}r&&this._gl.bindFramebuffer(this.FRAMEBUFFER,t?t._|0:this._gtkFboId)},_getAttachments(){return this._extensions.webgl_draw_buffers?this._extensions.webgl_draw_buffers._ALL_ATTACHMENTS:this.DEFAULT_ATTACHMENTS},_getColorAttachments(){return this._extensions.webgl_draw_buffers?this._extensions.webgl_draw_buffers._ALL_COLOR_ATTACHMENTS:this.DEFAULT_COLOR_ATTACHMENTS},_resizeDrawingBuffer(e,t){let n=this._activeFramebuffer,r=this._getActiveTexture(this.TEXTURE_2D),i=this._activeRenderbuffer,a=this._contextAttributes,o=this._drawingBuffer;o?._framebuffer&&this._gl.bindFramebuffer(this.FRAMEBUFFER,o?._framebuffer);let s=this._getAttachments();for(let e=0;e<s.length;++e)this._gl.framebufferTexture2D(this.FRAMEBUFFER,s[e],this.TEXTURE_2D,0,0);o?._color&&this._gl.bindTexture(this.TEXTURE_2D,o?._color);let c=a.alpha?this.RGBA:this.RGB;this._gl.texImage2D(this.TEXTURE_2D,0,c,e,t,0,c,this.UNSIGNED_BYTE,Uint8ArrayToVariant(null)),this._gl.texParameteri(this.TEXTURE_2D,this.TEXTURE_MIN_FILTER,this.NEAREST),this._gl.texParameteri(this.TEXTURE_2D,this.TEXTURE_MAG_FILTER,this.NEAREST),o?._color&&this._gl.framebufferTexture2D(this.FRAMEBUFFER,this.COLOR_ATTACHMENT0,this.TEXTURE_2D,o?._color,0);let l=0,u=0;a.depth&&a.stencil?(l=this.DEPTH_STENCIL,u=this.DEPTH_STENCIL_ATTACHMENT):a.depth?(l=33191,u=this.DEPTH_ATTACHMENT):a.stencil&&(l=this.STENCIL_INDEX8,u=this.STENCIL_ATTACHMENT),l&&(o?._depthStencil&&this._gl.bindRenderbuffer(this.RENDERBUFFER,o?._depthStencil),this._gl.renderbufferStorage(this.RENDERBUFFER,l,e,t),o?._depthStencil&&this._gl.framebufferRenderbuffer(this.FRAMEBUFFER,u,this.RENDERBUFFER,o?._depthStencil)),this.bindFramebuffer(this.FRAMEBUFFER,n),this.bindTexture(this.TEXTURE_2D,r),this.bindRenderbuffer(this.RENDERBUFFER,i)},_allocateDrawingBuffer(e,t){this._drawingBuffer=new WebGLDrawingBufferWrapper(this._gl.createFramebuffer(),this._gl.createTexture(),this._gl.createRenderbuffer()),this._resizeDrawingBuffer(e,t)},resize(e=0,t=0){if(e|=0,t|=0,e>0&&t>0)(e!==this.drawingBufferWidth||t!==this.drawingBufferHeight)&&this._resizeDrawingBuffer(e,t);else throw Error(`Invalid surface dimensions`)}};function installFramebufferMethods(e){Object.assign(e,Wn)}const Gn={enable(e=0){this._gl.enable(e)},disable(e=0){if(this._gl.disable(e),e===this.TEXTURE_2D||e===this.TEXTURE_CUBE_MAP){let t=this._getActiveTextureUnit();t._mode===e&&(t._mode=0)}},cullFace(e){this._gl.cullFace(e|0)},depthFunc(e){switch(e|=0,e){case this.NEVER:case this.LESS:case this.EQUAL:case this.LEQUAL:case this.GREATER:case this.NOTEQUAL:case this.GEQUAL:case this.ALWAYS:this._gl.depthFunc(e);return;default:this.setError(this.INVALID_ENUM)}},depthMask(e){this._gl.depthMask(!!e)},depthRange(e,t){if(e=+e,t=+t,e<=t){this._gl.depthRange(e,t);return}this.setError(this.INVALID_OPERATION)},frontFace(e=0){this._gl.frontFace(e)},lineWidth(e){if(isNaN(e)){this.setError(this.INVALID_VALUE);return}this._gl.lineWidth(+e)},polygonOffset(e,t){this._gl.polygonOffset(+e,+t)},sampleCoverage(e,t){this._gl.sampleCoverage(+e,!!t)},hint(e=0,t=0){let n=this._extensions.oes_standard_derivatives;if(!(e===this.GENERATE_MIPMAP_HINT||n&&e===n.FRAGMENT_SHADER_DERIVATIVE_HINT_OES)){this.setError(this.INVALID_ENUM);return}if(t!==this.FASTEST&&t!==this.NICEST&&t!==this.DONT_CARE){this.setError(this.INVALID_ENUM);return}e===this.GENERATE_MIPMAP_HINT&&(this._generateMipmapHint=t,this._isCoreProfile())||this._gl.hint(e,t)},finish(){this._gl.finish()},flush(){this._gl.flush()},blendColor(e=0,t=0,n=0,r=0){this._gl.blendColor(+e,+t,+n,+r)},blendEquation(e=0){if(this._validBlendMode(e)){this._gl.blendEquation(e);return}this.setError(this.INVALID_ENUM)},blendEquationSeparate(e=0,t=0){if(this._validBlendMode(e)&&this._validBlendMode(t)){this._gl.blendEquationSeparate(e,t);return}this.setError(this.INVALID_ENUM)},blendFunc(e=0,t=0){if(!this._validBlendFunc(e)||!this._validBlendFunc(t)){this.setError(this.INVALID_ENUM);return}if(this._isConstantBlendFunc(e)&&this._isConstantBlendFunc(t)){this.setError(this.INVALID_OPERATION);return}this._gl.blendFunc(e,t)},blendFuncSeparate(e=0,t=0,n=0,r=0){if(!(this._validBlendFunc(e)&&this._validBlendFunc(t)&&this._validBlendFunc(n)&&this._validBlendFunc(r))){this.setError(this.INVALID_ENUM);return}if(this._isConstantBlendFunc(e)&&this._isConstantBlendFunc(t)||this._isConstantBlendFunc(n)&&this._isConstantBlendFunc(r)){this.setError(this.INVALID_OPERATION);return}this._gl.blendFuncSeparate(e,t,n,r)},clear(e=0){this._framebufferOk()&&this._gl.clear(e)},clearColor(e,t,n,r){this._gl.clearColor(+e,+t,+n,+r)},clearDepth(e){this._gl.clearDepth(+e)},clearStencil(e=0){this._checkStencil=!1,this._gl.clearStencil(e)},colorMask(e,t,n,r){this._gl.colorMask(!!e,!!t,!!n,!!r)},stencilFunc(e,t,n){this._checkStencil=!0,this._gl.stencilFunc(e|0,t|0,n|0)},stencilFuncSeparate(e,t,n,r){this._checkStencil=!0,this._gl.stencilFuncSeparate(e|0,t|0,n|0,r|0)},stencilMask(e){this._checkStencil=!0,this._gl.stencilMask(e>>>0)},stencilMaskSeparate(e,t){this._checkStencil=!0,this._gl.stencilMaskSeparate(e|0,t>>>0)},stencilOp(e,t,n){this._checkStencil=!0,this._gl.stencilOp(e|0,t|0,n|0)},stencilOpSeparate(e,t,n,r){this._checkStencil=!0,this._gl.stencilOpSeparate(e|0,t|0,n|0,r|0)},isEnabled(e=0){return this._gl.isEnabled(e)},isContextLost(){return!1},getError(){return this._gl.getError()},setError(e){this._gl.setError(e)},isBuffer(e){return this._isObject(e,`isBuffer`,WebGLBuffer)?this._gl.isBuffer(e?._):!1},isFramebuffer(e){return this._isObject(e,`isFramebuffer`,WebGLFramebuffer)?this._gl.isFramebuffer(e?._):!1},isProgram(e){return this._isObject(e,`isProgram`,WebGLProgram$1)?this._gl.isProgram(e?._):!1},isRenderbuffer(e){return this._isObject(e,`isRenderbuffer`,WebGLRenderbuffer)?this._gl.isRenderbuffer(e?._):!1},isShader(e){return this._isObject(e,`isShader`,WebGLShader$1)?this._gl.isShader(e?._):!1},isTexture(e){return this._isObject(e,`isTexture`,WebGLTexture)?this._gl.isTexture(e?._):!1},generateMipmap(e=0){this._gl.generateMipmap(e)},_validBlendFunc(e){return e===this.ZERO||e===this.ONE||e===this.SRC_COLOR||e===this.ONE_MINUS_SRC_COLOR||e===this.DST_COLOR||e===this.ONE_MINUS_DST_COLOR||e===this.SRC_ALPHA||e===this.ONE_MINUS_SRC_ALPHA||e===this.DST_ALPHA||e===this.ONE_MINUS_DST_ALPHA||e===this.SRC_ALPHA_SATURATE||e===this.CONSTANT_COLOR||e===this.ONE_MINUS_CONSTANT_COLOR||e===this.CONSTANT_ALPHA||e===this.ONE_MINUS_CONSTANT_ALPHA},_validBlendMode(e){let t=this._extensions.ext_blend_minmax;return e===this.FUNC_ADD||e===this.FUNC_SUBTRACT||e===this.FUNC_REVERSE_SUBTRACT||!!(t&&(e===t.MIN_EXT||e===t.MAX_EXT))},_isConstantBlendFunc(e){return e===this.CONSTANT_COLOR||e===this.ONE_MINUS_CONSTANT_COLOR||e===this.CONSTANT_ALPHA||e===this.ONE_MINUS_CONSTANT_ALPHA},_saveError(){this._errorStack.push(this.getError())},_restoreError(e){let t=this._errorStack.pop();t===this.NO_ERROR?this.setError(e):t!==void 0&&this.setError(t)}};function installStateMethods(e){Object.assign(e,Gn)}const Kn={activeTexture(e=0){let t=e-this.TEXTURE0;if(t>=0&&t<this._textureUnits.length){this._activeTextureUnit=t,this._gl.activeTexture(e);return}this.setError(this.INVALID_ENUM)},bindTexture(e=0,t){if(!checkObject(t))throw TypeError(`bindTexture(GLenum, WebGLTexture)`);if(!this._validTextureTarget(e)){this.setError(this.INVALID_ENUM);return}let n=0;if(!t)t=null;else if(t instanceof WebGLTexture&&t._pendingDelete)return;else if(this._checkWrapper(t,WebGLTexture)){if(t._binding&&t._binding!==e){this.setError(this.INVALID_OPERATION);return}t._binding=e,t._complete&&(n=t._|0)}else return;this._saveError(),this._gl.bindTexture(e,n);let r=this.getError();if(this._restoreError(r),r!==this.NO_ERROR)return;let i=this._getActiveTextureUnit(),a=this._getActiveTexture(e);a!==t&&(a&&(--a._refCount,a._checkDelete()),t&&(t._refCount+=1)),e===this.TEXTURE_2D?i._bind2D=t:e===this.TEXTURE_CUBE_MAP&&(i._bindCube=t)},createTexture(){let e=this._gl.createTexture();if(e<=0)return null;let t=new WebGLTexture(e,this);return this._textures[e]=t,t},deleteTexture(e){if(!checkObject(e))throw TypeError(`deleteTexture(WebGLTexture)`);if(e instanceof WebGLTexture){if(!this._checkOwns(e)){this.setError(this.INVALID_OPERATION);return}}else return;let t=this._activeTextureUnit;for(let t=0;t<this._textureUnits.length;++t){let n=this._textureUnits[t];n._bind2D===e?(this.activeTexture(this.TEXTURE0+t),this.bindTexture(this.TEXTURE_2D,null)):n._bindCube===e&&(this.activeTexture(this.TEXTURE0+t),this.bindTexture(this.TEXTURE_CUBE_MAP,null))}this.activeTexture(this.TEXTURE0+t),this._detachTextureFromAllFramebuffers(e),e._pendingDelete=!0,e._checkDelete()},_detachTextureFromAllFramebuffers(e){let t=this._activeFramebuffer,n=this._getAttachments(),r=!1;for(let i in this._framebuffers){let a=this._framebuffers[i];if(!(!a||!a._linked(e))){a!==t&&(this._gl.bindFramebuffer(this.FRAMEBUFFER,a._|0),r=!0);for(let t=0;t<n.length;++t){let r=n[t];a._attachments[r]===e&&(this._gl.framebufferTexture2D(this.FRAMEBUFFER,r,a._attachmentFace[r]||this.TEXTURE_2D,0,a._attachmentLevel[r]||0),a._setAttachment(null,r))}}}r&&this._gl.bindFramebuffer(this.FRAMEBUFFER,t?t._|0:this._gtkFboId)},pixelStorei(e=0,t=0){if(typeof t==`boolean`&&(t=t===!1?0:1),e===this.UNPACK_ALIGNMENT)if(t===1||t===2||t===4||t===8)this._unpackAlignment=t;else{this.setError(this.INVALID_VALUE);return}else if(e===this.PACK_ALIGNMENT)if(t===1||t===2||t===4||t===8)this._packAlignment=t;else{this.setError(this.INVALID_VALUE);return}else if(e===this.UNPACK_COLORSPACE_CONVERSION_WEBGL){if(!(t===this.NONE||t===this.BROWSER_DEFAULT_WEBGL)){this.setError(this.INVALID_VALUE);return}}else if(e===this.UNPACK_FLIP_Y_WEBGL){this._unpackFlipY=!!t;return}else if(e===this.UNPACK_PREMULTIPLY_ALPHA_WEBGL){this._unpackPremultAlpha=!!t;return}this._gl.pixelStorei(e,t)}};function installTextureLifecycleMethods(e){Object.assign(e,Kn)}const qn={texImage2D(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0,c){let l=0,u=0,d=0,f,p,m=0;if(arguments.length===6)if(s=i,d=r,a instanceof bt.Pixbuf)p=a,l=p.get_width(),u=p.get_height(),c=p.get_pixels();else{f=a;let e=extractImageData(f);if(e==null)throw TypeError(`texImage2D(GLenum, GLint, GLenum, GLint, GLenum, GLenum, ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement)`);l=e.width,u=e.height,c=e.data}else arguments.length===9&&(l=r,u=i,m=a,d=o,c=c);if(typeof c!=`object`&&c!==void 0)throw TypeError(`texImage2D(GLenum, GLint, GLenum, GLint, GLint, GLint, GLenum, GLenum, Uint8Array)`);if(!checkFormat(this,d)||!checkFormat(this,n)){this.setError(this.INVALID_ENUM);return}if(s===this.FLOAT&&!this._extensions.oes_texture_float){this.setError(this.INVALID_ENUM);return}let h=this._getTexImage(e);if(!h||d!==n){this.setError(this.INVALID_OPERATION);return}let g=this._computePixelSize(s,d);if(g===0||!this._checkDimensions(e,l,u,t))return;let _=convertPixels(c),v=this._computeRowStride(l,g),y=v*u;if(_&&_.length<y){this.setError(this.INVALID_OPERATION);return}if(m!==0||validCubeTarget(this,e)&&l!==u){this.setError(this.INVALID_VALUE);return}if(this._unpackPremultAlpha&&_&&d===this.RGBA&&(_=premultiplyAlpha(_)),this._unpackFlipY&&_&&l>0&&u>0){let e=new Uint8Array(_.length);for(let t=0;t<u;t++){let n=t*v,r=(u-1-t)*v;e.set(_.subarray(n,n+v),r)}_=e}let b=this._legacyFormatStorage(d,s);this._saveError(),this._gl.texImage2D(e,t,b?b.internalFormat:this._nativeFloatInternalFormat(n,s),l,u,m,b?b.format:d,s,Uint8ArrayToVariant(_));let x=this.getError();if(this._restoreError(x),x!==this.NO_ERROR)return;this._setTextureSwizzle(e,h,b?b.swizzle:null),h._levelWidth[t]=l,h._levelHeight[t]=u,h._format=d,h._type=s;let S=this._activeFramebuffer;if(S){let e=!1,t=this._getAttachments();for(let n=0;n<t.length;++n)if(S._attachments[t[n]]===h){e=!0;break}e&&this._activeFramebuffer&&this._updateFramebufferAttachments(this._activeFramebuffer)}},texSubImage2D(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0,c){let l=0,u=0,d=0,f,p;if(arguments.length===7)if(s=a,d=i,o instanceof bt.Pixbuf)p=o,l=p.get_width(),u=p.get_height(),c=p.get_pixels();else{f=o;let e=extractImageData(f);if(e==null)throw TypeError(`texSubImage2D(GLenum, GLint, GLint, GLint, GLenum, GLenum, ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement)`);l=e.width,u=e.height,c=e.data}else l=i,u=a,d=o;if(typeof c!=`object`)throw TypeError(`texSubImage2D(GLenum, GLint, GLint, GLint, GLint, GLint, GLenum, GLenum, Uint8Array)`);let m=this._getTexImage(e);if(!m){this.setError(this.INVALID_OPERATION);return}if(this._legacySubImageMismatch(m,d)){this.setError(this.INVALID_OPERATION);return}if(s===this.FLOAT&&!this._extensions.oes_texture_float){this.setError(this.INVALID_ENUM);return}let h=this._computePixelSize(s,d);if(h===0||!this._checkDimensions(e,l,u,t))return;if(n<0||r<0){this.setError(this.INVALID_VALUE);return}let g=convertPixels(c),_=this._computeRowStride(l,h),v=_*u;if(!g||g.length<v){this.setError(this.INVALID_OPERATION);return}if(this._unpackPremultAlpha&&g&&d===this.RGBA&&(g=premultiplyAlpha(g)),this._unpackFlipY&&g&&l>0&&u>0){let e=new Uint8Array(g.length);for(let t=0;t<u;t++){let n=t*_,r=(u-1-t)*_;e.set(g.subarray(n,n+_),r)}g=e}let y=this._legacyFormatStorage(d,s)?.format??d;this._gl.texSubImage2D(e,t,n,r,l,u,y,s,Uint8ArrayToVariant(g))}};function installTexImage2DMethods(e){Object.assign(e,qn)}var Jn=__toESM(__commonJSMin((e=>{e.INT_MIN=-1<<31,e.isPow2=function(e){return!(e&e-1)&&!!e},e.log2=function(e){var t=(e>65535)<<4,n;return e>>>=t,n=(e>255)<<3,e>>>=n,t|=n,n=(e>15)<<2,e>>>=n,t|=n,n=(e>3)<<1,e>>>=n,t|=n,t|e>>1},e.nextPow2=function(e){return e+=e===0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1},(function(e){for(var t=0;t<256;++t){var n=t,r=t,i=7;for(n>>>=1;n;n>>>=1)r<<=1,r|=n&1,--i;e[t]=r<<i&255}})(Array(256))}))(),1);const Yn=5121,Xn=35051,Zn=35052,Qn=[[3333,4],[3330,0],[3331,0],[3332,0],[3317,1],[3314,0],[3315,0],[3316,0]],$n={copyTexImage2D(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0){let c=this._getTexImage(e);if(!c){this.setError(this.INVALID_OPERATION);return}if(n!==this.RGBA&&n!==this.RGB&&n!==this.ALPHA&&n!==this.LUMINANCE&&n!==this.LUMINANCE_ALPHA){this.setError(this.INVALID_ENUM);return}if(t<0||a<0||o<0||s!==0){this.setError(this.INVALID_VALUE);return}if(t>0&&!(Jn.isPow2(a)&&Jn.isPow2(o))){this.setError(this.INVALID_VALUE);return}let l=this._legacyFormatStorage(n,this.UNSIGNED_BYTE);this._saveError(),l&&n!==this.LUMINANCE?this._copyLegacyChannels(n,r,i,a,o,(n,r)=>this._gl.texImage2D(e,t,n.internalFormat,a,o,0,n.format,Yn,r)):this._gl.copyTexImage2D(e,t,l?l.internalFormat:n,r,i,a,o,s);let u=this.getError();this._restoreError(u),u===this.NO_ERROR&&(c._levelWidth[t]=a,c._levelHeight[t]=o,c._format=isLegacyFormat(n)?n:this.RGBA,c._type=this.UNSIGNED_BYTE,this._setTextureSwizzle(e,c,l?l.swizzle:null))},copyTexSubImage2D(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0){let c=this._getTexImage(e);if(!c){this.setError(this.INVALID_OPERATION);return}if(o<0||s<0||n<0||r<0||t<0){this.setError(this.INVALID_VALUE);return}if((c._format===this.ALPHA||c._format===this.LUMINANCE_ALPHA)&&this._legacyFormatStorage(c._format,this.UNSIGNED_BYTE)){this._copyLegacyChannels(c._format,i,a,o,s,(i,a)=>this._gl.texSubImage2D(e,t,n,r,o,s,i.format,Yn,a));return}this._gl.copyTexSubImage2D(e,t,n,r,i,a,o,s)},_copyLegacyChannels(e,t,n,r,i,a){let o=isLegacyFormat(e)?coreStorageForLegacyFormat(e,Yn):null;if(!o)return;if(this._gl.checkFramebufferStatus(36008)!==36053){this.setError(1286);return}let s=this._gl.getParameteri(35053),c=this._gl.getParameteri(35055),l=Qn.map(([e])=>this._gl.getParameteri(e)),u=this._packAlignment;s&&this._gl.bindBuffer(Xn,0),c&&this._gl.bindBuffer(Zn,0);for(let[e,t]of Qn)this._gl.pixelStorei(e,t);this._packAlignment=4;try{let s=new Uint8Array(Math.max(0,r*i*4));s.length>0&&this.readPixels(t,n,r,i,6408,Yn,s),a(o,Uint8ArrayToVariant(extractLegacyChannels(s,e)))}finally{this._packAlignment=u,Qn.forEach(([e],t)=>this._gl.pixelStorei(e,l[t])),s&&this._gl.bindBuffer(Xn,s),c&&this._gl.bindBuffer(Zn,c)}},compressedTexImage2D(e,t,n,r,i,a,o){this._saveError(),this._gl.compressedTexImage2D(e,t,n,r,i,a,Uint8ArrayToVariant(arrayToUint8Array(o)));let s=this.getError();if(this._restoreError(s),s!==this.NO_ERROR)return;let c=this._getTexImage(e);c&&(c._format=n,this._setTextureSwizzle(e,c,null))},compressedTexSubImage2D(e,t,n,r,i,a,o,s){this._gl.compressedTexSubImage2D(e,t,n,r,i,a,o,Uint8ArrayToVariant(arrayToUint8Array(s)))}};function installCopyAndCompressedTextureMethods(e){Object.assign(e,$n)}const er={texParameterf(e=0,t=0,n){if(n=+n,this._checkTextureTarget(e)){switch(this._verifyTextureCompleteness(e,t,n),t){case this.TEXTURE_MIN_FILTER:case this.TEXTURE_MAG_FILTER:case this.TEXTURE_WRAP_S:case this.TEXTURE_WRAP_T:this._gl.texParameterf(e,t,n);return}let r=this._extensions.ext_texture_filter_anisotropic;if(r&&t===r.TEXTURE_MAX_ANISOTROPY_EXT){this._gl.texParameterf(e,t,n);return}this.setError(this.INVALID_ENUM)}},texParameteri(e=0,t=0,n=0){if(this._checkTextureTarget(e)){switch(this._verifyTextureCompleteness(e,t,n),t){case this.TEXTURE_MIN_FILTER:case this.TEXTURE_MAG_FILTER:case this.TEXTURE_WRAP_S:case this.TEXTURE_WRAP_T:this._gl.texParameteri(e,t,n);return}let r=this._extensions.ext_texture_filter_anisotropic;if(r&&t===r.TEXTURE_MAX_ANISOTROPY_EXT){this._gl.texParameteri(e,t,n);return}this.setError(this.INVALID_ENUM)}},getTexParameter(e=0,t=0){if(!this._checkTextureTarget(e))return null;let n=this._getActiveTextureUnit();if(e===this.TEXTURE_2D&&!n._bind2D||e===this.TEXTURE_CUBE_MAP&&!n._bindCube)return this.setError(this.INVALID_OPERATION),null;switch(t){case this.TEXTURE_MAG_FILTER:case this.TEXTURE_MIN_FILTER:case this.TEXTURE_WRAP_S:case this.TEXTURE_WRAP_T:return this._getTexParameterDirect(e,t)}let r=this._extensions.ext_texture_filter_anisotropic;return r&&t===r.TEXTURE_MAX_ANISOTROPY_EXT?this._gl.getTexParameterfv(e,t):(this.setError(this.INVALID_ENUM),null)},_getTexParameterDirect(e=0,t=0){return this._gl.getTexParameterx(e,t)?.unpack()}};function installTextureParameterMethods(e){Object.assign(e,er)}const tr={_getActiveTextureUnit(){return this._textureUnits[this._activeTextureUnit]},_getActiveTexture(e){let t=this._getActiveTextureUnit();return e===this.TEXTURE_2D?t._bind2D:e===this.TEXTURE_CUBE_MAP?t._bindCube:null},_getTexImage(e){let t=this._getActiveTextureUnit();return e===this.TEXTURE_2D?t._bind2D:validCubeTarget(this,e)?t._bindCube:(this.setError(this.INVALID_ENUM),null)},_checkTextureTarget(e){let t=this._getActiveTextureUnit(),n=null;if(e===this.TEXTURE_2D)n=t._bind2D;else if(e===this.TEXTURE_CUBE_MAP)n=t._bindCube;else return this.setError(this.INVALID_ENUM),!1;return n?!0:(this.setError(this.INVALID_OPERATION),!1)},_validTextureTarget(e){return e===this.TEXTURE_2D||e===this.TEXTURE_CUBE_MAP},_validCubeTarget(e){return e===this.TEXTURE_CUBE_MAP_POSITIVE_X||e===this.TEXTURE_CUBE_MAP_NEGATIVE_X||e===this.TEXTURE_CUBE_MAP_POSITIVE_Y||e===this.TEXTURE_CUBE_MAP_NEGATIVE_Y||e===this.TEXTURE_CUBE_MAP_POSITIVE_Z||e===this.TEXTURE_CUBE_MAP_NEGATIVE_Z},_verifyTextureCompleteness(e,t,n){let r=this._getActiveTextureUnit(),i=null;if(e===this.TEXTURE_2D?i=r._bind2D:this._validCubeTarget(e)&&(i=r._bindCube),this._extensions.oes_texture_float&&!this._extensions.oes_texture_float_linear&&i&&i._type===this.FLOAT&&(t===this.TEXTURE_MAG_FILTER||t===this.TEXTURE_MIN_FILTER)&&(n===this.LINEAR||n===this.LINEAR_MIPMAP_NEAREST||n===this.NEAREST_MIPMAP_LINEAR||n===this.LINEAR_MIPMAP_LINEAR)){i._complete=!1,this.bindTexture(e,i);return}i&&i._complete===!1&&(i._complete=!0,this.bindTexture(e,i))},_computePixelSize(e,t){let n=formatSize(this,t);if(n===0)return this.setError(this.INVALID_ENUM),0;switch(e){case this.UNSIGNED_BYTE:return n;case this.UNSIGNED_SHORT_5_6_5:if(t!==this.RGB){this.setError(this.INVALID_OPERATION);break}return 2;case this.UNSIGNED_SHORT_4_4_4_4:case this.UNSIGNED_SHORT_5_5_5_1:if(t!==this.RGBA){this.setError(this.INVALID_OPERATION);break}return 2;case this.FLOAT:return 1}return this.setError(this.INVALID_ENUM),0},_computeRowStride(e,t){let n=e*t;return n%this._unpackAlignment&&(n+=this._unpackAlignment-n%this._unpackAlignment),n},_checkDimensions(e,t,n,r){if(r<0||t<0||n<0)return this.setError(this.INVALID_VALUE),!1;if(e===this.TEXTURE_2D){if(t>this._maxTextureSize||n>this._maxTextureSize||r>this._maxTextureLevel)return this.setError(this.INVALID_VALUE),!1}else if(this._validCubeTarget(e)){if(t>this._maxCubeMapSize||n>this._maxCubeMapSize||r>this._maxCubeMapLevel)return this.setError(this.INVALID_VALUE),!1}else return this.setError(this.INVALID_ENUM),!1;return!0}};function installTextureIntrospectionMethods(e){Object.assign(e,tr)}function installTextureManagementMethods(e){installTextureLifecycleMethods(e),installTexImage2DMethods(e),installCopyAndCompressedTextureMethods(e),installTextureParameterMethods(e),installTextureIntrospectionMethods(e)}const usesStandardDerivatives=e=>/\b(?:dFdx|dFdy|fwidth)\s*\(/.test(e),nr=`gjsify_FragColor`,rr=`gjsify_FragData`,ir=`GJSIFY_OES_standard_derivatives`,ar=/\b(texture|sample|smooth|flat|layout|centroid|noperspective|patch|subroutine|precise|uint|uvec[234]|common|partition|active|filter)\b/g;function translateGlsl1ToDesktop(e,t,n,r,i){let a=e.replace(/^(\s*)#\s*version\s+100\b[^\n]*/,`$1`).replace(ar,`gjsify_$1`),o=[`#version ${n}`,`#define texture2D texture`,`#define texture2DProj textureProj`,`#define texture2DLod textureLod`,`#define texture2DProjLod textureProjLod`,`#define textureCube texture`,`#define textureCubeLod textureLod`];i&&o.push(`#define ${ir} 1`);let s=[];t===`vertex`?o.push(`#define attribute in`,`#define varying out`):(o.push(`#define varying in`),/\bgl_FragColor\b/.test(a)&&(o.push(`#define gl_FragColor ${nr}`),s.push(`out vec4 ${nr};`)),/\bgl_FragData\b/.test(a)&&(o.push(`#define gl_FragData ${rr}`),s.push(`out vec4 ${rr}[1];`)));let c=a.split(`
|
|
78
|
-
`),l=-1;for(let e=0;e<c.length;e++)/^\s*#\s*extension\s+GL_OES_standard_derivatives\b/.test(c[e])?(c[e]=`// `+c[e],l=e):/^\s*#\s*extension\b/.test(c[e])?l=e:/^\s*#\s*(?:if|ifdef|ifndef|elif)\b/.test(c[e])&&(c[e]=c[e].replace(/\bGL_OES_standard_derivatives\b/g,
|
|
77
|
+
</node>`}function isWin32(){return B.DIR_SEPARATOR===92}function defaultListenAddress(){return isWin32()?`nonce-tcp:host=127.0.0.1`:`unix:tmpdir=${B.get_tmp_dir()}`}var DevtoolsPeerServerError=class extends Error{constructor(e,t,n,r){super(e),this.address=t,this.reason=n,this.name=`DevtoolsPeerServerError`,this.cause=r}};function isAddressInUse(e){return e instanceof B.Error&&e.matches(z.io_error_quark(),z.IOErrorEnum.ADDRESS_IN_USE)}function unixSocketPath(e){if(!e.startsWith(`unix:`))return null;for(let t of e.slice(5).split(`,`)){let e=t.indexOf(`=`);if(!(e<0||t.slice(0,e)!==`path`))try{return decodeURIComponent(t.slice(e+1))}catch{return null}}return null}function inspectExistingSocket(e){try{if((z.File.new_for_path(e).query_info(`unix::mode`,z.FileQueryInfoFlags.NONE,null).get_attribute_uint32(`unix::mode`)&61440)!=49152)return`not-a-socket`}catch{return`not-a-socket`}let t=new z.SocketClient;t.set_timeout(2);let n;try{n=t.connect(z.UnixSocketAddress.new(e),null)}catch{return`dead`}return n.close(null),`live`}function clearReclaimableSocket(e){let t=unixSocketPath(e);if(!t||!B.file_test(t,B.FileTest.EXISTS))return;let n=inspectExistingSocket(t);if(n===`live`)throw new DevtoolsPeerServerError(`cannot listen on ${e}: another process is already listening there. Stop it, or point ${mn} (or options.address) at a different socket — GJSIFY_DEVTOOLS_INSTANCE=<label> lets two devtools-enabled apps run side by side.`,e,`address-in-use`);if(n===`not-a-socket`)throw new DevtoolsPeerServerError(`cannot listen on ${e}: ${t} already exists and is not a socket, so it will NOT be removed. Point ${mn} (or options.address) at a free path.`,e,`occupied-by-other-file`);try{z.File.new_for_path(t).delete(null)}catch(n){throw new DevtoolsPeerServerError(`cannot listen on ${e}: ${t} is a socket nothing listens on, but removing it failed (${n}). Delete it by hand, or point ${mn} at a free path.`,e,`address-in-use`,n)}console.log(`[gjsify-devtools] reclaimed the stale socket ${t}: nothing was listening on it (an abnormal exit — Ctrl-C, SIGKILL, a crash — leaves the inode behind).`)}function flagsForAddress(e){return e.startsWith(`tcp:`)||e.startsWith(`nonce-tcp:`)?z.DBusServerFlags.NONE:z.DBusServerFlags.AUTHENTICATION_REQUIRE_SAME_USER}function startDevtoolsPeerServer(e,t,n){let r=n&&n!==``?n:defaultListenAddress();clearReclaimableSocket(r);let i;try{i=z.DBusServer.new_sync(r,flagsForAddress(r),z.dbus_generate_guid(),null,null)}catch(e){let t=isAddressInUse(e);throw new DevtoolsPeerServerError(t?`cannot listen on ${r}: the address is already in use (${e}). Stop whatever holds it, or point ${mn} (or options.address) at a different address.`:`cannot listen on ${r}: ${e}. Check the address form — \`unix:path=/tmp/app.sock\`, \`unix:tmpdir=/tmp\` or \`nonce-tcp:host=127.0.0.1\`.`,r,t?`address-in-use`:`listen-failed`,e)}let a=new Set;i.connect(`new-connection`,(n,r)=>(a.add(r),r.connect(`closed`,()=>{e.unexport(r),a.delete(r)}),e.export(r,t),!0)),i.start();let o=!1;return{address:i.get_client_address(),objectPath:t,get connectionCount(){return a.size},stop(){if(!o){o=!0,i.stop();for(let t of a)e.unexport(t),!t.is_closed()&&t.close(null,(e,t)=>{try{e.close_finish(t)}catch{}});a.clear()}}}}function writeDevtoolsAddressFile(e,t){try{if(B.mkdir_with_parents(B.path_get_dirname(e),448),!B.file_set_contents(e,`${t}\n`))return null}catch(t){return console.error(`[gjsify-devtools] could not publish the peer address to ${e}: ${t}`),null}try{z.File.new_for_path(e).set_attribute_uint32(`unix::mode`,384,z.FileQueryInfoFlags.NONE,null)}catch(t){console.error(`[gjsify-devtools] could not restrict ${e} to the current user: ${t}`)}return e}function removeDevtoolsAddressFile(e){try{z.File.new_for_path(e).delete(null)}catch{}}const hn=e(import.meta.url);let gn;function load$2(){return gn===void 0&&(gn=hn(`@gjsify/node-gi/gi`).requireGi(`Graphene`,`1.0`)),gn}__name$1(load$2,`load`);var _n=new Proxy(Object.create(null),{get(e,t){return load$2()[t]},has(e,t){return t in load$2()}});function captureWidget(e){let t=e.get_native()?.get_renderer();if(!t)return{png:null,blocker:`no-renderer`};let n=e.get_width(),r=e.get_height();if(n<=0||r<=0)return{png:null,blocker:`zero-size`};let i=W.WidgetPaintable.new(e),a=W.Snapshot.new();i.snapshot(a,n,r);let o=a.to_node();if(!o)return{png:null,blocker:`empty-snapshot`};let s=new _n.Rect;s.init(0,0,n,r);let c=t.render_texture(o,s).save_to_png_bytes().get_data();return c?{png:new Uint8Array(c)}:{png:null,blocker:`empty-png`}}function dumpGSettings(e){let t=z.SettingsSchemaSource.get_default()?.lookup(e,!0);if(!t)throw Error(formatDbusErrorMessage(`not-found`,`GSettings schema '${e}' is not installed`));let n=new z.Settings({settings_schema:t}),r={};for(let e of t.list_keys())r[e]=n.get_value(e).recursiveUnpack();return r}const vn=e(import.meta.url);let yn;function load$1(){return yn===void 0&&(yn=vn(`@gjsify/node-gi/gi`).requireGi(`GObject`,`2.0`)),yn}__name$1(load$1,`load`);var bn=new Proxy(Object.create(null),{get(e,t){return load$1()[t]},has(e,t){return t in load$1()}});function parseWidgetPath(e){let t=e.split(`/`).filter(e=>e.length>0);if(t.length===0)return null;let n=t[0].match(/^toplevel:(\d+)$/);if(!n)return null;let r=[];for(let e of t.slice(1)){let t=e.match(/^child:(\d+)$/);if(!t)return null;r.push(Number(t[1]))}return{toplevel:Number(n[1]),children:r}}function buildWidgetPath(e,t){return[`toplevel:${e}`,...t.map(e=>`child:${e}`)].join(`/`)}function widgetType(e){return gtypeName(e)??`GtkWidget`}function gtypeName(e){let t=e;return typeof t?.$typeName==`string`&&t.$typeName.length>0?t.$typeName:t?.constructor?.$gtype?.name??null}function widgetIsA(e,t){let n=gtypeName(e);if(n===null||!t)return!1;if(n===t)return!0;let r=bn.type_from_name(n),i=bn.type_from_name(t);return!r||!i?!1:bn.type_is_a(r,i)}function activateWidget(e){let t=e;if(typeof t.activate==`function`&&t.activate()===!0)return!0;let n=typeof t.get_parent==`function`?t.get_parent():null;if(n&&widgetIsA(n,`GtkListBox`)){let t=n,r=!1;return typeof t.select_row==`function`&&(t.select_row(e),r=!0),typeof t.emit==`function`&&(t.emit(`row-activated`,e),r=!0),r}return!1}function sendKeyToWidget(e,t,n){let r=e.observe_controllers(),i=!1;for(let e=0;e<r.get_n_items();e++){let a=r.get_item(e);widgetIsA(a,`GtkEventControllerKey`)&&(a.emit(`key-pressed`,t,0,n),i=!0)}return i}function nthChild(e,t){let n=e.get_first_child(),r=0;for(;n&&r<t;)n=n.get_next_sibling(),r++;return r===t?n:null}function listToplevels(){let e=W.Window.get_toplevels(),t=e.get_n_items(),n=[];for(let r=0;r<t;r++){let t=e.get_item(r);t&&n.push({path:`toplevel:${r}`,type:widgetType(t),title:t.get_title?.()??null,mapped:t.get_mapped(),focused:t.is_active??!1})}return n}function resolveWidgetPath(e){let t=parseWidgetPath(e);if(!t)return null;let n=W.Window.get_toplevels().get_item(t.toplevel);if(!n)return null;for(let e of t.children)if(n=nthChild(n,e),!n)return null;return n}function parseWidgetSelector(e){let t=e.indexOf(`:`),n=(t<0?e:e.slice(0,t)).trim(),r=(t<0?``:e.slice(t+1)).trim();return!n&&!r?null:{type:n,cssClass:r}}function findWidgetPath(e,t,n){let r={path:null};return walkForSelector(e,t,n,r)??r.path}function walkForSelector(e,t,n,r){if(!e.get_visible()||!e.get_mapped())return null;if(!t.cssClass||e.get_css_classes().includes(t.cssClass)){if(!t.type||widgetType(e)===t.type)return n;r.path===null&&widgetIsA(e,t.type)&&(r.path=n)}let i=e.get_first_child(),a=0;for(;i;){let e=walkForSelector(i,t,`${n}/child:${a}`,r);if(e)return e;i=i.get_next_sibling(),a++}return null}function geometryOf(e){if(!e.get_mapped())return;let t=e.get_allocation(),n=t.width+e.get_margin_start()+e.get_margin_end(),r=t.height+e.get_margin_top()+e.get_margin_bottom(),[i,a]=e.measure(W.Orientation.HORIZONTAL,-1),o=n>0?Math.max(n,i):-1,[s,c]=e.measure(W.Orientation.VERTICAL,o),l={width:n,height:r,widthRequest:[i,a],heightRequest:[s,c]};return(n<i||r<s)&&(l.short=!0),l}function dumpTree(e,t,n){let r={path:n,type:widgetType(e),name:e.get_name()||null,cssClasses:e.get_css_classes(),mapped:e.get_mapped(),visible:e.get_visible(),children:[]},i=geometryOf(e);if(i!==void 0&&(r.geometry=i),t<=0)return e.get_first_child()&&(r.truncated=!0),r;let a=e.get_first_child(),o=0;for(;a;)r.children.push(dumpTree(a,t-1,`${n}/child:${o}`)),a=a.get_next_sibling(),o++;return r}function jsonSafe(e){let t=typeof e;return e==null||t===`string`||t===`number`||t===`boolean`?e??null:`[${t}]`}function getWidgetProperty(e,t){let n=e,r=t.replace(/-/g,`_`),i=t.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase());for(let e of[t,r,i])if(e in n)return jsonSafe(n[e])}function childIndex(e,t){let n=e.get_first_child(),r=0;for(;n;){if(n===t)return r;n=n.get_next_sibling(),r++}return-1}function pathOfWidget(e){let t=[],n=e,r=n.get_parent();for(;r;){let e=childIndex(r,n);if(e<0)return null;t.unshift(e),n=r,r=n.get_parent()}let i=W.Window.get_toplevels(),a=i.get_n_items();for(let e=0;e<a;e++)if(i.get_item(e)===n)return buildWidgetPath(e,t);return null}function isActiveWindowScope(e){return!e||e===`window`||e===`active`}function frameDelay(e){return new Promise(t=>{B.timeout_add(B.PRIORITY_DEFAULT,e,()=>(t(),B.SOURCE_REMOVE))})}async function captureWidgetWhenRenderable(e,t=12,n=50){let r=null;for(let i=0;i<t;i++){let t=captureWidget(e);if(t.png)return{png:t.png,blocker:null};r=t.blocker,await frameDelay(n)}let i=captureWidget(e);return{png:i.png,blocker:i.png?null:i.blocker??r}}var DevtoolsService=class{constructor(e,t){this._app=e,this._options=t,this._exported=new Map,this._peer=null,this._addressFile=null,this._kinds=new Map,this._extensions=t.extend??[];for(let[e,t]of Object.entries(pn))this._kinds.set(e,t);for(let e of this._extensions){for(let[t,n]of Object.entries(e.methodKinds))this._kinds.set(t,n);for(let[t,n]of Object.entries(e.handlers)){let e=n;this[t]=(...n)=>(this._guard(t),e(...n))}}}export(e,t){if(this._exported.has(e))return;let n=buildDevtoolsIfaceXml(this._extensions.flatMap(e=>e.methodsXml??[])),r=z.DBusExportedObject.wrapJSObject(n,this);r.export(e,t),this._exported.set(e,r)}unexport(e){if(e){this._exported.get(e)?.unexport(),this._exported.delete(e);return}for(let e of this._exported.values())e.unexport();this._exported.clear(),this._peer?.stop(),this._peer=null,this._addressFile&&=(removeDevtoolsAddressFile(this._addressFile),null)}attachPeerServer(e,t){this._peer=e,this._addressFile=t??null}get peerAddress(){return this._peer?.address??null}get addressFile(){return this._addressFile}GetStatus(){let e=this._app.get_active_window(),t={appId:this._app.get_application_id()??`unknown`,instance:this._options.instance??`default`,activeWindow:e?{id:e.get_name()||`window`,title:e.get_title()??``,mapped:e.get_mapped()}:null,toplevelCount:W.Window.get_toplevels().get_n_items(),focusedWidget:null,paused:this._isPaused()};for(let e of this._extensions){let n=e.contributeStatus?.();n&&Object.assign(t,n)}return JSON.stringify(t)}async ScreenshotAsync(e,t){try{let n=typeof e?.[0]==`string`?e[0]:``,r=await this._captureScopePng(n);t.return_value(new B.Variant(`(ay)`,[r]))}catch(e){t.return_dbus_error(`org.gjsify.Devtools.Error.Screenshot`,e instanceof Error?e.message:String(e))}}async _captureScopePng(e){let t=this._resolveRootWidget(e);if(!t){if(isActiveWindowScope(e))return new Uint8Array;throw Error(formatDbusErrorMessage(`not-found`,`no widget at '${e}'`))}let n=captureWidget(t.widget);if(n.png)return n.png;let r=t.widget.get_root();r instanceof W.Window&&r.present();let i=await captureWidgetWhenRenderable(t.widget);return i.png?i.png:(console.warn(`[devtools] Screenshot('${e}') has no image: ${i.blocker??`unknown`} after 12 tries. Empty bytes follow.`),new Uint8Array)}ListActions(){let e={app:describeActions(this._actionGroup(`app`)),win:describeActions(this._actionGroup(`win`))};return JSON.stringify(e)}ActivateAction(e,t,n){this._guard(`ActivateAction`);let r=this._scope(e);activateAction(this._requireGroup(r,t),t,this._parseValue(n))}ChangeActionState(e,t,n){this._guard(`ChangeActionState`);let r=this._scope(e);changeActionState(this._requireGroup(r,t),t,this._parseValue(n))}PresentWindow(){this._app.get_active_window()?.present()}ResizeWindow(e,t){this._guard(`ResizeWindow`);let n=this._app.get_active_window();if(!n)throw Error(formatDbusErrorMessage(`unavailable`,`no active window to resize`));let r=Math.max(1,Math.round(e)),i=Math.max(1,Math.round(t));return n.is_maximized()&&n.unmaximize(),n.is_fullscreen()&&n.unfullscreen(),n.set_default_size(r,i),[r,i]}ListToplevels(){return JSON.stringify(listToplevels())}DumpTree(e,t){let n=this._resolveRootWidget(e);if(!n)throw Error(formatDbusErrorMessage(`not-found`,`no widget at '${e||`active window`}'`));return JSON.stringify(dumpTree(n.widget,t>0?t:40,n.path))}GetProperty(e,t){let n=this._resolveRootWidget(e);if(!n)throw Error(formatDbusErrorMessage(`not-found`,`no widget at '${e}'`));let r=getWidgetProperty(n.widget,t);if(r===void 0)throw Error(formatDbusErrorMessage(`not-found`,`widget has no property '${t}'`));return JSON.stringify(r)}GetFocused(){let e=this._app.get_active_window(),t=e?e.get_focus():null;return JSON.stringify(t?{path:pathOfWidget(t),name:t.get_name()||null,type:widgetType(t)}:null)}ActivateWidget(e){this._guard(`ActivateWidget`);let t=this._resolveRootWidget(e);if(!t)throw Error(formatDbusErrorMessage(`not-found`,`no widget at '${e}'`));return activateWidget(t.widget)}FindWidget(e){let t=parseWidgetSelector(e);if(!t)throw Error(formatDbusErrorMessage(`invalid-params`,`empty selector '${e}'`));let n=this._resolveRootWidget(``);return n?findWidgetPath(n.widget,t,n.path)??``:``}SendKey(e,t){this._guard(`SendKey`);let[n,r,i]=W.accelerator_parse(e);if(!n)throw Error(formatDbusErrorMessage(`invalid-params`,`cannot parse accelerator '${e}'`));let a;if(a=t?this._resolveRootWidget(t)?.widget??null:this._app.get_active_window()?.get_focus()??null,!a)throw Error(formatDbusErrorMessage(`not-found`,`no widget at '${t||`focus`}'`));return sendKeyToWidget(a,r,i??0)}DumpGSettings(e){return JSON.stringify(dumpGSettings(e))}DumpCss(){return JSON.stringify(dumpCss())}SwapCss(e,t){return this._guard(`SwapCss`),swapCss(e,t)}_resolveRootWidget(e){if(isActiveWindowScope(e)){let e=this._app.get_active_window();return e?{widget:e,path:pathOfWidget(e)??`toplevel:0`}:null}let t=resolveWidgetPath(e);return t?{widget:t,path:e}:null}_isPaused(){return this._options.paused?.()??!1}_guard(e){let t=this._kinds.get(e);if(!t)throw Error(formatDbusErrorMessage(`internal`,`unclassified devtools method '${e}'`));if(t===`mutating`&&this._isPaused())throw Error(formatDbusErrorMessage(`paused`,`${e} rejected — external control is paused. Read-only methods keep working.`))}_scope(e){return e===`app`?`app`:`win`}_actionGroup(e){if(e===`app`)return this._app;if(this._options.winActionGroup)return this._options.winActionGroup;let t=this._app.get_active_window();return t instanceof W.ApplicationWindow?t:null}_requireGroup(e,t){let n=this._actionGroup(e);if(!n)throw Error(formatDbusErrorMessage(`unavailable`,`no '${e}' action group`));if(!n.has_action(t))throw Error(formatDbusErrorMessage(`not-found`,`unknown action ${e}.${t}`));return n}_parseValue(e){if(!e||e===`null`)return null;try{return JSON.parse(e)}catch{throw Error(formatDbusErrorMessage(`invalid-params`,`value_json is not valid JSON: ${e}`))}}};const xn=`DBUS_SESSION_BUS_ADDRESS`,Sn=new Set;function envEnabled(){return isDevtoolsEnabledValue(B.getenv(`GJSIFY_DEVTOOLS`))}function envValue(e){let t=B.getenv(e);return t&&t!==``?t:null}function sessionBusUsable(){if(!envValue(xn))return!1;try{return z.bus_get_sync(z.BusType.SESSION,null),!0}catch{return!1}}function chooseDevtoolsTransport(e){return e.requestedAddress?{kind:`peer`,address:e.requestedAddress,reason:`requested`}:e.hasAppConnection?{kind:`session-bus`}:e.sessionBusUsable?{kind:`unregistered`}:{kind:`peer`,address:null,reason:`no-session-bus`}}function describeMissingConnection(e,t){return e?t?`[gjsify-devtools] the session bus answers but this application is not registered on it yet — call installDevtools() from the GtkApplication "startup" handler (the bus connection and object path exist only after registration).`:`[gjsify-devtools] ${xn} is set (${e}) but no bus answers there — using the bus-less peer transport instead. On macOS this is the usual state: Homebrew's dbus listens on launchd, so the advertised address only works while that socket is live.`:`[gjsify-devtools] this machine has no session bus (${xn} is unset) — using the bus-less peer transport instead. Point the bridge at the address below, or set ${mn} on both the app and \`gjsify debug\` to pin it yourself.`}function installDevtools(e,t={}){if(!(t.enabled??envEnabled()))return null;let n=t.instance??envValue(`GJSIFY_DEVTOOLS_INSTANCE`)??void 0,r=new DevtoolsService(e,{...t,instance:n});try{return exportDevtools(e,r,t,n)}catch(e){return r.unexport(),console.error(`[gjsify-devtools] devtools stayed OFF, the app is unaffected — ${describeInstallFailure(e)}`),null}}function describeInstallFailure(e){return e instanceof DevtoolsPeerServerError||e instanceof Error?e.message:String(e)}function exportDevtools(e,t,n,r){let i=e.get_is_registered(),a=i?e.get_dbus_connection():null,o=i?e.get_dbus_object_path():null,s=envValue(xn),c=!!(a&&o),l=c||sessionBusUsable(),u=chooseDevtoolsTransport({requestedAddress:n.address??envValue(mn),hasAppConnection:c,sessionBusUsable:l}),d=e.get_application_id()??`unknown`,f=`${o??appIdToObjectPath(d)}/devtools`;if((u.kind===`unregistered`||u.kind===`peer`&&u.reason===`no-session-bus`)&&console.error(describeMissingConnection(s,l)),u.kind===`session-bus`&&a)t.export(a,f),console.log(`[gjsify-devtools] exported ${fn} at ${f} (dest ${d})`);else if(u.kind===`peer`){let n=startDevtoolsPeerServer(t,f,u.address??void 0),i=writeDevtoolsAddressFile(devtoolsAddressFilePath(B.get_user_runtime_dir(),d,r),n.address);t.attachPeerServer(n,i),console.log(`[gjsify-devtools] exported ${fn} at ${f} (peer address ${n.address}${i?`, published to ${i}`:``})`),i&&e.connect(`shutdown`,()=>removeDevtoolsAddressFile(i))}return Sn.add(t),t}const Cn=`&(?![a-zA-Z][a-zA-Z0-9]*;|#\\d+;|#x[0-9a-fA-F]+;)|<(?![a-zA-Z/!?])`;RegExp(Cn),RegExp(Cn,`g`);var Linkable=class{constructor(e){this._=0,this._references=[],this._refCount=0,this._pendingDelete=!1,this._binding=0,this._=e,this._references=[],this._refCount=0,this._pendingDelete=!1,this._binding=0}_link(e){return this._references.push(e),e._refCount+=1,!0}_unlink(e){let t=this._references.indexOf(e);if(t<0)return!1;for(;t>=0;)this._references[t]=this._references[this._references.length-1],this._references.pop(),--e._refCount,e._checkDelete(),t=this._references.indexOf(e);return!0}_linked(e){return this._references.indexOf(e)>=0}_checkDelete(){if(this._refCount<=0&&this._pendingDelete&&this._!==0){for(;this._references.length>0;)this._unlink(this._references[0]);this._performDelete(),this._=0}}_performDelete(){}},WebGLBuffer=class extends Linkable{constructor(e,t){super(e),this._size=0,this._elements=new Uint8Array,this._ctx=t}_performDelete(){let e=this._ctx;delete e._buffers[this._|0],e._gl.deleteBuffer(this._)}},WebGLUniformLocation=class{constructor(e,t,n){this._linkCount=0,this._array=null,this._=e,this._program=t,this._linkCount=t._linkCount,this._activeInfo=n,this._array=null}},WebGLDrawingBufferWrapper=class{constructor(e,t,n){this._framebuffer=e,this._color=t,this._depthStencil=n}},WebGLFramebuffer=class extends Linkable{constructor(e,t){if(super(e),this._binding=0,this._width=0,this._height=0,this._status=null,this._ctx=t,this._attachments={},this._attachments[t.COLOR_ATTACHMENT0]=null,this._attachments[t.DEPTH_ATTACHMENT]=null,this._attachments[t.STENCIL_ATTACHMENT]=null,this._attachments[t.DEPTH_STENCIL_ATTACHMENT]=null,this._attachmentLevel={},this._attachmentLevel[t.COLOR_ATTACHMENT0]=0,this._attachmentLevel[t.DEPTH_ATTACHMENT]=0,this._attachmentLevel[t.STENCIL_ATTACHMENT]=0,this._attachmentLevel[t.DEPTH_STENCIL_ATTACHMENT]=0,this._attachmentFace={},this._attachmentFace[t.COLOR_ATTACHMENT0]=0,this._attachmentFace[t.DEPTH_ATTACHMENT]=0,this._attachmentFace[t.STENCIL_ATTACHMENT]=0,this._attachmentFace[t.DEPTH_STENCIL_ATTACHMENT]=0,t._extensions.webgl_draw_buffers){let e=t._extensions.webgl_draw_buffers;this._attachments[e.COLOR_ATTACHMENT1_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT2_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT3_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT4_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT5_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT6_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT7_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT8_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT9_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT10_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT11_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT12_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT13_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT14_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT15_WEBGL]=null,this._attachments[t.NONE]=null,this._attachments[t.BACK]=null,this._attachmentLevel[e.COLOR_ATTACHMENT1_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT2_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT3_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT4_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT5_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT6_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT7_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT8_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT9_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT10_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT11_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT12_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT13_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT14_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT15_WEBGL]=0,this._attachmentLevel[t.NONE]=null,this._attachmentLevel[t.BACK]=null,this._attachmentFace[e.COLOR_ATTACHMENT1_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT2_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT3_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT4_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT5_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT6_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT7_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT8_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT9_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT10_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT11_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT12_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT13_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT14_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT15_WEBGL]=0,this._attachmentFace[t.NONE]=null,this._attachmentFace[t.BACK]=null}}_clearAttachment(e){let t=this._attachments[e];t&&(this._attachments[e]=null,this._unlink(t))}_setAttachment(e,t){this._attachments[t]!==e&&(this._clearAttachment(t),e&&(this._attachments[t]=e,this._link(e)))}_performDelete(){let e=this._ctx;delete e._framebuffers[this._|0],e._gl.deleteFramebuffer(this._|0)}},WebGLRenderbuffer=class extends Linkable{constructor(e,t){super(e),this._binding=0,this._width=0,this._height=0,this._format=0,this._ctx=t,this._binding=0,this._width=0,this._height=0,this._format=0}_performDelete(){let e=this._ctx;delete e._renderbuffers[this._|0],e._gl.deleteRenderbuffer(this._)}},WebGLTexture=class extends Linkable{constructor(e,t){super(e),this._binding=0,this._levelWidth=new Int32Array(32),this._levelHeight=new Int32Array(32),this._format=0,this._type=0,this._complete=!0,this._swizzled=!1,this._ctx=t}_performDelete(){let e=this._ctx;delete e._textures[this._|0],e._gl.deleteTexture(this._|0)}},WebGLProgram$1=class extends Linkable{static{__name$1(this,`WebGLProgram`)}constructor(e,t){super(e),this._linkCount=0,this._linkStatus=!1,this._linkInfoLog=`not linked`,this._attributes=[],this._uniforms=[],this._ctx=t,this._linkCount=0,this._linkStatus=!1,this._linkInfoLog=`not linked`,this._attributes=[],this._uniforms=[]}_performDelete(){let e=this._ctx;delete e._programs[this._|0],e._gl.deleteProgram(this._|0)}},WebGLShader$1=class extends Linkable{static{__name$1(this,`WebGLShader`)}constructor(e,t,n){super(e),this._source=``,this._userSource=``,this._needsDesktop=!1,this._desktopSpelled=!1,this._compileStatus=!1,this._compileInfo=``,this._needsRecompile=!1,this._type=n,this._ctx=t,this._source=``,this._compileStatus=!1,this._compileInfo=``}_performDelete(){let e=this._ctx;delete e._shaders[this._|0],e._gl.deleteShader(this._|0)}},WebGLShaderPrecisionFormat=class{constructor(e){this.rangeMin=e.rangeMin,this.rangeMax=e.rangeMax,this.precision=e.precision}},WebGLActiveInfo=class{constructor(e){this.size=e.size,this.type=e.type,this.name=e.name}},EXTBlendMinMax=class{constructor(){this.MIN_EXT=32775,this.MAX_EXT=32776}};function getEXTBlendMinMax(e){let t=null,n=e.getSupportedExtensions();return n&&n.indexOf(`EXT_blend_minmax`)>=0&&(t=new EXTBlendMinMax),t}var EXTColorBufferFloat=class{};function getEXTColorBufferFloat(e){let t=e.getSupportedExtensions();return t&&t.indexOf(`EXT_color_buffer_float`)>=0?new EXTColorBufferFloat:null}var EXTColorBufferHalfFloat=class{};function getEXTColorBufferHalfFloat(e){let t=e.getSupportedExtensions();return t&&t.indexOf(`EXT_color_buffer_half_float`)>=0?new EXTColorBufferHalfFloat:null}var EXTTextureFilterAnisotropic=class{constructor(){this.TEXTURE_MAX_ANISOTROPY_EXT=34046,this.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047}};function getEXTTextureFilterAnisotropic(e){let t=null,n=e.getSupportedExtensions();return n&&n.indexOf(`EXT_texture_filter_anisotropic`)>=0&&(t=new EXTTextureFilterAnisotropic),t}var OESElementIndexUint=class{};function getOESElementIndexUint(e){let t=null,n=e.getSupportedExtensions();return n&&n.indexOf(`OES_element_index_uint`)>=0&&(t=new OESElementIndexUint),t}var OESStandardDerivatives=class{constructor(){this.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723}};function getOESStandardDerivatives(e){let t=null,n=e.getSupportedExtensions();return n&&n.indexOf(`OES_standard_derivatives`)>=0&&(t=new OESStandardDerivatives),t}var OESTextureFloatLinear=class{};function getOESTextureFloatLinear(e){let t=null,n=e.getSupportedExtensions();return n&&n.indexOf(`OES_texture_float_linear`)>=0&&(t=new OESTextureFloatLinear),t}var OESTextureFloat=class{};function getOESTextureFloat(e){let t=null,n=e.getSupportedExtensions();return n&&n.indexOf(`OES_texture_float`)>=0&&(t=new OESTextureFloat),t}var OESTextureHalfFloat=class{constructor(){this.HALF_FLOAT_OES=36193}};function getOESTextureHalfFloat(e){let t=e.getSupportedExtensions();return t&&t.indexOf(`OES_texture_half_float`)>=0||e._native2?new OESTextureHalfFloat:null}var STACKGLDestroyContext=class{constructor(e){this.destroy=e.destroy.bind(e)}};function getSTACKGLDestroyContext(e){return new STACKGLDestroyContext(e)}var STACKGLResizeDrawingBuffer=class{constructor(e){this.resize=e.resize.bind(e)}};function getSTACKGLResizeDrawingBuffer(e){return new STACKGLResizeDrawingBuffer(e)}var WEBGLDebugRendererInfo=class{constructor(){this.UNMASKED_VENDOR_WEBGL=37445,this.UNMASKED_RENDERER_WEBGL=37446}};function getWEBGLDebugRendererInfo(e){return new WEBGLDebugRendererInfo}var WebGLContextAttributes=class{constructor(e,t,n,r,i,a,o,s){this.alpha=e,this.depth=t,this.stencil=n,this.antialias=r,this.premultipliedAlpha=i,this.preserveDrawingBuffer=a,this.preferLowPowerToHighPerformance=o,this.failIfMajorPerformanceCaveat=s}},WebGLTextureUnit=class{constructor(e,t){this._mode=0,this._bind2D=null,this._bindCube=null,this._ctx=e,this._idx=t}},WebGLVertexArrayObjectAttribute=class{constructor(e,t){this._isPointer=!1,this._pointerBuffer=null,this._pointerOffset=0,this._pointerSize=0,this._pointerStride=0,this._pointerType=0,this._pointerNormal=!1,this._divisor=0,this._inputSize=4,this._inputStride=0,this._ctx=e,this._idx=t,this._pointerType=e.FLOAT,this._clear()}_clear(){this._isPointer=!1,this._pointerBuffer=null,this._pointerOffset=0,this._pointerSize=0,this._pointerStride=0,this._pointerType=this._ctx.FLOAT,this._pointerNormal=!1,this._divisor=0,this._inputSize=4,this._inputStride=0}},WebGLVertexArrayGlobalAttribute=class{constructor(e){this._idx=0,this._idx=e,this._data=new Float32Array([0,0,0,1])}},WebGLVertexArrayObjectState=class{constructor(e){this._elementArrayBufferBinding=null;let t=e.getParameter(e.MAX_VERTEX_ATTRIBS);this._attribs=Array.from({length:t});for(let n=0;n<t;++n)this._attribs[n]=new WebGLVertexArrayObjectAttribute(e,n);this._elementArrayBufferBinding=null}setElementArrayBuffer(e){if(e!==null&&!(e instanceof WebGLBuffer))throw TypeError(`setElementArrayBuffer(WebGLBuffer?)`);let t=this._elementArrayBufferBinding;t!==e&&(t&&(--t._refCount,t._checkDelete()),e&&(e._refCount+=1),this._elementArrayBufferBinding=e)}cleanUp(){let e=this._elementArrayBufferBinding;e&&(--e._refCount,e._checkDelete(),this._elementArrayBufferBinding=null);for(let e=0;e<this._attribs.length;++e){let t=this._attribs[e];t._pointerBuffer&&(--t._pointerBuffer._refCount,t._pointerBuffer._checkDelete()),t._clear()}}releaseArrayBuffer(e){if(e)for(let t=0;t<this._attribs.length;++t){let n=this._attribs[t];n._pointerBuffer===e&&(--n._pointerBuffer._refCount,n._pointerBuffer._checkDelete(),n._clear())}}setVertexAttribPointer(e,t,n,r,i,a,o,s,c){let l=this._attribs[t];e!==l._pointerBuffer&&(l._pointerBuffer&&(--l._pointerBuffer._refCount,l._pointerBuffer._checkDelete()),e&&(e._refCount+=1),l._pointerBuffer=e),l._pointerSize=n,l._pointerOffset=r,l._pointerStride=i,l._pointerType=a,l._pointerNormal=o,l._inputStride=s,l._inputSize=c}},WebGLVertexArrayGlobalState=class{constructor(e){this._arrayBufferBinding=null;let t=e.getParameter(e.MAX_VERTEX_ATTRIBS);this._attribs=Array.from({length:t});for(let e=0;e<t;++e)this._attribs[e]=new WebGLVertexArrayGlobalAttribute(e);this._arrayBufferBinding=null}setArrayBuffer(e){if(e!==null&&!(e instanceof WebGLBuffer))throw TypeError(`setArrayBuffer(WebGLBuffer?)`);let t=this._arrayBufferBinding;t!==e&&(t&&(--t._refCount,t._checkDelete()),e&&(e._refCount+=1),this._arrayBufferBinding=e)}};function checkObject(e){return typeof e==`object`||e===void 0}function checkUniform(e,t){return t instanceof WebGLUniformLocation&&t._program===e&&t._linkCount===e._linkCount}function isTypedArray$1(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Uint32Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array}__name$1(isTypedArray$1,`isTypedArray`);function isValidString(e){let t=e.replace(/(?:\/\*(?:[\s\S]*?)\*\/)|(?:([\s;])+\/\/(?:.*)$)/gm,``);return!/["$`@\\'\0]/.test(t)}function vertexCount(e,t,n){switch(t){case e.TRIANGLES:return n-n%3;case e.LINES:return n-n%2;case e.LINE_LOOP:case e.POINTS:return n;case e.TRIANGLE_FAN:case e.LINE_STRIP:return n<2?0:n;case e.TRIANGLE_STRIP:return n<3?0:n;default:return-1}}function typeSize(e,t){switch(t){case e.UNSIGNED_BYTE:case e.BYTE:return 1;case e.UNSIGNED_SHORT:case e.SHORT:return 2;case e.UNSIGNED_INT:case e.INT:case e.FLOAT:return 4}return 0}function uniformTypeSize(e,t){switch(t){case e.BOOL_VEC4:case e.INT_VEC4:case e.FLOAT_VEC4:return 4;case e.BOOL_VEC3:case e.INT_VEC3:case e.FLOAT_VEC3:return 3;case e.BOOL_VEC2:case e.INT_VEC2:case e.FLOAT_VEC2:return 2;case e.BOOL:case e.INT:case e.FLOAT:case e.SAMPLER_2D:case e.SAMPLER_CUBE:return 1;default:return 0}}const listToArray=e=>{let t=[];for(let n of e.values())t.push(n);return t};function arrayToUint8Array(e){if(isTypedArray$1(e))return new Uint8Array(e.buffer).subarray(e.byteOffset,e.byteLength+e.byteOffset);if(Array.isArray(e)||e instanceof ArrayBuffer)return new Uint8Array(e);if(typeof e.values==`function`)return new Uint8Array(listToArray(e));throw Error(`Can't unpack typed array!`)}function Uint8ArrayToVariant(e){return new Vt.Variant(`ay`,e)}const extractImageData=e=>{let t=e.width,n=e.height;if(typeof e==`object`&&t!==void 0&&n!==void 0){if(e.data!==void 0)return e;let r=null;if(typeof e.getContext==`function`)r=e.getContext(`2d`);else if(typeof e.isPixbuf==`function`&&e.isPixbuf())return e.getImageData();else if(e.src!==void 0&&typeof document==`object`&&typeof document.createElement==`function`){let i=document.createElement(`canvas`);typeof i==`object`&&typeof i.getContext==`function`&&(i.width=t,i.height=n,r=i.getContext(`2d`),r!==null&&r.drawImage(e,0,0))}if(r!==null)return r.getImageData(0,0,t,n)}return null};function formatSize(e,t){switch(t){case e.ALPHA:case e.LUMINANCE:return 1;case e.LUMINANCE_ALPHA:return 2;case e.RGB:return 3;case e.RGBA:return 4}return 0}function convertPixels(e){if(typeof e==`object`&&e){if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint8ClampedArray||e instanceof Float32Array)return arrayToUint8Array(e);if(e instanceof Buffer)return new Uint8Array(e)}return null}function checkFormat(e,t){return t===e.ALPHA||t===e.LUMINANCE_ALPHA||t===e.LUMINANCE||t===e.RGB||t===e.RGBA}function validCubeTarget(e,t){return t===e.TEXTURE_CUBE_MAP_POSITIVE_X||t===e.TEXTURE_CUBE_MAP_NEGATIVE_X||t===e.TEXTURE_CUBE_MAP_POSITIVE_Y||t===e.TEXTURE_CUBE_MAP_NEGATIVE_Y||t===e.TEXTURE_CUBE_MAP_POSITIVE_Z||t===e.TEXTURE_CUBE_MAP_NEGATIVE_Z}function flag(e,t,n){return!e||typeof e!=`object`||!(t in e)?n:!!e[t]}function premultiplyAlpha(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=4){let r=e[n+3]/255;t[n]=Math.round(e[n]*r),t[n+1]=Math.round(e[n+1]*r),t[n+2]=Math.round(e[n+2]*r),t[n+3]=e[n+3]}return t}const wn=6406,Tn=6409,En=6410,Dn=6403,On=6404,kn=[36418,36419,36420,36421],An=[Dn,On,6405,wn];function isLegacyFormat(e){return e===wn||e===Tn||e===En}function coreStorageForLegacyFormat(e,t){if(!isLegacyFormat(e))return null;let n=e===En,r;switch(t){case 5121:r=n?33323:33321;break;case 5126:r=n?33328:33326;break;case 5131:case 36193:r=n?33327:33325;break;default:return null}return{internalFormat:r,format:n?33319:Dn,swizzle:legacySwizzle(e)}}function legacySwizzle(e){return e===wn?[0,0,0,Dn]:e===Tn?[Dn,Dn,Dn,1]:[Dn,Dn,Dn,On]}function textureParameterTarget(e){return e>=34069&&e<=34074?34067:e}function extractLegacyChannels(e,t){let n=e.length>>2;if(t===En){let t=new Uint8Array(n*2);for(let r=0;r<n;++r)t[2*r]=e[4*r],t[2*r+1]=e[4*r+3];return t}let r=t===wn?3:0,i=new Uint8Array(n);for(let t=0;t<n;++t)i[t]=e[4*t+r];return i}const jn={bindBuffer(e=0,t){if(!checkObject(t))throw TypeError(`bindBuffer(GLenum, WebGLBuffer)`);if(e!==this.ARRAY_BUFFER&&e!==this.ELEMENT_ARRAY_BUFFER){this.setError(this.INVALID_ENUM);return}if(!t)t=null,this._gl.bindBuffer(e,0);else if(t._pendingDelete)return;else if(this._checkWrapper(t,WebGLBuffer)){if(t._binding&&t._binding!==e){this.setError(this.INVALID_OPERATION);return}t._binding=e|0,this._gl.bindBuffer(e,t._|0)}else return;e===this.ARRAY_BUFFER?this._vertexGlobalState.setArrayBuffer(t):this._vertexObjectState.setElementArrayBuffer(t)},bufferData(e=0,t,n=0){let r=0,i=null;if(typeof t==`number`?r=t:typeof t==`object`&&(i=t),n!==this.STREAM_DRAW&&n!==this.STATIC_DRAW&&n!==this.DYNAMIC_DRAW){this.setError(this.INVALID_ENUM);return}if(e!==this.ARRAY_BUFFER&&e!==this.ELEMENT_ARRAY_BUFFER){this.setError(this.INVALID_ENUM);return}let a=this._getActiveBuffer(e);if(!a){this.setError(this.INVALID_OPERATION);return}if(i){let t=null;if(isTypedArray$1(i)||i instanceof DataView||i instanceof ArrayBuffer)t=arrayToUint8Array(i);else{this.setError(this.INVALID_VALUE);return}this._saveError(),this._gl.bufferData(e,Uint8ArrayToVariant(t),n);let r=this.getError();if(this._restoreError(r),r!==this.NO_ERROR)return;a._size=t.length,e===this.ELEMENT_ARRAY_BUFFER&&(a._elements=new Uint8Array(t))}else if(typeof t==`number`){if(r<0){this.setError(this.INVALID_VALUE);return}this._saveError(),this._gl.bufferDataSizeOnly(e,r,n);let t=this.getError();if(this._restoreError(t),t!==this.NO_ERROR)return;a._size=r,e===this.ELEMENT_ARRAY_BUFFER&&(a._elements=new Uint8Array(r))}else this.setError(this.INVALID_VALUE)},bufferSubData(e=0,t=0,n){if(e!==this.ARRAY_BUFFER&&e!==this.ELEMENT_ARRAY_BUFFER){this.setError(this.INVALID_ENUM);return}if(typeof n!=`object`||!n)throw TypeError(`bufferSubData: data must be a BufferSource`);let r=this._getActiveBuffer(e);if(!r){this.setError(this.INVALID_OPERATION);return}if(t<0||t>=r._size){this.setError(this.INVALID_VALUE);return}let i=null;if(isTypedArray$1(n)||n instanceof DataView||n instanceof ArrayBuffer)i=arrayToUint8Array(n);else{this.setError(this.INVALID_VALUE);return}if(t+i.length>r._size){this.setError(this.INVALID_VALUE);return}e===this.ELEMENT_ARRAY_BUFFER&&r._elements.set(i,t),this._gl.bufferSubData(e,t,Uint8ArrayToVariant(i))},createBuffer(){let e=this._gl.createBuffer();if(!e||e<=0)return null;let t=new WebGLBuffer(e,this);return this._buffers[e]=t,t},deleteBuffer(e){if(!checkObject(e)||e!==null&&!(e instanceof WebGLBuffer))throw TypeError(`deleteBuffer(WebGLBuffer)`);if(!(e instanceof WebGLBuffer&&this._checkOwns(e))){this.setError(this.INVALID_OPERATION);return}this._vertexGlobalState._arrayBufferBinding===e&&this.bindBuffer(this.ARRAY_BUFFER,null),this._vertexObjectState._elementArrayBufferBinding===e&&this.bindBuffer(this.ELEMENT_ARRAY_BUFFER,null),this._vertexObjectState===this._defaultVertexObjectState&&this._vertexObjectState.releaseArrayBuffer(e),e._pendingDelete=!0,e._checkDelete()},getBufferParameter(e=0,t=0){if(e!==this.ARRAY_BUFFER&&e!==this.ELEMENT_ARRAY_BUFFER)return this.setError(this.INVALID_ENUM),null;switch(t){case this.BUFFER_SIZE:case this.BUFFER_USAGE:return this._gl.getBufferParameteriv(e|0,t|0)[0];default:return this.setError(this.INVALID_ENUM),null}},_getActiveBuffer(e){return e===this.ARRAY_BUFFER?this._vertexGlobalState._arrayBufferBinding:e===this.ELEMENT_ARRAY_BUFFER?this._vertexObjectState._elementArrayBufferBinding:null}};function installBufferBindingMethods(e){Object.assign(e,jn)}const Mn={drawArrays(e=0,t=0,n=0){if(t<0||n<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let r=vertexCount(this,e,n);if(r<0){this.setError(this.INVALID_ENUM);return}if(!this._framebufferOk()||n===0)return;let i=t;n>0&&(i=n+t-1>>>0),this._checkVertexAttribState(i)&&this._gl.drawArrays(e,t,r)},drawElements(e=0,t=0,n=0,r=0){if(t<0||r<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let i=this._vertexObjectState._elementArrayBufferBinding;if(!i){this.setError(this.INVALID_OPERATION);return}let a=null,o=r;if(n===this.UNSIGNED_SHORT){if(o%2){this.setError(this.INVALID_OPERATION);return}o>>=1,a=new Uint16Array(i._elements.buffer)}else if(this._extensions.oes_element_index_uint&&n===this.UNSIGNED_INT){if(o%4){this.setError(this.INVALID_OPERATION);return}o>>=2,a=new Uint32Array(i._elements.buffer)}else if(n===this.UNSIGNED_BYTE)a=i._elements;else{this.setError(this.INVALID_ENUM);return}let s=t;switch(e){case this.TRIANGLES:t%3&&(s-=t%3);break;case this.LINES:t%2&&(s-=t%2);break;case this.POINTS:break;case this.LINE_LOOP:case this.LINE_STRIP:if(t<2){this.setError(this.INVALID_OPERATION);return}break;case this.TRIANGLE_FAN:case this.TRIANGLE_STRIP:if(t<3){this.setError(this.INVALID_OPERATION);return}break;default:this.setError(this.INVALID_ENUM);return}if(!this._framebufferOk())return;if(t===0){this._checkVertexAttribState(0);return}if(t+o>>>0>a.length){this.setError(this.INVALID_OPERATION);return}let c=-1;for(let e=o;e<o+t;++e)c=Math.max(c,a[e]);if(c<0){this._checkVertexAttribState(0);return}this._checkVertexAttribState(c)&&s>0&&this._gl.drawElements(e,s,n,r)},viewport(e,t,n,r){this._viewport[0]=e|0,this._viewport[1]=t|0,this._viewport[2]=n|0,this._viewport[3]=r|0,this._gl.viewport(e,t,n,r)},scissor(e,t,n,r){this._scissorBox[0]=e|0,this._scissorBox[1]=t|0,this._scissorBox[2]=n|0,this._scissorBox[3]=r|0,this._gl.scissor(e|0,t|0,n|0,r|0)},readPixels(e=0,t=0,n=0,r=0,i=0,a=0,o){if(!o)return;if(!(this._extensions.oes_texture_float&&a===this.FLOAT&&i===this.RGBA)){if(i===this.RGB||i===this.ALPHA||a!==this.UNSIGNED_BYTE){this.setError(this.INVALID_OPERATION);return}else if(i!==this.RGBA){this.setError(this.INVALID_ENUM);return}else if(n<0||r<0||!(o instanceof Uint8Array)){this.setError(this.INVALID_VALUE);return}}if(!this._framebufferOk()){console.error(`framebuffer is not okay!`);return}let s=n*4;s%this._packAlignment!==0&&(s+=this._packAlignment-s%this._packAlignment);let c=s*(r-1)+n*4;if(c<=0)return;if((o.length||o.byteLength||0)<c){this.setError(this.INVALID_VALUE);return}let l=this.drawingBufferWidth,u=this.drawingBufferHeight;this._activeFramebuffer&&(l=this._activeFramebuffer._width,u=this._activeFramebuffer._height);let d=arrayToUint8Array(o);if(e>=l||e+n<=0||t>=u||t+r<=0)for(let e=0;e<d.length;++e)d[e]=0;else if(e<0||e+n>l||t<0||t+r>u){for(let e=0;e<d.length;++e)d[e]=0;let o=e,c=n;e<0&&(c+=e,o=0),o+n>l&&(c=l-o);let f=t,p=r;t<0&&(p+=t,f=0),f+r>u&&(p=u-f);let m=c*4;if(m%this._packAlignment!==0&&(m+=this._packAlignment-m%this._packAlignment),c>0&&p>0){let n=new Uint8Array(m*p),r=this._gl.readPixels(o,f,c,p,i,a,Uint8ArrayToVariant(n)),l=r&&r.length>0?r:n,u=4*(o-e)+(f-t)*s;for(let e=0;e<p;++e)for(let t=0;t<c;++t)for(let n=0;n<4;++n)d[u+e*s+4*t+n]=l[e*m+4*t+n]}}else{let o=this._gl.readPixels(e,t,n,r,i,a,Uint8ArrayToVariant(d));o&&o.length>0&&d.set(o)}},enableVertexAttribArray(e){if(e<0||e>=this._vertexObjectState._attribs.length){this.setError(this.INVALID_VALUE);return}this._gl.enableVertexAttribArray(e),this._vertexObjectState._attribs[e]._isPointer=!0},disableVertexAttribArray(e=0){if(e<0||e>=this._vertexObjectState._attribs.length){this.setError(this.INVALID_VALUE);return}this._gl.disableVertexAttribArray(e),this._vertexObjectState._attribs[e]._isPointer=!1},vertexAttrib1f(e,t){if(e|=0,!this._checkVertexIndex(e))return;let n=this._vertexGlobalState._attribs[e]._data;n[3]=1,n[1]=n[2]=0,n[0]=t,this._gl.vertexAttrib1f(e|0,+t)},vertexAttrib1fv(e,t){if(e|=0,!this._checkVertexIndex(e))return;if(typeof t!=`object`||!t||t.length<1){this.setError(this.INVALID_OPERATION);return}let n=this._vertexGlobalState._attribs[e]._data;n[3]=1,n[2]=0,n[1]=0,n[0]=t[0],this._gl.vertexAttrib1f(e|0,+t[0])},vertexAttrib2f(e,t,n){if(e|=0,!this._checkVertexIndex(e))return;let r=this._vertexGlobalState._attribs[e]._data;r[3]=1,r[2]=0,r[1]=n,r[0]=t,this._gl.vertexAttrib2f(e|0,+t,+n)},vertexAttrib2fv(e,t){if(e|=0,!this._checkVertexIndex(e))return;if(typeof t!=`object`||!t||t.length<2){this.setError(this.INVALID_OPERATION);return}let n=this._vertexGlobalState._attribs[e]._data;n[3]=1,n[2]=0,n[1]=t[1],n[0]=t[0],this._gl.vertexAttrib2f(e|0,+t[0],+t[1])},vertexAttrib3f(e,t,n,r){if(e|=0,!this._checkVertexIndex(e))return;let i=this._vertexGlobalState._attribs[e]._data;i[3]=1,i[2]=r,i[1]=n,i[0]=t,this._gl.vertexAttrib3f(e|0,+t,+n,+r)},vertexAttrib3fv(e,t){if(e|=0,!this._checkVertexIndex(e))return;if(typeof t!=`object`||!t||t.length<3){this.setError(this.INVALID_OPERATION);return}let n=this._vertexGlobalState._attribs[e]._data;n[3]=1,n[2]=t[2],n[1]=t[1],n[0]=t[0],this._gl.vertexAttrib3f(e|0,+t[0],+t[1],+t[2])},vertexAttrib4f(e=0,t,n,r,i){if(!this._checkVertexIndex(e))return;let a=this._vertexGlobalState._attribs[e]._data;a[3]=i,a[2]=r,a[1]=n,a[0]=t,this._gl.vertexAttrib4f(e|0,+t,+n,+r,+i)},vertexAttrib4fv(e,t){if(e|=0,!this._checkVertexIndex(e))return;if(typeof t!=`object`||!t||t.length<4){this.setError(this.INVALID_OPERATION);return}let n=this._vertexGlobalState._attribs[e]._data;n[3]=t[3],n[2]=t[2],n[1]=t[1],n[0]=t[0],this._gl.vertexAttrib4f(e|0,+t[0],+t[1],+t[2],+t[3])},vertexAttribPointer(e=0,t=0,n=0,r=!1,i=0,a=0){if(i<0||a<0){this.setError(this.INVALID_VALUE);return}if(i<0||a<0||e<0||e>=this._vertexObjectState._attribs.length||!(t===1||t===2||t===3||t===4)){this.setError(this.INVALID_VALUE);return}if(this._vertexGlobalState._arrayBufferBinding===null){this.setError(this.INVALID_OPERATION);return}let o=typeSize(this,n);if(o===0||n===this.INT||n===this.UNSIGNED_INT){this.setError(this.INVALID_ENUM);return}if(i>255||i<0){this.setError(this.INVALID_VALUE);return}if(i%o!==0||a%o!==0){this.setError(this.INVALID_OPERATION);return}this._gl.vertexAttribPointer(e,t,n,r,i,a),this._vertexObjectState.setVertexAttribPointer(this._vertexGlobalState._arrayBufferBinding,e,t*o,a,i||t*o,n,r,i,t)},getVertexAttrib(e=0,t=0){if(e<0||e>=this._vertexObjectState._attribs.length)return this.setError(this.INVALID_VALUE),null;let n=this._vertexObjectState._attribs[e],r=this._vertexGlobalState._attribs[e]._data,i=this._extensions.angle_instanced_arrays;if(i&&t===i.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE||t===this.VERTEX_ATTRIB_ARRAY_DIVISOR)return n._divisor;switch(t){case this.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:return n._pointerBuffer;case this.VERTEX_ATTRIB_ARRAY_ENABLED:return n._isPointer;case this.VERTEX_ATTRIB_ARRAY_SIZE:return n._inputSize;case this.VERTEX_ATTRIB_ARRAY_STRIDE:return n._inputStride;case this.VERTEX_ATTRIB_ARRAY_TYPE:return n._pointerType;case this.VERTEX_ATTRIB_ARRAY_NORMALIZED:return n._pointerNormal;case this.CURRENT_VERTEX_ATTRIB:return new Float32Array(r);default:return this.setError(this.INVALID_ENUM),null}},getVertexAttribOffset(e=0,t=0){return e<0||e>=this._vertexObjectState._attribs.length?(this.setError(this.INVALID_VALUE),-1):t===this.VERTEX_ATTRIB_ARRAY_POINTER?this._vertexObjectState._attribs[e]._pointerOffset:(this.setError(this.INVALID_ENUM),-1)},_checkVertexAttribState(e){let t=this._activeProgram;if(!t)return this.setError(this.INVALID_OPERATION),!1;let n=this._vertexObjectState._attribs;for(let r=0;r<n.length;++r){let i=n[r];if(i._isPointer){let n=i._pointerBuffer;if(!n)return this.setError(this.INVALID_OPERATION),!1;if(t._attributes.indexOf(r)>=0){let t=0;if(t=i._divisor?i._pointerSize+i._pointerOffset:i._pointerStride*e+i._pointerSize+i._pointerOffset,t>n._size)return this.setError(this.INVALID_OPERATION),!1}}}return!0},_checkVertexIndex(e){return e<0||e>=this._vertexObjectState._attribs.length?(this.setError(this.INVALID_VALUE),!1):!0}};function installDrawingMethods(e){Object.assign(e,Mn)}const Nn={bindFramebuffer(e,t){if(!checkObject(t))throw TypeError(`bindFramebuffer(GLenum, WebGLFramebuffer)`);if(e!==this.FRAMEBUFFER){this.setError(this.INVALID_ENUM);return}if(!t)this._gl.bindFramebuffer(this.FRAMEBUFFER,this._gtkFboId);else if(t._pendingDelete)return;else if(this._checkWrapper(t,WebGLFramebuffer))this._gl.bindFramebuffer(this.FRAMEBUFFER,t._|0);else return;let n=this._activeFramebuffer;n!==t&&(n&&(--n._refCount,n._checkDelete()),t&&(t._refCount+=1)),this._activeFramebuffer=t,t&&this._updateFramebufferAttachments(t)},bindRenderbuffer(e,t){if(!checkObject(t))throw TypeError(`bindRenderbuffer(GLenum, WebGLRenderbuffer)`);if(e!==this.RENDERBUFFER){this.setError(this.INVALID_ENUM);return}if(!t)this._gl.bindRenderbuffer(e|0,0);else if(t._pendingDelete)return;else if(this._checkWrapper(t,WebGLRenderbuffer))this._gl.bindRenderbuffer(e|0,t._|0);else return;let n=this._activeRenderbuffer;n!==t&&(n&&(--n._refCount,n._checkDelete()),t&&(t._refCount+=1)),this._activeRenderbuffer=t},framebufferRenderbuffer(e,t,n,r){if(!checkObject(r))throw TypeError(`framebufferRenderbuffer(GLenum, GLenum, GLenum, WebGLRenderbuffer)`);if(e!==this.FRAMEBUFFER||!this._validFramebufferAttachment(t)||n!==this.RENDERBUFFER){this.setError(this.INVALID_ENUM);return}let i=this._activeFramebuffer;if(!i){this.setError(this.INVALID_OPERATION);return}r&&!this._checkWrapper(r,WebGLRenderbuffer)||(i._setAttachment(r,t),this._updateFramebufferAttachments(i))},framebufferTexture2D(e,t,n,r,i=0){if(e|=0,t|=0,n|=0,i|=0,!checkObject(r))throw TypeError(`framebufferTexture2D(GLenum, GLenum, GLenum, WebGLTexture, GLint)`);if(e!==this.FRAMEBUFFER||!this._validFramebufferAttachment(t)){this.setError(this.INVALID_ENUM);return}if(i!==0){this.setError(this.INVALID_VALUE);return}if(r&&!this._checkWrapper(r,WebGLTexture))return;if(n===this.TEXTURE_2D){if(r&&r._binding!==this.TEXTURE_2D){this.setError(this.INVALID_OPERATION);return}}else if(this._validCubeTarget(n)){if(r&&r._binding!==this.TEXTURE_CUBE_MAP){this.setError(this.INVALID_OPERATION);return}}else{this.setError(this.INVALID_ENUM);return}let a=this._activeFramebuffer;if(!a){this.setError(this.INVALID_OPERATION);return}a._attachmentLevel[t]=i,a._attachmentFace[t]=n,a._setAttachment(r,t),this._updateFramebufferAttachments(a)},createFramebuffer(){let e=this._gl.createFramebuffer();if(e<=0)return null;let t=new WebGLFramebuffer(e,this);return this._framebuffers[e]=t,t},deleteFramebuffer(e){if(!checkObject(e))throw TypeError(`deleteFramebuffer(WebGLFramebuffer)`);if(!(e instanceof WebGLFramebuffer&&this._checkOwns(e))){this.setError(this.INVALID_OPERATION);return}this._activeFramebuffer===e&&this.bindFramebuffer(this.FRAMEBUFFER,null),e._pendingDelete=!0,e._checkDelete()},createRenderbuffer(){let e=this._gl.createRenderbuffer();if(e<=0)return null;let t=new WebGLRenderbuffer(e,this);return this._renderbuffers[e]=t,t},deleteRenderbuffer(e){if(!checkObject(e))throw TypeError(`deleteRenderbuffer(WebGLRenderbuffer)`);if(!(e instanceof WebGLRenderbuffer&&this._checkOwns(e))){this.setError(this.INVALID_OPERATION);return}this._activeRenderbuffer===e&&this.bindRenderbuffer(this.RENDERBUFFER,null),this._detachRenderbufferFromAllFramebuffers(e),e._pendingDelete=!0,e._checkDelete()},renderbufferStorage(e=0,t=0,n=0,r=0){if(e!==this.RENDERBUFFER){this.setError(this.INVALID_ENUM);return}let i=this._activeRenderbuffer;if(!i){this.setError(this.INVALID_OPERATION);return}if(t!==this.RGBA4&&t!==this.RGB565&&t!==this.RGB5_A1&&t!==this.DEPTH_COMPONENT16&&t!==this.STENCIL_INDEX&&t!==this.STENCIL_INDEX8&&t!==this.DEPTH_STENCIL){this.setError(this.INVALID_ENUM);return}this._saveError(),this._gl.renderbufferStorage(e,t,n,r);let a=this.getError();if(this._restoreError(a),a!==this.NO_ERROR)return;i._width=n,i._height=r,i._format=t;let o=this._activeFramebuffer;if(o){let e=!1,t=this._getAttachments();for(let n=0;n<t.length;++n)if(o._attachments[t[n]]===i){e=!0;break}e&&this._updateFramebufferAttachments(this._activeFramebuffer)}},getFramebufferAttachmentParameter(e=0,t=0,n=0){if(e!==this.FRAMEBUFFER||!this._validFramebufferAttachment(t))return this.setError(this.INVALID_ENUM),null;let r=this._activeFramebuffer;if(!r)return this.setError(this.INVALID_OPERATION),null;let i=r._attachments[t];if(i===null){if(n===this.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)return this.NONE}else if(i instanceof WebGLTexture)switch(n){case this.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:return i;case this.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:return this.TEXTURE;case this.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:return r._attachmentLevel[t];case this.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:{let e=r._attachmentFace[t];return e===this.TEXTURE_2D?0:e}}else if(i instanceof WebGLRenderbuffer)switch(n){case this.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:return i;case this.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:return this.RENDERBUFFER}return this.setError(this.INVALID_ENUM),null},getRenderbufferParameter(e=0,t=0){if(e!==this.RENDERBUFFER)return this.setError(this.INVALID_ENUM),null;let n=this._activeRenderbuffer;if(!n)return this.setError(this.INVALID_OPERATION),null;switch(t){case this.RENDERBUFFER_INTERNAL_FORMAT:return n._format;case this.RENDERBUFFER_WIDTH:return n._width;case this.RENDERBUFFER_HEIGHT:return n._height;case this.MAX_RENDERBUFFER_SIZE:return this._maxRenderbufferSize;case this.RENDERBUFFER_RED_SIZE:case this.RENDERBUFFER_GREEN_SIZE:case this.RENDERBUFFER_BLUE_SIZE:case this.RENDERBUFFER_ALPHA_SIZE:case this.RENDERBUFFER_DEPTH_SIZE:case this.RENDERBUFFER_STENCIL_SIZE:return this._gl.getRenderbufferParameter(e,t)}return this.setError(this.INVALID_ENUM),null},checkFramebufferStatus(e){if(e!==this.FRAMEBUFFER)return this.setError(this.INVALID_ENUM),0;let t=this._activeFramebuffer;return t?this._preCheckFramebufferStatus(t):this.FRAMEBUFFER_COMPLETE},_preCheckFramebufferStatus(e){let t=e._attachments,n=[],r=[],i=t[this.DEPTH_ATTACHMENT],a=t[this.DEPTH_STENCIL_ATTACHMENT],o=t[this.STENCIL_ATTACHMENT];if(a&&(o||i)||o&&i)return this.FRAMEBUFFER_UNSUPPORTED;let s=this._getColorAttachments(),c=0;for(let e in t)t[e]&&s.indexOf(Number(e))!==-1&&c++;if(c===0)return this.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;if(a instanceof WebGLTexture)return this.FRAMEBUFFER_UNSUPPORTED;if(a instanceof WebGLRenderbuffer){if(a._format!==this.DEPTH_STENCIL)return this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;n.push(a._width),r.push(a._height)}if(i instanceof WebGLTexture)return this.FRAMEBUFFER_UNSUPPORTED;if(i instanceof WebGLRenderbuffer){if(i._format!==this.DEPTH_COMPONENT16)return this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;n.push(i._width),r.push(i._height)}if(o instanceof WebGLTexture)return this.FRAMEBUFFER_UNSUPPORTED;if(o instanceof WebGLRenderbuffer){if(o._format!==this.STENCIL_INDEX8)return this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;n.push(o._width),r.push(o._height)}let l=!1;for(let i=0;i<s.length;++i){let a=t[s[i]];if(a instanceof WebGLTexture){if(a._format!==this.RGBA||!(a._type===this.UNSIGNED_BYTE||a._type===this.FLOAT))return this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;l=!0;let t=e._attachmentLevel[this.COLOR_ATTACHMENT0];if(t===null)throw TypeError(`level is null!`);n.push(a._levelWidth[t]),r.push(a._levelHeight[t])}else if(a instanceof WebGLRenderbuffer){let e=a._format;if(e!==this.RGBA4&&e!==this.RGB565&&e!==this.RGB5_A1)return this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;l=!0,n.push(a._width),r.push(a._height)}}if(!l&&!o&&!i&&!a)return this.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;if(n.length<=0||r.length<=0)return this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;for(let e=1;e<n.length;++e)if(n[e-1]!==n[e]||r[e-1]!==r[e])return this.FRAMEBUFFER_INCOMPLETE_DIMENSIONS;return n[0]===0||r[0]===0?this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:(e._width=n[0],e._height=r[0],this.FRAMEBUFFER_COMPLETE)},_framebufferOk(){let e=this._activeFramebuffer;return e&&this._preCheckFramebufferStatus(e)!==this.FRAMEBUFFER_COMPLETE?(this.setError(this.INVALID_FRAMEBUFFER_OPERATION),!1):!0},_validFramebufferAttachment(e){switch(e){case this.DEPTH_ATTACHMENT:case this.STENCIL_ATTACHMENT:case this.DEPTH_STENCIL_ATTACHMENT:case this.COLOR_ATTACHMENT0:return!0}if(this._extensions.webgl_draw_buffers){let t=this._extensions.webgl_draw_buffers;return e<t.COLOR_ATTACHMENT0_WEBGL+t._maxDrawBuffers}return!1},_updateFramebufferAttachments(e){if(!e)return;let t=e._status,n=this._getAttachments();if(e._status=this._preCheckFramebufferStatus(e),e._status!==this.FRAMEBUFFER_COMPLETE){if(t===this.FRAMEBUFFER_COMPLETE)for(let t=0;t<n.length;++t){let r=n[t];this._gl.framebufferTexture2D(this.FRAMEBUFFER,r,e._attachmentFace[r]||0,0,e._attachmentLevel[r]||0)}return}for(let t=0;t<n.length;++t){let r=n[t];this._gl.framebufferTexture2D(this.FRAMEBUFFER,r,e._attachmentFace[r]||0,0,e._attachmentLevel[r]||0)}for(let t=0;t<n.length;++t){let r=n[t],i=e._attachments[r];i instanceof WebGLTexture?this._gl.framebufferTexture2D(this.FRAMEBUFFER,r,e._attachmentFace[r]||0,i._|0,e._attachmentLevel[r]||0):i instanceof WebGLRenderbuffer&&this._gl.framebufferRenderbuffer(this.FRAMEBUFFER,r,this.RENDERBUFFER,i._|0)}},_tryDetachFramebuffer(e,t){if(e&&e._linked(t)){let n=this._getAttachments();for(let r=0;r<n.length;++r)e._attachments[n[r]]===t&&this.framebufferTexture2D(this.FRAMEBUFFER,n[r]|0,this.TEXTURE_2D,null)}},_detachRenderbufferFromAllFramebuffers(e){let t=this._activeFramebuffer,n=this._getAttachments(),r=!1;for(let i in this._framebuffers){let a=this._framebuffers[i];if(!(!a||!a._linked(e))){a!==t&&(this._gl.bindFramebuffer(this.FRAMEBUFFER,a._|0),r=!0);for(let t=0;t<n.length;++t){let r=n[t];a._attachments[r]===e&&(this._gl.framebufferRenderbuffer(this.FRAMEBUFFER,r,this.RENDERBUFFER,0),a._setAttachment(null,r))}}}r&&this._gl.bindFramebuffer(this.FRAMEBUFFER,t?t._|0:this._gtkFboId)},_getAttachments(){return this._extensions.webgl_draw_buffers?this._extensions.webgl_draw_buffers._ALL_ATTACHMENTS:this.DEFAULT_ATTACHMENTS},_getColorAttachments(){return this._extensions.webgl_draw_buffers?this._extensions.webgl_draw_buffers._ALL_COLOR_ATTACHMENTS:this.DEFAULT_COLOR_ATTACHMENTS},_resizeDrawingBuffer(e,t){let n=this._activeFramebuffer,r=this._getActiveTexture(this.TEXTURE_2D),i=this._activeRenderbuffer,a=this._contextAttributes,o=this._drawingBuffer;o?._framebuffer&&this._gl.bindFramebuffer(this.FRAMEBUFFER,o?._framebuffer);let s=this._getAttachments();for(let e=0;e<s.length;++e)this._gl.framebufferTexture2D(this.FRAMEBUFFER,s[e],this.TEXTURE_2D,0,0);o?._color&&this._gl.bindTexture(this.TEXTURE_2D,o?._color);let c=a.alpha?this.RGBA:this.RGB;this._gl.texImage2D(this.TEXTURE_2D,0,c,e,t,0,c,this.UNSIGNED_BYTE,Uint8ArrayToVariant(null)),this._gl.texParameteri(this.TEXTURE_2D,this.TEXTURE_MIN_FILTER,this.NEAREST),this._gl.texParameteri(this.TEXTURE_2D,this.TEXTURE_MAG_FILTER,this.NEAREST),o?._color&&this._gl.framebufferTexture2D(this.FRAMEBUFFER,this.COLOR_ATTACHMENT0,this.TEXTURE_2D,o?._color,0);let l=0,u=0;a.depth&&a.stencil?(l=this.DEPTH_STENCIL,u=this.DEPTH_STENCIL_ATTACHMENT):a.depth?(l=33191,u=this.DEPTH_ATTACHMENT):a.stencil&&(l=this.STENCIL_INDEX8,u=this.STENCIL_ATTACHMENT),l&&(o?._depthStencil&&this._gl.bindRenderbuffer(this.RENDERBUFFER,o?._depthStencil),this._gl.renderbufferStorage(this.RENDERBUFFER,l,e,t),o?._depthStencil&&this._gl.framebufferRenderbuffer(this.FRAMEBUFFER,u,this.RENDERBUFFER,o?._depthStencil)),this.bindFramebuffer(this.FRAMEBUFFER,n),this.bindTexture(this.TEXTURE_2D,r),this.bindRenderbuffer(this.RENDERBUFFER,i)},_allocateDrawingBuffer(e,t){this._drawingBuffer=new WebGLDrawingBufferWrapper(this._gl.createFramebuffer(),this._gl.createTexture(),this._gl.createRenderbuffer()),this._resizeDrawingBuffer(e,t)},resize(e=0,t=0){if(e|=0,t|=0,e>0&&t>0)(e!==this.drawingBufferWidth||t!==this.drawingBufferHeight)&&this._resizeDrawingBuffer(e,t);else throw Error(`Invalid surface dimensions`)}};function installFramebufferMethods(e){Object.assign(e,Nn)}const Pn={enable(e=0){this._gl.enable(e)},disable(e=0){if(this._gl.disable(e),e===this.TEXTURE_2D||e===this.TEXTURE_CUBE_MAP){let t=this._getActiveTextureUnit();t._mode===e&&(t._mode=0)}},cullFace(e){this._gl.cullFace(e|0)},depthFunc(e){switch(e|=0,e){case this.NEVER:case this.LESS:case this.EQUAL:case this.LEQUAL:case this.GREATER:case this.NOTEQUAL:case this.GEQUAL:case this.ALWAYS:this._gl.depthFunc(e);return;default:this.setError(this.INVALID_ENUM)}},depthMask(e){this._gl.depthMask(!!e)},depthRange(e,t){if(e=+e,t=+t,e<=t){this._gl.depthRange(e,t);return}this.setError(this.INVALID_OPERATION)},frontFace(e=0){this._gl.frontFace(e)},lineWidth(e){if(isNaN(e)){this.setError(this.INVALID_VALUE);return}this._gl.lineWidth(+e)},polygonOffset(e,t){this._gl.polygonOffset(+e,+t)},sampleCoverage(e,t){this._gl.sampleCoverage(+e,!!t)},hint(e=0,t=0){let n=this._extensions.oes_standard_derivatives;if(!(e===this.GENERATE_MIPMAP_HINT||n&&e===n.FRAGMENT_SHADER_DERIVATIVE_HINT_OES)){this.setError(this.INVALID_ENUM);return}if(t!==this.FASTEST&&t!==this.NICEST&&t!==this.DONT_CARE){this.setError(this.INVALID_ENUM);return}e===this.GENERATE_MIPMAP_HINT&&(this._generateMipmapHint=t,this._isCoreProfile())||this._gl.hint(e,t)},finish(){this._gl.finish()},flush(){this._gl.flush()},blendColor(e=0,t=0,n=0,r=0){this._gl.blendColor(+e,+t,+n,+r)},blendEquation(e=0){if(this._validBlendMode(e)){this._gl.blendEquation(e);return}this.setError(this.INVALID_ENUM)},blendEquationSeparate(e=0,t=0){if(this._validBlendMode(e)&&this._validBlendMode(t)){this._gl.blendEquationSeparate(e,t);return}this.setError(this.INVALID_ENUM)},blendFunc(e=0,t=0){if(!this._validBlendFunc(e)||!this._validBlendFunc(t)){this.setError(this.INVALID_ENUM);return}if(this._isConstantBlendFunc(e)&&this._isConstantBlendFunc(t)){this.setError(this.INVALID_OPERATION);return}this._gl.blendFunc(e,t)},blendFuncSeparate(e=0,t=0,n=0,r=0){if(!(this._validBlendFunc(e)&&this._validBlendFunc(t)&&this._validBlendFunc(n)&&this._validBlendFunc(r))){this.setError(this.INVALID_ENUM);return}if(this._isConstantBlendFunc(e)&&this._isConstantBlendFunc(t)||this._isConstantBlendFunc(n)&&this._isConstantBlendFunc(r)){this.setError(this.INVALID_OPERATION);return}this._gl.blendFuncSeparate(e,t,n,r)},clear(e=0){this._framebufferOk()&&this._gl.clear(e)},clearColor(e,t,n,r){this._gl.clearColor(+e,+t,+n,+r)},clearDepth(e){this._gl.clearDepth(+e)},clearStencil(e=0){this._checkStencil=!1,this._gl.clearStencil(e)},colorMask(e,t,n,r){this._gl.colorMask(!!e,!!t,!!n,!!r)},stencilFunc(e,t,n){this._checkStencil=!0,this._gl.stencilFunc(e|0,t|0,n|0)},stencilFuncSeparate(e,t,n,r){this._checkStencil=!0,this._gl.stencilFuncSeparate(e|0,t|0,n|0,r|0)},stencilMask(e){this._checkStencil=!0,this._gl.stencilMask(e>>>0)},stencilMaskSeparate(e,t){this._checkStencil=!0,this._gl.stencilMaskSeparate(e|0,t>>>0)},stencilOp(e,t,n){this._checkStencil=!0,this._gl.stencilOp(e|0,t|0,n|0)},stencilOpSeparate(e,t,n,r){this._checkStencil=!0,this._gl.stencilOpSeparate(e|0,t|0,n|0,r|0)},isEnabled(e=0){return this._gl.isEnabled(e)},isContextLost(){return!1},getError(){return this._gl.getError()},setError(e){this._gl.setError(e)},isBuffer(e){return this._isObject(e,`isBuffer`,WebGLBuffer)?this._gl.isBuffer(e?._):!1},isFramebuffer(e){return this._isObject(e,`isFramebuffer`,WebGLFramebuffer)?this._gl.isFramebuffer(e?._):!1},isProgram(e){return this._isObject(e,`isProgram`,WebGLProgram$1)?this._gl.isProgram(e?._):!1},isRenderbuffer(e){return this._isObject(e,`isRenderbuffer`,WebGLRenderbuffer)?this._gl.isRenderbuffer(e?._):!1},isShader(e){return this._isObject(e,`isShader`,WebGLShader$1)?this._gl.isShader(e?._):!1},isTexture(e){return this._isObject(e,`isTexture`,WebGLTexture)?this._gl.isTexture(e?._):!1},generateMipmap(e=0){this._gl.generateMipmap(e)},_validBlendFunc(e){return e===this.ZERO||e===this.ONE||e===this.SRC_COLOR||e===this.ONE_MINUS_SRC_COLOR||e===this.DST_COLOR||e===this.ONE_MINUS_DST_COLOR||e===this.SRC_ALPHA||e===this.ONE_MINUS_SRC_ALPHA||e===this.DST_ALPHA||e===this.ONE_MINUS_DST_ALPHA||e===this.SRC_ALPHA_SATURATE||e===this.CONSTANT_COLOR||e===this.ONE_MINUS_CONSTANT_COLOR||e===this.CONSTANT_ALPHA||e===this.ONE_MINUS_CONSTANT_ALPHA},_validBlendMode(e){let t=this._extensions.ext_blend_minmax;return e===this.FUNC_ADD||e===this.FUNC_SUBTRACT||e===this.FUNC_REVERSE_SUBTRACT||!!(t&&(e===t.MIN_EXT||e===t.MAX_EXT))},_isConstantBlendFunc(e){return e===this.CONSTANT_COLOR||e===this.ONE_MINUS_CONSTANT_COLOR||e===this.CONSTANT_ALPHA||e===this.ONE_MINUS_CONSTANT_ALPHA},_saveError(){this._errorStack.push(this.getError())},_restoreError(e){let t=this._errorStack.pop();t===this.NO_ERROR?this.setError(e):t!==void 0&&this.setError(t)}};function installStateMethods(e){Object.assign(e,Pn)}const Fn={activeTexture(e=0){let t=e-this.TEXTURE0;if(t>=0&&t<this._textureUnits.length){this._activeTextureUnit=t,this._gl.activeTexture(e);return}this.setError(this.INVALID_ENUM)},bindTexture(e=0,t){if(!checkObject(t))throw TypeError(`bindTexture(GLenum, WebGLTexture)`);if(!this._validTextureTarget(e)){this.setError(this.INVALID_ENUM);return}let n=0;if(!t)t=null;else if(t instanceof WebGLTexture&&t._pendingDelete)return;else if(this._checkWrapper(t,WebGLTexture)){if(t._binding&&t._binding!==e){this.setError(this.INVALID_OPERATION);return}t._binding=e,t._complete&&(n=t._|0)}else return;this._saveError(),this._gl.bindTexture(e,n);let r=this.getError();if(this._restoreError(r),r!==this.NO_ERROR)return;let i=this._getActiveTextureUnit(),a=this._getActiveTexture(e);a!==t&&(a&&(--a._refCount,a._checkDelete()),t&&(t._refCount+=1)),e===this.TEXTURE_2D?i._bind2D=t:e===this.TEXTURE_CUBE_MAP&&(i._bindCube=t)},createTexture(){let e=this._gl.createTexture();if(e<=0)return null;let t=new WebGLTexture(e,this);return this._textures[e]=t,t},deleteTexture(e){if(!checkObject(e))throw TypeError(`deleteTexture(WebGLTexture)`);if(e instanceof WebGLTexture){if(!this._checkOwns(e)){this.setError(this.INVALID_OPERATION);return}}else return;let t=this._activeTextureUnit;for(let t=0;t<this._textureUnits.length;++t){let n=this._textureUnits[t];n._bind2D===e?(this.activeTexture(this.TEXTURE0+t),this.bindTexture(this.TEXTURE_2D,null)):n._bindCube===e&&(this.activeTexture(this.TEXTURE0+t),this.bindTexture(this.TEXTURE_CUBE_MAP,null))}this.activeTexture(this.TEXTURE0+t),this._detachTextureFromAllFramebuffers(e),e._pendingDelete=!0,e._checkDelete()},_detachTextureFromAllFramebuffers(e){let t=this._activeFramebuffer,n=this._getAttachments(),r=!1;for(let i in this._framebuffers){let a=this._framebuffers[i];if(!(!a||!a._linked(e))){a!==t&&(this._gl.bindFramebuffer(this.FRAMEBUFFER,a._|0),r=!0);for(let t=0;t<n.length;++t){let r=n[t];a._attachments[r]===e&&(this._gl.framebufferTexture2D(this.FRAMEBUFFER,r,a._attachmentFace[r]||this.TEXTURE_2D,0,a._attachmentLevel[r]||0),a._setAttachment(null,r))}}}r&&this._gl.bindFramebuffer(this.FRAMEBUFFER,t?t._|0:this._gtkFboId)},pixelStorei(e=0,t=0){if(typeof t==`boolean`&&(t=t===!1?0:1),e===this.UNPACK_ALIGNMENT)if(t===1||t===2||t===4||t===8)this._unpackAlignment=t;else{this.setError(this.INVALID_VALUE);return}else if(e===this.PACK_ALIGNMENT)if(t===1||t===2||t===4||t===8)this._packAlignment=t;else{this.setError(this.INVALID_VALUE);return}else if(e===this.UNPACK_COLORSPACE_CONVERSION_WEBGL){if(!(t===this.NONE||t===this.BROWSER_DEFAULT_WEBGL)){this.setError(this.INVALID_VALUE);return}}else if(e===this.UNPACK_FLIP_Y_WEBGL){this._unpackFlipY=!!t;return}else if(e===this.UNPACK_PREMULTIPLY_ALPHA_WEBGL){this._unpackPremultAlpha=!!t;return}this._gl.pixelStorei(e,t)}};function installTextureLifecycleMethods(e){Object.assign(e,Fn)}const In={texImage2D(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0,c){let l=0,u=0,d=0,f,p,m=0;if(arguments.length===6)if(s=i,d=r,a instanceof ft.Pixbuf)p=a,l=p.get_width(),u=p.get_height(),c=p.get_pixels();else{f=a;let e=extractImageData(f);if(e==null)throw TypeError(`texImage2D(GLenum, GLint, GLenum, GLint, GLenum, GLenum, ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement)`);l=e.width,u=e.height,c=e.data}else arguments.length===9&&(l=r,u=i,m=a,d=o,c=c);if(typeof c!=`object`&&c!==void 0)throw TypeError(`texImage2D(GLenum, GLint, GLenum, GLint, GLint, GLint, GLenum, GLenum, Uint8Array)`);if(!checkFormat(this,d)||!checkFormat(this,n)){this.setError(this.INVALID_ENUM);return}if(s===this.FLOAT&&!this._extensions.oes_texture_float){this.setError(this.INVALID_ENUM);return}let h=this._getTexImage(e);if(!h||d!==n){this.setError(this.INVALID_OPERATION);return}let g=this._computePixelSize(s,d);if(g===0||!this._checkDimensions(e,l,u,t))return;let _=convertPixels(c),v=this._computeRowStride(l,g),y=v*u;if(_&&_.length<y){this.setError(this.INVALID_OPERATION);return}if(m!==0||validCubeTarget(this,e)&&l!==u){this.setError(this.INVALID_VALUE);return}if(this._unpackPremultAlpha&&_&&d===this.RGBA&&(_=premultiplyAlpha(_)),this._unpackFlipY&&_&&l>0&&u>0){let e=new Uint8Array(_.length);for(let t=0;t<u;t++){let n=t*v,r=(u-1-t)*v;e.set(_.subarray(n,n+v),r)}_=e}let b=this._legacyFormatStorage(d,s);this._saveError(),this._gl.texImage2D(e,t,b?b.internalFormat:this._nativeFloatInternalFormat(n,s),l,u,m,b?b.format:d,s,Uint8ArrayToVariant(_));let x=this.getError();if(this._restoreError(x),x!==this.NO_ERROR)return;this._setTextureSwizzle(e,h,b?b.swizzle:null),h._levelWidth[t]=l,h._levelHeight[t]=u,h._format=d,h._type=s;let S=this._activeFramebuffer;if(S){let e=!1,t=this._getAttachments();for(let n=0;n<t.length;++n)if(S._attachments[t[n]]===h){e=!0;break}e&&this._activeFramebuffer&&this._updateFramebufferAttachments(this._activeFramebuffer)}},texSubImage2D(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0,c){let l=0,u=0,d=0,f,p;if(arguments.length===7)if(s=a,d=i,o instanceof ft.Pixbuf)p=o,l=p.get_width(),u=p.get_height(),c=p.get_pixels();else{f=o;let e=extractImageData(f);if(e==null)throw TypeError(`texSubImage2D(GLenum, GLint, GLint, GLint, GLenum, GLenum, ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement)`);l=e.width,u=e.height,c=e.data}else l=i,u=a,d=o;if(typeof c!=`object`)throw TypeError(`texSubImage2D(GLenum, GLint, GLint, GLint, GLint, GLint, GLenum, GLenum, Uint8Array)`);let m=this._getTexImage(e);if(!m){this.setError(this.INVALID_OPERATION);return}if(this._legacySubImageMismatch(m,d)){this.setError(this.INVALID_OPERATION);return}if(s===this.FLOAT&&!this._extensions.oes_texture_float){this.setError(this.INVALID_ENUM);return}let h=this._computePixelSize(s,d);if(h===0||!this._checkDimensions(e,l,u,t))return;if(n<0||r<0){this.setError(this.INVALID_VALUE);return}let g=convertPixels(c),_=this._computeRowStride(l,h),v=_*u;if(!g||g.length<v){this.setError(this.INVALID_OPERATION);return}if(this._unpackPremultAlpha&&g&&d===this.RGBA&&(g=premultiplyAlpha(g)),this._unpackFlipY&&g&&l>0&&u>0){let e=new Uint8Array(g.length);for(let t=0;t<u;t++){let n=t*_,r=(u-1-t)*_;e.set(g.subarray(n,n+_),r)}g=e}let y=this._legacyFormatStorage(d,s)?.format??d;this._gl.texSubImage2D(e,t,n,r,l,u,y,s,Uint8ArrayToVariant(g))}};function installTexImage2DMethods(e){Object.assign(e,In)}var Ln=__toESM(__commonJSMin((e=>{e.INT_MIN=-1<<31,e.isPow2=function(e){return!(e&e-1)&&!!e},e.log2=function(e){var t=(e>65535)<<4,n;return e>>>=t,n=(e>255)<<3,e>>>=n,t|=n,n=(e>15)<<2,e>>>=n,t|=n,n=(e>3)<<1,e>>>=n,t|=n,t|e>>1},e.nextPow2=function(e){return e+=e===0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1},(function(e){for(var t=0;t<256;++t){var n=t,r=t,i=7;for(n>>>=1;n;n>>>=1)r<<=1,r|=n&1,--i;e[t]=r<<i&255}})(Array(256))}))(),1);const Rn=5121,zn=35051,Bn=35052,Vn=[[3333,4],[3330,0],[3331,0],[3332,0],[3317,1],[3314,0],[3315,0],[3316,0]],Hn={copyTexImage2D(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0){let c=this._getTexImage(e);if(!c){this.setError(this.INVALID_OPERATION);return}if(n!==this.RGBA&&n!==this.RGB&&n!==this.ALPHA&&n!==this.LUMINANCE&&n!==this.LUMINANCE_ALPHA){this.setError(this.INVALID_ENUM);return}if(t<0||a<0||o<0||s!==0){this.setError(this.INVALID_VALUE);return}if(t>0&&!(Ln.isPow2(a)&&Ln.isPow2(o))){this.setError(this.INVALID_VALUE);return}let l=this._legacyFormatStorage(n,this.UNSIGNED_BYTE);this._saveError(),l&&n!==this.LUMINANCE?this._copyLegacyChannels(n,r,i,a,o,(n,r)=>this._gl.texImage2D(e,t,n.internalFormat,a,o,0,n.format,Rn,r)):this._gl.copyTexImage2D(e,t,l?l.internalFormat:n,r,i,a,o,s);let u=this.getError();this._restoreError(u),u===this.NO_ERROR&&(c._levelWidth[t]=a,c._levelHeight[t]=o,c._format=isLegacyFormat(n)?n:this.RGBA,c._type=this.UNSIGNED_BYTE,this._setTextureSwizzle(e,c,l?l.swizzle:null))},copyTexSubImage2D(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0){let c=this._getTexImage(e);if(!c){this.setError(this.INVALID_OPERATION);return}if(o<0||s<0||n<0||r<0||t<0){this.setError(this.INVALID_VALUE);return}if((c._format===this.ALPHA||c._format===this.LUMINANCE_ALPHA)&&this._legacyFormatStorage(c._format,this.UNSIGNED_BYTE)){this._copyLegacyChannels(c._format,i,a,o,s,(i,a)=>this._gl.texSubImage2D(e,t,n,r,o,s,i.format,Rn,a));return}this._gl.copyTexSubImage2D(e,t,n,r,i,a,o,s)},_copyLegacyChannels(e,t,n,r,i,a){let o=isLegacyFormat(e)?coreStorageForLegacyFormat(e,Rn):null;if(!o)return;if(this._gl.checkFramebufferStatus(36008)!==36053){this.setError(1286);return}let s=this._gl.getParameteri(35053),c=this._gl.getParameteri(35055),l=Vn.map(([e])=>this._gl.getParameteri(e)),u=this._packAlignment;s&&this._gl.bindBuffer(zn,0),c&&this._gl.bindBuffer(Bn,0);for(let[e,t]of Vn)this._gl.pixelStorei(e,t);this._packAlignment=4;try{let s=new Uint8Array(Math.max(0,r*i*4));s.length>0&&this.readPixels(t,n,r,i,6408,Rn,s),a(o,Uint8ArrayToVariant(extractLegacyChannels(s,e)))}finally{this._packAlignment=u,Vn.forEach(([e],t)=>this._gl.pixelStorei(e,l[t])),s&&this._gl.bindBuffer(zn,s),c&&this._gl.bindBuffer(Bn,c)}},compressedTexImage2D(e,t,n,r,i,a,o){this._saveError(),this._gl.compressedTexImage2D(e,t,n,r,i,a,Uint8ArrayToVariant(arrayToUint8Array(o)));let s=this.getError();if(this._restoreError(s),s!==this.NO_ERROR)return;let c=this._getTexImage(e);c&&(c._format=n,this._setTextureSwizzle(e,c,null))},compressedTexSubImage2D(e,t,n,r,i,a,o,s){this._gl.compressedTexSubImage2D(e,t,n,r,i,a,o,Uint8ArrayToVariant(arrayToUint8Array(s)))}};function installCopyAndCompressedTextureMethods(e){Object.assign(e,Hn)}const Un={texParameterf(e=0,t=0,n){if(n=+n,this._checkTextureTarget(e)){switch(this._verifyTextureCompleteness(e,t,n),t){case this.TEXTURE_MIN_FILTER:case this.TEXTURE_MAG_FILTER:case this.TEXTURE_WRAP_S:case this.TEXTURE_WRAP_T:this._gl.texParameterf(e,t,n);return}let r=this._extensions.ext_texture_filter_anisotropic;if(r&&t===r.TEXTURE_MAX_ANISOTROPY_EXT){this._gl.texParameterf(e,t,n);return}this.setError(this.INVALID_ENUM)}},texParameteri(e=0,t=0,n=0){if(this._checkTextureTarget(e)){switch(this._verifyTextureCompleteness(e,t,n),t){case this.TEXTURE_MIN_FILTER:case this.TEXTURE_MAG_FILTER:case this.TEXTURE_WRAP_S:case this.TEXTURE_WRAP_T:this._gl.texParameteri(e,t,n);return}let r=this._extensions.ext_texture_filter_anisotropic;if(r&&t===r.TEXTURE_MAX_ANISOTROPY_EXT){this._gl.texParameteri(e,t,n);return}this.setError(this.INVALID_ENUM)}},getTexParameter(e=0,t=0){if(!this._checkTextureTarget(e))return null;let n=this._getActiveTextureUnit();if(e===this.TEXTURE_2D&&!n._bind2D||e===this.TEXTURE_CUBE_MAP&&!n._bindCube)return this.setError(this.INVALID_OPERATION),null;switch(t){case this.TEXTURE_MAG_FILTER:case this.TEXTURE_MIN_FILTER:case this.TEXTURE_WRAP_S:case this.TEXTURE_WRAP_T:return this._getTexParameterDirect(e,t)}let r=this._extensions.ext_texture_filter_anisotropic;return r&&t===r.TEXTURE_MAX_ANISOTROPY_EXT?this._gl.getTexParameterfv(e,t):(this.setError(this.INVALID_ENUM),null)},_getTexParameterDirect(e=0,t=0){return this._gl.getTexParameterx(e,t)?.unpack()}};function installTextureParameterMethods(e){Object.assign(e,Un)}const Wn={_getActiveTextureUnit(){return this._textureUnits[this._activeTextureUnit]},_getActiveTexture(e){let t=this._getActiveTextureUnit();return e===this.TEXTURE_2D?t._bind2D:e===this.TEXTURE_CUBE_MAP?t._bindCube:null},_getTexImage(e){let t=this._getActiveTextureUnit();return e===this.TEXTURE_2D?t._bind2D:validCubeTarget(this,e)?t._bindCube:(this.setError(this.INVALID_ENUM),null)},_checkTextureTarget(e){let t=this._getActiveTextureUnit(),n=null;if(e===this.TEXTURE_2D)n=t._bind2D;else if(e===this.TEXTURE_CUBE_MAP)n=t._bindCube;else return this.setError(this.INVALID_ENUM),!1;return n?!0:(this.setError(this.INVALID_OPERATION),!1)},_validTextureTarget(e){return e===this.TEXTURE_2D||e===this.TEXTURE_CUBE_MAP},_validCubeTarget(e){return e===this.TEXTURE_CUBE_MAP_POSITIVE_X||e===this.TEXTURE_CUBE_MAP_NEGATIVE_X||e===this.TEXTURE_CUBE_MAP_POSITIVE_Y||e===this.TEXTURE_CUBE_MAP_NEGATIVE_Y||e===this.TEXTURE_CUBE_MAP_POSITIVE_Z||e===this.TEXTURE_CUBE_MAP_NEGATIVE_Z},_verifyTextureCompleteness(e,t,n){let r=this._getActiveTextureUnit(),i=null;if(e===this.TEXTURE_2D?i=r._bind2D:this._validCubeTarget(e)&&(i=r._bindCube),this._extensions.oes_texture_float&&!this._extensions.oes_texture_float_linear&&i&&i._type===this.FLOAT&&(t===this.TEXTURE_MAG_FILTER||t===this.TEXTURE_MIN_FILTER)&&(n===this.LINEAR||n===this.LINEAR_MIPMAP_NEAREST||n===this.NEAREST_MIPMAP_LINEAR||n===this.LINEAR_MIPMAP_LINEAR)){i._complete=!1,this.bindTexture(e,i);return}i&&i._complete===!1&&(i._complete=!0,this.bindTexture(e,i))},_computePixelSize(e,t){let n=formatSize(this,t);if(n===0)return this.setError(this.INVALID_ENUM),0;switch(e){case this.UNSIGNED_BYTE:return n;case this.UNSIGNED_SHORT_5_6_5:if(t!==this.RGB){this.setError(this.INVALID_OPERATION);break}return 2;case this.UNSIGNED_SHORT_4_4_4_4:case this.UNSIGNED_SHORT_5_5_5_1:if(t!==this.RGBA){this.setError(this.INVALID_OPERATION);break}return 2;case this.FLOAT:return 1}return this.setError(this.INVALID_ENUM),0},_computeRowStride(e,t){let n=e*t;return n%this._unpackAlignment&&(n+=this._unpackAlignment-n%this._unpackAlignment),n},_checkDimensions(e,t,n,r){if(r<0||t<0||n<0)return this.setError(this.INVALID_VALUE),!1;if(e===this.TEXTURE_2D){if(t>this._maxTextureSize||n>this._maxTextureSize||r>this._maxTextureLevel)return this.setError(this.INVALID_VALUE),!1}else if(this._validCubeTarget(e)){if(t>this._maxCubeMapSize||n>this._maxCubeMapSize||r>this._maxCubeMapLevel)return this.setError(this.INVALID_VALUE),!1}else return this.setError(this.INVALID_ENUM),!1;return!0}};function installTextureIntrospectionMethods(e){Object.assign(e,Wn)}function installTextureManagementMethods(e){installTextureLifecycleMethods(e),installTexImage2DMethods(e),installCopyAndCompressedTextureMethods(e),installTextureParameterMethods(e),installTextureIntrospectionMethods(e)}const usesStandardDerivatives=e=>/\b(?:dFdx|dFdy|fwidth)\s*\(/.test(e),Gn=`gjsify_FragColor`,Kn=`gjsify_FragData`,qn=`GJSIFY_OES_standard_derivatives`,Jn=/\b(texture|sample|smooth|flat|layout|centroid|noperspective|patch|subroutine|precise|uint|uvec[234]|common|partition|active|filter)\b/g;function translateGlsl1ToDesktop(e,t,n,r,i){let a=e.replace(/^(\s*)#\s*version\s+100\b[^\n]*/,`$1`).replace(Jn,`gjsify_$1`),o=[`#version ${n}`,`#define texture2D texture`,`#define texture2DProj textureProj`,`#define texture2DLod textureLod`,`#define texture2DProjLod textureProjLod`,`#define textureCube texture`,`#define textureCubeLod textureLod`];i&&o.push(`#define ${qn} 1`);let s=[];t===`vertex`?o.push(`#define attribute in`,`#define varying out`):(o.push(`#define varying in`),/\bgl_FragColor\b/.test(a)&&(o.push(`#define gl_FragColor ${Gn}`),s.push(`out vec4 ${Gn};`)),/\bgl_FragData\b/.test(a)&&(o.push(`#define gl_FragData ${Kn}`),s.push(`out vec4 ${Kn}[1];`)));let c=a.split(`
|
|
78
|
+
`),l=-1;for(let e=0;e<c.length;e++)/^\s*#\s*extension\s+GL_OES_standard_derivatives\b/.test(c[e])?(c[e]=`// `+c[e],l=e):/^\s*#\s*extension\b/.test(c[e])?l=e:/^\s*#\s*(?:if|ifdef|ifndef|elif)\b/.test(c[e])&&(c[e]=c[e].replace(/\bGL_OES_standard_derivatives\b/g,qn));return s.length>0&&c.splice(l+1,0,...s,`#line ${l+2}`),o.join(`
|
|
79
79
|
`)+`
|
|
80
80
|
`+r+`#line 1
|
|
81
81
|
`+c.join(`
|
|
82
|
-
`)}var
|
|
83
|
-
`),
|
|
84
|
-
`:k=0,++O;break;default:++k;break}}return S+=t,
|
|
85
|
-
`)&&T!==`\\`?(token(E.join(``)),C=s,t):(E.push(w),T=w,t+1)}function line_comment(){return preprocessor()}function block_comment(){return w===`/`&&T===`*`?(E.push(w),token(E.join(``)),C=s,t+1):(E.push(w),T=w,t+1)}function operator(){if(T===`.`&&/\d/.test(w))return C=m,t;if(T===`/`&&w===`*`)return C=l,t;if(T===`/`&&w===`/`)return C=u,t;if(w===`.`&&E.length){for(;determine_operator(E););return C=m,t}if(w===`;`||w===`)`||w===`(`){if(E.length)for(;determine_operator(E););return token(w),C=s,t+1}var e=E.length===2&&w!==`=`;if(/[\w_\d\s]/.test(w)||e){for(;determine_operator(E););return C=s,t}return E.push(w),T=w,t+1}function determine_operator(e){var t=0,n,i;do{if(n=r.indexOf(e.slice(0,e.length+t).join(``)),i=r[n],n===-1){if(t--+e.length>0)continue;i=e.slice(0,1).join(``)}return token(i),A+=i.length,E=E.slice(i.length),E.length}while(1)}function hex(){return/[^a-fA-F0-9]/.test(w)?(token(E.join(``)),C=s,t):(E.push(w),T=w,t+1)}function integer(){return w===`.`||/[eE]/.test(w)?(E.push(w),C=m,T=w,t+1):w===`x`&&E.length===1&&E[0]===`0`?(C=b,E.push(w),T=w,t+1):/[^\d]/.test(w)?(token(E.join(``)),C=s,t):(E.push(w),T=w,t+1)}function decimal(){return w===`f`&&(E.push(w),T=w,t+=1),/[eE]/.test(w)||(w===`-`||w===`+`)&&/[eE]/.test(T)?(E.push(w),T=w,t+1):/[^\d]/.test(w)?(token(E.join(``)),C=s,t):(E.push(w),T=w,t+1)}function readtoken(){if(/[^\d\w_]/.test(w)){var e=E.join(``);return C=
|
|
86
|
-
#version`)?/^\s*#\s*version\s+100\b/.test(e):glslDialectOf(e)===`glsl1`}const
|
|
82
|
+
`)}var Yn=__commonJSMin(((e,t)=>{t.exports=`precision.highp.mediump.lowp.attribute.const.uniform.varying.break.continue.do.for.while.if.else.in.out.inout.float.int.uint.void.bool.true.false.discard.return.mat2.mat3.mat4.vec2.vec3.vec4.ivec2.ivec3.ivec4.bvec2.bvec3.bvec4.sampler1D.sampler2D.sampler3D.samplerCube.sampler1DShadow.sampler2DShadow.struct.asm.class.union.enum.typedef.template.this.packed.goto.switch.default.inline.noinline.volatile.public.static.extern.external.interface.long.short.double.half.fixed.unsigned.input.output.hvec2.hvec3.hvec4.dvec2.dvec3.dvec4.fvec2.fvec3.fvec4.sampler2DRect.sampler3DRect.sampler2DRectShadow.sizeof.cast.namespace.using`.split(`.`)})),Xn=__commonJSMin(((e,t)=>{t.exports=`<<= >>= ++ -- << >> <= >= == != && || += -= *= /= %= &= ^^ ^= |= ( ) [ ] . ! ~ * / % + - < > & ^ | ? : = , ; { }`.split(` `)})),Zn=__commonJSMin(((e,t)=>{t.exports=`abs.acos.all.any.asin.atan.ceil.clamp.cos.cross.dFdx.dFdy.degrees.distance.dot.equal.exp.exp2.faceforward.floor.fract.gl_BackColor.gl_BackLightModelProduct.gl_BackLightProduct.gl_BackMaterial.gl_BackSecondaryColor.gl_ClipPlane.gl_ClipVertex.gl_Color.gl_DepthRange.gl_DepthRangeParameters.gl_EyePlaneQ.gl_EyePlaneR.gl_EyePlaneS.gl_EyePlaneT.gl_Fog.gl_FogCoord.gl_FogFragCoord.gl_FogParameters.gl_FragColor.gl_FragCoord.gl_FragData.gl_FragDepth.gl_FragDepthEXT.gl_FrontColor.gl_FrontFacing.gl_FrontLightModelProduct.gl_FrontLightProduct.gl_FrontMaterial.gl_FrontSecondaryColor.gl_LightModel.gl_LightModelParameters.gl_LightModelProducts.gl_LightProducts.gl_LightSource.gl_LightSourceParameters.gl_MaterialParameters.gl_MaxClipPlanes.gl_MaxCombinedTextureImageUnits.gl_MaxDrawBuffers.gl_MaxFragmentUniformComponents.gl_MaxLights.gl_MaxTextureCoords.gl_MaxTextureImageUnits.gl_MaxTextureUnits.gl_MaxVaryingFloats.gl_MaxVertexAttribs.gl_MaxVertexTextureImageUnits.gl_MaxVertexUniformComponents.gl_ModelViewMatrix.gl_ModelViewMatrixInverse.gl_ModelViewMatrixInverseTranspose.gl_ModelViewMatrixTranspose.gl_ModelViewProjectionMatrix.gl_ModelViewProjectionMatrixInverse.gl_ModelViewProjectionMatrixInverseTranspose.gl_ModelViewProjectionMatrixTranspose.gl_MultiTexCoord0.gl_MultiTexCoord1.gl_MultiTexCoord2.gl_MultiTexCoord3.gl_MultiTexCoord4.gl_MultiTexCoord5.gl_MultiTexCoord6.gl_MultiTexCoord7.gl_Normal.gl_NormalMatrix.gl_NormalScale.gl_ObjectPlaneQ.gl_ObjectPlaneR.gl_ObjectPlaneS.gl_ObjectPlaneT.gl_Point.gl_PointCoord.gl_PointParameters.gl_PointSize.gl_Position.gl_ProjectionMatrix.gl_ProjectionMatrixInverse.gl_ProjectionMatrixInverseTranspose.gl_ProjectionMatrixTranspose.gl_SecondaryColor.gl_TexCoord.gl_TextureEnvColor.gl_TextureMatrix.gl_TextureMatrixInverse.gl_TextureMatrixInverseTranspose.gl_TextureMatrixTranspose.gl_Vertex.greaterThan.greaterThanEqual.inversesqrt.length.lessThan.lessThanEqual.log.log2.matrixCompMult.max.min.mix.mod.normalize.not.notEqual.pow.radians.reflect.refract.sign.sin.smoothstep.sqrt.step.tan.texture2D.texture2DLod.texture2DProj.texture2DProjLod.textureCube.textureCubeLod.texture2DLodEXT.texture2DProjLodEXT.textureCubeLodEXT.texture2DGradEXT.texture2DProjGradEXT.textureCubeGradEXT`.split(`.`)})),Qn=__commonJSMin(((e,t)=>{t.exports=Yn().slice().concat(`layout.centroid.smooth.case.mat2x2.mat2x3.mat2x4.mat3x2.mat3x3.mat3x4.mat4x2.mat4x3.mat4x4.uvec2.uvec3.uvec4.samplerCubeShadow.sampler2DArray.sampler2DArrayShadow.isampler2D.isampler3D.isamplerCube.isampler2DArray.usampler2D.usampler3D.usamplerCube.usampler2DArray.coherent.restrict.readonly.writeonly.resource.atomic_uint.noperspective.patch.sample.subroutine.common.partition.active.filter.image1D.image2D.image3D.imageCube.iimage1D.iimage2D.iimage3D.iimageCube.uimage1D.uimage2D.uimage3D.uimageCube.image1DArray.image2DArray.iimage1DArray.iimage2DArray.uimage1DArray.uimage2DArray.image1DShadow.image2DShadow.image1DArrayShadow.image2DArrayShadow.imageBuffer.iimageBuffer.uimageBuffer.sampler1DArray.sampler1DArrayShadow.isampler1D.isampler1DArray.usampler1D.usampler1DArray.isampler2DRect.usampler2DRect.samplerBuffer.isamplerBuffer.usamplerBuffer.sampler2DMS.isampler2DMS.usampler2DMS.sampler2DMSArray.isampler2DMSArray.usampler2DMSArray`.split(`.`))})),$n=__commonJSMin(((e,t)=>{var n=Zn();n=n.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),t.exports=n.concat(`gl_VertexID.gl_InstanceID.gl_Position.gl_PointSize.gl_FragCoord.gl_FrontFacing.gl_FragDepth.gl_PointCoord.gl_MaxVertexAttribs.gl_MaxVertexUniformVectors.gl_MaxVertexOutputVectors.gl_MaxFragmentInputVectors.gl_MaxVertexTextureImageUnits.gl_MaxCombinedTextureImageUnits.gl_MaxTextureImageUnits.gl_MaxFragmentUniformVectors.gl_MaxDrawBuffers.gl_MinProgramTexelOffset.gl_MaxProgramTexelOffset.gl_DepthRangeParameters.gl_DepthRange.trunc.round.roundEven.isnan.isinf.floatBitsToInt.floatBitsToUint.intBitsToFloat.uintBitsToFloat.packSnorm2x16.unpackSnorm2x16.packUnorm2x16.unpackUnorm2x16.packHalf2x16.unpackHalf2x16.outerProduct.transpose.determinant.inverse.texture.textureSize.textureProj.textureLod.textureOffset.texelFetch.texelFetchOffset.textureProjOffset.textureLodOffset.textureProjLod.textureProjLodOffset.textureGrad.textureGradOffset.textureProjGrad.textureProjGradOffset`.split(`.`))})),er=__commonJSMin(((e,t)=>{t.exports=tokenize;var n=Yn(),r=Xn(),i=Zn(),a=Qn(),o=$n(),s=999,c=9999,l=0,u=1,d=2,f=3,p=4,m=5,h=6,g=7,_=8,v=9,y=10,b=11,x=[`block-comment`,`line-comment`,`preprocessor`,`operator`,`integer`,`float`,`ident`,`builtin`,`keyword`,`whitespace`,`eof`,`integer`];function tokenize(e){var t=0,S=0,C=s,w,T,E=[],D=[],O=1,k=0,A=0,ee=!1,j=!1,M=``,N;e||={};var te=i,P=n;e.version===`300 es`&&(te=o,P=a);for(var ne={},re={},t=0;t<te.length;t++)ne[te[t]]=!0;for(var t=0;t<P.length;t++)re[P[t]]=!0;return function(e){return D=[],e===null?end():write(e)};function token(e){e.length&&D.push({type:x[C],data:e,position:A,line:O,column:k})}function write(e){t=0,e.toString&&(e=e.toString()),M+=e.replace(/\r\n/g,`
|
|
83
|
+
`),N=M.length;for(var n;w=M[t],t<N;){switch(n=t,C){case l:t=block_comment();break;case u:t=line_comment();break;case d:t=preprocessor();break;case f:t=operator();break;case p:t=integer();break;case b:t=hex();break;case m:t=decimal();break;case c:t=readtoken();break;case v:t=whitespace();break;case s:t=normal();break}if(n!==t)switch(M[n]){case`
|
|
84
|
+
`:k=0,++O;break;default:++k;break}}return S+=t,M=M.slice(t),D}function end(e){return E.length&&token(E.join(``)),C=y,token(`(eof)`),D}function normal(){return E=E.length?[]:E,T===`/`&&w===`*`?(A=S+t-1,C=l,T=w,t+1):T===`/`&&w===`/`?(A=S+t-1,C=u,T=w,t+1):w===`#`?(C=d,A=S+t,t):/\s/.test(w)?(C=v,A=S+t,t):(ee=/\d/.test(w),j=/[^\w_]/.test(w),A=S+t,C=ee?p:j?f:c,t)}function whitespace(){return/[^\s]/g.test(w)?(token(E.join(``)),C=s,t):(E.push(w),T=w,t+1)}function preprocessor(){return(w===`\r`||w===`
|
|
85
|
+
`)&&T!==`\\`?(token(E.join(``)),C=s,t):(E.push(w),T=w,t+1)}function line_comment(){return preprocessor()}function block_comment(){return w===`/`&&T===`*`?(E.push(w),token(E.join(``)),C=s,t+1):(E.push(w),T=w,t+1)}function operator(){if(T===`.`&&/\d/.test(w))return C=m,t;if(T===`/`&&w===`*`)return C=l,t;if(T===`/`&&w===`/`)return C=u,t;if(w===`.`&&E.length){for(;determine_operator(E););return C=m,t}if(w===`;`||w===`)`||w===`(`){if(E.length)for(;determine_operator(E););return token(w),C=s,t+1}var e=E.length===2&&w!==`=`;if(/[\w_\d\s]/.test(w)||e){for(;determine_operator(E););return C=s,t}return E.push(w),T=w,t+1}function determine_operator(e){var t=0,n,i;do{if(n=r.indexOf(e.slice(0,e.length+t).join(``)),i=r[n],n===-1){if(t--+e.length>0)continue;i=e.slice(0,1).join(``)}return token(i),A+=i.length,E=E.slice(i.length),E.length}while(1)}function hex(){return/[^a-fA-F0-9]/.test(w)?(token(E.join(``)),C=s,t):(E.push(w),T=w,t+1)}function integer(){return w===`.`||/[eE]/.test(w)?(E.push(w),C=m,T=w,t+1):w===`x`&&E.length===1&&E[0]===`0`?(C=b,E.push(w),T=w,t+1):/[^\d]/.test(w)?(token(E.join(``)),C=s,t):(E.push(w),T=w,t+1)}function decimal(){return w===`f`&&(E.push(w),T=w,t+=1),/[eE]/.test(w)||(w===`-`||w===`+`)&&/[eE]/.test(T)?(E.push(w),T=w,t+1):/[^\d]/.test(w)?(token(E.join(``)),C=s,t):(E.push(w),T=w,t+1)}function readtoken(){if(/[^\d\w_]/.test(w)){var e=E.join(``);return C=re[e]?_:ne[e]?g:h,token(E.join(``)),C=s,t}return E.push(w),T=w,t+1}}})),tr=__toESM(__commonJSMin(((e,t)=>{var n=er();t.exports=tokenizeString;function tokenizeString(e,t){var r=n(t),i=[];return i=i.concat(r(e)),i=i.concat(r(null)),i}}))(),1);const nr=/\b(attribute|varying|gl_FragColor|gl_FragData|texture2D|texture2DProj|textureCube)\b/,rr=new RegExp([String.raw`^\s*(?:flat\s+|smooth\s+|centroid\s+)*(?:in|out)\s+\w+\s+\w+\s*;`,String.raw`\blayout\s*\(`,String.raw`\b(?:texture|textureProj|textureLod|textureProjLod|textureGrad|textureProjGrad|texelFetch|texelFetchOffset|textureSize|textureOffset)\s*\(`,String.raw`\b(?:isampler|usampler)(?:2D|3D|Cube|2DArray)\b`,String.raw`\b(?:uint|uvec[234])\b`,String.raw`\b(?:gl_VertexID|gl_InstanceID|gl_FragDepth)\b`].join(`|`),`m`);function glslDialectOf(e){return nr.test(e)?`glsl1`:rr.test(e)?`modern`:`glsl1`}function isGlsl1Source(e){return e.startsWith(`#version`)||e.includes(`
|
|
86
|
+
#version`)?/^\s*#\s*version\s+100\b/.test(e):glslDialectOf(e)===`glsl1`}const ir={createShader(e=0){if(e!==this.FRAGMENT_SHADER&&e!==this.VERTEX_SHADER)return this.setError(this.INVALID_ENUM),null;let t=this._gl.createShader(e);if(t<0)return null;let n=new WebGLShader$1(t,this,e);return this._shaders[t]=n,n},deleteShader(e){this._deleteLinkable(`deleteShader`,e,WebGLShader$1)},compileShader(e){if(!checkObject(e))throw TypeError(`compileShader(WebGLShader)`);if(this._checkWrapper(e,WebGLShader$1)&&this._checkShaderSource(e)){let t=this.getError();this._gl.compileShader(e._|0),e._needsRecompile=!1;let n=this.getError();e._compileStatus=!!this._gl.getShaderParameter(e._|0,this.COMPILE_STATUS),e._compileInfo=this._gl.getShaderInfoLog(e._|0)||`null`,this.getError(),this.setError(t||n)}},shaderSource(e,t){if(!checkObject(e))throw TypeError(`shaderSource(WebGLShader, String)`);if(!e||!t&&typeof t!=`string`){this.setError(this.INVALID_VALUE);return}isValidString(t)?this._checkWrapper(e,WebGLShader$1)&&(e._userSource=t,e._needsDesktop=this._needsDesktopSpelling(t),e._desktopSpelled=e._needsDesktop,t=this._wrapShader(e._type,t,e._desktopSpelled),this._gl.shaderSource(e._|0,t),e._source=t,e._needsRecompile=!0):this.setError(this.INVALID_VALUE)},getShaderInfoLog(e){if(!checkObject(e))throw TypeError(`getShaderInfoLog(WebGLShader)`);return this._checkWrapper(e,WebGLShader$1)?e._compileInfo:null},getShaderParameter(e,t=0){if(!checkObject(e))throw TypeError(`getShaderParameter(WebGLShader, GLenum)`);if(this._checkWrapper(e,WebGLShader$1)){switch(t){case this.DELETE_STATUS:return e._pendingDelete;case this.COMPILE_STATUS:return e._compileStatus;case this.SHADER_TYPE:return e._type}this.setError(this.INVALID_ENUM)}return null},getShaderPrecisionFormat(e=0,t=0){if(!(e===this.FRAGMENT_SHADER||e===this.VERTEX_SHADER)||!(t===this.LOW_FLOAT||t===this.MEDIUM_FLOAT||t===this.HIGH_FLOAT||t===this.LOW_INT||t===this.MEDIUM_INT||t===this.HIGH_INT))return this.setError(this.INVALID_ENUM),null;let n=this._gl.getShaderPrecisionFormat(e,t);return n?new WebGLShaderPrecisionFormat(n):null},getShaderSource(e){if(!checkObject(e))throw TypeError(`Input to getShaderSource must be an object`);return this._checkWrapper(e,WebGLShader$1)?e._source:null},_checkShaderSource(e){let t=e._source,n=(0,tr.default)(t),r=!1,i=[];for(let e=0;e<n.length;++e){let t=n[e];if(t)switch(t.type){case`ident`:this._validGLSLIdentifier(t.data)||(r=!0,i.push(t.line+`:`+t.column+` invalid identifier - `+t.data));break;case`preprocessor`:{let e=t.data.match(/^\s*#\s*(.*)$/);if(!e||e?.length<2)break;let n=(0,tr.default)(e[1]);for(let e=0;e<n.length;++e){let a=n[e];(a.type===`ident`||a.type===void 0)&&(this._validGLSLIdentifier(a.data)||(r=!0,i.push(t.line+`:`+a.column+` invalid identifier - `+a.data)))}break}case`keyword`:switch(t.data){case`do`:r=!0,i.push(t.line+`:`+t.column+` do not supported`);break}break;case`builtin`:switch(t.data){case`dFdx`:case`dFdy`:case`fwidth`:!this._extensions.oes_standard_derivatives&&this._getGlslVersion(!0)===`100`&&(r=!0,i.push(t.line+`:`+t.column+` `+t.data+` not supported`));break}}}return r&&(e._compileInfo=i.join(`
|
|
87
87
|
`)),!r},_needsDesktopSpelling(e){return isGlsl1Source(e)&&usesStandardDerivatives(e)&&!!this._desktopGlslForEsDerivatives()},_harmoniseShaderSpelling(e){let t=e.some(e=>e._needsDesktop);for(let n of e){if(n._desktopSpelled===t||!isGlsl1Source(n._userSource))continue;let e=this._wrapShader(n._type,n._userSource,t);this._gl.shaderSource(n._|0,e),n._source=e,n._desktopSpelled=t,n._needsRecompile||(this._gl.compileShader(n._|0),n._compileStatus=!!this._gl.getShaderParameter(n._|0,this.COMPILE_STATUS),n._compileInfo=this._gl.getShaderInfoLog(n._|0)||`null`)}},_wrapShader(e,t,n=!1){let r=t.startsWith(`#version`)||t.includes(`
|
|
88
88
|
#version`),i=r?null:glslDialectOf(t),a=``;!this._extensions.oes_standard_derivatives&&/#ifdef\s+GL_OES_standard_derivatives/.test(t)&&(a+=`#undef GL_OES_standard_derivatives
|
|
89
89
|
`),!this._extensions.webgl_draw_buffers&&i===`glsl1`&&(a+=`#define gl_MaxDrawBuffers 1
|
|
@@ -91,27 +91,27 @@ import{createRequire as e}from"node:module";import"@gjsify/node-gi/globals";impo
|
|
|
91
91
|
`,``);return translateGlsl1ToDesktop(t,n,o,r,!!this._extensions.oes_standard_derivatives)}if(r){if(a){let e=t.indexOf(`
|
|
92
92
|
`);t=e===-1?t+`
|
|
93
93
|
`+a:t.slice(0,e+1)+a+t.slice(e+1)}}else if(this.canvas){let e=this.canvas.getGlArea().get_use_es(),n=i===`glsl1`?this._getGlsl1Version(e):this._getGlslVersion(e);n?t=`#version `+n+`
|
|
94
|
-
`+a+t:a&&(t=a+t)}else a&&(t=a+t);return t}};function installShaderLifecycleMethods(e){Object.assign(e,hr)}const gr={createProgram(){let e=this._gl.createProgram();if(e<=0)return null;let t=new WebGLProgram$1(e,this);return this._programs[e]=t,t},deleteProgram(e){this._deleteLinkable(`deleteProgram`,e,WebGLProgram$1)},useProgram(e){if(!checkObject(e))throw TypeError(`useProgram(WebGLProgram)`);if(!e){this._switchActiveProgram(this._activeProgram),this._activeProgram=null,this._gl.useProgram(0);return}else if(this._checkWrapper(e,WebGLProgram$1)){if(!e._linkStatus){this.setError(this.INVALID_OPERATION);return}this._activeProgram!==e&&(this._switchActiveProgram(this._activeProgram),this._activeProgram=e,e._refCount+=1),this._gl.useProgram(e._|0)}},linkProgram(e){if(!checkObject(e))throw TypeError(`linkProgram(WebGLProgram)`);if(this._checkWrapper(e,WebGLProgram$1)){e._linkCount+=1,e._attributes=[];let t=this.getError(),n=e._references.filter(e=>e instanceof WebGLShader$1),r=n.some(e=>e._type===this.VERTEX_SHADER)?n.some(e=>e._type===this.FRAGMENT_SHADER)?null:`fragment`:`vertex`;if(r){e._linkStatus=!1,e._uniforms=[],e._linkInfoLog=`link failed: no ${r} shader attached`,this.setError(t);return}this._harmoniseShaderSpelling(n);for(let t of e._references)t instanceof WebGLShader$1&&t._needsRecompile&&(this._gl.compileShader(t._|0),t._needsRecompile=!1);this._gl.linkProgram(e._|0);let i=this.getError();i===this.NO_ERROR&&(e._linkStatus=this._fixupLink(e)),this.getError(),this.setError(t||i)}},validateProgram(e){if(this._checkWrapper(e,WebGLProgram$1)){this._gl.validateProgram(e._|0);let t=this.getError();t===this.NO_ERROR&&(e._linkInfoLog=this._gl.getProgramInfoLog(e._|0)),this.getError(),this.setError(t)}},attachShader(e,t){if(!checkObject(e)||!checkObject(t))throw TypeError(`attachShader(WebGLProgram, WebGLShader)`);if(!e||!t){this.setError(this.INVALID_VALUE);return}else if(e instanceof WebGLProgram$1&&t instanceof WebGLShader$1&&this._checkOwns(e)&&this._checkOwns(t)){let n=e._references.some(e=>e instanceof WebGLShader$1&&e!==t&&e._type===t._type);if(!e._linked(t)&&!n){this._saveError(),this._gl.attachShader(e._|0,t._|0);let n=this.getError();this._restoreError(n),n===this.NO_ERROR&&e._link(t);return}}this.setError(this.INVALID_OPERATION)},detachShader(e,t){if(!checkObject(e)||!checkObject(t))throw TypeError(`detachShader(WebGLProgram, WebGLShader)`);this._checkWrapper(e,WebGLProgram$1)&&this._checkWrapper(t,WebGLShader$1)&&(e._linked(t)?(this._gl.detachShader(e._,t._),e._unlink(t)):this.setError(this.INVALID_OPERATION))},bindAttribLocation(e,t,n){if(!checkObject(e)||typeof n!=`string`)throw TypeError(`bindAttribLocation(WebGLProgram, GLint, String)`);n+=``,!isValidString(n)||n.length>256?this.setError(this.INVALID_VALUE):/^_?webgl_a/.test(n)?this.setError(this.INVALID_OPERATION):this._checkWrapper(e,WebGLProgram$1)&&this._gl.bindAttribLocation(e._|0,t|0,n)},getAttachedShaders(e){if(!checkObject(e)||typeof e==`object`&&e&&!(e instanceof WebGLProgram$1))throw TypeError(`getAttachedShaders(WebGLProgram)`);if(!e)this.setError(this.INVALID_VALUE);else if(this._checkWrapper(e,WebGLProgram$1))return e._references.filter(e=>e instanceof WebGLShader$1);return null},getProgramInfoLog(e){if(!checkObject(e))throw TypeError(`getProgramInfoLog(WebGLProgram)`);return this._checkWrapper(e,WebGLProgram$1)?e._linkInfoLog:null},getProgramParameter(e,t=0){if(!checkObject(e))throw TypeError(`getProgramParameter(WebGLProgram, GLenum)`);if(this._checkWrapper(e,WebGLProgram$1)){switch(t){case this.DELETE_STATUS:return e._pendingDelete;case this.LINK_STATUS:return e._linkStatus;case this.VALIDATE_STATUS:return e._linkStatus&&!!this._gl.getProgramParameter(e._,t);case this.ATTACHED_SHADERS:return this._gl.getProgramParameter(e._,t);case this.ACTIVE_ATTRIBUTES:return e._linkStatus?e._attributes.length:this._gl.getProgramParameter(e._,t);case this.ACTIVE_UNIFORMS:return e._linkStatus?e._uniforms.length:this._gl.getProgramParameter(e._,t)}this.setError(this.INVALID_ENUM)}return null},_switchActiveProgram(e){e&&(--e._refCount,e._checkDelete())},_fixupLink(e){if(!this._gl.getProgramParameter(e._,this.LINK_STATUS))return e._linkInfoLog=this._gl.getProgramInfoLog(e._),!1;let t=this.getProgramParameter(e,this.ACTIVE_ATTRIBUTES),n=Array.from({length:t});e._attributes.length=t;for(let r=0;r<t;++r)n[r]=this.getActiveAttrib(e,r)?.name,e._attributes[r]=this.getAttribLocation(e,n[r])|0;for(let t=0;t<n.length;++t)if(n[t].length>256)return e._linkInfoLog=`attribute `+n[t]+` is too long`,!1;for(let r=0;r<t;++r)e._attributes[r]<0||this._gl.bindAttribLocation(e._|0,e._attributes[r],n[r]);if(this._gl.linkProgram(e._|0),!this._gl.getProgramParameter(e._|0,this.LINK_STATUS))return e._linkInfoLog=this._gl.getProgramInfoLog(e._),!1;let r=this.getProgramParameter(e,this.ACTIVE_UNIFORMS);e._uniforms.length=r;for(let t=0;t<r;++t){let n=this.getActiveUniform(e,t);n&&(e._uniforms[t]=n)}for(let t=0;t<e._uniforms.length;++t)if(e._uniforms[t].name.length>256)return e._linkInfoLog=`uniform `+e._uniforms[t].name+` is too long`,!1;return e._linkInfoLog=``,!0},_deleteLinkable(e,t,n){if(!checkObject(t))throw TypeError(e+`(`+n.name+`)`);if(t instanceof n&&this._checkOwns(t)){t._pendingDelete=!0,t._checkDelete();return}this.setError(this.INVALID_OPERATION)}};function installProgramLifecycleMethods(e){Object.assign(e,gr)}const _r={getActiveAttrib(e,t){if(!checkObject(e))throw TypeError(`getActiveAttrib(WebGLProgram)`);if(!e)throw TypeError(`getActiveAttrib(WebGLProgram, GLuint)`);if(this._checkWrapper(e,WebGLProgram$1)){if(t>=(e._linkStatus?e._attributes.length:this._gl.getProgramParameter(e._|0,this.ACTIVE_ATTRIBUTES)))return this._gl.getError(),this.setError(this.INVALID_VALUE),null;let n=this._gl.getActiveAttrib(e._|0,t|0);if(n)return new WebGLActiveInfo(n)}return null},getActiveUniform(e,t){if(!checkObject(e))throw TypeError(`getActiveUniform(WebGLProgram, GLint)`);if(!e)throw TypeError(`getActiveUniform(WebGLProgram, GLuint)`);if(this._checkWrapper(e,WebGLProgram$1)){if(t>=(e._linkStatus?e._uniforms.length:this._gl.getProgramParameter(e._|0,this.ACTIVE_UNIFORMS)))return this.setError(this.INVALID_VALUE),null;let n=this._gl.getActiveUniform(e._|0,t|0);if(n)return new WebGLActiveInfo(n)}return null},getAttribLocation(e,t){if(!checkObject(e))throw TypeError(`getAttribLocation(WebGLProgram, String)`);if(t+=``,!isValidString(t)||t.length>256)this.setError(this.INVALID_VALUE);else if(this._checkWrapper(e,WebGLProgram$1))return this._gl.getAttribLocation(e._|0,t+``);return-1},getUniform(e,t){if(!checkObject(e)||!checkObject(t))throw TypeError(`getUniform(WebGLProgram, WebGLUniformLocation)`);if(!e)return this.setError(this.INVALID_VALUE),null;if(!t)return null;if(this._checkWrapper(e,WebGLProgram$1)){if(!checkUniform(e,t))return this.setError(this.INVALID_OPERATION),null;let n=this._gl.getUniform(e._|0,t._|0);if(!n)return null;switch(t._activeInfo.type){case this.FLOAT:return n[0];case this.FLOAT_VEC2:return new Float32Array(n.slice(0,2));case this.FLOAT_VEC3:return new Float32Array(n.slice(0,3));case this.FLOAT_VEC4:return new Float32Array(n.slice(0,4));case this.INT:return n[0]|0;case this.INT_VEC2:return new Int32Array(n.slice(0,2));case this.INT_VEC3:return new Int32Array(n.slice(0,3));case this.INT_VEC4:return new Int32Array(n.slice(0,4));case this.BOOL:return!!n[0];case this.BOOL_VEC2:return[!!n[0],!!n[1]];case this.BOOL_VEC3:return[!!n[0],!!n[1],!!n[2]];case this.BOOL_VEC4:return[!!n[0],!!n[1],!!n[2],!!n[3]];case this.FLOAT_MAT2:return new Float32Array(n.slice(0,4));case this.FLOAT_MAT3:return new Float32Array(n.slice(0,9));case this.FLOAT_MAT4:return new Float32Array(n.slice(0,16));case this.SAMPLER_2D:case this.SAMPLER_CUBE:return n[0]|0;default:return null}}return null},getUniformLocation(e,t){if(!checkObject(e))throw TypeError(`getUniformLocation(WebGLProgram, String)`);if(t+=``,!isValidString(t))return this.setError(this.INVALID_VALUE),null;if(this._checkWrapper(e,WebGLProgram$1)){let n=this._gl.getUniformLocation(e._|0,t);if(n!==null&&n>=0){let r=t;/\[\d+\]$/.test(t)&&(r=t.replace(/\[\d+\]$/,`[0]`));let i=r+`[0]`,a=null;for(let t=0;t<e._uniforms.length;++t){let n=e._uniforms[t];if(n.name===r||n.name===i){a={size:n.size,type:n.type,name:n.name};break}}a||={name:r,type:0,size:1};let o=new WebGLUniformLocation(n,e,a),s=t.match(/\[(\d+)\]$/),c=s?+s[1]:-1;if(a.name.endsWith(`[0]`)&&(c===-1||c===0)){let t=a.name.replace(/\[0\]$/,``),n=[];this._saveError();for(let r=0;this.getError()===this.NO_ERROR;++r){let i=this._gl.getUniformLocation(e._|0,t+`[`+r+`]`);if(this.getError()!==this.NO_ERROR||i==null||i<0)break;n.push(i)}this._restoreError(this.NO_ERROR),o._array=n}else if(c>0&&c>=a.size)return null;return o}}return null}};function installIntrospectionMethods(e){Object.assign(e,_r)}const vr={uniform1f(e,t){this._checkUniformValid(e,t,`uniform1f`,1,`f`)&&this._gl.uniform1f(e?._||0,t)},uniform1i(e,t){this._gl.uniform1i(e?._||0,t)},uniform2f(e,t,n){this._checkUniformValid(e,t,`uniform2f`,2,`f`)&&this._gl.uniform2f(e?._||0,t,n)},uniform2i(e,t,n){this._checkUniformValid(e,t,`uniform2i`,2,`i`)&&this._gl.uniform2i(e?._||0,t,n)},uniform3f(e,t,n,r){this._checkUniformValid(e,t,`uniform3f`,3,`f`)&&this._gl.uniform3f(e?._||0,t,n,r)},uniform3i(e,t,n,r){this._checkUniformValid(e,t,`uniform3i`,3,`i`)&&this._gl.uniform3i(e?._||0,t,n,r)},uniform4f(e,t,n,r,i){if(!this._checkUniformValid(e,t,`uniform4f`,4,`f`)){console.error(`uniform4f is not valid!`);return}this._gl.uniform4f(e?._||0,t,n,r,i)},uniform4i(e,t,n,r,i){this._checkUniformValid(e,t,`uniform4i`,4,`i`)&&this._gl.uniform4i(e?._||0,t,n,r,i)},uniform1fv(e,t){if(!(!e||!this._checkUniformValueValid(e,t,`uniform1fv`,1,`f`))){if(e?._array){let n=e._array;for(let e=0;e<n.length&&e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform1f(r,t[e])}return}this._gl.uniform1f(e?._|0,t[0])}},uniform1iv(e,t){if(this._checkUniformValueValid(e,t,`uniform1iv`,1,`i`)){if(e?._array){let n=e._array;for(let e=0;e<n.length&&e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform1i(r,t[e])}return}this.uniform1i(e,t[0])}},uniform2fv(e,t){if(this._checkUniformValueValid(e,t,`uniform2fv`,2,`f`)){if(e?._array){let n=e._array;for(let e=0;e<n.length&&2*e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform2f(r,t[2*e],t[2*e+1])}return}this._gl.uniform2f(e?._||0,t[0],t[1])}},uniform2iv(e,t){if(this._checkUniformValueValid(e,t,`uniform2iv`,2,`i`)){if(e?._array){let n=e._array;for(let e=0;e<n.length&&2*e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform2i(r,t[2*e],t[2*e+1])}return}this.uniform2i(e,t[0],t[1])}},uniform3fv(e,t){if(this._checkUniformValueValid(e,t,`uniform3fv`,3,`f`)){if(e?._array){let n=e._array;for(let e=0;e<n.length&&3*e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform3f(r,t[3*e],t[3*e+1],t[3*e+2])}return}this._gl.uniform3f(e?._||0,t[0],t[1],t[2])}},uniform3iv(e,t){if(this._checkUniformValueValid(e,t,`uniform3iv`,3,`i`)){if(e?._array){let n=e._array;for(let e=0;e<n.length&&3*e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform3i(r,t[3*e],t[3*e+1],t[3*e+2])}return}this.uniform3i(e,t[0],t[1],t[2])}},uniform4fv(e,t){if(this._checkUniformValueValid(e,t,`uniform4fv`,4,`f`)){if(e?._array){let n=e._array;for(let e=0;e<n.length&&4*e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform4f(r,t[4*e],t[4*e+1],t[4*e+2],t[4*e+3])}return}this._gl.uniform4f(e?._||0,t[0],t[1],t[2],t[3])}},uniform4iv(e,t){if(this._checkUniformValueValid(e,t,`uniform4iv`,4,`i`)){if(e?._array){let n=e._array;for(let e=0;e<n.length&&4*e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform4i(r,t[4*e],t[4*e+1],t[4*e+2],t[4*e+3])}return}this.uniform4i(e,t[0],t[1],t[2],t[3])}},uniformMatrix2fv(e,t,n){if(!this._checkUniformMatrix(e,t,n,`uniformMatrix2fv`,2))return;let r=new Float32Array(n);this._gl.uniformMatrix2fv(e?._||0,!!t,listToArray(r))},uniformMatrix3fv(e,t,n){if(!this._checkUniformMatrix(e,t,n,`uniformMatrix3fv`,3))return;let r=new Float32Array(n);this._gl.uniformMatrix3fv(e?._||0,!!t,listToArray(r))},uniformMatrix4fv(e,t,n){if(!this._checkUniformMatrix(e,t,n,`uniformMatrix4fv`,4))return;let r=new Float32Array(n);this._gl.uniformMatrix4fv(e?._||0,!!t,listToArray(r))},_checkLocation(e){return e instanceof WebGLUniformLocation?e._program._ctx!==this||e._linkCount!==e._program._linkCount?(this.setError(this.INVALID_OPERATION),!1):!0:(this.setError(this.INVALID_VALUE),!1)},_checkLocationActive(e){return e&&this._checkLocation(e)?e._program===this._activeProgram?!0:(this.setError(this.INVALID_OPERATION),!1):!1},_checkUniformValid(e,t,n,r,i){if(!checkObject(e))throw TypeError(`${n}(WebGLUniformLocation, ...)`);if(!e)return!1;if(this._checkLocationActive(e)){let n=e._activeInfo.type;if(n===this.SAMPLER_2D||n===this.SAMPLER_CUBE){if(r!==1)return this.setError(this.INVALID_VALUE),!1;if(i!==`i`)return this.setError(this.INVALID_OPERATION),!1;if(t<0||t>=this._textureUnits.length)return this.setError(this.INVALID_VALUE),!1}return uniformTypeSize(this,n)>r?(this.setError(this.INVALID_OPERATION),!1):!0}return!1},_checkUniformValueValid(e,t,n,r,i){if(!checkObject(e)||!checkObject(t))throw TypeError(`${n}v(WebGLUniformLocation, Array)`);if(!e||!this._checkLocationActive(e))return!1;if(typeof t!=`object`||!t||typeof t.length!=`number`)throw TypeError(`Second argument to ${n} must be array`);return uniformTypeSize(this,e._activeInfo.type)>r?(this.setError(this.INVALID_OPERATION),!1):t.length>=r&&t.length%r===0?e._array||t.length===r?!0:(this.setError(this.INVALID_OPERATION),!1):(this.setError(this.INVALID_VALUE),!1)},_checkUniformMatrix(e,t,n,r,i){if(!checkObject(e)||typeof n!=`object`)throw TypeError(r+`(WebGLUniformLocation, Boolean, Array)`);return t||typeof n!=`object`||!n||!n.length||n.length%i*i!==0?(this.setError(this.INVALID_VALUE),!1):!e||!this._checkLocationActive(e)?!1:n.length===i*i||e._array?!0:(this.setError(this.INVALID_VALUE),!1)}};function installUniformsMethods(e){Object.assign(e,vr)}function installShaderProgramMethods(e){installShaderLifecycleMethods(e),installProgramLifecycleMethods(e),installIntrospectionMethods(e),installUniformsMethods(e)}function installAllContextMethods(e){installStateMethods(e),installBufferBindingMethods(e),installTextureManagementMethods(e),installFramebufferMethods(e),installShaderProgramMethods(e),installDrawingMethods(e)}const yr=e(import.meta.url);let br;function load(){return br===void 0&&(br=yr(`@gjsify/node-gi/gi`).requireGi(`Gwebgl`,`0.1`)),br}var xr=new Proxy(Object.create(null),{get(e,t){return load()[t]},has(e,t){return t in load()}});let Sr=0;const Cr={oes_element_index_uint:getOESElementIndexUint,oes_texture_float:getOESTextureFloat,oes_texture_float_linear:getOESTextureFloatLinear,oes_standard_derivatives:getOESStandardDerivatives,stackgl_destroy_context:getSTACKGLDestroyContext,stackgl_resize_drawingbuffer:getSTACKGLResizeDrawingBuffer,ext_blend_minmax:getEXTBlendMinMax,ext_color_buffer_float:getEXTColorBufferFloat,ext_color_buffer_half_float:getEXTColorBufferHalfFloat,ext_texture_filter_anisotropic:getEXTTextureFilterAnisotropic,oes_texture_half_float:getOESTextureHalfFloat,webgl_debug_renderer_info:getWEBGLDebugRendererInfo};let wr=!1;function openGwebgl(){if(wr)return;let e=openNativeLibrary(`Gwebgl`);if(e)throw e;wr=!0}var WebGLContextBase=class{get drawingBufferHeight(){return this.canvas.height||0}get drawingBufferWidth(){return this.canvas.width||0}constructor(e,t={}){this.drawingBufferColorSpace=`srgb`,this.unpackColorSpace=`srgb`,this.RGBA8=32856,this.DEFAULT_ATTACHMENTS=[],this.DEFAULT_COLOR_ATTACHMENTS=[],this._=0,this._extensions={},this._programs={},this._shaders={},this._textures={},this._framebuffers={},this._renderbuffers={},this._buffers={},this._activeProgram=null,this._activeFramebuffer=null,this._activeRenderbuffer=null,this._checkStencil=!1,this._stencilState=!0,this._activeTextureUnit=0,this._errorStack=[],this._maxTextureSize=0,this._maxTextureLevel=0,this._maxCubeMapSize=0,this._maxCubeMapLevel=0,this._maxRenderbufferSize=0,this._unpackAlignment=4,this._packAlignment=4,this._unpackFlipY=!1,this._unpackPremultAlpha=!1,this._generateMipmapHint=4352,this._viewport=new Int32Array([0,0,0,0]),this._scissorBox=new Int32Array([0,0,0,0]),this._gtkFboId=0,this._textureUnits=[],this._drawingBuffer=null,openGwebgl(),this.canvas=e,this._contextAttributes=new WebGLContextAttributes(flag(t,`alpha`,!0),flag(t,`depth`,!0),flag(t,`stencil`,!1),!1,flag(t,`premultipliedAlpha`,!0),flag(t,`preserveDrawingBuffer`,!1),flag(t,`preferLowPowerToHighPerformance`,!1),flag(t,`failIfMajorPerformanceCaveat`,!1)),this._contextAttributes.premultipliedAlpha=this._contextAttributes.premultipliedAlpha&&this._contextAttributes.alpha}_init(){let e=this._gl.getParameterx(36006);this._gtkFboId=e?.deepUnpack()|0,this._initGLConstants(),this.DEFAULT_ATTACHMENTS=[this.COLOR_ATTACHMENT0,this.DEPTH_ATTACHMENT,this.STENCIL_ATTACHMENT,this.DEPTH_STENCIL_ATTACHMENT],this.DEFAULT_COLOR_ATTACHMENTS=[this.COLOR_ATTACHMENT0];let t=this.drawingBufferWidth||0,n=this.drawingBufferHeight||0;this._=Sr++;let r=this.getParameter(this.MAX_COMBINED_TEXTURE_IMAGE_UNITS);this._textureUnits=Array.from({length:r});for(let e=0;e<r;++e)this._textureUnits[e]=new WebGLTextureUnit(this,e);this.activeTexture(this.TEXTURE0),this._defaultVertexObjectState=new WebGLVertexArrayObjectState(this),this._vertexObjectState=this._defaultVertexObjectState,this._vertexGlobalState=new WebGLVertexArrayGlobalState(this),this._maxTextureSize=this.getParameter(this.MAX_TEXTURE_SIZE),this._maxTextureLevel=Jn.log2(Jn.nextPow2(this._maxTextureSize)),this._maxCubeMapSize=this.getParameter(this.MAX_CUBE_MAP_TEXTURE_SIZE),this._maxCubeMapLevel=Jn.log2(Jn.nextPow2(this._maxCubeMapSize)),this._maxRenderbufferSize=this.getParameter(this.MAX_RENDERBUFFER_SIZE),this._unpackAlignment=4,this._packAlignment=4,this._unpackFlipY=!1,this._unpackPremultAlpha=!1,this.bindBuffer(this.ARRAY_BUFFER,null),this.bindBuffer(this.ELEMENT_ARRAY_BUFFER,null),this.bindFramebuffer(this.FRAMEBUFFER,null),this.bindRenderbuffer(this.RENDERBUFFER,null),this.viewport(0,0,t,n),this.scissor(0,0,t,n),this.clearDepth(1),this.clearColor(0,0,0,0),this.clearStencil(0),this.clear(this.COLOR_BUFFER_BIT|this.DEPTH_BUFFER_BIT|this.STENCIL_BUFFER_BIT),this.disable(this.DEPTH_TEST),this.disable(this.STENCIL_TEST),this.disable(this.BLEND),this.disable(this.CULL_FACE),this.disable(this.POLYGON_OFFSET_FILL),this.disable(this.SCISSOR_TEST),this._gl.colorMask(!0,!0,!0,!0)}_initGLConstants(){let e=new xr.WebGLRenderingContextBase().get_webgl_constants();for(let[t,n]of Object.entries(e))Object.defineProperty(this,t,{value:n})}_getGlslVersion(e){return this._getGlsl1Version(e)}_getGlsl1Version(e){return e||this._atLeastGlVersion(4,1)?`100`:`120`}_desktopGlslVersion(){let e=this._gl.getString(35724);if(!e||e.startsWith(`OpenGL ES `))return`130`;let[t,n]=e.split(`.`,2).map(e=>Number.parseInt(e,10));return!Number.isFinite(t)||!Number.isFinite(n)?`130`:String(t*100+(n>=10?n:n*10))}_atLeastGlVersion(e,t){let n=this._gl.getString(7938);if(!n||n.startsWith(`OpenGL ES `))return!1;let[r,i]=n.split(`.`,2).map(e=>Number.parseInt(e,10));return!Number.isFinite(r)||!Number.isFinite(i)?!1:r>e||r===e&&i>=t}_nativeFloatInternalFormat(e,t){return t!==this.FLOAT||!this._atLeastGlVersion(3,0)?e:e===this.RGBA?34836:e===this.RGB?34837:e}_isCoreProfile(){if(this._coreProfile!==void 0)return this._coreProfile;let e=!1;return this._atLeastGlVersion(3,2)&&(e=(this._gl.getParameteri(37158)&1)!=0),this._coreProfile=e,e}_emulatesLegacyFormats(){return this._legacyFormatEmulation===void 0&&(this._legacyFormatEmulation=this._isCoreProfile()&&this._atLeastGlVersion(3,3)),this._legacyFormatEmulation}_legacyFormatStorage(e,t){return!isLegacyFormat(e)||!this._emulatesLegacyFormats()?null:coreStorageForLegacyFormat(e,t)}_legacySubImageMismatch(e,t){return(isLegacyFormat(t)||isLegacyFormat(e._format))&&t!==e._format}_setTextureSwizzle(e,t,n){if(!n&&(t?!t._swizzled:!this._emulatesLegacyFormats()))return;let r=n??Vn,i=textureParameterTarget(e);for(let e=0;e<4;++e)this._gl.texParameteri(i,Bn[e],r[e]);t&&(t._swizzled=n!==null)}_desktopGlslForEsDerivatives(){if(this._esDerivativesDesktopGlsl!==void 0)return this._esDerivativesDesktopGlsl;let e=null;if(this._atLeastGlVersion(4,1)){let t=this._gl.createShader(this.FRAGMENT_SHADER);this._gl.shaderSource(t,`#version 100
|
|
94
|
+
`+a+t:a&&(t=a+t)}else a&&(t=a+t);return t}};function installShaderLifecycleMethods(e){Object.assign(e,ir)}const ar={createProgram(){let e=this._gl.createProgram();if(e<=0)return null;let t=new WebGLProgram$1(e,this);return this._programs[e]=t,t},deleteProgram(e){this._deleteLinkable(`deleteProgram`,e,WebGLProgram$1)},useProgram(e){if(!checkObject(e))throw TypeError(`useProgram(WebGLProgram)`);if(!e){this._switchActiveProgram(this._activeProgram),this._activeProgram=null,this._gl.useProgram(0);return}else if(this._checkWrapper(e,WebGLProgram$1)){if(!e._linkStatus){this.setError(this.INVALID_OPERATION);return}this._activeProgram!==e&&(this._switchActiveProgram(this._activeProgram),this._activeProgram=e,e._refCount+=1),this._gl.useProgram(e._|0)}},linkProgram(e){if(!checkObject(e))throw TypeError(`linkProgram(WebGLProgram)`);if(this._checkWrapper(e,WebGLProgram$1)){e._linkCount+=1,e._attributes=[];let t=this.getError(),n=e._references.filter(e=>e instanceof WebGLShader$1),r=n.some(e=>e._type===this.VERTEX_SHADER)?n.some(e=>e._type===this.FRAGMENT_SHADER)?null:`fragment`:`vertex`;if(r){e._linkStatus=!1,e._uniforms=[],e._linkInfoLog=`link failed: no ${r} shader attached`,this.setError(t);return}this._harmoniseShaderSpelling(n);for(let t of e._references)t instanceof WebGLShader$1&&t._needsRecompile&&(this._gl.compileShader(t._|0),t._needsRecompile=!1);this._gl.linkProgram(e._|0);let i=this.getError();i===this.NO_ERROR&&(e._linkStatus=this._fixupLink(e)),this.getError(),this.setError(t||i)}},validateProgram(e){if(this._checkWrapper(e,WebGLProgram$1)){this._gl.validateProgram(e._|0);let t=this.getError();t===this.NO_ERROR&&(e._linkInfoLog=this._gl.getProgramInfoLog(e._|0)),this.getError(),this.setError(t)}},attachShader(e,t){if(!checkObject(e)||!checkObject(t))throw TypeError(`attachShader(WebGLProgram, WebGLShader)`);if(!e||!t){this.setError(this.INVALID_VALUE);return}else if(e instanceof WebGLProgram$1&&t instanceof WebGLShader$1&&this._checkOwns(e)&&this._checkOwns(t)){let n=e._references.some(e=>e instanceof WebGLShader$1&&e!==t&&e._type===t._type);if(!e._linked(t)&&!n){this._saveError(),this._gl.attachShader(e._|0,t._|0);let n=this.getError();this._restoreError(n),n===this.NO_ERROR&&e._link(t);return}}this.setError(this.INVALID_OPERATION)},detachShader(e,t){if(!checkObject(e)||!checkObject(t))throw TypeError(`detachShader(WebGLProgram, WebGLShader)`);this._checkWrapper(e,WebGLProgram$1)&&this._checkWrapper(t,WebGLShader$1)&&(e._linked(t)?(this._gl.detachShader(e._,t._),e._unlink(t)):this.setError(this.INVALID_OPERATION))},bindAttribLocation(e,t,n){if(!checkObject(e)||typeof n!=`string`)throw TypeError(`bindAttribLocation(WebGLProgram, GLint, String)`);n+=``,!isValidString(n)||n.length>256?this.setError(this.INVALID_VALUE):/^_?webgl_a/.test(n)?this.setError(this.INVALID_OPERATION):this._checkWrapper(e,WebGLProgram$1)&&this._gl.bindAttribLocation(e._|0,t|0,n)},getAttachedShaders(e){if(!checkObject(e)||typeof e==`object`&&e&&!(e instanceof WebGLProgram$1))throw TypeError(`getAttachedShaders(WebGLProgram)`);if(!e)this.setError(this.INVALID_VALUE);else if(this._checkWrapper(e,WebGLProgram$1))return e._references.filter(e=>e instanceof WebGLShader$1);return null},getProgramInfoLog(e){if(!checkObject(e))throw TypeError(`getProgramInfoLog(WebGLProgram)`);return this._checkWrapper(e,WebGLProgram$1)?e._linkInfoLog:null},getProgramParameter(e,t=0){if(!checkObject(e))throw TypeError(`getProgramParameter(WebGLProgram, GLenum)`);if(this._checkWrapper(e,WebGLProgram$1)){switch(t){case this.DELETE_STATUS:return e._pendingDelete;case this.LINK_STATUS:return e._linkStatus;case this.VALIDATE_STATUS:return e._linkStatus&&!!this._gl.getProgramParameter(e._,t);case this.ATTACHED_SHADERS:return this._gl.getProgramParameter(e._,t);case this.ACTIVE_ATTRIBUTES:return e._linkStatus?e._attributes.length:this._gl.getProgramParameter(e._,t);case this.ACTIVE_UNIFORMS:return e._linkStatus?e._uniforms.length:this._gl.getProgramParameter(e._,t)}this.setError(this.INVALID_ENUM)}return null},_switchActiveProgram(e){e&&(--e._refCount,e._checkDelete())},_fixupLink(e){if(!this._gl.getProgramParameter(e._,this.LINK_STATUS))return e._linkInfoLog=this._gl.getProgramInfoLog(e._),!1;let t=this.getProgramParameter(e,this.ACTIVE_ATTRIBUTES),n=Array.from({length:t});e._attributes.length=t;for(let r=0;r<t;++r)n[r]=this.getActiveAttrib(e,r)?.name,e._attributes[r]=this.getAttribLocation(e,n[r])|0;for(let t=0;t<n.length;++t)if(n[t].length>256)return e._linkInfoLog=`attribute `+n[t]+` is too long`,!1;for(let r=0;r<t;++r)e._attributes[r]<0||this._gl.bindAttribLocation(e._|0,e._attributes[r],n[r]);if(this._gl.linkProgram(e._|0),!this._gl.getProgramParameter(e._|0,this.LINK_STATUS))return e._linkInfoLog=this._gl.getProgramInfoLog(e._),!1;let r=this.getProgramParameter(e,this.ACTIVE_UNIFORMS);e._uniforms.length=r;for(let t=0;t<r;++t){let n=this.getActiveUniform(e,t);n&&(e._uniforms[t]=n)}for(let t=0;t<e._uniforms.length;++t)if(e._uniforms[t].name.length>256)return e._linkInfoLog=`uniform `+e._uniforms[t].name+` is too long`,!1;return e._linkInfoLog=``,!0},_deleteLinkable(e,t,n){if(!checkObject(t))throw TypeError(e+`(`+n.name+`)`);if(t instanceof n&&this._checkOwns(t)){t._pendingDelete=!0,t._checkDelete();return}this.setError(this.INVALID_OPERATION)}};function installProgramLifecycleMethods(e){Object.assign(e,ar)}const or={getActiveAttrib(e,t){if(!checkObject(e))throw TypeError(`getActiveAttrib(WebGLProgram)`);if(!e)throw TypeError(`getActiveAttrib(WebGLProgram, GLuint)`);if(this._checkWrapper(e,WebGLProgram$1)){if(t>=(e._linkStatus?e._attributes.length:this._gl.getProgramParameter(e._|0,this.ACTIVE_ATTRIBUTES)))return this._gl.getError(),this.setError(this.INVALID_VALUE),null;let n=this._gl.getActiveAttrib(e._|0,t|0);if(n)return new WebGLActiveInfo(n)}return null},getActiveUniform(e,t){if(!checkObject(e))throw TypeError(`getActiveUniform(WebGLProgram, GLint)`);if(!e)throw TypeError(`getActiveUniform(WebGLProgram, GLuint)`);if(this._checkWrapper(e,WebGLProgram$1)){if(t>=(e._linkStatus?e._uniforms.length:this._gl.getProgramParameter(e._|0,this.ACTIVE_UNIFORMS)))return this.setError(this.INVALID_VALUE),null;let n=this._gl.getActiveUniform(e._|0,t|0);if(n)return new WebGLActiveInfo(n)}return null},getAttribLocation(e,t){if(!checkObject(e))throw TypeError(`getAttribLocation(WebGLProgram, String)`);if(t+=``,!isValidString(t)||t.length>256)this.setError(this.INVALID_VALUE);else if(this._checkWrapper(e,WebGLProgram$1))return this._gl.getAttribLocation(e._|0,t+``);return-1},getUniform(e,t){if(!checkObject(e)||!checkObject(t))throw TypeError(`getUniform(WebGLProgram, WebGLUniformLocation)`);if(!e)return this.setError(this.INVALID_VALUE),null;if(!t)return null;if(this._checkWrapper(e,WebGLProgram$1)){if(!checkUniform(e,t))return this.setError(this.INVALID_OPERATION),null;let n=this._gl.getUniform(e._|0,t._|0);if(!n)return null;switch(t._activeInfo.type){case this.FLOAT:return n[0];case this.FLOAT_VEC2:return new Float32Array(n.slice(0,2));case this.FLOAT_VEC3:return new Float32Array(n.slice(0,3));case this.FLOAT_VEC4:return new Float32Array(n.slice(0,4));case this.INT:return n[0]|0;case this.INT_VEC2:return new Int32Array(n.slice(0,2));case this.INT_VEC3:return new Int32Array(n.slice(0,3));case this.INT_VEC4:return new Int32Array(n.slice(0,4));case this.BOOL:return!!n[0];case this.BOOL_VEC2:return[!!n[0],!!n[1]];case this.BOOL_VEC3:return[!!n[0],!!n[1],!!n[2]];case this.BOOL_VEC4:return[!!n[0],!!n[1],!!n[2],!!n[3]];case this.FLOAT_MAT2:return new Float32Array(n.slice(0,4));case this.FLOAT_MAT3:return new Float32Array(n.slice(0,9));case this.FLOAT_MAT4:return new Float32Array(n.slice(0,16));case this.SAMPLER_2D:case this.SAMPLER_CUBE:return n[0]|0;default:return null}}return null},getUniformLocation(e,t){if(!checkObject(e))throw TypeError(`getUniformLocation(WebGLProgram, String)`);if(t+=``,!isValidString(t))return this.setError(this.INVALID_VALUE),null;if(this._checkWrapper(e,WebGLProgram$1)){let n=this._gl.getUniformLocation(e._|0,t);if(n!==null&&n>=0){let r=t;/\[\d+\]$/.test(t)&&(r=t.replace(/\[\d+\]$/,`[0]`));let i=r+`[0]`,a=null;for(let t=0;t<e._uniforms.length;++t){let n=e._uniforms[t];if(n.name===r||n.name===i){a={size:n.size,type:n.type,name:n.name};break}}a||={name:r,type:0,size:1};let o=new WebGLUniformLocation(n,e,a),s=t.match(/\[(\d+)\]$/),c=s?+s[1]:-1;if(a.name.endsWith(`[0]`)&&(c===-1||c===0)){let t=a.name.replace(/\[0\]$/,``),n=[];this._saveError();for(let r=0;this.getError()===this.NO_ERROR;++r){let i=this._gl.getUniformLocation(e._|0,t+`[`+r+`]`);if(this.getError()!==this.NO_ERROR||i==null||i<0)break;n.push(i)}this._restoreError(this.NO_ERROR),o._array=n}else if(c>0&&c>=a.size)return null;return o}}return null}};function installIntrospectionMethods(e){Object.assign(e,or)}const sr={uniform1f(e,t){this._checkUniformValid(e,t,`uniform1f`,1,`f`)&&this._gl.uniform1f(e?._||0,t)},uniform1i(e,t){this._gl.uniform1i(e?._||0,t)},uniform2f(e,t,n){this._checkUniformValid(e,t,`uniform2f`,2,`f`)&&this._gl.uniform2f(e?._||0,t,n)},uniform2i(e,t,n){this._checkUniformValid(e,t,`uniform2i`,2,`i`)&&this._gl.uniform2i(e?._||0,t,n)},uniform3f(e,t,n,r){this._checkUniformValid(e,t,`uniform3f`,3,`f`)&&this._gl.uniform3f(e?._||0,t,n,r)},uniform3i(e,t,n,r){this._checkUniformValid(e,t,`uniform3i`,3,`i`)&&this._gl.uniform3i(e?._||0,t,n,r)},uniform4f(e,t,n,r,i){if(!this._checkUniformValid(e,t,`uniform4f`,4,`f`)){console.error(`uniform4f is not valid!`);return}this._gl.uniform4f(e?._||0,t,n,r,i)},uniform4i(e,t,n,r,i){this._checkUniformValid(e,t,`uniform4i`,4,`i`)&&this._gl.uniform4i(e?._||0,t,n,r,i)},uniform1fv(e,t){if(!(!e||!this._checkUniformValueValid(e,t,`uniform1fv`,1,`f`))){if(e?._array){let n=e._array;for(let e=0;e<n.length&&e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform1f(r,t[e])}return}this._gl.uniform1f(e?._|0,t[0])}},uniform1iv(e,t){if(this._checkUniformValueValid(e,t,`uniform1iv`,1,`i`)){if(e?._array){let n=e._array;for(let e=0;e<n.length&&e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform1i(r,t[e])}return}this.uniform1i(e,t[0])}},uniform2fv(e,t){if(this._checkUniformValueValid(e,t,`uniform2fv`,2,`f`)){if(e?._array){let n=e._array;for(let e=0;e<n.length&&2*e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform2f(r,t[2*e],t[2*e+1])}return}this._gl.uniform2f(e?._||0,t[0],t[1])}},uniform2iv(e,t){if(this._checkUniformValueValid(e,t,`uniform2iv`,2,`i`)){if(e?._array){let n=e._array;for(let e=0;e<n.length&&2*e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform2i(r,t[2*e],t[2*e+1])}return}this.uniform2i(e,t[0],t[1])}},uniform3fv(e,t){if(this._checkUniformValueValid(e,t,`uniform3fv`,3,`f`)){if(e?._array){let n=e._array;for(let e=0;e<n.length&&3*e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform3f(r,t[3*e],t[3*e+1],t[3*e+2])}return}this._gl.uniform3f(e?._||0,t[0],t[1],t[2])}},uniform3iv(e,t){if(this._checkUniformValueValid(e,t,`uniform3iv`,3,`i`)){if(e?._array){let n=e._array;for(let e=0;e<n.length&&3*e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform3i(r,t[3*e],t[3*e+1],t[3*e+2])}return}this.uniform3i(e,t[0],t[1],t[2])}},uniform4fv(e,t){if(this._checkUniformValueValid(e,t,`uniform4fv`,4,`f`)){if(e?._array){let n=e._array;for(let e=0;e<n.length&&4*e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform4f(r,t[4*e],t[4*e+1],t[4*e+2],t[4*e+3])}return}this._gl.uniform4f(e?._||0,t[0],t[1],t[2],t[3])}},uniform4iv(e,t){if(this._checkUniformValueValid(e,t,`uniform4iv`,4,`i`)){if(e?._array){let n=e._array;for(let e=0;e<n.length&&4*e<t.length;++e){let r=n[e];r!=null&&this._gl.uniform4i(r,t[4*e],t[4*e+1],t[4*e+2],t[4*e+3])}return}this.uniform4i(e,t[0],t[1],t[2],t[3])}},uniformMatrix2fv(e,t,n){if(!this._checkUniformMatrix(e,t,n,`uniformMatrix2fv`,2))return;let r=new Float32Array(n);this._gl.uniformMatrix2fv(e?._||0,!!t,listToArray(r))},uniformMatrix3fv(e,t,n){if(!this._checkUniformMatrix(e,t,n,`uniformMatrix3fv`,3))return;let r=new Float32Array(n);this._gl.uniformMatrix3fv(e?._||0,!!t,listToArray(r))},uniformMatrix4fv(e,t,n){if(!this._checkUniformMatrix(e,t,n,`uniformMatrix4fv`,4))return;let r=new Float32Array(n);this._gl.uniformMatrix4fv(e?._||0,!!t,listToArray(r))},_checkLocation(e){return e instanceof WebGLUniformLocation?e._program._ctx!==this||e._linkCount!==e._program._linkCount?(this.setError(this.INVALID_OPERATION),!1):!0:(this.setError(this.INVALID_VALUE),!1)},_checkLocationActive(e){return e&&this._checkLocation(e)?e._program===this._activeProgram?!0:(this.setError(this.INVALID_OPERATION),!1):!1},_checkUniformValid(e,t,n,r,i){if(!checkObject(e))throw TypeError(`${n}(WebGLUniformLocation, ...)`);if(!e)return!1;if(this._checkLocationActive(e)){let n=e._activeInfo.type;if(n===this.SAMPLER_2D||n===this.SAMPLER_CUBE){if(r!==1)return this.setError(this.INVALID_VALUE),!1;if(i!==`i`)return this.setError(this.INVALID_OPERATION),!1;if(t<0||t>=this._textureUnits.length)return this.setError(this.INVALID_VALUE),!1}return uniformTypeSize(this,n)>r?(this.setError(this.INVALID_OPERATION),!1):!0}return!1},_checkUniformValueValid(e,t,n,r,i){if(!checkObject(e)||!checkObject(t))throw TypeError(`${n}v(WebGLUniformLocation, Array)`);if(!e||!this._checkLocationActive(e))return!1;if(typeof t!=`object`||!t||typeof t.length!=`number`)throw TypeError(`Second argument to ${n} must be array`);return uniformTypeSize(this,e._activeInfo.type)>r?(this.setError(this.INVALID_OPERATION),!1):t.length>=r&&t.length%r===0?e._array||t.length===r?!0:(this.setError(this.INVALID_OPERATION),!1):(this.setError(this.INVALID_VALUE),!1)},_checkUniformMatrix(e,t,n,r,i){if(!checkObject(e)||typeof n!=`object`)throw TypeError(r+`(WebGLUniformLocation, Boolean, Array)`);return t||typeof n!=`object`||!n||!n.length||n.length%i*i!==0?(this.setError(this.INVALID_VALUE),!1):!e||!this._checkLocationActive(e)?!1:n.length===i*i||e._array?!0:(this.setError(this.INVALID_VALUE),!1)}};function installUniformsMethods(e){Object.assign(e,sr)}function installShaderProgramMethods(e){installShaderLifecycleMethods(e),installProgramLifecycleMethods(e),installIntrospectionMethods(e),installUniformsMethods(e)}function installAllContextMethods(e){installStateMethods(e),installBufferBindingMethods(e),installTextureManagementMethods(e),installFramebufferMethods(e),installShaderProgramMethods(e),installDrawingMethods(e)}const cr=e(import.meta.url);let lr;function load(){return lr===void 0&&(lr=cr(`@gjsify/node-gi/gi`).requireGi(`Gwebgl`,`0.1`)),lr}var ur=new Proxy(Object.create(null),{get(e,t){return load()[t]},has(e,t){return t in load()}});let dr=0;const fr={oes_element_index_uint:getOESElementIndexUint,oes_texture_float:getOESTextureFloat,oes_texture_float_linear:getOESTextureFloatLinear,oes_standard_derivatives:getOESStandardDerivatives,stackgl_destroy_context:getSTACKGLDestroyContext,stackgl_resize_drawingbuffer:getSTACKGLResizeDrawingBuffer,ext_blend_minmax:getEXTBlendMinMax,ext_color_buffer_float:getEXTColorBufferFloat,ext_color_buffer_half_float:getEXTColorBufferHalfFloat,ext_texture_filter_anisotropic:getEXTTextureFilterAnisotropic,oes_texture_half_float:getOESTextureHalfFloat,webgl_debug_renderer_info:getWEBGLDebugRendererInfo};let pr=!1;function openGwebgl(){if(pr)return;let e=openNativeLibrary(`Gwebgl`);if(e)throw e;pr=!0}var WebGLContextBase=class{get drawingBufferHeight(){return this.canvas.height||0}get drawingBufferWidth(){return this.canvas.width||0}constructor(e,t={}){this.drawingBufferColorSpace=`srgb`,this.unpackColorSpace=`srgb`,this.RGBA8=32856,this.DEFAULT_ATTACHMENTS=[],this.DEFAULT_COLOR_ATTACHMENTS=[],this._=0,this._extensions={},this._programs={},this._shaders={},this._textures={},this._framebuffers={},this._renderbuffers={},this._buffers={},this._activeProgram=null,this._activeFramebuffer=null,this._activeRenderbuffer=null,this._checkStencil=!1,this._stencilState=!0,this._activeTextureUnit=0,this._errorStack=[],this._maxTextureSize=0,this._maxTextureLevel=0,this._maxCubeMapSize=0,this._maxCubeMapLevel=0,this._maxRenderbufferSize=0,this._unpackAlignment=4,this._packAlignment=4,this._unpackFlipY=!1,this._unpackPremultAlpha=!1,this._generateMipmapHint=4352,this._viewport=new Int32Array([0,0,0,0]),this._scissorBox=new Int32Array([0,0,0,0]),this._gtkFboId=0,this._textureUnits=[],this._drawingBuffer=null,openGwebgl(),this.canvas=e,this._contextAttributes=new WebGLContextAttributes(flag(t,`alpha`,!0),flag(t,`depth`,!0),flag(t,`stencil`,!1),!1,flag(t,`premultipliedAlpha`,!0),flag(t,`preserveDrawingBuffer`,!1),flag(t,`preferLowPowerToHighPerformance`,!1),flag(t,`failIfMajorPerformanceCaveat`,!1)),this._contextAttributes.premultipliedAlpha=this._contextAttributes.premultipliedAlpha&&this._contextAttributes.alpha}_init(){let e=this._gl.getParameterx(36006);this._gtkFboId=e?.deepUnpack()|0,this._initGLConstants(),this.DEFAULT_ATTACHMENTS=[this.COLOR_ATTACHMENT0,this.DEPTH_ATTACHMENT,this.STENCIL_ATTACHMENT,this.DEPTH_STENCIL_ATTACHMENT],this.DEFAULT_COLOR_ATTACHMENTS=[this.COLOR_ATTACHMENT0];let t=this.drawingBufferWidth||0,n=this.drawingBufferHeight||0;this._=dr++;let r=this.getParameter(this.MAX_COMBINED_TEXTURE_IMAGE_UNITS);this._textureUnits=Array.from({length:r});for(let e=0;e<r;++e)this._textureUnits[e]=new WebGLTextureUnit(this,e);this.activeTexture(this.TEXTURE0),this._defaultVertexObjectState=new WebGLVertexArrayObjectState(this),this._vertexObjectState=this._defaultVertexObjectState,this._vertexGlobalState=new WebGLVertexArrayGlobalState(this),this._maxTextureSize=this.getParameter(this.MAX_TEXTURE_SIZE),this._maxTextureLevel=Ln.log2(Ln.nextPow2(this._maxTextureSize)),this._maxCubeMapSize=this.getParameter(this.MAX_CUBE_MAP_TEXTURE_SIZE),this._maxCubeMapLevel=Ln.log2(Ln.nextPow2(this._maxCubeMapSize)),this._maxRenderbufferSize=this.getParameter(this.MAX_RENDERBUFFER_SIZE),this._unpackAlignment=4,this._packAlignment=4,this._unpackFlipY=!1,this._unpackPremultAlpha=!1,this.bindBuffer(this.ARRAY_BUFFER,null),this.bindBuffer(this.ELEMENT_ARRAY_BUFFER,null),this.bindFramebuffer(this.FRAMEBUFFER,null),this.bindRenderbuffer(this.RENDERBUFFER,null),this.viewport(0,0,t,n),this.scissor(0,0,t,n),this.clearDepth(1),this.clearColor(0,0,0,0),this.clearStencil(0),this.clear(this.COLOR_BUFFER_BIT|this.DEPTH_BUFFER_BIT|this.STENCIL_BUFFER_BIT),this.disable(this.DEPTH_TEST),this.disable(this.STENCIL_TEST),this.disable(this.BLEND),this.disable(this.CULL_FACE),this.disable(this.POLYGON_OFFSET_FILL),this.disable(this.SCISSOR_TEST),this._gl.colorMask(!0,!0,!0,!0)}_initGLConstants(){let e=new ur.WebGLRenderingContextBase().get_webgl_constants();for(let[t,n]of Object.entries(e))Object.defineProperty(this,t,{value:n})}_getGlslVersion(e){return this._getGlsl1Version(e)}_getGlsl1Version(e){return e||this._atLeastGlVersion(4,1)?`100`:`120`}_desktopGlslVersion(){let e=this._gl.getString(35724);if(!e||e.startsWith(`OpenGL ES `))return`130`;let[t,n]=e.split(`.`,2).map(e=>Number.parseInt(e,10));return!Number.isFinite(t)||!Number.isFinite(n)?`130`:String(t*100+(n>=10?n:n*10))}_atLeastGlVersion(e,t){let n=this._gl.getString(7938);if(!n||n.startsWith(`OpenGL ES `))return!1;let[r,i]=n.split(`.`,2).map(e=>Number.parseInt(e,10));return!Number.isFinite(r)||!Number.isFinite(i)?!1:r>e||r===e&&i>=t}_nativeFloatInternalFormat(e,t){return t!==this.FLOAT||!this._atLeastGlVersion(3,0)?e:e===this.RGBA?34836:e===this.RGB?34837:e}_isCoreProfile(){if(this._coreProfile!==void 0)return this._coreProfile;let e=!1;return this._atLeastGlVersion(3,2)&&(e=(this._gl.getParameteri(37158)&1)!=0),this._coreProfile=e,e}_emulatesLegacyFormats(){return this._legacyFormatEmulation===void 0&&(this._legacyFormatEmulation=this._isCoreProfile()&&this._atLeastGlVersion(3,3)),this._legacyFormatEmulation}_legacyFormatStorage(e,t){return!isLegacyFormat(e)||!this._emulatesLegacyFormats()?null:coreStorageForLegacyFormat(e,t)}_legacySubImageMismatch(e,t){return(isLegacyFormat(t)||isLegacyFormat(e._format))&&t!==e._format}_setTextureSwizzle(e,t,n){if(!n&&(t?!t._swizzled:!this._emulatesLegacyFormats()))return;let r=n??An,i=textureParameterTarget(e);for(let e=0;e<4;++e)this._gl.texParameteri(i,kn[e],r[e]);t&&(t._swizzled=n!==null)}_desktopGlslForEsDerivatives(){if(this._esDerivativesDesktopGlsl!==void 0)return this._esDerivativesDesktopGlsl;let e=null;if(this._atLeastGlVersion(4,1)){let t=this._gl.createShader(this.FRAGMENT_SHADER);this._gl.shaderSource(t,`#version 100
|
|
95
95
|
#extension GL_OES_standard_derivatives : enable
|
|
96
96
|
precision mediump float;
|
|
97
97
|
void main() { gl_FragColor = vec4(dFdx(gl_FragCoord.x)); }
|
|
98
|
-
`),this._gl.compileShader(t);let n=!!this._gl.getShaderParameter(t,this.COMPILE_STATUS);this._gl.deleteShader(t),n||(e=this._desktopGlslVersion())}return this._esDerivativesDesktopGlsl=e,e}_checkOwns(e){return typeof e==`object`&&!!e&&e._ctx===this}_checkValid(e,t){return e instanceof t&&e._!==0}_checkWrapper(e,t){return this._checkValid(e,t)?this._checkOwns(e)?!0:(this.setError(this.INVALID_OPERATION),!1):(this.setError(this.INVALID_VALUE),!1)}_isObject(e,t,n){if(e!=null&&!(e instanceof n))throw TypeError(t+`(`+n.name+`)`);return!!(this._checkValid(e,n)&&this._checkOwns(e))}_checkStencilState(){return this._checkStencil?(this._checkStencil=!1,this._stencilState=!0,(this.getParameter(this.STENCIL_WRITEMASK)!==this.getParameter(this.STENCIL_BACK_WRITEMASK)||this.getParameter(this.STENCIL_VALUE_MASK)!==this.getParameter(this.STENCIL_BACK_VALUE_MASK)||this.getParameter(this.STENCIL_REF)!==this.getParameter(this.STENCIL_BACK_REF))&&(this.setError(this.INVALID_OPERATION),this._stencilState=!1),this._stencilState):this._stencilState}_validGLSLIdentifier(e){return!(e.indexOf(`webgl_`)===0||e.indexOf(`_webgl_`)===0||e.length>256)}_getParameterDirect(e){return this._gl.getParameterx(e)?.deepUnpack()}getContextAttributes(){return this._contextAttributes}getExtension(e){let t=e.toLowerCase();if(t in this._extensions)return this._extensions[t];let n=Cr[t]?Cr[t](this):null;return n&&(this._extensions[t]=n),n}getSupportedExtensions(){let e=[`ANGLE_instanced_arrays`,`STACKGL_resize_drawingbuffer`,`STACKGL_destroy_context`,`WEBGL_debug_renderer_info`],t=this._gl.getSupportedExtensions()??[];return(t.indexOf(`GL_OES_element_index_uint`)>=0||this._atLeastGlVersion(1,1))&&e.push(`OES_element_index_uint`),(t.indexOf(`GL_OES_standard_derivatives`)>=0||this._atLeastGlVersion(2,0))&&e.push(`OES_standard_derivatives`),(t.indexOf(`GL_OES_texture_float`)>=0||this._atLeastGlVersion(3,0))&&e.push(`OES_texture_float`),(t.indexOf(`GL_OES_texture_float_linear`)>=0||this._atLeastGlVersion(3,0))&&e.push(`OES_texture_float_linear`),(t.indexOf(`GL_OES_texture_half_float`)>=0||t.indexOf(`GL_ARB_half_float_pixel`)>=0)&&e.push(`OES_texture_half_float`),(t.indexOf(`GL_EXT_color_buffer_float`)>=0||t.indexOf(`GL_ARB_color_buffer_float`)>=0)&&e.push(`EXT_color_buffer_float`),t.indexOf(`GL_EXT_color_buffer_half_float`)>=0&&e.push(`EXT_color_buffer_half_float`),t.indexOf(`EXT_draw_buffers`)>=0&&e.push(`WEBGL_draw_buffers`),(t.indexOf(`GL_EXT_blend_minmax`)>=0||this._atLeastGlVersion(1,4))&&e.push(`EXT_blend_minmax`),(t.indexOf(`GL_EXT_texture_filter_anisotropic`)>=0||t.indexOf(`GL_ARB_texture_filter_anisotropic`)>=0||this._atLeastGlVersion(4,6))&&e.push(`EXT_texture_filter_anisotropic`),t.indexOf(`GL_OES_vertex_array_object`)>=0&&e.push(`OES_vertex_array_object`),e}getParameter(e=0){switch(e){case this.ARRAY_BUFFER_BINDING:return this._vertexGlobalState._arrayBufferBinding;case this.ELEMENT_ARRAY_BUFFER_BINDING:return this._vertexObjectState._elementArrayBufferBinding;case this.CURRENT_PROGRAM:return this._activeProgram;case this.FRAMEBUFFER_BINDING:return this._activeFramebuffer;case this.RENDERBUFFER_BINDING:return this._activeRenderbuffer;case this.TEXTURE_BINDING_2D:return this._getActiveTextureUnit()._bind2D;case this.TEXTURE_BINDING_CUBE_MAP:return this._getActiveTextureUnit()._bindCube;case this.VERSION:return`WebGL 1.0 0.0.1`;case this.VENDOR:return``;case this.RENDERER:return`ANGLE`;case 37445:return this._gl.getString(7936);case 37446:return this._gl.getString(7937);case this.SHADING_LANGUAGE_VERSION:return`WebGL GLSL ES 1.0 `;case this.COMPRESSED_TEXTURE_FORMATS:return new Uint32Array;case this.SCISSOR_BOX:return new Int32Array(this._scissorBox);case this.VIEWPORT:return new Int32Array(this._viewport);case this.MAX_VIEWPORT_DIMS:return new Int32Array([32767,32767]);case this.ALIASED_LINE_WIDTH_RANGE:case this.ALIASED_POINT_SIZE_RANGE:return new Float32Array([1,1]);case this.DEPTH_RANGE:return new Float32Array([0,1]);case this.BLEND_COLOR:case this.COLOR_CLEAR_VALUE:return new Float32Array(this._gl.getParameterfv(e,4));case this.COLOR_WRITEMASK:{let t=this._gl.getParameteriv(e,4);return[!!t[0],!!t[1],!!t[2],!!t[3]]}case this.DEPTH_CLEAR_VALUE:case this.LINE_WIDTH:case this.POLYGON_OFFSET_FACTOR:case this.POLYGON_OFFSET_UNITS:case this.SAMPLE_COVERAGE_VALUE:return this._gl.getParameterf(e);case this.BLEND:case this.CULL_FACE:case this.DEPTH_TEST:case this.DEPTH_WRITEMASK:case this.DITHER:case this.POLYGON_OFFSET_FILL:case this.SAMPLE_COVERAGE_INVERT:case this.SCISSOR_TEST:case this.STENCIL_TEST:case this.UNPACK_PREMULTIPLY_ALPHA_WEBGL:return!!this._gl.getParameteri(e);case this.UNPACK_FLIP_Y_WEBGL:return this._unpackFlipY;case this.GENERATE_MIPMAP_HINT:return this._generateMipmapHint;case this.ACTIVE_TEXTURE:case this.ALPHA_BITS:case this.BLEND_DST_ALPHA:case this.BLEND_DST_RGB:case this.BLEND_EQUATION_ALPHA:case this.BLEND_EQUATION_RGB:case this.BLEND_SRC_ALPHA:case this.BLEND_SRC_RGB:case this.BLUE_BITS:case this.CULL_FACE_MODE:case this.DEPTH_BITS:case this.DEPTH_FUNC:case this.FRONT_FACE:case this.GREEN_BITS:return this._gl.getParameteri(e);case this.MAX_RENDERBUFFER_SIZE:return this._maxRenderbufferSize;case this.MAX_COMBINED_TEXTURE_IMAGE_UNITS:case this.MAX_CUBE_MAP_TEXTURE_SIZE:case this.MAX_FRAGMENT_UNIFORM_VECTORS:case this.MAX_TEXTURE_IMAGE_UNITS:case this.MAX_TEXTURE_SIZE:case this.MAX_VARYING_VECTORS:case this.MAX_VERTEX_ATTRIBS:case this.MAX_VERTEX_TEXTURE_IMAGE_UNITS:case this.MAX_VERTEX_UNIFORM_VECTORS:case this.PACK_ALIGNMENT:case this.RED_BITS:case this.SAMPLE_BUFFERS:case this.SAMPLES:case this.STENCIL_BACK_FAIL:case this.STENCIL_BACK_FUNC:case this.STENCIL_BACK_PASS_DEPTH_FAIL:case this.STENCIL_BACK_PASS_DEPTH_PASS:case this.STENCIL_BACK_REF:case this.STENCIL_BACK_VALUE_MASK:case this.STENCIL_BACK_WRITEMASK:case this.STENCIL_BITS:case this.STENCIL_CLEAR_VALUE:case this.STENCIL_FAIL:case this.STENCIL_FUNC:case this.STENCIL_PASS_DEPTH_FAIL:case this.STENCIL_PASS_DEPTH_PASS:case this.STENCIL_REF:case this.STENCIL_VALUE_MASK:case this.STENCIL_WRITEMASK:case this.SUBPIXEL_BITS:case this.UNPACK_ALIGNMENT:case this.UNPACK_COLORSPACE_CONVERSION_WEBGL:return this._gl.getParameteri(e);case this.IMPLEMENTATION_COLOR_READ_FORMAT:case this.IMPLEMENTATION_COLOR_READ_TYPE:return this._getParameterDirect(e);default:if(this._extensions.webgl_draw_buffers){let t=this._extensions.webgl_draw_buffers;switch(e){case t.DRAW_BUFFER0_WEBGL:case t.DRAW_BUFFER1_WEBGL:case t.DRAW_BUFFER2_WEBGL:case t.DRAW_BUFFER3_WEBGL:case t.DRAW_BUFFER4_WEBGL:case t.DRAW_BUFFER5_WEBGL:case t.DRAW_BUFFER6_WEBGL:case t.DRAW_BUFFER7_WEBGL:case t.DRAW_BUFFER8_WEBGL:case t.DRAW_BUFFER9_WEBGL:case t.DRAW_BUFFER10_WEBGL:case t.DRAW_BUFFER11_WEBGL:case t.DRAW_BUFFER12_WEBGL:case t.DRAW_BUFFER13_WEBGL:case t.DRAW_BUFFER14_WEBGL:case t.DRAW_BUFFER15_WEBGL:return t._buffersState.length===1&&t._buffersState[0]===this.BACK?this.BACK:this._getParameterDirect(e);case t.MAX_DRAW_BUFFERS_WEBGL:case t.MAX_COLOR_ATTACHMENTS_WEBGL:return this._getParameterDirect(e)}}let t=this._extensions.oes_standard_derivatives;if(t&&e===t.FRAGMENT_SHADER_DERIVATIVE_HINT_OES)return this._getParameterDirect(e);let n=this._extensions.ext_texture_filter_anisotropic;if(n&&e===n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)return this._gl.getParameterf(e);let r=this._extensions.oes_vertex_array_object;return r&&e===r.VERTEX_ARRAY_BINDING_OES?r._activeVertexArrayObject:(this.setError(this.INVALID_ENUM),null)}}destroy(){warnNotImplemented(`destroy`)}};installAllContextMethods(WebGLContextBase.prototype);var WebGLRenderingContext$1=class extends WebGLContextBase{static{__name$1(this,`WebGLRenderingContext`)}get _gl(){return this._native}constructor(e,t={}){super(e,t),this._attrib0Buffer=null,this._native=new xr.WebGLRenderingContext({}),this._init();let n=this.createBuffer();this._attrib0Buffer=n}_beginAttrib0Hack(){this._native.bindBuffer(this.ARRAY_BUFFER,this._attrib0Buffer?._||0);let e=new Uint8Array(this._vertexGlobalState._attribs[0]._data.buffer);this._native.bufferData(this.ARRAY_BUFFER,Uint8ArrayToVariant(e),this.STREAM_DRAW),this._native.enableVertexAttribArray(0),this._native.vertexAttribPointer(0,4,this.FLOAT,!1,0,0),this._native._vertexAttribDivisor(0,1)}_endAttrib0Hack(){let e=this._vertexObjectState._attribs[0];e._pointerBuffer?this._native.bindBuffer(this.ARRAY_BUFFER,e._pointerBuffer._):this._native.bindBuffer(this.ARRAY_BUFFER,0),this._native.vertexAttribPointer(0,e._inputSize,e._pointerType,e._pointerNormal,e._inputStride,e._pointerOffset),this._native._vertexAttribDivisor(0,e._divisor),this._native.disableVertexAttribArray(0),this._vertexGlobalState._arrayBufferBinding?this._native.bindBuffer(this.ARRAY_BUFFER,this._vertexGlobalState._arrayBufferBinding._):this._native.bindBuffer(this.ARRAY_BUFFER,0)}drawArrays(e=0,t=0,n=0){if(t<0||n<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let r=vertexCount(this,e,n);if(r<0){this.setError(this.INVALID_ENUM);return}if(!this._framebufferOk()||n===0)return;let i=t;if(n>0&&(i=n+t-1>>>0),this._checkVertexAttribState(i)){let n=this._extensions.webgl_draw_buffers;if(this._vertexObjectState._attribs[0]._isPointer||n&&n._buffersState&&n._buffersState.length>0)return this._native.drawArrays(e,t,r);this._beginAttrib0Hack(),this._native._drawArraysInstanced(e,t,r,1),this._endAttrib0Hack()}}drawElements(e=0,t=0,n=0,r=0){if(t<0||r<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let i=this._vertexObjectState._elementArrayBufferBinding;if(!i){this.setError(this.INVALID_OPERATION);return}let a=null,o=r;if(n===this.UNSIGNED_SHORT){if(o%2){this.setError(this.INVALID_OPERATION);return}o>>=1,a=new Uint16Array(i._elements.buffer)}else if(this._extensions.oes_element_index_uint&&n===this.UNSIGNED_INT){if(o%4){this.setError(this.INVALID_OPERATION);return}o>>=2,a=new Uint32Array(i._elements.buffer)}else if(n===this.UNSIGNED_BYTE)a=i._elements;else{this.setError(this.INVALID_ENUM);return}let s=t;switch(e){case this.TRIANGLES:t%3&&(s-=t%3);break;case this.LINES:t%2&&(s-=t%2);break;case this.POINTS:break;case this.LINE_LOOP:case this.LINE_STRIP:if(t<2){this.setError(this.INVALID_OPERATION);return}break;case this.TRIANGLE_FAN:case this.TRIANGLE_STRIP:if(t<3){this.setError(this.INVALID_OPERATION);return}break;default:this.setError(this.INVALID_ENUM);return}if(!this._framebufferOk())return;if(t===0){this._checkVertexAttribState(0);return}if(t+o>>>0>a.length){this.setError(this.INVALID_OPERATION);return}let c=-1;for(let e=o;e<o+t;++e)c=Math.max(c,a[e]);if(c<0){this._checkVertexAttribState(0);return}if(this._checkVertexAttribState(c)&&s>0){if(this._vertexObjectState._attribs[0]._isPointer)return this._native.drawElements(e,s,n,r);this._beginAttrib0Hack(),this._native._drawElementsInstanced(e,s,n,r,1),this._endAttrib0Hack()}}},WebGLQuery=class extends Linkable{constructor(e,t){super(e),this._ctx=t}_performDelete(){let e=this._ctx;delete e._queries[this._|0],e._native2.deleteQuery(this._|0)}},WebGLSampler=class extends Linkable{constructor(e,t){super(e),this._ctx=t}_performDelete(){let e=this._ctx;delete e._samplers[this._|0],e._native2.deleteSampler(this._|0)}},WebGLSync=class extends Linkable{constructor(e,t){super(e),this._ctx=t}_performDelete(){let e=this._ctx;delete e._syncs[this._|0],e._native2.deleteSync(this._|0)}},WebGLTransformFeedback=class extends Linkable{constructor(e,t){super(e),this._ctx=t}_performDelete(){let e=this._ctx;delete e._transformFeedbacks[this._|0],e._native2.deleteTransformFeedback(this._|0)}},WebGLVertexArrayObject=class extends Linkable{constructor(e,t){super(e),this._ctx=t,this._objectState=new WebGLVertexArrayObjectState(t)}_performDelete(){let e=this._ctx;e._vertexObjectState===this._objectState&&(e._vertexObjectState=e._defaultVertexObjectState),this._objectState.cleanUp(),delete e._vertexArrayObjects[this._|0],e._native2.deleteVertexArray(this._|0)}};const Tr={createVertexArray(){let e=this._native2.createVertexArray();if(!e)return null;let t=new WebGLVertexArrayObject(e,this);return this._vertexArrayObjects[e]=t,t},deleteVertexArray(e){!e||!(e instanceof WebGLVertexArrayObject)||(e._pendingDelete=!0,e._checkDelete())},isVertexArray(e){return!e||!(e instanceof WebGLVertexArrayObject)?!1:this._native2.isVertexArray(e._)},bindVertexArray(e){e===null?(this._native2.bindVertexArray(0),this._vertexObjectState=this._defaultVertexObjectState):e instanceof WebGLVertexArrayObject?(this._native2.bindVertexArray(e._),this._vertexObjectState=e._objectState):this.setError(this.INVALID_OPERATION)},createQuery(){let e=this._native2.createQuery();if(!e)return null;let t=new WebGLQuery(e,this);return this._queries[e]=t,t},deleteQuery(e){!e||!(e instanceof WebGLQuery)||(e._pendingDelete=!0,e._checkDelete())},isQuery(e){return!e||!(e instanceof WebGLQuery)?!1:this._native2.isQuery(e._)},beginQuery(e,t){t instanceof WebGLQuery&&this._native2.beginQuery(e,t._)},endQuery(e){this._native2.endQuery(e)},getQuery(e,t){return warnNotImplemented(`WebGL2RenderingContext.getQuery`),null},getQueryParameter(e,t){return e instanceof WebGLQuery?this._native2.getQueryParameter(e._,t):null},createSampler(){let e=this._native2.createSampler();if(!e)return null;let t=new WebGLSampler(e,this);return this._samplers[e]=t,t},deleteSampler(e){!e||!(e instanceof WebGLSampler)||(e._pendingDelete=!0,e._checkDelete())},isSampler(e){return!e||!(e instanceof WebGLSampler)?!1:this._native2.isSampler(e._)},bindSampler(e,t){this._native2.bindSampler(e,t?t._:0)},samplerParameteri(e,t,n){e instanceof WebGLSampler&&this._native2.samplerParameteri(e._,t,n)},samplerParameterf(e,t,n){e instanceof WebGLSampler&&this._native2.samplerParameterf(e._,t,n)},getSamplerParameter(e,t){return e instanceof WebGLSampler?t===33082||t===33083?this._native2.getSamplerParameterf(e._,t):this._native2.getSamplerParameteri(e._,t):null},fenceSync(e,t){let n=this._native2.fenceSync(e,t);if(!n)return null;let r=new WebGLSync(n,this);return this._syncs[n]=r,r},isSync(e){return!e||!(e instanceof WebGLSync)?!1:this._native2.isSync(e._)},deleteSync(e){!e||!(e instanceof WebGLSync)||(e._pendingDelete=!0,e._checkDelete())},clientWaitSync(e,t,n){return e instanceof WebGLSync?this._native2.clientWaitSync(e._,t,n):37148},waitSync(e,t,n){e instanceof WebGLSync&&this._native2.waitSync(e._,t,n)},getSyncParameter(e,t){return e instanceof WebGLSync?this._native2.getSyncParameter(e._,t):null},createTransformFeedback(){let e=this._native2.createTransformFeedback();if(!e)return null;let t=new WebGLTransformFeedback(e,this);return this._transformFeedbacks[e]=t,t},deleteTransformFeedback(e){!e||!(e instanceof WebGLTransformFeedback)||(e._pendingDelete=!0,e._checkDelete())},isTransformFeedback(e){return!e||!(e instanceof WebGLTransformFeedback)?!1:this._native2.isTransformFeedback(e._)},bindTransformFeedback(e,t){this._native2.bindTransformFeedback(e,t?t._:0)},beginTransformFeedback(e){this._native2.beginTransformFeedback(e)},endTransformFeedback(){this._native2.endTransformFeedback()},pauseTransformFeedback(){this._native2.pauseTransformFeedback()},resumeTransformFeedback(){this._native2.resumeTransformFeedback()},transformFeedbackVaryings(e,t,n){this._native2.transformFeedbackVaryings(e._,t,n)},getTransformFeedbackVarying(e,t){let n=this._native2.getTransformFeedbackVarying(e._,t).deepUnpack();return new WebGLActiveInfo({size:n.size,type:n.type,name:n.name})}};function installObjectLifecycleMethods(e){Object.assign(e,Tr)}function boundTexture3D(e,t){let n=t===32879?32874:t===35866?35869:0;return n?e._textures[e._gl.getParameteri(n)]??null:null}const Er={texImage3D(e,t,n,r,i,a,o,s,c,l){let u=n===s?this._legacyFormatStorage(s,c):null,d=u?u.internalFormat:n,f=u?u.format:s;this._saveError(),l===null?this._native2.texImage3DNull(e,t,d,r,i,a,o,f,c):this._native2.texImage3D(e,t,d,r,i,a,o,f,c,Uint8ArrayToVariant(new Uint8Array(l.buffer,l.byteOffset,l.byteLength)));let p=this.getError();if(this._restoreError(p),p!==this.NO_ERROR)return;let m=boundTexture3D(this,e);m&&(m._format=s,m._type=c),this._setTextureSwizzle(e,m,u?u.swizzle:null)},texSubImage3D(e,t,n,r,i,a,o,s,c,l,u){if(u===null)return;let d=boundTexture3D(this,e);if(d&&this._legacySubImageMismatch(d,c)){this.setError(this.INVALID_OPERATION);return}this._native2.texSubImage3D(e,t,n,r,i,a,o,s,this._legacyFormatStorage(c,l)?.format??c,l,Uint8ArrayToVariant(new Uint8Array(u.buffer,u.byteOffset,u.byteLength)))},compressedTexImage3D(e,t,n,r,i,a,o,s,c){this._saveError(),this._native2.compressedTexImage3D(e,t,n,r,i,a,o,Uint8ArrayToVariant(new Uint8Array(c.buffer,c.byteOffset,c.byteLength)));let l=this.getError();if(this._restoreError(l),l!==this.NO_ERROR)return;let u=boundTexture3D(this,e);u&&(u._format=n),this._setTextureSwizzle(e,u,null)},compressedTexSubImage3D(e,t,n,r,i,a,o,s,c,l,u){this._native2.compressedTexSubImage3D(e,t,n,r,i,a,o,s,c,Uint8ArrayToVariant(new Uint8Array(u.buffer,u.byteOffset,u.byteLength)))},copyTexSubImage3D(e,t,n,r,i,a,o,s,c){let l=boundTexture3D(this,e)?._format??0;if((l===this.ALPHA||l===this.LUMINANCE_ALPHA)&&this._legacyFormatStorage(l,this.UNSIGNED_BYTE)){if(s<0||c<0){this.setError(this.INVALID_VALUE);return}this._copyLegacyChannels(l,a,o,s,c,(a,o)=>this._native2.texSubImage3D(e,t,n,r,i,s,c,1,a.format,this.UNSIGNED_BYTE,o));return}this._native2.copyTexSubImage3D(e,t,n,r,i,a,o,s,c)},texStorage2D(e,t,n,r,i){this._saveError(),this._native2.texStorage2D(e,t,n,r,i);let a=this.getError();if(this._restoreError(a),a!==this.NO_ERROR)return;let o=this._getTexImage(e);if(o){for(let e=0;e<t;e++)o._levelWidth[e]=Math.max(1,r>>e),o._levelHeight[e]=Math.max(1,i>>e);o._format=this.RGBA,o._type=this.UNSIGNED_BYTE,this._setTextureSwizzle(e,o,null)}},texStorage3D(e,t,n,r,i,a){this._saveError(),this._native2.texStorage3D(e,t,n,r,i,a);let o=this.getError();if(this._restoreError(o),o!==this.NO_ERROR)return;let s=boundTexture3D(this,e);s&&(s._format=this.RGBA,s._type=this.UNSIGNED_BYTE),this._setTextureSwizzle(e,s,null)}};function installTexImage3DMethods(e){Object.assign(e,Er)}const Dr={uniform1ui(e,t){e&&this._native2.uniform1ui(e._,t)},uniform2ui(e,t,n){e&&this._native2.uniform2ui(e._,t,n)},uniform3ui(e,t,n,r){e&&this._native2.uniform3ui(e._,t,n,r)},uniform4ui(e,t,n,r,i){e&&this._native2.uniform4ui(e._,t,n,r,i)},uniform1uiv(e,t,n,r){if(!e)return;let i=t instanceof Uint32Array?t:new Uint32Array(t);this._native2.uniform1uiv(e._,i.length,i)},uniform2uiv(e,t,n,r){if(!e)return;let i=t instanceof Uint32Array?t:new Uint32Array(t);this._native2.uniform2uiv(e._,i.length/2,i)},uniform3uiv(e,t,n,r){if(!e)return;let i=t instanceof Uint32Array?t:new Uint32Array(t);this._native2.uniform3uiv(e._,i.length/3,i)},uniform4uiv(e,t,n,r){if(!e)return;let i=t instanceof Uint32Array?t:new Uint32Array(t);this._native2.uniform4uiv(e._,i.length/4,i)},uniformMatrix2x3fv(e,t,n,r,i){if(!e)return;let a=n instanceof Float32Array?n:new Float32Array(n);this._native2.uniformMatrix2x3fv(e._,t,a)},uniformMatrix3x2fv(e,t,n,r,i){if(!e)return;let a=n instanceof Float32Array?n:new Float32Array(n);this._native2.uniformMatrix3x2fv(e._,t,a)},uniformMatrix2x4fv(e,t,n,r,i){if(!e)return;let a=n instanceof Float32Array?n:new Float32Array(n);this._native2.uniformMatrix2x4fv(e._,t,a)},uniformMatrix4x2fv(e,t,n,r,i){if(!e)return;let a=n instanceof Float32Array?n:new Float32Array(n);this._native2.uniformMatrix4x2fv(e._,t,a)},uniformMatrix3x4fv(e,t,n,r,i){if(!e)return;let a=n instanceof Float32Array?n:new Float32Array(n);this._native2.uniformMatrix3x4fv(e._,t,a)},uniformMatrix4x3fv(e,t,n,r,i){if(!e)return;let a=n instanceof Float32Array?n:new Float32Array(n);this._native2.uniformMatrix4x3fv(e._,t,a)}};function installUniformMethods(e){Object.assign(e,Dr)}const Or={clearBufferfv(e,t,n,r){let i=this._native2;if(typeof i.clearBufferfv==`function`){i.clearBufferfv(e,t,Array.from(n));return}let a=n;if(e===6144){let e=this.getParameter(this.COLOR_CLEAR_VALUE);this.clearColor(a[0]??0,a[1]??0,a[2]??0,a[3]??0),this.clear(this.COLOR_BUFFER_BIT),e&&this.clearColor(e[0],e[1],e[2],e[3])}else if(e===6145){let e=this.getParameter(this.DEPTH_CLEAR_VALUE);this.clearDepth(a[0]??1),this.clear(this.DEPTH_BUFFER_BIT),e!==null&&this.clearDepth(e)}},clearBufferiv(e,t,n,r){let i=this._native2;if(typeof i.clearBufferiv==`function`){i.clearBufferiv(e,t,Array.from(n));return}if(e===6146){let e=n,t=this.getParameter(this.STENCIL_CLEAR_VALUE);this.clearStencil(e[0]??0),this.clear(this.STENCIL_BUFFER_BIT),t!==null&&this.clearStencil(t)}},clearBufferuiv(e,t,n,r){let i=this._native2;if(typeof i.clearBufferuiv==`function`){i.clearBufferuiv(e,t,Array.from(n));return}},clearBufferfi(e,t,n,r){let i=this._native2;if(typeof i.clearBufferfi==`function`){i.clearBufferfi(e,t,n,r);return}if(e===34041){let e=this.getParameter(this.DEPTH_CLEAR_VALUE),t=this.getParameter(this.STENCIL_CLEAR_VALUE);this.clearDepth(n),this.clearStencil(r),this.clear(this.DEPTH_BUFFER_BIT|this.STENCIL_BUFFER_BIT),e!==null&&this.clearDepth(e),t!==null&&this.clearStencil(t)}}};function installClearBufferMethods(e){Object.assign(e,Or)}function debugGlEnabled(){return globalThis.__GJSIFY_DEBUG_GL===!0}const kr={drawArraysInstanced(e,t,n,r){if(t<0||n<0||r<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let i=vertexCount(this,e,n);if(i<0){this.setError(this.INVALID_ENUM);return}if(this._framebufferOk()&&!(n===0||r===0)&&this._checkVertexAttribState(n+t-1>>>0)){if(debugGlEnabled()){let e=this,t=e.__drawInstCount=(e.__drawInstCount|0)+1;(t<=5||t%100==0)&&console.log(`[WebGL] drawArraysInstanced #${t} count=${i} instances=${r} fbo=${this._activeFramebuffer?._??`_gtkFbo`}`)}this._native2.drawArraysInstanced(e,t,i,r)}},drawElementsInstanced(e,t,n,r,i){if(t<0||r<0||i<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let a=this._vertexObjectState._elementArrayBufferBinding;if(!a){this.setError(this.INVALID_OPERATION);return}let o=null,s=r;if(n===this.UNSIGNED_SHORT){if(s%2){this.setError(this.INVALID_OPERATION);return}s>>=1,o=new Uint16Array(a._elements.buffer)}else if(n===this.UNSIGNED_INT){if(s%4){this.setError(this.INVALID_OPERATION);return}s>>=2,o=new Uint32Array(a._elements.buffer)}else if(n===this.UNSIGNED_BYTE)o=a._elements;else{this.setError(this.INVALID_ENUM);return}let c=t;switch(e){case this.TRIANGLES:t%3&&(c-=t%3);break;case this.LINES:t%2&&(c-=t%2);break;case this.POINTS:break;case this.LINE_LOOP:case this.LINE_STRIP:if(t<2){this.setError(this.INVALID_OPERATION);return}break;case this.TRIANGLE_FAN:case this.TRIANGLE_STRIP:if(t<3){this.setError(this.INVALID_OPERATION);return}break;default:this.setError(this.INVALID_ENUM);return}if(!this._framebufferOk())return;if(c===0||i===0){this._checkVertexAttribState(0);return}if(c+s>>>0>o.length){this.setError(this.INVALID_OPERATION);return}let l=0;for(let e=s;e<s+c;++e)o[e]>l&&(l=o[e]);this._checkVertexAttribState(l)&&this._native2.drawElementsInstanced(e,c,n,r,i)},vertexAttribDivisor(e,t){this._checkVertexIndex(e)&&(this._native2.vertexAttribDivisor(e,t),this._vertexObjectState._attribs[e]._divisor=t)},vertexAttribIPointer(e,t,n,r,i){this._native2.vertexAttribIPointer(e,t,n,r,i)},drawBuffers(e){let t=!1;for(let n=0;n<e.length;n++)if(e[n]===1029){t=!0;break}if(!t){this._native2.drawBuffers(e);return}this._native2.drawBuffers(e.map(e=>e===1029?this.COLOR_ATTACHMENT0:e))},drawRangeElements(e,t,n,r,i,a){if(r<0||a<0){this.setError(this.INVALID_VALUE);return}if(n<t){this.setError(this.INVALID_VALUE);return}this.drawElements(e,r,i,a)},blitFramebuffer(e,t,n,r,i,a,o,s,c,l){if(debugGlEnabled()){let e=this._gl.getError();e!==0&&console.log(`[WebGL] blitFramebuffer PRE-ERROR 0x${e.toString(16)}`)}if(this._native2.blitFramebuffer(e,t,n,r,i,a,o,s,c,l),debugGlEnabled()){let i=this._gl.getError(),a=this,o=a.__blitCount=(a.__blitCount|0)+1;o<=5&&console.log(`[WebGL] blitFramebuffer #${o} src=(${e},${t},${n},${r}) readFbo=${this._activeReadFramebuffer?._??`_gtkFbo`} err=${i===0?`OK`:`0x`+i.toString(16)}`)}},framebufferTextureLayer(e,t,n,r,i){this._native2.framebufferTextureLayer(e,t,n?n._:0,r,i)},invalidateFramebuffer(e,t){this._native2.invalidateFramebuffer(e,t)},invalidateSubFramebuffer(e,t,n,r,i,a){this._native2.invalidateSubFramebuffer(e,t,n,r,i,a)},readBuffer(e){this._native2.readBuffer(e)},renderbufferStorageMultisample(e,t,n,r,i){if(e!==this.RENDERBUFFER){this.setError(this.INVALID_ENUM);return}let a=this._activeRenderbuffer;if(!a){this.setError(this.INVALID_OPERATION);return}this._saveError(),this._native2.renderbufferStorageMultisample(e,t,n,r,i);let o=this.getError();this._restoreError(o),o===this.NO_ERROR&&(a._width=r,a._height=i,a._format=n)}};function installInstancedAndFramebufferOpsMethods(e){Object.assign(e,kr)}var Ar=class WebGL2RenderingContext extends WebGLContextBase{get _gl(){return this._native2}constructor(e,t={}){super(e,t),this._queries={},this._samplers={},this._transformFeedbacks={},this._vertexArrayObjects={},this._syncs={},this._activeReadFramebuffer=null,this._activeDrawFramebuffer=null,this._native2=new xr.WebGL2RenderingContext({}),this._init()}_getGlslVersion(e){return e?`300 es`:this._desktopGlslVersion()}_validFramebufferAttachment(e){return super._validFramebufferAttachment(e)?!0:e>=36065&&e<=36079}static{this._WGL2_ALL_COLOR_ATTACHMENTS=[36064,36065,36066,36067,36068,36069,36070,36071,36072,36073,36074,36075,36076,36077,36078,36079]}_getColorAttachments(){return WebGL2RenderingContext._WGL2_ALL_COLOR_ATTACHMENTS}_preCheckFramebufferStatus(e){let t=e._attachments,n=0,r=0,i=[this.COLOR_ATTACHMENT0,this.DEPTH_ATTACHMENT,this.STENCIL_ATTACHMENT,this.DEPTH_STENCIL_ATTACHMENT,...WebGL2RenderingContext._WGL2_ALL_COLOR_ATTACHMENTS];for(let e of i){let n=t[e];if(n instanceof WebGLTexture&&isLegacyFormat(n._format))return this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT}for(let a of i){let i=t[a];if(i){if(i instanceof WebGLTexture){let t=e._attachmentLevel[a]??0,o=i._levelWidth[t]??0,s=i._levelHeight[t]??0;if(o>0&&s>0){n=o,r=s;break}}else if(i instanceof WebGLRenderbuffer&&i._width>0&&i._height>0){n=i._width,r=i._height;break}}}return n>0&&r>0?(e._width=n,e._height=r,this.FRAMEBUFFER_COMPLETE):this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT}_updateFramebufferAttachments(e){if(super._updateFramebufferAttachments(e),e)for(let t=1;t<=15;t++){let n=36064+t;if(!(n in e._attachments))continue;let r=e._attachments[n];if(r instanceof WebGLTexture&&!isLegacyFormat(r._format)){let t=e._attachmentFace[n]||this.TEXTURE_2D,i=e._attachmentLevel[n]??0;this._gl.framebufferTexture2D(this.FRAMEBUFFER,n,t,r._|0,i|0)}else r instanceof WebGLRenderbuffer?this._gl.framebufferRenderbuffer(this.FRAMEBUFFER,n,this.RENDERBUFFER,r._|0):this._gl.framebufferTexture2D(this.FRAMEBUFFER,n,this.TEXTURE_2D,0,0)}}bindBuffer(e,t){if(e===35345||e===35982||e===36662||e===36663){let n=t?t._|0:0;this._gl.bindBuffer(e,n);return}super.bindBuffer(e,t)}bindFramebuffer(e,t){if(e===36008||e===36009){if(!checkObject(t))throw TypeError(`bindFramebuffer(GLenum, WebGLFramebuffer)`);if(t&&t._pendingDelete||t&&!this._checkWrapper(t,WebGLFramebuffer))return;let n=t?t._|0:this._gtkFboId;if(this._gl.bindFramebuffer(e,n),e===36008){let e=this._activeReadFramebuffer;e!==t&&(e&&(--e._refCount,e._checkDelete()),t&&(t._refCount+=1)),this._activeReadFramebuffer=t}else{let e=this._activeDrawFramebuffer;e!==t&&(e&&(--e._refCount,e._checkDelete()),t&&(t._refCount+=1)),this._activeDrawFramebuffer=t,this._activeFramebuffer=t}return}super.bindFramebuffer(this.FRAMEBUFFER,t),this._activeReadFramebuffer=t,this._activeDrawFramebuffer=t}deleteFramebuffer(e){this._activeReadFramebuffer===e&&this.bindFramebuffer(36008,null),this._activeDrawFramebuffer===e&&this.bindFramebuffer(36009,null),super.deleteFramebuffer(e)}bufferData(e,t,n){let r=e===35345||e===35982||e===36662||e===36663,i=n===35041||n===35043||n===35045||n===35042||n===35044||n===35046?this.STATIC_DRAW:n;if(r){if(typeof t==`number`)t>=0&&this._gl.bufferDataSizeOnly(e,t,i);else if(typeof t==`object`&&t){let n=arrayToUint8Array(t);this._gl.bufferData(e,Uint8ArrayToVariant(n),i)}return}super.bufferData(e,t,i)}bufferSubData(e,t,n){if(e===35345||e===35982||e===36662||e===36663){if(t<0){this.setError(this.INVALID_VALUE);return}if(!n){this.setError(this.INVALID_VALUE);return}let r=arrayToUint8Array(n);this._gl.bufferSubData(e,t,Uint8ArrayToVariant(r));return}super.bufferSubData(e,t,n)}bindTexture(e,t){if(e===32879||e===35866){let n=t,r=n?n._|0:0;this._gl.bindTexture(e,r),n&&(n._binding=e);return}super.bindTexture(e,t)}texParameteri(e,t,n){if(t>=36418&&t<=36422){this.setError(this.INVALID_ENUM);return}if(e===32879||e===35866){this._gl.texParameteri(e,t,n);return}if(t===32882||t===34892||t===34893||t===33084||t===33085||t===33083||t===33082){this._gl.texParameteri(e,t,n);return}super.texParameteri(e,t,n)}drawArrays(e,t,n){if(t<0||n<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let r=vertexCount(this,e,n);if(r<0){this.setError(this.INVALID_ENUM);return}this._framebufferOk()&&n!==0&&this._checkVertexAttribState(n+t-1>>>0)&&this._native2.drawArrays(e,t,r)}drawElements(e=0,t=0,n=0,r=0){if(t<0||r<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let i=this._vertexObjectState._elementArrayBufferBinding;if(!i){this.setError(this.INVALID_OPERATION);return}let a=null,o=r;if(n===this.UNSIGNED_SHORT){if(o%2){this.setError(this.INVALID_OPERATION);return}o>>=1,a=new Uint16Array(i._elements.buffer)}else if(n===this.UNSIGNED_INT){if(o%4){this.setError(this.INVALID_OPERATION);return}o>>=2,a=new Uint32Array(i._elements.buffer)}else if(n===this.UNSIGNED_BYTE)a=i._elements;else{this.setError(this.INVALID_ENUM);return}let s=t;switch(e){case this.TRIANGLES:t%3&&(s-=t%3);break;case this.LINES:t%2&&(s-=t%2);break;case this.POINTS:break;case this.LINE_LOOP:case this.LINE_STRIP:if(t<2){this.setError(this.INVALID_OPERATION);return}break;case this.TRIANGLE_FAN:case this.TRIANGLE_STRIP:if(t<3){this.setError(this.INVALID_OPERATION);return}break;default:this.setError(this.INVALID_ENUM);return}if(!this._framebufferOk()||t===0)return;let c=0;for(let e=o;e<o+s;++e)e<a.length&&a[e]>c&&(c=a[e]);this._checkVertexAttribState(c)&&this._native2.drawElements(e,s,n,r)}bindBufferBase(e,t,n){this._native2.bindBufferBase(e,t,n?n._:0)}bindBufferRange(e,t,n,r,i){this._native2.bindBufferRange(e,t,n?n._:0,r,i)}copyBufferSubData(e,t,n,r,i){this._native2.copyBufferSubData(e,t,n,r,i)}getBufferSubData(e,t,n,r,i){let a=i===void 0?n.byteLength-(r??0):i,o=this._native2.getBufferSubData(e,t,a),s=new Uint8Array(n.buffer,n.byteOffset+(r??0)*(n instanceof Uint8Array?1:n.BYTES_PER_ELEMENT??1));s.set(o.subarray(0,s.byteLength))}texImage2D(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0,c){let l=0,u=0,d=0,f=0;if(arguments.length===6)if(s=i,d=r,a instanceof bt.Pixbuf){let e=a;l=e.get_width(),u=e.get_height(),c=e.get_pixels()}else{let e=extractImageData(a);if(e==null)throw TypeError(`texImage2D(GLenum, GLint, GLenum, GLint, GLenum, GLenum, ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement)`);l=e.width,u=e.height,c=e.data}else arguments.length>=9&&(l=r,u=i,f=a,d=o);let p=this._getTexImage(e);if(!p){this.setError(this.INVALID_OPERATION);return}let m=convertPixels(c);if(this._unpackPremultAlpha&&m&&d===this.RGBA&&(m=premultiplyAlpha(m)),this._unpackFlipY&&m&&l>0&&u>0){let e=this._computePixelSize(s,d);if(e>0){let t=this._computeRowStride(l,e),n=new Uint8Array(m.length);for(let e=0;e<u;e++){let r=e*t,i=(u-1-e)*t;n.set(m.subarray(r,r+t),i)}m=n}}let h=n===d?this._legacyFormatStorage(d,s):null;this._saveError(),this._gl.texImage2D(e,t,h?h.internalFormat:n,l,u,f,h?h.format:d,s,Uint8ArrayToVariant(m));let g=this.getError();if(this._restoreError(g),g!==this.NO_ERROR)return;this._setTextureSwizzle(e,p,h?h.swizzle:null),p._levelWidth[t]=l,p._levelHeight[t]=u,p._format=d,p._type=s;let _=this._activeFramebuffer;if(_){let e=!1,t=this._getAttachments();for(let n=0;n<t.length;++n)if(_._attachments[t[n]]===p){e=!0;break}e&&this._activeFramebuffer&&this._updateFramebufferAttachments(this._activeFramebuffer)}}texSubImage2D(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0,c){let l=0,u=0,d=0;if(arguments.length===7)if(s=a,d=i,o instanceof bt.Pixbuf){let e=o;l=e.get_width(),u=e.get_height(),c=e.get_pixels()}else{let e=extractImageData(o);if(e==null)throw TypeError(`texSubImage2D(GLenum, GLint, GLint, GLint, GLenum, GLenum, ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement)`);l=e.width,u=e.height,c=e.data}else l=i,u=a,d=o;let f=this._getTexImage(e);if(!f){this.setError(this.INVALID_OPERATION);return}if(this._legacySubImageMismatch(f,d)){this.setError(this.INVALID_OPERATION);return}let p=convertPixels(c);if(!p){this.setError(this.INVALID_OPERATION);return}if(this._unpackPremultAlpha&&p&&d===this.RGBA&&(p=premultiplyAlpha(p)),this._unpackFlipY&&p&&l>0&&u>0){let e=this._computePixelSize(s,d);if(e>0){let t=this._computeRowStride(l,e),n=new Uint8Array(p.length);for(let e=0;e<u;e++){let r=e*t,i=(u-1-e)*t;n.set(p.subarray(r,r+t),i)}p=n}}let m=this._legacyFormatStorage(d,s)?.format??d;this._gl.texSubImage2D(e,t,n,r,l,u,m,s,Uint8ArrayToVariant(p))}getUniform(e,t){let n=t?._activeInfo?.type,r=5125,i=36294,a=36295,o=n===r||n===i||n===a||n===36296,s=e;if(!o)return super.getUniform(s,t);if(!e||!t)return null;let c=this._native2.getUniformi(s._|0,t._|0);return c?n===r?c[0]>>>0:n===i?new Uint32Array([c[0]>>>0,c[1]>>>0]):n===a?new Uint32Array([c[0]>>>0,c[1]>>>0,c[2]>>>0]):new Uint32Array([c[0]>>>0,c[1]>>>0,c[2]>>>0,c[3]>>>0]):null}getUniformBlockIndex(e,t){return this._native2.getUniformBlockIndex(e._,t)}uniformBlockBinding(e,t,n){this._native2.uniformBlockBinding(e._,t,n)}getActiveUniformBlockName(e,t){let n=this._native2.getActiveUniformBlockName(e._,t);return n.length>0?n:null}getActiveUniformBlockParameter(e,t,n){return this._native2.getActiveUniformBlockParameter(e._,t,n)}getActiveUniforms(e,t,n){return this._native2.getActiveUniforms(e._,t,n)}getFragDataLocation(e,t){return this._native2.getFragDataLocation(e._,t)}getIndexedParameter(e,t){return this._native2.getIndexedParameteri(e,t)}getInternalformatParameter(e,t,n){return this._native2.getInternalformatParameter(e,t,n)}getParameter(e){if(e===7938)return`WebGL 2.0`;if(e===35724)return`WebGL GLSL ES 3.00`;if(e===7939)return warnNotImplemented(`WebGL2RenderingContext.getParameter(GL_EXTENSIONS)`),``;if(e===36006)return this._activeDrawFramebuffer;if(e===36010)return this._activeReadFramebuffer;switch(e){case 36183:case 35071:case 32883:case 36063:case 34852:case 36203:case 33001:case 33e3:case 37157:case 35373:case 35657:case 35077:case 35978:case 35979:case 35968:case 35376:case 35375:case 35659:case 37154:case 35371:case 35658:case 35379:case 35374:case 35377:case 35076:case 3330:case 3332:case 3331:case 35053:case 35055:case 3074:case 32874:case 35869:case 36389:case 35983:case 35368:case 35380:case 32878:case 3314:case 32877:case 3316:case 3315:case 34045:return this._native2.getParameterx(e)?.deepUnpack()|0;case 35977:case 36388:case 36387:return!!this._native2.getParameterx(e)?.deepUnpack()}return super.getParameter(e)}getStringi(e,t){let n=this._native2.getStringi(e,t);return n.length>0?n:null}renderbufferStorage(e,t,n,r){if(e!==this.RENDERBUFFER){this.setError(this.INVALID_ENUM);return}let i=this._activeRenderbuffer;if(!i){this.setError(this.INVALID_OPERATION);return}if(n<0||r<0){this.setError(this.INVALID_VALUE);return}for(;this._gl.getError()!==this.NO_ERROR;);if(this._gl.renderbufferStorage(e,t,n,r),this._gl.getError()!==this.NO_ERROR)return;i._width=n,i._height=r,i._format=t;let a=this._activeFramebuffer;if(a){let e=this._getAttachments(),t=!1;for(let n=0;n<e.length;++n)if(a._attachments[e[n]]===i){t=!0;break}t&&this._updateFramebufferAttachments(a)}}getSupportedExtensions(){let e=super.getSupportedExtensions();for(let t of[`EXT_color_buffer_float`,`EXT_color_buffer_half_float`,`OES_texture_half_float`])e.indexOf(t)===-1&&e.push(t);return e}readPixels(e,t,n,r,i,a,o){if(!o)return;if(n<0||r<0){this.setError(this.INVALID_VALUE);return}if(!this._framebufferOk())return;let s=i===6408||i===32856?4:i===6407?3:i===33319?2:1,c=a===5126?4:a===5131||a===36193?2:a===5125||a===5124?4:a===5123||a===5122?2:1,l=n*r*s*c,u=new Uint8Array(l);this._saveError();let d=this._gl.readPixels(e,t,n,r,i,a,Uint8ArrayToVariant(u)),f=this.getError();if(this._restoreError(f),f!==this.NO_ERROR)return;let p=d&&d.length>0?d:u;if(o instanceof Uint8Array)o.set(p);else if(o instanceof Float32Array){let e=new Float32Array(p.buffer,0,o.length);o.set(e)}}_framebufferOk(){return!0}};installObjectLifecycleMethods(Ar.prototype),installTexImage3DMethods(Ar.prototype),installUniformMethods(Ar.prototype),installClearBufferMethods(Ar.prototype),installInstancedAndFramebufferOpsMethods(Ar.prototype);function notifyElementResize(e,t,n){e._allocatedClientWidth=t,e._allocatedClientHeight=n,e._fireResizeSubscribers(t,n);let r=e.parentNode;for(;r;)r instanceof Element&&(r._allocatedClientWidth=t,r._allocatedClientHeight=n,r._fireResizeSubscribers(t,n)),r=r.parentNode}var HTMLCanvasElement$1=class extends Be{static{__name$1(this,`HTMLCanvasElement`)}constructor(e){super(),this.gtkGlArea=e}get width(){return this.gtkGlArea.get_allocated_width()*this.scaleFactor}set width(e){}get height(){return this.gtkGlArea.get_allocated_height()*this.scaleFactor}set height(e){}get scaleFactor(){return this.gtkGlArea.get_scale_factor()||1}get clientWidth(){return this.gtkGlArea.get_allocated_width()}get clientHeight(){return this.gtkGlArea.get_allocated_height()}get offsetWidth(){return this.clientWidth}get offsetHeight(){return this.clientHeight}getGlArea(){return this.gtkGlArea}_createCloneTarget(){let e=new Be;return e.width=this.width,e.height=this.height,e}getContext(e,t){return e===`webgl`||e===`experimental-webgl`?(this._webgl||=(this.gtkGlArea.make_current(),new WebGLRenderingContext$1(this,t)),this._webgl):e===`webgl2`?(this._webgl2||=(this.gtkGlArea.make_current(),new Ar(this,t)),this._webgl2):super.getContext(e,t)}};const jr=[`apple software renderer`,`llvmpipe`,`softpipe`,`swrast`,`swiftshader`,`microsoft basic render driver`,`mesa offscreen`];function isSoftwareRenderer(e){if(!e)return!1;let t=e.toLowerCase();return jr.some(e=>t.includes(e))}const Mr={Return:`Enter`,KP_Enter:`Enter`,Tab:`Tab`,ISO_Left_Tab:`Tab`,BackSpace:`Backspace`,Escape:`Escape`,Delete:`Delete`,KP_Delete:`Delete`,Insert:`Insert`,KP_Insert:`Insert`,Home:`Home`,KP_Home:`Home`,End:`End`,KP_End:`End`,Page_Up:`PageUp`,KP_Page_Up:`PageUp`,Page_Down:`PageDown`,KP_Page_Down:`PageDown`,Left:`ArrowLeft`,KP_Left:`ArrowLeft`,Up:`ArrowUp`,KP_Up:`ArrowUp`,Right:`ArrowRight`,KP_Right:`ArrowRight`,Down:`ArrowDown`,KP_Down:`ArrowDown`,Shift_L:`Shift`,Shift_R:`Shift`,Control_L:`Control`,Control_R:`Control`,Alt_L:`Alt`,Alt_R:`Alt`,Super_L:`Meta`,Super_R:`Meta`,Meta_L:`Meta`,Meta_R:`Meta`,Caps_Lock:`CapsLock`,Num_Lock:`NumLock`,Scroll_Lock:`ScrollLock`,Print:`PrintScreen`,Pause:`Pause`,Menu:`ContextMenu`,space:` `,F1:`F1`,F2:`F2`,F3:`F3`,F4:`F4`,F5:`F5`,F6:`F6`,F7:`F7`,F8:`F8`,F9:`F9`,F10:`F10`,F11:`F11`,F12:`F12`,KP_Add:`+`,KP_Subtract:`-`,KP_Multiply:`*`,KP_Divide:`/`,KP_Decimal:`.`,KP_Separator:`,`,KP_0:`0`,KP_1:`1`,KP_2:`2`,KP_3:`3`,KP_4:`4`,KP_5:`5`,KP_6:`6`,KP_7:`7`,KP_8:`8`,KP_9:`9`},Nr={Return:`Enter`,KP_Enter:`NumpadEnter`,Tab:`Tab`,ISO_Left_Tab:`Tab`,BackSpace:`Backspace`,Escape:`Escape`,Delete:`Delete`,KP_Delete:`NumpadDecimal`,Insert:`Insert`,KP_Insert:`Numpad0`,Home:`Home`,KP_Home:`Numpad7`,End:`End`,KP_End:`Numpad1`,Page_Up:`PageUp`,KP_Page_Up:`Numpad9`,Page_Down:`PageDown`,KP_Page_Down:`Numpad3`,Left:`ArrowLeft`,KP_Left:`Numpad4`,Up:`ArrowUp`,KP_Up:`Numpad8`,Right:`ArrowRight`,KP_Right:`Numpad6`,Down:`ArrowDown`,KP_Down:`Numpad2`,Shift_L:`ShiftLeft`,Shift_R:`ShiftRight`,Control_L:`ControlLeft`,Control_R:`ControlRight`,Alt_L:`AltLeft`,Alt_R:`AltRight`,Super_L:`MetaLeft`,Super_R:`MetaRight`,Meta_L:`MetaLeft`,Meta_R:`MetaRight`,Caps_Lock:`CapsLock`,Num_Lock:`NumLock`,Scroll_Lock:`ScrollLock`,Print:`PrintScreen`,Pause:`Pause`,Menu:`ContextMenu`,space:`Space`,F1:`F1`,F2:`F2`,F3:`F3`,F4:`F4`,F5:`F5`,F6:`F6`,F7:`F7`,F8:`F8`,F9:`F9`,F10:`F10`,F11:`F11`,F12:`F12`,KP_Add:`NumpadAdd`,KP_Subtract:`NumpadSubtract`,KP_Multiply:`NumpadMultiply`,KP_Divide:`NumpadDivide`,KP_Decimal:`NumpadDecimal`,KP_Separator:`NumpadComma`,KP_0:`Numpad0`,KP_1:`Numpad1`,KP_2:`Numpad2`,KP_3:`Numpad3`,KP_4:`Numpad4`,KP_5:`Numpad5`,KP_6:`Numpad6`,KP_7:`Numpad7`,KP_8:`Numpad8`,KP_9:`Numpad9`};function gdkKeyvalToKey(e){let t=_t.keyval_name(e);if(t&&Mr[t])return Mr[t];let n=_t.keyval_to_unicode(e);return n>0?String.fromCodePoint(n):t??`Unidentified`}function gdkKeyvalToCode(e){let t=_t.keyval_name(e);if(t&&Nr[t])return Nr[t];let n=_t.keyval_to_unicode(e);if(n>=97&&n<=122)return`Key`+String.fromCodePoint(n-32);if(n>=65&&n<=90)return`Key`+String.fromCodePoint(n);if(n>=48&&n<=57)return`Digit`+String.fromCodePoint(n);if(t){let e={minus:`Minus`,equal:`Equal`,bracketleft:`BracketLeft`,bracketright:`BracketRight`,backslash:`Backslash`,semicolon:`Semicolon`,apostrophe:`Quote`,grave:`Backquote`,comma:`Comma`,period:`Period`,slash:`Slash`};if(e[t])return e[t]}return t??`Unidentified`}function gdkKeyvalToLocation(e){let t=_t.keyval_name(e);return t?t.startsWith(`KP_`)?3:t.endsWith(`_L`)?1:t.endsWith(`_R`)?2:0:0}const Pr=.5;var TouchPointerTranslator=class{constructor(e,t){this.getElement=e,this.getWindowTarget=t,this.active=new Map,this.nextId=2}get activeCount(){return this.active.size}handle(e){switch(e.phase){case`begin`:this.begin(e);break;case`update`:this.update(e);break;case`end`:this.end(e);break;case`cancel`:this.cancel(e);break}}cancelAll(e){for(let[t,n]of this.active)this.cancel({...e,phase:`cancel`,key:t,x:n.lastX,y:n.lastY,isPrimary:n.isPrimary})}begin(e){this.active.has(e.key)&&this.cancel(e);let t=this.getElement();if(!t)return;let n={id:this.nextId++,isPrimary:e.isPrimary,lastX:e.x,lastY:e.y,preventMouse:!1};this.active.set(e.key,n);let r=this.pointerInit(e,n,-1,0,0),i=this.mouseInit(e,0,0);n.isPrimary&&t.dispatchEvent(new MouseEvent(`mousemove`,i)),t.dispatchEvent(new PointerEvent(`pointerover`,r)),t.dispatchEvent(new PointerEvent(`pointerenter`,{...r,bubbles:!1,cancelable:!1})),n.isPrimary&&(t.dispatchEvent(new MouseEvent(`mouseover`,i)),t.dispatchEvent(new MouseEvent(`mouseenter`,{...i,bubbles:!1,cancelable:!1})));let a=new PointerEvent(`pointerdown`,this.pointerInit(e,n,0,1,Pr));t.dispatchEvent(a),n.isPrimary&&(n.preventMouse=a.defaultPrevented,n.preventMouse||t.dispatchEvent(new MouseEvent(`mousedown`,{...this.mouseInit(e,0,1),detail:1})))}update(e){let t=this.active.get(e.key);if(!t)return;let n=this.getElement();if(!n)return;let r=e.x-t.lastX,i=e.y-t.lastY;t.lastX=e.x,t.lastY=e.y,n.dispatchEvent(new PointerEvent(`pointermove`,{...this.pointerInit(e,t,-1,1,Pr),movementX:r,movementY:i})),t.isPrimary&&!t.preventMouse&&n.dispatchEvent(new MouseEvent(`mousemove`,{...this.mouseInit(e,0,1),movementX:r,movementY:i}))}end(e){let t=this.active.get(e.key);if(!t)return;this.active.delete(e.key);let n=this.getElement();if(!n)return;let r=this.pointerInit(e,t,0,0,0),i=this.mouseInit(e,0,0),a=t.isPrimary&&!t.preventMouse;n.dispatchEvent(new PointerEvent(`pointerup`,r)),a&&n.dispatchEvent(new MouseEvent(`mouseup`,{...i,detail:1})),this.leave(n,t,{...r,button:-1},i),t.isPrimary&&n.dispatchEvent(new PointerEvent(`click`,{...r,detail:1}))}cancel(e){let t=this.active.get(e.key);if(!t)return;this.active.delete(e.key);let n=this.getElement();if(!n)return;let r={...e,x:t.lastX,y:t.lastY},i=this.pointerInit(r,t,-1,0,0),a=this.mouseInit(r,0,0);n.dispatchEvent(new PointerEvent(`pointercancel`,{...i,cancelable:!1})),t.isPrimary&&!t.preventMouse&&this.getWindowTarget()?.dispatchEvent(new MouseEvent(`mouseup`,{...a,detail:1})),this.leave(n,t,i,a)}leave(e,t,n,r){e.dispatchEvent(new PointerEvent(`pointerout`,n)),e.dispatchEvent(new PointerEvent(`pointerleave`,{...n,bubbles:!1,cancelable:!1})),t.isPrimary&&(e.dispatchEvent(new MouseEvent(`mouseout`,r)),e.dispatchEvent(new MouseEvent(`mouseleave`,{...r,bubbles:!1,cancelable:!1})))}mouseInit(e,t,n){return{shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,clientX:e.x,clientY:e.y,offsetX:e.x,offsetY:e.y,screenX:e.x,screenY:e.y,button:t,buttons:n,bubbles:!0,cancelable:!0}}pointerInit(e,t,n,r,i){return{...this.mouseInit(e,n,r),pointerId:t.id,pointerType:`touch`,isPrimary:t.isPrimary,pressure:i}}};const Fr=new Map([[_t.EventType.TOUCH_BEGIN,`begin`],[_t.EventType.TOUCH_UPDATE,`update`],[_t.EventType.TOUCH_END,`end`],[_t.EventType.TOUCH_CANCEL,`cancel`]]);function isTouchEvent(e){return e!==null&&Fr.has(e.get_event_type())}function pointerTypeOf(e){let t=e?.get_device()?.get_source();return t===_t.InputSource.TOUCHSCREEN?`touch`:t===_t.InputSource.PEN?`pen`:`mouse`}let Ir=!1;function sequenceKey(e,t){if(e===null)return t?`primary`:`secondary`;let n=String(e),r=n.lastIndexOf(`native@`);return r!==-1&&n.endsWith(`]`)?n.slice(r+7,-1):(Ir||(Ir=!0,console.warn(`@gjsify/event-bridge: GdkEventSequence identity is not readable on this runtime; touch pointers are keyed by the emulating-pointer flag, so a third concurrent contact merges with the second.`)),t?`primary`:`secondary`)}function surfaceToWidget(e,t,n){let r=e.get_native(),[i,a]=r.get_surface_transform(),o=t-i,s=n-a,[c,l]=r.compute_point(e,new On.Point({x:o,y:s}));return c?[l.x,l.y]:[o,s]}function getGlobalEventTarget(){return globalThis.__gjsify_globalEventTarget}const Lr={shiftKey:!1,ctrlKey:!1,altKey:!1,metaKey:!1};function modifiersFromState(e){return{shiftKey:!!(e&_t.ModifierType.SHIFT_MASK),ctrlKey:!!(e&_t.ModifierType.CONTROL_MASK),altKey:!!(e&_t.ModifierType.ALT_MASK),metaKey:!!(e&_t.ModifierType.SUPER_MASK)}}function extractModifiers(e){return modifiersFromState(e.get_current_event_state())}function gtkButtonToDom(e){return e===1?0:e===2?1:e===3?2:e-1}function buttonsFromModifiers(e){let t=e.get_current_event_state(),n=0;return t&_t.ModifierType.BUTTON1_MASK&&(n|=1),t&_t.ModifierType.BUTTON3_MASK&&(n|=2),t&_t.ModifierType.BUTTON2_MASK&&(n|=4),n}function attachEventControllers(e,t,n){e.set_focusable(!0),e.set_can_focus(!0);let r={lastX:0,lastY:0,buttonsPressed:0,pressedKeys:new Set},i=new TouchPointerTranslator(t,()=>getGlobalEventTarget()),a=new xn.EventControllerMotion;a.connect(`motion`,(n,i,o)=>{let s=t();if(!s)return;let c=e.get_allocated_width(),l=e.get_allocated_height(),u=Math.max(0,Math.min(i,c)),d=Math.max(0,Math.min(o,l)),f=u-r.lastX,p=d-r.lastY,m=extractModifiers(a),h=buttonsFromModifiers(a),g={...m,clientX:u,clientY:d,offsetX:u,offsetY:d,screenX:u,screenY:d,movementX:f,movementY:p,buttons:h,button:0,bubbles:!0,cancelable:!0};s.dispatchEvent(new PointerEvent(`pointermove`,{...g,pointerId:1,pointerType:pointerTypeOf(a.get_current_event()),isPrimary:!0})),s.dispatchEvent(new MouseEvent(`mousemove`,g)),r.lastX=u,r.lastY=d}),a.connect(`enter`,(e,n,i)=>{let o=t();if(!o)return;r.lastX=n,r.lastY=i;let s={...extractModifiers(a),clientX:n,clientY:i,offsetX:n,offsetY:i,screenX:n,screenY:i,bubbles:!1,cancelable:!1};o.dispatchEvent(new PointerEvent(`pointerenter`,{...s,pointerId:1,pointerType:pointerTypeOf(a.get_current_event()),isPrimary:!0})),o.dispatchEvent(new MouseEvent(`mouseenter`,s)),o.dispatchEvent(new MouseEvent(`mouseover`,{...s,bubbles:!0}))}),a.connect(`leave`,()=>{let e=t();if(!e)return;let n={...extractModifiers(a),clientX:r.lastX,clientY:r.lastY,bubbles:!1,cancelable:!1};e.dispatchEvent(new PointerEvent(`pointerleave`,{...n,pointerId:1,pointerType:pointerTypeOf(a.get_current_event()),isPrimary:!0})),e.dispatchEvent(new MouseEvent(`mouseleave`,n)),e.dispatchEvent(new MouseEvent(`mouseout`,{...n,bubbles:!0}))}),e.add_controller(a);let o=new xn.GestureClick;o.set_button(0),o.connect(`pressed`,(n,i,a,s)=>{if(isTouchEvent(o.get_current_event()))return;let c=t();if(!c)return;let l=gtkButtonToDom(o.get_current_button()),u=extractModifiers(o);r.buttonsPressed|=1<<l;let d={...u,clientX:a,clientY:s,offsetX:a,offsetY:s,screenX:a,screenY:s,button:l,buttons:r.buttonsPressed,detail:i,bubbles:!0,cancelable:!0};c.dispatchEvent(new PointerEvent(`pointerdown`,{...d,pointerId:1,pointerType:pointerTypeOf(o.get_current_event()),isPrimary:!0})),c.dispatchEvent(new MouseEvent(`mousedown`,d)),e.grab_focus()}),o.connect(`released`,(e,n,i,a)=>{if(isTouchEvent(o.get_current_event()))return;let s=t();if(!s)return;let c=gtkButtonToDom(o.get_current_button()),l=extractModifiers(o);r.buttonsPressed&=~(1<<c);let u={...l,clientX:i,clientY:a,offsetX:i,offsetY:a,screenX:i,screenY:a,button:c,buttons:r.buttonsPressed,detail:n,bubbles:!0,cancelable:!0};s.dispatchEvent(new PointerEvent(`pointerup`,{...u,pointerId:1,pointerType:pointerTypeOf(o.get_current_event()),isPrimary:!0})),s.dispatchEvent(new MouseEvent(`mouseup`,u)),c===0&&(s.dispatchEvent(new MouseEvent(`click`,u)),n===2&&s.dispatchEvent(new MouseEvent(`dblclick`,u))),c===2&&s.dispatchEvent(new MouseEvent(`contextmenu`,{...u,cancelable:!0}))}),o.connect(`cancel`,(e,n)=>{let i=o.get_last_event(n);if(isTouchEvent(i)||r.buttonsPressed===0)return;r.buttonsPressed=0;let a=t();a&&a.dispatchEvent(new PointerEvent(`pointercancel`,{...extractModifiers(o),clientX:r.lastX,clientY:r.lastY,offsetX:r.lastX,offsetY:r.lastY,screenX:r.lastX,screenY:r.lastY,button:-1,buttons:0,pointerId:1,pointerType:pointerTypeOf(i),isPrimary:!0,bubbles:!0,cancelable:!1}))}),e.add_controller(o);let s=new xn.EventControllerScroll({flags:xn.EventControllerScrollFlags.BOTH_AXES});s.connect(`scroll`,(e,n,i)=>{let a=t();if(!a)return;let o=extractModifiers(s),c=s.get_unit()===_t.ScrollUnit.WHEEL,l=c?3:1,u={...o,clientX:r.lastX,clientY:r.lastY,offsetX:r.lastX,offsetY:r.lastY,screenX:r.lastX,screenY:r.lastY,deltaX:n*l,deltaY:i*l,deltaZ:0,deltaMode:c?WheelEvent.DOM_DELTA_LINE:WheelEvent.DOM_DELTA_PIXEL,bubbles:!0,cancelable:!0};return a.dispatchEvent(new WheelEvent(`wheel`,u)),!1}),e.add_controller(s);let c=new xn.EventControllerKey;c.connect(`key-pressed`,(e,i,a,o)=>{let s=t();if(!s)return!1;let c=r.pressedKeys.has(i);r.pressedKeys.add(i);let l=gdkKeyvalToKey(i),u={key:l,code:gdkKeyvalToCode(i),location:gdkKeyvalToLocation(i),repeat:c,altKey:!!(o&_t.ModifierType.ALT_MASK),ctrlKey:!!(o&_t.ModifierType.CONTROL_MASK),metaKey:!!(o&_t.ModifierType.SUPER_MASK),shiftKey:!!(o&_t.ModifierType.SHIFT_MASK),keyCode:l.length===1?l.toUpperCase().charCodeAt(0):0,which:l.length===1?l.toUpperCase().charCodeAt(0):0,bubbles:!0,cancelable:!0},d=new KeyboardEvent(`keydown`,u);return s.dispatchEvent(d),getGlobalEventTarget()?.dispatchEvent(new KeyboardEvent(`keydown`,u)),n?.captureKeys===!0}),c.connect(`key-released`,(e,n,i,a)=>{let o=t();if(!o)return;r.pressedKeys.delete(n);let s=gdkKeyvalToKey(n),c={key:s,code:gdkKeyvalToCode(n),location:gdkKeyvalToLocation(n),repeat:!1,altKey:!!(a&_t.ModifierType.ALT_MASK),ctrlKey:!!(a&_t.ModifierType.CONTROL_MASK),metaKey:!!(a&_t.ModifierType.SUPER_MASK),shiftKey:!!(a&_t.ModifierType.SHIFT_MASK),keyCode:s.length===1?s.toUpperCase().charCodeAt(0):0,which:s.length===1?s.toUpperCase().charCodeAt(0):0,bubbles:!0,cancelable:!0};o.dispatchEvent(new KeyboardEvent(`keyup`,c)),getGlobalEventTarget()?.dispatchEvent(new KeyboardEvent(`keyup`,c))}),e.add_controller(c);let l=new xn.EventControllerFocus;l.connect(`enter`,()=>{let e=t();e&&(e.dispatchEvent(new FocusEvent(`focus`,{bubbles:!1,cancelable:!1})),e.dispatchEvent(new FocusEvent(`focusin`,{bubbles:!0,cancelable:!1})))}),l.connect(`leave`,()=>{let e=t();e&&(r.pressedKeys.clear(),e.dispatchEvent(new FocusEvent(`blur`,{bubbles:!1,cancelable:!1})),e.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,cancelable:!1})),getGlobalEventTarget()?.dispatchEvent(new FocusEvent(`blur`,{bubbles:!1,cancelable:!1})))}),e.add_controller(l);let u=new xn.EventControllerLegacy;u.connect(`event`,(t,n)=>{let r=n.get_event_type(),a=Fr.get(r);if(a===void 0)return r===_t.EventType.GRAB_BROKEN&&i.activeCount>0&&n.get_grab_surface()!==e.get_native().get_surface()&&i.cancelAll(modifiersFromState(n.get_modifier_state())),!1;let[,o,s]=n.get_position(),[c,l]=surfaceToWidget(e,o,s),u=n.get_emulating_pointer();return i.handle({...modifiersFromState(n.get_modifier_state()),phase:a,key:sequenceKey(n.get_event_sequence(),u),x:c,y:l,isPrimary:u}),a===`begin`&&e.grab_focus(),!1}),e.add_controller(u),e.connect(`unmap`,()=>i.cancelAll(Lr)),e.connect(`state-flags-changed`,(t,n)=>{let r=xn.StateFlags.INSENSITIVE;e.get_state_flags()&r&&!(n&r)&&i.cancelAll(Lr)})}const Rr=jn.registerClass({GTypeName:`GjsifyWebGLBridge`},class WebGLBridge extends xn.GLArea{constructor(e){super(e),this._canvas=null,this._readyCallbacks=[],this._resizeCallbacks=[],this._renderTag=null,this._tickCallbackId=null,this._frameCallback=null,this._lastFrameCallback=null,this._lastFrameTime=0,this._replaying=!1,this._frameCallbackId=0,this._nextFrameId=1,this._timeOrigin=mt.get_monotonic_time(),this._rendererInfo=null,this.set_allowed_apis(_t.GLAPI.GL|_t.GLAPI.GLES),this.set_required_version(3,2),this.set_has_depth_buffer(!0),this.set_has_stencil_buffer(!0),attachEventControllers(this,()=>this._canvas,{captureKeys:!0}),this._tickCallbackId=this.add_tick_callback((e,t)=>(this._frameCallback!==null&&this.queue_render(),mt.SOURCE_CONTINUE));let t=this.connect(`render`,()=>{this.disconnect(t),this.make_current(),this._canvas=new HTMLCanvasElement$1(this);{let e=globalThis;e.document?.body&&e.document.body.appendChild(this._canvas)}this._canvas.getContext(`webgl2`);let e=this._canvas.getContext(`webgl`);if(e){this._reportRenderer(e);for(let t of this._readyCallbacks)t(this._canvas,e);this._readyCallbacks=[]}return this._renderTag=this.connect(`render`,e=>{let t=(mt.get_monotonic_time()-this._timeOrigin)/1e3;if(this._frameCallback!==null){globalThis.__GJSIFY_DEBUG_RAF===!0&&console.log(`[rAF] frame callback fires t=${t.toFixed(1)}`);let e=this._frameCallback;this._frameCallback=null,this._frameCallbackId=0,this._lastFrameCallback=e,this._lastFrameTime=t,e(t)}else if(this._lastFrameCallback!==null){this._replaying=!0;try{this._lastFrameCallback(this._lastFrameTime)}finally{this._replaying=!1}}return!0}),!0});this.connect(`resize`,()=>{let e=this.get_allocated_width(),t=this.get_allocated_height();this._canvas&&(this._canvas.dispatchEvent(new Event(`resize`)),notifyElementResize(this._canvas,e,t));for(let n of this._resizeCallbacks)n(e,t);this._frameCallback&&this.requestAnimationFrame(this._frameCallback)}),this.connect(`unrealize`,()=>{this._renderTag!==null&&(this.disconnect(this._renderTag),this._renderTag=null),this._tickCallbackId!==null&&(this.remove_tick_callback(this._tickCallbackId),this._tickCallbackId=null),this._frameCallback=null,this._lastFrameCallback=null,this._lastFrameTime=0,this._replaying=!1,this._canvas=null})}get canvas(){return this._canvas}get rendererInfo(){return this._rendererInfo}onReady(e){if(this._canvas){let t=this._canvas.getContext(`webgl`);if(t){e(this._canvas,t);return}}this._readyCallbacks.push(e)}onWebGLReady(e){this.onReady(e)}_reportRenderer(e){let t=e.getExtension(`WEBGL_debug_renderer_info`),n=String(e.getParameter(t.UNMASKED_VENDOR_WEBGL)??``),r=String(e.getParameter(t.UNMASKED_RENDERER_WEBGL)??``);this._rendererInfo={vendor:n,renderer:r},isSoftwareRenderer(r)&&console.warn(`[@gjsify/webgl] GL is rasterised on the CPU by "${r}" (${n}) — this host exposes no usable GPU. Every draw call still works; fill-heavy or continuously animating content will be orders of magnitude slower than on hardware, which can look like a frozen window rather than a slow one. Read it yourself via WebGLBridge.rendererInfo or the WEBGL_debug_renderer_info extension.`)}onResize(e){this._resizeCallbacks.push(e)}requestAnimationFrame(e){let t=this._nextFrameId++;return this._replaying?t:(this._frameCallback=e,this._frameCallbackId=t,this.queue_render(),t)}cancelAnimationFrame(e){e!==0&&e===this._frameCallbackId&&(this._frameCallback=null,this._frameCallbackId=0,this._lastFrameCallback=null,this._lastFrameTime=0)}installGlobals(){let e=globalThis;e.requestAnimationFrame=e=>this.requestAnimationFrame(e),e.cancelAnimationFrame=e=>this.cancelAnimationFrame(e),e.WebGLRenderingContext=WebGLRenderingContext$1,e.WebGL2RenderingContext=Ar,Object.defineProperty(globalThis,"devicePixelRatio",{get:()=>this.get_scale_factor()||1,configurable:!0});let t=this._timeOrigin;e.performance={now:()=>(mt.get_monotonic_time()-t)/1e3,timeOrigin:Date.now()}}}),zr={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Br={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Vr=1e3,Hr=1001,Ur=1002,Wr=1003,Gr=1006,Kr=1008,qr=1009,Jr=1012,Yr=1014,Xr=1015,Zr=1016,Qr=1017,$r=1018,ei=1020,ti=1023,ni=1026,ri=1027,ii=1029,ai=1030,oi=1031,si=1033,ci=2300,li=2301,ui=2302,di=2303,fi=2400,pi=2401,mi=2402,hi=`srgb`,gi=`srgb-linear`,_i=`linear`,vi=`srgb`,yi=7680,bi=2e3
|
|
98
|
+
`),this._gl.compileShader(t);let n=!!this._gl.getShaderParameter(t,this.COMPILE_STATUS);this._gl.deleteShader(t),n||(e=this._desktopGlslVersion())}return this._esDerivativesDesktopGlsl=e,e}_checkOwns(e){return typeof e==`object`&&!!e&&e._ctx===this}_checkValid(e,t){return e instanceof t&&e._!==0}_checkWrapper(e,t){return this._checkValid(e,t)?this._checkOwns(e)?!0:(this.setError(this.INVALID_OPERATION),!1):(this.setError(this.INVALID_VALUE),!1)}_isObject(e,t,n){if(e!=null&&!(e instanceof n))throw TypeError(t+`(`+n.name+`)`);return!!(this._checkValid(e,n)&&this._checkOwns(e))}_checkStencilState(){return this._checkStencil?(this._checkStencil=!1,this._stencilState=!0,(this.getParameter(this.STENCIL_WRITEMASK)!==this.getParameter(this.STENCIL_BACK_WRITEMASK)||this.getParameter(this.STENCIL_VALUE_MASK)!==this.getParameter(this.STENCIL_BACK_VALUE_MASK)||this.getParameter(this.STENCIL_REF)!==this.getParameter(this.STENCIL_BACK_REF))&&(this.setError(this.INVALID_OPERATION),this._stencilState=!1),this._stencilState):this._stencilState}_validGLSLIdentifier(e){return!(e.indexOf(`webgl_`)===0||e.indexOf(`_webgl_`)===0||e.length>256)}_getParameterDirect(e){return this._gl.getParameterx(e)?.deepUnpack()}getContextAttributes(){return this._contextAttributes}getExtension(e){let t=e.toLowerCase();if(t in this._extensions)return this._extensions[t];let n=fr[t]?fr[t](this):null;return n&&(this._extensions[t]=n),n}getSupportedExtensions(){let e=[`ANGLE_instanced_arrays`,`STACKGL_resize_drawingbuffer`,`STACKGL_destroy_context`,`WEBGL_debug_renderer_info`],t=this._gl.getSupportedExtensions()??[];return(t.indexOf(`GL_OES_element_index_uint`)>=0||this._atLeastGlVersion(1,1))&&e.push(`OES_element_index_uint`),(t.indexOf(`GL_OES_standard_derivatives`)>=0||this._atLeastGlVersion(2,0))&&e.push(`OES_standard_derivatives`),(t.indexOf(`GL_OES_texture_float`)>=0||this._atLeastGlVersion(3,0))&&e.push(`OES_texture_float`),(t.indexOf(`GL_OES_texture_float_linear`)>=0||this._atLeastGlVersion(3,0))&&e.push(`OES_texture_float_linear`),(t.indexOf(`GL_OES_texture_half_float`)>=0||t.indexOf(`GL_ARB_half_float_pixel`)>=0)&&e.push(`OES_texture_half_float`),(t.indexOf(`GL_EXT_color_buffer_float`)>=0||t.indexOf(`GL_ARB_color_buffer_float`)>=0)&&e.push(`EXT_color_buffer_float`),t.indexOf(`GL_EXT_color_buffer_half_float`)>=0&&e.push(`EXT_color_buffer_half_float`),t.indexOf(`EXT_draw_buffers`)>=0&&e.push(`WEBGL_draw_buffers`),(t.indexOf(`GL_EXT_blend_minmax`)>=0||this._atLeastGlVersion(1,4))&&e.push(`EXT_blend_minmax`),(t.indexOf(`GL_EXT_texture_filter_anisotropic`)>=0||t.indexOf(`GL_ARB_texture_filter_anisotropic`)>=0||this._atLeastGlVersion(4,6))&&e.push(`EXT_texture_filter_anisotropic`),t.indexOf(`GL_OES_vertex_array_object`)>=0&&e.push(`OES_vertex_array_object`),e}getParameter(e=0){switch(e){case this.ARRAY_BUFFER_BINDING:return this._vertexGlobalState._arrayBufferBinding;case this.ELEMENT_ARRAY_BUFFER_BINDING:return this._vertexObjectState._elementArrayBufferBinding;case this.CURRENT_PROGRAM:return this._activeProgram;case this.FRAMEBUFFER_BINDING:return this._activeFramebuffer;case this.RENDERBUFFER_BINDING:return this._activeRenderbuffer;case this.TEXTURE_BINDING_2D:return this._getActiveTextureUnit()._bind2D;case this.TEXTURE_BINDING_CUBE_MAP:return this._getActiveTextureUnit()._bindCube;case this.VERSION:return`WebGL 1.0 0.0.1`;case this.VENDOR:return``;case this.RENDERER:return`ANGLE`;case 37445:return this._gl.getString(7936);case 37446:return this._gl.getString(7937);case this.SHADING_LANGUAGE_VERSION:return`WebGL GLSL ES 1.0 `;case this.COMPRESSED_TEXTURE_FORMATS:return new Uint32Array;case this.SCISSOR_BOX:return new Int32Array(this._scissorBox);case this.VIEWPORT:return new Int32Array(this._viewport);case this.MAX_VIEWPORT_DIMS:return new Int32Array([32767,32767]);case this.ALIASED_LINE_WIDTH_RANGE:case this.ALIASED_POINT_SIZE_RANGE:return new Float32Array([1,1]);case this.DEPTH_RANGE:return new Float32Array([0,1]);case this.BLEND_COLOR:case this.COLOR_CLEAR_VALUE:return new Float32Array(this._gl.getParameterfv(e,4));case this.COLOR_WRITEMASK:{let t=this._gl.getParameteriv(e,4);return[!!t[0],!!t[1],!!t[2],!!t[3]]}case this.DEPTH_CLEAR_VALUE:case this.LINE_WIDTH:case this.POLYGON_OFFSET_FACTOR:case this.POLYGON_OFFSET_UNITS:case this.SAMPLE_COVERAGE_VALUE:return this._gl.getParameterf(e);case this.BLEND:case this.CULL_FACE:case this.DEPTH_TEST:case this.DEPTH_WRITEMASK:case this.DITHER:case this.POLYGON_OFFSET_FILL:case this.SAMPLE_COVERAGE_INVERT:case this.SCISSOR_TEST:case this.STENCIL_TEST:case this.UNPACK_PREMULTIPLY_ALPHA_WEBGL:return!!this._gl.getParameteri(e);case this.UNPACK_FLIP_Y_WEBGL:return this._unpackFlipY;case this.GENERATE_MIPMAP_HINT:return this._generateMipmapHint;case this.ACTIVE_TEXTURE:case this.ALPHA_BITS:case this.BLEND_DST_ALPHA:case this.BLEND_DST_RGB:case this.BLEND_EQUATION_ALPHA:case this.BLEND_EQUATION_RGB:case this.BLEND_SRC_ALPHA:case this.BLEND_SRC_RGB:case this.BLUE_BITS:case this.CULL_FACE_MODE:case this.DEPTH_BITS:case this.DEPTH_FUNC:case this.FRONT_FACE:case this.GREEN_BITS:return this._gl.getParameteri(e);case this.MAX_RENDERBUFFER_SIZE:return this._maxRenderbufferSize;case this.MAX_COMBINED_TEXTURE_IMAGE_UNITS:case this.MAX_CUBE_MAP_TEXTURE_SIZE:case this.MAX_FRAGMENT_UNIFORM_VECTORS:case this.MAX_TEXTURE_IMAGE_UNITS:case this.MAX_TEXTURE_SIZE:case this.MAX_VARYING_VECTORS:case this.MAX_VERTEX_ATTRIBS:case this.MAX_VERTEX_TEXTURE_IMAGE_UNITS:case this.MAX_VERTEX_UNIFORM_VECTORS:case this.PACK_ALIGNMENT:case this.RED_BITS:case this.SAMPLE_BUFFERS:case this.SAMPLES:case this.STENCIL_BACK_FAIL:case this.STENCIL_BACK_FUNC:case this.STENCIL_BACK_PASS_DEPTH_FAIL:case this.STENCIL_BACK_PASS_DEPTH_PASS:case this.STENCIL_BACK_REF:case this.STENCIL_BACK_VALUE_MASK:case this.STENCIL_BACK_WRITEMASK:case this.STENCIL_BITS:case this.STENCIL_CLEAR_VALUE:case this.STENCIL_FAIL:case this.STENCIL_FUNC:case this.STENCIL_PASS_DEPTH_FAIL:case this.STENCIL_PASS_DEPTH_PASS:case this.STENCIL_REF:case this.STENCIL_VALUE_MASK:case this.STENCIL_WRITEMASK:case this.SUBPIXEL_BITS:case this.UNPACK_ALIGNMENT:case this.UNPACK_COLORSPACE_CONVERSION_WEBGL:return this._gl.getParameteri(e);case this.IMPLEMENTATION_COLOR_READ_FORMAT:case this.IMPLEMENTATION_COLOR_READ_TYPE:return this._getParameterDirect(e);default:if(this._extensions.webgl_draw_buffers){let t=this._extensions.webgl_draw_buffers;switch(e){case t.DRAW_BUFFER0_WEBGL:case t.DRAW_BUFFER1_WEBGL:case t.DRAW_BUFFER2_WEBGL:case t.DRAW_BUFFER3_WEBGL:case t.DRAW_BUFFER4_WEBGL:case t.DRAW_BUFFER5_WEBGL:case t.DRAW_BUFFER6_WEBGL:case t.DRAW_BUFFER7_WEBGL:case t.DRAW_BUFFER8_WEBGL:case t.DRAW_BUFFER9_WEBGL:case t.DRAW_BUFFER10_WEBGL:case t.DRAW_BUFFER11_WEBGL:case t.DRAW_BUFFER12_WEBGL:case t.DRAW_BUFFER13_WEBGL:case t.DRAW_BUFFER14_WEBGL:case t.DRAW_BUFFER15_WEBGL:return t._buffersState.length===1&&t._buffersState[0]===this.BACK?this.BACK:this._getParameterDirect(e);case t.MAX_DRAW_BUFFERS_WEBGL:case t.MAX_COLOR_ATTACHMENTS_WEBGL:return this._getParameterDirect(e)}}let t=this._extensions.oes_standard_derivatives;if(t&&e===t.FRAGMENT_SHADER_DERIVATIVE_HINT_OES)return this._getParameterDirect(e);let n=this._extensions.ext_texture_filter_anisotropic;if(n&&e===n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)return this._gl.getParameterf(e);let r=this._extensions.oes_vertex_array_object;return r&&e===r.VERTEX_ARRAY_BINDING_OES?r._activeVertexArrayObject:(this.setError(this.INVALID_ENUM),null)}}destroy(){warnNotImplemented(`destroy`)}};installAllContextMethods(WebGLContextBase.prototype);var WebGLRenderingContext$1=class extends WebGLContextBase{static{__name$1(this,`WebGLRenderingContext`)}get _gl(){return this._native}constructor(e,t={}){super(e,t),this._attrib0Buffer=null,this._native=new ur.WebGLRenderingContext({}),this._init();let n=this.createBuffer();this._attrib0Buffer=n}_beginAttrib0Hack(){this._native.bindBuffer(this.ARRAY_BUFFER,this._attrib0Buffer?._||0);let e=new Uint8Array(this._vertexGlobalState._attribs[0]._data.buffer);this._native.bufferData(this.ARRAY_BUFFER,Uint8ArrayToVariant(e),this.STREAM_DRAW),this._native.enableVertexAttribArray(0),this._native.vertexAttribPointer(0,4,this.FLOAT,!1,0,0),this._native._vertexAttribDivisor(0,1)}_endAttrib0Hack(){let e=this._vertexObjectState._attribs[0];e._pointerBuffer?this._native.bindBuffer(this.ARRAY_BUFFER,e._pointerBuffer._):this._native.bindBuffer(this.ARRAY_BUFFER,0),this._native.vertexAttribPointer(0,e._inputSize,e._pointerType,e._pointerNormal,e._inputStride,e._pointerOffset),this._native._vertexAttribDivisor(0,e._divisor),this._native.disableVertexAttribArray(0),this._vertexGlobalState._arrayBufferBinding?this._native.bindBuffer(this.ARRAY_BUFFER,this._vertexGlobalState._arrayBufferBinding._):this._native.bindBuffer(this.ARRAY_BUFFER,0)}drawArrays(e=0,t=0,n=0){if(t<0||n<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let r=vertexCount(this,e,n);if(r<0){this.setError(this.INVALID_ENUM);return}if(!this._framebufferOk()||n===0)return;let i=t;if(n>0&&(i=n+t-1>>>0),this._checkVertexAttribState(i)){let n=this._extensions.webgl_draw_buffers;if(this._vertexObjectState._attribs[0]._isPointer||n&&n._buffersState&&n._buffersState.length>0)return this._native.drawArrays(e,t,r);this._beginAttrib0Hack(),this._native._drawArraysInstanced(e,t,r,1),this._endAttrib0Hack()}}drawElements(e=0,t=0,n=0,r=0){if(t<0||r<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let i=this._vertexObjectState._elementArrayBufferBinding;if(!i){this.setError(this.INVALID_OPERATION);return}let a=null,o=r;if(n===this.UNSIGNED_SHORT){if(o%2){this.setError(this.INVALID_OPERATION);return}o>>=1,a=new Uint16Array(i._elements.buffer)}else if(this._extensions.oes_element_index_uint&&n===this.UNSIGNED_INT){if(o%4){this.setError(this.INVALID_OPERATION);return}o>>=2,a=new Uint32Array(i._elements.buffer)}else if(n===this.UNSIGNED_BYTE)a=i._elements;else{this.setError(this.INVALID_ENUM);return}let s=t;switch(e){case this.TRIANGLES:t%3&&(s-=t%3);break;case this.LINES:t%2&&(s-=t%2);break;case this.POINTS:break;case this.LINE_LOOP:case this.LINE_STRIP:if(t<2){this.setError(this.INVALID_OPERATION);return}break;case this.TRIANGLE_FAN:case this.TRIANGLE_STRIP:if(t<3){this.setError(this.INVALID_OPERATION);return}break;default:this.setError(this.INVALID_ENUM);return}if(!this._framebufferOk())return;if(t===0){this._checkVertexAttribState(0);return}if(t+o>>>0>a.length){this.setError(this.INVALID_OPERATION);return}let c=-1;for(let e=o;e<o+t;++e)c=Math.max(c,a[e]);if(c<0){this._checkVertexAttribState(0);return}if(this._checkVertexAttribState(c)&&s>0){if(this._vertexObjectState._attribs[0]._isPointer)return this._native.drawElements(e,s,n,r);this._beginAttrib0Hack(),this._native._drawElementsInstanced(e,s,n,r,1),this._endAttrib0Hack()}}},WebGLQuery=class extends Linkable{constructor(e,t){super(e),this._ctx=t}_performDelete(){let e=this._ctx;delete e._queries[this._|0],e._native2.deleteQuery(this._|0)}},WebGLSampler=class extends Linkable{constructor(e,t){super(e),this._ctx=t}_performDelete(){let e=this._ctx;delete e._samplers[this._|0],e._native2.deleteSampler(this._|0)}},WebGLSync=class extends Linkable{constructor(e,t){super(e),this._ctx=t}_performDelete(){let e=this._ctx;delete e._syncs[this._|0],e._native2.deleteSync(this._|0)}},WebGLTransformFeedback=class extends Linkable{constructor(e,t){super(e),this._ctx=t}_performDelete(){let e=this._ctx;delete e._transformFeedbacks[this._|0],e._native2.deleteTransformFeedback(this._|0)}},WebGLVertexArrayObject=class extends Linkable{constructor(e,t){super(e),this._ctx=t,this._objectState=new WebGLVertexArrayObjectState(t)}_performDelete(){let e=this._ctx;e._vertexObjectState===this._objectState&&(e._vertexObjectState=e._defaultVertexObjectState),this._objectState.cleanUp(),delete e._vertexArrayObjects[this._|0],e._native2.deleteVertexArray(this._|0)}};const mr={createVertexArray(){let e=this._native2.createVertexArray();if(!e)return null;let t=new WebGLVertexArrayObject(e,this);return this._vertexArrayObjects[e]=t,t},deleteVertexArray(e){!e||!(e instanceof WebGLVertexArrayObject)||(e._pendingDelete=!0,e._checkDelete())},isVertexArray(e){return!e||!(e instanceof WebGLVertexArrayObject)?!1:this._native2.isVertexArray(e._)},bindVertexArray(e){e===null?(this._native2.bindVertexArray(0),this._vertexObjectState=this._defaultVertexObjectState):e instanceof WebGLVertexArrayObject?(this._native2.bindVertexArray(e._),this._vertexObjectState=e._objectState):this.setError(this.INVALID_OPERATION)},createQuery(){let e=this._native2.createQuery();if(!e)return null;let t=new WebGLQuery(e,this);return this._queries[e]=t,t},deleteQuery(e){!e||!(e instanceof WebGLQuery)||(e._pendingDelete=!0,e._checkDelete())},isQuery(e){return!e||!(e instanceof WebGLQuery)?!1:this._native2.isQuery(e._)},beginQuery(e,t){t instanceof WebGLQuery&&this._native2.beginQuery(e,t._)},endQuery(e){this._native2.endQuery(e)},getQuery(e,t){return warnNotImplemented(`WebGL2RenderingContext.getQuery`),null},getQueryParameter(e,t){return e instanceof WebGLQuery?this._native2.getQueryParameter(e._,t):null},createSampler(){let e=this._native2.createSampler();if(!e)return null;let t=new WebGLSampler(e,this);return this._samplers[e]=t,t},deleteSampler(e){!e||!(e instanceof WebGLSampler)||(e._pendingDelete=!0,e._checkDelete())},isSampler(e){return!e||!(e instanceof WebGLSampler)?!1:this._native2.isSampler(e._)},bindSampler(e,t){this._native2.bindSampler(e,t?t._:0)},samplerParameteri(e,t,n){e instanceof WebGLSampler&&this._native2.samplerParameteri(e._,t,n)},samplerParameterf(e,t,n){e instanceof WebGLSampler&&this._native2.samplerParameterf(e._,t,n)},getSamplerParameter(e,t){return e instanceof WebGLSampler?t===33082||t===33083?this._native2.getSamplerParameterf(e._,t):this._native2.getSamplerParameteri(e._,t):null},fenceSync(e,t){let n=this._native2.fenceSync(e,t);if(!n)return null;let r=new WebGLSync(n,this);return this._syncs[n]=r,r},isSync(e){return!e||!(e instanceof WebGLSync)?!1:this._native2.isSync(e._)},deleteSync(e){!e||!(e instanceof WebGLSync)||(e._pendingDelete=!0,e._checkDelete())},clientWaitSync(e,t,n){return e instanceof WebGLSync?this._native2.clientWaitSync(e._,t,n):37148},waitSync(e,t,n){e instanceof WebGLSync&&this._native2.waitSync(e._,t,n)},getSyncParameter(e,t){return e instanceof WebGLSync?this._native2.getSyncParameter(e._,t):null},createTransformFeedback(){let e=this._native2.createTransformFeedback();if(!e)return null;let t=new WebGLTransformFeedback(e,this);return this._transformFeedbacks[e]=t,t},deleteTransformFeedback(e){!e||!(e instanceof WebGLTransformFeedback)||(e._pendingDelete=!0,e._checkDelete())},isTransformFeedback(e){return!e||!(e instanceof WebGLTransformFeedback)?!1:this._native2.isTransformFeedback(e._)},bindTransformFeedback(e,t){this._native2.bindTransformFeedback(e,t?t._:0)},beginTransformFeedback(e){this._native2.beginTransformFeedback(e)},endTransformFeedback(){this._native2.endTransformFeedback()},pauseTransformFeedback(){this._native2.pauseTransformFeedback()},resumeTransformFeedback(){this._native2.resumeTransformFeedback()},transformFeedbackVaryings(e,t,n){this._native2.transformFeedbackVaryings(e._,t,n)},getTransformFeedbackVarying(e,t){let n=this._native2.getTransformFeedbackVarying(e._,t).deepUnpack();return new WebGLActiveInfo({size:n.size,type:n.type,name:n.name})}};function installObjectLifecycleMethods(e){Object.assign(e,mr)}function boundTexture3D(e,t){let n=t===32879?32874:t===35866?35869:0;return n?e._textures[e._gl.getParameteri(n)]??null:null}const hr={texImage3D(e,t,n,r,i,a,o,s,c,l){let u=n===s?this._legacyFormatStorage(s,c):null,d=u?u.internalFormat:n,f=u?u.format:s;this._saveError(),l===null?this._native2.texImage3DNull(e,t,d,r,i,a,o,f,c):this._native2.texImage3D(e,t,d,r,i,a,o,f,c,Uint8ArrayToVariant(new Uint8Array(l.buffer,l.byteOffset,l.byteLength)));let p=this.getError();if(this._restoreError(p),p!==this.NO_ERROR)return;let m=boundTexture3D(this,e);m&&(m._format=s,m._type=c),this._setTextureSwizzle(e,m,u?u.swizzle:null)},texSubImage3D(e,t,n,r,i,a,o,s,c,l,u){if(u===null)return;let d=boundTexture3D(this,e);if(d&&this._legacySubImageMismatch(d,c)){this.setError(this.INVALID_OPERATION);return}this._native2.texSubImage3D(e,t,n,r,i,a,o,s,this._legacyFormatStorage(c,l)?.format??c,l,Uint8ArrayToVariant(new Uint8Array(u.buffer,u.byteOffset,u.byteLength)))},compressedTexImage3D(e,t,n,r,i,a,o,s,c){this._saveError(),this._native2.compressedTexImage3D(e,t,n,r,i,a,o,Uint8ArrayToVariant(new Uint8Array(c.buffer,c.byteOffset,c.byteLength)));let l=this.getError();if(this._restoreError(l),l!==this.NO_ERROR)return;let u=boundTexture3D(this,e);u&&(u._format=n),this._setTextureSwizzle(e,u,null)},compressedTexSubImage3D(e,t,n,r,i,a,o,s,c,l,u){this._native2.compressedTexSubImage3D(e,t,n,r,i,a,o,s,c,Uint8ArrayToVariant(new Uint8Array(u.buffer,u.byteOffset,u.byteLength)))},copyTexSubImage3D(e,t,n,r,i,a,o,s,c){let l=boundTexture3D(this,e)?._format??0;if((l===this.ALPHA||l===this.LUMINANCE_ALPHA)&&this._legacyFormatStorage(l,this.UNSIGNED_BYTE)){if(s<0||c<0){this.setError(this.INVALID_VALUE);return}this._copyLegacyChannels(l,a,o,s,c,(a,o)=>this._native2.texSubImage3D(e,t,n,r,i,s,c,1,a.format,this.UNSIGNED_BYTE,o));return}this._native2.copyTexSubImage3D(e,t,n,r,i,a,o,s,c)},texStorage2D(e,t,n,r,i){this._saveError(),this._native2.texStorage2D(e,t,n,r,i);let a=this.getError();if(this._restoreError(a),a!==this.NO_ERROR)return;let o=this._getTexImage(e);if(o){for(let e=0;e<t;e++)o._levelWidth[e]=Math.max(1,r>>e),o._levelHeight[e]=Math.max(1,i>>e);o._format=this.RGBA,o._type=this.UNSIGNED_BYTE,this._setTextureSwizzle(e,o,null)}},texStorage3D(e,t,n,r,i,a){this._saveError(),this._native2.texStorage3D(e,t,n,r,i,a);let o=this.getError();if(this._restoreError(o),o!==this.NO_ERROR)return;let s=boundTexture3D(this,e);s&&(s._format=this.RGBA,s._type=this.UNSIGNED_BYTE),this._setTextureSwizzle(e,s,null)}};function installTexImage3DMethods(e){Object.assign(e,hr)}const gr={uniform1ui(e,t){e&&this._native2.uniform1ui(e._,t)},uniform2ui(e,t,n){e&&this._native2.uniform2ui(e._,t,n)},uniform3ui(e,t,n,r){e&&this._native2.uniform3ui(e._,t,n,r)},uniform4ui(e,t,n,r,i){e&&this._native2.uniform4ui(e._,t,n,r,i)},uniform1uiv(e,t,n,r){if(!e)return;let i=t instanceof Uint32Array?t:new Uint32Array(t);this._native2.uniform1uiv(e._,i.length,i)},uniform2uiv(e,t,n,r){if(!e)return;let i=t instanceof Uint32Array?t:new Uint32Array(t);this._native2.uniform2uiv(e._,i.length/2,i)},uniform3uiv(e,t,n,r){if(!e)return;let i=t instanceof Uint32Array?t:new Uint32Array(t);this._native2.uniform3uiv(e._,i.length/3,i)},uniform4uiv(e,t,n,r){if(!e)return;let i=t instanceof Uint32Array?t:new Uint32Array(t);this._native2.uniform4uiv(e._,i.length/4,i)},uniformMatrix2x3fv(e,t,n,r,i){if(!e)return;let a=n instanceof Float32Array?n:new Float32Array(n);this._native2.uniformMatrix2x3fv(e._,t,a)},uniformMatrix3x2fv(e,t,n,r,i){if(!e)return;let a=n instanceof Float32Array?n:new Float32Array(n);this._native2.uniformMatrix3x2fv(e._,t,a)},uniformMatrix2x4fv(e,t,n,r,i){if(!e)return;let a=n instanceof Float32Array?n:new Float32Array(n);this._native2.uniformMatrix2x4fv(e._,t,a)},uniformMatrix4x2fv(e,t,n,r,i){if(!e)return;let a=n instanceof Float32Array?n:new Float32Array(n);this._native2.uniformMatrix4x2fv(e._,t,a)},uniformMatrix3x4fv(e,t,n,r,i){if(!e)return;let a=n instanceof Float32Array?n:new Float32Array(n);this._native2.uniformMatrix3x4fv(e._,t,a)},uniformMatrix4x3fv(e,t,n,r,i){if(!e)return;let a=n instanceof Float32Array?n:new Float32Array(n);this._native2.uniformMatrix4x3fv(e._,t,a)}};function installUniformMethods(e){Object.assign(e,gr)}const _r={clearBufferfv(e,t,n,r){let i=this._native2;if(typeof i.clearBufferfv==`function`){i.clearBufferfv(e,t,Array.from(n));return}let a=n;if(e===6144){let e=this.getParameter(this.COLOR_CLEAR_VALUE);this.clearColor(a[0]??0,a[1]??0,a[2]??0,a[3]??0),this.clear(this.COLOR_BUFFER_BIT),e&&this.clearColor(e[0],e[1],e[2],e[3])}else if(e===6145){let e=this.getParameter(this.DEPTH_CLEAR_VALUE);this.clearDepth(a[0]??1),this.clear(this.DEPTH_BUFFER_BIT),e!==null&&this.clearDepth(e)}},clearBufferiv(e,t,n,r){let i=this._native2;if(typeof i.clearBufferiv==`function`){i.clearBufferiv(e,t,Array.from(n));return}if(e===6146){let e=n,t=this.getParameter(this.STENCIL_CLEAR_VALUE);this.clearStencil(e[0]??0),this.clear(this.STENCIL_BUFFER_BIT),t!==null&&this.clearStencil(t)}},clearBufferuiv(e,t,n,r){let i=this._native2;if(typeof i.clearBufferuiv==`function`){i.clearBufferuiv(e,t,Array.from(n));return}},clearBufferfi(e,t,n,r){let i=this._native2;if(typeof i.clearBufferfi==`function`){i.clearBufferfi(e,t,n,r);return}if(e===34041){let e=this.getParameter(this.DEPTH_CLEAR_VALUE),t=this.getParameter(this.STENCIL_CLEAR_VALUE);this.clearDepth(n),this.clearStencil(r),this.clear(this.DEPTH_BUFFER_BIT|this.STENCIL_BUFFER_BIT),e!==null&&this.clearDepth(e),t!==null&&this.clearStencil(t)}}};function installClearBufferMethods(e){Object.assign(e,_r)}function debugGlEnabled(){return globalThis.__GJSIFY_DEBUG_GL===!0}const vr={drawArraysInstanced(e,t,n,r){if(t<0||n<0||r<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let i=vertexCount(this,e,n);if(i<0){this.setError(this.INVALID_ENUM);return}if(this._framebufferOk()&&!(n===0||r===0)&&this._checkVertexAttribState(n+t-1>>>0)){if(debugGlEnabled()){let e=this,t=e.__drawInstCount=(e.__drawInstCount|0)+1;(t<=5||t%100==0)&&console.log(`[WebGL] drawArraysInstanced #${t} count=${i} instances=${r} fbo=${this._activeFramebuffer?._??`_gtkFbo`}`)}this._native2.drawArraysInstanced(e,t,i,r)}},drawElementsInstanced(e,t,n,r,i){if(t<0||r<0||i<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let a=this._vertexObjectState._elementArrayBufferBinding;if(!a){this.setError(this.INVALID_OPERATION);return}let o=null,s=r;if(n===this.UNSIGNED_SHORT){if(s%2){this.setError(this.INVALID_OPERATION);return}s>>=1,o=new Uint16Array(a._elements.buffer)}else if(n===this.UNSIGNED_INT){if(s%4){this.setError(this.INVALID_OPERATION);return}s>>=2,o=new Uint32Array(a._elements.buffer)}else if(n===this.UNSIGNED_BYTE)o=a._elements;else{this.setError(this.INVALID_ENUM);return}let c=t;switch(e){case this.TRIANGLES:t%3&&(c-=t%3);break;case this.LINES:t%2&&(c-=t%2);break;case this.POINTS:break;case this.LINE_LOOP:case this.LINE_STRIP:if(t<2){this.setError(this.INVALID_OPERATION);return}break;case this.TRIANGLE_FAN:case this.TRIANGLE_STRIP:if(t<3){this.setError(this.INVALID_OPERATION);return}break;default:this.setError(this.INVALID_ENUM);return}if(!this._framebufferOk())return;if(c===0||i===0){this._checkVertexAttribState(0);return}if(c+s>>>0>o.length){this.setError(this.INVALID_OPERATION);return}let l=0;for(let e=s;e<s+c;++e)o[e]>l&&(l=o[e]);this._checkVertexAttribState(l)&&this._native2.drawElementsInstanced(e,c,n,r,i)},vertexAttribDivisor(e,t){this._checkVertexIndex(e)&&(this._native2.vertexAttribDivisor(e,t),this._vertexObjectState._attribs[e]._divisor=t)},vertexAttribIPointer(e,t,n,r,i){this._native2.vertexAttribIPointer(e,t,n,r,i)},drawBuffers(e){let t=!1;for(let n=0;n<e.length;n++)if(e[n]===1029){t=!0;break}if(!t){this._native2.drawBuffers(e);return}this._native2.drawBuffers(e.map(e=>e===1029?this.COLOR_ATTACHMENT0:e))},drawRangeElements(e,t,n,r,i,a){if(r<0||a<0){this.setError(this.INVALID_VALUE);return}if(n<t){this.setError(this.INVALID_VALUE);return}this.drawElements(e,r,i,a)},blitFramebuffer(e,t,n,r,i,a,o,s,c,l){if(debugGlEnabled()){let e=this._gl.getError();e!==0&&console.log(`[WebGL] blitFramebuffer PRE-ERROR 0x${e.toString(16)}`)}if(this._native2.blitFramebuffer(e,t,n,r,i,a,o,s,c,l),debugGlEnabled()){let i=this._gl.getError(),a=this,o=a.__blitCount=(a.__blitCount|0)+1;o<=5&&console.log(`[WebGL] blitFramebuffer #${o} src=(${e},${t},${n},${r}) readFbo=${this._activeReadFramebuffer?._??`_gtkFbo`} err=${i===0?`OK`:`0x`+i.toString(16)}`)}},framebufferTextureLayer(e,t,n,r,i){this._native2.framebufferTextureLayer(e,t,n?n._:0,r,i)},invalidateFramebuffer(e,t){this._native2.invalidateFramebuffer(e,t)},invalidateSubFramebuffer(e,t,n,r,i,a){this._native2.invalidateSubFramebuffer(e,t,n,r,i,a)},readBuffer(e){this._native2.readBuffer(e)},renderbufferStorageMultisample(e,t,n,r,i){if(e!==this.RENDERBUFFER){this.setError(this.INVALID_ENUM);return}let a=this._activeRenderbuffer;if(!a){this.setError(this.INVALID_OPERATION);return}this._saveError(),this._native2.renderbufferStorageMultisample(e,t,n,r,i);let o=this.getError();this._restoreError(o),o===this.NO_ERROR&&(a._width=r,a._height=i,a._format=n)}};function installInstancedAndFramebufferOpsMethods(e){Object.assign(e,vr)}var yr=class WebGL2RenderingContext extends WebGLContextBase{get _gl(){return this._native2}constructor(e,t={}){super(e,t),this._queries={},this._samplers={},this._transformFeedbacks={},this._vertexArrayObjects={},this._syncs={},this._activeReadFramebuffer=null,this._activeDrawFramebuffer=null,this._native2=new ur.WebGL2RenderingContext({}),this._init()}_getGlslVersion(e){return e?`300 es`:this._desktopGlslVersion()}_validFramebufferAttachment(e){return super._validFramebufferAttachment(e)?!0:e>=36065&&e<=36079}static{this._WGL2_ALL_COLOR_ATTACHMENTS=[36064,36065,36066,36067,36068,36069,36070,36071,36072,36073,36074,36075,36076,36077,36078,36079]}_getColorAttachments(){return WebGL2RenderingContext._WGL2_ALL_COLOR_ATTACHMENTS}_preCheckFramebufferStatus(e){let t=e._attachments,n=0,r=0,i=[this.COLOR_ATTACHMENT0,this.DEPTH_ATTACHMENT,this.STENCIL_ATTACHMENT,this.DEPTH_STENCIL_ATTACHMENT,...WebGL2RenderingContext._WGL2_ALL_COLOR_ATTACHMENTS];for(let e of i){let n=t[e];if(n instanceof WebGLTexture&&isLegacyFormat(n._format))return this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT}for(let a of i){let i=t[a];if(i){if(i instanceof WebGLTexture){let t=e._attachmentLevel[a]??0,o=i._levelWidth[t]??0,s=i._levelHeight[t]??0;if(o>0&&s>0){n=o,r=s;break}}else if(i instanceof WebGLRenderbuffer&&i._width>0&&i._height>0){n=i._width,r=i._height;break}}}return n>0&&r>0?(e._width=n,e._height=r,this.FRAMEBUFFER_COMPLETE):this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT}_updateFramebufferAttachments(e){if(super._updateFramebufferAttachments(e),e)for(let t=1;t<=15;t++){let n=36064+t;if(!(n in e._attachments))continue;let r=e._attachments[n];if(r instanceof WebGLTexture&&!isLegacyFormat(r._format)){let t=e._attachmentFace[n]||this.TEXTURE_2D,i=e._attachmentLevel[n]??0;this._gl.framebufferTexture2D(this.FRAMEBUFFER,n,t,r._|0,i|0)}else r instanceof WebGLRenderbuffer?this._gl.framebufferRenderbuffer(this.FRAMEBUFFER,n,this.RENDERBUFFER,r._|0):this._gl.framebufferTexture2D(this.FRAMEBUFFER,n,this.TEXTURE_2D,0,0)}}bindBuffer(e,t){if(e===35345||e===35982||e===36662||e===36663){let n=t?t._|0:0;this._gl.bindBuffer(e,n);return}super.bindBuffer(e,t)}bindFramebuffer(e,t){if(e===36008||e===36009){if(!checkObject(t))throw TypeError(`bindFramebuffer(GLenum, WebGLFramebuffer)`);if(t&&t._pendingDelete||t&&!this._checkWrapper(t,WebGLFramebuffer))return;let n=t?t._|0:this._gtkFboId;if(this._gl.bindFramebuffer(e,n),e===36008){let e=this._activeReadFramebuffer;e!==t&&(e&&(--e._refCount,e._checkDelete()),t&&(t._refCount+=1)),this._activeReadFramebuffer=t}else{let e=this._activeDrawFramebuffer;e!==t&&(e&&(--e._refCount,e._checkDelete()),t&&(t._refCount+=1)),this._activeDrawFramebuffer=t,this._activeFramebuffer=t}return}super.bindFramebuffer(this.FRAMEBUFFER,t),this._activeReadFramebuffer=t,this._activeDrawFramebuffer=t}deleteFramebuffer(e){this._activeReadFramebuffer===e&&this.bindFramebuffer(36008,null),this._activeDrawFramebuffer===e&&this.bindFramebuffer(36009,null),super.deleteFramebuffer(e)}bufferData(e,t,n){let r=e===35345||e===35982||e===36662||e===36663,i=n===35041||n===35043||n===35045||n===35042||n===35044||n===35046?this.STATIC_DRAW:n;if(r){if(typeof t==`number`)t>=0&&this._gl.bufferDataSizeOnly(e,t,i);else if(typeof t==`object`&&t){let n=arrayToUint8Array(t);this._gl.bufferData(e,Uint8ArrayToVariant(n),i)}return}super.bufferData(e,t,i)}bufferSubData(e,t,n){if(e===35345||e===35982||e===36662||e===36663){if(t<0){this.setError(this.INVALID_VALUE);return}if(!n){this.setError(this.INVALID_VALUE);return}let r=arrayToUint8Array(n);this._gl.bufferSubData(e,t,Uint8ArrayToVariant(r));return}super.bufferSubData(e,t,n)}bindTexture(e,t){if(e===32879||e===35866){let n=t,r=n?n._|0:0;this._gl.bindTexture(e,r),n&&(n._binding=e);return}super.bindTexture(e,t)}texParameteri(e,t,n){if(t>=36418&&t<=36422){this.setError(this.INVALID_ENUM);return}if(e===32879||e===35866){this._gl.texParameteri(e,t,n);return}if(t===32882||t===34892||t===34893||t===33084||t===33085||t===33083||t===33082){this._gl.texParameteri(e,t,n);return}super.texParameteri(e,t,n)}drawArrays(e,t,n){if(t<0||n<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let r=vertexCount(this,e,n);if(r<0){this.setError(this.INVALID_ENUM);return}this._framebufferOk()&&n!==0&&this._checkVertexAttribState(n+t-1>>>0)&&this._native2.drawArrays(e,t,r)}drawElements(e=0,t=0,n=0,r=0){if(t<0||r<0){this.setError(this.INVALID_VALUE);return}if(!this._checkStencilState())return;let i=this._vertexObjectState._elementArrayBufferBinding;if(!i){this.setError(this.INVALID_OPERATION);return}let a=null,o=r;if(n===this.UNSIGNED_SHORT){if(o%2){this.setError(this.INVALID_OPERATION);return}o>>=1,a=new Uint16Array(i._elements.buffer)}else if(n===this.UNSIGNED_INT){if(o%4){this.setError(this.INVALID_OPERATION);return}o>>=2,a=new Uint32Array(i._elements.buffer)}else if(n===this.UNSIGNED_BYTE)a=i._elements;else{this.setError(this.INVALID_ENUM);return}let s=t;switch(e){case this.TRIANGLES:t%3&&(s-=t%3);break;case this.LINES:t%2&&(s-=t%2);break;case this.POINTS:break;case this.LINE_LOOP:case this.LINE_STRIP:if(t<2){this.setError(this.INVALID_OPERATION);return}break;case this.TRIANGLE_FAN:case this.TRIANGLE_STRIP:if(t<3){this.setError(this.INVALID_OPERATION);return}break;default:this.setError(this.INVALID_ENUM);return}if(!this._framebufferOk()||t===0)return;let c=0;for(let e=o;e<o+s;++e)e<a.length&&a[e]>c&&(c=a[e]);this._checkVertexAttribState(c)&&this._native2.drawElements(e,s,n,r)}bindBufferBase(e,t,n){this._native2.bindBufferBase(e,t,n?n._:0)}bindBufferRange(e,t,n,r,i){this._native2.bindBufferRange(e,t,n?n._:0,r,i)}copyBufferSubData(e,t,n,r,i){this._native2.copyBufferSubData(e,t,n,r,i)}getBufferSubData(e,t,n,r,i){let a=i===void 0?n.byteLength-(r??0):i,o=this._native2.getBufferSubData(e,t,a),s=new Uint8Array(n.buffer,n.byteOffset+(r??0)*(n instanceof Uint8Array?1:n.BYTES_PER_ELEMENT??1));s.set(o.subarray(0,s.byteLength))}texImage2D(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0,c){let l=0,u=0,d=0,f=0;if(arguments.length===6)if(s=i,d=r,a instanceof ft.Pixbuf){let e=a;l=e.get_width(),u=e.get_height(),c=e.get_pixels()}else{let e=extractImageData(a);if(e==null)throw TypeError(`texImage2D(GLenum, GLint, GLenum, GLint, GLenum, GLenum, ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement)`);l=e.width,u=e.height,c=e.data}else arguments.length>=9&&(l=r,u=i,f=a,d=o);let p=this._getTexImage(e);if(!p){this.setError(this.INVALID_OPERATION);return}let m=convertPixels(c);if(this._unpackPremultAlpha&&m&&d===this.RGBA&&(m=premultiplyAlpha(m)),this._unpackFlipY&&m&&l>0&&u>0){let e=this._computePixelSize(s,d);if(e>0){let t=this._computeRowStride(l,e),n=new Uint8Array(m.length);for(let e=0;e<u;e++){let r=e*t,i=(u-1-e)*t;n.set(m.subarray(r,r+t),i)}m=n}}let h=n===d?this._legacyFormatStorage(d,s):null;this._saveError(),this._gl.texImage2D(e,t,h?h.internalFormat:n,l,u,f,h?h.format:d,s,Uint8ArrayToVariant(m));let g=this.getError();if(this._restoreError(g),g!==this.NO_ERROR)return;this._setTextureSwizzle(e,p,h?h.swizzle:null),p._levelWidth[t]=l,p._levelHeight[t]=u,p._format=d,p._type=s;let _=this._activeFramebuffer;if(_){let e=!1,t=this._getAttachments();for(let n=0;n<t.length;++n)if(_._attachments[t[n]]===p){e=!0;break}e&&this._activeFramebuffer&&this._updateFramebufferAttachments(this._activeFramebuffer)}}texSubImage2D(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0,c){let l=0,u=0,d=0;if(arguments.length===7)if(s=a,d=i,o instanceof ft.Pixbuf){let e=o;l=e.get_width(),u=e.get_height(),c=e.get_pixels()}else{let e=extractImageData(o);if(e==null)throw TypeError(`texSubImage2D(GLenum, GLint, GLint, GLint, GLenum, GLenum, ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement)`);l=e.width,u=e.height,c=e.data}else l=i,u=a,d=o;let f=this._getTexImage(e);if(!f){this.setError(this.INVALID_OPERATION);return}if(this._legacySubImageMismatch(f,d)){this.setError(this.INVALID_OPERATION);return}let p=convertPixels(c);if(!p){this.setError(this.INVALID_OPERATION);return}if(this._unpackPremultAlpha&&p&&d===this.RGBA&&(p=premultiplyAlpha(p)),this._unpackFlipY&&p&&l>0&&u>0){let e=this._computePixelSize(s,d);if(e>0){let t=this._computeRowStride(l,e),n=new Uint8Array(p.length);for(let e=0;e<u;e++){let r=e*t,i=(u-1-e)*t;n.set(p.subarray(r,r+t),i)}p=n}}let m=this._legacyFormatStorage(d,s)?.format??d;this._gl.texSubImage2D(e,t,n,r,l,u,m,s,Uint8ArrayToVariant(p))}getUniform(e,t){let n=t?._activeInfo?.type,r=5125,i=36294,a=36295,o=n===r||n===i||n===a||n===36296,s=e;if(!o)return super.getUniform(s,t);if(!e||!t)return null;let c=this._native2.getUniformi(s._|0,t._|0);return c?n===r?c[0]>>>0:n===i?new Uint32Array([c[0]>>>0,c[1]>>>0]):n===a?new Uint32Array([c[0]>>>0,c[1]>>>0,c[2]>>>0]):new Uint32Array([c[0]>>>0,c[1]>>>0,c[2]>>>0,c[3]>>>0]):null}getUniformBlockIndex(e,t){return this._native2.getUniformBlockIndex(e._,t)}uniformBlockBinding(e,t,n){this._native2.uniformBlockBinding(e._,t,n)}getActiveUniformBlockName(e,t){let n=this._native2.getActiveUniformBlockName(e._,t);return n.length>0?n:null}getActiveUniformBlockParameter(e,t,n){return this._native2.getActiveUniformBlockParameter(e._,t,n)}getActiveUniforms(e,t,n){return this._native2.getActiveUniforms(e._,t,n)}getFragDataLocation(e,t){return this._native2.getFragDataLocation(e._,t)}getIndexedParameter(e,t){return this._native2.getIndexedParameteri(e,t)}getInternalformatParameter(e,t,n){return this._native2.getInternalformatParameter(e,t,n)}getParameter(e){if(e===7938)return`WebGL 2.0`;if(e===35724)return`WebGL GLSL ES 3.00`;if(e===7939)return warnNotImplemented(`WebGL2RenderingContext.getParameter(GL_EXTENSIONS)`),``;if(e===36006)return this._activeDrawFramebuffer;if(e===36010)return this._activeReadFramebuffer;switch(e){case 36183:case 35071:case 32883:case 36063:case 34852:case 36203:case 33001:case 33e3:case 37157:case 35373:case 35657:case 35077:case 35978:case 35979:case 35968:case 35376:case 35375:case 35659:case 37154:case 35371:case 35658:case 35379:case 35374:case 35377:case 35076:case 3330:case 3332:case 3331:case 35053:case 35055:case 3074:case 32874:case 35869:case 36389:case 35983:case 35368:case 35380:case 32878:case 3314:case 32877:case 3316:case 3315:case 34045:return this._native2.getParameterx(e)?.deepUnpack()|0;case 35977:case 36388:case 36387:return!!this._native2.getParameterx(e)?.deepUnpack()}return super.getParameter(e)}getStringi(e,t){let n=this._native2.getStringi(e,t);return n.length>0?n:null}renderbufferStorage(e,t,n,r){if(e!==this.RENDERBUFFER){this.setError(this.INVALID_ENUM);return}let i=this._activeRenderbuffer;if(!i){this.setError(this.INVALID_OPERATION);return}if(n<0||r<0){this.setError(this.INVALID_VALUE);return}for(;this._gl.getError()!==this.NO_ERROR;);if(this._gl.renderbufferStorage(e,t,n,r),this._gl.getError()!==this.NO_ERROR)return;i._width=n,i._height=r,i._format=t;let a=this._activeFramebuffer;if(a){let e=this._getAttachments(),t=!1;for(let n=0;n<e.length;++n)if(a._attachments[e[n]]===i){t=!0;break}t&&this._updateFramebufferAttachments(a)}}getSupportedExtensions(){let e=super.getSupportedExtensions();for(let t of[`EXT_color_buffer_float`,`EXT_color_buffer_half_float`,`OES_texture_half_float`])e.indexOf(t)===-1&&e.push(t);return e}readPixels(e,t,n,r,i,a,o){if(!o)return;if(n<0||r<0){this.setError(this.INVALID_VALUE);return}if(!this._framebufferOk())return;let s=i===6408||i===32856?4:i===6407?3:i===33319?2:1,c=a===5126?4:a===5131||a===36193?2:a===5125||a===5124?4:a===5123||a===5122?2:1,l=n*r*s*c,u=new Uint8Array(l);this._saveError();let d=this._gl.readPixels(e,t,n,r,i,a,Uint8ArrayToVariant(u)),f=this.getError();if(this._restoreError(f),f!==this.NO_ERROR)return;let p=d&&d.length>0?d:u;if(o instanceof Uint8Array)o.set(p);else if(o instanceof Float32Array){let e=new Float32Array(p.buffer,0,o.length);o.set(e)}}_framebufferOk(){return!0}};installObjectLifecycleMethods(yr.prototype),installTexImage3DMethods(yr.prototype),installUniformMethods(yr.prototype),installClearBufferMethods(yr.prototype),installInstancedAndFramebufferOpsMethods(yr.prototype);function notifyElementResize(e,t,n){e._allocatedClientWidth=t,e._allocatedClientHeight=n,e._fireResizeSubscribers(t,n);let r=e.parentNode;for(;r;)r instanceof Element&&(r._allocatedClientWidth=t,r._allocatedClientHeight=n,r._fireResizeSubscribers(t,n)),r=r.parentNode}var HTMLCanvasElement$1=class extends Fe{static{__name$1(this,`HTMLCanvasElement`)}constructor(e){super(),this.gtkGlArea=e}get width(){return this.gtkGlArea.get_allocated_width()*this.scaleFactor}set width(e){}get height(){return this.gtkGlArea.get_allocated_height()*this.scaleFactor}set height(e){}get scaleFactor(){return this.gtkGlArea.get_scale_factor()||1}get clientWidth(){return this.gtkGlArea.get_allocated_width()}get clientHeight(){return this.gtkGlArea.get_allocated_height()}get offsetWidth(){return this.clientWidth}get offsetHeight(){return this.clientHeight}getGlArea(){return this.gtkGlArea}_createCloneTarget(){let e=new Fe;return e.width=this.width,e.height=this.height,e}getContext(e,t){return e===`webgl`||e===`experimental-webgl`?(this._webgl||=(this.gtkGlArea.make_current(),new WebGLRenderingContext$1(this,t)),this._webgl):e===`webgl2`?(this._webgl2||=(this.gtkGlArea.make_current(),new yr(this,t)),this._webgl2):super.getContext(e,t)}};const br=[`apple software renderer`,`llvmpipe`,`softpipe`,`swrast`,`swiftshader`,`microsoft basic render driver`,`mesa offscreen`];function isSoftwareRenderer(e){if(!e)return!1;let t=e.toLowerCase();return br.some(e=>t.includes(e))}function isNumericGdkName(e){return/^0x[0-9a-f]+$/.test(e)||/^U\+[0-9a-f]{4,6}$/.test(e)}function isUnidentifiedKeyval(e,t){return e===V.KEY_VoidSymbol||t===null||isNumericGdkName(t)}const xr={Return:`Enter`,KP_Enter:`Enter`,Tab:`Tab`,ISO_Left_Tab:`Tab`,BackSpace:`Backspace`,Escape:`Escape`,Delete:`Delete`,KP_Delete:`Delete`,Insert:`Insert`,KP_Insert:`Insert`,Home:`Home`,KP_Home:`Home`,End:`End`,KP_End:`End`,Page_Up:`PageUp`,KP_Page_Up:`PageUp`,Page_Down:`PageDown`,KP_Page_Down:`PageDown`,Left:`ArrowLeft`,KP_Left:`ArrowLeft`,Up:`ArrowUp`,KP_Up:`ArrowUp`,Right:`ArrowRight`,KP_Right:`ArrowRight`,Down:`ArrowDown`,KP_Down:`ArrowDown`,Shift_L:`Shift`,Shift_R:`Shift`,Control_L:`Control`,Control_R:`Control`,Alt_L:`Alt`,Alt_R:`Alt`,Super_L:`Meta`,Super_R:`Meta`,Meta_L:`Meta`,Meta_R:`Meta`,Caps_Lock:`CapsLock`,Num_Lock:`NumLock`,Scroll_Lock:`ScrollLock`,Print:`PrintScreen`,Pause:`Pause`,Menu:`ContextMenu`,space:` `,F1:`F1`,F2:`F2`,F3:`F3`,F4:`F4`,F5:`F5`,F6:`F6`,F7:`F7`,F8:`F8`,F9:`F9`,F10:`F10`,F11:`F11`,F12:`F12`,KP_Add:`+`,KP_Subtract:`-`,KP_Multiply:`*`,KP_Divide:`/`,KP_Decimal:`.`,KP_Separator:`,`,KP_0:`0`,KP_1:`1`,KP_2:`2`,KP_3:`3`,KP_4:`4`,KP_5:`5`,KP_6:`6`,KP_7:`7`,KP_8:`8`,KP_9:`9`},Sr={Return:`Enter`,KP_Enter:`NumpadEnter`,Tab:`Tab`,ISO_Left_Tab:`Tab`,BackSpace:`Backspace`,Escape:`Escape`,Delete:`Delete`,KP_Delete:`NumpadDecimal`,Insert:`Insert`,KP_Insert:`Numpad0`,Home:`Home`,KP_Home:`Numpad7`,End:`End`,KP_End:`Numpad1`,Page_Up:`PageUp`,KP_Page_Up:`Numpad9`,Page_Down:`PageDown`,KP_Page_Down:`Numpad3`,Left:`ArrowLeft`,KP_Left:`Numpad4`,Up:`ArrowUp`,KP_Up:`Numpad8`,Right:`ArrowRight`,KP_Right:`Numpad6`,Down:`ArrowDown`,KP_Down:`Numpad2`,Shift_L:`ShiftLeft`,Shift_R:`ShiftRight`,Control_L:`ControlLeft`,Control_R:`ControlRight`,Alt_L:`AltLeft`,Alt_R:`AltRight`,Super_L:`MetaLeft`,Super_R:`MetaRight`,Meta_L:`MetaLeft`,Meta_R:`MetaRight`,Caps_Lock:`CapsLock`,Num_Lock:`NumLock`,Scroll_Lock:`ScrollLock`,Print:`PrintScreen`,Pause:`Pause`,Menu:`ContextMenu`,space:`Space`,F1:`F1`,F2:`F2`,F3:`F3`,F4:`F4`,F5:`F5`,F6:`F6`,F7:`F7`,F8:`F8`,F9:`F9`,F10:`F10`,F11:`F11`,F12:`F12`,KP_Add:`NumpadAdd`,KP_Subtract:`NumpadSubtract`,KP_Multiply:`NumpadMultiply`,KP_Divide:`NumpadDivide`,KP_Decimal:`NumpadDecimal`,KP_Separator:`NumpadComma`,KP_0:`Numpad0`,KP_1:`Numpad1`,KP_2:`Numpad2`,KP_3:`Numpad3`,KP_4:`Numpad4`,KP_5:`Numpad5`,KP_6:`Numpad6`,KP_7:`Numpad7`,KP_8:`Numpad8`,KP_9:`Numpad9`},Cr={exclam:`1`,at:`2`,numbersign:`3`,dollar:`4`,percent:`5`,asciicircum:`6`,ampersand:`7`,asterisk:`8`,parenleft:`9`,parenright:`0`,underscore:`minus`,plus:`equal`,braceleft:`bracketleft`,bar:`backslash`,braceright:`bracketright`,colon:`semicolon`,quotedbl:`apostrophe`,less:`comma`,greater:`period`,question:`slash`,asciitilde:`grave`},wr={minus:`Minus`,equal:`Equal`,bracketleft:`BracketLeft`,bracketright:`BracketRight`,backslash:`Backslash`,semicolon:`Semicolon`,apostrophe:`Quote`,grave:`Backquote`,comma:`Comma`,period:`Period`,slash:`Slash`};function codeFromGdkName(e){if(Sr[e])return Sr[e];if(e.length===1&&e>=`a`&&e<=`z`)return`Key${e.toUpperCase()}`;if(e.length===1&&e>=`0`&&e<=`9`)return`Digit${e}`;if(wr[e])return wr[e];let t=Cr[e];return t?codeFromGdkName(t):null}function gdkKeyvalToKey(e){let t=V.keyval_name(e);if(isUnidentifiedKeyval(e,t))return`Unidentified`;if(t&&xr[t])return xr[t];let n=V.keyval_to_unicode(e);return n>0?String.fromCodePoint(n):t}function gdkKeyvalToCode(e){let t=V.keyval_name(e);if(isUnidentifiedKeyval(e,t))return``;let n=codeFromGdkName(t);if(n)return n;let r=V.keyval_to_lower(e);if(r!==e){let e=V.keyval_name(r),t=e===null?null:codeFromGdkName(e);if(t)return t}return``}function gdkKeyvalToLocation(e){let t=V.keyval_name(e);return t?t.startsWith(`KP_`)?3:t.endsWith(`_L`)?1:t.endsWith(`_R`)?2:0:0}const Tr=.5;var TouchPointerTranslator=class{constructor(e,t){this.getElement=e,this.getWindowTarget=t,this.active=new Map,this.nextId=2}get activeCount(){return this.active.size}handle(e){switch(e.phase){case`begin`:this.begin(e);break;case`update`:this.update(e);break;case`end`:this.end(e);break;case`cancel`:this.cancel(e);break}}cancelAll(e){for(let[t,n]of this.active)this.cancel({...e,phase:`cancel`,key:t,x:n.lastX,y:n.lastY,isPrimary:n.isPrimary})}begin(e){this.active.has(e.key)&&this.cancel(e);let t=this.getElement();if(!t)return;let n={id:this.nextId++,isPrimary:e.isPrimary,lastX:e.x,lastY:e.y,preventMouse:!1};this.active.set(e.key,n);let r=this.pointerInit(e,n,-1,0,0),i=this.mouseInit(e,0,0);n.isPrimary&&t.dispatchEvent(new MouseEvent(`mousemove`,i)),t.dispatchEvent(new PointerEvent(`pointerover`,r)),t.dispatchEvent(new PointerEvent(`pointerenter`,{...r,bubbles:!1,cancelable:!1})),n.isPrimary&&(t.dispatchEvent(new MouseEvent(`mouseover`,i)),t.dispatchEvent(new MouseEvent(`mouseenter`,{...i,bubbles:!1,cancelable:!1})));let a=new PointerEvent(`pointerdown`,this.pointerInit(e,n,0,1,Tr));t.dispatchEvent(a),n.isPrimary&&(n.preventMouse=a.defaultPrevented,n.preventMouse||t.dispatchEvent(new MouseEvent(`mousedown`,{...this.mouseInit(e,0,1),detail:1})))}update(e){let t=this.active.get(e.key);if(!t)return;let n=this.getElement();if(!n)return;let r=e.x-t.lastX,i=e.y-t.lastY;t.lastX=e.x,t.lastY=e.y,n.dispatchEvent(new PointerEvent(`pointermove`,{...this.pointerInit(e,t,-1,1,Tr),movementX:r,movementY:i})),t.isPrimary&&!t.preventMouse&&n.dispatchEvent(new MouseEvent(`mousemove`,{...this.mouseInit(e,0,1),movementX:r,movementY:i}))}end(e){let t=this.active.get(e.key);if(!t)return;this.active.delete(e.key);let n=this.getElement();if(!n)return;let r=this.pointerInit(e,t,0,0,0),i=this.mouseInit(e,0,0),a=t.isPrimary&&!t.preventMouse;n.dispatchEvent(new PointerEvent(`pointerup`,r)),a&&n.dispatchEvent(new MouseEvent(`mouseup`,{...i,detail:1})),this.leave(n,t,{...r,button:-1},i),t.isPrimary&&n.dispatchEvent(new PointerEvent(`click`,{...r,detail:1}))}cancel(e){let t=this.active.get(e.key);if(!t)return;this.active.delete(e.key);let n=this.getElement();if(!n)return;let r={...e,x:t.lastX,y:t.lastY},i=this.pointerInit(r,t,-1,0,0),a=this.mouseInit(r,0,0);n.dispatchEvent(new PointerEvent(`pointercancel`,{...i,cancelable:!1})),t.isPrimary&&!t.preventMouse&&this.getWindowTarget()?.dispatchEvent(new MouseEvent(`mouseup`,{...a,detail:1})),this.leave(n,t,i,a)}leave(e,t,n,r){e.dispatchEvent(new PointerEvent(`pointerout`,n)),e.dispatchEvent(new PointerEvent(`pointerleave`,{...n,bubbles:!1,cancelable:!1})),t.isPrimary&&(e.dispatchEvent(new MouseEvent(`mouseout`,r)),e.dispatchEvent(new MouseEvent(`mouseleave`,{...r,bubbles:!1,cancelable:!1})))}mouseInit(e,t,n){return{shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,clientX:e.x,clientY:e.y,offsetX:e.x,offsetY:e.y,screenX:e.x,screenY:e.y,button:t,buttons:n,bubbles:!0,cancelable:!0}}pointerInit(e,t,n,r,i){return{...this.mouseInit(e,n,r),pointerId:t.id,pointerType:`touch`,isPrimary:t.isPrimary,pressure:i}}};const Er=new Map([[V.EventType.TOUCH_BEGIN,`begin`],[V.EventType.TOUCH_UPDATE,`update`],[V.EventType.TOUCH_END,`end`],[V.EventType.TOUCH_CANCEL,`cancel`]]);function isTouchEvent(e){return e!==null&&Er.has(e.get_event_type())}function pointerTypeOf(e){let t=e?.get_device()?.get_source();return t===V.InputSource.TOUCHSCREEN?`touch`:t===V.InputSource.PEN?`pen`:`mouse`}let Dr=!1;function sequenceKey(e,t){if(e===null)return t?`primary`:`secondary`;let n=String(e),r=n.lastIndexOf(`native@`);return r!==-1&&n.endsWith(`]`)?n.slice(r+7,-1):(Dr||(Dr=!0,console.warn(`@gjsify/event-bridge: GdkEventSequence identity is not readable on this runtime; touch pointers are keyed by the emulating-pointer flag, so a third concurrent contact merges with the second.`)),t?`primary`:`secondary`)}function surfaceToWidget(e,t,n){let r=e.get_native(),[i,a]=r.get_surface_transform(),o=t-i,s=n-a,[c,l]=r.compute_point(e,new _n.Point({x:o,y:s}));return c?[l.x,l.y]:[o,s]}function getGlobalEventTarget(){return globalThis.__gjsify_globalEventTarget}const Or={shiftKey:!1,ctrlKey:!1,altKey:!1,metaKey:!1};function modifiersFromState(e){return{shiftKey:!!(e&V.ModifierType.SHIFT_MASK),ctrlKey:!!(e&V.ModifierType.CONTROL_MASK),altKey:!!(e&V.ModifierType.ALT_MASK),metaKey:!!(e&V.ModifierType.SUPER_MASK)}}function extractModifiers(e){return modifiersFromState(e.get_current_event_state())}function gtkButtonToDom(e){return e===1?0:e===2?1:e===3?2:e-1}function buttonsFromModifiers(e){let t=e.get_current_event_state(),n=0;return t&V.ModifierType.BUTTON1_MASK&&(n|=1),t&V.ModifierType.BUTTON3_MASK&&(n|=2),t&V.ModifierType.BUTTON2_MASK&&(n|=4),n}function attachEventControllers(e,t,n){e.set_focusable(!0),e.set_can_focus(!0);let r={lastX:0,lastY:0,buttonsPressed:0,pressedKeys:new Set},i=new TouchPointerTranslator(t,()=>getGlobalEventTarget()),a=new W.EventControllerMotion;a.connect(`motion`,(n,i,o)=>{let s=t();if(!s)return;let c=e.get_allocated_width(),l=e.get_allocated_height(),u=Math.max(0,Math.min(i,c)),d=Math.max(0,Math.min(o,l)),f=u-r.lastX,p=d-r.lastY,m=extractModifiers(a),h=buttonsFromModifiers(a),g={...m,clientX:u,clientY:d,offsetX:u,offsetY:d,screenX:u,screenY:d,movementX:f,movementY:p,buttons:h,button:0,bubbles:!0,cancelable:!0};s.dispatchEvent(new PointerEvent(`pointermove`,{...g,pointerId:1,pointerType:pointerTypeOf(a.get_current_event()),isPrimary:!0})),s.dispatchEvent(new MouseEvent(`mousemove`,g)),r.lastX=u,r.lastY=d}),a.connect(`enter`,(e,n,i)=>{let o=t();if(!o)return;r.lastX=n,r.lastY=i;let s={...extractModifiers(a),clientX:n,clientY:i,offsetX:n,offsetY:i,screenX:n,screenY:i,bubbles:!1,cancelable:!1};o.dispatchEvent(new PointerEvent(`pointerenter`,{...s,pointerId:1,pointerType:pointerTypeOf(a.get_current_event()),isPrimary:!0})),o.dispatchEvent(new MouseEvent(`mouseenter`,s)),o.dispatchEvent(new MouseEvent(`mouseover`,{...s,bubbles:!0}))}),a.connect(`leave`,()=>{let e=t();if(!e)return;let n={...extractModifiers(a),clientX:r.lastX,clientY:r.lastY,bubbles:!1,cancelable:!1};e.dispatchEvent(new PointerEvent(`pointerleave`,{...n,pointerId:1,pointerType:pointerTypeOf(a.get_current_event()),isPrimary:!0})),e.dispatchEvent(new MouseEvent(`mouseleave`,n)),e.dispatchEvent(new MouseEvent(`mouseout`,{...n,bubbles:!0}))}),e.add_controller(a);let o=new W.GestureClick;o.set_button(0),o.connect(`pressed`,(n,i,a,s)=>{if(isTouchEvent(o.get_current_event()))return;let c=t();if(!c)return;let l=gtkButtonToDom(o.get_current_button()),u=extractModifiers(o);r.buttonsPressed|=1<<l;let d={...u,clientX:a,clientY:s,offsetX:a,offsetY:s,screenX:a,screenY:s,button:l,buttons:r.buttonsPressed,detail:i,bubbles:!0,cancelable:!0};c.dispatchEvent(new PointerEvent(`pointerdown`,{...d,pointerId:1,pointerType:pointerTypeOf(o.get_current_event()),isPrimary:!0})),c.dispatchEvent(new MouseEvent(`mousedown`,d)),e.grab_focus()}),o.connect(`released`,(e,n,i,a)=>{if(isTouchEvent(o.get_current_event()))return;let s=t();if(!s)return;let c=gtkButtonToDom(o.get_current_button()),l=extractModifiers(o);r.buttonsPressed&=~(1<<c);let u={...l,clientX:i,clientY:a,offsetX:i,offsetY:a,screenX:i,screenY:a,button:c,buttons:r.buttonsPressed,detail:n,bubbles:!0,cancelable:!0};s.dispatchEvent(new PointerEvent(`pointerup`,{...u,pointerId:1,pointerType:pointerTypeOf(o.get_current_event()),isPrimary:!0})),s.dispatchEvent(new MouseEvent(`mouseup`,u)),c===0&&(s.dispatchEvent(new MouseEvent(`click`,u)),n===2&&s.dispatchEvent(new MouseEvent(`dblclick`,u))),c===2&&s.dispatchEvent(new MouseEvent(`contextmenu`,{...u,cancelable:!0}))}),o.connect(`cancel`,(e,n)=>{let i=o.get_last_event(n);if(isTouchEvent(i)||r.buttonsPressed===0)return;r.buttonsPressed=0;let a=t();a&&a.dispatchEvent(new PointerEvent(`pointercancel`,{...extractModifiers(o),clientX:r.lastX,clientY:r.lastY,offsetX:r.lastX,offsetY:r.lastY,screenX:r.lastX,screenY:r.lastY,button:-1,buttons:0,pointerId:1,pointerType:pointerTypeOf(i),isPrimary:!0,bubbles:!0,cancelable:!1}))}),e.add_controller(o);let s=new W.EventControllerScroll({flags:W.EventControllerScrollFlags.BOTH_AXES});s.connect(`scroll`,(e,n,i)=>{let a=t();if(!a)return;let o=extractModifiers(s),c=s.get_unit()===V.ScrollUnit.WHEEL,l=c?3:1,u={...o,clientX:r.lastX,clientY:r.lastY,offsetX:r.lastX,offsetY:r.lastY,screenX:r.lastX,screenY:r.lastY,deltaX:n*l,deltaY:i*l,deltaZ:0,deltaMode:c?WheelEvent.DOM_DELTA_LINE:WheelEvent.DOM_DELTA_PIXEL,bubbles:!0,cancelable:!0};return a.dispatchEvent(new WheelEvent(`wheel`,u)),!1}),e.add_controller(s);let c=new W.EventControllerKey;c.connect(`key-pressed`,(e,i,a,o)=>{let s=t();if(!s)return!1;let c=r.pressedKeys.has(i);r.pressedKeys.add(i);let l=gdkKeyvalToKey(i),u={key:l,code:gdkKeyvalToCode(i),location:gdkKeyvalToLocation(i),repeat:c,altKey:!!(o&V.ModifierType.ALT_MASK),ctrlKey:!!(o&V.ModifierType.CONTROL_MASK),metaKey:!!(o&V.ModifierType.SUPER_MASK),shiftKey:!!(o&V.ModifierType.SHIFT_MASK),keyCode:l.length===1?l.toUpperCase().charCodeAt(0):0,which:l.length===1?l.toUpperCase().charCodeAt(0):0,bubbles:!0,cancelable:!0},d=new KeyboardEvent(`keydown`,u);return s.dispatchEvent(d),getGlobalEventTarget()?.dispatchEvent(new KeyboardEvent(`keydown`,u)),n?.captureKeys===!0}),c.connect(`key-released`,(e,n,i,a)=>{let o=t();if(!o)return;r.pressedKeys.delete(n);let s=gdkKeyvalToKey(n),c={key:s,code:gdkKeyvalToCode(n),location:gdkKeyvalToLocation(n),repeat:!1,altKey:!!(a&V.ModifierType.ALT_MASK),ctrlKey:!!(a&V.ModifierType.CONTROL_MASK),metaKey:!!(a&V.ModifierType.SUPER_MASK),shiftKey:!!(a&V.ModifierType.SHIFT_MASK),keyCode:s.length===1?s.toUpperCase().charCodeAt(0):0,which:s.length===1?s.toUpperCase().charCodeAt(0):0,bubbles:!0,cancelable:!0};o.dispatchEvent(new KeyboardEvent(`keyup`,c)),getGlobalEventTarget()?.dispatchEvent(new KeyboardEvent(`keyup`,c))}),e.add_controller(c);let l=new W.EventControllerFocus;l.connect(`enter`,()=>{let e=t();e&&(e.dispatchEvent(new FocusEvent(`focus`,{bubbles:!1,cancelable:!1})),e.dispatchEvent(new FocusEvent(`focusin`,{bubbles:!0,cancelable:!1})))}),l.connect(`leave`,()=>{let e=t();e&&(r.pressedKeys.clear(),e.dispatchEvent(new FocusEvent(`blur`,{bubbles:!1,cancelable:!1})),e.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,cancelable:!1})),getGlobalEventTarget()?.dispatchEvent(new FocusEvent(`blur`,{bubbles:!1,cancelable:!1})))}),e.add_controller(l);let u=new W.EventControllerLegacy;u.connect(`event`,(t,n)=>{let r=n.get_event_type(),a=Er.get(r);if(a===void 0)return r===V.EventType.GRAB_BROKEN&&i.activeCount>0&&n.get_grab_surface()!==e.get_native().get_surface()&&i.cancelAll(modifiersFromState(n.get_modifier_state())),!1;let[,o,s]=n.get_position(),[c,l]=surfaceToWidget(e,o,s),u=n.get_emulating_pointer();return i.handle({...modifiersFromState(n.get_modifier_state()),phase:a,key:sequenceKey(n.get_event_sequence(),u),x:c,y:l,isPrimary:u}),a===`begin`&&e.grab_focus(),!1}),e.add_controller(u),e.connect(`unmap`,()=>i.cancelAll(Or)),e.connect(`state-flags-changed`,(t,n)=>{let r=W.StateFlags.INSENSITIVE;e.get_state_flags()&r&&!(n&r)&&i.cancelAll(Or)})}const kr=bn.registerClass({GTypeName:`GjsifyWebGLBridge`},class WebGLBridge extends W.GLArea{constructor(e){super(e),this._canvas=null,this._readyCallbacks=[],this._resizeCallbacks=[],this._renderTag=null,this._tickCallbackId=null,this._frameCallback=null,this._lastFrameCallback=null,this._lastFrameTime=0,this._replaying=!1,this._frameCallbackId=0,this._nextFrameId=1,this._timeOrigin=B.get_monotonic_time(),this._rendererInfo=null,this.set_allowed_apis(V.GLAPI.GL|V.GLAPI.GLES),this.set_required_version(3,2),this.set_has_depth_buffer(!0),this.set_has_stencil_buffer(!0),attachEventControllers(this,()=>this._canvas,{captureKeys:!0}),this._tickCallbackId=this.add_tick_callback((e,t)=>(this._frameCallback!==null&&this.queue_render(),B.SOURCE_CONTINUE));let t=this.connect(`render`,()=>{this.disconnect(t),this.make_current(),this._canvas=new HTMLCanvasElement$1(this);{let e=globalThis;e.document?.body&&e.document.body.appendChild(this._canvas)}this._canvas.getContext(`webgl2`);let e=this._canvas.getContext(`webgl`);if(e){this._reportRenderer(e);for(let t of this._readyCallbacks)t(this._canvas,e);this._readyCallbacks=[]}return this._renderTag=this.connect(`render`,e=>{let t=(B.get_monotonic_time()-this._timeOrigin)/1e3;if(this._frameCallback!==null){globalThis.__GJSIFY_DEBUG_RAF===!0&&console.log(`[rAF] frame callback fires t=${t.toFixed(1)}`);let e=this._frameCallback;this._frameCallback=null,this._frameCallbackId=0,this._lastFrameCallback=e,this._lastFrameTime=t,e(t)}else if(this._lastFrameCallback!==null){this._replaying=!0;try{this._lastFrameCallback(this._lastFrameTime)}finally{this._replaying=!1}}return!0}),!0});this.connect(`resize`,()=>{let e=this.get_allocated_width(),t=this.get_allocated_height();this._canvas&&(this._canvas.dispatchEvent(new Event(`resize`)),notifyElementResize(this._canvas,e,t));for(let n of this._resizeCallbacks)n(e,t);this._frameCallback&&this.requestAnimationFrame(this._frameCallback)}),this.connect(`unrealize`,()=>{this._renderTag!==null&&(this.disconnect(this._renderTag),this._renderTag=null),this._tickCallbackId!==null&&(this.remove_tick_callback(this._tickCallbackId),this._tickCallbackId=null),this._frameCallback=null,this._lastFrameCallback=null,this._lastFrameTime=0,this._replaying=!1,this._canvas=null})}get canvas(){return this._canvas}get rendererInfo(){return this._rendererInfo}onReady(e){if(this._canvas){let t=this._canvas.getContext(`webgl`);if(t){e(this._canvas,t);return}}this._readyCallbacks.push(e)}onWebGLReady(e){this.onReady(e)}_reportRenderer(e){let t=e.getExtension(`WEBGL_debug_renderer_info`),n=String(e.getParameter(t.UNMASKED_VENDOR_WEBGL)??``),r=String(e.getParameter(t.UNMASKED_RENDERER_WEBGL)??``);this._rendererInfo={vendor:n,renderer:r},isSoftwareRenderer(r)&&console.warn(`[@gjsify/webgl] GL is rasterised on the CPU by "${r}" (${n}) — this host exposes no usable GPU. Every draw call still works; fill-heavy or continuously animating content will be orders of magnitude slower than on hardware, which can look like a frozen window rather than a slow one. Read it yourself via WebGLBridge.rendererInfo or the WEBGL_debug_renderer_info extension.`)}onResize(e){this._resizeCallbacks.push(e)}requestAnimationFrame(e){let t=this._nextFrameId++;return this._replaying?t:(this._frameCallback=e,this._frameCallbackId=t,this.queue_render(),t)}cancelAnimationFrame(e){e!==0&&e===this._frameCallbackId&&(this._frameCallback=null,this._frameCallbackId=0,this._lastFrameCallback=null,this._lastFrameTime=0)}installGlobals(){let e=globalThis;e.requestAnimationFrame=e=>this.requestAnimationFrame(e),e.cancelAnimationFrame=e=>this.cancelAnimationFrame(e),e.WebGLRenderingContext=WebGLRenderingContext$1,e.WebGL2RenderingContext=yr,Object.defineProperty(globalThis,"devicePixelRatio",{get:()=>this.get_scale_factor()||1,configurable:!0});let t=this._timeOrigin;e.performance={now:()=>(B.get_monotonic_time()-t)/1e3,timeOrigin:Date.now()}}}),Ar={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},jr={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Mr=1e3,Nr=1001,Pr=1002,Fr=1003,Ir=1006,Lr=1008,Rr=1009,zr=1012,Br=1014,Vr=1015,Hr=1016,Ur=1017,Wr=1018,Gr=1020,Kr=1023,qr=1026,Jr=1027,Yr=1029,Xr=1030,Zr=1031,Qr=1033,$r=2300,ei=2301,ti=2302,ni=2303,ri=2400,ii=2401,ai=2402,oi=`srgb`,si=`srgb-linear`,ci=`linear`,li=`srgb`,ui=7680,di=2e3
|
|
99
99
|
/**
|
|
100
100
|
* @license
|
|
101
101
|
* Copyright 2010-2026 Three.js Authors
|
|
102
102
|
* SPDX-License-Identifier: MIT
|
|
103
103
|
*/
|
|
104
|
-
;function arrayNeedsUint32(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function isTypedArray(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function createElementNS(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function createCanvasElement(){let e=createElementNS(`canvas`);return e.style.display=`block`,e}const xi={};function log(...e){let t=`THREE.`+e.shift();console.log(t,...e)}function enhanceLogMessage(e){let t=e[0];if(typeof t==`string`&&t.startsWith(`TSL:`)){let t=e[1];t&&t.isStackTrace?e[0]+=` `+t.getLocation():e[1]=`Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.`}return e}function warn(...e){e=enhanceLogMessage(e);let t=`THREE.`+e.shift();{let n=e[0];n&&n.isStackTrace?console.warn(n.getError(t)):console.warn(t,...e)}}function error(...e){e=enhanceLogMessage(e);let t=`THREE.`+e.shift();{let n=e[0];n&&n.isStackTrace?console.error(n.getError(t)):console.error(t,...e)}}function warnOnce(...e){let t=e.join(` `);t in xi||(xi[t]=!0,warn(...e))}function probeAsync(e,t,n){return new Promise(function(r,i){function probe(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(probe,n);break;default:r()}}setTimeout(probe,n)})}const Si={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3};var EventDispatcher=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n<r;n++)t[n].call(this,e);e.target=null}}};const Ci=`00.01.02.03.04.05.06.07.08.09.0a.0b.0c.0d.0e.0f.10.11.12.13.14.15.16.17.18.19.1a.1b.1c.1d.1e.1f.20.21.22.23.24.25.26.27.28.29.2a.2b.2c.2d.2e.2f.30.31.32.33.34.35.36.37.38.39.3a.3b.3c.3d.3e.3f.40.41.42.43.44.45.46.47.48.49.4a.4b.4c.4d.4e.4f.50.51.52.53.54.55.56.57.58.59.5a.5b.5c.5d.5e.5f.60.61.62.63.64.65.66.67.68.69.6a.6b.6c.6d.6e.6f.70.71.72.73.74.75.76.77.78.79.7a.7b.7c.7d.7e.7f.80.81.82.83.84.85.86.87.88.89.8a.8b.8c.8d.8e.8f.90.91.92.93.94.95.96.97.98.99.9a.9b.9c.9d.9e.9f.a0.a1.a2.a3.a4.a5.a6.a7.a8.a9.aa.ab.ac.ad.ae.af.b0.b1.b2.b3.b4.b5.b6.b7.b8.b9.ba.bb.bc.bd.be.bf.c0.c1.c2.c3.c4.c5.c6.c7.c8.c9.ca.cb.cc.cd.ce.cf.d0.d1.d2.d3.d4.d5.d6.d7.d8.d9.da.db.dc.dd.de.df.e0.e1.e2.e3.e4.e5.e6.e7.e8.e9.ea.eb.ec.ed.ee.ef.f0.f1.f2.f3.f4.f5.f6.f7.f8.f9.fa.fb.fc.fd.fe.ff`.split(`.`);let wi=1234567;const Ti=Math.PI/180,Ei=180/Math.PI;function generateUUID(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(Ci[e&255]+Ci[e>>8&255]+Ci[e>>16&255]+Ci[e>>24&255]+`-`+Ci[t&255]+Ci[t>>8&255]+`-`+Ci[t>>16&15|64]+Ci[t>>24&255]+`-`+Ci[n&63|128]+Ci[n>>8&255]+`-`+Ci[n>>16&255]+Ci[n>>24&255]+Ci[r&255]+Ci[r>>8&255]+Ci[r>>16&255]+Ci[r>>24&255]).toLowerCase()}function clamp(e,t,n){return Math.max(t,Math.min(n,e))}function euclideanModulo(e,t){return(e%t+t)%t}function mapLinear(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function inverseLerp(e,t,n){return e===t?0:(n-e)/(t-e)}function lerp(e,t,n){return(1-n)*e+n*t}function damp(e,t,n,r){return lerp(e,t,1-Math.exp(-n*r))}function pingpong(e,t=1){return t-Math.abs(euclideanModulo(e,t*2)-t)}function smoothstep(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function smootherstep(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function randInt(e,t){return e+Math.floor(Math.random()*(t-e+1))}function randFloat(e,t){return e+Math.random()*(t-e)}function randFloatSpread(e){return e*(.5-Math.random())}function seededRandom(e){e!==void 0&&(wi=e);let t=wi+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function degToRad(e){return e*Ti}function radToDeg(e){return e*Ei}function isPowerOfTwo(e){return(e&e-1)==0&&e!==0}function ceilPowerOfTwo(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function floorPowerOfTwo(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function setQuaternionFromProperEuler(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:warn(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function denormalize(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}function normalize(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}const Di={DEG2RAD:Ti,RAD2DEG:Ei,generateUUID,clamp,euclideanModulo,mapLinear,inverseLerp,lerp,damp,pingpong,smoothstep,smootherstep,randInt,randFloat,randFloatSpread,seededRandom,degToRad,radToDeg,isPowerOfTwo,ceilPowerOfTwo,floorPowerOfTwo,setQuaternionFromProperEuler,normalize,denormalize};var Oi=class Vector2{static{Vector2.prototype.isVector2=!0}constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error(`THREE.Vector2: index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`THREE.Vector2: 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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.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){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[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,t){return this.x=clamp(this.x,e.x,t.x),this.y=clamp(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=clamp(this.x,e,t),this.y=clamp(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(clamp(n,e,t))}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){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Quaternion=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,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,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,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,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:warn(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(clamp(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),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*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),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}},P=class Vector3{static{Vector3.prototype.isVector3=!0}constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error(`THREE.Vector3: 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 Error(`THREE.Vector3: 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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.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,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Ai.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Ai.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,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,t){return this.x=clamp(this.x,e.x,t.x),this.y=clamp(this.y,e.y,t.y),this.z=clamp(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=clamp(this.x,e,t),this.y=clamp(this.y,e,t),this.z=clamp(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(clamp(n,e,t))}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,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return ki.copy(this).projectOnVector(e),this.sub(ki)}reflect(e){return this.sub(ki.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}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,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*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,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};const ki=new P,Ai=new Quaternion;var ji=class Matrix3{static{Matrix3.prototype.isMatrix3=!0}constructor(e,t,n,r,i,a,o,s,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return warnOnce(`Matrix3: .scale() is deprecated. Use .makeScale() instead.`),this.premultiply(Mi.makeScale(e,t)),this}rotate(e){return warnOnce(`Matrix3: .rotate() is deprecated. Use .makeRotation() instead.`),this.premultiply(Mi.makeRotation(-e)),this}translate(e,t){return warnOnce(`Matrix3: .translate() is deprecated. Use .makeTranslation() instead.`),this.premultiply(Mi.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};const Mi=new ji,Ni=new ji().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Pi=new ji().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function createColorManagement(){let e={enabled:!0,workingColorSpace:gi,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=SRGBToLinear(e.r),e.g=SRGBToLinear(e.g),e.b=SRGBToLinear(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=LinearToSRGB(e.r),e.g=LinearToSRGB(e.g),e.b=LinearToSRGB(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?_i:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return warnOnce(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return warnOnce(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[gi]:{primaries:t,whitePoint:r,transfer:_i,toXYZ:Ni,fromXYZ:Pi,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:hi},outputColorSpaceConfig:{drawingBufferColorSpace:hi}},[hi]:{primaries:t,whitePoint:r,transfer:vi,toXYZ:Ni,fromXYZ:Pi,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:hi}}}),e}const Fi=createColorManagement();function SRGBToLinear(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function LinearToSRGB(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}let Ii;var ImageUtils=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Ii===void 0&&(Ii=createElementNS(`canvas`)),Ii.width=e.width,Ii.height=e.height;let t=Ii.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=Ii}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=createElementNS(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=SRGBToLinear(i[e]/255)*255;return n.putImageData(r,0,0),t}else if(e.data){let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(SRGBToLinear(t[e]/255)*255):t[e]=SRGBToLinear(t[e]);return{data:t,width:e.width,height:e.height}}else return warn(`ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.`),e}};let Li=0;var Source=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Li++}),this.uuid=generateUUID(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let t=this.data;return typeof HTMLVideoElement<`u`&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<`u`&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t===null?e.set(0,0,0):e.set(t.width,t.height,t.depth||0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:``},r=this.data;if(r!==null){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(serializeImage(r[t].image)):e.push(serializeImage(r[t]))}else e=serializeImage(r);n.url=e}return t||(e.images[this.uuid]=n),n}};function serializeImage(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap?ImageUtils.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(warn(`Texture: Unable to serialize Texture.`),{})}let Ri=0;const zi=new P;var Bi=class Texture extends EventDispatcher{constructor(e=Texture.DEFAULT_IMAGE,t=Texture.DEFAULT_MAPPING,n=Hr,r=Hr,i=Gr,a=Kr,o=ti,s=qr,c=Texture.DEFAULT_ANISOTROPY,l=``){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Ri++}),this.uuid=generateUUID(),this.name=``,this.source=new Source(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=s,this.offset=new Oi(0,0),this.repeat=new Oi(1,1),this.center=new Oi(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ji,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(zi).x}get height(){return this.source.getSize(zi).y}get depth(){return this.source.getSize(zi).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){warn(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){warn(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:`Texture`,generator:`Texture.toJSON`},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Vr:e.x-=Math.floor(e.x);break;case Hr:e.x=e.x<0?0:1;break;case Ur:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Vr:e.y-=Math.floor(e.y);break;case Hr:e.y=e.y<0?0:1;break;case Ur:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(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++}};Bi.DEFAULT_IMAGE=null,Bi.DEFAULT_MAPPING=300,Bi.DEFAULT_ANISOTROPY=1;var Vi=class Vector4{static{Vector4.prototype.isVector4=!0}constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error(`THREE.Vector4: 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 Error(`THREE.Vector4: 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?1:e.w,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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.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){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)<a&&Math.abs(u-m)<a&&Math.abs(p-h)<a){if(Math.abs(l+d)<o&&Math.abs(u+m)<o&&Math.abs(p+h)<o&&Math.abs(c+f+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;let e=(c+1)/2,s=(f+1)/2,_=(g+1)/2,v=(l+d)/4,y=(u+m)/4,b=(p+h)/4;return e>s&&e>_?e<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=v/n,i=y/n):s>_?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=b/r):_<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=y/i,r=b/i),this.set(n,r,i,t),this}let _=Math.sqrt((h-p)*(h-p)+(u-m)*(u-m)+(d-l)*(d-l));return Math.abs(_)<.001&&(_=1),this.x=(h-p)/_,this.y=(u-m)/_,this.z=(d-l)/_,this.w=Math.acos((c+f+g-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[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,t){return this.x=clamp(this.x,e.x,t.x),this.y=clamp(this.y,e.y,t.y),this.z=clamp(this.z,e.z,t.z),this.w=clamp(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=clamp(this.x,e,t),this.y=clamp(this.y,e,t),this.z=clamp(this.z,e,t),this.w=clamp(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(clamp(n,e,t))}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,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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}},RenderTarget=class extends EventDispatcher{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Gr,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new Vi(0,0,e,t),this.scissorTest=!1,this.viewport=new Vi(0,0,e,t),this.textures=[];let r=new Bi({width:e,height:t,depth:n.depth}),i=n.count;for(let e=0;e<i;e++)this.textures[e]=r.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview,this.useArrayDepthTexture=n.useArrayDepthTexture}_setTextureOptions(e={}){let t={minFilter:Gr,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let e=0;e<this.textures.length;e++)this.textures[e].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;let n=Object.assign({},e.textures[t].image);this.textures[t].source=new Source(n)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:`dispose`})}},WebGLRenderTarget=class extends RenderTarget{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}},DataArrayTexture=class extends Bi{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Wr,this.minFilter=Wr,this.wrapR=Hr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},Data3DTexture=class extends Bi{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Wr,this.minFilter=Wr,this.wrapR=Hr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Hi=class Matrix4{static{Matrix4.prototype.isMatrix4=!0}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,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 Matrix4().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinantAffine()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinantAffine()===0)return this.identity();let t=this.elements,n=e.elements,r=1/Ui.setFromMatrixColumn(e,0).length(),i=1/Ui.setFromMatrixColumn(e,1).length(),a=1/Ui.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Gi,e,Ki)}lookAt(e,t,n){let r=this.elements;return Yi.subVectors(e,t),Yi.lengthSq()===0&&(Yi.z=1),Yi.normalize(),qi.crossVectors(n,Yi),qi.lengthSq()===0&&(Math.abs(n.z)===1?Yi.x+=1e-4:Yi.z+=1e-4,Yi.normalize(),qi.crossVectors(n,Yi)),qi.normalize(),Ji.crossVectors(Yi,qi),r[0]=qi.x,r[4]=Ji.x,r[8]=Yi.x,r[1]=qi.y,r[5]=Ji.y,r[9]=Yi.y,r[2]=qi.z,r[6]=Ji.z,r[10]=Yi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],k=r[2],A=r[6],ee=r[10],te=r[14],j=r[3],ne=r[7],re=r[11],ie=r[15];return i[0]=a*x+o*T+s*k+c*j,i[4]=a*S+o*E+s*A+c*ne,i[8]=a*C+o*D+s*ee+c*re,i[12]=a*w+o*O+s*te+c*ie,i[1]=l*x+u*T+d*k+f*j,i[5]=l*S+u*E+d*A+f*ne,i[9]=l*C+u*D+d*ee+f*re,i[13]=l*w+u*O+d*te+f*ie,i[2]=p*x+m*T+h*k+g*j,i[6]=p*S+m*E+h*A+g*ne,i[10]=p*C+m*D+h*ee+g*re,i[14]=p*w+m*O+h*te+g*ie,i[3]=_*x+v*T+y*k+b*j,i[7]=_*S+v*E+y*A+b*ne,i[11]=_*C+v*D+y*ee+b*re,i[15]=_*w+v*O+y*te+b*ie,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15],_=s*f-c*d,v=o*f-c*u,y=o*d-s*u,b=a*f-c*l,x=a*d-s*l,S=a*u-o*l;return t*(m*_-h*v+g*y)-n*(p*_-h*b+g*x)+r*(p*v-m*b+g*S)-i*(p*y-m*x+h*S)}determinantAffine(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[1],a=e[5],o=e[9],s=e[2],c=e[6],l=e[10];return t*(a*l-o*c)-n*(i*l-o*s)+r*(i*c-a*s)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=t*o-n*a,v=t*s-r*a,y=t*c-i*a,b=n*s-r*o,x=n*c-i*o,S=r*c-i*s,C=l*m-u*p,w=l*h-d*p,T=l*g-f*p,E=u*h-d*m,D=u*g-f*m,O=d*g-f*h,k=_*O-v*D+y*E+b*T-x*w+S*C;if(k===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let A=1/k;return e[0]=(o*O-s*D+c*E)*A,e[1]=(r*D-n*O-i*E)*A,e[2]=(m*S-h*x+g*b)*A,e[3]=(d*x-u*S-f*b)*A,e[4]=(s*T-a*O-c*w)*A,e[5]=(t*O-r*T+i*w)*A,e[6]=(h*y-p*S-g*v)*A,e[7]=(l*S-d*y+f*v)*A,e[8]=(a*D-o*T+c*C)*A,e[9]=(n*T-t*D-i*C)*A,e[10]=(p*x-m*y+g*_)*A,e[11]=(u*y-l*x-f*_)*A,e[12]=(o*w-a*E-s*C)*A,e[13]=(t*E-n*w+r*C)*A,e[14]=(m*v-p*b-h*_)*A,e[15]=(l*b-u*v+d*_)*A,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){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,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];let i=this.determinantAffine();if(i===0)return n.set(1,1,1),t.identity(),this;let a=Ui.set(r[0],r[1],r[2]).length(),o=Ui.set(r[4],r[5],r[6]).length(),s=Ui.set(r[8],r[9],r[10]).length();i<0&&(a=-a),Wi.copy(this);let c=1/a,l=1/o,u=1/s;return Wi.elements[0]*=c,Wi.elements[1]*=c,Wi.elements[2]*=c,Wi.elements[4]*=l,Wi.elements[5]*=l,Wi.elements[6]*=l,Wi.elements[8]*=u,Wi.elements[9]*=u,Wi.elements[10]*=u,t.setFromRotationMatrix(Wi),n.x=a,n.y=o,n.z=s,this}makePerspective(e,t,n,r,i,a,o=bi,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===2e3)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else if(o===2001)p=-a/(a-i),m=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=bi,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===2e3)p=-2/(a-i),m=-(a+i)/(a-i);else if(o===2001)p=-1/(a-i),m=-i/(a-i);else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};const Ui=new P,Wi=new Hi,Gi=new P(0,0,0),Ki=new P(1,1,1),qi=new P,Ji=new P,Yi=new P,Xi=new Hi,Zi=new Quaternion;var Qi=class Euler{constructor(e=0,t=0,n=0,r=Euler.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}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,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,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,t=this._order,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(clamp(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-clamp(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(clamp(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-clamp(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(clamp(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-clamp(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:warn(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Xi.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Xi,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Zi.setFromEuler(this),this.setFromQuaternion(Zi,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=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+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}};Qi.DEFAULT_ORDER=`XYZ`;var Layers=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!=0}};let $i=0;const ea=new P,ta=new Quaternion,na=new Hi,ra=new P,ia=new P,aa=new P,oa=new Quaternion,sa=new P(1,0,0),ca=new P(0,1,0),la=new P(0,0,1),ua={type:`added`},da={type:`removed`},fa={type:`childadded`,child:null},pa={type:`childremoved`,child:null};var ma=class Object3D extends EventDispatcher{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:$i++}),this.uuid=generateUUID(),this.name=``,this.type=`Object3D`,this.parent=null,this.children=[],this.up=Object3D.DEFAULT_UP.clone();let e=new P,t=new Qi,n=new Quaternion,r=new P(1,1,1);function onRotationChange(){n.setFromEuler(t,!1)}function onQuaternionChange(){t.setFromQuaternion(n,void 0,!1)}t._onChange(onRotationChange),n._onChange(onQuaternionChange),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Hi},normalMatrix:{value:new ji}}),this.matrix=new Hi,this.matrixWorld=new Hi,this.matrixAutoUpdate=Object3D.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Layers,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return ta.setFromAxisAngle(e,t),this.quaternion.multiply(ta),this}rotateOnWorldAxis(e,t){return ta.setFromAxisAngle(e,t),this.quaternion.premultiply(ta),this}rotateX(e){return this.rotateOnAxis(sa,e)}rotateY(e){return this.rotateOnAxis(ca,e)}rotateZ(e){return this.rotateOnAxis(la,e)}translateOnAxis(e,t){return ea.copy(e).applyQuaternion(this.quaternion),this.position.add(ea.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(sa,e)}translateY(e){return this.translateOnAxis(ca,e)}translateZ(e){return this.translateOnAxis(la,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(na.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?ra.copy(e):ra.set(e,t,n);let r=this.parent;this.updateWorldMatrix(!0,!1),ia.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?na.lookAt(ia,ra,this.up):na.lookAt(ra,ia,this.up),this.quaternion.setFromRotationMatrix(na),r&&(na.extractRotation(r.matrixWorld),ta.setFromRotationMatrix(na),this.quaternion.premultiply(ta.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(error(`Object3D.add: object can't be added as a child of itself.`,e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(ua),fa.child=e,this.dispatchEvent(fa),fa.child=null):error(`Object3D.add: object not an instance of THREE.Object3D.`,e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(da),pa.child=e,this.dispatchEvent(pa),pa.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),na.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),na.multiply(e.parent.matrixWorld)),e.applyMatrix4(na),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(ua),fa.child=e,this.dispatchEvent(fa),fa.child=null,this}getObjectById(e){return this.getObjectByProperty(`id`,e)}getObjectByName(e){return this.getObjectByProperty(`name`,e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){let r=this.children[n].getObjectByProperty(e,t);if(r!==void 0)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ia,e,aa),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ia,oa,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let e=this.pivot;if(e!==null){let t=e.x,n=e.y,r=e.z,i=this.matrix.elements;i[12]+=t-i[0]*t-i[4]*n-i[8]*r,i[13]+=n-i[1]*t-i[5]*n-i[9]*r,i[14]+=r-i[2]*t-i[6]*n-i[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t,n=!1){let r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,n=!0),t===!0){let e=this.children;for(let t=0,r=e.length;t<r;t++)e[t].updateWorldMatrix(!1,!0,n)}}toJSON(e){let t=e===void 0||typeof e==`string`,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:`Object`,generator:`Object3D.toJSON`});let r={};r.uuid=this.uuid,r.type=this.type,this.name!==``&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function serialize(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=serialize(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){let r=n[t];serialize(e.shapes,r)}else serialize(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(serialize(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(serialize(e.materials,this.material[n]));r.material=t}else r.material=serialize(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){let n=this.animations[t];r.animations.push(serialize(e.animations,n))}}if(t){let t=extractFromCache(e.geometries),r=extractFromCache(e.materials),i=extractFromCache(e.textures),a=extractFromCache(e.images),o=extractFromCache(e.shapes),s=extractFromCache(e.skeletons),c=extractFromCache(e.animations),l=extractFromCache(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),s.length>0&&(n.skeletons=s),c.length>0&&(n.animations=c),l.length>0&&(n.nodes=l)}return n.object=r,n;function extractFromCache(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!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.pivot=e.pivot===null?null:e.pivot.clone(),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.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let t=0;t<e.children.length;t++){let n=e.children[t];this.add(n.clone())}return this}};ma.DEFAULT_UP=new P(0,1,0),ma.DEFAULT_MATRIX_AUTO_UPDATE=!0,ma.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Group=class extends ma{constructor(){super(),this.isGroup=!0,this.type=`Group`}};const ha={type:`move`};var WebXRController=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Group,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 Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new P,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new P),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new P,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new P,this._grip.eventsEnabled=!1),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){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}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,t,n){let r=null,i=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(e&&t.session.visibilityState!==`visible-blurred`){if(c&&e.hand){a=!0;for(let r of e.hand.values()){let e=t.getJointPose(r,n),i=this._getHandJoint(c,r);e!==null&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=e!==null}let r=c.joints[`index-finger-tip`],i=c.joints[`thumb-tip`],o=r.position.distanceTo(i.position);c.inputState.pinching&&o>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,s.eventsEnabled&&s.dispatchEvent({type:`gripUpdated`,data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(ha)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new Group;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}};const ga={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},_a={h:0,s:0,l:0},va={h:0,s:0,l:0};function hue2rgb(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var Color=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=hi){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Fi.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=Fi.workingColorSpace){return this.r=e,this.g=t,this.b=n,Fi.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=Fi.workingColorSpace){if(e=euclideanModulo(e,1),t=clamp(t,0,1),n=clamp(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=hue2rgb(i,r,e+1/3),this.g=hue2rgb(i,r,e),this.b=hue2rgb(i,r,e-1/3)}return Fi.colorSpaceToWorking(this,r),this}setStyle(e,t=hi){function handleAlpha(t){t!==void 0&&parseFloat(t)<1&&warn(`Color: Alpha component of `+e+` will be ignored.`)}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let r,i=n[1],a=n[2];switch(i){case`rgb`:case`rgba`:if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return handleAlpha(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,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return handleAlpha(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,t);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 handleAlpha(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:warn(`Color: Unknown color model `+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let r=n[1],i=r.length;if(i===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(r,16),t);warn(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=hi){let n=ga[e.toLowerCase()];return n===void 0?warn(`Color: Unknown color `+e):this.setHex(n,t),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=SRGBToLinear(e.r),this.g=SRGBToLinear(e.g),this.b=SRGBToLinear(e.b),this}copyLinearToSRGB(e){return this.r=LinearToSRGB(e.r),this.g=LinearToSRGB(e.g),this.b=LinearToSRGB(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=hi){return Fi.workingToColorSpace(ya.copy(this),e),Math.round(clamp(ya.r*255,0,255))*65536+Math.round(clamp(ya.g*255,0,255))*256+Math.round(clamp(ya.b*255,0,255))}getHexString(e=hi){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Fi.workingColorSpace){Fi.workingToColorSpace(ya.copy(this),t);let n=ya.r,r=ya.g,i=ya.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r<i?6:0);break;case r:s=(i-n)/e+2;break;case i:s=(n-r)/e+4;break}s/=6}return e.h=s,e.s=c,e.l=l,e}getRGB(e,t=Fi.workingColorSpace){return Fi.workingToColorSpace(ya.copy(this),t),e.r=ya.r,e.g=ya.g,e.b=ya.b,e}getStyle(e=hi){Fi.workingToColorSpace(ya.copy(this),e);let t=ya.r,n=ya.g,r=ya.b;return e===`srgb`?`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`:`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`}offsetHSL(e,t,n){return this.getHSL(_a),this.setHSL(_a.h+e,_a.s+t,_a.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(_a),e.getHSL(va);let n=lerp(_a.h,va.h,t),r=lerp(_a.s,va.s,t),i=lerp(_a.l,va.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const ya=new Color;Color.NAMES=ga;var Scene=class extends ma{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 Qi,this.environmentIntensity=1,this.environmentRotation=new Qi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}copy(e,t){return super.copy(e,t),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){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}};const ba=new P,xa=new P,Sa=new P,Ca=new P,wa=new P,Ta=new P,Ea=new P,Da=new P,Oa=new P,ka=new P,Aa=new Vi,ja=new Vi,Ma=new Vi;var Na=class Triangle{constructor(e=new P,t=new P,n=new P){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),ba.subVectors(e,t),r.cross(ba);let i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){ba.subVectors(r,t),xa.subVectors(n,t),Sa.subVectors(e,t);let a=ba.dot(ba),o=ba.dot(xa),s=ba.dot(Sa),c=xa.dot(xa),l=xa.dot(Sa),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Ca)===null?!1:Ca.x>=0&&Ca.y>=0&&Ca.x+Ca.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Ca)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,Ca.x),s.addScaledVector(a,Ca.y),s.addScaledVector(o,Ca.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return Aa.setScalar(0),ja.setScalar(0),Ma.setScalar(0),Aa.fromBufferAttribute(e,t),ja.fromBufferAttribute(e,n),Ma.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(Aa,i.x),a.addScaledVector(ja,i.y),a.addScaledVector(Ma,i.z),a}static isFrontFacing(e,t,n,r){return ba.subVectors(n,t),xa.subVectors(e,t),ba.cross(xa).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),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 ba.subVectors(this.c,this.b),xa.subVectors(this.a,this.b),ba.cross(xa).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Triangle.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Triangle.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,i){return Triangle.getInterpolation(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return Triangle.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Triangle.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;wa.subVectors(r,n),Ta.subVectors(i,n),Da.subVectors(e,n);let s=wa.dot(Da),c=Ta.dot(Da);if(s<=0&&c<=0)return t.copy(n);Oa.subVectors(e,r);let l=wa.dot(Oa),u=Ta.dot(Oa);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(wa,a);ka.subVectors(e,i);let f=wa.dot(ka),p=Ta.dot(ka);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(Ta,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return Ea.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(Ea,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(wa,a).addScaledVector(Ta,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},Box3=class{constructor(e=new P(1/0,1/0,1/0),t=new P(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(Fa.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Fa.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=Fa.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let n=e.geometry;if(n!==void 0){let r=n.getAttribute(`position`);if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let t=0,n=r.count;t<n;t++)e.isMesh===!0?e.getVertexPosition(t,Fa):Fa.fromBufferAttribute(r,t),Fa.applyMatrix4(e.matrixWorld),this.expandByPoint(Fa);else e.boundingBox===void 0?(n.boundingBox===null&&n.computeBoundingBox(),Ia.copy(n.boundingBox)):(e.boundingBox===null&&e.computeBoundingBox(),Ia.copy(e.boundingBox)),Ia.applyMatrix4(e.matrixWorld),this.union(Ia)}let r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],t);return this}containsPoint(e){return e.x>=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,t){return t.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,Fa),Fa.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ua),Wa.subVectors(this.max,Ua),La.subVectors(e.a,Ua),Ra.subVectors(e.b,Ua),za.subVectors(e.c,Ua),Ba.subVectors(Ra,La),Va.subVectors(za,Ra),Ha.subVectors(La,za);let t=[0,-Ba.z,Ba.y,0,-Va.z,Va.y,0,-Ha.z,Ha.y,Ba.z,0,-Ba.x,Va.z,0,-Va.x,Ha.z,0,-Ha.x,-Ba.y,Ba.x,0,-Va.y,Va.x,0,-Ha.y,Ha.x,0];return!satForAxes(t,La,Ra,za,Wa)||(t=[1,0,0,0,1,0,0,0,1],!satForAxes(t,La,Ra,za,Wa))?!1:(Ga.crossVectors(Ba,Va),t=[Ga.x,Ga.y,Ga.z],satForAxes(t,La,Ra,za,Wa))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Fa).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Fa).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:(Pa[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Pa[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Pa[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Pa[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Pa[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Pa[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Pa[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Pa[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Pa),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)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}};const Pa=[new P,new P,new P,new P,new P,new P,new P,new P],Fa=new P,Ia=new Box3,La=new P,Ra=new P,za=new P,Ba=new P,Va=new P,Ha=new P,Ua=new P,Wa=new P,Ga=new P,Ka=new P;function satForAxes(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){Ka.fromArray(e,a);let o=i.x*Math.abs(Ka.x)+i.y*Math.abs(Ka.y)+i.z*Math.abs(Ka.z),s=t.dot(Ka),c=n.dot(Ka),l=r.dot(Ka);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}const qa=new P,Ja=new Oi;let Ya=0;var BufferAttribute=class extends EventDispatcher{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Ya++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=35044,this.updateRanges=[],this.gpuType=Xr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}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,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Ja.fromBufferAttribute(this,t),Ja.applyMatrix3(e),this.setXY(t,Ja.x,Ja.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)qa.fromBufferAttribute(this,t),qa.applyMatrix3(e),this.setXYZ(t,qa.x,qa.y,qa.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)qa.fromBufferAttribute(this,t),qa.applyMatrix4(e),this.setXYZ(t,qa.x,qa.y,qa.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)qa.fromBufferAttribute(this,t),qa.applyNormalMatrix(e),this.setXYZ(t,qa.x,qa.y,qa.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)qa.fromBufferAttribute(this,t),qa.transformDirection(e),this.setXYZ(t,qa.x,qa.y,qa.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=denormalize(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=normalize(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=denormalize(t,this.array)),t}setX(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=denormalize(t,this.array)),t}setY(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=denormalize(t,this.array)),t}setZ(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=denormalize(t,this.array)),t}setW(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=normalize(t,this.array),n=normalize(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=normalize(t,this.array),n=normalize(n,this.array),r=normalize(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=normalize(t,this.array),n=normalize(n,this.array),r=normalize(r,this.array),i=normalize(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==``&&(e.name=this.name),this.usage!==35044&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:`dispose`})}},Uint16BufferAttribute=class extends BufferAttribute{constructor(e,t,n){super(new Uint16Array(e),t,n)}},Uint32BufferAttribute=class extends BufferAttribute{constructor(e,t,n){super(new Uint32Array(e),t,n)}},Float32BufferAttribute=class extends BufferAttribute{constructor(e,t,n){super(new Float32Array(e),t,n)}};const Xa=new Box3,Za=new P,Qa=new P;var Sphere=class{constructor(e=new P,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t===void 0?Xa.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}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*=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;Za.subVectors(e,this.center);let t=Za.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(Za,n/e),this.radius+=n}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):(Qa.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Za.copy(e.center).add(Qa)),this.expandByPoint(Za.copy(e.center).sub(Qa))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}};let $a=0;const eo=new Hi,to=new ma,no=new P,ro=new Box3,io=new Box3,ao=new P;var oo=class BufferGeometry extends EventDispatcher{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:$a++}),this.uuid=generateUUID(),this.name=``,this.type=`BufferGeometry`,this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(arrayNeedsUint32(e)?Uint32BufferAttribute:Uint16BufferAttribute)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let t=new ji().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return eo.makeRotationFromQuaternion(e),this.applyMatrix4(eo),this}rotateX(e){return eo.makeRotationX(e),this.applyMatrix4(eo),this}rotateY(e){return eo.makeRotationY(e),this.applyMatrix4(eo),this}rotateZ(e){return eo.makeRotationZ(e),this.applyMatrix4(eo),this}translate(e,t,n){return eo.makeTranslation(e,t,n),this.applyMatrix4(eo),this}scale(e,t,n){return eo.makeScale(e,t,n),this.applyMatrix4(eo),this}lookAt(e){return to.lookAt(e),to.updateMatrix(),this.applyMatrix4(to.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(no).negate(),this.translate(no.x,no.y,no.z),this}setFromPoints(e){let t=this.getAttribute(`position`);if(t===void 0){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];t.push(r.x,r.y,r.z||0)}this.setAttribute(`position`,new Float32BufferAttribute(t,3))}else{let n=Math.min(e.length,t.count);for(let r=0;r<n;r++){let n=e[r];t.setXYZ(r,n.x,n.y,n.z||0)}e.length>t.count&&warn(`BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.`),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Box3);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){error(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new P(-1/0,-1/0,-1/0),new P(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];ro.setFromBufferAttribute(n),this.morphTargetsRelative?(ao.addVectors(this.boundingBox.min,ro.min),this.boundingBox.expandByPoint(ao),ao.addVectors(this.boundingBox.max,ro.max),this.boundingBox.expandByPoint(ao)):(this.boundingBox.expandByPoint(ro.min),this.boundingBox.expandByPoint(ro.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&error(`BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.`,this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Sphere);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){error(`BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.`,this),this.boundingSphere.set(new P,1/0);return}if(e){let n=this.boundingSphere.center;if(ro.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];io.setFromBufferAttribute(n),this.morphTargetsRelative?(ao.addVectors(ro.min,io.min),ro.expandByPoint(ao),ao.addVectors(ro.max,io.max),ro.expandByPoint(ao)):(ro.expandByPoint(io.min),ro.expandByPoint(io.max))}ro.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)ao.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(ao));if(t)for(let i=0,a=t.length;i<a;i++){let a=t[i],o=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)ao.fromBufferAttribute(a,t),o&&(no.fromBufferAttribute(e,t),ao.add(no)),r=Math.max(r,n.distanceToSquared(ao))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&error(`BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.`,this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){error(`BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)`);return}let n=t.position,r=t.normal,i=t.uv,a=this.getAttribute(`tangent`);(a===void 0||a.count!==n.count)&&(a=new BufferAttribute(new Float32Array(4*n.count),4),this.setAttribute(`tangent`,a));let o=[],s=[];for(let e=0;e<n.count;e++)o[e]=new P,s[e]=new P;let c=new P,l=new P,u=new P,d=new Oi,f=new Oi,p=new Oi,m=new P,h=new P;function handleTriangle(e,t,r){c.fromBufferAttribute(n,e),l.fromBufferAttribute(n,t),u.fromBufferAttribute(n,r),d.fromBufferAttribute(i,e),f.fromBufferAttribute(i,t),p.fromBufferAttribute(i,r),l.sub(c),u.sub(c),f.sub(d),p.sub(d);let a=1/(f.x*p.y-p.x*f.y);isFinite(a)&&(m.copy(l).multiplyScalar(p.y).addScaledVector(u,-f.y).multiplyScalar(a),h.copy(u).multiplyScalar(f.x).addScaledVector(l,-p.x).multiplyScalar(a),o[e].add(m),o[t].add(m),o[r].add(m),s[e].add(h),s[t].add(h),s[r].add(h))}let g=this.groups;g.length===0&&(g=[{start:0,count:e.count}]);for(let t=0,n=g.length;t<n;++t){let n=g[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)handleTriangle(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let _=new P,v=new P,y=new P,b=new P;function handleVertex(e){y.fromBufferAttribute(r,e),b.copy(y);let t=o[e];_.copy(t),_.sub(y.multiplyScalar(y.dot(t))).normalize(),v.crossVectors(b,t);let n=v.dot(s[e])<0?-1:1;a.setXYZW(e,_.x,_.y,_.z,n)}for(let t=0,n=g.length;t<n;++t){let n=g[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)handleVertex(e.getX(t+0)),handleVertex(e.getX(t+1)),handleVertex(e.getX(t+2))}this._transformed=!0}computeVertexNormals(){let e=this.index,t=this.getAttribute(`position`);if(t!==void 0){let n=this.getAttribute(`normal`);if(n===void 0||n.count!==t.count)n=new BufferAttribute(new Float32Array(t.count*3),3),this.setAttribute(`normal`,n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);let r=new P,i=new P,a=new P,o=new P,s=new P,c=new P,l=new P,u=new P;if(e)for(let d=0,f=e.count;d<f;d+=3){let f=e.getX(d+0),p=e.getX(d+1),m=e.getX(d+2);r.fromBufferAttribute(t,f),i.fromBufferAttribute(t,p),a.fromBufferAttribute(t,m),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),o.fromBufferAttribute(n,f),s.fromBufferAttribute(n,p),c.fromBufferAttribute(n,m),o.add(l),s.add(l),c.add(l),n.setXYZ(f,o.x,o.y,o.z),n.setXYZ(p,s.x,s.y,s.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let e=0,o=t.count;e<o;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),n.setXYZ(e+0,l.x,l.y,l.z),n.setXYZ(e+1,l.x,l.y,l.z),n.setXYZ(e+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)ao.fromBufferAttribute(e,t),ao.normalize(),e.setXYZ(t,ao.x,ao.y,ao.z)}toNonIndexed(){function convertBufferAttribute(e,t){let n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0;for(let i=0,c=t.length;i<c;i++){o=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)a[s++]=n[o++]}return new BufferAttribute(a,r,i)}if(this.index===null)return warn(`BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.`),this;let e=new BufferGeometry,t=this.index.array,n=this.attributes;for(let r in n){let i=n[r],a=convertBufferAttribute(i,t);e.setAttribute(r,a)}let r=this.morphAttributes;for(let n in r){let i=[],a=r[n];for(let e=0,n=a.length;e<n;e++){let n=a[e],r=convertBufferAttribute(n,t);i.push(r)}e.morphAttributes[n]=i}e.morphTargetsRelative=this.morphTargetsRelative;let i=this.groups;for(let t=0,n=i.length;t<n;t++){let n=i[t];e.addGroup(n.start,n.count,n.materialIndex)}return e}toJSON(){let e={metadata:{version:4.7,type:`BufferGeometry`,generator:`BufferGeometry.toJSON`}};if(e.uuid=this.uuid,e.type=this.parameters!==void 0&&this._transformed===!0?`BufferGeometry`:this.type,this.name!==``&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0&&this._transformed!==!0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t<r;t++){let r=n[t];a.push(r.toJSON(e.data))}a.length>0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),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;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());let s=e.boundingSphere;return s!==null&&(this.boundingSphere=s.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}dispose(){this.dispatchEvent({type:`dispose`})}};let so=0;var Material=class extends EventDispatcher{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:so++}),this.uuid=generateUUID(),this.name=``,this.type=`Material`,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Color(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=yi,this.stencilZFail=yi,this.stencilZPass=yi,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){warn(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){warn(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector2&&n&&n.isVector2||r&&r.isEuler&&n&&n.isEuler||r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function extractFromCache(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=extractFromCache(e.textures),r=extractFromCache(e.images);t.length>0&&(n.textures=t),r.length>0&&(n.images=r)}return n}fromJSON(e,t){if(e.uuid!==void 0&&(this.uuid=e.uuid),e.name!==void 0&&(this.name=e.name),e.color!==void 0&&this.color!==void 0&&this.color.setHex(e.color),e.roughness!==void 0&&(this.roughness=e.roughness),e.metalness!==void 0&&(this.metalness=e.metalness),e.sheen!==void 0&&(this.sheen=e.sheen),e.sheenColor!==void 0&&(this.sheenColor=new Color().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(this.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&this.emissive!==void 0&&this.emissive.setHex(e.emissive),e.specular!==void 0&&this.specular!==void 0&&this.specular.setHex(e.specular),e.specularIntensity!==void 0&&(this.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&this.specularColor!==void 0&&this.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(this.shininess=e.shininess),e.clearcoat!==void 0&&(this.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(this.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(this.dispersion=e.dispersion),e.iridescence!==void 0&&(this.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(this.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(this.transmission=e.transmission),e.thickness!==void 0&&(this.thickness=e.thickness),e.attenuationDistance!==void 0&&(this.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&this.attenuationColor!==void 0&&this.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(this.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(this.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(this.fog=e.fog),e.flatShading!==void 0&&(this.flatShading=e.flatShading),e.blending!==void 0&&(this.blending=e.blending),e.combine!==void 0&&(this.combine=e.combine),e.side!==void 0&&(this.side=e.side),e.shadowSide!==void 0&&(this.shadowSide=e.shadowSide),e.opacity!==void 0&&(this.opacity=e.opacity),e.transparent!==void 0&&(this.transparent=e.transparent),e.alphaTest!==void 0&&(this.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(this.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(this.depthFunc=e.depthFunc),e.depthTest!==void 0&&(this.depthTest=e.depthTest),e.depthWrite!==void 0&&(this.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(this.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(this.blendSrc=e.blendSrc),e.blendDst!==void 0&&(this.blendDst=e.blendDst),e.blendEquation!==void 0&&(this.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(this.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(this.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(this.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&this.blendColor!==void 0&&this.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(this.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(this.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(this.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(this.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(this.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(this.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(this.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(this.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(this.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(this.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(this.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(this.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(this.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(this.rotation=e.rotation),e.linewidth!==void 0&&(this.linewidth=e.linewidth),e.dashSize!==void 0&&(this.dashSize=e.dashSize),e.gapSize!==void 0&&(this.gapSize=e.gapSize),e.scale!==void 0&&(this.scale=e.scale),e.polygonOffset!==void 0&&(this.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(this.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(this.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(this.dithering=e.dithering),e.alphaToCoverage!==void 0&&(this.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(this.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(this.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(this.allowOverride=e.allowOverride),e.visible!==void 0&&(this.visible=e.visible),e.toneMapped!==void 0&&(this.toneMapped=e.toneMapped),e.userData!==void 0&&(this.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors==`number`?this.vertexColors=e.vertexColors>0:this.vertexColors=e.vertexColors),e.size!==void 0&&(this.size=e.size),e.sizeAttenuation!==void 0&&(this.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(this.map=t[e.map]||null),e.matcap!==void 0&&(this.matcap=t[e.matcap]||null),e.alphaMap!==void 0&&(this.alphaMap=t[e.alphaMap]||null),e.bumpMap!==void 0&&(this.bumpMap=t[e.bumpMap]||null),e.bumpScale!==void 0&&(this.bumpScale=e.bumpScale),e.normalMap!==void 0&&(this.normalMap=t[e.normalMap]||null),e.normalMapType!==void 0&&(this.normalMapType=e.normalMapType),e.normalScale!==void 0){let t=e.normalScale;Array.isArray(t)===!1&&(t=[t,t]),this.normalScale=new Oi().fromArray(t)}return e.displacementMap!==void 0&&(this.displacementMap=t[e.displacementMap]||null),e.displacementScale!==void 0&&(this.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(this.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(this.roughnessMap=t[e.roughnessMap]||null),e.metalnessMap!==void 0&&(this.metalnessMap=t[e.metalnessMap]||null),e.emissiveMap!==void 0&&(this.emissiveMap=t[e.emissiveMap]||null),e.emissiveIntensity!==void 0&&(this.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(this.specularMap=t[e.specularMap]||null),e.specularIntensityMap!==void 0&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),e.specularColorMap!==void 0&&(this.specularColorMap=t[e.specularColorMap]||null),e.envMap!==void 0&&(this.envMap=t[e.envMap]||null),e.envMapRotation!==void 0&&this.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(this.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(this.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(this.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(this.lightMap=t[e.lightMap]||null),e.lightMapIntensity!==void 0&&(this.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(this.aoMap=t[e.aoMap]||null),e.aoMapIntensity!==void 0&&(this.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(this.gradientMap=t[e.gradientMap]||null),e.clearcoatMap!==void 0&&(this.clearcoatMap=t[e.clearcoatMap]||null),e.clearcoatRoughnessMap!==void 0&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),e.clearcoatNormalMap!==void 0&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),e.clearcoatNormalScale!==void 0&&(this.clearcoatNormalScale=new Oi().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(this.iridescenceMap=t[e.iridescenceMap]||null),e.iridescenceThicknessMap!==void 0&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),e.transmissionMap!==void 0&&(this.transmissionMap=t[e.transmissionMap]||null),e.thicknessMap!==void 0&&(this.thicknessMap=t[e.thicknessMap]||null),e.anisotropyMap!==void 0&&(this.anisotropyMap=t[e.anisotropyMap]||null),e.sheenColorMap!==void 0&&(this.sheenColorMap=t[e.sheenColorMap]||null),e.sheenRoughnessMap!==void 0&&(this.sheenRoughnessMap=t[e.sheenRoughnessMap]||null),this}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;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,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.allowOverride=e.allowOverride,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++}};const co=new P,lo=new P,uo=new P,fo=new P,po=new P,mo=new P,ho=new P;var Ray=class{constructor(e=new P,t=new P(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.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,co)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=co.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(co.copy(this.origin).addScaledVector(this.direction,t),co.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){lo.copy(e).add(t).multiplyScalar(.5),uo.copy(t).sub(e).normalize(),fo.copy(this.origin).sub(lo);let i=e.distanceTo(t)*.5,a=-this.direction.dot(uo),o=fo.dot(this.direction),s=-fo.dot(uo),c=fo.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0)if(u=a*s-o,d=a*o-s,p=i*l,u>=0)if(d>=-p)if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(lo).addScaledVector(uo,d),f}intersectSphere(e,t){co.subVectors(e.center,this.origin);let n=co.dot(this.direction),r=co.dot(co)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),u>=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s<r||r!==r)&&(r=s),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,co)!==null}intersectTriangle(e,t,n,r,i){po.subVectors(t,e),mo.subVectors(n,e),ho.crossVectors(po,mo);let a=this.direction.dot(ho),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;fo.subVectors(this.origin,e);let s=o*this.direction.dot(mo.crossVectors(fo,mo));if(s<0)return null;let c=o*this.direction.dot(po.cross(fo));if(c<0||s+c>a)return null;let l=-o*fo.dot(ho);return l<0?null:this.at(l/a,i)}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)}},MeshBasicMaterial=class extends Material{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new Color(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 Qi,this.combine=0,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 go=new Hi,_o=new Ray,vo=new Sphere,yo=new P,bo=new P,xo=new P,So=new P,Co=new P,wo=new P,To=new P,Eo=new P;var Mesh=class extends ma{constructor(e=new oo,t=new MeshBasicMaterial){super(),this.isMesh=!0,this.type=`Mesh`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);let o=this.morphTargetInfluences;if(i&&o){wo.set(0,0,0);for(let n=0,r=i.length;n<r;n++){let r=o[n],s=i[n];r!==0&&(Co.fromBufferAttribute(s,e),a?wo.addScaledVector(Co,r):wo.addScaledVector(Co.sub(t),r))}t.add(wo)}return t}raycast(e,t){let n=this.geometry,r=this.material,i=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),vo.copy(n.boundingSphere),vo.applyMatrix4(i),_o.copy(e.ray).recast(e.near),!(vo.containsPoint(_o.origin)===!1&&(_o.intersectSphere(vo,yo)===null||_o.origin.distanceToSquared(yo)>(e.far-e.near)**2))&&(go.copy(i).invert(),_o.copy(e.ray).applyMatrix4(go),!(n.boundingBox!==null&&_o.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,_o)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null)if(Array.isArray(a))for(let i=0,s=d.length;i<s;i++){let s=d[i],p=a[s.materialIndex],m=Math.max(s.start,f.start),h=Math.min(o.count,Math.min(s.start+s.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=o.getX(i),d=o.getX(i+1),f=o.getX(i+2);r=checkGeometryIntersection(this,p,e,n,c,l,u,a,d,f),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),s=Math.min(o.count,f.start+f.count);for(let d=i,f=s;d<f;d+=3){let i=o.getX(d),s=o.getX(d+1),f=o.getX(d+2);r=checkGeometryIntersection(this,a,e,n,c,l,u,i,s,f),r&&(r.faceIndex=Math.floor(d/3),t.push(r))}}else if(s!==void 0)if(Array.isArray(a))for(let i=0,o=d.length;i<o;i++){let o=d[i],p=a[o.materialIndex],m=Math.max(o.start,f.start),h=Math.min(s.count,Math.min(o.start+o.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=i,s=i+1,d=i+2;r=checkGeometryIntersection(this,p,e,n,c,l,u,a,s,d),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),o=Math.min(s.count,f.start+f.count);for(let s=i,d=o;s<d;s+=3){let i=s,o=s+1,d=s+2;r=checkGeometryIntersection(this,a,e,n,c,l,u,i,o,d),r&&(r.faceIndex=Math.floor(s/3),t.push(r))}}}};function checkIntersection$1(e,t,n,r,i,a,o,s){let c;if(c=t.side===1?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side===0,s),c===null)return null;Eo.copy(s),Eo.applyMatrix4(e.matrixWorld);let l=n.ray.origin.distanceTo(Eo);return l<n.near||l>n.far?null:{distance:l,point:Eo.clone(),object:e}}function checkGeometryIntersection(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,bo),e.getVertexPosition(c,xo),e.getVertexPosition(l,So);let u=checkIntersection$1(e,t,n,r,bo,xo,So,To);if(u){let e=new P;Na.getBarycoord(To,bo,xo,So,e),i&&(u.uv=Na.getInterpolatedAttribute(i,s,c,l,e,new Oi)),a&&(u.uv1=Na.getInterpolatedAttribute(a,s,c,l,e,new Oi)),o&&(u.normal=Na.getInterpolatedAttribute(o,s,c,l,e,new P),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new P,materialIndex:0};Na.getNormal(bo,xo,So,t.normal),u.face=t,u.barycoord=e}return u}var DataTexture=class extends Bi{constructor(e=null,t=1,n=1,r,i,a,o,s,c=Wr,l=Wr,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};const Do=new P,Oo=new P,ko=new ji;var Plane=class{constructor(e=new P(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let r=Do.subVectors(n,t).cross(Oo.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let 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,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,n=!0){let r=e.delta(Do),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let a=-(e.start.dot(this.normal)+this.constant)/i;return n===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>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,t){let n=t||ko.getNormalMatrix(e),r=this.coplanarPoint(Do).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),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 Ao=new Sphere,jo=new Oi(.5,.5),Mo=new P;var Frustum=class{constructor(e=new Plane,t=new Plane,n=new Plane,r=new Plane,i=new Plane,a=new Plane){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=bi,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===2e3)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else if(t===2001)r[5].setComponents(s,d,h,y).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ao.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Ao.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ao)}intersectsSprite(e){Ao.center.set(0,0,0);let t=jo.distanceTo(e.center);return Ao.radius=.7071067811865476+t,Ao.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ao)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let r=t[n];if(Mo.x=r.normal.x>0?e.max.x:e.min.x,Mo.y=r.normal.y>0?e.max.y:e.min.y,Mo.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Mo)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}},CubeTexture=class extends Bi{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},DepthTexture=class extends Bi{constructor(e,t,n=Yr,r,i,a,o=Wr,s=Wr,c,l=ni,u=1){if(l!==1026&&l!==1027)throw Error(`THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Source(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},CubeDepthTexture=class extends DepthTexture{constructor(e,t=Yr,n=301,r,i,a=Wr,o=Wr,s,c=ni){let l={width:e,height:e,depth:1},u=[l,l,l,l,l,l];super(e,e,t,n,r,i,a,o,s,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},ExternalTexture=class extends Bi{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},No=class BoxGeometry extends oo{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;buildPlane(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),buildPlane(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),buildPlane(`x`,`z`,`y`,1,1,e,n,t,r,a,2),buildPlane(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),buildPlane(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),buildPlane(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new Float32BufferAttribute(c,3)),this.setAttribute(`normal`,new Float32BufferAttribute(l,3)),this.setAttribute(`uv`,new Float32BufferAttribute(u,2));function buildPlane(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new P;for(let a=0;a<w;a++){let o=a*y-x;for(let s=0;s<C;s++)D[e]=(s*v-b)*r,D[t]=o*i,D[n]=S,c.push(D.x,D.y,D.z),D[e]=0,D[t]=0,D[n]=m>0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e<g;e++)for(let t=0;t<h;t++){let n=d+t+C*e,r=d+t+C*(e+1),i=d+(t+1)+C*(e+1),a=d+(t+1)+C*e;s.push(n,r,a),s.push(r,i,a),E+=6}o.addGroup(f,E,_),f+=E,d+=T}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new BoxGeometry(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}},Po=class PlaneGeometry extends oo{constructor(e=1,t=1,n=1,r=1){super(),this.type=`PlaneGeometry`,this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};let i=e/2,a=t/2,o=Math.floor(n),s=Math.floor(r),c=o+1,l=s+1,u=e/o,d=t/s,f=[],p=[],m=[],h=[];for(let e=0;e<l;e++){let t=e*d-a;for(let n=0;n<c;n++){let r=n*u-i;p.push(r,-t,0),m.push(0,0,1),h.push(n/o),h.push(1-e/s)}}for(let e=0;e<s;e++)for(let t=0;t<o;t++){let n=t+c*e,r=t+c*(e+1),i=t+1+c*(e+1),a=t+1+c*e;f.push(n,r,a),f.push(r,i,a)}this.setIndex(f),this.setAttribute(`position`,new Float32BufferAttribute(p,3)),this.setAttribute(`normal`,new Float32BufferAttribute(m,3)),this.setAttribute(`uv`,new Float32BufferAttribute(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new PlaneGeometry(e.width,e.height,e.widthSegments,e.heightSegments)}};function cloneUniforms(e){let t={};for(let n in e){t[n]={};for(let r in e[n]){let i=e[n][r];if(isThreeObject(i))i.isRenderTargetTexture?(warn(`UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().`),t[n][r]=null):t[n][r]=i.clone();else if(Array.isArray(i))if(isThreeObject(i[0])){let e=[];for(let t=0,n=i.length;t<n;t++)e[t]=i[t].clone();t[n][r]=e}else t[n][r]=i.slice();else t[n][r]=i}}return t}function mergeUniforms(e){let t={};for(let n=0;n<e.length;n++){let r=cloneUniforms(e[n]);for(let e in r)t[e]=r[e]}return t}function isThreeObject(e){return e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture||e.isQuaternion)}function cloneUniformsGroups(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}function getUnlitUniformColorSpace(e){let t=e.getRenderTarget();return t===null?e.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Fi.workingColorSpace}const Fo={clone:cloneUniforms,merge:mergeUniforms};var Io=`void main() {
|
|
104
|
+
;function arrayNeedsUint32(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function isTypedArray(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function createElementNS(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function createCanvasElement(){let e=createElementNS(`canvas`);return e.style.display=`block`,e}const fi={};function log(...e){let t=`THREE.`+e.shift();console.log(t,...e)}function enhanceLogMessage(e){let t=e[0];if(typeof t==`string`&&t.startsWith(`TSL:`)){let t=e[1];t&&t.isStackTrace?e[0]+=` `+t.getLocation():e[1]=`Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.`}return e}function warn(...e){e=enhanceLogMessage(e);let t=`THREE.`+e.shift();{let n=e[0];n&&n.isStackTrace?console.warn(n.getError(t)):console.warn(t,...e)}}function error(...e){e=enhanceLogMessage(e);let t=`THREE.`+e.shift();{let n=e[0];n&&n.isStackTrace?console.error(n.getError(t)):console.error(t,...e)}}function warnOnce(...e){let t=e.join(` `);t in fi||(fi[t]=!0,warn(...e))}function probeAsync(e,t,n){return new Promise(function(r,i){function probe(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(probe,n);break;default:r()}}setTimeout(probe,n)})}const pi={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3};var EventDispatcher=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n<r;n++)t[n].call(this,e);e.target=null}}};const mi=`00.01.02.03.04.05.06.07.08.09.0a.0b.0c.0d.0e.0f.10.11.12.13.14.15.16.17.18.19.1a.1b.1c.1d.1e.1f.20.21.22.23.24.25.26.27.28.29.2a.2b.2c.2d.2e.2f.30.31.32.33.34.35.36.37.38.39.3a.3b.3c.3d.3e.3f.40.41.42.43.44.45.46.47.48.49.4a.4b.4c.4d.4e.4f.50.51.52.53.54.55.56.57.58.59.5a.5b.5c.5d.5e.5f.60.61.62.63.64.65.66.67.68.69.6a.6b.6c.6d.6e.6f.70.71.72.73.74.75.76.77.78.79.7a.7b.7c.7d.7e.7f.80.81.82.83.84.85.86.87.88.89.8a.8b.8c.8d.8e.8f.90.91.92.93.94.95.96.97.98.99.9a.9b.9c.9d.9e.9f.a0.a1.a2.a3.a4.a5.a6.a7.a8.a9.aa.ab.ac.ad.ae.af.b0.b1.b2.b3.b4.b5.b6.b7.b8.b9.ba.bb.bc.bd.be.bf.c0.c1.c2.c3.c4.c5.c6.c7.c8.c9.ca.cb.cc.cd.ce.cf.d0.d1.d2.d3.d4.d5.d6.d7.d8.d9.da.db.dc.dd.de.df.e0.e1.e2.e3.e4.e5.e6.e7.e8.e9.ea.eb.ec.ed.ee.ef.f0.f1.f2.f3.f4.f5.f6.f7.f8.f9.fa.fb.fc.fd.fe.ff`.split(`.`);let hi=1234567;const gi=Math.PI/180,_i=180/Math.PI;function generateUUID(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(mi[e&255]+mi[e>>8&255]+mi[e>>16&255]+mi[e>>24&255]+`-`+mi[t&255]+mi[t>>8&255]+`-`+mi[t>>16&15|64]+mi[t>>24&255]+`-`+mi[n&63|128]+mi[n>>8&255]+`-`+mi[n>>16&255]+mi[n>>24&255]+mi[r&255]+mi[r>>8&255]+mi[r>>16&255]+mi[r>>24&255]).toLowerCase()}function clamp(e,t,n){return Math.max(t,Math.min(n,e))}function euclideanModulo(e,t){return(e%t+t)%t}function mapLinear(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function inverseLerp(e,t,n){return e===t?0:(n-e)/(t-e)}function lerp(e,t,n){return(1-n)*e+n*t}function damp(e,t,n,r){return lerp(e,t,1-Math.exp(-n*r))}function pingpong(e,t=1){return t-Math.abs(euclideanModulo(e,t*2)-t)}function smoothstep(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function smootherstep(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function randInt(e,t){return e+Math.floor(Math.random()*(t-e+1))}function randFloat(e,t){return e+Math.random()*(t-e)}function randFloatSpread(e){return e*(.5-Math.random())}function seededRandom(e){e!==void 0&&(hi=e);let t=hi+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function degToRad(e){return e*gi}function radToDeg(e){return e*_i}function isPowerOfTwo(e){return(e&e-1)==0&&e!==0}function ceilPowerOfTwo(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function floorPowerOfTwo(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function setQuaternionFromProperEuler(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:warn(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function denormalize(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}function normalize(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}const vi={DEG2RAD:gi,RAD2DEG:_i,generateUUID,clamp,euclideanModulo,mapLinear,inverseLerp,lerp,damp,pingpong,smoothstep,smootherstep,randInt,randFloat,randFloatSpread,seededRandom,degToRad,radToDeg,isPowerOfTwo,ceilPowerOfTwo,floorPowerOfTwo,setQuaternionFromProperEuler,normalize,denormalize};var G=class Vector2{static{Vector2.prototype.isVector2=!0}constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error(`THREE.Vector2: index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`THREE.Vector2: 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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.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){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[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,t){return this.x=clamp(this.x,e.x,t.x),this.y=clamp(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=clamp(this.x,e,t),this.y=clamp(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(clamp(n,e,t))}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){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Quaternion=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,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,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,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,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:warn(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(clamp(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),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*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),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}},K=class Vector3{static{Vector3.prototype.isVector3=!0}constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error(`THREE.Vector3: 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 Error(`THREE.Vector3: 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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.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,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(bi.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(bi.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,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,t){return this.x=clamp(this.x,e.x,t.x),this.y=clamp(this.y,e.y,t.y),this.z=clamp(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=clamp(this.x,e,t),this.y=clamp(this.y,e,t),this.z=clamp(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(clamp(n,e,t))}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,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return yi.copy(this).projectOnVector(e),this.sub(yi)}reflect(e){return this.sub(yi.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}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,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*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,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};const yi=new K,bi=new Quaternion;var q=class Matrix3{static{Matrix3.prototype.isMatrix3=!0}constructor(e,t,n,r,i,a,o,s,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return warnOnce(`Matrix3: .scale() is deprecated. Use .makeScale() instead.`),this.premultiply(xi.makeScale(e,t)),this}rotate(e){return warnOnce(`Matrix3: .rotate() is deprecated. Use .makeRotation() instead.`),this.premultiply(xi.makeRotation(-e)),this}translate(e,t){return warnOnce(`Matrix3: .translate() is deprecated. Use .makeTranslation() instead.`),this.premultiply(xi.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};const xi=new q,Si=new q().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Ci=new q().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function createColorManagement(){let e={enabled:!0,workingColorSpace:si,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=SRGBToLinear(e.r),e.g=SRGBToLinear(e.g),e.b=SRGBToLinear(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=LinearToSRGB(e.r),e.g=LinearToSRGB(e.g),e.b=LinearToSRGB(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?ci:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return warnOnce(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return warnOnce(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[si]:{primaries:t,whitePoint:r,transfer:ci,toXYZ:Si,fromXYZ:Ci,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:oi},outputColorSpaceConfig:{drawingBufferColorSpace:oi}},[oi]:{primaries:t,whitePoint:r,transfer:li,toXYZ:Si,fromXYZ:Ci,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:oi}}}),e}const J=createColorManagement();function SRGBToLinear(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function LinearToSRGB(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}let wi;var ImageUtils=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{wi===void 0&&(wi=createElementNS(`canvas`)),wi.width=e.width,wi.height=e.height;let t=wi.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=wi}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=createElementNS(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=SRGBToLinear(i[e]/255)*255;return n.putImageData(r,0,0),t}else if(e.data){let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(SRGBToLinear(t[e]/255)*255):t[e]=SRGBToLinear(t[e]);return{data:t,width:e.width,height:e.height}}else return warn(`ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.`),e}};let Ti=0;var Source=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Ti++}),this.uuid=generateUUID(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let t=this.data;return typeof HTMLVideoElement<`u`&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<`u`&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t===null?e.set(0,0,0):e.set(t.width,t.height,t.depth||0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:``},r=this.data;if(r!==null){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(serializeImage(r[t].image)):e.push(serializeImage(r[t]))}else e=serializeImage(r);n.url=e}return t||(e.images[this.uuid]=n),n}};function serializeImage(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap?ImageUtils.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(warn(`Texture: Unable to serialize Texture.`),{})}let Ei=0;const Di=new K;var Oi=class Texture extends EventDispatcher{constructor(e=Texture.DEFAULT_IMAGE,t=Texture.DEFAULT_MAPPING,n=Nr,r=Nr,i=Ir,a=Lr,o=Kr,s=Rr,c=Texture.DEFAULT_ANISOTROPY,l=``){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Ei++}),this.uuid=generateUUID(),this.name=``,this.source=new Source(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=s,this.offset=new G(0,0),this.repeat=new G(1,1),this.center=new G(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new q,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(Di).x}get height(){return this.source.getSize(Di).y}get depth(){return this.source.getSize(Di).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){warn(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){warn(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:`Texture`,generator:`Texture.toJSON`},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Mr:e.x-=Math.floor(e.x);break;case Nr:e.x=e.x<0?0:1;break;case Pr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Mr:e.y-=Math.floor(e.y);break;case Nr:e.y=e.y<0?0:1;break;case Pr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(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++}};Oi.DEFAULT_IMAGE=null,Oi.DEFAULT_MAPPING=300,Oi.DEFAULT_ANISOTROPY=1;var Y=class Vector4{static{Vector4.prototype.isVector4=!0}constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error(`THREE.Vector4: 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 Error(`THREE.Vector4: 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?1:e.w,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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.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){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)<a&&Math.abs(u-m)<a&&Math.abs(p-h)<a){if(Math.abs(l+d)<o&&Math.abs(u+m)<o&&Math.abs(p+h)<o&&Math.abs(c+f+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;let e=(c+1)/2,s=(f+1)/2,_=(g+1)/2,v=(l+d)/4,y=(u+m)/4,b=(p+h)/4;return e>s&&e>_?e<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=v/n,i=y/n):s>_?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=b/r):_<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=y/i,r=b/i),this.set(n,r,i,t),this}let _=Math.sqrt((h-p)*(h-p)+(u-m)*(u-m)+(d-l)*(d-l));return Math.abs(_)<.001&&(_=1),this.x=(h-p)/_,this.y=(u-m)/_,this.z=(d-l)/_,this.w=Math.acos((c+f+g-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[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,t){return this.x=clamp(this.x,e.x,t.x),this.y=clamp(this.y,e.y,t.y),this.z=clamp(this.z,e.z,t.z),this.w=clamp(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=clamp(this.x,e,t),this.y=clamp(this.y,e,t),this.z=clamp(this.z,e,t),this.w=clamp(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(clamp(n,e,t))}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,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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}},RenderTarget=class extends EventDispatcher{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Ir,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new Y(0,0,e,t),this.scissorTest=!1,this.viewport=new Y(0,0,e,t),this.textures=[];let r=new Oi({width:e,height:t,depth:n.depth}),i=n.count;for(let e=0;e<i;e++)this.textures[e]=r.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview,this.useArrayDepthTexture=n.useArrayDepthTexture}_setTextureOptions(e={}){let t={minFilter:Ir,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let e=0;e<this.textures.length;e++)this.textures[e].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;let n=Object.assign({},e.textures[t].image);this.textures[t].source=new Source(n)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:`dispose`})}},WebGLRenderTarget=class extends RenderTarget{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}},DataArrayTexture=class extends Oi{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Fr,this.minFilter=Fr,this.wrapR=Nr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},Data3DTexture=class extends Oi{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Fr,this.minFilter=Fr,this.wrapR=Nr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},X=class Matrix4{static{Matrix4.prototype.isMatrix4=!0}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,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 Matrix4().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinantAffine()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinantAffine()===0)return this.identity();let t=this.elements,n=e.elements,r=1/ki.setFromMatrixColumn(e,0).length(),i=1/ki.setFromMatrixColumn(e,1).length(),a=1/ki.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(ji,e,Mi)}lookAt(e,t,n){let r=this.elements;return Fi.subVectors(e,t),Fi.lengthSq()===0&&(Fi.z=1),Fi.normalize(),Ni.crossVectors(n,Fi),Ni.lengthSq()===0&&(Math.abs(n.z)===1?Fi.x+=1e-4:Fi.z+=1e-4,Fi.normalize(),Ni.crossVectors(n,Fi)),Ni.normalize(),Pi.crossVectors(Fi,Ni),r[0]=Ni.x,r[4]=Pi.x,r[8]=Fi.x,r[1]=Ni.y,r[5]=Pi.y,r[9]=Fi.y,r[2]=Ni.z,r[6]=Pi.z,r[10]=Fi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],k=r[2],A=r[6],ee=r[10],j=r[14],M=r[3],N=r[7],te=r[11],P=r[15];return i[0]=a*x+o*T+s*k+c*M,i[4]=a*S+o*E+s*A+c*N,i[8]=a*C+o*D+s*ee+c*te,i[12]=a*w+o*O+s*j+c*P,i[1]=l*x+u*T+d*k+f*M,i[5]=l*S+u*E+d*A+f*N,i[9]=l*C+u*D+d*ee+f*te,i[13]=l*w+u*O+d*j+f*P,i[2]=p*x+m*T+h*k+g*M,i[6]=p*S+m*E+h*A+g*N,i[10]=p*C+m*D+h*ee+g*te,i[14]=p*w+m*O+h*j+g*P,i[3]=_*x+v*T+y*k+b*M,i[7]=_*S+v*E+y*A+b*N,i[11]=_*C+v*D+y*ee+b*te,i[15]=_*w+v*O+y*j+b*P,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15],_=s*f-c*d,v=o*f-c*u,y=o*d-s*u,b=a*f-c*l,x=a*d-s*l,S=a*u-o*l;return t*(m*_-h*v+g*y)-n*(p*_-h*b+g*x)+r*(p*v-m*b+g*S)-i*(p*y-m*x+h*S)}determinantAffine(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[1],a=e[5],o=e[9],s=e[2],c=e[6],l=e[10];return t*(a*l-o*c)-n*(i*l-o*s)+r*(i*c-a*s)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=t*o-n*a,v=t*s-r*a,y=t*c-i*a,b=n*s-r*o,x=n*c-i*o,S=r*c-i*s,C=l*m-u*p,w=l*h-d*p,T=l*g-f*p,E=u*h-d*m,D=u*g-f*m,O=d*g-f*h,k=_*O-v*D+y*E+b*T-x*w+S*C;if(k===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let A=1/k;return e[0]=(o*O-s*D+c*E)*A,e[1]=(r*D-n*O-i*E)*A,e[2]=(m*S-h*x+g*b)*A,e[3]=(d*x-u*S-f*b)*A,e[4]=(s*T-a*O-c*w)*A,e[5]=(t*O-r*T+i*w)*A,e[6]=(h*y-p*S-g*v)*A,e[7]=(l*S-d*y+f*v)*A,e[8]=(a*D-o*T+c*C)*A,e[9]=(n*T-t*D-i*C)*A,e[10]=(p*x-m*y+g*_)*A,e[11]=(u*y-l*x-f*_)*A,e[12]=(o*w-a*E-s*C)*A,e[13]=(t*E-n*w+r*C)*A,e[14]=(m*v-p*b-h*_)*A,e[15]=(l*b-u*v+d*_)*A,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){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,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];let i=this.determinantAffine();if(i===0)return n.set(1,1,1),t.identity(),this;let a=ki.set(r[0],r[1],r[2]).length(),o=ki.set(r[4],r[5],r[6]).length(),s=ki.set(r[8],r[9],r[10]).length();i<0&&(a=-a),Ai.copy(this);let c=1/a,l=1/o,u=1/s;return Ai.elements[0]*=c,Ai.elements[1]*=c,Ai.elements[2]*=c,Ai.elements[4]*=l,Ai.elements[5]*=l,Ai.elements[6]*=l,Ai.elements[8]*=u,Ai.elements[9]*=u,Ai.elements[10]*=u,t.setFromRotationMatrix(Ai),n.x=a,n.y=o,n.z=s,this}makePerspective(e,t,n,r,i,a,o=di,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===2e3)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else if(o===2001)p=-a/(a-i),m=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=di,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===2e3)p=-2/(a-i),m=-(a+i)/(a-i);else if(o===2001)p=-1/(a-i),m=-i/(a-i);else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};const ki=new K,Ai=new X,ji=new K(0,0,0),Mi=new K(1,1,1),Ni=new K,Pi=new K,Fi=new K,Ii=new X,Li=new Quaternion;var Ri=class Euler{constructor(e=0,t=0,n=0,r=Euler.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}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,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,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,t=this._order,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(clamp(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-clamp(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(clamp(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-clamp(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(clamp(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-clamp(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:warn(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Ii.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Ii,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Li.setFromEuler(this),this.setFromQuaternion(Li,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=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+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}};Ri.DEFAULT_ORDER=`XYZ`;var Layers=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!=0}};let zi=0;const Bi=new K,Vi=new Quaternion,Hi=new X,Ui=new K,Wi=new K,Gi=new K,Ki=new Quaternion,qi=new K(1,0,0),Ji=new K(0,1,0),Yi=new K(0,0,1),Xi={type:`added`},Zi={type:`removed`},Qi={type:`childadded`,child:null},$i={type:`childremoved`,child:null};var ea=class Object3D extends EventDispatcher{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:zi++}),this.uuid=generateUUID(),this.name=``,this.type=`Object3D`,this.parent=null,this.children=[],this.up=Object3D.DEFAULT_UP.clone();let e=new K,t=new Ri,n=new Quaternion,r=new K(1,1,1);function onRotationChange(){n.setFromEuler(t,!1)}function onQuaternionChange(){t.setFromQuaternion(n,void 0,!1)}t._onChange(onRotationChange),n._onChange(onQuaternionChange),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new X},normalMatrix:{value:new q}}),this.matrix=new X,this.matrixWorld=new X,this.matrixAutoUpdate=Object3D.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Layers,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Vi.setFromAxisAngle(e,t),this.quaternion.multiply(Vi),this}rotateOnWorldAxis(e,t){return Vi.setFromAxisAngle(e,t),this.quaternion.premultiply(Vi),this}rotateX(e){return this.rotateOnAxis(qi,e)}rotateY(e){return this.rotateOnAxis(Ji,e)}rotateZ(e){return this.rotateOnAxis(Yi,e)}translateOnAxis(e,t){return Bi.copy(e).applyQuaternion(this.quaternion),this.position.add(Bi.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(qi,e)}translateY(e){return this.translateOnAxis(Ji,e)}translateZ(e){return this.translateOnAxis(Yi,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Hi.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Ui.copy(e):Ui.set(e,t,n);let r=this.parent;this.updateWorldMatrix(!0,!1),Wi.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Hi.lookAt(Wi,Ui,this.up):Hi.lookAt(Ui,Wi,this.up),this.quaternion.setFromRotationMatrix(Hi),r&&(Hi.extractRotation(r.matrixWorld),Vi.setFromRotationMatrix(Hi),this.quaternion.premultiply(Vi.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(error(`Object3D.add: object can't be added as a child of itself.`,e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Xi),Qi.child=e,this.dispatchEvent(Qi),Qi.child=null):error(`Object3D.add: object not an instance of THREE.Object3D.`,e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Zi),$i.child=e,this.dispatchEvent($i),$i.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Hi.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Hi.multiply(e.parent.matrixWorld)),e.applyMatrix4(Hi),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Xi),Qi.child=e,this.dispatchEvent(Qi),Qi.child=null,this}getObjectById(e){return this.getObjectByProperty(`id`,e)}getObjectByName(e){return this.getObjectByProperty(`name`,e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){let r=this.children[n].getObjectByProperty(e,t);if(r!==void 0)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Wi,e,Gi),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Wi,Ki,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let e=this.pivot;if(e!==null){let t=e.x,n=e.y,r=e.z,i=this.matrix.elements;i[12]+=t-i[0]*t-i[4]*n-i[8]*r,i[13]+=n-i[1]*t-i[5]*n-i[9]*r,i[14]+=r-i[2]*t-i[6]*n-i[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t,n=!1){let r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,n=!0),t===!0){let e=this.children;for(let t=0,r=e.length;t<r;t++)e[t].updateWorldMatrix(!1,!0,n)}}toJSON(e){let t=e===void 0||typeof e==`string`,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:`Object`,generator:`Object3D.toJSON`});let r={};r.uuid=this.uuid,r.type=this.type,this.name!==``&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function serialize(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=serialize(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){let r=n[t];serialize(e.shapes,r)}else serialize(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(serialize(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(serialize(e.materials,this.material[n]));r.material=t}else r.material=serialize(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){let n=this.animations[t];r.animations.push(serialize(e.animations,n))}}if(t){let t=extractFromCache(e.geometries),r=extractFromCache(e.materials),i=extractFromCache(e.textures),a=extractFromCache(e.images),o=extractFromCache(e.shapes),s=extractFromCache(e.skeletons),c=extractFromCache(e.animations),l=extractFromCache(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),s.length>0&&(n.skeletons=s),c.length>0&&(n.animations=c),l.length>0&&(n.nodes=l)}return n.object=r,n;function extractFromCache(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!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.pivot=e.pivot===null?null:e.pivot.clone(),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.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let t=0;t<e.children.length;t++){let n=e.children[t];this.add(n.clone())}return this}};ea.DEFAULT_UP=new K(0,1,0),ea.DEFAULT_MATRIX_AUTO_UPDATE=!0,ea.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Group=class extends ea{constructor(){super(),this.isGroup=!0,this.type=`Group`}};const ta={type:`move`};var WebXRController=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Group,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 Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new K,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new K),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new K,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new K,this._grip.eventsEnabled=!1),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){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}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,t,n){let r=null,i=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(e&&t.session.visibilityState!==`visible-blurred`){if(c&&e.hand){a=!0;for(let r of e.hand.values()){let e=t.getJointPose(r,n),i=this._getHandJoint(c,r);e!==null&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=e!==null}let r=c.joints[`index-finger-tip`],i=c.joints[`thumb-tip`],o=r.position.distanceTo(i.position);c.inputState.pinching&&o>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,s.eventsEnabled&&s.dispatchEvent({type:`gripUpdated`,data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(ta)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new Group;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}};const na={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},ra={h:0,s:0,l:0},ia={h:0,s:0,l:0};function hue2rgb(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var Color=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=oi){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,J.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=J.workingColorSpace){return this.r=e,this.g=t,this.b=n,J.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=J.workingColorSpace){if(e=euclideanModulo(e,1),t=clamp(t,0,1),n=clamp(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=hue2rgb(i,r,e+1/3),this.g=hue2rgb(i,r,e),this.b=hue2rgb(i,r,e-1/3)}return J.colorSpaceToWorking(this,r),this}setStyle(e,t=oi){function handleAlpha(t){t!==void 0&&parseFloat(t)<1&&warn(`Color: Alpha component of `+e+` will be ignored.`)}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let r,i=n[1],a=n[2];switch(i){case`rgb`:case`rgba`:if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return handleAlpha(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,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return handleAlpha(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,t);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 handleAlpha(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:warn(`Color: Unknown color model `+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let r=n[1],i=r.length;if(i===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(r,16),t);warn(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=oi){let n=na[e.toLowerCase()];return n===void 0?warn(`Color: Unknown color `+e):this.setHex(n,t),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=SRGBToLinear(e.r),this.g=SRGBToLinear(e.g),this.b=SRGBToLinear(e.b),this}copyLinearToSRGB(e){return this.r=LinearToSRGB(e.r),this.g=LinearToSRGB(e.g),this.b=LinearToSRGB(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=oi){return J.workingToColorSpace(aa.copy(this),e),Math.round(clamp(aa.r*255,0,255))*65536+Math.round(clamp(aa.g*255,0,255))*256+Math.round(clamp(aa.b*255,0,255))}getHexString(e=oi){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=J.workingColorSpace){J.workingToColorSpace(aa.copy(this),t);let n=aa.r,r=aa.g,i=aa.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r<i?6:0);break;case r:s=(i-n)/e+2;break;case i:s=(n-r)/e+4;break}s/=6}return e.h=s,e.s=c,e.l=l,e}getRGB(e,t=J.workingColorSpace){return J.workingToColorSpace(aa.copy(this),t),e.r=aa.r,e.g=aa.g,e.b=aa.b,e}getStyle(e=oi){J.workingToColorSpace(aa.copy(this),e);let t=aa.r,n=aa.g,r=aa.b;return e===`srgb`?`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`:`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`}offsetHSL(e,t,n){return this.getHSL(ra),this.setHSL(ra.h+e,ra.s+t,ra.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(ra),e.getHSL(ia);let n=lerp(ra.h,ia.h,t),r=lerp(ra.s,ia.s,t),i=lerp(ra.l,ia.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const aa=new Color;Color.NAMES=na;var Scene=class extends ea{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 Ri,this.environmentIntensity=1,this.environmentRotation=new Ri,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}copy(e,t){return super.copy(e,t),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){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}};const oa=new K,sa=new K,ca=new K,la=new K,ua=new K,da=new K,fa=new K,pa=new K,ma=new K,ha=new K,ga=new Y,_a=new Y,va=new Y;var ya=class Triangle{constructor(e=new K,t=new K,n=new K){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),oa.subVectors(e,t),r.cross(oa);let i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){oa.subVectors(r,t),sa.subVectors(n,t),ca.subVectors(e,t);let a=oa.dot(oa),o=oa.dot(sa),s=oa.dot(ca),c=sa.dot(sa),l=sa.dot(ca),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,la)===null?!1:la.x>=0&&la.y>=0&&la.x+la.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,la)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,la.x),s.addScaledVector(a,la.y),s.addScaledVector(o,la.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return ga.setScalar(0),_a.setScalar(0),va.setScalar(0),ga.fromBufferAttribute(e,t),_a.fromBufferAttribute(e,n),va.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(ga,i.x),a.addScaledVector(_a,i.y),a.addScaledVector(va,i.z),a}static isFrontFacing(e,t,n,r){return oa.subVectors(n,t),sa.subVectors(e,t),oa.cross(sa).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),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 oa.subVectors(this.c,this.b),sa.subVectors(this.a,this.b),oa.cross(sa).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Triangle.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Triangle.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,i){return Triangle.getInterpolation(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return Triangle.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Triangle.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;ua.subVectors(r,n),da.subVectors(i,n),pa.subVectors(e,n);let s=ua.dot(pa),c=da.dot(pa);if(s<=0&&c<=0)return t.copy(n);ma.subVectors(e,r);let l=ua.dot(ma),u=da.dot(ma);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(ua,a);ha.subVectors(e,i);let f=ua.dot(ha),p=da.dot(ha);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(da,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return fa.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(fa,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(ua,a).addScaledVector(da,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},Box3=class{constructor(e=new K(1/0,1/0,1/0),t=new K(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(xa.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(xa.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=xa.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let n=e.geometry;if(n!==void 0){let r=n.getAttribute(`position`);if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let t=0,n=r.count;t<n;t++)e.isMesh===!0?e.getVertexPosition(t,xa):xa.fromBufferAttribute(r,t),xa.applyMatrix4(e.matrixWorld),this.expandByPoint(xa);else e.boundingBox===void 0?(n.boundingBox===null&&n.computeBoundingBox(),Sa.copy(n.boundingBox)):(e.boundingBox===null&&e.computeBoundingBox(),Sa.copy(e.boundingBox)),Sa.applyMatrix4(e.matrixWorld),this.union(Sa)}let r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],t);return this}containsPoint(e){return e.x>=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,t){return t.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,xa),xa.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ka),Aa.subVectors(this.max,ka),Ca.subVectors(e.a,ka),wa.subVectors(e.b,ka),Ta.subVectors(e.c,ka),Ea.subVectors(wa,Ca),Da.subVectors(Ta,wa),Oa.subVectors(Ca,Ta);let t=[0,-Ea.z,Ea.y,0,-Da.z,Da.y,0,-Oa.z,Oa.y,Ea.z,0,-Ea.x,Da.z,0,-Da.x,Oa.z,0,-Oa.x,-Ea.y,Ea.x,0,-Da.y,Da.x,0,-Oa.y,Oa.x,0];return!satForAxes(t,Ca,wa,Ta,Aa)||(t=[1,0,0,0,1,0,0,0,1],!satForAxes(t,Ca,wa,Ta,Aa))?!1:(ja.crossVectors(Ea,Da),t=[ja.x,ja.y,ja.z],satForAxes(t,Ca,wa,Ta,Aa))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,xa).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(xa).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:(ba[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ba[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ba[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ba[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ba[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ba[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ba[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ba[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ba),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)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}};const ba=[new K,new K,new K,new K,new K,new K,new K,new K],xa=new K,Sa=new Box3,Ca=new K,wa=new K,Ta=new K,Ea=new K,Da=new K,Oa=new K,ka=new K,Aa=new K,ja=new K,Ma=new K;function satForAxes(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){Ma.fromArray(e,a);let o=i.x*Math.abs(Ma.x)+i.y*Math.abs(Ma.y)+i.z*Math.abs(Ma.z),s=t.dot(Ma),c=n.dot(Ma),l=r.dot(Ma);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}const Na=new K,Pa=new G;let Fa=0;var BufferAttribute=class extends EventDispatcher{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Fa++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=35044,this.updateRanges=[],this.gpuType=Vr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}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,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Pa.fromBufferAttribute(this,t),Pa.applyMatrix3(e),this.setXY(t,Pa.x,Pa.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Na.fromBufferAttribute(this,t),Na.applyMatrix3(e),this.setXYZ(t,Na.x,Na.y,Na.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Na.fromBufferAttribute(this,t),Na.applyMatrix4(e),this.setXYZ(t,Na.x,Na.y,Na.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Na.fromBufferAttribute(this,t),Na.applyNormalMatrix(e),this.setXYZ(t,Na.x,Na.y,Na.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Na.fromBufferAttribute(this,t),Na.transformDirection(e),this.setXYZ(t,Na.x,Na.y,Na.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=denormalize(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=normalize(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=denormalize(t,this.array)),t}setX(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=denormalize(t,this.array)),t}setY(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=denormalize(t,this.array)),t}setZ(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=denormalize(t,this.array)),t}setW(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=normalize(t,this.array),n=normalize(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=normalize(t,this.array),n=normalize(n,this.array),r=normalize(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=normalize(t,this.array),n=normalize(n,this.array),r=normalize(r,this.array),i=normalize(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==``&&(e.name=this.name),this.usage!==35044&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:`dispose`})}},Uint16BufferAttribute=class extends BufferAttribute{constructor(e,t,n){super(new Uint16Array(e),t,n)}},Uint32BufferAttribute=class extends BufferAttribute{constructor(e,t,n){super(new Uint32Array(e),t,n)}},Float32BufferAttribute=class extends BufferAttribute{constructor(e,t,n){super(new Float32Array(e),t,n)}};const Ia=new Box3,La=new K,Ra=new K;var Sphere=class{constructor(e=new K,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t===void 0?Ia.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}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*=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;La.subVectors(e,this.center);let t=La.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(La,n/e),this.radius+=n}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):(Ra.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(La.copy(e.center).add(Ra)),this.expandByPoint(La.copy(e.center).sub(Ra))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}};let za=0;const Ba=new X,Va=new ea,Ha=new K,Ua=new Box3,Wa=new Box3,Ga=new K;var Ka=class BufferGeometry extends EventDispatcher{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:za++}),this.uuid=generateUUID(),this.name=``,this.type=`BufferGeometry`,this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(arrayNeedsUint32(e)?Uint32BufferAttribute:Uint16BufferAttribute)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let t=new q().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return Ba.makeRotationFromQuaternion(e),this.applyMatrix4(Ba),this}rotateX(e){return Ba.makeRotationX(e),this.applyMatrix4(Ba),this}rotateY(e){return Ba.makeRotationY(e),this.applyMatrix4(Ba),this}rotateZ(e){return Ba.makeRotationZ(e),this.applyMatrix4(Ba),this}translate(e,t,n){return Ba.makeTranslation(e,t,n),this.applyMatrix4(Ba),this}scale(e,t,n){return Ba.makeScale(e,t,n),this.applyMatrix4(Ba),this}lookAt(e){return Va.lookAt(e),Va.updateMatrix(),this.applyMatrix4(Va.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ha).negate(),this.translate(Ha.x,Ha.y,Ha.z),this}setFromPoints(e){let t=this.getAttribute(`position`);if(t===void 0){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];t.push(r.x,r.y,r.z||0)}this.setAttribute(`position`,new Float32BufferAttribute(t,3))}else{let n=Math.min(e.length,t.count);for(let r=0;r<n;r++){let n=e[r];t.setXYZ(r,n.x,n.y,n.z||0)}e.length>t.count&&warn(`BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.`),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Box3);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){error(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new K(-1/0,-1/0,-1/0),new K(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];Ua.setFromBufferAttribute(n),this.morphTargetsRelative?(Ga.addVectors(this.boundingBox.min,Ua.min),this.boundingBox.expandByPoint(Ga),Ga.addVectors(this.boundingBox.max,Ua.max),this.boundingBox.expandByPoint(Ga)):(this.boundingBox.expandByPoint(Ua.min),this.boundingBox.expandByPoint(Ua.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&error(`BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.`,this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Sphere);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){error(`BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.`,this),this.boundingSphere.set(new K,1/0);return}if(e){let n=this.boundingSphere.center;if(Ua.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];Wa.setFromBufferAttribute(n),this.morphTargetsRelative?(Ga.addVectors(Ua.min,Wa.min),Ua.expandByPoint(Ga),Ga.addVectors(Ua.max,Wa.max),Ua.expandByPoint(Ga)):(Ua.expandByPoint(Wa.min),Ua.expandByPoint(Wa.max))}Ua.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)Ga.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(Ga));if(t)for(let i=0,a=t.length;i<a;i++){let a=t[i],o=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)Ga.fromBufferAttribute(a,t),o&&(Ha.fromBufferAttribute(e,t),Ga.add(Ha)),r=Math.max(r,n.distanceToSquared(Ga))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&error(`BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.`,this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){error(`BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)`);return}let n=t.position,r=t.normal,i=t.uv,a=this.getAttribute(`tangent`);(a===void 0||a.count!==n.count)&&(a=new BufferAttribute(new Float32Array(4*n.count),4),this.setAttribute(`tangent`,a));let o=[],s=[];for(let e=0;e<n.count;e++)o[e]=new K,s[e]=new K;let c=new K,l=new K,u=new K,d=new G,f=new G,p=new G,m=new K,h=new K;function handleTriangle(e,t,r){c.fromBufferAttribute(n,e),l.fromBufferAttribute(n,t),u.fromBufferAttribute(n,r),d.fromBufferAttribute(i,e),f.fromBufferAttribute(i,t),p.fromBufferAttribute(i,r),l.sub(c),u.sub(c),f.sub(d),p.sub(d);let a=1/(f.x*p.y-p.x*f.y);isFinite(a)&&(m.copy(l).multiplyScalar(p.y).addScaledVector(u,-f.y).multiplyScalar(a),h.copy(u).multiplyScalar(f.x).addScaledVector(l,-p.x).multiplyScalar(a),o[e].add(m),o[t].add(m),o[r].add(m),s[e].add(h),s[t].add(h),s[r].add(h))}let g=this.groups;g.length===0&&(g=[{start:0,count:e.count}]);for(let t=0,n=g.length;t<n;++t){let n=g[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)handleTriangle(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let _=new K,v=new K,y=new K,b=new K;function handleVertex(e){y.fromBufferAttribute(r,e),b.copy(y);let t=o[e];_.copy(t),_.sub(y.multiplyScalar(y.dot(t))).normalize(),v.crossVectors(b,t);let n=v.dot(s[e])<0?-1:1;a.setXYZW(e,_.x,_.y,_.z,n)}for(let t=0,n=g.length;t<n;++t){let n=g[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)handleVertex(e.getX(t+0)),handleVertex(e.getX(t+1)),handleVertex(e.getX(t+2))}this._transformed=!0}computeVertexNormals(){let e=this.index,t=this.getAttribute(`position`);if(t!==void 0){let n=this.getAttribute(`normal`);if(n===void 0||n.count!==t.count)n=new BufferAttribute(new Float32Array(t.count*3),3),this.setAttribute(`normal`,n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);let r=new K,i=new K,a=new K,o=new K,s=new K,c=new K,l=new K,u=new K;if(e)for(let d=0,f=e.count;d<f;d+=3){let f=e.getX(d+0),p=e.getX(d+1),m=e.getX(d+2);r.fromBufferAttribute(t,f),i.fromBufferAttribute(t,p),a.fromBufferAttribute(t,m),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),o.fromBufferAttribute(n,f),s.fromBufferAttribute(n,p),c.fromBufferAttribute(n,m),o.add(l),s.add(l),c.add(l),n.setXYZ(f,o.x,o.y,o.z),n.setXYZ(p,s.x,s.y,s.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let e=0,o=t.count;e<o;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),n.setXYZ(e+0,l.x,l.y,l.z),n.setXYZ(e+1,l.x,l.y,l.z),n.setXYZ(e+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Ga.fromBufferAttribute(e,t),Ga.normalize(),e.setXYZ(t,Ga.x,Ga.y,Ga.z)}toNonIndexed(){function convertBufferAttribute(e,t){let n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0;for(let i=0,c=t.length;i<c;i++){o=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)a[s++]=n[o++]}return new BufferAttribute(a,r,i)}if(this.index===null)return warn(`BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.`),this;let e=new BufferGeometry,t=this.index.array,n=this.attributes;for(let r in n){let i=n[r],a=convertBufferAttribute(i,t);e.setAttribute(r,a)}let r=this.morphAttributes;for(let n in r){let i=[],a=r[n];for(let e=0,n=a.length;e<n;e++){let n=a[e],r=convertBufferAttribute(n,t);i.push(r)}e.morphAttributes[n]=i}e.morphTargetsRelative=this.morphTargetsRelative;let i=this.groups;for(let t=0,n=i.length;t<n;t++){let n=i[t];e.addGroup(n.start,n.count,n.materialIndex)}return e}toJSON(){let e={metadata:{version:4.7,type:`BufferGeometry`,generator:`BufferGeometry.toJSON`}};if(e.uuid=this.uuid,e.type=this.parameters!==void 0&&this._transformed===!0?`BufferGeometry`:this.type,this.name!==``&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0&&this._transformed!==!0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t<r;t++){let r=n[t];a.push(r.toJSON(e.data))}a.length>0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),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;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());let s=e.boundingSphere;return s!==null&&(this.boundingSphere=s.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}dispose(){this.dispatchEvent({type:`dispose`})}};let qa=0;var Material=class extends EventDispatcher{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:qa++}),this.uuid=generateUUID(),this.name=``,this.type=`Material`,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Color(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ui,this.stencilZFail=ui,this.stencilZPass=ui,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){warn(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){warn(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector2&&n&&n.isVector2||r&&r.isEuler&&n&&n.isEuler||r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function extractFromCache(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=extractFromCache(e.textures),r=extractFromCache(e.images);t.length>0&&(n.textures=t),r.length>0&&(n.images=r)}return n}fromJSON(e,t){if(e.uuid!==void 0&&(this.uuid=e.uuid),e.name!==void 0&&(this.name=e.name),e.color!==void 0&&this.color!==void 0&&this.color.setHex(e.color),e.roughness!==void 0&&(this.roughness=e.roughness),e.metalness!==void 0&&(this.metalness=e.metalness),e.sheen!==void 0&&(this.sheen=e.sheen),e.sheenColor!==void 0&&(this.sheenColor=new Color().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(this.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&this.emissive!==void 0&&this.emissive.setHex(e.emissive),e.specular!==void 0&&this.specular!==void 0&&this.specular.setHex(e.specular),e.specularIntensity!==void 0&&(this.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&this.specularColor!==void 0&&this.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(this.shininess=e.shininess),e.clearcoat!==void 0&&(this.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(this.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(this.dispersion=e.dispersion),e.iridescence!==void 0&&(this.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(this.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(this.transmission=e.transmission),e.thickness!==void 0&&(this.thickness=e.thickness),e.attenuationDistance!==void 0&&(this.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&this.attenuationColor!==void 0&&this.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(this.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(this.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(this.fog=e.fog),e.flatShading!==void 0&&(this.flatShading=e.flatShading),e.blending!==void 0&&(this.blending=e.blending),e.combine!==void 0&&(this.combine=e.combine),e.side!==void 0&&(this.side=e.side),e.shadowSide!==void 0&&(this.shadowSide=e.shadowSide),e.opacity!==void 0&&(this.opacity=e.opacity),e.transparent!==void 0&&(this.transparent=e.transparent),e.alphaTest!==void 0&&(this.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(this.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(this.depthFunc=e.depthFunc),e.depthTest!==void 0&&(this.depthTest=e.depthTest),e.depthWrite!==void 0&&(this.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(this.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(this.blendSrc=e.blendSrc),e.blendDst!==void 0&&(this.blendDst=e.blendDst),e.blendEquation!==void 0&&(this.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(this.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(this.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(this.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&this.blendColor!==void 0&&this.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(this.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(this.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(this.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(this.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(this.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(this.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(this.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(this.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(this.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(this.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(this.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(this.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(this.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(this.rotation=e.rotation),e.linewidth!==void 0&&(this.linewidth=e.linewidth),e.dashSize!==void 0&&(this.dashSize=e.dashSize),e.gapSize!==void 0&&(this.gapSize=e.gapSize),e.scale!==void 0&&(this.scale=e.scale),e.polygonOffset!==void 0&&(this.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(this.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(this.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(this.dithering=e.dithering),e.alphaToCoverage!==void 0&&(this.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(this.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(this.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(this.allowOverride=e.allowOverride),e.visible!==void 0&&(this.visible=e.visible),e.toneMapped!==void 0&&(this.toneMapped=e.toneMapped),e.userData!==void 0&&(this.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors==`number`?this.vertexColors=e.vertexColors>0:this.vertexColors=e.vertexColors),e.size!==void 0&&(this.size=e.size),e.sizeAttenuation!==void 0&&(this.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(this.map=t[e.map]||null),e.matcap!==void 0&&(this.matcap=t[e.matcap]||null),e.alphaMap!==void 0&&(this.alphaMap=t[e.alphaMap]||null),e.bumpMap!==void 0&&(this.bumpMap=t[e.bumpMap]||null),e.bumpScale!==void 0&&(this.bumpScale=e.bumpScale),e.normalMap!==void 0&&(this.normalMap=t[e.normalMap]||null),e.normalMapType!==void 0&&(this.normalMapType=e.normalMapType),e.normalScale!==void 0){let t=e.normalScale;Array.isArray(t)===!1&&(t=[t,t]),this.normalScale=new G().fromArray(t)}return e.displacementMap!==void 0&&(this.displacementMap=t[e.displacementMap]||null),e.displacementScale!==void 0&&(this.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(this.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(this.roughnessMap=t[e.roughnessMap]||null),e.metalnessMap!==void 0&&(this.metalnessMap=t[e.metalnessMap]||null),e.emissiveMap!==void 0&&(this.emissiveMap=t[e.emissiveMap]||null),e.emissiveIntensity!==void 0&&(this.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(this.specularMap=t[e.specularMap]||null),e.specularIntensityMap!==void 0&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),e.specularColorMap!==void 0&&(this.specularColorMap=t[e.specularColorMap]||null),e.envMap!==void 0&&(this.envMap=t[e.envMap]||null),e.envMapRotation!==void 0&&this.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(this.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(this.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(this.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(this.lightMap=t[e.lightMap]||null),e.lightMapIntensity!==void 0&&(this.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(this.aoMap=t[e.aoMap]||null),e.aoMapIntensity!==void 0&&(this.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(this.gradientMap=t[e.gradientMap]||null),e.clearcoatMap!==void 0&&(this.clearcoatMap=t[e.clearcoatMap]||null),e.clearcoatRoughnessMap!==void 0&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),e.clearcoatNormalMap!==void 0&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),e.clearcoatNormalScale!==void 0&&(this.clearcoatNormalScale=new G().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(this.iridescenceMap=t[e.iridescenceMap]||null),e.iridescenceThicknessMap!==void 0&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),e.transmissionMap!==void 0&&(this.transmissionMap=t[e.transmissionMap]||null),e.thicknessMap!==void 0&&(this.thicknessMap=t[e.thicknessMap]||null),e.anisotropyMap!==void 0&&(this.anisotropyMap=t[e.anisotropyMap]||null),e.sheenColorMap!==void 0&&(this.sheenColorMap=t[e.sheenColorMap]||null),e.sheenRoughnessMap!==void 0&&(this.sheenRoughnessMap=t[e.sheenRoughnessMap]||null),this}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;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,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.allowOverride=e.allowOverride,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++}};const Ja=new K,Ya=new K,Xa=new K,Za=new K,Qa=new K,$a=new K,eo=new K;var Ray=class{constructor(e=new K,t=new K(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.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,Ja)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Ja.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ja.copy(this.origin).addScaledVector(this.direction,t),Ja.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Ya.copy(e).add(t).multiplyScalar(.5),Xa.copy(t).sub(e).normalize(),Za.copy(this.origin).sub(Ya);let i=e.distanceTo(t)*.5,a=-this.direction.dot(Xa),o=Za.dot(this.direction),s=-Za.dot(Xa),c=Za.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0)if(u=a*s-o,d=a*o-s,p=i*l,u>=0)if(d>=-p)if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(Ya).addScaledVector(Xa,d),f}intersectSphere(e,t){Ja.subVectors(e.center,this.origin);let n=Ja.dot(this.direction),r=Ja.dot(Ja)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),u>=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s<r||r!==r)&&(r=s),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,Ja)!==null}intersectTriangle(e,t,n,r,i){Qa.subVectors(t,e),$a.subVectors(n,e),eo.crossVectors(Qa,$a);let a=this.direction.dot(eo),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Za.subVectors(this.origin,e);let s=o*this.direction.dot($a.crossVectors(Za,$a));if(s<0)return null;let c=o*this.direction.dot(Qa.cross(Za));if(c<0||s+c>a)return null;let l=-o*Za.dot(eo);return l<0?null:this.at(l/a,i)}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)}},MeshBasicMaterial=class extends Material{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new Color(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 Ri,this.combine=0,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 to=new X,no=new Ray,ro=new Sphere,io=new K,ao=new K,oo=new K,so=new K,co=new K,lo=new K,uo=new K,fo=new K;var Mesh=class extends ea{constructor(e=new Ka,t=new MeshBasicMaterial){super(),this.isMesh=!0,this.type=`Mesh`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);let o=this.morphTargetInfluences;if(i&&o){lo.set(0,0,0);for(let n=0,r=i.length;n<r;n++){let r=o[n],s=i[n];r!==0&&(co.fromBufferAttribute(s,e),a?lo.addScaledVector(co,r):lo.addScaledVector(co.sub(t),r))}t.add(lo)}return t}raycast(e,t){let n=this.geometry,r=this.material,i=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),ro.copy(n.boundingSphere),ro.applyMatrix4(i),no.copy(e.ray).recast(e.near),!(ro.containsPoint(no.origin)===!1&&(no.intersectSphere(ro,io)===null||no.origin.distanceToSquared(io)>(e.far-e.near)**2))&&(to.copy(i).invert(),no.copy(e.ray).applyMatrix4(to),!(n.boundingBox!==null&&no.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,no)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null)if(Array.isArray(a))for(let i=0,s=d.length;i<s;i++){let s=d[i],p=a[s.materialIndex],m=Math.max(s.start,f.start),h=Math.min(o.count,Math.min(s.start+s.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=o.getX(i),d=o.getX(i+1),f=o.getX(i+2);r=checkGeometryIntersection(this,p,e,n,c,l,u,a,d,f),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),s=Math.min(o.count,f.start+f.count);for(let d=i,f=s;d<f;d+=3){let i=o.getX(d),s=o.getX(d+1),f=o.getX(d+2);r=checkGeometryIntersection(this,a,e,n,c,l,u,i,s,f),r&&(r.faceIndex=Math.floor(d/3),t.push(r))}}else if(s!==void 0)if(Array.isArray(a))for(let i=0,o=d.length;i<o;i++){let o=d[i],p=a[o.materialIndex],m=Math.max(o.start,f.start),h=Math.min(s.count,Math.min(o.start+o.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=i,s=i+1,d=i+2;r=checkGeometryIntersection(this,p,e,n,c,l,u,a,s,d),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),o=Math.min(s.count,f.start+f.count);for(let s=i,d=o;s<d;s+=3){let i=s,o=s+1,d=s+2;r=checkGeometryIntersection(this,a,e,n,c,l,u,i,o,d),r&&(r.faceIndex=Math.floor(s/3),t.push(r))}}}};function checkIntersection$1(e,t,n,r,i,a,o,s){let c;if(c=t.side===1?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side===0,s),c===null)return null;fo.copy(s),fo.applyMatrix4(e.matrixWorld);let l=n.ray.origin.distanceTo(fo);return l<n.near||l>n.far?null:{distance:l,point:fo.clone(),object:e}}function checkGeometryIntersection(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,ao),e.getVertexPosition(c,oo),e.getVertexPosition(l,so);let u=checkIntersection$1(e,t,n,r,ao,oo,so,uo);if(u){let e=new K;ya.getBarycoord(uo,ao,oo,so,e),i&&(u.uv=ya.getInterpolatedAttribute(i,s,c,l,e,new G)),a&&(u.uv1=ya.getInterpolatedAttribute(a,s,c,l,e,new G)),o&&(u.normal=ya.getInterpolatedAttribute(o,s,c,l,e,new K),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new K,materialIndex:0};ya.getNormal(ao,oo,so,t.normal),u.face=t,u.barycoord=e}return u}var DataTexture=class extends Oi{constructor(e=null,t=1,n=1,r,i,a,o,s,c=Fr,l=Fr,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};const po=new K,mo=new K,ho=new q;var Plane=class{constructor(e=new K(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let r=po.subVectors(n,t).cross(mo.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let 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,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,n=!0){let r=e.delta(po),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let a=-(e.start.dot(this.normal)+this.constant)/i;return n===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>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,t){let n=t||ho.getNormalMatrix(e),r=this.coplanarPoint(po).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),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 go=new Sphere,_o=new G(.5,.5),vo=new K;var Frustum=class{constructor(e=new Plane,t=new Plane,n=new Plane,r=new Plane,i=new Plane,a=new Plane){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=di,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===2e3)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else if(t===2001)r[5].setComponents(s,d,h,y).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),go.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),go.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(go)}intersectsSprite(e){go.center.set(0,0,0);let t=_o.distanceTo(e.center);return go.radius=.7071067811865476+t,go.applyMatrix4(e.matrixWorld),this.intersectsSphere(go)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let r=t[n];if(vo.x=r.normal.x>0?e.max.x:e.min.x,vo.y=r.normal.y>0?e.max.y:e.min.y,vo.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(vo)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}},CubeTexture=class extends Oi{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},DepthTexture=class extends Oi{constructor(e,t,n=Br,r,i,a,o=Fr,s=Fr,c,l=qr,u=1){if(l!==1026&&l!==1027)throw Error(`THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Source(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},CubeDepthTexture=class extends DepthTexture{constructor(e,t=Br,n=301,r,i,a=Fr,o=Fr,s,c=qr){let l={width:e,height:e,depth:1},u=[l,l,l,l,l,l];super(e,e,t,n,r,i,a,o,s,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},ExternalTexture=class extends Oi{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},yo=class BoxGeometry extends Ka{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;buildPlane(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),buildPlane(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),buildPlane(`x`,`z`,`y`,1,1,e,n,t,r,a,2),buildPlane(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),buildPlane(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),buildPlane(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new Float32BufferAttribute(c,3)),this.setAttribute(`normal`,new Float32BufferAttribute(l,3)),this.setAttribute(`uv`,new Float32BufferAttribute(u,2));function buildPlane(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new K;for(let a=0;a<w;a++){let o=a*y-x;for(let s=0;s<C;s++)D[e]=(s*v-b)*r,D[t]=o*i,D[n]=S,c.push(D.x,D.y,D.z),D[e]=0,D[t]=0,D[n]=m>0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e<g;e++)for(let t=0;t<h;t++){let n=d+t+C*e,r=d+t+C*(e+1),i=d+(t+1)+C*(e+1),a=d+(t+1)+C*e;s.push(n,r,a),s.push(r,i,a),E+=6}o.addGroup(f,E,_),f+=E,d+=T}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new BoxGeometry(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}},bo=class PlaneGeometry extends Ka{constructor(e=1,t=1,n=1,r=1){super(),this.type=`PlaneGeometry`,this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};let i=e/2,a=t/2,o=Math.floor(n),s=Math.floor(r),c=o+1,l=s+1,u=e/o,d=t/s,f=[],p=[],m=[],h=[];for(let e=0;e<l;e++){let t=e*d-a;for(let n=0;n<c;n++){let r=n*u-i;p.push(r,-t,0),m.push(0,0,1),h.push(n/o),h.push(1-e/s)}}for(let e=0;e<s;e++)for(let t=0;t<o;t++){let n=t+c*e,r=t+c*(e+1),i=t+1+c*(e+1),a=t+1+c*e;f.push(n,r,a),f.push(r,i,a)}this.setIndex(f),this.setAttribute(`position`,new Float32BufferAttribute(p,3)),this.setAttribute(`normal`,new Float32BufferAttribute(m,3)),this.setAttribute(`uv`,new Float32BufferAttribute(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new PlaneGeometry(e.width,e.height,e.widthSegments,e.heightSegments)}};function cloneUniforms(e){let t={};for(let n in e){t[n]={};for(let r in e[n]){let i=e[n][r];if(isThreeObject(i))i.isRenderTargetTexture?(warn(`UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().`),t[n][r]=null):t[n][r]=i.clone();else if(Array.isArray(i))if(isThreeObject(i[0])){let e=[];for(let t=0,n=i.length;t<n;t++)e[t]=i[t].clone();t[n][r]=e}else t[n][r]=i.slice();else t[n][r]=i}}return t}function mergeUniforms(e){let t={};for(let n=0;n<e.length;n++){let r=cloneUniforms(e[n]);for(let e in r)t[e]=r[e]}return t}function isThreeObject(e){return e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture||e.isQuaternion)}function cloneUniformsGroups(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}function getUnlitUniformColorSpace(e){let t=e.getRenderTarget();return t===null?e.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:J.workingColorSpace}const xo={clone:cloneUniforms,merge:mergeUniforms};var So=`void main() {
|
|
105
105
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
106
|
-
}`,
|
|
106
|
+
}`,Co=`void main() {
|
|
107
107
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
108
|
-
}`,ShaderMaterial=class extends Material{constructor(e){super(),this.isShaderMaterial=!0,this.type=`ShaderMaterial`,this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Io,this.fragmentShader=Lo,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=cloneUniforms(e.uniforms),this.uniformsGroups=cloneUniformsGroups(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let n in this.uniforms){let r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:`t`,value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:`c`,value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:`v2`,value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:`v3`,value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:`v4`,value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:`m3`,value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:`m4`,value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)this.extensions[e]===!0&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}fromJSON(e,t){if(super.fromJSON(e,t),e.uniforms!==void 0)for(let n in e.uniforms){let r=e.uniforms[n];switch(this.uniforms[n]={},r.type){case`t`:this.uniforms[n].value=t[r.value]||null;break;case`c`:this.uniforms[n].value=new Color().setHex(r.value);break;case`v2`:this.uniforms[n].value=new Oi().fromArray(r.value);break;case`v3`:this.uniforms[n].value=new P().fromArray(r.value);break;case`v4`:this.uniforms[n].value=new Vi().fromArray(r.value);break;case`m3`:this.uniforms[n].value=new ji().fromArray(r.value);break;case`m4`:this.uniforms[n].value=new Hi().fromArray(r.value);break;default:this.uniforms[n].value=r.value}}if(e.defines!==void 0&&(this.defines=e.defines),e.vertexShader!==void 0&&(this.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(this.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(this.glslVersion=e.glslVersion),e.extensions!==void 0)for(let t in e.extensions)this.extensions[t]=e.extensions[t];return e.lights!==void 0&&(this.lights=e.lights),e.clipping!==void 0&&(this.clipping=e.clipping),this}},RawShaderMaterial=class extends ShaderMaterial{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type=`RawShaderMaterial`}},MeshPhongMaterial=class extends Material{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type=`MeshPhongMaterial`,this.color=new Color(16777215),this.specular=new Color(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Oi(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Qi,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,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.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,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.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.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,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}},MeshLambertMaterial=class extends Material{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type=`MeshLambertMaterial`,this.color=new Color(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Oi(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Qi,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,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.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.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.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.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,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}},MeshDepthMaterial=class extends Material{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type=`MeshDepthMaterial`,this.depthPacking=3200,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}},MeshDistanceMaterial=class extends Material{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}};function convertArray(e,t){return!e||e.constructor===t?e:typeof t.BYTES_PER_ELEMENT==`number`?new t(e):Array.prototype.slice.call(e)}var Interpolant=class{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r===void 0?new t.constructor(n):r,this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];validate_interval:{seek:{let a;linear_scan:{forward_scan:if(!(e<r)){for(let a=n+2;;){if(r===void 0){if(e<i)break forward_scan;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(i=r,r=t[++n],e<r)break seek}a=t.length;break linear_scan}if(!(e>=i)){let o=t[1];e<o&&(n=2,i=o);for(let a=n-2;;){if(i===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(r=i,i=t[--n-1],e>=i)break seek}a=n,n=0;break linear_scan}break validate_interval}for(;n<a;){let r=n+a>>>1;e<t[r]?a=r:n=r+1}if(r=t[n],i=t[n-1],i===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r;for(let e=0;e!==r;++e)t[e]=n[i+e];return t}interpolate_(){throw Error(`THREE.Interpolant: Call to abstract method.`)}intervalChanged_(){}},CubicInterpolant=class extends Interpolant{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:fi,endingEnd:fi}}intervalChanged_(e,t,n){let r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(o===void 0)switch(this.getSettings_().endingStart){case pi:i=e,o=2*t-n;break;case mi:i=r.length-2,o=t+r[i]-r[i+1];break;default:i=e,o=n}if(s===void 0)switch(this.getSettings_().endingEnd){case pi:a=e,s=2*n-t;break;case mi:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}let c=(n-t)*.5,l=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-n),this._offsetPrev=i*l,this._offsetNext=a*l}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,p=(n-t)/(r-t),m=p*p,h=m*p,g=-d*h+2*d*m-d*p,_=(1+d)*h+(-1.5-2*d)*m+(-.5+d)*p+1,v=(-1-f)*h+(1.5+f)*m+.5*p,y=f*h-f*m;for(let e=0;e!==o;++e)i[e]=g*a[l+e]+_*a[c+e]+v*a[s+e]+y*a[u+e];return i}},LinearInterpolant=class extends Interpolant{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=(n-t)/(r-t),u=1-l;for(let e=0;e!==o;++e)i[e]=a[c+e]*u+a[s+e]*l;return i}},DiscreteInterpolant=class extends Interpolant{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}},BezierInterpolant=class extends Interpolant{interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this.inTangents,u=this.outTangents;if(!l||!u){let e=(n-t)/(r-t),l=1-e;for(let t=0;t!==o;++t)i[t]=a[c+t]*l+a[s+t]*e;return i}let d=o*2,f=e-1;for(let p=0;p!==o;++p){let o=a[c+p],m=a[s+p],h=f*d+p*2,g=u[h],_=u[h+1],v=e*d+p*2,y=l[v],b=l[v+1],x=(n-t)/(r-t),S,C,w,T,E;for(let e=0;e<8;e++){S=x*x,C=S*x,w=1-x,T=w*w,E=T*w;let e=E*t+3*T*x*g+3*w*S*y+C*r-n;if(Math.abs(e)<1e-10)break;let i=3*T*(g-t)+6*w*x*(y-g)+3*S*(r-y);if(Math.abs(i)<1e-10)break;x-=e/i,x=Math.max(0,Math.min(1,x))}i[p]=E*o+3*T*x*_+3*w*S*b+C*m}return i}},KeyframeTrack=class{constructor(e,t,n,r){if(e===void 0)throw Error(`THREE.KeyframeTrack: track name is undefined`);if(t===void 0||t.length===0)throw Error(`THREE.KeyframeTrack: no keyframes in track named `+e);this.name=e,this.times=convertArray(t,this.TimeBufferType),this.values=convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:convertArray(e.times,Array),values:convertArray(e.values,Array)};let t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new LinearInterpolant(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new CubicInterpolant(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodBezier(e){let t=new BezierInterpolant(this.times,this.values,this.getValueSize(),e);return this.settings&&(t.inTangents=this.settings.inTangents,t.outTangents=this.settings.outTangents),t}setInterpolation(e){let t;switch(e){case ci:t=this.InterpolantFactoryMethodDiscrete;break;case li:t=this.InterpolantFactoryMethodLinear;break;case ui:t=this.InterpolantFactoryMethodSmooth;break;case di:t=this.InterpolantFactoryMethodBezier;break}if(t===void 0){let t=`unsupported interpolation for `+this.ValueTypeName+` keyframe track named `+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(t);return warn(`KeyframeTrack:`,t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ci;case this.InterpolantFactoryMethodLinear:return li;case this.InterpolantFactoryMethodSmooth:return ui;case this.InterpolantFactoryMethodBezier:return di}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){let n=this.times,r=n.length,i=0,a=r-1;for(;i!==r&&n[i]<e;)++i;for(;a!==-1&&n[a]>t;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);let e=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(error(`KeyframeTrack: Invalid value size in track.`,this),e=!1);let n=this.times,r=this.values,i=n.length;i===0&&(error(`KeyframeTrack: Track is empty.`,this),e=!1);let a=null;for(let t=0;t!==i;t++){let r=n[t];if(typeof r==`number`&&isNaN(r)){error(`KeyframeTrack: Time is not a valid number.`,this,t,r),e=!1;break}if(a!==null&&a>r){error(`KeyframeTrack: Out of order keys.`,this,t,r,a),e=!1;break}a=r}if(r!==void 0&&isTypedArray(r))for(let t=0,n=r.length;t!==n;++t){let n=r[t];if(isNaN(n)){error(`KeyframeTrack: Value is not a valid number.`,this,t,n),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===ui,i=e.length-1,a=1;for(let o=1;o<i;++o){let i=!1,s=e[o];if(s!==e[o+1]&&(o!==1||s!==e[0]))if(r)i=!0;else{let e=o*n,r=e-n,a=e+n;for(let o=0;o!==n;++o){let n=t[e+o];if(n!==t[r+o]||n!==t[a+o]){i=!0;break}}}if(i){if(o!==a){e[a]=e[o];let r=o*n,i=a*n;for(let e=0;e!==n;++e)t[i+e]=t[r+e]}++a}}if(i>0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a===e.length?(this.times=e,this.values=t):(this.times=e.slice(0,a),this.values=t.slice(0,a*n)),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};KeyframeTrack.prototype.ValueTypeName=``,KeyframeTrack.prototype.TimeBufferType=Float32Array,KeyframeTrack.prototype.ValueBufferType=Float32Array,KeyframeTrack.prototype.DefaultInterpolation=li;var BooleanKeyframeTrack=class extends KeyframeTrack{constructor(e,t,n){super(e,t,n)}};BooleanKeyframeTrack.prototype.ValueTypeName=`bool`,BooleanKeyframeTrack.prototype.ValueBufferType=Array,BooleanKeyframeTrack.prototype.DefaultInterpolation=ci,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;var ColorKeyframeTrack=class extends KeyframeTrack{constructor(e,t,n,r){super(e,t,n,r)}};ColorKeyframeTrack.prototype.ValueTypeName=`color`;var NumberKeyframeTrack=class extends KeyframeTrack{constructor(e,t,n,r){super(e,t,n,r)}};NumberKeyframeTrack.prototype.ValueTypeName=`number`;var QuaternionLinearInterpolant=class extends Interpolant{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),c=e*o;for(let e=c+o;c!==e;c+=4)Quaternion.slerpFlat(i,0,a,c-o,a,c,s);return i}},QuaternionKeyframeTrack=class extends KeyframeTrack{constructor(e,t,n,r){super(e,t,n,r)}InterpolantFactoryMethodLinear(e){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)}};QuaternionKeyframeTrack.prototype.ValueTypeName=`quaternion`,QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;var StringKeyframeTrack=class extends KeyframeTrack{constructor(e,t,n){super(e,t,n)}};StringKeyframeTrack.prototype.ValueTypeName=`string`,StringKeyframeTrack.prototype.ValueBufferType=Array,StringKeyframeTrack.prototype.DefaultInterpolation=ci,StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;var VectorKeyframeTrack=class extends KeyframeTrack{constructor(e,t,n,r){super(e,t,n,r)}};VectorKeyframeTrack.prototype.ValueTypeName=`vector`;const Ro={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(isBlobURL(e)||(this.files[e]=t))},get:function(e){if(this.enabled!==!1&&!isBlobURL(e))return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function isBlobURL(e){try{let t=e.slice(e.indexOf(`:`)+1);return new URL(t).protocol===`blob:`}catch{return!1}}var LoadingManager=class{constructor(e,t,n){let r=this,i=!1,a=0,o=0,s,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(e){o++,i===!1&&r.onStart!==void 0&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,r.onProgress!==void 0&&r.onProgress(e,a,o),a===o&&(i=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(e){r.onError!==void 0&&r.onError(e)},this.resolveURL=function(e){return e=e.normalize(`NFC`),s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){let t=c.indexOf(e);return t!==-1&&c.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=c.length;t<n;t+=2){let n=c[t],r=c[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||=new AbortController,this._abortController}};const zo=new LoadingManager;var Loader=class{constructor(e){this.manager=e===void 0?zo:e,this.crossOrigin=`anonymous`,this.withCredentials=!1,this.path=``,this.resourcePath=``,this.requestHeader={},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}load(){}loadAsync(e,t){let n=this;return new Promise(function(r,i){n.load(e,r,t,i)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}};Loader.DEFAULT_MATERIAL_NAME=`__DEFAULT`;const Bo=new WeakMap;var ImageLoader=class extends Loader{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=Ro.get(`image:${e}`);if(a!==void 0){if(a.complete===!0)i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0);else{let e=Bo.get(a);e===void 0&&(e=[],Bo.set(a,e)),e.push({onLoad:t,onError:r})}return a}let o=createElementNS(`img`);function onImageLoad(){removeEventListeners(),t&&t(this);let n=Bo.get(this)||[];for(let e=0;e<n.length;e++){let t=n[e];t.onLoad&&t.onLoad(this)}Bo.delete(this),i.manager.itemEnd(e)}function onImageError(t){removeEventListeners(),r&&r(t),Ro.remove(`image:${e}`);let n=Bo.get(this)||[];for(let e=0;e<n.length;e++){let r=n[e];r.onError&&r.onError(t)}Bo.delete(this),i.manager.itemError(e),i.manager.itemEnd(e)}function removeEventListeners(){o.removeEventListener(`load`,onImageLoad,!1),o.removeEventListener(`error`,onImageError,!1)}return o.addEventListener(`load`,onImageLoad,!1),o.addEventListener(`error`,onImageError,!1),e.slice(0,5)!==`data:`&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),Ro.add(`image:${e}`,o),i.manager.itemStart(e),o.src=e,o}},CubeTextureLoader=class extends Loader{constructor(e){super(e)}load(e,t,n,r){let i=new CubeTexture;i.colorSpace=hi;let a=new ImageLoader(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);let o=0;function loadTexture(n){a.load(e[n],function(e){i.images[n]=e,o++,o===6&&(i.needsUpdate=!0,t&&t(i))},void 0,r)}for(let t=0;t<e.length;++t)loadTexture(t);return i}},TextureLoader=class extends Loader{constructor(e){super(e)}load(e,t,n,r){let i=new Bi,a=new ImageLoader(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(e){i.image=e,i.needsUpdate=!0,t!==void 0&&t(i)},n,r),i}},Light=class extends ma{constructor(e,t=1){super(),this.isLight=!0,this.type=`Light`,this.color=new Color(e),this.intensity=t}dispose(){this.dispatchEvent({type:`dispose`})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}};const Vo=new Hi,Ho=new P,Uo=new P;var LightShadow=class{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Oi(512,512),this.mapType=qr,this.map=null,this.mapPass=null,this.matrix=new Hi,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Frustum,this._frameExtents=new Oi(1,1),this._viewportCount=1,this._viewports=[new Vi(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,n=this.matrix;Ho.setFromMatrixPosition(e.matrixWorld),t.position.copy(Ho),Uo.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Uo),t.updateMatrixWorld(),Vo.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Vo,t.coordinateSystem,t.reversedDepth),t.coordinateSystem===2001||t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Vo)}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.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this.biasNode=e.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){let 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}};const Wo=new P,Go=new Quaternion,Ko=new P;var Camera=class extends ma{constructor(){super(),this.isCamera=!0,this.type=`Camera`,this.matrixWorldInverse=new Hi,this.projectionMatrix=new Hi,this.projectionMatrixInverse=new Hi,this.coordinateSystem=bi,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),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.matrixWorld.decompose(Wo,Go,Ko),Ko.x===1&&Ko.y===1&&Ko.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Wo,Go,Ko.set(1,1,1)).invert()}updateWorldMatrix(e,t,n=!1){super.updateWorldMatrix(e,t,n),this.matrixWorld.decompose(Wo,Go,Ko),Ko.x===1&&Ko.y===1&&Ko.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Wo,Go,Ko.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}};const qo=new P,Jo=new Oi,Yo=new Oi;var PerspectiveCamera=class extends Camera{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type=`PerspectiveCamera`,this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),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){let t=.5*this.getFilmHeight()/e;this.fov=Ei*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Ti*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ei*2*Math.atan(Math.tan(Ti*.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,t,n){qo.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(qo.x,qo.y).multiplyScalar(-e/qo.z),qo.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(qo.x,qo.y).multiplyScalar(-e/qo.z)}getViewSize(e,t){return this.getViewBounds(e,Jo,Yo),t.subVectors(Yo,Jo)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,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=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Ti*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(this.view!==null&&this.view.enabled){let e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}let o=this.filmOffset;o!==0&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},OrthographicCamera=class extends Camera{constructor(e=-1,t=1,n=1,r=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type=`OrthographicCamera`,this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),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,t,n,r,i,a){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=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(this.view!==null&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,a=i+e*this.view.width,o-=t*this.view.offsetY,s=o-t*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}},DirectionalLightShadow=class extends LightShadow{constructor(){super(new OrthographicCamera(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},DirectionalLight=class extends Light{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type=`DirectionalLight`,this.position.copy(ma.DEFAULT_UP),this.updateMatrix(),this.target=new ma,this.shadow=new DirectionalLightShadow}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}},AmbientLight=class extends Light{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type=`AmbientLight`}},CubeCamera=class extends ma{constructor(e,t,n){super(),this.type=`CubeCamera`,this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new PerspectiveCamera(-90,1,e,t);r.layers=this.layers,this.add(r);let i=new PerspectiveCamera(-90,1,e,t);i.layers=this.layers,this.add(i);let a=new PerspectiveCamera(-90,1,e,t);a.layers=this.layers,this.add(a);let o=new PerspectiveCamera(-90,1,e,t);o.layers=this.layers,this.add(o);let s=new PerspectiveCamera(-90,1,e,t);s.layers=this.layers,this.add(s);let c=new PerspectiveCamera(-90,1,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(let e of t)this.remove(e);if(e===2e3)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else if(e===2001)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);else throw Error(`THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: `+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,o,s,c,l]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let h=!1;h=e.isWebGLRenderer===!0?e.state.buffers.depth.getReversed():e.reversedDepthBuffer,e.setRenderTarget(n,0,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,i),e.setRenderTarget(n,1,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,a),e.setRenderTarget(n,2,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,o),e.setRenderTarget(n,3,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,s),e.setRenderTarget(n,4,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,c),n.texture.generateMipmaps=m,e.setRenderTarget(n,5,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,l),e.setRenderTarget(u,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}},ArrayCamera=class extends PerspectiveCamera{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}};const Xo=RegExp(`[\\[\\]\\.:\\/]`,`g`),Zo=RegExp(`^((?:[^\\[\\]\\.:\\/]+[\\/:])*)([^\\[\\]:\\/]+)?(?:\\.([^\\[\\]\\.:\\/]+)(?:\\[(.+)\\])?)?\\.([^\\[\\]\\.:\\/]+)(?:\\[(.+)\\])?$`),Qo=[`material`,`materials`,`bones`,`map`];var Composite=class{constructor(e,t,n){let r=n||$o.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},$o=class PropertyBinding{constructor(e,t,n){this.path=t,this.parsedPath=n||PropertyBinding.parseTrackName(t),this.node=PropertyBinding.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new PropertyBinding.Composite(e,t,n):new PropertyBinding(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,`_`).replace(Xo,``)}static parseTrackName(e){let t=Zo.exec(e);if(t===null)throw Error(`THREE.PropertyBinding: Cannot parse trackName: `+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(`.`);if(r!==void 0&&r!==-1){let e=n.nodeName.substring(r+1);Qo.indexOf(e)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(n.propertyName===null||n.propertyName.length===0)throw Error(`THREE.PropertyBinding: can not parse propertyName from trackName: `+e);return n}static findNode(e,t){if(t===void 0||t===``||t===`.`||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let searchNodeSubtree=function(e){for(let n=0;n<e.length;n++){let r=e[n];if(r.name===t||r.uuid===t)return r;let i=searchNodeSubtree(r.children);if(i)return i}return null},n=searchNodeSubtree(e.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=PropertyBinding.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){warn(`PropertyBinding: No target node found for track: `+this.path+`.`);return}if(n){let r=t.objectIndex;switch(n){case`materials`:if(!e.material){error(`PropertyBinding: Can not bind to material as node does not have a material.`,this);return}if(!e.material.materials){error(`PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.`,this);return}e=e.material.materials;break;case`bones`:if(!e.skeleton){error(`PropertyBinding: Can not bind to bones as node does not have a skeleton.`,this);return}e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===r){r=t;break}break;case`map`:if(`map`in e){e=e.map;break}if(!e.material){error(`PropertyBinding: Can not bind to material as node does not have a material.`,this);return}if(!e.material.map){error(`PropertyBinding: Can not bind to material.map as node.material does not have a map.`,this);return}e=e.material.map;break;default:if(e[n]===void 0){error(`PropertyBinding: Can not bind to objectName of node undefined.`,this);return}e=e[n]}if(r!==void 0){if(e[r]===void 0){error(`PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.`,this,e);return}e=e[r]}}let a=e[r];if(a===void 0){let n=t.nodeName;error(`PropertyBinding: Trying to update property for track: `+n+`.`+r+` but it wasn't found.`,e);return}let o=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?o=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let s=this.BindingType.Direct;if(i!==void 0){if(r===`morphTargetInfluences`){if(!e.geometry){error(`PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.`,this);return}if(!e.geometry.morphAttributes){error(`PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.`,this);return}e.morphTargetDictionary[i]!==void 0&&(i=e.morphTargetDictionary[i])}s=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=i}else a.fromArray!==void 0&&a.toArray!==void 0?(s=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(s=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=r;this.getValue=this.GetterByBindingType[s],this.setValue=this.SetterByBindingTypeAndVersioning[s][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};$o.Composite=Composite,$o.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},$o.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},$o.prototype.GetterByBindingType=[$o.prototype._getValue_direct,$o.prototype._getValue_array,$o.prototype._getValue_arrayElement,$o.prototype._getValue_toArray],$o.prototype.SetterByBindingTypeAndVersioning=[[$o.prototype._setValue_direct,$o.prototype._setValue_direct_setNeedsUpdate,$o.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[$o.prototype._setValue_array,$o.prototype._setValue_array_setNeedsUpdate,$o.prototype._setValue_array_setMatrixWorldNeedsUpdate],[$o.prototype._setValue_arrayElement,$o.prototype._setValue_arrayElement_setNeedsUpdate,$o.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[$o.prototype._setValue_fromArray,$o.prototype._setValue_fromArray_setNeedsUpdate,$o.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Spherical=class{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){let e=1e-6;return this.phi=clamp(this.phi,e,Math.PI-e),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(clamp(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}};(class Matrix2{static{Matrix2.prototype.isMatrix2=!0}constructor(e,t,n,r){this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,r){let i=this.elements;return i[0]=e,i[2]=t,i[1]=n,i[3]=r,this}});var Controls=class extends EventDispatcher{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){warn(`Controls: connect() now requires an element.`);return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}};function getByteLength(e,t,n,r){let i=getTextureTypeByteLength(r);switch(n){case 1021:return e*t;case 1028:return e*t/i.components*i.byteLength;case ii:return e*t/i.components*i.byteLength;case ai:return e*t*2/i.components*i.byteLength;case oi:return e*t*2/i.components*i.byteLength;case 1022:return e*t*3/i.components*i.byteLength;case ti:return e*t*4/i.components*i.byteLength;case si:return e*t*4/i.components*i.byteLength;case 33776:case 33777:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case 33778:case 33779:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case 35841:case 35843:return Math.max(e,16)*Math.max(t,8)/4;case 35840:case 35842:return Math.max(e,8)*Math.max(t,8)/2;case 36196:case 37492:case 37488:case 37489:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case 37496:case 37490:case 37491:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case 37808:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case 37809:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case 37810:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case 37811:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case 37812:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case 37813:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case 37814:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case 37815:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case 37816:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case 37817:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case 37818:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case 37819:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case 37820:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case 37821:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case 36492:case 36494:case 36495:return Math.ceil(e/4)*Math.ceil(t/4)*16;case 36283:case 36284:return Math.ceil(e/4)*Math.ceil(t/4)*8;case 36285:case 36286:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw Error(`Unable to determine texture byte length for ${n} format.`)}function getTextureTypeByteLength(e){switch(e){case qr:case 1010:return{byteLength:1,components:1};case Jr:case 1011:case Zr:return{byteLength:2,components:1};case Qr:case $r:return{byteLength:2,components:4};case Yr:case 1013:case Xr:return{byteLength:4,components:1};case 35902:case 35899:return{byteLength:4,components:3}}throw Error(`THREE.TextureUtils: Unknown texture type ${e}.`)}typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`register`,{detail:{revision:`185`}})),typeof window<`u`&&(window.__THREE__?warn(`WARNING: Multiple instances of Three.js being imported.`):window.__THREE__=`185`);
|
|
108
|
+
}`,ShaderMaterial=class extends Material{constructor(e){super(),this.isShaderMaterial=!0,this.type=`ShaderMaterial`,this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=So,this.fragmentShader=Co,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=cloneUniforms(e.uniforms),this.uniformsGroups=cloneUniformsGroups(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let n in this.uniforms){let r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:`t`,value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:`c`,value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:`v2`,value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:`v3`,value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:`v4`,value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:`m3`,value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:`m4`,value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)this.extensions[e]===!0&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}fromJSON(e,t){if(super.fromJSON(e,t),e.uniforms!==void 0)for(let n in e.uniforms){let r=e.uniforms[n];switch(this.uniforms[n]={},r.type){case`t`:this.uniforms[n].value=t[r.value]||null;break;case`c`:this.uniforms[n].value=new Color().setHex(r.value);break;case`v2`:this.uniforms[n].value=new G().fromArray(r.value);break;case`v3`:this.uniforms[n].value=new K().fromArray(r.value);break;case`v4`:this.uniforms[n].value=new Y().fromArray(r.value);break;case`m3`:this.uniforms[n].value=new q().fromArray(r.value);break;case`m4`:this.uniforms[n].value=new X().fromArray(r.value);break;default:this.uniforms[n].value=r.value}}if(e.defines!==void 0&&(this.defines=e.defines),e.vertexShader!==void 0&&(this.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(this.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(this.glslVersion=e.glslVersion),e.extensions!==void 0)for(let t in e.extensions)this.extensions[t]=e.extensions[t];return e.lights!==void 0&&(this.lights=e.lights),e.clipping!==void 0&&(this.clipping=e.clipping),this}},RawShaderMaterial=class extends ShaderMaterial{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type=`RawShaderMaterial`}},MeshPhongMaterial=class extends Material{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type=`MeshPhongMaterial`,this.color=new Color(16777215),this.specular=new Color(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new G(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ri,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,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.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,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.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.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,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}},MeshLambertMaterial=class extends Material{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type=`MeshLambertMaterial`,this.color=new Color(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new G(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ri,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,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.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.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.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.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,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}},MeshDepthMaterial=class extends Material{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type=`MeshDepthMaterial`,this.depthPacking=3200,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}},MeshDistanceMaterial=class extends Material{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}};function convertArray(e,t){return!e||e.constructor===t?e:typeof t.BYTES_PER_ELEMENT==`number`?new t(e):Array.prototype.slice.call(e)}var Interpolant=class{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r===void 0?new t.constructor(n):r,this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];validate_interval:{seek:{let a;linear_scan:{forward_scan:if(!(e<r)){for(let a=n+2;;){if(r===void 0){if(e<i)break forward_scan;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(i=r,r=t[++n],e<r)break seek}a=t.length;break linear_scan}if(!(e>=i)){let o=t[1];e<o&&(n=2,i=o);for(let a=n-2;;){if(i===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(r=i,i=t[--n-1],e>=i)break seek}a=n,n=0;break linear_scan}break validate_interval}for(;n<a;){let r=n+a>>>1;e<t[r]?a=r:n=r+1}if(r=t[n],i=t[n-1],i===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r;for(let e=0;e!==r;++e)t[e]=n[i+e];return t}interpolate_(){throw Error(`THREE.Interpolant: Call to abstract method.`)}intervalChanged_(){}},CubicInterpolant=class extends Interpolant{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:ri,endingEnd:ri}}intervalChanged_(e,t,n){let r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(o===void 0)switch(this.getSettings_().endingStart){case ii:i=e,o=2*t-n;break;case ai:i=r.length-2,o=t+r[i]-r[i+1];break;default:i=e,o=n}if(s===void 0)switch(this.getSettings_().endingEnd){case ii:a=e,s=2*n-t;break;case ai:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}let c=(n-t)*.5,l=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-n),this._offsetPrev=i*l,this._offsetNext=a*l}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,p=(n-t)/(r-t),m=p*p,h=m*p,g=-d*h+2*d*m-d*p,_=(1+d)*h+(-1.5-2*d)*m+(-.5+d)*p+1,v=(-1-f)*h+(1.5+f)*m+.5*p,y=f*h-f*m;for(let e=0;e!==o;++e)i[e]=g*a[l+e]+_*a[c+e]+v*a[s+e]+y*a[u+e];return i}},LinearInterpolant=class extends Interpolant{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=(n-t)/(r-t),u=1-l;for(let e=0;e!==o;++e)i[e]=a[c+e]*u+a[s+e]*l;return i}},DiscreteInterpolant=class extends Interpolant{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}},BezierInterpolant=class extends Interpolant{interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this.inTangents,u=this.outTangents;if(!l||!u){let e=(n-t)/(r-t),l=1-e;for(let t=0;t!==o;++t)i[t]=a[c+t]*l+a[s+t]*e;return i}let d=o*2,f=e-1;for(let p=0;p!==o;++p){let o=a[c+p],m=a[s+p],h=f*d+p*2,g=u[h],_=u[h+1],v=e*d+p*2,y=l[v],b=l[v+1],x=(n-t)/(r-t),S,C,w,T,E;for(let e=0;e<8;e++){S=x*x,C=S*x,w=1-x,T=w*w,E=T*w;let e=E*t+3*T*x*g+3*w*S*y+C*r-n;if(Math.abs(e)<1e-10)break;let i=3*T*(g-t)+6*w*x*(y-g)+3*S*(r-y);if(Math.abs(i)<1e-10)break;x-=e/i,x=Math.max(0,Math.min(1,x))}i[p]=E*o+3*T*x*_+3*w*S*b+C*m}return i}},KeyframeTrack=class{constructor(e,t,n,r){if(e===void 0)throw Error(`THREE.KeyframeTrack: track name is undefined`);if(t===void 0||t.length===0)throw Error(`THREE.KeyframeTrack: no keyframes in track named `+e);this.name=e,this.times=convertArray(t,this.TimeBufferType),this.values=convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:convertArray(e.times,Array),values:convertArray(e.values,Array)};let t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new LinearInterpolant(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new CubicInterpolant(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodBezier(e){let t=new BezierInterpolant(this.times,this.values,this.getValueSize(),e);return this.settings&&(t.inTangents=this.settings.inTangents,t.outTangents=this.settings.outTangents),t}setInterpolation(e){let t;switch(e){case $r:t=this.InterpolantFactoryMethodDiscrete;break;case ei:t=this.InterpolantFactoryMethodLinear;break;case ti:t=this.InterpolantFactoryMethodSmooth;break;case ni:t=this.InterpolantFactoryMethodBezier;break}if(t===void 0){let t=`unsupported interpolation for `+this.ValueTypeName+` keyframe track named `+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(t);return warn(`KeyframeTrack:`,t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return $r;case this.InterpolantFactoryMethodLinear:return ei;case this.InterpolantFactoryMethodSmooth:return ti;case this.InterpolantFactoryMethodBezier:return ni}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){let n=this.times,r=n.length,i=0,a=r-1;for(;i!==r&&n[i]<e;)++i;for(;a!==-1&&n[a]>t;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);let e=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(error(`KeyframeTrack: Invalid value size in track.`,this),e=!1);let n=this.times,r=this.values,i=n.length;i===0&&(error(`KeyframeTrack: Track is empty.`,this),e=!1);let a=null;for(let t=0;t!==i;t++){let r=n[t];if(typeof r==`number`&&isNaN(r)){error(`KeyframeTrack: Time is not a valid number.`,this,t,r),e=!1;break}if(a!==null&&a>r){error(`KeyframeTrack: Out of order keys.`,this,t,r,a),e=!1;break}a=r}if(r!==void 0&&isTypedArray(r))for(let t=0,n=r.length;t!==n;++t){let n=r[t];if(isNaN(n)){error(`KeyframeTrack: Value is not a valid number.`,this,t,n),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===ti,i=e.length-1,a=1;for(let o=1;o<i;++o){let i=!1,s=e[o];if(s!==e[o+1]&&(o!==1||s!==e[0]))if(r)i=!0;else{let e=o*n,r=e-n,a=e+n;for(let o=0;o!==n;++o){let n=t[e+o];if(n!==t[r+o]||n!==t[a+o]){i=!0;break}}}if(i){if(o!==a){e[a]=e[o];let r=o*n,i=a*n;for(let e=0;e!==n;++e)t[i+e]=t[r+e]}++a}}if(i>0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a===e.length?(this.times=e,this.values=t):(this.times=e.slice(0,a),this.values=t.slice(0,a*n)),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};KeyframeTrack.prototype.ValueTypeName=``,KeyframeTrack.prototype.TimeBufferType=Float32Array,KeyframeTrack.prototype.ValueBufferType=Float32Array,KeyframeTrack.prototype.DefaultInterpolation=ei;var BooleanKeyframeTrack=class extends KeyframeTrack{constructor(e,t,n){super(e,t,n)}};BooleanKeyframeTrack.prototype.ValueTypeName=`bool`,BooleanKeyframeTrack.prototype.ValueBufferType=Array,BooleanKeyframeTrack.prototype.DefaultInterpolation=$r,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;var ColorKeyframeTrack=class extends KeyframeTrack{constructor(e,t,n,r){super(e,t,n,r)}};ColorKeyframeTrack.prototype.ValueTypeName=`color`;var NumberKeyframeTrack=class extends KeyframeTrack{constructor(e,t,n,r){super(e,t,n,r)}};NumberKeyframeTrack.prototype.ValueTypeName=`number`;var QuaternionLinearInterpolant=class extends Interpolant{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),c=e*o;for(let e=c+o;c!==e;c+=4)Quaternion.slerpFlat(i,0,a,c-o,a,c,s);return i}},QuaternionKeyframeTrack=class extends KeyframeTrack{constructor(e,t,n,r){super(e,t,n,r)}InterpolantFactoryMethodLinear(e){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)}};QuaternionKeyframeTrack.prototype.ValueTypeName=`quaternion`,QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;var StringKeyframeTrack=class extends KeyframeTrack{constructor(e,t,n){super(e,t,n)}};StringKeyframeTrack.prototype.ValueTypeName=`string`,StringKeyframeTrack.prototype.ValueBufferType=Array,StringKeyframeTrack.prototype.DefaultInterpolation=$r,StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;var VectorKeyframeTrack=class extends KeyframeTrack{constructor(e,t,n,r){super(e,t,n,r)}};VectorKeyframeTrack.prototype.ValueTypeName=`vector`;const wo={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(isBlobURL(e)||(this.files[e]=t))},get:function(e){if(this.enabled!==!1&&!isBlobURL(e))return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function isBlobURL(e){try{let t=e.slice(e.indexOf(`:`)+1);return new URL(t).protocol===`blob:`}catch{return!1}}var LoadingManager=class{constructor(e,t,n){let r=this,i=!1,a=0,o=0,s,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(e){o++,i===!1&&r.onStart!==void 0&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,r.onProgress!==void 0&&r.onProgress(e,a,o),a===o&&(i=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(e){r.onError!==void 0&&r.onError(e)},this.resolveURL=function(e){return e=e.normalize(`NFC`),s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){let t=c.indexOf(e);return t!==-1&&c.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=c.length;t<n;t+=2){let n=c[t],r=c[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||=new AbortController,this._abortController}};const To=new LoadingManager;var Loader=class{constructor(e){this.manager=e===void 0?To:e,this.crossOrigin=`anonymous`,this.withCredentials=!1,this.path=``,this.resourcePath=``,this.requestHeader={},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}load(){}loadAsync(e,t){let n=this;return new Promise(function(r,i){n.load(e,r,t,i)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}};Loader.DEFAULT_MATERIAL_NAME=`__DEFAULT`;const Eo=new WeakMap;var ImageLoader=class extends Loader{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=wo.get(`image:${e}`);if(a!==void 0){if(a.complete===!0)i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0);else{let e=Eo.get(a);e===void 0&&(e=[],Eo.set(a,e)),e.push({onLoad:t,onError:r})}return a}let o=createElementNS(`img`);function onImageLoad(){removeEventListeners(),t&&t(this);let n=Eo.get(this)||[];for(let e=0;e<n.length;e++){let t=n[e];t.onLoad&&t.onLoad(this)}Eo.delete(this),i.manager.itemEnd(e)}function onImageError(t){removeEventListeners(),r&&r(t),wo.remove(`image:${e}`);let n=Eo.get(this)||[];for(let e=0;e<n.length;e++){let r=n[e];r.onError&&r.onError(t)}Eo.delete(this),i.manager.itemError(e),i.manager.itemEnd(e)}function removeEventListeners(){o.removeEventListener(`load`,onImageLoad,!1),o.removeEventListener(`error`,onImageError,!1)}return o.addEventListener(`load`,onImageLoad,!1),o.addEventListener(`error`,onImageError,!1),e.slice(0,5)!==`data:`&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),wo.add(`image:${e}`,o),i.manager.itemStart(e),o.src=e,o}},CubeTextureLoader=class extends Loader{constructor(e){super(e)}load(e,t,n,r){let i=new CubeTexture;i.colorSpace=oi;let a=new ImageLoader(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);let o=0;function loadTexture(n){a.load(e[n],function(e){i.images[n]=e,o++,o===6&&(i.needsUpdate=!0,t&&t(i))},void 0,r)}for(let t=0;t<e.length;++t)loadTexture(t);return i}},TextureLoader=class extends Loader{constructor(e){super(e)}load(e,t,n,r){let i=new Oi,a=new ImageLoader(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(e){i.image=e,i.needsUpdate=!0,t!==void 0&&t(i)},n,r),i}},Light=class extends ea{constructor(e,t=1){super(),this.isLight=!0,this.type=`Light`,this.color=new Color(e),this.intensity=t}dispose(){this.dispatchEvent({type:`dispose`})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}};const Do=new X,Oo=new K,ko=new K;var LightShadow=class{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new G(512,512),this.mapType=Rr,this.map=null,this.mapPass=null,this.matrix=new X,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Frustum,this._frameExtents=new G(1,1),this._viewportCount=1,this._viewports=[new Y(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,n=this.matrix;Oo.setFromMatrixPosition(e.matrixWorld),t.position.copy(Oo),ko.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(ko),t.updateMatrixWorld(),Do.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Do,t.coordinateSystem,t.reversedDepth),t.coordinateSystem===2001||t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Do)}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.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this.biasNode=e.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){let 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}};const Ao=new K,jo=new Quaternion,Mo=new K;var Camera=class extends ea{constructor(){super(),this.isCamera=!0,this.type=`Camera`,this.matrixWorldInverse=new X,this.projectionMatrix=new X,this.projectionMatrixInverse=new X,this.coordinateSystem=di,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),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.matrixWorld.decompose(Ao,jo,Mo),Mo.x===1&&Mo.y===1&&Mo.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Ao,jo,Mo.set(1,1,1)).invert()}updateWorldMatrix(e,t,n=!1){super.updateWorldMatrix(e,t,n),this.matrixWorld.decompose(Ao,jo,Mo),Mo.x===1&&Mo.y===1&&Mo.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Ao,jo,Mo.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}};const No=new K,Po=new G,Fo=new G;var PerspectiveCamera=class extends Camera{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type=`PerspectiveCamera`,this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),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){let t=.5*this.getFilmHeight()/e;this.fov=_i*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(gi*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return _i*2*Math.atan(Math.tan(gi*.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,t,n){No.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(No.x,No.y).multiplyScalar(-e/No.z),No.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(No.x,No.y).multiplyScalar(-e/No.z)}getViewSize(e,t){return this.getViewBounds(e,Po,Fo),t.subVectors(Fo,Po)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,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=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(gi*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(this.view!==null&&this.view.enabled){let e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}let o=this.filmOffset;o!==0&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},OrthographicCamera=class extends Camera{constructor(e=-1,t=1,n=1,r=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type=`OrthographicCamera`,this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),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,t,n,r,i,a){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=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(this.view!==null&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,a=i+e*this.view.width,o-=t*this.view.offsetY,s=o-t*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}},DirectionalLightShadow=class extends LightShadow{constructor(){super(new OrthographicCamera(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},DirectionalLight=class extends Light{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type=`DirectionalLight`,this.position.copy(ea.DEFAULT_UP),this.updateMatrix(),this.target=new ea,this.shadow=new DirectionalLightShadow}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}},AmbientLight=class extends Light{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type=`AmbientLight`}},CubeCamera=class extends ea{constructor(e,t,n){super(),this.type=`CubeCamera`,this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new PerspectiveCamera(-90,1,e,t);r.layers=this.layers,this.add(r);let i=new PerspectiveCamera(-90,1,e,t);i.layers=this.layers,this.add(i);let a=new PerspectiveCamera(-90,1,e,t);a.layers=this.layers,this.add(a);let o=new PerspectiveCamera(-90,1,e,t);o.layers=this.layers,this.add(o);let s=new PerspectiveCamera(-90,1,e,t);s.layers=this.layers,this.add(s);let c=new PerspectiveCamera(-90,1,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(let e of t)this.remove(e);if(e===2e3)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else if(e===2001)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);else throw Error(`THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: `+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,o,s,c,l]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let h=!1;h=e.isWebGLRenderer===!0?e.state.buffers.depth.getReversed():e.reversedDepthBuffer,e.setRenderTarget(n,0,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,i),e.setRenderTarget(n,1,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,a),e.setRenderTarget(n,2,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,o),e.setRenderTarget(n,3,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,s),e.setRenderTarget(n,4,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,c),n.texture.generateMipmaps=m,e.setRenderTarget(n,5,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,l),e.setRenderTarget(u,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}},ArrayCamera=class extends PerspectiveCamera{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}};const Io=RegExp(`[\\[\\]\\.:\\/]`,`g`),Lo=RegExp(`^((?:[^\\[\\]\\.:\\/]+[\\/:])*)([^\\[\\]:\\/]+)?(?:\\.([^\\[\\]\\.:\\/]+)(?:\\[(.+)\\])?)?\\.([^\\[\\]\\.:\\/]+)(?:\\[(.+)\\])?$`),Ro=[`material`,`materials`,`bones`,`map`];var Composite=class{constructor(e,t,n){let r=n||zo.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},zo=class PropertyBinding{constructor(e,t,n){this.path=t,this.parsedPath=n||PropertyBinding.parseTrackName(t),this.node=PropertyBinding.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new PropertyBinding.Composite(e,t,n):new PropertyBinding(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,`_`).replace(Io,``)}static parseTrackName(e){let t=Lo.exec(e);if(t===null)throw Error(`THREE.PropertyBinding: Cannot parse trackName: `+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(`.`);if(r!==void 0&&r!==-1){let e=n.nodeName.substring(r+1);Ro.indexOf(e)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(n.propertyName===null||n.propertyName.length===0)throw Error(`THREE.PropertyBinding: can not parse propertyName from trackName: `+e);return n}static findNode(e,t){if(t===void 0||t===``||t===`.`||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let searchNodeSubtree=function(e){for(let n=0;n<e.length;n++){let r=e[n];if(r.name===t||r.uuid===t)return r;let i=searchNodeSubtree(r.children);if(i)return i}return null},n=searchNodeSubtree(e.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=PropertyBinding.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){warn(`PropertyBinding: No target node found for track: `+this.path+`.`);return}if(n){let r=t.objectIndex;switch(n){case`materials`:if(!e.material){error(`PropertyBinding: Can not bind to material as node does not have a material.`,this);return}if(!e.material.materials){error(`PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.`,this);return}e=e.material.materials;break;case`bones`:if(!e.skeleton){error(`PropertyBinding: Can not bind to bones as node does not have a skeleton.`,this);return}e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===r){r=t;break}break;case`map`:if(`map`in e){e=e.map;break}if(!e.material){error(`PropertyBinding: Can not bind to material as node does not have a material.`,this);return}if(!e.material.map){error(`PropertyBinding: Can not bind to material.map as node.material does not have a map.`,this);return}e=e.material.map;break;default:if(e[n]===void 0){error(`PropertyBinding: Can not bind to objectName of node undefined.`,this);return}e=e[n]}if(r!==void 0){if(e[r]===void 0){error(`PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.`,this,e);return}e=e[r]}}let a=e[r];if(a===void 0){let n=t.nodeName;error(`PropertyBinding: Trying to update property for track: `+n+`.`+r+` but it wasn't found.`,e);return}let o=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?o=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let s=this.BindingType.Direct;if(i!==void 0){if(r===`morphTargetInfluences`){if(!e.geometry){error(`PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.`,this);return}if(!e.geometry.morphAttributes){error(`PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.`,this);return}e.morphTargetDictionary[i]!==void 0&&(i=e.morphTargetDictionary[i])}s=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=i}else a.fromArray!==void 0&&a.toArray!==void 0?(s=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(s=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=r;this.getValue=this.GetterByBindingType[s],this.setValue=this.SetterByBindingTypeAndVersioning[s][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};zo.Composite=Composite,zo.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},zo.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},zo.prototype.GetterByBindingType=[zo.prototype._getValue_direct,zo.prototype._getValue_array,zo.prototype._getValue_arrayElement,zo.prototype._getValue_toArray],zo.prototype.SetterByBindingTypeAndVersioning=[[zo.prototype._setValue_direct,zo.prototype._setValue_direct_setNeedsUpdate,zo.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[zo.prototype._setValue_array,zo.prototype._setValue_array_setNeedsUpdate,zo.prototype._setValue_array_setMatrixWorldNeedsUpdate],[zo.prototype._setValue_arrayElement,zo.prototype._setValue_arrayElement_setNeedsUpdate,zo.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[zo.prototype._setValue_fromArray,zo.prototype._setValue_fromArray_setNeedsUpdate,zo.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Spherical=class{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){let e=1e-6;return this.phi=clamp(this.phi,e,Math.PI-e),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(clamp(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}};(class Matrix2{static{Matrix2.prototype.isMatrix2=!0}constructor(e,t,n,r){this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,r){let i=this.elements;return i[0]=e,i[2]=t,i[1]=n,i[3]=r,this}});var Controls=class extends EventDispatcher{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){warn(`Controls: connect() now requires an element.`);return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}};function getByteLength(e,t,n,r){let i=getTextureTypeByteLength(r);switch(n){case 1021:return e*t;case 1028:return e*t/i.components*i.byteLength;case Yr:return e*t/i.components*i.byteLength;case Xr:return e*t*2/i.components*i.byteLength;case Zr:return e*t*2/i.components*i.byteLength;case 1022:return e*t*3/i.components*i.byteLength;case Kr:return e*t*4/i.components*i.byteLength;case Qr:return e*t*4/i.components*i.byteLength;case 33776:case 33777:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case 33778:case 33779:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case 35841:case 35843:return Math.max(e,16)*Math.max(t,8)/4;case 35840:case 35842:return Math.max(e,8)*Math.max(t,8)/2;case 36196:case 37492:case 37488:case 37489:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case 37496:case 37490:case 37491:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case 37808:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case 37809:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case 37810:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case 37811:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case 37812:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case 37813:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case 37814:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case 37815:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case 37816:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case 37817:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case 37818:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case 37819:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case 37820:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case 37821:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case 36492:case 36494:case 36495:return Math.ceil(e/4)*Math.ceil(t/4)*16;case 36283:case 36284:return Math.ceil(e/4)*Math.ceil(t/4)*8;case 36285:case 36286:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw Error(`Unable to determine texture byte length for ${n} format.`)}function getTextureTypeByteLength(e){switch(e){case Rr:case 1010:return{byteLength:1,components:1};case zr:case 1011:case Hr:return{byteLength:2,components:1};case Ur:case Wr:return{byteLength:2,components:4};case Br:case 1013:case Vr:return{byteLength:4,components:1};case 35902:case 35899:return{byteLength:4,components:3}}throw Error(`THREE.TextureUtils: Unknown texture type ${e}.`)}typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`register`,{detail:{revision:`185`}})),typeof window<`u`&&(window.__THREE__?warn(`WARNING: Multiple instances of Three.js being imported.`):window.__THREE__=`185`);
|
|
109
109
|
/**
|
|
110
110
|
* @license
|
|
111
111
|
* Copyright 2010-2026 Three.js Authors
|
|
112
112
|
* SPDX-License-Identifier: MIT
|
|
113
113
|
*/
|
|
114
|
-
function WebGLAnimation(){let e=null,t=!1,n=null,r=null;function onAnimationFrame(t,i){n(t,i),r=e.requestAnimationFrame(onAnimationFrame)}return{start:function(){t!==!0&&n!==null&&e!==null&&(r=e.requestAnimationFrame(onAnimationFrame),t=!0)},stop:function(){e!==null&&e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function WebGLAttributes(e){let t=new WeakMap;function createBuffer(t,n){let r=t.array,i=t.usage,a=r.byteLength,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback();let s;if(r instanceof Float32Array)s=e.FLOAT;else if(typeof Float16Array<`u`&&r instanceof Float16Array)s=e.HALF_FLOAT;else if(r instanceof Uint16Array)s=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)s=e.SHORT;else if(r instanceof Uint32Array)s=e.UNSIGNED_INT;else if(r instanceof Int32Array)s=e.INT;else if(r instanceof Int8Array)s=e.BYTE;else if(r instanceof Uint8Array)s=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)s=e.UNSIGNED_BYTE;else throw Error(`THREE.WebGLAttributes: Unsupported buffer data format: `+r);return{buffer:o,type:s,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:a}}function updateBuffer(t,n,r){let i=n.array,a=n.updateRanges;if(e.bindBuffer(r,t),a.length===0)e.bufferSubData(r,0,i);else{a.sort((e,t)=>e.start-t.start);let t=0;for(let e=1;e<a.length;e++){let n=a[t],r=a[e];r.start<=n.start+n.count+1?n.count=Math.max(n.count,r.start+r.count-n.start):(++t,a[t]=r)}a.length=t+1;for(let t=0,n=a.length;t<n;t++){let n=a[t];e.bufferSubData(r,n.start*i.BYTES_PER_ELEMENT,i,n.start,n.count)}n.clearUpdateRanges()}n.onUploadCallback()}function get(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)}function remove(n){n.isInterleavedBufferAttribute&&(n=n.data);let r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))}function update(e,n){if(e.isInterleavedBufferAttribute&&(e=e.data),e.isGLBufferAttribute){let n=t.get(e);(!n||n.version<e.version)&&t.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version});return}let r=t.get(e);if(r===void 0)t.set(e,createBuffer(e,n));else if(r.version<e.version){if(r.size!==e.array.byteLength)throw Error(`THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.`);updateBuffer(r.buffer,e,n),r.version=e.version}}return{get,remove,update}}const
|
|
114
|
+
function WebGLAnimation(){let e=null,t=!1,n=null,r=null;function onAnimationFrame(t,i){n(t,i),r=e.requestAnimationFrame(onAnimationFrame)}return{start:function(){t!==!0&&n!==null&&e!==null&&(r=e.requestAnimationFrame(onAnimationFrame),t=!0)},stop:function(){e!==null&&e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function WebGLAttributes(e){let t=new WeakMap;function createBuffer(t,n){let r=t.array,i=t.usage,a=r.byteLength,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback();let s;if(r instanceof Float32Array)s=e.FLOAT;else if(typeof Float16Array<`u`&&r instanceof Float16Array)s=e.HALF_FLOAT;else if(r instanceof Uint16Array)s=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)s=e.SHORT;else if(r instanceof Uint32Array)s=e.UNSIGNED_INT;else if(r instanceof Int32Array)s=e.INT;else if(r instanceof Int8Array)s=e.BYTE;else if(r instanceof Uint8Array)s=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)s=e.UNSIGNED_BYTE;else throw Error(`THREE.WebGLAttributes: Unsupported buffer data format: `+r);return{buffer:o,type:s,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:a}}function updateBuffer(t,n,r){let i=n.array,a=n.updateRanges;if(e.bindBuffer(r,t),a.length===0)e.bufferSubData(r,0,i);else{a.sort((e,t)=>e.start-t.start);let t=0;for(let e=1;e<a.length;e++){let n=a[t],r=a[e];r.start<=n.start+n.count+1?n.count=Math.max(n.count,r.start+r.count-n.start):(++t,a[t]=r)}a.length=t+1;for(let t=0,n=a.length;t<n;t++){let n=a[t];e.bufferSubData(r,n.start*i.BYTES_PER_ELEMENT,i,n.start,n.count)}n.clearUpdateRanges()}n.onUploadCallback()}function get(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)}function remove(n){n.isInterleavedBufferAttribute&&(n=n.data);let r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))}function update(e,n){if(e.isInterleavedBufferAttribute&&(e=e.data),e.isGLBufferAttribute){let n=t.get(e);(!n||n.version<e.version)&&t.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version});return}let r=t.get(e);if(r===void 0)t.set(e,createBuffer(e,n));else if(r.version<e.version){if(r.size!==e.array.byteLength)throw Error(`THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.`);updateBuffer(r.buffer,e,n),r.version=e.version}}return{get,remove,update}}const Z={alphahash_fragment:`#ifdef USE_ALPHAHASH
|
|
115
115
|
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
|
|
116
116
|
#endif`,alphahash_pars_fragment:`#ifdef USE_ALPHAHASH
|
|
117
117
|
const float ALPHA_HASH_SCALE = 0.05;
|
|
@@ -3777,7 +3777,7 @@ void main() {
|
|
|
3777
3777
|
#include <tonemapping_fragment>
|
|
3778
3778
|
#include <colorspace_fragment>
|
|
3779
3779
|
#include <fog_fragment>
|
|
3780
|
-
}`},F={common:{diffuse:{value:new Color(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ji},alphaMap:{value:null},alphaMapTransform:{value:new ji},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ji}},envmap:{envMap:{value:null},envMapRotation:{value:new ji},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ji}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ji}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ji},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ji},normalScale:{value:new Oi(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ji},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ji}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ji}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ji}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new P},probesMax:{value:new P},probesResolution:{value:new P}},points:{diffuse:{value:new Color(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ji},alphaTest:{value:0},uvTransform:{value:new ji}},sprite:{diffuse:{value:new Color(16777215)},opacity:{value:1},center:{value:new Oi(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ji},alphaMap:{value:null},alphaMapTransform:{value:new ji},alphaTest:{value:0}}},ts={basic:{uniforms:mergeUniforms([F.common,F.specularmap,F.envmap,F.aomap,F.lightmap,F.fog]),vertexShader:es.meshbasic_vert,fragmentShader:es.meshbasic_frag},lambert:{uniforms:mergeUniforms([F.common,F.specularmap,F.envmap,F.aomap,F.lightmap,F.emissivemap,F.bumpmap,F.normalmap,F.displacementmap,F.fog,F.lights,{emissive:{value:new Color(0)},envMapIntensity:{value:1}}]),vertexShader:es.meshlambert_vert,fragmentShader:es.meshlambert_frag},phong:{uniforms:mergeUniforms([F.common,F.specularmap,F.envmap,F.aomap,F.lightmap,F.emissivemap,F.bumpmap,F.normalmap,F.displacementmap,F.fog,F.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:es.meshphong_vert,fragmentShader:es.meshphong_frag},standard:{uniforms:mergeUniforms([F.common,F.envmap,F.aomap,F.lightmap,F.emissivemap,F.bumpmap,F.normalmap,F.displacementmap,F.roughnessmap,F.metalnessmap,F.fog,F.lights,{emissive:{value:new Color(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:es.meshphysical_vert,fragmentShader:es.meshphysical_frag},toon:{uniforms:mergeUniforms([F.common,F.aomap,F.lightmap,F.emissivemap,F.bumpmap,F.normalmap,F.displacementmap,F.gradientmap,F.fog,F.lights,{emissive:{value:new Color(0)}}]),vertexShader:es.meshtoon_vert,fragmentShader:es.meshtoon_frag},matcap:{uniforms:mergeUniforms([F.common,F.bumpmap,F.normalmap,F.displacementmap,F.fog,{matcap:{value:null}}]),vertexShader:es.meshmatcap_vert,fragmentShader:es.meshmatcap_frag},points:{uniforms:mergeUniforms([F.points,F.fog]),vertexShader:es.points_vert,fragmentShader:es.points_frag},dashed:{uniforms:mergeUniforms([F.common,F.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:es.linedashed_vert,fragmentShader:es.linedashed_frag},depth:{uniforms:mergeUniforms([F.common,F.displacementmap]),vertexShader:es.depth_vert,fragmentShader:es.depth_frag},normal:{uniforms:mergeUniforms([F.common,F.bumpmap,F.normalmap,F.displacementmap,{opacity:{value:1}}]),vertexShader:es.meshnormal_vert,fragmentShader:es.meshnormal_frag},sprite:{uniforms:mergeUniforms([F.sprite,F.fog]),vertexShader:es.sprite_vert,fragmentShader:es.sprite_frag},background:{uniforms:{uvTransform:{value:new ji},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:es.background_vert,fragmentShader:es.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ji}},vertexShader:es.backgroundCube_vert,fragmentShader:es.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:es.cube_vert,fragmentShader:es.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:es.equirect_vert,fragmentShader:es.equirect_frag},distance:{uniforms:mergeUniforms([F.common,F.displacementmap,{referencePosition:{value:new P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:es.distance_vert,fragmentShader:es.distance_frag},shadow:{uniforms:mergeUniforms([F.lights,F.fog,{color:{value:new Color(0)},opacity:{value:1}}]),vertexShader:es.shadow_vert,fragmentShader:es.shadow_frag}};ts.physical={uniforms:mergeUniforms([ts.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ji},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ji},clearcoatNormalScale:{value:new Oi(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ji},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ji},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ji},sheen:{value:0},sheenColor:{value:new Color(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ji},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ji},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ji},transmissionSamplerSize:{value:new Oi},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ji},attenuationDistance:{value:0},attenuationColor:{value:new Color(0)},specularColor:{value:new Color(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ji},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ji},anisotropyVector:{value:new Oi},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ji}}]),vertexShader:es.meshphysical_vert,fragmentShader:es.meshphysical_frag};const ns={r:0,b:0,g:0},rs=new Hi,is=new ji;is.set(-1,0,0,0,1,0,0,0,1);function WebGLBackground(e,t,n,r,i,a){let o=new Color(0),s=i===!0?0:1,c,l,u=null,d=0,f=null;function getBackground(e){let n=e.isScene===!0?e.background:null;if(n&&n.isTexture){let r=e.backgroundBlurriness>0;n=t.get(n,r)}return n}function render(t){let r=!1,i=getBackground(t);i===null?setClear(o,s):i&&i.isColor&&(setClear(i,1),r=!0);let c=e.xr.getEnvironmentBlendMode();c===`additive`?n.buffers.color.setClear(0,0,0,1,a):c===`alpha-blend`&&n.buffers.color.setClear(0,0,0,0,a),(e.autoClear||r)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))}function addToRenderList(t,n){let i=getBackground(n);i&&(i.isCubeTexture||i.mapping===306)?(l===void 0&&(l=new Mesh(new No(1,1,1),new ShaderMaterial({name:`BackgroundCubeMaterial`,uniforms:cloneUniforms(ts.backgroundCube.uniforms),vertexShader:ts.backgroundCube.vertexShader,fragmentShader:ts.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute(`normal`),l.geometry.deleteAttribute(`uv`),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(l)),l.material.uniforms.envMap.value=i,l.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(rs.makeRotationFromEuler(n.backgroundRotation)).transpose(),i.isCubeTexture&&i.isRenderTargetTexture===!1&&l.material.uniforms.backgroundRotation.value.premultiply(is),l.material.toneMapped=Fi.getTransfer(i.colorSpace)!==vi,(u!==i||d!==i.version||f!==e.toneMapping)&&(l.material.needsUpdate=!0,u=i,d=i.version,f=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null)):i&&i.isTexture&&(c===void 0&&(c=new Mesh(new Po(2,2),new ShaderMaterial({name:`BackgroundMaterial`,uniforms:cloneUniforms(ts.background.uniforms),vertexShader:ts.background.vertexShader,fragmentShader:ts.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute(`normal`),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=i,c.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,c.material.toneMapped=Fi.getTransfer(i.colorSpace)!==vi,i.matrixAutoUpdate===!0&&i.updateMatrix(),c.material.uniforms.uvTransform.value.copy(i.matrix),(u!==i||d!==i.version||f!==e.toneMapping)&&(c.material.needsUpdate=!0,u=i,d=i.version,f=e.toneMapping),c.layers.enableAll(),t.unshift(c,c.geometry,c.material,0,0,null))}function setClear(t,r){t.getRGB(ns,getUnlitUniformColorSpace(e)),n.buffers.color.setClear(ns.r,ns.g,ns.b,r,a)}function dispose(){l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),s=t,setClear(o,s)},getClearAlpha:function(){return s},setClearAlpha:function(e){s=e,setClear(o,s)},render,addToRenderList,dispose}}function WebGLBindingStates(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=createBindingState(null),a=i,o=!1;function setup(n,r,i,s,c){let l=!1,u=getBindingState(n,s,i,r);a!==u&&(a=u,bindVertexArrayObject(a.object)),l=needsUpdate(n,s,i,c),l&&saveCache(n,s,i,c),c!==null&&t.update(c,e.ELEMENT_ARRAY_BUFFER),(l||o)&&(o=!1,setupVertexAttributes(n,r,i,s),c!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(c).buffer))}function createVertexArrayObject(){return e.createVertexArray()}function bindVertexArrayObject(t){return e.bindVertexArray(t)}function deleteVertexArrayObject(t){return e.deleteVertexArray(t)}function getBindingState(e,t,n,i){let a=i.wireframe===!0,o=r[t.id];o===void 0&&(o={},r[t.id]=o);let s=e.isInstancedMesh===!0?e.id:0,c=o[s];c===void 0&&(c={},o[s]=c);let l=c[n.id];l===void 0&&(l={},c[n.id]=l);let u=l[a];return u===void 0&&(u=createBindingState(createVertexArrayObject()),l[a]=u),u}function createBindingState(e){let t=[],r=[],i=[];for(let e=0;e<n;e++)t[e]=0,r[e]=0,i[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:r,attributeDivisors:i,object:e,attributes:{},index:null}}function needsUpdate(e,t,n,r){let i=a.attributes,o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=i[t],r=o[t];if(r===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(r=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(r=e.instanceColor)),n===void 0||n.attribute!==r||r&&n.data!==r.data)return!0;s++}return a.attributesNum!==s||a.index!==r}function saveCache(e,t,n,r){let i={},o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=o[t];n===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(n=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,s++}a.attributes=i,a.attributesNum=s,a.index=r}function initAttributes(){let e=a.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function enableAttribute(e){enableAttributeAndDivisor(e,0)}function enableAttributeAndDivisor(t,n){let r=a.newAttributes,i=a.enabledAttributes,o=a.attributeDivisors;r[t]=1,i[t]===0&&(e.enableVertexAttribArray(t),i[t]=1),o[t]!==n&&(e.vertexAttribDivisor(t,n),o[t]=n)}function disableUnusedAttributes(){let t=a.newAttributes,n=a.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function vertexAttribPointer(t,n,r,i,a,o,s){s===!0?e.vertexAttribIPointer(t,n,r,a,o):e.vertexAttribPointer(t,n,r,i,a,o)}function setupVertexAttributes(n,r,i,a){initAttributes();let o=a.attributes,s=i.getAttributes(),c=r.defaultAttributeValues;for(let r in s){let i=s[r];if(i.location>=0){let s=o[r];if(s===void 0&&(r===`instanceMatrix`&&n.instanceMatrix&&(s=n.instanceMatrix),r===`instanceColor`&&n.instanceColor&&(s=n.instanceColor)),s!==void 0){let r=s.normalized,o=s.itemSize,c=t.get(s);if(c===void 0)continue;let l=c.buffer,u=c.type,d=c.bytesPerElement,f=u===e.INT||u===e.UNSIGNED_INT||s.gpuType===1013;if(s.isInterleavedBufferAttribute){let t=s.data,c=t.stride,p=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<i.locationSize;e++)enableAttributeAndDivisor(i.location+e,t.meshPerAttribute);n.isInstancedMesh!==!0&&a._maxInstanceCount===void 0&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<i.locationSize;e++)enableAttribute(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,l);for(let e=0;e<i.locationSize;e++)vertexAttribPointer(i.location+e,o/i.locationSize,u,r,c*d,(p+o/i.locationSize*e)*d,f)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<i.locationSize;e++)enableAttributeAndDivisor(i.location+e,s.meshPerAttribute);n.isInstancedMesh!==!0&&a._maxInstanceCount===void 0&&(a._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<i.locationSize;e++)enableAttribute(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,l);for(let e=0;e<i.locationSize;e++)vertexAttribPointer(i.location+e,o/i.locationSize,u,r,o*d,o/i.locationSize*e*d,f)}}else if(c!==void 0){let t=c[r];if(t!==void 0)switch(t.length){case 2:e.vertexAttrib2fv(i.location,t);break;case 3:e.vertexAttrib3fv(i.location,t);break;case 4:e.vertexAttrib4fv(i.location,t);break;default:e.vertexAttrib1fv(i.location,t)}}}}disableUnusedAttributes()}function dispose(){reset();for(let e in r){let t=r[e];for(let e in t){let n=t[e];for(let e in n){let t=n[e];for(let e in t)deleteVertexArrayObject(t[e].object),delete t[e];delete n[e]}}delete r[e]}}function releaseStatesOfGeometry(e){if(r[e.id]===void 0)return;let t=r[e.id];for(let e in t){let n=t[e];for(let e in n){let t=n[e];for(let e in t)deleteVertexArrayObject(t[e].object),delete t[e];delete n[e]}}delete r[e.id]}function releaseStatesOfProgram(e){for(let t in r){let n=r[t];for(let t in n){let r=n[t];if(r[e.id]===void 0)continue;let i=r[e.id];for(let e in i)deleteVertexArrayObject(i[e].object),delete i[e];delete r[e.id]}}}function releaseStatesOfObject(e){for(let t in r){let n=r[t],i=e.isInstancedMesh===!0?e.id:0,a=n[i];if(a!==void 0){for(let e in a){let t=a[e];for(let e in t)deleteVertexArrayObject(t[e].object),delete t[e];delete a[e]}delete n[i],Object.keys(n).length===0&&delete r[t]}}}function reset(){resetDefaultState(),o=!0,a!==i&&(a=i,bindVertexArrayObject(a.object))}function resetDefaultState(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup,reset,resetDefaultState,dispose,releaseStatesOfGeometry,releaseStatesOfObject,releaseStatesOfProgram,initAttributes,enableAttribute,disableUnusedAttributes}}function WebGLBufferRenderer(e,t,n){let r;function setMode(e){r=e}function render(t,i){e.drawArrays(r,t,i),n.update(i,r,1)}function renderInstances(t,i,a){a!==0&&(e.drawArraysInstanced(r,t,i,a),n.update(i,r,a))}function renderMultiDraw(e,i,a){if(a===0)return;t.get(`WEBGL_multi_draw`).multiDrawArraysWEBGL(r,e,0,i,0,a);let o=0;for(let e=0;e<a;e++)o+=i[e];n.update(o,r,1)}this.setMode=setMode,this.render=render,this.renderInstances=renderInstances,this.renderMultiDraw=renderMultiDraw}function WebGLCapabilities(e,t,n,r){let i;function getMaxAnisotropy(){if(i!==void 0)return i;if(t.has(`EXT_texture_filter_anisotropic`)===!0){let n=t.get(`EXT_texture_filter_anisotropic`);i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function textureFormatReadable(t){return!(t!==1023&&r.convert(t)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT))}function textureTypeReadable(n){let i=n===1016&&(t.has(`EXT_color_buffer_half_float`)||t.has(`EXT_color_buffer_float`));return!(n!==1009&&r.convert(n)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==1015&&!i)}function getMaxPrecision(t){if(t===`highp`){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return`highp`;t=`mediump`}return t===`mediump`&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?`mediump`:`lowp`}let a=n.precision===void 0?`highp`:n.precision,o=getMaxPrecision(a);o!==a&&(warn(`WebGLRenderer:`,a,`not supported, using`,o,`instead.`),a=o);let s=n.logarithmicDepthBuffer===!0,c=n.reversedDepthBuffer===!0&&t.has(`EXT_clip_control`);n.reversedDepthBuffer===!0&&c===!1&&warn(`WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.`);let l=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=e.getParameter(e.MAX_TEXTURE_SIZE),f=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),p=e.getParameter(e.MAX_VERTEX_ATTRIBS),m=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),h=e.getParameter(e.MAX_VARYING_VECTORS),g=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),_=e.getParameter(e.MAX_SAMPLES),v=e.getParameter(e.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy,getMaxPrecision,textureFormatReadable,textureTypeReadable,precision:a,logarithmicDepthBuffer:s,reversedDepthBuffer:c,maxTextures:l,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:f,maxAttributes:p,maxVertexUniforms:m,maxVaryings:h,maxFragmentUniforms:g,maxSamples:_,samples:v}}function WebGLClipping(e){let t=this,n=null,r=0,i=!1,a=!1,o=new Plane,s=new ji,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let n=e.length!==0||t||r!==0||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,projectPlanes(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=projectPlanes(e,t,0)},this.setState=function(t,o,s){let l=t.clippingPlanes,u=t.clipIntersection,d=t.clipShadows,f=e.get(t);if(!i||l===null||l.length===0||a&&!d)a?projectPlanes(null):resetGlobalState();else{let e=a?0:r,t=e*4,i=f.clippingState||null;c.value=i,i=projectPlanes(l,o,t,s);for(let e=0;e!==t;++e)i[e]=n[e];f.clippingState=i,this.numIntersection=u?this.numPlanes:0,this.numPlanes+=e}};function resetGlobalState(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function projectPlanes(e,n,r,i){let a=e===null?0:e.length,l=null;if(a!==0){if(l=c.value,i!==!0||l===null){let t=r+a*4,i=n.matrixWorldInverse;s.getNormalMatrix(i),(l===null||l.length<t)&&(l=new Float32Array(t));for(let t=0,n=r;t!==a;++t,n+=4)o.copy(e[t]).applyMatrix4(i,s),o.normal.toArray(l,n),l[n+3]=o.constant}c.value=l,c.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,l}}const as=[.125,.215,.35,.446,.526,.582],os=new OrthographicCamera,ss=new Color;let cs=null,ls=0,us=0,ds=!1;const fs=new P;var PMREMGenerator=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,r=100,i={}){let{size:a=256,position:o=fs}=i;cs=this._renderer.getRenderTarget(),ls=this._renderer.getActiveCubeFace(),us=this._renderer.getActiveMipmapLevel(),ds=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,r,s,o),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=2**this._lodMax}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(cs,ls,us),this._renderer.xr.enabled=ds,e.scissorTest=!1,_setViewport(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===301||e.mapping===302?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),cs=this._renderer.getRenderTarget(),ls=this._renderer.getActiveCubeFace(),us=this._renderer.getActiveMipmapLevel(),ds=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:Gr,minFilter:Gr,generateMipmaps:!1,type:Zr,format:ti,colorSpace:gi,depthBuffer:!1},r=_createRenderTarget(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=_createRenderTarget(e,t,n);let{_lodMax:r}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=_createPlanes(r)),this._blurMaterial=_getBlurShader(r,e,t),this._ggxMaterial=_getGGXShader(r,e,t)}return r}_compileMaterial(e){let t=new Mesh(new oo,e);this._renderer.compile(t,os)}_sceneToCubeUV(e,t,n,r,i){let a=new PerspectiveCamera(90,1,t,n),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],c=this._renderer,l=c.autoClear,u=c.toneMapping;c.getClearColor(ss),c.toneMapping=0,c.autoClear=!1,c.state.buffers.depth.getReversed()&&(c.setRenderTarget(r),c.clearDepth(),c.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new Mesh(new No,new MeshBasicMaterial({name:`PMREM.Background`,side:1,depthWrite:!1,depthTest:!1})));let d=this._backgroundBox,f=d.material,p=!1,m=e.background;m?m.isColor&&(f.color.copy(m),e.background=null,p=!0):(f.color.copy(ss),p=!0);for(let t=0;t<6;t++){let n=t%3;n===0?(a.up.set(0,o[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x+s[t],i.y,i.z)):n===1?(a.up.set(0,0,o[t]),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y+s[t],i.z)):(a.up.set(0,o[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y,i.z+s[t]));let l=this._cubeSize;_setViewport(r,n*l,t>2?l:0,l,l),c.setRenderTarget(r),p&&c.render(d,a),c.render(e,a)}c.toneMapping=u,c.autoClear=l,e.background=m}_textureToCubeUV(e,t){let n=this._renderer,r=e.mapping===301||e.mapping===302;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial());let i=r?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=i;let o=i.uniforms;o.envMap.value=e;let s=this._cubeSize;_setViewport(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,os)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodMeshes.length;for(let t=1;t<r;t++)this._applyGGXFilter(e,t-1,t);t.autoClear=n}_applyGGXFilter(e,t,n){let r=this._renderer,i=this._pingPongRenderTarget,a=this._ggxMaterial,o=this._lodMeshes[n];o.material=a;let s=a.uniforms,c=n/(this._lodMeshes.length-1),l=t/(this._lodMeshes.length-1),u=Math.sqrt(c*c-l*l)*(0+c*1.25),{_lodMax:d}=this,f=this._sizeLods[n],p=3*f*(n>d-4?n-d+4:0),m=4*(this._cubeSize-f);s.envMap.value=e.texture,s.roughness.value=u,s.mipInt.value=d-t,_setViewport(i,p,m,3*f,2*f),r.setRenderTarget(i),r.render(o,os),s.envMap.value=i.texture,s.roughness.value=0,s.mipInt.value=d-n,_setViewport(e,p,m,3*f,2*f),r.setRenderTarget(e),r.render(o,os)}_blur(e,t,n,r,i){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,`latitudinal`,i),this._halfBlur(a,e,n,n,r,`longitudinal`,i)}_halfBlur(e,t,n,r,i,a,o){let s=this._renderer,c=this._blurMaterial;a!==`latitudinal`&&a!==`longitudinal`&&error(`blur direction must be either latitudinal or longitudinal!`);let l=this._lodMeshes[r];l.material=c;let u=c.uniforms,d=this._sizeLods[n]-1,f=isFinite(i)?Math.PI/(2*d):2*Math.PI/39,p=i/f,m=isFinite(i)?1+Math.floor(3*p):20;m>20&&warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to 20`);let h=[],g=0;for(let e=0;e<20;++e){let t=e/p,n=Math.exp(-t*t/2);h.push(n),e===0?g+=n:e<m&&(g+=2*n)}for(let e=0;e<h.length;e++)h[e]=h[e]/g;u.envMap.value=e.texture,u.samples.value=m,u.weights.value=h,u.latitudinal.value=a===`latitudinal`,o&&(u.poleAxis.value=o);let{_lodMax:_}=this;u.dTheta.value=f,u.mipInt.value=_-n;let v=this._sizeLods[r];_setViewport(t,3*v*(r>_-4?r-_+4:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(t),s.render(l,os)}};function _createPlanes(e){let t=[],n=[],r=[],i=e,a=e-4+1+as.length;for(let o=0;o<a;o++){let a=2**i;t.push(a);let s=1/a;o>e-4?s=as[o-e+4-1]:o===0&&(s=0),n.push(s);let c=1/(a-2),l=-c,u=1+c,d=[l,l,u,l,u,u,l,l,u,u,l,u],f=new Float32Array(108),p=new Float32Array(72),m=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];f.set(r,18*e),p.set(d,12*e);let i=[e,e,e,e,e,e];m.set(i,6*e)}let h=new oo;h.setAttribute(`position`,new BufferAttribute(f,3)),h.setAttribute(`uv`,new BufferAttribute(p,2)),h.setAttribute(`faceIndex`,new BufferAttribute(m,1)),r.push(new Mesh(h,null)),i>4&&i--}return{lodMeshes:r,sizeLods:t,sigmas:n}}function _createRenderTarget(e,t,n){let r=new WebGLRenderTarget(e,t,n);return r.texture.mapping=306,r.texture.name=`PMREM.cubeUv`,r.scissorTest=!0,r}function _setViewport(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function _getGGXShader(e,t,n){return new ShaderMaterial({name:`PMREMGGXConvolution`,defines:{GGX_SAMPLES:256,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:_getCommonVertexShader(),fragmentShader:`
|
|
3780
|
+
}`},Q={common:{diffuse:{value:new Color(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new q},alphaMap:{value:null},alphaMapTransform:{value:new q},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new q}},envmap:{envMap:{value:null},envMapRotation:{value:new q},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new q}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new q}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new q},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new q},normalScale:{value:new G(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new q},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new q}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new q}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new q}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new K},probesMax:{value:new K},probesResolution:{value:new K}},points:{diffuse:{value:new Color(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new q},alphaTest:{value:0},uvTransform:{value:new q}},sprite:{diffuse:{value:new Color(16777215)},opacity:{value:1},center:{value:new G(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new q},alphaMap:{value:null},alphaMapTransform:{value:new q},alphaTest:{value:0}}},Bo={basic:{uniforms:mergeUniforms([Q.common,Q.specularmap,Q.envmap,Q.aomap,Q.lightmap,Q.fog]),vertexShader:Z.meshbasic_vert,fragmentShader:Z.meshbasic_frag},lambert:{uniforms:mergeUniforms([Q.common,Q.specularmap,Q.envmap,Q.aomap,Q.lightmap,Q.emissivemap,Q.bumpmap,Q.normalmap,Q.displacementmap,Q.fog,Q.lights,{emissive:{value:new Color(0)},envMapIntensity:{value:1}}]),vertexShader:Z.meshlambert_vert,fragmentShader:Z.meshlambert_frag},phong:{uniforms:mergeUniforms([Q.common,Q.specularmap,Q.envmap,Q.aomap,Q.lightmap,Q.emissivemap,Q.bumpmap,Q.normalmap,Q.displacementmap,Q.fog,Q.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:Z.meshphong_vert,fragmentShader:Z.meshphong_frag},standard:{uniforms:mergeUniforms([Q.common,Q.envmap,Q.aomap,Q.lightmap,Q.emissivemap,Q.bumpmap,Q.normalmap,Q.displacementmap,Q.roughnessmap,Q.metalnessmap,Q.fog,Q.lights,{emissive:{value:new Color(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Z.meshphysical_vert,fragmentShader:Z.meshphysical_frag},toon:{uniforms:mergeUniforms([Q.common,Q.aomap,Q.lightmap,Q.emissivemap,Q.bumpmap,Q.normalmap,Q.displacementmap,Q.gradientmap,Q.fog,Q.lights,{emissive:{value:new Color(0)}}]),vertexShader:Z.meshtoon_vert,fragmentShader:Z.meshtoon_frag},matcap:{uniforms:mergeUniforms([Q.common,Q.bumpmap,Q.normalmap,Q.displacementmap,Q.fog,{matcap:{value:null}}]),vertexShader:Z.meshmatcap_vert,fragmentShader:Z.meshmatcap_frag},points:{uniforms:mergeUniforms([Q.points,Q.fog]),vertexShader:Z.points_vert,fragmentShader:Z.points_frag},dashed:{uniforms:mergeUniforms([Q.common,Q.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Z.linedashed_vert,fragmentShader:Z.linedashed_frag},depth:{uniforms:mergeUniforms([Q.common,Q.displacementmap]),vertexShader:Z.depth_vert,fragmentShader:Z.depth_frag},normal:{uniforms:mergeUniforms([Q.common,Q.bumpmap,Q.normalmap,Q.displacementmap,{opacity:{value:1}}]),vertexShader:Z.meshnormal_vert,fragmentShader:Z.meshnormal_frag},sprite:{uniforms:mergeUniforms([Q.sprite,Q.fog]),vertexShader:Z.sprite_vert,fragmentShader:Z.sprite_frag},background:{uniforms:{uvTransform:{value:new q},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Z.background_vert,fragmentShader:Z.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new q}},vertexShader:Z.backgroundCube_vert,fragmentShader:Z.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Z.cube_vert,fragmentShader:Z.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Z.equirect_vert,fragmentShader:Z.equirect_frag},distance:{uniforms:mergeUniforms([Q.common,Q.displacementmap,{referencePosition:{value:new K},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Z.distance_vert,fragmentShader:Z.distance_frag},shadow:{uniforms:mergeUniforms([Q.lights,Q.fog,{color:{value:new Color(0)},opacity:{value:1}}]),vertexShader:Z.shadow_vert,fragmentShader:Z.shadow_frag}};Bo.physical={uniforms:mergeUniforms([Bo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new q},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new q},clearcoatNormalScale:{value:new G(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new q},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new q},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new q},sheen:{value:0},sheenColor:{value:new Color(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new q},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new q},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new q},transmissionSamplerSize:{value:new G},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new q},attenuationDistance:{value:0},attenuationColor:{value:new Color(0)},specularColor:{value:new Color(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new q},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new q},anisotropyVector:{value:new G},anisotropyMap:{value:null},anisotropyMapTransform:{value:new q}}]),vertexShader:Z.meshphysical_vert,fragmentShader:Z.meshphysical_frag};const Vo={r:0,b:0,g:0},Ho=new X,Uo=new q;Uo.set(-1,0,0,0,1,0,0,0,1);function WebGLBackground(e,t,n,r,i,a){let o=new Color(0),s=i===!0?0:1,c,l,u=null,d=0,f=null;function getBackground(e){let n=e.isScene===!0?e.background:null;if(n&&n.isTexture){let r=e.backgroundBlurriness>0;n=t.get(n,r)}return n}function render(t){let r=!1,i=getBackground(t);i===null?setClear(o,s):i&&i.isColor&&(setClear(i,1),r=!0);let c=e.xr.getEnvironmentBlendMode();c===`additive`?n.buffers.color.setClear(0,0,0,1,a):c===`alpha-blend`&&n.buffers.color.setClear(0,0,0,0,a),(e.autoClear||r)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))}function addToRenderList(t,n){let i=getBackground(n);i&&(i.isCubeTexture||i.mapping===306)?(l===void 0&&(l=new Mesh(new yo(1,1,1),new ShaderMaterial({name:`BackgroundCubeMaterial`,uniforms:cloneUniforms(Bo.backgroundCube.uniforms),vertexShader:Bo.backgroundCube.vertexShader,fragmentShader:Bo.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute(`normal`),l.geometry.deleteAttribute(`uv`),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(l)),l.material.uniforms.envMap.value=i,l.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(Ho.makeRotationFromEuler(n.backgroundRotation)).transpose(),i.isCubeTexture&&i.isRenderTargetTexture===!1&&l.material.uniforms.backgroundRotation.value.premultiply(Uo),l.material.toneMapped=J.getTransfer(i.colorSpace)!==li,(u!==i||d!==i.version||f!==e.toneMapping)&&(l.material.needsUpdate=!0,u=i,d=i.version,f=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null)):i&&i.isTexture&&(c===void 0&&(c=new Mesh(new bo(2,2),new ShaderMaterial({name:`BackgroundMaterial`,uniforms:cloneUniforms(Bo.background.uniforms),vertexShader:Bo.background.vertexShader,fragmentShader:Bo.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute(`normal`),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=i,c.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,c.material.toneMapped=J.getTransfer(i.colorSpace)!==li,i.matrixAutoUpdate===!0&&i.updateMatrix(),c.material.uniforms.uvTransform.value.copy(i.matrix),(u!==i||d!==i.version||f!==e.toneMapping)&&(c.material.needsUpdate=!0,u=i,d=i.version,f=e.toneMapping),c.layers.enableAll(),t.unshift(c,c.geometry,c.material,0,0,null))}function setClear(t,r){t.getRGB(Vo,getUnlitUniformColorSpace(e)),n.buffers.color.setClear(Vo.r,Vo.g,Vo.b,r,a)}function dispose(){l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),s=t,setClear(o,s)},getClearAlpha:function(){return s},setClearAlpha:function(e){s=e,setClear(o,s)},render,addToRenderList,dispose}}function WebGLBindingStates(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=createBindingState(null),a=i,o=!1;function setup(n,r,i,s,c){let l=!1,u=getBindingState(n,s,i,r);a!==u&&(a=u,bindVertexArrayObject(a.object)),l=needsUpdate(n,s,i,c),l&&saveCache(n,s,i,c),c!==null&&t.update(c,e.ELEMENT_ARRAY_BUFFER),(l||o)&&(o=!1,setupVertexAttributes(n,r,i,s),c!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(c).buffer))}function createVertexArrayObject(){return e.createVertexArray()}function bindVertexArrayObject(t){return e.bindVertexArray(t)}function deleteVertexArrayObject(t){return e.deleteVertexArray(t)}function getBindingState(e,t,n,i){let a=i.wireframe===!0,o=r[t.id];o===void 0&&(o={},r[t.id]=o);let s=e.isInstancedMesh===!0?e.id:0,c=o[s];c===void 0&&(c={},o[s]=c);let l=c[n.id];l===void 0&&(l={},c[n.id]=l);let u=l[a];return u===void 0&&(u=createBindingState(createVertexArrayObject()),l[a]=u),u}function createBindingState(e){let t=[],r=[],i=[];for(let e=0;e<n;e++)t[e]=0,r[e]=0,i[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:r,attributeDivisors:i,object:e,attributes:{},index:null}}function needsUpdate(e,t,n,r){let i=a.attributes,o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=i[t],r=o[t];if(r===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(r=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(r=e.instanceColor)),n===void 0||n.attribute!==r||r&&n.data!==r.data)return!0;s++}return a.attributesNum!==s||a.index!==r}function saveCache(e,t,n,r){let i={},o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=o[t];n===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(n=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,s++}a.attributes=i,a.attributesNum=s,a.index=r}function initAttributes(){let e=a.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function enableAttribute(e){enableAttributeAndDivisor(e,0)}function enableAttributeAndDivisor(t,n){let r=a.newAttributes,i=a.enabledAttributes,o=a.attributeDivisors;r[t]=1,i[t]===0&&(e.enableVertexAttribArray(t),i[t]=1),o[t]!==n&&(e.vertexAttribDivisor(t,n),o[t]=n)}function disableUnusedAttributes(){let t=a.newAttributes,n=a.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function vertexAttribPointer(t,n,r,i,a,o,s){s===!0?e.vertexAttribIPointer(t,n,r,a,o):e.vertexAttribPointer(t,n,r,i,a,o)}function setupVertexAttributes(n,r,i,a){initAttributes();let o=a.attributes,s=i.getAttributes(),c=r.defaultAttributeValues;for(let r in s){let i=s[r];if(i.location>=0){let s=o[r];if(s===void 0&&(r===`instanceMatrix`&&n.instanceMatrix&&(s=n.instanceMatrix),r===`instanceColor`&&n.instanceColor&&(s=n.instanceColor)),s!==void 0){let r=s.normalized,o=s.itemSize,c=t.get(s);if(c===void 0)continue;let l=c.buffer,u=c.type,d=c.bytesPerElement,f=u===e.INT||u===e.UNSIGNED_INT||s.gpuType===1013;if(s.isInterleavedBufferAttribute){let t=s.data,c=t.stride,p=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<i.locationSize;e++)enableAttributeAndDivisor(i.location+e,t.meshPerAttribute);n.isInstancedMesh!==!0&&a._maxInstanceCount===void 0&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<i.locationSize;e++)enableAttribute(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,l);for(let e=0;e<i.locationSize;e++)vertexAttribPointer(i.location+e,o/i.locationSize,u,r,c*d,(p+o/i.locationSize*e)*d,f)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<i.locationSize;e++)enableAttributeAndDivisor(i.location+e,s.meshPerAttribute);n.isInstancedMesh!==!0&&a._maxInstanceCount===void 0&&(a._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<i.locationSize;e++)enableAttribute(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,l);for(let e=0;e<i.locationSize;e++)vertexAttribPointer(i.location+e,o/i.locationSize,u,r,o*d,o/i.locationSize*e*d,f)}}else if(c!==void 0){let t=c[r];if(t!==void 0)switch(t.length){case 2:e.vertexAttrib2fv(i.location,t);break;case 3:e.vertexAttrib3fv(i.location,t);break;case 4:e.vertexAttrib4fv(i.location,t);break;default:e.vertexAttrib1fv(i.location,t)}}}}disableUnusedAttributes()}function dispose(){reset();for(let e in r){let t=r[e];for(let e in t){let n=t[e];for(let e in n){let t=n[e];for(let e in t)deleteVertexArrayObject(t[e].object),delete t[e];delete n[e]}}delete r[e]}}function releaseStatesOfGeometry(e){if(r[e.id]===void 0)return;let t=r[e.id];for(let e in t){let n=t[e];for(let e in n){let t=n[e];for(let e in t)deleteVertexArrayObject(t[e].object),delete t[e];delete n[e]}}delete r[e.id]}function releaseStatesOfProgram(e){for(let t in r){let n=r[t];for(let t in n){let r=n[t];if(r[e.id]===void 0)continue;let i=r[e.id];for(let e in i)deleteVertexArrayObject(i[e].object),delete i[e];delete r[e.id]}}}function releaseStatesOfObject(e){for(let t in r){let n=r[t],i=e.isInstancedMesh===!0?e.id:0,a=n[i];if(a!==void 0){for(let e in a){let t=a[e];for(let e in t)deleteVertexArrayObject(t[e].object),delete t[e];delete a[e]}delete n[i],Object.keys(n).length===0&&delete r[t]}}}function reset(){resetDefaultState(),o=!0,a!==i&&(a=i,bindVertexArrayObject(a.object))}function resetDefaultState(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup,reset,resetDefaultState,dispose,releaseStatesOfGeometry,releaseStatesOfObject,releaseStatesOfProgram,initAttributes,enableAttribute,disableUnusedAttributes}}function WebGLBufferRenderer(e,t,n){let r;function setMode(e){r=e}function render(t,i){e.drawArrays(r,t,i),n.update(i,r,1)}function renderInstances(t,i,a){a!==0&&(e.drawArraysInstanced(r,t,i,a),n.update(i,r,a))}function renderMultiDraw(e,i,a){if(a===0)return;t.get(`WEBGL_multi_draw`).multiDrawArraysWEBGL(r,e,0,i,0,a);let o=0;for(let e=0;e<a;e++)o+=i[e];n.update(o,r,1)}this.setMode=setMode,this.render=render,this.renderInstances=renderInstances,this.renderMultiDraw=renderMultiDraw}function WebGLCapabilities(e,t,n,r){let i;function getMaxAnisotropy(){if(i!==void 0)return i;if(t.has(`EXT_texture_filter_anisotropic`)===!0){let n=t.get(`EXT_texture_filter_anisotropic`);i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function textureFormatReadable(t){return!(t!==1023&&r.convert(t)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT))}function textureTypeReadable(n){let i=n===1016&&(t.has(`EXT_color_buffer_half_float`)||t.has(`EXT_color_buffer_float`));return!(n!==1009&&r.convert(n)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==1015&&!i)}function getMaxPrecision(t){if(t===`highp`){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return`highp`;t=`mediump`}return t===`mediump`&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?`mediump`:`lowp`}let a=n.precision===void 0?`highp`:n.precision,o=getMaxPrecision(a);o!==a&&(warn(`WebGLRenderer:`,a,`not supported, using`,o,`instead.`),a=o);let s=n.logarithmicDepthBuffer===!0,c=n.reversedDepthBuffer===!0&&t.has(`EXT_clip_control`);n.reversedDepthBuffer===!0&&c===!1&&warn(`WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.`);let l=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=e.getParameter(e.MAX_TEXTURE_SIZE),f=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),p=e.getParameter(e.MAX_VERTEX_ATTRIBS),m=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),h=e.getParameter(e.MAX_VARYING_VECTORS),g=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),_=e.getParameter(e.MAX_SAMPLES),v=e.getParameter(e.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy,getMaxPrecision,textureFormatReadable,textureTypeReadable,precision:a,logarithmicDepthBuffer:s,reversedDepthBuffer:c,maxTextures:l,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:f,maxAttributes:p,maxVertexUniforms:m,maxVaryings:h,maxFragmentUniforms:g,maxSamples:_,samples:v}}function WebGLClipping(e){let t=this,n=null,r=0,i=!1,a=!1,o=new Plane,s=new q,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let n=e.length!==0||t||r!==0||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,projectPlanes(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=projectPlanes(e,t,0)},this.setState=function(t,o,s){let l=t.clippingPlanes,u=t.clipIntersection,d=t.clipShadows,f=e.get(t);if(!i||l===null||l.length===0||a&&!d)a?projectPlanes(null):resetGlobalState();else{let e=a?0:r,t=e*4,i=f.clippingState||null;c.value=i,i=projectPlanes(l,o,t,s);for(let e=0;e!==t;++e)i[e]=n[e];f.clippingState=i,this.numIntersection=u?this.numPlanes:0,this.numPlanes+=e}};function resetGlobalState(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function projectPlanes(e,n,r,i){let a=e===null?0:e.length,l=null;if(a!==0){if(l=c.value,i!==!0||l===null){let t=r+a*4,i=n.matrixWorldInverse;s.getNormalMatrix(i),(l===null||l.length<t)&&(l=new Float32Array(t));for(let t=0,n=r;t!==a;++t,n+=4)o.copy(e[t]).applyMatrix4(i,s),o.normal.toArray(l,n),l[n+3]=o.constant}c.value=l,c.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,l}}const Wo=[.125,.215,.35,.446,.526,.582],Go=new OrthographicCamera,Ko=new Color;let qo=null,Jo=0,Yo=0,Xo=!1;const Zo=new K;var PMREMGenerator=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,r=100,i={}){let{size:a=256,position:o=Zo}=i;qo=this._renderer.getRenderTarget(),Jo=this._renderer.getActiveCubeFace(),Yo=this._renderer.getActiveMipmapLevel(),Xo=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,r,s,o),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=2**this._lodMax}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(qo,Jo,Yo),this._renderer.xr.enabled=Xo,e.scissorTest=!1,_setViewport(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===301||e.mapping===302?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),qo=this._renderer.getRenderTarget(),Jo=this._renderer.getActiveCubeFace(),Yo=this._renderer.getActiveMipmapLevel(),Xo=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:Ir,minFilter:Ir,generateMipmaps:!1,type:Hr,format:Kr,colorSpace:si,depthBuffer:!1},r=_createRenderTarget(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=_createRenderTarget(e,t,n);let{_lodMax:r}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=_createPlanes(r)),this._blurMaterial=_getBlurShader(r,e,t),this._ggxMaterial=_getGGXShader(r,e,t)}return r}_compileMaterial(e){let t=new Mesh(new Ka,e);this._renderer.compile(t,Go)}_sceneToCubeUV(e,t,n,r,i){let a=new PerspectiveCamera(90,1,t,n),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],c=this._renderer,l=c.autoClear,u=c.toneMapping;c.getClearColor(Ko),c.toneMapping=0,c.autoClear=!1,c.state.buffers.depth.getReversed()&&(c.setRenderTarget(r),c.clearDepth(),c.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new Mesh(new yo,new MeshBasicMaterial({name:`PMREM.Background`,side:1,depthWrite:!1,depthTest:!1})));let d=this._backgroundBox,f=d.material,p=!1,m=e.background;m?m.isColor&&(f.color.copy(m),e.background=null,p=!0):(f.color.copy(Ko),p=!0);for(let t=0;t<6;t++){let n=t%3;n===0?(a.up.set(0,o[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x+s[t],i.y,i.z)):n===1?(a.up.set(0,0,o[t]),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y+s[t],i.z)):(a.up.set(0,o[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y,i.z+s[t]));let l=this._cubeSize;_setViewport(r,n*l,t>2?l:0,l,l),c.setRenderTarget(r),p&&c.render(d,a),c.render(e,a)}c.toneMapping=u,c.autoClear=l,e.background=m}_textureToCubeUV(e,t){let n=this._renderer,r=e.mapping===301||e.mapping===302;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial());let i=r?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=i;let o=i.uniforms;o.envMap.value=e;let s=this._cubeSize;_setViewport(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,Go)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodMeshes.length;for(let t=1;t<r;t++)this._applyGGXFilter(e,t-1,t);t.autoClear=n}_applyGGXFilter(e,t,n){let r=this._renderer,i=this._pingPongRenderTarget,a=this._ggxMaterial,o=this._lodMeshes[n];o.material=a;let s=a.uniforms,c=n/(this._lodMeshes.length-1),l=t/(this._lodMeshes.length-1),u=Math.sqrt(c*c-l*l)*(0+c*1.25),{_lodMax:d}=this,f=this._sizeLods[n],p=3*f*(n>d-4?n-d+4:0),m=4*(this._cubeSize-f);s.envMap.value=e.texture,s.roughness.value=u,s.mipInt.value=d-t,_setViewport(i,p,m,3*f,2*f),r.setRenderTarget(i),r.render(o,Go),s.envMap.value=i.texture,s.roughness.value=0,s.mipInt.value=d-n,_setViewport(e,p,m,3*f,2*f),r.setRenderTarget(e),r.render(o,Go)}_blur(e,t,n,r,i){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,`latitudinal`,i),this._halfBlur(a,e,n,n,r,`longitudinal`,i)}_halfBlur(e,t,n,r,i,a,o){let s=this._renderer,c=this._blurMaterial;a!==`latitudinal`&&a!==`longitudinal`&&error(`blur direction must be either latitudinal or longitudinal!`);let l=this._lodMeshes[r];l.material=c;let u=c.uniforms,d=this._sizeLods[n]-1,f=isFinite(i)?Math.PI/(2*d):2*Math.PI/39,p=i/f,m=isFinite(i)?1+Math.floor(3*p):20;m>20&&warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to 20`);let h=[],g=0;for(let e=0;e<20;++e){let t=e/p,n=Math.exp(-t*t/2);h.push(n),e===0?g+=n:e<m&&(g+=2*n)}for(let e=0;e<h.length;e++)h[e]=h[e]/g;u.envMap.value=e.texture,u.samples.value=m,u.weights.value=h,u.latitudinal.value=a===`latitudinal`,o&&(u.poleAxis.value=o);let{_lodMax:_}=this;u.dTheta.value=f,u.mipInt.value=_-n;let v=this._sizeLods[r];_setViewport(t,3*v*(r>_-4?r-_+4:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(t),s.render(l,Go)}};function _createPlanes(e){let t=[],n=[],r=[],i=e,a=e-4+1+Wo.length;for(let o=0;o<a;o++){let a=2**i;t.push(a);let s=1/a;o>e-4?s=Wo[o-e+4-1]:o===0&&(s=0),n.push(s);let c=1/(a-2),l=-c,u=1+c,d=[l,l,u,l,u,u,l,l,u,u,l,u],f=new Float32Array(108),p=new Float32Array(72),m=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];f.set(r,18*e),p.set(d,12*e);let i=[e,e,e,e,e,e];m.set(i,6*e)}let h=new Ka;h.setAttribute(`position`,new BufferAttribute(f,3)),h.setAttribute(`uv`,new BufferAttribute(p,2)),h.setAttribute(`faceIndex`,new BufferAttribute(m,1)),r.push(new Mesh(h,null)),i>4&&i--}return{lodMeshes:r,sizeLods:t,sigmas:n}}function _createRenderTarget(e,t,n){let r=new WebGLRenderTarget(e,t,n);return r.texture.mapping=306,r.texture.name=`PMREM.cubeUv`,r.scissorTest=!0,r}function _setViewport(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function _getGGXShader(e,t,n){return new ShaderMaterial({name:`PMREMGGXConvolution`,defines:{GGX_SAMPLES:256,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:_getCommonVertexShader(),fragmentShader:`
|
|
3781
3781
|
|
|
3782
3782
|
precision highp float;
|
|
3783
3783
|
precision highp int;
|
|
@@ -3881,7 +3881,7 @@ void main() {
|
|
|
3881
3881
|
|
|
3882
3882
|
gl_FragColor = vec4(prefilteredColor, 1.0);
|
|
3883
3883
|
}
|
|
3884
|
-
`,blending:0,depthTest:!1,depthWrite:!1})}function _getBlurShader(e,t,n){let r=new Float32Array(20),i=new
|
|
3884
|
+
`,blending:0,depthTest:!1,depthWrite:!1})}function _getBlurShader(e,t,n){let r=new Float32Array(20),i=new K(0,1,0);return new ShaderMaterial({name:`SphericalGaussianBlur`,defines:{n:20,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:_getCommonVertexShader(),fragmentShader:`
|
|
3885
3885
|
|
|
3886
3886
|
precision mediump float;
|
|
3887
3887
|
precision mediump int;
|
|
@@ -4066,7 +4066,7 @@ void main() {
|
|
|
4066
4066
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
4067
4067
|
|
|
4068
4068
|
}
|
|
4069
|
-
`},r=new
|
|
4069
|
+
`},r=new yo(5,5,5),i=new ShaderMaterial({name:`CubemapFromEquirect`,uniforms:cloneUniforms(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;let a=new Mesh(r,i),o=t.minFilter;return t.minFilter===1008&&(t.minFilter=Ir),new CubeCamera(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){let i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}};function WebGLEnvironments(e){let t=new WeakMap,n=new WeakMap,r=null;function get(e,t=!1){return e==null?null:t?getPMREM(e):getCube(e)}function getCube(n){if(n&&n.isTexture){let r=n.mapping;if(r===303||r===304)if(t.has(n)){let e=t.get(n).texture;return mapTextureMapping(e,n.mapping)}else{let r=n.image;if(r&&r.height>0){let i=new WebGLCubeRenderTarget(r.height);return i.fromEquirectangularTexture(e,n),t.set(n,i),n.addEventListener(`dispose`,onCubemapDispose),mapTextureMapping(i.texture,n.mapping)}else return null}}return n}function getPMREM(t){if(t&&t.isTexture){let i=t.mapping,a=i===303||i===304,o=i===301||i===302;if(a||o){let i=n.get(t),s=i===void 0?0:i.texture.pmremVersion;if(t.isRenderTargetTexture&&t.pmremVersion!==s)return r===null&&(r=new PMREMGenerator(e)),i=a?r.fromEquirectangular(t,i):r.fromCubemap(t,i),i.texture.pmremVersion=t.pmremVersion,n.set(t,i),i.texture;if(i!==void 0)return i.texture;{let s=t.image;return a&&s&&s.height>0||o&&s&&isCubeTextureComplete(s)?(r===null&&(r=new PMREMGenerator(e)),i=a?r.fromEquirectangular(t):r.fromCubemap(t),i.texture.pmremVersion=t.pmremVersion,n.set(t,i),t.addEventListener(`dispose`,onPMREMDispose),i.texture):null}}}return t}function mapTextureMapping(e,t){return t===303?e.mapping=301:t===304&&(e.mapping=302),e}function isCubeTextureComplete(e){let t=0;for(let n=0;n<6;n++)e[n]!==void 0&&t++;return t===6}function onCubemapDispose(e){let n=e.target;n.removeEventListener(`dispose`,onCubemapDispose);let r=t.get(n);r!==void 0&&(t.delete(n),r.dispose())}function onPMREMDispose(e){let t=e.target;t.removeEventListener(`dispose`,onPMREMDispose);let r=n.get(t);r!==void 0&&(n.delete(t),r.dispose())}function dispose(){t=new WeakMap,n=new WeakMap,r!==null&&(r.dispose(),r=null)}return{get,dispose}}function WebGLExtensions(e){let t={};function getExtension(n){if(t[n]!==void 0)return t[n];let r=e.getExtension(n);return t[n]=r,r}return{has:function(e){return getExtension(e)!==null},init:function(){getExtension(`EXT_color_buffer_float`),getExtension(`WEBGL_clip_cull_distance`),getExtension(`OES_texture_float_linear`),getExtension(`EXT_color_buffer_half_float`),getExtension(`WEBGL_multisampled_render_to_texture`),getExtension(`WEBGL_render_shared_exponent`)},get:function(e){let t=getExtension(e);return t===null&&warnOnce(`WebGLRenderer: `+e+` extension not supported.`),t}}}function WebGLGeometries(e,t,n,r){let i={},a=new WeakMap;function onGeometryDispose(e){let o=e.target;o.index!==null&&t.remove(o.index);for(let e in o.attributes)t.remove(o.attributes[e]);o.removeEventListener(`dispose`,onGeometryDispose),delete i[o.id];let s=a.get(o);s&&(t.remove(s),a.delete(o)),r.releaseStatesOfGeometry(o),o.isInstancedBufferGeometry===!0&&delete o._maxInstanceCount,n.memory.geometries--}function get(e,t){return i[t.id]===!0?t:(t.addEventListener(`dispose`,onGeometryDispose),i[t.id]=!0,n.memory.geometries++,t)}function update(n){let r=n.attributes;for(let n in r)t.update(r[n],e.ARRAY_BUFFER)}function updateWireframeAttribute(e){let n=[],r=e.index,i=e.attributes.position,o=0;if(i===void 0)return;if(r!==null){let e=r.array;o=r.version;for(let t=0,r=e.length;t<r;t+=3){let r=e[t+0],i=e[t+1],a=e[t+2];n.push(r,i,i,a,a,r)}}else{let e=i.array;o=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){let e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}let s=new(i.count>=65535?Uint32BufferAttribute:Uint16BufferAttribute)(n,1);s.version=o;let c=a.get(e);c&&t.remove(c),a.set(e,s)}function getWireframeAttribute(e){let t=a.get(e);if(t){let n=e.index;n!==null&&t.version<n.version&&updateWireframeAttribute(e)}else updateWireframeAttribute(e);return a.get(e)}return{get,update,getWireframeAttribute}}function WebGLIndexedBufferRenderer(e,t,n){let r;function setMode(e){r=e}let i,a;function setIndex(e){i=e.type,a=e.bytesPerElement}function render(t,o){e.drawElements(r,o,i,t*a),n.update(o,r,1)}function renderInstances(t,o,s){s!==0&&(e.drawElementsInstanced(r,o,i,t*a,s),n.update(o,r,s))}function renderMultiDraw(e,a,o){if(o===0)return;t.get(`WEBGL_multi_draw`).multiDrawElementsWEBGL(r,a,0,i,e,0,o);let s=0;for(let e=0;e<o;e++)s+=a[e];n.update(s,r,1)}this.setMode=setMode,this.setIndex=setIndex,this.render=render,this.renderInstances=renderInstances,this.renderMultiDraw=renderMultiDraw}function WebGLInfo(e){let t={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function update(t,r,i){switch(n.calls++,r){case e.TRIANGLES:n.triangles+=t/3*i;break;case e.LINES:n.lines+=t/2*i;break;case e.LINE_STRIP:n.lines+=i*(t-1);break;case e.LINE_LOOP:n.lines+=i*t;break;case e.POINTS:n.points+=i*t;break;default:error(`WebGLInfo: Unknown draw mode:`,r);break}}function reset(){n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:t,render:n,programs:null,autoReset:!0,reset,update}}function WebGLMorphtargets(e,t,n){let r=new WeakMap,i=new Y;function update(a,o,s){let c=a.morphTargetInfluences,l=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=l===void 0?0:l.length,d=r.get(o);if(d===void 0||d.count!==u){d!==void 0&&d.texture.dispose();let e=o.morphAttributes.position!==void 0,n=o.morphAttributes.normal!==void 0,a=o.morphAttributes.color!==void 0,s=o.morphAttributes.position||[],c=o.morphAttributes.normal||[],l=o.morphAttributes.color||[],f=0;e===!0&&(f=1),n===!0&&(f=2),a===!0&&(f=3);let p=o.attributes.position.count*f,m=1;p>t.maxTextureSize&&(m=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let h=new Float32Array(p*m*4*u),g=new DataArrayTexture(h,p,m,u);g.type=Vr,g.needsUpdate=!0;let _=f*4;for(let t=0;t<u;t++){let r=s[t],o=c[t],u=l[t],d=p*m*4*t;for(let t=0;t<r.count;t++){let s=t*_;e===!0&&(i.fromBufferAttribute(r,t),h[d+s+0]=i.x,h[d+s+1]=i.y,h[d+s+2]=i.z,h[d+s+3]=0),n===!0&&(i.fromBufferAttribute(o,t),h[d+s+4]=i.x,h[d+s+5]=i.y,h[d+s+6]=i.z,h[d+s+7]=0),a===!0&&(i.fromBufferAttribute(u,t),h[d+s+8]=i.x,h[d+s+9]=i.y,h[d+s+10]=i.z,h[d+s+11]=u.itemSize===4?i.w:1)}}d={count:u,texture:g,size:new G(p,m)},r.set(o,d);function disposeTexture(){g.dispose(),r.delete(o),o.removeEventListener(`dispose`,disposeTexture)}o.addEventListener(`dispose`,disposeTexture)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)s.getUniforms().setValue(e,`morphTexture`,a.morphTexture,n);else{let t=0;for(let e=0;e<c.length;e++)t+=c[e];let n=o.morphTargetsRelative?1:1-t;s.getUniforms().setValue(e,`morphTargetBaseInfluence`,n),s.getUniforms().setValue(e,`morphTargetInfluences`,c)}s.getUniforms().setValue(e,`morphTargetsTexture`,d.texture,n),s.getUniforms().setValue(e,`morphTargetsTextureSize`,d.size)}return{update}}function WebGLObjects(e,t,n,r,i){let a=new WeakMap;function update(r){let o=i.render.frame,s=r.geometry,c=t.get(r,s);if(a.get(c)!==o&&(t.update(c),a.set(c,o)),r.isInstancedMesh&&(r.hasEventListener(`dispose`,onInstancedMeshDispose)===!1&&r.addEventListener(`dispose`,onInstancedMeshDispose),a.get(r)!==o&&(n.update(r.instanceMatrix,e.ARRAY_BUFFER),r.instanceColor!==null&&n.update(r.instanceColor,e.ARRAY_BUFFER),a.set(r,o))),r.isSkinnedMesh){let e=r.skeleton;a.get(e)!==o&&(e.update(),a.set(e,o))}return c}function dispose(){a=new WeakMap}function onInstancedMeshDispose(e){let t=e.target;t.removeEventListener(`dispose`,onInstancedMeshDispose),r.releaseStatesOfObject(t),n.remove(t.instanceMatrix),t.instanceColor!==null&&n.remove(t.instanceColor)}return{update,dispose}}const Qo={1:`LINEAR_TONE_MAPPING`,2:`REINHARD_TONE_MAPPING`,3:`CINEON_TONE_MAPPING`,4:`ACES_FILMIC_TONE_MAPPING`,6:`AGX_TONE_MAPPING`,7:`NEUTRAL_TONE_MAPPING`,5:`CUSTOM_TONE_MAPPING`};function WebGLOutput(e,t,n,r,i,a){let o=new WebGLRenderTarget(t,n,{type:e,depthBuffer:i,stencilBuffer:a,samples:r?4:0,depthTexture:i?new DepthTexture(t,n):void 0}),s=new WebGLRenderTarget(t,n,{type:Hr,depthBuffer:!1,stencilBuffer:!1}),c=new Ka;c.setAttribute(`position`,new Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),c.setAttribute(`uv`,new Float32BufferAttribute([0,2,0,0,2,0],2));let l=new RawShaderMaterial({uniforms:{tDiffuse:{value:null}},vertexShader:`
|
|
4070
4070
|
precision highp float;
|
|
4071
4071
|
|
|
4072
4072
|
uniform mat4 modelViewMatrix;
|
|
@@ -4112,17 +4112,17 @@ void main() {
|
|
|
4112
4112
|
#ifdef SRGB_TRANSFER
|
|
4113
4113
|
gl_FragColor = sRGBTransferOETF( gl_FragColor );
|
|
4114
4114
|
#endif
|
|
4115
|
-
}`,depthTest:!1,depthWrite:!1}),u=new Mesh(c,l),d=new OrthographicCamera(-1,1,1,-1,0,1),f=null,p=null,m=!1,h,g=null,_=[],v=!1;this.setSize=function(e,t){o.setSize(e,t),s.setSize(e,t);for(let n=0;n<_.length;n++){let r=_[n];r.setSize&&r.setSize(e,t)}},this.setEffects=function(e){_=e,v=_.length>0&&_[0].isRenderPass===!0;let t=o.width,n=o.height;for(let e=0;e<_.length;e++){let r=_[e];r.setSize&&r.setSize(t,n)}},this.begin=function(e,t){if(m||e.toneMapping===0&&_.length===0)return!1;if(g=t,t!==null){let e=t.width,n=t.height;(o.width!==e||o.height!==n)&&this.setSize(e,n)}return v===!1&&e.setRenderTarget(o),h=e.toneMapping,e.toneMapping=0,!0},this.hasRenderPass=function(){return v},this.end=function(e,t){e.toneMapping=h,m=!0;let n=o,r=s;for(let i=0;i<_.length;i++){let a=_[i];if(a.enabled!==!1&&(a.render(e,r,n,t),a.needsSwap!==!1)){let e=n;n=r,r=e}}if(f!==e.outputColorSpace||p!==e.toneMapping){f=e.outputColorSpace,p=e.toneMapping,l.defines={},Fi.getTransfer(f)===`srgb`&&(l.defines.SRGB_TRANSFER=``);let t=ps[p];t&&(l.defines[t]=``),l.needsUpdate=!0}l.uniforms.tDiffuse.value=n.texture,e.setRenderTarget(g),e.render(u,d),g=null,m=!1},this.isCompositing=function(){return m},this.dispose=function(){o.depthTexture&&o.depthTexture.dispose(),o.dispose(),s.dispose(),c.dispose(),l.dispose()}}const ms=new Bi,hs=new DepthTexture(1,1),gs=new DataArrayTexture,_s=new Data3DTexture,vs=new CubeTexture,ys=[],bs=[],xs=new Float32Array(16),Ss=new Float32Array(9),Cs=new Float32Array(4);function flatten(e,t,n){let r=e[0];if(r<=0||r>0)return e;let i=t*n,a=ys[i];if(a===void 0&&(a=new Float32Array(i),ys[i]=a),t!==0){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function arraysEqual(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function copyArray(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function allocTexUnits(e,t){let n=bs[t];n===void 0&&(n=new Int32Array(t),bs[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function setValueV1f(e,t){let n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function setValueV2f(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(arraysEqual(n,t))return;e.uniform2fv(this.addr,t),copyArray(n,t)}}function setValueV3f(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(t.r!==void 0)(n[0]!==t.r||n[1]!==t.g||n[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(arraysEqual(n,t))return;e.uniform3fv(this.addr,t),copyArray(n,t)}}function setValueV4f(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(arraysEqual(n,t))return;e.uniform4fv(this.addr,t),copyArray(n,t)}}function setValueM2(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(arraysEqual(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),copyArray(n,t)}else{if(arraysEqual(n,r))return;Cs.set(r),e.uniformMatrix2fv(this.addr,!1,Cs),copyArray(n,r)}}function setValueM3(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(arraysEqual(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),copyArray(n,t)}else{if(arraysEqual(n,r))return;Ss.set(r),e.uniformMatrix3fv(this.addr,!1,Ss),copyArray(n,r)}}function setValueM4(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(arraysEqual(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),copyArray(n,t)}else{if(arraysEqual(n,r))return;xs.set(r),e.uniformMatrix4fv(this.addr,!1,xs),copyArray(n,r)}}function setValueV1i(e,t){let n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function setValueV2i(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(arraysEqual(n,t))return;e.uniform2iv(this.addr,t),copyArray(n,t)}}function setValueV3i(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(arraysEqual(n,t))return;e.uniform3iv(this.addr,t),copyArray(n,t)}}function setValueV4i(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(arraysEqual(n,t))return;e.uniform4iv(this.addr,t),copyArray(n,t)}}function setValueV1ui(e,t){let n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function setValueV2ui(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(arraysEqual(n,t))return;e.uniform2uiv(this.addr,t),copyArray(n,t)}}function setValueV3ui(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(arraysEqual(n,t))return;e.uniform3uiv(this.addr,t),copyArray(n,t)}}function setValueV4ui(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(arraysEqual(n,t))return;e.uniform4uiv(this.addr,t),copyArray(n,t)}}function setValueT1(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i);let a;this.type===e.SAMPLER_2D_SHADOW?(hs.compareFunction=n.isReversedDepthBuffer()?518:515,a=hs):a=ms,n.setTexture2D(t||a,i)}function setValueT3D1(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||_s,i)}function setValueT6(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||vs,i)}function setValueT2DArray1(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||gs,i)}function getSingularSetter(e){switch(e){case 5126:return setValueV1f;case 35664:return setValueV2f;case 35665:return setValueV3f;case 35666:return setValueV4f;case 35674:return setValueM2;case 35675:return setValueM3;case 35676:return setValueM4;case 5124:case 35670:return setValueV1i;case 35667:case 35671:return setValueV2i;case 35668:case 35672:return setValueV3i;case 35669:case 35673:return setValueV4i;case 5125:return setValueV1ui;case 36294:return setValueV2ui;case 36295:return setValueV3ui;case 36296:return setValueV4ui;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1;case 35679:case 36299:case 36307:return setValueT3D1;case 35680:case 36300:case 36308:case 36293:return setValueT6;case 36289:case 36303:case 36311:case 36292:return setValueT2DArray1}}function setValueV1fArray(e,t){e.uniform1fv(this.addr,t)}function setValueV2fArray(e,t){let n=flatten(t,this.size,2);e.uniform2fv(this.addr,n)}function setValueV3fArray(e,t){let n=flatten(t,this.size,3);e.uniform3fv(this.addr,n)}function setValueV4fArray(e,t){let n=flatten(t,this.size,4);e.uniform4fv(this.addr,n)}function setValueM2Array(e,t){let n=flatten(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function setValueM3Array(e,t){let n=flatten(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function setValueM4Array(e,t){let n=flatten(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function setValueV1iArray(e,t){e.uniform1iv(this.addr,t)}function setValueV2iArray(e,t){e.uniform2iv(this.addr,t)}function setValueV3iArray(e,t){e.uniform3iv(this.addr,t)}function setValueV4iArray(e,t){e.uniform4iv(this.addr,t)}function setValueV1uiArray(e,t){e.uniform1uiv(this.addr,t)}function setValueV2uiArray(e,t){e.uniform2uiv(this.addr,t)}function setValueV3uiArray(e,t){e.uniform3uiv(this.addr,t)}function setValueV4uiArray(e,t){e.uniform4uiv(this.addr,t)}function setValueT1Array(e,t,n){let r=this.cache,i=t.length,a=allocTexUnits(n,i);arraysEqual(r,a)||(e.uniform1iv(this.addr,a),copyArray(r,a));let o;o=this.type===e.SAMPLER_2D_SHADOW?hs:ms;for(let e=0;e!==i;++e)n.setTexture2D(t[e]||o,a[e])}function setValueT3DArray(e,t,n){let r=this.cache,i=t.length,a=allocTexUnits(n,i);arraysEqual(r,a)||(e.uniform1iv(this.addr,a),copyArray(r,a));for(let e=0;e!==i;++e)n.setTexture3D(t[e]||_s,a[e])}function setValueT6Array(e,t,n){let r=this.cache,i=t.length,a=allocTexUnits(n,i);arraysEqual(r,a)||(e.uniform1iv(this.addr,a),copyArray(r,a));for(let e=0;e!==i;++e)n.setTextureCube(t[e]||vs,a[e])}function setValueT2DArrayArray(e,t,n){let r=this.cache,i=t.length,a=allocTexUnits(n,i);arraysEqual(r,a)||(e.uniform1iv(this.addr,a),copyArray(r,a));for(let e=0;e!==i;++e)n.setTexture2DArray(t[e]||gs,a[e])}function getPureArraySetter(e){switch(e){case 5126:return setValueV1fArray;case 35664:return setValueV2fArray;case 35665:return setValueV3fArray;case 35666:return setValueV4fArray;case 35674:return setValueM2Array;case 35675:return setValueM3Array;case 35676:return setValueM4Array;case 5124:case 35670:return setValueV1iArray;case 35667:case 35671:return setValueV2iArray;case 35668:case 35672:return setValueV3iArray;case 35669:case 35673:return setValueV4iArray;case 5125:return setValueV1uiArray;case 36294:return setValueV2uiArray;case 36295:return setValueV3uiArray;case 36296:return setValueV4uiArray;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1Array;case 35679:case 36299:case 36307:return setValueT3DArray;case 35680:case 36300:case 36308:case 36293:return setValueT6Array;case 36289:case 36303:case 36311:case 36292:return setValueT2DArrayArray}}var SingleUniform=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=getSingularSetter(t.type)}},PureArrayUniform=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=getPureArraySetter(t.type)}},StructuredUniform=class{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){let r=this.seq;for(let i=0,a=r.length;i!==a;++i){let a=r[i];a.setValue(e,t[a.id],n)}}};const ws=/(\w+)(\])?(\[|\.)?/g;function addUniform(e,t){e.seq.push(t),e.map[t.id]=t}function parseUniform(e,t,n){let r=e.name,i=r.length;for(ws.lastIndex=0;;){let a=ws.exec(r),o=ws.lastIndex,s=a[1],c=a[2]===`]`,l=a[3];if(c&&(s|=0),l===void 0||l===`[`&&o+2===i){addUniform(n,l===void 0?new SingleUniform(s,e,t):new PureArrayUniform(s,e,t));break}else{let e=n.map[s];e===void 0&&(e=new StructuredUniform(s),addUniform(n,e)),n=e}}}var WebGLUniforms=class{constructor(e,t){this.seq=[],this.map={};let n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){let n=e.getActiveUniform(t,r);parseUniform(n,e.getUniformLocation(t,n.name),this)}let r=[],i=[];for(let t of this.seq)t.type===e.SAMPLER_2D_SHADOW||t.type===e.SAMPLER_CUBE_SHADOW||t.type===e.SAMPLER_2D_ARRAY_SHADOW?r.push(t):i.push(t);r.length>0&&(this.seq=r.concat(i))}setValue(e,t,n,r){let i=this.map[t];i!==void 0&&i.setValue(e,n,r)}setOptional(e,t,n){let r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,a=t.length;i!==a;++i){let a=t[i],o=n[a.id];o.needsUpdate!==!1&&a.setValue(e,o.value,r)}}static seqWithValue(e,t){let n=[];for(let r=0,i=e.length;r!==i;++r){let i=e[r];i.id in t&&n.push(i)}return n}};function WebGLShader(e,t,n){let r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}let Ts=0;function handleSource(e,t){let n=e.split(`
|
|
4115
|
+
}`,depthTest:!1,depthWrite:!1}),u=new Mesh(c,l),d=new OrthographicCamera(-1,1,1,-1,0,1),f=null,p=null,m=!1,h,g=null,_=[],v=!1;this.setSize=function(e,t){o.setSize(e,t),s.setSize(e,t);for(let n=0;n<_.length;n++){let r=_[n];r.setSize&&r.setSize(e,t)}},this.setEffects=function(e){_=e,v=_.length>0&&_[0].isRenderPass===!0;let t=o.width,n=o.height;for(let e=0;e<_.length;e++){let r=_[e];r.setSize&&r.setSize(t,n)}},this.begin=function(e,t){if(m||e.toneMapping===0&&_.length===0)return!1;if(g=t,t!==null){let e=t.width,n=t.height;(o.width!==e||o.height!==n)&&this.setSize(e,n)}return v===!1&&e.setRenderTarget(o),h=e.toneMapping,e.toneMapping=0,!0},this.hasRenderPass=function(){return v},this.end=function(e,t){e.toneMapping=h,m=!0;let n=o,r=s;for(let i=0;i<_.length;i++){let a=_[i];if(a.enabled!==!1&&(a.render(e,r,n,t),a.needsSwap!==!1)){let e=n;n=r,r=e}}if(f!==e.outputColorSpace||p!==e.toneMapping){f=e.outputColorSpace,p=e.toneMapping,l.defines={},J.getTransfer(f)===`srgb`&&(l.defines.SRGB_TRANSFER=``);let t=Qo[p];t&&(l.defines[t]=``),l.needsUpdate=!0}l.uniforms.tDiffuse.value=n.texture,e.setRenderTarget(g),e.render(u,d),g=null,m=!1},this.isCompositing=function(){return m},this.dispose=function(){o.depthTexture&&o.depthTexture.dispose(),o.dispose(),s.dispose(),c.dispose(),l.dispose()}}const $o=new Oi,es=new DepthTexture(1,1),ts=new DataArrayTexture,ns=new Data3DTexture,rs=new CubeTexture,is=[],as=[],os=new Float32Array(16),ss=new Float32Array(9),cs=new Float32Array(4);function flatten(e,t,n){let r=e[0];if(r<=0||r>0)return e;let i=t*n,a=is[i];if(a===void 0&&(a=new Float32Array(i),is[i]=a),t!==0){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function arraysEqual(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function copyArray(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function allocTexUnits(e,t){let n=as[t];n===void 0&&(n=new Int32Array(t),as[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function setValueV1f(e,t){let n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function setValueV2f(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(arraysEqual(n,t))return;e.uniform2fv(this.addr,t),copyArray(n,t)}}function setValueV3f(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(t.r!==void 0)(n[0]!==t.r||n[1]!==t.g||n[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(arraysEqual(n,t))return;e.uniform3fv(this.addr,t),copyArray(n,t)}}function setValueV4f(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(arraysEqual(n,t))return;e.uniform4fv(this.addr,t),copyArray(n,t)}}function setValueM2(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(arraysEqual(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),copyArray(n,t)}else{if(arraysEqual(n,r))return;cs.set(r),e.uniformMatrix2fv(this.addr,!1,cs),copyArray(n,r)}}function setValueM3(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(arraysEqual(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),copyArray(n,t)}else{if(arraysEqual(n,r))return;ss.set(r),e.uniformMatrix3fv(this.addr,!1,ss),copyArray(n,r)}}function setValueM4(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(arraysEqual(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),copyArray(n,t)}else{if(arraysEqual(n,r))return;os.set(r),e.uniformMatrix4fv(this.addr,!1,os),copyArray(n,r)}}function setValueV1i(e,t){let n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function setValueV2i(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(arraysEqual(n,t))return;e.uniform2iv(this.addr,t),copyArray(n,t)}}function setValueV3i(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(arraysEqual(n,t))return;e.uniform3iv(this.addr,t),copyArray(n,t)}}function setValueV4i(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(arraysEqual(n,t))return;e.uniform4iv(this.addr,t),copyArray(n,t)}}function setValueV1ui(e,t){let n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function setValueV2ui(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(arraysEqual(n,t))return;e.uniform2uiv(this.addr,t),copyArray(n,t)}}function setValueV3ui(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(arraysEqual(n,t))return;e.uniform3uiv(this.addr,t),copyArray(n,t)}}function setValueV4ui(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(arraysEqual(n,t))return;e.uniform4uiv(this.addr,t),copyArray(n,t)}}function setValueT1(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i);let a;this.type===e.SAMPLER_2D_SHADOW?(es.compareFunction=n.isReversedDepthBuffer()?518:515,a=es):a=$o,n.setTexture2D(t||a,i)}function setValueT3D1(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||ns,i)}function setValueT6(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||rs,i)}function setValueT2DArray1(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||ts,i)}function getSingularSetter(e){switch(e){case 5126:return setValueV1f;case 35664:return setValueV2f;case 35665:return setValueV3f;case 35666:return setValueV4f;case 35674:return setValueM2;case 35675:return setValueM3;case 35676:return setValueM4;case 5124:case 35670:return setValueV1i;case 35667:case 35671:return setValueV2i;case 35668:case 35672:return setValueV3i;case 35669:case 35673:return setValueV4i;case 5125:return setValueV1ui;case 36294:return setValueV2ui;case 36295:return setValueV3ui;case 36296:return setValueV4ui;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1;case 35679:case 36299:case 36307:return setValueT3D1;case 35680:case 36300:case 36308:case 36293:return setValueT6;case 36289:case 36303:case 36311:case 36292:return setValueT2DArray1}}function setValueV1fArray(e,t){e.uniform1fv(this.addr,t)}function setValueV2fArray(e,t){let n=flatten(t,this.size,2);e.uniform2fv(this.addr,n)}function setValueV3fArray(e,t){let n=flatten(t,this.size,3);e.uniform3fv(this.addr,n)}function setValueV4fArray(e,t){let n=flatten(t,this.size,4);e.uniform4fv(this.addr,n)}function setValueM2Array(e,t){let n=flatten(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function setValueM3Array(e,t){let n=flatten(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function setValueM4Array(e,t){let n=flatten(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function setValueV1iArray(e,t){e.uniform1iv(this.addr,t)}function setValueV2iArray(e,t){e.uniform2iv(this.addr,t)}function setValueV3iArray(e,t){e.uniform3iv(this.addr,t)}function setValueV4iArray(e,t){e.uniform4iv(this.addr,t)}function setValueV1uiArray(e,t){e.uniform1uiv(this.addr,t)}function setValueV2uiArray(e,t){e.uniform2uiv(this.addr,t)}function setValueV3uiArray(e,t){e.uniform3uiv(this.addr,t)}function setValueV4uiArray(e,t){e.uniform4uiv(this.addr,t)}function setValueT1Array(e,t,n){let r=this.cache,i=t.length,a=allocTexUnits(n,i);arraysEqual(r,a)||(e.uniform1iv(this.addr,a),copyArray(r,a));let o;o=this.type===e.SAMPLER_2D_SHADOW?es:$o;for(let e=0;e!==i;++e)n.setTexture2D(t[e]||o,a[e])}function setValueT3DArray(e,t,n){let r=this.cache,i=t.length,a=allocTexUnits(n,i);arraysEqual(r,a)||(e.uniform1iv(this.addr,a),copyArray(r,a));for(let e=0;e!==i;++e)n.setTexture3D(t[e]||ns,a[e])}function setValueT6Array(e,t,n){let r=this.cache,i=t.length,a=allocTexUnits(n,i);arraysEqual(r,a)||(e.uniform1iv(this.addr,a),copyArray(r,a));for(let e=0;e!==i;++e)n.setTextureCube(t[e]||rs,a[e])}function setValueT2DArrayArray(e,t,n){let r=this.cache,i=t.length,a=allocTexUnits(n,i);arraysEqual(r,a)||(e.uniform1iv(this.addr,a),copyArray(r,a));for(let e=0;e!==i;++e)n.setTexture2DArray(t[e]||ts,a[e])}function getPureArraySetter(e){switch(e){case 5126:return setValueV1fArray;case 35664:return setValueV2fArray;case 35665:return setValueV3fArray;case 35666:return setValueV4fArray;case 35674:return setValueM2Array;case 35675:return setValueM3Array;case 35676:return setValueM4Array;case 5124:case 35670:return setValueV1iArray;case 35667:case 35671:return setValueV2iArray;case 35668:case 35672:return setValueV3iArray;case 35669:case 35673:return setValueV4iArray;case 5125:return setValueV1uiArray;case 36294:return setValueV2uiArray;case 36295:return setValueV3uiArray;case 36296:return setValueV4uiArray;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1Array;case 35679:case 36299:case 36307:return setValueT3DArray;case 35680:case 36300:case 36308:case 36293:return setValueT6Array;case 36289:case 36303:case 36311:case 36292:return setValueT2DArrayArray}}var SingleUniform=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=getSingularSetter(t.type)}},PureArrayUniform=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=getPureArraySetter(t.type)}},StructuredUniform=class{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){let r=this.seq;for(let i=0,a=r.length;i!==a;++i){let a=r[i];a.setValue(e,t[a.id],n)}}};const ls=/(\w+)(\])?(\[|\.)?/g;function addUniform(e,t){e.seq.push(t),e.map[t.id]=t}function parseUniform(e,t,n){let r=e.name,i=r.length;for(ls.lastIndex=0;;){let a=ls.exec(r),o=ls.lastIndex,s=a[1],c=a[2]===`]`,l=a[3];if(c&&(s|=0),l===void 0||l===`[`&&o+2===i){addUniform(n,l===void 0?new SingleUniform(s,e,t):new PureArrayUniform(s,e,t));break}else{let e=n.map[s];e===void 0&&(e=new StructuredUniform(s),addUniform(n,e)),n=e}}}var WebGLUniforms=class{constructor(e,t){this.seq=[],this.map={};let n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){let n=e.getActiveUniform(t,r);parseUniform(n,e.getUniformLocation(t,n.name),this)}let r=[],i=[];for(let t of this.seq)t.type===e.SAMPLER_2D_SHADOW||t.type===e.SAMPLER_CUBE_SHADOW||t.type===e.SAMPLER_2D_ARRAY_SHADOW?r.push(t):i.push(t);r.length>0&&(this.seq=r.concat(i))}setValue(e,t,n,r){let i=this.map[t];i!==void 0&&i.setValue(e,n,r)}setOptional(e,t,n){let r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,a=t.length;i!==a;++i){let a=t[i],o=n[a.id];o.needsUpdate!==!1&&a.setValue(e,o.value,r)}}static seqWithValue(e,t){let n=[];for(let r=0,i=e.length;r!==i;++r){let i=e[r];i.id in t&&n.push(i)}return n}};function WebGLShader(e,t,n){let r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}let us=0;function handleSource(e,t){let n=e.split(`
|
|
4116
4116
|
`),r=[],i=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=i;e<a;e++){let i=e+1;r.push(`${i===t?`>`:` `} ${i}: ${n[e]}`)}return r.join(`
|
|
4117
|
-
`)}const
|
|
4117
|
+
`)}const ds=new q;function getEncodingComponents(e){J._getMatrix(ds,J.workingColorSpace,e);let t=`mat3( ${ds.elements.map(e=>e.toFixed(4))} )`;switch(J.getTransfer(e)){case ci:return[t,`LinearTransferOETF`];case li:return[t,`sRGBTransferOETF`];default:return warn(`WebGLProgram: Unsupported color space: `,e),[t,`LinearTransferOETF`]}}function getShaderErrors(e,t,n){let r=e.getShaderParameter(t,e.COMPILE_STATUS),i=(e.getShaderInfoLog(t)||``).trim();if(r&&i===``)return``;let a=/ERROR: 0:(\d+)/.exec(i);if(a){let r=parseInt(a[1]);return n.toUpperCase()+`
|
|
4118
4118
|
|
|
4119
4119
|
`+i+`
|
|
4120
4120
|
|
|
4121
4121
|
`+handleSource(e.getShaderSource(t),r)}else return i}function getTexelEncodingFunction(e,t){let n=getEncodingComponents(t);return[`vec4 ${e}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,`}`].join(`
|
|
4122
|
-
`)}const
|
|
4122
|
+
`)}const fs={1:`Linear`,2:`Reinhard`,3:`Cineon`,4:`ACESFilmic`,6:`AgX`,7:`Neutral`,5:`Custom`};function getToneMappingFunction(e,t){let n=fs[t];return n===void 0?(warn(`WebGLProgram: Unsupported toneMapping:`,t),`vec3 `+e+`( vec3 color ) { return LinearToneMapping( color ); }`):`vec3 `+e+`( vec3 color ) { return `+n+`ToneMapping( color ); }`}const ps=new K;function getLuminanceFunction(){return J.getLuminanceCoefficients(ps),[`float luminance( const in vec3 rgb ) {`,` const vec3 weights = vec3( ${ps.x.toFixed(4)}, ${ps.y.toFixed(4)}, ${ps.z.toFixed(4)} );`,` return dot( weights, rgb );`,`}`].join(`
|
|
4123
4123
|
`)}function generateVertexExtensions(e){return[e.extensionClipCullDistance?`#extension GL_ANGLE_clip_cull_distance : require`:``,e.extensionMultiDraw?`#extension GL_ANGLE_multi_draw : require`:``].filter(filterEmptyLine).join(`
|
|
4124
4124
|
`)}function generateDefines(e){let t=[];for(let n in e){let r=e[n];r!==!1&&t.push(`#define `+n+` `+r)}return t.join(`
|
|
4125
|
-
`)}function fetchAttributeLocations(e,t){let n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){let r=e.getActiveAttrib(t,i),a=r.name,o=1;r.type===e.FLOAT_MAT2&&(o=2),r.type===e.FLOAT_MAT3&&(o=3),r.type===e.FLOAT_MAT4&&(o=4),n[a]={type:r.type,location:e.getAttribLocation(t,a),locationSize:o}}return n}function filterEmptyLine(e){return e!==``}function replaceLightNums(e,t){let n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function replaceClippingPlaneNums(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const
|
|
4125
|
+
`)}function fetchAttributeLocations(e,t){let n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){let r=e.getActiveAttrib(t,i),a=r.name,o=1;r.type===e.FLOAT_MAT2&&(o=2),r.type===e.FLOAT_MAT3&&(o=3),r.type===e.FLOAT_MAT4&&(o=4),n[a]={type:r.type,location:e.getAttribLocation(t,a),locationSize:o}}return n}function filterEmptyLine(e){return e!==``}function replaceLightNums(e,t){let n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function replaceClippingPlaneNums(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const ms=/^[ \t]*#include +<([\w\d./]+)>/gm;function resolveIncludes(e){return e.replace(ms,includeReplacer)}const hs=new Map;function includeReplacer(e,t){let n=Z[t];if(n===void 0){let e=hs.get(t);if(e!==void 0)n=Z[e],warn(`WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.`,t,e);else throw Error(`THREE.WebGLProgram: Can not resolve #include <`+t+`>`)}return resolveIncludes(n)}const gs=/#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 unrollLoops(e){return e.replace(gs,loopReplacer)}function loopReplacer(e,t,n,r){let i=``;for(let e=parseInt(t);e<parseInt(n);e++)i+=r.replace(/\[\s*i\s*\]/g,`[ `+e+` ]`).replace(/UNROLLED_LOOP_INDEX/g,e);return i}function generatePrecision(e){let t=`precision ${e.precision} float;
|
|
4126
4126
|
precision ${e.precision} int;
|
|
4127
4127
|
precision ${e.precision} sampler2D;
|
|
4128
4128
|
precision ${e.precision} samplerCube;
|
|
@@ -4142,14 +4142,14 @@ void main() {
|
|
|
4142
4142
|
`;return e.precision===`highp`?t+=`
|
|
4143
4143
|
#define HIGH_PRECISION`:e.precision===`mediump`?t+=`
|
|
4144
4144
|
#define MEDIUM_PRECISION`:e.precision===`lowp`&&(t+=`
|
|
4145
|
-
#define LOW_PRECISION`),t}const
|
|
4145
|
+
#define LOW_PRECISION`),t}const _s={1:`SHADOWMAP_TYPE_PCF`,3:`SHADOWMAP_TYPE_VSM`};function generateShadowMapTypeDefine(e){return _s[e.shadowMapType]||`SHADOWMAP_TYPE_BASIC`}const vs={301:`ENVMAP_TYPE_CUBE`,302:`ENVMAP_TYPE_CUBE`,306:`ENVMAP_TYPE_CUBE_UV`};function generateEnvMapTypeDefine(e){return e.envMap===!1?`ENVMAP_TYPE_CUBE`:vs[e.envMapMode]||`ENVMAP_TYPE_CUBE`}const ys={302:`ENVMAP_MODE_REFRACTION`};function generateEnvMapModeDefine(e){return e.envMap===!1?`ENVMAP_MODE_REFLECTION`:ys[e.envMapMode]||`ENVMAP_MODE_REFLECTION`}const bs={0:`ENVMAP_BLENDING_MULTIPLY`,1:`ENVMAP_BLENDING_MIX`,2:`ENVMAP_BLENDING_ADD`};function generateEnvMapBlendingDefine(e){return e.envMap===!1?`ENVMAP_BLENDING_NONE`:bs[e.combine]||`ENVMAP_BLENDING_NONE`}function generateCubeUVSize(e){let t=e.envMapCubeUVHeight;if(t===null)return null;let n=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(2**n,112)),texelHeight:r,maxMip:n}}function WebGLProgram(e,t,n,r){let i=e.getContext(),a=n.defines,o=n.vertexShader,s=n.fragmentShader,c=generateShadowMapTypeDefine(n),l=generateEnvMapTypeDefine(n),u=generateEnvMapModeDefine(n),d=generateEnvMapBlendingDefine(n),f=generateCubeUVSize(n),p=generateVertexExtensions(n),m=generateDefines(a),h=i.createProgram(),g,_,v=n.glslVersion?`#version `+n.glslVersion+`
|
|
4146
4146
|
`:``;n.isRawShaderMaterial?(g=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m].filter(filterEmptyLine).join(`
|
|
4147
4147
|
`),g.length>0&&(g+=`
|
|
4148
4148
|
`),_=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m].filter(filterEmptyLine).join(`
|
|
4149
4149
|
`),_.length>0&&(_+=`
|
|
4150
4150
|
`)):(g=[generatePrecision(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,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.vertexNormals?`#define HAS_NORMAL`:``,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 `+c:``,n.sizeAttenuation?`#define USE_SIZEATTENUATION`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`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`,`
|
|
4151
4151
|
`].filter(filterEmptyLine).join(`
|
|
4152
|
-
`),_=[generatePrecision(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,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 `+l:``,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.packedNormalMap?`#define USE_PACKED_NORMALMAP`:``,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?`#define USE_COLOR`:``,n.vertexAlphas||n.batchingColor?`#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 `+c:``,n.premultipliedAlpha?`#define PREMULTIPLIED_ALPHA`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.numLightProbeGrids>0?`#define USE_LIGHT_PROBES_GRID`:``,n.decodeVideoTexture?`#define DECODE_VIDEO_TEXTURE`:``,n.decodeVideoTextureEmissive?`#define DECODE_VIDEO_TEXTURE_EMISSIVE`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 viewMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,n.toneMapping===0?``:`#define TONE_MAPPING`,n.toneMapping===0?``:
|
|
4152
|
+
`),_=[generatePrecision(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,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 `+l:``,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.packedNormalMap?`#define USE_PACKED_NORMALMAP`:``,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?`#define USE_COLOR`:``,n.vertexAlphas||n.batchingColor?`#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 `+c:``,n.premultipliedAlpha?`#define PREMULTIPLIED_ALPHA`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.numLightProbeGrids>0?`#define USE_LIGHT_PROBES_GRID`:``,n.decodeVideoTexture?`#define DECODE_VIDEO_TEXTURE`:``,n.decodeVideoTextureEmissive?`#define DECODE_VIDEO_TEXTURE_EMISSIVE`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 viewMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,n.toneMapping===0?``:`#define TONE_MAPPING`,n.toneMapping===0?``:Z.tonemapping_pars_fragment,n.toneMapping===0?``:getToneMappingFunction(`toneMapping`,n.toneMapping),n.dithering?`#define DITHERING`:``,n.opaque?`#define OPAQUE`:``,Z.colorspace_pars_fragment,getTexelEncodingFunction(`linearToOutputTexel`,n.outputColorSpace),getLuminanceFunction(),n.useDepthPacking?`#define DEPTH_PACKING `+n.depthPacking:``,`
|
|
4153
4153
|
`].filter(filterEmptyLine).join(`
|
|
4154
4154
|
`)),o=resolveIncludes(o),o=replaceLightNums(o,n),o=replaceClippingPlaneNums(o,n),s=resolveIncludes(s),s=replaceLightNums(s,n),s=replaceClippingPlaneNums(s,n),o=unrollLoops(o),s=unrollLoops(s),n.isRawShaderMaterial!==!0&&(v=`#version 300 es
|
|
4155
4155
|
`,g=[p,`#define attribute in`,`#define varying out`,`#define texture2D texture`].join(`
|
|
@@ -4163,7 +4163,7 @@ Material Type: `+t.type+`
|
|
|
4163
4163
|
|
|
4164
4164
|
Program Info Log: `+o+`
|
|
4165
4165
|
`+e+`
|
|
4166
|
-
`+n)}else o===``?(s===``||c===``)&&(u=!1):warn(`WebGLProgram: Program Info Log:`,o);u&&(t.diagnostics={runnable:l,programLog:o,vertexShader:{log:s,prefix:g},fragmentShader:{log:c,prefix:_}})}i.deleteShader(x),i.deleteShader(S),C=new WebGLUniforms(i,h),w=fetchAttributeLocations(i,h)}let C;this.getUniforms=function(){return C===void 0&&onFirstUse(this),C};let w;this.getAttributes=function(){return w===void 0&&onFirstUse(this),w};let T=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return T===!1&&(T=i.getProgramParameter(h,37297)),T},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(h),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Ts++,this.cacheKey=t,this.usedTimes=1,this.program=h,this.vertexShader=x,this.fragmentShader=S,this}let Is=0;var WebGLShaderCache=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,t,n){let r=this._getShaderCacheForMaterial(e);return r.has(t)===!1&&(r.add(t),t.usedTimes++),r.has(n)===!1&&(r.add(n),n.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let e of t)e.usedTimes--,e.usedTimes===0&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new WebGLShaderStage(e),t.set(e,n)),n}},WebGLShaderStage=class{constructor(e){this.id=Is++,this.code=e,this.usedTimes=0}};function isPackedRGFormat(e){return e===1030||e===37490||e===36285}function WebGLPrograms(e,t,n,r,i,a){let o=new Layers,s=new WebGLShaderCache,c=new Set,l=[],u=new Map,d=r.logarithmicDepthBuffer,f=r.precision,p={MeshDepthMaterial:`depth`,MeshDistanceMaterial:`distance`,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 getChannel(e){return c.add(e),e===0?`uv`:`uv${e}`}function getParameters(i,o,l,u,m,h){let g=u.fog,_=m.geometry,v=i.isMeshStandardMaterial||i.isMeshLambertMaterial||i.isMeshPhongMaterial?u.environment:null,y=i.isMeshStandardMaterial||i.isMeshLambertMaterial&&!i.envMap||i.isMeshPhongMaterial&&!i.envMap,b=t.get(i.envMap||v,y),x=b&&b.mapping===306?b.image.height:null,S=p[i.type];i.precision!==null&&(f=r.getMaxPrecision(i.precision),f!==i.precision&&warn(`WebGLProgram.getParameters:`,i.precision,`not supported, using`,f,`instead.`));let C=_.morphAttributes.position||_.morphAttributes.normal||_.morphAttributes.color,w=C===void 0?0:C.length,T=0;_.morphAttributes.position!==void 0&&(T=1),_.morphAttributes.normal!==void 0&&(T=2),_.morphAttributes.color!==void 0&&(T=3);let E,D,O,k;if(S){let e=ts[S];E=e.vertexShader,D=e.fragmentShader}else{E=i.vertexShader,D=i.fragmentShader;let e=s.getVertexShaderStage(i),t=s.getFragmentShaderStage(i);s.update(i,e,t),O=e.id,k=t.id}let A=e.getRenderTarget(),ee=e.state.buffers.depth.getReversed(),te=m.isInstancedMesh===!0,j=m.isBatchedMesh===!0,ne=!!i.map,re=!!i.matcap,ie=!!b,ae=!!i.aoMap,oe=!!i.lightMap,se=!!i.bumpMap&&i.wireframe===!1,ce=!!i.normalMap,le=!!i.displacementMap,ue=!!i.emissiveMap,de=!!i.metalnessMap,fe=!!i.roughnessMap,pe=i.anisotropy>0,me=i.clearcoat>0,he=i.dispersion>0,ge=i.iridescence>0,_e=i.sheen>0,ve=i.transmission>0,ye=pe&&!!i.anisotropyMap,be=me&&!!i.clearcoatMap,xe=me&&!!i.clearcoatNormalMap,Se=me&&!!i.clearcoatRoughnessMap,Ce=ge&&!!i.iridescenceMap,we=ge&&!!i.iridescenceThicknessMap,M=_e&&!!i.sheenColorMap,Te=_e&&!!i.sheenRoughnessMap,Ee=!!i.specularMap,N=!!i.specularColorMap,De=!!i.specularIntensityMap,Oe=ve&&!!i.transmissionMap,ke=ve&&!!i.thicknessMap,Ae=!!i.gradientMap,je=!!i.alphaMap,Me=i.alphaTest>0,Ne=!!i.alphaHash,Pe=!!i.extensions,Fe=0;i.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(Fe=e.toneMapping);let Ie={shaderID:S,shaderType:i.type,shaderName:i.name,vertexShader:E,fragmentShader:D,defines:i.defines,customVertexShaderID:O,customFragmentShaderID:k,isRawShaderMaterial:i.isRawShaderMaterial===!0,glslVersion:i.glslVersion,precision:f,batching:j,batchingColor:j&&m._colorsTexture!==null,instancing:te,instancingColor:te&&m.instanceColor!==null,instancingMorph:te&&m.morphTexture!==null,outputColorSpace:A===null?e.outputColorSpace:A.isXRRenderTarget===!0?A.texture.colorSpace:Fi.workingColorSpace,alphaToCoverage:!!i.alphaToCoverage,map:ne,matcap:re,envMap:ie,envMapMode:ie&&b.mapping,envMapCubeUVHeight:x,aoMap:ae,lightMap:oe,bumpMap:se,normalMap:ce,displacementMap:le,emissiveMap:ue,normalMapObjectSpace:ce&&i.normalMapType===1,normalMapTangentSpace:ce&&i.normalMapType===0,packedNormalMap:ce&&i.normalMapType===0&&isPackedRGFormat(i.normalMap.format),metalnessMap:de,roughnessMap:fe,anisotropy:pe,anisotropyMap:ye,clearcoat:me,clearcoatMap:be,clearcoatNormalMap:xe,clearcoatRoughnessMap:Se,dispersion:he,iridescence:ge,iridescenceMap:Ce,iridescenceThicknessMap:we,sheen:_e,sheenColorMap:M,sheenRoughnessMap:Te,specularMap:Ee,specularColorMap:N,specularIntensityMap:De,transmission:ve,transmissionMap:Oe,thicknessMap:ke,gradientMap:Ae,opaque:i.transparent===!1&&i.blending===1&&i.alphaToCoverage===!1,alphaMap:je,alphaTest:Me,alphaHash:Ne,combine:i.combine,mapUv:ne&&getChannel(i.map.channel),aoMapUv:ae&&getChannel(i.aoMap.channel),lightMapUv:oe&&getChannel(i.lightMap.channel),bumpMapUv:se&&getChannel(i.bumpMap.channel),normalMapUv:ce&&getChannel(i.normalMap.channel),displacementMapUv:le&&getChannel(i.displacementMap.channel),emissiveMapUv:ue&&getChannel(i.emissiveMap.channel),metalnessMapUv:de&&getChannel(i.metalnessMap.channel),roughnessMapUv:fe&&getChannel(i.roughnessMap.channel),anisotropyMapUv:ye&&getChannel(i.anisotropyMap.channel),clearcoatMapUv:be&&getChannel(i.clearcoatMap.channel),clearcoatNormalMapUv:xe&&getChannel(i.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Se&&getChannel(i.clearcoatRoughnessMap.channel),iridescenceMapUv:Ce&&getChannel(i.iridescenceMap.channel),iridescenceThicknessMapUv:we&&getChannel(i.iridescenceThicknessMap.channel),sheenColorMapUv:M&&getChannel(i.sheenColorMap.channel),sheenRoughnessMapUv:Te&&getChannel(i.sheenRoughnessMap.channel),specularMapUv:Ee&&getChannel(i.specularMap.channel),specularColorMapUv:N&&getChannel(i.specularColorMap.channel),specularIntensityMapUv:De&&getChannel(i.specularIntensityMap.channel),transmissionMapUv:Oe&&getChannel(i.transmissionMap.channel),thicknessMapUv:ke&&getChannel(i.thicknessMap.channel),alphaMapUv:je&&getChannel(i.alphaMap.channel),vertexTangents:!!_.attributes.tangent&&(ce||pe),vertexNormals:!!_.attributes.normal,vertexColors:i.vertexColors,vertexAlphas:i.vertexColors===!0&&!!_.attributes.color&&_.attributes.color.itemSize===4,pointsUvs:m.isPoints===!0&&!!_.attributes.uv&&(ne||je),fog:!!g,useFog:i.fog===!0,fogExp2:!!g&&g.isFogExp2,flatShading:i.wireframe===!1&&(i.flatShading===!0||_.attributes.normal===void 0&&ce===!1&&(i.isMeshLambertMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.isMeshPhysicalMaterial)),sizeAttenuation:i.sizeAttenuation===!0,logarithmicDepthBuffer:d,reversedDepthBuffer:ee,skinning:m.isSkinnedMesh===!0,hasPositionAttribute:_.attributes.position!==void 0,morphTargets:_.morphAttributes.position!==void 0,morphNormals:_.morphAttributes.normal!==void 0,morphColors:_.morphAttributes.color!==void 0,morphTargetsCount:w,morphTextureStride:T,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numLightProbeGrids:h.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&l.length>0,shadowMapType:e.shadowMap.type,toneMapping:Fe,decodeVideoTexture:ne&&i.map.isVideoTexture===!0&&Fi.getTransfer(i.map.colorSpace)===`srgb`,decodeVideoTextureEmissive:ue&&i.emissiveMap.isVideoTexture===!0&&Fi.getTransfer(i.emissiveMap.colorSpace)===`srgb`,premultipliedAlpha:i.premultipliedAlpha,doubleSided:i.side===2,flipSided:i.side===1,useDepthPacking:i.depthPacking>=0,depthPacking:i.depthPacking||0,index0AttributeName:i.index0AttributeName,extensionClipCullDistance:Pe&&i.extensions.clipCullDistance===!0&&n.has(`WEBGL_clip_cull_distance`),extensionMultiDraw:(Pe&&i.extensions.multiDraw===!0||j)&&n.has(`WEBGL_multi_draw`),rendererExtensionParallelShaderCompile:n.has(`KHR_parallel_shader_compile`),customProgramCacheKey:i.customProgramCacheKey()};return Ie.vertexUv1s=c.has(1),Ie.vertexUv2s=c.has(2),Ie.vertexUv3s=c.has(3),c.clear(),Ie}function getProgramCacheKey(t){let n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),t.defines!==void 0)for(let e in t.defines)n.push(e),n.push(t.defines[e]);return t.isRawShaderMaterial===!1&&(getProgramCacheKeyParameters(n,t),getProgramCacheKeyBooleans(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()}function getProgramCacheKeyParameters(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}function getProgramCacheKeyBooleans(e,t){o.disableAll(),t.instancing&&o.enable(0),t.instancingColor&&o.enable(1),t.instancingMorph&&o.enable(2),t.matcap&&o.enable(3),t.envMap&&o.enable(4),t.normalMapObjectSpace&&o.enable(5),t.normalMapTangentSpace&&o.enable(6),t.clearcoat&&o.enable(7),t.iridescence&&o.enable(8),t.alphaTest&&o.enable(9),t.vertexColors&&o.enable(10),t.vertexAlphas&&o.enable(11),t.vertexUv1s&&o.enable(12),t.vertexUv2s&&o.enable(13),t.vertexUv3s&&o.enable(14),t.vertexTangents&&o.enable(15),t.anisotropy&&o.enable(16),t.alphaHash&&o.enable(17),t.batching&&o.enable(18),t.dispersion&&o.enable(19),t.batchingColor&&o.enable(20),t.gradientMap&&o.enable(21),t.packedNormalMap&&o.enable(22),t.vertexNormals&&o.enable(23),e.push(o.mask),o.disableAll(),t.fog&&o.enable(0),t.useFog&&o.enable(1),t.flatShading&&o.enable(2),t.logarithmicDepthBuffer&&o.enable(3),t.reversedDepthBuffer&&o.enable(4),t.skinning&&o.enable(5),t.morphTargets&&o.enable(6),t.morphNormals&&o.enable(7),t.morphColors&&o.enable(8),t.premultipliedAlpha&&o.enable(9),t.shadowMapEnabled&&o.enable(10),t.doubleSided&&o.enable(11),t.flipSided&&o.enable(12),t.useDepthPacking&&o.enable(13),t.dithering&&o.enable(14),t.transmission&&o.enable(15),t.sheen&&o.enable(16),t.opaque&&o.enable(17),t.pointsUvs&&o.enable(18),t.decodeVideoTexture&&o.enable(19),t.decodeVideoTextureEmissive&&o.enable(20),t.alphaToCoverage&&o.enable(21),t.numLightProbeGrids>0&&o.enable(22),t.hasPositionAttribute&&o.enable(23),e.push(o.mask)}function getUniforms(e){let t=p[e.type],n;if(t){let e=ts[t];n=Fo.clone(e.uniforms)}else n=e.uniforms;return n}function acquireProgram(t,n){let r=u.get(n);return r===void 0?(r=new WebGLProgram(e,n,t,i),l.push(r),u.set(n,r)):++r.usedTimes,r}function releaseProgram(e){if(--e.usedTimes===0){let t=l.indexOf(e);l[t]=l[l.length-1],l.pop(),u.delete(e.cacheKey),e.destroy()}}function releaseShaderCache(e){s.remove(e)}function dispose(){s.dispose()}return{getParameters,getProgramCacheKey,getUniforms,acquireProgram,releaseProgram,releaseShaderCache,programs:l,dispose}}function WebGLProperties(){let e=new WeakMap;function has(t){return e.has(t)}function get(t){let n=e.get(t);return n===void 0&&(n={},e.set(t,n)),n}function remove(t){e.delete(t)}function update(t,n,r){e.get(t)[n]=r}function dispose(){e=new WeakMap}return{has,get,remove,update,dispose}}function painterSortStable(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.material.id===t.material.id?e.materialVariant===t.materialVariant?e.z===t.z?e.id-t.id:e.z-t.z:e.materialVariant-t.materialVariant:e.material.id-t.material.id:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function reversePainterSortStable(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.z===t.z?e.id-t.id:t.z-e.z:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function WebGLRenderList(){let e=[],t=0,n=[],r=[],i=[];function init(){t=0,n.length=0,r.length=0,i.length=0}function materialVariant(e){let t=0;return e.isInstancedMesh&&(t+=2),e.isSkinnedMesh&&(t+=1),t}function getNextRenderItem(n,r,i,a,o,s){let c=e[t];return c===void 0?(c={id:n.id,object:n,geometry:r,material:i,materialVariant:materialVariant(n),groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},e[t]=c):(c.id=n.id,c.object=n,c.geometry=r,c.material=i,c.materialVariant=materialVariant(n),c.groupOrder=a,c.renderOrder=n.renderOrder,c.z=o,c.group=s),t++,c}function push(e,t,a,o,s,c){let l=getNextRenderItem(e,t,a,o,s,c);a.transmission>0?r.push(l):a.transparent===!0?i.push(l):n.push(l)}function unshift(e,t,a,o,s,c){let l=getNextRenderItem(e,t,a,o,s,c);a.transmission>0?r.unshift(l):a.transparent===!0?i.unshift(l):n.unshift(l)}function sort(e,t,a){n.length>1&&n.sort(e||painterSortStable),r.length>1&&r.sort(t||reversePainterSortStable),i.length>1&&i.sort(t||reversePainterSortStable),a&&(n.reverse(),r.reverse(),i.reverse())}function finish(){for(let n=t,r=e.length;n<r;n++){let t=e[n];if(t.id===null)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}}return{opaque:n,transmissive:r,transparent:i,init,push,unshift,finish,sort}}function WebGLRenderLists(){let e=new WeakMap;function get(t,n){let r=e.get(t),i;return r===void 0?(i=new WebGLRenderList,e.set(t,[i])):n>=r.length?(i=new WebGLRenderList,r.push(i)):i=r[n],i}function dispose(){e=new WeakMap}return{get,dispose}}function UniformsCache(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={direction:new P,color:new Color};break;case`SpotLight`:n={position:new P,direction:new P,color:new Color,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case`PointLight`:n={position:new P,color:new Color,distance:0,decay:0};break;case`HemisphereLight`:n={direction:new P,skyColor:new Color,groundColor:new Color};break;case`RectAreaLight`:n={color:new Color,position:new P,halfWidth:new P,halfHeight:new P};break}return e[t.id]=n,n}}}function ShadowUniformsCache(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Oi};break;case`SpotLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Oi};break;case`PointLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Oi,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=n,n}}}let Ls=0;function shadowCastingAndTexturingLightsFirst(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+ +!!t.map-!!e.map}function WebGLLights(e){let t=new UniformsCache,n=ShadowUniformsCache(),r={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 e=0;e<9;e++)r.probe.push(new P);let i=new P,a=new Hi,o=new Hi;function setup(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0;i.sort(shadowCastingAndTexturingLightsFirst);for(let e=0,y=i.length;e<y;e++){let y=i[e],b=y.color,x=y.intensity,S=y.distance,C=null;if(y.shadow&&y.shadow.map&&(C=y.shadow.map.texture.format===1030?y.shadow.map.texture:y.shadow.map.depthTexture||y.shadow.map.texture),y.isAmbientLight)a+=b.r*x,o+=b.g*x,s+=b.b*x;else if(y.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(y.sh.coefficients[e],x);v++}else if(y.isDirectionalLight){let e=t.get(y);if(e.color.copy(y.color).multiplyScalar(y.intensity),y.castShadow){let e=y.shadow,t=n.get(y);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[c]=t,r.directionalShadowMap[c]=C,r.directionalShadowMatrix[c]=y.shadow.matrix,p++}r.directional[c]=e,c++}else if(y.isSpotLight){let e=t.get(y);e.position.setFromMatrixPosition(y.matrixWorld),e.color.copy(b).multiplyScalar(x),e.distance=S,e.coneCos=Math.cos(y.angle),e.penumbraCos=Math.cos(y.angle*(1-y.penumbra)),e.decay=y.decay,r.spot[u]=e;let i=y.shadow;if(y.map&&(r.spotLightMap[g]=y.map,g++,i.updateMatrices(y),y.castShadow&&_++),r.spotLightMatrix[u]=i.matrix,y.castShadow){let e=n.get(y);e.shadowIntensity=i.intensity,e.shadowBias=i.bias,e.shadowNormalBias=i.normalBias,e.shadowRadius=i.radius,e.shadowMapSize=i.mapSize,r.spotShadow[u]=e,r.spotShadowMap[u]=C,h++}u++}else if(y.isRectAreaLight){let e=t.get(y);e.color.copy(b).multiplyScalar(x),e.halfWidth.set(y.width*.5,0,0),e.halfHeight.set(0,y.height*.5,0),r.rectArea[d]=e,d++}else if(y.isPointLight){let e=t.get(y);if(e.color.copy(y.color).multiplyScalar(y.intensity),e.distance=y.distance,e.decay=y.decay,y.castShadow){let e=y.shadow,t=n.get(y);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,r.pointShadow[l]=t,r.pointShadowMap[l]=C,r.pointShadowMatrix[l]=y.shadow.matrix,m++}r.point[l]=e,l++}else if(y.isHemisphereLight){let e=t.get(y);e.skyColor.copy(y.color).multiplyScalar(x),e.groundColor.copy(y.groundColor).multiplyScalar(x),r.hemi[f]=e,f++}}d>0&&(e.has(`OES_texture_float_linear`)===!0?(r.rectAreaLTC1=F.LTC_FLOAT_1,r.rectAreaLTC2=F.LTC_FLOAT_2):(r.rectAreaLTC1=F.LTC_HALF_1,r.rectAreaLTC2=F.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;let y=r.hash;(y.directionalLength!==c||y.pointLength!==l||y.spotLength!==u||y.rectAreaLength!==d||y.hemiLength!==f||y.numDirectionalShadows!==p||y.numPointShadows!==m||y.numSpotShadows!==h||y.numSpotMaps!==g||y.numLightProbes!==v)&&(r.directional.length=c,r.spot.length=u,r.rectArea.length=d,r.point.length=l,r.hemi.length=f,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=h,r.spotShadowMap.length=h,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=m,r.spotLightMatrix.length=h+g-_,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=v,y.directionalLength=c,y.pointLength=l,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=f,y.numDirectionalShadows=p,y.numPointShadows=m,y.numSpotShadows=h,y.numSpotMaps=g,y.numLightProbes=v,r.version=Ls++)}function setupView(e,t){let n=0,s=0,c=0,l=0,u=0,d=t.matrixWorldInverse;for(let t=0,f=e.length;t<f;t++){let f=e[t];if(f.isDirectionalLight){let e=r.directional[n];e.direction.setFromMatrixPosition(f.matrixWorld),i.setFromMatrixPosition(f.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(d),n++}else if(f.isSpotLight){let e=r.spot[c];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),e.direction.setFromMatrixPosition(f.matrixWorld),i.setFromMatrixPosition(f.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(d),c++}else if(f.isRectAreaLight){let e=r.rectArea[l];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),o.identity(),a.copy(f.matrixWorld),a.premultiply(d),o.extractRotation(a),e.halfWidth.set(f.width*.5,0,0),e.halfHeight.set(0,f.height*.5,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),l++}else if(f.isPointLight){let e=r.point[s];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),s++}else if(f.isHemisphereLight){let e=r.hemi[u];e.direction.setFromMatrixPosition(f.matrixWorld),e.direction.transformDirection(d),u++}}}return{setup,setupView,state:r}}function WebGLRenderState(e){let t=new WebGLLights(e),n=[],r=[],i=[];function init(e){a.camera=e,n.length=0,r.length=0,i.length=0}function pushLight(e){n.push(e)}function pushShadow(e){r.push(e)}function pushLightProbeGrid(e){i.push(e)}function setupLights(){t.setup(n)}function setupLightsView(e){t.setupView(n,e)}let a={lightsArray:n,shadowsArray:r,lightProbeGridArray:i,camera:null,lights:t,transmissionRenderTarget:{},textureUnits:0};return{init,state:a,setupLights,setupLightsView,pushLight,pushShadow,pushLightProbeGrid}}function WebGLRenderStates(e){let t=new WeakMap;function get(n,r=0){let i=t.get(n),a;return i===void 0?(a=new WebGLRenderState(e),t.set(n,[a])):r>=i.length?(a=new WebGLRenderState(e),i.push(a)):a=i[r],a}function dispose(){t=new WeakMap}return{get,dispose}}const Rs=[new P(1,0,0),new P(-1,0,0),new P(0,1,0),new P(0,-1,0),new P(0,0,1),new P(0,0,-1)],zs=[new P(0,-1,0),new P(0,-1,0),new P(0,0,1),new P(0,0,-1),new P(0,-1,0),new P(0,-1,0)],Bs=new Hi,Vs=new P,Hs=new P;function WebGLShadowMap(e,t,n){let r=new Frustum,i=new Oi,a=new Oi,o=new Vi,s=new MeshDepthMaterial,c=new MeshDistanceMaterial,l={},u=n.maxTextureSize,d={0:1,1:0,2:2},f=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Oi},radius:{value:4}},vertexShader:`void main() {
|
|
4166
|
+
`+n)}else o===``?(s===``||c===``)&&(u=!1):warn(`WebGLProgram: Program Info Log:`,o);u&&(t.diagnostics={runnable:l,programLog:o,vertexShader:{log:s,prefix:g},fragmentShader:{log:c,prefix:_}})}i.deleteShader(x),i.deleteShader(S),C=new WebGLUniforms(i,h),w=fetchAttributeLocations(i,h)}let C;this.getUniforms=function(){return C===void 0&&onFirstUse(this),C};let w;this.getAttributes=function(){return w===void 0&&onFirstUse(this),w};let T=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return T===!1&&(T=i.getProgramParameter(h,37297)),T},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(h),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=us++,this.cacheKey=t,this.usedTimes=1,this.program=h,this.vertexShader=x,this.fragmentShader=S,this}let xs=0;var WebGLShaderCache=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,t,n){let r=this._getShaderCacheForMaterial(e);return r.has(t)===!1&&(r.add(t),t.usedTimes++),r.has(n)===!1&&(r.add(n),n.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let e of t)e.usedTimes--,e.usedTimes===0&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new WebGLShaderStage(e),t.set(e,n)),n}},WebGLShaderStage=class{constructor(e){this.id=xs++,this.code=e,this.usedTimes=0}};function isPackedRGFormat(e){return e===1030||e===37490||e===36285}function WebGLPrograms(e,t,n,r,i,a){let o=new Layers,s=new WebGLShaderCache,c=new Set,l=[],u=new Map,d=r.logarithmicDepthBuffer,f=r.precision,p={MeshDepthMaterial:`depth`,MeshDistanceMaterial:`distance`,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 getChannel(e){return c.add(e),e===0?`uv`:`uv${e}`}function getParameters(i,o,l,u,m,h){let g=u.fog,_=m.geometry,v=i.isMeshStandardMaterial||i.isMeshLambertMaterial||i.isMeshPhongMaterial?u.environment:null,y=i.isMeshStandardMaterial||i.isMeshLambertMaterial&&!i.envMap||i.isMeshPhongMaterial&&!i.envMap,b=t.get(i.envMap||v,y),x=b&&b.mapping===306?b.image.height:null,S=p[i.type];i.precision!==null&&(f=r.getMaxPrecision(i.precision),f!==i.precision&&warn(`WebGLProgram.getParameters:`,i.precision,`not supported, using`,f,`instead.`));let C=_.morphAttributes.position||_.morphAttributes.normal||_.morphAttributes.color,w=C===void 0?0:C.length,T=0;_.morphAttributes.position!==void 0&&(T=1),_.morphAttributes.normal!==void 0&&(T=2),_.morphAttributes.color!==void 0&&(T=3);let E,D,O,k;if(S){let e=Bo[S];E=e.vertexShader,D=e.fragmentShader}else{E=i.vertexShader,D=i.fragmentShader;let e=s.getVertexShaderStage(i),t=s.getFragmentShaderStage(i);s.update(i,e,t),O=e.id,k=t.id}let A=e.getRenderTarget(),ee=e.state.buffers.depth.getReversed(),j=m.isInstancedMesh===!0,M=m.isBatchedMesh===!0,N=!!i.map,te=!!i.matcap,P=!!b,ne=!!i.aoMap,re=!!i.lightMap,ie=!!i.bumpMap&&i.wireframe===!1,ae=!!i.normalMap,oe=!!i.displacementMap,se=!!i.emissiveMap,ce=!!i.metalnessMap,le=!!i.roughnessMap,ue=i.anisotropy>0,de=i.clearcoat>0,fe=i.dispersion>0,pe=i.iridescence>0,me=i.sheen>0,he=i.transmission>0,ge=ue&&!!i.anisotropyMap,_e=de&&!!i.clearcoatMap,ve=de&&!!i.clearcoatNormalMap,ye=de&&!!i.clearcoatRoughnessMap,be=pe&&!!i.iridescenceMap,xe=pe&&!!i.iridescenceThicknessMap,F=me&&!!i.sheenColorMap,Se=me&&!!i.sheenRoughnessMap,Ce=!!i.specularMap,I=!!i.specularColorMap,we=!!i.specularIntensityMap,L=he&&!!i.transmissionMap,R=he&&!!i.thicknessMap,Te=!!i.gradientMap,Ee=!!i.alphaMap,De=i.alphaTest>0,Oe=!!i.alphaHash,ke=!!i.extensions,Ae=0;i.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(Ae=e.toneMapping);let je={shaderID:S,shaderType:i.type,shaderName:i.name,vertexShader:E,fragmentShader:D,defines:i.defines,customVertexShaderID:O,customFragmentShaderID:k,isRawShaderMaterial:i.isRawShaderMaterial===!0,glslVersion:i.glslVersion,precision:f,batching:M,batchingColor:M&&m._colorsTexture!==null,instancing:j,instancingColor:j&&m.instanceColor!==null,instancingMorph:j&&m.morphTexture!==null,outputColorSpace:A===null?e.outputColorSpace:A.isXRRenderTarget===!0?A.texture.colorSpace:J.workingColorSpace,alphaToCoverage:!!i.alphaToCoverage,map:N,matcap:te,envMap:P,envMapMode:P&&b.mapping,envMapCubeUVHeight:x,aoMap:ne,lightMap:re,bumpMap:ie,normalMap:ae,displacementMap:oe,emissiveMap:se,normalMapObjectSpace:ae&&i.normalMapType===1,normalMapTangentSpace:ae&&i.normalMapType===0,packedNormalMap:ae&&i.normalMapType===0&&isPackedRGFormat(i.normalMap.format),metalnessMap:ce,roughnessMap:le,anisotropy:ue,anisotropyMap:ge,clearcoat:de,clearcoatMap:_e,clearcoatNormalMap:ve,clearcoatRoughnessMap:ye,dispersion:fe,iridescence:pe,iridescenceMap:be,iridescenceThicknessMap:xe,sheen:me,sheenColorMap:F,sheenRoughnessMap:Se,specularMap:Ce,specularColorMap:I,specularIntensityMap:we,transmission:he,transmissionMap:L,thicknessMap:R,gradientMap:Te,opaque:i.transparent===!1&&i.blending===1&&i.alphaToCoverage===!1,alphaMap:Ee,alphaTest:De,alphaHash:Oe,combine:i.combine,mapUv:N&&getChannel(i.map.channel),aoMapUv:ne&&getChannel(i.aoMap.channel),lightMapUv:re&&getChannel(i.lightMap.channel),bumpMapUv:ie&&getChannel(i.bumpMap.channel),normalMapUv:ae&&getChannel(i.normalMap.channel),displacementMapUv:oe&&getChannel(i.displacementMap.channel),emissiveMapUv:se&&getChannel(i.emissiveMap.channel),metalnessMapUv:ce&&getChannel(i.metalnessMap.channel),roughnessMapUv:le&&getChannel(i.roughnessMap.channel),anisotropyMapUv:ge&&getChannel(i.anisotropyMap.channel),clearcoatMapUv:_e&&getChannel(i.clearcoatMap.channel),clearcoatNormalMapUv:ve&&getChannel(i.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ye&&getChannel(i.clearcoatRoughnessMap.channel),iridescenceMapUv:be&&getChannel(i.iridescenceMap.channel),iridescenceThicknessMapUv:xe&&getChannel(i.iridescenceThicknessMap.channel),sheenColorMapUv:F&&getChannel(i.sheenColorMap.channel),sheenRoughnessMapUv:Se&&getChannel(i.sheenRoughnessMap.channel),specularMapUv:Ce&&getChannel(i.specularMap.channel),specularColorMapUv:I&&getChannel(i.specularColorMap.channel),specularIntensityMapUv:we&&getChannel(i.specularIntensityMap.channel),transmissionMapUv:L&&getChannel(i.transmissionMap.channel),thicknessMapUv:R&&getChannel(i.thicknessMap.channel),alphaMapUv:Ee&&getChannel(i.alphaMap.channel),vertexTangents:!!_.attributes.tangent&&(ae||ue),vertexNormals:!!_.attributes.normal,vertexColors:i.vertexColors,vertexAlphas:i.vertexColors===!0&&!!_.attributes.color&&_.attributes.color.itemSize===4,pointsUvs:m.isPoints===!0&&!!_.attributes.uv&&(N||Ee),fog:!!g,useFog:i.fog===!0,fogExp2:!!g&&g.isFogExp2,flatShading:i.wireframe===!1&&(i.flatShading===!0||_.attributes.normal===void 0&&ae===!1&&(i.isMeshLambertMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.isMeshPhysicalMaterial)),sizeAttenuation:i.sizeAttenuation===!0,logarithmicDepthBuffer:d,reversedDepthBuffer:ee,skinning:m.isSkinnedMesh===!0,hasPositionAttribute:_.attributes.position!==void 0,morphTargets:_.morphAttributes.position!==void 0,morphNormals:_.morphAttributes.normal!==void 0,morphColors:_.morphAttributes.color!==void 0,morphTargetsCount:w,morphTextureStride:T,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numLightProbeGrids:h.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&l.length>0,shadowMapType:e.shadowMap.type,toneMapping:Ae,decodeVideoTexture:N&&i.map.isVideoTexture===!0&&J.getTransfer(i.map.colorSpace)===`srgb`,decodeVideoTextureEmissive:se&&i.emissiveMap.isVideoTexture===!0&&J.getTransfer(i.emissiveMap.colorSpace)===`srgb`,premultipliedAlpha:i.premultipliedAlpha,doubleSided:i.side===2,flipSided:i.side===1,useDepthPacking:i.depthPacking>=0,depthPacking:i.depthPacking||0,index0AttributeName:i.index0AttributeName,extensionClipCullDistance:ke&&i.extensions.clipCullDistance===!0&&n.has(`WEBGL_clip_cull_distance`),extensionMultiDraw:(ke&&i.extensions.multiDraw===!0||M)&&n.has(`WEBGL_multi_draw`),rendererExtensionParallelShaderCompile:n.has(`KHR_parallel_shader_compile`),customProgramCacheKey:i.customProgramCacheKey()};return je.vertexUv1s=c.has(1),je.vertexUv2s=c.has(2),je.vertexUv3s=c.has(3),c.clear(),je}function getProgramCacheKey(t){let n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),t.defines!==void 0)for(let e in t.defines)n.push(e),n.push(t.defines[e]);return t.isRawShaderMaterial===!1&&(getProgramCacheKeyParameters(n,t),getProgramCacheKeyBooleans(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()}function getProgramCacheKeyParameters(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}function getProgramCacheKeyBooleans(e,t){o.disableAll(),t.instancing&&o.enable(0),t.instancingColor&&o.enable(1),t.instancingMorph&&o.enable(2),t.matcap&&o.enable(3),t.envMap&&o.enable(4),t.normalMapObjectSpace&&o.enable(5),t.normalMapTangentSpace&&o.enable(6),t.clearcoat&&o.enable(7),t.iridescence&&o.enable(8),t.alphaTest&&o.enable(9),t.vertexColors&&o.enable(10),t.vertexAlphas&&o.enable(11),t.vertexUv1s&&o.enable(12),t.vertexUv2s&&o.enable(13),t.vertexUv3s&&o.enable(14),t.vertexTangents&&o.enable(15),t.anisotropy&&o.enable(16),t.alphaHash&&o.enable(17),t.batching&&o.enable(18),t.dispersion&&o.enable(19),t.batchingColor&&o.enable(20),t.gradientMap&&o.enable(21),t.packedNormalMap&&o.enable(22),t.vertexNormals&&o.enable(23),e.push(o.mask),o.disableAll(),t.fog&&o.enable(0),t.useFog&&o.enable(1),t.flatShading&&o.enable(2),t.logarithmicDepthBuffer&&o.enable(3),t.reversedDepthBuffer&&o.enable(4),t.skinning&&o.enable(5),t.morphTargets&&o.enable(6),t.morphNormals&&o.enable(7),t.morphColors&&o.enable(8),t.premultipliedAlpha&&o.enable(9),t.shadowMapEnabled&&o.enable(10),t.doubleSided&&o.enable(11),t.flipSided&&o.enable(12),t.useDepthPacking&&o.enable(13),t.dithering&&o.enable(14),t.transmission&&o.enable(15),t.sheen&&o.enable(16),t.opaque&&o.enable(17),t.pointsUvs&&o.enable(18),t.decodeVideoTexture&&o.enable(19),t.decodeVideoTextureEmissive&&o.enable(20),t.alphaToCoverage&&o.enable(21),t.numLightProbeGrids>0&&o.enable(22),t.hasPositionAttribute&&o.enable(23),e.push(o.mask)}function getUniforms(e){let t=p[e.type],n;if(t){let e=Bo[t];n=xo.clone(e.uniforms)}else n=e.uniforms;return n}function acquireProgram(t,n){let r=u.get(n);return r===void 0?(r=new WebGLProgram(e,n,t,i),l.push(r),u.set(n,r)):++r.usedTimes,r}function releaseProgram(e){if(--e.usedTimes===0){let t=l.indexOf(e);l[t]=l[l.length-1],l.pop(),u.delete(e.cacheKey),e.destroy()}}function releaseShaderCache(e){s.remove(e)}function dispose(){s.dispose()}return{getParameters,getProgramCacheKey,getUniforms,acquireProgram,releaseProgram,releaseShaderCache,programs:l,dispose}}function WebGLProperties(){let e=new WeakMap;function has(t){return e.has(t)}function get(t){let n=e.get(t);return n===void 0&&(n={},e.set(t,n)),n}function remove(t){e.delete(t)}function update(t,n,r){e.get(t)[n]=r}function dispose(){e=new WeakMap}return{has,get,remove,update,dispose}}function painterSortStable(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.material.id===t.material.id?e.materialVariant===t.materialVariant?e.z===t.z?e.id-t.id:e.z-t.z:e.materialVariant-t.materialVariant:e.material.id-t.material.id:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function reversePainterSortStable(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.z===t.z?e.id-t.id:t.z-e.z:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function WebGLRenderList(){let e=[],t=0,n=[],r=[],i=[];function init(){t=0,n.length=0,r.length=0,i.length=0}function materialVariant(e){let t=0;return e.isInstancedMesh&&(t+=2),e.isSkinnedMesh&&(t+=1),t}function getNextRenderItem(n,r,i,a,o,s){let c=e[t];return c===void 0?(c={id:n.id,object:n,geometry:r,material:i,materialVariant:materialVariant(n),groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},e[t]=c):(c.id=n.id,c.object=n,c.geometry=r,c.material=i,c.materialVariant=materialVariant(n),c.groupOrder=a,c.renderOrder=n.renderOrder,c.z=o,c.group=s),t++,c}function push(e,t,a,o,s,c){let l=getNextRenderItem(e,t,a,o,s,c);a.transmission>0?r.push(l):a.transparent===!0?i.push(l):n.push(l)}function unshift(e,t,a,o,s,c){let l=getNextRenderItem(e,t,a,o,s,c);a.transmission>0?r.unshift(l):a.transparent===!0?i.unshift(l):n.unshift(l)}function sort(e,t,a){n.length>1&&n.sort(e||painterSortStable),r.length>1&&r.sort(t||reversePainterSortStable),i.length>1&&i.sort(t||reversePainterSortStable),a&&(n.reverse(),r.reverse(),i.reverse())}function finish(){for(let n=t,r=e.length;n<r;n++){let t=e[n];if(t.id===null)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}}return{opaque:n,transmissive:r,transparent:i,init,push,unshift,finish,sort}}function WebGLRenderLists(){let e=new WeakMap;function get(t,n){let r=e.get(t),i;return r===void 0?(i=new WebGLRenderList,e.set(t,[i])):n>=r.length?(i=new WebGLRenderList,r.push(i)):i=r[n],i}function dispose(){e=new WeakMap}return{get,dispose}}function UniformsCache(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={direction:new K,color:new Color};break;case`SpotLight`:n={position:new K,direction:new K,color:new Color,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case`PointLight`:n={position:new K,color:new Color,distance:0,decay:0};break;case`HemisphereLight`:n={direction:new K,skyColor:new Color,groundColor:new Color};break;case`RectAreaLight`:n={color:new Color,position:new K,halfWidth:new K,halfHeight:new K};break}return e[t.id]=n,n}}}function ShadowUniformsCache(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new G};break;case`SpotLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new G};break;case`PointLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new G,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=n,n}}}let Ss=0;function shadowCastingAndTexturingLightsFirst(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+ +!!t.map-!!e.map}function WebGLLights(e){let t=new UniformsCache,n=ShadowUniformsCache(),r={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 e=0;e<9;e++)r.probe.push(new K);let i=new K,a=new X,o=new X;function setup(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0;i.sort(shadowCastingAndTexturingLightsFirst);for(let e=0,y=i.length;e<y;e++){let y=i[e],b=y.color,x=y.intensity,S=y.distance,C=null;if(y.shadow&&y.shadow.map&&(C=y.shadow.map.texture.format===1030?y.shadow.map.texture:y.shadow.map.depthTexture||y.shadow.map.texture),y.isAmbientLight)a+=b.r*x,o+=b.g*x,s+=b.b*x;else if(y.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(y.sh.coefficients[e],x);v++}else if(y.isDirectionalLight){let e=t.get(y);if(e.color.copy(y.color).multiplyScalar(y.intensity),y.castShadow){let e=y.shadow,t=n.get(y);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[c]=t,r.directionalShadowMap[c]=C,r.directionalShadowMatrix[c]=y.shadow.matrix,p++}r.directional[c]=e,c++}else if(y.isSpotLight){let e=t.get(y);e.position.setFromMatrixPosition(y.matrixWorld),e.color.copy(b).multiplyScalar(x),e.distance=S,e.coneCos=Math.cos(y.angle),e.penumbraCos=Math.cos(y.angle*(1-y.penumbra)),e.decay=y.decay,r.spot[u]=e;let i=y.shadow;if(y.map&&(r.spotLightMap[g]=y.map,g++,i.updateMatrices(y),y.castShadow&&_++),r.spotLightMatrix[u]=i.matrix,y.castShadow){let e=n.get(y);e.shadowIntensity=i.intensity,e.shadowBias=i.bias,e.shadowNormalBias=i.normalBias,e.shadowRadius=i.radius,e.shadowMapSize=i.mapSize,r.spotShadow[u]=e,r.spotShadowMap[u]=C,h++}u++}else if(y.isRectAreaLight){let e=t.get(y);e.color.copy(b).multiplyScalar(x),e.halfWidth.set(y.width*.5,0,0),e.halfHeight.set(0,y.height*.5,0),r.rectArea[d]=e,d++}else if(y.isPointLight){let e=t.get(y);if(e.color.copy(y.color).multiplyScalar(y.intensity),e.distance=y.distance,e.decay=y.decay,y.castShadow){let e=y.shadow,t=n.get(y);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,r.pointShadow[l]=t,r.pointShadowMap[l]=C,r.pointShadowMatrix[l]=y.shadow.matrix,m++}r.point[l]=e,l++}else if(y.isHemisphereLight){let e=t.get(y);e.skyColor.copy(y.color).multiplyScalar(x),e.groundColor.copy(y.groundColor).multiplyScalar(x),r.hemi[f]=e,f++}}d>0&&(e.has(`OES_texture_float_linear`)===!0?(r.rectAreaLTC1=Q.LTC_FLOAT_1,r.rectAreaLTC2=Q.LTC_FLOAT_2):(r.rectAreaLTC1=Q.LTC_HALF_1,r.rectAreaLTC2=Q.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;let y=r.hash;(y.directionalLength!==c||y.pointLength!==l||y.spotLength!==u||y.rectAreaLength!==d||y.hemiLength!==f||y.numDirectionalShadows!==p||y.numPointShadows!==m||y.numSpotShadows!==h||y.numSpotMaps!==g||y.numLightProbes!==v)&&(r.directional.length=c,r.spot.length=u,r.rectArea.length=d,r.point.length=l,r.hemi.length=f,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=h,r.spotShadowMap.length=h,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=m,r.spotLightMatrix.length=h+g-_,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=v,y.directionalLength=c,y.pointLength=l,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=f,y.numDirectionalShadows=p,y.numPointShadows=m,y.numSpotShadows=h,y.numSpotMaps=g,y.numLightProbes=v,r.version=Ss++)}function setupView(e,t){let n=0,s=0,c=0,l=0,u=0,d=t.matrixWorldInverse;for(let t=0,f=e.length;t<f;t++){let f=e[t];if(f.isDirectionalLight){let e=r.directional[n];e.direction.setFromMatrixPosition(f.matrixWorld),i.setFromMatrixPosition(f.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(d),n++}else if(f.isSpotLight){let e=r.spot[c];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),e.direction.setFromMatrixPosition(f.matrixWorld),i.setFromMatrixPosition(f.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(d),c++}else if(f.isRectAreaLight){let e=r.rectArea[l];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),o.identity(),a.copy(f.matrixWorld),a.premultiply(d),o.extractRotation(a),e.halfWidth.set(f.width*.5,0,0),e.halfHeight.set(0,f.height*.5,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),l++}else if(f.isPointLight){let e=r.point[s];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),s++}else if(f.isHemisphereLight){let e=r.hemi[u];e.direction.setFromMatrixPosition(f.matrixWorld),e.direction.transformDirection(d),u++}}}return{setup,setupView,state:r}}function WebGLRenderState(e){let t=new WebGLLights(e),n=[],r=[],i=[];function init(e){a.camera=e,n.length=0,r.length=0,i.length=0}function pushLight(e){n.push(e)}function pushShadow(e){r.push(e)}function pushLightProbeGrid(e){i.push(e)}function setupLights(){t.setup(n)}function setupLightsView(e){t.setupView(n,e)}let a={lightsArray:n,shadowsArray:r,lightProbeGridArray:i,camera:null,lights:t,transmissionRenderTarget:{},textureUnits:0};return{init,state:a,setupLights,setupLightsView,pushLight,pushShadow,pushLightProbeGrid}}function WebGLRenderStates(e){let t=new WeakMap;function get(n,r=0){let i=t.get(n),a;return i===void 0?(a=new WebGLRenderState(e),t.set(n,[a])):r>=i.length?(a=new WebGLRenderState(e),i.push(a)):a=i[r],a}function dispose(){t=new WeakMap}return{get,dispose}}const Cs=[new K(1,0,0),new K(-1,0,0),new K(0,1,0),new K(0,-1,0),new K(0,0,1),new K(0,0,-1)],ws=[new K(0,-1,0),new K(0,-1,0),new K(0,0,1),new K(0,0,-1),new K(0,-1,0),new K(0,-1,0)],Ts=new X,Es=new K,Ds=new K;function WebGLShadowMap(e,t,n){let r=new Frustum,i=new G,a=new G,o=new Y,s=new MeshDepthMaterial,c=new MeshDistanceMaterial,l={},u=n.maxTextureSize,d={0:1,1:0,2:2},f=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new G},radius:{value:4}},vertexShader:`void main() {
|
|
4167
4167
|
gl_Position = vec4( position, 1.0 );
|
|
4168
4168
|
}`,fragmentShader:`uniform sampler2D shadow_pass;
|
|
4169
4169
|
uniform vec2 resolution;
|
|
@@ -4190,7 +4190,7 @@ void main() {
|
|
|
4190
4190
|
squared_mean = squared_mean / samples;
|
|
4191
4191
|
float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
|
|
4192
4192
|
gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
|
|
4193
|
-
}`}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let m=new oo;m.setAttribute(`position`,new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let h=new Mesh(m,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let _=this.type;this.render=function(t,n,s){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||t.length===0)return;this.type===2&&(warn(`WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead.`),this.type=1);let c=e.getRenderTarget(),l=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.state;f.setBlending(0),f.buffers.depth.getReversed()===!0?f.buffers.color.setClear(0,0,0,0):f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);let p=_!==this.type;p&&n.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let c=0,l=t.length;c<l;c++){let l=t[c],d=l.shadow;if(d===void 0){warn(`WebGLShadowMap:`,l,`has no shadow.`);continue}if(d.autoUpdate===!1&&d.needsUpdate===!1)continue;i.copy(d.mapSize);let m=d.getFrameExtents();i.multiply(m),a.copy(d.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/m.x),i.x=a.x*m.x,d.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/m.y),i.y=a.y*m.y,d.mapSize.y=a.y));let h=e.state.buffers.depth.getReversed();if(d.camera._reversedDepth=h,d.map===null||p===!0){if(d.map!==null&&(d.map.depthTexture!==null&&(d.map.depthTexture.dispose(),d.map.depthTexture=null),d.map.dispose()),this.type===3){if(l.isPointLight){warn(`WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.`);continue}d.map=new WebGLRenderTarget(i.x,i.y,{format:ai,type:Zr,minFilter:Gr,magFilter:Gr,generateMipmaps:!1}),d.map.texture.name=l.name+`.shadowMap`,d.map.depthTexture=new DepthTexture(i.x,i.y,Xr),d.map.depthTexture.name=l.name+`.shadowMapDepth`,d.map.depthTexture.format=ni,d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=Wr,d.map.depthTexture.magFilter=Wr}else l.isPointLight?(d.map=new WebGLCubeRenderTarget(i.x),d.map.depthTexture=new CubeDepthTexture(i.x,Yr)):(d.map=new WebGLRenderTarget(i.x,i.y),d.map.depthTexture=new DepthTexture(i.x,i.y,Yr)),d.map.depthTexture.name=l.name+`.shadowMap`,d.map.depthTexture.format=ni,this.type===1?(d.map.depthTexture.compareFunction=h?518:515,d.map.depthTexture.minFilter=Gr,d.map.depthTexture.magFilter=Gr):(d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=Wr,d.map.depthTexture.magFilter=Wr);d.camera.updateProjectionMatrix()}let g=d.map.isWebGLCubeRenderTarget?6:1;for(let t=0;t<g;t++){if(d.map.isWebGLCubeRenderTarget)e.setRenderTarget(d.map,t),e.clear();else{t===0&&(e.setRenderTarget(d.map),e.clear());let n=d.getViewport(t);o.set(a.x*n.x,a.y*n.y,a.x*n.z,a.y*n.w),f.viewport(o)}if(l.isPointLight){let e=d.camera,n=d.matrix,r=l.distance||e.far;r!==e.far&&(e.far=r,e.updateProjectionMatrix()),Vs.setFromMatrixPosition(l.matrixWorld),e.position.copy(Vs),Hs.copy(e.position),Hs.add(Rs[t]),e.up.copy(zs[t]),e.lookAt(Hs),e.updateMatrixWorld(),n.makeTranslation(-Vs.x,-Vs.y,-Vs.z),Bs.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),d._frustum.setFromProjectionMatrix(Bs,e.coordinateSystem,e.reversedDepth)}else d.updateMatrices(l);r=d.getFrustum(),renderObject(n,s,d.camera,l,this.type)}d.isPointLightShadow!==!0&&this.type===3&&VSMPass(d,s),d.needsUpdate=!1}_=this.type,g.needsUpdate=!1,e.setRenderTarget(c,l,d)};function VSMPass(n,r){let a=t.update(h);f.defines.VSM_SAMPLES!==n.blurSamples&&(f.defines.VSM_SAMPLES=n.blurSamples,p.defines.VSM_SAMPLES=n.blurSamples,f.needsUpdate=!0,p.needsUpdate=!0),n.mapPass===null&&(n.mapPass=new WebGLRenderTarget(i.x,i.y,{format:ai,type:Zr})),f.uniforms.shadow_pass.value=n.map.depthTexture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,a,f,h,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,a,p,h,null)}function getDepthMaterial(t,n,r,i){let a=null,o=r.isPointLight===!0?t.customDistanceMaterial:t.customDepthMaterial;if(o!==void 0)a=o;else if(a=r.isPointLight===!0?c:s,e.localClippingEnabled&&n.clipShadows===!0&&Array.isArray(n.clippingPlanes)&&n.clippingPlanes.length!==0||n.displacementMap&&n.displacementScale!==0||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||n.alphaToCoverage===!0){let e=a.uuid,t=n.uuid,r=l[e];r===void 0&&(r={},l[e]=r);let i=r[t];i===void 0&&(i=a.clone(),r[t]=i,n.addEventListener(`dispose`,onMaterialDispose)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,i===3?a.side=n.shadowSide===null?n.side:n.shadowSide:a.side=n.shadowSide===null?d[n.side]:n.shadowSide,a.alphaMap=n.alphaMap,a.alphaTest=n.alphaToCoverage===!0?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,r.isPointLight===!0&&a.isMeshDistanceMaterial===!0){let t=e.properties.get(a);t.light=r}return a}function renderObject(n,i,a,o,s){if(n.visible===!1)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===3)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);let r=t.update(n),c=n.material;if(Array.isArray(c)){let t=r.groups;for(let l=0,u=t.length;l<u;l++){let u=t[l],d=c[u.materialIndex];if(d&&d.visible){let t=getDepthMaterial(n,d,o,s);n.onBeforeShadow(e,n,i,a,r,t,u),e.renderBufferDirect(a,null,r,t,n,u),n.onAfterShadow(e,n,i,a,r,t,u)}}}else if(c.visible){let t=getDepthMaterial(n,c,o,s);n.onBeforeShadow(e,n,i,a,r,t,null),e.renderBufferDirect(a,null,r,t,n,null),n.onAfterShadow(e,n,i,a,r,t,null)}}let c=n.children;for(let e=0,t=c.length;e<t;e++)renderObject(c[e],i,a,o,s)}function onMaterialDispose(e){e.target.removeEventListener(`dispose`,onMaterialDispose);for(let t in l){let n=l[t],r=e.target.uuid;r in n&&(n[r].dispose(),delete n[r])}}}function WebGLState(e,t){function ColorBuffer(){let t=!1,n=new Vi,r=null,i=new Vi(0,0,0,0);return{setMask:function(n){r!==n&&!t&&(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){s===!0&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),i.equals(n)===!1&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}}function DepthBuffer(){let n=!1,r=!1,i=null,a=null,o=null;return{setReversed:function(e){if(r!==e){let n=t.get(`EXT_clip_control`);e?n.clipControlEXT(n.LOWER_LEFT_EXT,n.ZERO_TO_ONE_EXT):n.clipControlEXT(n.LOWER_LEFT_EXT,n.NEGATIVE_ONE_TO_ONE_EXT),r=e;let i=o;o=null,this.setClear(i)}},getReversed:function(){return r},setTest:function(t){t?enable(e.DEPTH_TEST):disable(e.DEPTH_TEST)},setMask:function(t){i!==t&&!n&&(e.depthMask(t),i=t)},setFunc:function(t){if(r&&(t=Si[t]),a!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}a=t}},setLocked:function(e){n=e},setClear:function(t){o!==t&&(o=t,r&&(t=1-t),e.clearDepth(t))},reset:function(){n=!1,i=null,a=null,o=null,r=!1}}}function StencilBuffer(){let t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(n){t||(n?enable(e.STENCIL_TEST):disable(e.STENCIL_TEST))},setMask:function(r){n!==r&&!t&&(e.stencilMask(r),n=r)},setFunc:function(t,n,o){(r!==t||i!==n||a!==o)&&(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){(o!==t||s!==n||c!==r)&&(e.stencilOp(t,n,r),o=t,s=n,c=r)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null}}}let n=new ColorBuffer,r=new DepthBuffer,i=new StencilBuffer,a=new WeakMap,o=new WeakMap,s={},c={},l={},u=new WeakMap,d=[],f=null,p=!1,m=null,h=null,g=null,_=null,v=null,y=null,b=null,x=new Color(0,0,0),S=0,C=!1,w=null,T=null,E=null,D=null,O=null,k=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),A=!1,ee=0,te=e.getParameter(e.VERSION);te.indexOf(`WebGL`)===-1?te.indexOf(`OpenGL ES`)!==-1&&(ee=parseFloat(/^OpenGL ES (\d)/.exec(te)[1]),A=ee>=2):(ee=parseFloat(/^WebGL (\d)/.exec(te)[1]),A=ee>=1);let j=null,ne={},re=e.getParameter(e.SCISSOR_BOX),ie=e.getParameter(e.VIEWPORT),ae=new Vi().fromArray(re),oe=new Vi().fromArray(ie);function createTexture(t,n,r,i){let a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o<r;o++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,i,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(n+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return o}let se={};se[e.TEXTURE_2D]=createTexture(e.TEXTURE_2D,e.TEXTURE_2D,1),se[e.TEXTURE_CUBE_MAP]=createTexture(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),se[e.TEXTURE_2D_ARRAY]=createTexture(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),se[e.TEXTURE_3D]=createTexture(e.TEXTURE_3D,e.TEXTURE_3D,1,1),n.setClear(0,0,0,1),r.setClear(1),i.setClear(0),enable(e.DEPTH_TEST),r.setFunc(3),setFlipSided(!1),setCullFace(1),enable(e.CULL_FACE),setBlending(0);function enable(t){s[t]!==!0&&(e.enable(t),s[t]=!0)}function disable(t){s[t]!==!1&&(e.disable(t),s[t]=!1)}function bindFramebuffer(t,n){return l[t]===n?!1:(e.bindFramebuffer(t,n),l[t]=n,t===e.DRAW_FRAMEBUFFER&&(l[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(l[e.DRAW_FRAMEBUFFER]=n),!0)}function drawBuffers(t,n){let r=d,i=!1;if(t){r=u.get(n),r===void 0&&(r=[],u.set(n,r));let a=t.textures;if(r.length!==a.length||r[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=a.length;t<n;t++)r[t]=e.COLOR_ATTACHMENT0+t;r.length=a.length,i=!0}}else r[0]!==e.BACK&&(r[0]=e.BACK,i=!0);i&&e.drawBuffers(r)}function useProgram(t){return f===t?!1:(e.useProgram(t),f=t,!0)}let ce={100:e.FUNC_ADD,101:e.FUNC_SUBTRACT,102:e.FUNC_REVERSE_SUBTRACT};ce[103]=e.MIN,ce[104]=e.MAX;let le={200:e.ZERO,201:e.ONE,202:e.SRC_COLOR,204:e.SRC_ALPHA,210:e.SRC_ALPHA_SATURATE,208:e.DST_COLOR,206:e.DST_ALPHA,203:e.ONE_MINUS_SRC_COLOR,205:e.ONE_MINUS_SRC_ALPHA,209:e.ONE_MINUS_DST_COLOR,207:e.ONE_MINUS_DST_ALPHA,211:e.CONSTANT_COLOR,212:e.ONE_MINUS_CONSTANT_COLOR,213:e.CONSTANT_ALPHA,214:e.ONE_MINUS_CONSTANT_ALPHA};function setBlending(t,n,r,i,a,o,s,c,l,u){if(t===0){p===!0&&(disable(e.BLEND),p=!1);return}if(p===!1&&(enable(e.BLEND),p=!0),t!==5){if(t!==m||u!==C){if((h!==100||v!==100)&&(e.blendEquation(e.FUNC_ADD),h=100,v=100),u)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ZERO,e.ONE);break;default:error(`WebGLState: Invalid blending: `,t);break}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE,e.ONE,e.ONE);break;case 3:error(`WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true`);break;case 4:error(`WebGLState: MultiplyBlending requires material.premultipliedAlpha = true`);break;default:error(`WebGLState: Invalid blending: `,t);break}g=null,_=null,y=null,b=null,x.set(0,0,0),S=0,m=t,C=u}return}a||=n,o||=r,s||=i,(n!==h||a!==v)&&(e.blendEquationSeparate(ce[n],ce[a]),h=n,v=a),(r!==g||i!==_||o!==y||s!==b)&&(e.blendFuncSeparate(le[r],le[i],le[o],le[s]),g=r,_=i,y=o,b=s),(c.equals(x)===!1||l!==S)&&(e.blendColor(c.r,c.g,c.b,l),x.copy(c),S=l),m=t,C=!1}function setMaterial(t,a){t.side===2?disable(e.CULL_FACE):enable(e.CULL_FACE);let o=t.side===1;a&&(o=!o),setFlipSided(o),t.blending===1&&t.transparent===!1?setBlending(0):setBlending(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),r.setFunc(t.depthFunc),r.setTest(t.depthTest),r.setMask(t.depthWrite),n.setMask(t.colorWrite);let s=t.stencilWrite;i.setTest(s),s&&(i.setMask(t.stencilWriteMask),i.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),i.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),setPolygonOffset(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),t.alphaToCoverage===!0?enable(e.SAMPLE_ALPHA_TO_COVERAGE):disable(e.SAMPLE_ALPHA_TO_COVERAGE)}function setFlipSided(t){w!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),w=t)}function setCullFace(t){t===0?disable(e.CULL_FACE):(enable(e.CULL_FACE),t!==T&&(t===1?e.cullFace(e.BACK):t===2?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))),T=t}function setLineWidth(t){t!==E&&(A&&e.lineWidth(t),E=t)}function setPolygonOffset(t,n,i){t?(enable(e.POLYGON_OFFSET_FILL),(D!==n||O!==i)&&(D=n,O=i,r.getReversed()&&(n=-n),e.polygonOffset(n,i))):disable(e.POLYGON_OFFSET_FILL)}function setScissorTest(t){t?enable(e.SCISSOR_TEST):disable(e.SCISSOR_TEST)}function activeTexture(t){t===void 0&&(t=e.TEXTURE0+k-1),j!==t&&(e.activeTexture(t),j=t)}function bindTexture(t,n,r){r===void 0&&(r=j===null?e.TEXTURE0+k-1:j);let i=ne[r];i===void 0&&(i={type:void 0,texture:void 0},ne[r]=i),(i.type!==t||i.texture!==n)&&(j!==r&&(e.activeTexture(r),j=r),e.bindTexture(t,n||se[t]),i.type=t,i.texture=n)}function unbindTexture(){let t=ne[j];t!==void 0&&t.type!==void 0&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)}function compressedTexImage2D(){try{e.compressedTexImage2D(...arguments)}catch(e){error(`WebGLState:`,e)}}function compressedTexImage3D(){try{e.compressedTexImage3D(...arguments)}catch(e){error(`WebGLState:`,e)}}function texSubImage2D(){try{e.texSubImage2D(...arguments)}catch(e){error(`WebGLState:`,e)}}function texSubImage3D(){try{e.texSubImage3D(...arguments)}catch(e){error(`WebGLState:`,e)}}function compressedTexSubImage2D(){try{e.compressedTexSubImage2D(...arguments)}catch(e){error(`WebGLState:`,e)}}function compressedTexSubImage3D(){try{e.compressedTexSubImage3D(...arguments)}catch(e){error(`WebGLState:`,e)}}function texStorage2D(){try{e.texStorage2D(...arguments)}catch(e){error(`WebGLState:`,e)}}function texStorage3D(){try{e.texStorage3D(...arguments)}catch(e){error(`WebGLState:`,e)}}function texImage2D(){try{e.texImage2D(...arguments)}catch(e){error(`WebGLState:`,e)}}function texImage3D(){try{e.texImage3D(...arguments)}catch(e){error(`WebGLState:`,e)}}function getParameter(t){return c[t]===void 0?e.getParameter(t):c[t]}function pixelStorei(t,n){c[t]!==n&&(e.pixelStorei(t,n),c[t]=n)}function scissor(t){ae.equals(t)===!1&&(e.scissor(t.x,t.y,t.z,t.w),ae.copy(t))}function viewport(t){oe.equals(t)===!1&&(e.viewport(t.x,t.y,t.z,t.w),oe.copy(t))}function updateUBOMapping(t,n){let r=o.get(n);r===void 0&&(r=new WeakMap,o.set(n,r));let i=r.get(t);i===void 0&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))}function uniformBlockBinding(t,n){let r=o.get(n).get(t);a.get(n)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),a.set(n,r))}function reset(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),r.setReversed(!1),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),e.pixelStorei(e.PACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),e.pixelStorei(e.PACK_ROW_LENGTH,0),e.pixelStorei(e.PACK_SKIP_PIXELS,0),e.pixelStorei(e.PACK_SKIP_ROWS,0),e.pixelStorei(e.UNPACK_ROW_LENGTH,0),e.pixelStorei(e.UNPACK_IMAGE_HEIGHT,0),e.pixelStorei(e.UNPACK_SKIP_PIXELS,0),e.pixelStorei(e.UNPACK_SKIP_ROWS,0),e.pixelStorei(e.UNPACK_SKIP_IMAGES,0),s={},c={},j=null,ne={},l={},u=new WeakMap,d=[],f=null,p=!1,m=null,h=null,g=null,_=null,v=null,y=null,b=null,x=new Color(0,0,0),S=0,C=!1,w=null,T=null,E=null,D=null,O=null,ae.set(0,0,e.canvas.width,e.canvas.height),oe.set(0,0,e.canvas.width,e.canvas.height),n.reset(),r.reset(),i.reset()}return{buffers:{color:n,depth:r,stencil:i},enable,disable,bindFramebuffer,drawBuffers,useProgram,setBlending,setMaterial,setFlipSided,setCullFace,setLineWidth,setPolygonOffset,setScissorTest,activeTexture,bindTexture,unbindTexture,compressedTexImage2D,compressedTexImage3D,texImage2D,texImage3D,pixelStorei,getParameter,updateUBOMapping,uniformBlockBinding,texStorage2D,texStorage3D,texSubImage2D,texSubImage3D,compressedTexSubImage2D,compressedTexSubImage3D,scissor,viewport,reset}}function WebGLTextures(e,t,n,r,i,a,o){let s=t.has(`WEBGL_multisampled_render_to_texture`)?t.get(`WEBGL_multisampled_render_to_texture`):null,c=typeof navigator>`u`?!1:/OculusBrowser/g.test(navigator.userAgent),l=new Oi,u=new WeakMap,d=new Set,f,p=new WeakMap,m=!1;try{m=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)!==null}catch{}function createCanvas(e,t){return m?new OffscreenCanvas(e,t):createElementNS(`canvas`)}function resizeImage(e,t,n){let r=1,i=getDimensions(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1)if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||typeof VideoFrame<`u`&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);f===void 0&&(f=createCanvas(n,a));let o=t?createCanvas(n,a):f;return o.width=n,o.height=a,o.getContext(`2d`).drawImage(e,0,0,n,a),warn(`WebGLRenderer: Texture has been resized from (`+i.width+`x`+i.height+`) to (`+n+`x`+a+`).`),o}else return`data`in e&&warn(`WebGLRenderer: Image in DataTexture is too big (`+i.width+`x`+i.height+`).`),e;return e}function textureNeedsGenerateMipmaps(e){return e.generateMipmaps}function generateMipmap(t){e.generateMipmap(t)}function getTargetType(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function getInternalFormat(n,r,i,a,o,s=!1){if(n!==null){if(e[n]!==void 0)return e[n];warn(`WebGLRenderer: Attempt to use non-existing WebGL internal format '`+n+`'`)}let c;a&&(c=t.get(`EXT_texture_norm16`),c||warn(`WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension`));let l=r;if(r===e.RED&&(i===e.FLOAT&&(l=e.R32F),i===e.HALF_FLOAT&&(l=e.R16F),i===e.UNSIGNED_BYTE&&(l=e.R8),i===e.UNSIGNED_SHORT&&c&&(l=c.R16_EXT),i===e.SHORT&&c&&(l=c.R16_SNORM_EXT)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.R8UI),i===e.UNSIGNED_SHORT&&(l=e.R16UI),i===e.UNSIGNED_INT&&(l=e.R32UI),i===e.BYTE&&(l=e.R8I),i===e.SHORT&&(l=e.R16I),i===e.INT&&(l=e.R32I)),r===e.RG&&(i===e.FLOAT&&(l=e.RG32F),i===e.HALF_FLOAT&&(l=e.RG16F),i===e.UNSIGNED_BYTE&&(l=e.RG8),i===e.UNSIGNED_SHORT&&c&&(l=c.RG16_EXT),i===e.SHORT&&c&&(l=c.RG16_SNORM_EXT)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RG8UI),i===e.UNSIGNED_SHORT&&(l=e.RG16UI),i===e.UNSIGNED_INT&&(l=e.RG32UI),i===e.BYTE&&(l=e.RG8I),i===e.SHORT&&(l=e.RG16I),i===e.INT&&(l=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RGB8UI),i===e.UNSIGNED_SHORT&&(l=e.RGB16UI),i===e.UNSIGNED_INT&&(l=e.RGB32UI),i===e.BYTE&&(l=e.RGB8I),i===e.SHORT&&(l=e.RGB16I),i===e.INT&&(l=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(l=e.RGBA16UI),i===e.UNSIGNED_INT&&(l=e.RGBA32UI),i===e.BYTE&&(l=e.RGBA8I),i===e.SHORT&&(l=e.RGBA16I),i===e.INT&&(l=e.RGBA32I)),r===e.RGB&&(i===e.UNSIGNED_SHORT&&c&&(l=c.RGB16_EXT),i===e.SHORT&&c&&(l=c.RGB16_SNORM_EXT),i===e.UNSIGNED_INT_5_9_9_9_REV&&(l=e.RGB9_E5),i===e.UNSIGNED_INT_10F_11F_11F_REV&&(l=e.R11F_G11F_B10F)),r===e.RGBA){let t=s?_i:Fi.getTransfer(o);i===e.FLOAT&&(l=e.RGBA32F),i===e.HALF_FLOAT&&(l=e.RGBA16F),i===e.UNSIGNED_BYTE&&(l=t===`srgb`?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT&&c&&(l=c.RGBA16_EXT),i===e.SHORT&&c&&(l=c.RGBA16_SNORM_EXT),i===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)}return(l===e.R16F||l===e.R32F||l===e.RG16F||l===e.RG32F||l===e.RGBA16F||l===e.RGBA32F)&&t.get(`EXT_color_buffer_float`),l}function getInternalDepthFormat(t,n){let r;return t?n===null||n===1014||n===1020?r=e.DEPTH24_STENCIL8:n===1015?r=e.DEPTH32F_STENCIL8:n===1012&&(r=e.DEPTH24_STENCIL8,warn(`DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.`)):n===null||n===1014||n===1020?r=e.DEPTH_COMPONENT24:n===1015?r=e.DEPTH_COMPONENT32F:n===1012&&(r=e.DEPTH_COMPONENT16),r}function getMipLevels(e,t){return textureNeedsGenerateMipmaps(e)===!0||e.isFramebufferTexture&&e.minFilter!==1003&&e.minFilter!==1006?Math.log2(Math.max(t.width,t.height))+1:e.mipmaps!==void 0&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function onTextureDispose(e){let t=e.target;t.removeEventListener(`dispose`,onTextureDispose),deallocateTexture(t),t.isVideoTexture&&u.delete(t),t.isHTMLTexture&&d.delete(t)}function onRenderTargetDispose(e){let t=e.target;t.removeEventListener(`dispose`,onRenderTargetDispose),deallocateRenderTarget(t)}function deallocateTexture(e){let t=r.get(e);if(t.__webglInit===void 0)return;let n=e.source,i=p.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,r.usedTimes===0&&deleteTexture(e),Object.keys(i).length===0&&p.delete(n)}r.remove(e)}function deleteTexture(t){let n=r.get(t);e.deleteTexture(n.__webglTexture);let i=t.source,a=p.get(i);delete a[n.__cacheKey],o.memory.textures--}function deallocateRenderTarget(t){let n=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r<n.__webglFramebuffer[t].length;r++)e.deleteFramebuffer(n.__webglFramebuffer[t][r]);else e.deleteFramebuffer(n.__webglFramebuffer[t]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}let i=t.textures;for(let t=0,n=i.length;t<n;t++){let n=r.get(i[t]);n.__webglTexture&&(e.deleteTexture(n.__webglTexture),o.memory.textures--),r.remove(i[t])}r.remove(t)}let h=0;function resetTextureUnits(){h=0}function getTextureUnits(){return h}function setTextureUnits(e){h=e}function allocateTextureUnit(){let e=h;return e>=i.maxTextures&&warn(`WebGLTextures: Trying to use `+e+` texture units while this GPU supports only `+i.maxTextures),h+=1,e}function getTextureCacheKey(e){let t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}function setTexture2D(t,i){let a=r.get(t);if(t.isVideoTexture&&updateVideoTexture(t),t.isRenderTargetTexture===!1&&t.isExternalTexture!==!0&&t.version>0&&a.__version!==t.version){let e=t.image;if(e===null)warn(`WebGLRenderer: Texture marked for update but no image data found.`);else if(e.complete===!1)warn(`WebGLRenderer: Texture marked for update but image is incomplete`);else{uploadTexture(a,t,i);return}}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}function setTexture2DArray(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){uploadTexture(a,t,i);return}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)}function setTexture3D(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){uploadTexture(a,t,i);return}n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)}function setTextureCube(t,i){let a=r.get(t);if(t.isCubeDepthTexture!==!0&&t.version>0&&a.__version!==t.version){uploadCubeTexture(a,t,i);return}n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture,e.TEXTURE0+i)}let g={[Vr]:e.REPEAT,[Hr]:e.CLAMP_TO_EDGE,[Ur]:e.MIRRORED_REPEAT},_={[Wr]:e.NEAREST,1004:e.NEAREST_MIPMAP_NEAREST,1005:e.NEAREST_MIPMAP_LINEAR,[Gr]:e.LINEAR,1007:e.LINEAR_MIPMAP_NEAREST,[Kr]:e.LINEAR_MIPMAP_LINEAR},v={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function setTextureParameters(n,a){if(a.type===1015&&t.has(`OES_texture_float_linear`)===!1&&(a.magFilter===1006||a.magFilter===1007||a.magFilter===1005||a.magFilter===1008||a.minFilter===1006||a.minFilter===1007||a.minFilter===1005||a.minFilter===1008)&&warn(`WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.`),e.texParameteri(n,e.TEXTURE_WRAP_S,g[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,g[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,g[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,_[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,_[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,v[a.compareFunction])),t.has(`EXT_texture_filter_anisotropic`)===!0){if(a.magFilter===1003||a.minFilter!==1005&&a.minFilter!==1008||a.type===1015&&t.has(`OES_texture_float_linear`)===!1)return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){let o=t.get(`EXT_texture_filter_anisotropic`);e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function initTexture(t,n){let r=!1;t.__webglInit===void 0&&(t.__webglInit=!0,n.addEventListener(`dispose`,onTextureDispose));let i=n.source,a=p.get(i);a===void 0&&(a={},p.set(i,a));let s=getTextureCacheKey(n);if(s!==t.__cacheKey){a[s]===void 0&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;let i=a[t.__cacheKey];i!==void 0&&(a[t.__cacheKey].usedTimes--,i.usedTimes===0&&deleteTexture(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function getRow(e,t,n){return Math.floor(Math.floor(e/n)/t)}function updateTexture(t,r,i,a){let o=t.updateRanges;if(o.length===0)n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,i,a,r.data);else{o.sort((e,t)=>e.start-t.start);let s=0;for(let e=1;e<o.length;e++){let t=o[s],n=o[e],i=t.start+t.count,a=getRow(n.start,r.width,4),c=getRow(t.start,r.width,4);n.start<=i+1&&a===c&&getRow(n.start+n.count-1,r.width,4)===a?t.count=Math.max(t.count,n.start+n.count-t.start):(++s,o[s]=n)}o.length=s+1;let c=n.getParameter(e.UNPACK_ROW_LENGTH),l=n.getParameter(e.UNPACK_SKIP_PIXELS),u=n.getParameter(e.UNPACK_SKIP_ROWS);n.pixelStorei(e.UNPACK_ROW_LENGTH,r.width);for(let t=0,s=o.length;t<s;t++){let s=o[t],c=Math.floor(s.start/4),l=Math.ceil(s.count/4),u=c%r.width,d=Math.floor(c/r.width),f=l;n.pixelStorei(e.UNPACK_SKIP_PIXELS,u),n.pixelStorei(e.UNPACK_SKIP_ROWS,d),n.texSubImage2D(e.TEXTURE_2D,0,u,d,f,1,i,a,r.data)}t.clearUpdateRanges(),n.pixelStorei(e.UNPACK_ROW_LENGTH,c),n.pixelStorei(e.UNPACK_SKIP_PIXELS,l),n.pixelStorei(e.UNPACK_SKIP_ROWS,u)}}function uploadTexture(t,o,s){let c=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(c=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(c=e.TEXTURE_3D);let l=initTexture(t,o),u=o.source;n.bindTexture(c,t.__webglTexture,e.TEXTURE0+s);let f=r.get(u);if(u.version!==f.__version||l===!0){if(n.activeTexture(e.TEXTURE0+s),!(typeof ImageBitmap<`u`&&o.image instanceof ImageBitmap)){let t=Fi.getPrimaries(Fi.workingColorSpace),r=o.colorSpace===``?null:Fi.getPrimaries(o.colorSpace),i=o.colorSpace===``||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;n.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,i)}n.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment);let t=resizeImage(o.image,!1,i.maxTextureSize);t=verifyColorSpace(o,t);let r=a.convert(o.format,o.colorSpace),p=a.convert(o.type),m=getInternalFormat(o.internalFormat,r,p,o.normalized,o.colorSpace,o.isVideoTexture);setTextureParameters(c,o);let h,g=o.mipmaps,_=o.isVideoTexture!==!0,v=f.__version===void 0||l===!0,y=u.dataReady,b=getMipLevels(o,t);if(o.isDepthTexture)m=getInternalDepthFormat(o.format===ri,o.type),v&&(_?n.texStorage2D(e.TEXTURE_2D,1,m,t.width,t.height):n.texImage2D(e.TEXTURE_2D,0,m,t.width,t.height,0,r,p,null));else if(o.isDataTexture)if(g.length>0){_&&v&&n.texStorage2D(e.TEXTURE_2D,b,m,g[0].width,g[0].height);for(let t=0,i=g.length;t<i;t++)h=g[t],_?y&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,h.width,h.height,r,p,h.data):n.texImage2D(e.TEXTURE_2D,t,m,h.width,h.height,0,r,p,h.data);o.generateMipmaps=!1}else _?(v&&n.texStorage2D(e.TEXTURE_2D,b,m,t.width,t.height),y&&updateTexture(o,t,r,p)):n.texImage2D(e.TEXTURE_2D,0,m,t.width,t.height,0,r,p,t.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){_&&v&&n.texStorage3D(e.TEXTURE_2D_ARRAY,b,m,g[0].width,g[0].height,t.depth);for(let i=0,a=g.length;i<a;i++)if(h=g[i],o.format!==1023)if(r!==null)if(_){if(y)if(o.layerUpdates.size>0){let t=getByteLength(h.width,h.height,o.format,o.type);for(let a of o.layerUpdates){let o=h.data.subarray(a*t/h.data.BYTES_PER_ELEMENT,(a+1)*t/h.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,a,h.width,h.height,1,r,o)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,h.width,h.height,t.depth,r,h.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,i,m,h.width,h.height,t.depth,0,h.data,0,0);else warn(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`);else _?y&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,h.width,h.height,t.depth,r,p,h.data):n.texImage3D(e.TEXTURE_2D_ARRAY,i,m,h.width,h.height,t.depth,0,r,p,h.data)}else{_&&v&&n.texStorage2D(e.TEXTURE_2D,b,m,g[0].width,g[0].height);for(let t=0,i=g.length;t<i;t++)h=g[t],o.format===1023?_?y&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,h.width,h.height,r,p,h.data):n.texImage2D(e.TEXTURE_2D,t,m,h.width,h.height,0,r,p,h.data):r===null?warn(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`):_?y&&n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,h.width,h.height,r,h.data):n.compressedTexImage2D(e.TEXTURE_2D,t,m,h.width,h.height,0,h.data)}else if(o.isDataArrayTexture)if(_){if(v&&n.texStorage3D(e.TEXTURE_2D_ARRAY,b,m,t.width,t.height,t.depth),y)if(o.layerUpdates.size>0){let i=getByteLength(t.width,t.height,o.format,o.type);for(let a of o.layerUpdates){let o=t.data.subarray(a*i/t.data.BYTES_PER_ELEMENT,(a+1)*i/t.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,a,t.width,t.height,1,r,p,o)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,t.width,t.height,t.depth,r,p,t.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,m,t.width,t.height,t.depth,0,r,p,t.data);else if(o.isData3DTexture)_?(v&&n.texStorage3D(e.TEXTURE_3D,b,m,t.width,t.height,t.depth),y&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,t.width,t.height,t.depth,r,p,t.data)):n.texImage3D(e.TEXTURE_3D,0,m,t.width,t.height,t.depth,0,r,p,t.data);else if(o.isFramebufferTexture){if(v)if(_)n.texStorage2D(e.TEXTURE_2D,b,m,t.width,t.height);else{let i=t.width,a=t.height;for(let t=0;t<b;t++)n.texImage2D(e.TEXTURE_2D,t,m,i,a,0,r,p,null),i>>=1,a>>=1}}else if(o.isHTMLTexture){if(`texElementImage2D`in e){let n=e.canvas;if(n.hasAttribute(`layoutsubtree`)||n.setAttribute(`layoutsubtree`,`true`),t.parentNode!==n){n.appendChild(t),d.add(o),n.onpaint=e=>{let t=e.changedElements;for(let e of d)t.includes(e.image)&&(e.needsUpdate=!0)},n.requestPaint();return}if(e.texElementImage2D.length===3)e.texElementImage2D(e.TEXTURE_2D,e.RGBA8,t);else{let n=e.RGBA,r=e.RGBA,i=e.UNSIGNED_BYTE;e.texElementImage2D(e.TEXTURE_2D,0,n,r,i,t)}e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}}else if(g.length>0){if(_&&v){let t=getDimensions(g[0]);n.texStorage2D(e.TEXTURE_2D,b,m,t.width,t.height)}for(let t=0,i=g.length;t<i;t++)h=g[t],_?y&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,r,p,h):n.texImage2D(e.TEXTURE_2D,t,m,r,p,h);o.generateMipmaps=!1}else if(_){if(v){let r=getDimensions(t);n.texStorage2D(e.TEXTURE_2D,b,m,r.width,r.height)}y&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,r,p,t)}else n.texImage2D(e.TEXTURE_2D,0,m,r,p,t);textureNeedsGenerateMipmaps(o)&&generateMipmap(c),f.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function uploadCubeTexture(t,o,s){if(o.image.length!==6)return;let c=initTexture(t,o),l=o.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+s);let u=r.get(l);if(l.version!==u.__version||c===!0){n.activeTexture(e.TEXTURE0+s);let t=Fi.getPrimaries(Fi.workingColorSpace),r=o.colorSpace===``?null:Fi.getPrimaries(o.colorSpace),d=o.colorSpace===``||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;n.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),n.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let f=o.isCompressedTexture||o.image[0].isCompressedTexture,p=o.image[0]&&o.image[0].isDataTexture,m=[];for(let e=0;e<6;e++)!f&&!p?m[e]=resizeImage(o.image[e],!0,i.maxCubemapSize):m[e]=p?o.image[e].image:o.image[e],m[e]=verifyColorSpace(o,m[e]);let h=m[0],g=a.convert(o.format,o.colorSpace),_=a.convert(o.type),v=getInternalFormat(o.internalFormat,g,_,o.normalized,o.colorSpace),y=o.isVideoTexture!==!0,b=u.__version===void 0||c===!0,x=l.dataReady,S=getMipLevels(o,h);setTextureParameters(e.TEXTURE_CUBE_MAP,o);let C;if(f){y&&b&&n.texStorage2D(e.TEXTURE_CUBE_MAP,S,v,h.width,h.height);for(let t=0;t<6;t++){C=m[t].mipmaps;for(let r=0;r<C.length;r++){let i=C[r];o.format===1023?y?x&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,g,_,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,v,i.width,i.height,0,g,_,i.data):g===null?warn(`WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()`):y?x&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,g,i.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,v,i.width,i.height,0,i.data)}}}else{if(C=o.mipmaps,y&&b){C.length>0&&S++;let t=getDimensions(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,S,v,t.width,t.height)}for(let t=0;t<6;t++)if(p){y?x&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m[t].width,m[t].height,g,_,m[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,v,m[t].width,m[t].height,0,g,_,m[t].data);for(let r=0;r<C.length;r++){let i=C[r].image[t].image;y?x&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,i.width,i.height,g,_,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,v,i.width,i.height,0,g,_,i.data)}}else{y?x&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,g,_,m[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,v,g,_,m[t]);for(let r=0;r<C.length;r++){let i=C[r];y?x&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,g,_,i.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,v,g,_,i.image[t])}}}textureNeedsGenerateMipmaps(o)&&generateMipmap(e.TEXTURE_CUBE_MAP),u.__version=l.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function setupFrameBufferTexture(t,i,o,c,l,u){let d=a.convert(o.format,o.colorSpace),f=a.convert(o.type),p=getInternalFormat(o.internalFormat,d,f,o.normalized,o.colorSpace),m=r.get(i),h=r.get(o);if(h.__renderTarget=i,!m.__hasExternalTextures){let t=Math.max(1,i.width>>u),r=Math.max(1,i.height>>u);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,u,p,t,r,i.depth,0,d,f,null):n.texImage2D(l,u,p,t,r,0,d,f,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),useMultisampledRTT(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,c,l,h.__webglTexture,0,getRenderTargetSamples(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,c,l,h.__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function setupRenderBufferStorage(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=getInternalDepthFormat(n.stencilBuffer,a),c=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;useMultisampledRTT(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,getRenderTargetSamples(n),o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,getRenderTargetSamples(n),o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,c,e.RENDERBUFFER,t)}else{let t=n.textures;for(let i=0;i<t.length;i++){let o=t[i],c=a.convert(o.format,o.colorSpace),l=a.convert(o.type),u=getInternalFormat(o.internalFormat,c,l,o.normalized,o.colorSpace);useMultisampledRTT(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,getRenderTargetSamples(n),u,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,getRenderTargetSamples(n),u,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,u,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function setupDepthTexture(t,i,o){let c=i.isWebGLCubeRenderTarget===!0;if(n.bindFramebuffer(e.FRAMEBUFFER,t),!(i.depthTexture&&i.depthTexture.isDepthTexture))throw Error(`THREE.WebGLTextures: renderTarget.depthTexture must be an instance of THREE.DepthTexture.`);let l=r.get(i.depthTexture);if(l.__renderTarget=i,(!l.__webglTexture||i.depthTexture.image.width!==i.width||i.depthTexture.image.height!==i.height)&&(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),c){if(l.__webglInit===void 0&&(l.__webglInit=!0,i.depthTexture.addEventListener(`dispose`,onTextureDispose)),l.__webglTexture===void 0){l.__webglTexture=e.createTexture(),n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),setTextureParameters(e.TEXTURE_CUBE_MAP,i.depthTexture);let t=a.convert(i.depthTexture.format),r=a.convert(i.depthTexture.type),o;i.depthTexture.format===1026?o=e.DEPTH_COMPONENT24:i.depthTexture.format===1027&&(o=e.DEPTH24_STENCIL8);for(let n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,o,i.width,i.height,0,t,r,null)}}else setTexture2D(i.depthTexture,0);let u=l.__webglTexture,d=getRenderTargetSamples(i),f=c?e.TEXTURE_CUBE_MAP_POSITIVE_X+o:e.TEXTURE_2D,p=i.depthTexture.format===1027?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;if(i.depthTexture.format===1026)useMultisampledRTT(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,p,f,u,0,d):e.framebufferTexture2D(e.FRAMEBUFFER,p,f,u,0);else if(i.depthTexture.format===1027)useMultisampledRTT(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,p,f,u,0,d):e.framebufferTexture2D(e.FRAMEBUFFER,p,f,u,0);else throw Error(`THREE.WebGLTextures: Unknown depthTexture format.`)}function setupDepthRenderbuffer(t){let i=r.get(t),a=t.isWebGLCubeRenderTarget===!0;if(i.__boundDepthTexture!==t.depthTexture){let e=t.depthTexture;if(i.__depthDisposeCallback&&i.__depthDisposeCallback(),e){let disposeEvent=()=>{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener(`dispose`,disposeEvent)};e.addEventListener(`dispose`,disposeEvent),i.__depthDisposeCallback=disposeEvent}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer)if(a)for(let e=0;e<6;e++)setupDepthTexture(i.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?setupDepthTexture(i.__webglFramebuffer[0],t,0):setupDepthTexture(i.__webglFramebuffer,t,0)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]===void 0)i.__webglDepthbuffer[r]=e.createRenderbuffer(),setupRenderBufferStorage(i.__webglDepthbuffer[r],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let r=t.texture.mipmaps;if(r&&r.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer===void 0)i.__webglDepthbuffer=e.createRenderbuffer(),setupRenderBufferStorage(i.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}function rebindTextures(t,n,i){let a=r.get(t);n!==void 0&&setupFrameBufferTexture(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),i!==void 0&&setupDepthRenderbuffer(t)}function setupRenderTarget(t){let i=t.texture,s=r.get(t),c=r.get(i);t.addEventListener(`dispose`,onRenderTargetDispose);let l=t.textures,u=t.isWebGLCubeRenderTarget===!0,d=l.length>1;if(d||(c.__webglTexture===void 0&&(c.__webglTexture=e.createTexture()),c.__version=i.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n<i.mipmaps.length;n++)s.__webglFramebuffer[t][n]=e.createFramebuffer()}else s.__webglFramebuffer[t]=e.createFramebuffer()}else{if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer=[];for(let t=0;t<i.mipmaps.length;t++)s.__webglFramebuffer[t]=e.createFramebuffer()}else s.__webglFramebuffer=e.createFramebuffer();if(d)for(let t=0,n=l.length;t<n;t++){let n=r.get(l[t]);n.__webglTexture===void 0&&(n.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&useMultisampledRTT(t)===!1){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n<l.length;n++){let r=l[n];s.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,s.__webglColorRenderbuffer[n]);let i=a.convert(r.format,r.colorSpace),o=a.convert(r.type),c=getInternalFormat(r.internalFormat,i,o,r.normalized,r.colorSpace,t.isXRRenderTarget===!0),u=getRenderTargetSamples(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,u,c,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,s.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),setupRenderBufferStorage(s.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(u){n.bindTexture(e.TEXTURE_CUBE_MAP,c.__webglTexture),setTextureParameters(e.TEXTURE_CUBE_MAP,i);for(let n=0;n<6;n++)if(i.mipmaps&&i.mipmaps.length>0)for(let r=0;r<i.mipmaps.length;r++)setupFrameBufferTexture(s.__webglFramebuffer[n][r],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else setupFrameBufferTexture(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);textureNeedsGenerateMipmaps(i)&&generateMipmap(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(d){for(let i=0,a=l.length;i<a;i++){let a=l[i],o=r.get(a),c=e.TEXTURE_2D;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(c=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(c,o.__webglTexture),setTextureParameters(c,a),setupFrameBufferTexture(s.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+i,c,0),textureNeedsGenerateMipmaps(a)&&generateMipmap(c)}n.unbindTexture()}else{let r=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(r,c.__webglTexture),setTextureParameters(r,i),i.mipmaps&&i.mipmaps.length>0)for(let n=0;n<i.mipmaps.length;n++)setupFrameBufferTexture(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,r,n);else setupFrameBufferTexture(s.__webglFramebuffer,t,i,e.COLOR_ATTACHMENT0,r,0);textureNeedsGenerateMipmaps(i)&&generateMipmap(r),n.unbindTexture()}t.depthBuffer&&setupDepthRenderbuffer(t)}function updateRenderTargetMipmap(e){let t=e.textures;for(let i=0,a=t.length;i<a;i++){let a=t[i];if(textureNeedsGenerateMipmaps(a)){let t=getTargetType(e),i=r.get(a).__webglTexture;n.bindTexture(t,i),generateMipmap(t),n.unbindTexture()}}}let y=[],b=[];function updateMultisampleRenderTarget(t){if(t.samples>0){if(useMultisampledRTT(t)===!1){let i=t.textures,a=t.width,o=t.height,s=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),d=i.length>1;if(d)for(let t=0;t<i.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer);let f=t.texture.mipmaps;f&&f.length>0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<i.length;n++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(s|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(s|=e.STENCIL_BUFFER_BIT)),d){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,u.__webglColorRenderbuffer[n]);let t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,o,0,0,a,o,s,e.NEAREST),c===!0&&(y.length=0,b.length=0,y.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&t.resolveDepthBuffer===!1&&(y.push(l),b.push(l),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,b)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,y))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),d)for(let t=0;t<i.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,u.__webglColorRenderbuffer[t]);let a=r.get(i[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&t.resolveDepthBuffer===!1&&c){let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}}}function getRenderTargetSamples(e){return Math.min(i.maxSamples,e.samples)}function useMultisampledRTT(e){let n=r.get(e);return e.samples>0&&t.has(`WEBGL_multisampled_render_to_texture`)===!0&&n.__useRenderToTexture!==!1}function updateVideoTexture(e){let t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}function verifyColorSpace(e,t){let n=e.colorSpace,r=e.format,i=e.type;return e.isCompressedTexture===!0||e.isVideoTexture===!0||n!==`srgb-linear`&&n!==``&&(Fi.getTransfer(n)===`srgb`?(r!==1023||i!==1009)&&warn(`WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.`):error(`WebGLTextures: Unsupported texture color space:`,n)),t}function getDimensions(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement?(l.width=e.naturalWidth||e.width,l.height=e.naturalHeight||e.height):typeof VideoFrame<`u`&&e instanceof VideoFrame?(l.width=e.displayWidth,l.height=e.displayHeight):(l.width=e.width,l.height=e.height),l}this.allocateTextureUnit=allocateTextureUnit,this.resetTextureUnits=resetTextureUnits,this.getTextureUnits=getTextureUnits,this.setTextureUnits=setTextureUnits,this.setTexture2D=setTexture2D,this.setTexture2DArray=setTexture2DArray,this.setTexture3D=setTexture3D,this.setTextureCube=setTextureCube,this.rebindTextures=rebindTextures,this.setupRenderTarget=setupRenderTarget,this.updateRenderTargetMipmap=updateRenderTargetMipmap,this.updateMultisampleRenderTarget=updateMultisampleRenderTarget,this.setupDepthRenderbuffer=setupDepthRenderbuffer,this.setupFrameBufferTexture=setupFrameBufferTexture,this.useMultisampledRTT=useMultisampledRTT,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function WebGLUtils(e,t){function convert(n,r=``){let i,a=Fi.getTransfer(r);if(n===1009)return e.UNSIGNED_BYTE;if(n===1017)return e.UNSIGNED_SHORT_4_4_4_4;if(n===1018)return e.UNSIGNED_SHORT_5_5_5_1;if(n===35902)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===35899)return e.UNSIGNED_INT_10F_11F_11F_REV;if(n===1010)return e.BYTE;if(n===1011)return e.SHORT;if(n===1012)return e.UNSIGNED_SHORT;if(n===1013)return e.INT;if(n===1014)return e.UNSIGNED_INT;if(n===1015)return e.FLOAT;if(n===1016)return e.HALF_FLOAT;if(n===1021)return e.ALPHA;if(n===1022)return e.RGB;if(n===1023)return e.RGBA;if(n===1026)return e.DEPTH_COMPONENT;if(n===1027)return e.DEPTH_STENCIL;if(n===1028)return e.RED;if(n===1029)return e.RED_INTEGER;if(n===1030)return e.RG;if(n===1031)return e.RG_INTEGER;if(n===1033)return e.RGBA_INTEGER;if(n===33776||n===33777||n===33778||n===33779)if(a===`srgb`)if(i=t.get(`WEBGL_compressed_texture_s3tc_srgb`),i!==null){if(n===33776)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(i=t.get(`WEBGL_compressed_texture_s3tc`),i!==null){if(n===33776)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===35840||n===35841||n===35842||n===35843)if(i=t.get(`WEBGL_compressed_texture_pvrtc`),i!==null){if(n===35840)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===35841)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===35842)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===35843)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===36196||n===37492||n===37496||n===37488||n===37489||n===37490||n===37491)if(i=t.get(`WEBGL_compressed_texture_etc`),i!==null){if(n===36196||n===37492)return a===`srgb`?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===37496)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC;if(n===37488)return i.COMPRESSED_R11_EAC;if(n===37489)return i.COMPRESSED_SIGNED_R11_EAC;if(n===37490)return i.COMPRESSED_RG11_EAC;if(n===37491)return i.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===37808||n===37809||n===37810||n===37811||n===37812||n===37813||n===37814||n===37815||n===37816||n===37817||n===37818||n===37819||n===37820||n===37821)if(i=t.get(`WEBGL_compressed_texture_astc`),i!==null){if(n===37808)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===37809)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===37810)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===37811)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===37812)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===37813)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===37814)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===37815)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===37816)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===37817)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===37818)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===37819)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===37820)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===37821)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===36492||n===36494||n===36495)if(i=t.get(`EXT_texture_compression_bptc`),i!==null){if(n===36492)return a===`srgb`?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===36494)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===36495)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===36283||n===36284||n===36285||n===36286)if(i=t.get(`EXT_texture_compression_rgtc`),i!==null){if(n===36283)return i.COMPRESSED_RED_RGTC1_EXT;if(n===36284)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===36285)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===36286)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===1020?e.UNSIGNED_INT_24_8:e[n]===void 0?null:e[n]}return{convert}}var WebXRDepthSensing=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let n=new ExternalTexture(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new ShaderMaterial({vertexShader:`
|
|
4193
|
+
}`}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let m=new Ka;m.setAttribute(`position`,new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let h=new Mesh(m,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let _=this.type;this.render=function(t,n,s){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||t.length===0)return;this.type===2&&(warn(`WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead.`),this.type=1);let c=e.getRenderTarget(),l=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.state;f.setBlending(0),f.buffers.depth.getReversed()===!0?f.buffers.color.setClear(0,0,0,0):f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);let p=_!==this.type;p&&n.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let c=0,l=t.length;c<l;c++){let l=t[c],d=l.shadow;if(d===void 0){warn(`WebGLShadowMap:`,l,`has no shadow.`);continue}if(d.autoUpdate===!1&&d.needsUpdate===!1)continue;i.copy(d.mapSize);let m=d.getFrameExtents();i.multiply(m),a.copy(d.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/m.x),i.x=a.x*m.x,d.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/m.y),i.y=a.y*m.y,d.mapSize.y=a.y));let h=e.state.buffers.depth.getReversed();if(d.camera._reversedDepth=h,d.map===null||p===!0){if(d.map!==null&&(d.map.depthTexture!==null&&(d.map.depthTexture.dispose(),d.map.depthTexture=null),d.map.dispose()),this.type===3){if(l.isPointLight){warn(`WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.`);continue}d.map=new WebGLRenderTarget(i.x,i.y,{format:Xr,type:Hr,minFilter:Ir,magFilter:Ir,generateMipmaps:!1}),d.map.texture.name=l.name+`.shadowMap`,d.map.depthTexture=new DepthTexture(i.x,i.y,Vr),d.map.depthTexture.name=l.name+`.shadowMapDepth`,d.map.depthTexture.format=qr,d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=Fr,d.map.depthTexture.magFilter=Fr}else l.isPointLight?(d.map=new WebGLCubeRenderTarget(i.x),d.map.depthTexture=new CubeDepthTexture(i.x,Br)):(d.map=new WebGLRenderTarget(i.x,i.y),d.map.depthTexture=new DepthTexture(i.x,i.y,Br)),d.map.depthTexture.name=l.name+`.shadowMap`,d.map.depthTexture.format=qr,this.type===1?(d.map.depthTexture.compareFunction=h?518:515,d.map.depthTexture.minFilter=Ir,d.map.depthTexture.magFilter=Ir):(d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=Fr,d.map.depthTexture.magFilter=Fr);d.camera.updateProjectionMatrix()}let g=d.map.isWebGLCubeRenderTarget?6:1;for(let t=0;t<g;t++){if(d.map.isWebGLCubeRenderTarget)e.setRenderTarget(d.map,t),e.clear();else{t===0&&(e.setRenderTarget(d.map),e.clear());let n=d.getViewport(t);o.set(a.x*n.x,a.y*n.y,a.x*n.z,a.y*n.w),f.viewport(o)}if(l.isPointLight){let e=d.camera,n=d.matrix,r=l.distance||e.far;r!==e.far&&(e.far=r,e.updateProjectionMatrix()),Es.setFromMatrixPosition(l.matrixWorld),e.position.copy(Es),Ds.copy(e.position),Ds.add(Cs[t]),e.up.copy(ws[t]),e.lookAt(Ds),e.updateMatrixWorld(),n.makeTranslation(-Es.x,-Es.y,-Es.z),Ts.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),d._frustum.setFromProjectionMatrix(Ts,e.coordinateSystem,e.reversedDepth)}else d.updateMatrices(l);r=d.getFrustum(),renderObject(n,s,d.camera,l,this.type)}d.isPointLightShadow!==!0&&this.type===3&&VSMPass(d,s),d.needsUpdate=!1}_=this.type,g.needsUpdate=!1,e.setRenderTarget(c,l,d)};function VSMPass(n,r){let a=t.update(h);f.defines.VSM_SAMPLES!==n.blurSamples&&(f.defines.VSM_SAMPLES=n.blurSamples,p.defines.VSM_SAMPLES=n.blurSamples,f.needsUpdate=!0,p.needsUpdate=!0),n.mapPass===null&&(n.mapPass=new WebGLRenderTarget(i.x,i.y,{format:Xr,type:Hr})),f.uniforms.shadow_pass.value=n.map.depthTexture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,a,f,h,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,a,p,h,null)}function getDepthMaterial(t,n,r,i){let a=null,o=r.isPointLight===!0?t.customDistanceMaterial:t.customDepthMaterial;if(o!==void 0)a=o;else if(a=r.isPointLight===!0?c:s,e.localClippingEnabled&&n.clipShadows===!0&&Array.isArray(n.clippingPlanes)&&n.clippingPlanes.length!==0||n.displacementMap&&n.displacementScale!==0||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||n.alphaToCoverage===!0){let e=a.uuid,t=n.uuid,r=l[e];r===void 0&&(r={},l[e]=r);let i=r[t];i===void 0&&(i=a.clone(),r[t]=i,n.addEventListener(`dispose`,onMaterialDispose)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,i===3?a.side=n.shadowSide===null?n.side:n.shadowSide:a.side=n.shadowSide===null?d[n.side]:n.shadowSide,a.alphaMap=n.alphaMap,a.alphaTest=n.alphaToCoverage===!0?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,r.isPointLight===!0&&a.isMeshDistanceMaterial===!0){let t=e.properties.get(a);t.light=r}return a}function renderObject(n,i,a,o,s){if(n.visible===!1)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===3)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);let r=t.update(n),c=n.material;if(Array.isArray(c)){let t=r.groups;for(let l=0,u=t.length;l<u;l++){let u=t[l],d=c[u.materialIndex];if(d&&d.visible){let t=getDepthMaterial(n,d,o,s);n.onBeforeShadow(e,n,i,a,r,t,u),e.renderBufferDirect(a,null,r,t,n,u),n.onAfterShadow(e,n,i,a,r,t,u)}}}else if(c.visible){let t=getDepthMaterial(n,c,o,s);n.onBeforeShadow(e,n,i,a,r,t,null),e.renderBufferDirect(a,null,r,t,n,null),n.onAfterShadow(e,n,i,a,r,t,null)}}let c=n.children;for(let e=0,t=c.length;e<t;e++)renderObject(c[e],i,a,o,s)}function onMaterialDispose(e){e.target.removeEventListener(`dispose`,onMaterialDispose);for(let t in l){let n=l[t],r=e.target.uuid;r in n&&(n[r].dispose(),delete n[r])}}}function WebGLState(e,t){function ColorBuffer(){let t=!1,n=new Y,r=null,i=new Y(0,0,0,0);return{setMask:function(n){r!==n&&!t&&(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){s===!0&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),i.equals(n)===!1&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}}function DepthBuffer(){let n=!1,r=!1,i=null,a=null,o=null;return{setReversed:function(e){if(r!==e){let n=t.get(`EXT_clip_control`);e?n.clipControlEXT(n.LOWER_LEFT_EXT,n.ZERO_TO_ONE_EXT):n.clipControlEXT(n.LOWER_LEFT_EXT,n.NEGATIVE_ONE_TO_ONE_EXT),r=e;let i=o;o=null,this.setClear(i)}},getReversed:function(){return r},setTest:function(t){t?enable(e.DEPTH_TEST):disable(e.DEPTH_TEST)},setMask:function(t){i!==t&&!n&&(e.depthMask(t),i=t)},setFunc:function(t){if(r&&(t=pi[t]),a!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}a=t}},setLocked:function(e){n=e},setClear:function(t){o!==t&&(o=t,r&&(t=1-t),e.clearDepth(t))},reset:function(){n=!1,i=null,a=null,o=null,r=!1}}}function StencilBuffer(){let t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(n){t||(n?enable(e.STENCIL_TEST):disable(e.STENCIL_TEST))},setMask:function(r){n!==r&&!t&&(e.stencilMask(r),n=r)},setFunc:function(t,n,o){(r!==t||i!==n||a!==o)&&(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){(o!==t||s!==n||c!==r)&&(e.stencilOp(t,n,r),o=t,s=n,c=r)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null}}}let n=new ColorBuffer,r=new DepthBuffer,i=new StencilBuffer,a=new WeakMap,o=new WeakMap,s={},c={},l={},u=new WeakMap,d=[],f=null,p=!1,m=null,h=null,g=null,_=null,v=null,y=null,b=null,x=new Color(0,0,0),S=0,C=!1,w=null,T=null,E=null,D=null,O=null,k=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),A=!1,ee=0,j=e.getParameter(e.VERSION);j.indexOf(`WebGL`)===-1?j.indexOf(`OpenGL ES`)!==-1&&(ee=parseFloat(/^OpenGL ES (\d)/.exec(j)[1]),A=ee>=2):(ee=parseFloat(/^WebGL (\d)/.exec(j)[1]),A=ee>=1);let M=null,N={},te=e.getParameter(e.SCISSOR_BOX),P=e.getParameter(e.VIEWPORT),ne=new Y().fromArray(te),re=new Y().fromArray(P);function createTexture(t,n,r,i){let a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o<r;o++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,i,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(n+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return o}let ie={};ie[e.TEXTURE_2D]=createTexture(e.TEXTURE_2D,e.TEXTURE_2D,1),ie[e.TEXTURE_CUBE_MAP]=createTexture(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),ie[e.TEXTURE_2D_ARRAY]=createTexture(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),ie[e.TEXTURE_3D]=createTexture(e.TEXTURE_3D,e.TEXTURE_3D,1,1),n.setClear(0,0,0,1),r.setClear(1),i.setClear(0),enable(e.DEPTH_TEST),r.setFunc(3),setFlipSided(!1),setCullFace(1),enable(e.CULL_FACE),setBlending(0);function enable(t){s[t]!==!0&&(e.enable(t),s[t]=!0)}function disable(t){s[t]!==!1&&(e.disable(t),s[t]=!1)}function bindFramebuffer(t,n){return l[t]===n?!1:(e.bindFramebuffer(t,n),l[t]=n,t===e.DRAW_FRAMEBUFFER&&(l[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(l[e.DRAW_FRAMEBUFFER]=n),!0)}function drawBuffers(t,n){let r=d,i=!1;if(t){r=u.get(n),r===void 0&&(r=[],u.set(n,r));let a=t.textures;if(r.length!==a.length||r[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=a.length;t<n;t++)r[t]=e.COLOR_ATTACHMENT0+t;r.length=a.length,i=!0}}else r[0]!==e.BACK&&(r[0]=e.BACK,i=!0);i&&e.drawBuffers(r)}function useProgram(t){return f===t?!1:(e.useProgram(t),f=t,!0)}let ae={100:e.FUNC_ADD,101:e.FUNC_SUBTRACT,102:e.FUNC_REVERSE_SUBTRACT};ae[103]=e.MIN,ae[104]=e.MAX;let oe={200:e.ZERO,201:e.ONE,202:e.SRC_COLOR,204:e.SRC_ALPHA,210:e.SRC_ALPHA_SATURATE,208:e.DST_COLOR,206:e.DST_ALPHA,203:e.ONE_MINUS_SRC_COLOR,205:e.ONE_MINUS_SRC_ALPHA,209:e.ONE_MINUS_DST_COLOR,207:e.ONE_MINUS_DST_ALPHA,211:e.CONSTANT_COLOR,212:e.ONE_MINUS_CONSTANT_COLOR,213:e.CONSTANT_ALPHA,214:e.ONE_MINUS_CONSTANT_ALPHA};function setBlending(t,n,r,i,a,o,s,c,l,u){if(t===0){p===!0&&(disable(e.BLEND),p=!1);return}if(p===!1&&(enable(e.BLEND),p=!0),t!==5){if(t!==m||u!==C){if((h!==100||v!==100)&&(e.blendEquation(e.FUNC_ADD),h=100,v=100),u)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ZERO,e.ONE);break;default:error(`WebGLState: Invalid blending: `,t);break}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE,e.ONE,e.ONE);break;case 3:error(`WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true`);break;case 4:error(`WebGLState: MultiplyBlending requires material.premultipliedAlpha = true`);break;default:error(`WebGLState: Invalid blending: `,t);break}g=null,_=null,y=null,b=null,x.set(0,0,0),S=0,m=t,C=u}return}a||=n,o||=r,s||=i,(n!==h||a!==v)&&(e.blendEquationSeparate(ae[n],ae[a]),h=n,v=a),(r!==g||i!==_||o!==y||s!==b)&&(e.blendFuncSeparate(oe[r],oe[i],oe[o],oe[s]),g=r,_=i,y=o,b=s),(c.equals(x)===!1||l!==S)&&(e.blendColor(c.r,c.g,c.b,l),x.copy(c),S=l),m=t,C=!1}function setMaterial(t,a){t.side===2?disable(e.CULL_FACE):enable(e.CULL_FACE);let o=t.side===1;a&&(o=!o),setFlipSided(o),t.blending===1&&t.transparent===!1?setBlending(0):setBlending(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),r.setFunc(t.depthFunc),r.setTest(t.depthTest),r.setMask(t.depthWrite),n.setMask(t.colorWrite);let s=t.stencilWrite;i.setTest(s),s&&(i.setMask(t.stencilWriteMask),i.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),i.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),setPolygonOffset(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),t.alphaToCoverage===!0?enable(e.SAMPLE_ALPHA_TO_COVERAGE):disable(e.SAMPLE_ALPHA_TO_COVERAGE)}function setFlipSided(t){w!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),w=t)}function setCullFace(t){t===0?disable(e.CULL_FACE):(enable(e.CULL_FACE),t!==T&&(t===1?e.cullFace(e.BACK):t===2?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))),T=t}function setLineWidth(t){t!==E&&(A&&e.lineWidth(t),E=t)}function setPolygonOffset(t,n,i){t?(enable(e.POLYGON_OFFSET_FILL),(D!==n||O!==i)&&(D=n,O=i,r.getReversed()&&(n=-n),e.polygonOffset(n,i))):disable(e.POLYGON_OFFSET_FILL)}function setScissorTest(t){t?enable(e.SCISSOR_TEST):disable(e.SCISSOR_TEST)}function activeTexture(t){t===void 0&&(t=e.TEXTURE0+k-1),M!==t&&(e.activeTexture(t),M=t)}function bindTexture(t,n,r){r===void 0&&(r=M===null?e.TEXTURE0+k-1:M);let i=N[r];i===void 0&&(i={type:void 0,texture:void 0},N[r]=i),(i.type!==t||i.texture!==n)&&(M!==r&&(e.activeTexture(r),M=r),e.bindTexture(t,n||ie[t]),i.type=t,i.texture=n)}function unbindTexture(){let t=N[M];t!==void 0&&t.type!==void 0&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)}function compressedTexImage2D(){try{e.compressedTexImage2D(...arguments)}catch(e){error(`WebGLState:`,e)}}function compressedTexImage3D(){try{e.compressedTexImage3D(...arguments)}catch(e){error(`WebGLState:`,e)}}function texSubImage2D(){try{e.texSubImage2D(...arguments)}catch(e){error(`WebGLState:`,e)}}function texSubImage3D(){try{e.texSubImage3D(...arguments)}catch(e){error(`WebGLState:`,e)}}function compressedTexSubImage2D(){try{e.compressedTexSubImage2D(...arguments)}catch(e){error(`WebGLState:`,e)}}function compressedTexSubImage3D(){try{e.compressedTexSubImage3D(...arguments)}catch(e){error(`WebGLState:`,e)}}function texStorage2D(){try{e.texStorage2D(...arguments)}catch(e){error(`WebGLState:`,e)}}function texStorage3D(){try{e.texStorage3D(...arguments)}catch(e){error(`WebGLState:`,e)}}function texImage2D(){try{e.texImage2D(...arguments)}catch(e){error(`WebGLState:`,e)}}function texImage3D(){try{e.texImage3D(...arguments)}catch(e){error(`WebGLState:`,e)}}function getParameter(t){return c[t]===void 0?e.getParameter(t):c[t]}function pixelStorei(t,n){c[t]!==n&&(e.pixelStorei(t,n),c[t]=n)}function scissor(t){ne.equals(t)===!1&&(e.scissor(t.x,t.y,t.z,t.w),ne.copy(t))}function viewport(t){re.equals(t)===!1&&(e.viewport(t.x,t.y,t.z,t.w),re.copy(t))}function updateUBOMapping(t,n){let r=o.get(n);r===void 0&&(r=new WeakMap,o.set(n,r));let i=r.get(t);i===void 0&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))}function uniformBlockBinding(t,n){let r=o.get(n).get(t);a.get(n)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),a.set(n,r))}function reset(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),r.setReversed(!1),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),e.pixelStorei(e.PACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),e.pixelStorei(e.PACK_ROW_LENGTH,0),e.pixelStorei(e.PACK_SKIP_PIXELS,0),e.pixelStorei(e.PACK_SKIP_ROWS,0),e.pixelStorei(e.UNPACK_ROW_LENGTH,0),e.pixelStorei(e.UNPACK_IMAGE_HEIGHT,0),e.pixelStorei(e.UNPACK_SKIP_PIXELS,0),e.pixelStorei(e.UNPACK_SKIP_ROWS,0),e.pixelStorei(e.UNPACK_SKIP_IMAGES,0),s={},c={},M=null,N={},l={},u=new WeakMap,d=[],f=null,p=!1,m=null,h=null,g=null,_=null,v=null,y=null,b=null,x=new Color(0,0,0),S=0,C=!1,w=null,T=null,E=null,D=null,O=null,ne.set(0,0,e.canvas.width,e.canvas.height),re.set(0,0,e.canvas.width,e.canvas.height),n.reset(),r.reset(),i.reset()}return{buffers:{color:n,depth:r,stencil:i},enable,disable,bindFramebuffer,drawBuffers,useProgram,setBlending,setMaterial,setFlipSided,setCullFace,setLineWidth,setPolygonOffset,setScissorTest,activeTexture,bindTexture,unbindTexture,compressedTexImage2D,compressedTexImage3D,texImage2D,texImage3D,pixelStorei,getParameter,updateUBOMapping,uniformBlockBinding,texStorage2D,texStorage3D,texSubImage2D,texSubImage3D,compressedTexSubImage2D,compressedTexSubImage3D,scissor,viewport,reset}}function WebGLTextures(e,t,n,r,i,a,o){let s=t.has(`WEBGL_multisampled_render_to_texture`)?t.get(`WEBGL_multisampled_render_to_texture`):null,c=typeof navigator>`u`?!1:/OculusBrowser/g.test(navigator.userAgent),l=new G,u=new WeakMap,d=new Set,f,p=new WeakMap,m=!1;try{m=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)!==null}catch{}function createCanvas(e,t){return m?new OffscreenCanvas(e,t):createElementNS(`canvas`)}function resizeImage(e,t,n){let r=1,i=getDimensions(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1)if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||typeof VideoFrame<`u`&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);f===void 0&&(f=createCanvas(n,a));let o=t?createCanvas(n,a):f;return o.width=n,o.height=a,o.getContext(`2d`).drawImage(e,0,0,n,a),warn(`WebGLRenderer: Texture has been resized from (`+i.width+`x`+i.height+`) to (`+n+`x`+a+`).`),o}else return`data`in e&&warn(`WebGLRenderer: Image in DataTexture is too big (`+i.width+`x`+i.height+`).`),e;return e}function textureNeedsGenerateMipmaps(e){return e.generateMipmaps}function generateMipmap(t){e.generateMipmap(t)}function getTargetType(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function getInternalFormat(n,r,i,a,o,s=!1){if(n!==null){if(e[n]!==void 0)return e[n];warn(`WebGLRenderer: Attempt to use non-existing WebGL internal format '`+n+`'`)}let c;a&&(c=t.get(`EXT_texture_norm16`),c||warn(`WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension`));let l=r;if(r===e.RED&&(i===e.FLOAT&&(l=e.R32F),i===e.HALF_FLOAT&&(l=e.R16F),i===e.UNSIGNED_BYTE&&(l=e.R8),i===e.UNSIGNED_SHORT&&c&&(l=c.R16_EXT),i===e.SHORT&&c&&(l=c.R16_SNORM_EXT)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.R8UI),i===e.UNSIGNED_SHORT&&(l=e.R16UI),i===e.UNSIGNED_INT&&(l=e.R32UI),i===e.BYTE&&(l=e.R8I),i===e.SHORT&&(l=e.R16I),i===e.INT&&(l=e.R32I)),r===e.RG&&(i===e.FLOAT&&(l=e.RG32F),i===e.HALF_FLOAT&&(l=e.RG16F),i===e.UNSIGNED_BYTE&&(l=e.RG8),i===e.UNSIGNED_SHORT&&c&&(l=c.RG16_EXT),i===e.SHORT&&c&&(l=c.RG16_SNORM_EXT)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RG8UI),i===e.UNSIGNED_SHORT&&(l=e.RG16UI),i===e.UNSIGNED_INT&&(l=e.RG32UI),i===e.BYTE&&(l=e.RG8I),i===e.SHORT&&(l=e.RG16I),i===e.INT&&(l=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RGB8UI),i===e.UNSIGNED_SHORT&&(l=e.RGB16UI),i===e.UNSIGNED_INT&&(l=e.RGB32UI),i===e.BYTE&&(l=e.RGB8I),i===e.SHORT&&(l=e.RGB16I),i===e.INT&&(l=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(l=e.RGBA16UI),i===e.UNSIGNED_INT&&(l=e.RGBA32UI),i===e.BYTE&&(l=e.RGBA8I),i===e.SHORT&&(l=e.RGBA16I),i===e.INT&&(l=e.RGBA32I)),r===e.RGB&&(i===e.UNSIGNED_SHORT&&c&&(l=c.RGB16_EXT),i===e.SHORT&&c&&(l=c.RGB16_SNORM_EXT),i===e.UNSIGNED_INT_5_9_9_9_REV&&(l=e.RGB9_E5),i===e.UNSIGNED_INT_10F_11F_11F_REV&&(l=e.R11F_G11F_B10F)),r===e.RGBA){let t=s?ci:J.getTransfer(o);i===e.FLOAT&&(l=e.RGBA32F),i===e.HALF_FLOAT&&(l=e.RGBA16F),i===e.UNSIGNED_BYTE&&(l=t===`srgb`?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT&&c&&(l=c.RGBA16_EXT),i===e.SHORT&&c&&(l=c.RGBA16_SNORM_EXT),i===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)}return(l===e.R16F||l===e.R32F||l===e.RG16F||l===e.RG32F||l===e.RGBA16F||l===e.RGBA32F)&&t.get(`EXT_color_buffer_float`),l}function getInternalDepthFormat(t,n){let r;return t?n===null||n===1014||n===1020?r=e.DEPTH24_STENCIL8:n===1015?r=e.DEPTH32F_STENCIL8:n===1012&&(r=e.DEPTH24_STENCIL8,warn(`DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.`)):n===null||n===1014||n===1020?r=e.DEPTH_COMPONENT24:n===1015?r=e.DEPTH_COMPONENT32F:n===1012&&(r=e.DEPTH_COMPONENT16),r}function getMipLevels(e,t){return textureNeedsGenerateMipmaps(e)===!0||e.isFramebufferTexture&&e.minFilter!==1003&&e.minFilter!==1006?Math.log2(Math.max(t.width,t.height))+1:e.mipmaps!==void 0&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function onTextureDispose(e){let t=e.target;t.removeEventListener(`dispose`,onTextureDispose),deallocateTexture(t),t.isVideoTexture&&u.delete(t),t.isHTMLTexture&&d.delete(t)}function onRenderTargetDispose(e){let t=e.target;t.removeEventListener(`dispose`,onRenderTargetDispose),deallocateRenderTarget(t)}function deallocateTexture(e){let t=r.get(e);if(t.__webglInit===void 0)return;let n=e.source,i=p.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,r.usedTimes===0&&deleteTexture(e),Object.keys(i).length===0&&p.delete(n)}r.remove(e)}function deleteTexture(t){let n=r.get(t);e.deleteTexture(n.__webglTexture);let i=t.source,a=p.get(i);delete a[n.__cacheKey],o.memory.textures--}function deallocateRenderTarget(t){let n=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r<n.__webglFramebuffer[t].length;r++)e.deleteFramebuffer(n.__webglFramebuffer[t][r]);else e.deleteFramebuffer(n.__webglFramebuffer[t]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}let i=t.textures;for(let t=0,n=i.length;t<n;t++){let n=r.get(i[t]);n.__webglTexture&&(e.deleteTexture(n.__webglTexture),o.memory.textures--),r.remove(i[t])}r.remove(t)}let h=0;function resetTextureUnits(){h=0}function getTextureUnits(){return h}function setTextureUnits(e){h=e}function allocateTextureUnit(){let e=h;return e>=i.maxTextures&&warn(`WebGLTextures: Trying to use `+e+` texture units while this GPU supports only `+i.maxTextures),h+=1,e}function getTextureCacheKey(e){let t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}function setTexture2D(t,i){let a=r.get(t);if(t.isVideoTexture&&updateVideoTexture(t),t.isRenderTargetTexture===!1&&t.isExternalTexture!==!0&&t.version>0&&a.__version!==t.version){let e=t.image;if(e===null)warn(`WebGLRenderer: Texture marked for update but no image data found.`);else if(e.complete===!1)warn(`WebGLRenderer: Texture marked for update but image is incomplete`);else{uploadTexture(a,t,i);return}}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}function setTexture2DArray(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){uploadTexture(a,t,i);return}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)}function setTexture3D(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){uploadTexture(a,t,i);return}n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)}function setTextureCube(t,i){let a=r.get(t);if(t.isCubeDepthTexture!==!0&&t.version>0&&a.__version!==t.version){uploadCubeTexture(a,t,i);return}n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture,e.TEXTURE0+i)}let g={[Mr]:e.REPEAT,[Nr]:e.CLAMP_TO_EDGE,[Pr]:e.MIRRORED_REPEAT},_={[Fr]:e.NEAREST,1004:e.NEAREST_MIPMAP_NEAREST,1005:e.NEAREST_MIPMAP_LINEAR,[Ir]:e.LINEAR,1007:e.LINEAR_MIPMAP_NEAREST,[Lr]:e.LINEAR_MIPMAP_LINEAR},v={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function setTextureParameters(n,a){if(a.type===1015&&t.has(`OES_texture_float_linear`)===!1&&(a.magFilter===1006||a.magFilter===1007||a.magFilter===1005||a.magFilter===1008||a.minFilter===1006||a.minFilter===1007||a.minFilter===1005||a.minFilter===1008)&&warn(`WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.`),e.texParameteri(n,e.TEXTURE_WRAP_S,g[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,g[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,g[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,_[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,_[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,v[a.compareFunction])),t.has(`EXT_texture_filter_anisotropic`)===!0){if(a.magFilter===1003||a.minFilter!==1005&&a.minFilter!==1008||a.type===1015&&t.has(`OES_texture_float_linear`)===!1)return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){let o=t.get(`EXT_texture_filter_anisotropic`);e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function initTexture(t,n){let r=!1;t.__webglInit===void 0&&(t.__webglInit=!0,n.addEventListener(`dispose`,onTextureDispose));let i=n.source,a=p.get(i);a===void 0&&(a={},p.set(i,a));let s=getTextureCacheKey(n);if(s!==t.__cacheKey){a[s]===void 0&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;let i=a[t.__cacheKey];i!==void 0&&(a[t.__cacheKey].usedTimes--,i.usedTimes===0&&deleteTexture(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function getRow(e,t,n){return Math.floor(Math.floor(e/n)/t)}function updateTexture(t,r,i,a){let o=t.updateRanges;if(o.length===0)n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,i,a,r.data);else{o.sort((e,t)=>e.start-t.start);let s=0;for(let e=1;e<o.length;e++){let t=o[s],n=o[e],i=t.start+t.count,a=getRow(n.start,r.width,4),c=getRow(t.start,r.width,4);n.start<=i+1&&a===c&&getRow(n.start+n.count-1,r.width,4)===a?t.count=Math.max(t.count,n.start+n.count-t.start):(++s,o[s]=n)}o.length=s+1;let c=n.getParameter(e.UNPACK_ROW_LENGTH),l=n.getParameter(e.UNPACK_SKIP_PIXELS),u=n.getParameter(e.UNPACK_SKIP_ROWS);n.pixelStorei(e.UNPACK_ROW_LENGTH,r.width);for(let t=0,s=o.length;t<s;t++){let s=o[t],c=Math.floor(s.start/4),l=Math.ceil(s.count/4),u=c%r.width,d=Math.floor(c/r.width),f=l;n.pixelStorei(e.UNPACK_SKIP_PIXELS,u),n.pixelStorei(e.UNPACK_SKIP_ROWS,d),n.texSubImage2D(e.TEXTURE_2D,0,u,d,f,1,i,a,r.data)}t.clearUpdateRanges(),n.pixelStorei(e.UNPACK_ROW_LENGTH,c),n.pixelStorei(e.UNPACK_SKIP_PIXELS,l),n.pixelStorei(e.UNPACK_SKIP_ROWS,u)}}function uploadTexture(t,o,s){let c=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(c=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(c=e.TEXTURE_3D);let l=initTexture(t,o),u=o.source;n.bindTexture(c,t.__webglTexture,e.TEXTURE0+s);let f=r.get(u);if(u.version!==f.__version||l===!0){if(n.activeTexture(e.TEXTURE0+s),!(typeof ImageBitmap<`u`&&o.image instanceof ImageBitmap)){let t=J.getPrimaries(J.workingColorSpace),r=o.colorSpace===``?null:J.getPrimaries(o.colorSpace),i=o.colorSpace===``||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;n.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,i)}n.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment);let t=resizeImage(o.image,!1,i.maxTextureSize);t=verifyColorSpace(o,t);let r=a.convert(o.format,o.colorSpace),p=a.convert(o.type),m=getInternalFormat(o.internalFormat,r,p,o.normalized,o.colorSpace,o.isVideoTexture);setTextureParameters(c,o);let h,g=o.mipmaps,_=o.isVideoTexture!==!0,v=f.__version===void 0||l===!0,y=u.dataReady,b=getMipLevels(o,t);if(o.isDepthTexture)m=getInternalDepthFormat(o.format===Jr,o.type),v&&(_?n.texStorage2D(e.TEXTURE_2D,1,m,t.width,t.height):n.texImage2D(e.TEXTURE_2D,0,m,t.width,t.height,0,r,p,null));else if(o.isDataTexture)if(g.length>0){_&&v&&n.texStorage2D(e.TEXTURE_2D,b,m,g[0].width,g[0].height);for(let t=0,i=g.length;t<i;t++)h=g[t],_?y&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,h.width,h.height,r,p,h.data):n.texImage2D(e.TEXTURE_2D,t,m,h.width,h.height,0,r,p,h.data);o.generateMipmaps=!1}else _?(v&&n.texStorage2D(e.TEXTURE_2D,b,m,t.width,t.height),y&&updateTexture(o,t,r,p)):n.texImage2D(e.TEXTURE_2D,0,m,t.width,t.height,0,r,p,t.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){_&&v&&n.texStorage3D(e.TEXTURE_2D_ARRAY,b,m,g[0].width,g[0].height,t.depth);for(let i=0,a=g.length;i<a;i++)if(h=g[i],o.format!==1023)if(r!==null)if(_){if(y)if(o.layerUpdates.size>0){let t=getByteLength(h.width,h.height,o.format,o.type);for(let a of o.layerUpdates){let o=h.data.subarray(a*t/h.data.BYTES_PER_ELEMENT,(a+1)*t/h.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,a,h.width,h.height,1,r,o)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,h.width,h.height,t.depth,r,h.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,i,m,h.width,h.height,t.depth,0,h.data,0,0);else warn(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`);else _?y&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,h.width,h.height,t.depth,r,p,h.data):n.texImage3D(e.TEXTURE_2D_ARRAY,i,m,h.width,h.height,t.depth,0,r,p,h.data)}else{_&&v&&n.texStorage2D(e.TEXTURE_2D,b,m,g[0].width,g[0].height);for(let t=0,i=g.length;t<i;t++)h=g[t],o.format===1023?_?y&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,h.width,h.height,r,p,h.data):n.texImage2D(e.TEXTURE_2D,t,m,h.width,h.height,0,r,p,h.data):r===null?warn(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`):_?y&&n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,h.width,h.height,r,h.data):n.compressedTexImage2D(e.TEXTURE_2D,t,m,h.width,h.height,0,h.data)}else if(o.isDataArrayTexture)if(_){if(v&&n.texStorage3D(e.TEXTURE_2D_ARRAY,b,m,t.width,t.height,t.depth),y)if(o.layerUpdates.size>0){let i=getByteLength(t.width,t.height,o.format,o.type);for(let a of o.layerUpdates){let o=t.data.subarray(a*i/t.data.BYTES_PER_ELEMENT,(a+1)*i/t.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,a,t.width,t.height,1,r,p,o)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,t.width,t.height,t.depth,r,p,t.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,m,t.width,t.height,t.depth,0,r,p,t.data);else if(o.isData3DTexture)_?(v&&n.texStorage3D(e.TEXTURE_3D,b,m,t.width,t.height,t.depth),y&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,t.width,t.height,t.depth,r,p,t.data)):n.texImage3D(e.TEXTURE_3D,0,m,t.width,t.height,t.depth,0,r,p,t.data);else if(o.isFramebufferTexture){if(v)if(_)n.texStorage2D(e.TEXTURE_2D,b,m,t.width,t.height);else{let i=t.width,a=t.height;for(let t=0;t<b;t++)n.texImage2D(e.TEXTURE_2D,t,m,i,a,0,r,p,null),i>>=1,a>>=1}}else if(o.isHTMLTexture){if(`texElementImage2D`in e){let n=e.canvas;if(n.hasAttribute(`layoutsubtree`)||n.setAttribute(`layoutsubtree`,`true`),t.parentNode!==n){n.appendChild(t),d.add(o),n.onpaint=e=>{let t=e.changedElements;for(let e of d)t.includes(e.image)&&(e.needsUpdate=!0)},n.requestPaint();return}if(e.texElementImage2D.length===3)e.texElementImage2D(e.TEXTURE_2D,e.RGBA8,t);else{let n=e.RGBA,r=e.RGBA,i=e.UNSIGNED_BYTE;e.texElementImage2D(e.TEXTURE_2D,0,n,r,i,t)}e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}}else if(g.length>0){if(_&&v){let t=getDimensions(g[0]);n.texStorage2D(e.TEXTURE_2D,b,m,t.width,t.height)}for(let t=0,i=g.length;t<i;t++)h=g[t],_?y&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,r,p,h):n.texImage2D(e.TEXTURE_2D,t,m,r,p,h);o.generateMipmaps=!1}else if(_){if(v){let r=getDimensions(t);n.texStorage2D(e.TEXTURE_2D,b,m,r.width,r.height)}y&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,r,p,t)}else n.texImage2D(e.TEXTURE_2D,0,m,r,p,t);textureNeedsGenerateMipmaps(o)&&generateMipmap(c),f.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function uploadCubeTexture(t,o,s){if(o.image.length!==6)return;let c=initTexture(t,o),l=o.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+s);let u=r.get(l);if(l.version!==u.__version||c===!0){n.activeTexture(e.TEXTURE0+s);let t=J.getPrimaries(J.workingColorSpace),r=o.colorSpace===``?null:J.getPrimaries(o.colorSpace),d=o.colorSpace===``||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;n.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),n.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let f=o.isCompressedTexture||o.image[0].isCompressedTexture,p=o.image[0]&&o.image[0].isDataTexture,m=[];for(let e=0;e<6;e++)!f&&!p?m[e]=resizeImage(o.image[e],!0,i.maxCubemapSize):m[e]=p?o.image[e].image:o.image[e],m[e]=verifyColorSpace(o,m[e]);let h=m[0],g=a.convert(o.format,o.colorSpace),_=a.convert(o.type),v=getInternalFormat(o.internalFormat,g,_,o.normalized,o.colorSpace),y=o.isVideoTexture!==!0,b=u.__version===void 0||c===!0,x=l.dataReady,S=getMipLevels(o,h);setTextureParameters(e.TEXTURE_CUBE_MAP,o);let C;if(f){y&&b&&n.texStorage2D(e.TEXTURE_CUBE_MAP,S,v,h.width,h.height);for(let t=0;t<6;t++){C=m[t].mipmaps;for(let r=0;r<C.length;r++){let i=C[r];o.format===1023?y?x&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,g,_,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,v,i.width,i.height,0,g,_,i.data):g===null?warn(`WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()`):y?x&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,g,i.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,v,i.width,i.height,0,i.data)}}}else{if(C=o.mipmaps,y&&b){C.length>0&&S++;let t=getDimensions(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,S,v,t.width,t.height)}for(let t=0;t<6;t++)if(p){y?x&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m[t].width,m[t].height,g,_,m[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,v,m[t].width,m[t].height,0,g,_,m[t].data);for(let r=0;r<C.length;r++){let i=C[r].image[t].image;y?x&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,i.width,i.height,g,_,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,v,i.width,i.height,0,g,_,i.data)}}else{y?x&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,g,_,m[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,v,g,_,m[t]);for(let r=0;r<C.length;r++){let i=C[r];y?x&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,g,_,i.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,v,g,_,i.image[t])}}}textureNeedsGenerateMipmaps(o)&&generateMipmap(e.TEXTURE_CUBE_MAP),u.__version=l.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function setupFrameBufferTexture(t,i,o,c,l,u){let d=a.convert(o.format,o.colorSpace),f=a.convert(o.type),p=getInternalFormat(o.internalFormat,d,f,o.normalized,o.colorSpace),m=r.get(i),h=r.get(o);if(h.__renderTarget=i,!m.__hasExternalTextures){let t=Math.max(1,i.width>>u),r=Math.max(1,i.height>>u);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,u,p,t,r,i.depth,0,d,f,null):n.texImage2D(l,u,p,t,r,0,d,f,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),useMultisampledRTT(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,c,l,h.__webglTexture,0,getRenderTargetSamples(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,c,l,h.__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function setupRenderBufferStorage(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=getInternalDepthFormat(n.stencilBuffer,a),c=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;useMultisampledRTT(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,getRenderTargetSamples(n),o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,getRenderTargetSamples(n),o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,c,e.RENDERBUFFER,t)}else{let t=n.textures;for(let i=0;i<t.length;i++){let o=t[i],c=a.convert(o.format,o.colorSpace),l=a.convert(o.type),u=getInternalFormat(o.internalFormat,c,l,o.normalized,o.colorSpace);useMultisampledRTT(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,getRenderTargetSamples(n),u,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,getRenderTargetSamples(n),u,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,u,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function setupDepthTexture(t,i,o){let c=i.isWebGLCubeRenderTarget===!0;if(n.bindFramebuffer(e.FRAMEBUFFER,t),!(i.depthTexture&&i.depthTexture.isDepthTexture))throw Error(`THREE.WebGLTextures: renderTarget.depthTexture must be an instance of THREE.DepthTexture.`);let l=r.get(i.depthTexture);if(l.__renderTarget=i,(!l.__webglTexture||i.depthTexture.image.width!==i.width||i.depthTexture.image.height!==i.height)&&(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),c){if(l.__webglInit===void 0&&(l.__webglInit=!0,i.depthTexture.addEventListener(`dispose`,onTextureDispose)),l.__webglTexture===void 0){l.__webglTexture=e.createTexture(),n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),setTextureParameters(e.TEXTURE_CUBE_MAP,i.depthTexture);let t=a.convert(i.depthTexture.format),r=a.convert(i.depthTexture.type),o;i.depthTexture.format===1026?o=e.DEPTH_COMPONENT24:i.depthTexture.format===1027&&(o=e.DEPTH24_STENCIL8);for(let n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,o,i.width,i.height,0,t,r,null)}}else setTexture2D(i.depthTexture,0);let u=l.__webglTexture,d=getRenderTargetSamples(i),f=c?e.TEXTURE_CUBE_MAP_POSITIVE_X+o:e.TEXTURE_2D,p=i.depthTexture.format===1027?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;if(i.depthTexture.format===1026)useMultisampledRTT(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,p,f,u,0,d):e.framebufferTexture2D(e.FRAMEBUFFER,p,f,u,0);else if(i.depthTexture.format===1027)useMultisampledRTT(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,p,f,u,0,d):e.framebufferTexture2D(e.FRAMEBUFFER,p,f,u,0);else throw Error(`THREE.WebGLTextures: Unknown depthTexture format.`)}function setupDepthRenderbuffer(t){let i=r.get(t),a=t.isWebGLCubeRenderTarget===!0;if(i.__boundDepthTexture!==t.depthTexture){let e=t.depthTexture;if(i.__depthDisposeCallback&&i.__depthDisposeCallback(),e){let disposeEvent=()=>{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener(`dispose`,disposeEvent)};e.addEventListener(`dispose`,disposeEvent),i.__depthDisposeCallback=disposeEvent}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer)if(a)for(let e=0;e<6;e++)setupDepthTexture(i.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?setupDepthTexture(i.__webglFramebuffer[0],t,0):setupDepthTexture(i.__webglFramebuffer,t,0)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]===void 0)i.__webglDepthbuffer[r]=e.createRenderbuffer(),setupRenderBufferStorage(i.__webglDepthbuffer[r],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let r=t.texture.mipmaps;if(r&&r.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer===void 0)i.__webglDepthbuffer=e.createRenderbuffer(),setupRenderBufferStorage(i.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}function rebindTextures(t,n,i){let a=r.get(t);n!==void 0&&setupFrameBufferTexture(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),i!==void 0&&setupDepthRenderbuffer(t)}function setupRenderTarget(t){let i=t.texture,s=r.get(t),c=r.get(i);t.addEventListener(`dispose`,onRenderTargetDispose);let l=t.textures,u=t.isWebGLCubeRenderTarget===!0,d=l.length>1;if(d||(c.__webglTexture===void 0&&(c.__webglTexture=e.createTexture()),c.__version=i.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n<i.mipmaps.length;n++)s.__webglFramebuffer[t][n]=e.createFramebuffer()}else s.__webglFramebuffer[t]=e.createFramebuffer()}else{if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer=[];for(let t=0;t<i.mipmaps.length;t++)s.__webglFramebuffer[t]=e.createFramebuffer()}else s.__webglFramebuffer=e.createFramebuffer();if(d)for(let t=0,n=l.length;t<n;t++){let n=r.get(l[t]);n.__webglTexture===void 0&&(n.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&useMultisampledRTT(t)===!1){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n<l.length;n++){let r=l[n];s.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,s.__webglColorRenderbuffer[n]);let i=a.convert(r.format,r.colorSpace),o=a.convert(r.type),c=getInternalFormat(r.internalFormat,i,o,r.normalized,r.colorSpace,t.isXRRenderTarget===!0),u=getRenderTargetSamples(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,u,c,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,s.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),setupRenderBufferStorage(s.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(u){n.bindTexture(e.TEXTURE_CUBE_MAP,c.__webglTexture),setTextureParameters(e.TEXTURE_CUBE_MAP,i);for(let n=0;n<6;n++)if(i.mipmaps&&i.mipmaps.length>0)for(let r=0;r<i.mipmaps.length;r++)setupFrameBufferTexture(s.__webglFramebuffer[n][r],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else setupFrameBufferTexture(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);textureNeedsGenerateMipmaps(i)&&generateMipmap(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(d){for(let i=0,a=l.length;i<a;i++){let a=l[i],o=r.get(a),c=e.TEXTURE_2D;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(c=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(c,o.__webglTexture),setTextureParameters(c,a),setupFrameBufferTexture(s.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+i,c,0),textureNeedsGenerateMipmaps(a)&&generateMipmap(c)}n.unbindTexture()}else{let r=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(r,c.__webglTexture),setTextureParameters(r,i),i.mipmaps&&i.mipmaps.length>0)for(let n=0;n<i.mipmaps.length;n++)setupFrameBufferTexture(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,r,n);else setupFrameBufferTexture(s.__webglFramebuffer,t,i,e.COLOR_ATTACHMENT0,r,0);textureNeedsGenerateMipmaps(i)&&generateMipmap(r),n.unbindTexture()}t.depthBuffer&&setupDepthRenderbuffer(t)}function updateRenderTargetMipmap(e){let t=e.textures;for(let i=0,a=t.length;i<a;i++){let a=t[i];if(textureNeedsGenerateMipmaps(a)){let t=getTargetType(e),i=r.get(a).__webglTexture;n.bindTexture(t,i),generateMipmap(t),n.unbindTexture()}}}let y=[],b=[];function updateMultisampleRenderTarget(t){if(t.samples>0){if(useMultisampledRTT(t)===!1){let i=t.textures,a=t.width,o=t.height,s=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),d=i.length>1;if(d)for(let t=0;t<i.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer);let f=t.texture.mipmaps;f&&f.length>0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<i.length;n++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(s|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(s|=e.STENCIL_BUFFER_BIT)),d){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,u.__webglColorRenderbuffer[n]);let t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,o,0,0,a,o,s,e.NEAREST),c===!0&&(y.length=0,b.length=0,y.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&t.resolveDepthBuffer===!1&&(y.push(l),b.push(l),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,b)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,y))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),d)for(let t=0;t<i.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,u.__webglColorRenderbuffer[t]);let a=r.get(i[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&t.resolveDepthBuffer===!1&&c){let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}}}function getRenderTargetSamples(e){return Math.min(i.maxSamples,e.samples)}function useMultisampledRTT(e){let n=r.get(e);return e.samples>0&&t.has(`WEBGL_multisampled_render_to_texture`)===!0&&n.__useRenderToTexture!==!1}function updateVideoTexture(e){let t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}function verifyColorSpace(e,t){let n=e.colorSpace,r=e.format,i=e.type;return e.isCompressedTexture===!0||e.isVideoTexture===!0||n!==`srgb-linear`&&n!==``&&(J.getTransfer(n)===`srgb`?(r!==1023||i!==1009)&&warn(`WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.`):error(`WebGLTextures: Unsupported texture color space:`,n)),t}function getDimensions(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement?(l.width=e.naturalWidth||e.width,l.height=e.naturalHeight||e.height):typeof VideoFrame<`u`&&e instanceof VideoFrame?(l.width=e.displayWidth,l.height=e.displayHeight):(l.width=e.width,l.height=e.height),l}this.allocateTextureUnit=allocateTextureUnit,this.resetTextureUnits=resetTextureUnits,this.getTextureUnits=getTextureUnits,this.setTextureUnits=setTextureUnits,this.setTexture2D=setTexture2D,this.setTexture2DArray=setTexture2DArray,this.setTexture3D=setTexture3D,this.setTextureCube=setTextureCube,this.rebindTextures=rebindTextures,this.setupRenderTarget=setupRenderTarget,this.updateRenderTargetMipmap=updateRenderTargetMipmap,this.updateMultisampleRenderTarget=updateMultisampleRenderTarget,this.setupDepthRenderbuffer=setupDepthRenderbuffer,this.setupFrameBufferTexture=setupFrameBufferTexture,this.useMultisampledRTT=useMultisampledRTT,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function WebGLUtils(e,t){function convert(n,r=``){let i,a=J.getTransfer(r);if(n===1009)return e.UNSIGNED_BYTE;if(n===1017)return e.UNSIGNED_SHORT_4_4_4_4;if(n===1018)return e.UNSIGNED_SHORT_5_5_5_1;if(n===35902)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===35899)return e.UNSIGNED_INT_10F_11F_11F_REV;if(n===1010)return e.BYTE;if(n===1011)return e.SHORT;if(n===1012)return e.UNSIGNED_SHORT;if(n===1013)return e.INT;if(n===1014)return e.UNSIGNED_INT;if(n===1015)return e.FLOAT;if(n===1016)return e.HALF_FLOAT;if(n===1021)return e.ALPHA;if(n===1022)return e.RGB;if(n===1023)return e.RGBA;if(n===1026)return e.DEPTH_COMPONENT;if(n===1027)return e.DEPTH_STENCIL;if(n===1028)return e.RED;if(n===1029)return e.RED_INTEGER;if(n===1030)return e.RG;if(n===1031)return e.RG_INTEGER;if(n===1033)return e.RGBA_INTEGER;if(n===33776||n===33777||n===33778||n===33779)if(a===`srgb`)if(i=t.get(`WEBGL_compressed_texture_s3tc_srgb`),i!==null){if(n===33776)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(i=t.get(`WEBGL_compressed_texture_s3tc`),i!==null){if(n===33776)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===35840||n===35841||n===35842||n===35843)if(i=t.get(`WEBGL_compressed_texture_pvrtc`),i!==null){if(n===35840)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===35841)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===35842)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===35843)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===36196||n===37492||n===37496||n===37488||n===37489||n===37490||n===37491)if(i=t.get(`WEBGL_compressed_texture_etc`),i!==null){if(n===36196||n===37492)return a===`srgb`?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===37496)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC;if(n===37488)return i.COMPRESSED_R11_EAC;if(n===37489)return i.COMPRESSED_SIGNED_R11_EAC;if(n===37490)return i.COMPRESSED_RG11_EAC;if(n===37491)return i.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===37808||n===37809||n===37810||n===37811||n===37812||n===37813||n===37814||n===37815||n===37816||n===37817||n===37818||n===37819||n===37820||n===37821)if(i=t.get(`WEBGL_compressed_texture_astc`),i!==null){if(n===37808)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===37809)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===37810)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===37811)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===37812)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===37813)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===37814)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===37815)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===37816)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===37817)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===37818)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===37819)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===37820)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===37821)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===36492||n===36494||n===36495)if(i=t.get(`EXT_texture_compression_bptc`),i!==null){if(n===36492)return a===`srgb`?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===36494)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===36495)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===36283||n===36284||n===36285||n===36286)if(i=t.get(`EXT_texture_compression_rgtc`),i!==null){if(n===36283)return i.COMPRESSED_RED_RGTC1_EXT;if(n===36284)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===36285)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===36286)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===1020?e.UNSIGNED_INT_24_8:e[n]===void 0?null:e[n]}return{convert}}var WebXRDepthSensing=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let n=new ExternalTexture(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new ShaderMaterial({vertexShader:`
|
|
4194
4194
|
void main() {
|
|
4195
4195
|
|
|
4196
4196
|
gl_Position = vec4( position, 1.0 );
|
|
@@ -4214,7 +4214,7 @@ void main() {
|
|
|
4214
4214
|
|
|
4215
4215
|
}
|
|
4216
4216
|
|
|
4217
|
-
}`,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Mesh(new Po(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},WebXRManager=class extends EventDispatcher{constructor(e,t){super();let n=this,r=null,i=1,a=null,o=`local-floor`,s=1,c=null,l=null,u=null,d=null,f=null,p=null,m=typeof XRWebGLBinding<`u`,h=new WebXRDepthSensing,g={},_=t.getContextAttributes(),v=null,y=null,b=[],x=[],S=new Oi,C=null,w=new PerspectiveCamera;w.viewport=new Vi;let T=new PerspectiveCamera;T.viewport=new Vi;let E=[w,T],D=new ArrayCamera,O=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=b[e];return t===void 0&&(t=new WebXRController,b[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=b[e];return t===void 0&&(t=new WebXRController,b[e]=t),t.getGripSpace()},this.getHand=function(e){let t=b[e];return t===void 0&&(t=new WebXRController,b[e]=t),t.getHandSpace()};function onSessionEvent(e){let t=x.indexOf(e.inputSource);if(t===-1)return;let n=b[t];n!==void 0&&(n.update(e.inputSource,e.frame,c||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function onSessionEnd(){r.removeEventListener(`select`,onSessionEvent),r.removeEventListener(`selectstart`,onSessionEvent),r.removeEventListener(`selectend`,onSessionEvent),r.removeEventListener(`squeeze`,onSessionEvent),r.removeEventListener(`squeezestart`,onSessionEvent),r.removeEventListener(`squeezeend`,onSessionEvent),r.removeEventListener(`end`,onSessionEnd),r.removeEventListener(`inputsourceschange`,onInputSourcesChange);for(let e=0;e<b.length;e++){let t=x[e];t!==null&&(x[e]=null,b[e].disconnect(t))}O=null,k=null,h.reset();for(let e in g)delete g[e];e.setRenderTarget(v),f=null,d=null,u=null,r=null,y=null,j.stop(),n.isPresenting=!1,e.setPixelRatio(C),e.setSize(S.width,S.height,!1),n.dispatchEvent({type:`sessionend`})}this.setFramebufferScaleFactor=function(e){i=e,n.isPresenting===!0&&warn(`WebXRManager: Cannot change framebuffer scale while presenting.`)},this.setReferenceSpaceType=function(e){o=e,n.isPresenting===!0&&warn(`WebXRManager: Cannot change reference space type while presenting.`)},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(e){c=e},this.getBaseLayer=function(){return d===null?f:d},this.getBinding=function(){return u===null&&m&&(u=new XRWebGLBinding(r,t)),u},this.getFrame=function(){return p},this.getSession=function(){return r},this.setSession=async function(l){if(r=l,r!==null){if(v=e.getRenderTarget(),r.addEventListener(`select`,onSessionEvent),r.addEventListener(`selectstart`,onSessionEvent),r.addEventListener(`selectend`,onSessionEvent),r.addEventListener(`squeeze`,onSessionEvent),r.addEventListener(`squeezestart`,onSessionEvent),r.addEventListener(`squeezeend`,onSessionEvent),r.addEventListener(`end`,onSessionEnd),r.addEventListener(`inputsourceschange`,onInputSourcesChange),_.xrCompatible!==!0&&await t.makeXRCompatible(),C=e.getPixelRatio(),e.getSize(S),m&&`createProjectionLayer`in XRWebGLBinding.prototype){let n=null,a=null,o=null;_.depth&&(o=_.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=_.stencil?ri:ni,a=_.stencil?ei:Yr);let s={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:i};u=this.getBinding(),d=u.createProjectionLayer(s),r.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),y=new WebGLRenderTarget(d.textureWidth,d.textureHeight,{format:ti,type:qr,depthTexture:new DepthTexture(d.textureWidth,d.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:_.stencil,colorSpace:e.outputColorSpace,samples:_.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{let n={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:i};f=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),y=new WebGLRenderTarget(f.framebufferWidth,f.framebufferHeight,{format:ti,type:qr,colorSpace:e.outputColorSpace,stencilBuffer:_.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}y.isXRRenderTarget=!0,this.setFoveation(s),c=null,a=await r.requestReferenceSpace(o),j.setContext(r),j.start(),n.isPresenting=!0,n.dispatchEvent({type:`sessionstart`})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return h.getDepthTexture()};function onInputSourcesChange(e){for(let t=0;t<e.removed.length;t++){let n=e.removed[t],r=x.indexOf(n);r>=0&&(x[r]=null,b[r].disconnect(n))}for(let t=0;t<e.added.length;t++){let n=e.added[t],r=x.indexOf(n);if(r===-1){for(let e=0;e<b.length;e++)if(e>=x.length){x.push(n),r=e;break}else if(x[e]===null){x[e]=n,r=e;break}if(r===-1)break}let i=b[r];i&&i.connect(n)}}let A=new P,ee=new P;function setProjectionFromUnion(e,t,n){A.setFromMatrixPosition(t.matrixWorld),ee.setFromMatrixPosition(n.matrixWorld);let r=A.distanceTo(ee),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(a[8]+1)/a[0],f=o*u,p=o*d,m=r/(-u+d),h=m*-u;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(h),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),i[10]===-1)e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{let t=o+m,n=s+m,i=f-h,a=p+(r-h),u=c*s/n*t,d=l*s/n*t;e.projectionMatrix.makePerspective(i,a,u,d,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}function updateCamera(e,t){t===null?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(r===null)return;let t=e.near,n=e.far;h.texture!==null&&(h.depthNear>0&&(t=h.depthNear),h.depthFar>0&&(n=h.depthFar)),D.near=T.near=w.near=t,D.far=T.far=w.far=n,(O!==D.near||k!==D.far)&&(r.updateRenderState({depthNear:D.near,depthFar:D.far}),O=D.near,k=D.far),D.layers.mask=e.layers.mask|6,w.layers.mask=D.layers.mask&-5,T.layers.mask=D.layers.mask&-3;let i=e.parent,a=D.cameras;updateCamera(D,i);for(let e=0;e<a.length;e++)updateCamera(a[e],i);a.length===2?setProjectionFromUnion(D,w,T):D.projectionMatrix.copy(w.projectionMatrix),updateUserCamera(e,D,i)};function updateUserCamera(e,t,n){n===null?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld)),e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0),e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=Ei*2*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}this.getCamera=function(){return D},this.getFoveation=function(){if(!(d===null&&f===null))return s},this.setFoveation=function(e){s=e,d!==null&&(d.fixedFoveation=e),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=e)},this.hasDepthSensing=function(){return h.texture!==null},this.getDepthSensingMesh=function(){return h.getMesh(D)},this.getCameraTexture=function(e){return g[e]};let te=null;function onAnimationFrame(t,i){if(l=i.getViewerPose(c||a),p=i,l!==null){let t=l.views;f!==null&&(e.setRenderTargetFramebuffer(y,f.framebuffer),e.setRenderTarget(y));let i=!1;t.length!==D.cameras.length&&(D.cameras.length=0,i=!0);for(let n=0;n<t.length;n++){let r=t[n],a=null;if(f!==null)a=f.getViewport(r);else{let t=u.getViewSubImage(d,r);a=t.viewport,n===0&&(e.setRenderTargetTextures(y,t.colorTexture,t.depthStencilTexture),e.setRenderTarget(y))}let o=E[n];o===void 0&&(o=new PerspectiveCamera,o.layers.enable(n),o.viewport=new Vi,E[n]=o),o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(r.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(a.x,a.y,a.width,a.height),n===0&&(D.matrix.copy(o.matrix),D.matrix.decompose(D.position,D.quaternion,D.scale)),i===!0&&D.cameras.push(o)}let a=r.enabledFeatures;if(a&&a.includes(`depth-sensing`)&&r.depthUsage==`gpu-optimized`&&m){u=n.getBinding();let e=u.getDepthInformation(t[0]);e&&e.isValid&&e.texture&&h.init(e,r.renderState)}if(a&&a.includes(`camera-access`)&&m){e.state.unbindTexture(),u=n.getBinding();for(let e=0;e<t.length;e++){let n=t[e].camera;if(n){let e=g[n];e||(e=new ExternalTexture,g[n]=e);let t=u.getCameraImage(n);e.sourceTexture=t}}}}for(let e=0;e<b.length;e++){let t=x[e],n=b[e];t!==null&&n!==void 0&&n.update(t,i,c||a)}te&&te(t,i),i.detectedPlanes&&n.dispatchEvent({type:`planesdetected`,data:i}),p=null}let j=new WebGLAnimation;j.setAnimationLoop(onAnimationFrame),this.setAnimationLoop=function(e){te=e},this.dispose=function(){}}};const Us=new Hi,Ws=new ji;Ws.set(-1,0,0,0,1,0,0,0,1);function WebGLMaterials(e,t){function refreshTransformUniform(e,t){e.matrixAutoUpdate===!0&&e.updateMatrix(),t.value.copy(e.matrix)}function refreshFogUniforms(t,n){n.color.getRGB(t.fogColor.value,getUnlitUniformColorSpace(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)}function refreshMaterialUniforms(e,t,n,r,i){t.isNodeMaterial?t.uniformsNeedUpdate=!1:t.isMeshBasicMaterial?refreshUniformsCommon(e,t):t.isMeshLambertMaterial?(refreshUniformsCommon(e,t),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)):t.isMeshToonMaterial?(refreshUniformsCommon(e,t),refreshUniformsToon(e,t)):t.isMeshPhongMaterial?(refreshUniformsCommon(e,t),refreshUniformsPhong(e,t),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)):t.isMeshStandardMaterial?(refreshUniformsCommon(e,t),refreshUniformsStandard(e,t),t.isMeshPhysicalMaterial&&refreshUniformsPhysical(e,t,i)):t.isMeshMatcapMaterial?(refreshUniformsCommon(e,t),refreshUniformsMatcap(e,t)):t.isMeshDepthMaterial?refreshUniformsCommon(e,t):t.isMeshDistanceMaterial?(refreshUniformsCommon(e,t),refreshUniformsDistance(e,t)):t.isMeshNormalMaterial?refreshUniformsCommon(e,t):t.isLineBasicMaterial?(refreshUniformsLine(e,t),t.isLineDashedMaterial&&refreshUniformsDash(e,t)):t.isPointsMaterial?refreshUniformsPoints(e,t,n,r):t.isSpriteMaterial?refreshUniformsSprites(e,t):t.isShadowMaterial?(e.color.value.copy(t.color),e.opacity.value=t.opacity):t.isShaderMaterial&&(t.uniformsNeedUpdate=!1)}function refreshUniformsCommon(e,n){e.opacity.value=n.opacity,n.color&&e.diffuse.value.copy(n.color),n.emissive&&e.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(e.map.value=n.map,refreshTransformUniform(n.map,e.mapTransform)),n.alphaMap&&(e.alphaMap.value=n.alphaMap,refreshTransformUniform(n.alphaMap,e.alphaMapTransform)),n.bumpMap&&(e.bumpMap.value=n.bumpMap,refreshTransformUniform(n.bumpMap,e.bumpMapTransform),e.bumpScale.value=n.bumpScale,n.side===1&&(e.bumpScale.value*=-1)),n.normalMap&&(e.normalMap.value=n.normalMap,refreshTransformUniform(n.normalMap,e.normalMapTransform),e.normalScale.value.copy(n.normalScale),n.side===1&&e.normalScale.value.negate()),n.displacementMap&&(e.displacementMap.value=n.displacementMap,refreshTransformUniform(n.displacementMap,e.displacementMapTransform),e.displacementScale.value=n.displacementScale,e.displacementBias.value=n.displacementBias),n.emissiveMap&&(e.emissiveMap.value=n.emissiveMap,refreshTransformUniform(n.emissiveMap,e.emissiveMapTransform)),n.specularMap&&(e.specularMap.value=n.specularMap,refreshTransformUniform(n.specularMap,e.specularMapTransform)),n.alphaTest>0&&(e.alphaTest.value=n.alphaTest);let r=t.get(n),i=r.envMap,a=r.envMapRotation;i&&(e.envMap.value=i,e.envMapRotation.value.setFromMatrix4(Us.makeRotationFromEuler(a)).transpose(),i.isCubeTexture&&i.isRenderTargetTexture===!1&&e.envMapRotation.value.premultiply(Ws),e.reflectivity.value=n.reflectivity,e.ior.value=n.ior,e.refractionRatio.value=n.refractionRatio),n.lightMap&&(e.lightMap.value=n.lightMap,e.lightMapIntensity.value=n.lightMapIntensity,refreshTransformUniform(n.lightMap,e.lightMapTransform)),n.aoMap&&(e.aoMap.value=n.aoMap,e.aoMapIntensity.value=n.aoMapIntensity,refreshTransformUniform(n.aoMap,e.aoMapTransform))}function refreshUniformsLine(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,refreshTransformUniform(t.map,e.mapTransform))}function refreshUniformsDash(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function refreshUniformsPoints(e,t,n,r){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=r*.5,t.map&&(e.map.value=t.map,refreshTransformUniform(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,refreshTransformUniform(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function refreshUniformsSprites(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,refreshTransformUniform(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,refreshTransformUniform(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function refreshUniformsPhong(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}function refreshUniformsToon(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function refreshUniformsStandard(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,refreshTransformUniform(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,refreshTransformUniform(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function refreshUniformsPhysical(e,t,n){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,refreshTransformUniform(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,refreshTransformUniform(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,refreshTransformUniform(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,refreshTransformUniform(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,refreshTransformUniform(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===1&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,refreshTransformUniform(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,refreshTransformUniform(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=n.texture,e.transmissionSamplerSize.value.set(n.width,n.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,refreshTransformUniform(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,refreshTransformUniform(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,refreshTransformUniform(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,refreshTransformUniform(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,refreshTransformUniform(t.specularIntensityMap,e.specularIntensityMapTransform))}function refreshUniformsMatcap(e,t){t.matcap&&(e.matcap.value=t.matcap)}function refreshUniformsDistance(e,n){let r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}return{refreshFogUniforms,refreshMaterialUniforms}}function WebGLUniformsGroups(e,t,n,r){let i={},a={},o=[],s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function bind(e,t){let n=t.program;r.uniformBlockBinding(e,n)}function update(e,n){let o=i[e.id];o===void 0&&(prepareUniformsGroup(e),o=createBuffer(e),i[e.id]=o,e.addEventListener(`dispose`,onUniformsGroupsDispose));let s=n.program;r.updateUBOMapping(e,s);let c=t.render.frame;a[e.id]!==c&&(updateBufferData(e),a[e.id]=c)}function createBuffer(t){let n=allocateBindingPointIndex();t.__bindingPointIndex=n;let r=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}function allocateBindingPointIndex(){for(let e=0;e<s;e++)if(o.indexOf(e)===-1)return o.push(e),e;return error(`WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.`),0}function updateBufferData(t){let n=i[t.id],r=t.uniforms,a=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let e=0,t=r.length;e<t;e++){let t=r[e];if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)updateUniform(t[n],e,n,a);else updateUniform(t,e,0,a)}e.bindBuffer(e.UNIFORM_BUFFER,null)}function updateUniform(t,n,r,i){if(hasUniformChanged(t,n,r,i)===!0){let n=t.__offset,r=t.value;if(Array.isArray(r)){let e=0;for(let n=0;n<r.length;n++){let i=r[n],a=getUniformSize(i);writeUniformValue(i,t.__data,e),typeof i!=`number`&&typeof i!=`boolean`&&!i.isMatrix3&&!ArrayBuffer.isView(i)&&(e+=a.storage/Float32Array.BYTES_PER_ELEMENT)}}else writeUniformValue(r,t.__data,0);e.bufferSubData(e.UNIFORM_BUFFER,n,t.__data)}}function writeUniformValue(e,t,n){typeof e==`number`||typeof e==`boolean`?t[0]=e:e.isMatrix3?(t[0]=e.elements[0],t[1]=e.elements[1],t[2]=e.elements[2],t[3]=0,t[4]=e.elements[3],t[5]=e.elements[4],t[6]=e.elements[5],t[7]=0,t[8]=e.elements[6],t[9]=e.elements[7],t[10]=e.elements[8],t[11]=0):ArrayBuffer.isView(e)?t.set(new e.constructor(e.buffer,e.byteOffset,t.length)):e.toArray(t,n)}function hasUniformChanged(e,t,n,r){let i=e.value,a=t+`_`+n;if(r[a]===void 0)return typeof i==`number`||typeof i==`boolean`?r[a]=i:ArrayBuffer.isView(i)?r[a]=i.slice():r[a]=i.clone(),!0;{let e=r[a];if(typeof i==`number`||typeof i==`boolean`){if(e!==i)return r[a]=i,!0}else if(ArrayBuffer.isView(i))return!0;else if(e.equals(i)===!1)return e.copy(i),!0}return!1}function prepareUniformsGroup(e){let t=e.uniforms,n=0;for(let e=0,r=t.length;e<r;e++){let r=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=r.length;e<t;e++){let t=r[e],i=Array.isArray(t.value)?t.value:[t.value];for(let e=0,r=i.length;e<r;e++){let r=i[e],a=getUniformSize(r),o=n%16,s=o%a.boundary,c=o+s;n+=s,c!==0&&16-c<a.storage&&(n+=16-c),t.__data=new Float32Array(a.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,n+=a.storage}}}let r=n%16;return r>0&&(n+=16-r),e.__size=n,e.__cache={},this}function getUniformSize(e){let t={boundary:0,storage:0};return typeof e==`number`||typeof e==`boolean`?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?warn(`WebGLRenderer: Texture samplers can not be part of an uniforms group.`):ArrayBuffer.isView(e)?(t.boundary=16,t.storage=e.byteLength):warn(`WebGLRenderer: Unsupported uniform value type.`,e),t}function onUniformsGroupsDispose(t){let n=t.target;n.removeEventListener(`dispose`,onUniformsGroupsDispose);let r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}function dispose(){for(let t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}return{bind,update,dispose}}const Gs=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Ks=null;function getDFGLUT(){return Ks===null&&(Ks=new DataTexture(Gs,16,16,ai,Zr),Ks.name=`DFG_LUT`,Ks.minFilter=Gr,Ks.magFilter=Gr,Ks.wrapS=Hr,Ks.wrapT=Hr,Ks.generateMipmaps=!1,Ks.needsUpdate=!0),Ks}var WebGLRenderer=class{constructor(e={}){let{canvas:t=createCanvasElement(),context:n=null,depth:r=!0,stencil:i=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:c=!1,powerPreference:l=`default`,failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1,outputBufferType:f=qr}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<`u`&&n instanceof WebGLRenderingContext)throw Error(`THREE.WebGLRenderer: WebGL 1 is not supported since r163.`);p=n.getContextAttributes().alpha}else p=a;let m=f,h=new Set([si,oi,ii]),g=new Set([qr,Yr,Jr,ei,Qr,$r]),_=new Uint32Array(4),v=new Int32Array(4),y=new P,b=null,x=null,S=[],C=[],w=null;this.domElement=t,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.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let T=this,E=!1,D=null,O=null,k=null,A=null;this._outputColorSpace=hi;let ee=0,te=0,j=null,ne=-1,re=null,ie=new Vi,ae=new Vi,oe=null,se=new Color(0),ce=0,le=t.width,ue=t.height,de=1,fe=null,pe=null,me=new Vi(0,0,le,ue),he=new Vi(0,0,le,ue),ge=!1,_e=new Frustum,ve=!1,ye=!1,be=new Hi,xe=new P,Se=new Vi,Ce={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},we=!1;function getTargetPixelRatio(){return j===null?de:1}let M=n;function getContext(e,n){return t.getContext(e,n)}try{let e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(`setAttribute`in t&&t.setAttribute(`data-engine`,`three.js r185`),t.addEventListener(`webglcontextlost`,onContextLost,!1),t.addEventListener(`webglcontextrestored`,onContextRestore,!1),t.addEventListener(`webglcontextcreationerror`,onContextCreationError,!1),M===null){let t=`webgl2`;if(M=getContext(t,e),M===null)throw getContext(t)?Error(`THREE.WebGLRenderer: Error creating WebGL context with your selected attributes.`):Error(`THREE.WebGLRenderer: Error creating WebGL context.`)}}catch(e){throw error(`WebGLRenderer: `+e.message),e}let Te,Ee,N,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We,Ge,Ke;function initGLContext(){Te=new WebGLExtensions(M),Te.init(),We=new WebGLUtils(M,Te),Ee=new WebGLCapabilities(M,Te,e,We),N=new WebGLState(M,Te),Ee.reversedDepthBuffer&&d&&N.buffers.depth.setReversed(!0),O=M.createFramebuffer(),k=M.createFramebuffer(),A=M.createFramebuffer(),De=new WebGLInfo(M),Oe=new WebGLProperties,ke=new WebGLTextures(M,Te,N,Oe,Ee,We,De),Ae=new WebGLEnvironments(T),je=new WebGLAttributes(M),Ge=new WebGLBindingStates(M,je),Me=new WebGLGeometries(M,je,De,Ge),Ne=new WebGLObjects(M,Me,je,Ge,De),Ve=new WebGLMorphtargets(M,Ee,ke),Re=new WebGLClipping(Oe),Pe=new WebGLPrograms(T,Ae,Te,Ee,Ge,Re),Fe=new WebGLMaterials(T,Oe),Ie=new WebGLRenderLists,Le=new WebGLRenderStates(Te),Be=new WebGLBackground(T,Ae,N,Ne,p,s),ze=new WebGLShadowMap(T,Ne,Ee),Ke=new WebGLUniformsGroups(M,De,Ee,N),He=new WebGLBufferRenderer(M,Te,De),Ue=new WebGLIndexedBufferRenderer(M,Te,De),De.programs=Pe.programs,T.capabilities=Ee,T.extensions=Te,T.properties=Oe,T.renderLists=Ie,T.shadowMap=ze,T.state=N,T.info=De}initGLContext(),m!==1009&&(w=new WebGLOutput(m,t.width,t.height,o,r,i));let qe=new WebXRManager(T,M);this.xr=qe,this.getContext=function(){return M},this.getContextAttributes=function(){return M.getContextAttributes()},this.forceContextLoss=function(){let e=Te.get(`WEBGL_lose_context`);e&&e.loseContext()},this.forceContextRestore=function(){let e=Te.get(`WEBGL_lose_context`);e&&e.restoreContext()},this.getPixelRatio=function(){return de},this.setPixelRatio=function(e){e!==void 0&&(de=e,this.setSize(le,ue,!1))},this.getSize=function(e){return e.set(le,ue)},this.setSize=function(e,n,r=!0){if(qe.isPresenting){warn(`WebGLRenderer: Can't change size while VR device is presenting.`);return}le=e,ue=n,t.width=Math.floor(e*de),t.height=Math.floor(n*de),r===!0&&(t.style.width=e+`px`,t.style.height=n+`px`),w!==null&&w.setSize(t.width,t.height),this.setViewport(0,0,e,n)},this.getDrawingBufferSize=function(e){return e.set(le*de,ue*de).floor()},this.setDrawingBufferSize=function(e,n,r){le=e,ue=n,de=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.setEffects=function(e){if(m===1009){error(`WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.`);return}if(e){for(let t=0;t<e.length;t++)if(e[t].isOutputPass===!0){warn(`WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.`);break}}w.setEffects(e||[])},this.getCurrentViewport=function(e){return e.copy(ie)},this.getViewport=function(e){return e.copy(me)},this.setViewport=function(e,t,n,r){e.isVector4?me.set(e.x,e.y,e.z,e.w):me.set(e,t,n,r),N.viewport(ie.copy(me).multiplyScalar(de).round())},this.getScissor=function(e){return e.copy(he)},this.setScissor=function(e,t,n,r){e.isVector4?he.set(e.x,e.y,e.z,e.w):he.set(e,t,n,r),N.scissor(ae.copy(he).multiplyScalar(de).round())},this.getScissorTest=function(){return ge},this.setScissorTest=function(e){N.setScissorTest(ge=e)},this.setOpaqueSort=function(e){fe=e},this.setTransparentSort=function(e){pe=e},this.getClearColor=function(e){return e.copy(Be.getClearColor())},this.setClearColor=function(){Be.setClearColor(...arguments)},this.getClearAlpha=function(){return Be.getClearAlpha()},this.setClearAlpha=function(){Be.setClearAlpha(...arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;if(e){let e=!1;if(j!==null){let t=j.texture.format;e=h.has(t)}if(e){let e=j.texture.type,t=g.has(e),n=Be.getClearColor(),r=Be.getClearAlpha(),i=n.r,a=n.g,o=n.b;t?(_[0]=i,_[1]=a,_[2]=o,_[3]=r,M.clearBufferuiv(M.COLOR,0,_)):(v[0]=i,v[1]=a,v[2]=o,v[3]=r,M.clearBufferiv(M.COLOR,0,v))}else r|=M.COLOR_BUFFER_BIT}t&&(r|=M.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),n&&(r|=M.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),r!==0&&M.clear(r)},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.setNodesHandler=function(e){e.setRenderer(this),D=e},this.dispose=function(){t.removeEventListener(`webglcontextlost`,onContextLost,!1),t.removeEventListener(`webglcontextrestored`,onContextRestore,!1),t.removeEventListener(`webglcontextcreationerror`,onContextCreationError,!1),Be.dispose(),Ie.dispose(),Le.dispose(),Oe.dispose(),Ae.dispose(),Ne.dispose(),Ge.dispose(),Ke.dispose(),Pe.dispose(),qe.dispose(),qe.removeEventListener(`sessionstart`,onXRSessionStart),qe.removeEventListener(`sessionend`,onXRSessionEnd),Ye.stop()};function onContextLost(e){e.preventDefault(),log(`WebGLRenderer: Context Lost.`),E=!0}function onContextRestore(){log(`WebGLRenderer: Context Restored.`),E=!1;let e=De.autoReset,t=ze.enabled,n=ze.autoUpdate,r=ze.needsUpdate,i=ze.type;initGLContext(),De.autoReset=e,ze.enabled=t,ze.autoUpdate=n,ze.needsUpdate=r,ze.type=i}function onContextCreationError(e){error(`WebGLRenderer: A WebGL context could not be created. Reason: `,e.statusMessage)}function onMaterialDispose(e){let t=e.target;t.removeEventListener(`dispose`,onMaterialDispose),deallocateMaterial(t)}function deallocateMaterial(e){releaseMaterialProgramReferences(e),Oe.remove(e)}function releaseMaterialProgramReferences(e){let t=Oe.get(e).programs;t!==void 0&&(t.forEach(function(e){Pe.releaseProgram(e)}),e.isShaderMaterial&&Pe.releaseShaderCache(e))}this.renderBufferDirect=function(e,t,n,r,i,a){t===null&&(t=Ce);let o=i.isMesh&&i.matrixWorld.determinantAffine()<0,s=setProgram(e,t,n,r,i);N.setMaterial(r,o);let c=n.index,l=1;if(r.wireframe===!0){if(c=Me.getWireframeAttribute(n),c===void 0)return;l=2}let u=n.drawRange,d=n.attributes.position,f=u.start*l,p=(u.start+u.count)*l;a!==null&&(f=Math.max(f,a.start*l),p=Math.min(p,(a.start+a.count)*l)),c===null?d!=null&&(f=Math.max(f,0),p=Math.min(p,d.count)):(f=Math.max(f,0),p=Math.min(p,c.count));let m=p-f;if(m<0||m===1/0)return;Ge.setup(i,r,s,n,c);let h,g=He;if(c!==null&&(h=je.get(c),g=Ue,g.setIndex(h)),i.isMesh)r.wireframe===!0?(N.setLineWidth(r.wireframeLinewidth*getTargetPixelRatio()),g.setMode(M.LINES)):g.setMode(M.TRIANGLES);else if(i.isLine){let e=r.linewidth;e===void 0&&(e=1),N.setLineWidth(e*getTargetPixelRatio()),i.isLineSegments?g.setMode(M.LINES):i.isLineLoop?g.setMode(M.LINE_LOOP):g.setMode(M.LINE_STRIP)}else i.isPoints?g.setMode(M.POINTS):i.isSprite&&g.setMode(M.TRIANGLES);if(i.isBatchedMesh)if(Te.get(`WEBGL_multi_draw`))g.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else{let e=i._multiDrawStarts,t=i._multiDrawCounts,n=i._multiDrawCount,a=c?je.get(c).bytesPerElement:1,o=Oe.get(r).currentProgram.getUniforms();for(let r=0;r<n;r++)o.setValue(M,`_gl_DrawID`,r),g.render(e[r]/a,t[r])}else if(i.isInstancedMesh)g.renderInstances(f,m,i.count);else if(n.isInstancedBufferGeometry){let e=n._maxInstanceCount===void 0?1/0:n._maxInstanceCount,t=Math.min(n.instanceCount,e);g.renderInstances(f,m,t)}else g.render(f,m)};function prepareMaterial(e,t,n){e.transparent===!0&&e.side===2&&e.forceSinglePass===!1?(e.side=1,e.needsUpdate=!0,getProgram(e,t,n),e.side=0,e.needsUpdate=!0,getProgram(e,t,n),e.side=2):getProgram(e,t,n)}this.compile=function(e,t,n=null){n===null&&(n=e),x=Le.get(n),x.init(t),C.push(x),n.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(x.pushLight(e),e.castShadow&&x.pushShadow(e))}),e!==n&&e.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(x.pushLight(e),e.castShadow&&x.pushShadow(e))}),x.setupLights();let r=new Set;return e.traverse(function(e){if(!(e.isMesh||e.isPoints||e.isLine||e.isSprite))return;let t=e.material;if(t)if(Array.isArray(t))for(let i=0;i<t.length;i++){let a=t[i];prepareMaterial(a,n,e),r.add(a)}else prepareMaterial(t,n,e),r.add(t)}),x=C.pop(),r},this.compileAsync=function(e,t,n=null){let r=this.compile(e,t,n);return new Promise(t=>{function checkMaterialsReady(){if(r.forEach(function(e){Oe.get(e).currentProgram.isReady()&&r.delete(e)}),r.size===0){t(e);return}setTimeout(checkMaterialsReady,10)}Te.get(`KHR_parallel_shader_compile`)===null?setTimeout(checkMaterialsReady,10):checkMaterialsReady()})};let Je=null;function onAnimationFrame(e){Je&&Je(e)}function onXRSessionStart(){Ye.stop()}function onXRSessionEnd(){Ye.start()}let Ye=new WebGLAnimation;Ye.setAnimationLoop(onAnimationFrame),typeof self<`u`&&Ye.setContext(self),this.setAnimationLoop=function(e){Je=e,qe.setAnimationLoop(e),e===null?Ye.stop():Ye.start()},qe.addEventListener(`sessionstart`,onXRSessionStart),qe.addEventListener(`sessionend`,onXRSessionEnd),this.render=function(e,t){if(t!==void 0&&t.isCamera!==!0){error(`WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(E===!0)return;D!==null&&D.renderStart(e,t);let n=qe.enabled===!0&&qe.isPresenting===!0,r=w!==null&&(j===null||n)&&w.begin(T,j);if(e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),qe.enabled===!0&&qe.isPresenting===!0&&(w===null||w.isCompositing()===!1)&&(qe.cameraAutoUpdate===!0&&qe.updateCamera(t),t=qe.getCamera()),e.isScene===!0&&e.onBeforeRender(T,e,t,j),x=Le.get(e,C.length),x.init(t),x.state.textureUnits=ke.getTextureUnits(),C.push(x),be.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),_e.setFromProjectionMatrix(be,bi,t.reversedDepth),ye=this.localClippingEnabled,ve=Re.init(this.clippingPlanes,ye),b=Ie.get(e,S.length),b.init(),S.push(b),qe.enabled===!0&&qe.isPresenting===!0){let e=T.xr.getDepthSensingMesh();e!==null&&projectObject(e,t,-1/0,T.sortObjects)}projectObject(e,t,0,T.sortObjects),b.finish(),T.sortObjects===!0&&b.sort(fe,pe,t.reversedDepth),we=qe.enabled===!1||qe.isPresenting===!1||qe.hasDepthSensing()===!1,we&&Be.addToRenderList(b,e),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),ve===!0&&Re.beginShadows();let i=x.state.shadowsArray;if(ze.render(i,e,t),ve===!0&&Re.endShadows(),(r&&w.hasRenderPass())===!1){let n=b.opaque,r=b.transmissive;if(x.setupLights(),t.isArrayCamera){let i=t.cameras;if(r.length>0)for(let t=0,a=i.length;t<a;t++){let a=i[t];renderTransmissionPass(n,r,e,a)}we&&Be.render(e);for(let t=0,n=i.length;t<n;t++){let n=i[t];renderScene(b,e,n,n.viewport)}}else r.length>0&&renderTransmissionPass(n,r,e,t),we&&Be.render(e),renderScene(b,e,t)}j!==null&&te===0&&(ke.updateMultisampleRenderTarget(j),ke.updateRenderTargetMipmap(j)),r&&w.end(T),e.isScene===!0&&e.onAfterRender(T,e,t),Ge.resetDefaultState(),ne=-1,re=null,C.pop(),C.length>0?(x=C[C.length-1],ke.setTextureUnits(x.state.textureUnits),ve===!0&&Re.setGlobalState(T.clippingPlanes,x.state.camera)):x=null,S.pop(),b=S.length>0?S[S.length-1]:null,D!==null&&D.renderEnd()};function projectObject(e,t,n,r){if(e.visible===!1)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLightProbeGrid)x.pushLightProbeGrid(e);else if(e.isLight)x.pushLight(e),e.castShadow&&x.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||_e.intersectsSprite(e)){r&&Se.setFromMatrixPosition(e.matrixWorld).applyMatrix4(be);let t=Ne.update(e),i=e.material;i.visible&&b.push(e,t,i,n,Se.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||_e.intersectsObject(e))){let t=Ne.update(e),i=e.material;if(r&&(e.boundingSphere===void 0?(t.boundingSphere===null&&t.computeBoundingSphere(),Se.copy(t.boundingSphere.center)):(e.boundingSphere===null&&e.computeBoundingSphere(),Se.copy(e.boundingSphere.center)),Se.applyMatrix4(e.matrixWorld).applyMatrix4(be)),Array.isArray(i)){let r=t.groups;for(let a=0,o=r.length;a<o;a++){let o=r[a],s=i[o.materialIndex];s&&s.visible&&b.push(e,t,s,n,Se.z,o)}}else i.visible&&b.push(e,t,i,n,Se.z,null)}}let i=e.children;for(let e=0,a=i.length;e<a;e++)projectObject(i[e],t,n,r)}function renderScene(e,t,n,r){let{opaque:i,transmissive:a,transparent:o}=e;x.setupLightsView(n),ve===!0&&Re.setGlobalState(T.clippingPlanes,n),r&&N.viewport(ie.copy(r)),i.length>0&&renderObjects(i,t,n),a.length>0&&renderObjects(a,t,n),o.length>0&&renderObjects(o,t,n),N.buffers.depth.setTest(!0),N.buffers.depth.setMask(!0),N.buffers.color.setMask(!0),N.setPolygonOffset(!1)}function renderTransmissionPass(e,t,n,r){if((n.isScene===!0?n.overrideMaterial:null)!==null)return;if(x.state.transmissionRenderTarget[r.id]===void 0){let e=Te.has(`EXT_color_buffer_half_float`)||Te.has(`EXT_color_buffer_float`);x.state.transmissionRenderTarget[r.id]=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:e?Zr:qr,minFilter:Kr,samples:Math.max(4,Ee.samples),stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Fi.workingColorSpace})}let a=x.state.transmissionRenderTarget[r.id],o=r.viewport||ie;a.setSize(o.z*T.transmissionResolutionScale,o.w*T.transmissionResolutionScale);let s=T.getRenderTarget(),c=T.getActiveCubeFace(),l=T.getActiveMipmapLevel();T.setRenderTarget(a),T.getClearColor(se),ce=T.getClearAlpha(),ce<1&&T.setClearColor(16777215,.5),T.clear(),we&&Be.render(n);let u=T.toneMapping;T.toneMapping=0;let d=r.viewport;if(r.viewport!==void 0&&(r.viewport=void 0),x.setupLightsView(r),ve===!0&&Re.setGlobalState(T.clippingPlanes,r),renderObjects(e,n,r),ke.updateMultisampleRenderTarget(a),ke.updateRenderTargetMipmap(a),Te.has(`WEBGL_multisampled_render_to_texture`)===!1){let e=!1;for(let i=0,a=t.length;i<a;i++){let{object:a,geometry:o,material:s,group:c}=t[i];if(s.side===2&&a.layers.test(r.layers)){let t=s.side;s.side=1,s.needsUpdate=!0,renderObject(a,n,r,o,s,c),s.side=t,s.needsUpdate=!0,e=!0}}e===!0&&(ke.updateMultisampleRenderTarget(a),ke.updateRenderTargetMipmap(a))}T.setRenderTarget(s,c,l),T.setClearColor(se,ce),d!==void 0&&(r.viewport=d),T.toneMapping=u}function renderObjects(e,t,n){let r=t.isScene===!0?t.overrideMaterial:null;for(let i=0,a=e.length;i<a;i++){let a=e[i],{object:o,geometry:s,group:c}=a,l=a.material;l.allowOverride===!0&&r!==null&&(l=r),o.layers.test(n.layers)&&renderObject(o,t,n,s,l,c)}}function renderObject(e,t,n,r,i,a){e.onBeforeRender(T,t,n,r,i,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(T,t,n,r,e,a),i.transparent===!0&&i.side===2&&i.forceSinglePass===!1?(i.side=1,i.needsUpdate=!0,T.renderBufferDirect(n,t,r,i,e,a),i.side=0,i.needsUpdate=!0,T.renderBufferDirect(n,t,r,i,e,a),i.side=2):T.renderBufferDirect(n,t,r,i,e,a),e.onAfterRender(T,t,n,r,i,a)}function getProgram(e,t,n){t.isScene!==!0&&(t=Ce);let r=Oe.get(e),i=x.state.lights,a=x.state.shadowsArray,o=i.state.version,s=Pe.getParameters(e,i.state,a,t,n,x.state.lightProbeGridArray),c=Pe.getProgramCacheKey(s),l=r.programs;r.environment=e.isMeshStandardMaterial||e.isMeshLambertMaterial||e.isMeshPhongMaterial?t.environment:null,r.fog=t.fog;let u=e.isMeshStandardMaterial||e.isMeshLambertMaterial&&!e.envMap||e.isMeshPhongMaterial&&!e.envMap;r.envMap=Ae.get(e.envMap||r.environment,u),r.envMapRotation=r.environment!==null&&e.envMap===null?t.environmentRotation:e.envMapRotation,l===void 0&&(e.addEventListener(`dispose`,onMaterialDispose),l=new Map,r.programs=l);let d=l.get(c);if(d!==void 0){if(r.currentProgram===d&&r.lightsStateVersion===o)return updateCommonMaterialProperties(e,s),d}else s.uniforms=Pe.getUniforms(e),D!==null&&e.isNodeMaterial&&D.build(e,n,s),e.onBeforeCompile(s,T),d=Pe.acquireProgram(s,c),l.set(c,d),r.uniforms=s.uniforms;let f=r.uniforms;return(!e.isShaderMaterial&&!e.isRawShaderMaterial||e.clipping===!0)&&(f.clippingPlanes=Re.uniform),updateCommonMaterialProperties(e,s),r.needsLights=materialNeedsLights(e),r.lightsStateVersion=o,r.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.directionalLightShadows.value=i.state.directionalShadow,f.spotLights.value=i.state.spot,f.spotLightShadows.value=i.state.spotShadow,f.rectAreaLights.value=i.state.rectArea,f.ltc_1.value=i.state.rectAreaLTC1,f.ltc_2.value=i.state.rectAreaLTC2,f.pointLights.value=i.state.point,f.pointLightShadows.value=i.state.pointShadow,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotLightMatrix.value=i.state.spotLightMatrix,f.spotLightMap.value=i.state.spotLightMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix),r.lightProbeGrid=x.state.lightProbeGridArray.length>0,r.currentProgram=d,r.uniformsList=null,d}function getUniformList(e){if(e.uniformsList===null){let t=e.currentProgram.getUniforms();e.uniformsList=WebGLUniforms.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function updateCommonMaterialProperties(e,t){let n=Oe.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}function findLightProbeGrid(e,t){if(e.length===0)return null;if(e.length===1)return e[0].texture===null?null:e[0];y.setFromMatrixPosition(t.matrixWorld);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n.texture!==null&&n.boundingBox.containsPoint(y))return n}return null}function setProgram(e,t,n,r,i){t.isScene!==!0&&(t=Ce),ke.resetTextureUnits();let a=t.fog,o=r.isMeshStandardMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial?t.environment:null,s=j===null?T.outputColorSpace:j.isXRRenderTarget===!0?j.texture.colorSpace:Fi.workingColorSpace,c=r.isMeshStandardMaterial||r.isMeshLambertMaterial&&!r.envMap||r.isMeshPhongMaterial&&!r.envMap,l=Ae.get(r.envMap||o,c),u=r.vertexColors===!0&&!!n.attributes.color&&n.attributes.color.itemSize===4,d=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),f=!!n.morphAttributes.position,p=!!n.morphAttributes.normal,m=!!n.morphAttributes.color,h=0;r.toneMapped&&(j===null||j.isXRRenderTarget===!0)&&(h=T.toneMapping);let g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,_=g===void 0?0:g.length,v=Oe.get(r),y=x.state.lights;if(ve===!0&&(ye===!0||e!==re)){let t=e===re&&r.id===ne;Re.setState(r,e,t)}let b=!1;r.version===v.__version?v.needsLights&&v.lightsStateVersion!==y.state.version?b=!0:v.outputColorSpace===s?i.isBatchedMesh&&v.batching===!1||!i.isBatchedMesh&&v.batching===!0||i.isBatchedMesh&&v.batchingColor===!0&&i.colorTexture===null||i.isBatchedMesh&&v.batchingColor===!1&&i.colorTexture!==null||i.isInstancedMesh&&v.instancing===!1||!i.isInstancedMesh&&v.instancing===!0||i.isSkinnedMesh&&v.skinning===!1||!i.isSkinnedMesh&&v.skinning===!0||i.isInstancedMesh&&v.instancingColor===!0&&i.instanceColor===null||i.isInstancedMesh&&v.instancingColor===!1&&i.instanceColor!==null||i.isInstancedMesh&&v.instancingMorph===!0&&i.morphTexture===null||i.isInstancedMesh&&v.instancingMorph===!1&&i.morphTexture!==null?b=!0:v.envMap===l?r.fog===!0&&v.fog!==a||v.numClippingPlanes!==void 0&&(v.numClippingPlanes!==Re.numPlanes||v.numIntersection!==Re.numIntersection)?b=!0:v.vertexAlphas===u&&v.vertexTangents===d&&v.morphTargets===f&&v.morphNormals===p&&v.morphColors===m&&v.toneMapping===h&&v.morphTargetsCount===_?!!v.lightProbeGrid!=x.state.lightProbeGridArray.length>0&&(b=!0):b=!0:b=!0:b=!0:(b=!0,v.__version=r.version);let S=v.currentProgram;b===!0&&(S=getProgram(r,t,i),D&&r.isNodeMaterial&&D.onUpdateProgram(r,S,v));let C=!1,w=!1,E=!1,O=S.getUniforms(),k=v.uniforms;if(N.useProgram(S.program)&&(C=!0,w=!0,E=!0),r.id!==ne&&(ne=r.id,w=!0),v.needsLights){let e=findLightProbeGrid(x.state.lightProbeGridArray,i);v.lightProbeGrid!==e&&(v.lightProbeGrid=e,w=!0)}if(C||re!==e){N.buffers.depth.getReversed()&&e.reversedDepth!==!0&&(e._reversedDepth=!0,e.updateProjectionMatrix()),O.setValue(M,`projectionMatrix`,e.projectionMatrix),O.setValue(M,`viewMatrix`,e.matrixWorldInverse);let t=O.map.cameraPosition;t!==void 0&&t.setValue(M,xe.setFromMatrixPosition(e.matrixWorld)),Ee.logarithmicDepthBuffer&&O.setValue(M,`logDepthBufFC`,2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&O.setValue(M,`isOrthographic`,e.isOrthographicCamera===!0),re!==e&&(re=e,w=!0,E=!0)}if(v.needsLights&&(y.state.directionalShadowMap.length>0&&O.setValue(M,`directionalShadowMap`,y.state.directionalShadowMap,ke),y.state.spotShadowMap.length>0&&O.setValue(M,`spotShadowMap`,y.state.spotShadowMap,ke),y.state.pointShadowMap.length>0&&O.setValue(M,`pointShadowMap`,y.state.pointShadowMap,ke)),i.isSkinnedMesh){O.setOptional(M,i,`bindMatrix`),O.setOptional(M,i,`bindMatrixInverse`);let e=i.skeleton;e&&(e.boneTexture===null&&e.computeBoneTexture(),O.setValue(M,`boneTexture`,e.boneTexture,ke))}i.isBatchedMesh&&(O.setOptional(M,i,`batchingTexture`),O.setValue(M,`batchingTexture`,i._matricesTexture,ke),O.setOptional(M,i,`batchingIdTexture`),O.setValue(M,`batchingIdTexture`,i._indirectTexture,ke),O.setOptional(M,i,`batchingColorTexture`),i._colorsTexture!==null&&O.setValue(M,`batchingColorTexture`,i._colorsTexture,ke));let A=n.morphAttributes;if((A.position!==void 0||A.normal!==void 0||A.color!==void 0)&&Ve.update(i,n,S),(w||v.receiveShadow!==i.receiveShadow)&&(v.receiveShadow=i.receiveShadow,O.setValue(M,`receiveShadow`,i.receiveShadow)),(r.isMeshStandardMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial)&&r.envMap===null&&t.environment!==null&&(k.envMapIntensity.value=t.environmentIntensity),k.dfgLUT!==void 0&&(k.dfgLUT.value=getDFGLUT()),w){if(O.setValue(M,`toneMappingExposure`,T.toneMappingExposure),v.needsLights&&markUniformsLightsNeedsUpdate(k,E),a&&r.fog===!0&&Fe.refreshFogUniforms(k,a),Fe.refreshMaterialUniforms(k,r,de,ue,x.state.transmissionRenderTarget[e.id]),v.needsLights&&v.lightProbeGrid){let e=v.lightProbeGrid;k.probesSH.value=e.texture,k.probesMin.value.copy(e.boundingBox.min),k.probesMax.value.copy(e.boundingBox.max),k.probesResolution.value.copy(e.resolution)}WebGLUniforms.upload(M,getUniformList(v),k,ke)}if(r.isShaderMaterial&&r.uniformsNeedUpdate===!0&&(WebGLUniforms.upload(M,getUniformList(v),k,ke),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&O.setValue(M,`center`,i.center),O.setValue(M,`modelViewMatrix`,i.modelViewMatrix),O.setValue(M,`normalMatrix`,i.normalMatrix),O.setValue(M,`modelMatrix`,i.matrixWorld),r.uniformsGroups!==void 0){let e=r.uniformsGroups;for(let t=0,n=e.length;t<n;t++){let n=e[t];Ke.update(n,S),Ke.bind(n,S)}}return S}function markUniformsLightsNeedsUpdate(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}function materialNeedsLights(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&e.lights===!0}this.getActiveCubeFace=function(){return ee},this.getActiveMipmapLevel=function(){return te},this.getRenderTarget=function(){return j},this.setRenderTargetTextures=function(e,t,n){let r=Oe.get(e);r.__autoAllocateDepthBuffer=e.resolveDepthBuffer===!1,r.__autoAllocateDepthBuffer===!1&&(r.__useRenderToTexture=!1),Oe.get(e.texture).__webglTexture=t,Oe.get(e.depthTexture).__webglTexture=r.__autoAllocateDepthBuffer?void 0:n,r.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){let n=Oe.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=t===void 0},this.setRenderTarget=function(e,t=0,n=0){j=e,ee=t,te=n;let r=null,i=!1,a=!1;if(e){let o=Oe.get(e);if(o.__useDefaultFramebuffer!==void 0){N.bindFramebuffer(M.FRAMEBUFFER,o.__webglFramebuffer),ie.copy(e.viewport),ae.copy(e.scissor),oe=e.scissorTest,N.viewport(ie),N.scissor(ae),N.setScissorTest(oe),ne=-1;return}else if(o.__webglFramebuffer===void 0)ke.setupRenderTarget(e);else if(o.__hasExternalTextures)ke.rebindTextures(e,Oe.get(e.texture).__webglTexture,Oe.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let t=e.depthTexture;if(o.__boundDepthTexture!==t){if(t!==null&&Oe.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw Error(`THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.`);ke.setupDepthRenderbuffer(e)}}let s=e.texture;(s.isData3DTexture||s.isDataArrayTexture||s.isCompressedArrayTexture)&&(a=!0);let c=Oe.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=Array.isArray(c[t])?c[t][n]:c[t],i=!0):r=e.samples>0&&ke.useMultisampledRTT(e)===!1?Oe.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,ie.copy(e.viewport),ae.copy(e.scissor),oe=e.scissorTest}else ie.copy(me).multiplyScalar(de).floor(),ae.copy(he).multiplyScalar(de).floor(),oe=ge;if(n!==0&&(r=O),N.bindFramebuffer(M.FRAMEBUFFER,r)&&N.drawBuffers(e,r),N.viewport(ie),N.scissor(ae),N.setScissorTest(oe),i){let r=Oe.get(e.texture);M.framebufferTexture2D(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0,M.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(a){let r=t;for(let t=0;t<e.textures.length;t++){let i=Oe.get(e.textures[t]);M.framebufferTextureLayer(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0+t,i.__webglTexture,n,r)}}else if(e!==null&&n!==0){let t=Oe.get(e.texture);M.framebufferTexture2D(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0,M.TEXTURE_2D,t.__webglTexture,n)}ne=-1},this.readRenderTargetPixels=function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget)){error(`WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);return}let c=Oe.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c){N.bindFramebuffer(M.FRAMEBUFFER,c);try{let o=e.textures[s],c=o.format,l=o.type;if(e.textures.length>1&&M.readBuffer(M.COLOR_ATTACHMENT0+s),!Ee.textureFormatReadable(c)){error(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.`);return}if(!Ee.textureTypeReadable(l)){error(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.`);return}t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&M.readPixels(t,n,r,i,We.convert(c),We.convert(l),a)}finally{let e=j===null?null:Oe.get(j).__webglFramebuffer;N.bindFramebuffer(M.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget))throw Error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);let c=Oe.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c)if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){N.bindFramebuffer(M.FRAMEBUFFER,c);let o=e.textures[s],l=o.format,u=o.type;if(e.textures.length>1&&M.readBuffer(M.COLOR_ATTACHMENT0+s),!Ee.textureFormatReadable(l))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.`);if(!Ee.textureTypeReadable(u))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.`);let d=M.createBuffer();M.bindBuffer(M.PIXEL_PACK_BUFFER,d),M.bufferData(M.PIXEL_PACK_BUFFER,a.byteLength,M.STREAM_READ),M.readPixels(t,n,r,i,We.convert(l),We.convert(u),0);let f=j===null?null:Oe.get(j).__webglFramebuffer;N.bindFramebuffer(M.FRAMEBUFFER,f);let p=M.fenceSync(M.SYNC_GPU_COMMANDS_COMPLETE,0);return M.flush(),await probeAsync(M,p,4),M.bindBuffer(M.PIXEL_PACK_BUFFER,d),M.getBufferSubData(M.PIXEL_PACK_BUFFER,0,a),M.deleteBuffer(d),M.deleteSync(p),a}else throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.`)},this.copyFramebufferToTexture=function(e,t=null,n=0){let r=2**-n,i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=t===null?0:t.x,s=t===null?0:t.y;ke.setTexture2D(e,0),M.copyTexSubImage2D(M.TEXTURE_2D,n,0,0,o,s,i,a),N.unbindTexture()},this.copyTextureToTexture=function(e,t,n=null,r=null,i=0,a=0){let o,s,c,l,u,d,f,p,m,h=e.isCompressedTexture?e.mipmaps[a]:e.image;if(n!==null)o=n.max.x-n.min.x,s=n.max.y-n.min.y,c=n.isBox3?n.max.z-n.min.z:1,l=n.min.x,u=n.min.y,d=n.isBox3?n.min.z:0;else{let t=2**-i;o=Math.floor(h.width*t),s=Math.floor(h.height*t),c=e.isDataArrayTexture?h.depth:e.isData3DTexture?Math.floor(h.depth*t):1,l=0,u=0,d=0}r===null?(f=0,p=0,m=0):(f=r.x,p=r.y,m=r.z);let g=We.convert(t.format),_=We.convert(t.type),v;t.isData3DTexture?(ke.setTexture3D(t,0),v=M.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(ke.setTexture2DArray(t,0),v=M.TEXTURE_2D_ARRAY):(ke.setTexture2D(t,0),v=M.TEXTURE_2D),N.activeTexture(M.TEXTURE0),N.pixelStorei(M.UNPACK_FLIP_Y_WEBGL,t.flipY),N.pixelStorei(M.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),N.pixelStorei(M.UNPACK_ALIGNMENT,t.unpackAlignment);let y=N.getParameter(M.UNPACK_ROW_LENGTH),b=N.getParameter(M.UNPACK_IMAGE_HEIGHT),x=N.getParameter(M.UNPACK_SKIP_PIXELS),S=N.getParameter(M.UNPACK_SKIP_ROWS),C=N.getParameter(M.UNPACK_SKIP_IMAGES);N.pixelStorei(M.UNPACK_ROW_LENGTH,h.width),N.pixelStorei(M.UNPACK_IMAGE_HEIGHT,h.height),N.pixelStorei(M.UNPACK_SKIP_PIXELS,l),N.pixelStorei(M.UNPACK_SKIP_ROWS,u),N.pixelStorei(M.UNPACK_SKIP_IMAGES,d);let w=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=Oe.get(e),r=Oe.get(t),h=Oe.get(n.__renderTarget),g=Oe.get(r.__renderTarget);N.bindFramebuffer(M.READ_FRAMEBUFFER,h.__webglFramebuffer),N.bindFramebuffer(M.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let n=0;n<c;n++)w&&(M.framebufferTextureLayer(M.READ_FRAMEBUFFER,M.COLOR_ATTACHMENT0,Oe.get(e).__webglTexture,i,d+n),M.framebufferTextureLayer(M.DRAW_FRAMEBUFFER,M.COLOR_ATTACHMENT0,Oe.get(t).__webglTexture,a,m+n)),M.blitFramebuffer(l,u,o,s,f,p,o,s,M.DEPTH_BUFFER_BIT,M.NEAREST);N.bindFramebuffer(M.READ_FRAMEBUFFER,null),N.bindFramebuffer(M.DRAW_FRAMEBUFFER,null)}else if(i!==0||e.isRenderTargetTexture||Oe.has(e)){let n=Oe.get(e),r=Oe.get(t);N.bindFramebuffer(M.READ_FRAMEBUFFER,k),N.bindFramebuffer(M.DRAW_FRAMEBUFFER,A);for(let e=0;e<c;e++)w?M.framebufferTextureLayer(M.READ_FRAMEBUFFER,M.COLOR_ATTACHMENT0,n.__webglTexture,i,d+e):M.framebufferTexture2D(M.READ_FRAMEBUFFER,M.COLOR_ATTACHMENT0,M.TEXTURE_2D,n.__webglTexture,i),T?M.framebufferTextureLayer(M.DRAW_FRAMEBUFFER,M.COLOR_ATTACHMENT0,r.__webglTexture,a,m+e):M.framebufferTexture2D(M.DRAW_FRAMEBUFFER,M.COLOR_ATTACHMENT0,M.TEXTURE_2D,r.__webglTexture,a),i===0?T?M.copyTexSubImage3D(v,a,f,p,m+e,l,u,o,s):M.copyTexSubImage2D(v,a,f,p,l,u,o,s):M.blitFramebuffer(l,u,o,s,f,p,o,s,M.COLOR_BUFFER_BIT,M.NEAREST);N.bindFramebuffer(M.READ_FRAMEBUFFER,null),N.bindFramebuffer(M.DRAW_FRAMEBUFFER,null)}else T?e.isDataTexture||e.isData3DTexture?M.texSubImage3D(v,a,f,p,m,o,s,c,g,_,h.data):t.isCompressedArrayTexture?M.compressedTexSubImage3D(v,a,f,p,m,o,s,c,g,h.data):M.texSubImage3D(v,a,f,p,m,o,s,c,g,_,h):e.isDataTexture?M.texSubImage2D(M.TEXTURE_2D,a,f,p,o,s,g,_,h.data):e.isCompressedTexture?M.compressedTexSubImage2D(M.TEXTURE_2D,a,f,p,h.width,h.height,g,h.data):M.texSubImage2D(M.TEXTURE_2D,a,f,p,o,s,g,_,h);N.pixelStorei(M.UNPACK_ROW_LENGTH,y),N.pixelStorei(M.UNPACK_IMAGE_HEIGHT,b),N.pixelStorei(M.UNPACK_SKIP_PIXELS,x),N.pixelStorei(M.UNPACK_SKIP_ROWS,S),N.pixelStorei(M.UNPACK_SKIP_IMAGES,C),a===0&&t.generateMipmaps&&M.generateMipmap(v),N.unbindTexture()},this.initRenderTarget=function(e){Oe.get(e).__webglFramebuffer===void 0&&ke.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?ke.setTextureCube(e,0):e.isData3DTexture?ke.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?ke.setTexture2DArray(e,0):ke.setTexture2D(e,0),N.unbindTexture()},this.resetState=function(){ee=0,te=0,j=null,N.reset(),Ge.reset()},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}get coordinateSystem(){return bi}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=Fi._getDrawingBufferColorSpace(e),t.unpackColorSpace=Fi._getUnpackColorSpace()}};const qs={type:`change`},Js={type:`start`},Ys={type:`end`},Xs=new Ray,Zs=new Plane,Qs=Math.cos(70*Di.DEG2RAD),$s=new P,ec=2*Math.PI,tc={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},nc=1e-6;var OrbitControls=class extends Controls{constructor(e,t=null){super(e,t),this.state=tc.NONE,this.target=new P,this.cursor=new P,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`},this.mouseButtons={LEFT:zr.ROTATE,MIDDLE:zr.DOLLY,RIGHT:zr.PAN},this.touches={ONE:Br.ROTATE,TWO:Br.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle=`auto`,this._domElementKeyEvents=null,this._lastPosition=new P,this._lastQuaternion=new Quaternion,this._lastTargetPosition=new P,this._quat=new Quaternion().setFromUnitVectors(e.up,new P(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Spherical,this._sphericalDelta=new Spherical,this._scale=1,this._panOffset=new P,this._rotateStart=new Oi,this._rotateEnd=new Oi,this._rotateDelta=new Oi,this._panStart=new Oi,this._panEnd=new Oi,this._panDelta=new Oi,this._dollyStart=new Oi,this._dollyEnd=new Oi,this._dollyDelta=new Oi,this._dollyDirection=new P,this._mouse=new Oi,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=onPointerMove.bind(this),this._onPointerDown=onPointerDown.bind(this),this._onPointerUp=onPointerUp.bind(this),this._onContextMenu=onContextMenu.bind(this),this._onMouseWheel=onMouseWheel.bind(this),this._onKeyDown=onKeyDown.bind(this),this._onTouchStart=onTouchStart.bind(this),this._onTouchMove=onTouchMove.bind(this),this._onMouseDown=onMouseDown.bind(this),this._onMouseMove=onMouseMove.bind(this),this._interceptControlDown=interceptControlDown.bind(this),this._interceptControlUp=interceptControlUp.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(e){this._cursorStyle=e,e===`grab`?this.domElement.style.cursor=`grab`:this.domElement.style.cursor=`auto`}get cursorStyle(){return this._cursorStyle}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointercancel`,this._onPointerUp),this.domElement.addEventListener(`contextmenu`,this._onContextMenu),this.domElement.addEventListener(`wheel`,this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener(`keydown`,this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.removeEventListener(`pointercancel`,this._onPointerUp),this.domElement.removeEventListener(`wheel`,this._onMouseWheel),this.domElement.removeEventListener(`contextmenu`,this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener(`keydown`,this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=``}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(qs),this.update(),this.state=tc.NONE}pan(e,t){this._pan(e,t),this.update()}dollyIn(e){this._dollyIn(e),this.update()}dollyOut(e){this._dollyOut(e),this.update()}rotateLeft(e){this._rotateLeft(e),this.update()}rotateUp(e){this._rotateUp(e),this.update()}update(e=null){let t=this.object.position;$s.copy(t).sub(this.target),$s.applyQuaternion(this._quat),this._spherical.setFromVector3($s),this.autoRotate&&this.state===tc.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=ec:n>Math.PI&&(n-=ec),r<-Math.PI?r+=ec:r>Math.PI&&(r-=ec),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if($s.setFromSpherical(this._spherical),$s.applyQuaternion(this._quatInverse),t.copy(this.target).add($s),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=$s.length();e=this._clampDistance(t*this._scale);let n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){let t=new P(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;let r=new P(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=$s.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),this.zoomToCursor=!1;e!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(Xs.origin.copy(this.object.position),Xs.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Xs.direction))<Qs?this.object.lookAt(this.target):(Zs.setFromNormalAndCoplanarPoint(this.object.up,this.target),Xs.intersectPlane(Zs,this.target))))}else if(this.object.isOrthographicCamera){let e=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),e!==this.object.zoom&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,this._performCursorZoom=!1,i||this._lastPosition.distanceToSquared(this.object.position)>nc||8*(1-this._lastQuaternion.dot(this.object.quaternion))>nc||this._lastTargetPosition.distanceToSquared(this.target)>nc?(this.dispatchEvent(qs),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?ec/60/60*this.autoRotateSpeed:ec/60*this.autoRotateSpeed*e}_getZoomScale(e){let t=Math.abs(e*.01);return .95**(this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){$s.setFromMatrixColumn(t,0),$s.multiplyScalar(-e),this._panOffset.add($s)}_panUp(e,t){this.screenSpacePanning===!0?$s.setFromMatrixColumn(t,1):($s.setFromMatrixColumn(t,0),$s.crossVectors(this.object.up,$s)),$s.multiplyScalar(e),this._panOffset.add($s)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;$s.copy(r).sub(this.target);let i=$s.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,a=n.width,o=n.height;this._mouse.x=r/a*2-1,this._mouse.y=-(i/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(ec*this._rotateDelta.x/t.clientHeight),this._rotateUp(ec*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(ec*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-ec*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(ec*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-ec*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(ec*this._rotateDelta.x/t.clientHeight),this._rotateUp(ec*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,(this._dollyEnd.y/this._dollyStart.y)**+this.zoomSpeed),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new Oi,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){let t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){let t=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}};function onPointerDown(e){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(e.pointerId),this.domElement.ownerDocument.addEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.addEventListener(`pointerup`,this._onPointerUp)),!this._isTrackingPointer(e)&&(this._addPointer(e),e.pointerType===`touch`?this._onTouchStart(e):this._onMouseDown(e),this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grabbing`)))}function onPointerMove(e){this.enabled!==!1&&(e.pointerType===`touch`?this._onTouchMove(e):this._onMouseMove(e))}function onPointerUp(e){switch(this._removePointer(e),this._pointers.length){case 0:this.domElement.releasePointerCapture(e.pointerId),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.dispatchEvent(Ys),this.state=tc.NONE,this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grab`);break;case 1:let t=this._pointers[0],n=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:n.x,pageY:n.y});break}}function onMouseDown(e){let t;switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case zr.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(e),this.state=tc.DOLLY;break;case zr.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=tc.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=tc.ROTATE}break;case zr.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=tc.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=tc.PAN}break;default:this.state=tc.NONE}this.state!==tc.NONE&&this.dispatchEvent(Js)}function onMouseMove(e){switch(this.state){case tc.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(e);break;case tc.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(e);break;case tc.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(e);break}}function onMouseWheel(e){this.enabled===!1||this.enableZoom===!1||this.state!==tc.NONE||(e.preventDefault(),this.dispatchEvent(Js),this._handleMouseWheel(this._customWheelEvent(e)),this.dispatchEvent(Ys))}function onKeyDown(e){this.enabled!==!1&&this._handleKeyDown(e)}function onTouchStart(e){switch(this._trackPointer(e),this._pointers.length){case 1:switch(this.touches.ONE){case Br.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(e),this.state=tc.TOUCH_ROTATE;break;case Br.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(e),this.state=tc.TOUCH_PAN;break;default:this.state=tc.NONE}break;case 2:switch(this.touches.TWO){case Br.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(e),this.state=tc.TOUCH_DOLLY_PAN;break;case Br.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(e),this.state=tc.TOUCH_DOLLY_ROTATE;break;default:this.state=tc.NONE}break;default:this.state=tc.NONE}this.state!==tc.NONE&&this.dispatchEvent(Js)}function onTouchMove(e){switch(this._trackPointer(e),this.state){case tc.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(e),this.update();break;case tc.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(e),this.update();break;case tc.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(e),this.update();break;case tc.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(e),this.update();break;default:this.state=tc.NONE}}function onContextMenu(e){this.enabled!==!1&&e.preventDefault()}function interceptControlDown(e){e.key===`Control`&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}function interceptControlUp(e){e.key===`Control`&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}var TeapotGeometry=class extends oo{constructor(e=50,t=10,n=!0,r=!0,i=!0,a=!0,o=!0){let s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,3,16,17,18,7,19,20,21,11,22,23,24,15,25,26,27,18,28,29,30,21,31,32,33,24,34,35,36,27,37,38,39,30,40,41,0,33,42,43,4,36,44,45,8,39,46,47,12,12,13,14,15,48,49,50,51,52,53,54,55,56,57,58,59,15,25,26,27,51,60,61,62,55,63,64,65,59,66,67,68,27,37,38,39,62,69,70,71,65,72,73,74,68,75,76,77,39,46,47,12,71,78,79,48,74,80,81,52,77,82,83,56,56,57,58,59,84,85,86,87,88,89,90,91,92,93,94,95,59,66,67,68,87,96,97,98,91,99,100,101,95,102,103,104,68,75,76,77,98,105,106,107,101,108,109,110,104,111,112,113,77,82,83,56,107,114,115,84,110,116,117,88,113,118,119,92,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,123,136,137,120,127,138,139,124,131,140,141,128,135,142,143,132,132,133,134,135,144,145,146,147,148,149,150,151,68,152,153,154,135,142,143,132,147,155,156,144,151,157,158,148,154,159,160,68,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,164,177,178,161,168,179,180,165,172,181,182,169,176,183,184,173,173,174,175,176,185,186,187,188,189,190,191,192,193,194,195,196,176,183,184,173,188,197,198,185,192,199,200,189,196,201,202,193,203,203,203,203,204,205,206,207,208,208,208,208,209,210,211,212,203,203,203,203,207,213,214,215,208,208,208,208,212,216,217,218,203,203,203,203,215,219,220,221,208,208,208,208,218,222,223,224,203,203,203,203,221,225,226,204,208,208,208,208,224,227,228,209,209,210,211,212,229,230,231,232,233,234,235,236,237,238,239,240,212,216,217,218,232,241,242,243,236,244,245,246,240,247,248,249,218,222,223,224,243,250,251,252,246,253,254,255,249,256,257,258,224,227,228,209,252,259,260,229,255,261,262,233,258,263,264,237,265,265,265,265,266,267,268,269,270,271,272,273,92,119,118,113,265,265,265,265,269,274,275,276,273,277,278,279,113,112,111,104,265,265,265,265,276,280,281,282,279,283,284,285,104,103,102,95,265,265,265,265,282,286,287,266,285,288,289,270,95,94,93,92],c=[1.4,0,2.4,1.4,-.784,2.4,.784,-1.4,2.4,0,-1.4,2.4,1.3375,0,2.53125,1.3375,-.749,2.53125,.749,-1.3375,2.53125,0,-1.3375,2.53125,1.4375,0,2.53125,1.4375,-.805,2.53125,.805,-1.4375,2.53125,0,-1.4375,2.53125,1.5,0,2.4,1.5,-.84,2.4,.84,-1.5,2.4,0,-1.5,2.4,-.784,-1.4,2.4,-1.4,-.784,2.4,-1.4,0,2.4,-.749,-1.3375,2.53125,-1.3375,-.749,2.53125,-1.3375,0,2.53125,-.805,-1.4375,2.53125,-1.4375,-.805,2.53125,-1.4375,0,2.53125,-.84,-1.5,2.4,-1.5,-.84,2.4,-1.5,0,2.4,-1.4,.784,2.4,-.784,1.4,2.4,0,1.4,2.4,-1.3375,.749,2.53125,-.749,1.3375,2.53125,0,1.3375,2.53125,-1.4375,.805,2.53125,-.805,1.4375,2.53125,0,1.4375,2.53125,-1.5,.84,2.4,-.84,1.5,2.4,0,1.5,2.4,.784,1.4,2.4,1.4,.784,2.4,.749,1.3375,2.53125,1.3375,.749,2.53125,.805,1.4375,2.53125,1.4375,.805,2.53125,.84,1.5,2.4,1.5,.84,2.4,1.75,0,1.875,1.75,-.98,1.875,.98,-1.75,1.875,0,-1.75,1.875,2,0,1.35,2,-1.12,1.35,1.12,-2,1.35,0,-2,1.35,2,0,.9,2,-1.12,.9,1.12,-2,.9,0,-2,.9,-.98,-1.75,1.875,-1.75,-.98,1.875,-1.75,0,1.875,-1.12,-2,1.35,-2,-1.12,1.35,-2,0,1.35,-1.12,-2,.9,-2,-1.12,.9,-2,0,.9,-1.75,.98,1.875,-.98,1.75,1.875,0,1.75,1.875,-2,1.12,1.35,-1.12,2,1.35,0,2,1.35,-2,1.12,.9,-1.12,2,.9,0,2,.9,.98,1.75,1.875,1.75,.98,1.875,1.12,2,1.35,2,1.12,1.35,1.12,2,.9,2,1.12,.9,2,0,.45,2,-1.12,.45,1.12,-2,.45,0,-2,.45,1.5,0,.225,1.5,-.84,.225,.84,-1.5,.225,0,-1.5,.225,1.5,0,.15,1.5,-.84,.15,.84,-1.5,.15,0,-1.5,.15,-1.12,-2,.45,-2,-1.12,.45,-2,0,.45,-.84,-1.5,.225,-1.5,-.84,.225,-1.5,0,.225,-.84,-1.5,.15,-1.5,-.84,.15,-1.5,0,.15,-2,1.12,.45,-1.12,2,.45,0,2,.45,-1.5,.84,.225,-.84,1.5,.225,0,1.5,.225,-1.5,.84,.15,-.84,1.5,.15,0,1.5,.15,1.12,2,.45,2,1.12,.45,.84,1.5,.225,1.5,.84,.225,.84,1.5,.15,1.5,.84,.15,-1.6,0,2.025,-1.6,-.3,2.025,-1.5,-.3,2.25,-1.5,0,2.25,-2.3,0,2.025,-2.3,-.3,2.025,-2.5,-.3,2.25,-2.5,0,2.25,-2.7,0,2.025,-2.7,-.3,2.025,-3,-.3,2.25,-3,0,2.25,-2.7,0,1.8,-2.7,-.3,1.8,-3,-.3,1.8,-3,0,1.8,-1.5,.3,2.25,-1.6,.3,2.025,-2.5,.3,2.25,-2.3,.3,2.025,-3,.3,2.25,-2.7,.3,2.025,-3,.3,1.8,-2.7,.3,1.8,-2.7,0,1.575,-2.7,-.3,1.575,-3,-.3,1.35,-3,0,1.35,-2.5,0,1.125,-2.5,-.3,1.125,-2.65,-.3,.9375,-2.65,0,.9375,-2,-.3,.9,-1.9,-.3,.6,-1.9,0,.6,-3,.3,1.35,-2.7,.3,1.575,-2.65,.3,.9375,-2.5,.3,1.125,-1.9,.3,.6,-2,.3,.9,1.7,0,1.425,1.7,-.66,1.425,1.7,-.66,.6,1.7,0,.6,2.6,0,1.425,2.6,-.66,1.425,3.1,-.66,.825,3.1,0,.825,2.3,0,2.1,2.3,-.25,2.1,2.4,-.25,2.025,2.4,0,2.025,2.7,0,2.4,2.7,-.25,2.4,3.3,-.25,2.4,3.3,0,2.4,1.7,.66,.6,1.7,.66,1.425,3.1,.66,.825,2.6,.66,1.425,2.4,.25,2.025,2.3,.25,2.1,3.3,.25,2.4,2.7,.25,2.4,2.8,0,2.475,2.8,-.25,2.475,3.525,-.25,2.49375,3.525,0,2.49375,2.9,0,2.475,2.9,-.15,2.475,3.45,-.15,2.5125,3.45,0,2.5125,2.8,0,2.4,2.8,-.15,2.4,3.2,-.15,2.4,3.2,0,2.4,3.525,.25,2.49375,2.8,.25,2.475,3.45,.15,2.5125,2.9,.15,2.475,3.2,.15,2.4,2.8,.15,2.4,0,0,3.15,.8,0,3.15,.8,-.45,3.15,.45,-.8,3.15,0,-.8,3.15,0,0,2.85,.2,0,2.7,.2,-.112,2.7,.112,-.2,2.7,0,-.2,2.7,-.45,-.8,3.15,-.8,-.45,3.15,-.8,0,3.15,-.112,-.2,2.7,-.2,-.112,2.7,-.2,0,2.7,-.8,.45,3.15,-.45,.8,3.15,0,.8,3.15,-.2,.112,2.7,-.112,.2,2.7,0,.2,2.7,.45,.8,3.15,.8,.45,3.15,.112,.2,2.7,.2,.112,2.7,.4,0,2.55,.4,-.224,2.55,.224,-.4,2.55,0,-.4,2.55,1.3,0,2.55,1.3,-.728,2.55,.728,-1.3,2.55,0,-1.3,2.55,1.3,0,2.4,1.3,-.728,2.4,.728,-1.3,2.4,0,-1.3,2.4,-.224,-.4,2.55,-.4,-.224,2.55,-.4,0,2.55,-.728,-1.3,2.55,-1.3,-.728,2.55,-1.3,0,2.55,-.728,-1.3,2.4,-1.3,-.728,2.4,-1.3,0,2.4,-.4,.224,2.55,-.224,.4,2.55,0,.4,2.55,-1.3,.728,2.55,-.728,1.3,2.55,0,1.3,2.55,-1.3,.728,2.4,-.728,1.3,2.4,0,1.3,2.4,.224,.4,2.55,.4,.224,2.55,.728,1.3,2.55,1.3,.728,2.55,.728,1.3,2.4,1.3,.728,2.4,0,0,0,1.425,0,0,1.425,.798,0,.798,1.425,0,0,1.425,0,1.5,0,.075,1.5,.84,.075,.84,1.5,.075,0,1.5,.075,-.798,1.425,0,-1.425,.798,0,-1.425,0,0,-.84,1.5,.075,-1.5,.84,.075,-1.5,0,.075,-1.425,-.798,0,-.798,-1.425,0,0,-1.425,0,-1.5,-.84,.075,-.84,-1.5,.075,0,-1.5,.075,.798,-1.425,0,1.425,-.798,0,.84,-1.5,.075,1.5,-.84,.075];super(),t=Math.max(2,Math.floor(t));let l=1.3,u=3.15*(o?1:l)/2,d=e/u,f=n?(8*t-4)*t:0;f+=r?(16*t-4)*t:0,f+=i?40*t*t:0;let p=new Uint32Array(f*3),m=n?4:0;m+=r?8:0,m+=i?20:0,m*=(t+1)*(t+1);let h=new Float32Array(m*3),g=new Float32Array(m*3),_=new Float32Array(m*2),v=new Hi;v.set(-1,3,-3,1,3,-6,3,0,-3,3,0,0,1,0,0,0);let y=[],b=[],x=[],S=[],C=[],w=[],T=[],E=[],D=[],O=new P,k,A,ee,te,j=0,ne=0,re=new P,ie=new Hi,ae=new Hi,oe=new Vi,se=new Vi,ce=new Vi,le=new Vi,ue=new P,de=new P,fe=v.clone();fe.transpose();let notDegenerate=(e,t,n)=>!(h[e*3]===h[t*3]&&h[e*3+1]===h[t*3+1]&&h[e*3+2]===h[t*3+2]||h[e*3]===h[n*3]&&h[e*3+1]===h[n*3+1]&&h[e*3+2]===h[n*3+2]||h[t*3]===h[n*3]&&h[t*3+1]===h[n*3+1]&&h[t*3+2]===h[n*3+2]);for(let e=0;e<3;e++)w[e]=new Hi;let pe=i?0:20,me=n?32:28,he=t+1,ge=0,_e=0,ve=0,ye=0,be=0;for(let e=pe;e<me;e++)if(r||e<20||e>=28){for(let t=0;t<3;t++){for(let n=0;n<4;n++)for(let r=0;r<4;r++)y[r*4+n]=c[s[e*16+n*4+r]*3+t],a&&e>=20&&e<28&&t!==2&&(y[r*4+n]*=1.077),!o&&t===2&&(y[r*4+n]*=l);ie.set(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),ae.multiplyMatrices(ie,v),w[t].multiplyMatrices(fe,ae)}for(let e=0;e<=t;e++){let n=e/t;for(let e=0;e<=t;e++){let r=e/t;for(te=4,A=ee=1;te--;)b[te]=A,x[te]=ee,A*=n,ee*=r,te===3?(S[te]=C[te]=0,j=ne=1):(S[te]=j*(3-te),C[te]=ne*(3-te),j*=n,ne*=r);oe.fromArray(b),se.fromArray(x),ce.fromArray(S),le.fromArray(C);for(let e=0;e<3;e++)k=oe.clone(),k.applyMatrix4(w[e]),T[e]=k.dot(se),k=ce.clone(),k.applyMatrix4(w[e]),E[e]=k.dot(se),k=oe.clone(),k.applyMatrix4(w[e]),D[e]=k.dot(le);ue.fromArray(E),de.fromArray(D),O.crossVectors(de,ue),O.normalize(),T[0]===0&&T[1]===0?re.set(0,T[2]>u?1:-1,0):re.set(O.x,O.z,-O.y),h[_e++]=d*T[0],h[_e++]=d*(T[2]-u),h[_e++]=-d*T[1],g[ve++]=re.x,g[ve++]=re.y,g[ve++]=re.z,_[ye++]=1-r,_[ye++]=1-n}}for(let e=0;e<t;e++)for(let n=0;n<t;n++){let t=ge*he*he+e*he+n,r=t+1,i=r+he,a=t+he;notDegenerate(t,r,i)&&(p[be++]=t,p[be++]=r,p[be++]=i),notDegenerate(t,i,a)&&(p[be++]=t,p[be++]=i,p[be++]=a)}ge++}this.setIndex(new BufferAttribute(p,1)),this.setAttribute(`position`,new BufferAttribute(h,3)),this.setAttribute(`normal`,new BufferAttribute(g,3)),this.setAttribute(`uv`,new BufferAttribute(_,2)),this.computeBoundingSphere()}};const rc=[()=>I,`height`,`width`,`frameRequestRate`,()=>ic,`captureStream`,`2d`,`contextId`,()=>ac,`options`,()=>oc,`getContext`,`bitmaprenderer`,()=>sc,()=>cc,`webgl`,()=>lc,()=>uc,`webgl2`,()=>lc,()=>dc,()=>fc,()=>pc,`callback`,`type`,`quality`,`toBlob`,`toDataURL`,()=>mc,`transferControlToOffscreen`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLCanvasElement`,`Pn!'4"'4#P'2$8n%1&P.'2(n)2*8Pn+,J1,P.-2(n.2*8Pn/,J1,P.02(n12*8Pn2,J1,P.32(n42*8Pn5,J1,P&2("2*8Pn6,J1,Pn728&298'2:8$1;P&298'2:8&1<Pn=1>P"29Pn?2@nA"f2B"/C2DP)nEJ2*8$1FP&29nG2DP)nHJ2*8$1FP"29PnI2@nJ"f2B"/C2DP)nKJ2*8$1LP&29nM2DP)nNJ2*8$1LMwOy`],I=[()=>V,()=>hc,()=>gc,()=>_c,()=>vc,`accessKey`,`accessKeyLabel`,`autocapitalize`,`autocorrect`,`dir`,`draggable`,`until-found`,`hidden`,`inert`,`innerText`,`lang`,`offsetHeight`,`offsetLeft`,()=>V,`offsetParent`,`offsetTop`,`offsetWidth`,`outerText`,`popover`,`spellcheck`,`title`,`translate`,`writingSuggestions`,()=>yc,`attachInternals`,`click`,`hidePopover`,()=>bc,`options`,`showPopover`,()=>xc,`togglePopover`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLElement`,`Pn!n"n#n$n%&4&&4'9&4()4)&4*)4+P).,J4-)4.&4/&40'419'429Pn3,J449'459'469&47P&,J48)49&4:)4;&4<Pn=1>P$1?P$1@PnA2B8$1CPPnD)J2B8)1EP"2FPnG2HnI"f2J"/K2LP)nMJ2B8$1NP&2FnO2LP)nPJ2B8$1NP"2FPnQ2HnR"f2J"/K2LP)nSJ2B8$1TP&2FnU2LP)nVJ2B8$1TMwWy`],ic=[()=>H,`active`,`id`,0,`this`,()=>Sc,`ev`,``,`onaddtrack`,0,()=>Sc,`onremovetrack`,()=>Cc,`track`,`addTrack`,0,`clone`,()=>Cc,`getAudioTracks`,`trackId`,()=>Cc,`getTrackById`,()=>Cc,`getTracks`,()=>Cc,`getVideoTracks`,()=>Cc,`removeTrack`,`type`,0,()=>wc,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>wc,()=>B,`removeEventListener`,()=>z,()=>B,`MediaStream`,`Pn!)4"9&4#9PPn$2%n&2'"/(,J4)PPn*2%n+2'"/(,J4,Pn-2.$1/Pn011Pn2F13P&24Pn5,J16Pn7F18Pn9F1:Pn;2.$1<P"2=Pn>2%n?"f2'"/(2@P)nAJ2B8$1CP&2=nD2@P)nEJ2B8$1CP"2=PnF2%nG"f2'"/(2@P)nHJ2B8$1IP&2=nJ2@P)nKJ2B8$1IMwLy`],ac=[`alpha`,()=>Tc,`colorSpace`,`desynchronized`,`willReadFrequently`,`CanvasRenderingContext2DSettings`,`P)4!8n"4#8)4$8)4%8Mw&y`],oc=[()=>Ec,()=>Dc,()=>Oc,()=>kc,()=>Ac,()=>jc,()=>Mc,()=>Nc,()=>Pc,()=>Fc,()=>Ic,()=>Lc,()=>Rc,()=>zc,()=>Bc,()=>Vc,()=>Hc,()=>rc,`canvas`,`CanvasRenderingContext2D`,`Pn!n"n#n$n%n&n'n(n)n*n+n,n-n.n/n0n1n2439Mw4y`],sc=[`alpha`,`ImageBitmapRenderingContextSettings`,`P)4!8Mw"y`],cc=[()=>rc,()=>mc,`canvas`,()=>Uc,`bitmap`,`transferFromImageBitmap`,`ImageBitmapRenderingContext`,`PPn!n"J4#9PPn$,J2%$1&Mw'y`],lc=[`alpha`,`antialias`,`depth`,`desynchronized`,`failIfMajorPerformanceCaveat`,()=>Wc,`powerPreference`,`premultipliedAlpha`,`preserveDrawingBuffer`,`stencil`,`xrCompatible`,`WebGLContextAttributes`,`P)4!8)4"8)4#8)4$8)4%8n&4'8)4(8)4)8)4*8)4+8Mw,y`],uc=[()=>Gc,()=>Kc,`WebGLRenderingContext`,`Pn!n"Mw#y`],dc=[()=>qc,()=>Jc,()=>Gc,`WebGL2RenderingContext`,`Pn!n"n#Mw$y`],fc=[()=>oc,()=>cc,()=>uc,()=>dc,()=>Yc,`RenderingContext`,`Pn!n"n#n$n%Jw&y`],pc=[()=>Xc,`blob`,``,`BlobCallback`,`PPPn!,J2"$v#Mw$y`],mc=[()=>H,`height`,0,`this`,()=>U,`ev`,``,`oncontextlost`,0,()=>U,`oncontextrestored`,`width`,()=>Zc,`options`,()=>Xc,`convertToBlob`,`2d`,`contextId`,()=>Qc,`getContext`,`bitmaprenderer`,()=>cc,`webgl`,()=>uc,`webgl2`,()=>dc,()=>$c,()=>el,()=>Uc,`transferToImageBitmap`,`type`,0,()=>tl,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>tl,()=>B,`removeEventListener`,()=>z,()=>B,`OffscreenCanvas`,`Pn!'4"PPn#2$n%2&"/',J4(PPn)2$n*2&"/',J4+'4,Pn-2.8n/\`10P.122"2.8Pn3,J14P.522"2.8Pn6,J14P.722"2.8Pn8,J14P.922"2.8Pn:,J14Pn;22"2.8Pn<,J14Pn=1>P"2?Pn@2$nA"f2&"/'2BP)nCJ2.8$1DP&2?nE2BP)nFJ2.8$1DP"2?PnG2$nH"f2&"/'2BP)nIJ2.8$1JP&2?nK2BP)nLJ2.8$1JMwMy`],L=[()=>nl,()=>rl,`HTMLElementEventMap`,`Pn!n"Mw#y`],R=[()=>B,`once`,`passive`,()=>il,`signal`,`AddEventListenerOptions`,`Pn!)4"8)4#8n$4%8Mw&y`],z=[()=>al,()=>ol,`EventListenerOrEventListenerObject`,`Pn!n"Jw#y`],B=[`capture`,`EventListenerOptions`,`P)4!8Mw"y`],V=[()=>W,()=>sl,()=>cl,()=>ll,()=>ul,()=>dl,()=>fl,()=>pl,`attributes`,`className`,`clientHeight`,`clientLeft`,`clientTop`,`clientWidth`,`currentCSSZoom`,()=>ml,`customElementRegistry`,`id`,`innerHTML`,`localName`,`namespaceURI`,0,`this`,()=>U,`ev`,``,`onfullscreenchange`,0,()=>U,`onfullscreenerror`,`outerHTML`,()=>hl,`ownerDocument`,`prefix`,`scrollHeight`,`scrollLeft`,`scrollTop`,`scrollWidth`,()=>gl,`shadowRoot`,`slot`,`tagName`,()=>_l,`init`,()=>gl,`attachShadow`,()=>vl,`options`,`checkVisibility`,`selector`,()=>yl,`closest`,()=>bl,()=>xl,`selectors`,()=>Sl,`computedStyleMap`,`qualifiedName`,`getAttribute`,`namespace`,`getAttributeNS`,`getAttributeNames`,()=>Cl,`getAttributeNode`,()=>Cl,`getAttributeNodeNS`,()=>wl,`getBoundingClientRect`,()=>Tl,`getClientRects`,`classNames`,()=>El,0,`getElementsByClassName`,()=>El,()=>yl,`getElementsByTagName`,()=>El,()=>bl,()=>El,()=>xl,()=>El,()=>Dl,()=>El,0,`http://www.w3.org/1999/xhtml`,()=>El,()=>I,`getElementsByTagNameNS`,`http://www.w3.org/2000/svg`,()=>El,()=>G,`http://www.w3.org/1998/Math/MathML`,()=>El,()=>Ol,()=>El,0,()=>kl,`getHTML`,`hasAttribute`,`hasAttributeNS`,`hasAttributes`,`pointerId`,`hasPointerCapture`,()=>Al,`where`,0,`element`,0,`insertAdjacentElement`,()=>Al,`position`,`string`,`insertAdjacentHTML`,()=>Al,`data`,`insertAdjacentText`,`matches`,`releasePointerCapture`,`removeAttribute`,`removeAttributeNS`,()=>Cl,`attr`,()=>Cl,`removeAttributeNode`,()=>jl,`requestFullscreen`,()=>Ml,`requestPointerLock`,()=>Nl,`scroll`,`x`,`y`,()=>Nl,`scrollBy`,()=>Pl,`arg`,`scrollIntoView`,()=>Nl,`scrollTo`,`value`,`setAttribute`,`setAttributeNS`,()=>Cl,()=>Cl,`setAttributeNode`,()=>Cl,()=>Cl,`setAttributeNodeNS`,`html`,`setHTMLUnsafe`,`setPointerCapture`,`force`,`toggleAttribute`,`webkitMatchesSelector`,`type`,0,()=>nl,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>nl,()=>B,`removeEventListener`,()=>z,()=>B,`Element`,`Pn!n"n#n$n%n&n'n(4)9!!&4*'4+9'4,9'4-9'4.9'4/9Pn0,J419&42&43&449P&,J459PPn627n829"/:,J4;PPn<27n=29"/:,J4>&4?n@4A9!!P&,J4B9'4C9'4D'4E'4F9PnG,J4H9&4I&4J9PnK2LnM1NPnO2P8)1QP"2RPnS"f,J1TP"2RPnU"f,J1TP"2RPnV"f,J1TP&2WP",J1TPnX1YP&2ZP&,J1[PP&,J2\\&24P&,J1]P&F1^P&2ZPn_,J1\`PP&,J2\\&24Pna,J1bPnc1dPne1fP&2gnioh"1jP"2Znl"fok"1mP"2Zno"fon"1mP"2Znq"fop"1mP"2Zns"for"1mP&2Znuot"1mP.v25&24nxow"1yP.z25&24n|o{"1yP.}25&24no~"1yPP&,J2\\&24no"1yPn2P8&1P&2Z)1PP&,J2\\&24)1
P)1P'2)1Pn2n2Pn,J1Pn2&2$1Pn2&2$1P"2W!1P"2W!1P"2W!1P&2W)1P'2$1P&2Z$1PP&,J2\\&24$1Pn2n1Pn2P8$\`1Pn\xA02P8$\`1¡Pn¢2P8$1£P'2¤'2¥$1£Pn¦2P8$1§P'2¤'2¥$1§PP)n¨J2©8$1ªPn«2P8$1¬P'2¤'2¥$1¬P&2Z&2$1®PP&,J2\\&2Z&2$1¯Pn°2Pn±,J1²Pn³2Pn´,J1µP&2¶$1·P'2$1¸P&2Z)2¹8)1ºP&2W)1»!!P"2¼Pn½27n¾"f29"/:2¿P)nÀJ2P8$1ÁP&2¼nÂ2¿P)nÃJ2P8$1ÁP"2¼PnÄ27nÅ"f29"/:2¿P)nÆJ2P8$1ÇP&2¼nÈ2¿P)nÉJ2P8$1ÇMwÊy`],hc=[()=>Fl,`attributeStyleMap`,`ElementCSSInlineStyle`,`Pn!4"9!!Mw#y`],gc=[`contentEditable`,`enterKeyHint`,`inputMode`,`isContentEditable`,`ElementContentEditable`,`P&4!&4"&4#)4$9Mw%y`],_c=[0,`this`,()=>Il,`ev`,``,`onabort`,0,()=>Ll,`onanimationcancel`,0,()=>Ll,`onanimationend`,0,()=>Ll,`onanimationiteration`,0,()=>Ll,`onanimationstart`,0,()=>Rl,`onauxclick`,0,()=>zl,`onbeforeinput`,0,()=>U,`onbeforematch`,0,()=>Bl,`onbeforetoggle`,0,()=>Vl,`onblur`,0,()=>U,`oncancel`,0,()=>U,`oncanplay`,0,()=>U,`oncanplaythrough`,0,()=>U,`onchange`,0,()=>Rl,`onclick`,0,()=>U,`onclose`,0,()=>U,`oncommand`,0,()=>U,`oncontextlost`,0,()=>Rl,`oncontextmenu`,0,()=>U,`oncontextrestored`,0,()=>Hl,`oncopy`,0,()=>U,`oncuechange`,0,()=>Hl,`oncut`,0,()=>Ul,`ondblclick`,0,()=>Wl,`ondrag`,0,()=>Wl,`ondragend`,0,()=>Wl,`ondragenter`,0,()=>Wl,`ondragleave`,0,()=>Wl,`ondragover`,0,()=>Wl,`ondragstart`,0,()=>Wl,`ondrop`,0,()=>U,`ondurationchange`,0,()=>U,`onemptied`,0,()=>U,`onended`,()=>Gl,`onerror`,0,()=>Vl,`onfocus`,0,()=>Kl,`onformdata`,0,()=>Rl,`ongotpointercapture`,0,()=>zl,`oninput`,0,()=>U,`oninvalid`,0,()=>ql,`onkeydown`,0,()=>ql,`onkeypress`,0,()=>ql,`onkeyup`,0,()=>U,`onload`,0,()=>U,`onloadeddata`,0,()=>U,`onloadedmetadata`,0,()=>U,`onloadstart`,0,()=>Rl,`onlostpointercapture`,0,()=>Ul,`onmousedown`,0,()=>Ul,`onmouseenter`,0,()=>Ul,`onmouseleave`,0,()=>Ul,`onmousemove`,0,()=>Ul,`onmouseout`,0,()=>Ul,`onmouseover`,0,()=>Ul,`onmouseup`,0,()=>Hl,`onpaste`,0,()=>U,`onpause`,0,()=>U,`onplay`,0,()=>U,`onplaying`,0,()=>Rl,`onpointercancel`,0,()=>Rl,`onpointerdown`,0,()=>Rl,`onpointerenter`,0,()=>Rl,`onpointerleave`,0,()=>Rl,`onpointermove`,0,()=>Rl,`onpointerout`,0,()=>Rl,`onpointerover`,0,()=>U,`onpointerrawupdate`,0,()=>Rl,`onpointerup`,0,()=>Jl,`onprogress`,0,()=>U,`onratechange`,0,()=>U,`onreset`,0,()=>Il,`onresize`,0,()=>U,`onscroll`,0,()=>U,`onscrollend`,0,()=>Yl,`onsecuritypolicyviolation`,0,()=>U,`onseeked`,0,()=>U,`onseeking`,0,()=>U,`onselect`,0,()=>U,`onselectionchange`,0,()=>U,`onselectstart`,0,()=>U,`onslotchange`,0,()=>U,`onstalled`,0,()=>Xl,`onsubmit`,0,()=>U,`onsuspend`,0,()=>U,`ontimeupdate`,0,()=>Bl,`ontoggle`,0,()=>Zl,`ontouchcancel`,0,()=>Zl,`ontouchend`,0,()=>Zl,`ontouchmove`,0,()=>Zl,`ontouchstart`,0,()=>Ql,`ontransitioncancel`,0,()=>Ql,`ontransitionend`,0,()=>Ql,`ontransitionrun`,0,()=>Ql,`ontransitionstart`,0,()=>U,`onvolumechange`,0,()=>U,`onwaiting`,0,()=>U,`onwebkitanimationend`,0,()=>U,`onwebkitanimationiteration`,0,()=>U,`onwebkitanimationstart`,0,()=>U,`onwebkittransitionend`,0,()=>$l,`onwheel`,`type`,0,()=>rl,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>rl,()=>B,`removeEventListener`,()=>z,()=>B,`GlobalEventHandlers`,`PPPn!2"n#2$"/%,J4&PPn'2"n(2$"/%,J4)PPn*2"n+2$"/%,J4,PPn-2"n.2$"/%,J4/PPn02"n12$"/%,J42PPn32"n42$"/%,J45PPn62"n72$"/%,J48PPn92"n:2$"/%,J4;PPn<2"n=2$"/%,J4>PPn?2"n@2$"/%,J4APPnB2"nC2$"/%,J4DPPnE2"nF2$"/%,J4GPPnH2"nI2$"/%,J4JPPnK2"nL2$"/%,J4MPPnN2"nO2$"/%,J4PPPnQ2"nR2$"/%,J4SPPnT2"nU2$"/%,J4VPPnW2"nX2$"/%,J4YPPnZ2"n[2$"/%,J4\\PPn]2"n^2$"/%,J4_PPn\`2"na2$"/%,J4bPPnc2"nd2$"/%,J4ePPnf2"ng2$"/%,J4hPPni2"nj2$"/%,J4kPPnl2"nm2$"/%,J4nPPno2"np2$"/%,J4qPPnr2"ns2$"/%,J4tPPnu2"nv2$"/%,J4wPPnx2"ny2$"/%,J4zPPn{2"n|2$"/%,J4}PPn~2"n2$"/%,J4PPn2"n2$"/%,J4PPn2"n
2$"/%,J4PPn2"n2$"/%,J4n4PPn2"n2$"/%,J4PPn2"n2$"/%,J4PPn2"n2$"/%,J4PPn2"n2$"/%,J4PPn2"n2$"/%,J4PPn2"n2$"/%,J4PPn2"n2$"/%,J4\xA0PPn¡2"n¢2$"/%,J4£PPn¤2"n¥2$"/%,J4¦PPn§2"n¨2$"/%,J4©PPnª2"n«2$"/%,J4¬PPn2"n®2$"/%,J4¯PPn°2"n±2$"/%,J4²PPn³2"n´2$"/%,J4µPPn¶2"n·2$"/%,J4¸PPn¹2"nº2$"/%,J4»PPn¼2"n½2$"/%,J4¾PPn¿2"nÀ2$"/%,J4ÁPPnÂ2"nÃ2$"/%,J4ÄPPnÅ2"nÆ2$"/%,J4ÇPPnÈ2"nÉ2$"/%,J4ÊPPnË2"nÌ2$"/%,J4ÍPPnÎ2"nÏ2$"/%,J4ÐPPnÑ2"nÒ2$"/%,J4ÓPPnÔ2"nÕ2$"/%,J4ÖPPn×2"nØ2$"/%,J4ÙPPnÚ2"nÛ2$"/%,J4ÜPPnÝ2"nÞ2$"/%,J4ßPPnà2"ná2$"/%,J4âPPnã2"nä2$"/%,J4åPPnæ2"nç2$"/%,J4èPPné2"nê2$"/%,J4ëPPnì2"ní2$"/%,J4îPPnï2"nð2$"/%,J4ñPPnò2"nó2$"/%,J4ôPPnõ2"nö2$"/%,J4÷PPnø2"nù2$"/%,J4úPPnû2"nü2$"/%,J4ýPPnþ2"nÿ2$"/%,J4ĀPPnā2"nĂ2$"/%,J4ăPPnĄ2"ną2$"/%,J4ĆPPnć2"nĈ2$"/%,J4ĉPPnĊ2"nċ2$"/%,J4ČPPnč2"nĎ2$"/%,J4ďPPnĐ2"nđ2$"/%,J4ĒPPnē2"nĔ2$"/%,J4ĕPPnĖ2"nė2$"/%,J4ĘPPnę2"nĚ2$"/%,J4ěPPnĜ2"nĝ2$"/%,J4ĞPPnğ2"nĠ2$"/%,J4ġPPnĢ2"nģ2$"/%,J4ĤPPnĥ2"nĦ2$"/%,-J4ħ8PPnĨ2"nĩ2$"/%,-J4Ī8PPnī2"nĬ2$"/%,-J4ĭ8PPnĮ2"nį2$"/%,-J4İ8PPnı2"nIJ2$"/%,J4ijPPnĴ2"nĵ2$"/%,J4ĶPPnķ2"nĸ2$"/%,J4ĹPPnĺ2"nĻ2$"/%,J4ļPPnĽ2"nľ2$"/%,J4ĿPPnŀ2"nŁ2$"/%,J4łPPnŃ2"nń2$"/%,J4ŅPPnņ2"nŇ2$"/%,J4ňPPnʼn2"nŊ2$"/%,J4ŋPPnŌ2"nō2$"/%,J4ŎPPnŏ2"nŐ2$"/%,J4őP"2ŒPnœ2"nŔ"f2$"/%2ŕP)nŖJ2ŗ8$1ŘP&2Œnř2ŕP)nŚJ2ŗ8$1ŘP"2ŒPnś2"nŜ"f2$"/%2ŕP)nŝJ2ŗ8$1ŞP&2Œnş2ŕP)nŠJ2ŗ8$1ŞMwšy`],vc=[`autofocus`,()=>eu,`dataset`,`nonce`,`tabIndex`,`blur`,()=>tu,`options`,`focus`,`HTMLOrSVGElement`,`P)4!n"4#9&4$'4%P$1&Pn'2(8$1)Mw*y`],yc=[()=>sl,()=>nu,`form`,()=>ru,`labels`,()=>gl,`shadowRoot`,()=>iu,`states`,`validationMessage`,()=>au,`validity`,`willValidate`,`checkValidity`,`reportValidity`,()=>ou,()=>su,`value`,()=>ou,()=>su,`state`,`setFormValue`,()=>cu,`flags`,`message`,()=>I,`anchor`,`setValidity`,`ElementInternals`,`Pn!Pn",J4#9n$4%9Pn&,J4'9n(4)9&4*9n+4,9)4-9P)1.P)1/PPn0&n1,J22Pn3&n4,J258$16Pn7288&298n:2;8$1<Mw=y`],bc=[()=>I,`source`,`ShowPopoverOptions`,`Pn!4"8Mw#y`],xc=[()=>bc,`force`,`TogglePopoverOptions`,`Pn!)4"8Mw#y`],H=[`type`,()=>z,`callback`,()=>R,`options`,`addEventListener`,()=>U,`event`,`dispatchEvent`,()=>z,()=>B,`removeEventListener`,`EventTarget`,`PP&2!Pn",J2#Pn$)J2%8$1&Pn'2()1)P&2!Pn*,J2#Pn+)J2%8$1,Mw-y`],Sc=[()=>U,()=>Cc,`track`,`MediaStreamTrackEvent`,`Pn!n"4#9Mw$y`],Cc=[()=>H,`contentHint`,`enabled`,`id`,`kind`,`label`,`muted`,0,`this`,()=>U,`ev`,``,`onended`,0,()=>U,`onmute`,0,()=>U,`onunmute`,()=>lu,`readyState`,()=>uu,`constraints`,`applyConstraints`,0,`clone`,()=>du,`getCapabilities`,()=>uu,`getConstraints`,()=>fu,`getSettings`,`stop`,`type`,0,()=>pu,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>pu,()=>B,`removeEventListener`,()=>z,()=>B,`MediaStreamTrack`,`Pn!&4")4#&4$9&4%9&4&9)4'9PPn(2)n*2+"/,,J4-PPn.2)n/2+"/,,J40PPn12)n22+"/,,J43n4459Pn6278$\`18Pn91:Pn;1<Pn=1>Pn?1@P$1AP"2BPnC2)nD"f2+"/,2EP)nFJ2G8$1HP&2BnI2EP)nJJ2G8$1HP"2BPnK2)nL"f2+"/,2EP)nMJ2G8$1NP&2BnO2EP)nPJ2G8$1NMwQy`],wc=[()=>Sc,`addtrack`,()=>Sc,`removetrack`,`MediaStreamEventMap`,`Pn!4"n#4$Mw%y`],Tc=[`display-p3`,`srgb`,`PredefinedColorSpace`,`P.!."Jw#y`],Ec=[`globalAlpha`,()=>mu,`globalCompositeOperation`,`CanvasCompositing`,`P'4!n"4#Mw$y`],Dc=[()=>hu,`image`,`dx`,`dy`,`drawImage`,()=>hu,`dw`,`dh`,()=>hu,`sx`,`sy`,`sw`,`sh`,`CanvasDrawImage`,`PPn!2"'2#'2$$1%Pn&2"'2#'2$'2''2($1%Pn)2"'2*'2+'2,'2-'2#'2$'2''2($1%Mw.y`],Oc=[`beginPath`,()=>gu,`fillRule`,`clip`,()=>_u,`path`,()=>gu,()=>gu,`fill`,()=>_u,()=>gu,`x`,`y`,()=>gu,`isPointInPath`,()=>_u,()=>gu,`isPointInStroke`,()=>_u,`stroke`,()=>_u,`CanvasDrawPath`,`PP$1!Pn"2#8$1$Pn%2&n'2#8$1$Pn(2#8$1)Pn*2&n+2#8$1)P'2,'2-n.2#8)1/Pn02&'2,'2-n12#8)1/P'2,'2-)12Pn32&'2,'2-)12P$14Pn52&$14Mw6y`],kc=[()=>vu,()=>yu,`fillStyle`,()=>vu,()=>yu,`strokeStyle`,`startAngle`,`x`,`y`,()=>vu,`createConicGradient`,`x0`,`y0`,`x1`,`y1`,()=>vu,`createLinearGradient`,()=>hu,`image`,`repetition`,()=>yu,`createPattern`,`r0`,`r1`,()=>vu,`createRadialGradient`,`CanvasFillStrokeStyles`,`PP&n!n"J4#P&n$n%J4&P'2''2('2)n*1+P'2,'2-'2.'2/n011Pn223P&,J24Pn5,J16P'2,'2-'27'2.'2/'28n91:Mw;y`],Ac=[`filter`,`CanvasFilters`,`P&4!Mw"y`],jc=[`sw`,`sh`,()=>bu,`settings`,()=>xu,`createImageData`,()=>xu,`imageData`,()=>xu,`sx`,`sy`,()=>bu,()=>xu,`getImageData`,()=>xu,`dx`,`dy`,`putImageData`,()=>xu,`dirtyX`,`dirtyY`,`dirtyWidth`,`dirtyHeight`,`CanvasImageData`,`PP'2!'2"n#2$8n%1&Pn'2(n)1&P'2*'2+'2!'2"n,2$8n-1.Pn/2('20'21$12Pn32('20'21'24'25'26'27$12Mw8y`],Mc=[`imageSmoothingEnabled`,()=>Su,`imageSmoothingQuality`,`CanvasImageSmoothing`,`P)4!n"4#Mw$y`],Nc=[`x`,`y`,`radius`,`startAngle`,`endAngle`,`counterclockwise`,`arc`,`x1`,`y1`,`x2`,`y2`,`arcTo`,`cp1x`,`cp1y`,`cp2x`,`cp2y`,`bezierCurveTo`,`closePath`,`radiusX`,`radiusY`,`rotation`,`ellipse`,`lineTo`,`moveTo`,`cpx`,`cpy`,`quadraticCurveTo`,`w`,`h`,`rect`,()=>Cu,()=>Cu,`radii`,`roundRect`,`CanvasPath`,`PP'2!'2"'2#'2$'2%)2&8$1'P'2('2)'2*'2+'2#$1,P'2-'2.'2/'20'2!'2"$11P$12P'2!'2"'23'24'25'2$'2%)2&8$16P'2!'2"$17P'2!'2"$18P'29'2:'2!'2"$1;P'2!'2"'2<'2=$1>P'2!'2"'2<'2=P'n?P'n@JFJ2A8$1BMwCy`],Pc=[()=>wu,`lineCap`,`lineDashOffset`,()=>Tu,`lineJoin`,`lineWidth`,`miterLimit`,`getLineDash`,`segments`,`setLineDash`,`CanvasPathDrawingStyles`,`Pn!4"'4#n$4%'4&'4'P'F1(P'F2)$1*Mw+y`],Fc=[`x`,`y`,`w`,`h`,`clearRect`,`fillRect`,`strokeRect`,`CanvasRect`,`PP'2!'2"'2#'2$$1%P'2!'2"'2#'2$$1&P'2!'2"'2#'2$$1'Mw(y`],Ic=[()=>ac,`getContextAttributes`,`CanvasSettings`,`PPn!1"Mw#y`],Lc=[`shadowBlur`,`shadowColor`,`shadowOffsetX`,`shadowOffsetY`,`CanvasShadowStyles`,`P'4!&4"'4#'4$Mw%y`],Rc=[`isContextLost`,`reset`,`restore`,`save`,`CanvasState`,`PP)1!P$1"P$1#P$1$Mw%y`],zc=[`text`,`x`,`y`,`maxWidth`,`fillText`,()=>Eu,`measureText`,`strokeText`,`CanvasText`,`PP&2!'2"'2#'2$8$1%P&2!n&1'P&2!'2"'2#'2$8$1(Mw)y`],Bc=[()=>Du,`direction`,`font`,()=>Ou,`fontKerning`,()=>ku,`fontStretch`,()=>Au,`fontVariantCaps`,`letterSpacing`,()=>ju,`textAlign`,()=>Mu,`textBaseline`,()=>Nu,`textRendering`,`wordSpacing`,`CanvasTextDrawingStyles`,`Pn!4"&4#n$4%n&4'n(4)&4*n+4,n-4.n/40&41Mw2y`],Vc=[()=>Pu,`getTransform`,`resetTransform`,`angle`,`rotate`,`x`,`y`,`scale`,`a`,`b`,`c`,`d`,`e`,`f`,`setTransform`,()=>Fu,`transform`,`translate`,`CanvasTransform`,`PPn!1"P$1#P'2$$1%P'2&'2'$1(P'2)'2*'2+'2,'2-'2.$1/Pn0218$1/P'2)'2*'2+'2,'2-'2.$11P'2&'2'$12Mw3y`],Hc=[()=>V,`element`,`drawFocusIfNeeded`,()=>_u,`path`,()=>V,`CanvasUserInterface`,`PPn!2"$1#Pn$2%n&2"$1#Mw'y`],Uc=[`height`,`width`,`close`,`ImageBitmap`,`P'4!9'4"9P$1#Mw$y`],Wc=[`default`,`high-performance`,`low-power`,`WebGLPowerPreference`,`P.!.".#Jw$y`],Gc=[()=>rc,()=>mc,`canvas`,()=>Tc,`drawingBufferColorSpace`,()=>K,`drawingBufferHeight`,()=>K,`drawingBufferWidth`,()=>Tc,`unpackColorSpace`,()=>q,`texture`,`activeTexture`,()=>Iu,`program`,()=>Lu,`shader`,`attachShader`,()=>Iu,()=>J,`index`,`name`,`bindAttribLocation`,()=>q,`target`,()=>Ru,`buffer`,`bindBuffer`,()=>q,()=>zu,`framebuffer`,`bindFramebuffer`,()=>q,()=>Bu,`renderbuffer`,`bindRenderbuffer`,()=>q,()=>Vu,`bindTexture`,()=>Hu,`red`,()=>Hu,`green`,()=>Hu,`blue`,()=>Hu,`alpha`,`blendColor`,()=>q,`mode`,`blendEquation`,()=>q,`modeRGB`,()=>q,`modeAlpha`,`blendEquationSeparate`,()=>q,`sfactor`,()=>q,`dfactor`,`blendFunc`,()=>q,`srcRGB`,()=>q,`dstRGB`,()=>q,`srcAlpha`,()=>q,`dstAlpha`,`blendFuncSeparate`,()=>q,()=>q,`checkFramebufferStatus`,()=>Uu,`mask`,`clear`,()=>Hu,()=>Hu,()=>Hu,()=>Hu,`clearColor`,()=>Hu,`depth`,`clearDepth`,()=>Y,`s`,`clearStencil`,()=>Wu,()=>Wu,()=>Wu,()=>Wu,`colorMask`,()=>Lu,`compileShader`,()=>q,()=>Y,`level`,()=>q,`internalformat`,()=>Y,`x`,()=>Y,`y`,()=>K,`width`,()=>K,`height`,()=>Y,`border`,`copyTexImage2D`,()=>q,()=>Y,()=>Y,`xoffset`,()=>Y,`yoffset`,()=>Y,()=>Y,()=>K,()=>K,`copyTexSubImage2D`,()=>Ru,`createBuffer`,()=>zu,`createFramebuffer`,()=>Iu,`createProgram`,()=>Bu,`createRenderbuffer`,()=>q,`type`,()=>Lu,`createShader`,()=>Vu,`createTexture`,()=>q,`cullFace`,()=>Ru,`deleteBuffer`,()=>zu,`deleteFramebuffer`,()=>Iu,`deleteProgram`,()=>Bu,`deleteRenderbuffer`,()=>Lu,`deleteShader`,()=>Vu,`deleteTexture`,()=>q,`func`,`depthFunc`,()=>Wu,`flag`,`depthMask`,()=>Hu,`zNear`,()=>Hu,`zFar`,`depthRange`,()=>Iu,()=>Lu,`detachShader`,()=>q,`cap`,`disable`,()=>J,`disableVertexAttribArray`,()=>q,()=>Y,`first`,()=>K,`count`,`drawArrays`,()=>q,()=>K,()=>q,()=>Gu,`offset`,`drawElements`,()=>q,`enable`,()=>J,`enableVertexAttribArray`,`finish`,`flush`,()=>q,()=>q,`attachment`,()=>q,`renderbuffertarget`,()=>Bu,`framebufferRenderbuffer`,()=>q,()=>q,()=>q,`textarget`,()=>Vu,()=>Y,`framebufferTexture2D`,()=>q,`frontFace`,()=>q,`generateMipmap`,()=>Iu,()=>J,()=>Ku,`getActiveAttrib`,()=>Iu,()=>J,()=>Ku,`getActiveUniform`,()=>Iu,()=>Lu,`getAttachedShaders`,()=>Iu,()=>Y,`getAttribLocation`,()=>q,()=>q,`pname`,`getBufferParameter`,()=>lc,`getContextAttributes`,()=>q,`getError`,`getExtension`,`ANGLE_instanced_arrays`,`extensionName`,()=>qu,`EXT_blend_minmax`,()=>Ju,`EXT_color_buffer_float`,()=>Yu,`EXT_color_buffer_half_float`,()=>Xu,`EXT_float_blend`,()=>Zu,`EXT_frag_depth`,()=>Qu,`EXT_sRGB`,()=>$u,`EXT_shader_texture_lod`,()=>ed,`EXT_texture_compression_bptc`,()=>td,`EXT_texture_compression_rgtc`,()=>nd,`EXT_texture_filter_anisotropic`,()=>rd,`KHR_parallel_shader_compile`,()=>id,`OES_element_index_uint`,()=>ad,`OES_fbo_render_mipmap`,()=>od,`OES_standard_derivatives`,()=>sd,`OES_texture_float`,()=>cd,`OES_texture_float_linear`,()=>ld,`OES_texture_half_float`,()=>ud,`OES_texture_half_float_linear`,()=>dd,`OES_vertex_array_object`,()=>fd,`OVR_multiview2`,()=>pd,`WEBGL_color_buffer_float`,()=>md,`WEBGL_compressed_texture_astc`,()=>hd,`WEBGL_compressed_texture_etc`,()=>gd,`WEBGL_compressed_texture_etc1`,()=>_d,`WEBGL_compressed_texture_pvrtc`,()=>vd,`WEBGL_compressed_texture_s3tc`,()=>yd,`WEBGL_compressed_texture_s3tc_srgb`,()=>bd,`WEBGL_debug_renderer_info`,()=>xd,`WEBGL_debug_shaders`,()=>Sd,`WEBGL_depth_texture`,()=>Cd,`WEBGL_draw_buffers`,()=>wd,`WEBGL_lose_context`,()=>Td,`WEBGL_multi_draw`,()=>Ed,()=>q,()=>q,()=>q,`getFramebufferAttachmentParameter`,()=>q,`getParameter`,()=>Iu,`getProgramInfoLog`,()=>Iu,()=>q,`getProgramParameter`,()=>q,()=>q,`getRenderbufferParameter`,()=>Lu,`getShaderInfoLog`,()=>Lu,()=>q,`getShaderParameter`,()=>q,`shadertype`,()=>q,`precisiontype`,()=>Dd,`getShaderPrecisionFormat`,()=>Lu,`getShaderSource`,`getSupportedExtensions`,()=>q,()=>q,`getTexParameter`,()=>Iu,()=>X,`location`,`getUniform`,()=>Iu,()=>X,`getUniformLocation`,()=>J,()=>q,`getVertexAttrib`,()=>J,()=>q,()=>Gu,`getVertexAttribOffset`,()=>q,()=>q,`hint`,()=>Ru,()=>Wu,`isBuffer`,`isContextLost`,()=>q,()=>Wu,`isEnabled`,()=>zu,()=>Wu,`isFramebuffer`,()=>Iu,()=>Wu,`isProgram`,()=>Bu,()=>Wu,`isRenderbuffer`,()=>Lu,()=>Wu,`isShader`,()=>Vu,()=>Wu,`isTexture`,()=>Od,`lineWidth`,()=>Iu,`linkProgram`,()=>q,()=>Y,()=>Wu,`param`,`pixelStorei`,()=>Od,`factor`,()=>Od,`units`,`polygonOffset`,()=>q,()=>q,()=>K,()=>K,`renderbufferStorage`,()=>Hu,`value`,()=>Wu,`invert`,`sampleCoverage`,()=>Y,()=>Y,()=>K,()=>K,`scissor`,()=>Lu,`source`,`shaderSource`,()=>q,()=>Y,`ref`,()=>J,`stencilFunc`,()=>q,`face`,()=>q,()=>Y,()=>J,`stencilFuncSeparate`,()=>J,`stencilMask`,()=>q,()=>J,`stencilMaskSeparate`,()=>q,`fail`,()=>q,`zfail`,()=>q,`zpass`,`stencilOp`,()=>q,()=>q,()=>q,()=>q,`stencilOpSeparate`,()=>q,()=>q,()=>Od,`texParameterf`,()=>q,()=>q,()=>Y,`texParameteri`,()=>X,()=>Od,`uniform1f`,()=>X,()=>Y,`uniform1i`,()=>X,()=>Od,()=>Od,`uniform2f`,()=>X,()=>Y,()=>Y,`uniform2i`,()=>X,()=>Od,()=>Od,()=>Od,`z`,`uniform3f`,()=>X,()=>Y,()=>Y,()=>Y,`uniform3i`,()=>X,()=>Od,()=>Od,()=>Od,()=>Od,`w`,`uniform4f`,()=>X,()=>Y,()=>Y,()=>Y,()=>Y,`uniform4i`,()=>Iu,`useProgram`,()=>Iu,`validateProgram`,()=>J,()=>Od,`vertexAttrib1f`,()=>J,()=>kd,`values`,`vertexAttrib1fv`,()=>J,()=>Od,()=>Od,`vertexAttrib2f`,()=>J,()=>kd,`vertexAttrib2fv`,()=>J,()=>Od,()=>Od,()=>Od,`vertexAttrib3f`,()=>J,()=>kd,`vertexAttrib3fv`,()=>J,()=>Od,()=>Od,()=>Od,()=>Od,`vertexAttrib4f`,()=>J,()=>kd,`vertexAttrib4fv`,()=>J,()=>Y,`size`,()=>q,()=>Wu,`normalized`,()=>K,`stride`,()=>Gu,`vertexAttribPointer`,()=>Y,()=>Y,()=>K,()=>K,`viewport`,256,`DEPTH_BUFFER_BIT`,1024,`STENCIL_BUFFER_BIT`,16384,`COLOR_BUFFER_BIT`,0,`POINTS`,1,`LINES`,2,`LINE_LOOP`,3,`LINE_STRIP`,4,`TRIANGLES`,5,`TRIANGLE_STRIP`,6,`TRIANGLE_FAN`,0,`ZERO`,1,`ONE`,768,`SRC_COLOR`,769,`ONE_MINUS_SRC_COLOR`,770,`SRC_ALPHA`,771,`ONE_MINUS_SRC_ALPHA`,772,`DST_ALPHA`,773,`ONE_MINUS_DST_ALPHA`,774,`DST_COLOR`,775,`ONE_MINUS_DST_COLOR`,776,`SRC_ALPHA_SATURATE`,32774,`FUNC_ADD`,32777,`BLEND_EQUATION`,32777,`BLEND_EQUATION_RGB`,34877,`BLEND_EQUATION_ALPHA`,32778,`FUNC_SUBTRACT`,32779,`FUNC_REVERSE_SUBTRACT`,32968,`BLEND_DST_RGB`,32969,`BLEND_SRC_RGB`,32970,`BLEND_DST_ALPHA`,32971,`BLEND_SRC_ALPHA`,32769,`CONSTANT_COLOR`,32770,`ONE_MINUS_CONSTANT_COLOR`,32771,`CONSTANT_ALPHA`,32772,`ONE_MINUS_CONSTANT_ALPHA`,32773,`BLEND_COLOR`,34962,`ARRAY_BUFFER`,34963,`ELEMENT_ARRAY_BUFFER`,34964,`ARRAY_BUFFER_BINDING`,34965,`ELEMENT_ARRAY_BUFFER_BINDING`,35040,`STREAM_DRAW`,35044,`STATIC_DRAW`,35048,`DYNAMIC_DRAW`,34660,`BUFFER_SIZE`,34661,`BUFFER_USAGE`,34342,`CURRENT_VERTEX_ATTRIB`,1028,`FRONT`,1029,`BACK`,1032,`FRONT_AND_BACK`,2884,`CULL_FACE`,3042,`BLEND`,3024,`DITHER`,2960,`STENCIL_TEST`,2929,`DEPTH_TEST`,3089,`SCISSOR_TEST`,32823,`POLYGON_OFFSET_FILL`,32926,`SAMPLE_ALPHA_TO_COVERAGE`,32928,`SAMPLE_COVERAGE`,0,`NO_ERROR`,1280,`INVALID_ENUM`,1281,`INVALID_VALUE`,1282,`INVALID_OPERATION`,1285,`OUT_OF_MEMORY`,2304,`CW`,2305,`CCW`,2849,`LINE_WIDTH`,33901,`ALIASED_POINT_SIZE_RANGE`,33902,`ALIASED_LINE_WIDTH_RANGE`,2885,`CULL_FACE_MODE`,2886,`FRONT_FACE`,2928,`DEPTH_RANGE`,2930,`DEPTH_WRITEMASK`,2931,`DEPTH_CLEAR_VALUE`,2932,`DEPTH_FUNC`,2961,`STENCIL_CLEAR_VALUE`,2962,`STENCIL_FUNC`,2964,`STENCIL_FAIL`,2965,`STENCIL_PASS_DEPTH_FAIL`,2966,`STENCIL_PASS_DEPTH_PASS`,2967,`STENCIL_REF`,2963,`STENCIL_VALUE_MASK`,2968,`STENCIL_WRITEMASK`,34816,`STENCIL_BACK_FUNC`,34817,`STENCIL_BACK_FAIL`,34818,`STENCIL_BACK_PASS_DEPTH_FAIL`,34819,`STENCIL_BACK_PASS_DEPTH_PASS`,36003,`STENCIL_BACK_REF`,36004,`STENCIL_BACK_VALUE_MASK`,36005,`STENCIL_BACK_WRITEMASK`,2978,`VIEWPORT`,3088,`SCISSOR_BOX`,3106,`COLOR_CLEAR_VALUE`,3107,`COLOR_WRITEMASK`,3317,`UNPACK_ALIGNMENT`,3333,`PACK_ALIGNMENT`,3379,`MAX_TEXTURE_SIZE`,3386,`MAX_VIEWPORT_DIMS`,3408,`SUBPIXEL_BITS`,3410,`RED_BITS`,3411,`GREEN_BITS`,3412,`BLUE_BITS`,3413,`ALPHA_BITS`,3414,`DEPTH_BITS`,3415,`STENCIL_BITS`,10752,`POLYGON_OFFSET_UNITS`,32824,`POLYGON_OFFSET_FACTOR`,32873,`TEXTURE_BINDING_2D`,32936,`SAMPLE_BUFFERS`,32937,`SAMPLES`,32938,`SAMPLE_COVERAGE_VALUE`,32939,`SAMPLE_COVERAGE_INVERT`,34467,`COMPRESSED_TEXTURE_FORMATS`,4352,`DONT_CARE`,4353,`FASTEST`,4354,`NICEST`,33170,`GENERATE_MIPMAP_HINT`,5120,`BYTE`,5121,`UNSIGNED_BYTE`,5122,`SHORT`,5123,`UNSIGNED_SHORT`,5124,`INT`,5125,`UNSIGNED_INT`,5126,`FLOAT`,6402,`DEPTH_COMPONENT`,6406,`ALPHA`,6407,`RGB`,6408,`RGBA`,6409,`LUMINANCE`,6410,`LUMINANCE_ALPHA`,32819,`UNSIGNED_SHORT_4_4_4_4`,32820,`UNSIGNED_SHORT_5_5_5_1`,33635,`UNSIGNED_SHORT_5_6_5`,35632,`FRAGMENT_SHADER`,35633,`VERTEX_SHADER`,34921,`MAX_VERTEX_ATTRIBS`,36347,`MAX_VERTEX_UNIFORM_VECTORS`,36348,`MAX_VARYING_VECTORS`,35661,`MAX_COMBINED_TEXTURE_IMAGE_UNITS`,35660,`MAX_VERTEX_TEXTURE_IMAGE_UNITS`,34930,`MAX_TEXTURE_IMAGE_UNITS`,36349,`MAX_FRAGMENT_UNIFORM_VECTORS`,35663,`SHADER_TYPE`,35712,`DELETE_STATUS`,35714,`LINK_STATUS`,35715,`VALIDATE_STATUS`,35717,`ATTACHED_SHADERS`,35718,`ACTIVE_UNIFORMS`,35721,`ACTIVE_ATTRIBUTES`,35724,`SHADING_LANGUAGE_VERSION`,35725,`CURRENT_PROGRAM`,512,`NEVER`,513,`LESS`,514,`EQUAL`,515,`LEQUAL`,516,`GREATER`,517,`NOTEQUAL`,518,`GEQUAL`,519,`ALWAYS`,7680,`KEEP`,7681,`REPLACE`,7682,`INCR`,7683,`DECR`,5386,`INVERT`,34055,`INCR_WRAP`,34056,`DECR_WRAP`,7936,`VENDOR`,7937,`RENDERER`,7938,`VERSION`,9728,`NEAREST`,9729,`LINEAR`,9984,`NEAREST_MIPMAP_NEAREST`,9985,`LINEAR_MIPMAP_NEAREST`,9986,`NEAREST_MIPMAP_LINEAR`,9987,`LINEAR_MIPMAP_LINEAR`,10240,`TEXTURE_MAG_FILTER`,10241,`TEXTURE_MIN_FILTER`,10242,`TEXTURE_WRAP_S`,10243,`TEXTURE_WRAP_T`,3553,`TEXTURE_2D`,5890,`TEXTURE`,34067,`TEXTURE_CUBE_MAP`,34068,`TEXTURE_BINDING_CUBE_MAP`,34069,`TEXTURE_CUBE_MAP_POSITIVE_X`,34070,`TEXTURE_CUBE_MAP_NEGATIVE_X`,34071,`TEXTURE_CUBE_MAP_POSITIVE_Y`,34072,`TEXTURE_CUBE_MAP_NEGATIVE_Y`,34073,`TEXTURE_CUBE_MAP_POSITIVE_Z`,34074,`TEXTURE_CUBE_MAP_NEGATIVE_Z`,34076,`MAX_CUBE_MAP_TEXTURE_SIZE`,33984,`TEXTURE0`,33985,`TEXTURE1`,33986,`TEXTURE2`,33987,`TEXTURE3`,33988,`TEXTURE4`,33989,`TEXTURE5`,33990,`TEXTURE6`,33991,`TEXTURE7`,33992,`TEXTURE8`,33993,`TEXTURE9`,33994,`TEXTURE10`,33995,`TEXTURE11`,33996,`TEXTURE12`,33997,`TEXTURE13`,33998,`TEXTURE14`,33999,`TEXTURE15`,34e3,`TEXTURE16`,34001,`TEXTURE17`,34002,`TEXTURE18`,34003,`TEXTURE19`,34004,`TEXTURE20`,34005,`TEXTURE21`,34006,`TEXTURE22`,34007,`TEXTURE23`,34008,`TEXTURE24`,34009,`TEXTURE25`,34010,`TEXTURE26`,34011,`TEXTURE27`,34012,`TEXTURE28`,34013,`TEXTURE29`,34014,`TEXTURE30`,34015,`TEXTURE31`,34016,`ACTIVE_TEXTURE`,10497,`REPEAT`,33071,`CLAMP_TO_EDGE`,33648,`MIRRORED_REPEAT`,35664,`FLOAT_VEC2`,35665,`FLOAT_VEC3`,35666,`FLOAT_VEC4`,35667,`INT_VEC2`,35668,`INT_VEC3`,35669,`INT_VEC4`,35670,`BOOL`,35671,`BOOL_VEC2`,35672,`BOOL_VEC3`,35673,`BOOL_VEC4`,35674,`FLOAT_MAT2`,35675,`FLOAT_MAT3`,35676,`FLOAT_MAT4`,35678,`SAMPLER_2D`,35680,`SAMPLER_CUBE`,34338,`VERTEX_ATTRIB_ARRAY_ENABLED`,34339,`VERTEX_ATTRIB_ARRAY_SIZE`,34340,`VERTEX_ATTRIB_ARRAY_STRIDE`,34341,`VERTEX_ATTRIB_ARRAY_TYPE`,34922,`VERTEX_ATTRIB_ARRAY_NORMALIZED`,34373,`VERTEX_ATTRIB_ARRAY_POINTER`,34975,`VERTEX_ATTRIB_ARRAY_BUFFER_BINDING`,35738,`IMPLEMENTATION_COLOR_READ_TYPE`,35739,`IMPLEMENTATION_COLOR_READ_FORMAT`,35713,`COMPILE_STATUS`,36336,`LOW_FLOAT`,36337,`MEDIUM_FLOAT`,36338,`HIGH_FLOAT`,36339,`LOW_INT`,36340,`MEDIUM_INT`,36341,`HIGH_INT`,36160,`FRAMEBUFFER`,36161,`RENDERBUFFER`,32854,`RGBA4`,32855,`RGB5_A1`,32856,`RGBA8`,36194,`RGB565`,33189,`DEPTH_COMPONENT16`,36168,`STENCIL_INDEX8`,34041,`DEPTH_STENCIL`,36162,`RENDERBUFFER_WIDTH`,36163,`RENDERBUFFER_HEIGHT`,36164,`RENDERBUFFER_INTERNAL_FORMAT`,36176,`RENDERBUFFER_RED_SIZE`,36177,`RENDERBUFFER_GREEN_SIZE`,36178,`RENDERBUFFER_BLUE_SIZE`,36179,`RENDERBUFFER_ALPHA_SIZE`,36180,`RENDERBUFFER_DEPTH_SIZE`,36181,`RENDERBUFFER_STENCIL_SIZE`,36048,`FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE`,36049,`FRAMEBUFFER_ATTACHMENT_OBJECT_NAME`,36050,`FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL`,36051,`FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE`,36064,`COLOR_ATTACHMENT0`,36096,`DEPTH_ATTACHMENT`,36128,`STENCIL_ATTACHMENT`,33306,`DEPTH_STENCIL_ATTACHMENT`,0,`NONE`,36053,`FRAMEBUFFER_COMPLETE`,36054,`FRAMEBUFFER_INCOMPLETE_ATTACHMENT`,36055,`FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT`,36057,`FRAMEBUFFER_INCOMPLETE_DIMENSIONS`,36061,`FRAMEBUFFER_UNSUPPORTED`,36006,`FRAMEBUFFER_BINDING`,36007,`RENDERBUFFER_BINDING`,34024,`MAX_RENDERBUFFER_SIZE`,1286,`INVALID_FRAMEBUFFER_OPERATION`,37440,`UNPACK_FLIP_Y_WEBGL`,37441,`UNPACK_PREMULTIPLY_ALPHA_WEBGL`,37442,`CONTEXT_LOST_WEBGL`,37443,`UNPACK_COLORSPACE_CONVERSION_WEBGL`,37444,`BROWSER_DEFAULT_WEBGL`,`WebGLRenderingContextBase`,`PPn!n"J4#9n$4%n&4'9n(4)9n*4+Pn,2-$1.Pn/20n122$13Pn420n526&27$18Pn92:Pn;,J2<$1=Pn>2:Pn?,J2@$1APnB2:PnC,J2D$1EPnF2:PnG,J2-$1HPnI2JnK2LnM2NnO2P$1QPnR2S$1TPnU2VnW2X$1YPnZ2[n\\2]$1^Pn_2\`na2bnc2dne2f$1gPnh2:ni1jPnk2l$1mPnn2Jno2Lnp2Nnq2P$1rPns2t$1uPnv2w$1xPny2Jnz2Ln{2Nn|2P$1}Pn~22$1Pn2:n2n2n
2n2n2n2n2$1Pn2:n2n2n2n2n2n2n2$1Pn1Pn1Pn1\xA0Pn¡1¢Pn£2¤Pn¥,J1¦Pn§1¨Pn©2S$1ªPPn«,J2<$1¬PPn,J2@$1®PPn¯,J20$1°PPn±,J2D$1²PPn³,J22$1´PPnµ,J2-$1¶Pn·2¸$1¹Pnº2»$1¼Pn½2¾n¿2À$1ÁPnÂ20nÃ22$1ÄPnÅ2Æ$1ÇPnÈ26$1ÉPnÊ2SnË2ÌnÍ2Î$1ÏPnÐ2SnÑ2ÎnÒ2¤nÓ2Ô$1ÕPnÖ2Æ$1×PnØ26$1ÙP$1ÚP$1ÛPnÜ2:nÝ2Þnß2àPná,J2D$1âPnã2:nä2Þnå2æPnç,J2-nè2$1éPnê2S$1ëPnì2:$1íPnî20nï26Pnð,J1ñPnò20nó26Pnô,J1õPnö20Pn÷F,J1øPnù20&27nú1ûPnü2:ný2þ"1ÿPPnĀ,J1āPnĂ1ăP&27"1ĄP.ą2ĆPnć,J1ĄP.Ĉ2ĆPnĉ,J1ĄP.Ċ2ĆPnċ,J1ĄP.Č2ĆPnč,J1ĄP.Ď2ĆPnď,J1ĄP.Đ2ĆPnđ,J1ĄP.Ē2ĆPnē,J1ĄP.Ĕ2ĆPnĕ,J1ĄP.Ė2ĆPnė,J1ĄP.Ę2ĆPnę,J1ĄP.Ě2ĆPně,J1ĄP.Ĝ2ĆPnĝ,J1ĄP.Ğ2ĆPnğ,J1ĄP.Ġ2ĆPnġ,J1ĄP.Ģ2ĆPnģ,J1ĄP.Ĥ2ĆPnĥ,J1ĄP.Ħ2ĆPnħ,J1ĄP.Ĩ2ĆPnĩ,J1ĄP.Ī2ĆPnī,J1ĄP.Ĭ2ĆPnĭ,J1ĄP.Į2ĆPnį,J1ĄP.İ2ĆPnı,J1ĄP.IJ2ĆPnij,J1ĄP.Ĵ2ĆPnĵ,J1ĄP.Ķ2ĆPnķ,J1ĄP.ĸ2ĆPnĹ,J1ĄP.ĺ2ĆPnĻ,J1ĄP.ļ2ĆPnĽ,J1ĄP.ľ2ĆPnĿ,J1ĄP.ŀ2ĆPnŁ,J1ĄP.ł2ĆPnŃ,J1ĄP.ń2ĆPnŅ,J1ĄP.ņ2ĆPnŇ,J1ĄP.ň2ĆPnʼn,J1ĄPnŊ2:nŋ2ÞnŌ2þ"1ōPnŎ2þ"1ŏPnŐ20P&,J1őPnŒ20nœ2þ"1ŔPnŕ2:nŖ2þ"1ŗPnŘ22P&,J1řPnŚ22nś2þ"1ŜPnŝ2Şnş2ŠPnš,J1ŢPnţ22P&,J1ŤPP&F,J1ťPnŦ2:nŧ2þ"1ŨPnũ20nŪ2ū"1ŬPnŭ20&27PnŮ,J1ůPnŰ26nű2þ"1ŲPnų26nŴ2þnŵ1ŶPnŷ2:nŸ2S$1ŹPPnź,J2<nŻ1żP)1ŽPnž2Ænſ1ƀPPnƁ,J2@nƂ1ƃPPnƄ,J20nƅ1ƆPPnƇ,J2Dnƈ1ƉPPnƊ,J22nƋ1ƌPPnƍ,J2-nƎ1ƏPnƐ2$1ƑPnƒ20$1ƓPnƔ2þPnƕnƖJ2Ɨ$1ƘPnƙ2ƚnƛ2Ɯ$1ƝPnƞ2:nƟ2nƠ2nơ2$1ƢPnƣ2Ƥnƥ2Ʀ$1ƧPnƨ2nƩ2nƪ2nƫ2$1ƬPnƭ22&2Ʈ$1ƯPnư2¸nƱ2ƲnƳ2l$1ƴPnƵ2ƶnƷ2¸nƸ2Ʋnƹ2l$1ƺPnƻ2l$1ƼPnƽ2ƶnƾ2l$1ƿPnǀ2ǁnǂ2ǃnDŽ2Dž$1džPnLJ2ƶnLj2ǁnlj2ǃnNJ2Dž$1NjPnnj2:nǍ2þnǎ2Ɨ$1ǏPnǐ2:nǑ2þnǒ2Ɨ$1ǓPPnǔ,J2ūnǕ2$1ǖPPnǗ,J2ūnǘ2$1ǙPPnǚ,J2ūnǛ2nǜ2$1ǝPPnǞ,J2ūnǟ2nǠ2$1ǡPPnǢ,J2ūnǣ2nǤ2nǥ2Ǧ$1ǧPPnǨ,J2ūnǩ2nǪ2nǫ2Ǧ$1ǬPPnǭ,J2ūnǮ2nǯ2nǰ2ǦnDZ2Dz$1dzPPnǴ,J2ūnǵ2nǶ2nǷ2ǦnǸ2Dz$1ǹPPnǺ,J20$1ǻPnǼ20$1ǽPnǾ26nǿ2$1ȀPnȁ26nȂ2ȃ$1ȄPnȅ26nȆ2nȇ2$1ȈPnȉ26nȊ2ȃ$1ȋPnȌ26nȍ2nȎ2nȏ2Ǧ$1ȐPnȑ26nȒ2ȃ$1ȓPnȔ26nȕ2nȖ2nȗ2ǦnȘ2Dz$1șPnȚ26nț2ȃ$1ȜPnȝ26nȞ2ȟnȠ2¤nȡ2Ȣnȣ2Ȥnȥ2Ô$1ȦPnȧ2nȨ2nȩ2nȪ2$1ȫ.Ȭ4ȭ9.Ȯ4ȯ9.Ȱ4ȱ9.Ȳ4ȳ9.ȴ4ȵ9.ȶ4ȷ9.ȸ4ȹ9.Ⱥ4Ȼ9.ȼ4Ƚ9.Ⱦ4ȿ9.ɀ4Ɂ9.ɂ4Ƀ9.Ʉ4Ʌ9.Ɇ4ɇ9.Ɉ4ɉ9.Ɋ4ɋ9.Ɍ4ɍ9.Ɏ4ɏ9.ɐ4ɑ9.ɒ4ɓ9.ɔ4ɕ9.ɖ4ɗ9.ɘ4ə9.ɚ4ɛ9.ɜ4ɝ9.ɞ4ɟ9.ɠ4ɡ9.ɢ4ɣ9.ɤ4ɥ9.ɦ4ɧ9.ɨ4ɩ9.ɪ4ɫ9.ɬ4ɭ9.ɮ4ɯ9.ɰ4ɱ9.ɲ4ɳ9.ɴ4ɵ9.ɶ4ɷ9.ɸ4ɹ9.ɺ4ɻ9.ɼ4ɽ9.ɾ4ɿ9.ʀ4ʁ9.ʂ4ʃ9.ʄ4ʅ9.ʆ4ʇ9.ʈ4ʉ9.ʊ4ʋ9.ʌ4ʍ9.ʎ4ʏ9.ʐ4ʑ9.ʒ4ʓ9.ʔ4ʕ9.ʖ4ʗ9.ʘ4ʙ9.ʚ4ʛ9.ʜ4ʝ9.ʞ4ʟ9.ʠ4ʡ9.ʢ4ʣ9.ʤ4ʥ9.ʦ4ʧ9.ʨ4ʩ9.ʪ4ʫ9.ʬ4ʭ9.ʮ4ʯ9.ʰ4ʱ9.ʲ4ʳ9.ʴ4ʵ9.ʶ4ʷ9.ʸ4ʹ9.ʺ4ʻ9.ʼ4ʽ9.ʾ4ʿ9.ˀ4ˁ9.˂4˃9.˄4˅9.ˆ4ˇ9.ˈ4ˉ9.ˊ4ˋ9.ˌ4ˍ9.ˎ4ˏ9.ː4ˑ9.˒4˓9.˔4˕9.˖4˗9.˘4˙9.˚4˛9.˜4˝9.˞4˟9.ˠ4ˡ9.ˢ4ˣ9.ˤ4˥9.˦4˧9.˨4˩9.˪4˫9.ˬ4˭9.ˮ4˯9.˰4˱9.˲4˳9.˴4˵9.˶4˷9.˸4˹9.˺4˻9.˼4˽9.˾4˿9.̀4́9.̂4̃9.̄4̅9.̆4̇9.̈4̉9.̊4̋9.̌4̍9.̎4̏9.̐4̑9.̒4̓9.̔4̕9.̖4̗9.̘4̙9.̚4̛9.̜4̝9.̞4̟9.̠4̡9.̢4̣9.̤4̥9.̦4̧9.̨4̩9.̪4̫9.̬4̭9.̮4̯9.̰4̱9.̲4̳9.̴4̵9.̶4̷9.̸4̹9.̺4̻9.̼4̽9.̾4̿9.̀4́9.͂4̓9.̈́4ͅ9.͆4͇9.͈4͉9.͊4͋9.͌4͍9.͎4͏9.͐4͑9.͒4͓9.͔4͕9.͖4͗9.͘4͙9.͚4͛9.͜4͝9.͞4͟9.͠4͡9.͢4ͣ9.ͤ4ͥ9.ͦ4ͧ9.ͨ4ͩ9.ͪ4ͫ9.ͬ4ͭ9.ͮ4ͯ9.Ͱ4ͱ9.Ͳ4ͳ9.ʹ4͵9.Ͷ4ͷ9.49.ͺ4ͻ9.ͼ4ͽ9.;4Ϳ9.49.49.΄4΅9.Ά4·9.Έ4Ή9.Ί49.Ό49.Ύ4Ώ9.ΐ4Α9.Β4Γ9.Δ4Ε9.Ζ4Η9.Θ4Ι9.Κ4Λ9.Μ4Ν9.Ξ4Ο9.Π4Ρ9.4Σ9.Τ4Υ9.Φ4Χ9.Ψ4Ω9.Ϊ4Ϋ9.ά4έ9.ή4ί9.ΰ4α9.β4γ9.δ4ε9.ζ4η9.θ4ι9.κ4λ9.μ4ν9.ξ4ο9.π4ρ9.ς4σ9.τ4υ9.φ4χ9.ψ4ω9.ϊ4ϋ9.ό4ύ9.ώ4Ϗ9.ϐ4ϑ9.ϒ4ϓ9.ϔ4ϕ9.ϖ4ϗ9.Ϙ4ϙ9.Ϛ4ϛ9.Ϝ4ϝ9.Ϟ4ϟ9.Ϡ4ϡ9.Ϣ4ϣ9.Ϥ4ϥ9.Ϧ4ϧ9.Ϩ4ϩ9.Ϫ4ϫ9.Ϭ4ϭ9.Ϯ4ϯ9.ϰ4ϱ9.ϲ4ϳ9.ϴ4ϵ9.϶4Ϸ9.ϸ4Ϲ9.Ϻ4ϻ9.ϼ4Ͻ9.Ͼ4Ͽ9.Ѐ4Ё9.Ђ4Ѓ9.Є4Ѕ9.І4Ї9.Ј4Љ9.Њ4Ћ9.Ќ4Ѝ9.Ў4Џ9.А4Б9.В4Г9.Д4Е9.Ж4З9.И4Й9.К4Л9.М4Н9.О4П9.Р4С9.Т4У9.Ф4Х9.Ц4Ч9.Ш4Щ9.Ъ4Ы9.Ь4Э9.Ю4Я9.а4б9.в4г9.д4е9.ж4з9.и4й9.к4л9.м4н9.о4п9.р4с9.т4у9.ф4х9.ц4ч9.ш4щ9.ъ4ы9.ь4э9.ю4я9.ѐ4ё9.ђ4ѓ9.є4ѕ9.і4ї9.ј4љ9.њ4ћ9.ќ4ѝ9.ў4џ9.Ѡ4ѡ9.Ѣ4ѣ9.Ѥ4ѥ9.Ѧ4ѧ9.Ѩ4ѩ9.Ѫ4ѫ9.Ѭ4ѭ9.Ѯ4ѯ9.Ѱ4ѱ9.Ѳ4ѳ9.Ѵ4ѵ9.Ѷ4ѷ9.Ѹ4ѹ9.Ѻ4ѻ9.Ѽ4ѽ9MwѾy`],Kc=[()=>q,`target`,()=>Ad,`size`,()=>q,`usage`,`bufferData`,()=>q,()=>jd,`data`,()=>q,()=>q,()=>Gu,`offset`,()=>jd,`bufferSubData`,()=>q,()=>Y,`level`,()=>q,`internalformat`,()=>K,`width`,()=>K,`height`,()=>Y,`border`,()=>Md,()=>Nd,`compressedTexImage2D`,()=>q,()=>Y,()=>Y,`xoffset`,()=>Y,`yoffset`,()=>K,()=>K,()=>q,`format`,()=>Md,()=>Nd,`compressedTexSubImage2D`,()=>Y,`x`,()=>Y,`y`,()=>K,()=>K,()=>q,()=>q,`type`,()=>Md,()=>Nd,`pixels`,`readPixels`,()=>q,()=>Y,()=>Y,()=>K,()=>K,()=>Y,()=>q,()=>q,()=>Md,()=>Nd,`texImage2D`,()=>q,()=>Y,()=>Y,()=>q,()=>q,()=>Pd,`source`,()=>q,()=>Y,()=>Y,()=>Y,()=>K,()=>K,()=>q,()=>q,()=>Md,()=>Nd,`texSubImage2D`,()=>q,()=>Y,()=>Y,()=>Y,()=>q,()=>q,()=>Pd,()=>X,`location`,()=>kd,`v`,`uniform1fv`,()=>X,()=>Fd,`uniform1iv`,()=>X,()=>kd,`uniform2fv`,()=>X,()=>Fd,`uniform2iv`,()=>X,()=>kd,`uniform3fv`,()=>X,()=>Fd,`uniform3iv`,()=>X,()=>kd,`uniform4fv`,()=>X,()=>Fd,`uniform4iv`,()=>X,()=>Wu,`transpose`,()=>kd,`value`,`uniformMatrix2fv`,()=>X,()=>Wu,()=>kd,`uniformMatrix3fv`,()=>X,()=>Wu,()=>kd,`uniformMatrix4fv`,`WebGLRenderingContextOverloads`,`PPn!2"n#2$n%2&$1'Pn(2"Pn),J2*n+2&$1'Pn,2"n-2.n/2*$10Pn12"n223n425n627n829n:2;n=o<"2*$1>Pn?2"n@23nA2BnC2DnE27nF29nG2HnJoI"2*$1KPnL2MnN2OnP27nQ29nR2HnS2TPnVoU",J2W$1XPnY2"nZ23n[25n\\27n]29n^2;n_2Hn\`2TPnboa",J2W$1cPnd2"ne23nf25ng2Hnh2Tni2j$1cPnk2"nl23nm2Bnn2Dno27np29nq2Hnr2TPntos",J2W$1uPnv2"nw23nx2Bny2Dnz2Hn{2Tn|2j$1uPPn},J2~n2$1PPn,J2~n2$1PPn
,J2~n2$1PPn,J2~n2$1PPn,J2~n2$1PPn,J2~n2$1PPn,J2~n2$1PPn,J2~n2$1PPn,J2~n2n2$1PPn,J2~n2n2$1\xA0PPn¡,J2~n¢2n£2$1¤Mw¥y`],qc=[()=>q,`target`,()=>Id,`query`,`beginQuery`,()=>q,`primitiveMode`,`beginTransformFeedback`,()=>q,()=>J,`index`,()=>Ru,`buffer`,`bindBufferBase`,()=>q,()=>J,()=>Ru,()=>Gu,`offset`,()=>Ad,`size`,`bindBufferRange`,()=>J,`unit`,()=>Ld,`sampler`,`bindSampler`,()=>q,()=>Rd,`tf`,`bindTransformFeedback`,()=>zd,`array`,`bindVertexArray`,()=>Y,`srcX0`,()=>Y,`srcY0`,()=>Y,`srcX1`,()=>Y,`srcY1`,()=>Y,`dstX0`,()=>Y,`dstY0`,()=>Y,`dstX1`,()=>Y,`dstY1`,()=>Uu,`mask`,()=>q,`filter`,`blitFramebuffer`,()=>q,()=>Y,`drawbuffer`,()=>Od,`depth`,()=>Y,`stencil`,`clearBufferfi`,()=>q,()=>Y,()=>kd,`values`,`srcOffset`,`clearBufferfv`,()=>q,()=>Y,()=>Fd,`clearBufferiv`,()=>q,()=>Y,()=>Bd,`clearBufferuiv`,()=>Vd,`sync`,()=>Uu,`flags`,()=>Hd,`timeout`,()=>q,`clientWaitSync`,()=>q,()=>Y,`level`,()=>q,`internalformat`,()=>K,`width`,()=>K,`height`,()=>K,()=>Y,`border`,()=>K,`imageSize`,()=>Gu,`compressedTexImage3D`,()=>q,()=>Y,()=>q,()=>K,()=>K,()=>K,()=>Y,()=>Md,()=>Nd,`srcData`,()=>J,`srcLengthOverride`,()=>q,()=>Y,()=>Y,`xoffset`,()=>Y,`yoffset`,()=>Y,`zoffset`,()=>K,()=>K,()=>K,()=>q,`format`,()=>K,()=>Gu,`compressedTexSubImage3D`,()=>q,()=>Y,()=>Y,()=>Y,()=>Y,()=>K,()=>K,()=>K,()=>q,()=>Md,()=>Nd,()=>J,()=>q,`readTarget`,()=>q,`writeTarget`,()=>Gu,`readOffset`,()=>Gu,`writeOffset`,()=>Ad,`copyBufferSubData`,()=>q,()=>Y,()=>Y,()=>Y,()=>Y,()=>Y,`x`,()=>Y,`y`,()=>K,()=>K,`copyTexSubImage3D`,()=>Id,`createQuery`,()=>Ld,`createSampler`,()=>Rd,`createTransformFeedback`,()=>zd,`createVertexArray`,()=>Id,`deleteQuery`,()=>Ld,`deleteSampler`,()=>Vd,`deleteSync`,()=>Rd,`deleteTransformFeedback`,()=>zd,`vertexArray`,`deleteVertexArray`,()=>q,`mode`,()=>Y,`first`,()=>K,`count`,()=>K,`instanceCount`,`drawArraysInstanced`,()=>q,`buffers`,`drawBuffers`,()=>q,()=>K,()=>q,`type`,()=>Gu,()=>K,`drawElementsInstanced`,()=>q,()=>J,`start`,()=>J,`end`,()=>K,()=>q,()=>Gu,`drawRangeElements`,()=>q,`endQuery`,`endTransformFeedback`,()=>q,`condition`,()=>Uu,()=>Vd,`fenceSync`,()=>q,()=>q,`attachment`,()=>Vu,`texture`,()=>Y,()=>Y,`layer`,`framebufferTextureLayer`,()=>Iu,`program`,()=>J,`uniformBlockIndex`,`getActiveUniformBlockName`,()=>Iu,()=>J,()=>q,`pname`,`getActiveUniformBlockParameter`,()=>Iu,()=>J,`uniformIndices`,()=>q,`getActiveUniforms`,()=>q,()=>Gu,`srcByteOffset`,()=>Md,()=>Nd,`dstBuffer`,`dstOffset`,()=>J,`length`,`getBufferSubData`,()=>Iu,`name`,()=>Y,`getFragDataLocation`,()=>q,()=>J,`getIndexedParameter`,()=>q,()=>q,()=>q,`getInternalformatParameter`,()=>q,()=>q,()=>Id,`getQuery`,()=>Id,()=>q,`getQueryParameter`,()=>Ld,()=>q,`getSamplerParameter`,()=>Vd,()=>q,`getSyncParameter`,()=>Iu,()=>J,()=>Ku,`getTransformFeedbackVarying`,()=>Iu,`uniformBlockName`,()=>J,`getUniformBlockIndex`,()=>Iu,`uniformNames`,()=>J,`getUniformIndices`,()=>q,()=>q,`attachments`,`invalidateFramebuffer`,()=>q,()=>q,()=>Y,()=>Y,()=>K,()=>K,`invalidateSubFramebuffer`,()=>Id,()=>Wu,`isQuery`,()=>Ld,()=>Wu,`isSampler`,()=>Vd,()=>Wu,`isSync`,()=>Rd,()=>Wu,`isTransformFeedback`,()=>zd,()=>Wu,`isVertexArray`,`pauseTransformFeedback`,()=>q,`src`,`readBuffer`,()=>q,()=>K,`samples`,()=>q,()=>K,()=>K,`renderbufferStorageMultisample`,`resumeTransformFeedback`,()=>Ld,()=>q,()=>Od,`param`,`samplerParameterf`,()=>Ld,()=>q,()=>Y,`samplerParameteri`,()=>q,()=>Y,()=>Y,()=>K,()=>K,()=>K,()=>Y,()=>q,()=>q,()=>Gu,`pboOffset`,`texImage3D`,()=>q,()=>Y,()=>Y,()=>K,()=>K,()=>K,()=>Y,()=>q,()=>q,()=>Pd,`source`,()=>q,()=>Y,()=>Y,()=>K,()=>K,()=>K,()=>Y,()=>q,()=>q,()=>Md,()=>Nd,()=>q,()=>Y,()=>Y,()=>K,()=>K,()=>K,()=>Y,()=>q,()=>q,()=>Md,()=>Nd,()=>q,()=>K,`levels`,()=>q,()=>K,()=>K,`texStorage2D`,()=>q,()=>K,()=>q,()=>K,()=>K,()=>K,`texStorage3D`,()=>q,()=>Y,()=>Y,()=>Y,()=>Y,()=>K,()=>K,()=>K,()=>q,()=>q,()=>Gu,`texSubImage3D`,()=>q,()=>Y,()=>Y,()=>Y,()=>Y,()=>K,()=>K,()=>K,()=>q,()=>q,()=>Pd,()=>q,()=>Y,()=>Y,()=>Y,()=>Y,()=>K,()=>K,()=>K,()=>q,()=>q,()=>Md,()=>Nd,()=>Iu,`varyings`,()=>q,`bufferMode`,`transformFeedbackVaryings`,()=>X,`location`,()=>J,`v0`,`uniform1ui`,()=>X,()=>Bd,`data`,()=>J,`srcLength`,`uniform1uiv`,()=>X,()=>J,()=>J,`v1`,`uniform2ui`,()=>X,()=>Bd,()=>J,`uniform2uiv`,()=>X,()=>J,()=>J,()=>J,`v2`,`uniform3ui`,()=>X,()=>Bd,()=>J,`uniform3uiv`,()=>X,()=>J,()=>J,()=>J,()=>J,`v3`,`uniform4ui`,()=>X,()=>Bd,()=>J,`uniform4uiv`,()=>Iu,()=>J,()=>J,`uniformBlockBinding`,()=>X,()=>Wu,`transpose`,()=>kd,()=>J,`uniformMatrix2x3fv`,()=>X,()=>Wu,()=>kd,()=>J,`uniformMatrix2x4fv`,()=>X,()=>Wu,()=>kd,()=>J,`uniformMatrix3x2fv`,()=>X,()=>Wu,()=>kd,()=>J,`uniformMatrix3x4fv`,()=>X,()=>Wu,()=>kd,()=>J,`uniformMatrix4x2fv`,()=>X,()=>Wu,()=>kd,()=>J,`uniformMatrix4x3fv`,()=>J,()=>J,`divisor`,`vertexAttribDivisor`,()=>J,()=>Y,()=>Y,()=>Y,`z`,()=>Y,`w`,`vertexAttribI4i`,()=>J,()=>Fd,`vertexAttribI4iv`,()=>J,()=>J,()=>J,()=>J,()=>J,`vertexAttribI4ui`,()=>J,()=>Bd,`vertexAttribI4uiv`,()=>J,()=>Y,()=>q,()=>K,`stride`,()=>Gu,`vertexAttribIPointer`,()=>Vd,()=>Uu,()=>Ud,`waitSync`,3074,`READ_BUFFER`,3314,`UNPACK_ROW_LENGTH`,3315,`UNPACK_SKIP_ROWS`,3316,`UNPACK_SKIP_PIXELS`,3330,`PACK_ROW_LENGTH`,3331,`PACK_SKIP_ROWS`,3332,`PACK_SKIP_PIXELS`,6144,`COLOR`,6145,`DEPTH`,6146,`STENCIL`,6403,`RED`,32849,`RGB8`,32857,`RGB10_A2`,32874,`TEXTURE_BINDING_3D`,32877,`UNPACK_SKIP_IMAGES`,32878,`UNPACK_IMAGE_HEIGHT`,32879,`TEXTURE_3D`,32882,`TEXTURE_WRAP_R`,32883,`MAX_3D_TEXTURE_SIZE`,33640,`UNSIGNED_INT_2_10_10_10_REV`,33e3,`MAX_ELEMENTS_VERTICES`,33001,`MAX_ELEMENTS_INDICES`,33082,`TEXTURE_MIN_LOD`,33083,`TEXTURE_MAX_LOD`,33084,`TEXTURE_BASE_LEVEL`,33085,`TEXTURE_MAX_LEVEL`,32775,`MIN`,32776,`MAX`,33190,`DEPTH_COMPONENT24`,34045,`MAX_TEXTURE_LOD_BIAS`,34892,`TEXTURE_COMPARE_MODE`,34893,`TEXTURE_COMPARE_FUNC`,34917,`CURRENT_QUERY`,34918,`QUERY_RESULT`,34919,`QUERY_RESULT_AVAILABLE`,35041,`STREAM_READ`,35042,`STREAM_COPY`,35045,`STATIC_READ`,35046,`STATIC_COPY`,35049,`DYNAMIC_READ`,35050,`DYNAMIC_COPY`,34852,`MAX_DRAW_BUFFERS`,34853,`DRAW_BUFFER0`,34854,`DRAW_BUFFER1`,34855,`DRAW_BUFFER2`,34856,`DRAW_BUFFER3`,34857,`DRAW_BUFFER4`,34858,`DRAW_BUFFER5`,34859,`DRAW_BUFFER6`,34860,`DRAW_BUFFER7`,34861,`DRAW_BUFFER8`,34862,`DRAW_BUFFER9`,34863,`DRAW_BUFFER10`,34864,`DRAW_BUFFER11`,34865,`DRAW_BUFFER12`,34866,`DRAW_BUFFER13`,34867,`DRAW_BUFFER14`,34868,`DRAW_BUFFER15`,35657,`MAX_FRAGMENT_UNIFORM_COMPONENTS`,35658,`MAX_VERTEX_UNIFORM_COMPONENTS`,35679,`SAMPLER_3D`,35682,`SAMPLER_2D_SHADOW`,35723,`FRAGMENT_SHADER_DERIVATIVE_HINT`,35051,`PIXEL_PACK_BUFFER`,35052,`PIXEL_UNPACK_BUFFER`,35053,`PIXEL_PACK_BUFFER_BINDING`,35055,`PIXEL_UNPACK_BUFFER_BINDING`,35685,`FLOAT_MAT2x3`,35686,`FLOAT_MAT2x4`,35687,`FLOAT_MAT3x2`,35688,`FLOAT_MAT3x4`,35689,`FLOAT_MAT4x2`,35690,`FLOAT_MAT4x3`,35904,`SRGB`,35905,`SRGB8`,35907,`SRGB8_ALPHA8`,34894,`COMPARE_REF_TO_TEXTURE`,34836,`RGBA32F`,34837,`RGB32F`,34842,`RGBA16F`,34843,`RGB16F`,35069,`VERTEX_ATTRIB_ARRAY_INTEGER`,35071,`MAX_ARRAY_TEXTURE_LAYERS`,35076,`MIN_PROGRAM_TEXEL_OFFSET`,35077,`MAX_PROGRAM_TEXEL_OFFSET`,35659,`MAX_VARYING_COMPONENTS`,35866,`TEXTURE_2D_ARRAY`,35869,`TEXTURE_BINDING_2D_ARRAY`,35898,`R11F_G11F_B10F`,35899,`UNSIGNED_INT_10F_11F_11F_REV`,35901,`RGB9_E5`,35902,`UNSIGNED_INT_5_9_9_9_REV`,35967,`TRANSFORM_FEEDBACK_BUFFER_MODE`,35968,`MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS`,35971,`TRANSFORM_FEEDBACK_VARYINGS`,35972,`TRANSFORM_FEEDBACK_BUFFER_START`,35973,`TRANSFORM_FEEDBACK_BUFFER_SIZE`,35976,`TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN`,35977,`RASTERIZER_DISCARD`,35978,`MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS`,35979,`MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS`,35980,`INTERLEAVED_ATTRIBS`,35981,`SEPARATE_ATTRIBS`,35982,`TRANSFORM_FEEDBACK_BUFFER`,35983,`TRANSFORM_FEEDBACK_BUFFER_BINDING`,36208,`RGBA32UI`,36209,`RGB32UI`,36214,`RGBA16UI`,36215,`RGB16UI`,36220,`RGBA8UI`,36221,`RGB8UI`,36226,`RGBA32I`,36227,`RGB32I`,36232,`RGBA16I`,36233,`RGB16I`,36238,`RGBA8I`,36239,`RGB8I`,36244,`RED_INTEGER`,36248,`RGB_INTEGER`,36249,`RGBA_INTEGER`,36289,`SAMPLER_2D_ARRAY`,36292,`SAMPLER_2D_ARRAY_SHADOW`,36293,`SAMPLER_CUBE_SHADOW`,36294,`UNSIGNED_INT_VEC2`,36295,`UNSIGNED_INT_VEC3`,36296,`UNSIGNED_INT_VEC4`,36298,`INT_SAMPLER_2D`,36299,`INT_SAMPLER_3D`,36300,`INT_SAMPLER_CUBE`,36303,`INT_SAMPLER_2D_ARRAY`,36306,`UNSIGNED_INT_SAMPLER_2D`,36307,`UNSIGNED_INT_SAMPLER_3D`,36308,`UNSIGNED_INT_SAMPLER_CUBE`,36311,`UNSIGNED_INT_SAMPLER_2D_ARRAY`,36012,`DEPTH_COMPONENT32F`,36013,`DEPTH32F_STENCIL8`,36269,`FLOAT_32_UNSIGNED_INT_24_8_REV`,33296,`FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING`,33297,`FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE`,33298,`FRAMEBUFFER_ATTACHMENT_RED_SIZE`,33299,`FRAMEBUFFER_ATTACHMENT_GREEN_SIZE`,33300,`FRAMEBUFFER_ATTACHMENT_BLUE_SIZE`,33301,`FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE`,33302,`FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE`,33303,`FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE`,33304,`FRAMEBUFFER_DEFAULT`,34042,`UNSIGNED_INT_24_8`,35056,`DEPTH24_STENCIL8`,35863,`UNSIGNED_NORMALIZED`,36006,`DRAW_FRAMEBUFFER_BINDING`,36008,`READ_FRAMEBUFFER`,36009,`DRAW_FRAMEBUFFER`,36010,`READ_FRAMEBUFFER_BINDING`,36011,`RENDERBUFFER_SAMPLES`,36052,`FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER`,36063,`MAX_COLOR_ATTACHMENTS`,36065,`COLOR_ATTACHMENT1`,36066,`COLOR_ATTACHMENT2`,36067,`COLOR_ATTACHMENT3`,36068,`COLOR_ATTACHMENT4`,36069,`COLOR_ATTACHMENT5`,36070,`COLOR_ATTACHMENT6`,36071,`COLOR_ATTACHMENT7`,36072,`COLOR_ATTACHMENT8`,36073,`COLOR_ATTACHMENT9`,36074,`COLOR_ATTACHMENT10`,36075,`COLOR_ATTACHMENT11`,36076,`COLOR_ATTACHMENT12`,36077,`COLOR_ATTACHMENT13`,36078,`COLOR_ATTACHMENT14`,36079,`COLOR_ATTACHMENT15`,36182,`FRAMEBUFFER_INCOMPLETE_MULTISAMPLE`,36183,`MAX_SAMPLES`,5131,`HALF_FLOAT`,33319,`RG`,33320,`RG_INTEGER`,33321,`R8`,33323,`RG8`,33325,`R16F`,33326,`R32F`,33327,`RG16F`,33328,`RG32F`,33329,`R8I`,33330,`R8UI`,33331,`R16I`,33332,`R16UI`,33333,`R32I`,33334,`R32UI`,33335,`RG8I`,33336,`RG8UI`,33337,`RG16I`,33338,`RG16UI`,33339,`RG32I`,33340,`RG32UI`,34229,`VERTEX_ARRAY_BINDING`,36756,`R8_SNORM`,36757,`RG8_SNORM`,36758,`RGB8_SNORM`,36759,`RGBA8_SNORM`,36764,`SIGNED_NORMALIZED`,36662,`COPY_READ_BUFFER`,36663,`COPY_WRITE_BUFFER`,36662,`COPY_READ_BUFFER_BINDING`,36663,`COPY_WRITE_BUFFER_BINDING`,35345,`UNIFORM_BUFFER`,35368,`UNIFORM_BUFFER_BINDING`,35369,`UNIFORM_BUFFER_START`,35370,`UNIFORM_BUFFER_SIZE`,35371,`MAX_VERTEX_UNIFORM_BLOCKS`,35373,`MAX_FRAGMENT_UNIFORM_BLOCKS`,35374,`MAX_COMBINED_UNIFORM_BLOCKS`,35375,`MAX_UNIFORM_BUFFER_BINDINGS`,35376,`MAX_UNIFORM_BLOCK_SIZE`,35377,`MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS`,35379,`MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS`,35380,`UNIFORM_BUFFER_OFFSET_ALIGNMENT`,35382,`ACTIVE_UNIFORM_BLOCKS`,35383,`UNIFORM_TYPE`,35384,`UNIFORM_SIZE`,35386,`UNIFORM_BLOCK_INDEX`,35387,`UNIFORM_OFFSET`,35388,`UNIFORM_ARRAY_STRIDE`,35389,`UNIFORM_MATRIX_STRIDE`,35390,`UNIFORM_IS_ROW_MAJOR`,35391,`UNIFORM_BLOCK_BINDING`,35392,`UNIFORM_BLOCK_DATA_SIZE`,35394,`UNIFORM_BLOCK_ACTIVE_UNIFORMS`,35395,`UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES`,35396,`UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER`,35398,`UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER`,4294967295,`INVALID_INDEX`,37154,`MAX_VERTEX_OUTPUT_COMPONENTS`,37157,`MAX_FRAGMENT_INPUT_COMPONENTS`,37137,`MAX_SERVER_WAIT_TIMEOUT`,37138,`OBJECT_TYPE`,37139,`SYNC_CONDITION`,37140,`SYNC_STATUS`,37141,`SYNC_FLAGS`,37142,`SYNC_FENCE`,37143,`SYNC_GPU_COMMANDS_COMPLETE`,37144,`UNSIGNALED`,37145,`SIGNALED`,37146,`ALREADY_SIGNALED`,37147,`TIMEOUT_EXPIRED`,37148,`CONDITION_SATISFIED`,37149,`WAIT_FAILED`,1,`SYNC_FLUSH_COMMANDS_BIT`,35070,`VERTEX_ATTRIB_ARRAY_DIVISOR`,35887,`ANY_SAMPLES_PASSED`,36202,`ANY_SAMPLES_PASSED_CONSERVATIVE`,35097,`SAMPLER_BINDING`,36975,`RGB10_A2UI`,36255,`INT_2_10_10_10_REV`,36386,`TRANSFORM_FEEDBACK`,36387,`TRANSFORM_FEEDBACK_PAUSED`,36388,`TRANSFORM_FEEDBACK_ACTIVE`,36389,`TRANSFORM_FEEDBACK_BINDING`,37167,`TEXTURE_IMMUTABLE_FORMAT`,36203,`MAX_ELEMENT_INDEX`,33503,`TEXTURE_IMMUTABLE_LEVELS`,-1,`TIMEOUT_IGNORED`,37447,`MAX_CLIENT_WAIT_TIMEOUT_WEBGL`,`WebGL2RenderingContextBase`,`PPn!2"n#2$$1%Pn&2'$1(Pn)2"n*2+Pn,,J2-$1.Pn/2"n02+Pn1,J2-n223n425$16Pn728Pn9,J2:$1;Pn<2"Pn=,J2>$1?PPn@,J2A$1BPnC2DnE2FnG2HnI2JnK2LnM2NnO2PnQ2RnS2TnU2V$1WPnX2-nY2Zn[2\\n]2^$1_Pn\`2-na2Znb2c'2d8$1ePnf2-ng2Znh2c'2d8$1iPnj2-nk2Znl2c'2d8$1mPnn2onp2qnr2snt1uPnv2"nw2xny2zn{2|n}2~n2\\n2n2n23$1
Pn2"n2xn2zn2|n2~n2\\n2no"2'2d8n28$1
Pn2"n2xn2n2n2n2|n2~n2\\n2n2n\xA023$1¡Pn¢2"n£2xn¤2n¥2n¦2n§2|n¨2~n©2\\nª2n¬o«"2'2d8n28$1¡Pn®2¯n°2±n²2³n´2µn¶25$1·Pn¸2"n¹2xnº2n»2n¼2n½2¾n¿2ÀnÁ2|nÂ2~$1ÃPnÄ1ÅPnÆ1ÇPnÈ1ÉPnÊ1ËPPnÌ,J2$$1ÍPPnÎ,J2:$1ÏPPnÐ,J2o$1ÑPPnÒ,J2>$1ÓPPnÔ,J2Õ$1ÖPn×2ØnÙ2ÚnÛ2ÜnÝ2Þ$1ßPnàF2á$1âPnã2Ønä2Ünå2ænç23nè2Þ$1éPnê2Ønë2ìní2înï2Ünð2ænñ23$1òPnó2"$1ôP$1õPnö2÷nø2qPnù,J1úPnû2"nü2ýPnþ,J2ÿnĀ2xnā2Ă$1ăPnĄ2ąnĆ2ćP&,J1ĈPnĉ2ąnĊ2ćnċ2Č"1čPnĎ2ąnďF2Đnđ2Č"1ĒPnē2"nĔ2ĕnėoĖ"2Ę'2ę8nĚ2ě8$1ĜPnĝ2ą&2Ğnğ1ĠPnġ2"nĢ2+"1ģPnĤ2"nĥ2znĦ2Č"1ħPnĨ2"nĩ2ČPnĪ,J1īPnĬ2$nĭ2Č"1ĮPnį2:nİ2Č"1ıPnIJ2onij2Č"1ĴPnĵ2ąnĶ2+Pnķ,J1ĸPnĹ2ą&2ĺnĻ1ļPnĽ2ą&F2ľPnĿF,J1ŀPnŁ2"nłF2Ń$1ńPnŅ2"nņF2ŃnŇ2¾nň2Ànʼn2|nŊ2~$1ŋPPnŌ,J2$nō1ŎPPnŏ,J2:nŐ1őPPnŒ,J2onœ1ŔPPnŕ,J2>nŖ1ŗPPnŘ,J2Õnř1ŚP$1śPnŜ2ŝ$1ŞPnş2"nŠ2šnŢ2znţ2|nŤ2~$1ťP$1ŦPnŧ2:nŨ2Čnũ2Ū$1ūPnŬ2:nŭ2ČnŮ2Ū$1ůPnŰ2"nű2xnŲ2znų2|nŴ2~nŵ2\\nŶ2nŷ2nŸ2ænŹ2ź$1ŻPnż2"nŽ2xnž2znſ2|nƀ2~nƁ2\\nƂ2nƃ2nƄ2ænƅ2Ɔ$1ŻPnƇ2"nƈ2xnƉ2znƊ2|nƋ2~nƌ2\\nƍ2nƎ2nƏ2æPnƑoƐ",J2$1ŻPnƒ2"nƓ2xnƔ2znƕ2|nƖ2~nƗ2\\nƘ2nƙ2nƚ2ænƜoƛ"2'2d$1ŻPnƝ2"nƞ2ƟnƠ2znơ2|nƢ2~$1ƣPnƤ2"nƥ2ƟnƦ2znƧ2|nƨ2~nƩ2\\$1ƪPnƫ2"nƬ2xnƭ2nƮ2nƯ2nư2|nƱ2~nƲ2\\nƳ2nƴ2ænƵ2ź$1ƶPnƷ2"nƸ2xnƹ2nƺ2nƻ2nƼ2|nƽ2~nƾ2\\nƿ2nǀ2ænǁ2Ɔ$1ƶPnǂ2"nǃ2xnDŽ2nDž2ndž2nLJ2|nLj2~nlj2\\nNJ2nNj2æPnǍonj",J2'2d8$1ƶPnǎ2ą&F2Ǐnǐ2Ǒ$1ǒPPnǓ,J2ǔnǕ2ǖ$1ǗPPnǘ,J2ǔnǙ2ǚ'2d8nǛ2ǜ8$1ǝPPnǞ,J2ǔnǟ2ǖnǠ2ǡ$1ǢPPnǣ,J2ǔnǤ2ǚ'2d8nǥ2ǜ8$1ǦPPnǧ,J2ǔnǨ2ǖnǩ2ǡnǪ2ǫ$1ǬPPnǭ,J2ǔnǮ2ǚ'2d8nǯ2ǜ8$1ǰPPnDZ,J2ǔnDz2ǖndz2ǡnǴ2ǫnǵ2Ƕ$1ǷPPnǸ,J2ǔnǹ2ǚ'2d8nǺ2ǜ8$1ǻPnǼ2ąnǽ2ćnǾ2ǿ$1ǿPPnȀ,J2ǔnȁ2Ȃnȃ2ǚ'2d8nȄ2ǜ8$1ȅPPnȆ,J2ǔnȇ2ȂnȈ2ǚ'2d8nȉ2ǜ8$1ȊPPnȋ,J2ǔnȌ2Ȃnȍ2ǚ'2d8nȎ2ǜ8$1ȏPPnȐ,J2ǔnȑ2ȂnȒ2ǚ'2d8nȓ2ǜ8$1ȔPPnȕ,J2ǔnȖ2Ȃnȗ2ǚ'2d8nȘ2ǜ8$1șPPnȚ,J2ǔnț2ȂnȜ2ǚ'2d8nȝ2ǜ8$1ȞPnȟ2+nȠ2ȡ$1ȢPnȣ2+nȤ2¾nȥ2ÀnȦ2ȧnȨ2ȩ$1ȪPnȫ2+nȬ2c$1ȭPnȮ2+nȯ2¾nȰ2Ànȱ2ȧnȲ2ȩ$1ȳPnȴ2+nȵ2c$1ȶPnȷ2+nȸ25nȹ2ænȺ2Ȼnȼ23$1ȽPnȾ2onȿ2qnɀ2s$1Ɂ.ɂ4Ƀ9.Ʉ4Ʌ9.Ɇ4ɇ9.Ɉ4ɉ9.Ɋ4ɋ9.Ɍ4ɍ9.Ɏ4ɏ9.ɐ4ɑ9.ɒ4ɓ9.ɔ4ɕ9.ɖ4ɗ9.ɘ4ə9.ɚ4ɛ9.ɜ4ɝ9.ɞ4ɟ9.ɠ4ɡ9.ɢ4ɣ9.ɤ4ɥ9.ɦ4ɧ9.ɨ4ɩ9.ɪ4ɫ9.ɬ4ɭ9.ɮ4ɯ9.ɰ4ɱ9.ɲ4ɳ9.ɴ4ɵ9.ɶ4ɷ9.ɸ4ɹ9.ɺ4ɻ9.ɼ4ɽ9.ɾ4ɿ9.ʀ4ʁ9.ʂ4ʃ9.ʄ4ʅ9.ʆ4ʇ9.ʈ4ʉ9.ʊ4ʋ9.ʌ4ʍ9.ʎ4ʏ9.ʐ4ʑ9.ʒ4ʓ9.ʔ4ʕ9.ʖ4ʗ9.ʘ4ʙ9.ʚ4ʛ9.ʜ4ʝ9.ʞ4ʟ9.ʠ4ʡ9.ʢ4ʣ9.ʤ4ʥ9.ʦ4ʧ9.ʨ4ʩ9.ʪ4ʫ9.ʬ4ʭ9.ʮ4ʯ9.ʰ4ʱ9.ʲ4ʳ9.ʴ4ʵ9.ʶ4ʷ9.ʸ4ʹ9.ʺ4ʻ9.ʼ4ʽ9.ʾ4ʿ9.ˀ4ˁ9.˂4˃9.˄4˅9.ˆ4ˇ9.ˈ4ˉ9.ˊ4ˋ9.ˌ4ˍ9.ˎ4ˏ9.ː4ˑ9.˒4˓9.˔4˕9.˖4˗9.˘4˙9.˚4˛9.˜4˝9.˞4˟9.ˠ4ˡ9.ˢ4ˣ9.ˤ4˥9.˦4˧9.˨4˩9.˪4˫9.ˬ4˭9.ˮ4˯9.˰4˱9.˲4˳9.˴4˵9.˶4˷9.˸4˹9.˺4˻9.˼4˽9.˾4˿9.̀4́9.̂4̃9.̄4̅9.̆4̇9.̈4̉9.̊4̋9.̌4̍9.̎4̏9.̐4̑9.̒4̓9.̔4̕9.̖4̗9.̘4̙9.̚4̛9.̜4̝9.̞4̟9.̠4̡9.̢4̣9.̤4̥9.̦4̧9.̨4̩9.̪4̫9.̬4̭9.̮4̯9.̰4̱9.̲4̳9.̴4̵9.̶4̷9.̸4̹9.̺4̻9.̼4̽9.̾4̿9.̀4́9.͂4̓9.̈́4ͅ9.͆4͇9.͈4͉9.͊4͋9.͌4͍9.͎4͏9.͐4͑9.͒4͓9.͔4͕9.͖4͗9.͘4͙9.͚4͛9.͜4͝9.͞4͟9.͠4͡9.͢4ͣ9.ͤ4ͥ9.ͦ4ͧ9.ͨ4ͩ9.ͪ4ͫ9.ͬ4ͭ9.ͮ4ͯ9.Ͱ4ͱ9.Ͳ4ͳ9.ʹ4͵9.Ͷ4ͷ9.49.ͺ4ͻ9.ͼ4ͽ9.;4Ϳ9.49.49.΄4΅9.Ά4·9.Έ4Ή9.Ί49.Ό49.Ύ4Ώ9.ΐ4Α9.Β4Γ9.Δ4Ε9.Ζ4Η9.Θ4Ι9.Κ4Λ9.Μ4Ν9.Ξ4Ο9.Π4Ρ9.4Σ9.Τ4Υ9.Φ4Χ9.Ψ4Ω9.Ϊ4Ϋ9.ά4έ9.ή4ί9.ΰ4α9.β4γ9.δ4ε9.ζ4η9.θ4ι9.κ4λ9.μ4ν9.ξ4ο9.π4ρ9.ς4σ9.τ4υ9.φ4χ9.ψ4ω9.ϊ4ϋ9.ό4ύ9.ώ4Ϗ9.ϐ4ϑ9.ϒ4ϓ9.ϔ4ϕ9.ϖ4ϗ9.Ϙ4ϙ9.Ϛ4ϛ9.Ϝ4ϝ9.Ϟ4ϟ9.Ϡ4ϡ9.Ϣ4ϣ9.Ϥ4ϥ9.Ϧ4ϧ9.Ϩ4ϩ9.Ϫ4ϫ9.Ϭ4ϭ9.Ϯ4ϯ9.ϰ4ϱ9.ϲ4ϳ9.ϴ4ϵ9.϶4Ϸ9.ϸ4Ϲ9.Ϻ4ϻ9.ϼ4Ͻ9.Ͼ4Ͽ9.Ѐ4Ё9.Ђ4Ѓ9.Є4Ѕ9.І4Ї9.Ј4Љ9.Њ4Ћ9.Ќ4Ѝ9.Ў4Џ9.А4Б9.В4Г9.Д4Е9.Ж4З9.И4Й9.К4Л9.М4Н9.О4П9.Р4С9.Т4У9.Ф4Х9.Ц4Ч9.Ш4Щ9.Ъ4Ы9.Ь4Э9.Ю4Я9.а4б9.в4г9.д4е9.ж4з9.и4й9.к4л9.м4н9.о4п9.р4с9.т4у9.ф4х9.ц4ч9.ш4щ9.ъ4ы9.ь4э9Mwюy`],Jc=[()=>q,`target`,()=>Ad,`size`,()=>q,`usage`,`bufferData`,()=>q,()=>jd,`srcData`,()=>q,()=>q,()=>Md,()=>Nd,()=>q,`srcOffset`,()=>J,`length`,()=>q,()=>Gu,`dstByteOffset`,()=>jd,`bufferSubData`,()=>q,()=>Gu,()=>Md,()=>Nd,()=>J,()=>q,()=>Y,`level`,()=>q,`internalformat`,()=>K,`width`,()=>K,`height`,()=>Y,`border`,()=>K,`imageSize`,()=>Gu,`offset`,`compressedTexImage2D`,()=>q,()=>Y,()=>q,()=>K,()=>K,()=>Y,()=>Md,()=>Nd,()=>J,`srcLengthOverride`,()=>q,()=>Y,()=>Y,`xoffset`,()=>Y,`yoffset`,()=>K,()=>K,()=>q,`format`,()=>K,()=>Gu,`compressedTexSubImage2D`,()=>q,()=>Y,()=>Y,()=>Y,()=>K,()=>K,()=>q,()=>Md,()=>Nd,()=>J,()=>Y,`x`,()=>Y,`y`,()=>K,()=>K,()=>q,()=>q,`type`,()=>Md,()=>Nd,`dstData`,`readPixels`,()=>Y,()=>Y,()=>K,()=>K,()=>q,()=>q,()=>Gu,()=>Y,()=>Y,()=>K,()=>K,()=>q,()=>q,()=>Md,()=>Nd,`dstOffset`,()=>q,()=>Y,()=>Y,()=>K,()=>K,()=>Y,()=>q,()=>q,()=>Md,()=>Nd,`pixels`,`texImage2D`,()=>q,()=>Y,()=>Y,()=>q,()=>q,()=>Pd,`source`,()=>q,()=>Y,()=>Y,()=>K,()=>K,()=>Y,()=>q,()=>q,()=>Gu,`pboOffset`,()=>q,()=>Y,()=>Y,()=>K,()=>K,()=>Y,()=>q,()=>q,()=>Pd,()=>q,()=>Y,()=>Y,()=>K,()=>K,()=>Y,()=>q,()=>q,()=>Md,()=>Nd,()=>q,()=>Y,()=>Y,()=>Y,()=>K,()=>K,()=>q,()=>q,()=>Md,()=>Nd,`texSubImage2D`,()=>q,()=>Y,()=>Y,()=>Y,()=>q,()=>q,()=>Pd,()=>q,()=>Y,()=>Y,()=>Y,()=>K,()=>K,()=>q,()=>q,()=>Gu,()=>q,()=>Y,()=>Y,()=>Y,()=>K,()=>K,()=>q,()=>q,()=>Pd,()=>q,()=>Y,()=>Y,()=>Y,()=>K,()=>K,()=>q,()=>q,()=>Md,()=>Nd,()=>X,`location`,()=>kd,`data`,()=>J,`srcLength`,`uniform1fv`,()=>X,()=>Fd,()=>J,`uniform1iv`,()=>X,()=>kd,()=>J,`uniform2fv`,()=>X,()=>Fd,()=>J,`uniform2iv`,()=>X,()=>kd,()=>J,`uniform3fv`,()=>X,()=>Fd,()=>J,`uniform3iv`,()=>X,()=>kd,()=>J,`uniform4fv`,()=>X,()=>Fd,()=>J,`uniform4iv`,()=>X,()=>Wu,`transpose`,()=>kd,()=>J,`uniformMatrix2fv`,()=>X,()=>Wu,()=>kd,()=>J,`uniformMatrix3fv`,()=>X,()=>Wu,()=>kd,()=>J,`uniformMatrix4fv`,`WebGL2RenderingContextOverloads`,`PPn!2"n#2$n%2&$1'Pn(2"Pn),J2*n+2&$1'Pn,2"n.o-"2*n/2&'20n1228$1'Pn32"n425n62*$17Pn82"n925n;o:"2*'20n<228$17Pn=2"n>2?n@2AnB2CnD2EnF2GnH2InJ2K$1LPnM2"nN2?nO2AnP2CnQ2EnR2GnToS"2*'208nU2V8$1LPnW2"nX2?nY2Zn[2\\n]2Cn^2En_2\`na2Inb2K$1cPnd2"ne2?nf2Zng2\\nh2Cni2Enj2\`nlok"2*'208nm2V8$1cPnn2onp2qnr2Cns2Ent2\`nu2vPnxow",J2y$1zPn{2on|2qn}2Cn~2En2\`n2vn2K$1zPn2on2qn2Cn
2En2\`n2vno"2y'2$1zPn2"n2?n2An2Cn2En2Gn2\`n2vPno",J2$1Pn2"n2?n2An2\`n2vn2$1Pn2"n2?n\xA02An¡2Cn¢2En£2Gn¤2\`n¥2vn¦2§$1Pn¨2"n©2?nª2An«2Cn¬2En2Gn®2\`n¯2vn°2$1Pn±2"n²2?n³2An´2Cnµ2En¶2Gn·2\`n¸2vnºo¹"2*'20$1Pn»2"n¼2?n½2Zn¾2\\n¿2CnÀ2EnÁ2\`nÂ2vPnÄoÃ",J2$1ÅPnÆ2"nÇ2?nÈ2ZnÉ2\\nÊ2\`nË2vnÌ2$1ÅPnÍ2"nÎ2?nÏ2ZnÐ2\\nÑ2CnÒ2EnÓ2\`nÔ2vnÕ2§$1ÅPnÖ2"n×2?nØ2ZnÙ2\\nÚ2CnÛ2EnÜ2\`nÝ2vnÞ2$1ÅPnß2"nà2?ná2Znâ2\\nã2Cnä2Enå2\`næ2vnèoç"2*'20$1ÅPPné,J2ênë2ì'208ní2î8$1ïPPnð,J2ênñ2ì'208nò2î8$1óPPnô,J2ênõ2ì'208nö2î8$1÷PPnø,J2ênù2ì'208nú2î8$1ûPPnü,J2êný2ì'208nþ2î8$1ÿPPnĀ,J2ênā2ì'208nĂ2î8$1ăPPnĄ,J2êną2ì'208nĆ2î8$1ćPPnĈ,J2ênĉ2ì'208nĊ2î8$1ċPPnČ,J2ênč2Ďnď2ì'208nĐ2î8$1đPPnĒ,J2ênē2ĎnĔ2ì'208nĕ2î8$1ĖPPnė,J2ênĘ2Ďnę2ì'208nĚ2î8$1ěMwĜy`],Yc=[()=>rc,()=>mc,`canvas`,()=>Wd,`configuration`,`configure`,()=>Wd,`getConfiguration`,()=>Gd,`getCurrentTexture`,`unconfigure`,`GPUCanvasContext`,`PPn!n"J4#9Pn$2%$1&PPn',J1(Pn)1*P$1+Mw,y`],Xc=[`size`,`type`,`arrayBuffer`,`bytes`,`start`,`end`,`contentType`,0,`slice`,()=>Kd,`stream`,`text`,`Blob`,"P'4!9&4\"9P_`1#PW`1$P'2%8'2&8&2'8n(1)PWo*\"1+P&`1,Mw-y"],U=[`bubbles`,`cancelBubble`,`cancelable`,`composed`,()=>H,`currentTarget`,`defaultPrevented`,`eventPhase`,`isTrusted`,`returnValue`,()=>H,`srcElement`,()=>H,`target`,()=>qd,`timeStamp`,`type`,()=>H,`composedPath`,`initEvent`,`preventDefault`,`stopImmediatePropagation`,`stopPropagation`,0,`NONE`,1,`CAPTURING_PHASE`,2,`AT_TARGET`,3,`BUBBLING_PHASE`,`Event`,`P)4!9)4")4#9)4$9Pn%,J4&9)4'9'4(9)4)9)4*Pn+,J4,9Pn-,J4.9n/409&419Pn2F13P&21)2!8)2#8$14P$15P$16P$17.8499.:4;9.<4=9.>4?9Mw@y`],Zc=[`quality`,`type`,`ImageEncodeOptions`,`P'4!8&4"8Mw#y`],Qc=[()=>Ec,()=>Dc,()=>Oc,()=>kc,()=>Ac,()=>jc,()=>Mc,()=>Nc,()=>Pc,()=>Fc,()=>Lc,()=>Rc,()=>zc,()=>Bc,()=>Vc,()=>mc,`canvas`,`OffscreenCanvasRenderingContext2D`,`Pn!n"n#n$n%n&n'n(n)n*n+n,n-n.n/n0419Mw2y`],$c=[`2d`,`bitmaprenderer`,`webgl`,`webgl2`,`webgpu`,`OffscreenRenderingContextId`,`P.!.".#.$.%Jw&y`],el=[()=>Qc,()=>cc,()=>uc,()=>dc,()=>Yc,`OffscreenRenderingContext`,`Pn!n"n#n$n%Jw&y`],tl=[()=>U,`contextlost`,()=>U,`contextrestored`,`OffscreenCanvasEventMap`,`Pn!4"n#4$Mw%y`],nl=[()=>U,`fullscreenchange`,()=>U,`fullscreenerror`,`ElementEventMap`,`Pn!4"n#4$Mw%y`],rl=[()=>Il,`abort`,()=>Ll,`animationcancel`,()=>Ll,`animationend`,()=>Ll,`animationiteration`,()=>Ll,`animationstart`,()=>Rl,`auxclick`,()=>zl,`beforeinput`,()=>U,`beforematch`,()=>Bl,`beforetoggle`,()=>Vl,`blur`,()=>U,`cancel`,()=>U,`canplay`,()=>U,`canplaythrough`,()=>U,`change`,()=>Rl,`click`,()=>U,`close`,()=>U,`command`,()=>Jd,`compositionend`,()=>Jd,`compositionstart`,()=>Jd,`compositionupdate`,()=>U,`contextlost`,()=>Rl,`contextmenu`,()=>U,`contextrestored`,()=>Hl,`copy`,()=>U,`cuechange`,()=>Hl,`cut`,()=>Ul,`dblclick`,()=>Wl,`drag`,()=>Wl,`dragend`,()=>Wl,`dragenter`,()=>Wl,`dragleave`,()=>Wl,`dragover`,()=>Wl,`dragstart`,()=>Wl,`drop`,()=>U,`durationchange`,()=>U,`emptied`,()=>U,`ended`,()=>Yd,`error`,()=>Vl,`focus`,()=>Vl,`focusin`,()=>Vl,`focusout`,()=>Kl,`formdata`,()=>Rl,`gotpointercapture`,()=>zl,`input`,()=>U,`invalid`,()=>ql,`keydown`,()=>ql,`keypress`,()=>ql,`keyup`,()=>U,`load`,()=>U,`loadeddata`,()=>U,`loadedmetadata`,()=>U,`loadstart`,()=>Rl,`lostpointercapture`,()=>Ul,`mousedown`,()=>Ul,`mouseenter`,()=>Ul,`mouseleave`,()=>Ul,`mousemove`,()=>Ul,`mouseout`,()=>Ul,`mouseover`,()=>Ul,`mouseup`,()=>Hl,`paste`,()=>U,`pause`,()=>U,`play`,()=>U,`playing`,()=>Rl,`pointercancel`,()=>Rl,`pointerdown`,()=>Rl,`pointerenter`,()=>Rl,`pointerleave`,()=>Rl,`pointermove`,()=>Rl,`pointerout`,()=>Rl,`pointerover`,()=>U,`pointerrawupdate`,()=>Rl,`pointerup`,()=>Jl,`progress`,()=>U,`ratechange`,()=>U,`reset`,()=>Il,`resize`,()=>U,`scroll`,()=>U,`scrollend`,()=>Yl,`securitypolicyviolation`,()=>U,`seeked`,()=>U,`seeking`,()=>U,`select`,()=>U,`selectionchange`,()=>U,`selectstart`,()=>U,`slotchange`,()=>U,`stalled`,()=>Xl,`submit`,()=>U,`suspend`,()=>U,`timeupdate`,()=>Bl,`toggle`,()=>Zl,`touchcancel`,()=>Zl,`touchend`,()=>Zl,`touchmove`,()=>Zl,`touchstart`,()=>Ql,`transitioncancel`,()=>Ql,`transitionend`,()=>Ql,`transitionrun`,()=>Ql,`transitionstart`,()=>U,`volumechange`,()=>U,`waiting`,()=>U,`webkitanimationend`,()=>U,`webkitanimationiteration`,()=>U,`webkitanimationstart`,()=>U,`webkittransitionend`,()=>$l,`wheel`,`GlobalEventHandlersEventMap`,`Pn!4"n#4$n%4&n'4(n)4*n+4,n-4.n/40n142n344n546n748n94:n;4<n=4>n?4@nA4BnC4DnE4FnG4HnI4JnK4LnM4NnO4PnQ4RnS4TnU4VnW4XnY4Zn[4\\n]4^n_4\`na4bnc4dne4fng4hni4jnk4lnm4nno4pnq4rns4tnu4vnw4xny4zn{4|n}4~n4n4n4n
4n4n4n4n4n4n4n4n4n4n4n4n4n4\xA0n¡4¢n£4¤n¥4¦n§4¨n©4ªn«4¬n4®n¯4°n±4²n³4´nµ4¶n·4¸n¹4ºn»4¼n½4¾n¿4ÀnÁ4ÂnÃ4ÄnÅ4ÆnÇ4ÈnÉ4ÊnË4ÌnÍ4ÎnÏ4ÐnÑ4ÒnÓ4ÔnÕ4Ön×4ØnÙ4ÚnÛ4ÜnÝ4Þnß4àná4ânã4änå4ænç4èné4ênë4ìní4înï4ðnñ4ònó4ôMwõy`],il=[()=>H,`aborted`,0,`this`,()=>U,`ev`,``,`onabort`,`reason`,`throwIfAborted`,`type`,0,()=>Xd,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Xd,()=>B,`removeEventListener`,()=>z,()=>B,`AbortSignal`,`Pn!)4"9PPn#2$n%2&"/',J4("4)9P$1*P"2+Pn,2$n-"f2&"/'2.P)n/J208$11P&2+n22.P)n3J208$11P"2+Pn42$n5"f2&"/'2.P)n6J208$17P&2+n82.P)n9J208$17Mw:y`],al=[()=>U,`evt`,``,`EventListener`,`PPn!2"$v#Mw$y`],ol=[()=>U,`object`,`handleEvent`,`EventListenerObject`,`PPn!2"$1#Mw$y`],W=[()=>H,`baseURI`,()=>Zd,()=>ll,`childNodes`,()=>ll,`firstChild`,`isConnected`,()=>ll,`lastChild`,()=>ll,`nextSibling`,`nodeName`,`nodeType`,`nodeValue`,()=>hl,`ownerDocument`,()=>I,`parentElement`,()=>dl,`parentNode`,()=>ll,`previousSibling`,`textContent`,`node`,`appendChild`,`subtree`,0,`cloneNode`,0,`other`,`compareDocumentPosition`,0,`contains`,()=>Qd,`options`,0,`getRootNode`,`hasChildNodes`,0,`child`,`insertBefore`,`namespace`,`isDefaultNamespace`,0,`otherNode`,`isEqualNode`,0,`isSameNode`,`prefix`,`lookupNamespaceURI`,`lookupPrefix`,`normalize`,`removeChild`,0,`replaceChild`,1,`ELEMENT_NODE`,2,`ATTRIBUTE_NODE`,3,`TEXT_NODE`,4,`CDATA_SECTION_NODE`,5,`ENTITY_REFERENCE_NODE`,6,`ENTITY_NODE`,7,`PROCESSING_INSTRUCTION_NODE`,8,`COMMENT_NODE`,9,`DOCUMENT_NODE`,10,`DOCUMENT_TYPE_NODE`,11,`DOCUMENT_FRAGMENT_NODE`,12,`NOTATION_NODE`,1,`DOCUMENT_POSITION_DISCONNECTED`,2,`DOCUMENT_POSITION_PRECEDING`,4,`DOCUMENT_POSITION_FOLLOWING`,8,`DOCUMENT_POSITION_CONTAINS`,16,`DOCUMENT_POSITION_CONTAINED_BY`,32,`DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC`,`Node`,`Pn!&4"9n$o#"4%9Pn&,J4'9)4(9Pn),J4*9Pn+,J4,9&4-9'4.9P&,J4/Pn0,J419Pn2,J439Pn4,J459Pn6,J479P&,J48P"29"1:P)2;8n<1=Pn>2?'1@PPnA,J2?)1BPnC2D8nE1FP)1GP"29PnH,J2I"1JPP&,J2K)1LPPnM,J2N)1OPPnP,J2N)1QPP&,J2RP&,J1SPP&,J2KP&,J1TP$1UP"2I"1VPnW29"2I"1X.Y4Z9.[4\\9.]4^9._4\`9.a4b9.c4d9.e4f9.g4h9.i4j9.k4l9.m4n9.o4p9.q4r9.s4t9.u4v9.w4x9.y4z9.{4|9Mw}y`],sl=[()=>V,`ariaActiveDescendantElement`,`ariaAtomic`,`ariaAutoComplete`,`ariaBrailleLabel`,`ariaBrailleRoleDescription`,`ariaBusy`,`ariaChecked`,`ariaColCount`,`ariaColIndex`,`ariaColIndexText`,`ariaColSpan`,()=>$d,()=>V,`ariaControlsElements`,`ariaCurrent`,()=>$d,()=>V,`ariaDescribedByElements`,`ariaDescription`,()=>$d,()=>V,`ariaDetailsElements`,`ariaDisabled`,()=>$d,()=>V,`ariaErrorMessageElements`,`ariaExpanded`,()=>$d,()=>V,`ariaFlowToElements`,`ariaHasPopup`,`ariaHidden`,`ariaInvalid`,`ariaKeyShortcuts`,`ariaLabel`,()=>$d,()=>V,`ariaLabelledByElements`,`ariaLevel`,`ariaLive`,`ariaModal`,`ariaMultiLine`,`ariaMultiSelectable`,`ariaOrientation`,()=>$d,()=>V,`ariaOwnsElements`,`ariaPlaceholder`,`ariaPosInSet`,`ariaPressed`,`ariaReadOnly`,`ariaRelevant`,`ariaRequired`,`ariaRoleDescription`,`ariaRowCount`,`ariaRowIndex`,`ariaRowIndexText`,`ariaRowSpan`,`ariaSelected`,`ariaSetSize`,`ariaSort`,`ariaValueMax`,`ariaValueMin`,`ariaValueNow`,`ariaValueText`,`role`,`ARIAMixin`,`PPn!,J4"P&,J4#P&,J4$P&,J4%P&,J4&P&,J4'P&,J4(P&,J4)P&,J4*P&,J4+P&,J4,Pn.o-",J4/P&,J40Pn2o1",J43P&,J44Pn6o5",J47P&,J48Pn:o9",J4;P&,J4<Pn>o=",J4?P&,J4@P&,J4AP&,J4BP&,J4CP&,J4DPnFoE",J4GP&,J4HP&,J4IP&,J4JP&,J4KP&,J4LP&,J4MPnOoN",J4PP&,J4QP&,J4RP&,J4SP&,J4TP&,J4UP&,J4VP&,J4WP&,J4XP&,J4YP&,J4ZP&,J4[P&,J4\\P&,J4]P&,J4^P&,J4_P&,J4\`P&,J4aP&,J4bP&,J4cMwdy`],cl=[()=>ef,()=>tf,`keyframes`,()=>nf,`options`,()=>rf,`animate`,()=>af,()=>rf,`getAnimations`,`Animatable`,`PPPn!Fn",J2#P'n$J2%8n&1'Pn(2%8n)F1*Mw+y`],ll=[()=>W,()=>W,`nodes`,`after`,()=>W,`before`,`remove`,()=>W,`replaceWith`,`ChildNode`,`Pn!PPn"&J@2#$1$PPn%&J@2#$1&P$1'PPn(&J@2#$1)Mw*y`],ul=[()=>V,`nextElementSibling`,()=>V,`previousElementSibling`,`NonDocumentTypeChildNode`,`PPn!,J4"9Pn#,J4$9Mw%y`],dl=[()=>W,`childElementCount`,()=>of,`children`,()=>V,`firstElementChild`,()=>V,`lastElementChild`,()=>W,`nodes`,`append`,()=>W,`node`,()=>W,`child`,`moveBefore`,()=>W,`prepend`,`selectors`,()=>yl,`querySelector`,()=>bl,()=>xl,()=>Dl,()=>Zd,()=>yl,`querySelectorAll`,()=>Zd,()=>bl,()=>Zd,()=>xl,()=>Zd,()=>Dl,()=>Zd,()=>W,`replaceChildren`,`ParentNode`,`Pn!'4"9n#4$9Pn%,J4&9Pn',J4(9PPn)&J@2*$1+Pn,2-Pn.,J2/$10PPn1&J@2*$12P"23Pn4"f,J15P"23Pn6"f,J15P"23Pn7"f,J15P"23Pn8"f,J15P&23P",J15P"23n:"fo9"1;P"23n="fo<"1;P"23n?"fo>"1;P"23nA"fo@"1;P&23"oB"1;PPnC&J@2*$1DMwEy`],fl=[()=>sf,`assignedSlot`,`Slottable`,`PPn!,J4"9Mw#y`],pl=[`length`,`qualifiedName`,()=>Cl,`getNamedItem`,`namespace`,`localName`,()=>Cl,`getNamedItemNS`,`index`,()=>Cl,`item`,()=>Cl,`removeNamedItem`,()=>Cl,`removeNamedItemNS`,()=>Cl,`attr`,()=>Cl,`setNamedItem`,()=>Cl,()=>Cl,`setNamedItemNS`,()=>Cl,`NamedNodeMap`,`P'4!9P&2"Pn#,J1$PP&,J2%&2&Pn',J1(P'2)Pn*,J1+P&2"n,1-PP&,J2%&2&n.1/Pn021Pn2,J13Pn421Pn5,J16'n7LMw8y`],ml=[`name`,()=>cf,`constructor`,()=>lf,`options`,`define`,()=>cf,`get`,()=>cf,`getName`,()=>W,`root`,`initialize`,()=>W,`upgrade`,()=>cf,`whenDefined`,`CustomElementRegistry`,`PP&2!n"2#n$2%8$1&P&2!Pn'-J1(Pn)2#P&,J1*Pn+2,$1-Pn.2,$1/P&2!n0\`11Mw2y`],hl=[()=>W,()=>uf,()=>df,()=>_c,()=>ff,()=>dl,()=>pf,`URL`,()=>mf,`activeViewTransition`,`alinkColor`,()=>hf,`all`,()=>El,()=>gf,`anchors`,()=>of,`applets`,`bgColor`,()=>I,`body`,`characterSet`,`charset`,`compatMode`,`contentType`,`cookie`,()=>_f,`currentScript`,()=>vf,()=>globalThis,`defaultView`,`designMode`,`dir`,()=>yf,`doctype`,()=>I,`documentElement`,`documentURI`,`domain`,()=>El,()=>bf,`embeds`,`fgColor`,()=>El,()=>nu,`forms`,()=>xf,`fragmentDirective`,`fullscreen`,`fullscreenEnabled`,()=>Sf,`head`,`hidden`,()=>El,()=>Cf,`images`,()=>wf,`implementation`,`inputEncoding`,`lastModified`,`linkColor`,()=>El,()=>gf,()=>Tf,`links`,0,`this`,()=>U,`ev`,``,`onfullscreenchange`,0,()=>U,`onfullscreenerror`,0,()=>U,`onpointerlockchange`,0,()=>U,`onpointerlockerror`,0,()=>U,`onreadystatechange`,0,()=>U,`onvisibilitychange`,`ownerDocument`,`pictureInPictureEnabled`,()=>El,()=>bf,`plugins`,()=>Ef,`readyState`,`referrer`,()=>Df,`rootElement`,()=>El,()=>Of,`scripts`,()=>V,`scrollingElement`,()=>kf,`timeline`,`title`,()=>Af,`visibilityState`,`vlinkColor`,`node`,`adoptNode`,`captureEvents`,`x`,`y`,()=>jf,`options`,()=>Mf,`caretPositionFromPoint`,()=>Nf,`caretRangeFromPoint`,`clear`,`close`,`localName`,()=>Cl,`createAttribute`,`namespace`,`qualifiedName`,()=>Cl,`createAttributeNS`,`data`,()=>Pf,`createCDATASection`,()=>Ff,`createComment`,()=>If,`createDocumentFragment`,`tagName`,()=>Lf,()=>yl,`createElement`,()=>Lf,()=>Dl,()=>Lf,()=>I,`http://www.w3.org/1999/xhtml`,`namespaceURI`,()=>I,`createElementNS`,`http://www.w3.org/2000/svg`,()=>bl,`http://www.w3.org/2000/svg`,()=>G,`http://www.w3.org/1998/Math/MathML`,()=>xl,`http://www.w3.org/1998/Math/MathML`,()=>Ol,()=>Lf,()=>V,()=>Lf,()=>V,`AnimationEvent`,`eventInterface`,()=>Ll,`createEvent`,`AnimationPlaybackEvent`,()=>Rf,`AudioProcessingEvent`,()=>zf,`BeforeUnloadEvent`,()=>Bf,`BlobEvent`,()=>Vf,`ClipboardEvent`,()=>Hl,`CloseEvent`,()=>Hf,`CommandEvent`,()=>Uf,`CompositionEvent`,()=>Jd,`ContentVisibilityAutoStateChangeEvent`,()=>Wf,`CookieChangeEvent`,()=>Gf,`CustomEvent`,()=>Kf,`DeviceMotionEvent`,()=>qf,`DeviceOrientationEvent`,()=>Jf,`DragEvent`,()=>Wl,`ErrorEvent`,()=>Yd,`Event`,()=>U,`Events`,()=>U,`FocusEvent`,()=>Vl,`FontFaceSetLoadEvent`,()=>Yf,`FormDataEvent`,()=>Kl,`GPUUncapturedErrorEvent`,()=>Xf,`GamepadEvent`,()=>Zf,`HashChangeEvent`,()=>Qf,`IDBVersionChangeEvent`,()=>$f,`InputEvent`,()=>zl,`KeyboardEvent`,()=>ql,`MIDIConnectionEvent`,()=>ep,`MIDIMessageEvent`,()=>tp,`MediaEncryptedEvent`,()=>np,`MediaKeyMessageEvent`,()=>rp,`MediaQueryListEvent`,()=>ip,`MediaStreamTrackEvent`,()=>Sc,`MessageEvent`,()=>ap,`MouseEvent`,()=>Ul,`MouseEvents`,()=>Ul,`NavigateEvent`,()=>op,`NavigationCurrentEntryChangeEvent`,()=>sp,`OfflineAudioCompletionEvent`,()=>cp,`PageRevealEvent`,()=>lp,`PageSwapEvent`,()=>up,`PageTransitionEvent`,()=>dp,`PaymentMethodChangeEvent`,()=>fp,`PaymentRequestUpdateEvent`,()=>pp,`PictureInPictureEvent`,()=>mp,`PointerEvent`,()=>Rl,`PopStateEvent`,()=>hp,`ProgressEvent`,()=>Jl,`PromiseRejectionEvent`,()=>gp,`RTCDTMFToneChangeEvent`,()=>_p,`RTCDataChannelEvent`,()=>vp,`RTCErrorEvent`,()=>yp,`RTCPeerConnectionIceErrorEvent`,()=>bp,`RTCPeerConnectionIceEvent`,()=>xp,`RTCTrackEvent`,()=>Sp,`SecurityPolicyViolationEvent`,()=>Yl,`SpeechRecognitionErrorEvent`,()=>Cp,`SpeechRecognitionEvent`,()=>wp,`SpeechSynthesisErrorEvent`,()=>Tp,`SpeechSynthesisEvent`,()=>Ep,`StorageEvent`,()=>Dp,`SubmitEvent`,()=>Xl,`TaskPriorityChangeEvent`,()=>Op,`TextEvent`,()=>kp,`ToggleEvent`,()=>Bl,`TouchEvent`,()=>Zl,`TrackEvent`,()=>Ap,`TransitionEvent`,()=>Ql,`UIEvent`,()=>Il,`UIEvents`,()=>Il,`WebGLContextEvent`,()=>jp,`WheelEvent`,()=>$l,()=>U,()=>W,`root`,`whatToShow`,()=>Mp,`filter`,()=>Np,`createNodeIterator`,`target`,()=>Pp,`createProcessingInstruction`,()=>Nf,`createRange`,()=>Fp,`createTextNode`,()=>W,()=>Mp,()=>Ip,`createTreeWalker`,`commandId`,`showUI`,`value`,`execCommand`,`exitFullscreen`,`exitPictureInPicture`,`exitPointerLock`,`elementId`,()=>I,`getElementById`,`classNames`,()=>El,()=>V,`getElementsByClassName`,`elementName`,()=>Zd,()=>I,`getElementsByName`,()=>El,()=>yl,`getElementsByTagName`,()=>El,()=>bl,()=>El,()=>xl,()=>El,()=>Dl,()=>El,()=>V,`http://www.w3.org/1999/xhtml`,()=>El,()=>I,`getElementsByTagNameNS`,`http://www.w3.org/2000/svg`,()=>El,()=>G,`http://www.w3.org/1998/Math/MathML`,()=>El,()=>Ol,()=>El,()=>V,()=>Lp,`getSelection`,`hasFocus`,`hasStorageAccess`,()=>Rp,`importNode`,`unused1`,`unused2`,0,`open`,()=>zp,`url`,`name`,`features`,()=>vf,`queryCommandEnabled`,`queryCommandIndeterm`,`queryCommandState`,`queryCommandSupported`,`queryCommandValue`,`releaseEvents`,`requestStorageAccess`,()=>Bp,()=>Vp,`callbackOptions`,()=>mf,`startViewTransition`,`text`,`write`,`writeln`,`type`,0,()=>Hp,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>Hp,()=>B,`removeEventListener`,()=>z,()=>B,`Document`,`Pn!n"n#n$n%n&n'&4(9Pn),J4*9&4+n,4-9n/o."409n1429&43n445&469&479&489&499&4:Pn;,J4<9PPn=i>K,J4?9&4@&4APnB,J4C9nD4E9&4F9&4GnIoH"4J9&4KnMoL"4N9nO4P9)4Q9)4R9nS4T9)4U9nWoV"4X9nY4Z9&4[9&4\\9&4]Pn_n\`Jo^"4a9!!PPnb2cnd2e"/f,J4gPPnh2cni2e"/f,J4jPPnk2cnl2e"/f,J4mPPnn2cno2e"/f,J4pPPnq2cnr2e"/f,J4sPPnt2cnu2e"/f,J4v,4w9)4x9nzoy"4{9n|4}9&4~9Pn,J49no"49Pn,J4
9n49&4n49&4P"2"1P$1P'2'2n28Pn,J1P'2'2Pn,J1P$1P$1P&2n1PP&,J2&2n1P&2\xA0n¡1¢P&2\xA0n£1¤Pn¥1¦P"2§n¨28n©"f1ªP"2§n«28n¬"f1ªP&2§n28n®1ªP.¯2°&2n±1²P.³2°"2n´"f1²P.µ2°&2n¶1²P.·2°"2n¸"f1²P.¹2°&2nº1²PP&,J2°&2n»28n¼1²PP&,J2&2P&n½J28n¾1²P.¿2ÀnÁ1ÂP.Ã2ÀnÄ1ÂP.Å2ÀnÆ1ÂP.Ç2ÀnÈ1ÂP.É2ÀnÊ1ÂP.Ë2ÀnÌ1ÂP.Í2ÀnÎ1ÂP.Ï2ÀnÐ1ÂP.Ñ2ÀnÒ1ÂP.Ó2ÀnÔ1ÂP.Õ2ÀnÖ1ÂP.×2ÀnØ1ÂP.Ù2ÀnÚ1ÂP.Û2ÀnÜ1ÂP.Ý2ÀnÞ1ÂP.ß2Ànà1ÂP.á2Ànâ1ÂP.ã2Ànä1ÂP.å2Ànæ1ÂP.ç2Ànè1ÂP.é2Ànê1ÂP.ë2Ànì1ÂP.í2Ànî1ÂP.ï2Ànð1ÂP.ñ2Ànò1ÂP.ó2Ànô1ÂP.õ2Ànö1ÂP.÷2Ànø1ÂP.ù2Ànú1ÂP.û2Ànü1ÂP.ý2Ànþ1ÂP.ÿ2ÀnĀ1ÂP.ā2ÀnĂ1ÂP.ă2ÀnĄ1ÂP.ą2ÀnĆ1ÂP.ć2ÀnĈ1ÂP.ĉ2ÀnĊ1ÂP.ċ2ÀnČ1ÂP.č2ÀnĎ1ÂP.ď2ÀnĐ1ÂP.đ2ÀnĒ1ÂP.ē2ÀnĔ1ÂP.ĕ2ÀnĖ1ÂP.ė2ÀnĘ1ÂP.ę2ÀnĚ1ÂP.ě2ÀnĜ1ÂP.ĝ2ÀnĞ1ÂP.ğ2ÀnĠ1ÂP.ġ2ÀnĢ1ÂP.ģ2ÀnĤ1ÂP.ĥ2ÀnĦ1ÂP.ħ2ÀnĨ1ÂP.ĩ2ÀnĪ1ÂP.ī2ÀnĬ1ÂP.ĭ2ÀnĮ1ÂP.į2Ànİ1ÂP.ı2ÀnIJ1ÂP.ij2ÀnĴ1ÂP.ĵ2ÀnĶ1ÂP.ķ2Ànĸ1ÂP.Ĺ2Ànĺ1ÂP.Ļ2Ànļ1ÂP.Ľ2Ànľ1ÂP.Ŀ2Ànŀ1ÂP.Ł2Ànł1ÂP.Ń2Ànń1ÂP.Ņ2Ànņ1ÂP.Ň2Ànň1ÂP.ʼn2ÀnŊ1ÂP.ŋ2ÀnŌ1ÂP.ō2ÀnŎ1ÂP.ŏ2ÀnŐ1ÂP&2Ànő1ÂPnŒ2œ'2Ŕ8Pnŕ,J2Ŗ8nŗ1ŘP&2ř&2\xA0nŚ1śPnŜ1ŝP&2\xA0nŞ1şPnŠ2œ'2Ŕ8Pnš,J2Ŗ8nŢ1ţP&2Ť)2ť8&2Ŧ8)1ŧP$\`1ŨP$\`1ũP$1ŪP&2ūPnŬ,J1ŭP&2ŮnŰoů"1űP&2ŲnŴoų"1ŵP"2nŷ"foŶ"1ŸP"2nź"foŹ"1ŸP"2nż"foŻ"1ŸP"2nž"foŽ"1ŸP&2nƀoſ"1ŸP.Ɓ2°&2nƃoƂ"1ƄP.ƅ2°&2nƇoƆ"1ƄP.ƈ2°&2nƊoƉ"1ƄPP&,J2&2nƌoƋ"1ƄPPnƍ,J1ƎP)1ƏP)\`1ƐP"2P)nƑJ28"1ƒP&2Ɠ8&2Ɣ8nƕ1ƖPP&nƗJ2Ƙ&2ƙ&2ƚPnƛ,J1ƖP&2Ť)1ƜP&2Ť)1ƝP&2Ť)1ƞP&2Ť)1ƟP&2Ť&1ƠP$1ơP$\`1ƢPPnƣnƤJ2ƥ8nƦ1ƧP&@2ƨ$1ƩP&@2ƨ$1ƪ!P"2ƫPnƬ2cnƭ"f2e"/f2ƮP)nƯJ28$1ưP&2ƫnƱ2ƮP)nƲJ28$1ưP"2ƫPnƳ2cnƴ"f2e"/f2ƮP)nƵJ28$1ƶP&2ƫnƷ2ƮP)nƸJ28$1ƶMwƹy`],gl=[()=>If,()=>uf,`clonable`,`delegatesFocus`,()=>V,`host`,`innerHTML`,()=>Up,`mode`,0,`this`,()=>U,`ev`,``,`onslotchange`,`serializable`,()=>Wp,`slotAssignment`,()=>kl,`options`,`getHTML`,`html`,`setHTMLUnsafe`,`type`,0,()=>Gp,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>Gp,()=>B,`removeEventListener`,()=>z,()=>B,`ShadowRoot`,`Pn!n")4#9)4$9n%4&9&4'n(4)9PPn*2+n,2-"/.,J4/)409n1429Pn3248&15P&26$17P"28Pn92+n:"f2-"/.2;P)n<J248$1=P&28n>2;P)n?J248$1=P"28Pn@2+nA"f2-"/.2;P)nBJ248$1CP&28nD2;P)nEJ248$1CMwFy`],_l=[`clonable`,()=>ml,`customElementRegistry`,`delegatesFocus`,()=>Up,`mode`,`serializable`,()=>Wp,`slotAssignment`,`ShadowRootInit`,`P)4!8Pn",J4#8)4$8n%4&)4'8n(4)8Mw*y`],vl=[`checkOpacity`,`checkVisibilityCSS`,`contentVisibilityAuto`,`opacityProperty`,`visibilityProperty`,`CheckVisibilityOptions`,`P)4!8)4"8)4#8)4$8)4%8Mw&y`],yl=[()=>gf,`a`,()=>I,`abbr`,()=>I,`address`,()=>Tf,`area`,()=>I,`article`,()=>I,`aside`,()=>Kp,`audio`,()=>I,`b`,()=>qp,`base`,()=>I,`bdi`,()=>I,`bdo`,()=>Jp,`blockquote`,()=>Yp,`body`,()=>Xp,`br`,()=>Zp,`button`,()=>rc,`canvas`,()=>Qp,`caption`,()=>I,`cite`,()=>I,`code`,()=>$p,`col`,()=>$p,`colgroup`,()=>em,`data`,()=>tm,`datalist`,()=>I,`dd`,()=>nm,`del`,()=>rm,`details`,()=>I,`dfn`,()=>im,`dialog`,()=>am,`div`,()=>om,`dl`,()=>I,`dt`,()=>I,`em`,()=>bf,`embed`,()=>sm,`fieldset`,()=>I,`figcaption`,()=>I,`figure`,()=>I,`footer`,()=>nu,`form`,()=>cm,`h1`,()=>cm,`h2`,()=>cm,`h3`,()=>cm,`h4`,()=>cm,`h5`,()=>cm,`h6`,()=>Sf,`head`,()=>I,`header`,()=>I,`hgroup`,()=>lm,`hr`,()=>um,`html`,()=>I,`i`,()=>dm,`iframe`,()=>Cf,`img`,()=>fm,`input`,()=>nm,`ins`,()=>I,`kbd`,()=>pm,`label`,()=>mm,`legend`,()=>hm,`li`,()=>gm,`link`,()=>I,`main`,()=>_m,`map`,()=>I,`mark`,()=>vm,`menu`,()=>ym,`meta`,()=>bm,`meter`,()=>I,`nav`,()=>I,`noscript`,()=>xm,`object`,()=>Sm,`ol`,()=>Cm,`optgroup`,()=>wm,`option`,()=>Tm,`output`,()=>Em,`p`,()=>Dm,`picture`,()=>Om,`pre`,()=>km,`progress`,()=>Jp,`q`,()=>I,`rp`,()=>I,`rt`,()=>I,`ruby`,()=>I,`s`,()=>I,`samp`,()=>Of,`script`,()=>I,`search`,()=>I,`section`,()=>Am,`select`,()=>sf,`slot`,()=>I,`small`,()=>jm,`source`,()=>Mm,`span`,()=>I,`strong`,()=>Nm,`style`,()=>I,`sub`,()=>I,`summary`,()=>I,`sup`,()=>Pm,`table`,()=>Fm,`tbody`,()=>Im,`td`,()=>Lm,`template`,()=>Rm,`textarea`,()=>Fm,`tfoot`,()=>Im,`th`,()=>Fm,`thead`,()=>zm,`time`,()=>Bm,`title`,()=>Vm,`tr`,()=>Hm,`track`,()=>I,`u`,()=>Um,`ul`,()=>I,`var`,()=>Wm,`video`,()=>I,`wbr`,`HTMLElementTagNameMap`,`Pn!4"n#4$n%4&n'4(n)4*n+4,n-4.n/40n142n344n546n748n94:n;4<n=4>n?4@nA4BnC4DnE4FnG4HnI4JnK4LnM4NnO4PnQ4RnS4TnU4VnW4XnY4Zn[4\\n]4^n_4\`na4bnc4dne4fng4hni4jnk4lnm4nno4pnq4rns4tnu4vnw4xny4zn{4|n}4~n4n4n4n
4n4n4n4n4n4n4n4n4n4n4n4n4n4\xA0n¡4¢n£4¤n¥4¦n§4¨n©4ªn«4¬n4®n¯4°n±4²n³4´nµ4¶n·4¸n¹4ºn»4¼n½4¾n¿4ÀnÁ4ÂnÃ4ÄnÅ4ÆnÇ4ÈnÉ4ÊnË4ÌnÍ4ÎnÏ4ÐnÑ4ÒnÓ4ÔnÕ4Ön×4ØnÙ4ÚnÛ4ÜnÝ4Þnß4àná4ânã4änå4ænç4èné4ênë4ìní4înï4ðnñ4ònó4ônõ4ön÷4ønù4únû4üný4þnÿ4ĀMwāy`],bl=[()=>Gm,`a`,()=>Km,`animate`,()=>qm,`animateMotion`,()=>Jm,`animateTransform`,()=>Ym,`circle`,()=>Xm,`clipPath`,()=>Zm,`defs`,()=>Qm,`desc`,()=>$m,`ellipse`,()=>eh,`feBlend`,()=>th,`feColorMatrix`,()=>nh,`feComponentTransfer`,()=>rh,`feComposite`,()=>ih,`feConvolveMatrix`,()=>ah,`feDiffuseLighting`,()=>oh,`feDisplacementMap`,()=>sh,`feDistantLight`,()=>ch,`feDropShadow`,()=>lh,`feFlood`,()=>uh,`feFuncA`,()=>dh,`feFuncB`,()=>fh,`feFuncG`,()=>ph,`feFuncR`,()=>mh,`feGaussianBlur`,()=>hh,`feImage`,()=>gh,`feMerge`,()=>_h,`feMergeNode`,()=>vh,`feMorphology`,()=>yh,`feOffset`,()=>bh,`fePointLight`,()=>xh,`feSpecularLighting`,()=>Sh,`feSpotLight`,()=>Ch,`feTile`,()=>wh,`feTurbulence`,()=>Th,`filter`,()=>Eh,`foreignObject`,()=>Dh,`g`,()=>Oh,`image`,()=>kh,`line`,()=>Ah,`linearGradient`,()=>jh,`marker`,()=>Mh,`mask`,()=>Nh,`metadata`,()=>Ph,`mpath`,()=>Fh,`path`,()=>Ih,`pattern`,()=>Lh,`polygon`,()=>Rh,`polyline`,()=>zh,`radialGradient`,()=>Bh,`rect`,()=>Vh,`script`,()=>Hh,`set`,()=>Uh,`stop`,()=>Wh,`style`,()=>Df,`svg`,()=>Gh,`switch`,()=>Kh,`symbol`,()=>qh,`text`,()=>Jh,`textPath`,()=>Yh,`title`,()=>Xh,`tspan`,()=>Zh,`use`,()=>Qh,`view`,`SVGElementTagNameMap`,`Pn!4"n#4$n%4&n'4(n)4*n+4,n-4.n/40n142n344n546n748n94:n;4<n=4>n?4@nA4BnC4DnE4FnG4HnI4JnK4LnM4NnO4PnQ4RnS4TnU4VnW4XnY4Zn[4\\n]4^n_4\`na4bnc4dne4fng4hni4jnk4lnm4nno4pnq4rns4tnu4vnw4xny4zn{4|n}4~n4n4n4n
4n4n4n4n4n4n4n4n4n4n4n4n4Mwy`],xl=[()=>Ol,`a`,()=>Ol,`annotation`,()=>Ol,`annotation-xml`,()=>Ol,`maction`,()=>Ol,`math`,()=>Ol,`merror`,()=>Ol,`mfrac`,()=>Ol,`mi`,()=>Ol,`mmultiscripts`,()=>Ol,`mn`,()=>Ol,`mo`,()=>Ol,`mover`,()=>Ol,`mpadded`,()=>Ol,`mphantom`,()=>Ol,`mprescripts`,()=>Ol,`mroot`,()=>Ol,`mrow`,()=>Ol,`ms`,()=>Ol,`mspace`,()=>Ol,`msqrt`,()=>Ol,`mstyle`,()=>Ol,`msub`,()=>Ol,`msubsup`,()=>Ol,`msup`,()=>Ol,`mtable`,()=>Ol,`mtd`,()=>Ol,`mtext`,()=>Ol,`mtr`,()=>Ol,`munder`,()=>Ol,`munderover`,()=>Ol,`semantics`,`MathMLElementTagNameMap`,`Pn!4"n#4$n%4&n'4(n)4*n+4,n-4.n/40n142n344n546n748n94:n;4<n=4>n?4@nA4BnC4DnE4FnG4HnI4JnK4LnM4NnO4PnQ4RnS4TnU4VnW4XnY4Zn[4\\n]4^Mw_y`],Sl=[`size`,`property`,()=>$h,`get`,()=>$h,`getAll`,`has`,()=>$h,`value`,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,`StylePropertyMapReadOnly`,`P'4!9P&2"P-n#J1$P&2"n%F1&P&2")1'PPn(F2)&2*n+2,$/-2."2/8$10Mw1y`],Cl=[()=>W,`localName`,`name`,`namespaceURI`,()=>hl,`ownerDocument`,()=>V,`ownerElement`,`prefix`,`specified`,`value`,`Attr`,`Pn!&4"9&4#9P&,J4$9n%4&9Pn',J4(9P&,J4)9)4*9&4+!!Mw,y`],wl=[()=>eg,`height`,`width`,`x`,`y`,`DOMRect`,`Pn!'4"'4#'4$'4%Mw&y`],Tl=[`length`,`index`,()=>wl,`item`,()=>wl,`DOMRectList`,`P'4!9P'2"Pn#,J1$'n%LMw&y`],El=[`T`,()=>tg,`index`,`item`,`name`,`namedItem`,`HTMLCollectionOf`,`b!Pn"P'2#Pe$!,J1$P&2%Pe$!,J1&'e"!LMw'y`],Dl=[()=>I,`acronym`,()=>ng,`applet`,()=>I,`basefont`,()=>ng,`bgsound`,()=>I,`big`,()=>ng,`blink`,()=>I,`center`,()=>rg,`dir`,()=>ig,`font`,()=>ag,`frame`,()=>og,`frameset`,()=>ng,`isindex`,()=>ng,`keygen`,()=>Om,`listing`,()=>sg,`marquee`,()=>I,`menuitem`,()=>ng,`multicol`,()=>ng,`nextid`,()=>I,`nobr`,()=>I,`noembed`,()=>I,`noframes`,()=>cg,`param`,()=>I,`plaintext`,()=>I,`rb`,()=>I,`rtc`,()=>ng,`spacer`,()=>I,`strike`,()=>I,`tt`,()=>Om,`xmp`,`HTMLElementDeprecatedTagNameMap`,`Pn!4"n#4$n%4&n'4(n)4*n+4,n-4.n/40n142n344n546n748n94:n;4<n=4>n?4@nA4BnC4DnE4FnG4HnI4JnK4LnM4NnO4PnQ4RnS4TnU4VnW4XnY4ZMw[y`],G=[()=>V,()=>hc,()=>_c,()=>vc,`className`,()=>Df,`ownerSVGElement`,0,`viewportElement`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGElement`,`Pn!n"n#n$"4%9Pn&,J4'9Pn(,J4)9P"2*Pn+2,n-"f2."//20P)n1J228$13P&2*n420P)n5J228$13P"2*Pn62,n7"f2."//20P)n8J228$19P&2*n:20P)n;J228$19Mw<y`],Ol=[()=>V,()=>hc,()=>_c,()=>vc,`type`,0,`this`,()=>lg,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>lg,()=>B,`removeEventListener`,()=>z,()=>B,`MathMLElement`,`Pn!n"n#n$P"2%Pn&2'n("f2)"/*2+P)n,J2-8$1.P&2%n/2+P)n0J2-8$1.P"2%Pn12'n2"f2)"/*2+P)n3J2-8$14P&2%n52+P)n6J2-8$14Mw7y`],kl=[`serializableShadowRoots`,()=>gl,`shadowRoots`,`GetHTMLOptions`,`P)4!8n"F4#8Mw$y`],Al=[`afterbegin`,`afterend`,`beforebegin`,`beforeend`,`InsertPosition`,`P.!.".#.$Jw%y`],jl=[()=>ug,`navigationUI`,`FullscreenOptions`,`Pn!4"8Mw#y`],Ml=[`unadjustedMovement`,`PointerLockOptions`,`P)4!8Mw"y`],Nl=[()=>dg,`left`,`top`,`ScrollToOptions`,`Pn!'4"8'4#8Mw$y`],Pl=[()=>dg,()=>fg,`block`,()=>fg,`inline`,`ScrollIntoViewOptions`,`Pn!n"4#8n$4%8Mw&y`],Fl=[()=>Sl,`property`,()=>$h,`values`,`append`,`clear`,`delete`,()=>$h,`set`,`StylePropertyMap`,`Pn!P&2"Pn#&J@2$$1%P$1&P&2"$1'P&2"Pn(&J@2$$1)Mw*y`],Il=[()=>U,`detail`,()=>pg,`view`,`which`,`typeArg`,`bubblesArg`,`cancelableArg`,()=>pg,`viewArg`,`detailArg`,`initUIEvent`,`UIEvent`,`Pn!'4"9Pn#,J4$9'4%9P&2&)2'8)2(8Pn),J2*8'2+8$1,Mw-y`],Ll=[()=>U,`animationName`,`elapsedTime`,`pseudoElement`,`AnimationEvent`,`Pn!&4"9'4#9&4$9Mw%y`],Rl=[()=>Ul,`altitudeAngle`,`azimuthAngle`,`height`,`isPrimary`,`persistentDeviceId`,`pointerId`,`pointerType`,`pressure`,`tangentialPressure`,`tiltX`,`tiltY`,`twist`,`width`,0,`getCoalescedEvents`,0,`getPredictedEvents`,`PointerEvent`,`Pn!'4"9'4#9'4$9)4%9'4&9'4'9&4(9'4)9'4*9'4+9'4,9'4-9'4.9Pn/F10Pn1F12Mw3y`],zl=[()=>Il,`data`,()=>mg,`dataTransfer`,`inputType`,`isComposing`,()=>hg,`getTargetRanges`,`InputEvent`,`Pn!P&,J4"9Pn#,J4$9&4%9)4&9Pn'F1(Mw)y`],Bl=[()=>U,`newState`,`oldState`,()=>V,`source`,`ToggleEvent`,`Pn!&4"9&4#9Pn$,J4%9Mw&y`],Vl=[()=>Il,()=>H,`relatedTarget`,`FocusEvent`,`Pn!Pn",J4#9Mw$y`],Hl=[()=>U,()=>mg,`clipboardData`,`ClipboardEvent`,`Pn!Pn",J4#9Mw$y`],Ul=[()=>Il,`altKey`,`button`,`buttons`,`clientX`,`clientY`,`ctrlKey`,`layerX`,`layerY`,`metaKey`,`movementX`,`movementY`,`offsetX`,`offsetY`,`pageX`,`pageY`,()=>H,`relatedTarget`,`screenX`,`screenY`,`shiftKey`,`x`,`y`,`keyArg`,`getModifierState`,`typeArg`,`canBubbleArg`,`cancelableArg`,()=>pg,`viewArg`,`detailArg`,`screenXArg`,`screenYArg`,`clientXArg`,`clientYArg`,`ctrlKeyArg`,`altKeyArg`,`shiftKeyArg`,`metaKeyArg`,`buttonArg`,()=>H,`relatedTargetArg`,`initMouseEvent`,`MouseEvent`,`Pn!)4"9'4#9'4$9'4%9'4&9)4'9'4(9'4)9)4*9'4+9'4,9'4-9'4.9'4/9'409Pn1,J429'439'449)459'469'479P&28)19P&2:)2;)2<n=2>'2?'2@'2A'2B'2C)2D)2E)2F)2G'2HPnI,J2J$1KMwLy`],Wl=[()=>Ul,()=>mg,`dataTransfer`,`DragEvent`,`Pn!Pn",J4#9Mw$y`],Gl=[()=>gg,`OnErrorEventHandler`,`Pn!,Jw"y`],Kl=[()=>U,()=>su,`formData`,`FormDataEvent`,`Pn!n"4#9Mw$y`],ql=[()=>Il,`altKey`,`charCode`,`code`,`ctrlKey`,`isComposing`,`key`,`keyCode`,`location`,`metaKey`,`repeat`,`shiftKey`,`keyArg`,`getModifierState`,`typeArg`,`bubblesArg`,`cancelableArg`,()=>pg,`viewArg`,`locationArg`,`initKeyboardEvent`,0,`DOM_KEY_LOCATION_STANDARD`,1,`DOM_KEY_LOCATION_LEFT`,2,`DOM_KEY_LOCATION_RIGHT`,3,`DOM_KEY_LOCATION_NUMPAD`,`KeyboardEvent`,`Pn!)4"9'4#9&4$9)4%9)4&9&4'9'4(9'4)9)4*9)4+9)4,9P&2-)1.P&2/)208)218Pn2,J238&2-8'248)2%8)2"8)2,8)2*8$15.6479.8499.:4;9.<4=9Mw>y`],Jl=[()=>H,`T`,()=>U,`lengthComputable`,`loaded`,`target`,`total`,`ProgressEvent`,`n!c"Pn#)4$9'4%9Pe#!,J4&9'4'9Mw(y`],Yl=[()=>U,`blockedURI`,`columnNumber`,()=>_g,`disposition`,`documentURI`,`effectiveDirective`,`lineNumber`,`originalPolicy`,`referrer`,`sample`,`sourceFile`,`statusCode`,`violatedDirective`,`SecurityPolicyViolationEvent`,`Pn!&4"9'4#9n$4%9&4&9&4'9'4(9&4)9&4*9&4+9&4,9'4-9&4.9Mw/y`],Xl=[()=>U,()=>I,`submitter`,`SubmitEvent`,`Pn!Pn",J4#9Mw$y`],Zl=[()=>Il,`altKey`,()=>vg,`changedTouches`,`ctrlKey`,`metaKey`,`shiftKey`,()=>vg,`targetTouches`,()=>vg,`touches`,`TouchEvent`,`Pn!)4"9n#4$9)4%9)4&9)4'9n(4)9n*4+9Mw,y`],Ql=[()=>U,`elapsedTime`,`propertyName`,`pseudoElement`,`TransitionEvent`,`Pn!'4"9&4#9&4$9Mw%y`],$l=[()=>Ul,`deltaMode`,`deltaX`,`deltaY`,`deltaZ`,0,`DOM_DELTA_PIXEL`,1,`DOM_DELTA_LINE`,2,`DOM_DELTA_PAGE`,`WheelEvent`,`Pn!'4"9'4#9'4$9'4%9.&4'9.(4)9.*4+9Mw,y`],eu=[`DOMStringMap`,`P&P&-JLMw!y`],tu=[`focusVisible`,`preventScroll`,`FocusOptions`,`P)4!8)4"8Mw#y`],nu=[()=>I,`acceptCharset`,`action`,()=>yg,`autocomplete`,()=>bg,`elements`,`encoding`,`enctype`,`length`,`method`,`name`,`noValidate`,`rel`,`target`,`checkValidity`,`reportValidity`,()=>I,`submitter`,`requestSubmit`,`reset`,`submit`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,()=>V,`HTMLFormElement`,`Pn!&4"&4#n$4%n&4'9&4(&4)'4*9&4+&4,)4-&4.!!&4/P)10P)11PPn2,J238$14P$15P$16P"27Pn829n:"f2;"/<2=P)n>J2?8$1@P&27nA2=P)nBJ2?8$1@P"27PnC29nD"f2;"/<2=P)nEJ2?8$1FP&27nG2=P)nHJ2?8$1F'nIL&"LMwJy`],ru=[`length`,`index`,()=>W,`item`,()=>W,`value`,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,()=>W,`NodeList`,`P'4!9P'2"Pn#,J1$PPn%2&'2'n(2)$/*2+"2,8$1-'n.LMw/y`],iu=[`value`,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,`CustomStateSet`,`PPP&2!&2"n#2$$/%2&"2'8$1(Mw)y`],au=[`badInput`,`customError`,`patternMismatch`,`rangeOverflow`,`rangeUnderflow`,`stepMismatch`,`tooLong`,`tooShort`,`typeMismatch`,`valid`,`valueMissing`,`ValidityState`,`P)4!9)4"9)4#9)4$9)4%9)4&9)4'9)4(9)4)9)4*9)4+9Mw,y`],ou=[()=>Xc,`lastModified`,`name`,`webkitRelativePath`,`File`,`Pn!'4"9&4#9&4$9Mw%y`],su=[`name`,()=>Xc,`value`,`append`,()=>Xc,`blobValue`,`filename`,`delete`,()=>xg,`get`,()=>xg,`getAll`,`has`,()=>Xc,`set`,()=>Xc,()=>xg,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,`FormData`,`PP&2!P&n"J2#$1$P&2!&2#$1$P&2!n%2&&2'8$1$P&2!$1(P&2!Pn),J1*P&2!n+F1,P&2!)1-P&2!P&n.J2#$1/P&2!&2#$1/P&2!n02&&2'8$1/PPn12#&22n324$/526"278$18Mw9y`],cu=[`badInput`,`customError`,`patternMismatch`,`rangeOverflow`,`rangeUnderflow`,`stepMismatch`,`tooLong`,`tooShort`,`typeMismatch`,`valueMissing`,`ValidityStateFlags`,`P)4!8)4"8)4#8)4$8)4%8)4&8)4'8)4(8)4)8)4*8Mw+y`],lu=[`ended`,`live`,`MediaStreamTrackState`,`P.!."Jw#y`],uu=[()=>Sg,()=>Sg,`advanced`,`MediaTrackConstraints`,`Pn!n"F4#8Mw$y`],du=[()=>Cg,`aspectRatio`,`autoGainControl`,`backgroundBlur`,()=>wg,`channelCount`,`deviceId`,`displaySurface`,`echoCancellation`,`facingMode`,()=>Cg,`frameRate`,`groupId`,()=>wg,`height`,`noiseSuppression`,()=>wg,`sampleRate`,()=>wg,`sampleSize`,()=>wg,`width`,`MediaTrackCapabilities`,`Pn!4"8)F4#8)F4$8n%4&8&4'8&4(8P)&JF4)8&F4*8n+4,8&4-8n.4/8)F408n1428n3448n5468Mw7y`],fu=[`aspectRatio`,`autoGainControl`,`backgroundBlur`,`channelCount`,`deviceId`,`displaySurface`,`echoCancellation`,`facingMode`,`frameRate`,`groupId`,`height`,`noiseSuppression`,`sampleRate`,`sampleSize`,`torch`,`whiteBalanceMode`,`width`,`zoom`,`MediaTrackSettings`,`P'4!8)4"8)4#8'4$8&4%8&4&8P)&J4'8&4(8'4)8&4*8'4+8)4,8'4-8'4.8)4/8&408'418'428Mw3y`],pu=[()=>U,`ended`,()=>U,`mute`,()=>U,`unmute`,`MediaStreamTrackEventMap`,`Pn!4"n#4$n%4&Mw'y`],mu=`color color-burn color-dodge copy darken destination-atop destination-in destination-out destination-over difference exclusion hard-light hue lighten lighter luminosity multiply overlay saturation screen soft-light source-atop source-in source-out source-over xor GlobalCompositeOperation P.!.".#.$.%.&.'.(.).*.+.,.-.../.0.1.2.3.4.5.6.7.8.9.:Jw;y`.split(` `),hu=[()=>Tg,()=>Wm,()=>rc,()=>Uc,()=>mc,()=>Eg,`CanvasImageSource`,`Pn!n"n#n$n%n&Jw'y`],gu=[`evenodd`,`nonzero`,`CanvasFillRule`,`P.!."Jw#y`],_u=[()=>Nc,0,`path`,()=>Fu,`transform`,`addPath`,`Path2D`,`Pn!Pn"2#n$2%8$1&Mw'y`],vu=[`offset`,`color`,`addColorStop`,`CanvasGradient`,`PP'2!&2"$1#Mw$y`],yu=[()=>Fu,`transform`,`setTransform`,`CanvasPattern`,`PPn!2"8$1#Mw$y`],bu=[()=>Tc,`colorSpace`,()=>Dg,`pixelFormat`,`ImageDataSettings`,`Pn!4"8n#4$8Mw%y`],xu=[()=>Tc,`colorSpace`,()=>Og,`data`,`height`,`width`,`ImageData`,`Pn!4"9n#4$9'4%9'4&9Mw'y`],Su=[`high`,`low`,`medium`,`ImageSmoothingQuality`,`P.!.".#Jw$y`],Cu=[`w`,`x`,`y`,`z`,`DOMPointInit`,`P'4!8'4"8'4#8'4$8Mw%y`],wu=[`butt`,`round`,`square`,`CanvasLineCap`,`P.!.".#Jw$y`],Tu=[`bevel`,`miter`,`round`,`CanvasLineJoin`,`P.!.".#Jw$y`],Eu=[`actualBoundingBoxAscent`,`actualBoundingBoxDescent`,`actualBoundingBoxLeft`,`actualBoundingBoxRight`,`alphabeticBaseline`,`emHeightAscent`,`emHeightDescent`,`fontBoundingBoxAscent`,`fontBoundingBoxDescent`,`hangingBaseline`,`ideographicBaseline`,`width`,`TextMetrics`,`P'4!9'4"9'4#9'4$9'4%9'4&9'4'9'4(9'4)9'4*9'4+9'4,9Mw-y`],Du=[`inherit`,`ltr`,`rtl`,`CanvasDirection`,`P.!.".#Jw$y`],Ou=[`auto`,`none`,`normal`,`CanvasFontKerning`,`P.!.".#Jw$y`],ku=[`condensed`,`expanded`,`extra-condensed`,`extra-expanded`,`normal`,`semi-condensed`,`semi-expanded`,`ultra-condensed`,`ultra-expanded`,`CanvasFontStretch`,`P.!.".#.$.%.&.'.(.)Jw*y`],Au=[`all-petite-caps`,`all-small-caps`,`normal`,`petite-caps`,`small-caps`,`titling-caps`,`unicase`,`CanvasFontVariantCaps`,`P.!.".#.$.%.&.'Jw(y`],ju=[`center`,`end`,`left`,`right`,`start`,`CanvasTextAlign`,`P.!.".#.$.%Jw&y`],Mu=[`alphabetic`,`bottom`,`hanging`,`ideographic`,`middle`,`top`,`CanvasTextBaseline`,`P.!.".#.$.%.&Jw'y`],Nu=[`auto`,`geometricPrecision`,`optimizeLegibility`,`optimizeSpeed`,`CanvasTextRendering`,`P.!.".#.$Jw%y`],Pu=[()=>kg,`a`,`b`,`c`,`d`,`e`,`f`,`m11`,`m12`,`m13`,`m14`,`m21`,`m22`,`m23`,`m24`,`m31`,`m32`,`m33`,`m34`,`m41`,`m42`,`m43`,`m44`,0,`invertSelf`,()=>Ag,`other`,0,`multiplySelf`,()=>Ag,0,`preMultiplySelf`,`x`,`y`,`z`,`angle`,0,`rotateAxisAngleSelf`,0,`rotateFromVectorSelf`,`rotX`,`rotY`,`rotZ`,0,`rotateSelf`,`scale`,`originX`,`originY`,`originZ`,0,`scale3dSelf`,`scaleX`,`scaleY`,`scaleZ`,0,`scaleSelf`,`transformList`,0,`setMatrixValue`,`sx`,0,`skewXSelf`,`sy`,0,`skewYSelf`,`tx`,`ty`,`tz`,0,`translateSelf`,`DOMMatrix`,`Pn!'4"'4#'4$'4%'4&'4''4('4)'4*'4+'4,'4-'4.'4/'40'41'42'43'44'45'46'47Pn819Pn:2;8n<1=Pn>2;8n?1@P'2A8'2B8'2C8'2D8nE1FP'2A8'2B8nG1HP'2I8'2J8'2K8nL1MP'2N8'2O8'2P8'2Q8nR1SP'2T8'2U8'2V8'2O8'2P8'2Q8nW1XP&2YnZ1[P'2\\8n]1^P'2_8n\`1aP'2b8'2c8'2d8ne1fMwgy`],Fu=[`a`,`b`,`c`,`d`,`e`,`f`,`m11`,`m12`,`m21`,`m22`,`m41`,`m42`,`DOMMatrix2DInit`,`P'4!8'4"8'4#8'4$8'4%8'4&8'4'8'4(8'4)8'4*8'4+8'4,8Mw-y`],K=[`GLsizei`,`'w!y`],q=[`GLenum`,`'w!y`],Iu=[`WebGLProgram`,`PMw!y`],Lu=[`WebGLShader`,`PMw!y`],J=[`GLuint`,`'w!y`],Ru=[`WebGLBuffer`,`PMw!y`],zu=[`WebGLFramebuffer`,`PMw!y`],Bu=[`WebGLRenderbuffer`,`PMw!y`],Vu=[`WebGLTexture`,`PMw!y`],Hu=[`GLclampf`,`'w!y`],Uu=[`GLbitfield`,`'w!y`],Y=[`GLint`,`'w!y`],Wu=[`GLboolean`,`)w!y`],Gu=[`GLintptr`,`'w!y`],Ku=[`name`,()=>Y,`size`,()=>q,`type`,`WebGLActiveInfo`,`P&4!9n"4#9n$4%9Mw&y`],qu=[()=>q,`mode`,()=>Y,`first`,()=>K,`count`,()=>K,`primcount`,`drawArraysInstancedANGLE`,()=>q,()=>K,()=>q,`type`,()=>Gu,`offset`,()=>K,`drawElementsInstancedANGLE`,()=>J,`index`,()=>J,`divisor`,`vertexAttribDivisorANGLE`,35070,`VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE`,`ANGLE_instanced_arrays`,`PPn!2"n#2$n%2&n'2($1)Pn*2"n+2&n,2-n.2/n02($11Pn223n425$16.7489Mw9y`],Ju=[32775,`MIN_EXT`,32776,`MAX_EXT`,`EXT_blend_minmax`,`P.!4"9.#4$9Mw%y`],Yu=[`EXT_color_buffer_float`,`PMw!y`],Xu=[34842,`RGBA16F_EXT`,34843,`RGB16F_EXT`,33297,`FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT`,35863,`UNSIGNED_NORMALIZED_EXT`,`EXT_color_buffer_half_float`,`P.!4"9.#4$9.%4&9.'4(9Mw)y`],Zu=[`EXT_float_blend`,`PMw!y`],Qu=[`EXT_frag_depth`,`PMw!y`],$u=[35904,`SRGB_EXT`,35906,`SRGB_ALPHA_EXT`,35907,`SRGB8_ALPHA8_EXT`,33296,`FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT`,`EXT_sRGB`,`P.!4"9.#4$9.%4&9.'4(9Mw)y`],ed=[`EXT_shader_texture_lod`,`PMw!y`],td=[36492,`COMPRESSED_RGBA_BPTC_UNORM_EXT`,36493,`COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT`,36494,`COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT`,36495,`COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT`,`EXT_texture_compression_bptc`,`P.!4"9.#4$9.%4&9.'4(9Mw)y`],nd=[36283,`COMPRESSED_RED_RGTC1_EXT`,36284,`COMPRESSED_SIGNED_RED_RGTC1_EXT`,36285,`COMPRESSED_RED_GREEN_RGTC2_EXT`,36286,`COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT`,`EXT_texture_compression_rgtc`,`P.!4"9.#4$9.%4&9.'4(9Mw)y`],rd=[34046,`TEXTURE_MAX_ANISOTROPY_EXT`,34047,`MAX_TEXTURE_MAX_ANISOTROPY_EXT`,`EXT_texture_filter_anisotropic`,`P.!4"9.#4$9Mw%y`],id=[37297,`COMPLETION_STATUS_KHR`,`KHR_parallel_shader_compile`,`P.!4"9Mw#y`],ad=[`OES_element_index_uint`,`PMw!y`],od=[`OES_fbo_render_mipmap`,`PMw!y`],sd=[35723,`FRAGMENT_SHADER_DERIVATIVE_HINT_OES`,`OES_standard_derivatives`,`P.!4"9Mw#y`],cd=[`OES_texture_float`,`PMw!y`],ld=[`OES_texture_float_linear`,`PMw!y`],ud=[36193,`HALF_FLOAT_OES`,`OES_texture_half_float`,`P.!4"9Mw#y`],dd=[`OES_texture_half_float_linear`,`PMw!y`],fd=[()=>jg,`arrayObject`,`bindVertexArrayOES`,()=>jg,`createVertexArrayOES`,()=>jg,`deleteVertexArrayOES`,()=>jg,()=>Wu,`isVertexArrayOES`,34229,`VERTEX_ARRAY_BINDING_OES`,`OES_vertex_array_object`,`PPPn!,J2"$1#Pn$1%PPn&,J2"$1'PPn(,J2"n)1*.+4,9Mw-y`],pd=[()=>q,`target`,()=>q,`attachment`,()=>Vu,`texture`,()=>Y,`level`,()=>Y,`baseViewIndex`,()=>K,`numViews`,`framebufferTextureMultiviewOVR`,38448,`FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR`,38450,`FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR`,38449,`MAX_VIEWS_OVR`,38451,`FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR`,`OVR_multiview2`,`PPn!2"n#2$Pn%,J2&n'2(n)2*n+2,$1-..4/9.0419.2439.4459Mw6y`],md=[34836,`RGBA32F_EXT`,33297,`FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT`,35863,`UNSIGNED_NORMALIZED_EXT`,`WEBGL_color_buffer_float`,`P.!4"9.#4$9.%4&9Mw'y`],hd=[`getSupportedProfiles`,37808,`COMPRESSED_RGBA_ASTC_4x4_KHR`,37809,`COMPRESSED_RGBA_ASTC_5x4_KHR`,37810,`COMPRESSED_RGBA_ASTC_5x5_KHR`,37811,`COMPRESSED_RGBA_ASTC_6x5_KHR`,37812,`COMPRESSED_RGBA_ASTC_6x6_KHR`,37813,`COMPRESSED_RGBA_ASTC_8x5_KHR`,37814,`COMPRESSED_RGBA_ASTC_8x6_KHR`,37815,`COMPRESSED_RGBA_ASTC_8x8_KHR`,37816,`COMPRESSED_RGBA_ASTC_10x5_KHR`,37817,`COMPRESSED_RGBA_ASTC_10x6_KHR`,37818,`COMPRESSED_RGBA_ASTC_10x8_KHR`,37819,`COMPRESSED_RGBA_ASTC_10x10_KHR`,37820,`COMPRESSED_RGBA_ASTC_12x10_KHR`,37821,`COMPRESSED_RGBA_ASTC_12x12_KHR`,37840,`COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR`,37841,`COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR`,37842,`COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR`,37843,`COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR`,37844,`COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR`,37845,`COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR`,37846,`COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR`,37847,`COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR`,37848,`COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR`,37849,`COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR`,37850,`COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR`,37851,`COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR`,37852,`COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR`,37853,`COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR`,`WEBGL_compressed_texture_astc`,`PP&F1!."4#9.$4%9.&4'9.(4)9.*4+9.,4-9..4/9.0419.2439.4459.6479.8499.:4;9.<4=9.>4?9.@4A9.B4C9.D4E9.F4G9.H4I9.J4K9.L4M9.N4O9.P4Q9.R4S9.T4U9.V4W9.X4Y9MwZy`],gd=[37488,`COMPRESSED_R11_EAC`,37489,`COMPRESSED_SIGNED_R11_EAC`,37490,`COMPRESSED_RG11_EAC`,37491,`COMPRESSED_SIGNED_RG11_EAC`,37492,`COMPRESSED_RGB8_ETC2`,37493,`COMPRESSED_SRGB8_ETC2`,37494,`COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2`,37495,`COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2`,37496,`COMPRESSED_RGBA8_ETC2_EAC`,37497,`COMPRESSED_SRGB8_ALPHA8_ETC2_EAC`,`WEBGL_compressed_texture_etc`,`P.!4"9.#4$9.%4&9.'4(9.)4*9.+4,9.-4.9./409.1429.3449Mw5y`],_d=[36196,`COMPRESSED_RGB_ETC1_WEBGL`,`WEBGL_compressed_texture_etc1`,`P.!4"9Mw#y`],vd=[35840,`COMPRESSED_RGB_PVRTC_4BPPV1_IMG`,35841,`COMPRESSED_RGB_PVRTC_2BPPV1_IMG`,35842,`COMPRESSED_RGBA_PVRTC_4BPPV1_IMG`,35843,`COMPRESSED_RGBA_PVRTC_2BPPV1_IMG`,`WEBGL_compressed_texture_pvrtc`,`P.!4"9.#4$9.%4&9.'4(9Mw)y`],yd=[33776,`COMPRESSED_RGB_S3TC_DXT1_EXT`,33777,`COMPRESSED_RGBA_S3TC_DXT1_EXT`,33778,`COMPRESSED_RGBA_S3TC_DXT3_EXT`,33779,`COMPRESSED_RGBA_S3TC_DXT5_EXT`,`WEBGL_compressed_texture_s3tc`,`P.!4"9.#4$9.%4&9.'4(9Mw)y`],bd=[35916,`COMPRESSED_SRGB_S3TC_DXT1_EXT`,35917,`COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT`,35918,`COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT`,35919,`COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT`,`WEBGL_compressed_texture_s3tc_srgb`,`P.!4"9.#4$9.%4&9.'4(9Mw)y`],xd=[37445,`UNMASKED_VENDOR_WEBGL`,37446,`UNMASKED_RENDERER_WEBGL`,`WEBGL_debug_renderer_info`,`P.!4"9.#4$9Mw%y`],Sd=[()=>Lu,`shader`,`getTranslatedShaderSource`,`WEBGL_debug_shaders`,`PPn!2"&1#Mw$y`],Cd=[34042,`UNSIGNED_INT_24_8_WEBGL`,`WEBGL_depth_texture`,`P.!4"9Mw#y`],wd=[()=>q,`buffers`,`drawBuffersWEBGL`,36064,`COLOR_ATTACHMENT0_WEBGL`,36065,`COLOR_ATTACHMENT1_WEBGL`,36066,`COLOR_ATTACHMENT2_WEBGL`,36067,`COLOR_ATTACHMENT3_WEBGL`,36068,`COLOR_ATTACHMENT4_WEBGL`,36069,`COLOR_ATTACHMENT5_WEBGL`,36070,`COLOR_ATTACHMENT6_WEBGL`,36071,`COLOR_ATTACHMENT7_WEBGL`,36072,`COLOR_ATTACHMENT8_WEBGL`,36073,`COLOR_ATTACHMENT9_WEBGL`,36074,`COLOR_ATTACHMENT10_WEBGL`,36075,`COLOR_ATTACHMENT11_WEBGL`,36076,`COLOR_ATTACHMENT12_WEBGL`,36077,`COLOR_ATTACHMENT13_WEBGL`,36078,`COLOR_ATTACHMENT14_WEBGL`,36079,`COLOR_ATTACHMENT15_WEBGL`,34853,`DRAW_BUFFER0_WEBGL`,34854,`DRAW_BUFFER1_WEBGL`,34855,`DRAW_BUFFER2_WEBGL`,34856,`DRAW_BUFFER3_WEBGL`,34857,`DRAW_BUFFER4_WEBGL`,34858,`DRAW_BUFFER5_WEBGL`,34859,`DRAW_BUFFER6_WEBGL`,34860,`DRAW_BUFFER7_WEBGL`,34861,`DRAW_BUFFER8_WEBGL`,34862,`DRAW_BUFFER9_WEBGL`,34863,`DRAW_BUFFER10_WEBGL`,34864,`DRAW_BUFFER11_WEBGL`,34865,`DRAW_BUFFER12_WEBGL`,34866,`DRAW_BUFFER13_WEBGL`,34867,`DRAW_BUFFER14_WEBGL`,34868,`DRAW_BUFFER15_WEBGL`,36063,`MAX_COLOR_ATTACHMENTS_WEBGL`,34852,`MAX_DRAW_BUFFERS_WEBGL`,`WEBGL_draw_buffers`,`PPn!F2"$1#.$4%9.&4'9.(4)9.*4+9.,4-9..4/9.0419.2439.4459.6479.8499.:4;9.<4=9.>4?9.@4A9.B4C9.D4E9.F4G9.H4I9.J4K9.L4M9.N4O9.P4Q9.R4S9.T4U9.V4W9.X4Y9.Z4[9.\\4]9.^4_9.\`4a9.b4c9.d4e9.f4g9Mwhy`],Td=[`loseContext`,`restoreContext`,`WEBGL_lose_context`,`PP$1!P$1"Mw#y`],Ed=[()=>q,`mode`,()=>Y,`firstsList`,`firstsOffset`,()=>K,`countsList`,`countsOffset`,()=>K,`instanceCountsList`,`instanceCountsOffset`,()=>K,`drawcount`,`multiDrawArraysInstancedWEBGL`,()=>q,()=>Y,()=>K,()=>K,`multiDrawArraysWEBGL`,()=>q,()=>K,()=>q,`type`,()=>K,`offsetsList`,`offsetsOffset`,()=>K,()=>K,`multiDrawElementsInstancedWEBGL`,()=>q,()=>K,()=>q,()=>K,()=>K,`multiDrawElementsWEBGL`,`WEBGL_multi_draw`,`PPn!2"PZn#FJ2$'2%PZn&FJ2''2(PZn)FJ2*'2+n,2-$1.Pn/2"PZn0FJ2$'2%PZn1FJ2''2(n22-$13Pn42"PZn5FJ2''2(n627PZn8FJ29'2:PZn;FJ2*'2+n<2-$1=Pn>2"PZn?FJ2''2(n@27PZnAFJ29'2:nB2-$1CMwDy`],Dd=[()=>Y,`precision`,()=>Y,`rangeMax`,()=>Y,`rangeMin`,`WebGLShaderPrecisionFormat`,`Pn!4"9n#4$9n%4&9Mw'y`],X=[`WebGLUniformLocation`,`PMw!y`],Od=[`GLfloat`,`'w!y`],kd=[()=>Od,`Float32List`,`P\\n!FJw"y`],Ad=[`GLsizeiptr`,`'w!y`],jd=[()=>Nd,()=>Md,()=>Nd,`AllowSharedBufferSource`,`Pn!n#o""Jw$y`],Md=[()=>Nd,`TArrayBuffer`,`buffer`,`byteLength`,`byteOffset`,`ArrayBufferView`,`n!c"Pe"!4#9'4$9'4%9Mw&y`],Nd=[()=>Mg,()=>Mg,`ArrayBufferLike`,`n!n"gfw#y`],Pd=[()=>Uc,()=>xu,()=>Cf,()=>rc,()=>Wm,()=>mc,()=>Eg,`TexImageSource`,`Pn!n"n#n$n%n&n'Jw(y`],Fd=[()=>Y,`Int32List`,`PZn!FJw"y`],Id=[`WebGLQuery`,`PMw!y`],Ld=[`WebGLSampler`,`PMw!y`],Rd=[`WebGLTransformFeedback`,`PMw!y`],zd=[`WebGLVertexArrayObject`,`PMw!y`],Bd=[()=>J,`Uint32List`,`P[n!FJw"y`],Vd=[`WebGLSync`,`PMw!y`],Hd=[`GLuint64`,`'w!y`],Ud=[`GLint64`,`'w!y`],Wd=[()=>Ng,`alphaMode`,()=>Tc,`colorSpace`,()=>Pg,`device`,()=>Fg,`format`,()=>Ig,`toneMapping`,()=>Lg,`usage`,()=>Fg,`viewFormats`,`GPUCanvasConfiguration`,`Pn!4"8n#4$8n%4&n'4(n)4*8n+4,8n-F4.8Mw/y`],Gd=[()=>Rg,()=>zg,`depthOrArrayLayers`,()=>Bg,`dimension`,()=>Fg,`format`,()=>zg,`height`,()=>zg,`mipLevelCount`,()=>Vg,`sampleCount`,()=>Hg,`usage`,()=>zg,`width`,()=>Ug,`descriptor`,()=>Wg,`createView`,`destroy`,`GPUTexture`,`Pn!n"4#9n$4%9n&4'9n(4)9n*4+9n,4-9n.4/9n0419Pn2238n415P$16Mw7y`],Kd=[`R`,`locked`,`reason`,`cancel`,`byob`,`mode`,`options`,()=>Gg,`getReader`,()=>Kg,()=>qg,()=>Jg,()=>Yg,`transform`,()=>Xg,0,`pipeThrough`,()=>Zg,`destination`,()=>Xg,`pipeTo`,0,0,`tee`,`ReadableStream`,`"c!P)4"9P"2#8$\`1$PP.%4&M2'n(1)Pe#!o*"1)Pn+2'8e#!o,"1)P"e#!o-#2.n/2'8"o0"11Pe#!o2"23n42'8$\`15PPe$!o6"e$!o7"G18Mw9y`],qd=[`DOMHighResTimeStamp`,`'w!y`],Jd=[()=>Il,`data`,`typeArg`,`bubblesArg`,`cancelableArg`,()=>vf,`viewArg`,`dataArg`,`initCompositionEvent`,`CompositionEvent`,`Pn!&4"9P&2#)2$8)2%8Pn&,J2'8&2(8$1)Mw*y`],Yd=[()=>U,`colno`,`error`,`filename`,`lineno`,`message`,`ErrorEvent`,`Pn!'4"9"4#9&4$9'4%9&4&9Mw'y`],Xd=[()=>U,`abort`,`AbortSignalEventMap`,`Pn!4"Mw#y`],Zd=[`TNode`,()=>ru,`index`,`item`,`value`,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,`NodeListOf`,`b!Pn"P'2#e#!1$PPe$!2%'2&e$!o'"2($/)2*"2+8$1,'e"!LMw-y`],Qd=[`composed`,`GetRootNodeOptions`,`P)4!8Mw"y`],$d=[`T`,`length`,`toString`,`toLocaleString`,()=>Qg,`items`,`concat`,()=>Qg,`separator`,`join`,`start`,`end`,`slice`,`searchElement`,`fromIndex`,`indexOf`,`lastIndexOf`,`value`,`index`,`array`,``,`predicate`,`thisArg`,`every`,`some`,`callbackfn`,`forEach`,`map`,`filter`,`previousValue`,`currentValue`,`currentIndex`,`reduce`,`initialValue`,`reduceRight`,`ReadonlyArray`,`b!P'4"9P&1#P&1$Pe#!o%"@2&e#!F1'PPe$!e$!o("J@2&e#!F1'P&2)8&1*P'2+8'2,8e#!F1-Pe#!2.'2/8'10Pe#!2.'2/8'11PPe$!22'23e$!F924!/526"278!18PPe$!22'23e$!F924#/526"278)18PPe$!22'23e$!F924#/526"278)19PPe$!22'23e$!F924$/52:"278$1;PPe$!22'23e$!F924"/52:"278"F1<PPe$!22'23e$!F924!/526"278"F1=PPe$!22'23e$!F924#/526"278e#!F1=PPe$!2>e$!2?'2@e$!F924e$!/52:e#!1APPe$!2>e$!2?'2@e$!F924e$!/52:e#!2Be#!1APP"2>e$!2?'2@e$!F924"/52:"2B"1APPe$!2>e$!2?'2@e$!F924e$!/52:e#!1CPPe$!2>e$!2?'2@e$!F924e$!/52:e#!2Be#!1CPP"2>e$!2?'2@e$!F924"/52:"2B"1C'e"!LMwDy`],ef=[()=>$g,`composite`,`easing`,`offset`,`Keyframe`,`Pn!4"8&4#8P',J4$8&P&',-JLMw%y`],tf=[()=>$g,()=>$g,`composite`,`easing`,`offset`,`PropertyIndexedKeyframes`,`PPn!n"FJ4#8P&&FJ4$8P'P',JFJ4%8&P&&F',P',JF-JLMw&y`],nf=[()=>e_,`id`,()=>t_,()=>n_,()=>r_,`rangeEnd`,()=>t_,()=>n_,()=>r_,`rangeStart`,()=>i_,`timeline`,`KeyframeAnimationOptions`,`Pn!&4"8Pn#n$n%&J4&8Pn'n(n)&J4*8Pn+,J4,8Mw-y`],rf=[()=>H,()=>a_,`currentTime`,()=>o_,`effect`,0,`finished`,`id`,0,`this`,()=>Rf,`ev`,``,`oncancel`,0,()=>Rf,`onfinish`,0,()=>Rf,`onremove`,`overallProgress`,`pending`,()=>s_,`playState`,`playbackRate`,0,`ready`,()=>c_,`replaceState`,()=>a_,`startTime`,()=>i_,`timeline`,`cancel`,`commitStyles`,`finish`,`pause`,`persist`,`play`,`reverse`,`updatePlaybackRate`,`type`,0,()=>l_,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>l_,()=>B,`removeEventListener`,()=>z,()=>B,`Animation`,`Pn!Pn",J4#Pn$,J4%n&\`4'9&4(PPn)2*n+2,"/-,J4.PPn/2*n02,"/-,J41PPn22*n32,"/-,J44P',J459)469n7489'49n:\`4;9n<4=9Pn>,J4?Pn@,J4AP$1BP$1CP$1DP$1EP$1FP$1GP$1HP'29$1IP"2JPnK2*nL"f2,"/-2MP)nNJ2O8$1PP&2JnQ2MP)nRJ2O8$1PP"2JPnS2*nT"f2,"/-2MP)nUJ2O8$1VP&2JnW2MP)nXJ2O8$1VMwYy`],af=[`subtree`,`GetAnimationsOptions`,`P)4!8Mw"y`],of=[()=>tg,`name`,()=>V,`namedItem`,`HTMLCollection`,`Pn!P&2"Pn#,J1$Mw%y`],sf=[()=>I,`name`,()=>V,()=>Fp,`nodes`,`assign`,()=>u_,`options`,()=>V,`assignedElements`,()=>u_,()=>W,`assignedNodes`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLSlotElement`,`Pn!&4"PPn#n$J@2%$1&Pn'2(8n)F1*Pn+2(8n,F1-P"2.Pn/20n1"f22"/324P)n5J2(8$16P&2.n724P)n8J2(8$16P"2.Pn920n:"f22"/324P)n;J2(8$1<P&2.n=24P)n>J2(8$1<Mw?y`],cf=[`params`,()=>I,`new`,`CustomElementConstructor`,`PP"@2!n"1#Mw$y`],lf=[`extends`,`ElementDefinitionOptions`,`P&4!8Mw"y`],uf=[()=>V,`activeElement`,()=>d_,`adoptedStyleSheets`,()=>ml,`customElementRegistry`,()=>V,`fullscreenElement`,()=>V,`pictureInPictureElement`,()=>V,`pointerLockElement`,()=>f_,`styleSheets`,`x`,`y`,()=>V,`elementFromPoint`,()=>V,`elementsFromPoint`,()=>rf,`getAnimations`,`DocumentOrShadowRoot`,`PPn!,J4"9n#F4$Pn%,J4&9Pn',J4(9Pn),J4*9Pn+,J4,9n-4.9P'2/'20Pn1,J12P'2/'20n3F14Pn5F16Mw7y`],df=[()=>p_,`fonts`,`FontFaceSource`,`Pn!4"9Mw#y`],ff=[`elementId`,()=>V,`getElementById`,`NonElementParentNode`,`PP&2!Pn",J1#Mw$y`],pf=[`expression`,()=>m_,`resolver`,()=>h_,`createExpression`,()=>W,`nodeResolver`,()=>W,`createNSResolver`,()=>W,`contextNode`,()=>m_,`type`,()=>g_,`result`,()=>g_,`evaluate`,`XPathEvaluatorBase`,`PP&2!Pn",J2#8n$1%Pn&2'n(1)P&2!n*2+Pn,,J2#8'2-8Pn.,J2/8n011Mw2y`],mf=[`finished`,`ready`,()=>__,`types`,`updateCallbackDone`,`skipTransition`,`ViewTransition`,"P$`4!9$`4\"9n#4$9$`4%9P$1&Mw'y"],hf=[`length`,`nameOrIndex`,()=>of,()=>V,`item`,`name`,()=>of,()=>V,`namedItem`,()=>V,`HTMLAllCollection`,`P'4!9P&2"8Pn#n$,J1%P&2&Pn'n(,J1)'n*LMw+y`],gf=[()=>I,()=>v_,`charset`,`coords`,`download`,`hreflang`,`name`,`ping`,`referrerPolicy`,`rel`,`rev`,`shape`,`target`,`text`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLAnchorElement`,`Pn!n"&4#&4$&4%&4&&4'&4(&4)&4*!!&4+&4,&4-&4.&4/P"2/Pn021n2"f23"/425P)n6J278$18P&2/n925P)n:J278$18P"2/Pn;21n<"f23"/425P)n=J278$1>P&2/n?25P)n@J278$1>MwAy`],_f=[()=>Of,()=>Vh,`HTMLOrSVGScriptElement`,`Pn!n"Jw#y`],vf=[()=>pg,`WindowProxy`,`n!w"y`],yf=[()=>W,()=>ll,`name`,()=>hl,`ownerDocument`,`publicId`,`systemId`,`DocumentType`,`Pn!n"&4#9n$4%9&4&9&4'9!Mw(y`],bf=[()=>I,`align`,`height`,`name`,`src`,`type`,`width`,()=>hl,`getSVGDocument`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLEmbedElement`,`Pn!&4"&4#&4$&4%&4&&4'PPn(,J1)P"2&Pn*2+n,"f2-"/.2/P)n0J218$12P&2&n32/P)n4J218$12P"2&Pn52+n6"f2-"/.2/P)n7J218$18P&2&n92/P)n:J218$18Mw;y`],xf=[`FragmentDirective`,`PMw!y`],Sf=[()=>I,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLHeadElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],Cf=[()=>I,`align`,`alt`,`border`,`complete`,`crossOrigin`,`currentSrc`,`async`,`sync`,`auto`,`decoding`,`high`,`low`,`auto`,`fetchPriority`,`height`,`hspace`,`isMap`,`eager`,`lazy`,`loading`,`longDesc`,`lowsrc`,`name`,`naturalHeight`,`naturalWidth`,`referrerPolicy`,`sizes`,`src`,`srcset`,`useMap`,`vspace`,`width`,`x`,`y`,`decode`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLImageElement`,`Pn!&4"&4#&4$)4%9P&,J4&&4'9P.(.).*J4+P.,.-..J4/'40'41)42P.3.4J45&46&47&48'499'4:9&4;&4<&4=&4>&4?'4@'4A'4B9'4C9P$\`1DP"2EPnF2GnH"f2I"/J2KP)nLJ2M8$1NP&2EnO2KP)nPJ2M8$1NP"2EPnQ2GnR"f2I"/J2KP)nSJ2M8$1TP&2EnU2KP)nVJ2M8$1TMwWy`],wf=[`namespace`,`qualifiedName`,()=>yf,`doctype`,()=>y_,`createDocument`,`name`,`publicId`,`systemId`,()=>yf,`createDocumentType`,`title`,()=>hl,`createHTMLDocument`,`args`,!0,`hasFeature`,`DOMImplementation`,`PPP&,J2!P&,J2"Pn#,J2$8n%1&P&2'&2(&2)n*1+P&2,8n-1.P"@2/.011Mw2y`],Tf=[()=>I,()=>v_,`alt`,`coords`,`download`,`noHref`,`ping`,`referrerPolicy`,`rel`,`shape`,`target`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLAreaElement`,`Pn!n"&4#&4$&4%)4&&4'&4(&4)!!&4*&4+P"2,Pn-2.n/"f20"/122P)n3J248$15P&2,n622P)n7J248$15P"2,Pn82.n9"f20"/122P)n:J248$1;P&2,n<22P)n=J248$1;Mw>y`],Ef=[`complete`,`interactive`,`loading`,`DocumentReadyState`,`P.!.".#Jw$y`],Df=[()=>b_,()=>x_,()=>S_,`currentScale`,()=>C_,`currentTranslate`,()=>Q,`height`,()=>Q,`width`,()=>Q,`x`,()=>Q,`y`,`animationsPaused`,()=>G,`element`,()=>eg,`rect`,`checkEnclosure`,()=>G,()=>eg,`checkIntersection`,()=>w_,`createSVGAngle`,()=>T_,`createSVGLength`,()=>Pu,`createSVGMatrix`,()=>E_,`createSVGNumber`,()=>D_,`createSVGPoint`,()=>wl,`createSVGRect`,()=>O_,`createSVGTransform`,()=>Fu,`matrix`,()=>O_,`createSVGTransformFromMatrix`,`deselectAll`,`forceRedraw`,`getCurrentTime`,`elementId`,()=>V,`getElementById`,()=>eg,()=>G,`referenceElement`,()=>Zd,()=>Ym,()=>$m,()=>Oh,()=>kh,()=>Fh,()=>Lh,()=>Rh,()=>Bh,()=>qh,()=>Zh,`getEnclosureList`,()=>eg,()=>G,()=>Zd,()=>Ym,()=>$m,()=>Oh,()=>kh,()=>Fh,()=>Lh,()=>Rh,()=>Bh,()=>qh,()=>Zh,`getIntersectionList`,`pauseAnimations`,`seconds`,`setCurrentTime`,`maxWaitMilliseconds`,`suspendRedraw`,`unpauseAnimations`,`suspendHandleID`,`unsuspendRedraw`,`unsuspendRedrawAll`,`type`,0,`this`,()=>k_,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>k_,()=>B,`removeEventListener`,()=>z,()=>B,`SVGSVGElement`,`Pn!n"n#'4$n%4&9n'4(9n)4*9n+4,9n-4.9P)1/Pn021n223)14Pn521n623)17Pn819Pn:1;Pn<1=Pn>1?Pn@1APnB1CPnD1EPnF2G8nH1IP$1JP$1KP'1LP&2MPnN,J1OPnP23PnQ,J2RPnTnUnVnWnXnYnZn[n\\n]JoS"1^Pn_23Pn\`,J2RPnbncndnenfngnhninjnkJoa"1lP$1mP'2n$1oP'2p'1qP$1rP'2s$1tP$1uP"2vPnw2xny"f2z"/{2|P)n}J2~8$1P&2vn2|P)nJ2~8$1P"2vPn2xn"f2z"/{2|P)nJ2~8$1
P&2vn2|P)nJ2~8$1
Mwy`],Of=[()=>I,`async`,`charset`,`crossOrigin`,`defer`,`event`,`high`,`low`,`auto`,`fetchPriority`,`htmlFor`,`integrity`,`noModule`,`referrerPolicy`,`src`,`text`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLScriptElement`,`Pn!)4"!!&4#P&,J4$)4%&4&P.'.(.)J4*&4+&4,)4-&4.&4/&40&41P"21Pn223n4"f25"/627P)n8J298$1:P&21n;27P)n<J298$1:P"21Pn=23n>"f25"/627P)n?J298$1@P&21nA27P)nBJ298$1@MwCy`],kf=[()=>i_,`DocumentTimeline`,`Pn!Mw"y`],Af=[`hidden`,`visible`,`DocumentVisibilityState`,`P.!."Jw#y`],jf=[()=>gl,`shadowRoots`,`CaretPositionFromPointOptions`,`Pn!F4"8Mw#y`],Mf=[`offset`,()=>W,`offsetNode`,()=>wl,`getClientRect`,`CaretPosition`,`P'4!9n"4#9PPn$,J1%Mw&y`],Nf=[()=>A_,()=>W,`commonAncestorContainer`,()=>If,`cloneContents`,0,`cloneRange`,`toStart`,`collapse`,`how`,0,`sourceRange`,`compareBoundaryPoints`,()=>W,`node`,`offset`,`comparePoint`,`string`,()=>If,`createContextualFragment`,`deleteContents`,`detach`,()=>If,`extractContents`,()=>wl,`getBoundingClientRect`,()=>Tl,`getClientRects`,()=>W,`insertNode`,()=>W,`intersectsNode`,()=>W,`isPointInRange`,()=>W,`selectNode`,()=>W,`selectNodeContents`,()=>W,`setEnd`,()=>W,`setEndAfter`,()=>W,`setEndBefore`,()=>W,`setStart`,()=>W,`setStartAfter`,()=>W,`setStartBefore`,()=>W,`newParent`,`surroundContents`,`toString`,0,`START_TO_START`,1,`START_TO_END`,2,`END_TO_END`,3,`END_TO_START`,`Range`,`Pn!n"4#9Pn$1%Pn&1'P)2(8$1)P'2*n+2,'1-Pn.2/'20'11P&22n314P$15P$16Pn718Pn91:Pn;1<Pn=2/$1>Pn?2/)1@PnA2/'20)1BPnC2/$1DPnE2/$1FPnG2/'20$1HPnI2/$1JPnK2/$1LPnM2/'20$1NPnO2/$1PPnQ2/$1RPnS2T$1UP&1V.W4X9.Y4Z9.[4\\9.]4^9Mw_y`],Pf=[()=>Fp,`CDATASection`,`Pn!Mw"y`],Ff=[()=>j_,`Comment`,`Pn!Mw"y`],If=[()=>W,()=>ff,()=>dl,()=>hl,`ownerDocument`,`elementId`,()=>I,`getElementById`,`DocumentFragment`,`Pn!n"n#n$4%9P&2&Pn',J1(!!Mw)y`],Lf=[()=>ml,`customElementRegistry`,`is`,`ElementCreationOptions`,`PPn!,J4"8&4#8Mw$y`],Rf=[()=>U,()=>a_,`currentTime`,()=>a_,`timelineTime`,`AnimationPlaybackEvent`,`Pn!Pn",J4#9Pn$,J4%9Mw&y`],zf=[()=>U,()=>M_,`inputBuffer`,()=>M_,`outputBuffer`,`playbackTime`,`AudioProcessingEvent`,`Pn!n"4#9n$4%9'4&9Mw'y`],Bf=[()=>U,`returnValue`,`BeforeUnloadEvent`,`Pn!"4"Mw#y`],Vf=[()=>U,()=>Xc,`data`,()=>qd,`timecode`,`BlobEvent`,`Pn!n"4#9n$4%9Mw&y`],Hf=[()=>U,`code`,`reason`,`wasClean`,`CloseEvent`,`Pn!'4"9&4#9)4$9Mw%y`],Uf=[()=>U,`command`,()=>V,`source`,`CommandEvent`,`Pn!&4"9Pn#,J4$9Mw%y`],Wf=[()=>U,`skipped`,`ContentVisibilityAutoStateChangeEvent`,`Pn!)4"9Mw#y`],Gf=[()=>U,()=>$d,()=>N_,`changed`,()=>$d,()=>N_,`deleted`,`CookieChangeEvent`,`Pn!n#o""4$9n&o%"4'9Mw(y`],Kf=[`T`,()=>U,`detail`,`type`,`bubbles`,`cancelable`,`initCustomEvent`,`CustomEvent`,`"c!Pn"e"!4#9P&2$)2%8)2&8e#!2#8$1'Mw(y`],qf=[()=>U,()=>P_,`acceleration`,()=>P_,`accelerationIncludingGravity`,`interval`,()=>F_,`rotationRate`,`DeviceMotionEvent`,`Pn!Pn",J4#9Pn$,J4%9'4&9Pn',J4(9Mw)y`],Jf=[()=>U,`absolute`,`alpha`,`beta`,`gamma`,`DeviceOrientationEvent`,`Pn!)4"9P',J4#9P',J4$9P',J4%9Mw&y`],Yf=[()=>U,()=>$d,()=>I_,`fontfaces`,`FontFaceSetLoadEvent`,`Pn!n#o""4$9Mw%y`],Xf=[()=>U,()=>L_,`error`,`GPUUncapturedErrorEvent`,`Pn!n"4#9Mw$y`],Zf=[()=>U,()=>R_,`gamepad`,`GamepadEvent`,`Pn!n"4#9Mw$y`],Qf=[()=>U,`newURL`,`oldURL`,`HashChangeEvent`,`Pn!&4"9&4#9Mw$y`],$f=[()=>U,`newVersion`,`oldVersion`,`IDBVersionChangeEvent`,`Pn!P',J4"9'4#9Mw$y`],ep=[()=>U,()=>z_,`port`,`MIDIConnectionEvent`,`Pn!Pn",J4#9Mw$y`],tp=[()=>U,`data`,`MIDIMessageEvent`,`Pn!PW,J4"9Mw#y`],np=[()=>U,`initData`,`initDataType`,`MediaEncryptedEvent`,`Pn!P_,J4"9&4#9Mw$y`],rp=[()=>U,`message`,()=>B_,`messageType`,`MediaKeyMessageEvent`,`Pn!_4"9n#4$9Mw%y`],ip=[()=>U,`matches`,`media`,`MediaQueryListEvent`,`Pn!)4"9&4#9Mw$y`],ap=[`T`,()=>U,`data`,`lastEventId`,`origin`,()=>$d,()=>V_,`ports`,()=>H_,`source`,`type`,`bubbles`,`cancelable`,()=>H_,()=>V_,`initMessageEvent`,`MessageEvent`,`"c!Pn"e"!4#9&4$9&4%9n'o&"4(9Pn),J4*9P&2+)2,8)2-8"2#8&2%8&2$8Pn.,J2*8n/F2(8$10Mw1y`],op=[()=>U,`canIntercept`,()=>U_,`destination`,`downloadRequest`,()=>su,`formData`,`hasUAVisualTransition`,`hashChange`,`info`,()=>W_,`navigationType`,()=>il,`signal`,()=>V,`sourceElement`,`userInitiated`,()=>G_,`options`,`intercept`,`scroll`,`NavigateEvent`,`Pn!)4"9n#4$9P&,J4%9Pn&,J4'9)4(9)4)9"4*9n+4,9n-4.9Pn/,J409)419Pn2238$14P$15Mw6y`],sp=[()=>U,()=>K_,`from`,()=>W_,`navigationType`,`NavigationCurrentEntryChangeEvent`,`Pn!n"4#9Pn$,J4%9Mw&y`],cp=[()=>U,()=>M_,`renderedBuffer`,`OfflineAudioCompletionEvent`,`Pn!n"4#9Mw$y`],lp=[()=>U,()=>mf,`viewTransition`,`PageRevealEvent`,`Pn!Pn",J4#9Mw$y`],up=[()=>U,()=>q_,`activation`,()=>mf,`viewTransition`,`PageSwapEvent`,`Pn!Pn",J4#9Pn$,J4%9Mw&y`],dp=[()=>U,`persisted`,`PageTransitionEvent`,`Pn!)4"9Mw#y`],fp=[()=>pp,`methodDetails`,`methodName`,`PaymentMethodChangeEvent`,`Pn!"4"9&4#9Mw$y`],pp=[()=>U,()=>J_,()=>Y_,()=>J_,`detailsPromise`,`updateWith`,`PaymentRequestUpdateEvent`,`Pn!PPn"n$o#"J2%$1&Mw'y`],mp=[()=>U,()=>X_,`pictureInPictureWindow`,`PictureInPictureEvent`,`Pn!n"4#9Mw$y`],hp=[()=>U,`hasUAVisualTransition`,`state`,`PopStateEvent`,`Pn!)4"9"4#9Mw$y`],gp=[()=>U,`promise`,`reason`,`PromiseRejectionEvent`,'Pn!"`4"9"4#9Mw$y'],_p=[()=>U,`tone`,`RTCDTMFToneChangeEvent`,`Pn!&4"9Mw#y`],vp=[()=>U,()=>Z_,`channel`,`RTCDataChannelEvent`,`Pn!n"4#9Mw$y`],yp=[()=>U,()=>Q_,`error`,`RTCErrorEvent`,`Pn!n"4#9Mw$y`],bp=[()=>U,`address`,`errorCode`,`errorText`,`port`,`url`,`RTCPeerConnectionIceErrorEvent`,`Pn!P&,J4"9'4#9&4$9P',J4%9&4&9Mw'y`],xp=[()=>U,()=>$_,`candidate`,`RTCPeerConnectionIceEvent`,`Pn!Pn",J4#9Mw$y`],Sp=[()=>U,()=>ev,`receiver`,()=>$d,()=>ic,`streams`,()=>Cc,`track`,()=>tv,`transceiver`,`RTCTrackEvent`,`Pn!n"4#9n%o$"4&9n'4(9n)4*9Mw+y`],Cp=[()=>U,()=>nv,`error`,`message`,`SpeechRecognitionErrorEvent`,`Pn!n"4#9&4$9Mw%y`],wp=[()=>U,`resultIndex`,()=>rv,`results`,`SpeechRecognitionEvent`,`Pn!'4"9n#4$9Mw%y`],Tp=[()=>Ep,()=>iv,`error`,`SpeechSynthesisErrorEvent`,`Pn!n"4#9Mw$y`],Ep=[()=>U,`charIndex`,`charLength`,`elapsedTime`,`name`,()=>av,`utterance`,`SpeechSynthesisEvent`,`Pn!'4"9'4#9'4$9&4%9n&4'9Mw(y`],Dp=[()=>U,`key`,`newValue`,`oldValue`,()=>ov,`storageArea`,`url`,`type`,`bubbles`,`cancelable`,()=>zp,()=>ov,`initStorageEvent`,`StorageEvent`,`Pn!P&,J4"9P&,J4#9P&,J4$9Pn%,J4&9&4'9P&2()2)8)2*8P&,J2"8P&,J2$8P&,J2#8P&n+J2'8Pn,,J2&8$1-Mw.y`],Op=[()=>U,()=>sv,`previousPriority`,`TaskPriorityChangeEvent`,`Pn!n"4#9Mw$y`],kp=[()=>Il,`data`,`type`,`bubbles`,`cancelable`,()=>pg,`view`,`initTextEvent`,`TextEvent`,`Pn!&4"9P&2#)2$8)2%8Pn&,J2'8&2"8$1(Mw)y`],Ap=[()=>U,()=>cv,`track`,`TrackEvent`,`Pn!Pn",J4#9Mw$y`],jp=[()=>U,`statusMessage`,`WebGLContextEvent`,`Pn!&4"9Mw#y`],Mp=[()=>W,`node`,``,()=>W,`acceptNode`,`NodeFilter`,`PPn!2"'/#PPn$2"'1%MJw&y`],Np=[()=>Mp,`filter`,`pointerBeforeReferenceNode`,()=>W,`referenceNode`,()=>W,`root`,`whatToShow`,`detach`,()=>W,`nextNode`,()=>W,`previousNode`,`NodeIterator`,`PPn!,J4"9)4#9n$4%9n&4'9'4(9P$1)PPn*,J1+PPn,,J1-Mw.y`],Pp=[()=>j_,()=>lv,`target`,`ProcessingInstruction`,`Pn!n"&4#9Mw$y`],Fp=[()=>j_,()=>fl,`wholeText`,`offset`,0,`splitText`,`Text`,`Pn!n"&4#9P'2$n%1&Mw'y`],Ip=[()=>W,`currentNode`,()=>Mp,`filter`,()=>W,`root`,`whatToShow`,()=>W,`firstChild`,()=>W,`lastChild`,()=>W,`nextNode`,()=>W,`nextSibling`,()=>W,`parentNode`,()=>W,`previousNode`,()=>W,`previousSibling`,`TreeWalker`,`Pn!4"Pn#,J4$9n%4&9'4'9PPn(,J1)PPn*,J1+PPn,,J1-PPn.,J1/PPn0,J11PPn2,J13PPn4,J15Mw6y`],Lp=[()=>W,`anchorNode`,`anchorOffset`,`direction`,()=>W,`focusNode`,`focusOffset`,`isCollapsed`,`rangeCount`,`type`,()=>Nf,`range`,`addRange`,()=>W,`node`,`offset`,`collapse`,`collapseToEnd`,`collapseToStart`,()=>W,`allowPartialContainment`,`containsNode`,`deleteFromDocument`,`empty`,()=>W,`extend`,()=>uv,`options`,()=>hg,`getComposedRanges`,`index`,()=>Nf,`getRangeAt`,`alter`,`granularity`,`modify`,`removeAllRanges`,()=>Nf,`removeRange`,()=>W,`selectAllChildren`,()=>W,()=>W,`setBaseAndExtent`,()=>W,`setPosition`,`toString`,`Selection`,`PPn!,J4"9'4#9&4$9Pn%,J4&9'4'9)4(9'4)9&4*9Pn+2,$1-PPn.,J2/'208$11P$12P$13Pn42/)258)16P$17P$18Pn92/'208$1:Pn;2<8n=F1>P'2?n@1AP&2B8&2$8&2C8$1DP$1EPnF2,$1GPnH2/$1IPnJ2"'2#nK2&'2'$1LPPnM,J2/'208$1NP&1OMwPy`],Rp=[()=>ml,`customElementRegistry`,`selfOnly`,`ImportNodeOptions`,`Pn!4"8)4#8Mw$y`],zp=[`hash`,`host`,`hostname`,`href`,`toString`,`origin`,`password`,`pathname`,`port`,`protocol`,`search`,()=>dv,`searchParams`,`username`,`toJSON`,`URL`,`P&4!&4"&4#&4$P&1%&4&9&4'&4(&4)&4*&4+n,4-9&4.P&1/Mw0y`],Bp=[``,`ViewTransitionUpdateCallback`,`PP"v!Mw"y`],Vp=[`types`,()=>Bp,`update`,`StartViewTransitionOptions`,`PP&F,J4!8Pn",J4#8Mw$y`],Hp=[()=>rl,()=>U,`DOMContentLoaded`,()=>U,`fullscreenchange`,()=>U,`fullscreenerror`,()=>U,`pointerlockchange`,()=>U,`pointerlockerror`,()=>U,`readystatechange`,()=>U,`visibilitychange`,`DocumentEventMap`,`Pn!n"4#n$4%n&4'n(4)n*4+n,4-n.4/Mw0y`],Up=[`closed`,`open`,`ShadowRootMode`,`P.!."Jw#y`],Wp=[`manual`,`named`,`SlotAssignmentMode`,`P.!."Jw#y`],Gp=[()=>U,`slotchange`,`ShadowRootEventMap`,`Pn!4"Mw#y`],Kp=[()=>fv,`type`,0,`this`,()=>pv,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>pv,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLAudioElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],qp=[()=>I,`href`,`target`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLBaseElement`,`Pn!&4"&4#P"2$Pn%2&n'"f2("/)2*P)n+J2,8$1-P&2$n.2*P)n/J2,8$1-P"2$Pn02&n1"f2("/)2*P)n2J2,8$13P&2$n42*P)n5J2,8$13Mw6y`],Jp=[()=>I,`cite`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLQuoteElement`,`Pn!&4"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],Yp=[()=>I,()=>S_,`aLink`,`background`,`bgColor`,`link`,`text`,`vLink`,`type`,0,`this`,()=>mv,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>mv,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLBodyElement`,`Pn!n"&4#&4$&4%&4&&4'&4(P"2)Pn*2+n,"f2-"/.2/P)n0J218$12P&2)n32/P)n4J218$12P"2)Pn52+n6"f2-"/.2/P)n7J218$18P&2)n92/P)n:J218$18Mw;y`],Xp=[()=>I,`clear`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLBRElement`,`Pn!&4"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],Zp=[()=>I,()=>hv,`command`,()=>V,`commandForElement`,`disabled`,()=>nu,`form`,`formAction`,`formEnctype`,`formMethod`,`formNoValidate`,`formTarget`,()=>Zd,()=>pm,`labels`,`name`,`submit`,`reset`,`button`,`type`,`validationMessage`,()=>au,`validity`,`value`,`willValidate`,`checkValidity`,`reportValidity`,`error`,`setCustomValidity`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLButtonElement`,`Pn!n"&4#Pn$,J4%)4&Pn',J4(9&4)&4*&4+)4,&4-n/o."409&41P.2.3.4J45&469n7489&49)4:9P)1;P)1<P&2=$1>P"25Pn?2@nA"f2B"/C2DP)nEJ2F8$1GP&25nH2DP)nIJ2F8$1GP"25PnJ2@nK"f2B"/C2DP)nLJ2F8$1MP&25nN2DP)nOJ2F8$1MMwPy`],Qp=[()=>I,`align`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLTableCaptionElement`,`Pn!&4"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],$p=[()=>I,`align`,`ch`,`chOff`,`span`,`vAlign`,`width`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLTableColElement`,`Pn!&4"&4#&4$'4%&4&&4'P"2(Pn)2*n+"f2,"/-2.P)n/J208$11P&2(n22.P)n3J208$11P"2(Pn42*n5"f2,"/-2.P)n6J208$17P&2(n82.P)n9J208$17Mw:y`],em=[()=>I,`value`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLDataElement`,`Pn!&4"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],tm=[()=>I,()=>El,()=>wm,`options`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLDataListElement`,`Pn!n#o""4$9P"2%Pn&2'n("f2)"/*2+P)n,J2$8$1-P&2%n.2+P)n/J2$8$1-P"2%Pn02'n1"f2)"/*2+P)n2J2$8$13P&2%n42+P)n5J2$8$13Mw6y`],nm=[()=>I,`cite`,`dateTime`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLModElement`,`Pn!&4"&4#P"2$Pn%2&n'"f2("/)2*P)n+J2,8$1-P&2$n.2*P)n/J2,8$1-P"2$Pn02&n1"f2("/)2*P)n2J2,8$13P&2$n42*P)n5J2,8$13Mw6y`],rm=[()=>I,`name`,`open`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLDetailsElement`,`Pn!&4")4#P"2$Pn%2&n'"f2("/)2*P)n+J2,8$1-P&2$n.2*P)n/J2,8$1-P"2$Pn02&n1"f2("/)2*P)n2J2,8$13P&2$n42*P)n5J2,8$13Mw6y`],im=[()=>I,`closedBy`,`open`,`returnValue`,`close`,`requestClose`,`show`,`showModal`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLDialogElement`,`Pn!&4")4#&4$P&2$8$1%P&2$8$1&P$1'P$1(P"2)Pn*2+n,"f2-"/.2/P)n0J218$12P&2)n32/P)n4J218$12P"2)Pn52+n6"f2-"/.2/P)n7J218$18P&2)n92/P)n:J218$18Mw;y`],am=[()=>I,`align`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLDivElement`,`Pn!&4"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],om=[()=>I,`compact`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLDListElement`,`Pn!)4"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],sm=[()=>I,`disabled`,()=>of,`elements`,()=>nu,`form`,`name`,`type`,`validationMessage`,()=>au,`validity`,`willValidate`,`checkValidity`,`reportValidity`,`error`,`setCustomValidity`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLFieldSetElement`,`Pn!)4"n#4$9Pn%,J4&9&4'&4(9&4)9n*4+9)4,9P)1-P)1.P&2/$10P"2(Pn122n3"f24"/526P)n7J288$19P&2(n:26P)n;J288$19P"2(Pn<22n="f24"/526P)n>J288$1?P&2(n@26P)nAJ288$1?MwBy`],cm=[()=>I,`align`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLHeadingElement`,`Pn!&4"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],lm=[()=>I,`align`,`color`,`noShade`,`size`,`width`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLHRElement`,`Pn!&4"&4#)4$&4%&4&P"2'Pn(2)n*"f2+"/,2-P)n.J2/8$10P&2'n12-P)n2J2/8$10P"2'Pn32)n4"f2+"/,2-P)n5J2/8$16P&2'n72-P)n8J2/8$16Mw9y`],um=[()=>I,`version`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLHtmlElement`,`Pn!&4"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],dm=[()=>I,`align`,`allow`,`allowFullscreen`,()=>hl,`contentDocument`,()=>vf,`contentWindow`,`frameBorder`,`height`,`eager`,`lazy`,`loading`,`longDesc`,`marginHeight`,`marginWidth`,`name`,()=>gv,`referrerPolicy`,`scrolling`,`src`,`srcdoc`,`width`,()=>hl,`getSVGDocument`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLIFrameElement`,`Pn!&4"&4#)4$Pn%,J4&9Pn',J4(9&4)&4*P.+.,J4-&4.&4/&40&41n243!!&44&45&46&47PPn8,J19P"2:Pn;2<n="f2>"/?2@P)nAJ2B8$1CP&2:nD2@P)nEJ2B8$1CP"2:PnF2<nG"f2>"/?2@P)nHJ2B8$1IP&2:nJ2@P)nKJ2B8$1IMwLy`],fm=[()=>I,()=>hv,`accept`,`align`,`alt`,()=>_v,`autocomplete`,`capture`,`checked`,`defaultChecked`,`defaultValue`,`dirName`,`disabled`,()=>vv,`files`,()=>nu,`form`,`formAction`,`formEnctype`,`formMethod`,`formNoValidate`,`formTarget`,`height`,`indeterminate`,()=>Zd,()=>pm,`labels`,()=>tm,`list`,`max`,`maxLength`,`min`,`minLength`,`multiple`,`name`,`pattern`,`placeholder`,`readOnly`,`required`,()=>yv,`selectionDirection`,`selectionEnd`,`selectionStart`,`size`,`src`,`step`,`type`,`useMap`,`validationMessage`,()=>au,`validity`,`value`,`valueAsDate`,`valueAsNumber`,()=>$d,()=>bv,`webkitEntries`,`webkitdirectory`,`width`,`willValidate`,`checkValidity`,`reportValidity`,`select`,`error`,`setCustomValidity`,`replacement`,`setRangeText`,`start`,`end`,()=>xv,`selectionMode`,()=>yv,`direction`,`setSelectionRange`,`showPicker`,`n`,`stepDown`,`stepUp`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLInputElement`,`Pn!n"&4#&4$&4%n&4'&4()4))4*&4+&4,)4-Pn.,J4/Pn0,J419&42&43&44)45&46'47)48Pn:o9",J4;9Pn<,J4=9&4>'4?&4@'4A)4B&4C&4D&4E)4F)4GPnH,J4IP',J4JP',J4K'4L&4M&4N&4O&4P&4Q9nR4S9&4TPT,J4U'4VnXoW"4Y9)4Z'4[)4\\9P)1]P)1^P$1_P&2\`$1aP&2b$1cP&2b'2d'2enf2g8$1cPP',J2dP',J2enh2i8$1jP$1kP'2l8$1mP'2l8$1nP"2OPno2pnq"f2r"/s2tP)nuJ2v8$1wP&2Onx2tP)nyJ2v8$1wP"2OPnz2pn{"f2r"/s2tP)n|J2v8$1}P&2On~2tP)nJ2v8$1}Mwy`],pm=[()=>I,()=>I,`control`,()=>nu,`form`,`htmlFor`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLLabelElement`,`Pn!Pn",J4#9Pn$,J4%9&4&P"2'Pn(2)n*"f2+"/,2-P)n.J2/8$10P&2'n12-P)n2J2/8$10P"2'Pn32)n4"f2+"/,2-P)n5J2/8$16P&2'n72-P)n8J2/8$16Mw9y`],mm=[()=>I,`align`,()=>nu,`form`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLLegendElement`,`Pn!&4"Pn#,J4$9P"2%Pn&2'n("f2)"/*2+P)n,J2-8$1.P&2%n/2+P)n0J2-8$1.P"2%Pn12'n2"f2)"/*2+P)n3J2-8$14P&2%n52+P)n6J2-8$14Mw7y`],hm=[()=>I,`type`,`value`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLLIElement`,`Pn!&4"'4#P"2"Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2"n-2)P)n.J2+8$1,P"2"Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2"n32)P)n4J2+8$12Mw5y`],gm=[()=>I,()=>lv,`as`,`charset`,`crossOrigin`,`disabled`,`high`,`low`,`auto`,`fetchPriority`,`href`,`hreflang`,`imageSizes`,`imageSrcset`,`integrity`,`media`,`referrerPolicy`,`rel`,`rev`,`target`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLLinkElement`,`Pn!n"&4#!!&4$P&,J4%)4&P.'.(.)J4*&4+&4,&4-&4.&4/&40&41&42!!&43!!&44&45P"25Pn627n8"f29"/:2;P)n<J2=8$1>P&25n?2;P)n@J2=8$1>P"25PnA27nB"f29"/:2;P)nCJ2=8$1DP&25nE2;P)nFJ2=8$1DMwGy`],_m=[()=>I,()=>of,`areas`,`name`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLMapElement`,`Pn!n"4#9&4$P"2%Pn&2'n("f2)"/*2+P)n,J2-8$1.P&2%n/2+P)n0J2-8$1.P"2%Pn12'n2"f2)"/*2+P)n3J2-8$14P&2%n52+P)n6J2-8$14Mw7y`],vm=[()=>I,`compact`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLMenuElement`,`Pn!)4"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],ym=[()=>I,`content`,`httpEquiv`,`media`,`name`,`scheme`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLMetaElement`,`Pn!&4"&4#&4$&4%&4&P"2'Pn(2)n*"f2+"/,2-P)n.J2/8$10P&2'n12-P)n2J2/8$10P"2'Pn32)n4"f2+"/,2-P)n5J2/8$16P&2'n72-P)n8J2/8$16Mw9y`],bm=[()=>I,`high`,()=>Zd,()=>pm,`labels`,`low`,`max`,`min`,`optimum`,`value`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLMeterElement`,`Pn!'4"n$o#"4%9'4&'4''4('4)'4*P"2+Pn,2-n."f2/"/021P)n2J238$14P&2+n521P)n6J238$14P"2+Pn72-n8"f2/"/021P)n9J238$1:P&2+n;21P)n<J238$1:Mw=y`],xm=[()=>I,`align`,`archive`,`border`,`code`,`codeBase`,`codeType`,()=>hl,`contentDocument`,()=>vf,`contentWindow`,`data`,`declare`,()=>nu,`form`,`height`,`hspace`,`name`,`standby`,`type`,`useMap`,`validationMessage`,()=>au,`validity`,`vspace`,`width`,`willValidate`,`checkValidity`,()=>hl,`getSVGDocument`,`reportValidity`,`error`,`setCustomValidity`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLObjectElement`,`Pn!&4"&4#&4$&4%&4&&4'Pn(,J4)9Pn*,J4+9&4,)4-Pn.,J4/9&40'41&42&43&44&45&469n7489'49&4:)4;9P)1<PPn=,J1>P)1?P&2@$1AP"24PnB2CnD"f2E"/F2GP)nHJ2I8$1JP&24nK2GP)nLJ2I8$1JP"24PnM2CnN"f2E"/F2GP)nOJ2I8$1PP&24nQ2GP)nRJ2I8$1PMwSy`],Sm=[()=>I,`compact`,`reversed`,`start`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLOListElement`,`Pn!)4")4#'4$&4%P"2%Pn&2'n("f2)"/*2+P)n,J2-8$1.P&2%n/2+P)n0J2-8$1.P"2%Pn12'n2"f2)"/*2+P)n3J2-8$14P&2%n52+P)n6J2-8$14Mw7y`],Cm=[()=>I,`disabled`,`label`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLOptGroupElement`,`Pn!)4"&4#P"2$Pn%2&n'"f2("/)2*P)n+J2,8$1-P&2$n.2*P)n/J2,8$1-P"2$Pn02&n1"f2("/)2*P)n2J2,8$13P&2$n42*P)n5J2,8$13Mw6y`],wm=[()=>I,`defaultSelected`,`disabled`,()=>nu,`form`,`index`,`label`,`selected`,`text`,`value`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLOptionElement`,`Pn!)4")4#Pn$,J4%9'4&9&4')4(&4)&4*P"2+Pn,2-n."f2/"/021P)n2J238$14P&2+n521P)n6J238$14P"2+Pn72-n8"f2/"/021P)n9J238$1:P&2+n;21P)n<J238$1:Mw=y`],Tm=[()=>I,`defaultValue`,()=>nu,`form`,()=>Zd,()=>pm,`labels`,`name`,`type`,`validationMessage`,()=>au,`validity`,`value`,`willValidate`,`checkValidity`,`reportValidity`,`error`,`setCustomValidity`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLOutputElement`,`Pn!&4"Pn#,J4$9!!n&o%"4'9&4(&4)9&4*9n+4,9&4-)4.9P)1/P)10P&21$12P"2)Pn324n5"f26"/728P)n9J2:8$1;P&2)n<28P)n=J2:8$1;P"2)Pn>24n?"f26"/728P)n@J2:8$1AP&2)nB28P)nCJ2:8$1AMwDy`],Em=[()=>I,`align`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLParagraphElement`,`Pn!&4"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],Dm=[()=>I,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLPictureElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],Om=[()=>I,`width`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLPreElement`,`Pn!'4"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],km=[()=>I,()=>Zd,()=>pm,`labels`,`max`,`position`,`value`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLProgressElement`,`Pn!n#o""4$9'4%'4&9'4'P"2(Pn)2*n+"f2,"/-2.P)n/J208$11P&2(n22.P)n3J208$11P"2(Pn42*n5"f2,"/-2.P)n6J208$17P&2(n82.P)n9J208$17Mw:y`],Am=[()=>I,()=>_v,`autocomplete`,`disabled`,()=>nu,`form`,()=>Zd,()=>pm,`labels`,`length`,`multiple`,`name`,()=>Sv,`options`,`required`,`selectedIndex`,()=>El,()=>wm,`selectedOptions`,`size`,`select-one`,`select-multiple`,`type`,`validationMessage`,()=>au,`validity`,`value`,`willValidate`,()=>wm,()=>Cm,`element`,()=>I,`before`,`add`,`checkValidity`,`index`,()=>wm,`item`,()=>wm,`namedItem`,`remove`,`reportValidity`,`error`,`setCustomValidity`,`showPicker`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,()=>wm,()=>Cm,`HTMLSelectElement`,`Pn!n"4#)4$Pn%,J4&9n(o'"4)9'4*)4+&4,n-4.9)4/'40n2o1"439'44P.5.6J479&489n94:9&4;)4<9PPn=n>J2?Pn@',J2A8$1BP)1CP'2DPnE,J1FP&2,PnG,J1HP$1IP'2D$1IP)1JP&2K$1LP$1MP"27PnN2OnP"f2Q"/R2SP)nTJ2.8$1UP&27nV2SP)nWJ2.8$1UP"27PnX2OnY"f2Q"/R2SP)nZJ2.8$1[P&27n\\2SP)n]J2.8$1['Pn^n_JLMw\`y`],jm=[()=>I,`height`,`media`,`sizes`,`src`,`srcset`,`type`,`width`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLSourceElement`,`Pn!'4"&4#&4$&4%&4&&4''4(P"2'Pn)2*n+"f2,"/-2.P)n/J208$11P&2'n22.P)n3J208$11P"2'Pn42*n5"f2,"/-2.P)n6J208$17P&2'n82.P)n9J208$17Mw:y`],Mm=[()=>I,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLSpanElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],Nm=[()=>I,()=>lv,`disabled`,`media`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLStyleElement`,`Pn!n"!!)4#&4$&4%P"2%Pn&2'n("f2)"/*2+P)n,J2-8$1.P&2%n/2+P)n0J2-8$1.P"2%Pn12'n2"f2)"/*2+P)n3J2-8$14P&2%n52+P)n6J2-8$14Mw7y`],Pm=[()=>I,`align`,`bgColor`,`border`,()=>Qp,`caption`,`cellPadding`,`cellSpacing`,`frame`,()=>El,()=>Vm,`rows`,`rules`,`summary`,()=>El,()=>Fm,`tBodies`,()=>Fm,`tFoot`,()=>Fm,`tHead`,`width`,()=>Qp,`createCaption`,()=>Fm,`createTBody`,()=>Fm,`createTFoot`,()=>Fm,`createTHead`,`deleteCaption`,`index`,`deleteRow`,`deleteTFoot`,`deleteTHead`,()=>Vm,`insertRow`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLTableElement`,`Pn!&4"&4#&4$Pn%,J4&&4'&4(&4)n+o*"4,9&4-&4.n0o/"419Pn2,J43Pn4,J45&46Pn718Pn91:Pn;1<Pn=1>P$1?P'2@$1AP$1BP$1CP'2@8nD1EP"2FPnG2HnI"f2J"/K2LP)nMJ2N8$1OP&2FnP2LP)nQJ2N8$1OP"2FPnR2HnS"f2J"/K2LP)nTJ2N8$1UP&2FnV2LP)nWJ2N8$1UMwXy`],Fm=[()=>I,`align`,`ch`,`chOff`,()=>El,()=>Vm,`rows`,`vAlign`,`index`,`deleteRow`,()=>Vm,`insertRow`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLTableSectionElement`,`Pn!&4"&4#&4$n&o%"4'9&4(P'2)$1*P'2)8n+1,P"2-Pn.2/n0"f21"/223P)n4J258$16P&2-n723P)n8J258$16P"2-Pn92/n:"f21"/223P)n;J258$1<P&2-n=23P)n>J258$1<Mw?y`],Im=[()=>I,`abbr`,`align`,`axis`,`bgColor`,`cellIndex`,`ch`,`chOff`,`colSpan`,`headers`,`height`,`noWrap`,`rowSpan`,`scope`,`vAlign`,`width`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLTableCellElement`,`Pn!&4"&4#&4$&4%'4&9&4'&4('4)&4*&4+)4,'4-&4.&4/&40P"21Pn223n4"f25"/627P)n8J298$1:P&21n;27P)n<J298$1:P"21Pn=23n>"f25"/627P)n?J298$1@P&21nA27P)nBJ298$1@MwCy`],Lm=[()=>I,()=>If,`content`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootMode`,`shadowRootSerializable`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLTemplateElement`,`Pn!n"4#9)4$&4%)4&&4')4(P"2)Pn*2+n,"f2-"/.2/P)n0J218$12P&2)n32/P)n4J218$12P"2)Pn52+n6"f2-"/.2/P)n7J218$18P&2)n92/P)n:J218$18Mw;y`],Rm=[()=>I,()=>_v,`autocomplete`,`cols`,`defaultValue`,`dirName`,`disabled`,()=>nu,`form`,()=>Zd,()=>pm,`labels`,`maxLength`,`minLength`,`name`,`placeholder`,`readOnly`,`required`,`rows`,()=>yv,`selectionDirection`,`selectionEnd`,`selectionStart`,`textLength`,`type`,`validationMessage`,()=>au,`validity`,`value`,`willValidate`,`wrap`,`checkValidity`,`reportValidity`,`select`,`error`,`setCustomValidity`,`replacement`,`setRangeText`,`start`,`end`,()=>xv,`selectionMode`,()=>yv,`direction`,`setSelectionRange`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLTextAreaElement`,`Pn!n"4#'4$&4%&4&)4'Pn(,J4)9n+o*"4,9'4-'4.&4/&40)41)42'43n445'46'47'489&499&4:9n;4<9&4=)4>9&4?P)1@P)1AP$1BP&2C$1DP&2E$1FP&2E'2G'2HnI2J8$1FPP',J2GP',J2HnK2L8$1MP"29PnN2OnP"f2Q"/R2SP)nTJ2U8$1VP&29nW2SP)nXJ2U8$1VP"29PnY2OnZ"f2Q"/R2SP)n[J2U8$1\\P&29n]2SP)n^J2U8$1\\Mw_y`],zm=[()=>I,`dateTime`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLTimeElement`,`Pn!&4"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],Bm=[()=>I,`text`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLTitleElement`,`Pn!&4"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],Vm=[()=>I,`align`,`bgColor`,()=>El,()=>Im,`cells`,`ch`,`chOff`,`rowIndex`,`sectionRowIndex`,`vAlign`,`index`,`deleteCell`,()=>Im,`insertCell`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLTableRowElement`,`Pn!&4"&4#n%o$"4&9&4'&4('4)9'4*9&4+P'2,$1-P'2,8n.1/P"20Pn122n3"f24"/526P)n7J288$19P&20n:26P)n;J288$19P"20Pn<22n="f24"/526P)n>J288$1?P&20n@26P)nAJ288$1?MwBy`],Hm=[()=>I,`default`,`kind`,`label`,`readyState`,`src`,`srclang`,()=>cv,`track`,0,`NONE`,1,`LOADING`,2,`LOADED`,3,`ERROR`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLTrackElement`,`Pn!)4"&4#&4$'4%9&4&&4'n(4)9.*4+9.,4-9..4/9.0419P"22Pn324n5"f26"/728P)n9J2:8$1;P&22n<28P)n=J2:8$1;P"22Pn>24n?"f26"/728P)n@J2:8$1AP&22nB28P)nCJ2:8$1AMwDy`],Um=[()=>I,`compact`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLUListElement`,`Pn!)4"&4#P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],Wm=[()=>fv,`disablePictureInPicture`,`height`,0,`this`,()=>mp,`ev`,``,`onenterpictureinpicture`,0,()=>mp,`onleavepictureinpicture`,`playsInline`,`poster`,`videoHeight`,`videoWidth`,`width`,`handle`,`cancelVideoFrameCallback`,()=>Cv,`getVideoPlaybackQuality`,()=>X_,`requestPictureInPicture`,()=>wv,`callback`,`requestVideoFrameCallback`,`type`,0,()=>Tv,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Tv,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLVideoElement`,`Pn!)4"'4#PPn$2%n&2'"/(,J4)PPn*2%n+2'"/(,J4,)4-&4.'4/9'409'41P'22$13Pn415Pn6\`17Pn829'1:P"2;Pn<2%n="f2'"/(2>P)n?J2@8$1AP&2;nB2>P)nCJ2@8$1AP"2;PnD2%nE"f2'"/(2>P)nFJ2@8$1GP&2;nH2>P)nIJ2@8$1GMwJy`],Gm=[()=>b_,()=>Ev,`download`,`hreflang`,`ping`,`referrerPolicy`,`rel`,()=>Dv,`target`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGAElement`,`Pn!n"&4#&4$&4%&4&&4'!!n(4)9&4*P"2*Pn+2,n-"f2."//20P)n1J228$13P&2*n420P)n5J228$13P"2*Pn62,n7"f2."//20P)n8J228$19P&2*n:20P)n;J228$19Mw<y`],Km=[()=>Ov,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGAnimateElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],qm=[()=>Ov,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGAnimateMotionElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],Jm=[()=>Ov,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGAnimateTransformElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],Ym=[()=>kv,()=>Q,`cx`,()=>Q,`cy`,()=>Q,`r`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGCircleElement`,`Pn!n"4#9n$4%9n&4'9P"2(Pn)2*n+"f2,"/-2.P)n/J208$11P&2(n22.P)n3J208$11P"2(Pn42*n5"f2,"/-2.P)n6J208$17P&2(n82.P)n9J208$17Mw:y`],Xm=[()=>G,()=>Av,`clipPathUnits`,()=>jv,`transform`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGClipPathElement`,`Pn!n"4#9n$4%9P"2&Pn'2(n)"f2*"/+2,P)n-J2.8$1/P&2&n02,P)n1J2.8$1/P"2&Pn22(n3"f2*"/+2,P)n4J2.8$15P&2&n62,P)n7J2.8$15Mw8y`],Zm=[()=>b_,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGDefsElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],Qm=[()=>G,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGDescElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],$m=[()=>kv,()=>Q,`cx`,()=>Q,`cy`,()=>Q,`rx`,()=>Q,`ry`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGEllipseElement`,`Pn!n"4#9n$4%9n&4'9n(4)9P"2*Pn+2,n-"f2."//20P)n1J228$13P&2*n420P)n5J228$13P"2*Pn62,n7"f2."//20P)n8J228$19P&2*n:20P)n;J228$19Mw<y`],eh=[()=>G,()=>Mv,()=>Dv,`in1`,()=>Dv,`in2`,()=>Av,`mode`,0,`SVG_FEBLEND_MODE_UNKNOWN`,1,`SVG_FEBLEND_MODE_NORMAL`,2,`SVG_FEBLEND_MODE_MULTIPLY`,3,`SVG_FEBLEND_MODE_SCREEN`,4,`SVG_FEBLEND_MODE_DARKEN`,5,`SVG_FEBLEND_MODE_LIGHTEN`,6,`SVG_FEBLEND_MODE_OVERLAY`,7,`SVG_FEBLEND_MODE_COLOR_DODGE`,8,`SVG_FEBLEND_MODE_COLOR_BURN`,9,`SVG_FEBLEND_MODE_HARD_LIGHT`,10,`SVG_FEBLEND_MODE_SOFT_LIGHT`,11,`SVG_FEBLEND_MODE_DIFFERENCE`,12,`SVG_FEBLEND_MODE_EXCLUSION`,13,`SVG_FEBLEND_MODE_HUE`,14,`SVG_FEBLEND_MODE_SATURATION`,15,`SVG_FEBLEND_MODE_COLOR`,16,`SVG_FEBLEND_MODE_LUMINOSITY`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEBlendElement`,`Pn!n"n#4$9n%4&9n'4(9.)4*9.+4,9.-4.9./409.1429.3449.5469.7489.94:9.;4<9.=4>9.?4@9.A4B9.C4D9.E4F9.G4H9.I4J9P"2KPnL2MnN"f2O"/P2QP)nRJ2S8$1TP&2KnU2QP)nVJ2S8$1TP"2KPnW2MnX"f2O"/P2QP)nYJ2S8$1ZP&2Kn[2QP)n\\J2S8$1ZMw]y`],th=[()=>G,()=>Mv,()=>Dv,`in1`,()=>Av,`type`,()=>Nv,`values`,0,`SVG_FECOLORMATRIX_TYPE_UNKNOWN`,1,`SVG_FECOLORMATRIX_TYPE_MATRIX`,2,`SVG_FECOLORMATRIX_TYPE_SATURATE`,3,`SVG_FECOLORMATRIX_TYPE_HUEROTATE`,4,`SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEColorMatrixElement`,`Pn!n"n#4$9n%4&9n'4(9.)4*9.+4,9.-4.9./409.1429P"2&Pn324n5"f26"/728P)n9J2:8$1;P&2&n<28P)n=J2:8$1;P"2&Pn>24n?"f26"/728P)n@J2:8$1AP&2&nB28P)nCJ2:8$1AMwDy`],nh=[()=>G,()=>Mv,()=>Dv,`in1`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEComponentTransferElement`,`Pn!n"n#4$9P"2%Pn&2'n("f2)"/*2+P)n,J2-8$1.P&2%n/2+P)n0J2-8$1.P"2%Pn12'n2"f2)"/*2+P)n3J2-8$14P&2%n52+P)n6J2-8$14Mw7y`],rh=[()=>G,()=>Mv,()=>Dv,`in1`,()=>Dv,`in2`,()=>$,`k1`,()=>$,`k2`,()=>$,`k3`,()=>$,`k4`,()=>Av,`operator`,0,`SVG_FECOMPOSITE_OPERATOR_UNKNOWN`,1,`SVG_FECOMPOSITE_OPERATOR_OVER`,2,`SVG_FECOMPOSITE_OPERATOR_IN`,3,`SVG_FECOMPOSITE_OPERATOR_OUT`,4,`SVG_FECOMPOSITE_OPERATOR_ATOP`,5,`SVG_FECOMPOSITE_OPERATOR_XOR`,6,`SVG_FECOMPOSITE_OPERATOR_ARITHMETIC`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFECompositeElement`,`Pn!n"n#4$9n%4&9n'4(9n)4*9n+4,9n-4.9n/409.1429.3449.5469.7489.94:9.;4<9.=4>9P"2?Pn@2AnB"f2C"/D2EP)nFJ2G8$1HP&2?nI2EP)nJJ2G8$1HP"2?PnK2AnL"f2C"/D2EP)nMJ2G8$1NP&2?nO2EP)nPJ2G8$1NMwQy`],ih=[()=>G,()=>Mv,()=>$,`bias`,()=>$,`divisor`,()=>Av,`edgeMode`,()=>Dv,`in1`,()=>Nv,`kernelMatrix`,()=>$,`kernelUnitLengthX`,()=>$,`kernelUnitLengthY`,()=>Pv,`orderX`,()=>Pv,`orderY`,()=>Fv,`preserveAlpha`,()=>Pv,`targetX`,()=>Pv,`targetY`,0,`SVG_EDGEMODE_UNKNOWN`,1,`SVG_EDGEMODE_DUPLICATE`,2,`SVG_EDGEMODE_WRAP`,3,`SVG_EDGEMODE_NONE`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEConvolveMatrixElement`,`Pn!n"n#4$9n%4&9n'4(9n)4*9n+4,9n-4.9n/409n1429n3449n5469n7489n94:9.;4<9.=4>9.?4@9.A4B9P"2CPnD2EnF"f2G"/H2IP)nJJ2K8$1LP&2CnM2IP)nNJ2K8$1LP"2CPnO2EnP"f2G"/H2IP)nQJ2K8$1RP&2CnS2IP)nTJ2K8$1RMwUy`],ah=[()=>G,()=>Mv,()=>$,`diffuseConstant`,()=>Dv,`in1`,()=>$,`kernelUnitLengthX`,()=>$,`kernelUnitLengthY`,()=>$,`surfaceScale`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEDiffuseLightingElement`,`Pn!n"n#4$9n%4&9n'4(9n)4*9n+4,9P"2-Pn.2/n0"f21"/223P)n4J258$16P&2-n723P)n8J258$16P"2-Pn92/n:"f21"/223P)n;J258$1<P&2-n=23P)n>J258$1<Mw?y`],oh=[()=>G,()=>Mv,()=>Dv,`in1`,()=>Dv,`in2`,()=>$,`scale`,()=>Av,`xChannelSelector`,()=>Av,`yChannelSelector`,0,`SVG_CHANNEL_UNKNOWN`,1,`SVG_CHANNEL_R`,2,`SVG_CHANNEL_G`,3,`SVG_CHANNEL_B`,4,`SVG_CHANNEL_A`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEDisplacementMapElement`,`Pn!n"n#4$9n%4&9n'4(9n)4*9n+4,9.-4.9./409.1429.3449.5469P"27Pn829n:"f2;"/<2=P)n>J2?8$1@P&27nA2=P)nBJ2?8$1@P"27PnC29nD"f2;"/<2=P)nEJ2?8$1FP&27nG2=P)nHJ2?8$1FMwIy`],sh=[()=>G,()=>$,`azimuth`,()=>$,`elevation`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEDistantLightElement`,`Pn!n"4#9n$4%9P"2&Pn'2(n)"f2*"/+2,P)n-J2.8$1/P&2&n02,P)n1J2.8$1/P"2&Pn22(n3"f2*"/+2,P)n4J2.8$15P&2&n62,P)n7J2.8$15Mw8y`],ch=[()=>G,()=>Mv,()=>$,`dx`,()=>$,`dy`,()=>Dv,`in1`,()=>$,`stdDeviationX`,()=>$,`stdDeviationY`,`setStdDeviation`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEDropShadowElement`,`Pn!n"n#4$9n%4&9n'4(9n)4*9n+4,9P'2*'2,$1-P"2.Pn/20n1"f22"/324P)n5J268$17P&2.n824P)n9J268$17P"2.Pn:20n;"f22"/324P)n<J268$1=P&2.n>24P)n?J268$1=Mw@y`],lh=[()=>G,()=>Mv,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEFloodElement`,`Pn!n"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],uh=[()=>Iv,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEFuncAElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],dh=[()=>Iv,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEFuncBElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],fh=[()=>Iv,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEFuncGElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],ph=[()=>Iv,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEFuncRElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],mh=[()=>G,()=>Mv,()=>Dv,`in1`,()=>$,`stdDeviationX`,()=>$,`stdDeviationY`,`setStdDeviation`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEGaussianBlurElement`,`Pn!n"n#4$9n%4&9n'4(9P'2&'2($1)P"2*Pn+2,n-"f2."//20P)n1J228$13P&2*n420P)n5J228$13P"2*Pn62,n7"f2."//20P)n8J228$19P&2*n:20P)n;J228$19Mw<y`],hh=[()=>G,()=>Mv,()=>Ev,()=>Lv,`preserveAspectRatio`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEImageElement`,`Pn!n"n#n$4%9P"2&Pn'2(n)"f2*"/+2,P)n-J2.8$1/P&2&n02,P)n1J2.8$1/P"2&Pn22(n3"f2*"/+2,P)n4J2.8$15P&2&n62,P)n7J2.8$15Mw8y`],gh=[()=>G,()=>Mv,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEMergeElement`,`Pn!n"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],_h=[()=>G,()=>Dv,`in1`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEMergeNodeElement`,`Pn!n"4#9P"2$Pn%2&n'"f2("/)2*P)n+J2,8$1-P&2$n.2*P)n/J2,8$1-P"2$Pn02&n1"f2("/)2*P)n2J2,8$13P&2$n42*P)n5J2,8$13Mw6y`],vh=[()=>G,()=>Mv,()=>Dv,`in1`,()=>Av,`operator`,()=>$,`radiusX`,()=>$,`radiusY`,0,`SVG_MORPHOLOGY_OPERATOR_UNKNOWN`,1,`SVG_MORPHOLOGY_OPERATOR_ERODE`,2,`SVG_MORPHOLOGY_OPERATOR_DILATE`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEMorphologyElement`,`Pn!n"n#4$9n%4&9n'4(9n)4*9.+4,9.-4.9./409P"21Pn223n4"f25"/627P)n8J298$1:P&21n;27P)n<J298$1:P"21Pn=23n>"f25"/627P)n?J298$1@P&21nA27P)nBJ298$1@MwCy`],yh=[()=>G,()=>Mv,()=>$,`dx`,()=>$,`dy`,()=>Dv,`in1`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEOffsetElement`,`Pn!n"n#4$9n%4&9n'4(9P"2)Pn*2+n,"f2-"/.2/P)n0J218$12P&2)n32/P)n4J218$12P"2)Pn52+n6"f2-"/.2/P)n7J218$18P&2)n92/P)n:J218$18Mw;y`],bh=[()=>G,()=>$,`x`,()=>$,`y`,()=>$,`z`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFEPointLightElement`,`Pn!n"4#9n$4%9n&4'9P"2(Pn)2*n+"f2,"/-2.P)n/J208$11P&2(n22.P)n3J208$11P"2(Pn42*n5"f2,"/-2.P)n6J208$17P&2(n82.P)n9J208$17Mw:y`],xh=[()=>G,()=>Mv,()=>Dv,`in1`,()=>$,`kernelUnitLengthX`,()=>$,`kernelUnitLengthY`,()=>$,`specularConstant`,()=>$,`specularExponent`,()=>$,`surfaceScale`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFESpecularLightingElement`,`Pn!n"n#4$9n%4&9n'4(9n)4*9n+4,9n-4.9P"2/Pn021n2"f23"/425P)n6J278$18P&2/n925P)n:J278$18P"2/Pn;21n<"f23"/425P)n=J278$1>P&2/n?25P)n@J278$1>MwAy`],Sh=[()=>G,()=>$,`limitingConeAngle`,()=>$,`pointsAtX`,()=>$,`pointsAtY`,()=>$,`pointsAtZ`,()=>$,`specularExponent`,()=>$,`x`,()=>$,`y`,()=>$,`z`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFESpotLightElement`,`Pn!n"4#9n$4%9n&4'9n(4)9n*4+9n,4-9n.4/9n0419P"22Pn324n5"f26"/728P)n9J2:8$1;P&22n<28P)n=J2:8$1;P"22Pn>24n?"f26"/728P)n@J2:8$1AP&22nB28P)nCJ2:8$1AMwDy`],Ch=[()=>G,()=>Mv,()=>Dv,`in1`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFETileElement`,`Pn!n"n#4$9P"2%Pn&2'n("f2)"/*2+P)n,J2-8$1.P&2%n/2+P)n0J2-8$1.P"2%Pn12'n2"f2)"/*2+P)n3J2-8$14P&2%n52+P)n6J2-8$14Mw7y`],wh=[()=>G,()=>Mv,()=>$,`baseFrequencyX`,()=>$,`baseFrequencyY`,()=>Pv,`numOctaves`,()=>$,`seed`,()=>Av,`stitchTiles`,()=>Av,`type`,0,`SVG_TURBULENCE_TYPE_UNKNOWN`,1,`SVG_TURBULENCE_TYPE_FRACTALNOISE`,2,`SVG_TURBULENCE_TYPE_TURBULENCE`,0,`SVG_STITCHTYPE_UNKNOWN`,1,`SVG_STITCHTYPE_STITCH`,2,`SVG_STITCHTYPE_NOSTITCH`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFETurbulenceElement`,`Pn!n"n#4$9n%4&9n'4(9n)4*9n+4,9n-4.9./409.1429.3449.5469.7489.94:9P"2.Pn;2<n="f2>"/?2@P)nAJ2B8$1CP&2.nD2@P)nEJ2B8$1CP"2.PnF2<nG"f2>"/?2@P)nHJ2B8$1IP&2.nJ2@P)nKJ2B8$1IMwLy`],Th=[()=>G,()=>Ev,()=>Av,`filterUnits`,()=>Q,`height`,()=>Av,`primitiveUnits`,()=>Q,`width`,()=>Q,`x`,()=>Q,`y`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGFilterElement`,`Pn!n"n#4$9n%4&9n'4(9n)4*9n+4,9n-4.9P"2/Pn021n2"f23"/425P)n6J278$18P&2/n925P)n:J278$18P"2/Pn;21n<"f23"/425P)n=J278$1>P&2/n?25P)n@J278$1>MwAy`],Eh=[()=>b_,()=>Q,`height`,()=>Q,`width`,()=>Q,`x`,()=>Q,`y`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGForeignObjectElement`,`Pn!n"4#9n$4%9n&4'9n(4)9P"2*Pn+2,n-"f2."//20P)n1J228$13P&2*n420P)n5J228$13P"2*Pn62,n7"f2."//20P)n8J228$19P&2*n:20P)n;J228$19Mw<y`],Dh=[()=>b_,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGGElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],Oh=[()=>b_,()=>Ev,`crossOrigin`,()=>Q,`height`,()=>Lv,`preserveAspectRatio`,()=>Q,`width`,()=>Q,`x`,()=>Q,`y`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGImageElement`,`Pn!n"P&,J4#n$4%9n&4'9n(4)9n*4+9n,4-9P"2.Pn/20n1"f22"/324P)n5J268$17P&2.n824P)n9J268$17P"2.Pn:20n;"f22"/324P)n<J268$1=P&2.n>24P)n?J268$1=Mw@y`],kh=[()=>kv,()=>Q,`x1`,()=>Q,`x2`,()=>Q,`y1`,()=>Q,`y2`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGLineElement`,`Pn!n"4#9n$4%9n&4'9n(4)9P"2*Pn+2,n-"f2."//20P)n1J228$13P&2*n420P)n5J228$13P"2*Pn62,n7"f2."//20P)n8J228$19P&2*n:20P)n;J228$19Mw<y`],Ah=[()=>Rv,()=>Q,`x1`,()=>Q,`x2`,()=>Q,`y1`,()=>Q,`y2`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGLinearGradientElement`,`Pn!n"4#9n$4%9n&4'9n(4)9P"2*Pn+2,n-"f2."//20P)n1J228$13P&2*n420P)n5J228$13P"2*Pn62,n7"f2."//20P)n8J228$19P&2*n:20P)n;J228$19Mw<y`],jh=[()=>G,()=>x_,()=>Q,`markerHeight`,()=>Av,`markerUnits`,()=>Q,`markerWidth`,()=>zv,`orientAngle`,()=>Av,`orientType`,()=>Q,`refX`,()=>Q,`refY`,()=>w_,`angle`,`setOrientToAngle`,`setOrientToAuto`,0,`SVG_MARKERUNITS_UNKNOWN`,1,`SVG_MARKERUNITS_USERSPACEONUSE`,2,`SVG_MARKERUNITS_STROKEWIDTH`,0,`SVG_MARKER_ORIENT_UNKNOWN`,1,`SVG_MARKER_ORIENT_AUTO`,2,`SVG_MARKER_ORIENT_ANGLE`,3,`SVG_MARKER_ORIENT_AUTO_START_REVERSE`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGMarkerElement`,`Pn!n"n#4$9n%4&9n'4(9n)4*9n+4,9n-4.9n/409Pn122$13P$14.5469.7489.94:9.;4<9.=4>9.?4@9.A4B9P"2CPnD2EnF"f2G"/H2IP)nJJ2K8$1LP&2CnM2IP)nNJ2K8$1LP"2CPnO2EnP"f2G"/H2IP)nQJ2K8$1RP&2CnS2IP)nTJ2K8$1RMwUy`],Mh=[()=>G,()=>Q,`height`,()=>Av,`maskContentUnits`,()=>Av,`maskUnits`,()=>Q,`width`,()=>Q,`x`,()=>Q,`y`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGMaskElement`,`Pn!n"4#9n$4%9n&4'9n(4)9n*4+9n,4-9P"2.Pn/20n1"f22"/324P)n5J268$17P&2.n824P)n9J268$17P"2.Pn:20n;"f22"/324P)n<J268$1=P&2.n>24P)n?J268$1=Mw@y`],Nh=[()=>G,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGMetadataElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],Ph=[()=>G,()=>Ev,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGMPathElement`,`Pn!n"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],Fh=[()=>kv,()=>$,`pathLength`,`distance`,()=>D_,`getPointAtLength`,`getTotalLength`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGPathElement`,`Pn!n"4#9P'2$n%1&P'1'P"2(Pn)2*n+"f2,"/-2.P)n/J208$11P&2(n22.P)n3J208$11P"2(Pn42*n5"f2,"/-2.P)n6J208$17P&2(n82.P)n9J208$17Mw:y`],Ih=[()=>G,()=>x_,()=>Ev,()=>Q,`height`,()=>Av,`patternContentUnits`,()=>jv,`patternTransform`,()=>Av,`patternUnits`,()=>Q,`width`,()=>Q,`x`,()=>Q,`y`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGPatternElement`,`Pn!n"n#n$4%9n&4'9n(4)9n*4+9n,4-9n.4/9n0419P"22Pn324n5"f26"/728P)n9J2:8$1;P&22n<28P)n=J2:8$1;P"22Pn>24n?"f26"/728P)n@J2:8$1AP&22nB28P)nCJ2:8$1AMwDy`],Lh=[()=>kv,()=>Bv,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGPolygonElement`,`Pn!n"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],Rh=[()=>kv,()=>Bv,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGPolylineElement`,`Pn!n"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],zh=[()=>Rv,()=>Q,`cx`,()=>Q,`cy`,()=>Q,`fr`,()=>Q,`fx`,()=>Q,`fy`,()=>Q,`r`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGRadialGradientElement`,`Pn!n"4#9n$4%9n&4'9n(4)9n*4+9n,4-9P"2.Pn/20n1"f22"/324P)n5J268$17P&2.n824P)n9J268$17P"2.Pn:20n;"f22"/324P)n<J268$1=P&2.n>24P)n?J268$1=Mw@y`],Bh=[()=>kv,()=>Q,`height`,()=>Q,`rx`,()=>Q,`ry`,()=>Q,`width`,()=>Q,`x`,()=>Q,`y`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGRectElement`,`Pn!n"4#9n$4%9n&4'9n(4)9n*4+9n,4-9P"2.Pn/20n1"f22"/324P)n5J268$17P&2.n824P)n9J268$17P"2.Pn:20n;"f22"/324P)n<J268$1=P&2.n>24P)n?J268$1=Mw@y`],Vh=[()=>G,()=>Ev,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGScriptElement`,`Pn!n"&4#P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],Hh=[()=>Ov,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGSetElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],Uh=[()=>G,()=>$,`offset`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGStopElement`,`Pn!n"4#9P"2$Pn%2&n'"f2("/)2*P)n+J2,8$1-P&2$n.2*P)n/J2,8$1-P"2$Pn02&n1"f2("/)2*P)n2J2,8$13P&2$n42*P)n5J2,8$13Mw6y`],Wh=[()=>G,()=>lv,`disabled`,`media`,`title`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGStyleElement`,`Pn!n")4#&4$&4%&4&P"2&Pn'2(n)"f2*"/+2,P)n-J2.8$1/P&2&n02,P)n1J2.8$1/P"2&Pn22(n3"f2*"/+2,P)n4J2.8$15P&2&n62,P)n7J2.8$15Mw8y`],Gh=[()=>b_,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGSwitchElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],Kh=[()=>G,()=>x_,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGSymbolElement`,`Pn!n"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],qh=[()=>Vv,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGTextElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],Jh=[()=>Hv,()=>Ev,()=>Av,`method`,()=>Av,`spacing`,()=>Q,`startOffset`,0,`TEXTPATH_METHODTYPE_UNKNOWN`,1,`TEXTPATH_METHODTYPE_ALIGN`,2,`TEXTPATH_METHODTYPE_STRETCH`,0,`TEXTPATH_SPACINGTYPE_UNKNOWN`,1,`TEXTPATH_SPACINGTYPE_AUTO`,2,`TEXTPATH_SPACINGTYPE_EXACT`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGTextPathElement`,`Pn!n"n#4$9n%4&9n'4(9.)4*9.+4,9.-4.9./409.1429.3449P"25Pn627n8"f29"/:2;P)n<J2=8$1>P&25n?2;P)n@J2=8$1>P"25PnA27nB"f29"/:2;P)nCJ2=8$1DP&25nE2;P)nFJ2=8$1DMwGy`],Yh=[()=>G,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGTitleElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],Xh=[()=>Vv,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGTSpanElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],Zh=[()=>b_,()=>Ev,()=>Q,`height`,()=>Q,`width`,()=>Q,`x`,()=>Q,`y`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGUseElement`,`Pn!n"n#4$9n%4&9n'4(9n)4*9P"2+Pn,2-n."f2/"/021P)n2J238$14P&2+n521P)n6J238$14P"2+Pn72-n8"f2/"/021P)n9J238$1:P&2+n;21P)n<J238$1:Mw=y`],Qh=[()=>G,()=>x_,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGViewElement`,`Pn!n"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],$h=[`toString`,`CSSStyleValue`,`PP&1!Mw"y`],eg=[`bottom`,`height`,`left`,`right`,`top`,`width`,`x`,`y`,`toJSON`,`DOMRectReadOnly`,`P'4!9'4"9'4#9'4$9'4%9'4&9'4'9'4(9P"1)Mw*y`],tg=[`length`,`index`,()=>V,`item`,()=>V,`HTMLCollectionBase`,`P'4!9P'2"Pn#,J1$'n%LMw&y`],ng=[()=>I,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLUnknownElement`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],rg=[()=>I,`compact`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLDirectoryElement`,`Pn!)4"P"2#Pn$2%n&"f2'"/(2)P)n*J2+8$1,P&2#n-2)P)n.J2+8$1,P"2#Pn/2%n0"f2'"/(2)P)n1J2+8$12P&2#n32)P)n4J2+8$12Mw5y`],ig=[()=>I,`color`,`face`,`size`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLFontElement`,`Pn!&4"&4#&4$P"2%Pn&2'n("f2)"/*2+P)n,J2-8$1.P&2%n/2+P)n0J2-8$1.P"2%Pn12'n2"f2)"/*2+P)n3J2-8$14P&2%n52+P)n6J2-8$14Mw7y`],ag=[()=>I,()=>hl,`contentDocument`,()=>vf,`contentWindow`,`frameBorder`,`longDesc`,`marginHeight`,`marginWidth`,`name`,`noResize`,`scrolling`,`src`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLFrameElement`,`Pn!Pn",J4#9Pn$,J4%9&4&&4'&4(&4)&4*)4+&4,&4-P"2.Pn/20n1"f22"/324P)n5J268$17P&2.n824P)n9J268$17P"2.Pn:20n;"f22"/324P)n<J268$1=P&2.n>24P)n?J268$1=Mw@y`],og=[()=>I,()=>S_,`cols`,`rows`,`type`,0,`this`,()=>Uv,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Uv,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLFrameSetElement`,`Pn!n"&4#&4$P"2%Pn&2'n("f2)"/*2+P)n,J2-8$1.P&2%n/2+P)n0J2-8$1.P"2%Pn12'n2"f2)"/*2+P)n3J2-8$14P&2%n52+P)n6J2-8$14Mw7y`],sg=[()=>I,`behavior`,`bgColor`,`direction`,`height`,`hspace`,`loop`,`scrollAmount`,`scrollDelay`,`trueSpeed`,`vspace`,`width`,`start`,`stop`,`type`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLMarqueeElement`,`Pn!&4"&4#&4$&4%'4&'4''4('4))4*'4+&4,P$1-P$1.P"2/Pn021n2"f23"/425P)n6J278$18P&2/n925P)n:J278$18P"2/Pn;21n<"f23"/425P)n=J278$1>P&2/n?25P)n@J278$1>MwAy`],cg=[()=>I,`name`,`type`,`value`,`valueType`,0,`this`,()=>L,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>L,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLParamElement`,`Pn!&4"&4#&4$&4%P"2#Pn&2'n("f2)"/*2+P)n,J2-8$1.P&2#n/2+P)n0J2-8$1.P"2#Pn12'n2"f2)"/*2+P)n3J2-8$14P&2#n52+P)n6J2-8$14Mw7y`],Z=[()=>nl,()=>rl,`SVGElementEventMap`,`Pn!n"Mw#y`],lg=[()=>nl,()=>rl,`MathMLElementEventMap`,`Pn!n"Mw#y`],ug=[`auto`,`hide`,`show`,`FullscreenNavigationUI`,`P.!.".#Jw$y`],dg=[()=>Wv,`behavior`,`ScrollOptions`,`Pn!4"8Mw#y`],fg=[`center`,`end`,`nearest`,`start`,`ScrollLogicalPosition`,`P.!.".#.$Jw%y`],pg=[()=>H,()=>Gv,()=>_c,()=>S_,()=>Kv,()=>qv,()=>Jv,()=>Yv,`clientInformation`,`closed`,()=>Xv,`cookieStore`,()=>ml,`customElements`,`devicePixelRatio`,()=>hl,`document`,()=>U,`event`,()=>Zv,`external`,()=>V,`frameElement`,()=>vf,`frames`,()=>Qv,`history`,`innerHeight`,`innerWidth`,`length`,()=>$v,`locationbar`,()=>$v,`menubar`,`name`,()=>ey,`navigation`,()=>Yv,`navigator`,0,`this`,()=>qf,`ev`,``,`ondevicemotion`,0,()=>Jf,`ondeviceorientation`,0,()=>Jf,`ondeviceorientationabsolute`,0,()=>U,`onorientationchange`,`opener`,`orientation`,`originAgentCluster`,`outerHeight`,`outerWidth`,`pageXOffset`,`pageYOffset`,()=>vf,`parent`,()=>$v,`personalbar`,()=>ty,`screen`,`screenLeft`,`screenTop`,`screenX`,`screenY`,`scrollX`,`scrollY`,()=>$v,`scrollbars`,0,()=>globalThis,`self`,()=>ny,`speechSynthesis`,`status`,()=>$v,`statusbar`,()=>$v,`toolbar`,()=>vf,`top`,()=>ry,`visualViewport`,0,()=>globalThis,`window`,`message`,`alert`,`blur`,`handle`,`cancelIdleCallback`,`captureEvents`,`close`,`confirm`,`focus`,()=>V,`elt`,`pseudoElt`,()=>iy,`getComputedStyle`,()=>Lp,`getSelection`,`query`,()=>ay,`matchMedia`,`x`,`y`,`moveBy`,`moveTo`,()=>zp,`url`,`target`,`features`,()=>vf,`open`,`targetOrigin`,()=>oy,`transfer`,`postMessage`,()=>sy,`options`,`print`,`_default`,`prompt`,`releaseEvents`,()=>cy,`callback`,()=>ly,`requestIdleCallback`,`resizeBy`,`width`,`height`,`resizeTo`,()=>Nl,`scroll`,()=>Nl,`scrollBy`,()=>Nl,`scrollTo`,`stop`,`type`,0,()=>uy,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>uy,()=>B,`removeEventListener`,()=>z,()=>B,0,`Window`,`Pn!n"n#n$n%n&n'n(4)9)4*9n+4,9n-4.9'4/9n0419Pn2-J439n4459Pn6,J479n8499n:4;9'4<9'4=9'4>9!!n?4@9nA4B9&4CnD4E9nF4G9PPnH2InJ2K"/L,J4MPPnN2InO2K"/L,J4PPPnQ2InR2K"/L,J4SPPnT2InU2K"/L,J4V"4W'4X9)4Y9'4Z9'4[9'4\\9'4]9n^4_9n\`4a9nb4c9'4d9'4e9'4f9'4g9'4h9'4i9nj4k9PnlimK4n9no4p9&4qnr4s9nt4u9Pnv,J4w9Pnx,J4y9Pnzi{K4|9P"2}8$1~P$1P'2$1P$1P$1P&2}8)1P$1
Pn2P&,J28n1PPn,J1P&2n1P'2'2$1P'2'2$1PP&nJ28&28&28Pn,J1P"2}&2nF28$1P"2}n28$1P$1\xA0P&2}8&2¡8P&,J1¢P$1£Pn¤2¥n¦28'1§P'2'2$1¨P'2©'2ª$1«Pn¬28$1P'2'2$1Pn®28$1¯P'2'2$1¯Pn°28$1±P'2'2$1±P$1²P"2³Pn´2Inµ"f2K"/L2¶P)n·J28$1¸P&2³n¹2¶P)nºJ28$1¸P"2³Pn»2In¼"f2K"/L2¶P)n½J28$1¾P&2³n¿2¶P)nÀJ28$1¾'nÁLMwÂy`],mg=[`none`,`copy`,`link`,`move`,`dropEffect`,`none`,`copy`,`copyLink`,`copyMove`,`link`,`linkMove`,`move`,`all`,`uninitialized`,`effectAllowed`,()=>vv,`files`,()=>dy,`items`,()=>$d,`types`,`format`,`clearData`,`getData`,`data`,`setData`,()=>V,`image`,`x`,`y`,`setDragImage`,`DataTransfer`,`PP.!.".#.$J4%P.&.'.(.).*.+.,.-..J4/n0419n2439&o4"459P&268$17P&26&18P&26&29$1:Pn;2<'2='2>$1?Mw@y`],hg=[()=>A_,`StaticRange`,`Pn!Mw"y`],gg=[()=>U,`event`,`source`,`lineno`,`colno`,()=>fy,`error`,``,`OnErrorEventHandlerNonNull`,`PPPn!&J2"&2#8'2$8'2%8n&2'8"v(Mw)y`],_g=[`enforce`,`report`,`SecurityPolicyViolationEventDisposition`,`P.!."Jw#y`],vg=[`length`,`index`,()=>py,`item`,()=>py,`TouchList`,`P'4!9P'2"Pn#,J1$'n%LMw&y`],yg=[``,`off`,`on`,`AutoFillBase`,`P.!.".#Jw$y`],bg=[()=>tg,`name`,()=>my,()=>V,`namedItem`,`HTMLFormControlsCollection`,`Pn!P&2"Pn#n$,J1%Mw&y`],xg=[()=>ou,`FormDataEntryValue`,`Pn!&Jw"y`],Sg=[()=>hy,`aspectRatio`,()=>gy,`autoGainControl`,()=>gy,`backgroundBlur`,()=>_y,`channelCount`,()=>vy,`deviceId`,()=>vy,`displaySurface`,()=>yy,`echoCancellation`,()=>vy,`facingMode`,()=>hy,`frameRate`,()=>vy,`groupId`,()=>_y,`height`,()=>gy,`noiseSuppression`,()=>_y,`sampleRate`,()=>_y,`sampleSize`,()=>_y,`width`,`MediaTrackConstraintSet`,`Pn!4"8n#4$8n%4&8n'4(8n)4*8n+4,8n-4.8n/408n1428n3448n5468n7488n94:8n;4<8n=4>8Mw?y`],Cg=[`max`,`min`,`DoubleRange`,`P'4!8'4"8Mw#y`],wg=[`max`,`min`,`ULongRange`,`P'4!8'4"8Mw#y`],Tg=[()=>Cf,()=>Oh,`HTMLOrSVGImageElement`,`Pn!n"Jw#y`],Eg=[`codedHeight`,()=>eg,`codedRect`,`codedWidth`,()=>by,`colorSpace`,`displayHeight`,`displayWidth`,`duration`,()=>xy,`format`,`timestamp`,()=>eg,`visibleRect`,()=>Sy,`options`,`allocationSize`,0,`clone`,`close`,()=>jd,`destination`,()=>Sy,()=>Cy,`copyTo`,`VideoFrame`,`P'4!9Pn",J4#9'4$9n%4&9'4'9'4(9P',J4)9Pn*,J4+9'4,9Pn-,J4.9Pn/208'11Pn213P$14Pn526n7208n8F\`19Mw:y`],Dg=[`rgba-float16`,`rgba-unorm8`,`ImageDataPixelFormat`,`P.!."Jw#y`],Og=[`ImageDataArray`,`Vw!y`],kg=[`a`,`b`,`c`,`d`,`e`,`f`,`is2D`,`isIdentity`,`m11`,`m12`,`m13`,`m14`,`m21`,`m22`,`m23`,`m24`,`m31`,`m32`,`m33`,`m34`,`m41`,`m42`,`m43`,`m44`,()=>Pu,`flipX`,()=>Pu,`flipY`,()=>Pu,`inverse`,()=>Ag,`other`,()=>Pu,`multiply`,`rotX`,`rotY`,`rotZ`,()=>Pu,`rotate`,`x`,`y`,`z`,`angle`,()=>Pu,`rotateAxisAngle`,()=>Pu,`rotateFromVector`,`scaleX`,`scaleY`,`scaleZ`,`originX`,`originY`,`originZ`,()=>Pu,`scale`,()=>Pu,`scale3d`,()=>Pu,`scaleNonUniform`,`sx`,()=>Pu,`skewX`,`sy`,()=>Pu,`skewY`,`toFloat32Array`,`toFloat64Array`,`toJSON`,()=>Cu,`point`,()=>D_,`transformPoint`,`tx`,`ty`,`tz`,()=>Pu,`translate`,`toString`,`DOMMatrixReadOnly`,`P'4!9'4"9'4#9'4$9'4%9'4&9)4'9)4(9'4)9'4*9'4+9'4,9'4-9'4.9'4/9'409'419'429'439'449'459'469'479'489Pn91:Pn;1<Pn=1>Pn?2@8nA1BP'2C8'2D8'2E8nF1GP'2H8'2I8'2J8'2K8nL1MP'2H8'2I8nN1OP'2P8'2Q8'2R8'2S8'2T8'2U8nV1WP'2W8'2S8'2T8'2U8nX1YP'2P8'2Q8nZ1[P'2\\8n]1^P'2_8n\`1aP\\1bP]1cP"1dPne2f8ng1hP'2i8'2j8'2k8nl1mP&1nMwoy`],Ag=[()=>Fu,`is2D`,`m13`,`m14`,`m23`,`m24`,`m31`,`m32`,`m33`,`m34`,`m43`,`m44`,`DOMMatrixInit`,`Pn!)4"8'4#8'4$8'4%8'4&8'4'8'4(8'4)8'4*8'4+8'4,8Mw-y`],jg=[`WebGLVertexArrayObjectOES`,`PMw!y`],Mg=[`ArrayBuffer`,`ArrayBufferTypes`,`P_4!Mw"y`],Ng=[`opaque`,`premultiplied`,`GPUCanvasAlphaMode`,`P.!."Jw#y`],Pg=[()=>H,()=>Rg,()=>wy,`adapterInfo`,()=>Ty,`features`,()=>Ey,`limits`,()=>Dy,`lost`,0,`this`,()=>Xf,`ev`,``,`onuncapturederror`,()=>Oy,`queue`,()=>ky,`descriptor`,()=>Ay,`createBindGroup`,()=>jy,()=>My,`createBindGroupLayout`,()=>Ny,()=>Py,`createBuffer`,()=>Fy,()=>Iy,`createCommandEncoder`,()=>Ly,()=>Ry,`createComputePipeline`,()=>Ly,()=>Ry,`createComputePipelineAsync`,()=>zy,()=>By,`createPipelineLayout`,()=>Vy,()=>Hy,`createQuerySet`,()=>Uy,()=>Wy,`createRenderBundleEncoder`,()=>Gy,()=>Ky,`createRenderPipeline`,()=>Gy,()=>Ky,`createRenderPipelineAsync`,()=>qy,()=>Jy,`createSampler`,()=>Yy,()=>Xy,`createShaderModule`,()=>Zy,()=>Gd,`createTexture`,`destroy`,()=>Qy,()=>$y,`importExternalTexture`,()=>L_,`popErrorScope`,()=>eb,`filter`,`pushErrorScope`,`type`,0,()=>tb,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>tb,()=>B,`removeEventListener`,()=>z,()=>B,`GPUDevice`,'Pn!n"n#4$9n%4&9n\'4(9n)`4*9PPn+2,n-2."//,J40n1429Pn324n516Pn724n819Pn:24n;1<Pn=248n>1?Pn@24nA1BPnC24nD`1EPnF24nG1HPnI24nJ1KPnL24nM1NPnO24nP1QPnR24nS`1TPnU248nV1WPnX24nY1ZPn[24n\\1]P$1^Pn_24n`1aPPnb,J`1cPnd2e$1fP"2gPnh2,ni"f2."//2jP)nkJ2l8$1mP&2gnn2jP)noJ2l8$1mP"2gPnp2,nq"f2."//2jP)nrJ2l8$1sP&2gnt2jP)nuJ2l8$1sMwvy'],Fg=`astc-10x10-unorm astc-10x10-unorm-srgb astc-10x5-unorm astc-10x5-unorm-srgb astc-10x6-unorm astc-10x6-unorm-srgb astc-10x8-unorm astc-10x8-unorm-srgb astc-12x10-unorm astc-12x10-unorm-srgb astc-12x12-unorm astc-12x12-unorm-srgb astc-4x4-unorm astc-4x4-unorm-srgb astc-5x4-unorm astc-5x4-unorm-srgb astc-5x5-unorm astc-5x5-unorm-srgb astc-6x5-unorm astc-6x5-unorm-srgb astc-6x6-unorm astc-6x6-unorm-srgb astc-8x5-unorm astc-8x5-unorm-srgb astc-8x6-unorm astc-8x6-unorm-srgb astc-8x8-unorm astc-8x8-unorm-srgb bc1-rgba-unorm bc1-rgba-unorm-srgb bc2-rgba-unorm bc2-rgba-unorm-srgb bc3-rgba-unorm bc3-rgba-unorm-srgb bc4-r-snorm bc4-r-unorm bc5-rg-snorm bc5-rg-unorm bc6h-rgb-float bc6h-rgb-ufloat bc7-rgba-unorm bc7-rgba-unorm-srgb bgra8unorm bgra8unorm-srgb depth16unorm depth24plus depth24plus-stencil8 depth32float depth32float-stencil8 eac-r11snorm eac-r11unorm eac-rg11snorm eac-rg11unorm etc2-rgb8a1unorm etc2-rgb8a1unorm-srgb etc2-rgb8unorm etc2-rgb8unorm-srgb etc2-rgba8unorm etc2-rgba8unorm-srgb r16float r16sint r16snorm r16uint r16unorm r32float r32sint r32uint r8sint r8snorm r8uint r8unorm rg11b10ufloat rg16float rg16sint rg16snorm rg16uint rg16unorm rg32float rg32sint rg32uint rg8sint rg8snorm rg8uint rg8unorm rgb10a2uint rgb10a2unorm rgb9e5ufloat rgba16float rgba16sint rgba16snorm rgba16uint rgba16unorm rgba32float rgba32sint rgba32uint rgba8sint rgba8snorm rgba8uint rgba8unorm rgba8unorm-srgb stencil8 GPUTextureFormat P.!.".#.$.%.&.'.(.).*.+.,.-.../.0.1.2.3.4.5.6.7.8.9.:.;.<.=.>.?.@.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.[.\\.].^._.\`.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.{.|.}.~.......
Jwy`.split(` `),Ig=[()=>nb,`mode`,`GPUCanvasToneMapping`,`Pn!4"8Mw#y`],Lg=[`GPUTextureUsageFlags`,`'w!y`],Rg=[`label`,`GPUObjectBase`,`P&4!Mw"y`],zg=[`GPUIntegerCoordinateOut`,`'w!y`],Bg=[`1d`,`2d`,`3d`,`GPUTextureDimension`,`P.!.".#Jw$y`],Vg=[`GPUSize32Out`,`'w!y`],Hg=[`GPUFlagsConstant`,`'w!y`],Ug=[()=>rb,()=>ib,`arrayLayerCount`,()=>ab,`aspect`,()=>ib,`baseArrayLayer`,()=>ib,`baseMipLevel`,()=>ob,`dimension`,()=>Fg,`format`,()=>ib,`mipLevelCount`,()=>Lg,`usage`,`GPUTextureViewDescriptor`,`Pn!n"4#8n$4%8n&4'8n(4)8n*4+8n,4-8n.4/8n0418Mw2y`],Wg=[()=>Rg,`GPUTextureView`,`Pn!Mw"y`],Gg=[()=>sb,`view`,()=>cb,`options`,()=>lb,`read`,`releaseLock`,`ReadableStreamBYOBReader`,`Pn!P"2"n#2$8"o%"\`1&P$1'Mw(y`],Kg=[`R`,()=>sb,()=>lb,`read`,`releaseLock`,`ReadableStreamDefaultReader`,'"c!Pn"Pe#!o#"`1$P$1%Mw&y'],qg=[()=>ub,`mode`,`ReadableStreamGetReaderOptions`,`Pn!4"8Mw#y`],Jg=[`T`,()=>Kg,()=>Gg,`ReadableStreamReader`,`b!Pe"!o""n#Jw$y`],Yg=[`R`,`W`,()=>Kd,`readable`,()=>Zg,`writable`,`ReadableWritablePair`,`"c!"c"Pe"!o#"4$e""o%"4&Mw'y`],Xg=[`preventAbort`,`preventCancel`,`preventClose`,()=>il,`signal`,`StreamPipeOptions`,`P)4!8)4"8)4#8n$4%8Mw&y`],Zg=[`W`,`locked`,`reason`,`abort`,`close`,()=>db,`getWriter`,`WritableStream`,'"c!P)4"9P"2#8$`1$P$`1%Pe#!o&"1\'Mw(y'],Qg=[`T`,`length`,`separator`,`join`,`start`,`end`,`slice`,`ConcatArray`,`b!P'4"9'e"!LP&2#8&1$P'2%8'2&8e#!F1'Mw(y`],$g=[`accumulate`,`add`,`auto`,`replace`,`CompositeOperationOrAuto`,`P.!.".#.$Jw%y`],e_=[()=>fb,()=>pb,`composite`,()=>mb,`iterationComposite`,`pseudoElement`,`KeyframeEffectOptions`,`Pn!n"4#8n$4%8P&,J4&8Mw'y`],t_=[()=>n_,`offset`,`rangeName`,`TimelineRangeOffset`,`Pn!4"8P&,J4#8Mw$y`],n_=[()=>$h,()=>a_,`values`,0,`add`,()=>a_,0,`div`,()=>a_,`value`,`equals`,()=>a_,0,`max`,()=>a_,0,`min`,()=>a_,0,`mul`,()=>a_,0,`sub`,`unit`,()=>hb,`to`,`units`,()=>gb,`toSum`,()=>_b,`type`,`CSSNumericValue`,`Pn!Pn"@2#n$1%Pn&@2#n'1(Pn)@2*)1+Pn,@2#n-1.Pn/@2#n011Pn2@2#n314Pn5@2#n617P&28n91:P&@2;n<1=Pn>1?Mw@y`],r_=[()=>$h,`value`,`CSSKeywordValue`,`Pn!&4"Mw#y`],i_=[()=>a_,`currentTime`,()=>a_,`duration`,`AnimationTimeline`,`PPn!,J4"9Pn#,J4$9Mw%y`],a_=[()=>n_,`CSSNumberish`,`P'n!Jw"y`],o_=[()=>vb,`getComputedTiming`,()=>fb,`getTiming`,()=>yb,`timing`,`updateTiming`,`AnimationEffect`,`PPn!1"Pn#1$Pn%2&8$1'Mw(y`],s_=[`finished`,`idle`,`paused`,`running`,`AnimationPlayState`,`P.!.".#.$Jw%y`],c_=[`active`,`persisted`,`removed`,`AnimationReplaceState`,`P.!.".#Jw$y`],l_=[()=>Rf,`cancel`,()=>Rf,`finish`,()=>Rf,`remove`,`AnimationEventMap`,`Pn!4"n#4$n%4&Mw'y`],u_=[`flatten`,`AssignedNodesOptions`,`P)4!8Mw"y`],d_=[()=>bb,()=>xb,`cssRules`,()=>Sb,`ownerRule`,()=>xb,`rules`,`selector`,`style`,`index`,`addRule`,`deleteRule`,`rule`,`insertRule`,`removeRule`,`text`,0,`replace`,`replaceSync`,`CSSStyleSheet`,`Pn!n"4#9Pn$,J4%9n&4'9P&2(8&2)8'2*8'1+P'2*$1,P&2-'2*8'1.P'2*8$1/P&20n1\`12P&20$13Mw4y`],f_=[`length`,`index`,()=>d_,`item`,()=>d_,`StyleSheetList`,`P'4!9P'2"Pn#,J1$'n%LMw&y`],p_=[()=>H,0,`this`,()=>Yf,`ev`,``,`onloading`,0,()=>Yf,`onloadingdone`,0,()=>Yf,`onloadingerror`,0,`ready`,()=>Cb,`status`,`font`,`text`,`check`,()=>I_,`load`,()=>I_,`value`,()=>I_,`key`,0,`parent`,`callbackfn`,`thisArg`,`forEach`,`type`,0,()=>wb,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>wb,()=>B,`removeEventListener`,()=>z,()=>B,`FontFaceSet`,'Pn!PPn"2#n$2%"/&,J4\'PPn(2#n)2%"/&,J4*PPn+2#n,2%"/&,J4-n.`4/9n0419P&22&238)14P&22&238n5F`16PPn728n92:n;2<$/&2="2>8$1?P"2@PnA2#nB"f2%"/&2CP)nDJ2E8$1FP&2@nG2CP)nHJ2E8$1FP"2@PnI2#nJ"f2%"/&2CP)nKJ2E8$1LP&2@nM2CP)nNJ2E8$1LMwOy'],m_=[`prefix`,``,`lookupNamespaceURI`,`XPathNSResolver`,`PPP&,J2!P&,J/"PPP&,J2!P&,J1#MJw$y`],h_=[()=>W,`contextNode`,`type`,()=>g_,`result`,()=>g_,`evaluate`,`XPathExpression`,`PPn!2"'2#8Pn$,J2%8n&1'Mw(y`],g_=[`booleanValue`,`invalidIteratorState`,`numberValue`,`resultType`,()=>W,`singleNodeValue`,`snapshotLength`,`stringValue`,()=>W,`iterateNext`,`index`,()=>W,`snapshotItem`,0,`ANY_TYPE`,1,`NUMBER_TYPE`,2,`STRING_TYPE`,3,`BOOLEAN_TYPE`,4,`UNORDERED_NODE_ITERATOR_TYPE`,5,`ORDERED_NODE_ITERATOR_TYPE`,6,`UNORDERED_NODE_SNAPSHOT_TYPE`,7,`ORDERED_NODE_SNAPSHOT_TYPE`,8,`ANY_UNORDERED_NODE_TYPE`,9,`FIRST_ORDERED_NODE_TYPE`,`XPathResult`,`P)4!9)4"9'4#9'4$9Pn%,J4&9'4'9&4(9PPn),J1*P'2+Pn,,J1-..4/9.0419.2439.4459.6479.8499.:4;9.<4=9.>4?9.@4A9MwBy`],__=[`value`,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,`ViewTransitionTypeSet`,`PPP&2!&2"n#2$$/%2&"2'8$1(Mw)y`],v_=[`hash`,`host`,`hostname`,`href`,`toString`,`origin`,`password`,`pathname`,`port`,`protocol`,`search`,`username`,`HTMLHyperlinkElementUtils`,`P&4!&4"&4#&4$P&1%&4&9&4'&4(&4)&4*&4+&4,Mw-y`],y_=[()=>hl,`type`,0,`this`,()=>Hp,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Hp,()=>B,`removeEventListener`,()=>z,()=>B,`XMLDocument`,`Pn!P"2"Pn#2$n%"f2&"/'2(P)n)J2*8$1+P&2"n,2(P)n-J2*8$1+P"2"Pn.2$n/"f2&"/'2(P)n0J2*8$11P&2"n22(P)n3J2*8$11Mw4y`],b_=[()=>G,()=>Tb,()=>jv,`transform`,()=>Eb,`options`,()=>wl,`getBBox`,()=>Pu,`getCTM`,()=>Pu,`getScreenCTM`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGGraphicsElement`,`Pn!n"n#4$9Pn%2&8n'1(PPn),J1*PPn+,J1,P"2-Pn.2/n0"f21"/223P)n4J2&8$15P&2-n623P)n7J2&8$15P"2-Pn82/n9"f21"/223P)n:J2&8$1;P&2-n<23P)n=J2&8$1;Mw>y`],x_=[()=>Lv,`preserveAspectRatio`,()=>Db,`viewBox`,`SVGFitToViewBox`,`Pn!4"9n#4$9Mw%y`],S_=[0,`this`,()=>U,`ev`,``,`onafterprint`,0,()=>U,`onbeforeprint`,0,()=>Bf,`onbeforeunload`,0,()=>Zf,`ongamepadconnected`,0,()=>Zf,`ongamepaddisconnected`,0,()=>Qf,`onhashchange`,0,()=>U,`onlanguagechange`,0,()=>ap,`onmessage`,0,()=>ap,`onmessageerror`,0,()=>U,`onoffline`,0,()=>U,`ononline`,0,()=>dp,`onpagehide`,0,()=>lp,`onpagereveal`,0,()=>dp,`onpageshow`,0,()=>up,`onpageswap`,0,()=>hp,`onpopstate`,0,()=>gp,`onrejectionhandled`,0,()=>Dp,`onstorage`,0,()=>gp,`onunhandledrejection`,0,()=>U,`onunload`,`type`,0,()=>Ob,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Ob,()=>B,`removeEventListener`,()=>z,()=>B,`WindowEventHandlers`,'PPPn!2"n#2$"/%,J4&PPn\'2"n(2$"/%,J4)PPn*2"n+2$"/%,J4,PPn-2"n.2$"/%,J4/PPn02"n12$"/%,J42PPn32"n42$"/%,J45PPn62"n72$"/%,J48PPn92"n:2$"/%,J4;PPn<2"n=2$"/%,J4>PPn?2"n@2$"/%,J4APPnB2"nC2$"/%,J4DPPnE2"nF2$"/%,J4GPPnH2"nI2$"/%,J4JPPnK2"nL2$"/%,J4MPPnN2"nO2$"/%,J4PPPnQ2"nR2$"/%,J4SPPnT2"nU2$"/%,J4VPPnW2"nX2$"/%,J4YPPnZ2"n[2$"/%,J4\\PPn]2"n^2$"/%,J4_P"2`Pna2"nb"f2$"/%2cP)ndJ2e8$1fP&2`ng2cP)nhJ2e8$1fP"2`Pni2"nj"f2$"/%2cP)nkJ2e8$1lP&2`nm2cP)nnJ2e8$1lMwoy'],C_=[`w`,`x`,`y`,`z`,()=>Ag,`matrix`,()=>D_,`matrixTransform`,`toJSON`,`DOMPointReadOnly`,`P'4!9'4"9'4#9'4$9Pn%2&8n'1(P"1)Mw*y`],Q=[()=>T_,`animVal`,()=>T_,`baseVal`,`SVGAnimatedLength`,`Pn!4"9n#4$9Mw%y`],w_=[`unitType`,`value`,`valueAsString`,`valueInSpecifiedUnits`,`convertToSpecifiedUnits`,`newValueSpecifiedUnits`,0,`SVG_ANGLETYPE_UNKNOWN`,1,`SVG_ANGLETYPE_UNSPECIFIED`,2,`SVG_ANGLETYPE_DEG`,3,`SVG_ANGLETYPE_RAD`,4,`SVG_ANGLETYPE_GRAD`,`SVGAngle`,`P'4!9'4"&4#'4$P'2!$1%P'2!'2$$1&.'4(9.)4*9.+4,9.-4.9./409Mw1y`],T_=[`unitType`,`value`,`valueAsString`,`valueInSpecifiedUnits`,`convertToSpecifiedUnits`,`newValueSpecifiedUnits`,0,`SVG_LENGTHTYPE_UNKNOWN`,1,`SVG_LENGTHTYPE_NUMBER`,2,`SVG_LENGTHTYPE_PERCENTAGE`,3,`SVG_LENGTHTYPE_EMS`,4,`SVG_LENGTHTYPE_EXS`,5,`SVG_LENGTHTYPE_PX`,6,`SVG_LENGTHTYPE_CM`,7,`SVG_LENGTHTYPE_MM`,8,`SVG_LENGTHTYPE_IN`,9,`SVG_LENGTHTYPE_PT`,10,`SVG_LENGTHTYPE_PC`,`SVGLength`,`P'4!9'4"&4#'4$P'2!$1%P'2!'2$$1&.'4(9.)4*9.+4,9.-4.9./409.1429.3449.5469.7489.94:9.;4<9Mw=y`],E_=[`value`,`SVGNumber`,`P'4!Mw"y`],D_=[()=>C_,`w`,`x`,`y`,`z`,`DOMPoint`,`Pn!'4"'4#'4$'4%Mw&y`],O_=[`angle`,()=>Pu,`matrix`,`type`,()=>Fu,`setMatrix`,`cx`,`cy`,`setRotate`,`sx`,`sy`,`setScale`,`setSkewX`,`setSkewY`,`tx`,`ty`,`setTranslate`,0,`SVG_TRANSFORM_UNKNOWN`,1,`SVG_TRANSFORM_MATRIX`,2,`SVG_TRANSFORM_TRANSLATE`,3,`SVG_TRANSFORM_SCALE`,4,`SVG_TRANSFORM_ROTATE`,5,`SVG_TRANSFORM_SKEWX`,6,`SVG_TRANSFORM_SKEWY`,`SVGTransform`,`P'4!9n"4#9'4$9Pn%2#8$1&P'2!'2''2($1)P'2*'2+$1,P'2!$1-P'2!$1.P'2/'20$11.2439.4459.6479.8499.:4;9.<4=9.>4?9Mw@y`],k_=[()=>Z,()=>Ob,`SVGSVGElementEventMap`,`Pn!n"Mw#y`],A_=[`collapsed`,()=>W,`endContainer`,`endOffset`,()=>W,`startContainer`,`startOffset`,`AbstractRange`,`P)4!9n"4#9'4$9n%4&9'4'9Mw(y`],j_=[()=>W,()=>ll,()=>ul,`data`,`length`,()=>hl,`ownerDocument`,`appendData`,`offset`,`count`,`deleteData`,`insertData`,`replaceData`,`substringData`,`CharacterData`,`Pn!n"n#&4$'4%9n&4'9P&2$$1(P'2)'2*$1+P'2)&2$$1,P'2)'2*&2$$1-P'2)'2*&1.!!Mw/y`],M_=[`duration`,`length`,`numberOfChannels`,`sampleRate`,`destination`,`channelNumber`,`bufferOffset`,`copyFromChannel`,`source`,`copyToChannel`,`channel`,`getChannelData`,`AudioBuffer`,`P'4!9'4"9'4#9'4$9P\\2%'2&'2'8$1(P\\2)'2&'2'8$1*P'2+\\1,Mw-y`],N_=[`name`,`value`,`CookieListItem`,`P&4!8&4"8Mw#y`],P_=[`x`,`y`,`z`,`DeviceMotionEventAcceleration`,`PP',J4!9P',J4"9P',J4#9Mw$y`],F_=[`alpha`,`beta`,`gamma`,`DeviceMotionEventRotationRate`,`PP',J4!9P',J4"9P',J4#9Mw$y`],I_=[`ascentOverride`,`descentOverride`,()=>kb,`display`,`family`,`featureSettings`,`lineGapOverride`,0,`loaded`,()=>Ab,`status`,`stretch`,`style`,`unicodeRange`,`variationSettings`,`weight`,0,`load`,`FontFace`,"P&4!&4\"n#4$&4%&4&&4'n(`4)9n*4+9&4,&4-&4.&4/&40Pn1`12Mw3y"],L_=[`message`,`GPUError`,`P&4!9Mw"y`],R_=[()=>$d,`axes`,()=>$d,()=>jb,`buttons`,`connected`,`id`,`index`,()=>Mb,`mapping`,()=>qd,`timestamp`,()=>Nb,`vibrationActuator`,`Gamepad`,`P'o!"4"9n$o#"4%9)4&9&4'9'4(9n)4*9n+4,9n-4.9Mw/y`],z_=[()=>H,()=>Pb,`connection`,`id`,`manufacturer`,`name`,0,`this`,()=>ep,`ev`,``,`onstatechange`,()=>Fb,`state`,()=>Ib,`type`,`version`,0,`close`,0,`open`,0,()=>Lb,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Lb,()=>B,`removeEventListener`,()=>z,()=>B,`MIDIPort`,'Pn!n"4#9&4$9P&,J4%9P&,J4&9PPn\'2(n)2*"/+,J4,n-4.9n/409P&,J419Pn2`13Pn4`15P"20Pn62(n7"f2*"/+28P)n9J2:8$1;P&20n<28P)n=J2:8$1;P"20Pn>2(n?"f2*"/+28P)n@J2:8$1AP&20nB28P)nCJ2:8$1AMwDy'],B_=[`individualization-request`,`license-release`,`license-renewal`,`license-request`,`MediaKeyMessageType`,`P.!.".#.$Jw%y`],V_=[()=>H,()=>Rb,0,`close`,`message`,()=>oy,`transfer`,`postMessage`,()=>zb,`options`,`start`,`type`,0,`this`,()=>Bb,`ev`,``,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>Bb,()=>B,`removeEventListener`,()=>z,()=>B,`MessagePort`,`Pn!n#o""P$1$P"2%n&F2'$1(P"2%n)2*8$1(P$1+P"2,Pn-2.n/"f20"/122P)n3J2*8$14P&2,n522P)n6J2*8$14P"2,Pn72.n8"f20"/122P)n9J2*8$1:P&2,n;22P)n<J2*8$1:Mw=y`],H_=[()=>vf,()=>V_,()=>Vb,`MessageEventSource`,`Pn!n"n#Jw$y`],U_=[`id`,`index`,`key`,`sameDocument`,`url`,`getState`,`NavigationDestination`,`P&4!9'4"9&4#9)4$9&4%9P"1&Mw'y`],W_=[`push`,`reload`,`replace`,`traverse`,`NavigationType`,`P.!.".#.$Jw%y`],G_=[()=>Hb,`focusReset`,()=>Ub,`handler`,()=>Wb,`precommitHandler`,()=>Gb,`scroll`,`NavigationInterceptOptions`,`Pn!4"8n#4$8n%4&8n'4(8Mw)y`],K_=[()=>H,`id`,`index`,`key`,0,`this`,()=>U,`ev`,``,`ondispose`,`sameDocument`,`url`,`getState`,`type`,0,()=>Kb,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Kb,()=>B,`removeEventListener`,()=>z,()=>B,`NavigationHistoryEntry`,`Pn!&4"9'4#9&4$9PPn%2&n'2("/),J4*)4+9P&,J4,9P"1-P"2.Pn/2&n0"f2("/)21P)n2J238$14P&2.n521P)n6J238$14P"2.Pn72&n8"f2("/)21P)n9J238$1:P&2.n;21P)n<J238$1:Mw=y`],q_=[()=>K_,`entry`,()=>K_,`from`,()=>W_,`navigationType`,`NavigationActivation`,`Pn!4"9Pn#,J4$9n%4&9Mw'y`],J_=[()=>qb,`error`,`paymentMethodErrors`,()=>Jb,`shippingAddressErrors`,()=>Yb,`total`,`PaymentDetailsUpdate`,`Pn!&4"8"4#8n$4%8n&4'8Mw(y`],Y_=[`T`,`value`,0,``,`onfulfilled`,`reason`,0,`onrejected`,0,`then`,`PromiseLike`,`b!PPPPe%!2"P""o#"J/$-,J2%8PP"2&P""o'"J/$-,J2(8P""Jo)"1*Mw+y`],X_=[()=>H,`height`,0,`this`,()=>U,`ev`,``,`onresize`,`width`,`type`,0,()=>Xb,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Xb,()=>B,`removeEventListener`,()=>z,()=>B,`PictureInPictureWindow`,`Pn!'4"9PPn#2$n%2&"/',J4('4)9P"2*Pn+2$n,"f2&"/'2-P)n.J2/8$10P&2*n12-P)n2J2/8$10P"2*Pn32$n4"f2&"/'2-P)n5J2/8$16P&2*n72-P)n8J2/8$16Mw9y`],Z_=[()=>H,()=>Zb,`binaryType`,`bufferedAmount`,`bufferedAmountLowThreshold`,`id`,`label`,`maxPacketLifeTime`,`maxRetransmits`,`negotiated`,0,`this`,()=>U,`ev`,``,`onbufferedamountlow`,0,()=>U,`onclose`,0,()=>U,`onclosing`,0,()=>yp,`onerror`,0,()=>ap,`onmessage`,0,()=>U,`onopen`,`ordered`,`protocol`,()=>Qb,`readyState`,`close`,`data`,`send`,()=>Xc,()=>Md,`type`,0,()=>$b,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>$b,()=>B,`removeEventListener`,()=>z,()=>B,`RTCDataChannel`,`Pn!n"4#'4$9'4%P',J4&9&4'9P',J4(9P',J4)9)4*9PPn+2,n-2."//,J40PPn12,n22."//,J43PPn42,n52."//,J46PPn72,n82."//,J49PPn:2,n;2."//,J4<PPn=2,n>2."//,J4?)4@9&4A9nB4C9P$1DP&2E$1FPnG2E$1FP_2E$1FP_oH"2E$1FP"2IPnJ2,nK"f2."//2LP)nMJ2N8$1OP&2InP2LP)nQJ2N8$1OP"2IPnR2,nS"f2."//2LP)nTJ2N8$1UP&2InV2LP)nWJ2N8$1UMwXy`],Q_=[()=>ex,()=>tx,`errorDetail`,`receivedAlert`,`sctpCauseCode`,`sdpLineNumber`,`sentAlert`,`RTCError`,`Pn!n"4#9P',J4$9P',J4%9P',J4&9P',J4'9Mw(y`],$_=[`address`,`candidate`,()=>nx,`component`,`foundation`,`port`,`priority`,()=>rx,`protocol`,`relatedAddress`,`relatedPort`,`sdpMLineIndex`,`sdpMid`,()=>ix,`tcpType`,()=>ax,`type`,`usernameFragment`,()=>ox,`toJSON`,`RTCIceCandidate`,`PP&,J4!9&4"9Pn#,J4$9P&,J4%9P',J4&9P',J4'9Pn(,J4)9P&,J4*9P',J4+9P',J4,9P&,J4-9Pn.,J4/9Pn0,J419P&,J429Pn314Mw5y`],ev=[()=>qd,`jitterBufferTarget`,()=>Cc,`track`,()=>sx,`transform`,()=>cx,`transport`,()=>lx,`getContributingSources`,()=>ux,`getParameters`,()=>dx,`getStats`,()=>fx,`getSynchronizationSources`,`RTCRtpReceiver`,`PPn!,J4"n#4$9Pn%,J4&Pn',J4(9Pn)F1*Pn+1,Pn-\`1.Pn/F10Mw1y`],tv=[()=>px,`currentDirection`,()=>px,`direction`,`mid`,()=>ev,`receiver`,()=>mx,`sender`,()=>hx,`codecs`,`setCodecPreferences`,`stop`,`RTCRtpTransceiver`,`PPn!,J4"9n#4$P&,J4%9n&4'9n(4)9Pn*F2+$1,P$1-Mw.y`],nv=[`aborted`,`audio-capture`,`language-not-supported`,`network`,`no-speech`,`not-allowed`,`phrases-not-supported`,`service-not-allowed`,`SpeechRecognitionErrorCode`,`P.!.".#.$.%.&.'.(Jw)y`],rv=[`length`,`index`,()=>gx,`item`,()=>gx,`SpeechRecognitionResultList`,`P'4!9P'2"n#1$'n%LMw&y`],iv=[`audio-busy`,`audio-hardware`,`canceled`,`interrupted`,`invalid-argument`,`language-unavailable`,`network`,`not-allowed`,`synthesis-failed`,`synthesis-unavailable`,`text-too-long`,`voice-unavailable`,`SpeechSynthesisErrorCode`,`P.!.".#.$.%.&.'.(.).*.+.,Jw-y`],av=[()=>H,`lang`,0,`this`,()=>Ep,`ev`,``,`onboundary`,0,()=>Ep,`onend`,0,()=>Tp,`onerror`,0,()=>Ep,`onmark`,0,()=>Ep,`onpause`,0,()=>Ep,`onresume`,0,()=>Ep,`onstart`,`pitch`,`rate`,`text`,()=>_x,`voice`,`volume`,`type`,0,()=>vx,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>vx,()=>B,`removeEventListener`,()=>z,()=>B,`SpeechSynthesisUtterance`,`Pn!&4"PPn#2$n%2&"/',J4(PPn)2$n*2&"/',J4+PPn,2$n-2&"/',J4.PPn/2$n02&"/',J41PPn22$n32&"/',J44PPn52$n62&"/',J47PPn82$n92&"/',J4:'4;'4<&4=Pn>,J4?'4@P"2APnB2$nC"f2&"/'2DP)nEJ2F8$1GP&2AnH2DP)nIJ2F8$1GP"2APnJ2$nK"f2&"/'2DP)nLJ2F8$1MP&2AnN2DP)nOJ2F8$1MMwPy`],ov=[`length`,`clear`,`key`,`getItem`,`index`,`removeItem`,`value`,`setItem`,`Storage`,`P'4!9P$1"P&2#P&,J1$P'2%P&,J1#P&2#$1&P&2#&2'$1(&"LMw)y`],sv=[`background`,`user-blocking`,`user-visible`,`TaskPriority`,`P.!.".#Jw$y`],cv=[()=>H,()=>yx,`activeCues`,()=>yx,`cues`,`id`,`inBandMetadataTrackDispatchType`,()=>bx,`kind`,`label`,`language`,()=>xx,`mode`,0,`this`,()=>U,`ev`,``,`oncuechange`,()=>Sx,`cue`,`addCue`,()=>Sx,`removeCue`,`type`,0,()=>Cx,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Cx,()=>B,`removeEventListener`,()=>z,()=>B,`TextTrack`,`Pn!Pn",J4#9Pn$,J4%9&4&9&4'9n(4)9&4*9&4+9n,4-PPn.2/n021"/2,J43Pn425$16Pn725$18P"29Pn:2/n;"f21"/22<P)n=J2>8$1?P&29n@2<P)nAJ2>8$1?P"29PnB2/nC"f21"/22<P)nDJ2>8$1EP&29nF2<P)nGJ2>8$1EMwHy`],lv=[()=>d_,`sheet`,`LinkStyle`,`PPn!,J4"9Mw#y`],uv=[()=>gl,`shadowRoots`,`GetComposedRangesOptions`,`Pn!F4"8Mw#y`],dv=[`size`,`name`,`value`,`append`,`delete`,`get`,`getAll`,`has`,`set`,`sort`,`toString`,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,`URLSearchParams`,`P'4!9P&2"&2#$1$P&2"&2#8$1%P&2"P&,J1&P&2"&F1'P&2"&2#8)1(P&2"&2#$1)P$1*P&1+PP&2#&2,n-2.$//20"218$12Mw3y`],fv=[()=>I,`autoplay`,()=>wx,`buffered`,`controls`,`crossOrigin`,`currentSrc`,`currentTime`,`defaultMuted`,`defaultPlaybackRate`,`disableRemotePlayback`,`duration`,`ended`,()=>Tx,`error`,`loop`,()=>Ex,`mediaKeys`,`muted`,`networkState`,0,`this`,()=>np,`ev`,``,`onencrypted`,0,()=>U,`onwaitingforkey`,`paused`,`playbackRate`,()=>wx,`played`,`none`,`metadata`,`auto`,``,`preload`,`preservesPitch`,`readyState`,()=>Dx,`remote`,()=>wx,`seekable`,`seeking`,`sinkId`,`src`,()=>Ox,`srcObject`,()=>kx,`textTracks`,`volume`,()=>bx,`kind`,`label`,`language`,()=>cv,`addTextTrack`,`type`,()=>Ax,`canPlayType`,`time`,`fastSeek`,`load`,`pause`,`play`,()=>Ex,`setMediaKeys`,`setSinkId`,0,`NETWORK_EMPTY`,1,`NETWORK_IDLE`,2,`NETWORK_LOADING`,3,`NETWORK_NO_SOURCE`,0,`HAVE_NOTHING`,1,`HAVE_METADATA`,2,`HAVE_CURRENT_DATA`,3,`HAVE_FUTURE_DATA`,4,`HAVE_ENOUGH_DATA`,0,()=>pv,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>pv,()=>B,`removeEventListener`,()=>z,()=>B,`HTMLMediaElement`,`Pn!)4"n#4$9)4%P&,J4&&4'9'4()4)'4*)4+'4,9)4-9Pn.,J4/9)40Pn1,J429)43'449PPn526n728"/9,J4:PPn;26n<28"/9,J4=)4>9'4?n@4A9P.B.C.D.EJ4F)4G'4H9nI4J9nK4L9)4M9&4N9&4OPnP,J4QnR4S9'4TPnU2V&2W8&2X8nY1ZP&2[n\\1]P'2^$1_P$1\`P$1aP$\`1bPPnc,J22$\`1dP&2N$\`1e.f4g9.h4i9.j4k9.l4m9.n4o9.p4q9.r4s9.t4u9.v4w9P"2[Pnx26ny"f28"/92zP)n{J2|8$1}P&2[n~2zP)nJ2|8$1}P"2[Pn26n"f28"/92zP)nJ2|8$1P&2[n2zP)n
J2|8$1Mwy`],pv=[()=>L,()=>np,`encrypted`,()=>U,`waitingforkey`,`HTMLMediaElementEventMap`,`Pn!n"4#n$4%Mw&y`],mv=[()=>L,()=>Ob,`HTMLBodyElementEventMap`,`Pn!n"Mw#y`],hv=[`popoverTargetAction`,()=>V,`popoverTargetElement`,`PopoverTargetAttributes`,`P&4!Pn",J4#Mw$y`],gv=[``,`no-referrer`,`no-referrer-when-downgrade`,`origin`,`origin-when-cross-origin`,`same-origin`,`strict-origin`,`strict-origin-when-cross-origin`,`unsafe-url`,`ReferrerPolicy`,`P.!.".#.$.%.&.'.(.)Jw*y`],_v=[()=>yg,()=>jx,()=>Mx,()=>jx,()=>Nx,()=>Px,()=>Fx,()=>Ix,`AutoFill`,`Pn!Pn#o""n%o$"n&n(o'"SJw)y`],vv=[`length`,`index`,()=>ou,`item`,()=>ou,`FileList`,`P'4!9P'2"Pn#,J1$'n%LMw&y`],yv=[`forward`,`backward`,`none`,`SelectionDirection`,`P.!.".#Jw$y`],bv=[()=>Lx,`filesystem`,`fullPath`,`isDirectory`,`isFile`,`name`,()=>Rx,`successCallback`,()=>zx,`errorCallback`,`getParent`,`FileSystemEntry`,`Pn!4"9&4#9)4$9)4%9&4&9Pn'2(8n)2*8$1+Mw,y`],xv=[`end`,`preserve`,`select`,`start`,`SelectionMode`,`P.!.".#.$Jw%y`],Sv=[()=>El,()=>wm,`length`,`selectedIndex`,()=>wm,()=>Cm,`element`,()=>I,`before`,`add`,`index`,`remove`,`HTMLOptionsCollection`,`Pn"o!"'4#'4$PPn%n&J2'Pn(',J2)8$1*P'2+$1,Mw-y`],Cv=[`corruptedVideoFrames`,()=>qd,`creationTime`,`droppedVideoFrames`,`totalVideoFrames`,`VideoPlaybackQuality`,`P'4!9n"4#9'4$9'4%9Mw&y`],wv=[()=>qd,`now`,()=>Bx,`metadata`,``,`VideoFrameRequestCallback`,`PPn!2"n#2$$v%Mw&y`],Tv=[()=>pv,()=>mp,`enterpictureinpicture`,()=>mp,`leavepictureinpicture`,`HTMLVideoElementEventMap`,`Pn!n"4#n$4%Mw&y`],Ev=[()=>Dv,`href`,`SVGURIReference`,`Pn!4"9Mw#y`],Dv=[`animVal`,`baseVal`,`SVGAnimatedString`,`P&4!9&4"Mw#y`],Ov=[()=>G,()=>Tb,()=>G,`targetElement`,`beginElement`,`offset`,`beginElementAt`,`endElement`,`endElementAt`,`getCurrentTime`,`getSimpleDuration`,`getStartTime`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGAnimationElement`,`Pn!n"Pn#,J4$9P$1%P'2&$1'P$1(P'2&$1)P'1*P'1+P'1,P"2-Pn.2/n0"f21"/223P)n4J258$16P&2-n723P)n8J258$16P"2-Pn92/n:"f21"/223P)n;J258$1<P&2-n=23P)n>J258$1<Mw?y`],kv=[()=>b_,()=>$,`pathLength`,`distance`,()=>D_,`getPointAtLength`,`getTotalLength`,()=>Cu,`point`,`isPointInFill`,()=>Cu,`isPointInStroke`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGGeometryElement`,`Pn!n"4#9P'2$n%1&P'1'Pn(2)8)1*Pn+2)8)1,P"2-Pn.2/n0"f21"/223P)n4J258$16P&2-n723P)n8J258$16P"2-Pn92/n:"f21"/223P)n;J258$1<P&2-n=23P)n>J258$1<Mw?y`],Av=[`animVal`,`baseVal`,`SVGAnimatedEnumeration`,`P'4!9'4"Mw#y`],jv=[()=>Vx,`animVal`,()=>Vx,`baseVal`,`SVGAnimatedTransformList`,`Pn!4"9n#4$9Mw%y`],Mv=[()=>Q,`height`,()=>Dv,`result`,()=>Q,`width`,()=>Q,`x`,()=>Q,`y`,`SVGFilterPrimitiveStandardAttributes`,`Pn!4"9n#4$9n%4&9n'4(9n)4*9Mw+y`],Nv=[()=>Hx,`animVal`,()=>Hx,`baseVal`,`SVGAnimatedNumberList`,`Pn!4"9n#4$9Mw%y`],$=[`animVal`,`baseVal`,`SVGAnimatedNumber`,`P'4!9'4"Mw#y`],Pv=[`animVal`,`baseVal`,`SVGAnimatedInteger`,`P'4!9'4"Mw#y`],Fv=[`animVal`,`baseVal`,`SVGAnimatedBoolean`,`P)4!9)4"Mw#y`],Iv=[()=>G,()=>$,`amplitude`,()=>$,`exponent`,()=>$,`intercept`,()=>$,`offset`,()=>$,`slope`,()=>Nv,`tableValues`,()=>Av,`type`,0,`SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN`,1,`SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY`,2,`SVG_FECOMPONENTTRANSFER_TYPE_TABLE`,3,`SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE`,4,`SVG_FECOMPONENTTRANSFER_TYPE_LINEAR`,5,`SVG_FECOMPONENTTRANSFER_TYPE_GAMMA`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGComponentTransferFunctionElement`,`Pn!n"4#9n$4%9n&4'9n(4)9n*4+9n,4-9n.4/9.0419.2439.4459.6479.8499.:4;9P"2/Pn<2=n>"f2?"/@2AP)nBJ2C8$1DP&2/nE2AP)nFJ2C8$1DP"2/PnG2=nH"f2?"/@2AP)nIJ2C8$1JP&2/nK2AP)nLJ2C8$1JMwMy`],Lv=[()=>Ux,`animVal`,()=>Ux,`baseVal`,`SVGAnimatedPreserveAspectRatio`,`Pn!4"9n#4$9Mw%y`],Rv=[()=>G,()=>Ev,()=>jv,`gradientTransform`,()=>Av,`gradientUnits`,()=>Av,`spreadMethod`,0,`SVG_SPREADMETHOD_UNKNOWN`,1,`SVG_SPREADMETHOD_PAD`,2,`SVG_SPREADMETHOD_REFLECT`,3,`SVG_SPREADMETHOD_REPEAT`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGGradientElement`,`Pn!n"n#4$9n%4&9n'4(9.)4*9.+4,9.-4.9./409P"21Pn223n4"f25"/627P)n8J298$1:P&21n;27P)n<J298$1:P"21Pn=23n>"f25"/627P)n?J298$1@P&21nA27P)nBJ298$1@MwCy`],zv=[()=>w_,`animVal`,()=>w_,`baseVal`,`SVGAnimatedAngle`,`Pn!4"9n#4$9Mw%y`],Bv=[()=>Wx,`animatedPoints`,()=>Wx,`points`,`SVGAnimatedPoints`,`Pn!4"9n#4$9Mw%y`],Vv=[()=>Hv,()=>Gx,`dx`,()=>Gx,`dy`,()=>Nv,`rotate`,()=>Gx,`x`,()=>Gx,`y`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGTextPositioningElement`,`Pn!n"4#9n$4%9n&4'9n(4)9n*4+9P"2,Pn-2.n/"f20"/122P)n3J248$15P&2,n622P)n7J248$15P"2,Pn82.n9"f20"/122P)n:J248$1;P&2,n<22P)n=J248$1;Mw>y`],Hv=[()=>b_,()=>Av,`lengthAdjust`,()=>Q,`textLength`,()=>Cu,`point`,`getCharNumAtPosition`,`getComputedTextLength`,`charnum`,()=>D_,`getEndPositionOfChar`,()=>wl,`getExtentOfChar`,`getNumberOfChars`,`getRotationOfChar`,()=>D_,`getStartPositionOfChar`,`nchars`,`getSubStringLength`,`selectSubString`,0,`LENGTHADJUST_UNKNOWN`,1,`LENGTHADJUST_SPACING`,2,`LENGTHADJUST_SPACINGANDGLYPHS`,`type`,0,`this`,()=>Z,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Z,()=>B,`removeEventListener`,()=>z,()=>B,`SVGTextContentElement`,`Pn!n"4#9n$4%9Pn&2'8'1(P'1)P'2*n+1,P'2*n-1.P'1/P'2*'10P'2*n112P'2*'23'14P'2*'23$15.6479.8499.:4;9P"2<Pn=2>n?"f2@"/A2BP)nCJ2D8$1EP&2<nF2BP)nGJ2D8$1EP"2<PnH2>nI"f2@"/A2BP)nJJ2D8$1KP&2<nL2BP)nMJ2D8$1KMwNy`],Uv=[()=>L,()=>Ob,`HTMLFrameSetElementEventMap`,`Pn!n"Mw#y`],Wv=[`auto`,`instant`,`smooth`,`ScrollBehavior`,`P.!.".#Jw$y`],Gv=[`handle`,`cancelAnimationFrame`,()=>Kx,`callback`,`requestAnimationFrame`,`AnimationFrameProvider`,`PP'2!$1"Pn#2$'1%Mw&y`],Kv=[()=>ov,`localStorage`,`WindowLocalStorage`,`Pn!4"9Mw#y`],qv=[()=>qx,`caches`,`crossOriginIsolated`,()=>Jx,`crypto`,()=>Yx,`indexedDB`,`isSecureContext`,`origin`,()=>Xx,`performance`,()=>Zx,`scheduler`,`data`,`atob`,`btoa`,`id`,`clearInterval`,`clearTimeout`,()=>Qx,`image`,()=>$x,`options`,()=>Uc,`createImageBitmap`,()=>Qx,`sx`,`sy`,`sw`,`sh`,()=>$x,()=>Uc,()=>eS,()=>zp,`input`,()=>tS,`init`,()=>nS,`fetch`,()=>rS,`callback`,`queueMicrotask`,`e`,`reportError`,()=>iS,`handler`,`timeout`,`arguments`,`setInterval`,()=>iS,`setTimeout`,`value`,()=>zb,`structuredClone`,`WindowOrWorkerGlobalScope`,`Pn!4"9)4#9n$4%9n&4'9)4(9&4)9n*4+9n,4-9P&2.&1/P&2.&10PP'-J21$12PP'-J21$13Pn425n6278n8\`19Pn:25'2;'2<'2='2>n?278n@\`19PPnAnBJ2CnD2E8nF\`1GPnH2I$1JP"2K$1LPnM2N'2O8"@2P'1QPnR2N'2O8"@2P'1SP"2TnU278"1VMwWy`],Jv=[()=>ov,`sessionStorage`,`WindowSessionStorage`,`Pn!4"9Mw#y`],Yv=[()=>aS,()=>oS,()=>sS,()=>cS,()=>lS,()=>uS,()=>dS,()=>fS,()=>pS,()=>mS,()=>hS,()=>gS,()=>_S,`clipboard`,()=>vS,`credentials`,`doNotTrack`,()=>yS,`geolocation`,()=>bS,`login`,`maxTouchPoints`,()=>xS,`mediaCapabilities`,()=>SS,`mediaDevices`,()=>CS,`mediaSession`,()=>wS,`permissions`,()=>TS,`serviceWorker`,()=>ES,`userActivation`,()=>DS,`wakeLock`,()=>OS,`data`,`canShare`,()=>R_,`getGamepads`,()=>kS,`options`,()=>AS,`requestMIDIAccess`,`keySystem`,()=>jS,`supportedConfigurations`,()=>MS,`requestMediaKeySystemAccess`,()=>zp,`url`,()=>NS,`sendBeacon`,()=>OS,`share`,()=>PS,`pattern`,`vibrate`,`Navigator`,"Pn!n\"n#n$n%n&n'n(n)n*n+n,n-4.9n/409P&,J419n2439n4459'469n7489n94:9n;4<9n=4>9n?4@9nA4B9nC4D9PnE2F8)1GPPnH,JF1IPnJ2K8nL`1MP&2NnOF2PnQ`1RPP&nSJ2TPnU,J2F8)1VPnW2F8$`1XPnY2Z)1[Mw\\y"],Xv=[()=>H,0,`this`,()=>Gf,`ev`,``,`onchange`,`name`,`delete`,()=>FS,`options`,()=>N_,`get`,()=>IS,()=>N_,()=>LS,`getAll`,()=>IS,()=>LS,`value`,`set`,()=>RS,`type`,0,()=>zS,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>zS,()=>B,`removeEventListener`,()=>z,()=>B,`CookieStore`,'Pn!PPn"2#n$2%"/&,J4\'P&2($`1)Pn*2+$`1)P&2(Pn,,J`1-Pn.2+8Pn/,J`1-P&2(n0`11Pn22+8n3`11P&2(&24$`15Pn62+$`15P"27Pn82#n9"f2%"/&2:P)n;J2+8$1<P&27n=2:P)n>J2+8$1<P"27Pn?2#n@"f2%"/&2:P)nAJ2+8$1BP&27nC2:P)nDJ2+8$1BMwEy'],Zv=[`AddSearchProvider`,`IsSearchProviderInstalled`,`External`,`PP$1!P$1"Mw#y`],Qv=[`length`,()=>BS,`scrollRestoration`,`state`,`back`,`forward`,`delta`,`go`,`data`,`unused`,()=>zp,`url`,`pushState`,()=>zp,`replaceState`,`History`,`P'4!9n"4#"4$9P$1%P$1&P'2'8$1(P"2)&2*P&n+,J2,8$1-P"2)&2*P&n.,J2,8$1/Mw0y`],$v=[`visible`,`BarProp`,`P)4!9Mw"y`],ey=[()=>H,()=>q_,`activation`,`canGoBack`,`canGoForward`,()=>K_,`currentEntry`,0,`this`,()=>sp,`ev`,``,`oncurrententrychange`,0,()=>op,`onnavigate`,0,()=>Yd,`onnavigateerror`,0,()=>U,`onnavigatesuccess`,()=>VS,`transition`,()=>HS,`options`,()=>US,`back`,()=>K_,`entries`,()=>HS,()=>US,`forward`,()=>zp,`url`,()=>WS,()=>US,`navigate`,()=>GS,()=>US,`reload`,`key`,()=>HS,()=>US,`traverseTo`,()=>KS,`updateCurrentEntry`,`type`,0,()=>qS,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>qS,()=>B,`removeEventListener`,()=>z,()=>B,`Navigation`,`Pn!Pn",J4#9)4$9)4%9Pn&,J4'9PPn(2)n*2+"/,,J4-PPn.2)n/2+"/,,J40PPn12)n22+"/,,J43PPn42)n52+"/,,J46Pn7,J489Pn92:8n;1<Pn=F1>Pn?2:8n@1APP&nBJ2CnD2:8nE1FPnG2:8nH1IP&2JnK2:8nL1MPnN2:$1OP"2PPnQ2)nR"f2+"/,2SP)nTJ2:8$1UP&2PnV2SP)nWJ2:8$1UP"2PPnX2)nY"f2+"/,2SP)nZJ2:8$1[P&2Pn\\2SP)n]J2:8$1[Mw^y`],ty=[`availHeight`,`availWidth`,`colorDepth`,`height`,()=>JS,`orientation`,`pixelDepth`,`width`,`Screen`,`P'4!9'4"9'4#9'4$9n%4&9'4'9'4(9Mw)y`],ny=[()=>H,0,`this`,()=>U,`ev`,``,`onvoiceschanged`,`paused`,`pending`,`speaking`,`cancel`,()=>_x,`getVoices`,`pause`,`resume`,()=>av,`utterance`,`speak`,`type`,0,()=>YS,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>YS,()=>B,`removeEventListener`,()=>z,()=>B,`SpeechSynthesis`,`Pn!PPn"2#n$2%"/&,J4')4(9)4)9)4*9P$1+Pn,F1-P$1.P$1/Pn021$12P"23Pn42#n5"f2%"/&26P)n7J288$19P&23n:26P)n;J288$19P"23Pn<2#n="f2%"/&26P)n>J288$1?P&23n@26P)nAJ288$1?MwBy`],ry=[()=>H,`height`,`offsetLeft`,`offsetTop`,0,`this`,()=>U,`ev`,``,`onresize`,0,()=>U,`onscroll`,`pageLeft`,`pageTop`,`scale`,`width`,`type`,0,()=>XS,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>XS,()=>B,`removeEventListener`,()=>z,()=>B,`VisualViewport`,`Pn!'4"9'4#9'4$9PPn%2&n'2("/),J4*PPn+2&n,2("/),J4-'4.9'4/9'409'419P"22Pn32&n4"f2("/)25P)n6J278$18P&22n925P)n:J278$18P"22Pn;2&n<"f2("/)25P)n=J278$1>P&22n?25P)n@J278$1>MwAy`],iy=[()=>ZS,`CSSStyleDeclaration`,`Pn!Mw"y`],ay=[()=>H,`matches`,`media`,0,`this`,()=>ip,`ev`,``,`onchange`,0,()=>ip,`callback`,`addListener`,0,()=>ip,`removeListener`,`type`,0,()=>QS,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>QS,()=>B,`removeEventListener`,()=>z,()=>B,`MediaQueryList`,`Pn!)4"9&4#9PPn$2%n&2'"/(,J4)PPPn*2%n+2'"/(,J2,$1-PPPn.2%n/2'"/(,J2,$10P"21Pn22%n3"f2'"/(24P)n5J268$17P&21n824P)n9J268$17P"21Pn:2%n;"f2'"/(24P)n<J268$1=P&21n>24P)n?J268$1=Mw@y`],oy=[()=>mc,()=>Uc,()=>V_,()=>$S,()=>Kd,()=>Zg,()=>eC,()=>tC,()=>Eg,()=>Z_,`Transferable`,`Pn!n"n#n$n%n&n'n(n)n*_Jw+y`],sy=[()=>zb,`targetOrigin`,`WindowPostMessageOptions`,`Pn!&4"8Mw#y`],cy=[()=>nC,`deadline`,``,`IdleRequestCallback`,`PPn!2"$v#Mw$y`],ly=[`timeout`,`IdleRequestOptions`,`P'4!8Mw"y`],uy=[()=>rl,()=>Ob,()=>U,`DOMContentLoaded`,()=>qf,`devicemotion`,()=>Jf,`deviceorientation`,()=>Jf,`deviceorientationabsolute`,()=>Zf,`gamepadconnected`,()=>Zf,`gamepaddisconnected`,()=>U,`orientationchange`,`WindowEventMap`,`Pn!n"n#4$n%4&n'4(n)4*n+4,n-4.n/40Mw1y`],dy=[`length`,`data`,`type`,()=>rC,`add`,()=>ou,()=>rC,`clear`,`index`,`remove`,()=>rC,`DataTransferItemList`,`P'4!9P&2"&2#Pn$,J1%Pn&2"Pn',J1%P$1(P'2)$1*'n+LMw,y`],fy=[`name`,`message`,`stack`,`Error`,`P&4!&4"&4#8Mw$y`],py=[`clientX`,`clientY`,`force`,`identifier`,`pageX`,`pageY`,`radiusX`,`radiusY`,`rotationAngle`,`screenX`,`screenY`,()=>H,`target`,`Touch`,`P'4!9'4"9'4#9'4$9'4%9'4&9'4'9'4(9'4)9'4*9'4+9n,4-9Mw.y`],my=[()=>Zd,()=>fm,`value`,`RadioNodeList`,`Pn"o!"&4#Mw$y`],hy=[()=>iC,`ConstrainDouble`,`P'n!Jw"y`],gy=[()=>aC,`ConstrainBoolean`,`P)n!Jw"y`],_y=[()=>oC,`ConstrainULong`,`P'n!Jw"y`],vy=[()=>sC,`ConstrainDOMString`,`P&&Fn!Jw"y`],yy=[()=>cC,`ConstrainBooleanOrDOMString`,`P)&n!Jw"y`],by=[`fullRange`,()=>lC,`matrix`,()=>uC,`primaries`,()=>dC,`transfer`,()=>fC,`toJSON`,`VideoColorSpace`,`PP),J4!9Pn",J4#9Pn$,J4%9Pn&,J4'9Pn(1)Mw*y`],xy=[`BGRA`,`BGRX`,`I420`,`I420A`,`I422`,`I444`,`NV12`,`RGBA`,`RGBX`,`VideoPixelFormat`,`P.!.".#.$.%.&.'.(.)Jw*y`],Sy=[()=>Tc,`colorSpace`,()=>xy,`format`,()=>Cy,`layout`,()=>pC,`rect`,`VideoFrameCopyToOptions`,`Pn!4"8n#4$8n%F4&8n'4(8Mw)y`],Cy=[`offset`,`stride`,`PlaneLayout`,`P'4!'4"Mw#y`],wy=[`architecture`,`description`,`device`,`isFallbackAdapter`,`subgroupMaxSize`,`subgroupMinSize`,`vendor`,`GPUAdapterInfo`,`P&4!9&4"9&4#9)4$9'4%9'4&9&4'9Mw(y`],Ty=[`value`,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,`GPUSupportedFeatures`,`PPP&2!&2"n#2$$/%2&"2'8$1(Mw)y`],Ey=`maxBindGroups maxBindGroupsPlusVertexBuffers maxBindingsPerBindGroup maxBufferSize maxColorAttachmentBytesPerSample maxColorAttachments maxComputeInvocationsPerWorkgroup maxComputeWorkgroupSizeX maxComputeWorkgroupSizeY maxComputeWorkgroupSizeZ maxComputeWorkgroupStorageSize maxComputeWorkgroupsPerDimension maxDynamicStorageBuffersPerPipelineLayout maxDynamicUniformBuffersPerPipelineLayout maxInterStageShaderVariables maxSampledTexturesPerShaderStage maxSamplersPerShaderStage maxStorageBufferBindingSize maxStorageBuffersPerShaderStage maxStorageTexturesPerShaderStage maxTextureArrayLayers maxTextureDimension1D maxTextureDimension2D maxTextureDimension3D maxUniformBufferBindingSize maxUniformBuffersPerShaderStage maxVertexAttributes maxVertexBufferArrayStride maxVertexBuffers minStorageBufferOffsetAlignment minUniformBufferOffsetAlignment GPUSupportedLimits P'4!9'4"9'4#9'4$9'4%9'4&9'4'9'4(9'4)9'4*9'4+9'4,9'4-9'4.9'4/9'409'419'429'439'449'459'469'479'489'499'4:9'4;9'4<9'4=9'4>9'4?9Mw@y`.split(` `),Dy=[`message`,()=>mC,`reason`,`GPUDeviceLostInfo`,`P&4!9n"4#9Mw$y`],Oy=[()=>Rg,()=>hC,`source`,()=>gC,`destination`,()=>_C,`copySize`,`copyExternalImageToTexture`,`onSubmittedWorkDone`,()=>vC,`commandBuffers`,`submit`,()=>Py,`buffer`,()=>yC,`bufferOffset`,()=>jd,`data`,()=>yC,`dataOffset`,()=>yC,`size`,`writeBuffer`,()=>bC,()=>jd,()=>xC,`dataLayout`,()=>_C,`writeTexture`,`GPUQueue`,`Pn!Pn"2#n$2%n&2'$1(P$\`1)Pn*F2+$1,Pn-2.n/20n122n3248n5268$17Pn82%n922n:2;n<26$1=Mw>y`],ky=[()=>rb,()=>SC,`entries`,()=>My,`layout`,`GPUBindGroupDescriptor`,`Pn!n"F4#n$4%Mw&y`],Ay=[()=>Rg,`GPUBindGroup`,`Pn!Mw"y`],jy=[()=>rb,()=>CC,`entries`,`GPUBindGroupLayoutDescriptor`,`Pn!n"F4#Mw$y`],My=[()=>Rg,`GPUBindGroupLayout`,`Pn!Mw"y`],Ny=[()=>rb,`mappedAtCreation`,()=>yC,`size`,()=>wC,`usage`,`GPUBufferDescriptor`,`Pn!)4"8n#4$n%4&Mw'y`],Py=[()=>Rg,()=>TC,`mapState`,()=>EC,`size`,()=>Hg,`usage`,`destroy`,()=>yC,`offset`,()=>yC,`getMappedRange`,()=>DC,`mode`,()=>yC,()=>yC,`mapAsync`,`unmap`,`GPUBuffer`,`Pn!n"4#9n$4%9n&4'9P$1(Pn)2*8n+2%8_1,Pn-2.n/2*8n02%8$\`11P$12Mw3y`],Fy=[()=>rb,`GPUCommandEncoderDescriptor`,`Pn!Mw"y`],Iy=[()=>OC,()=>Rg,()=>kC,`descriptor`,()=>AC,`beginComputePass`,()=>jC,()=>MC,`beginRenderPass`,()=>Py,`buffer`,()=>yC,`offset`,()=>yC,`size`,`clearBuffer`,()=>Py,`source`,()=>Py,`destination`,()=>yC,`copyBufferToBuffer`,()=>Py,()=>yC,`sourceOffset`,()=>Py,()=>yC,`destinationOffset`,()=>yC,()=>NC,()=>bC,()=>_C,`copySize`,`copyBufferToTexture`,()=>bC,()=>NC,()=>_C,`copyTextureToBuffer`,()=>bC,()=>bC,()=>_C,`copyTextureToTexture`,()=>PC,()=>vC,`finish`,()=>Hy,`querySet`,()=>FC,`firstQuery`,()=>FC,`queryCount`,()=>Py,()=>yC,`resolveQuerySet`,`GPUCommandEncoder`,`Pn!n"Pn#2$8n%1&Pn'2$n(1)Pn*2+n,2-8n.2/8$10Pn122n324n52/8$16Pn722n829n:24n;2<n=2/8$16Pn>22n?24n@2A$1BPnC22nD24nE2A$1FPnG22nH24nI2A$1JPnK2$8nL1MPnN2OnP2QnR2SnT24nU2<$1VMwWy`],Ly=[()=>IC,()=>LC,`compute`,`GPUComputePipelineDescriptor`,`Pn!n"4#Mw$y`],Ry=[()=>Rg,()=>RC,`GPUComputePipeline`,`Pn!n"Mw#y`],zy=[()=>rb,()=>My,`bindGroupLayouts`,`GPUPipelineLayoutDescriptor`,`Pn!Pn",JF4#Mw$y`],By=[()=>Rg,`GPUPipelineLayout`,`Pn!Mw"y`],Vy=[()=>rb,()=>FC,`count`,()=>zC,`type`,`GPUQuerySetDescriptor`,`Pn!n"4#n$4%Mw&y`],Hy=[()=>Rg,()=>Vg,`count`,()=>zC,`type`,`destroy`,`GPUQuerySet`,`Pn!n"4#9n$4%9P$1&Mw'y`],Uy=[()=>BC,`depthReadOnly`,`stencilReadOnly`,`GPURenderBundleEncoderDescriptor`,`Pn!)4"8)4#8Mw$y`],Wy=[()=>VC,()=>OC,()=>Rg,()=>HC,()=>UC,`descriptor`,()=>WC,`finish`,`GPURenderBundleEncoder`,`Pn!n"n#n$Pn%2&8n'1(Mw)y`],Gy=[()=>IC,()=>GC,`depthStencil`,()=>KC,`fragment`,()=>qC,`multisample`,()=>JC,`primitive`,()=>YC,`vertex`,`GPURenderPipelineDescriptor`,`Pn!n"4#8n$4%8n&4'8n(4)8n*4+Mw,y`],Ky=[()=>Rg,()=>RC,`GPURenderPipeline`,`Pn!n"Mw#y`],qy=[()=>rb,()=>XC,`addressModeU`,()=>XC,`addressModeV`,()=>XC,`addressModeW`,()=>ZC,`compare`,`lodMaxClamp`,`lodMinClamp`,()=>QC,`magFilter`,`maxAnisotropy`,()=>QC,`minFilter`,()=>$C,`mipmapFilter`,`GPUSamplerDescriptor`,`Pn!n"4#8n$4%8n&4'8n(4)8'4*8'4+8n,4-8'4.8n/408n1428Mw3y`],Jy=[()=>Rg,`GPUSampler`,`Pn!Mw"y`],Yy=[()=>rb,`code`,`GPUShaderModuleDescriptor`,`Pn!&4"Mw#y`],Xy=[()=>Rg,()=>ew,`getCompilationInfo`,`GPUShaderModule`,'Pn!Pn"`1#Mw$y'],Zy=[()=>rb,()=>Bg,`dimension`,()=>Fg,`format`,()=>ib,`mipLevelCount`,()=>FC,`sampleCount`,()=>_C,`size`,()=>Lg,`usage`,()=>Fg,`viewFormats`,`GPUTextureDescriptor`,`Pn!n"4#8n$4%n&4'8n(4)8n*4+n,4-n.F4/8Mw0y`],Qy=[()=>rb,()=>Tc,`colorSpace`,()=>Wm,()=>Eg,`source`,`GPUExternalTextureDescriptor`,`Pn!n"4#8Pn$n%J4&Mw'y`],$y=[()=>Rg,`GPUExternalTexture`,`Pn!Mw"y`],eb=[`internal`,`out-of-memory`,`validation`,`GPUErrorFilter`,`P.!.".#Jw$y`],tb=[()=>Xf,`uncapturederror`,`GPUDeviceEventMap`,`Pn!4"Mw#y`],nb=[`extended`,`standard`,`GPUCanvasToneMappingMode`,`P.!."Jw#y`],rb=[`label`,`GPUObjectDescriptorBase`,`P&4!8Mw"y`],ib=[`GPUIntegerCoordinate`,`'w!y`],ab=[`all`,`depth-only`,`stencil-only`,`GPUTextureAspect`,`P.!.".#Jw$y`],ob=[`1d`,`2d`,`2d-array`,`3d`,`cube`,`cube-array`,`GPUTextureViewDimension`,`P.!.".#.$.%.&Jw'y`],sb=[`closed`,`reason`,`cancel`,`ReadableStreamGenericReader`,'P$`4!9P"2"8$`1#Mw$y'],cb=[`min`,`ReadableStreamBYOBReaderReadOptions`,`P'4!8Mw"y`],lb=[`T`,()=>tw,()=>nw,`ReadableStreamReadResult`,`b!Pe"!o""e"!o#"Jw$y`],ub=[`byob`,`ReadableStreamReaderMode`,`.!w"y`],db=[`W`,`closed`,`desiredSize`,`ready`,`reason`,`abort`,`close`,`releaseLock`,`chunk`,`write`,`WritableStreamDefaultWriter`,'"c!P$`4"9P\',J4#9$`4$9P"2%8$`1&P$`1\'P$1(Pe#!2)8$`1*Mw+y'],fb=[`delay`,()=>rw,`direction`,()=>n_,`duration`,`easing`,`endDelay`,()=>iw,`fill`,`iterationStart`,`iterations`,`playbackRate`,`EffectTiming`,`P'4!8n"4#8P'n$&J4%8&4&8'4'8n(4)8'4*8'4+8'4,8Mw-y`],pb=[`accumulate`,`add`,`replace`,`CompositeOperation`,`P.!.".#Jw$y`],mb=[`accumulate`,`replace`,`IterationCompositeOperation`,`P.!."Jw#y`],hb=[()=>n_,`unit`,`value`,`CSSUnitValue`,`Pn!&4"9'4#Mw$y`],gb=[()=>aw,()=>ow,`values`,`CSSMathSum`,`Pn!n"4#9Mw$y`],_b=[`angle`,`flex`,`frequency`,`length`,`percent`,()=>sw,`percentHint`,`resolution`,`time`,`CSSNumericType`,`P'4!8'4"8'4#8'4$8'4%8n&4'8'4(8'4)8Mw*y`],vb=[()=>fb,()=>a_,`activeDuration`,`currentIteration`,()=>a_,`endTime`,()=>a_,`localTime`,`progress`,()=>a_,`startTime`,`ComputedEffectTiming`,`Pn!n"4#8P',J4$8n%4&8Pn',J4(8P',J4)8n*4+8Mw,y`],yb=[`delay`,()=>rw,`direction`,`duration`,`easing`,`endDelay`,()=>iw,`fill`,`iterationStart`,`iterations`,`playbackRate`,`OptionalEffectTiming`,`P'4!8n"4#8P'&J4$8&4%8'4&8n'4(8'4)8'4*8'4+8Mw,y`],bb=[`disabled`,`href`,()=>V,()=>Pp,`ownerNode`,()=>d_,`parentStyleSheet`,`title`,`type`,`StyleSheet`,`P)4!P&,J4"9!!Pn#n$,J4%9Pn&,J4'9P&,J4(9&4)9Mw*y`],xb=[`length`,`index`,()=>Sb,`item`,()=>Sb,`CSSRuleList`,`P'4!9P'2"Pn#,J1$'n%LMw&y`],Sb=[`cssText`,0,`parentRule`,()=>d_,`parentStyleSheet`,`type`,1,`STYLE_RULE`,2,`CHARSET_RULE`,3,`IMPORT_RULE`,4,`MEDIA_RULE`,5,`FONT_FACE_RULE`,6,`PAGE_RULE`,9,`MARGIN_RULE`,10,`NAMESPACE_RULE`,7,`KEYFRAMES_RULE`,8,`KEYFRAME_RULE`,12,`SUPPORTS_RULE`,11,`COUNTER_STYLE_RULE`,14,`FONT_FEATURE_VALUES_RULE`,`CSSRule`,`P&4!Pn",J4#9Pn$,J4%9'4&9.'4(9.)4*9.+4,9.-4.9./409.1429.3449.5469.7489.94:9.;4<9.=4>9.?4@9MwAy`],Cb=[`loaded`,`loading`,`FontFaceSetLoadStatus`,`P.!."Jw#y`],wb=[()=>Yf,`loading`,()=>Yf,`loadingdone`,()=>Yf,`loadingerror`,`FontFaceSetEventMap`,`Pn!4"n#4$n%4&Mw'y`],Tb=[()=>cw,`requiredExtensions`,()=>cw,`systemLanguage`,`SVGTests`,`Pn!4"9n#4$9Mw%y`],Eb=[`clipped`,`fill`,`markers`,`stroke`,`SVGBoundingBoxOptions`,`P)4!8)4"8)4#8)4$8Mw%y`],Db=[()=>eg,`animVal`,()=>wl,`baseVal`,`SVGAnimatedRect`,`Pn!4"9n#4$9Mw%y`],Ob=[()=>U,`afterprint`,()=>U,`beforeprint`,()=>Bf,`beforeunload`,()=>Zf,`gamepadconnected`,()=>Zf,`gamepaddisconnected`,()=>Qf,`hashchange`,()=>U,`languagechange`,()=>ap,`message`,()=>ap,`messageerror`,()=>U,`offline`,()=>U,`online`,()=>dp,`pagehide`,()=>lp,`pagereveal`,()=>dp,`pageshow`,()=>up,`pageswap`,()=>hp,`popstate`,()=>gp,`rejectionhandled`,()=>Dp,`storage`,()=>gp,`unhandledrejection`,()=>U,`unload`,`WindowEventHandlersEventMap`,`Pn!4"n#4$n%4&n'4(n)4*n+4,n-4.n/40n142n344n546n748n94:n;4<n=4>n?4@nA4BnC4DnE4FnG4HMwIy`],kb=[`auto`,`block`,`fallback`,`optional`,`swap`,`FontDisplay`,`P.!.".#.$.%Jw&y`],Ab=[`error`,`loaded`,`loading`,`unloaded`,`FontFaceLoadStatus`,`P.!.".#.$Jw%y`],jb=[`pressed`,`touched`,`value`,`GamepadButton`,`P)4!9)4"9'4#9Mw$y`],Mb=[``,`standard`,`xr-standard`,`GamepadMappingType`,`P.!.".#Jw$y`],Nb=[()=>lw,`type`,()=>uw,`params`,()=>dw,`playEffect`,()=>dw,`reset`,`GamepadHapticActuator`,"PPn!2\"n#2$8n%`1&Pn'`1(Mw)y"],Pb=[`closed`,`open`,`pending`,`MIDIPortConnectionState`,`P.!.".#Jw$y`],Fb=[`connected`,`disconnected`,`MIDIPortDeviceState`,`P.!."Jw#y`],Ib=[`input`,`output`,`MIDIPortType`,`P.!."Jw#y`],Lb=[()=>ep,`statechange`,`MIDIPortEventMap`,`Pn!4"Mw#y`],Rb=[`T`,`this`,()=>ap,`ev`,``,`onmessage`,()=>ap,`onmessageerror`,`type`,()=>fw,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,()=>fw,()=>B,`removeEventListener`,()=>z,()=>B,`MessageEventTarget`,`b!PPPe$!2"n#2$"/%,J4&PPe$!2"n'2$"/%,J4(P"2)Pe$!2"n*"f2$"/%2+P)n,J2-8$1.P&2)n/2+P)n0J2-8$1.P"2)Pe$!2"n1"f2$"/%2+P)n2J2-8$13P&2)n42+P)n5J2-8$13Mw6y`],zb=[()=>oy,`transfer`,`StructuredSerializeOptions`,`Pn!F4"8Mw#y`],Bb=[()=>fw,()=>ap,`message`,()=>ap,`messageerror`,`MessagePortEventMap`,`Pn!n"4#n$4%Mw&y`],Vb=[()=>H,()=>pw,0,`this`,()=>U,`ev`,``,`onstatechange`,`scriptURL`,()=>mw,`state`,`message`,()=>oy,`transfer`,`postMessage`,()=>zb,`options`,`type`,0,()=>hw,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>hw,()=>B,`removeEventListener`,()=>z,()=>B,`ServiceWorker`,`Pn!n"PPn#2$n%2&"/',J4(&4)9n*4+9P"2,n-F2.$1/P"2,n0218$1/P"22Pn32$n4"f2&"/'25P)n6J218$17P&22n825P)n9J218$17P"22Pn:2$n;"f2&"/'25P)n<J218$1=P&22n>25P)n?J218$1=Mw@y`],Hb=[`after-transition`,`manual`,`NavigationFocusReset`,`P.!."Jw#y`],Ub=[()=>Y_,``,`NavigationInterceptHandler`,`PPP$$o!"Jv"Mw#y`],Wb=[()=>gw,`controller`,()=>Y_,``,`NavigationPrecommitHandler`,`PPn!2"P$$o#"Jv$Mw%y`],Gb=[`after-transition`,`manual`,`NavigationScrollBehavior`,`P.!."Jw#y`],Kb=[()=>U,`dispose`,`NavigationHistoryEntryEventMap`,`Pn!4"Mw#y`],qb=[()=>Yb,`displayItems`,()=>_w,`modifiers`,()=>vw,`shippingOptions`,`PaymentDetailsBase`,`Pn!F4"8n#F4$8n%F4&8Mw'y`],Jb=[`addressLine`,`city`,`country`,`dependentLocality`,`organization`,`phone`,`postalCode`,`recipient`,`region`,`sortingCode`,`AddressErrors`,`P&4!8&4"8&4#8&4$8&4%8&4&8&4'8&4(8&4)8&4*8Mw+y`],Yb=[()=>yw,`amount`,`label`,`pending`,`PaymentItem`,`Pn!4"&4#)4$8Mw%y`],Xb=[()=>U,`resize`,`PictureInPictureWindowEventMap`,`Pn!4"Mw#y`],Zb=[`arraybuffer`,`blob`,`BinaryType`,`P.!."Jw#y`],Qb=[`closed`,`closing`,`connecting`,`open`,`RTCDataChannelState`,`P.!.".#.$Jw%y`],$b=[()=>U,`bufferedamountlow`,()=>U,`close`,()=>U,`closing`,()=>yp,`error`,()=>ap,`message`,()=>U,`open`,`RTCDataChannelEventMap`,`Pn!4"n#4$n%4&n'4(n)4*n+4,Mw-y`],ex=[()=>fy,`code`,`message`,`name`,1,`INDEX_SIZE_ERR`,2,`DOMSTRING_SIZE_ERR`,3,`HIERARCHY_REQUEST_ERR`,4,`WRONG_DOCUMENT_ERR`,5,`INVALID_CHARACTER_ERR`,6,`NO_DATA_ALLOWED_ERR`,7,`NO_MODIFICATION_ALLOWED_ERR`,8,`NOT_FOUND_ERR`,9,`NOT_SUPPORTED_ERR`,10,`INUSE_ATTRIBUTE_ERR`,11,`INVALID_STATE_ERR`,12,`SYNTAX_ERR`,13,`INVALID_MODIFICATION_ERR`,14,`NAMESPACE_ERR`,15,`INVALID_ACCESS_ERR`,16,`VALIDATION_ERR`,17,`TYPE_MISMATCH_ERR`,18,`SECURITY_ERR`,19,`NETWORK_ERR`,20,`ABORT_ERR`,21,`URL_MISMATCH_ERR`,22,`QUOTA_EXCEEDED_ERR`,23,`TIMEOUT_ERR`,24,`INVALID_NODE_TYPE_ERR`,25,`DATA_CLONE_ERR`,`DOMException`,`Pn!'4"9&4#9&4$9.%4&9.'4(9.)4*9.+4,9.-4.9./409.1429.3449.5469.7489.94:9.;4<9.=4>9.?4@9.A4B9.C4D9.E4F9.G4H9.I4J9.K4L9.M4N9.O4P9.Q4R9.S4T9.U4V9MwWy`],tx=[`data-channel-failure`,`dtls-failure`,`fingerprint-failure`,`hardware-encoder-error`,`hardware-encoder-not-available`,`sctp-failure`,`sdp-syntax-error`,`RTCErrorDetailType`,`P.!.".#.$.%.&.'Jw(y`],nx=[`rtcp`,`rtp`,`RTCIceComponent`,`P.!."Jw#y`],rx=[`tcp`,`udp`,`RTCIceProtocol`,`P.!."Jw#y`],ix=[`active`,`passive`,`so`,`RTCIceTcpCandidateType`,`P.!.".#Jw$y`],ax=[`host`,`prflx`,`relay`,`srflx`,`RTCIceCandidateType`,`P.!.".#.$Jw%y`],ox=[`candidate`,`sdpMLineIndex`,`sdpMid`,`usernameFragment`,`RTCIceCandidateInit`,`P&4!8P',J4"8P&,J4#8P&,J4$8Mw%y`],sx=[()=>bw,`RTCRtpReceiverTransform`,`n!w"y`],cx=[()=>H,()=>xw,`iceTransport`,0,`this`,()=>yp,`ev`,``,`onerror`,0,()=>U,`onstatechange`,()=>Sw,`state`,`getRemoteCertificates`,`type`,0,()=>Cw,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Cw,()=>B,`removeEventListener`,()=>z,()=>B,`RTCDtlsTransport`,`Pn!n"4#9PPn$2%n&2'"/(,J4)PPn*2%n+2'"/(,J4,n-4.9P_F1/P"20Pn12%n2"f2'"/(23P)n4J258$16P&20n723P)n8J258$16P"20Pn92%n:"f2'"/(23P)n;J258$1<P&20n=23P)n>J258$1<Mw?y`],lx=[`audioLevel`,`rtpTimestamp`,`source`,()=>qd,`timestamp`,`RTCRtpContributingSource`,`P'4!8'4"'4#n$4%Mw&y`],ux=[()=>ww,`RTCRtpReceiveParameters`,`Pn!Mw"y`],dx=[`value`,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,`RTCStatsReport`,`PPP"2!&2"n#2$$/%2&"2'8$1(Mw)y`],fx=[()=>lx,`RTCRtpSynchronizationSource`,`Pn!Mw"y`],px=[`inactive`,`recvonly`,`sendonly`,`sendrecv`,`stopped`,`RTCRtpTransceiverDirection`,`P.!.".#.$.%Jw&y`],mx=[()=>Tw,`dtmf`,()=>Cc,`track`,()=>Ew,`transform`,()=>cx,`transport`,()=>Dw,`getParameters`,()=>dx,`getStats`,()=>Cc,`withTrack`,`replaceTrack`,()=>Dw,`parameters`,()=>Ow,`setParameterOptions`,`setParameters`,()=>ic,`streams`,`setStreams`,`RTCRtpSender`,"PPn!,J4\"9Pn#,J4$9Pn%,J4&Pn',J4(9Pn)1*Pn+`1,PPn-,J2.$`1/Pn021n2238$`14Pn5@26$17Mw8y"],hx=[`channels`,`clockRate`,`mimeType`,`sdpFmtpLine`,`RTCRtpCodec`,`P'4!8'4"&4#&4$8Mw%y`],gx=[`isFinal`,`length`,`index`,()=>kw,`item`,()=>kw,`SpeechRecognitionResult`,`P)4!9'4"9P'2#n$1%'n&LMw'y`],_x=[`default`,`lang`,`localService`,`name`,`voiceURI`,`SpeechSynthesisVoice`,`P)4!9&4"9)4#9&4$9&4%9Mw&y`],vx=[()=>Ep,`boundary`,()=>Ep,`end`,()=>Tp,`error`,()=>Ep,`mark`,()=>Ep,`pause`,()=>Ep,`resume`,()=>Ep,`start`,`SpeechSynthesisUtteranceEventMap`,`Pn!4"n#4$n%4&n'4(n)4*n+4,n-4.Mw/y`],yx=[`length`,`id`,()=>Sx,`getCueById`,()=>Sx,`TextTrackCueList`,`P'4!9P&2"Pn#,J1$'n%LMw&y`],bx=[`captions`,`chapters`,`descriptions`,`metadata`,`subtitles`,`TextTrackKind`,`P.!.".#.$.%Jw&y`],xx=[`disabled`,`hidden`,`showing`,`TextTrackMode`,`P.!.".#Jw$y`],Sx=[()=>H,`endTime`,`id`,0,`this`,()=>U,`ev`,``,`onenter`,0,()=>U,`onexit`,`pauseOnExit`,`startTime`,()=>cv,`track`,`type`,0,()=>Aw,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Aw,()=>B,`removeEventListener`,()=>z,()=>B,`TextTrackCue`,`Pn!'4"&4#PPn$2%n&2'"/(,J4)PPn*2%n+2'"/(,J4,)4-'4.Pn/,J409P"21Pn22%n3"f2'"/(24P)n5J268$17P&21n824P)n9J268$17P"21Pn:2%n;"f2'"/(24P)n<J268$1=P&21n>24P)n?J268$1=Mw@y`],Cx=[()=>U,`cuechange`,`TextTrackEventMap`,`Pn!4"Mw#y`],wx=[`length`,`index`,`end`,`start`,`TimeRanges`,`P'4!9P'2"'1#P'2"'1$Mw%y`],Tx=[`code`,`message`,1,`MEDIA_ERR_ABORTED`,2,`MEDIA_ERR_NETWORK`,3,`MEDIA_ERR_DECODE`,4,`MEDIA_ERR_SRC_NOT_SUPPORTED`,`MediaError`,`P'4!9&4"9.#4$9.%4&9.'4(9.)4*9Mw+y`],Ex=[()=>jw,`sessionType`,()=>Mw,`createSession`,()=>Nw,`policy`,()=>Pw,`getStatusForPolicy`,()=>Fw,`serverCertificate`,`setServerCertificate`,`MediaKeys`,"PPn!2\"8n#1$Pn%2&8n'`1(Pn)2*)`1+Mw,y"],Dx=[()=>H,0,`this`,()=>U,`ev`,``,`onconnect`,0,()=>U,`onconnecting`,0,()=>U,`ondisconnect`,()=>Iw,`state`,`id`,`cancelWatchAvailability`,`prompt`,()=>Lw,`callback`,`watchAvailability`,`type`,0,()=>Rw,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Rw,()=>B,`removeEventListener`,()=>z,()=>B,`RemotePlayback`,`Pn!PPn"2#n$2%"/&,J4'PPn(2#n)2%"/&,J4*PPn+2#n,2%"/&,J4-n.4/9P'208$\`11P$\`12Pn324'\`15P"26Pn72#n8"f2%"/&29P)n:J2;8$1<P&26n=29P)n>J2;8$1<P"26Pn?2#n@"f2%"/&29P)nAJ2;8$1BP&26nC29P)nDJ2;8$1BMwEy`],Ox=[()=>ic,()=>zw,()=>Xc,`MediaProvider`,`Pn!n"n#Jw$y`],kx=[()=>H,`length`,0,`this`,()=>Ap,`ev`,``,`onaddtrack`,0,()=>U,`onchange`,0,()=>Ap,`onremovetrack`,`id`,()=>cv,`getTrackById`,`type`,0,()=>Bw,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Bw,()=>B,`removeEventListener`,()=>z,()=>B,()=>cv,`TextTrackList`,`Pn!'4"9PPn#2$n%2&"/',J4(PPn)2$n*2&"/',J4+PPn,2$n-2&"/',J4.P&2/Pn0,J11P"22Pn32$n4"f2&"/'25P)n6J278$18P&22n925P)n:J278$18P"22Pn;2$n<"f2&"/'25P)n=J278$1>P&22n?25P)n@J278$1>'nALMwBy`],Ax=[``,`maybe`,`probably`,`CanPlayTypeResult`,`P.!.".#Jw$y`],jx=[`T`,` `,``,`OptionalPrefixToken`,`b!PPe#!."S.#Jw$y`],Mx=[`section-`,`AutoFillSection`,`P.!&Sw"y`],Nx=[`billing`,`shipping`,`AutoFillAddressKind`,`P.!."Jw#y`],Px=[()=>Vw,()=>jx,()=>Hw,()=>Uw,`AutoFillField`,`Pn!Pn#o""n$SJw%y`],Fx=[`T`,` `,``,`OptionalPostfixToken`,`b!PP."e#!S.#Jw$y`],Ix=[`webauthn`,`AutoFillCredentialField`,`.!w"y`],Lx=[`name`,()=>Ww,`root`,`FileSystem`,`P&4!9n"4#9Mw$y`],Rx=[()=>bv,`entry`,``,`FileSystemEntryCallback`,`PPn!2"$v#Mw$y`],zx=[()=>ex,`err`,``,`ErrorCallback`,`PPn!2"$v#Mw$y`],Bx=[()=>qd,`captureTime`,()=>qd,`expectedDisplayTime`,`height`,`mediaTime`,()=>qd,`presentationTime`,`presentedFrames`,`processingDuration`,()=>qd,`receiveTime`,`rtpTimestamp`,`width`,`VideoFrameCallbackMetadata`,`Pn!4"8n#4$'4%'4&n'4('4)'4*8n+4,8'4-8'4.Mw/y`],Vx=[`length`,`numberOfItems`,()=>O_,`newItem`,()=>O_,`appendItem`,`clear`,()=>O_,`consolidate`,()=>Fu,`matrix`,()=>O_,`createSVGTransformFromMatrix`,`index`,()=>O_,`getItem`,()=>O_,()=>O_,`initialize`,()=>O_,()=>O_,`insertItemBefore`,()=>O_,`removeItem`,()=>O_,()=>O_,`replaceItem`,()=>O_,`SVGTransformList`,`P'4!9'4"9Pn#2$n%1&P$1'PPn(,J1)Pn*2+8n,1-P'2.n/10Pn12$n213Pn42$'2.n516P'2.n718Pn92$'2.n:1;'n<LMw=y`],Hx=[`length`,`numberOfItems`,()=>E_,`newItem`,()=>E_,`appendItem`,`clear`,`index`,()=>E_,`getItem`,()=>E_,()=>E_,`initialize`,()=>E_,()=>E_,`insertItemBefore`,()=>E_,`removeItem`,()=>E_,()=>E_,`replaceItem`,()=>E_,`SVGNumberList`,`P'4!9'4"9Pn#2$n%1&P$1'P'2(n)1*Pn+2$n,1-Pn.2$'2(n/10P'2(n112Pn32$'2(n415'n6LMw7y`],Ux=[`align`,`meetOrSlice`,0,`SVG_PRESERVEASPECTRATIO_UNKNOWN`,1,`SVG_PRESERVEASPECTRATIO_NONE`,2,`SVG_PRESERVEASPECTRATIO_XMINYMIN`,3,`SVG_PRESERVEASPECTRATIO_XMIDYMIN`,4,`SVG_PRESERVEASPECTRATIO_XMAXYMIN`,5,`SVG_PRESERVEASPECTRATIO_XMINYMID`,6,`SVG_PRESERVEASPECTRATIO_XMIDYMID`,7,`SVG_PRESERVEASPECTRATIO_XMAXYMID`,8,`SVG_PRESERVEASPECTRATIO_XMINYMAX`,9,`SVG_PRESERVEASPECTRATIO_XMIDYMAX`,10,`SVG_PRESERVEASPECTRATIO_XMAXYMAX`,0,`SVG_MEETORSLICE_UNKNOWN`,1,`SVG_MEETORSLICE_MEET`,2,`SVG_MEETORSLICE_SLICE`,`SVGPreserveAspectRatio`,`P'4!'4".#4$9.%4&9.'4(9.)4*9.+4,9.-4.9./409.1429.3449.5469.7489.94:9.;4<9.=4>9Mw?y`],Wx=[`length`,`numberOfItems`,()=>D_,`newItem`,()=>D_,`appendItem`,`clear`,`index`,()=>D_,`getItem`,()=>D_,()=>D_,`initialize`,()=>D_,()=>D_,`insertItemBefore`,()=>D_,`removeItem`,()=>D_,()=>D_,`replaceItem`,()=>D_,`SVGPointList`,`P'4!9'4"9Pn#2$n%1&P$1'P'2(n)1*Pn+2$n,1-Pn.2$'2(n/10P'2(n112Pn32$'2(n415'n6LMw7y`],Gx=[()=>Gw,`animVal`,()=>Gw,`baseVal`,`SVGAnimatedLengthList`,`Pn!4"9n#4$9Mw%y`],Kx=[()=>qd,`time`,``,`FrameRequestCallback`,`PPn!2"$v#Mw$y`],qx=[`cacheName`,`delete`,`has`,`keys`,()=>eS,()=>zp,`request`,()=>Kw,`options`,()=>nS,`match`,()=>qw,`open`,`CacheStorage`,"PP&2!)`1\"P&2!)`1#P&F`1$PPn%n&J2'n(2)8Pn*-J`1+P&2!n,`1-Mw.y"],Jx=[()=>Jw,`subtle`,`array`,`getRandomValues`,`-`,`randomUUID`,`Crypto`,`Pn!4"9P"2#"1$PP&.%&.%&.%&.%&S1&Mw'y`],Yx=[`first`,`second`,`cmp`,()=>Yw,`databases`,`name`,()=>Xw,`deleteDatabase`,`version`,()=>Xw,`open`,`IDBFactory`,`PP"2!"2"'1#Pn$F\`1%P&2&n'1(P&2&'2)8n*1+Mw,y`],Xx=[()=>H,()=>Zw,`eventCounts`,`interactionCount`,()=>Qw,`navigation`,0,`this`,()=>U,`ev`,``,`onresourcetimingbufferfull`,()=>qd,`timeOrigin`,()=>$w,`timing`,`markName`,`clearMarks`,`measureName`,`clearMeasures`,`clearResourceTimings`,()=>eT,`getEntries`,`name`,`type`,()=>eT,`getEntriesByName`,()=>eT,`getEntriesByType`,()=>tT,`markOptions`,()=>nT,`mark`,()=>rT,`startOrMeasureOptions`,`endMark`,()=>iT,`measure`,()=>qd,`now`,`maxSize`,`setResourceTimingBufferSize`,`toJSON`,0,()=>aT,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>aT,()=>B,`removeEventListener`,()=>z,()=>B,`Performance`,`Pn!n"4#9'4$9n%4&9PPn'2(n)2*"/+,J4,n-4.9n/409P&218$12P&238$14P$15Pn617P&28&298n:1;P&29n<1=P&21n>2?8n@1AP&23P&nBJ2C8&2D8nE1FPnG1HP'2I$1JP"1KP"29PnL2(nM"f2*"/+2NP)nOJ2P8$1QP&29nR2NP)nSJ2P8$1QP"29PnT2(nU"f2*"/+2NP)nVJ2P8$1WP&29nX2NP)nYJ2P8$1WMwZy`],Zx=[()=>oT,`callback`,()=>sT,`options`,`postTask`,`yield`,`Scheduler`,'PPn!2"n#2$8"`1%P$`1&Mw\'y'],Qx=[()=>hu,()=>Xc,()=>xu,`ImageBitmapSource`,`Pn!n"n#Jw$y`],$x=[()=>cT,`colorSpaceConversion`,()=>lT,`imageOrientation`,()=>uT,`premultiplyAlpha`,`resizeHeight`,()=>dT,`resizeQuality`,`resizeWidth`,`ImageBitmapOptions`,`Pn!4"8n#4$8n%4&8'4'8n(4)8'4*8Mw+y`],eS=[()=>fT,`RequestInfo`,`Pn!&Jw"y`],tS=[()=>NS,`body`,()=>pT,`cache`,()=>mT,`credentials`,()=>hT,`headers`,`integrity`,`keepalive`,`method`,()=>gT,`mode`,()=>_T,`priority`,()=>vT,`redirect`,`referrer`,()=>gv,`referrerPolicy`,()=>il,`signal`,`window`,`RequestInit`,`PPn!,J4"8n#4$8n%4&8n'4(8&4)8)4*8&4+8n,4-8n.4/8n0418&428n3448Pn5,J468,478Mw8y`],nS=[()=>yT,()=>bT,`headers`,`ok`,`redirected`,`status`,`statusText`,()=>xT,`type`,`url`,0,`clone`,`Response`,`Pn!n"4#9)4$9)4%9'4&9&4'9n(4)9&4*9Pn+1,Mw-y`],rS=[``,`VoidFunction`,`PP$v!Mw"y`],iS=[()=>Function,`TimerHandler`,`P&Pu!Jw"y`],aS=[`webdriver`,`NavigatorAutomationInformation`,`P)4!9Mw"y`],oS=[`clearAppBadge`,`contents`,`setAppBadge`,`NavigatorBadge`,"PP$`1!P'2\"8$`1#Mw$y"],sS=[`hardwareConcurrency`,`NavigatorConcurrentHardware`,`P'4!9Mw"y`],cS=[`scheme`,()=>zp,`url`,`registerProtocolHandler`,`NavigatorContentUtils`,`PP&2!P&n"J2#$1$Mw%y`],lS=[`cookieEnabled`,`NavigatorCookies`,`P)4!9Mw"y`],uS=[()=>ST,`gpu`,`NavigatorGPU`,`Pn!4"9Mw#y`],dS=[`appCodeName`,`appName`,`appVersion`,`platform`,`product`,`productSub`,`userAgent`,`vendor`,`vendorSub`,`NavigatorID`,`P&4!9&4"9&4#9&4$9&4%9&4&9&4'9&4(9&4)9Mw*y`],fS=[`language`,()=>$d,`languages`,`NavigatorLanguage`,`P&4!9&o""4#9Mw$y`],pS=[()=>CT,`locks`,`NavigatorLocks`,`Pn!4"9Mw#y`],mS=[`onLine`,`NavigatorOnLine`,`P)4!9Mw"y`],hS=[()=>wT,`mimeTypes`,`pdfViewerEnabled`,()=>TT,`plugins`,`javaEnabled`,`NavigatorPlugins`,`Pn!4"9)4#9n$4%9P)1&Mw'y`],gS=[()=>ET,`storage`,`NavigatorStorage`,`Pn!4"9Mw#y`],_S=[()=>H,()=>DT,`read`,`readText`,()=>DT,`data`,`write`,`writeText`,`Clipboard`,"Pn!Pn\"`1#P&`1$Pn%2&$`1'P&2&$`1(Mw)y"],vS=[()=>OT,`options`,()=>kT,`create`,()=>AT,()=>kT,`get`,`preventSilentAccess`,()=>kT,`credential`,`store`,`CredentialsContainer`,'PPn!2"8Pn#,J`1$Pn%2"8Pn&,J`1\'P$`1(Pn)2*$`1+Mw,y'],yS=[`watchId`,`clearWatch`,()=>jT,`successCallback`,()=>MT,`errorCallback`,()=>NT,`options`,`getCurrentPosition`,()=>jT,()=>MT,()=>NT,`watchPosition`,`Geolocation`,`PP'2!$1"Pn#2$Pn%,J2&8n'2(8$1)Pn*2$Pn+,J2&8n,2(8'1-Mw.y`],bS=[()=>PT,`status`,`setStatus`,`NavigatorLogin`,'PPn!2"$`1#Mw$y'],xS=[()=>FT,`configuration`,()=>IT,`decodingInfo`,()=>LT,()=>RT,`encodingInfo`,`MediaCapabilities`,'PPn!2"n#`1$Pn%2"n&`1\'Mw(y'],SS=[()=>H,0,`this`,()=>U,`ev`,``,`ondevicechange`,()=>zT,`enumerateDevices`,()=>BT,`options`,()=>ic,`getDisplayMedia`,()=>VT,`getSupportedConstraints`,()=>HT,`constraints`,()=>ic,`getUserMedia`,`type`,0,()=>UT,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>UT,()=>B,`removeEventListener`,()=>z,()=>B,`MediaDevices`,'Pn!PPn"2#n$2%"/&,J4\'Pn(F`1)Pn*2+8n,`1-Pn.1/Pn0218n2`13P"24Pn52#n6"f2%"/&27P)n8J2+8$19P&24n:27P)n;J2+8$19P"24Pn<2#n="f2%"/&27P)n>J2+8$1?P&24n@27P)nAJ2+8$1?MwBy'],CS=[()=>WT,`metadata`,()=>GT,`playbackState`,()=>KT,`action`,()=>qT,`handler`,`setActionHandler`,`active`,`setCameraActive`,`setMicrophoneActive`,()=>JT,`state`,`setPositionState`,`MediaSession`,"PPn!,J4\"n#4$Pn%2&Pn',J2($1)P)2*$`1+P)2*$`1,Pn-2.8$1/Mw0y"],wS=[()=>YT,`permissionDesc`,()=>XT,`query`,`Permissions`,'PPn!2"n#`1$Mw%y'],TS=[()=>H,()=>Vb,`controller`,0,`this`,()=>U,`ev`,``,`oncontrollerchange`,0,()=>ap,`onmessage`,0,()=>ap,`onmessageerror`,()=>ZT,`ready`,()=>zp,`clientURL`,()=>ZT,`getRegistration`,()=>$d,()=>ZT,`getRegistrations`,()=>zp,`scriptURL`,()=>QT,`options`,()=>ZT,`register`,`startMessages`,`type`,0,()=>$T,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>$T,()=>B,`removeEventListener`,()=>z,()=>B,`ServiceWorkerContainer`,`Pn!Pn",J4#9PPn$2%n&2'"/(,J4)PPn*2%n+2'"/(,J4,PPn-2%n.2'"/(,J4/n0\`419PP&n2J238Pn4-J\`15Pn7o6"\`18PP&n9J2:n;2<8n=\`1>P$1?P"2@PnA2%nB"f2'"/(2CP)nDJ2<8$1EP&2@nF2CP)nGJ2<8$1EP"2@PnH2%nI"f2'"/(2CP)nJJ2<8$1KP&2@nL2CP)nMJ2<8$1KMwNy`],ES=[`hasBeenActive`,`isActive`,`UserActivation`,`P)4!9)4"9Mw#y`],DS=[()=>eE,`type`,()=>tE,`request`,`WakeLock`,'PPn!2"8n#`1$Mw%y'],OS=[()=>ou,`files`,`text`,`title`,`url`,`ShareData`,`Pn!F4"8&4#8&4$8&4%8Mw&y`],kS=[`software`,`sysex`,`MIDIOptions`,`P)4!8)4"8Mw#y`],AS=[()=>H,()=>nE,`inputs`,0,`this`,()=>ep,`ev`,``,`onstatechange`,()=>rE,`outputs`,`sysexEnabled`,`type`,0,()=>iE,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>iE,()=>B,`removeEventListener`,()=>z,()=>B,`MIDIAccess`,`Pn!n"4#9PPn$2%n&2'"/(,J4)n*4+9)4,9P"2-Pn.2%n/"f2'"/(20P)n1J228$13P&2-n420P)n5J228$13P"2-Pn62%n7"f2'"/(20P)n8J228$19P&2-n:20P)n;J228$19Mw<y`],jS=[()=>aE,`audioCapabilities`,()=>oE,`distinctiveIdentifier`,`initDataTypes`,`label`,()=>oE,`persistentState`,`sessionTypes`,()=>aE,`videoCapabilities`,`MediaKeySystemConfiguration`,`Pn!F4"8n#4$8&F4%8&4&8n'4(8&F4)8n*F4+8Mw,y`],MS=[`keySystem`,()=>Ex,`createMediaKeys`,()=>jS,`getConfiguration`,`MediaKeySystemAccess`,'P&4!9Pn"`1#Pn$1%Mw&y'],NS=[()=>Kd,()=>sE,`BodyInit`,`Pn!n"Jw#y`],PS=[`VibratePattern`,`P''FJw!y`],FS=[`domain`,`name`,`partitioned`,`path`,`CookieStoreDeleteOptions`,`PP&,J4!8&4")4#8&4$8Mw%y`],IS=[`name`,`url`,`CookieStoreGetOptions`,`P&4!8&4"8Mw#y`],LS=[()=>N_,`CookieList`,`n!Fw"y`],RS=[`domain`,()=>qd,`expires`,`name`,`partitioned`,`path`,()=>cE,`sameSite`,`value`,`CookieInit`,`PP&,J4!8Pn",J4#8&4$)4%8&4&8n'4(8&4)Mw*y`],zS=[()=>Gf,`change`,`CookieStoreEventMap`,`Pn!4"Mw#y`],BS=[`auto`,`manual`,`ScrollRestoration`,`P.!."Jw#y`],VS=[`committed`,`finished`,()=>K_,`from`,()=>W_,`navigationType`,`NavigationTransition`,"P$`4!9$`4\"9n#4$9n%4&9Mw'y"],HS=[`info`,`NavigationOptions`,`P"4!8Mw"y`],US=[()=>K_,`committed`,()=>K_,`finished`,`NavigationResult`,'Pn!`4"8n#`4$8Mw%y'],WS=[()=>HS,()=>lE,`history`,`state`,`NavigationNavigateOptions`,`Pn!n"4#8"4$8Mw%y`],GS=[()=>HS,`state`,`NavigationReloadOptions`,`Pn!"4"8Mw#y`],KS=[`state`,`NavigationUpdateCurrentEntryOptions`,`P"4!Mw"y`],qS=[()=>sp,`currententrychange`,()=>op,`navigate`,()=>Yd,`navigateerror`,()=>U,`navigatesuccess`,`NavigationEventMap`,`Pn!4"n#4$n%4&n'4(Mw)y`],JS=[()=>H,`angle`,0,`this`,()=>U,`ev`,``,`onchange`,()=>uE,`type`,()=>dE,`orientation`,`lock`,`unlock`,0,()=>fE,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>fE,()=>B,`removeEventListener`,()=>z,()=>B,`ScreenOrientation`,`Pn!'4"9PPn#2$n%2&"/',J4(n)4*9Pn+2,$\`1-P$1.P"2*Pn/2$n0"f2&"/'21P)n2J238$14P&2*n521P)n6J238$14P"2*Pn72$n8"f2&"/'21P)n9J238$1:P&2*n;21P)n<J238$1:Mw=y`],YS=[()=>U,`voiceschanged`,`SpeechSynthesisEventMap`,`Pn!4"Mw#y`],XS=[()=>U,`resize`,()=>U,`scroll`,`VisualViewportEventMap`,`Pn!4"n#4$Mw%y`],ZS=[()=>pE,`accentColor`,`alignContent`,`alignItems`,`alignSelf`,`alignmentBaseline`,`all`,`anchorName`,`anchorScope`,`animation`,`animationComposition`,`animationDelay`,`animationDirection`,`animationDuration`,`animationFillMode`,`animationIterationCount`,`animationName`,`animationPlayState`,`animationRange`,`animationRangeEnd`,`animationRangeStart`,`animationTimeline`,`animationTimingFunction`,`appearance`,`aspectRatio`,`backdropFilter`,`backfaceVisibility`,`background`,`backgroundAttachment`,`backgroundBlendMode`,`backgroundClip`,`backgroundColor`,`backgroundImage`,`backgroundOrigin`,`backgroundPosition`,`backgroundPositionX`,`backgroundPositionY`,`backgroundRepeat`,`backgroundSize`,`baselineShift`,`baselineSource`,`blockSize`,`border`,`borderBlock`,`borderBlockColor`,`borderBlockEnd`,`borderBlockEndColor`,`borderBlockEndStyle`,`borderBlockEndWidth`,`borderBlockStart`,`borderBlockStartColor`,`borderBlockStartStyle`,`borderBlockStartWidth`,`borderBlockStyle`,`borderBlockWidth`,`borderBottom`,`borderBottomColor`,`borderBottomLeftRadius`,`borderBottomRightRadius`,`borderBottomStyle`,`borderBottomWidth`,`borderCollapse`,`borderColor`,`borderEndEndRadius`,`borderEndStartRadius`,`borderImage`,`borderImageOutset`,`borderImageRepeat`,`borderImageSlice`,`borderImageSource`,`borderImageWidth`,`borderInline`,`borderInlineColor`,`borderInlineEnd`,`borderInlineEndColor`,`borderInlineEndStyle`,`borderInlineEndWidth`,`borderInlineStart`,`borderInlineStartColor`,`borderInlineStartStyle`,`borderInlineStartWidth`,`borderInlineStyle`,`borderInlineWidth`,`borderLeft`,`borderLeftColor`,`borderLeftStyle`,`borderLeftWidth`,`borderRadius`,`borderRight`,`borderRightColor`,`borderRightStyle`,`borderRightWidth`,`borderSpacing`,`borderStartEndRadius`,`borderStartStartRadius`,`borderStyle`,`borderTop`,`borderTopColor`,`borderTopLeftRadius`,`borderTopRightRadius`,`borderTopStyle`,`borderTopWidth`,`borderWidth`,`bottom`,`boxDecorationBreak`,`boxShadow`,`boxSizing`,`breakAfter`,`breakBefore`,`breakInside`,`captionSide`,`caretColor`,`clear`,`clip`,`clipPath`,`clipRule`,`color`,`colorInterpolation`,`colorInterpolationFilters`,`colorScheme`,`columnCount`,`columnFill`,`columnGap`,`columnRule`,`columnRuleColor`,`columnRuleStyle`,`columnRuleWidth`,`columnSpan`,`columnWidth`,`columns`,`contain`,`containIntrinsicBlockSize`,`containIntrinsicHeight`,`containIntrinsicInlineSize`,`containIntrinsicSize`,`containIntrinsicWidth`,`container`,`containerName`,`containerType`,`content`,`contentVisibility`,`counterIncrement`,`counterReset`,`counterSet`,`cssFloat`,`cursor`,`cx`,`cy`,`d`,`direction`,`display`,`dominantBaseline`,`dynamicRangeLimit`,`emptyCells`,`fieldSizing`,`fill`,`fillOpacity`,`fillRule`,`filter`,`flex`,`flexBasis`,`flexDirection`,`flexFlow`,`flexGrow`,`flexShrink`,`flexWrap`,`float`,`floodColor`,`floodOpacity`,`font`,`fontFamily`,`fontFeatureSettings`,`fontKerning`,`fontLanguageOverride`,`fontOpticalSizing`,`fontPalette`,`fontSize`,`fontSizeAdjust`,`fontStretch`,`fontStyle`,`fontSynthesis`,`fontSynthesisSmallCaps`,`fontSynthesisStyle`,`fontSynthesisWeight`,`fontVariant`,`fontVariantAlternates`,`fontVariantCaps`,`fontVariantEastAsian`,`fontVariantEmoji`,`fontVariantLigatures`,`fontVariantNumeric`,`fontVariantPosition`,`fontVariationSettings`,`fontWeight`,`forcedColorAdjust`,`gap`,`grid`,`gridArea`,`gridAutoColumns`,`gridAutoFlow`,`gridAutoRows`,`gridColumn`,`gridColumnEnd`,`gridColumnGap`,`gridColumnStart`,`gridGap`,`gridRow`,`gridRowEnd`,`gridRowGap`,`gridRowStart`,`gridTemplate`,`gridTemplateAreas`,`gridTemplateColumns`,`gridTemplateRows`,`height`,`hyphenateCharacter`,`hyphenateLimitChars`,`hyphens`,`imageOrientation`,`imageRendering`,`inlineSize`,`inset`,`insetBlock`,`insetBlockEnd`,`insetBlockStart`,`insetInline`,`insetInlineEnd`,`insetInlineStart`,`isolation`,`justifyContent`,`justifyItems`,`justifySelf`,`left`,`letterSpacing`,`lightingColor`,`lineBreak`,`lineHeight`,`listStyle`,`listStyleImage`,`listStylePosition`,`listStyleType`,`margin`,`marginBlock`,`marginBlockEnd`,`marginBlockStart`,`marginBottom`,`marginInline`,`marginInlineEnd`,`marginInlineStart`,`marginLeft`,`marginRight`,`marginTop`,`marker`,`markerEnd`,`markerMid`,`markerStart`,`mask`,`maskClip`,`maskComposite`,`maskImage`,`maskMode`,`maskOrigin`,`maskPosition`,`maskRepeat`,`maskSize`,`maskType`,`mathDepth`,`mathShift`,`mathStyle`,`maxBlockSize`,`maxHeight`,`maxInlineSize`,`maxWidth`,`minBlockSize`,`minHeight`,`minInlineSize`,`minWidth`,`mixBlendMode`,`objectFit`,`objectPosition`,`offset`,`offsetAnchor`,`offsetDistance`,`offsetPath`,`offsetPosition`,`offsetRotate`,`opacity`,`order`,`orphans`,`outline`,`outlineColor`,`outlineOffset`,`outlineStyle`,`outlineWidth`,`overflow`,`overflowAnchor`,`overflowBlock`,`overflowClipMargin`,`overflowInline`,`overflowWrap`,`overflowX`,`overflowY`,`overscrollBehavior`,`overscrollBehaviorBlock`,`overscrollBehaviorInline`,`overscrollBehaviorX`,`overscrollBehaviorY`,`padding`,`paddingBlock`,`paddingBlockEnd`,`paddingBlockStart`,`paddingBottom`,`paddingInline`,`paddingInlineEnd`,`paddingInlineStart`,`paddingLeft`,`paddingRight`,`paddingTop`,`page`,`pageBreakAfter`,`pageBreakBefore`,`pageBreakInside`,`paintOrder`,`perspective`,`perspectiveOrigin`,`placeContent`,`placeItems`,`placeSelf`,`pointerEvents`,`position`,`positionAnchor`,`positionArea`,`positionTry`,`positionTryFallbacks`,`positionTryOrder`,`positionVisibility`,`printColorAdjust`,`quotes`,`r`,`resize`,`right`,`rotate`,`rowGap`,`rubyAlign`,`rubyPosition`,`rx`,`ry`,`scale`,`scrollBehavior`,`scrollMargin`,`scrollMarginBlock`,`scrollMarginBlockEnd`,`scrollMarginBlockStart`,`scrollMarginBottom`,`scrollMarginInline`,`scrollMarginInlineEnd`,`scrollMarginInlineStart`,`scrollMarginLeft`,`scrollMarginRight`,`scrollMarginTop`,`scrollPadding`,`scrollPaddingBlock`,`scrollPaddingBlockEnd`,`scrollPaddingBlockStart`,`scrollPaddingBottom`,`scrollPaddingInline`,`scrollPaddingInlineEnd`,`scrollPaddingInlineStart`,`scrollPaddingLeft`,`scrollPaddingRight`,`scrollPaddingTop`,`scrollSnapAlign`,`scrollSnapStop`,`scrollSnapType`,`scrollTimeline`,`scrollTimelineAxis`,`scrollTimelineName`,`scrollbarColor`,`scrollbarGutter`,`scrollbarWidth`,`shapeImageThreshold`,`shapeMargin`,`shapeOutside`,`shapeRendering`,`stopColor`,`stopOpacity`,`stroke`,`strokeDasharray`,`strokeDashoffset`,`strokeLinecap`,`strokeLinejoin`,`strokeMiterlimit`,`strokeOpacity`,`strokeWidth`,`tabSize`,`tableLayout`,`textAlign`,`textAlignLast`,`textAnchor`,`textAutospace`,`textBox`,`textBoxEdge`,`textBoxTrim`,`textCombineUpright`,`textDecoration`,`textDecorationColor`,`textDecorationLine`,`textDecorationSkipInk`,`textDecorationStyle`,`textDecorationThickness`,`textEmphasis`,`textEmphasisColor`,`textEmphasisPosition`,`textEmphasisStyle`,`textIndent`,`textJustify`,`textOrientation`,`textOverflow`,`textRendering`,`textShadow`,`textTransform`,`textUnderlineOffset`,`textUnderlinePosition`,`textWrap`,`textWrapMode`,`textWrapStyle`,`timelineScope`,`top`,`touchAction`,`transform`,`transformBox`,`transformOrigin`,`transformStyle`,`transition`,`transitionBehavior`,`transitionDelay`,`transitionDuration`,`transitionProperty`,`transitionTimingFunction`,`translate`,`unicodeBidi`,`userSelect`,`vectorEffect`,`verticalAlign`,`viewTimeline`,`viewTimelineAxis`,`viewTimelineInset`,`viewTimelineName`,`viewTransitionClass`,`viewTransitionName`,`visibility`,`webkitAlignContent`,`webkitAlignItems`,`webkitAlignSelf`,`webkitAnimation`,`webkitAnimationDelay`,`webkitAnimationDirection`,`webkitAnimationDuration`,`webkitAnimationFillMode`,`webkitAnimationIterationCount`,`webkitAnimationName`,`webkitAnimationPlayState`,`webkitAnimationTimingFunction`,`webkitAppearance`,`webkitBackfaceVisibility`,`webkitBackgroundClip`,`webkitBackgroundOrigin`,`webkitBackgroundSize`,`webkitBorderBottomLeftRadius`,`webkitBorderBottomRightRadius`,`webkitBorderRadius`,`webkitBorderTopLeftRadius`,`webkitBorderTopRightRadius`,`webkitBoxAlign`,`webkitBoxFlex`,`webkitBoxOrdinalGroup`,`webkitBoxOrient`,`webkitBoxPack`,`webkitBoxShadow`,`webkitBoxSizing`,`webkitFilter`,`webkitFlex`,`webkitFlexBasis`,`webkitFlexDirection`,`webkitFlexFlow`,`webkitFlexGrow`,`webkitFlexShrink`,`webkitFlexWrap`,`webkitJustifyContent`,`webkitLineClamp`,`webkitMask`,`webkitMaskBoxImage`,`webkitMaskBoxImageOutset`,`webkitMaskBoxImageRepeat`,`webkitMaskBoxImageSlice`,`webkitMaskBoxImageSource`,`webkitMaskBoxImageWidth`,`webkitMaskClip`,`webkitMaskComposite`,`webkitMaskImage`,`webkitMaskOrigin`,`webkitMaskPosition`,`webkitMaskRepeat`,`webkitMaskSize`,`webkitOrder`,`webkitPerspective`,`webkitPerspectiveOrigin`,`webkitTextFillColor`,`webkitTextSizeAdjust`,`webkitTextStroke`,`webkitTextStrokeColor`,`webkitTextStrokeWidth`,`webkitTransform`,`webkitTransformOrigin`,`webkitTransformStyle`,`webkitTransition`,`webkitTransitionDelay`,`webkitTransitionDuration`,`webkitTransitionProperty`,`webkitTransitionTimingFunction`,`webkitUserSelect`,`whiteSpace`,`whiteSpaceCollapse`,`widows`,`width`,`willChange`,`wordBreak`,`wordSpacing`,`wordWrap`,`writingMode`,`x`,`y`,`zIndex`,`zoom`,`CSSStyleProperties`,`Pn!&4"&4#&4$&4%&4&&4'&4(&4)&4*&4+&4,&4-&4.&4/&40&41&42&43&44&45&46&47&48&49&4:&4;&4<&4=&4>&4?&4@&4A&4B&4C&4D&4E&4F&4G&4H&4I&4J&4K&4L&4M&4N&4O&4P&4Q&4R&4S&4T&4U&4V&4W&4X&4Y&4Z&4[&4\\&4]&4^&4_&4\`&4a&4b&4c&4d&4e&4f&4g&4h&4i&4j&4k&4l&4m&4n&4o&4p&4q&4r&4s&4t&4u&4v&4w&4x&4y&4z&4{&4|&4}&4~&4&4&4&4&4&4&4
&4&4&4&4&4&4&4&4&4&4&4&4&4&4&4&4&4&4&4&4&4&4&4&4&4&4&4\xA0&4¡&4¢&4£&4¤&4¥&4¦&4§&4¨&4©&4ª&4«&4¬&4&4®&4¯&4°&4±&4²&4³&4´&4µ&4¶&4·&4¸&4¹&4º&4»&4¼&4½&4¾&4¿&4À&4Á&4Â&4Ã&4Ä&4Å&4Æ&4Ç&4È&4É&4Ê&4Ë&4Ì&4Í&4Î&4Ï&4Ð&4Ñ&4Ò&4Ó&4Ô&4Õ&4Ö&4×&4Ø&4Ù&4Ú&4Û&4Ü&4Ý&4Þ&4ß&4à&4á&4â&4ã&4ä&4å&4æ&4ç&4è&4é&4ê&4ë&4ì&4í&4î&4ï&4ð&4ñ&4ò&4ó&4ô&4õ&4ö&4÷&4ø&4ù&4ú&4û&4ü&4ý&4þ&4ÿ&4Ā&4ā&4Ă&4ă&4Ą&4ą&4Ć&4ć&4Ĉ&4ĉ&4Ċ&4ċ&4Č&4č&4Ď&4ď&4Đ&4đ&4Ē&4ē&4Ĕ&4ĕ&4Ė&4ė&4Ę&4ę&4Ě&4ě&4Ĝ&4ĝ&4Ğ&4ğ&4Ġ&4ġ&4Ģ&4ģ&4Ĥ&4ĥ&4Ħ&4ħ&4Ĩ&4ĩ&4Ī&4ī&4Ĭ&4ĭ&4Į&4į&4İ&4ı&4IJ&4ij&4Ĵ&4ĵ&4Ķ&4ķ&4ĸ&4Ĺ&4ĺ&4Ļ&4ļ&4Ľ&4ľ&4Ŀ&4ŀ&4Ł&4ł&4Ń&4ń&4Ņ&4ņ&4Ň&4ň&4ʼn&4Ŋ&4ŋ&4Ō&4ō&4Ŏ&4ŏ&4Ő&4ő&4Œ&4œ&4Ŕ&4ŕ&4Ŗ&4ŗ&4Ř&4ř&4Ś&4ś&4Ŝ&4ŝ&4Ş&4ş&4Š&4š&4Ţ&4ţ&4Ť&4ť&4Ŧ&4ŧ&4Ũ&4ũ&4Ū&4ū&4Ŭ&4ŭ&4Ů&4ů&4Ű&4ű&4Ų&4ų&4Ŵ&4ŵ&4Ŷ&4ŷ&4Ÿ&4Ź&4ź&4Ż&4ż&4Ž&4ž&4ſ&4ƀ&4Ɓ&4Ƃ&4ƃ&4Ƅ&4ƅ&4Ɔ&4Ƈ&4ƈ&4Ɖ&4Ɗ&4Ƌ&4ƌ&4ƍ&4Ǝ&4Ə&4Ɛ&4Ƒ&4ƒ&4Ɠ&4Ɣ&4ƕ&4Ɩ&4Ɨ&4Ƙ&4ƙ&4ƚ&4ƛ&4Ɯ&4Ɲ&4ƞ&4Ɵ&4Ơ&4ơ&4Ƣ&4ƣ&4Ƥ&4ƥ&4Ʀ&4Ƨ&4ƨ&4Ʃ&4ƪ&4ƫ&4Ƭ&4ƭ&4Ʈ&4Ư&4ư&4Ʊ&4Ʋ&4Ƴ&4ƴ&4Ƶ&4ƶ&4Ʒ&4Ƹ&4ƹ&4ƺ&4ƻ&4Ƽ&4ƽ&4ƾ&4ƿ&4ǀ&4ǁ&4ǂ&4ǃ&4DŽ&4Dž&4dž&4LJ&4Lj&4lj&4NJ&4Nj&4nj&4Ǎ&4ǎ&4Ǐ&4ǐ&4Ǒ&4ǒ&4Ǔ&4ǔ&4Ǖ&4ǖ&4Ǘ&4ǘ&4Ǚ&4ǚ&4Ǜ&4ǜ&4ǝ&4Ǟ&4ǟ&4Ǡ&4ǡ&4Ǣ&4ǣ&4Ǥ&4ǥ&4Ǧ&4ǧ&4Ǩ&4ǩ&4Ǫ&4ǫ&4Ǭ&4ǭ&4Ǯ&4ǯ&4ǰ&4DZ&4Dz&4dz&4Ǵ&4ǵ&4Ƕ&4Ƿ&4Ǹ&4ǹ&4Ǻ&4ǻ&4Ǽ&4ǽ&4Ǿ&4ǿ&4Ȁ&4ȁ&4Ȃ&4ȃ&4Ȅ&4ȅ&4Ȇ&4ȇ&4Ȉ&4ȉ&4Ȋ&4ȋ&4Ȍ&4ȍ&4Ȏ&4ȏ&4Ȑ&4ȑ&4Ȓ&4ȓ&4Ȕ&4ȕ&4Ȗ&4ȗ&4Ș&4ș&4Ț&4ț&4Ȝ&4ȝ&4Ȟ&4ȟ&4Ƞ&4ȡ&4Ȣ&4ȣ&4Ȥ&4ȥ&4Ȧ&4ȧ&4Ȩ&4ȩ&4Ȫ&4ȫ&4Ȭ&4ȭ&4Ȯ&4ȯ&4Ȱ&4ȱ&4Ȳ&4ȳ&4ȴ&4ȵ&4ȶMwȷy`],QS=[()=>ip,`change`,`MediaQueryListEventMap`,`Pn!4"Mw#y`],$S=[`MediaSourceHandle`,`PMw!y`],eC=[`I`,`O`,()=>Kd,`readable`,()=>Zg,`writable`,`TransformStream`,`"c!"c"Pe""o#"4$9e"!o%"4&9Mw'y`],tC=[`duration`,()=>mE,`format`,`numberOfChannels`,`numberOfFrames`,`sampleRate`,`timestamp`,()=>hE,`options`,`allocationSize`,0,`clone`,`close`,()=>jd,`destination`,()=>hE,`copyTo`,`AudioData`,`P'4!9Pn",J4#9'4$9'4%9'4&9'4'9Pn(2)'1*Pn+1,P$1-Pn.2/n02)$11Mw2y`],nC=[`didTimeout`,()=>qd,`timeRemaining`,`IdleDeadline`,`P)4!9Pn"1#Mw$y`],rC=[`kind`,`type`,()=>ou,`getAsFile`,()=>gE,`callback`,`getAsString`,()=>bv,`webkitGetAsEntry`,`DataTransferItem`,`P&4!9&4"9PPn#,J1$PPn%,J2&$1'PPn(,J1)Mw*y`],iC=[()=>Cg,`exact`,`ideal`,`ConstrainDoubleRange`,`Pn!'4"8'4#8Mw$y`],aC=[`exact`,`ideal`,`ConstrainBooleanParameters`,`P)4!8)4"8Mw#y`],oC=[()=>wg,`exact`,`ideal`,`ConstrainULongRange`,`Pn!'4"8'4#8Mw$y`],sC=[`exact`,`ideal`,`ConstrainDOMStringParameters`,`PP&&FJ4!8P&&FJ4"8Mw#y`],cC=[`exact`,`ideal`,`ConstrainBooleanOrDOMStringParameters`,`PP)&J4!8P)&J4"8Mw#y`],lC=[`bt470bg`,`bt709`,`rgb`,`smpte170m`,`VideoMatrixCoefficients`,`P.!.".#.$Jw%y`],uC=[`bt470bg`,`bt709`,`smpte170m`,`VideoColorPrimaries`,`P.!.".#Jw$y`],dC=[`bt709`,`iec61966-2-1`,`smpte170m`,`VideoTransferCharacteristics`,`P.!.".#Jw$y`],fC=[`fullRange`,()=>lC,`matrix`,()=>uC,`primaries`,()=>dC,`transfer`,`VideoColorSpaceInit`,`PP),J4!8Pn",J4#8Pn$,J4%8Pn&,J4'8Mw(y`],pC=[`height`,`width`,`x`,`y`,`DOMRectInit`,`P'4!8'4"8'4#8'4$8Mw%y`],mC=[`destroyed`,`unknown`,`GPUDeviceLostReason`,`P.!."Jw#y`],hC=[`flipY`,()=>_E,`origin`,()=>vE,`source`,`GPUCopyExternalImageSourceInfo`,`P)4!8n"4#8n$4%Mw&y`],gC=[()=>bC,()=>Tc,`colorSpace`,`premultipliedAlpha`,`GPUCopyExternalImageDestInfo`,`Pn!n"4#8)4$8Mw%y`],_C=[()=>ib,()=>yE,`GPUExtent3D`,`Pn!Fn"Jw#y`],vC=[()=>Rg,`GPUCommandBuffer`,`Pn!Mw"y`],yC=[`GPUSize64`,`'w!y`],bC=[()=>ab,`aspect`,()=>ib,`mipLevel`,()=>bE,`origin`,()=>Gd,`texture`,`GPUTexelCopyTextureInfo`,`Pn!4"8n#4$8n%4&8n'4(Mw)y`],xC=[()=>FC,`bytesPerRow`,()=>yC,`offset`,()=>FC,`rowsPerImage`,`GPUTexelCopyBufferLayout`,`Pn!4"8n#4$8n%4&8Mw'y`],SC=[()=>xE,`binding`,()=>SE,`resource`,`GPUBindGroupEntry`,`Pn!4"n#4$Mw%y`],CC=[()=>xE,`binding`,()=>CE,`buffer`,()=>wE,`externalTexture`,()=>TE,`sampler`,()=>EE,`storageTexture`,()=>DE,`texture`,()=>OE,`visibility`,`GPUBindGroupLayoutEntry`,`Pn!4"n#4$8n%4&8n'4(8n)4*8n+4,8n-4.Mw/y`],wC=[`GPUBufferUsageFlags`,`'w!y`],TC=[`mapped`,`pending`,`unmapped`,`GPUBufferMapState`,`P.!.".#Jw$y`],EC=[`GPUSize64Out`,`'w!y`],DC=[`GPUMapModeFlags`,`'w!y`],OC=[`markerLabel`,`insertDebugMarker`,`popDebugGroup`,`groupLabel`,`pushDebugGroup`,`GPUDebugCommandsMixin`,`PP&2!$1"P$1#P&2$$1%Mw&y`],kC=[()=>rb,()=>kE,`timestampWrites`,`GPUComputePassDescriptor`,`Pn!n"4#8Mw$y`],AC=[()=>VC,()=>OC,()=>Rg,()=>FC,`workgroupCountX`,()=>FC,`workgroupCountY`,()=>FC,`workgroupCountZ`,`dispatchWorkgroups`,()=>Py,`indirectBuffer`,()=>yC,`indirectOffset`,`dispatchWorkgroupsIndirect`,`end`,()=>Ry,`pipeline`,`setPipeline`,`GPUComputePassEncoder`,`Pn!n"n#Pn$2%n&2'8n(2)8$1*Pn+2,n-2.$1/P$10Pn122$13Mw4y`],jC=[()=>rb,()=>AE,`colorAttachments`,()=>jE,`depthStencilAttachment`,()=>yC,`maxDrawCount`,()=>Hy,`occlusionQuerySet`,()=>ME,`timestampWrites`,`GPURenderPassDescriptor`,`Pn!Pn",JF4#n$4%8n&4'8n(4)8n*4+8Mw,y`],MC=[()=>VC,()=>OC,()=>Rg,()=>HC,()=>FC,`queryIndex`,`beginOcclusionQuery`,`end`,`endOcclusionQuery`,()=>WC,`bundles`,`executeBundles`,()=>NE,`color`,`setBlendConstant`,()=>ib,`x`,()=>ib,`y`,()=>ib,`width`,()=>ib,`height`,`setScissorRect`,()=>PE,`reference`,`setStencilReference`,`minDepth`,`maxDepth`,`setViewport`,`GPURenderPassEncoder`,`Pn!n"n#n$Pn%2&$1'P$1(P$1)Pn*F2+$1,Pn-2.$1/Pn021n223n425n627$18Pn92:$1;P'21'23'25'27'2<'2=$1>Mw?y`],NC=[()=>xC,()=>Py,`buffer`,`GPUTexelCopyBufferInfo`,`Pn!n"4#Mw$y`],PC=[()=>rb,`GPUCommandBufferDescriptor`,`Pn!Mw"y`],FC=[`GPUSize32`,`'w!y`],IC=[()=>rb,()=>By,()=>FE,`layout`,`GPUPipelineDescriptorBase`,`Pn!Pn"n#J4$Mw%y`],LC=[()=>IE,()=>LE,`constants`,`entryPoint`,()=>Xy,`module`,`GPUProgrammableStage`,`P&n"o!#4#8&4$8n%4&Mw'y`],RC=[`index`,()=>My,`getBindGroupLayout`,`GPUPipelineBase`,`PP'2!n"1#Mw$y`],zC=[`occlusion`,`timestamp`,`GPUQueryType`,`P.!."Jw#y`],BC=[()=>rb,()=>Fg,`colorFormats`,()=>Fg,`depthStencilFormat`,()=>FC,`sampleCount`,`GPURenderPassLayout`,`Pn!Pn",JF4#n$4%8n&4'8Mw(y`],VC=[()=>xE,`index`,()=>Ay,`bindGroup`,()=>RE,`dynamicOffsets`,`setBindGroup`,()=>xE,()=>Ay,`dynamicOffsetsData`,()=>yC,`dynamicOffsetsDataStart`,()=>FC,`dynamicOffsetsDataLength`,`GPUBindingCommandsMixin`,`PPn!2"Pn#,J2$n%F2&8$1'Pn(2"Pn),J2$[2*n+2,n-2.$1'Mw/y`],HC=[()=>FC,`vertexCount`,()=>FC,`instanceCount`,()=>FC,`firstVertex`,()=>FC,`firstInstance`,`draw`,()=>FC,`indexCount`,()=>FC,()=>FC,`firstIndex`,()=>zE,`baseVertex`,()=>FC,`drawIndexed`,()=>Py,`indirectBuffer`,()=>yC,`indirectOffset`,`drawIndexedIndirect`,()=>Py,()=>yC,`drawIndirect`,()=>Py,`buffer`,()=>BE,`indexFormat`,()=>yC,`offset`,()=>yC,`size`,`setIndexBuffer`,()=>Ky,`pipeline`,`setPipeline`,()=>xE,`slot`,()=>Py,()=>yC,()=>yC,`setVertexBuffer`,`GPURenderCommandsMixin`,`PPn!2"n#2$8n%2&8n'2(8$1)Pn*2+n,2$8n-2.8n/208n12(8$12Pn324n526$17Pn824n926$1:Pn;2<n=2>n?2@8nA2B8$1CPnD2E$1FPnG2HPnI,J2<nJ2@8nK2B8$1LMwMy`],UC=[()=>rb,`GPURenderBundleDescriptor`,`Pn!Mw"y`],WC=[()=>Rg,`GPURenderBundle`,`Pn!Mw"y`],GC=[()=>VE,`depthBias`,`depthBiasClamp`,`depthBiasSlopeScale`,()=>ZC,`depthCompare`,`depthWriteEnabled`,()=>Fg,`format`,()=>HE,`stencilBack`,()=>HE,`stencilFront`,()=>PE,`stencilReadMask`,()=>PE,`stencilWriteMask`,`GPUDepthStencilState`,`Pn!4"8'4#8'4$8n%4&8)4'8n(4)n*4+8n,4-8n.4/8n0418Mw2y`],KC=[()=>LC,()=>UE,`targets`,`GPUFragmentState`,`Pn!Pn",JF4#Mw$y`],qC=[`alphaToCoverageEnabled`,()=>FC,`count`,()=>WE,`mask`,`GPUMultisampleState`,`P)4!8n"4#8n$4%8Mw&y`],JC=[()=>GE,`cullMode`,()=>KE,`frontFace`,()=>BE,`stripIndexFormat`,()=>qE,`topology`,`unclippedDepth`,`GPUPrimitiveState`,`Pn!4"8n#4$8n%4&8n'4(8)4)8Mw*y`],YC=[()=>LC,()=>JE,`buffers`,`GPUVertexState`,`Pn!Pn",JF4#8Mw$y`],XC=[`clamp-to-edge`,`mirror-repeat`,`repeat`,`GPUAddressMode`,`P.!.".#Jw$y`],ZC=[`always`,`equal`,`greater`,`greater-equal`,`less`,`less-equal`,`never`,`not-equal`,`GPUCompareFunction`,`P.!.".#.$.%.&.'.(Jw)y`],QC=[`linear`,`nearest`,`GPUFilterMode`,`P.!."Jw#y`],$C=[`linear`,`nearest`,`GPUMipmapFilterMode`,`P.!."Jw#y`],ew=[()=>$d,()=>YE,`messages`,`GPUCompilationInfo`,`Pn"o!"4#9Mw$y`],tw=[`T`,!1,`done`,`value`,`ReadableStreamReadValueResult`,`b!P."4#e"!4$Mw%y`],nw=[`T`,!0,`done`,`value`,`ReadableStreamReadDoneResult`,`b!P."4#Pe#!-J4$Mw%y`],rw=[`alternate`,`alternate-reverse`,`normal`,`reverse`,`PlaybackDirection`,`P.!.".#.$Jw%y`],iw=[`auto`,`backwards`,`both`,`forwards`,`none`,`FillMode`,`P.!.".#.$.%Jw&y`],aw=[()=>n_,()=>XE,`operator`,`CSSMathValue`,`Pn!n"4#9Mw$y`],ow=[`length`,()=>n_,`value`,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,()=>n_,`CSSNumericArray`,`P'4!9PPn"2#'2$n%2&$/'2("2)8$1*'n+LMw,y`],sw=[`angle`,`flex`,`frequency`,`length`,`percent`,`resolution`,`time`,`CSSNumericBaseType`,`P.!.".#.$.%.&.'Jw(y`],cw=[`length`,`numberOfItems`,`newItem`,`appendItem`,`clear`,`index`,`getItem`,`initialize`,`insertItemBefore`,`removeItem`,`replaceItem`,`SVGStringList`,`P'4!9'4"9P&2#&1$P$1%P'2&&1'P&2#&1(P&2#'2&&1)P'2&&1*P&2#'2&&1+'&LMw,y`],lw=[`dual-rumble`,`trigger-rumble`,`GamepadHapticEffectType`,`P.!."Jw#y`],uw=[`duration`,`leftTrigger`,`rightTrigger`,`startDelay`,`strongMagnitude`,`weakMagnitude`,`GamepadEffectParameters`,`P'4!8'4"8'4#8'4$8'4%8'4&8Mw'y`],dw=[`complete`,`preempted`,`GamepadHapticsResult`,`P.!."Jw#y`],fw=[()=>ap,`message`,()=>ap,`messageerror`,`MessageEventTargetEventMap`,`Pn!4"n#4$Mw%y`],pw=[0,`this`,()=>Yd,`ev`,``,`onerror`,`type`,0,()=>ZE,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>ZE,()=>B,`removeEventListener`,()=>z,()=>B,`AbstractWorker`,`PPPn!2"n#2$"/%,J4&P"2'Pn(2"n)"f2$"/%2*P)n+J2,8$1-P&2'n.2*P)n/J2,8$1-P"2'Pn02"n1"f2$"/%2*P)n2J2,8$13P&2'n42*P)n5J2,8$13Mw6y`],mw=[`activated`,`activating`,`installed`,`installing`,`parsed`,`redundant`,`ServiceWorkerState`,`P.!.".#.$.%.&Jw'y`],hw=[()=>ZE,()=>U,`statechange`,`ServiceWorkerEventMap`,`Pn!n"4#Mw$y`],gw=[()=>Ub,`handler`,`addHandler`,()=>zp,`url`,()=>WS,`options`,`redirect`,`NavigationPrecommitController`,`PPn!2"$1#PP&n$J2%n&2'8$1(Mw)y`],_w=[()=>Yb,`additionalDisplayItems`,`data`,`supportedMethods`,()=>Yb,`total`,`PaymentDetailsModifier`,`Pn!F4"8"4#8&4$n%4&8Mw'y`],vw=[()=>yw,`amount`,`id`,`label`,`selected`,`PaymentShippingOption`,`Pn!4"&4#&4$)4%8Mw&y`],yw=[`currency`,`value`,`PaymentCurrencyAmount`,`P&4!&4"Mw#y`],bw=[`RTCRtpScriptTransform`,`PMw!y`],xw=[()=>H,()=>QE,`gatheringState`,0,`this`,()=>U,`ev`,``,`ongatheringstatechange`,0,()=>U,`onselectedcandidatepairchange`,0,()=>U,`onstatechange`,()=>$E,`state`,()=>eD,`getSelectedCandidatePair`,`type`,0,()=>tD,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>tD,()=>B,`removeEventListener`,()=>z,()=>B,`RTCIceTransport`,`Pn!n"4#9PPn$2%n&2'"/(,J4)PPn*2%n+2'"/(,J4,PPn-2%n.2'"/(,J4/n0419PPn2,J13P"24Pn52%n6"f2'"/(27P)n8J298$1:P&24n;27P)n<J298$1:P"24Pn=2%n>"f2'"/(27P)n?J298$1@P&24nA27P)nBJ298$1@MwCy`],Sw=[`closed`,`connected`,`connecting`,`failed`,`new`,`RTCDtlsTransportState`,`P.!.".#.$.%Jw&y`],Cw=[()=>yp,`error`,()=>U,`statechange`,`RTCDtlsTransportEventMap`,`Pn!4"n#4$Mw%y`],ww=[()=>nD,`codecs`,()=>rD,`headerExtensions`,()=>iD,`rtcp`,`RTCRtpParameters`,`Pn!F4"n#F4$n%4&Mw'y`],Tw=[()=>H,`canInsertDTMF`,0,`this`,()=>_p,`ev`,``,`ontonechange`,`toneBuffer`,`tones`,`duration`,`interToneGap`,`insertDTMF`,`type`,0,()=>aD,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>aD,()=>B,`removeEventListener`,()=>z,()=>B,`RTCDTMFSender`,`Pn!)4"9PPn#2$n%2&"/',J4(&4)9P&2*'2+8'2,8$1-P"2.Pn/2$n0"f2&"/'21P)n2J238$14P&2.n521P)n6J238$14P"2.Pn72$n8"f2&"/'21P)n9J238$1:P&2.n;21P)n<J238$1:Mw=y`],Ew=[()=>bw,`RTCRtpSenderTransform`,`n!w"y`],Dw=[()=>ww,()=>oD,`degradationPreference`,()=>sD,`encodings`,`transactionId`,`RTCRtpSendParameters`,`Pn!n"4#8n$F4%&4&Mw'y`],Ow=[`RTCSetParameterOptions`,`PMw!y`],kw=[`confidence`,`transcript`,`SpeechRecognitionAlternative`,`P'4!9&4"9Mw#y`],Aw=[()=>U,`enter`,()=>U,`exit`,`TextTrackCueEventMap`,`Pn!4"n#4$Mw%y`],jw=[`persistent-license`,`temporary`,`MediaKeySessionType`,`P.!."Jw#y`],Mw=[()=>H,()=>cD,`closed`,`expiration`,()=>lD,`keyStatuses`,0,`this`,()=>U,`ev`,``,`onkeystatuseschange`,0,()=>rp,`onmessage`,`sessionId`,`close`,`initDataType`,()=>Fw,`initData`,`generateRequest`,`load`,`remove`,()=>Fw,`response`,`update`,`type`,0,()=>uD,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>uD,()=>B,`removeEventListener`,()=>z,()=>B,`MediaKeySession`,'Pn!n"`4#9\'4$9n%4&9PPn\'2(n)2*"/+,J4,PPn-2(n.2*"/+,J4/&409P$`11P&22n324$`15P&20)`16P$`17Pn829$`1:P"2;Pn<2(n="f2*"/+2>P)n?J2@8$1AP&2;nB2>P)nCJ2@8$1AP"2;PnD2(nE"f2*"/+2>P)nFJ2@8$1GP&2;nH2>P)nIJ2@8$1GMwJy'],Nw=[`minHdcpVersion`,`MediaKeysPolicy`,`P&4!8Mw"y`],Pw=[`expired`,`internal-error`,`output-downscaled`,`output-restricted`,`released`,`status-pending`,`usable`,`usable-in-future`,`MediaKeyStatus`,`P.!.".#.$.%.&.'.(Jw)y`],Fw=[()=>Md,`BufferSource`,`P_o!"_Jw"y`],Iw=[`connected`,`connecting`,`disconnected`,`RemotePlaybackState`,`P.!.".#Jw$y`],Lw=[`available`,``,`RemotePlaybackAvailabilityCallback`,`PP)2!$v"Mw#y`],Rw=[()=>U,`connect`,()=>U,`connecting`,()=>U,`disconnect`,`RemotePlaybackEventMap`,`Pn!4"n#4$n%4&Mw'y`],zw=[()=>H,()=>dD,`activeSourceBuffers`,`duration`,0,`this`,()=>U,`ev`,``,`onsourceclose`,0,()=>U,`onsourceended`,0,()=>U,`onsourceopen`,()=>fD,`readyState`,()=>dD,`sourceBuffers`,`type`,()=>pD,`addSourceBuffer`,`clearLiveSeekableRange`,()=>mD,`error`,`endOfStream`,()=>pD,`sourceBuffer`,`removeSourceBuffer`,`start`,`end`,`setLiveSeekableRange`,0,()=>hD,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>hD,()=>B,`removeEventListener`,()=>z,()=>B,`MediaSource`,`Pn!n"4#9'4$PPn%2&n'2("/),J4*PPn+2&n,2("/),J4-PPn.2&n/2("/),J40n1429n3449P&25n617P$18Pn92:8$1;Pn<2=$1>P'2?'2@$1AP"25PnB2&nC"f2("/)2DP)nEJ2F8$1GP&25nH2DP)nIJ2F8$1GP"25PnJ2&nK"f2("/)2DP)nLJ2F8$1MP&25nN2DP)nOJ2F8$1MMwPy`],Bw=[()=>Ap,`addtrack`,()=>U,`change`,()=>Ap,`removetrack`,`TextTrackListEventMap`,`Pn!4"n#4$n%4&Mw'y`],Vw=`additional-name address-level1 address-level2 address-level3 address-level4 address-line1 address-line2 address-line3 bday-day bday-month bday-year cc-csc cc-exp cc-exp-month cc-exp-year cc-family-name cc-given-name cc-name cc-number cc-type country country-name current-password family-name given-name honorific-prefix honorific-suffix name new-password one-time-code organization postal-code street-address transaction-amount transaction-currency username AutoFillNormalField P.!.".#.$.%.&.'.(.).*.+.,.-.../.0.1.2.3.4.5.6.7.8.9.:.;.<.=.>.?.@.A.B.C.DJwEy`.split(` `),Hw=[`home`,`mobile`,`work`,`AutoFillContactKind`,`P.!.".#Jw$y`],Uw=[`email`,`tel`,`tel-area-code`,`tel-country-code`,`tel-extension`,`tel-local`,`tel-local-prefix`,`tel-local-suffix`,`tel-national`,`AutoFillContactField`,`P.!.".#.$.%.&.'.(.)Jw*y`],Ww=[()=>bv,()=>gD,`createReader`,`path`,()=>_D,`options`,()=>Rx,`successCallback`,()=>zx,`errorCallback`,`getDirectory`,()=>_D,()=>Rx,()=>zx,`getFile`,`FileSystemDirectoryEntry`,`Pn!Pn"1#PP&,J2$8n%2&8n'2(8n)2*8$1+PP&,J2$8n,2&8n-2(8n.2*8$1/Mw0y`],Gw=[`length`,`numberOfItems`,()=>T_,`newItem`,()=>T_,`appendItem`,`clear`,`index`,()=>T_,`getItem`,()=>T_,()=>T_,`initialize`,()=>T_,()=>T_,`insertItemBefore`,()=>T_,`removeItem`,()=>T_,()=>T_,`replaceItem`,()=>T_,`SVGLengthList`,`P'4!9'4"9Pn#2$n%1&P$1'P'2(n)1*Pn+2$n,1-Pn.2$'2(n/10P'2(n112Pn32$'2(n415'n6LMw7y`],Kw=[()=>vD,`cacheName`,`MultiCacheQueryOptions`,`Pn!&4"8Mw#y`],qw=[()=>eS,()=>zp,`request`,`add`,()=>eS,`requests`,`addAll`,()=>eS,()=>zp,()=>vD,`options`,`delete`,()=>eS,()=>zp,()=>vD,()=>$d,()=>fT,`keys`,()=>eS,()=>zp,()=>vD,()=>nS,`match`,()=>eS,()=>zp,()=>vD,()=>$d,()=>nS,`matchAll`,()=>eS,()=>zp,()=>nS,`response`,`put`,`Cache`,'PPPn!n"J2#$`1$Pn%F2&$`1\'PPn(n)J2#n*2+8)`1,PPn-n.J2#8n/2+8n1o0"`12PPn3n4J2#n52+8Pn6-J`17PPn8n9J2#8n:2+8n<o;"`1=PPn>n?J2#n@2A$`1BMwCy'],Jw=[()=>yD,()=>bD,()=>xD,()=>SD,()=>CD,`algorithm`,()=>wD,`key`,()=>Fw,`data`,`decrypt`,()=>yD,()=>TD,()=>ED,()=>DD,()=>wD,`baseKey`,`length`,`deriveBits`,()=>yD,()=>TD,()=>ED,()=>DD,()=>wD,()=>yD,()=>OD,()=>kD,()=>ED,()=>DD,`derivedKeyType`,`extractable`,()=>AD,`keyUsages`,()=>wD,`deriveKey`,()=>yD,()=>Fw,`digest`,()=>yD,()=>bD,()=>xD,()=>SD,()=>CD,()=>wD,()=>Fw,`encrypt`,`jwk`,`format`,()=>wD,()=>jD,`exportKey`,()=>MD,()=>ND,`jwk`,()=>wD,()=>ND,()=>wD,()=>jD,`Ed25519`,`Ed25519`,`name`,()=>$d,`sign`,`verify`,()=>PD,`generateKey`,`X25519`,`X25519`,()=>$d,`deriveBits`,`deriveKey`,()=>PD,()=>FD,()=>ID,()=>$d,()=>AD,()=>PD,()=>LD,()=>RD,()=>DD,()=>$d,()=>AD,()=>wD,()=>yD,()=>AD,()=>PD,()=>wD,`jwk`,()=>jD,`keyData`,()=>yD,()=>zD,()=>BD,()=>kD,()=>VD,()=>$d,()=>AD,()=>wD,`importKey`,()=>MD,()=>ND,`jwk`,()=>Fw,()=>yD,()=>zD,()=>BD,()=>kD,()=>VD,()=>AD,()=>wD,()=>yD,()=>HD,()=>UD,()=>wD,()=>Fw,`sign`,()=>ND,()=>Fw,`wrappedKey`,()=>wD,`unwrappingKey`,()=>yD,()=>bD,()=>xD,()=>SD,()=>CD,`unwrapAlgorithm`,()=>yD,()=>zD,()=>BD,()=>kD,()=>VD,`unwrappedKeyAlgorithm`,()=>AD,()=>wD,`unwrapKey`,()=>yD,()=>HD,()=>UD,()=>wD,()=>Fw,`signature`,()=>Fw,`verify`,()=>ND,()=>wD,()=>wD,`wrappingKey`,()=>yD,()=>bD,()=>xD,()=>SD,()=>CD,`wrapAlgorithm`,`wrapKey`,`SubtleCrypto`,'PPPn!n"n#n$n%J2&n\'2(n)2*_`1+PPn,n-n.n/J2&n021P\',J228_`13PPn4n5n6n7J2&n821Pn9n:n;n<n=J2>)2?n@F2AnB`1CPnD2&nE2*_`1FPPnGnHnInJnKJ2&nL2(nM2*_`1NP.O2PnQ2(nR`1SPnU.VoT#2PnW2(_`1SPnX2PnY2(P_nZJ`1SPP.[P.\\4]MJ2&)2?P._.`Jo^"2Ana`1bPP.cP.d4]MJ2&)2?P.f.gJoe"2Anh`1bPPninjJ2&)2?nlok"2Anm`1bPPnnnonpJ2&)2?nroq"2Ans`1bPnt2&)2?nuF2APnvnwJ`1bP.x2Pny2zPn{n|n}n~nJ2&)2?no"2An`1Pn
.o#2Pn2zPnnnnnJ2&)2?nF2An`1PPnnnJ2&n2(n2*_`1Pn2Pn2n2PnnnnnJ2Pn\xA0n¡n¢n£n¤J2¥)2?n¦F2An§`1¨PPn©nªn«J2&n¬2(n2®n¯2*)`1°Pn±2Pn²2(n³2´Pnµn¶n·n¸n¹J2º_`1»Mw¼y'],Yw=[`name`,`version`,`IDBDatabaseInfo`,`P&4!8'4"8Mw#y`],Xw=[()=>WD,()=>GD,0,`this`,()=>$f,`ev`,``,`onblocked`,0,()=>$f,`onupgradeneeded`,`type`,0,()=>KD,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>KD,()=>B,`removeEventListener`,()=>z,()=>B,`IDBOpenDBRequest`,`Pn"o!"PPn#2$n%2&"/',J4(PPn)2$n*2&"/',J4+P"2,Pn-2$n."f2&"/'2/P)n0J218$12P&2,n32/P)n4J218$12P"2,Pn52$n6"f2&"/'2/P)n7J218$18P&2,n92/P)n:J218$18Mw;y`],Zw=[`value`,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,`EventCounts`,`PPP'2!&2"n#2$$/%2&"2'8$1(Mw)y`],Qw=[`redirectCount`,`type`,`toJSON`,0,`TYPE_NAVIGATE`,1,`TYPE_RELOAD`,2,`TYPE_BACK_FORWARD`,255,`TYPE_RESERVED`,`PerformanceNavigation`,`P'4!9'4"9P"1#.$4%9.&4'9.(4)9.*4+9Mw,y`],$w=[`connectEnd`,`connectStart`,`domComplete`,`domContentLoadedEventEnd`,`domContentLoadedEventStart`,`domInteractive`,`domLoading`,`domainLookupEnd`,`domainLookupStart`,`fetchStart`,`loadEventEnd`,`loadEventStart`,`navigationStart`,`redirectEnd`,`redirectStart`,`requestStart`,`responseEnd`,`responseStart`,`secureConnectionStart`,`unloadEventEnd`,`unloadEventStart`,`toJSON`,`PerformanceTiming`,`P'4!9'4"9'4#9'4$9'4%9'4&9'4'9'4(9'4)9'4*9'4+9'4,9'4-9'4.9'4/9'409'419'429'439'449'459P"16Mw7y`],eT=[()=>qD,`PerformanceEntryList`,`n!Fw"y`],tT=[`detail`,()=>qd,`startTime`,`PerformanceMarkOptions`,`P"4!8n"4#8Mw$y`],nT=[()=>qD,`detail`,`PerformanceMark`,`Pn!"4"9Mw#y`],rT=[`detail`,()=>qd,`duration`,()=>qd,`end`,()=>qd,`start`,`PerformanceMeasureOptions`,`P"4!8n"4#8P&n$J4%8P&n&J4'8Mw(y`],iT=[()=>qD,`detail`,`PerformanceMeasure`,`Pn!"4"9Mw#y`],aT=[()=>U,`resourcetimingbufferfull`,`PerformanceEventMap`,`Pn!4"Mw#y`],oT=[``,`SchedulerPostTaskCallback`,`PP"v!Mw"y`],sT=[`delay`,()=>sv,`priority`,()=>il,`signal`,`SchedulerPostTaskOptions`,`P'4!8n"4#8n$4%8Mw&y`],cT=[`default`,`none`,`ColorSpaceConversion`,`P.!."Jw#y`],lT=[`flipY`,`from-image`,`none`,`ImageOrientation`,`P.!.".#Jw$y`],uT=[`default`,`none`,`premultiply`,`PremultiplyAlpha`,`P.!.".#Jw$y`],dT=[`high`,`low`,`medium`,`pixelated`,`ResizeQuality`,`P.!.".#.$Jw%y`],fT=[()=>yT,()=>pT,`cache`,()=>mT,`credentials`,()=>JD,`destination`,()=>bT,`headers`,`integrity`,`keepalive`,`method`,()=>gT,`mode`,()=>vT,`redirect`,`referrer`,()=>gv,`referrerPolicy`,()=>il,`signal`,`url`,0,`clone`,`Request`,`Pn!n"4#9n$4%9n&4'9n(4)9&4*9)4+9&4,9n-4.9n/409&419n2439n4459&469Pn718Mw9y`],pT=[`default`,`force-cache`,`no-cache`,`no-store`,`only-if-cached`,`reload`,`RequestCache`,`P.!.".#.$.%.&Jw'y`],mT=[`include`,`omit`,`same-origin`,`RequestCredentials`,`P.!.".#Jw$y`],hT=[()=>IE,()=>bT,`HeadersInit`,`PP&&GF&&o!#n"Jw#y`],gT=[`cors`,`navigate`,`no-cors`,`same-origin`,`RequestMode`,`P.!.".#.$Jw%y`],_T=[`auto`,`high`,`low`,`RequestPriority`,`P.!.".#Jw$y`],vT=[`error`,`follow`,`manual`,`RequestRedirect`,`P.!.".#Jw$y`],yT=[()=>Kd,`body`,`bodyUsed`,`arrayBuffer`,()=>Xc,`blob`,`bytes`,()=>su,`formData`,`json`,`text`,`Body`,'PPWo!",J4"9)4#9P_`1$Pn%`1&PW`1\'Pn(`1)P"`1*P&`1+Mw,y'],bT=[`name`,`value`,`append`,`delete`,`get`,`getSetCookie`,`has`,`set`,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,`Headers`,`PP&2!&2"$1#P&2!$1$P&2!P&,J1%P&F1&P&2!)1'P&2!&2"$1(PP&2"&2)n*2+$/,2-"2.8$1/Mw0y`],xT=[`basic`,`cors`,`default`,`error`,`opaque`,`opaqueredirect`,`ResponseType`,`P.!.".#.$.%.&Jw'y`],ST=[()=>YD,`wgslLanguageFeatures`,()=>Fg,`getPreferredCanvasFormat`,()=>XD,`options`,()=>ZD,`requestAdapter`,`GPU`,`Pn!4"9Pn#1$Pn%2&8Pn',J\`1(Mw)y`],CT=[()=>QD,`query`,`name`,()=>$D,`callback`,()=>eO,`request`,()=>tO,`options`,()=>$D,()=>eO,`LockManager`,'PPn!`1"P&2#"o$"2%"o&"`1\'P&2#n(2)"o*"2%"o+"`1\'Mw,y'],wT=[`length`,`index`,()=>nO,`item`,`name`,()=>nO,`namedItem`,()=>nO,`MimeTypeArray`,`P'4!9P'2"Pn#,J1$P&2%Pn&,J1''n(LMw)y`],TT=[`length`,`index`,()=>rO,`item`,`name`,()=>rO,`namedItem`,`refresh`,()=>rO,`PluginArray`,`P'4!9P'2"Pn#,J1$P&2%Pn&,J1'P$1('n)LMw*y`],ET=[()=>iO,`estimate`,()=>aO,`getDirectory`,`persist`,`persisted`,`StorageManager`,"PPn!`1\"Pn#`1$P)`1%P)`1&Mw'y"],DT=[()=>oO,`ClipboardItems`,`n!Fw"y`],OT=[()=>sO,`publicKey`,()=>il,`signal`,`CredentialCreationOptions`,`Pn!4"8n#4$8Mw%y`],kT=[`id`,`type`,`Credential`,`P&4!9&4"9Mw#y`],AT=[()=>cO,`mediation`,()=>lO,`publicKey`,()=>il,`signal`,`CredentialRequestOptions`,`Pn!4"8n#4$8n%4&8Mw'y`],jT=[()=>uO,`position`,``,`PositionCallback`,`PPn!2"$v#Mw$y`],MT=[()=>dO,`positionError`,``,`PositionErrorCallback`,`PPn!2"$v#Mw$y`],NT=[`enableHighAccuracy`,`maximumAge`,`timeout`,`PositionOptions`,`P)4!8'4"8'4#8Mw$y`],PT=[`logged-in`,`logged-out`,`LoginStatus`,`P.!."Jw#y`],FT=[()=>fO,()=>pO,`keySystemConfiguration`,()=>mO,`type`,`MediaDecodingConfiguration`,`Pn!n"4#8n$4%Mw&y`],IT=[()=>hO,()=>MS,`keySystemAccess`,`MediaCapabilitiesDecodingInfo`,`Pn!Pn",J4#Mw$y`],LT=[()=>fO,()=>gO,`type`,`MediaEncodingConfiguration`,`Pn!n"4#Mw$y`],RT=[()=>hO,`MediaCapabilitiesEncodingInfo`,`Pn!Mw"y`],zT=[`deviceId`,`groupId`,()=>_O,`kind`,`label`,`toJSON`,`MediaDeviceInfo`,`P&4!9&4"9n#4$9&4%9P"1&Mw'y`],BT=[()=>uu,`audio`,()=>uu,`video`,`DisplayMediaStreamOptions`,`PP)n!J4"8P)n#J4$8Mw%y`],VT=[`aspectRatio`,`autoGainControl`,`backgroundBlur`,`channelCount`,`deviceId`,`displaySurface`,`echoCancellation`,`facingMode`,`frameRate`,`groupId`,`height`,`noiseSuppression`,`sampleRate`,`sampleSize`,`width`,`MediaTrackSupportedConstraints`,`P)4!8)4"8)4#8)4$8)4%8)4&8)4'8)4(8)4)8)4*8)4+8)4,8)4-8)4.8)4/8Mw0y`],HT=[()=>uu,`audio`,`peerIdentity`,`preferCurrentTab`,()=>uu,`video`,`MediaStreamConstraints`,`PP)n!J4"8&4#8)4$8P)n%J4&8Mw'y`],UT=[()=>U,`devicechange`,`MediaDevicesEventMap`,`Pn!4"Mw#y`],WT=[`album`,`artist`,()=>$d,()=>vO,`artwork`,`title`,`MediaMetadata`,`P&4!&4"n$o#"4%&4&Mw'y`],GT=[`none`,`paused`,`playing`,`MediaSessionPlaybackState`,`P.!.".#Jw$y`],KT=[`nexttrack`,`pause`,`play`,`previoustrack`,`seekbackward`,`seekforward`,`seekto`,`skipad`,`stop`,`MediaSessionAction`,`P.!.".#.$.%.&.'.(.)Jw*y`],qT=[()=>yO,`details`,``,`MediaSessionActionHandler`,`PPn!2"$v#Mw$y`],JT=[`duration`,`playbackRate`,`position`,`MediaPositionState`,`P'4!8'4"8'4#8Mw$y`],YT=[()=>bO,`name`,`PermissionDescriptor`,`Pn!4"Mw#y`],XT=[()=>H,`name`,0,`this`,()=>U,`ev`,``,`onchange`,()=>xO,`state`,`type`,0,()=>SO,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>SO,()=>B,`removeEventListener`,()=>z,()=>B,`PermissionStatus`,`Pn!&4"9PPn#2$n%2&"/',J4(n)4*9P"2+Pn,2$n-"f2&"/'2.P)n/J208$11P&2+n22.P)n3J208$11P"2+Pn42$n5"f2&"/'2.P)n6J208$17P&2+n82.P)n9J208$17Mw:y`],ZT=[()=>H,()=>CO,()=>Vb,`active`,()=>wO,`cookies`,()=>Vb,`installing`,()=>TO,`navigationPreload`,0,`this`,()=>U,`ev`,``,`onupdatefound`,`scope`,()=>EO,`updateViaCache`,()=>Vb,`waiting`,()=>DO,`filter`,()=>OO,`getNotifications`,`title`,()=>kO,`options`,`showNotification`,`unregister`,0,`update`,`type`,0,()=>AO,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>AO,()=>B,`removeEventListener`,()=>z,()=>B,`ServiceWorkerRegistration`,'Pn!n"Pn#,J4$9n%4&9Pn\',J4(9n)4*9PPn+2,n-2."//,J40&419n2439Pn4,J459Pn6278n8F`19P&2:n;2<8$`1=P)`1>Pn?`1@P"2APnB2,nC"f2."//2DP)nEJ2<8$1FP&2AnG2DP)nHJ2<8$1FP"2APnI2,nJ"f2."//2DP)nKJ2<8$1LP&2AnM2DP)nNJ2<8$1LMwOy'],QT=[`scope`,()=>jO,`type`,()=>EO,`updateViaCache`,`RegistrationOptions`,`P&4!8n"4#8n$4%8Mw&y`],$T=[()=>U,`controllerchange`,()=>ap,`message`,()=>ap,`messageerror`,`ServiceWorkerContainerEventMap`,`Pn!4"n#4$n%4&Mw'y`],eE=[`screen`,`WakeLockType`,`.!w"y`],tE=[()=>H,0,`this`,()=>U,`ev`,``,`onrelease`,`released`,()=>eE,`type`,`release`,0,()=>MO,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>MO,()=>B,`removeEventListener`,()=>z,()=>B,`WakeLockSentinel`,`Pn!PPn"2#n$2%"/&,J4')4(9n)4*9P$\`1+P"2*Pn,2#n-"f2%"/&2.P)n/J208$11P&2*n22.P)n3J208$11P"2*Pn42#n5"f2%"/&2.P)n6J208$17P&2*n82.P)n9J208$17Mw:y`],nE=[()=>NO,`value`,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,`MIDIInputMap`,`PPPn!2"&2#n$2%$/&2'"2(8$1)Mw*y`],rE=[()=>PO,`value`,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,`MIDIOutputMap`,`PPPn!2"&2#n$2%$/&2'"2(8$1)Mw*y`],iE=[()=>ep,`statechange`,`MIDIAccessEventMap`,`Pn!4"Mw#y`],aE=[`contentType`,`encryptionScheme`,`robustness`,`MediaKeySystemMediaCapability`,`P&4!8P&,J4"8&4#8Mw$y`],oE=[`not-allowed`,`optional`,`required`,`MediaKeysRequirement`,`P.!.".#Jw$y`],sE=[()=>Xc,()=>Fw,()=>su,()=>dv,`XMLHttpRequestBodyInit`,`Pn!n"n#n$&Jw%y`],cE=[`lax`,`none`,`strict`,`CookieSameSite`,`P.!.".#Jw$y`],lE=[`auto`,`push`,`replace`,`NavigationHistoryBehavior`,`P.!.".#Jw$y`],uE=[`landscape-primary`,`landscape-secondary`,`portrait-primary`,`portrait-secondary`,`OrientationType`,`P.!.".#.$Jw%y`],dE=[`any`,`landscape`,`landscape-primary`,`landscape-secondary`,`natural`,`portrait`,`portrait-primary`,`portrait-secondary`,`OrientationLockType`,`P.!.".#.$.%.&.'.(Jw)y`],fE=[()=>U,`change`,`ScreenOrientationEventMap`,`Pn!4"Mw#y`],pE=[`cssText`,`length`,()=>Sb,`parentRule`,`property`,`getPropertyPriority`,`getPropertyValue`,`index`,`item`,`removeProperty`,`value`,`priority`,`setProperty`,`CSSStyleDeclarationBase`,`P&4!'4"9Pn#,J4$9P&2%&1&P&2%&1'P'2(&1)P&2%&1*P&2%P&,J2+&2,8$1-'&LMw.y`],mE=[`f32`,`f32-planar`,`s16`,`s16-planar`,`s32`,`s32-planar`,`u8`,`u8-planar`,`AudioSampleFormat`,`P.!.".#.$.%.&.'.(Jw)y`],hE=[()=>mE,`format`,`frameCount`,`frameOffset`,`planeIndex`,`AudioDataCopyToOptions`,`Pn!4"8'4#8'4$8'4%Mw&y`],gE=[`data`,``,`FunctionStringCallback`,`PP&2!$v"Mw#y`],_E=[()=>ib,()=>FO,`GPUOrigin2D`,`Pn!Fn"Jw#y`],vE=[()=>Uc,()=>xu,()=>Cf,()=>Wm,()=>Eg,()=>rc,()=>mc,`GPUCopyExternalImageSource`,`Pn!n"n#n$n%n&n'Jw(y`],yE=[()=>ib,`depthOrArrayLayers`,()=>ib,`height`,()=>ib,`width`,`GPUExtent3DDict`,`Pn!4"8n#4$8n%4&Mw'y`],bE=[()=>ib,()=>IO,`GPUOrigin3D`,`Pn!Fn"Jw#y`],xE=[`GPUIndex32`,`'w!y`],SE=[()=>Jy,()=>Gd,()=>Wg,()=>Py,()=>LO,()=>$y,`GPUBindingResource`,`Pn!n"n#n$n%n&Jw'y`],CE=[`hasDynamicOffset`,()=>yC,`minBindingSize`,()=>RO,`type`,`GPUBufferBindingLayout`,`P)4!8n"4#8n$4%8Mw&y`],wE=[`GPUExternalTextureBindingLayout`,`PMw!y`],TE=[()=>zO,`type`,`GPUSamplerBindingLayout`,`Pn!4"8Mw#y`],EE=[()=>BO,`access`,()=>Fg,`format`,()=>ob,`viewDimension`,`GPUStorageTextureBindingLayout`,`Pn!4"8n#4$n%4&8Mw'y`],DE=[`multisampled`,()=>VO,`sampleType`,()=>ob,`viewDimension`,`GPUTextureBindingLayout`,`P)4!8n"4#8n$4%8Mw&y`],OE=[`GPUShaderStageFlags`,`'w!y`],kE=[()=>FC,`beginningOfPassWriteIndex`,()=>FC,`endOfPassWriteIndex`,()=>Hy,`querySet`,`GPUComputePassTimestampWrites`,`Pn!4"8n#4$8n%4&Mw'y`],AE=[()=>NE,`clearValue`,()=>ib,`depthSlice`,()=>HO,`loadOp`,()=>Gd,()=>Wg,`resolveTarget`,()=>UO,`storeOp`,()=>Gd,()=>Wg,`view`,`GPURenderPassColorAttachment`,`Pn!4"8n#4$8n%4&Pn'n(J4)8n*4+Pn,n-J4.Mw/y`],jE=[`depthClearValue`,()=>HO,`depthLoadOp`,`depthReadOnly`,()=>UO,`depthStoreOp`,()=>PE,`stencilClearValue`,()=>HO,`stencilLoadOp`,`stencilReadOnly`,()=>UO,`stencilStoreOp`,()=>Gd,()=>Wg,`view`,`GPURenderPassDepthStencilAttachment`,`P'4!8n"4#8)4$8n%4&8n'4(8n)4*8)4+8n,4-8Pn.n/J40Mw1y`],ME=[()=>FC,`beginningOfPassWriteIndex`,()=>FC,`endOfPassWriteIndex`,()=>Hy,`querySet`,`GPURenderPassTimestampWrites`,`Pn!4"8n#4$8n%4&Mw'y`],NE=[()=>WO,`GPUColor`,`P'Fn!Jw"y`],PE=[`GPUStencilValue`,`'w!y`],FE=[`auto`,`GPUAutoLayoutMode`,`.!w"y`],IE=[`K`,`T`,`Record`,`l'e#"Rb!b"Pde"!N#!w#y`],LE=[`GPUPipelineConstantValue`,`'w!y`],RE=[`GPUBufferDynamicOffset`,`'w!y`],zE=[`GPUSignedOffset32`,`'w!y`],BE=[`uint16`,`uint32`,`GPUIndexFormat`,`P.!."Jw#y`],VE=[`GPUDepthBias`,`'w!y`],HE=[()=>ZC,`compare`,()=>GO,`depthFailOp`,()=>GO,`failOp`,()=>GO,`passOp`,`GPUStencilFaceState`,`Pn!4"8n#4$8n%4&8n'4(8Mw)y`],UE=[()=>KO,`blend`,()=>Fg,`format`,()=>qO,`writeMask`,`GPUColorTargetState`,`Pn!4"8n#4$n%4&8Mw'y`],WE=[`GPUSampleMask`,`'w!y`],GE=[`back`,`front`,`none`,`GPUCullMode`,`P.!.".#Jw$y`],KE=[`ccw`,`cw`,`GPUFrontFace`,`P.!."Jw#y`],qE=[`line-list`,`line-strip`,`point-list`,`triangle-list`,`triangle-strip`,`GPUPrimitiveTopology`,`P.!.".#.$.%Jw&y`],JE=[()=>yC,`arrayStride`,()=>JO,`attributes`,()=>YO,`stepMode`,`GPUVertexBufferLayout`,`Pn!4"n#F4$n%4&8Mw'y`],YE=[`length`,`lineNum`,`linePos`,`message`,`offset`,()=>XO,`type`,`GPUCompilationMessage`,`P'4!9'4"9'4#9&4$9'4%9n&4'9Mw(y`],XE=[`clamp`,`invert`,`max`,`min`,`negate`,`product`,`sum`,`CSSMathOperator`,`P.!.".#.$.%.&.'Jw(y`],ZE=[()=>Yd,`error`,`AbstractWorkerEventMap`,`Pn!4"Mw#y`],QE=[`complete`,`gathering`,`new`,`RTCIceGathererState`,`P.!.".#Jw$y`],$E=[`checking`,`closed`,`completed`,`connected`,`disconnected`,`failed`,`new`,`RTCIceTransportState`,`P.!.".#.$.%.&.'Jw(y`],eD=[()=>$_,`local`,()=>$_,`remote`,`RTCIceCandidatePair`,`Pn!4"n#4$Mw%y`],tD=[()=>U,`gatheringstatechange`,()=>U,`selectedcandidatepairchange`,()=>U,`statechange`,`RTCIceTransportEventMap`,`Pn!4"n#4$n%4&Mw'y`],nD=[()=>hx,`payloadType`,`RTCRtpCodecParameters`,`Pn!'4"Mw#y`],rD=[`encrypted`,`id`,`uri`,`RTCRtpHeaderExtensionParameters`,`P)4!8'4"&4#Mw$y`],iD=[`cname`,`reducedSize`,`RTCRtcpParameters`,`P&4!8)4"8Mw#y`],aD=[()=>_p,`tonechange`,`RTCDTMFSenderEventMap`,`Pn!4"Mw#y`],oD=[`balanced`,`maintain-framerate`,`maintain-resolution`,`RTCDegradationPreference`,`P.!.".#Jw$y`],sD=[()=>ZO,`active`,`maxBitrate`,`maxFramerate`,()=>QO,`networkPriority`,()=>QO,`priority`,`scaleResolutionDownBy`,`RTCRtpEncodingParameters`,`Pn!)4"8'4#8'4$8n%4&8n'4(8'4)8Mw*y`],cD=[`closed-by-application`,`hardware-context-reset`,`internal-error`,`release-acknowledged`,`resource-evicted`,`MediaKeySessionClosedReason`,`P.!.".#.$.%Jw&y`],lD=[`size`,()=>Fw,`keyId`,()=>Pw,`get`,()=>Fw,`has`,()=>Pw,`value`,()=>Fw,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,`MediaKeyStatusMap`,`P'4!9Pn"2#Pn$-J1%Pn&2#)1'PPn(2)n*2+n,2-$/.2/"208$11Mw2y`],uD=[()=>U,`keystatuseschange`,()=>rp,`message`,`MediaKeySessionEventMap`,`Pn!4"n#4$Mw%y`],dD=[()=>H,`length`,0,`this`,()=>U,`ev`,``,`onaddsourcebuffer`,0,()=>U,`onremovesourcebuffer`,`type`,0,()=>$O,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>$O,()=>B,`removeEventListener`,()=>z,()=>B,()=>pD,`SourceBufferList`,`Pn!'4"9PPn#2$n%2&"/',J4(PPn)2$n*2&"/',J4+P"2,Pn-2$n."f2&"/'2/P)n0J218$12P&2,n32/P)n4J218$12P"2,Pn52$n6"f2&"/'2/P)n7J218$18P&2,n92/P)n:J218$18'n;LMw<y`],fD=[`closed`,`ended`,`open`,`ReadyState`,`P.!.".#Jw$y`],pD=[()=>H,`appendWindowEnd`,`appendWindowStart`,()=>wx,`buffered`,()=>ek,`mode`,0,`this`,()=>U,`ev`,``,`onabort`,0,()=>U,`onerror`,0,()=>U,`onupdate`,0,()=>U,`onupdateend`,0,()=>U,`onupdatestart`,`timestampOffset`,`updating`,`abort`,()=>Fw,`data`,`appendBuffer`,`type`,`changeType`,`start`,`end`,`remove`,0,()=>tk,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>tk,()=>B,`removeEventListener`,()=>z,()=>B,`SourceBuffer`,`Pn!'4"'4#n$4%9n&4'PPn(2)n*2+"/,,J4-PPn.2)n/2+"/,,J40PPn12)n22+"/,,J43PPn42)n52+"/,,J46PPn72)n82+"/,,J49'4:)4;9P$1<Pn=2>$1?P&2@$1AP'2B'2C$1DP"2@PnE2)nF"f2+"/,2GP)nHJ2I8$1JP&2@nK2GP)nLJ2I8$1JP"2@PnM2)nN"f2+"/,2GP)nOJ2I8$1PP&2@nQ2GP)nRJ2I8$1PMwSy`],mD=[`decode`,`network`,`EndOfStreamError`,`P.!."Jw#y`],hD=[()=>U,`sourceclose`,()=>U,`sourceended`,()=>U,`sourceopen`,`MediaSourceEventMap`,`Pn!4"n#4$n%4&Mw'y`],gD=[()=>nk,`successCallback`,()=>zx,`errorCallback`,`readEntries`,`FileSystemDirectoryReader`,`PPn!2"n#2$8$1%Mw&y`],_D=[`create`,`exclusive`,`FileSystemFlags`,`P)4!8)4"8Mw#y`],vD=[`ignoreMethod`,`ignoreSearch`,`ignoreVary`,`CacheQueryOptions`,`P)4!8)4"8)4#8Mw$y`],yD=[()=>rk,`AlgorithmIdentifier`,`Pn!&Jw"y`],bD=[()=>rk,()=>Fw,`label`,`RsaOaepParams`,`Pn!n"4#8Mw$y`],xD=[()=>rk,()=>Fw,`counter`,`length`,`AesCtrParams`,`Pn!n"4#'4$Mw%y`],SD=[()=>rk,()=>Fw,`iv`,`AesCbcParams`,`Pn!n"4#Mw$y`],CD=[()=>rk,()=>Fw,`additionalData`,()=>Fw,`iv`,`tagLength`,`AesGcmParams`,`Pn!n"4#8n$4%'4&8Mw'y`],wD=[()=>ik,`algorithm`,`extractable`,()=>ak,`type`,()=>AD,`usages`,`CryptoKey`,`Pn!4"9)4#9n$4%9n&F4'9Mw(y`],TD=[()=>rk,()=>wD,`public`,`EcdhKeyDeriveParams`,`Pn!n"4#Mw$y`],ED=[()=>rk,()=>ok,`hash`,()=>Fw,`info`,()=>Fw,`salt`,`HkdfParams`,`Pn!n"4#n$4%n&4'Mw(y`],DD=[()=>rk,()=>ok,`hash`,`iterations`,()=>Fw,`salt`,`Pbkdf2Params`,`Pn!n"4#'4$n%4&Mw'y`],OD=[()=>rk,`length`,`AesDerivedKeyParams`,`Pn!'4"Mw#y`],kD=[()=>rk,()=>ok,`hash`,`length`,`HmacImportParams`,`Pn!n"4#'4$8Mw%y`],AD=[`decrypt`,`deriveBits`,`deriveKey`,`encrypt`,`sign`,`unwrapKey`,`verify`,`wrapKey`,`KeyUsage`,`P.!.".#.$.%.&.'.(Jw)y`],jD=[`alg`,`crv`,`d`,`dp`,`dq`,`e`,`ext`,`k`,`key_ops`,`kty`,`n`,()=>sk,`oth`,`p`,`q`,`qi`,`use`,`x`,`y`,`JsonWebKey`,`P&4!8&4"8&4#8&4$8&4%8&4&8)4'8&4(8&F4)8&4*8&4+8n,F4-8&4.8&4/8&408&418&428&438Mw4y`],MD=[`T`,`U`,`Exclude`,`l6!Re$!RPe#!e$"qk#%QRb!b"Pde"!p)w#y`],ND=[`jwk`,`pkcs8`,`raw`,`spki`,`KeyFormat`,`P.!.".#.$Jw%y`],PD=[()=>wD,`privateKey`,()=>wD,`publicKey`,`CryptoKeyPair`,`Pn!4"n#4$Mw%y`],FD=[()=>ck,()=>ok,`hash`,`RsaHashedKeyGenParams`,`Pn!n"4#Mw$y`],ID=[()=>rk,()=>lk,`namedCurve`,`EcKeyGenParams`,`Pn!n"4#Mw$y`],LD=[()=>rk,`length`,`AesKeyGenParams`,`Pn!'4"Mw#y`],RD=[()=>rk,()=>ok,`hash`,`length`,`HmacKeyGenParams`,`Pn!n"4#'4$8Mw%y`],zD=[()=>rk,()=>ok,`hash`,`RsaHashedImportParams`,`Pn!n"4#Mw$y`],BD=[()=>rk,()=>lk,`namedCurve`,`EcKeyImportParams`,`Pn!n"4#Mw$y`],VD=[()=>ik,`length`,`AesKeyAlgorithm`,`Pn!'4"Mw#y`],HD=[()=>rk,`saltLength`,`RsaPssParams`,`Pn!'4"Mw#y`],UD=[()=>rk,()=>ok,`hash`,`EcdsaParams`,`Pn!n"4#Mw$y`],WD=[`T`,()=>H,()=>ex,`error`,0,`this`,()=>U,`ev`,``,`onerror`,0,()=>U,`onsuccess`,()=>uk,`readyState`,`result`,()=>dk,()=>fk,()=>pk,`source`,()=>mk,`transaction`,`type`,0,()=>hk,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>hk,()=>B,`removeEventListener`,()=>z,()=>B,`IDBRequest`,`"c!Pn"Pn#,J4$9PPe$!o%"2&n'2("/),J4*PPe$!o+"2&n,2("/),J4-n.4/9e"!409Pn1n2n3J449Pn5,J469P"27Pe$!o8"2&n9"f2("/)2:P)n;J2<8$1=P&27n>2:P)n?J2<8$1=P"27Pe$!o@"2&nA"f2("/)2:P)nBJ2<8$1CP&27nD2:P)nEJ2<8$1CMwFy`],GD=[()=>H,`name`,()=>gk,`objectStoreNames`,0,`this`,()=>U,`ev`,``,`onabort`,0,()=>U,`onclose`,0,()=>U,`onerror`,0,()=>$f,`onversionchange`,`version`,`close`,()=>_k,`options`,()=>dk,`createObjectStore`,`deleteObjectStore`,`storeNames`,()=>vk,`mode`,()=>yk,()=>mk,`transaction`,`type`,0,()=>bk,`listener`,()=>R,`addEventListener`,()=>z,()=>R,0,()=>bk,()=>B,`removeEventListener`,()=>z,()=>B,`IDBDatabase`,`Pn!&4"9n#4$9PPn%2&n'2("/),J4*PPn+2&n,2("/),J4-PPn.2&n/2("/),J40PPn12&n22("/),J43'449P$15P&2"n6278n819P&2"$1:PP&&FJ2;n<2=8n>278n?1@P"2APnB2&nC"f2("/)2DP)nEJ278$1FP&2AnG2DP)nHJ278$1FP"2APnI2&nJ"f2("/)2DP)nKJ278$1LP&2AnM2DP)nNJ278$1LMwOy`],KD=[()=>hk,()=>$f,`blocked`,()=>$f,`upgradeneeded`,`IDBOpenDBRequestEventMap`,`Pn!n"4#n$4%Mw&y`],qD=[()=>qd,`duration`,`entryType`,`name`,()=>qd,`startTime`,`toJSON`,`PerformanceEntry`,`Pn!4"9&4#9&4$9n%4&9P"1'Mw(y`],JD=[``,`audio`,`audioworklet`,`document`,`embed`,`font`,`frame`,`iframe`,`image`,`manifest`,`object`,`paintworklet`,`report`,`script`,`sharedworker`,`style`,`track`,`video`,`worker`,`xslt`,`RequestDestination`,`P.!.".#.$.%.&.'.(.).*.+.,.-.../.0.1.2.3.4Jw5y`],YD=[`value`,`key`,0,`parent`,``,`callbackfn`,`thisArg`,`forEach`,`WGSLLanguageFeatures`,`PPP&2!&2"n#2$$/%2&"2'8$1(Mw)y`],XD=[`forceFallbackAdapter`,()=>xk,`powerPreference`,`GPURequestAdapterOptions`,`P)4!8n"4#8Mw$y`],ZD=[()=>Ty,`features`,()=>wy,`info`,()=>Ey,`limits`,()=>Sk,`descriptor`,()=>Pg,`requestDevice`,`GPUAdapter`,`Pn!4"9n#4$9n%4&9Pn'2(8n)\`1*Mw+y`],QD=[()=>Ck,`held`,()=>Ck,`pending`,`LockManagerSnapshot`,`Pn!F4"8n#F4$8Mw%y`],$D=[`T`,()=>wk,`lock`,``,`LockGrantedCallback`,`b!PPPn",J2#e#!v$Mw%y`],eO=[`T`,`onfulfilled`,`args`,`then`,`value`,``,0,`Awaited`,`le$!Re"!o'"R!RPde#!Ph"!2%h&"@2#"/&qk'.QRPde#!p0Re$!RPdde#!P%PPh$!2"h$"@2#"1$MKqkJRQRPde%!pVRPe#!P,-Jqk#vQRb!Pde"!p~w(y`],tO=[`ifAvailable`,()=>Tk,`mode`,()=>il,`signal`,`steal`,`LockOptions`,`P)4!8n"4#8n$4%8)4&8Mw'y`],nO=[`description`,()=>rO,`enabledPlugin`,`suffixes`,`type`,`MimeType`,`P&4!9n"4#9&4$9&4%9Mw&y`],rO=[`description`,`filename`,`length`,`name`,`index`,()=>nO,`item`,()=>nO,`namedItem`,()=>nO,`Plugin`,`P&4!9&4"9'4#9&4$9P'2%Pn&,J1'P&2$Pn(,J1)'n*LMw+y`],iO=[`quota`,`usage`,`StorageEstimate`,`P'4!8'4"8Mw#y`],aO=[()=>Ek,`directory`,`kind`,`name`,()=>Dk,`options`,0,`getDirectoryHandle`,()=>Ok,()=>kk,`getFileHandle`,()=>Ak,`removeEntry`,()=>Ek,`possibleDescendant`,`resolve`,`FileSystemDirectoryHandle`,"Pn!.\"4#9P&2$n%2&8n'`1(P&2$n)2&8n*`1+P&2$n,2&8$`1-Pn.2/P&F,J`10Mw1y"],oO=[()=>jk,`presentationStyle`,()=>$d,`types`,`type`,()=>Xc,`getType`,`ClipboardItem`,`Pn!4"9&o#"4$9P&2%n&\`1'Mw(y`],sO=[()=>Mk,`attestation`,()=>Nk,`authenticatorSelection`,()=>Fw,`challenge`,()=>Pk,`excludeCredentials`,()=>Fk,`extensions`,()=>Ik,`pubKeyCredParams`,()=>Lk,`rp`,`timeout`,()=>Rk,`user`,`PublicKeyCredentialCreationOptions`,`Pn!4"8n#4$8n%4&n'F4(8n)4*8n+F4,n-4.'4/8n041Mw2y`],cO=[`conditional`,`optional`,`required`,`silent`,`CredentialMediationRequirement`,`P.!.".#.$Jw%y`],lO=[()=>Pk,`allowCredentials`,()=>Fw,`challenge`,()=>Fk,`extensions`,`rpId`,`timeout`,()=>zk,`userVerification`,`PublicKeyCredentialRequestOptions`,`Pn!F4"8n#4$n%4&8&4'8'4(8n)4*8Mw+y`],uO=[()=>Bk,`coords`,()=>Vk,`timestamp`,`toJSON`,`GeolocationPosition`,`Pn!4"9n#4$9P"1%Mw&y`],dO=[`code`,`message`,1,`PERMISSION_DENIED`,2,`POSITION_UNAVAILABLE`,3,`TIMEOUT`,`GeolocationPositionError`,`P'4!9&4"9.#4$9.%4&9.'4(9Mw)y`],fO=[()=>Hk,`audio`,()=>Uk,`video`,`MediaConfiguration`,`Pn!4"8n#4$8Mw%y`],pO=[()=>Wk,`audio`,()=>oE,`distinctiveIdentifier`,`initDataType`,`keySystem`,()=>oE,`persistentState`,`sessionTypes`,()=>Wk,`video`,`MediaCapabilitiesKeySystemConfiguration`,`Pn!4"8n#4$8&4%8&4&n'4(8&F4)8n*4+8Mw,y`],mO=[`file`,`media-source`,`webrtc`,`MediaDecodingType`,`P.!.".#Jw$y`],hO=[`powerEfficient`,`smooth`,`supported`,`MediaCapabilitiesInfo`,`P)4!)4")4#Mw$y`],gO=[`record`,`webrtc`,`MediaEncodingType`,`P.!."Jw#y`],_O=[`audioinput`,`audiooutput`,`videoinput`,`MediaDeviceKind`,`P.!.".#Jw$y`],vO=[`sizes`,`src`,`type`,`MediaImage`,`P&4!8&4"&4#8Mw$y`],yO=[()=>KT,`action`,`fastSeek`,`seekOffset`,`seekTime`,`MediaSessionActionDetails`,`Pn!4")4#8'4$8'4%8Mw&y`],bO=[`camera`,`geolocation`,`microphone`,`midi`,`notifications`,`persistent-storage`,`push`,`screen-wake-lock`,`storage-access`,`PermissionName`,`P.!.".#.$.%.&.'.(.)Jw*y`],xO=[`denied`,`granted`,`prompt`,`PermissionState`,`P.!.".#Jw$y`],SO=[()=>U,`change`,`PermissionStatusEventMap`,`Pn!4"Mw#y`],CO=[()=>Gk,`pushManager`,`PushManagerAttribute`,`Pn!4"9Mw#y`],wO=[()=>IS,`getSubscriptions`,()=>IS,`subscriptions`,`subscribe`,()=>IS,`unsubscribe`,`CookieStoreManager`,"PPn!F`1\"Pn#F2$$`1%Pn&F2$$`1'Mw(y"],TO=[`disable`,`enable`,()=>Kk,`getState`,`value`,`setHeaderValue`,`NavigationPreloadManager`,"PP$`1!P$`1\"Pn#`1$P&2%$`1&Mw'y"],EO=[`all`,`imports`,`none`,`ServiceWorkerUpdateViaCache`,`P.!.".#Jw$y`],DO=[`tag`,`GetNotificationOptions`,`P&4!8Mw"y`],OO=[()=>H,`body`,`data`,()=>qk,`dir`,`icon`,`lang`,0,`this`,()=>U,`ev`,``,`onclick`,0,()=>U,`onclose`,0,()=>U,`onerror`,0,()=>U,`onshow`,`requireInteraction`,`silent`,`tag`,`title`,`close`,`type`,0,()=>Jk,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Jk,()=>B,`removeEventListener`,()=>z,()=>B,`Notification`,`Pn!&4"9"4#9n$4%9&4&9&4'9PPn(2)n*2+"/,,J4-PPn.2)n/2+"/,,J40PPn12)n22+"/,,J43PPn42)n52+"/,,J46)479P),J489&499&4:9P$1;P"2<Pn=2)n>"f2+"/,2?P)n@J2A8$1BP&2<nC2?P)nDJ2A8$1BP"2<PnE2)nF"f2+"/,2?P)nGJ2A8$1HP&2<nI2?P)nJJ2A8$1HMwKy`],kO=[`badge`,`body`,`data`,()=>qk,`dir`,`icon`,`lang`,`requireInteraction`,`silent`,`tag`,`NotificationOptions`,`P&4!8&4"8"4#8n$4%8&4&8&4'8)4(8P),J4)8&4*8Mw+y`],AO=[()=>U,`updatefound`,`ServiceWorkerRegistrationEventMap`,`Pn!4"Mw#y`],jO=[`classic`,`module`,`WorkerType`,`P.!."Jw#y`],MO=[()=>U,`release`,`WakeLockSentinelEventMap`,`Pn!4"Mw#y`],NO=[()=>z_,0,`this`,()=>tp,`ev`,``,`onmidimessage`,`type`,0,()=>Yk,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Yk,()=>B,`removeEventListener`,()=>z,()=>B,`MIDIInput`,`Pn!PPn"2#n$2%"/&,J4'P"2(Pn)2#n*"f2%"/&2+P)n,J2-8$1.P&2(n/2+P)n0J2-8$1.P"2(Pn12#n2"f2%"/&2+P)n3J2-8$14P&2(n52+P)n6J2-8$14Mw7y`],PO=[()=>z_,`data`,()=>qd,`timestamp`,`send`,`type`,0,`this`,()=>Lb,`ev`,``,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>Lb,()=>B,`removeEventListener`,()=>z,()=>B,`MIDIOutput`,`Pn!P'F2"n#2$8$1%P"2&Pn'2(n)"f2*"/+2,P)n-J2.8$1/P&2&n02,P)n1J2.8$1/P"2&Pn22(n3"f2*"/+2,P)n4J2.8$15P&2&n62,P)n7J2.8$15Mw8y`],FO=[()=>ib,`x`,()=>ib,`y`,`GPUOrigin2DDict`,`Pn!4"8n#4$8Mw%y`],IO=[()=>ib,`x`,()=>ib,`y`,()=>ib,`z`,`GPUOrigin3DDict`,`Pn!4"8n#4$8n%4&8Mw'y`],LO=[()=>Py,`buffer`,()=>yC,`offset`,()=>yC,`size`,`GPUBufferBinding`,`Pn!4"n#4$8n%4&8Mw'y`],RO=[`read-only-storage`,`storage`,`uniform`,`GPUBufferBindingType`,`P.!.".#Jw$y`],zO=[`comparison`,`filtering`,`non-filtering`,`GPUSamplerBindingType`,`P.!.".#Jw$y`],BO=[`read-only`,`read-write`,`write-only`,`GPUStorageTextureAccess`,`P.!.".#Jw$y`],VO=[`depth`,`float`,`sint`,`uint`,`unfilterable-float`,`GPUTextureSampleType`,`P.!.".#.$.%Jw&y`],HO=[`clear`,`load`,`GPULoadOp`,`P.!."Jw#y`],UO=[`discard`,`store`,`GPUStoreOp`,`P.!."Jw#y`],WO=[`a`,`b`,`g`,`r`,`GPUColorDict`,`P'4!'4"'4#'4$Mw%y`],GO=[`decrement-clamp`,`decrement-wrap`,`increment-clamp`,`increment-wrap`,`invert`,`keep`,`replace`,`zero`,`GPUStencilOperation`,`P.!.".#.$.%.&.'.(Jw)y`],KO=[()=>Xk,`alpha`,()=>Xk,`color`,`GPUBlendState`,`Pn!4"n#4$Mw%y`],qO=[`GPUColorWriteFlags`,`'w!y`],JO=[()=>Zk,`format`,()=>yC,`offset`,()=>xE,`shaderLocation`,`GPUVertexAttribute`,`Pn!4"n#4$n%4&Mw'y`],YO=[`instance`,`vertex`,`GPUVertexStepMode`,`P.!."Jw#y`],XO=[`error`,`info`,`warning`,`GPUCompilationMessageType`,`P.!.".#Jw$y`],ZO=[`rid`,`RTCRtpCodingParameters`,`P&4!8Mw"y`],QO=[`high`,`low`,`medium`,`very-low`,`RTCPriorityType`,`P.!.".#.$Jw%y`],$O=[()=>U,`addsourcebuffer`,()=>U,`removesourcebuffer`,`SourceBufferListEventMap`,`Pn!4"n#4$Mw%y`],ek=[`segments`,`sequence`,`AppendMode`,`P.!."Jw#y`],tk=[()=>U,`abort`,()=>U,`error`,()=>U,`update`,()=>U,`updateend`,()=>U,`updatestart`,`SourceBufferEventMap`,`Pn!4"n#4$n%4&n'4(n)4*Mw+y`],nk=[()=>bv,`entries`,``,`FileSystemEntriesCallback`,`PPn!F2"$v#Mw$y`],rk=[`name`,`Algorithm`,`P&4!Mw"y`],ik=[`name`,`KeyAlgorithm`,`P&4!Mw"y`],ak=[`private`,`public`,`secret`,`KeyType`,`P.!.".#Jw$y`],ok=[()=>yD,`HashAlgorithmIdentifier`,`n!w"y`],sk=[`d`,`r`,`t`,`RsaOtherPrimesInfo`,`P&4!8&4"8&4#8Mw$y`],ck=[()=>rk,`modulusLength`,()=>Qk,`publicExponent`,`RsaKeyGenParams`,`Pn!'4"n#4$Mw%y`],lk=[`NamedCurve`,`&w!y`],uk=[`done`,`pending`,`IDBRequestReadyState`,`P.!."Jw#y`],dk=[`autoIncrement`,()=>gk,`indexNames`,`keyPath`,`name`,()=>mk,`transaction`,`value`,()=>$k,`key`,()=>WD,()=>$k,`add`,()=>WD,`clear`,()=>$k,()=>eA,`query`,()=>WD,`count`,()=>tA,`options`,()=>fk,`createIndex`,()=>$k,()=>eA,()=>WD,`delete`,`deleteIndex`,()=>$k,()=>eA,()=>WD,`get`,()=>$k,()=>eA,`queryOrOptions`,()=>WD,`getAll`,()=>$k,()=>eA,()=>WD,()=>$k,`getAllKeys`,()=>$k,()=>eA,()=>WD,()=>$k,`getKey`,()=>fk,`index`,()=>$k,()=>eA,()=>nA,`direction`,()=>WD,()=>rA,`openCursor`,()=>$k,()=>eA,()=>nA,()=>WD,()=>pk,`openKeyCursor`,()=>$k,()=>WD,()=>$k,`put`,`IDBObjectStore`,`P)4!9n"4#9P&&F,J4$9&4%n&4'9P"2(n)2*8n,o+"1-P-o."1/PPn0n1J228'o3"14P&2%P&&FJ2$n5268n718PPn9n:J22-o;"1<P&2%$1=PPn>n?J22"o@"1APPnBnC,J2D8'248"FoE"1FPPnGnH,J2D8'248nJFoI"1KPPnLnMJ22PnO-JoN"1PP&2%nQ1RPPnSnT,J228nU2V8PnX,JoW"1YPPnZn[,J228n\\2V8Pn^,Jo]"1_P"2(n\`2*8nboa"1cMwdy`],fk=[`keyPath`,`multiEntry`,`name`,()=>dk,`objectStore`,`unique`,()=>$k,()=>eA,`query`,()=>WD,`count`,()=>$k,()=>eA,()=>WD,`get`,()=>$k,()=>eA,`queryOrOptions`,()=>WD,`getAll`,()=>$k,()=>eA,()=>WD,()=>$k,`getAllKeys`,()=>$k,()=>eA,()=>WD,()=>$k,`getKey`,()=>$k,()=>eA,()=>nA,`direction`,()=>WD,()=>rA,`openCursor`,()=>$k,()=>eA,()=>nA,()=>WD,()=>pk,`openKeyCursor`,`IDBIndex`,`PP&&FJ4!9)4"9&4#n$4%9)4&9PPn'n(J2)8'o*"1+PPn,n-J2)"o."1/PPn0n1,J228'2+8"Fo3"14PPn5n6,J228'2+8n8Fo7"19PPn:n;J2)Pn=-Jo<"1>PPn?n@,J2)8nA2B8PnD,JoC"1EPPnFnG,J2)8nH2B8PnJ,JoI"1KMwLy`],pk=[()=>nA,`direction`,()=>$k,`key`,()=>$k,`primaryKey`,()=>WD,`request`,()=>dk,()=>fk,`source`,`count`,`advance`,()=>$k,`continue`,()=>$k,()=>$k,`continuePrimaryKey`,()=>WD,`delete`,`value`,()=>WD,()=>$k,`update`,`IDBCursor`,`Pn!4"9n#4$9n%4&9n'4(9Pn)n*J4+9P'2,$1-Pn.2$8$1/Pn02$n12&$12P-o3"14P"25n7o6"18Mw9y`],mk=[()=>H,()=>GD,`db`,()=>iA,`durability`,()=>ex,`error`,()=>vk,`mode`,()=>gk,`objectStoreNames`,0,`this`,()=>U,`ev`,``,`onabort`,0,()=>U,`oncomplete`,0,()=>U,`onerror`,`abort`,`commit`,`name`,()=>dk,`objectStore`,`type`,0,()=>aA,`listener`,()=>R,`options`,`addEventListener`,()=>z,()=>R,0,()=>aA,()=>B,`removeEventListener`,()=>z,()=>B,`IDBTransaction`,`Pn!n"4#9n$4%9Pn&,J4'9n(4)9n*4+9PPn,2-n.2/"/0,J41PPn22-n32/"/0,J44PPn52-n62/"/0,J47P$18P$19P&2:n;1<P"2=Pn>2-n?"f2/"/02@P)nAJ2B8$1CP&2=nD2@P)nEJ2B8$1CP"2=PnF2-nG"f2/"/02@P)nHJ2B8$1IP&2=nJ2@P)nKJ2B8$1IMwLy`],hk=[()=>U,`error`,()=>U,`success`,`IDBRequestEventMap`,`Pn!4"n#4$Mw%y`],gk=[`length`,`string`,`contains`,`index`,`item`,`DOMStringList`,`P'4!9P&2")1#P'2$P&,J1%'&LMw&y`],_k=[`autoIncrement`,`keyPath`,`IDBObjectStoreParameters`,`P)4!8P&&F,J4"8Mw#y`],vk=[`readonly`,`readwrite`,`versionchange`,`IDBTransactionMode`,`P.!.".#Jw$y`],yk=[()=>iA,`durability`,`IDBTransactionOptions`,`Pn!4"8Mw#y`],bk=[()=>U,`abort`,()=>U,`close`,()=>U,`error`,()=>$f,`versionchange`,`IDBDatabaseEventMap`,`Pn!4"n#4$n%4&n'4(Mw)y`],xk=[`high-performance`,`low-power`,`GPUPowerPreference`,`P.!."Jw#y`],Sk=[()=>rb,()=>oA,`defaultQueue`,()=>sA,`requiredFeatures`,()=>IE,()=>yC,`requiredLimits`,`GPUDeviceDescriptor`,`Pn!n"4#8n$F4%8&Pn'-Jo(8Mw)y`],Ck=[`clientId`,()=>Tk,`mode`,`name`,`LockInfo`,`P&4!8n"4#8&4$8Mw%y`],wk=[()=>Tk,`mode`,`name`,`Lock`,`Pn!4"9&4#9Mw$y`],Tk=[`exclusive`,`shared`,`LockMode`,`P.!."Jw#y`],Ek=[()=>cA,`kind`,`name`,0,`other`,`isSameEntry`,`FileSystemHandle`,`Pn!4"9&4#9Pn$2%)\`1&Mw'y`],Dk=[`create`,`FileSystemGetDirectoryOptions`,`P)4!8Mw"y`],Ok=[`create`,`FileSystemGetFileOptions`,`P)4!8Mw"y`],kk=[()=>Ek,`file`,`kind`,()=>lA,`options`,()=>uA,`createWritable`,()=>ou,`getFile`,`FileSystemFileHandle`,"Pn!.\"4#9Pn$2%8n&`1'Pn(`1)Mw*y"],Ak=[`recursive`,`FileSystemRemoveOptions`,`P)4!8Mw"y`],jk=[`attachment`,`inline`,`unspecified`,`PresentationStyle`,`P.!.".#Jw$y`],Mk=[`direct`,`enterprise`,`indirect`,`none`,`AttestationConveyancePreference`,`P.!.".#.$Jw%y`],Nk=[()=>dA,`authenticatorAttachment`,`requireResidentKey`,()=>fA,`residentKey`,()=>zk,`userVerification`,`AuthenticatorSelectionCriteria`,`Pn!4"8)4#8n$4%8n&4'8Mw(y`],Pk=[()=>Fw,`id`,()=>pA,`transports`,()=>mA,`type`,`PublicKeyCredentialDescriptor`,`Pn!4"n#F4$8n%4&Mw'y`],Fk=[`appid`,`credProps`,`credentialProtectionPolicy`,`enforceCredentialProtectionPolicy`,`hmacCreateSecret`,()=>hA,`largeBlob`,`minPinLength`,()=>gA,`prf`,`AuthenticationExtensionsClientInputs`,`P&4!8)4"8&4#8)4$8)4%8n&4'8)4(8n)4*8Mw+y`],Ik=[()=>_A,`alg`,()=>mA,`type`,`PublicKeyCredentialParameters`,`Pn!4"n#4$Mw%y`],Lk=[()=>vA,`id`,`PublicKeyCredentialRpEntity`,`Pn!&4"8Mw#y`],Rk=[()=>vA,`displayName`,()=>Fw,`id`,`PublicKeyCredentialUserEntity`,`Pn!&4"n#4$Mw%y`],zk=[`discouraged`,`preferred`,`required`,`UserVerificationRequirement`,`P.!.".#Jw$y`],Bk=[`accuracy`,`altitude`,`altitudeAccuracy`,`heading`,`latitude`,`longitude`,`speed`,`toJSON`,`GeolocationCoordinates`,`P'4!9P',J4"9P',J4#9P',J4$9'4%9'4&9P',J4'9P"1(Mw)y`],Vk=[`EpochTimeStamp`,`'w!y`],Hk=[`bitrate`,`channels`,`contentType`,`samplerate`,`spatialRendering`,`AudioConfiguration`,`P'4!8&4"8&4#'4$8)4%8Mw&y`],Uk=[`bitrate`,()=>yA,`colorGamut`,`contentType`,`framerate`,`hasAlphaChannel`,()=>bA,`hdrMetadataType`,`height`,`scalabilityMode`,()=>xA,`transferFunction`,`width`,`VideoConfiguration`,`P'4!n"4#8&4$'4%)4&8n'4(8'4)&4*8n+4,8'4-Mw.y`],Wk=[`robustness`,`KeySystemTrackConfiguration`,`P&4!8Mw"y`],Gk=[()=>SA,`getSubscription`,()=>CA,`options`,()=>xO,`permissionState`,()=>CA,()=>SA,`subscribe`,`PushManager`,"PPPn!,J`1\"Pn#2$8n%`1&Pn'2$8n(`1)Mw*y"],Kk=[`enabled`,`headerValue`,`NavigationPreloadState`,`P)4!8&4"8Mw#y`],qk=[`auto`,`ltr`,`rtl`,`NotificationDirection`,`P.!.".#Jw$y`],Jk=[()=>U,`click`,()=>U,`close`,()=>U,`error`,()=>U,`show`,`NotificationEventMap`,`Pn!4"n#4$n%4&n'4(Mw)y`],Yk=[()=>Lb,()=>tp,`midimessage`,`MIDIInputEventMap`,`Pn!n"4#Mw$y`],Xk=[()=>wA,`dstFactor`,()=>TA,`operation`,()=>wA,`srcFactor`,`GPUBlendComponent`,`Pn!4"8n#4$8n%4&8Mw'y`],Zk=`float16 float16x2 float16x4 float32 float32x2 float32x3 float32x4 sint16 sint16x2 sint16x4 sint32 sint32x2 sint32x3 sint32x4 sint8 sint8x2 sint8x4 snorm16 snorm16x2 snorm16x4 snorm8 snorm8x2 snorm8x4 uint16 uint16x2 uint16x4 uint32 uint32x2 uint32x3 uint32x4 uint8 uint8x2 uint8x4 unorm10-10-10-2 unorm16 unorm16x2 unorm16x4 unorm8 unorm8x2 unorm8x4 unorm8x4-bgra GPUVertexFormat P.!.".#.$.%.&.'.(.).*.+.,.-.../.0.1.2.3.4.5.6.7.8.9.:.;.<.=.>.?.@.A.B.C.D.E.F.G.H.IJwJy`.split(` `),Qk=[`BigInteger`,`Ww!y`],$k=[()=>Fw,0,`IDBValidKey`,`P'&Tn!n"FJw#y`],eA=[`lower`,`lowerOpen`,`upper`,`upperOpen`,`key`,`includes`,`IDBKeyRange`,`P"4!9)4"9"4#9)4$9P"2%)1&Mw'y`],tA=[`multiEntry`,`unique`,`IDBIndexParameters`,`P)4!8)4"8Mw#y`],nA=[`next`,`nextunique`,`prev`,`prevunique`,`IDBCursorDirection`,`P.!.".#.$Jw%y`],rA=[()=>pk,`value`,`IDBCursorWithValue`,`Pn!"4"9Mw#y`],iA=[`default`,`relaxed`,`strict`,`IDBTransactionDurability`,`P.!.".#Jw$y`],aA=[()=>U,`abort`,()=>U,`complete`,()=>U,`error`,`IDBTransactionEventMap`,`Pn!4"n#4$n%4&Mw'y`],oA=[()=>rb,`GPUQueueDescriptor`,`Pn!Mw"y`],sA=[`bgra8unorm-storage`,`clip-distances`,`core-features-and-limits`,`depth-clip-control`,`depth32float-stencil8`,`dual-source-blending`,`float32-blendable`,`float32-filterable`,`indirect-first-instance`,`primitive-index`,`rg11b10ufloat-renderable`,`shader-f16`,`subgroups`,`texture-compression-astc`,`texture-compression-astc-sliced-3d`,`texture-compression-bc`,`texture-compression-bc-sliced-3d`,`texture-compression-etc2`,`texture-formats-tier1`,`timestamp-query`,`GPUFeatureName`,`P.!.".#.$.%.&.'.(.).*.+.,.-.../.0.1.2.3.4Jw5y`],cA=[`directory`,`file`,`FileSystemHandleKind`,`P.!."Jw#y`],lA=[`keepExistingData`,`FileSystemCreateWritableOptions`,`P)4!8Mw"y`],uA=[()=>Zg,`position`,`seek`,`size`,`truncate`,()=>EA,`data`,`write`,`FileSystemWritableFileStream`,"Pn!P'2\"$`1#P'2$$`1%Pn&2'$`1(Mw)y"],dA=[`cross-platform`,`platform`,`AuthenticatorAttachment`,`P.!."Jw#y`],fA=[`discouraged`,`preferred`,`required`,`ResidentKeyRequirement`,`P.!.".#Jw$y`],pA=[`ble`,`hybrid`,`internal`,`nfc`,`usb`,`AuthenticatorTransport`,`P.!.".#.$.%Jw&y`],mA=[`public-key`,`PublicKeyCredentialType`,`.!w"y`],hA=[`read`,`support`,()=>Fw,`write`,`AuthenticationExtensionsLargeBlobInputs`,`P)4!8&4"8n#4$8Mw%y`],gA=[()=>DA,`eval`,()=>IE,()=>DA,`evalByCredential`,`AuthenticationExtensionsPRFInputs`,`Pn!4"8&n$o##4%8Mw&y`],_A=[`COSEAlgorithmIdentifier`,`'w!y`],vA=[`name`,`PublicKeyCredentialEntity`,`P&4!Mw"y`],yA=[`p3`,`rec2020`,`srgb`,`ColorGamut`,`P.!.".#Jw$y`],bA=[`smpteSt2086`,`smpteSt2094-10`,`smpteSt2094-40`,`HdrMetadataType`,`P.!.".#Jw$y`],xA=[`hlg`,`pq`,`srgb`,`TransferFunction`,`P.!.".#Jw$y`],SA=[`endpoint`,()=>Vk,`expirationTime`,()=>OA,`options`,()=>kA,`name`,`getKey`,()=>AA,`toJSON`,`unsubscribe`,`PushSubscription`,`P&4!9Pn",J4#9n$4%9Pn&2'P_,J1(Pn)1*P)\`1+Mw,y`],CA=[()=>Fw,`applicationServerKey`,`userVisibleOnly`,`PushSubscriptionOptionsInit`,`PPn!&,J4"8)4#8Mw$y`],wA=[`constant`,`dst`,`dst-alpha`,`one`,`one-minus-constant`,`one-minus-dst`,`one-minus-dst-alpha`,`one-minus-src`,`one-minus-src-alpha`,`src`,`src-alpha`,`src-alpha-saturated`,`zero`,`GPUBlendFactor`,`P.!.".#.$.%.&.'.(.).*.+.,.-Jw.y`],TA=[`add`,`max`,`min`,`reverse-subtract`,`subtract`,`GPUBlendOperation`,`P.!.".#.$.%Jw&y`],EA=[()=>Fw,()=>Xc,()=>jA,`FileSystemWriteChunkType`,`Pn!n"&n#Jw$y`],DA=[()=>Fw,`first`,()=>Fw,`second`,`AuthenticationExtensionsPRFValues`,`Pn!4"n#4$8Mw%y`],OA=[`applicationServerKey`,`userVisibleOnly`,`PushSubscriptionOptions`,`PP_,J4!9)4"9Mw#y`],kA=[`auth`,`p256dh`,`PushEncryptionKeyName`,`P.!."Jw#y`],AA=[`endpoint`,()=>Vk,`expirationTime`,()=>IE,`keys`,`PushSubscriptionJSON`,`P&4!8Pn",J4#8&&o$#4%8Mw&y`],jA=[()=>Fw,()=>Xc,`data`,`position`,`size`,()=>MA,`type`,`WriteParams`,`PPn!n"&,J4#8P',J4$8P',J4%8n&4'Mw(y`],MA=[`seek`,`truncate`,`write`,`WriteCommandType`,`P.!.".#Jw$y`];function __assignType$1(e,t){return e.__type=t,e}__name$1(__assignType$1,`__assignType`);const NA=[`wireframe`,`flat`,`smooth`,`glossy`,`textured`,`reflective`,`ShadingMode`,`P.!.".#.$.%.&Jw'y`],PA=[2,3,4,5,6,8,10,15,20,30,40,50],FA=[`wireframe`,`flat`,`smooth`,`glossy`,`textured`,`reflective`],IA=[`newTess`,`lid`,`body`,`bottom`,`fitLid`,`nonblinn`,()=>NA,`newShading`,`TeapotEffectController`,`P'4!)4")4#)4$)4%)4&n'4(Mw)y`],LA=[()=>IA,`effectController`,`render`,`pause`,`resume`,`isPaused`,`TeapotDemo`,`Pn!4"9P$1#P$1$P$1%)4&9Mw'y`],RA=[`assetBase`,`StartOptions`,`P&4!8Mw"y`];function start(e,t){let n=t?.assetBase??`./`,r=new WebGLRenderer({canvas:e,antialias:!0});r.setSize(e.width,e.height,!1);let i=e.width,a=e.height,o=new PerspectiveCamera(45,e.width/e.height,1,8e4);o.position.set(-600,550,1300);let s=new Scene;s.background=new Color(11184810);let c=new AmbientLight(8158332,2);s.add(c);let l=new DirectionalLight(16777215,2);l.position.set(.32,.39,.7),s.add(l);let u=new TextureLoader().load(`${n}assets/uv_grid_opengl.jpg`);u.wrapS=u.wrapT=Vr,u.anisotropy=16,u.colorSpace=hi;let d=`${n}assets/pisa/`,f=new CubeTextureLoader().setPath(d).load([`px.png`,`nx.png`,`py.png`,`ny.png`,`pz.png`,`nz.png`]),p={wireframe:new MeshBasicMaterial({wireframe:!0}),flat:new MeshPhongMaterial({specular:0,flatShading:!0,side:2}),smooth:new MeshLambertMaterial({side:2}),glossy:new MeshPhongMaterial({color:12632256,specular:4210752,shininess:300,side:2}),textured:new MeshPhongMaterial({map:u,side:2}),reflective:new MeshPhongMaterial({envMap:f,side:2})};new OrbitControls(o,e).addEventListener(`change`,render);let m={newTess:15,lid:!0,body:!0,bottom:!0,fitLid:!1,nonblinn:!1,newShading:`glossy`},h=-1,g,_,v,y,b,x,S;function createNewTeapot(){S!==void 0&&(S.geometry.dispose(),s.remove(S)),S=new Mesh(new TeapotGeometry(300,h,m.bottom,m.lid,m.body,m.fitLid,!m.nonblinn),p[x]),s.add(S)}createNewTeapot.__type=[`createNewTeapot`,`P"/!`];function doRender(){(m.newTess!==h||m.bottom!==g||m.lid!==_||m.body!==v||m.fitLid!==y||m.nonblinn!==b||m.newShading!==x)&&(h=m.newTess,g=m.bottom,_=m.lid,v=m.body,y=m.fitLid,b=m.nonblinn,x=m.newShading,createNewTeapot()),x===`reflective`?s.background=f:s.background=null;let t=e.width,n=e.height;(i!==t||a!==n)&&(i=t,a=n,r.setSize(t,n,!1),o.aspect=t/n,o.updateProjectionMatrix()),r.render(s,o)}doRender.__type=[`doRender`,`P"/!`];let C=!1,w=!1,T=!1;function render(){if(w){T=!0;return}C||(C=!0,requestAnimationFrame(()=>{C=!1,doRender()}))}return render.__type=[`render`,`P"/!`],render(),{effectController:m,render,get isPaused(){return w},pause:__assignType$1(function pause(){w||=!0},[`pause`,`P"/!`]),resume:__assignType$1(function resume(){w&&(w=!1,T&&(T=!1,render()))},[`resume`,`P"/!`])}}start.__type=[()=>rc,`canvas`,()=>RA,`options`,()=>LA,`start`,`Pn!2"n#2$8n%/&`];const zA=[`sidebarToggleButton`,`pauseButton`,`splitView`,`tessRow`,`lidRow`,`bodyRow`,`bottomRow`,`fitLidRow`,`nonblinnRow`,`shadingRow`,`glAreaContainer`];function __assignType(e,t){return e.__type=t,e}var TeapotWindow=class extends vn.ApplicationWindow{_demo=null;static{jn.registerClass({GTypeName:`TeapotWindow`,Template:`<?xml version="1.0" encoding="UTF-8"?>
|
|
4217
|
+
}`,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Mesh(new bo(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},WebXRManager=class extends EventDispatcher{constructor(e,t){super();let n=this,r=null,i=1,a=null,o=`local-floor`,s=1,c=null,l=null,u=null,d=null,f=null,p=null,m=typeof XRWebGLBinding<`u`,h=new WebXRDepthSensing,g={},_=t.getContextAttributes(),v=null,y=null,b=[],x=[],S=new G,C=null,w=new PerspectiveCamera;w.viewport=new Y;let T=new PerspectiveCamera;T.viewport=new Y;let E=[w,T],D=new ArrayCamera,O=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=b[e];return t===void 0&&(t=new WebXRController,b[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=b[e];return t===void 0&&(t=new WebXRController,b[e]=t),t.getGripSpace()},this.getHand=function(e){let t=b[e];return t===void 0&&(t=new WebXRController,b[e]=t),t.getHandSpace()};function onSessionEvent(e){let t=x.indexOf(e.inputSource);if(t===-1)return;let n=b[t];n!==void 0&&(n.update(e.inputSource,e.frame,c||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function onSessionEnd(){r.removeEventListener(`select`,onSessionEvent),r.removeEventListener(`selectstart`,onSessionEvent),r.removeEventListener(`selectend`,onSessionEvent),r.removeEventListener(`squeeze`,onSessionEvent),r.removeEventListener(`squeezestart`,onSessionEvent),r.removeEventListener(`squeezeend`,onSessionEvent),r.removeEventListener(`end`,onSessionEnd),r.removeEventListener(`inputsourceschange`,onInputSourcesChange);for(let e=0;e<b.length;e++){let t=x[e];t!==null&&(x[e]=null,b[e].disconnect(t))}O=null,k=null,h.reset();for(let e in g)delete g[e];e.setRenderTarget(v),f=null,d=null,u=null,r=null,y=null,M.stop(),n.isPresenting=!1,e.setPixelRatio(C),e.setSize(S.width,S.height,!1),n.dispatchEvent({type:`sessionend`})}this.setFramebufferScaleFactor=function(e){i=e,n.isPresenting===!0&&warn(`WebXRManager: Cannot change framebuffer scale while presenting.`)},this.setReferenceSpaceType=function(e){o=e,n.isPresenting===!0&&warn(`WebXRManager: Cannot change reference space type while presenting.`)},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(e){c=e},this.getBaseLayer=function(){return d===null?f:d},this.getBinding=function(){return u===null&&m&&(u=new XRWebGLBinding(r,t)),u},this.getFrame=function(){return p},this.getSession=function(){return r},this.setSession=async function(l){if(r=l,r!==null){if(v=e.getRenderTarget(),r.addEventListener(`select`,onSessionEvent),r.addEventListener(`selectstart`,onSessionEvent),r.addEventListener(`selectend`,onSessionEvent),r.addEventListener(`squeeze`,onSessionEvent),r.addEventListener(`squeezestart`,onSessionEvent),r.addEventListener(`squeezeend`,onSessionEvent),r.addEventListener(`end`,onSessionEnd),r.addEventListener(`inputsourceschange`,onInputSourcesChange),_.xrCompatible!==!0&&await t.makeXRCompatible(),C=e.getPixelRatio(),e.getSize(S),m&&`createProjectionLayer`in XRWebGLBinding.prototype){let n=null,a=null,o=null;_.depth&&(o=_.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=_.stencil?Jr:qr,a=_.stencil?Gr:Br);let s={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:i};u=this.getBinding(),d=u.createProjectionLayer(s),r.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),y=new WebGLRenderTarget(d.textureWidth,d.textureHeight,{format:Kr,type:Rr,depthTexture:new DepthTexture(d.textureWidth,d.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:_.stencil,colorSpace:e.outputColorSpace,samples:_.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{let n={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:i};f=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),y=new WebGLRenderTarget(f.framebufferWidth,f.framebufferHeight,{format:Kr,type:Rr,colorSpace:e.outputColorSpace,stencilBuffer:_.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}y.isXRRenderTarget=!0,this.setFoveation(s),c=null,a=await r.requestReferenceSpace(o),M.setContext(r),M.start(),n.isPresenting=!0,n.dispatchEvent({type:`sessionstart`})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return h.getDepthTexture()};function onInputSourcesChange(e){for(let t=0;t<e.removed.length;t++){let n=e.removed[t],r=x.indexOf(n);r>=0&&(x[r]=null,b[r].disconnect(n))}for(let t=0;t<e.added.length;t++){let n=e.added[t],r=x.indexOf(n);if(r===-1){for(let e=0;e<b.length;e++)if(e>=x.length){x.push(n),r=e;break}else if(x[e]===null){x[e]=n,r=e;break}if(r===-1)break}let i=b[r];i&&i.connect(n)}}let A=new K,ee=new K;function setProjectionFromUnion(e,t,n){A.setFromMatrixPosition(t.matrixWorld),ee.setFromMatrixPosition(n.matrixWorld);let r=A.distanceTo(ee),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(a[8]+1)/a[0],f=o*u,p=o*d,m=r/(-u+d),h=m*-u;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(h),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),i[10]===-1)e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{let t=o+m,n=s+m,i=f-h,a=p+(r-h),u=c*s/n*t,d=l*s/n*t;e.projectionMatrix.makePerspective(i,a,u,d,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}function updateCamera(e,t){t===null?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(r===null)return;let t=e.near,n=e.far;h.texture!==null&&(h.depthNear>0&&(t=h.depthNear),h.depthFar>0&&(n=h.depthFar)),D.near=T.near=w.near=t,D.far=T.far=w.far=n,(O!==D.near||k!==D.far)&&(r.updateRenderState({depthNear:D.near,depthFar:D.far}),O=D.near,k=D.far),D.layers.mask=e.layers.mask|6,w.layers.mask=D.layers.mask&-5,T.layers.mask=D.layers.mask&-3;let i=e.parent,a=D.cameras;updateCamera(D,i);for(let e=0;e<a.length;e++)updateCamera(a[e],i);a.length===2?setProjectionFromUnion(D,w,T):D.projectionMatrix.copy(w.projectionMatrix),updateUserCamera(e,D,i)};function updateUserCamera(e,t,n){n===null?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld)),e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0),e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=_i*2*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}this.getCamera=function(){return D},this.getFoveation=function(){if(!(d===null&&f===null))return s},this.setFoveation=function(e){s=e,d!==null&&(d.fixedFoveation=e),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=e)},this.hasDepthSensing=function(){return h.texture!==null},this.getDepthSensingMesh=function(){return h.getMesh(D)},this.getCameraTexture=function(e){return g[e]};let j=null;function onAnimationFrame(t,i){if(l=i.getViewerPose(c||a),p=i,l!==null){let t=l.views;f!==null&&(e.setRenderTargetFramebuffer(y,f.framebuffer),e.setRenderTarget(y));let i=!1;t.length!==D.cameras.length&&(D.cameras.length=0,i=!0);for(let n=0;n<t.length;n++){let r=t[n],a=null;if(f!==null)a=f.getViewport(r);else{let t=u.getViewSubImage(d,r);a=t.viewport,n===0&&(e.setRenderTargetTextures(y,t.colorTexture,t.depthStencilTexture),e.setRenderTarget(y))}let o=E[n];o===void 0&&(o=new PerspectiveCamera,o.layers.enable(n),o.viewport=new Y,E[n]=o),o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(r.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(a.x,a.y,a.width,a.height),n===0&&(D.matrix.copy(o.matrix),D.matrix.decompose(D.position,D.quaternion,D.scale)),i===!0&&D.cameras.push(o)}let a=r.enabledFeatures;if(a&&a.includes(`depth-sensing`)&&r.depthUsage==`gpu-optimized`&&m){u=n.getBinding();let e=u.getDepthInformation(t[0]);e&&e.isValid&&e.texture&&h.init(e,r.renderState)}if(a&&a.includes(`camera-access`)&&m){e.state.unbindTexture(),u=n.getBinding();for(let e=0;e<t.length;e++){let n=t[e].camera;if(n){let e=g[n];e||(e=new ExternalTexture,g[n]=e);let t=u.getCameraImage(n);e.sourceTexture=t}}}}for(let e=0;e<b.length;e++){let t=x[e],n=b[e];t!==null&&n!==void 0&&n.update(t,i,c||a)}j&&j(t,i),i.detectedPlanes&&n.dispatchEvent({type:`planesdetected`,data:i}),p=null}let M=new WebGLAnimation;M.setAnimationLoop(onAnimationFrame),this.setAnimationLoop=function(e){j=e},this.dispose=function(){}}};const Os=new X,ks=new q;ks.set(-1,0,0,0,1,0,0,0,1);function WebGLMaterials(e,t){function refreshTransformUniform(e,t){e.matrixAutoUpdate===!0&&e.updateMatrix(),t.value.copy(e.matrix)}function refreshFogUniforms(t,n){n.color.getRGB(t.fogColor.value,getUnlitUniformColorSpace(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)}function refreshMaterialUniforms(e,t,n,r,i){t.isNodeMaterial?t.uniformsNeedUpdate=!1:t.isMeshBasicMaterial?refreshUniformsCommon(e,t):t.isMeshLambertMaterial?(refreshUniformsCommon(e,t),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)):t.isMeshToonMaterial?(refreshUniformsCommon(e,t),refreshUniformsToon(e,t)):t.isMeshPhongMaterial?(refreshUniformsCommon(e,t),refreshUniformsPhong(e,t),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)):t.isMeshStandardMaterial?(refreshUniformsCommon(e,t),refreshUniformsStandard(e,t),t.isMeshPhysicalMaterial&&refreshUniformsPhysical(e,t,i)):t.isMeshMatcapMaterial?(refreshUniformsCommon(e,t),refreshUniformsMatcap(e,t)):t.isMeshDepthMaterial?refreshUniformsCommon(e,t):t.isMeshDistanceMaterial?(refreshUniformsCommon(e,t),refreshUniformsDistance(e,t)):t.isMeshNormalMaterial?refreshUniformsCommon(e,t):t.isLineBasicMaterial?(refreshUniformsLine(e,t),t.isLineDashedMaterial&&refreshUniformsDash(e,t)):t.isPointsMaterial?refreshUniformsPoints(e,t,n,r):t.isSpriteMaterial?refreshUniformsSprites(e,t):t.isShadowMaterial?(e.color.value.copy(t.color),e.opacity.value=t.opacity):t.isShaderMaterial&&(t.uniformsNeedUpdate=!1)}function refreshUniformsCommon(e,n){e.opacity.value=n.opacity,n.color&&e.diffuse.value.copy(n.color),n.emissive&&e.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(e.map.value=n.map,refreshTransformUniform(n.map,e.mapTransform)),n.alphaMap&&(e.alphaMap.value=n.alphaMap,refreshTransformUniform(n.alphaMap,e.alphaMapTransform)),n.bumpMap&&(e.bumpMap.value=n.bumpMap,refreshTransformUniform(n.bumpMap,e.bumpMapTransform),e.bumpScale.value=n.bumpScale,n.side===1&&(e.bumpScale.value*=-1)),n.normalMap&&(e.normalMap.value=n.normalMap,refreshTransformUniform(n.normalMap,e.normalMapTransform),e.normalScale.value.copy(n.normalScale),n.side===1&&e.normalScale.value.negate()),n.displacementMap&&(e.displacementMap.value=n.displacementMap,refreshTransformUniform(n.displacementMap,e.displacementMapTransform),e.displacementScale.value=n.displacementScale,e.displacementBias.value=n.displacementBias),n.emissiveMap&&(e.emissiveMap.value=n.emissiveMap,refreshTransformUniform(n.emissiveMap,e.emissiveMapTransform)),n.specularMap&&(e.specularMap.value=n.specularMap,refreshTransformUniform(n.specularMap,e.specularMapTransform)),n.alphaTest>0&&(e.alphaTest.value=n.alphaTest);let r=t.get(n),i=r.envMap,a=r.envMapRotation;i&&(e.envMap.value=i,e.envMapRotation.value.setFromMatrix4(Os.makeRotationFromEuler(a)).transpose(),i.isCubeTexture&&i.isRenderTargetTexture===!1&&e.envMapRotation.value.premultiply(ks),e.reflectivity.value=n.reflectivity,e.ior.value=n.ior,e.refractionRatio.value=n.refractionRatio),n.lightMap&&(e.lightMap.value=n.lightMap,e.lightMapIntensity.value=n.lightMapIntensity,refreshTransformUniform(n.lightMap,e.lightMapTransform)),n.aoMap&&(e.aoMap.value=n.aoMap,e.aoMapIntensity.value=n.aoMapIntensity,refreshTransformUniform(n.aoMap,e.aoMapTransform))}function refreshUniformsLine(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,refreshTransformUniform(t.map,e.mapTransform))}function refreshUniformsDash(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function refreshUniformsPoints(e,t,n,r){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=r*.5,t.map&&(e.map.value=t.map,refreshTransformUniform(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,refreshTransformUniform(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function refreshUniformsSprites(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,refreshTransformUniform(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,refreshTransformUniform(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function refreshUniformsPhong(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}function refreshUniformsToon(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function refreshUniformsStandard(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,refreshTransformUniform(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,refreshTransformUniform(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function refreshUniformsPhysical(e,t,n){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,refreshTransformUniform(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,refreshTransformUniform(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,refreshTransformUniform(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,refreshTransformUniform(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,refreshTransformUniform(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===1&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,refreshTransformUniform(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,refreshTransformUniform(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=n.texture,e.transmissionSamplerSize.value.set(n.width,n.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,refreshTransformUniform(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,refreshTransformUniform(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,refreshTransformUniform(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,refreshTransformUniform(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,refreshTransformUniform(t.specularIntensityMap,e.specularIntensityMapTransform))}function refreshUniformsMatcap(e,t){t.matcap&&(e.matcap.value=t.matcap)}function refreshUniformsDistance(e,n){let r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}return{refreshFogUniforms,refreshMaterialUniforms}}function WebGLUniformsGroups(e,t,n,r){let i={},a={},o=[],s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function bind(e,t){let n=t.program;r.uniformBlockBinding(e,n)}function update(e,n){let o=i[e.id];o===void 0&&(prepareUniformsGroup(e),o=createBuffer(e),i[e.id]=o,e.addEventListener(`dispose`,onUniformsGroupsDispose));let s=n.program;r.updateUBOMapping(e,s);let c=t.render.frame;a[e.id]!==c&&(updateBufferData(e),a[e.id]=c)}function createBuffer(t){let n=allocateBindingPointIndex();t.__bindingPointIndex=n;let r=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}function allocateBindingPointIndex(){for(let e=0;e<s;e++)if(o.indexOf(e)===-1)return o.push(e),e;return error(`WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.`),0}function updateBufferData(t){let n=i[t.id],r=t.uniforms,a=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let e=0,t=r.length;e<t;e++){let t=r[e];if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)updateUniform(t[n],e,n,a);else updateUniform(t,e,0,a)}e.bindBuffer(e.UNIFORM_BUFFER,null)}function updateUniform(t,n,r,i){if(hasUniformChanged(t,n,r,i)===!0){let n=t.__offset,r=t.value;if(Array.isArray(r)){let e=0;for(let n=0;n<r.length;n++){let i=r[n],a=getUniformSize(i);writeUniformValue(i,t.__data,e),typeof i!=`number`&&typeof i!=`boolean`&&!i.isMatrix3&&!ArrayBuffer.isView(i)&&(e+=a.storage/Float32Array.BYTES_PER_ELEMENT)}}else writeUniformValue(r,t.__data,0);e.bufferSubData(e.UNIFORM_BUFFER,n,t.__data)}}function writeUniformValue(e,t,n){typeof e==`number`||typeof e==`boolean`?t[0]=e:e.isMatrix3?(t[0]=e.elements[0],t[1]=e.elements[1],t[2]=e.elements[2],t[3]=0,t[4]=e.elements[3],t[5]=e.elements[4],t[6]=e.elements[5],t[7]=0,t[8]=e.elements[6],t[9]=e.elements[7],t[10]=e.elements[8],t[11]=0):ArrayBuffer.isView(e)?t.set(new e.constructor(e.buffer,e.byteOffset,t.length)):e.toArray(t,n)}function hasUniformChanged(e,t,n,r){let i=e.value,a=t+`_`+n;if(r[a]===void 0)return typeof i==`number`||typeof i==`boolean`?r[a]=i:ArrayBuffer.isView(i)?r[a]=i.slice():r[a]=i.clone(),!0;{let e=r[a];if(typeof i==`number`||typeof i==`boolean`){if(e!==i)return r[a]=i,!0}else if(ArrayBuffer.isView(i))return!0;else if(e.equals(i)===!1)return e.copy(i),!0}return!1}function prepareUniformsGroup(e){let t=e.uniforms,n=0;for(let e=0,r=t.length;e<r;e++){let r=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=r.length;e<t;e++){let t=r[e],i=Array.isArray(t.value)?t.value:[t.value];for(let e=0,r=i.length;e<r;e++){let r=i[e],a=getUniformSize(r),o=n%16,s=o%a.boundary,c=o+s;n+=s,c!==0&&16-c<a.storage&&(n+=16-c),t.__data=new Float32Array(a.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,n+=a.storage}}}let r=n%16;return r>0&&(n+=16-r),e.__size=n,e.__cache={},this}function getUniformSize(e){let t={boundary:0,storage:0};return typeof e==`number`||typeof e==`boolean`?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?warn(`WebGLRenderer: Texture samplers can not be part of an uniforms group.`):ArrayBuffer.isView(e)?(t.boundary=16,t.storage=e.byteLength):warn(`WebGLRenderer: Unsupported uniform value type.`,e),t}function onUniformsGroupsDispose(t){let n=t.target;n.removeEventListener(`dispose`,onUniformsGroupsDispose);let r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}function dispose(){for(let t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}return{bind,update,dispose}}const As=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let js=null;function getDFGLUT(){return js===null&&(js=new DataTexture(As,16,16,Xr,Hr),js.name=`DFG_LUT`,js.minFilter=Ir,js.magFilter=Ir,js.wrapS=Nr,js.wrapT=Nr,js.generateMipmaps=!1,js.needsUpdate=!0),js}var WebGLRenderer=class{constructor(e={}){let{canvas:t=createCanvasElement(),context:n=null,depth:r=!0,stencil:i=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:c=!1,powerPreference:l=`default`,failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1,outputBufferType:f=Rr}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<`u`&&n instanceof WebGLRenderingContext)throw Error(`THREE.WebGLRenderer: WebGL 1 is not supported since r163.`);p=n.getContextAttributes().alpha}else p=a;let m=f,h=new Set([Qr,Zr,Yr]),g=new Set([Rr,Br,zr,Gr,Ur,Wr]),_=new Uint32Array(4),v=new Int32Array(4),y=new K,b=null,x=null,S=[],C=[],w=null;this.domElement=t,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.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let T=this,E=!1,D=null,O=null,k=null,A=null;this._outputColorSpace=oi;let ee=0,j=0,M=null,N=-1,te=null,P=new Y,ne=new Y,re=null,ie=new Color(0),ae=0,oe=t.width,se=t.height,ce=1,le=null,ue=null,de=new Y(0,0,oe,se),fe=new Y(0,0,oe,se),pe=!1,me=new Frustum,he=!1,ge=!1,_e=new X,ve=new K,ye=new Y,be={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},xe=!1;function getTargetPixelRatio(){return M===null?ce:1}let F=n;function getContext(e,n){return t.getContext(e,n)}try{let e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(`setAttribute`in t&&t.setAttribute(`data-engine`,`three.js r185`),t.addEventListener(`webglcontextlost`,onContextLost,!1),t.addEventListener(`webglcontextrestored`,onContextRestore,!1),t.addEventListener(`webglcontextcreationerror`,onContextCreationError,!1),F===null){let t=`webgl2`;if(F=getContext(t,e),F===null)throw getContext(t)?Error(`THREE.WebGLRenderer: Error creating WebGL context with your selected attributes.`):Error(`THREE.WebGLRenderer: Error creating WebGL context.`)}}catch(e){throw error(`WebGLRenderer: `+e.message),e}let Se,Ce,I,we,L,R,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve;function initGLContext(){Se=new WebGLExtensions(F),Se.init(),ze=new WebGLUtils(F,Se),Ce=new WebGLCapabilities(F,Se,e,ze),I=new WebGLState(F,Se),Ce.reversedDepthBuffer&&d&&I.buffers.depth.setReversed(!0),O=F.createFramebuffer(),k=F.createFramebuffer(),A=F.createFramebuffer(),we=new WebGLInfo(F),L=new WebGLProperties,R=new WebGLTextures(F,Se,I,L,Ce,ze,we),Te=new WebGLEnvironments(T),Ee=new WebGLAttributes(F),Be=new WebGLBindingStates(F,Ee),De=new WebGLGeometries(F,Ee,we,Be),Oe=new WebGLObjects(F,De,Ee,Be,we),Ie=new WebGLMorphtargets(F,Ce,R),Ne=new WebGLClipping(L),ke=new WebGLPrograms(T,Te,Se,Ce,Be,Ne),Ae=new WebGLMaterials(T,L),je=new WebGLRenderLists,Me=new WebGLRenderStates(Se),Fe=new WebGLBackground(T,Te,I,Oe,p,s),Pe=new WebGLShadowMap(T,Oe,Ce),Ve=new WebGLUniformsGroups(F,we,Ce,I),Le=new WebGLBufferRenderer(F,Se,we),Re=new WebGLIndexedBufferRenderer(F,Se,we),we.programs=ke.programs,T.capabilities=Ce,T.extensions=Se,T.properties=L,T.renderLists=je,T.shadowMap=Pe,T.state=I,T.info=we}initGLContext(),m!==1009&&(w=new WebGLOutput(m,t.width,t.height,o,r,i));let He=new WebXRManager(T,F);this.xr=He,this.getContext=function(){return F},this.getContextAttributes=function(){return F.getContextAttributes()},this.forceContextLoss=function(){let e=Se.get(`WEBGL_lose_context`);e&&e.loseContext()},this.forceContextRestore=function(){let e=Se.get(`WEBGL_lose_context`);e&&e.restoreContext()},this.getPixelRatio=function(){return ce},this.setPixelRatio=function(e){e!==void 0&&(ce=e,this.setSize(oe,se,!1))},this.getSize=function(e){return e.set(oe,se)},this.setSize=function(e,n,r=!0){if(He.isPresenting){warn(`WebGLRenderer: Can't change size while VR device is presenting.`);return}oe=e,se=n,t.width=Math.floor(e*ce),t.height=Math.floor(n*ce),r===!0&&(t.style.width=e+`px`,t.style.height=n+`px`),w!==null&&w.setSize(t.width,t.height),this.setViewport(0,0,e,n)},this.getDrawingBufferSize=function(e){return e.set(oe*ce,se*ce).floor()},this.setDrawingBufferSize=function(e,n,r){oe=e,se=n,ce=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.setEffects=function(e){if(m===1009){error(`WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.`);return}if(e){for(let t=0;t<e.length;t++)if(e[t].isOutputPass===!0){warn(`WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.`);break}}w.setEffects(e||[])},this.getCurrentViewport=function(e){return e.copy(P)},this.getViewport=function(e){return e.copy(de)},this.setViewport=function(e,t,n,r){e.isVector4?de.set(e.x,e.y,e.z,e.w):de.set(e,t,n,r),I.viewport(P.copy(de).multiplyScalar(ce).round())},this.getScissor=function(e){return e.copy(fe)},this.setScissor=function(e,t,n,r){e.isVector4?fe.set(e.x,e.y,e.z,e.w):fe.set(e,t,n,r),I.scissor(ne.copy(fe).multiplyScalar(ce).round())},this.getScissorTest=function(){return pe},this.setScissorTest=function(e){I.setScissorTest(pe=e)},this.setOpaqueSort=function(e){le=e},this.setTransparentSort=function(e){ue=e},this.getClearColor=function(e){return e.copy(Fe.getClearColor())},this.setClearColor=function(){Fe.setClearColor(...arguments)},this.getClearAlpha=function(){return Fe.getClearAlpha()},this.setClearAlpha=function(){Fe.setClearAlpha(...arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;if(e){let e=!1;if(M!==null){let t=M.texture.format;e=h.has(t)}if(e){let e=M.texture.type,t=g.has(e),n=Fe.getClearColor(),r=Fe.getClearAlpha(),i=n.r,a=n.g,o=n.b;t?(_[0]=i,_[1]=a,_[2]=o,_[3]=r,F.clearBufferuiv(F.COLOR,0,_)):(v[0]=i,v[1]=a,v[2]=o,v[3]=r,F.clearBufferiv(F.COLOR,0,v))}else r|=F.COLOR_BUFFER_BIT}t&&(r|=F.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),n&&(r|=F.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),r!==0&&F.clear(r)},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.setNodesHandler=function(e){e.setRenderer(this),D=e},this.dispose=function(){t.removeEventListener(`webglcontextlost`,onContextLost,!1),t.removeEventListener(`webglcontextrestored`,onContextRestore,!1),t.removeEventListener(`webglcontextcreationerror`,onContextCreationError,!1),Fe.dispose(),je.dispose(),Me.dispose(),L.dispose(),Te.dispose(),Oe.dispose(),Be.dispose(),Ve.dispose(),ke.dispose(),He.dispose(),He.removeEventListener(`sessionstart`,onXRSessionStart),He.removeEventListener(`sessionend`,onXRSessionEnd),We.stop()};function onContextLost(e){e.preventDefault(),log(`WebGLRenderer: Context Lost.`),E=!0}function onContextRestore(){log(`WebGLRenderer: Context Restored.`),E=!1;let e=we.autoReset,t=Pe.enabled,n=Pe.autoUpdate,r=Pe.needsUpdate,i=Pe.type;initGLContext(),we.autoReset=e,Pe.enabled=t,Pe.autoUpdate=n,Pe.needsUpdate=r,Pe.type=i}function onContextCreationError(e){error(`WebGLRenderer: A WebGL context could not be created. Reason: `,e.statusMessage)}function onMaterialDispose(e){let t=e.target;t.removeEventListener(`dispose`,onMaterialDispose),deallocateMaterial(t)}function deallocateMaterial(e){releaseMaterialProgramReferences(e),L.remove(e)}function releaseMaterialProgramReferences(e){let t=L.get(e).programs;t!==void 0&&(t.forEach(function(e){ke.releaseProgram(e)}),e.isShaderMaterial&&ke.releaseShaderCache(e))}this.renderBufferDirect=function(e,t,n,r,i,a){t===null&&(t=be);let o=i.isMesh&&i.matrixWorld.determinantAffine()<0,s=setProgram(e,t,n,r,i);I.setMaterial(r,o);let c=n.index,l=1;if(r.wireframe===!0){if(c=De.getWireframeAttribute(n),c===void 0)return;l=2}let u=n.drawRange,d=n.attributes.position,f=u.start*l,p=(u.start+u.count)*l;a!==null&&(f=Math.max(f,a.start*l),p=Math.min(p,(a.start+a.count)*l)),c===null?d!=null&&(f=Math.max(f,0),p=Math.min(p,d.count)):(f=Math.max(f,0),p=Math.min(p,c.count));let m=p-f;if(m<0||m===1/0)return;Be.setup(i,r,s,n,c);let h,g=Le;if(c!==null&&(h=Ee.get(c),g=Re,g.setIndex(h)),i.isMesh)r.wireframe===!0?(I.setLineWidth(r.wireframeLinewidth*getTargetPixelRatio()),g.setMode(F.LINES)):g.setMode(F.TRIANGLES);else if(i.isLine){let e=r.linewidth;e===void 0&&(e=1),I.setLineWidth(e*getTargetPixelRatio()),i.isLineSegments?g.setMode(F.LINES):i.isLineLoop?g.setMode(F.LINE_LOOP):g.setMode(F.LINE_STRIP)}else i.isPoints?g.setMode(F.POINTS):i.isSprite&&g.setMode(F.TRIANGLES);if(i.isBatchedMesh)if(Se.get(`WEBGL_multi_draw`))g.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else{let e=i._multiDrawStarts,t=i._multiDrawCounts,n=i._multiDrawCount,a=c?Ee.get(c).bytesPerElement:1,o=L.get(r).currentProgram.getUniforms();for(let r=0;r<n;r++)o.setValue(F,`_gl_DrawID`,r),g.render(e[r]/a,t[r])}else if(i.isInstancedMesh)g.renderInstances(f,m,i.count);else if(n.isInstancedBufferGeometry){let e=n._maxInstanceCount===void 0?1/0:n._maxInstanceCount,t=Math.min(n.instanceCount,e);g.renderInstances(f,m,t)}else g.render(f,m)};function prepareMaterial(e,t,n){e.transparent===!0&&e.side===2&&e.forceSinglePass===!1?(e.side=1,e.needsUpdate=!0,getProgram(e,t,n),e.side=0,e.needsUpdate=!0,getProgram(e,t,n),e.side=2):getProgram(e,t,n)}this.compile=function(e,t,n=null){n===null&&(n=e),x=Me.get(n),x.init(t),C.push(x),n.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(x.pushLight(e),e.castShadow&&x.pushShadow(e))}),e!==n&&e.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(x.pushLight(e),e.castShadow&&x.pushShadow(e))}),x.setupLights();let r=new Set;return e.traverse(function(e){if(!(e.isMesh||e.isPoints||e.isLine||e.isSprite))return;let t=e.material;if(t)if(Array.isArray(t))for(let i=0;i<t.length;i++){let a=t[i];prepareMaterial(a,n,e),r.add(a)}else prepareMaterial(t,n,e),r.add(t)}),x=C.pop(),r},this.compileAsync=function(e,t,n=null){let r=this.compile(e,t,n);return new Promise(t=>{function checkMaterialsReady(){if(r.forEach(function(e){L.get(e).currentProgram.isReady()&&r.delete(e)}),r.size===0){t(e);return}setTimeout(checkMaterialsReady,10)}Se.get(`KHR_parallel_shader_compile`)===null?setTimeout(checkMaterialsReady,10):checkMaterialsReady()})};let Ue=null;function onAnimationFrame(e){Ue&&Ue(e)}function onXRSessionStart(){We.stop()}function onXRSessionEnd(){We.start()}let We=new WebGLAnimation;We.setAnimationLoop(onAnimationFrame),typeof self<`u`&&We.setContext(self),this.setAnimationLoop=function(e){Ue=e,He.setAnimationLoop(e),e===null?We.stop():We.start()},He.addEventListener(`sessionstart`,onXRSessionStart),He.addEventListener(`sessionend`,onXRSessionEnd),this.render=function(e,t){if(t!==void 0&&t.isCamera!==!0){error(`WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(E===!0)return;D!==null&&D.renderStart(e,t);let n=He.enabled===!0&&He.isPresenting===!0,r=w!==null&&(M===null||n)&&w.begin(T,M);if(e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),He.enabled===!0&&He.isPresenting===!0&&(w===null||w.isCompositing()===!1)&&(He.cameraAutoUpdate===!0&&He.updateCamera(t),t=He.getCamera()),e.isScene===!0&&e.onBeforeRender(T,e,t,M),x=Me.get(e,C.length),x.init(t),x.state.textureUnits=R.getTextureUnits(),C.push(x),_e.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),me.setFromProjectionMatrix(_e,di,t.reversedDepth),ge=this.localClippingEnabled,he=Ne.init(this.clippingPlanes,ge),b=je.get(e,S.length),b.init(),S.push(b),He.enabled===!0&&He.isPresenting===!0){let e=T.xr.getDepthSensingMesh();e!==null&&projectObject(e,t,-1/0,T.sortObjects)}projectObject(e,t,0,T.sortObjects),b.finish(),T.sortObjects===!0&&b.sort(le,ue,t.reversedDepth),xe=He.enabled===!1||He.isPresenting===!1||He.hasDepthSensing()===!1,xe&&Fe.addToRenderList(b,e),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),he===!0&&Ne.beginShadows();let i=x.state.shadowsArray;if(Pe.render(i,e,t),he===!0&&Ne.endShadows(),(r&&w.hasRenderPass())===!1){let n=b.opaque,r=b.transmissive;if(x.setupLights(),t.isArrayCamera){let i=t.cameras;if(r.length>0)for(let t=0,a=i.length;t<a;t++){let a=i[t];renderTransmissionPass(n,r,e,a)}xe&&Fe.render(e);for(let t=0,n=i.length;t<n;t++){let n=i[t];renderScene(b,e,n,n.viewport)}}else r.length>0&&renderTransmissionPass(n,r,e,t),xe&&Fe.render(e),renderScene(b,e,t)}M!==null&&j===0&&(R.updateMultisampleRenderTarget(M),R.updateRenderTargetMipmap(M)),r&&w.end(T),e.isScene===!0&&e.onAfterRender(T,e,t),Be.resetDefaultState(),N=-1,te=null,C.pop(),C.length>0?(x=C[C.length-1],R.setTextureUnits(x.state.textureUnits),he===!0&&Ne.setGlobalState(T.clippingPlanes,x.state.camera)):x=null,S.pop(),b=S.length>0?S[S.length-1]:null,D!==null&&D.renderEnd()};function projectObject(e,t,n,r){if(e.visible===!1)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLightProbeGrid)x.pushLightProbeGrid(e);else if(e.isLight)x.pushLight(e),e.castShadow&&x.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||me.intersectsSprite(e)){r&&ye.setFromMatrixPosition(e.matrixWorld).applyMatrix4(_e);let t=Oe.update(e),i=e.material;i.visible&&b.push(e,t,i,n,ye.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||me.intersectsObject(e))){let t=Oe.update(e),i=e.material;if(r&&(e.boundingSphere===void 0?(t.boundingSphere===null&&t.computeBoundingSphere(),ye.copy(t.boundingSphere.center)):(e.boundingSphere===null&&e.computeBoundingSphere(),ye.copy(e.boundingSphere.center)),ye.applyMatrix4(e.matrixWorld).applyMatrix4(_e)),Array.isArray(i)){let r=t.groups;for(let a=0,o=r.length;a<o;a++){let o=r[a],s=i[o.materialIndex];s&&s.visible&&b.push(e,t,s,n,ye.z,o)}}else i.visible&&b.push(e,t,i,n,ye.z,null)}}let i=e.children;for(let e=0,a=i.length;e<a;e++)projectObject(i[e],t,n,r)}function renderScene(e,t,n,r){let{opaque:i,transmissive:a,transparent:o}=e;x.setupLightsView(n),he===!0&&Ne.setGlobalState(T.clippingPlanes,n),r&&I.viewport(P.copy(r)),i.length>0&&renderObjects(i,t,n),a.length>0&&renderObjects(a,t,n),o.length>0&&renderObjects(o,t,n),I.buffers.depth.setTest(!0),I.buffers.depth.setMask(!0),I.buffers.color.setMask(!0),I.setPolygonOffset(!1)}function renderTransmissionPass(e,t,n,r){if((n.isScene===!0?n.overrideMaterial:null)!==null)return;if(x.state.transmissionRenderTarget[r.id]===void 0){let e=Se.has(`EXT_color_buffer_half_float`)||Se.has(`EXT_color_buffer_float`);x.state.transmissionRenderTarget[r.id]=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:e?Hr:Rr,minFilter:Lr,samples:Math.max(4,Ce.samples),stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:J.workingColorSpace})}let a=x.state.transmissionRenderTarget[r.id],o=r.viewport||P;a.setSize(o.z*T.transmissionResolutionScale,o.w*T.transmissionResolutionScale);let s=T.getRenderTarget(),c=T.getActiveCubeFace(),l=T.getActiveMipmapLevel();T.setRenderTarget(a),T.getClearColor(ie),ae=T.getClearAlpha(),ae<1&&T.setClearColor(16777215,.5),T.clear(),xe&&Fe.render(n);let u=T.toneMapping;T.toneMapping=0;let d=r.viewport;if(r.viewport!==void 0&&(r.viewport=void 0),x.setupLightsView(r),he===!0&&Ne.setGlobalState(T.clippingPlanes,r),renderObjects(e,n,r),R.updateMultisampleRenderTarget(a),R.updateRenderTargetMipmap(a),Se.has(`WEBGL_multisampled_render_to_texture`)===!1){let e=!1;for(let i=0,a=t.length;i<a;i++){let{object:a,geometry:o,material:s,group:c}=t[i];if(s.side===2&&a.layers.test(r.layers)){let t=s.side;s.side=1,s.needsUpdate=!0,renderObject(a,n,r,o,s,c),s.side=t,s.needsUpdate=!0,e=!0}}e===!0&&(R.updateMultisampleRenderTarget(a),R.updateRenderTargetMipmap(a))}T.setRenderTarget(s,c,l),T.setClearColor(ie,ae),d!==void 0&&(r.viewport=d),T.toneMapping=u}function renderObjects(e,t,n){let r=t.isScene===!0?t.overrideMaterial:null;for(let i=0,a=e.length;i<a;i++){let a=e[i],{object:o,geometry:s,group:c}=a,l=a.material;l.allowOverride===!0&&r!==null&&(l=r),o.layers.test(n.layers)&&renderObject(o,t,n,s,l,c)}}function renderObject(e,t,n,r,i,a){e.onBeforeRender(T,t,n,r,i,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(T,t,n,r,e,a),i.transparent===!0&&i.side===2&&i.forceSinglePass===!1?(i.side=1,i.needsUpdate=!0,T.renderBufferDirect(n,t,r,i,e,a),i.side=0,i.needsUpdate=!0,T.renderBufferDirect(n,t,r,i,e,a),i.side=2):T.renderBufferDirect(n,t,r,i,e,a),e.onAfterRender(T,t,n,r,i,a)}function getProgram(e,t,n){t.isScene!==!0&&(t=be);let r=L.get(e),i=x.state.lights,a=x.state.shadowsArray,o=i.state.version,s=ke.getParameters(e,i.state,a,t,n,x.state.lightProbeGridArray),c=ke.getProgramCacheKey(s),l=r.programs;r.environment=e.isMeshStandardMaterial||e.isMeshLambertMaterial||e.isMeshPhongMaterial?t.environment:null,r.fog=t.fog;let u=e.isMeshStandardMaterial||e.isMeshLambertMaterial&&!e.envMap||e.isMeshPhongMaterial&&!e.envMap;r.envMap=Te.get(e.envMap||r.environment,u),r.envMapRotation=r.environment!==null&&e.envMap===null?t.environmentRotation:e.envMapRotation,l===void 0&&(e.addEventListener(`dispose`,onMaterialDispose),l=new Map,r.programs=l);let d=l.get(c);if(d!==void 0){if(r.currentProgram===d&&r.lightsStateVersion===o)return updateCommonMaterialProperties(e,s),d}else s.uniforms=ke.getUniforms(e),D!==null&&e.isNodeMaterial&&D.build(e,n,s),e.onBeforeCompile(s,T),d=ke.acquireProgram(s,c),l.set(c,d),r.uniforms=s.uniforms;let f=r.uniforms;return(!e.isShaderMaterial&&!e.isRawShaderMaterial||e.clipping===!0)&&(f.clippingPlanes=Ne.uniform),updateCommonMaterialProperties(e,s),r.needsLights=materialNeedsLights(e),r.lightsStateVersion=o,r.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.directionalLightShadows.value=i.state.directionalShadow,f.spotLights.value=i.state.spot,f.spotLightShadows.value=i.state.spotShadow,f.rectAreaLights.value=i.state.rectArea,f.ltc_1.value=i.state.rectAreaLTC1,f.ltc_2.value=i.state.rectAreaLTC2,f.pointLights.value=i.state.point,f.pointLightShadows.value=i.state.pointShadow,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotLightMatrix.value=i.state.spotLightMatrix,f.spotLightMap.value=i.state.spotLightMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix),r.lightProbeGrid=x.state.lightProbeGridArray.length>0,r.currentProgram=d,r.uniformsList=null,d}function getUniformList(e){if(e.uniformsList===null){let t=e.currentProgram.getUniforms();e.uniformsList=WebGLUniforms.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function updateCommonMaterialProperties(e,t){let n=L.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}function findLightProbeGrid(e,t){if(e.length===0)return null;if(e.length===1)return e[0].texture===null?null:e[0];y.setFromMatrixPosition(t.matrixWorld);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n.texture!==null&&n.boundingBox.containsPoint(y))return n}return null}function setProgram(e,t,n,r,i){t.isScene!==!0&&(t=be),R.resetTextureUnits();let a=t.fog,o=r.isMeshStandardMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial?t.environment:null,s=M===null?T.outputColorSpace:M.isXRRenderTarget===!0?M.texture.colorSpace:J.workingColorSpace,c=r.isMeshStandardMaterial||r.isMeshLambertMaterial&&!r.envMap||r.isMeshPhongMaterial&&!r.envMap,l=Te.get(r.envMap||o,c),u=r.vertexColors===!0&&!!n.attributes.color&&n.attributes.color.itemSize===4,d=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),f=!!n.morphAttributes.position,p=!!n.morphAttributes.normal,m=!!n.morphAttributes.color,h=0;r.toneMapped&&(M===null||M.isXRRenderTarget===!0)&&(h=T.toneMapping);let g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,_=g===void 0?0:g.length,v=L.get(r),y=x.state.lights;if(he===!0&&(ge===!0||e!==te)){let t=e===te&&r.id===N;Ne.setState(r,e,t)}let b=!1;r.version===v.__version?v.needsLights&&v.lightsStateVersion!==y.state.version?b=!0:v.outputColorSpace===s?i.isBatchedMesh&&v.batching===!1||!i.isBatchedMesh&&v.batching===!0||i.isBatchedMesh&&v.batchingColor===!0&&i.colorTexture===null||i.isBatchedMesh&&v.batchingColor===!1&&i.colorTexture!==null||i.isInstancedMesh&&v.instancing===!1||!i.isInstancedMesh&&v.instancing===!0||i.isSkinnedMesh&&v.skinning===!1||!i.isSkinnedMesh&&v.skinning===!0||i.isInstancedMesh&&v.instancingColor===!0&&i.instanceColor===null||i.isInstancedMesh&&v.instancingColor===!1&&i.instanceColor!==null||i.isInstancedMesh&&v.instancingMorph===!0&&i.morphTexture===null||i.isInstancedMesh&&v.instancingMorph===!1&&i.morphTexture!==null?b=!0:v.envMap===l?r.fog===!0&&v.fog!==a||v.numClippingPlanes!==void 0&&(v.numClippingPlanes!==Ne.numPlanes||v.numIntersection!==Ne.numIntersection)?b=!0:v.vertexAlphas===u&&v.vertexTangents===d&&v.morphTargets===f&&v.morphNormals===p&&v.morphColors===m&&v.toneMapping===h&&v.morphTargetsCount===_?!!v.lightProbeGrid!=x.state.lightProbeGridArray.length>0&&(b=!0):b=!0:b=!0:b=!0:(b=!0,v.__version=r.version);let S=v.currentProgram;b===!0&&(S=getProgram(r,t,i),D&&r.isNodeMaterial&&D.onUpdateProgram(r,S,v));let C=!1,w=!1,E=!1,O=S.getUniforms(),k=v.uniforms;if(I.useProgram(S.program)&&(C=!0,w=!0,E=!0),r.id!==N&&(N=r.id,w=!0),v.needsLights){let e=findLightProbeGrid(x.state.lightProbeGridArray,i);v.lightProbeGrid!==e&&(v.lightProbeGrid=e,w=!0)}if(C||te!==e){I.buffers.depth.getReversed()&&e.reversedDepth!==!0&&(e._reversedDepth=!0,e.updateProjectionMatrix()),O.setValue(F,`projectionMatrix`,e.projectionMatrix),O.setValue(F,`viewMatrix`,e.matrixWorldInverse);let t=O.map.cameraPosition;t!==void 0&&t.setValue(F,ve.setFromMatrixPosition(e.matrixWorld)),Ce.logarithmicDepthBuffer&&O.setValue(F,`logDepthBufFC`,2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&O.setValue(F,`isOrthographic`,e.isOrthographicCamera===!0),te!==e&&(te=e,w=!0,E=!0)}if(v.needsLights&&(y.state.directionalShadowMap.length>0&&O.setValue(F,`directionalShadowMap`,y.state.directionalShadowMap,R),y.state.spotShadowMap.length>0&&O.setValue(F,`spotShadowMap`,y.state.spotShadowMap,R),y.state.pointShadowMap.length>0&&O.setValue(F,`pointShadowMap`,y.state.pointShadowMap,R)),i.isSkinnedMesh){O.setOptional(F,i,`bindMatrix`),O.setOptional(F,i,`bindMatrixInverse`);let e=i.skeleton;e&&(e.boneTexture===null&&e.computeBoneTexture(),O.setValue(F,`boneTexture`,e.boneTexture,R))}i.isBatchedMesh&&(O.setOptional(F,i,`batchingTexture`),O.setValue(F,`batchingTexture`,i._matricesTexture,R),O.setOptional(F,i,`batchingIdTexture`),O.setValue(F,`batchingIdTexture`,i._indirectTexture,R),O.setOptional(F,i,`batchingColorTexture`),i._colorsTexture!==null&&O.setValue(F,`batchingColorTexture`,i._colorsTexture,R));let A=n.morphAttributes;if((A.position!==void 0||A.normal!==void 0||A.color!==void 0)&&Ie.update(i,n,S),(w||v.receiveShadow!==i.receiveShadow)&&(v.receiveShadow=i.receiveShadow,O.setValue(F,`receiveShadow`,i.receiveShadow)),(r.isMeshStandardMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial)&&r.envMap===null&&t.environment!==null&&(k.envMapIntensity.value=t.environmentIntensity),k.dfgLUT!==void 0&&(k.dfgLUT.value=getDFGLUT()),w){if(O.setValue(F,`toneMappingExposure`,T.toneMappingExposure),v.needsLights&&markUniformsLightsNeedsUpdate(k,E),a&&r.fog===!0&&Ae.refreshFogUniforms(k,a),Ae.refreshMaterialUniforms(k,r,ce,se,x.state.transmissionRenderTarget[e.id]),v.needsLights&&v.lightProbeGrid){let e=v.lightProbeGrid;k.probesSH.value=e.texture,k.probesMin.value.copy(e.boundingBox.min),k.probesMax.value.copy(e.boundingBox.max),k.probesResolution.value.copy(e.resolution)}WebGLUniforms.upload(F,getUniformList(v),k,R)}if(r.isShaderMaterial&&r.uniformsNeedUpdate===!0&&(WebGLUniforms.upload(F,getUniformList(v),k,R),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&O.setValue(F,`center`,i.center),O.setValue(F,`modelViewMatrix`,i.modelViewMatrix),O.setValue(F,`normalMatrix`,i.normalMatrix),O.setValue(F,`modelMatrix`,i.matrixWorld),r.uniformsGroups!==void 0){let e=r.uniformsGroups;for(let t=0,n=e.length;t<n;t++){let n=e[t];Ve.update(n,S),Ve.bind(n,S)}}return S}function markUniformsLightsNeedsUpdate(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}function materialNeedsLights(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&e.lights===!0}this.getActiveCubeFace=function(){return ee},this.getActiveMipmapLevel=function(){return j},this.getRenderTarget=function(){return M},this.setRenderTargetTextures=function(e,t,n){let r=L.get(e);r.__autoAllocateDepthBuffer=e.resolveDepthBuffer===!1,r.__autoAllocateDepthBuffer===!1&&(r.__useRenderToTexture=!1),L.get(e.texture).__webglTexture=t,L.get(e.depthTexture).__webglTexture=r.__autoAllocateDepthBuffer?void 0:n,r.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){let n=L.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=t===void 0},this.setRenderTarget=function(e,t=0,n=0){M=e,ee=t,j=n;let r=null,i=!1,a=!1;if(e){let o=L.get(e);if(o.__useDefaultFramebuffer!==void 0){I.bindFramebuffer(F.FRAMEBUFFER,o.__webglFramebuffer),P.copy(e.viewport),ne.copy(e.scissor),re=e.scissorTest,I.viewport(P),I.scissor(ne),I.setScissorTest(re),N=-1;return}else if(o.__webglFramebuffer===void 0)R.setupRenderTarget(e);else if(o.__hasExternalTextures)R.rebindTextures(e,L.get(e.texture).__webglTexture,L.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let t=e.depthTexture;if(o.__boundDepthTexture!==t){if(t!==null&&L.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw Error(`THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.`);R.setupDepthRenderbuffer(e)}}let s=e.texture;(s.isData3DTexture||s.isDataArrayTexture||s.isCompressedArrayTexture)&&(a=!0);let c=L.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=Array.isArray(c[t])?c[t][n]:c[t],i=!0):r=e.samples>0&&R.useMultisampledRTT(e)===!1?L.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,P.copy(e.viewport),ne.copy(e.scissor),re=e.scissorTest}else P.copy(de).multiplyScalar(ce).floor(),ne.copy(fe).multiplyScalar(ce).floor(),re=pe;if(n!==0&&(r=O),I.bindFramebuffer(F.FRAMEBUFFER,r)&&I.drawBuffers(e,r),I.viewport(P),I.scissor(ne),I.setScissorTest(re),i){let r=L.get(e.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(a){let r=t;for(let t=0;t<e.textures.length;t++){let i=L.get(e.textures[t]);F.framebufferTextureLayer(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0+t,i.__webglTexture,n,r)}}else if(e!==null&&n!==0){let t=L.get(e.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,t.__webglTexture,n)}N=-1},this.readRenderTargetPixels=function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget)){error(`WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);return}let c=L.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c){I.bindFramebuffer(F.FRAMEBUFFER,c);try{let o=e.textures[s],c=o.format,l=o.type;if(e.textures.length>1&&F.readBuffer(F.COLOR_ATTACHMENT0+s),!Ce.textureFormatReadable(c)){error(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.`);return}if(!Ce.textureTypeReadable(l)){error(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.`);return}t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&F.readPixels(t,n,r,i,ze.convert(c),ze.convert(l),a)}finally{let e=M===null?null:L.get(M).__webglFramebuffer;I.bindFramebuffer(F.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget))throw Error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);let c=L.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c)if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){I.bindFramebuffer(F.FRAMEBUFFER,c);let o=e.textures[s],l=o.format,u=o.type;if(e.textures.length>1&&F.readBuffer(F.COLOR_ATTACHMENT0+s),!Ce.textureFormatReadable(l))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.`);if(!Ce.textureTypeReadable(u))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.`);let d=F.createBuffer();F.bindBuffer(F.PIXEL_PACK_BUFFER,d),F.bufferData(F.PIXEL_PACK_BUFFER,a.byteLength,F.STREAM_READ),F.readPixels(t,n,r,i,ze.convert(l),ze.convert(u),0);let f=M===null?null:L.get(M).__webglFramebuffer;I.bindFramebuffer(F.FRAMEBUFFER,f);let p=F.fenceSync(F.SYNC_GPU_COMMANDS_COMPLETE,0);return F.flush(),await probeAsync(F,p,4),F.bindBuffer(F.PIXEL_PACK_BUFFER,d),F.getBufferSubData(F.PIXEL_PACK_BUFFER,0,a),F.deleteBuffer(d),F.deleteSync(p),a}else throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.`)},this.copyFramebufferToTexture=function(e,t=null,n=0){let r=2**-n,i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=t===null?0:t.x,s=t===null?0:t.y;R.setTexture2D(e,0),F.copyTexSubImage2D(F.TEXTURE_2D,n,0,0,o,s,i,a),I.unbindTexture()},this.copyTextureToTexture=function(e,t,n=null,r=null,i=0,a=0){let o,s,c,l,u,d,f,p,m,h=e.isCompressedTexture?e.mipmaps[a]:e.image;if(n!==null)o=n.max.x-n.min.x,s=n.max.y-n.min.y,c=n.isBox3?n.max.z-n.min.z:1,l=n.min.x,u=n.min.y,d=n.isBox3?n.min.z:0;else{let t=2**-i;o=Math.floor(h.width*t),s=Math.floor(h.height*t),c=e.isDataArrayTexture?h.depth:e.isData3DTexture?Math.floor(h.depth*t):1,l=0,u=0,d=0}r===null?(f=0,p=0,m=0):(f=r.x,p=r.y,m=r.z);let g=ze.convert(t.format),_=ze.convert(t.type),v;t.isData3DTexture?(R.setTexture3D(t,0),v=F.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(R.setTexture2DArray(t,0),v=F.TEXTURE_2D_ARRAY):(R.setTexture2D(t,0),v=F.TEXTURE_2D),I.activeTexture(F.TEXTURE0),I.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,t.flipY),I.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),I.pixelStorei(F.UNPACK_ALIGNMENT,t.unpackAlignment);let y=I.getParameter(F.UNPACK_ROW_LENGTH),b=I.getParameter(F.UNPACK_IMAGE_HEIGHT),x=I.getParameter(F.UNPACK_SKIP_PIXELS),S=I.getParameter(F.UNPACK_SKIP_ROWS),C=I.getParameter(F.UNPACK_SKIP_IMAGES);I.pixelStorei(F.UNPACK_ROW_LENGTH,h.width),I.pixelStorei(F.UNPACK_IMAGE_HEIGHT,h.height),I.pixelStorei(F.UNPACK_SKIP_PIXELS,l),I.pixelStorei(F.UNPACK_SKIP_ROWS,u),I.pixelStorei(F.UNPACK_SKIP_IMAGES,d);let w=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=L.get(e),r=L.get(t),h=L.get(n.__renderTarget),g=L.get(r.__renderTarget);I.bindFramebuffer(F.READ_FRAMEBUFFER,h.__webglFramebuffer),I.bindFramebuffer(F.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let n=0;n<c;n++)w&&(F.framebufferTextureLayer(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,L.get(e).__webglTexture,i,d+n),F.framebufferTextureLayer(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,L.get(t).__webglTexture,a,m+n)),F.blitFramebuffer(l,u,o,s,f,p,o,s,F.DEPTH_BUFFER_BIT,F.NEAREST);I.bindFramebuffer(F.READ_FRAMEBUFFER,null),I.bindFramebuffer(F.DRAW_FRAMEBUFFER,null)}else if(i!==0||e.isRenderTargetTexture||L.has(e)){let n=L.get(e),r=L.get(t);I.bindFramebuffer(F.READ_FRAMEBUFFER,k),I.bindFramebuffer(F.DRAW_FRAMEBUFFER,A);for(let e=0;e<c;e++)w?F.framebufferTextureLayer(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,n.__webglTexture,i,d+e):F.framebufferTexture2D(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,n.__webglTexture,i),T?F.framebufferTextureLayer(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,r.__webglTexture,a,m+e):F.framebufferTexture2D(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,r.__webglTexture,a),i===0?T?F.copyTexSubImage3D(v,a,f,p,m+e,l,u,o,s):F.copyTexSubImage2D(v,a,f,p,l,u,o,s):F.blitFramebuffer(l,u,o,s,f,p,o,s,F.COLOR_BUFFER_BIT,F.NEAREST);I.bindFramebuffer(F.READ_FRAMEBUFFER,null),I.bindFramebuffer(F.DRAW_FRAMEBUFFER,null)}else T?e.isDataTexture||e.isData3DTexture?F.texSubImage3D(v,a,f,p,m,o,s,c,g,_,h.data):t.isCompressedArrayTexture?F.compressedTexSubImage3D(v,a,f,p,m,o,s,c,g,h.data):F.texSubImage3D(v,a,f,p,m,o,s,c,g,_,h):e.isDataTexture?F.texSubImage2D(F.TEXTURE_2D,a,f,p,o,s,g,_,h.data):e.isCompressedTexture?F.compressedTexSubImage2D(F.TEXTURE_2D,a,f,p,h.width,h.height,g,h.data):F.texSubImage2D(F.TEXTURE_2D,a,f,p,o,s,g,_,h);I.pixelStorei(F.UNPACK_ROW_LENGTH,y),I.pixelStorei(F.UNPACK_IMAGE_HEIGHT,b),I.pixelStorei(F.UNPACK_SKIP_PIXELS,x),I.pixelStorei(F.UNPACK_SKIP_ROWS,S),I.pixelStorei(F.UNPACK_SKIP_IMAGES,C),a===0&&t.generateMipmaps&&F.generateMipmap(v),I.unbindTexture()},this.initRenderTarget=function(e){L.get(e).__webglFramebuffer===void 0&&R.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?R.setTextureCube(e,0):e.isData3DTexture?R.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?R.setTexture2DArray(e,0):R.setTexture2D(e,0),I.unbindTexture()},this.resetState=function(){ee=0,j=0,M=null,I.reset(),Be.reset()},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}get coordinateSystem(){return di}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=J._getDrawingBufferColorSpace(e),t.unpackColorSpace=J._getUnpackColorSpace()}};const Ms={type:`change`},Ns={type:`start`},Ps={type:`end`},Fs=new Ray,Is=new Plane,Ls=Math.cos(70*vi.DEG2RAD),Rs=new K,zs=2*Math.PI,$={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Bs=1e-6;var OrbitControls=class extends Controls{constructor(e,t=null){super(e,t),this.state=$.NONE,this.target=new K,this.cursor=new K,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`},this.mouseButtons={LEFT:Ar.ROTATE,MIDDLE:Ar.DOLLY,RIGHT:Ar.PAN},this.touches={ONE:jr.ROTATE,TWO:jr.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle=`auto`,this._domElementKeyEvents=null,this._lastPosition=new K,this._lastQuaternion=new Quaternion,this._lastTargetPosition=new K,this._quat=new Quaternion().setFromUnitVectors(e.up,new K(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Spherical,this._sphericalDelta=new Spherical,this._scale=1,this._panOffset=new K,this._rotateStart=new G,this._rotateEnd=new G,this._rotateDelta=new G,this._panStart=new G,this._panEnd=new G,this._panDelta=new G,this._dollyStart=new G,this._dollyEnd=new G,this._dollyDelta=new G,this._dollyDirection=new K,this._mouse=new G,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=onPointerMove.bind(this),this._onPointerDown=onPointerDown.bind(this),this._onPointerUp=onPointerUp.bind(this),this._onContextMenu=onContextMenu.bind(this),this._onMouseWheel=onMouseWheel.bind(this),this._onKeyDown=onKeyDown.bind(this),this._onTouchStart=onTouchStart.bind(this),this._onTouchMove=onTouchMove.bind(this),this._onMouseDown=onMouseDown.bind(this),this._onMouseMove=onMouseMove.bind(this),this._interceptControlDown=interceptControlDown.bind(this),this._interceptControlUp=interceptControlUp.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(e){this._cursorStyle=e,e===`grab`?this.domElement.style.cursor=`grab`:this.domElement.style.cursor=`auto`}get cursorStyle(){return this._cursorStyle}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointercancel`,this._onPointerUp),this.domElement.addEventListener(`contextmenu`,this._onContextMenu),this.domElement.addEventListener(`wheel`,this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener(`keydown`,this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.removeEventListener(`pointercancel`,this._onPointerUp),this.domElement.removeEventListener(`wheel`,this._onMouseWheel),this.domElement.removeEventListener(`contextmenu`,this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener(`keydown`,this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=``}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Ms),this.update(),this.state=$.NONE}pan(e,t){this._pan(e,t),this.update()}dollyIn(e){this._dollyIn(e),this.update()}dollyOut(e){this._dollyOut(e),this.update()}rotateLeft(e){this._rotateLeft(e),this.update()}rotateUp(e){this._rotateUp(e),this.update()}update(e=null){let t=this.object.position;Rs.copy(t).sub(this.target),Rs.applyQuaternion(this._quat),this._spherical.setFromVector3(Rs),this.autoRotate&&this.state===$.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=zs:n>Math.PI&&(n-=zs),r<-Math.PI?r+=zs:r>Math.PI&&(r-=zs),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if(Rs.setFromSpherical(this._spherical),Rs.applyQuaternion(this._quatInverse),t.copy(this.target).add(Rs),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=Rs.length();e=this._clampDistance(t*this._scale);let n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){let t=new K(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;let r=new K(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=Rs.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),this.zoomToCursor=!1;e!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(Fs.origin.copy(this.object.position),Fs.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Fs.direction))<Ls?this.object.lookAt(this.target):(Is.setFromNormalAndCoplanarPoint(this.object.up,this.target),Fs.intersectPlane(Is,this.target))))}else if(this.object.isOrthographicCamera){let e=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),e!==this.object.zoom&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,this._performCursorZoom=!1,i||this._lastPosition.distanceToSquared(this.object.position)>Bs||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Bs||this._lastTargetPosition.distanceToSquared(this.target)>Bs?(this.dispatchEvent(Ms),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?zs/60/60*this.autoRotateSpeed:zs/60*this.autoRotateSpeed*e}_getZoomScale(e){let t=Math.abs(e*.01);return .95**(this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){Rs.setFromMatrixColumn(t,0),Rs.multiplyScalar(-e),this._panOffset.add(Rs)}_panUp(e,t){this.screenSpacePanning===!0?Rs.setFromMatrixColumn(t,1):(Rs.setFromMatrixColumn(t,0),Rs.crossVectors(this.object.up,Rs)),Rs.multiplyScalar(e),this._panOffset.add(Rs)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;Rs.copy(r).sub(this.target);let i=Rs.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,a=n.width,o=n.height;this._mouse.x=r/a*2-1,this._mouse.y=-(i/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(zs*this._rotateDelta.x/t.clientHeight),this._rotateUp(zs*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(zs*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-zs*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(zs*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-zs*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(zs*this._rotateDelta.x/t.clientHeight),this._rotateUp(zs*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,(this._dollyEnd.y/this._dollyStart.y)**+this.zoomSpeed),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new G,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){let t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){let t=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}};function onPointerDown(e){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(e.pointerId),this.domElement.ownerDocument.addEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.addEventListener(`pointerup`,this._onPointerUp)),!this._isTrackingPointer(e)&&(this._addPointer(e),e.pointerType===`touch`?this._onTouchStart(e):this._onMouseDown(e),this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grabbing`)))}function onPointerMove(e){this.enabled!==!1&&(e.pointerType===`touch`?this._onTouchMove(e):this._onMouseMove(e))}function onPointerUp(e){switch(this._removePointer(e),this._pointers.length){case 0:this.domElement.releasePointerCapture(e.pointerId),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.dispatchEvent(Ps),this.state=$.NONE,this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grab`);break;case 1:let t=this._pointers[0],n=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:n.x,pageY:n.y});break}}function onMouseDown(e){let t;switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case Ar.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(e),this.state=$.DOLLY;break;case Ar.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=$.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=$.ROTATE}break;case Ar.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=$.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=$.PAN}break;default:this.state=$.NONE}this.state!==$.NONE&&this.dispatchEvent(Ns)}function onMouseMove(e){switch(this.state){case $.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(e);break;case $.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(e);break;case $.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(e);break}}function onMouseWheel(e){this.enabled===!1||this.enableZoom===!1||this.state!==$.NONE||(e.preventDefault(),this.dispatchEvent(Ns),this._handleMouseWheel(this._customWheelEvent(e)),this.dispatchEvent(Ps))}function onKeyDown(e){this.enabled!==!1&&this._handleKeyDown(e)}function onTouchStart(e){switch(this._trackPointer(e),this._pointers.length){case 1:switch(this.touches.ONE){case jr.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(e),this.state=$.TOUCH_ROTATE;break;case jr.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(e),this.state=$.TOUCH_PAN;break;default:this.state=$.NONE}break;case 2:switch(this.touches.TWO){case jr.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(e),this.state=$.TOUCH_DOLLY_PAN;break;case jr.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(e),this.state=$.TOUCH_DOLLY_ROTATE;break;default:this.state=$.NONE}break;default:this.state=$.NONE}this.state!==$.NONE&&this.dispatchEvent(Ns)}function onTouchMove(e){switch(this._trackPointer(e),this.state){case $.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(e),this.update();break;case $.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(e),this.update();break;case $.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(e),this.update();break;case $.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(e),this.update();break;default:this.state=$.NONE}}function onContextMenu(e){this.enabled!==!1&&e.preventDefault()}function interceptControlDown(e){e.key===`Control`&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}function interceptControlUp(e){e.key===`Control`&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}var TeapotGeometry=class extends Ka{constructor(e=50,t=10,n=!0,r=!0,i=!0,a=!0,o=!0){let s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,3,16,17,18,7,19,20,21,11,22,23,24,15,25,26,27,18,28,29,30,21,31,32,33,24,34,35,36,27,37,38,39,30,40,41,0,33,42,43,4,36,44,45,8,39,46,47,12,12,13,14,15,48,49,50,51,52,53,54,55,56,57,58,59,15,25,26,27,51,60,61,62,55,63,64,65,59,66,67,68,27,37,38,39,62,69,70,71,65,72,73,74,68,75,76,77,39,46,47,12,71,78,79,48,74,80,81,52,77,82,83,56,56,57,58,59,84,85,86,87,88,89,90,91,92,93,94,95,59,66,67,68,87,96,97,98,91,99,100,101,95,102,103,104,68,75,76,77,98,105,106,107,101,108,109,110,104,111,112,113,77,82,83,56,107,114,115,84,110,116,117,88,113,118,119,92,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,123,136,137,120,127,138,139,124,131,140,141,128,135,142,143,132,132,133,134,135,144,145,146,147,148,149,150,151,68,152,153,154,135,142,143,132,147,155,156,144,151,157,158,148,154,159,160,68,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,164,177,178,161,168,179,180,165,172,181,182,169,176,183,184,173,173,174,175,176,185,186,187,188,189,190,191,192,193,194,195,196,176,183,184,173,188,197,198,185,192,199,200,189,196,201,202,193,203,203,203,203,204,205,206,207,208,208,208,208,209,210,211,212,203,203,203,203,207,213,214,215,208,208,208,208,212,216,217,218,203,203,203,203,215,219,220,221,208,208,208,208,218,222,223,224,203,203,203,203,221,225,226,204,208,208,208,208,224,227,228,209,209,210,211,212,229,230,231,232,233,234,235,236,237,238,239,240,212,216,217,218,232,241,242,243,236,244,245,246,240,247,248,249,218,222,223,224,243,250,251,252,246,253,254,255,249,256,257,258,224,227,228,209,252,259,260,229,255,261,262,233,258,263,264,237,265,265,265,265,266,267,268,269,270,271,272,273,92,119,118,113,265,265,265,265,269,274,275,276,273,277,278,279,113,112,111,104,265,265,265,265,276,280,281,282,279,283,284,285,104,103,102,95,265,265,265,265,282,286,287,266,285,288,289,270,95,94,93,92],c=[1.4,0,2.4,1.4,-.784,2.4,.784,-1.4,2.4,0,-1.4,2.4,1.3375,0,2.53125,1.3375,-.749,2.53125,.749,-1.3375,2.53125,0,-1.3375,2.53125,1.4375,0,2.53125,1.4375,-.805,2.53125,.805,-1.4375,2.53125,0,-1.4375,2.53125,1.5,0,2.4,1.5,-.84,2.4,.84,-1.5,2.4,0,-1.5,2.4,-.784,-1.4,2.4,-1.4,-.784,2.4,-1.4,0,2.4,-.749,-1.3375,2.53125,-1.3375,-.749,2.53125,-1.3375,0,2.53125,-.805,-1.4375,2.53125,-1.4375,-.805,2.53125,-1.4375,0,2.53125,-.84,-1.5,2.4,-1.5,-.84,2.4,-1.5,0,2.4,-1.4,.784,2.4,-.784,1.4,2.4,0,1.4,2.4,-1.3375,.749,2.53125,-.749,1.3375,2.53125,0,1.3375,2.53125,-1.4375,.805,2.53125,-.805,1.4375,2.53125,0,1.4375,2.53125,-1.5,.84,2.4,-.84,1.5,2.4,0,1.5,2.4,.784,1.4,2.4,1.4,.784,2.4,.749,1.3375,2.53125,1.3375,.749,2.53125,.805,1.4375,2.53125,1.4375,.805,2.53125,.84,1.5,2.4,1.5,.84,2.4,1.75,0,1.875,1.75,-.98,1.875,.98,-1.75,1.875,0,-1.75,1.875,2,0,1.35,2,-1.12,1.35,1.12,-2,1.35,0,-2,1.35,2,0,.9,2,-1.12,.9,1.12,-2,.9,0,-2,.9,-.98,-1.75,1.875,-1.75,-.98,1.875,-1.75,0,1.875,-1.12,-2,1.35,-2,-1.12,1.35,-2,0,1.35,-1.12,-2,.9,-2,-1.12,.9,-2,0,.9,-1.75,.98,1.875,-.98,1.75,1.875,0,1.75,1.875,-2,1.12,1.35,-1.12,2,1.35,0,2,1.35,-2,1.12,.9,-1.12,2,.9,0,2,.9,.98,1.75,1.875,1.75,.98,1.875,1.12,2,1.35,2,1.12,1.35,1.12,2,.9,2,1.12,.9,2,0,.45,2,-1.12,.45,1.12,-2,.45,0,-2,.45,1.5,0,.225,1.5,-.84,.225,.84,-1.5,.225,0,-1.5,.225,1.5,0,.15,1.5,-.84,.15,.84,-1.5,.15,0,-1.5,.15,-1.12,-2,.45,-2,-1.12,.45,-2,0,.45,-.84,-1.5,.225,-1.5,-.84,.225,-1.5,0,.225,-.84,-1.5,.15,-1.5,-.84,.15,-1.5,0,.15,-2,1.12,.45,-1.12,2,.45,0,2,.45,-1.5,.84,.225,-.84,1.5,.225,0,1.5,.225,-1.5,.84,.15,-.84,1.5,.15,0,1.5,.15,1.12,2,.45,2,1.12,.45,.84,1.5,.225,1.5,.84,.225,.84,1.5,.15,1.5,.84,.15,-1.6,0,2.025,-1.6,-.3,2.025,-1.5,-.3,2.25,-1.5,0,2.25,-2.3,0,2.025,-2.3,-.3,2.025,-2.5,-.3,2.25,-2.5,0,2.25,-2.7,0,2.025,-2.7,-.3,2.025,-3,-.3,2.25,-3,0,2.25,-2.7,0,1.8,-2.7,-.3,1.8,-3,-.3,1.8,-3,0,1.8,-1.5,.3,2.25,-1.6,.3,2.025,-2.5,.3,2.25,-2.3,.3,2.025,-3,.3,2.25,-2.7,.3,2.025,-3,.3,1.8,-2.7,.3,1.8,-2.7,0,1.575,-2.7,-.3,1.575,-3,-.3,1.35,-3,0,1.35,-2.5,0,1.125,-2.5,-.3,1.125,-2.65,-.3,.9375,-2.65,0,.9375,-2,-.3,.9,-1.9,-.3,.6,-1.9,0,.6,-3,.3,1.35,-2.7,.3,1.575,-2.65,.3,.9375,-2.5,.3,1.125,-1.9,.3,.6,-2,.3,.9,1.7,0,1.425,1.7,-.66,1.425,1.7,-.66,.6,1.7,0,.6,2.6,0,1.425,2.6,-.66,1.425,3.1,-.66,.825,3.1,0,.825,2.3,0,2.1,2.3,-.25,2.1,2.4,-.25,2.025,2.4,0,2.025,2.7,0,2.4,2.7,-.25,2.4,3.3,-.25,2.4,3.3,0,2.4,1.7,.66,.6,1.7,.66,1.425,3.1,.66,.825,2.6,.66,1.425,2.4,.25,2.025,2.3,.25,2.1,3.3,.25,2.4,2.7,.25,2.4,2.8,0,2.475,2.8,-.25,2.475,3.525,-.25,2.49375,3.525,0,2.49375,2.9,0,2.475,2.9,-.15,2.475,3.45,-.15,2.5125,3.45,0,2.5125,2.8,0,2.4,2.8,-.15,2.4,3.2,-.15,2.4,3.2,0,2.4,3.525,.25,2.49375,2.8,.25,2.475,3.45,.15,2.5125,2.9,.15,2.475,3.2,.15,2.4,2.8,.15,2.4,0,0,3.15,.8,0,3.15,.8,-.45,3.15,.45,-.8,3.15,0,-.8,3.15,0,0,2.85,.2,0,2.7,.2,-.112,2.7,.112,-.2,2.7,0,-.2,2.7,-.45,-.8,3.15,-.8,-.45,3.15,-.8,0,3.15,-.112,-.2,2.7,-.2,-.112,2.7,-.2,0,2.7,-.8,.45,3.15,-.45,.8,3.15,0,.8,3.15,-.2,.112,2.7,-.112,.2,2.7,0,.2,2.7,.45,.8,3.15,.8,.45,3.15,.112,.2,2.7,.2,.112,2.7,.4,0,2.55,.4,-.224,2.55,.224,-.4,2.55,0,-.4,2.55,1.3,0,2.55,1.3,-.728,2.55,.728,-1.3,2.55,0,-1.3,2.55,1.3,0,2.4,1.3,-.728,2.4,.728,-1.3,2.4,0,-1.3,2.4,-.224,-.4,2.55,-.4,-.224,2.55,-.4,0,2.55,-.728,-1.3,2.55,-1.3,-.728,2.55,-1.3,0,2.55,-.728,-1.3,2.4,-1.3,-.728,2.4,-1.3,0,2.4,-.4,.224,2.55,-.224,.4,2.55,0,.4,2.55,-1.3,.728,2.55,-.728,1.3,2.55,0,1.3,2.55,-1.3,.728,2.4,-.728,1.3,2.4,0,1.3,2.4,.224,.4,2.55,.4,.224,2.55,.728,1.3,2.55,1.3,.728,2.55,.728,1.3,2.4,1.3,.728,2.4,0,0,0,1.425,0,0,1.425,.798,0,.798,1.425,0,0,1.425,0,1.5,0,.075,1.5,.84,.075,.84,1.5,.075,0,1.5,.075,-.798,1.425,0,-1.425,.798,0,-1.425,0,0,-.84,1.5,.075,-1.5,.84,.075,-1.5,0,.075,-1.425,-.798,0,-.798,-1.425,0,0,-1.425,0,-1.5,-.84,.075,-.84,-1.5,.075,0,-1.5,.075,.798,-1.425,0,1.425,-.798,0,.84,-1.5,.075,1.5,-.84,.075];super(),t=Math.max(2,Math.floor(t));let l=1.3,u=3.15*(o?1:l)/2,d=e/u,f=n?(8*t-4)*t:0;f+=r?(16*t-4)*t:0,f+=i?40*t*t:0;let p=new Uint32Array(f*3),m=n?4:0;m+=r?8:0,m+=i?20:0,m*=(t+1)*(t+1);let h=new Float32Array(m*3),g=new Float32Array(m*3),_=new Float32Array(m*2),v=new X;v.set(-1,3,-3,1,3,-6,3,0,-3,3,0,0,1,0,0,0);let y=[],b=[],x=[],S=[],C=[],w=[],T=[],E=[],D=[],O=new K,k,A,ee,j,M=0,N=0,te=new K,P=new X,ne=new X,re=new Y,ie=new Y,ae=new Y,oe=new Y,se=new K,ce=new K,le=v.clone();le.transpose();let notDegenerate=(e,t,n)=>!(h[e*3]===h[t*3]&&h[e*3+1]===h[t*3+1]&&h[e*3+2]===h[t*3+2]||h[e*3]===h[n*3]&&h[e*3+1]===h[n*3+1]&&h[e*3+2]===h[n*3+2]||h[t*3]===h[n*3]&&h[t*3+1]===h[n*3+1]&&h[t*3+2]===h[n*3+2]);for(let e=0;e<3;e++)w[e]=new X;let ue=i?0:20,de=n?32:28,fe=t+1,pe=0,me=0,he=0,ge=0,_e=0;for(let e=ue;e<de;e++)if(r||e<20||e>=28){for(let t=0;t<3;t++){for(let n=0;n<4;n++)for(let r=0;r<4;r++)y[r*4+n]=c[s[e*16+n*4+r]*3+t],a&&e>=20&&e<28&&t!==2&&(y[r*4+n]*=1.077),!o&&t===2&&(y[r*4+n]*=l);P.set(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),ne.multiplyMatrices(P,v),w[t].multiplyMatrices(le,ne)}for(let e=0;e<=t;e++){let n=e/t;for(let e=0;e<=t;e++){let r=e/t;for(j=4,A=ee=1;j--;)b[j]=A,x[j]=ee,A*=n,ee*=r,j===3?(S[j]=C[j]=0,M=N=1):(S[j]=M*(3-j),C[j]=N*(3-j),M*=n,N*=r);re.fromArray(b),ie.fromArray(x),ae.fromArray(S),oe.fromArray(C);for(let e=0;e<3;e++)k=re.clone(),k.applyMatrix4(w[e]),T[e]=k.dot(ie),k=ae.clone(),k.applyMatrix4(w[e]),E[e]=k.dot(ie),k=re.clone(),k.applyMatrix4(w[e]),D[e]=k.dot(oe);se.fromArray(E),ce.fromArray(D),O.crossVectors(ce,se),O.normalize(),T[0]===0&&T[1]===0?te.set(0,T[2]>u?1:-1,0):te.set(O.x,O.z,-O.y),h[me++]=d*T[0],h[me++]=d*(T[2]-u),h[me++]=-d*T[1],g[he++]=te.x,g[he++]=te.y,g[he++]=te.z,_[ge++]=1-r,_[ge++]=1-n}}for(let e=0;e<t;e++)for(let n=0;n<t;n++){let t=pe*fe*fe+e*fe+n,r=t+1,i=r+fe,a=t+fe;notDegenerate(t,r,i)&&(p[_e++]=t,p[_e++]=r,p[_e++]=i),notDegenerate(t,i,a)&&(p[_e++]=t,p[_e++]=i,p[_e++]=a)}pe++}this.setIndex(new BufferAttribute(p,1)),this.setAttribute(`position`,new BufferAttribute(h,3)),this.setAttribute(`normal`,new BufferAttribute(g,3)),this.setAttribute(`uv`,new BufferAttribute(_,2)),this.computeBoundingSphere()}};const Vs=[2,3,4,5,6,8,10,15,20,30,40,50],Hs=[`wireframe`,`flat`,`smooth`,`glossy`,`textured`,`reflective`];function start(e,t){let n=t?.assetBase??`./`,r=new WebGLRenderer({canvas:e,antialias:!0});r.setSize(e.width,e.height,!1);let i=e.width,a=e.height,o=new PerspectiveCamera(45,e.width/e.height,1,8e4);o.position.set(-600,550,1300);let s=new Scene;s.background=new Color(11184810);let c=new AmbientLight(8158332,2);s.add(c);let l=new DirectionalLight(16777215,2);l.position.set(.32,.39,.7),s.add(l);let u=new TextureLoader().load(`${n}assets/uv_grid_opengl.jpg`);u.wrapS=u.wrapT=Mr,u.anisotropy=16,u.colorSpace=oi;let d=`${n}assets/pisa/`,f=new CubeTextureLoader().setPath(d).load([`px.png`,`nx.png`,`py.png`,`ny.png`,`pz.png`,`nz.png`]),p={wireframe:new MeshBasicMaterial({wireframe:!0}),flat:new MeshPhongMaterial({specular:0,flatShading:!0,side:2}),smooth:new MeshLambertMaterial({side:2}),glossy:new MeshPhongMaterial({color:12632256,specular:4210752,shininess:300,side:2}),textured:new MeshPhongMaterial({map:u,side:2}),reflective:new MeshPhongMaterial({envMap:f,side:2})};new OrbitControls(o,e).addEventListener(`change`,render);let m={newTess:15,lid:!0,body:!0,bottom:!0,fitLid:!1,nonblinn:!1,newShading:`glossy`},h=-1,g,_,v,y,b,x,S;function createNewTeapot(){S!==void 0&&(S.geometry.dispose(),s.remove(S)),S=new Mesh(new TeapotGeometry(300,h,m.bottom,m.lid,m.body,m.fitLid,!m.nonblinn),p[x]),s.add(S)}function doRender(){(m.newTess!==h||m.bottom!==g||m.lid!==_||m.body!==v||m.fitLid!==y||m.nonblinn!==b||m.newShading!==x)&&(h=m.newTess,g=m.bottom,_=m.lid,v=m.body,y=m.fitLid,b=m.nonblinn,x=m.newShading,createNewTeapot()),x===`reflective`?s.background=f:s.background=null;let t=e.width,n=e.height;(i!==t||a!==n)&&(i=t,a=n,r.setSize(t,n,!1),o.aspect=t/n,o.updateProjectionMatrix()),r.render(s,o)}let C=!1,w=!1,T=!1;function render(){if(w){T=!0;return}C||(C=!0,requestAnimationFrame(()=>{C=!1,doRender()}))}return render(),{effectController:m,render,get isPaused(){return w},pause(){w||=!0},resume(){w&&(w=!1,T&&(T=!1,render()))}}}const Us=[`sidebarToggleButton`,`pauseButton`,`splitView`,`tessRow`,`lidRow`,`bodyRow`,`bottomRow`,`fitLidRow`,`nonblinnRow`,`shadingRow`,`glAreaContainer`];var TeapotWindow=class extends cn.ApplicationWindow{_demo=null;static{bn.registerClass({GTypeName:`TeapotWindow`,Template:`<?xml version="1.0" encoding="UTF-8"?>
|
|
4218
4218
|
<!--
|
|
4219
4219
|
DO NOT EDIT!
|
|
4220
4220
|
This file was @generated by blueprint-compiler. Instead, edit the
|
|
@@ -4343,4 +4343,4 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
|
|
|
4343
4343
|
</property>
|
|
4344
4344
|
</template>
|
|
4345
4345
|
</interface>
|
|
4346
|
-
`,InternalChildren:
|
|
4346
|
+
`,InternalChildren:Us},this)}constructor(e){super({application:e}),this._tessRow.set_model(W.StringList.new(Vs.map(String))),this._tessRow.set_selected(7),this._shadingRow.set_model(W.StringList.new([...Hs])),this._shadingRow.set_selected(3);let t=new kr;t.set_hexpand(!0),t.set_vexpand(!0),t.installGlobals(),this._glAreaContainer.append(t),Object.defineProperty(globalThis,"innerWidth",{get:()=>t.get_allocated_width(),configurable:!0}),Object.defineProperty(globalThis,"innerHeight",{get:()=>t.get_allocated_height(),configurable:!0}),t.onReady(e=>{t.grab_focus();let n=t.get_context();print(`Context version: OpenGL${n.get_use_es()?` ES`:``} ${n.get_version().join(`.`)}`),this._demo=start(e),this.connectControls(this._demo)}),this._pauseButton.connect(`clicked`,()=>{this._demo&&(this._demo.isPaused?(this._demo.resume(),this._pauseButton.set_icon_name(`media-playback-pause-symbolic`),this._pauseButton.set_tooltip_text(`Pause Rendering`)):(this._demo.pause(),this._pauseButton.set_icon_name(`media-playback-start-symbolic`),this._pauseButton.set_tooltip_text(`Resume Rendering`)))})}connectControls(e){this._tessRow.connect(`notify::selected`,()=>{e.effectController.newTess=Vs[this._tessRow.selected],e.render()}),this._shadingRow.connect(`notify::selected`,()=>{e.effectController.newShading=Hs[this._shadingRow.selected],e.render()}),this._lidRow.connect(`notify::active`,()=>{e.effectController.lid=this._lidRow.active,e.render()}),this._bodyRow.connect(`notify::active`,()=>{e.effectController.body=this._bodyRow.active,e.render()}),this._bottomRow.connect(`notify::active`,()=>{e.effectController.bottom=this._bottomRow.active,e.render()}),this._fitLidRow.connect(`notify::active`,()=>{e.effectController.fitLid=this._fitLidRow.active,e.render()}),this._nonblinnRow.connect(`notify::active`,()=>{e.effectController.nonblinn=this._nonblinnRow.active,e.render()})}};const Ws=new cn.Application({application_id:`gjsify.examples.three-geometry-teapot`,flags:z.ApplicationFlags.FLAGS_NONE});Ws.connect(`startup`,()=>installDevtools(Ws)),Ws.connect(`activate`,()=>{let e=Ws.get_active_window();e||=new TeapotWindow(Ws),e.present()}),await Ws.runAsync([]);export{};
|