GraphictoriaWeb/web/public/js/pages/maintenance.js

2 lines
1.0 MiB
Raw Blame History

/*! For license information please see maintenance.js.LICENSE.txt */
(()=>{var e={9669:(e,t,n)=>{e.exports=n(1609)},5448:(e,t,n)=>{"use strict";var r=n(4867),i=n(6026),a=n(4372),o=n(5327),s=n(4097),l=n(4109),u=n(7985),c=n(5061),d=n(5655),h=n(5263);e.exports=function(e){return new Promise((function(t,n){var p,f=e.data,m=e.headers,g=e.responseType;function v(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}r.isFormData(f)&&delete m["Content-Type"];var y=new XMLHttpRequest;if(e.auth){var x=e.auth.username||"",b=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(x+":"+b)}var w=s(e.baseURL,e.url);function _(){if(y){var r="getAllResponseHeaders"in y?l(y.getAllResponseHeaders()):null,a={data:g&&"text"!==g&&"json"!==g?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y};i((function(e){t(e),v()}),(function(e){n(e),v()}),a),y=null}}if(y.open(e.method.toUpperCase(),o(w,e.params,e.paramsSerializer),!0),y.timeout=e.timeout,"onloadend"in y?y.onloadend=_:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(_)},y.onabort=function(){y&&(n(c("Request aborted",e,"ECONNABORTED",y)),y=null)},y.onerror=function(){n(c("Network Error",e,null,y)),y=null},y.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||d.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(c(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",y)),y=null},r.isStandardBrowserEnv()){var M=(e.withCredentials||u(w))&&e.xsrfCookieName?a.read(e.xsrfCookieName):void 0;M&&(m[e.xsrfHeaderName]=M)}"setRequestHeader"in y&&r.forEach(m,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete m[t]:y.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(y.withCredentials=!!e.withCredentials),g&&"json"!==g&&(y.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&y.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&y.upload&&y.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){y&&(n(!e||e&&e.type?new h("canceled"):e),y.abort(),y=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),f||(f=null),y.send(f)}))}},1609:(e,t,n)=>{"use strict";var r=n(4867),i=n(1849),a=n(321),o=n(7185);var s=function e(t){var n=new a(t),s=i(a.prototype.request,n);return r.extend(s,a.prototype,n),r.extend(s,n),s.create=function(n){return e(o(t,n))},s}(n(5655));s.Axios=a,s.Cancel=n(5263),s.CancelToken=n(4972),s.isCancel=n(6502),s.VERSION=n(7288).version,s.all=function(e){return Promise.all(e)},s.spread=n(8713),s.isAxiosError=n(6268),e.exports=s,e.exports.default=s},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,n)=>{"use strict";var r=n(5263);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},6502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,n)=>{"use strict";var r=n(4867),i=n(5327),a=n(782),o=n(3572),s=n(7185),l=n(4875),u=l.validators;function c(e){this.defaults=e,this.interceptors={request:new a,response:new a}}c.prototype.request=function(e,t){if("string"==typeof e?(t=t||{}).url=e:t=e||{},!t.url)throw new Error("Provided config url is not valid");(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&l.assertOptions(n,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var r=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var a,c=[];if(this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)})),!i){var d=[o,void 0];for(Array.prototype.unshift.apply(d,r),d=d.concat(c),a=Promise.resolve(t);d.length;)a=a.then(d.shift(),d.shift());return a}for(var h=t;r.length;){var p=r.shift(),f=r.shift();try{h=p(h)}catch(e){f(e);break}}try{a=o(h)}catch(e){return Promise.reject(e)}for(;c.length;)a=a.then(c.shift(),c.shift());return a},c.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=s(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,n){return this.request(s(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,n,r){return this.request(s(r||{},{method:e,url:t,data:n}))}})),e.exports=c},782:(e,t,n)=>{"use strict";var r=n(4867);function i(){this.handlers=[]}i.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},4097:(e,t,n)=>{"use strict";var r=n(1793),i=n(7303);e.exports=function(e,t){return e&&!r(t)?i(e,t):t}},5061:(e,t,n)=>{"use strict";var r=n(481);e.exports=function(e,t,n,i,a){var o=new Error(e);return r(o,t,n,i,a)}},3572:(e,t,n)=>{"use strict";var r=n(4867),i=n(8527),a=n(6502),o=n(5655),s=n(5263);function l(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s("canceled")}e.exports=function(e){return l(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return l(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return a(t)||(l(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},7185:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){t=t||{};var n={};function i(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function a(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:i(void 0,e[n]):i(e[n],t[n])}function o(e){if(!r.isUndefined(t[e]))return i(void 0,t[e])}function s(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:i(void 0,e[n]):i(void 0,t[n])}function l(n){return n in t?i(e[n],t[n]):n in e?i(void 0,e[n]):void 0}var u={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||a,i=t(e);r.isUndefined(i)&&t!==l||(n[e]=i)})),n}},6026:(e,t,n)=>{"use strict";var r=n(5061);e.exports=function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},8527:(e,t,n)=>{"use strict";var r=n(4867),i=n(5655);e.exports=function(e,t,n){var a=this||i;return r.forEach(n,(function(n){e=n.call(a,e,t)})),e}},5655:(e,t,n)=>{"use strict";var r=n(4155),i=n(4867),a=n(6016),o=n(481),s={"Content-Type":"application/x-www-form-urlencoded"};function l(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r))&&(u=n(5448)),u),transformRequest:[function(e,t){return a(t,"Accept"),a(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(l(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)||t&&"application/json"===t["Content-Type"]?(l(t,"application/json"),function(e,t,n){if(i.isString(e))try{return(t||JSON.parse)(e),i.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||c.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||r&&i.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw o(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),i.forEach(["post","put","patch"],(function(e){c.headers[e]=i.merge(s)})),e.exports=c},7288:e=>{e.exports={version:"0.25.0"}},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},5327:(e,t,n)=>{"use strict";var r=n(4867);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var a;if(n)a=n(t);else if(r.isURLSearchParams(t))a=t.toString();else{var o=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),o.push(i(t)+"="+i(e))})))})),a=o.join("&")}if(a){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}},7303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,a,o){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},6268:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e){return r.isObject(e)&&!0===e.isAxiosError}},7985:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},6016:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},4109:(e,t,n)=>{"use strict";var r=n(4867),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,a,o={};return e?(r.forEach(e.split("\n"),(function(e){if(a=e.indexOf(":"),t=r.trim(e.substr(0,a)).toLowerCase(),n=r.trim(e.substr(a+1)),t){if(o[t]&&i.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4875:(e,t,n)=>{"use strict";var r=n(7288).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var a={};i.transitional=function(e,t,n){function i(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,o){if(!1===e)throw new Error(i(r," has been removed"+(t?" in "+t:"")));return t&&!a[r]&&(a[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,o)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),i=r.length;i-- >0;){var a=r[i],o=t[a];if(o){var s=e[a],l=void 0===s||o(s,a,e);if(!0!==l)throw new TypeError("option "+a+" must be "+l)}else if(!0!==n)throw Error("Unknown option "+a)}},validators:i}},4867:(e,t,n)=>{"use strict";var r=n(1849),i=Object.prototype.toString;function a(e){return Array.isArray(e)}function o(e){return void 0===e}function s(e){return"[object ArrayBuffer]"===i.call(e)}function l(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===i.call(e)}function d(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),a(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:a,isArrayBuffer:s,isBuffer:function(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===i.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&s(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:l,isPlainObject:u,isUndefined:o,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:c,isStream:function(e){return l(e)&&c(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===i.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:d,merge:function e(){var t={};function n(n,r){u(t[r])&&u(n)?t[r]=e(t[r],n):u(n)?t[r]=e({},n):a(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)d(arguments[r],n);return t},extend:function(e,t,n){return d(t,(function(t,i){e[i]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},296:e=>{function t(e,t,n){var r,i,a,o,s;function l(){var u=Date.now()-o;u<t&&u>=0?r=setTimeout(l,t-u):(r=null,n||(s=e.apply(a,i),a=i=null))}null==t&&(t=100);var u=function(){a=this,i=arguments,o=Date.now();var u=n&&!r;return r||(r=setTimeout(l,t)),u&&(s=e.apply(a,i),a=i=null),s};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(s=e.apply(a,i),a=i=null,clearTimeout(r),r=null)},u}t.debounce=t,e.exports=t},9755:function(e,t){var n;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,(function(r,i){"use strict";var a=[],o=Object.getPrototypeOf,s=a.slice,l=a.flat?function(e){return a.flat.call(e)}:function(e){return a.concat.apply([],e)},u=a.push,c=a.indexOf,d={},h=d.toString,p=d.hasOwnProperty,f=p.toString,m=f.call(Object),g={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},x=r.document,b={type:!0,src:!0,nonce:!0,noModule:!0};function w(e,t,n){var r,i,a=(n=n||x).createElement("script");if(a.text=e,t)for(r in b)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&a.setAttribute(r,i);n.head.appendChild(a).parentNode.removeChild(a)}function _(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[h.call(e)]||"object":typeof e}var M="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function A(e){var t=!!e&&"length"in e&&e.length,n=_(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}S.fn=S.prototype={jquery:M,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:a.sort,splice:a.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,a,o=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof o&&(u=o,o=arguments[s]||{},s++),"object"==typeof o||v(o)||(o={}),s===l&&(o=this,s--);s<l;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&o!==r&&(u&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=o[t],a=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,o[t]=S.extend(u,a,r)):void 0!==r&&(o[t]=r));return o},S.extend({expando:"jQuery"+(M+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==h.call(e))&&(!(t=o(e))||"function"==typeof(n=p.call(t,"constructor")&&t.constructor)&&f.call(n)===m)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){w(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(A(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(A(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:c.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,a=e.length,o=!n;i<a;i++)!t(e[i],i)!==o&&r.push(e[i]);return r},map:function(e,t,n){var r,i,a=0,o=[];if(A(e))for(r=e.length;a<r;a++)null!=(i=t(e[a],a,n))&&o.push(i);else for(a in e)null!=(i=t(e[a],a,n))&&o.push(i);return l(o)},guid:1,support:g}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=a[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){d["[object "+t+"]"]=t.toLowerCase()}));var E=function(e){var t,n,r,i,a,o,s,l,u,c,d,h,p,f,m,g,v,y,x,b="sizzle"+1*new Date,w=e.document,_=0,M=0,S=le(),A=le(),E=le(),C=le(),T=function(e,t){return e===t&&(d=!0),0},B={}.hasOwnProperty,R=[],L=R.pop,P=R.push,D=R.push,I=R.slice,F=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},k="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",N="[\\x20\\t\\r\\n\\f]",O="(?:\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",H="\\[[\\x20\\t\\r\\n\\f]*("+O+")(?:"+N+"*([*^$|!~]?=)"+N+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+N+"*\\]",U=":("+O+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+H+")*)|.*)\\)|)",G=new RegExp(N+"+","g"),z=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),W=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),V=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),j=new RegExp(N+"|>"),J=new RegExp(U),q=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+O+")"),CLASS:new RegExp("^\\.("+O+")"),TAG:new RegExp("^("+O+"|[*])"),ATTR:new RegExp("^"+H),PSEUDO:new RegExp("^"+U),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+k+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"<22>":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ae=function(){h()},oe=be((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{D.apply(R=I.call(w.childNodes),w.childNodes),R[w.childNodes.length].nodeType}catch(e){D={apply:R.length?function(e,t){P.apply(e,I.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,i){var a,s,u,c,d,f,v,y=t&&t.ownerDocument,w=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return r;if(!i&&(h(t),t=t||p,m)){if(11!==w&&(d=$.exec(e)))if(a=d[1]){if(9===w){if(!(u=t.getElementById(a)))return r;if(u.id===a)return r.push(u),r}else if(y&&(u=y.getElementById(a))&&x(t,u)&&u.id===a)return r.push(u),r}else{if(d[2])return D.apply(r,t.getElementsByTagName(e)),r;if((a=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return D.apply(r,t.getElementsByClassName(a)),r}if(n.qsa&&!C[e+" "]&&(!g||!g.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(v=e,y=t,1===w&&(j.test(e)||V.test(e))){for((y=ee.test(e)&&ve(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,ie):t.setAttribute("id",c=b)),s=(f=o(e)).length;s--;)f[s]=(c?"#"+c:":scope")+" "+xe(f[s]);v=f.join(",")}try{return D.apply(r,y.querySelectorAll(v)),r}catch(t){C(e,!0)}finally{c===b&&t.removeAttribute("id")}}}return l(e.replace(z,"$1"),t,r,i)}function le(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function ue(e){return e[b]=!0,e}function ce(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function he(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function pe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function fe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&oe(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ue((function(t){return t=+t,ue((function(n,r){for(var i,a=e([],n.length,t),o=a.length;o--;)n[i=a[o]]&&(n[i]=!(r[i]=n[i]))}))}))}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},a=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!K.test(t||n&&n.nodeName||"HTML")},h=se.setDocument=function(e){var t,i,o=e?e.ownerDocument||e:w;return o!=p&&9===o.nodeType&&o.documentElement?(f=(p=o).documentElement,m=!a(p),w!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ae,!1):i.attachEvent&&i.attachEvent("onunload",ae)),n.scope=ce((function(e){return f.appendChild(e).appendChild(p.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=ce((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ce((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=Z.test(p.getElementsByClassName),n.getById=ce((function(e){return f.appendChild(e).id=b,!p.getElementsByName||!p.getElementsByName(b).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,r,i,a=t.getElementById(e);if(a){if((n=a.getAttributeNode("id"))&&n.value===e)return[a];for(i=t.getElementsByName(e),r=0;a=i[r++];)if((n=a.getAttributeNode("id"))&&n.value===e)return[a]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,a=t.getElementsByTagName(e);if("*"===e){for(;n=a[i++];)1===n.nodeType&&r.push(n);return r}return a},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],g=[],(n.qsa=Z.test(p.querySelectorAll))&&(ce((function(e){var t;f.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+k+")"),e.querySelectorAll("[id~="+b+"-]").length||g.push("~="),(t=p.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ce((function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),f.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Z.test(y=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ce((function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),v.push("!=",U)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=Z.test(f.compareDocumentPosition),x=t||Z.test(f.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},T=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==p||e.ownerDocument==w&&x(w,e)?-1:t==p||t.ownerDocument==w&&x(w,t)?1:c?F(c,e)-F(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,i=e.parentNode,a=t.parentNode,o=[e],s=[t];if(!i||!a)return e==p?-1:t==p?1:i?-1:a?1:c?F(c,e)-F(c,t):0;if(i===a)return he(e,t);for(n=e;n=n.parentNode;)o.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;o[r]===s[r];)r++;return r?he(o[r],s[r]):o[r]==w?-1:s[r]==w?1:0},p):p},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(h(e),n.matchesSelector&&m&&!C[t+" "]&&(!v||!v.test(t))&&(!g||!g.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){C(t,!0)}return se(t,p,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!=p&&h(e),x(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=p&&h(e);var i=r.attrHandle[t.toLowerCase()],a=i&&B.call(r.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==a?a:n.attributes||!m?e.getAttribute(t):(a=e.getAttributeNode(t))&&a.specified?a.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,r=[],i=0,a=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(T),d){for(;t=e[a++];)t===e[a]&&(i=r.push(a));for(;i--;)e.splice(r[i],1)}return c=null,e},i=se.getText=function(e){var t,n="",r=0,a=e.nodeType;if(a){if(1===a||9===a||11===a){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===a||4===a)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},r=se.selectors={cacheLength:50,createPseudo:ue,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return X.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&J.test(n)&&(t=o(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=S[e+" "];return t||(t=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+e+"("+N+"|$)"))&&S(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=se.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(G," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var a="nth"!==e.slice(0,3),o="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,d,h,p,f,m=a!==o?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s,x=!1;if(g){if(a){for(;m;){for(h=t;h=h[m];)if(s?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[o?g.firstChild:g.lastChild],o&&y){for(x=(p=(u=(c=(d=(h=g)[b]||(h[b]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]||[])[0]===_&&u[1])&&u[2],h=p&&g.childNodes[p];h=++p&&h&&h[m]||(x=p=0)||f.pop();)if(1===h.nodeType&&++x&&h===t){c[e]=[_,p,x];break}}else if(y&&(x=p=(u=(c=(d=(h=t)[b]||(h[b]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]||[])[0]===_&&u[1]),!1===x)for(;(h=++p&&h&&h[m]||(x=p=0)||f.pop())&&((s?h.nodeName.toLowerCase()!==v:1!==h.nodeType)||!++x||(y&&((c=(d=h[b]||(h[b]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]=[_,x]),h!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ue((function(e,n){for(var r,a=i(e,t),o=a.length;o--;)e[r=F(e,a[o])]=!(n[r]=a[o])})):function(e){return i(e,0,n)}):i}},pseudos:{not:ue((function(e){var t=[],n=[],r=s(e.replace(z,"$1"));return r[b]?ue((function(e,t,n,i){for(var a,o=r(e,null,i,[]),s=e.length;s--;)(a=o[s])&&(e[s]=!(t[s]=a))})):function(e,i,a){return t[0]=e,r(t,null,a,n),t[0]=null,!n.pop()}})),has:ue((function(e){return function(t){return se(e,t).length>0}})),contains:ue((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}})),lang:ue((function(e){return q.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge((function(){return[0]})),last:ge((function(e,t){return[t-1]})),eq:ge((function(e,t,n){return[n<0?n+t:n]})),even:ge((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:ge((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:ge((function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e})),gt:ge((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}},r.pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=pe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=fe(t);function ye(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(e,t,n){var r=t.dir,i=t.next,a=i||r,o=n&&"parentNode"===a,s=M++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||o)return e(t,n,i);return!1}:function(t,n,l){var u,c,d,h=[_,s];if(l){for(;t=t[r];)if((1===t.nodeType||o)&&e(t,n,l))return!0}else for(;t=t[r];)if(1===t.nodeType||o)if(c=(d=t[b]||(t[b]={}))[t.uniqueID]||(d[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((u=c[a])&&u[0]===_&&u[1]===s)return h[2]=u[2];if(c[a]=h,h[2]=e(t,n,l))return!0}return!1}}function we(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function _e(e,t,n,r,i){for(var a,o=[],s=0,l=e.length,u=null!=t;s<l;s++)(a=e[s])&&(n&&!n(a,r,i)||(o.push(a),u&&t.push(s)));return o}function Me(e,t,n,r,i,a){return r&&!r[b]&&(r=Me(r)),i&&!i[b]&&(i=Me(i,a)),ue((function(a,o,s,l){var u,c,d,h=[],p=[],f=o.length,m=a||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),g=!e||!a&&t?m:_e(m,h,e,s,l),v=n?i||(a?e:f||r)?[]:o:g;if(n&&n(g,v,s,l),r)for(u=_e(v,p),r(u,[],s,l),c=u.length;c--;)(d=u[c])&&(v[p[c]]=!(g[p[c]]=d));if(a){if(i||e){if(i){for(u=[],c=v.length;c--;)(d=v[c])&&u.push(g[c]=d);i(null,v=[],u,l)}for(c=v.length;c--;)(d=v[c])&&(u=i?F(a,d):h[c])>-1&&(a[u]=!(o[u]=d))}}else v=_e(v===o?v.splice(f,v.length):v),i?i(null,o,v,l):D.apply(o,v)}))}function Se(e){for(var t,n,i,a=e.length,o=r.relative[e[0].type],s=o||r.relative[" "],l=o?1:0,c=be((function(e){return e===t}),s,!0),d=be((function(e){return F(t,e)>-1}),s,!0),h=[function(e,n,r){var i=!o&&(r||n!==u)||((t=n).nodeType?c(e,n,r):d(e,n,r));return t=null,i}];l<a;l++)if(n=r.relative[e[l].type])h=[be(we(h),n)];else{if((n=r.filter[e[l].type].apply(null,e[l].matches))[b]){for(i=++l;i<a&&!r.relative[e[i].type];i++);return Me(l>1&&we(h),l>1&&xe(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,l<i&&Se(e.slice(l,i)),i<a&&Se(e=e.slice(i)),i<a&&xe(e))}h.push(n)}return we(h)}return ye.prototype=r.filters=r.pseudos,r.setFilters=new ye,o=se.tokenize=function(e,t){var n,i,a,o,s,l,u,c=A[e+" "];if(c)return t?0:c.slice(0);for(s=e,l=[],u=r.preFilter;s;){for(o in n&&!(i=W.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(a=[])),n=!1,(i=V.exec(s))&&(n=i.shift(),a.push({value:n,type:i[0].replace(z," ")}),s=s.slice(n.length)),r.filter)!(i=X[o].exec(s))||u[o]&&!(i=u[o](i))||(n=i.shift(),a.push({value:n,type:o,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?se.error(e):A(e,l).slice(0)},s=se.compile=function(e,t){var n,i=[],a=[],s=E[e+" "];if(!s){for(t||(t=o(e)),n=t.length;n--;)(s=Se(t[n]))[b]?i.push(s):a.push(s);s=E(e,function(e,t){var n=t.length>0,i=e.length>0,a=function(a,o,s,l,c){var d,f,g,v=0,y="0",x=a&&[],b=[],w=u,M=a||i&&r.find.TAG("*",c),S=_+=null==w?1:Math.random()||.1,A=M.length;for(c&&(u=o==p||o||c);y!==A&&null!=(d=M[y]);y++){if(i&&d){for(f=0,o||d.ownerDocument==p||(h(d),s=!m);g=e[f++];)if(g(d,o||p,s)){l.push(d);break}c&&(_=S)}n&&((d=!g&&d)&&v--,a&&x.push(d))}if(v+=y,n&&y!==v){for(f=0;g=t[f++];)g(x,b,o,s);if(a){if(v>0)for(;y--;)x[y]||b[y]||(b[y]=L.call(l));b=_e(b)}D.apply(l,b),c&&!a&&b.length>0&&v+t.length>1&&se.uniqueSort(l)}return c&&(_=S,u=w),x};return n?ue(a):a}(a,i)),s.selector=e}return s},l=se.select=function(e,t,n,i){var a,l,u,c,d,h="function"==typeof e&&e,p=!i&&o(e=h.selector||e);if(n=n||[],1===p.length){if((l=p[0]=p[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===t.nodeType&&m&&r.relative[l[1].type]){if(!(t=(r.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return n;h&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(a=X.needsContext.test(e)?0:l.length;a--&&(u=l[a],!r.relative[c=u.type]);)if((d=r.find[c])&&(i=d(u.matches[0].replace(te,ne),ee.test(l[0].type)&&ve(t.parentNode)||t))){if(l.splice(a,1),!(e=i.length&&xe(l)))return D.apply(n,i),n;break}}return(h||s(e,p))(i,t,!m,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},n.sortStable=b.split("").sort(T).join("")===b,n.detectDuplicates=!!d,h(),n.sortDetached=ce((function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))})),ce((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||de("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ce((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||de("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ce((function(e){return null==e.getAttribute("disabled")}))||de(k,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),se}(r);S.find=E,S.expr=E.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=E.uniqueSort,S.text=E.getText,S.isXMLDoc=E.isXML,S.contains=E.contains,S.escapeSelector=E.escape;var C=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},B=S.expr.match.needsContext;function R(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var L=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function P(e,t,n){return v(t)?S.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?S.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?S.grep(e,(function(e){return c.call(t,e)>-1!==n})):S.filter(t,e,n)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,(function(e){return 1===e.nodeType})))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter((function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0})));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return r>1?S.uniqueSort(n):n},filter:function(e){return this.pushStack(P(this,e||[],!1))},not:function(e){return this.pushStack(P(this,e||[],!0))},is:function(e){return!!P(this,"string"==typeof e&&B.test(e)?S(e):e||[],!1).length}});var D,I=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:I.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:x,!0)),L.test(r[1])&&S.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=x.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(x);var F=/^(?:parents|prev(?:Until|All))/,k={children:!0,contents:!0,next:!0,prev:!0};function N(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0}))},closest:function(e,t){var n,r=0,i=this.length,a=[],o="string"!=typeof e&&S(e);if(!B.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&S.find.matchesSelector(n,e))){a.push(n);break}return this.pushStack(a.length>1?S.uniqueSort(a):a)},index:function(e){return e?"string"==typeof e?c.call(S(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return C(e,"parentNode")},parentsUntil:function(e,t,n){return C(e,"parentNode",n)},next:function(e){return N(e,"nextSibling")},prev:function(e){return N(e,"previousSibling")},nextAll:function(e){return C(e,"nextSibling")},prevAll:function(e){return C(e,"previousSibling")},nextUntil:function(e,t,n){return C(e,"nextSibling",n)},prevUntil:function(e,t,n){return C(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&o(e.contentDocument)?e.contentDocument:(R(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},(function(e,t){S.fn[e]=function(n,r){var i=S.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=S.filter(r,i)),this.length>1&&(k[e]||S.uniqueSort(i),F.test(e)&&i.reverse()),this.pushStack(i)}}));var O=/[^\x20\t\r\n\f]+/g;function H(e){return e}function U(e){throw e}function G(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return S.each(e.match(O)||[],(function(e,n){t[n]=!0})),t}(e):S.extend({},e);var t,n,r,i,a=[],o=[],s=-1,l=function(){for(i=i||e.once,r=t=!0;o.length;s=-1)for(n=o.shift();++s<a.length;)!1===a[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=a.length,n=!1);e.memory||(n=!1),t=!1,i&&(a=n?[]:"")},u={add:function(){return a&&(n&&!t&&(s=a.length-1,o.push(n)),function t(n){S.each(n,(function(n,r){v(r)?e.unique&&u.has(r)||a.push(r):r&&r.length&&"string"!==_(r)&&t(r)}))}(arguments),n&&!t&&l()),this},remove:function(){return S.each(arguments,(function(e,t){for(var n;(n=S.inArray(t,a,n))>-1;)a.splice(n,1),n<=s&&s--})),this},has:function(e){return e?S.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=o=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=o=[],n||t||(a=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],o.push(n),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},S.extend({Deferred:function(e){var t=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return a.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return S.Deferred((function(n){S.each(t,(function(t,r){var i=v(e[r[4]])&&e[r[4]];a[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&v(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(e,n,i){var a=0;function o(e,t,n,i){return function(){var s=this,l=arguments,u=function(){var r,u;if(!(e<a)){if((r=n.apply(s,l))===t.promise())throw new TypeError("Thenable self-resolution");u=r&&("object"==typeof r||"function"==typeof r)&&r.then,v(u)?i?u.call(r,o(a,t,H,i),o(a,t,U,i)):(a++,u.call(r,o(a,t,H,i),o(a,t,U,i),o(a,t,H,t.notifyWith))):(n!==H&&(s=void 0,l=[r]),(i||t.resolveWith)(s,l))}},c=i?u:function(){try{u()}catch(r){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(r,c.stackTrace),e+1>=a&&(n!==U&&(s=void 0,l=[r]),t.rejectWith(s,l))}};e?c():(S.Deferred.getStackHook&&(c.stackTrace=S.Deferred.getStackHook()),r.setTimeout(c))}}return S.Deferred((function(r){t[0][3].add(o(0,r,v(i)?i:H,r.notifyWith)),t[1][3].add(o(0,r,v(e)?e:H)),t[2][3].add(o(0,r,v(n)?n:U))})).promise()},promise:function(e){return null!=e?S.extend(e,i):i}},a={};return S.each(t,(function(e,r){var o=r[2],s=r[5];i[r[1]]=o.add,s&&o.add((function(){n=s}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),o.add(r[3].fire),a[r[0]]=function(){return a[r[0]+"With"](this===a?void 0:this,arguments),this},a[r[0]+"With"]=o.fireWith})),i.promise(a),e&&e.call(a,a),a},when:function(e){var t=arguments.length,n=t,r=Array(n),i=s.call(arguments),a=S.Deferred(),o=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?s.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&(G(e,a.done(o(n)).resolve,a.reject,!t),"pending"===a.state()||v(i[n]&&i[n].then)))return a.then();for(;n--;)G(i[n],o(n),a.reject);return a.promise()}});var z=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&z.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){r.setTimeout((function(){throw e}))};var W=S.Deferred();function V(){x.removeEventListener("DOMContentLoaded",V),r.removeEventListener("load",V),S.ready()}S.fn.ready=function(e){return W.then(e).catch((function(e){S.readyException(e)})),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==e&&--S.readyWait>0||W.resolveWith(x,[S]))}}),S.ready.then=W.then,"complete"===x.readyState||"loading"!==x.readyState&&!x.documentElement.doScroll?r.setTimeout(S.ready):(x.addEventListener("DOMContentLoaded",V),r.addEventListener("load",V));var j=function(e,t,n,r,i,a,o){var s=0,l=e.length,u=null==n;if("object"===_(n))for(s in i=!0,n)j(e,t,s,n[s],!0,a,o);else if(void 0!==r&&(i=!0,v(r)||(o=!0),u&&(o?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(S(e),n)})),t))for(;s<l;s++)t(e[s],n,o?r:r.call(e[s],s,t(e[s],n)));return i?e:u?t.call(e):l?t(e[0],n):a},J=/^-ms-/,q=/-([a-z])/g;function X(e,t){return t.toUpperCase()}function K(e){return e.replace(J,"ms-").replace(q,X)}var Q=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Y(){this.expando=S.expando+Y.uid++}Y.uid=1,Y.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Q(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[K(t)]=n;else for(r in t)i[K(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][K(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(K):(t=K(t))in r?[t]:t.match(O)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Z=new Y,$=new Y,ee=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,te=/[A-Z]/g;function ne(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(te,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:ee.test(e)?JSON.parse(e):e)}(n)}catch(e){}$.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return $.hasData(e)||Z.hasData(e)},data:function(e,t,n){return $.access(e,t,n)},removeData:function(e,t){$.remove(e,t)},_data:function(e,t,n){return Z.access(e,t,n)},_removeData:function(e,t){Z.remove(e,t)}}),S.fn.extend({data:function(e,t){var n,r,i,a=this[0],o=a&&a.attributes;if(void 0===e){if(this.length&&(i=$.get(a),1===a.nodeType&&!Z.get(a,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&0===(r=o[n].name).indexOf("data-")&&(r=K(r.slice(5)),ne(a,r,i[r]));Z.set(a,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each((function(){$.set(this,e)})):j(this,(function(t){var n;if(a&&void 0===t)return void 0!==(n=$.get(a,e))||void 0!==(n=ne(a,e))?n:void 0;this.each((function(){$.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){$.remove(this,e)}))}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Z.get(e,t),n&&(!r||Array.isArray(n)?r=Z.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),a=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete a.stop,i.call(e,(function(){S.dequeue(e,t)}),a)),!r&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Z.get(e,n)||Z.access(e,n,{empty:S.Callbacks("once memory").add((function(){Z.remove(e,[t+"queue",n])}))})}}),S.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?S.queue(this[0],e):void 0===t?this:this.each((function(){var n=S.queue(this,e,t);S._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&S.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){S.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),a=this,o=this.length,s=function(){--r||i.resolveWith(a,[a])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";o--;)(n=Z.get(a[o],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var re=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ie=new RegExp("^(?:([+-])=|)("+re+")([a-z%]*)$","i"),ae=["Top","Right","Bottom","Left"],oe=x.documentElement,se=function(e){return S.contains(e.ownerDocument,e)},le={composed:!0};oe.getRootNode&&(se=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(le)===e.ownerDocument});var ue=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&se(e)&&"none"===S.css(e,"display")};function ce(e,t,n,r){var i,a,o=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},l=s(),u=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==u&&+l)&&ie.exec(S.css(e,t));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;o--;)S.style(e,t,c+u),(1-a)*(1-(a=s()/l||.5))<=0&&(o=0),c/=a;c*=2,S.style(e,t,c+u),n=n||[]}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=i)),i}var de={};function he(e){var t,n=e.ownerDocument,r=e.nodeName,i=de[r];return i||(t=n.body.appendChild(n.createElement(r)),i=S.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),de[r]=i,i)}function pe(e,t){for(var n,r,i=[],a=0,o=e.length;a<o;a++)(r=e[a]).style&&(n=r.style.display,t?("none"===n&&(i[a]=Z.get(r,"display")||null,i[a]||(r.style.display="")),""===r.style.display&&ue(r)&&(i[a]=he(r))):"none"!==n&&(i[a]="none",Z.set(r,"display",n)));for(a=0;a<o;a++)null!=i[a]&&(e[a].style.display=i[a]);return e}S.fn.extend({show:function(){return pe(this,!0)},hide:function(){return pe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){ue(this)?S(this).show():S(this).hide()}))}});var fe,me,ge=/^(?:checkbox|radio)$/i,ve=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ye=/^$|^module$|\/(?:java|ecma)script/i;fe=x.createDocumentFragment().appendChild(x.createElement("div")),(me=x.createElement("input")).setAttribute("type","radio"),me.setAttribute("checked","checked"),me.setAttribute("name","t"),fe.appendChild(me),g.checkClone=fe.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!fe.cloneNode(!0).lastChild.defaultValue,fe.innerHTML="<option></option>",g.option=!!fe.lastChild;var xe={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function be(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&R(e,t)?S.merge([e],n):n}function we(e,t){for(var n=0,r=e.length;n<r;n++)Z.set(e[n],"globalEval",!t||Z.get(t[n],"globalEval"))}xe.tbody=xe.tfoot=xe.colgroup=xe.caption=xe.thead,xe.th=xe.td,g.option||(xe.optgroup=xe.option=[1,"<select multiple='multiple'>","</select>"]);var _e=/<|&#?\w+;/;function Me(e,t,n,r,i){for(var a,o,s,l,u,c,d=t.createDocumentFragment(),h=[],p=0,f=e.length;p<f;p++)if((a=e[p])||0===a)if("object"===_(a))S.merge(h,a.nodeType?[a]:a);else if(_e.test(a)){for(o=o||d.appendChild(t.createElement("div")),s=(ve.exec(a)||["",""])[1].toLowerCase(),l=xe[s]||xe._default,o.innerHTML=l[1]+S.htmlPrefilter(a)+l[2],c=l[0];c--;)o=o.lastChild;S.merge(h,o.childNodes),(o=d.firstChild).textContent=""}else h.push(t.createTextNode(a));for(d.textContent="",p=0;a=h[p++];)if(r&&S.inArray(a,r)>-1)i&&i.push(a);else if(u=se(a),o=be(d.appendChild(a),"script"),u&&we(o),n)for(c=0;a=o[c++];)ye.test(a.type||"")&&n.push(a);return d}var Se=/^([^.]*)(?:\.(.+)|)/;function Ae(){return!0}function Ee(){return!1}function Ce(e,t){return e===function(){try{return x.activeElement}catch(e){}}()==("focus"===t)}function Te(e,t,n,r,i,a){var o,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Te(e,s,n,r,t[s],a);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===a&&(o=i,i=function(e){return S().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=S.guid++)),e.each((function(){S.event.add(this,t,i,r,n)}))}function Be(e,t,n){n?(Z.set(e,t,!1),S.event.add(e,t,{namespace:!1,handler:function(e){var r,i,a=Z.get(this,t);if(1&e.isTrigger&&this[t]){if(a.length)(S.event.special[t]||{}).delegateType&&e.stopPropagation();else if(a=s.call(arguments),Z.set(this,t,a),r=n(this,t),this[t](),a!==(i=Z.get(this,t))||r?Z.set(this,t,!1):i={},a!==i)return e.stopImmediatePropagation(),e.preventDefault(),i&&i.value}else a.length&&(Z.set(this,t,{value:S.event.trigger(S.extend(a[0],S.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Z.get(e,t)&&S.event.add(e,t,Ae)}S.event={global:{},add:function(e,t,n,r,i){var a,o,s,l,u,c,d,h,p,f,m,g=Z.get(e);if(Q(e))for(n.handler&&(n=(a=n).handler,i=a.selector),i&&S.find.matchesSelector(oe,i),n.guid||(n.guid=S.guid++),(l=g.events)||(l=g.events=Object.create(null)),(o=g.handle)||(o=g.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(O)||[""]).length;u--;)p=m=(s=Se.exec(t[u])||[])[1],f=(s[2]||"").split(".").sort(),p&&(d=S.event.special[p]||{},p=(i?d.delegateType:d.bindType)||p,d=S.event.special[p]||{},c=S.extend({type:p,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:f.join(".")},a),(h=l[p])||((h=l[p]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,f,o)||e.addEventListener&&e.addEventListener(p,o)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,c):h.push(c),S.event.global[p]=!0)},remove:function(e,t,n,r,i){var a,o,s,l,u,c,d,h,p,f,m,g=Z.hasData(e)&&Z.get(e);if(g&&(l=g.events)){for(u=(t=(t||"").match(O)||[""]).length;u--;)if(p=m=(s=Se.exec(t[u])||[])[1],f=(s[2]||"").split(".").sort(),p){for(d=S.event.special[p]||{},h=l[p=(r?d.delegateType:d.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=a=h.length;a--;)c=h[a],!i&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(h.splice(a,1),c.selector&&h.delegateCount--,d.remove&&d.remove.call(e,c));o&&!h.length&&(d.teardown&&!1!==d.teardown.call(e,f,g.handle)||S.removeEvent(e,p,g.handle),delete l[p])}else for(p in l)S.event.remove(e,p+t[u],n,r,!0);S.isEmptyObject(l)&&Z.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,a,o,s=new Array(arguments.length),l=S.event.fix(e),u=(Z.get(this,"events")||Object.create(null))[l.type]||[],c=S.event.special[l.type]||{};for(s[0]=l,t=1;t<arguments.length;t++)s[t]=arguments[t];if(l.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,l)){for(o=S.event.handlers.call(this,l,u),t=0;(i=o[t++])&&!l.isPropagationStopped();)for(l.currentTarget=i.elem,n=0;(a=i.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==a.namespace&&!l.rnamespace.test(a.namespace)||(l.handleObj=a,l.data=a.data,void 0!==(r=((S.event.special[a.origType]||{}).handle||a.handler).apply(i.elem,s))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,l),l.result}},handlers:function(e,t){var n,r,i,a,o,s=[],l=t.delegateCount,u=e.target;if(l&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(a=[],o={},n=0;n<l;n++)void 0===o[i=(r=t[n]).selector+" "]&&(o[i]=r.needsContext?S(i,this).index(u)>-1:S.find(i,this,null,[u]).length),o[i]&&a.push(r);a.length&&s.push({elem:u,handlers:a})}return u=this,l<t.length&&s.push({elem:u,handlers:t.slice(l)}),s},addProp:function(e,t){Object.defineProperty(S.Event.prototype,e,{enumerable:!0,configurable:!0,get:v(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return ge.test(t.type)&&t.click&&R(t,"input")&&Be(t,"click",Ae),!1},trigger:function(e){var t=this||e;return ge.test(t.type)&&t.click&&R(t,"input")&&Be(t,"click"),!0},_default:function(e){var t=e.target;return ge.test(t.type)&&t.click&&R(t,"input")&&Z.get(t,"click")||R(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ae:Ee,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ee,isPropagationStopped:Ee,isImmediatePropagationStopped:Ee,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ae,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ae,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ae,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},(function(e,t){S.event.special[e]={setup:function(){return Be(this,e,Ce),!1},trigger:function(){return Be(this,e),!0},_default:function(){return!0},delegateType:t}})),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){S.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,a=e.handleObj;return i&&(i===r||S.contains(r,i))||(e.type=a.origType,n=a.handler.apply(this,arguments),e.type=t),n}}})),S.fn.extend({on:function(e,t,n,r){return Te(this,e,t,n,r)},one:function(e,t,n,r){return Te(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ee),this.each((function(){S.event.remove(this,e,n,t)}))}});var Re=/<script|<style|<link/i,Le=/checked\s*(?:[^=]|=\s*.checked.)/i,Pe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function De(e,t){return R(e,"table")&&R(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Fe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function ke(e,t){var n,r,i,a,o,s;if(1===t.nodeType){if(Z.hasData(e)&&(s=Z.get(e).events))for(i in Z.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);$.hasData(e)&&(a=$.access(e),o=S.extend({},a),$.set(t,o))}}function Ne(e,t){var n=t.nodeName.toLowerCase();"input"===n&&ge.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Oe(e,t,n,r){t=l(t);var i,a,o,s,u,c,d=0,h=e.length,p=h-1,f=t[0],m=v(f);if(m||h>1&&"string"==typeof f&&!g.checkClone&&Le.test(f))return e.each((function(i){var a=e.eq(i);m&&(t[0]=f.call(this,i,a.html())),Oe(a,t,n,r)}));if(h&&(a=(i=Me(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=a),a||r)){for(s=(o=S.map(be(i,"script"),Ie)).length;d<h;d++)u=i,d!==p&&(u=S.clone(u,!0,!0),s&&S.merge(o,be(u,"script"))),n.call(e[d],u,d);if(s)for(c=o[o.length-1].ownerDocument,S.map(o,Fe),d=0;d<s;d++)u=o[d],ye.test(u.type||"")&&!Z.access(u,"globalEval")&&S.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):w(u.textContent.replace(Pe,""),u,c))}return e}function He(e,t,n){for(var r,i=t?S.filter(t,e):e,a=0;null!=(r=i[a]);a++)n||1!==r.nodeType||S.cleanData(be(r)),r.parentNode&&(n&&se(r)&&we(be(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,a,o,s=e.cloneNode(!0),l=se(e);if(!(g.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(o=be(s),r=0,i=(a=be(e)).length;r<i;r++)Ne(a[r],o[r]);if(t)if(n)for(a=a||be(e),o=o||be(s),r=0,i=a.length;r<i;r++)ke(a[r],o[r]);else ke(e,s);return(o=be(s,"script")).length>0&&we(o,!l&&be(e,"script")),s},cleanData:function(e){for(var t,n,r,i=S.event.special,a=0;void 0!==(n=e[a]);a++)if(Q(n)){if(t=n[Z.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Z.expando]=void 0}n[$.expando]&&(n[$.expando]=void 0)}}}),S.fn.extend({detach:function(e){return He(this,e,!0)},remove:function(e){return He(this,e)},text:function(e){return j(this,(function(e){return void 0===e?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Oe(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||De(this,e).appendChild(e)}))},prepend:function(){return Oe(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=De(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Oe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Oe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(be(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return S.clone(this,e,t)}))},html:function(e){return j(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Re.test(e)&&!xe[(ve.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(be(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return Oe(this,arguments,(function(t){var n=this.parentNode;S.inArray(this,e)<0&&(S.cleanData(be(this)),n&&n.replaceChild(t,this))}),e)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){S.fn[e]=function(e){for(var n,r=[],i=S(e),a=i.length-1,o=0;o<=a;o++)n=o===a?this:this.clone(!0),S(i[o])[t](n),u.apply(r,n.get());return this.pushStack(r)}}));var Ue=new RegExp("^("+re+")(?!px)[a-z%]+$","i"),Ge=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=r),t.getComputedStyle(e)},ze=function(e,t,n){var r,i,a={};for(i in t)a[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=a[i];return r},We=new RegExp(ae.join("|"),"i");function Ve(e,t,n){var r,i,a,o,s=e.style;return(n=n||Ge(e))&&(""!==(o=n.getPropertyValue(t)||n[t])||se(e)||(o=S.style(e,t)),!g.pixelBoxStyles()&&Ue.test(o)&&We.test(t)&&(r=s.width,i=s.minWidth,a=s.maxWidth,s.minWidth=s.maxWidth=s.width=o,o=n.width,s.width=r,s.minWidth=i,s.maxWidth=a)),void 0!==o?o+"":o}function je(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",oe.appendChild(u).appendChild(c);var e=r.getComputedStyle(c);n="1%"!==e.top,l=12===t(e.marginLeft),c.style.right="60%",o=36===t(e.right),i=36===t(e.width),c.style.position="absolute",a=12===t(c.offsetWidth/3),oe.removeChild(u),c=null}}function t(e){return Math.round(parseFloat(e))}var n,i,a,o,s,l,u=x.createElement("div"),c=x.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===c.style.backgroundClip,S.extend(g,{boxSizingReliable:function(){return e(),i},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),l},scrollboxSize:function(){return e(),a},reliableTrDimensions:function(){var e,t,n,i;return null==s&&(e=x.createElement("table"),t=x.createElement("tr"),n=x.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",oe.appendChild(e).appendChild(t).appendChild(n),i=r.getComputedStyle(t),s=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===t.offsetHeight,oe.removeChild(e)),s}}))}();var Je=["Webkit","Moz","ms"],qe=x.createElement("div").style,Xe={};function Ke(e){var t=S.cssProps[e]||Xe[e];return t||(e in qe?e:Xe[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=Je.length;n--;)if((e=Je[n]+t)in qe)return e}(e)||e)}var Qe=/^(none|table(?!-c[ea]).+)/,Ye=/^--/,Ze={position:"absolute",visibility:"hidden",display:"block"},$e={letterSpacing:"0",fontWeight:"400"};function et(e,t,n){var r=ie.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function tt(e,t,n,r,i,a){var o="width"===t?1:0,s=0,l=0;if(n===(r?"border":"content"))return 0;for(;o<4;o+=2)"margin"===n&&(l+=S.css(e,n+ae[o],!0,i)),r?("content"===n&&(l-=S.css(e,"padding"+ae[o],!0,i)),"margin"!==n&&(l-=S.css(e,"border"+ae[o]+"Width",!0,i))):(l+=S.css(e,"padding"+ae[o],!0,i),"padding"!==n?l+=S.css(e,"border"+ae[o]+"Width",!0,i):s+=S.css(e,"border"+ae[o]+"Width",!0,i));return!r&&a>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-a-l-s-.5))||0),l}function nt(e,t,n){var r=Ge(e),i=(!g.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),a=i,o=Ve(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Ue.test(o)){if(!n)return o;o="auto"}return(!g.boxSizingReliable()&&i||!g.reliableTrDimensions()&&R(e,"tr")||"auto"===o||!parseFloat(o)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(a=s in e)&&(o=e[s])),(o=parseFloat(o)||0)+tt(e,t,n||(i?"border":"content"),a,r,o)+"px"}function rt(e,t,n,r,i){return new rt.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ve(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,a,o,s=K(t),l=Ye.test(t),u=e.style;if(l||(t=Ke(s)),o=S.cssHooks[t]||S.cssHooks[s],void 0===n)return o&&"get"in o&&void 0!==(i=o.get(e,!1,r))?i:u[t];"string"===(a=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ce(e,t,i),a="number"),null!=n&&n==n&&("number"!==a||l||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),g.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),o&&"set"in o&&void 0===(n=o.set(e,n,r))||(l?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var i,a,o,s=K(t);return Ye.test(t)||(t=Ke(s)),(o=S.cssHooks[t]||S.cssHooks[s])&&"get"in o&&(i=o.get(e,!0,n)),void 0===i&&(i=Ve(e,t,r)),"normal"===i&&t in $e&&(i=$e[t]),""===n||n?(a=parseFloat(i),!0===n||isFinite(a)?a||0:i):i}}),S.each(["height","width"],(function(e,t){S.cssHooks[t]={get:function(e,n,r){if(n)return!Qe.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?nt(e,t,r):ze(e,Ze,(function(){return nt(e,t,r)}))},set:function(e,n,r){var i,a=Ge(e),o=!g.scrollboxSize()&&"absolute"===a.position,s=(o||r)&&"border-box"===S.css(e,"boxSizing",!1,a),l=r?tt(e,t,r,s,a):0;return s&&o&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(a[t])-tt(e,t,"border",!1,a)-.5)),l&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=S.css(e,t)),et(0,n,l)}}})),S.cssHooks.marginLeft=je(g.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Ve(e,"marginLeft"))||e.getBoundingClientRect().left-ze(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(e,t){S.cssHooks[e+t]={expand:function(n){for(var r=0,i={},a="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+ae[r]+t]=a[r]||a[r-2]||a[0];return i}},"margin"!==e&&(S.cssHooks[e+t].set=et)})),S.fn.extend({css:function(e,t){return j(this,(function(e,t,n){var r,i,a={},o=0;if(Array.isArray(t)){for(r=Ge(e),i=t.length;o<i;o++)a[t[o]]=S.css(e,t[o],!1,r);return a}return void 0!==n?S.style(e,t,n):S.css(e,t)}),e,t,arguments.length>1)}}),S.Tween=rt,rt.prototype={constructor:rt,init:function(e,t,n,r,i,a){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=a||(S.cssNumber[n]?"":"px")},cur:function(){var e=rt.propHooks[this.prop];return e&&e.get?e.get(this):rt.propHooks._default.get(this)},run:function(e){var t,n=rt.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rt.propHooks._default.set(this),this}},rt.prototype.init.prototype=rt.prototype,rt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Ke(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}},rt.propHooks.scrollTop=rt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=rt.prototype.init,S.fx.step={};var it,at,ot=/^(?:toggle|show|hide)$/,st=/queueHooks$/;function lt(){at&&(!1===x.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(lt):r.setTimeout(lt,S.fx.interval),S.fx.tick())}function ut(){return r.setTimeout((function(){it=void 0})),it=Date.now()}function ct(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ae[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function dt(e,t,n){for(var r,i=(ht.tweeners[t]||[]).concat(ht.tweeners["*"]),a=0,o=i.length;a<o;a++)if(r=i[a].call(n,t,e))return r}function ht(e,t,n){var r,i,a=0,o=ht.prefilters.length,s=S.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var t=it||ut(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),a=0,o=u.tweens.length;a<o;a++)u.tweens[a].run(r);return s.notifyWith(e,[u,r,n]),r<1&&o?n:(o||s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:S.extend({},t),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},n),originalProperties:t,originalOptions:n,startTime:it||ut(),duration:n.duration,tweens:[],createTween:function(t,n){var r=S.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)u.tweens[n].run(1);return t?(s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u,t])):s.rejectWith(e,[u,t]),this}}),c=u.props;for(!function(e,t){var n,r,i,a,o;for(n in e)if(i=t[r=K(n)],a=e[n],Array.isArray(a)&&(i=a[1],a=e[n]=a[0]),n!==r&&(e[r]=a,delete e[n]),(o=S.cssHooks[r])&&"expand"in o)for(n in a=o.expand(a),delete e[r],a)n in e||(e[n]=a[n],t[n]=i);else t[r]=i}(c,u.opts.specialEasing);a<o;a++)if(r=ht.prefilters[a].call(u,e,c,u.opts))return v(r.stop)&&(S._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return S.map(c,dt,u),v(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),S.fx.timer(S.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u}S.Animation=S.extend(ht,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ce(n.elem,e,ie.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(O);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ht.tweeners[n]=ht.tweeners[n]||[],ht.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,a,o,s,l,u,c,d="width"in t||"height"in t,h=this,p={},f=e.style,m=e.nodeType&&ue(e),g=Z.get(e,"fxshow");for(r in n.queue||(null==(o=S._queueHooks(e,"fx")).unqueued&&(o.unqueued=0,s=o.empty.fire,o.empty.fire=function(){o.unqueued||s()}),o.unqueued++,h.always((function(){h.always((function(){o.unqueued--,S.queue(e,"fx").length||o.empty.fire()}))}))),t)if(i=t[r],ot.test(i)){if(delete t[r],a=a||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;m=!0}p[r]=g&&g[r]||S.style(e,r)}if((l=!S.isEmptyObject(t))||!S.isEmptyObject(p))for(r in d&&1===e.nodeType&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],null==(u=g&&g.display)&&(u=Z.get(e,"display")),"none"===(c=S.css(e,"display"))&&(u?c=u:(pe([e],!0),u=e.style.display||u,c=S.css(e,"display"),pe([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===S.css(e,"float")&&(l||(h.done((function(){f.display=u})),null==u&&(c=f.display,u="none"===c?"":c)),f.display="inline-block")),n.overflow&&(f.overflow="hidden",h.always((function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]}))),l=!1,p)l||(g?"hidden"in g&&(m=g.hidden):g=Z.access(e,"fxshow",{display:u}),a&&(g.hidden=!m),m&&pe([e],!0),h.done((function(){for(r in m||pe([e]),Z.remove(e,"fxshow"),p)S.style(e,r,p[r])}))),l=dt(m?g[r]:0,r,h),r in g||(g[r]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?ht.prefilters.unshift(e):ht.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ue).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=S.isEmptyObject(e),a=S.speed(t,n,r),o=function(){var t=ht(this,S.extend({},e),a);(i||Z.get(this,"finish"))&&t.stop(!0)};return o.finish=o,i||!1===a.queue?this.each(o):this.queue(a.queue,o)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",a=S.timers,o=Z.get(this);if(i)o[i]&&o[i].stop&&r(o[i]);else for(i in o)o[i]&&o[i].stop&&st.test(i)&&r(o[i]);for(i=a.length;i--;)a[i].elem!==this||null!=e&&a[i].queue!==e||(a[i].anim.stop(n),t=!1,a.splice(i,1));!t&&n||S.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=Z.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],a=S.timers,o=r?r.length:0;for(n.finish=!0,S.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=a.length;t--;)a[t].elem===this&&a[t].queue===e&&(a[t].anim.stop(!0),a.splice(t,1));for(t=0;t<o;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),S.each(["toggle","show","hide"],(function(e,t){var n=S.fn[t];S.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ct(t,!0),e,r,i)}})),S.each({slideDown:ct("show"),slideUp:ct("hide"),slideToggle:ct("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){S.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(it=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),it=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){at||(at=!0,lt())},S.fx.stop=function(){at=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(e,t){return e=S.fx&&S.fx.speeds[e]||e,t=t||"fx",this.queue(t,(function(t,n){var i=r.setTimeout(t,e);n.stop=function(){r.clearTimeout(i)}}))},function(){var e=x.createElement("input"),t=x.createElement("select").appendChild(x.createElement("option"));e.type="checkbox",g.checkOn=""!==e.value,g.optSelected=t.selected,(e=x.createElement("input")).value="t",e.type="radio",g.radioValue="t"===e.value}();var pt,ft=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return j(this,S.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){S.removeAttr(this,e)}))}}),S.extend({attr:function(e,t,n){var r,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===e.getAttribute?S.prop(e,t,n):(1===a&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&R(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(O);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=ft[t]||S.find.attr;ft[t]=function(e,t,r){var i,a,o=t.toLowerCase();return r||(a=ft[o],ft[o]=i,i=null!=n(e,t,r)?o:null,ft[o]=a),i}}));var mt=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function vt(e){return(e.match(O)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(O)||[]}S.fn.extend({prop:function(e,t){return j(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[S.propFix[e]||e]}))}}),S.extend({prop:function(e,t,n){var r,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):mt.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(e){var t,n,r,i,a,o,s,l=0;if(v(e))return this.each((function(t){S(this).addClass(e.call(this,t,yt(this)))}));if((t=xt(e)).length)for(;n=this[l++];)if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){for(o=0;a=t[o++];)r.indexOf(" "+a+" ")<0&&(r+=a+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,a,o,s,l=0;if(v(e))return this.each((function(t){S(this).removeClass(e.call(this,t,yt(this)))}));if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)for(;n=this[l++];)if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){for(o=0;a=t[o++];)for(;r.indexOf(" "+a+" ")>-1;)r=r.replace(" "+a+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):v(e)?this.each((function(n){S(this).toggleClass(e.call(this,n,yt(this),t),t)})):this.each((function(){var t,i,a,o;if(r)for(i=0,a=S(this),o=xt(e);t=o[i++];)a.hasClass(t)?a.removeClass(t):a.addClass(t);else void 0!==e&&"boolean"!==n||((t=yt(this))&&Z.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Z.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+vt(yt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;S.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=v(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,S(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=S.map(i,(function(e){return null==e?"":e+""}))),(t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=S.valHooks[i.type]||S.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:vt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,a=e.selectedIndex,o="select-one"===e.type,s=o?null:[],l=o?a+1:i.length;for(r=a<0?l:o?a:0;r<l;r++)if(((n=i[r]).selected||r===a)&&!n.disabled&&(!n.parentNode.disabled||!R(n.parentNode,"optgroup"))){if(t=S(n).val(),o)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,a=S.makeArray(t),o=i.length;o--;)((r=i[o]).selected=S.inArray(S.valHooks.option.get(r),a)>-1)&&(n=!0);return n||(e.selectedIndex=-1),a}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},g.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),g.focusin="onfocusin"in r;var wt=/^(?:focusinfocus|focusoutblur)$/,_t=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,i){var a,o,s,l,u,c,d,h,f=[n||x],m=p.call(e,"type")?e.type:e,g=p.call(e,"namespace")?e.namespace.split("."):[];if(o=h=s=n=n||x,3!==n.nodeType&&8!==n.nodeType&&!wt.test(m+S.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),u=m.indexOf(":")<0&&"on"+m,(e=e[S.expando]?e:new S.Event(m,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),d=S.event.special[m]||{},i||!d.trigger||!1!==d.trigger.apply(n,t))){if(!i&&!d.noBubble&&!y(n)){for(l=d.delegateType||m,wt.test(l+m)||(o=o.parentNode);o;o=o.parentNode)f.push(o),s=o;s===(n.ownerDocument||x)&&f.push(s.defaultView||s.parentWindow||r)}for(a=0;(o=f[a++])&&!e.isPropagationStopped();)h=o,e.type=a>1?l:d.bindType||m,(c=(Z.get(o,"events")||Object.create(null))[e.type]&&Z.get(o,"handle"))&&c.apply(o,t),(c=u&&o[u])&&c.apply&&Q(o)&&(e.result=c.apply(o,t),!1===e.result&&e.preventDefault());return e.type=m,i||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(f.pop(),t)||!Q(n)||u&&v(n[m])&&!y(n)&&((s=n[u])&&(n[u]=null),S.event.triggered=m,e.isPropagationStopped()&&h.addEventListener(m,_t),n[m](),e.isPropagationStopped()&&h.removeEventListener(m,_t),S.event.triggered=void 0,s&&(n[u]=s)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each((function(){S.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),g.focusin||S.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){S.event.simulate(t,e.target,S.event.fix(e))};S.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=Z.access(r,t);i||r.addEventListener(e,n,!0),Z.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=Z.access(r,t)-1;i?Z.access(r,t,i):(r.removeEventListener(e,n,!0),Z.remove(r,t))}}}));var Mt=r.location,St={guid:Date.now()},At=/\?/;S.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,(function(e){return e.textContent})).join("\n"):e)),t};var Et=/\[\]$/,Ct=/\r?\n/g,Tt=/^(?:submit|button|image|reset|file)$/i,Bt=/^(?:input|select|textarea|keygen)/i;function Rt(e,t,n,r){var i;if(Array.isArray(t))S.each(t,(function(t,i){n||Et.test(e)?r(e,i):Rt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==_(t))r(e,t);else for(i in t)Rt(e+"["+i+"]",t[i],n,r)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,(function(){i(this.name,this.value)}));else for(n in e)Rt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Bt.test(this.nodeName)&&!Tt.test(e)&&(this.checked||!ge.test(e))})).map((function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,(function(e){return{name:t.name,value:e.replace(Ct,"\r\n")}})):{name:t.name,value:n.replace(Ct,"\r\n")}})).get()}});var Lt=/%20/g,Pt=/#.*$/,Dt=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ft=/^(?:GET|HEAD)$/,kt=/^\/\//,Nt={},Ot={},Ht="*/".concat("*"),Ut=x.createElement("a");function Gt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,a=t.toLowerCase().match(O)||[];if(v(n))for(;r=a[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function zt(e,t,n,r){var i={},a=e===Ot;function o(s){var l;return i[s]=!0,S.each(e[s]||[],(function(e,s){var u=s(t,n,r);return"string"!=typeof u||a||i[u]?a?!(l=u):void 0:(t.dataTypes.unshift(u),o(u),!1)})),l}return o(t.dataTypes[0])||!i["*"]&&o("*")}function Wt(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Ut.href=Mt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Mt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Mt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ht,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Wt(Wt(e,S.ajaxSettings),t):Wt(S.ajaxSettings,e)},ajaxPrefilter:Gt(Nt),ajaxTransport:Gt(Ot),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,i,a,o,s,l,u,c,d,h,p=S.ajaxSetup({},t),f=p.context||p,m=p.context&&(f.nodeType||f.jquery)?S(f):S.event,g=S.Deferred(),v=S.Callbacks("once memory"),y=p.statusCode||{},b={},w={},_="canceled",M={readyState:0,getResponseHeader:function(e){var t;if(u){if(!o)for(o={};t=It.exec(a);)o[t[1].toLowerCase()+" "]=(o[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=o[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?a:null},setRequestHeader:function(e,t){return null==u&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==u&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)M.always(e[M.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||_;return n&&n.abort(t),A(0,t),this}};if(g.promise(M),p.url=((e||p.url||Mt.href)+"").replace(kt,Mt.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(O)||[""],null==p.crossDomain){l=x.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Ut.protocol+"//"+Ut.host!=l.protocol+"//"+l.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=S.param(p.data,p.traditional)),zt(Nt,p,t,M),u)return M;for(d in(c=S.event&&p.global)&&0==S.active++&&S.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ft.test(p.type),i=p.url.replace(Pt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Lt,"+")):(h=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(At.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(Dt,"$1"),h=(At.test(i)?"&":"?")+"_="+St.guid+++h),p.url=i+h),p.ifModified&&(S.lastModified[i]&&M.setRequestHeader("If-Modified-Since",S.lastModified[i]),S.etag[i]&&M.setRequestHeader("If-None-Match",S.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||t.contentType)&&M.setRequestHeader("Content-Type",p.contentType),M.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Ht+"; q=0.01":""):p.accepts["*"]),p.headers)M.setRequestHeader(d,p.headers[d]);if(p.beforeSend&&(!1===p.beforeSend.call(f,M,p)||u))return M.abort();if(_="abort",v.add(p.complete),M.done(p.success),M.fail(p.error),n=zt(Ot,p,t,M)){if(M.readyState=1,c&&m.trigger("ajaxSend",[M,p]),u)return M;p.async&&p.timeout>0&&(s=r.setTimeout((function(){M.abort("timeout")}),p.timeout));try{u=!1,n.send(b,A)}catch(e){if(u)throw e;A(-1,e)}}else A(-1,"No Transport");function A(e,t,o,l){var d,h,x,b,w,_=t;u||(u=!0,s&&r.clearTimeout(s),n=void 0,a=l||"",M.readyState=e>0?4:0,d=e>=200&&e<300||304===e,o&&(b=function(e,t,n){for(var r,i,a,o,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)a=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){a=i;break}o||(o=i)}a=a||o}if(a)return a!==l[0]&&l.unshift(a),n[a]}(p,M,o)),!d&&S.inArray("script",p.dataTypes)>-1&&S.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),b=function(e,t,n,r){var i,a,o,s,l,u={},c=e.dataTypes.slice();if(c[1])for(o in e.converters)u[o.toLowerCase()]=e.converters[o];for(a=c.shift();a;)if(e.responseFields[a]&&(n[e.responseFields[a]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=a,a=c.shift())if("*"===a)a=l;else if("*"!==l&&l!==a){if(!(o=u[l+" "+a]||u["* "+a]))for(i in u)if((s=i.split(" "))[1]===a&&(o=u[l+" "+s[0]]||u["* "+s[0]])){!0===o?o=u[i]:!0!==u[i]&&(a=s[0],c.unshift(s[1]));break}if(!0!==o)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:"parsererror",error:o?e:"No conversion from "+l+" to "+a}}}return{state:"success",data:t}}(p,b,M,d),d?(p.ifModified&&((w=M.getResponseHeader("Last-Modified"))&&(S.lastModified[i]=w),(w=M.getResponseHeader("etag"))&&(S.etag[i]=w)),204===e||"HEAD"===p.type?_="nocontent":304===e?_="notmodified":(_=b.state,h=b.data,d=!(x=b.error))):(x=_,!e&&_||(_="error",e<0&&(e=0))),M.status=e,M.statusText=(t||_)+"",d?g.resolveWith(f,[h,_,M]):g.rejectWith(f,[M,_,x]),M.statusCode(y),y=void 0,c&&m.trigger(d?"ajaxSuccess":"ajaxError",[M,p,d?h:x]),v.fireWith(f,[M,_]),c&&(m.trigger("ajaxComplete",[M,p]),--S.active||S.event.trigger("ajaxStop")))}return M},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],(function(e,t){S[t]=function(e,n,r,i){return v(n)&&(i=i||r,r=n,n=void 0),S.ajax(S.extend({url:e,type:t,dataType:i,data:n,success:r},S.isPlainObject(e)&&e))}})),S.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return v(e)?this.each((function(t){S(this).wrapInner(e.call(this,t))})):this.each((function(){var t=S(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=v(e);return this.each((function(n){S(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},jt=S.ajaxSettings.xhr();g.cors=!!jt&&"withCredentials"in jt,g.ajax=jt=!!jt,S.ajaxTransport((function(e){var t,n;if(g.cors||jt&&!e.crossDomain)return{send:function(i,a){var o,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)s[o]=e.xhrFields[o];for(o in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(o,i[o]);t=function(e){return function(){t&&(t=n=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?a(0,"error"):a(s.status,s.statusText):a(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),n=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&r.setTimeout((function(){t&&n()}))},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),S.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),S.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=S("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),x.head.appendChild(t[0])},abort:function(){n&&n()}}}));var Jt,qt=[],Xt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=qt.pop()||S.expando+"_"+St.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",(function(e,t,n){var i,a,o,s=!1!==e.jsonp&&(Xt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Xt.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Xt,"$1"+i):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return o||S.error(i+" was not called"),o[0]},e.dataTypes[0]="json",a=r[i],r[i]=function(){o=arguments},n.always((function(){void 0===a?S(r).removeProp(i):r[i]=a,e[i]&&(e.jsonpCallback=t.jsonpCallback,qt.push(i)),o&&v(a)&&a(o[0]),o=a=void 0})),"script"})),g.createHTMLDocument=((Jt=x.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Jt.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(g.createHTMLDocument?((r=(t=x.implementation.createHTMLDocument("")).createElement("base")).href=x.location.href,t.head.appendChild(r)):t=x),a=!n&&[],(i=L.exec(e))?[t.createElement(i[1])]:(i=Me([e],t,a),a&&a.length&&S(a).remove(),S.merge([],i.childNodes)));var r,i,a},S.fn.load=function(e,t,n){var r,i,a,o=this,s=e.indexOf(" ");return s>-1&&(r=vt(e.slice(s)),e=e.slice(0,s)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),o.length>0&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){a=arguments,o.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)})).always(n&&function(e,t){o.each((function(){n.apply(this,a||[e.responseText,t,e])}))}),this},S.expr.pseudos.animated=function(e){return S.grep(S.timers,(function(t){return e===t.elem})).length},S.offset={setOffset:function(e,t,n){var r,i,a,o,s,l,u=S.css(e,"position"),c=S(e),d={};"static"===u&&(e.style.position="relative"),s=c.offset(),a=S.css(e,"top"),l=S.css(e,"left"),("absolute"===u||"fixed"===u)&&(a+l).indexOf("auto")>-1?(o=(r=c.position()).top,i=r.left):(o=parseFloat(a)||0,i=parseFloat(l)||0),v(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(d.top=t.top-s.top+o),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):c.css(d)}},S.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){S.offset.setOffset(this,e,t)}));var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||oe}))}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;S.fn[e]=function(r){return j(this,(function(e,r,i){var a;if(y(e)?a=e:9===e.nodeType&&(a=e.defaultView),void 0===i)return a?a[t]:e[r];a?a.scrollTo(n?a.pageXOffset:i,n?i:a.pageYOffset):e[r]=i}),e,r,arguments.length)}})),S.each(["top","left"],(function(e,t){S.cssHooks[t]=je(g.pixelPosition,(function(e,n){if(n)return n=Ve(e,t),Ue.test(n)?S(e).position()[t]+"px":n}))})),S.each({Height:"height",Width:"width"},(function(e,t){S.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){S.fn[r]=function(i,a){var o=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===a?"margin":"border");return j(this,(function(t,n,i){var a;return y(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(a=t.documentElement,Math.max(t.body["scroll"+e],a["scroll"+e],t.body["offset"+e],a["offset"+e],a["client"+e])):void 0===i?S.css(t,n,s):S.style(t,n,i,s)}),t,o?i:void 0,o)}}))})),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){S.fn[t]=function(e){return this.on(t,e)}})),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){S.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}));var Kt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return r=s.call(arguments,2),i=function(){return e.apply(t||this,r.concat(s.call(arguments)))},i.guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=R,S.isFunction=v,S.isWindow=y,S.camelCase=K,S.type=_,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Kt,"")},void 0===(n=function(){return S}.apply(t,[]))||(e.exports=n);var Qt=r.jQuery,Yt=r.$;return S.noConflict=function(e){return r.$===S&&(r.$=Yt),e&&r.jQuery===S&&(r.jQuery=Qt),S},void 0===i&&(r.jQuery=r.$=S),S}))},4155:e=>{var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var s,l=[],u=!1,c=-1;function d(){u&&s&&(u=!1,s.length?l=s.concat(l):c=-1,l.length&&h())}function h(){if(!u){var e=o(d);u=!0;for(var t=l.length;t;){for(s=l,l=[];++c<t;)s&&s[c].run();c=-1,t=l.length}s=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function f(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new p(e,t)),1!==l.length||u||o(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=f,r.addListener=f,r.once=f,r.off=f,r.removeListener=f,r.removeAllListeners=f,r.emit=f,r.prependListener=f,r.prependOnceListener=f,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},2703:(e,t,n)=>{"use strict";var r=n(414);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4448:(e,t,n)=>{"use strict";var r=n(7294),i=n(4142);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,s={};function l(e,t){u(e,t),u(e+"Capture",t)}function u(e,t){for(s[e]=t,e=0;e<t.length;e++)o.add(t[e])}var c=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),d=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},f={};function m(e,t,n,r,i,a,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new m(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}function x(e,t,n,r){var i=g.hasOwnProperty(t)?g[t]:null;(null!==i?0!==i.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!d.call(f,e)||!d.call(p,e)&&(h.test(e)?f[e]=!0:(p[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)}));var b=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),_=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),C=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),P=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var D=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var I=Symbol.iterator;function F(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=I&&e[I]||e["@@iterator"])?e:null}var k,N=Object.assign;function O(e){if(void 0===k)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);k=t&&t[1]||""}return"\n"+k+e}var H=!1;function U(e,t){if(!e||H)return"";H=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),a=r.stack.split("\n"),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(1!==o||1!==s)do{if(o--,0>--s||i[o]!==a[s]){var l="\n"+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=o&&0<=s);break}}}finally{H=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?O(e):""}function G(e){switch(e.tag){case 5:return O(e.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return e=U(e.type,!1);case 11:return e=U(e.type.render,!1);case 1:return e=U(e.type,!0);default:return""}}function z(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case M:return"Fragment";case _:return"Portal";case A:return"Profiler";case S:return"StrictMode";case B:return"Suspense";case R:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case C:return(e.displayName||"Context")+".Consumer";case E:return(e._context.displayName||"Context")+".Provider";case T:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case L:return null!==(t=e.displayName||null)?t:z(e.type)||"Memo";case P:t=e._payload,e=e._init;try{return z(e(t))}catch(e){}}return null}function W(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return z(t);case 8:return t===S?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function V(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function j(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function J(e){e._valueTracker||(e._valueTracker=function(e){var t=j(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=j(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function X(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function K(e,t){var n=t.checked;return N({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Q(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=V(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Y(e,t){null!=(t=t.checked)&&x(e,"checked",t,!1)}function Z(e,t){Y(e,t);var n=V(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,V(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function $(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&X(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+V(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function re(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return N({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ie(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(te(n)){if(1<n.length)throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:V(n)}}function ae(e,t){var n=V(t.value),r=V(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function oe(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function se(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?se(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ue,ce,de=(ce=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ue=ue||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ue.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ce(e,t)}))}:ce);function he(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},fe=["Webkit","ms","Moz","O"];function me(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||pe.hasOwnProperty(e)&&pe[e]?(""+t).trim():t+"px"}function ge(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=me(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(pe).forEach((function(e){fe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pe[t]=pe[e]}))}));var ve=N({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ye(e,t){if(t){if(ve[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(a(62))}}function xe(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var be=null;function we(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var _e=null,Me=null,Se=null;function Ae(e){if(e=xi(e)){if("function"!=typeof _e)throw Error(a(280));var t=e.stateNode;t&&(t=wi(t),_e(e.stateNode,e.type,t))}}function Ee(e){Me?Se?Se.push(e):Se=[e]:Me=e}function Ce(){if(Me){var e=Me,t=Se;if(Se=Me=null,Ae(e),t)for(e=0;e<t.length;e++)Ae(t[e])}}function Te(e,t){return e(t)}function Be(){}var Re=!1;function Le(e,t,n){if(Re)return e(t,n);Re=!0;try{return Te(e,t,n)}finally{Re=!1,(null!==Me||null!==Se)&&(Be(),Ce())}}function Pe(e,t){var n=e.stateNode;if(null===n)return null;var r=wi(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(a(231,t,typeof n));return n}var De=!1;if(c)try{var Ie={};Object.defineProperty(Ie,"passive",{get:function(){De=!0}}),window.addEventListener("test",Ie,Ie),window.removeEventListener("test",Ie,Ie)}catch(ce){De=!1}function Fe(e,t,n,r,i,a,o,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(e){this.onError(e)}}var ke=!1,Ne=null,Oe=!1,He=null,Ue={onError:function(e){ke=!0,Ne=e}};function Ge(e,t,n,r,i,a,o,s,l){ke=!1,Ne=null,Fe.apply(Ue,arguments)}function ze(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function We(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ve(e){if(ze(e)!==e)throw Error(a(188))}function je(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=ze(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return Ve(i),e;if(o===r)return Ve(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e))?Je(e):null}function Je(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Je(e);if(null!==t)return t;e=e.sibling}return null}var qe=i.unstable_scheduleCallback,Xe=i.unstable_cancelCallback,Ke=i.unstable_shouldYield,Qe=i.unstable_requestPaint,Ye=i.unstable_now,Ze=i.unstable_getCurrentPriorityLevel,$e=i.unstable_ImmediatePriority,et=i.unstable_UserBlockingPriority,tt=i.unstable_NormalPriority,nt=i.unstable_LowPriority,rt=i.unstable_IdlePriority,it=null,at=null;var ot=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(st(e)/lt|0)|0},st=Math.log,lt=Math.LN2;var ut=64,ct=4194304;function dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ht(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=268435455&n;if(0!==o){var s=o&~i;0!==s?r=dt(s):0!==(a&=o)&&(r=dt(a))}else 0!==(o=n&~i)?r=dt(o):0!==a&&(r=dt(a));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&i)&&((i=r&-r)>=(a=t&-t)||16===i&&0!=(4194240&a)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-ot(t)),r|=e[n],t&=~i;return r}function pt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function ft(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function mt(){var e=ut;return 0==(4194240&(ut<<=1))&&(ut=64),e}function gt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-ot(t)]=n}function yt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ot(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var xt=0;function bt(e){return 1<(e&=-e)?4<e?0!=(268435455&e)?16:536870912:4:1}var wt,_t,Mt,St,At,Et=!1,Ct=[],Tt=null,Bt=null,Rt=null,Lt=new Map,Pt=new Map,Dt=[],It="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ft(e,t){switch(e){case"focusin":case"focusout":Tt=null;break;case"dragenter":case"dragleave":Bt=null;break;case"mouseover":case"mouseout":Rt=null;break;case"pointerover":case"pointerout":Lt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pt.delete(t.pointerId)}}function kt(e,t,n,r,i,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},null!==t&&(null!==(t=xi(t))&&_t(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Nt(e){var t=yi(e.target);if(null!==t){var n=ze(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=We(n)))return e.blockedOn=t,void At(e.priority,(function(){Mt(n)}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Ot(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Kt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=xi(n))&&_t(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);be=r,n.target.dispatchEvent(r),be=null,t.shift()}return!0}function Ht(e,t,n){Ot(e)&&n.delete(t)}function Ut(){Et=!1,null!==Tt&&Ot(Tt)&&(Tt=null),null!==Bt&&Ot(Bt)&&(Bt=null),null!==Rt&&Ot(Rt)&&(Rt=null),Lt.forEach(Ht),Pt.forEach(Ht)}function Gt(e,t){e.blockedOn===t&&(e.blockedOn=null,Et||(Et=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Ut)))}function zt(e){function t(t){return Gt(t,e)}if(0<Ct.length){Gt(Ct[0],e);for(var n=1;n<Ct.length;n++){var r=Ct[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Tt&&Gt(Tt,e),null!==Bt&&Gt(Bt,e),null!==Rt&&Gt(Rt,e),Lt.forEach(t),Pt.forEach(t),n=0;n<Dt.length;n++)(r=Dt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Dt.length&&null===(n=Dt[0]).blockedOn;)Nt(n),null===n.blockedOn&&Dt.shift()}var Wt=b.ReactCurrentBatchConfig,Vt=!0;function jt(e,t,n,r){var i=xt,a=Wt.transition;Wt.transition=null;try{xt=1,qt(e,t,n,r)}finally{xt=i,Wt.transition=a}}function Jt(e,t,n,r){var i=xt,a=Wt.transition;Wt.transition=null;try{xt=4,qt(e,t,n,r)}finally{xt=i,Wt.transition=a}}function qt(e,t,n,r){if(Vt){var i=Kt(e,t,n,r);if(null===i)Vr(e,t,r,Xt,n),Ft(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return Tt=kt(Tt,e,t,n,r,i),!0;case"dragenter":return Bt=kt(Bt,e,t,n,r,i),!0;case"mouseover":return Rt=kt(Rt,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return Lt.set(a,kt(Lt.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,Pt.set(a,kt(Pt.get(a)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Ft(e,r),4&t&&-1<It.indexOf(e)){for(;null!==i;){var a=xi(i);if(null!==a&&wt(a),null===(a=Kt(e,t,n,r))&&Vr(e,t,r,Xt,n),a===i)break;i=a}null!==i&&r.stopPropagation()}else Vr(e,t,r,null,n)}}var Xt=null;function Kt(e,t,n,r){if(Xt=null,null!==(e=yi(e=we(r))))if(null===(t=ze(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=We(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Xt=e,null}function Qt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ze()){case $e:return 1;case et:return 4;case tt:case nt:return 16;case rt:return 536870912;default:return 16}default:return 16}}var Yt=null,Zt=null,$t=null;function en(){if($t)return $t;var e,t,n=Zt,r=n.length,i="value"in Yt?Yt.value:Yt.textContent,a=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[a-t];t++);return $t=i.slice(e,1<t?1-t:void 0)}function tn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nn(){return!0}function rn(){return!1}function an(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?nn:rn,this.isPropagationStopped=rn,this}return N(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var on,sn,ln,un={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cn=an(un),dn=N({},un,{view:0,detail:0}),hn=an(dn),pn=N({},dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:An,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ln&&(ln&&"mousemove"===e.type?(on=e.screenX-ln.screenX,sn=e.screenY-ln.screenY):sn=on=0,ln=e),on)},movementY:function(e){return"movementY"in e?e.movementY:sn}}),fn=an(pn),mn=an(N({},pn,{dataTransfer:0})),gn=an(N({},dn,{relatedTarget:0})),vn=an(N({},un,{animationName:0,elapsedTime:0,pseudoElement:0})),yn=N({},un,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xn=an(yn),bn=an(N({},un,{data:0})),wn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_n={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Mn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Mn[e])&&!!t[e]}function An(){return Sn}var En=N({},dn,{key:function(e){if(e.key){var t=wn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?_n[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:An,charCode:function(e){return"keypress"===e.type?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Cn=an(En),Tn=an(N({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Bn=an(N({},dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:An})),Rn=an(N({},un,{propertyName:0,elapsedTime:0,pseudoElement:0})),Ln=N({},pn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Pn=an(Ln),Dn=[9,13,27,32],In=c&&"CompositionEvent"in window,Fn=null;c&&"documentMode"in document&&(Fn=document.documentMode);var kn=c&&"TextEvent"in window&&!Fn,Nn=c&&(!In||Fn&&8<Fn&&11>=Fn),On=String.fromCharCode(32),Hn=!1;function Un(e,t){switch(e){case"keyup":return-1!==Dn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var zn=!1;var Wn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Vn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Wn[e.type]:"textarea"===t}function jn(e,t,n,r){Ee(r),0<(t=Jr(t,"onChange")).length&&(n=new cn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Jn=null,qn=null;function Xn(e){Or(e,0)}function Kn(e){if(q(bi(e)))return e}function Qn(e,t){if("change"===e)return t}var Yn=!1;if(c){var Zn;if(c){var $n="oninput"in document;if(!$n){var er=document.createElement("div");er.setAttribute("oninput","return;"),$n="function"==typeof er.oninput}Zn=$n}else Zn=!1;Yn=Zn&&(!document.documentMode||9<document.documentMode)}function tr(){Jn&&(Jn.detachEvent("onpropertychange",nr),qn=Jn=null)}function nr(e){if("value"===e.propertyName&&Kn(qn)){var t=[];jn(t,qn,e,we(e)),Le(Xn,t)}}function rr(e,t,n){"focusin"===e?(tr(),qn=n,(Jn=t).attachEvent("onpropertychange",nr)):"focusout"===e&&tr()}function ir(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Kn(qn)}function ar(e,t){if("click"===e)return Kn(t)}function or(e,t){if("input"===e||"change"===e)return Kn(t)}var sr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function lr(e,t){if(sr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!d.call(t,i)||!sr(e[i],t[i]))return!1}return!0}function ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cr(e,t){var n,r=ur(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ur(r)}}function dr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?dr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function hr(){for(var e=window,t=X();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=X((e=t.contentWindow).document)}return t}function pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function fr(e){var t=hr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dr(n.ownerDocument.documentElement,n)){if(null!==r&&pr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=void 0===r.end?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=cr(n,a);var o=cr(n,r);i&&o&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var mr=c&&"documentMode"in document&&11>=document.documentMode,gr=null,vr=null,yr=null,xr=!1;function br(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;xr||null==gr||gr!==X(r)||("selectionStart"in(r=gr)&&pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},yr&&lr(yr,r)||(yr=r,0<(r=Jr(vr,"onSelect")).length&&(t=new cn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=gr)))}function wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _r={animationend:wr("Animation","AnimationEnd"),animationiteration:wr("Animation","AnimationIteration"),animationstart:wr("Animation","AnimationStart"),transitionend:wr("Transition","TransitionEnd")},Mr={},Sr={};function Ar(e){if(Mr[e])return Mr[e];if(!_r[e])return e;var t,n=_r[e];for(t in n)if(n.hasOwnProperty(t)&&t in Sr)return Mr[e]=n[t];return e}c&&(Sr=document.createElement("div").style,"AnimationEvent"in window||(delete _r.animationend.animation,delete _r.animationiteration.animation,delete _r.animationstart.animation),"TransitionEvent"in window||delete _r.transitionend.transition);var Er=Ar("animationend"),Cr=Ar("animationiteration"),Tr=Ar("animationstart"),Br=Ar("transitionend"),Rr=new Map,Lr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Pr(e,t){Rr.set(e,t),l(t,[e])}for(var Dr=0;Dr<Lr.length;Dr++){var Ir=Lr[Dr];Pr(Ir.toLowerCase(),"on"+(Ir[0].toUpperCase()+Ir.slice(1)))}Pr(Er,"onAnimationEnd"),Pr(Cr,"onAnimationIteration"),Pr(Tr,"onAnimationStart"),Pr("dblclick","onDoubleClick"),Pr("focusin","onFocus"),Pr("focusout","onBlur"),Pr(Br,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),kr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fr));function Nr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,o,s,l,u){if(Ge.apply(this,arguments),ke){if(!ke)throw Error(a(198));var c=Ne;ke=!1,Ne=null,Oe||(Oe=!0,He=c)}}(r,t,void 0,e),e.currentTarget=null}function Or(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==a&&i.isPropagationStopped())break e;Nr(i,s,u),a=l}else for(o=0;o<r.length;o++){if(l=(s=r[o]).instance,u=s.currentTarget,s=s.listener,l!==a&&i.isPropagationStopped())break e;Nr(i,s,u),a=l}}}if(Oe)throw e=He,Oe=!1,He=null,e}function Hr(e,t){var n=t[mi];void 0===n&&(n=t[mi]=new Set);var r=e+"__bubble";n.has(r)||(Wr(t,e,2,!1),n.add(r))}function Ur(e,t,n){var r=0;t&&(r|=4),Wr(n,e,r,t)}var Gr="_reactListening"+Math.random().toString(36).slice(2);function zr(e){if(!e[Gr]){e[Gr]=!0,o.forEach((function(t){"selectionchange"!==t&&(kr.has(t)||Ur(t,!1,e),Ur(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Gr]||(t[Gr]=!0,Ur("selectionchange",!1,t))}}function Wr(e,t,n,r){switch(Qt(t)){case 1:var i=jt;break;case 4:i=Jt;break;default:i=qt}n=i.bind(null,t,n,e),i=void 0,!De||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Vr(e,t,n,r,i){var a=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var s=r.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===o)for(o=r.return;null!==o;){var l=o.tag;if((3===l||4===l)&&((l=o.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;o=o.return}for(;null!==s;){if(null===(o=yi(s)))return;if(5===(l=o.tag)||6===l){r=a=o;continue e}s=s.parentNode}}r=r.return}Le((function(){var r=a,i=we(n),o=[];e:{var s=Rr.get(e);if(void 0!==s){var l=cn,u=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":l=Cn;break;case"focusin":u="focus",l=gn;break;case"focusout":u="blur",l=gn;break;case"beforeblur":case"afterblur":l=gn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=fn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=mn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Bn;break;case Er:case Cr:case Tr:l=vn;break;case Br:l=Rn;break;case"scroll":l=hn;break;case"wheel":l=Pn;break;case"copy":case"cut":case"paste":l=xn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=Tn}var c=0!=(4&t),d=!c&&"scroll"===e,h=c?null!==s?s+"Capture":null:s;c=[];for(var p,f=r;null!==f;){var m=(p=f).stateNode;if(5===p.tag&&null!==m&&(p=m,null!==h&&(null!=(m=Pe(f,h))&&c.push(jr(f,m,p)))),d)break;f=f.return}0<c.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:c}))}}if(0==(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===be||!(u=n.relatedTarget||n.fromElement)||!yi(u)&&!u[fi])&&(l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(u=(u=n.relatedTarget||n.toElement)?yi(u):null)&&(u!==(d=ze(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(l=null,u=r),l!==u)){if(c=fn,m="onMouseLeave",h="onMouseEnter",f="mouse","pointerout"!==e&&"pointerover"!==e||(c=Tn,m="onPointerLeave",h="onPointerEnter",f="pointer"),d=null==l?s:bi(l),p=null==u?s:bi(u),(s=new c(m,f+"leave",l,n,i)).target=d,s.relatedTarget=p,m=null,yi(i)===r&&((c=new c(h,f+"enter",u,n,i)).target=p,c.relatedTarget=d,m=c),d=m,l&&u)e:{for(h=u,f=0,p=c=l;p;p=qr(p))f++;for(p=0,m=h;m;m=qr(m))p++;for(;0<f-p;)c=qr(c),f--;for(;0<p-f;)h=qr(h),p--;for(;f--;){if(c===h||null!==h&&c===h.alternate)break e;c=qr(c),h=qr(h)}c=null}else c=null;null!==l&&Xr(o,s,l,c,!1),null!==u&&null!==d&&Xr(o,d,u,c,!0)}if("select"===(l=(s=r?bi(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Qn;else if(Vn(s))if(Yn)g=or;else{g=ir;var v=rr}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=ar);switch(g&&(g=g(e,r))?jn(o,g,n,i):(v&&v(e,s,r),"focusout"===e&&(v=s._wrapperState)&&v.controlled&&"number"===s.type&&ee(s,"number",s.value)),v=r?bi(r):window,e){case"focusin":(Vn(v)||"true"===v.contentEditable)&&(gr=v,vr=r,yr=null);break;case"focusout":yr=vr=gr=null;break;case"mousedown":xr=!0;break;case"contextmenu":case"mouseup":case"dragend":xr=!1,br(o,n,i);break;case"selectionchange":if(mr)break;case"keydown":case"keyup":br(o,n,i)}var y;if(In)e:{switch(e){case"compositionstart":var x="onCompositionStart";break e;case"compositionend":x="onCompositionEnd";break e;case"compositionupdate":x="onCompositionUpdate";break e}x=void 0}else zn?Un(e,n)&&(x="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(x="onCompositionStart");x&&(Nn&&"ko"!==n.locale&&(zn||"onCompositionStart"!==x?"onCompositionEnd"===x&&zn&&(y=en()):(Zt="value"in(Yt=i)?Yt.value:Yt.textContent,zn=!0)),0<(v=Jr(r,x)).length&&(x=new bn(x,e,null,n,i),o.push({event:x,listeners:v}),y?x.data=y:null!==(y=Gn(n))&&(x.data=y))),(y=kn?function(e,t){switch(e){case"compositionend":return Gn(t);case"keypress":return 32!==t.which?null:(Hn=!0,On);case"textInput":return(e=t.data)===On&&Hn?null:e;default:return null}}(e,n):function(e,t){if(zn)return"compositionend"===e||!In&&Un(e,t)?(e=en(),$t=Zt=Yt=null,zn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Nn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Jr(r,"onBeforeInput")).length&&(i=new bn("onBeforeInput","beforeinput",null,n,i),o.push({event:i,listeners:r}),i.data=y))}Or(o,t)}))}function jr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jr(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,a=i.stateNode;5===i.tag&&null!==a&&(i=a,null!=(a=Pe(e,n))&&r.unshift(jr(e,a,i)),null!=(a=Pe(e,t))&&r.push(jr(e,a,i))),e=e.return}return r}function qr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Xr(e,t,n,r,i){for(var a=t._reactName,o=[];null!==n&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==u&&(s=u,i?null!=(l=Pe(n,a))&&o.unshift(jr(n,l,s)):i||null!=(l=Pe(n,a))&&o.push(jr(n,l,s))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}var Kr=/\r\n?/g,Qr=/\u0000|\uFFFD/g;function Yr(e){return("string"==typeof e?e:""+e).replace(Kr,"\n").replace(Qr,"")}function Zr(e,t,n){if(t=Yr(t),Yr(e)!==t&&n)throw Error(a(425))}function $r(){}var ei=null,ti=null;function ni(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ri="function"==typeof setTimeout?setTimeout:void 0,ii="function"==typeof clearTimeout?clearTimeout:void 0,ai="function"==typeof Promise?Promise:void 0,oi="function"==typeof queueMicrotask?queueMicrotask:void 0!==ai?function(e){return ai.resolve(null).then(e).catch(si)}:ri;function si(e){setTimeout((function(){throw e}))}function li(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===r)return e.removeChild(i),void zt(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);zt(t)}function ui(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function ci(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var di=Math.random().toString(36).slice(2),hi="__reactFiber$"+di,pi="__reactProps$"+di,fi="__reactContainer$"+di,mi="__reactEvents$"+di,gi="__reactListeners$"+di,vi="__reactHandles$"+di;function yi(e){var t=e[hi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[fi]||n[hi]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=ci(e);null!==e;){if(n=e[hi])return n;e=ci(e)}return t}n=(e=n).parentNode}return null}function xi(e){return!(e=e[hi]||e[fi])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function bi(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function wi(e){return e[pi]||null}var _i=[],Mi=-1;function Si(e){return{current:e}}function Ai(e){0>Mi||(e.current=_i[Mi],_i[Mi]=null,Mi--)}function Ei(e,t){Mi++,_i[Mi]=e.current,e.current=t}var Ci={},Ti=Si(Ci),Bi=Si(!1),Ri=Ci;function Li(e,t){var n=e.type.contextTypes;if(!n)return Ci;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Pi(e){return null!=(e=e.childContextTypes)}function Di(){Ai(Bi),Ai(Ti)}function Ii(e,t,n){if(Ti.current!==Ci)throw Error(a(168));Ei(Ti,t),Ei(Bi,n)}function Fi(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(a(108,W(e)||"Unknown",i));return N({},n,r)}function ki(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ci,Ri=Ti.current,Ei(Ti,e),Ei(Bi,Bi.current),!0}function Ni(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=Fi(e,t,Ri),r.__reactInternalMemoizedMergedChildContext=e,Ai(Bi),Ai(Ti),Ei(Ti,e)):Ai(Bi),Ei(Bi,n)}var Oi=null,Hi=!1,Ui=!1;function Gi(e){null===Oi?Oi=[e]:Oi.push(e)}function zi(){if(!Ui&&null!==Oi){Ui=!0;var e=0,t=xt;try{var n=Oi;for(xt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Oi=null,Hi=!1}catch(t){throw null!==Oi&&(Oi=Oi.slice(e+1)),qe($e,zi),t}finally{xt=t,Ui=!1}}return null}var Wi=b.ReactCurrentBatchConfig;function Vi(e,t){if(e&&e.defaultProps){for(var n in t=N({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var ji=Si(null),Ji=null,qi=null,Xi=null;function Ki(){Xi=qi=Ji=null}function Qi(e){var t=ji.current;Ai(ji),e._currentValue=t}function Yi(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Zi(e,t){Ji=e,Xi=qi=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(ws=!0),e.firstContext=null)}function $i(e){var t=e._currentValue;if(Xi!==e)if(e={context:e,memoizedValue:t,next:null},null===qi){if(null===Ji)throw Error(a(308));qi=e,Ji.dependencies={lanes:0,firstContext:e}}else qi=qi.next=e;return t}var ea=null,ta=!1;function na(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ra(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ia(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function aa(e,t){var n=e.updateQueue;null!==n&&(n=n.shared,tu(e)?(null===(e=n.interleaved)?(t.next=t,null===ea?ea=[n]:ea.push(n)):(t.next=e.next,e.next=t),n.interleaved=t):(null===(e=n.pending)?t.next=t:(t.next=e.next,e.next=t),n.pending=t))}function oa(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,yt(e,n)}}function sa(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?i=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?i=a=t:a=a.next=t}else i=a=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function la(e,t,n,r){var i=e.updateQueue;ta=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var l=s,u=l.next;l.next=null,null===o?a=u:o.next=u,o=l;var c=e.alternate;null!==c&&((s=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===s?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(null!==a){var d=i.baseState;for(o=0,c=u=l=null,s=a;;){var h=s.lane,p=s.eventTime;if((r&h)===h){null!==c&&(c=c.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var f=e,m=s;switch(h=t,p=n,m.tag){case 1:if("function"==typeof(f=m.payload)){d=f.call(p,d,h);break e}d=f;break e;case 3:f.flags=-65537&f.flags|128;case 0:if(null==(h="function"==typeof(f=m.payload)?f.call(p,d,h):f))break e;d=N({},d,h);break e;case 2:ta=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(h=i.effects)?i.effects=[s]:h.push(s))}else p={eventTime:p,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===c?(u=c=p,l=d):c=c.next=p,o|=h;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(h=s).next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}if(null===c&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null!==(t=i.shared.interleaved)){i=t;do{o|=i.lane,i=i.next}while(i!==t)}else null===a&&(i.shared.lanes=0);Dl|=o,e.lanes=o,e.memoizedState=d}}function ua(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(a(191,i));i.call(r)}}}var ca=(new r.Component).refs;function da(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:N({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var ha={isMounted:function(e){return!!(e=e._reactInternals)&&ze(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Yl(),i=Zl(e),a=ia(r,i);a.payload=t,null!=n&&(a.callback=n),aa(e,a),null!==(t=$l(e,i,r))&&oa(t,e,i)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Yl(),i=Zl(e),a=ia(r,i);a.tag=1,a.payload=t,null!=n&&(a.callback=n),aa(e,a),null!==(t=$l(e,i,r))&&oa(t,e,i)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Yl(),r=Zl(e),i=ia(n,r);i.tag=2,null!=t&&(i.callback=t),aa(e,i),null!==(t=$l(e,r,n))&&oa(t,e,r)}};function pa(e,t,n,r,i,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!lr(n,r)||!lr(i,a))}function fa(e,t,n){var r=!1,i=Ci,a=t.contextType;return"object"==typeof a&&null!==a?a=$i(a):(i=Pi(t)?Ri:Ti.current,a=(r=null!=(r=t.contextTypes))?Li(e,i):Ci),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ha,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function ma(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ha.enqueueReplaceState(t,t.state,null)}function ga(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=ca,na(e);var a=t.contextType;"object"==typeof a&&null!==a?i.context=$i(a):(a=Pi(t)?Ri:Ti.current,i.context=Li(e,a)),i.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(da(e,t,a,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&ha.enqueueReplaceState(i,i.state,null),la(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4194308)}var va=[],ya=0,xa=null,ba=0,wa=[],_a=0,Ma=null,Sa=1,Aa="";function Ea(e,t){va[ya++]=ba,va[ya++]=xa,xa=e,ba=t}function Ca(e,t,n){wa[_a++]=Sa,wa[_a++]=Aa,wa[_a++]=Ma,Ma=e;var r=Sa;e=Aa;var i=32-ot(r)-1;r&=~(1<<i),n+=1;var a=32-ot(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Sa=1<<32-ot(t)+i|n<<i|r,Aa=a+e}else Sa=1<<a|n<<i|r,Aa=e}function Ta(e){null!==e.return&&(Ea(e,1),Ca(e,1,0))}function Ba(e){for(;e===xa;)xa=va[--ya],va[ya]=null,ba=va[--ya],va[ya]=null;for(;e===Ma;)Ma=wa[--_a],wa[_a]=null,Aa=wa[--_a],wa[_a]=null,Sa=wa[--_a],wa[_a]=null}var Ra=null,La=null,Pa=!1,Da=null;function Ia(e,t){var n=Ru(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function Fa(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,Ra=e,La=ui(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,Ra=e,La=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Ma?{id:Sa,overflow:Aa}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Ru(18,null,null,0)).stateNode=t,n.return=e,e.child=n,Ra=e,La=null,!0);default:return!1}}function ka(e){return 0!=(1&e.mode)&&0==(128&e.flags)}function Na(e){if(Pa){var t=La;if(t){var n=t;if(!Fa(e,t)){if(ka(e))throw Error(a(418));t=ui(n.nextSibling);var r=Ra;t&&Fa(e,t)?Ia(r,n):(e.flags=-4097&e.flags|2,Pa=!1,Ra=e)}}else{if(ka(e))throw Error(a(418));e.flags=-4097&e.flags|2,Pa=!1,Ra=e}}}function Oa(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Ra=e}function Ha(e){if(e!==Ra)return!1;if(!Pa)return Oa(e),Pa=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!ni(e.type,e.memoizedProps)),t&&(t=La)){if(ka(e)){for(e=La;e;)e=ui(e.nextSibling);throw Error(a(418))}for(;t;)Ia(e,t),t=ui(t.nextSibling)}if(Oa(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){La=ui(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}La=null}}else La=Ra?ui(e.stateNode.nextSibling):null;return!0}function Ua(){La=Ra=null,Pa=!1}function Ga(e){null===Da?Da=[e]:Da.push(e)}function za(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,e));var i=r,o=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===o?t.ref:(t=function(e){var t=i.refs;t===ca&&(t=i.refs={}),null===e?delete t[o]:t[o]=e},t._stringRef=o,t)}if("string"!=typeof e)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function Wa(e,t){throw e=Object.prototype.toString.call(t),Error(a(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Va(e){return(0,e._init)(e._payload)}function ja(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Pu(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=ku(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function u(e,t,n,r){var a=n.type;return a===M?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===a||"object"==typeof a&&null!==a&&a.$$typeof===P&&Va(a)===t.type)?((r=i(t,n.props)).ref=za(e,t,n),r.return=e,r):((r=Du(n.type,n.key,n.props,null,e.mode,r)).ref=za(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Nu(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,a){return null===t||7!==t.tag?((t=Iu(n,e.mode,r,a)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=ku(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case w:return(n=Du(t.type,t.key,t.props,null,e.mode,n)).ref=za(e,null,t),n.return=e,n;case _:return(t=Nu(t,e.mode,n)).return=e,t;case P:return h(e,(0,t._init)(t._payload),n)}if(te(t)||F(t))return(t=Iu(t,e.mode,n,null)).return=e,t;Wa(e,t)}return null}function p(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case w:return n.key===i?u(e,t,n,r):null;case _:return n.key===i?c(e,t,n,r):null;case P:return p(e,t,(i=n._init)(n._payload),r)}if(te(n)||F(n))return null!==i?null:d(e,t,n,r,null);Wa(e,n)}return null}function f(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case w:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case _:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i);case P:return f(e,t,n,(0,r._init)(r._payload),i)}if(te(r)||F(r))return d(t,e=e.get(n)||null,r,i,null);Wa(t,r)}return null}function m(i,a,s,l){for(var u=null,c=null,d=a,m=a=0,g=null;null!==d&&m<s.length;m++){d.index>m?(g=d,d=null):g=d.sibling;var v=p(i,d,s[m],l);if(null===v){null===d&&(d=g);break}e&&d&&null===v.alternate&&t(i,d),a=o(v,a,m),null===c?u=v:c.sibling=v,c=v,d=g}if(m===s.length)return n(i,d),Pa&&Ea(i,m),u;if(null===d){for(;m<s.length;m++)null!==(d=h(i,s[m],l))&&(a=o(d,a,m),null===c?u=d:c.sibling=d,c=d);return Pa&&Ea(i,m),u}for(d=r(i,d);m<s.length;m++)null!==(g=f(d,i,m,s[m],l))&&(e&&null!==g.alternate&&d.delete(null===g.key?m:g.key),a=o(g,a,m),null===c?u=g:c.sibling=g,c=g);return e&&d.forEach((function(e){return t(i,e)})),Pa&&Ea(i,m),u}function g(i,s,l,u){var c=F(l);if("function"!=typeof c)throw Error(a(150));if(null==(l=c.call(l)))throw Error(a(151));for(var d=c=null,m=s,g=s=0,v=null,y=l.next();null!==m&&!y.done;g++,y=l.next()){m.index>g?(v=m,m=null):v=m.sibling;var x=p(i,m,y.value,u);if(null===x){null===m&&(m=v);break}e&&m&&null===x.alternate&&t(i,m),s=o(x,s,g),null===d?c=x:d.sibling=x,d=x,m=v}if(y.done)return n(i,m),Pa&&Ea(i,g),c;if(null===m){for(;!y.done;g++,y=l.next())null!==(y=h(i,y.value,u))&&(s=o(y,s,g),null===d?c=y:d.sibling=y,d=y);return Pa&&Ea(i,g),c}for(m=r(i,m);!y.done;g++,y=l.next())null!==(y=f(m,i,g,y.value,u))&&(e&&null!==y.alternate&&m.delete(null===y.key?g:y.key),s=o(y,s,g),null===d?c=y:d.sibling=y,d=y);return e&&m.forEach((function(e){return t(i,e)})),Pa&&Ea(i,g),c}return function e(r,a,o,l){if("object"==typeof o&&null!==o&&o.type===M&&null===o.key&&(o=o.props.children),"object"==typeof o&&null!==o){switch(o.$$typeof){case w:e:{for(var u=o.key,c=a;null!==c;){if(c.key===u){if((u=o.type)===M){if(7===c.tag){n(r,c.sibling),(a=i(c,o.props.children)).return=r,r=a;break e}}else if(c.elementType===u||"object"==typeof u&&null!==u&&u.$$typeof===P&&Va(u)===c.type){n(r,c.sibling),(a=i(c,o.props)).ref=za(r,c,o),a.return=r,r=a;break e}n(r,c);break}t(r,c),c=c.sibling}o.type===M?((a=Iu(o.props.children,r.mode,l,o.key)).return=r,r=a):((l=Du(o.type,o.key,o.props,null,r.mode,l)).ref=za(r,a,o),l.return=r,r=l)}return s(r);case _:e:{for(c=o.key;null!==a;){if(a.key===c){if(4===a.tag&&a.stateNode.containerInfo===o.containerInfo&&a.stateNode.implementation===o.implementation){n(r,a.sibling),(a=i(a,o.children||[])).return=r,r=a;break e}n(r,a);break}t(r,a),a=a.sibling}(a=Nu(o,r.mode,l)).return=r,r=a}return s(r);case P:return e(r,a,(c=o._init)(o._payload),l)}if(te(o))return m(r,a,o,l);if(F(o))return g(r,a,o,l);Wa(r,o)}return"string"==typeof o&&""!==o||"number"==typeof o?(o=""+o,null!==a&&6===a.tag?(n(r,a.sibling),(a=i(a,o)).return=r,r=a):(n(r,a),(a=ku(o,r.mode,l)).return=r,r=a),s(r)):n(r,a)}}var Ja=ja(!0),qa=ja(!1),Xa={},Ka=Si(Xa),Qa=Si(Xa),Ya=Si(Xa);function Za(e){if(e===Xa)throw Error(a(174));return e}function $a(e,t){switch(Ei(Ya,t),Ei(Qa,e),Ei(Ka,Xa),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Ai(Ka),Ei(Ka,t)}function eo(){Ai(Ka),Ai(Qa),Ai(Ya)}function to(e){Za(Ya.current);var t=Za(Ka.current),n=le(t,e.type);t!==n&&(Ei(Qa,e),Ei(Ka,n))}function no(e){Qa.current===e&&(Ai(Ka),Ai(Qa))}var ro=Si(0);function io(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ao=[];function oo(){for(var e=0;e<ao.length;e++)ao[e]._workInProgressVersionPrimary=null;ao.length=0}var so=b.ReactCurrentDispatcher,lo=b.ReactCurrentBatchConfig,uo=0,co=null,ho=null,po=null,fo=!1,mo=!1,go=0,vo=0;function yo(){throw Error(a(321))}function xo(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sr(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,o){if(uo=o,co=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,so.current=null===e||null===e.memoizedState?rs:is,e=n(r,i),mo){o=0;do{if(mo=!1,go=0,25<=o)throw Error(a(301));o+=1,po=ho=null,t.updateQueue=null,so.current=as,e=n(r,i)}while(mo)}if(so.current=ns,t=null!==ho&&null!==ho.next,uo=0,po=ho=co=null,fo=!1,t)throw Error(a(300));return e}function wo(){var e=0!==go;return go=0,e}function _o(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===po?co.memoizedState=po=e:po=po.next=e,po}function Mo(){if(null===ho){var e=co.alternate;e=null!==e?e.memoizedState:null}else e=ho.next;var t=null===po?co.memoizedState:po.next;if(null!==t)po=t,ho=e;else{if(null===e)throw Error(a(310));e={memoizedState:(ho=e).memoizedState,baseState:ho.baseState,baseQueue:ho.baseQueue,queue:ho.queue,next:null},null===po?co.memoizedState=po=e:po=po.next=e}return po}function So(e,t){return"function"==typeof t?t(e):t}function Ao(e){var t=Mo(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=ho,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(null!==i){o=i.next,r=r.baseState;var l=s=null,u=null,c=o;do{var d=c.lane;if((uo&d)===d)null!==u&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var h={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===u?(l=u=h,s=r):u=u.next=h,co.lanes|=d,Dl|=d}c=c.next}while(null!==c&&c!==o);null===u?s=r:u.next=l,sr(r,t.memoizedState)||(ws=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=u,n.lastRenderedState=r}if(null!==(e=n.interleaved)){i=e;do{o=i.lane,co.lanes|=o,Dl|=o,i=i.next}while(i!==e)}else null===i&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Eo(e){var t=Mo(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{o=e(o,s.action),s=s.next}while(s!==i);sr(o,t.memoizedState)||(ws=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Co(){}function To(e,t){var n=co,r=Mo(),i=t(),o=!sr(r.memoizedState,i);if(o&&(r.memoizedState=i,ws=!0),r=r.queue,Ho(Lo.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||null!==po&&1&po.memoizedState.tag){if(n.flags|=2048,Io(9,Ro.bind(null,n,r,i,t),void 0,null),null===El)throw Error(a(349));0!=(30&uo)||Bo(n,t,i)}return i}function Bo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=co.updateQueue)?(t={lastEffect:null,stores:null},co.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Po(t)&&$l(e,1,-1)}function Lo(e,t,n){return n((function(){Po(t)&&$l(e,1,-1)}))}function Po(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sr(e,n)}catch(e){return!0}}function Do(e){var t=_o();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:So,lastRenderedState:e},t.queue=e,e=e.dispatch=Yo.bind(null,co,e),[t.memoizedState,e]}function Io(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=co.updateQueue)?(t={lastEffect:null,stores:null},co.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Fo(){return Mo().memoizedState}function ko(e,t,n,r){var i=_o();co.flags|=e,i.memoizedState=Io(1|t,n,void 0,void 0===r?null:r)}function No(e,t,n,r){var i=Mo();r=void 0===r?null:r;var a=void 0;if(null!==ho){var o=ho.memoizedState;if(a=o.destroy,null!==r&&xo(r,o.deps))return void(i.memoizedState=Io(t,n,a,r))}co.flags|=e,i.memoizedState=Io(1|t,n,a,r)}function Oo(e,t){return ko(8390656,8,e,t)}function Ho(e,t){return No(2048,8,e,t)}function Uo(e,t){return No(4,2,e,t)}function Go(e,t){return No(4,4,e,t)}function zo(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Wo(e,t,n){return n=null!=n?n.concat([e]):null,No(4,4,zo.bind(null,t,e),n)}function Vo(){}function jo(e,t){var n=Mo();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Jo(e,t){var n=Mo();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&xo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function qo(e,t,n){return 0==(21&uo)?(e.baseState&&(e.baseState=!1,ws=!0),e.memoizedState=n):(sr(n,t)||(n=mt(),co.lanes|=n,Dl|=n,e.baseState=!0),t)}function Xo(e,t){var n=xt;xt=0!==n&&4>n?n:4,e(!0);var r=lo.transition;lo.transition={};try{e(!1),t()}finally{xt=n,lo.transition=r}}function Ko(){return Mo().memoizedState}function Qo(e,t,n){var r=Zl(e);n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Zo(e)?$o(t,n):(es(e,t,n),null!==(e=$l(e,r,n=Yl()))&&ts(e,t,r))}function Yo(e,t,n){var r=Zl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Zo(e))$o(t,i);else{es(e,t,i);var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,sr(s,o))return}catch(e){}null!==(e=$l(e,r,n=Yl()))&&ts(e,t,r)}}function Zo(e){var t=e.alternate;return e===co||null!==t&&t===co}function $o(e,t){mo=fo=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function es(e,t,n){tu(e)?(null===(e=t.interleaved)?(n.next=n,null===ea?ea=[t]:ea.push(t)):(n.next=e.next,e.next=n),t.interleaved=n):(null===(e=t.pending)?n.next=n:(n.next=e.next,e.next=n),t.pending=n)}function ts(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,yt(e,n)}}var ns={readContext:$i,useCallback:yo,useContext:yo,useEffect:yo,useImperativeHandle:yo,useInsertionEffect:yo,useLayoutEffect:yo,useMemo:yo,useReducer:yo,useRef:yo,useState:yo,useDebugValue:yo,useDeferredValue:yo,useTransition:yo,useMutableSource:yo,useSyncExternalStore:yo,useId:yo,unstable_isNewReconciler:!1},rs={readContext:$i,useCallback:function(e,t){return _o().memoizedState=[e,void 0===t?null:t],e},useContext:$i,useEffect:Oo,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,ko(4194308,4,zo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ko(4194308,4,e,t)},useInsertionEffect:function(e,t){return ko(4,2,e,t)},useMemo:function(e,t){var n=_o();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=_o();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Qo.bind(null,co,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},_o().memoizedState=e},useState:Do,useDebugValue:Vo,useDeferredValue:function(e){return _o().memoizedState=e},useTransition:function(){var e=Do(!1),t=e[0];return e=Xo.bind(null,e[1]),_o().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=co,i=_o();if(Pa){if(void 0===n)throw Error(a(407));n=n()}else{if(n=t(),null===El)throw Error(a(349));0!=(30&uo)||Bo(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Oo(Lo.bind(null,r,o,e),[e]),r.flags|=2048,Io(9,Ro.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=_o(),t=El.identifierPrefix;if(Pa){var n=Aa;t=":"+t+"R"+(n=(Sa&~(1<<32-ot(Sa)-1)).toString(32)+n),0<(n=go++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=vo++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},is={readContext:$i,useCallback:jo,useContext:$i,useEffect:Ho,useImperativeHandle:Wo,useInsertionEffect:Uo,useLayoutEffect:Go,useMemo:Jo,useReducer:Ao,useRef:Fo,useState:function(){return Ao(So)},useDebugValue:Vo,useDeferredValue:function(e){return qo(Mo(),ho.memoizedState,e)},useTransition:function(){return[Ao(So)[0],Mo().memoizedState]},useMutableSource:Co,useSyncExternalStore:To,useId:Ko,unstable_isNewReconciler:!1},as={readContext:$i,useCallback:jo,useContext:$i,useEffect:Ho,useImperativeHandle:Wo,useInsertionEffect:Uo,useLayoutEffect:Go,useMemo:Jo,useReducer:Eo,useRef:Fo,useState:function(){return Eo(So)},useDebugValue:Vo,useDeferredValue:function(e){var t=Mo();return null===ho?t.memoizedState=e:qo(t,ho.memoizedState,e)},useTransition:function(){return[Eo(So)[0],Mo().memoizedState]},useMutableSource:Co,useSyncExternalStore:To,useId:Ko,unstable_isNewReconciler:!1};function os(e,t){try{var n="",r=t;do{n+=G(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i}}function ss(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}var ls,us,cs,ds="function"==typeof WeakMap?WeakMap:Map;function hs(e,t,n){(n=ia(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Gl||(Gl=!0,zl=r),ss(0,t)},n}function ps(e,t,n){(n=ia(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ss(0,t)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){ss(0,t),"function"!=typeof r&&(null===Wl?Wl=new Set([this]):Wl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function fs(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new ds;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Su.bind(null,e,t,n),t.then(e,e))}function ms(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function gs(e,t,n,r,i){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=ia(-1,1)).tag=2,aa(n,t))),n.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}function vs(e,t){if(!Pa)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ys(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function xs(e,t,n){var r=t.pendingProps;switch(Ba(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ys(t),null;case 1:case 17:return Pi(t.type)&&Di(),ys(t),null;case 3:return r=t.stateNode,eo(),Ai(Bi),Ai(Ti),oo(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Ha(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==Da&&(au(Da),Da=null))),ys(t),null;case 5:no(t);var i=Za(Ya.current);if(n=t.type,null!==e&&null!=t.stateNode)us(e,t,n,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(a(166));return ys(t),null}if(e=Za(Ka.current),Ha(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[hi]=t,r[pi]=o,e=0!=(1&t.mode),n){case"dialog":Hr("cancel",r),Hr("close",r);break;case"iframe":case"object":case"embed":Hr("load",r);break;case"video":case"audio":for(i=0;i<Fr.length;i++)Hr(Fr[i],r);break;case"source":Hr("error",r);break;case"img":case"image":case"link":Hr("error",r),Hr("load",r);break;case"details":Hr("toggle",r);break;case"input":Q(r,o),Hr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Hr("invalid",r);break;case"textarea":ie(r,o),Hr("invalid",r)}for(var l in ye(n,o),i=null,o)if(o.hasOwnProperty(l)){var u=o[l];"children"===l?"string"==typeof u?r.textContent!==u&&(!0!==o.suppressHydrationWarning&&Zr(r.textContent,u,e),i=["children",u]):"number"==typeof u&&r.textContent!==""+u&&(!0!==o.suppressHydrationWarning&&Zr(r.textContent,u,e),i=["children",""+u]):s.hasOwnProperty(l)&&null!=u&&"onScroll"===l&&Hr("scroll",r)}switch(n){case"input":J(r),$(r,o,!0);break;case"textarea":J(r),oe(r);break;case"select":case"option":break;default:"function"==typeof o.onClick&&(r.onclick=$r)}r=i,t.updateQueue=r,null!==r&&(t.flags|=4)}else{l=9===i.nodeType?i:i.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=se(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),"select"===n&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[hi]=t,e[pi]=r,ls(e,t),t.stateNode=e;e:{switch(l=xe(n,r),n){case"dialog":Hr("cancel",e),Hr("close",e),i=r;break;case"iframe":case"object":case"embed":Hr("load",e),i=r;break;case"video":case"audio":for(i=0;i<Fr.length;i++)Hr(Fr[i],e);i=r;break;case"source":Hr("error",e),i=r;break;case"img":case"image":case"link":Hr("error",e),Hr("load",e),i=r;break;case"details":Hr("toggle",e),i=r;break;case"input":Q(e,r),i=K(e,r),Hr("invalid",e);break;case"option":default:i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=N({},r,{value:void 0}),Hr("invalid",e);break;case"textarea":ie(e,r),i=re(e,r),Hr("invalid",e)}for(o in ye(n,i),u=i)if(u.hasOwnProperty(o)){var c=u[o];"style"===o?ge(e,c):"dangerouslySetInnerHTML"===o?null!=(c=c?c.__html:void 0)&&de(e,c):"children"===o?"string"==typeof c?("textarea"!==n||""!==c)&&he(e,c):"number"==typeof c&&he(e,""+c):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(s.hasOwnProperty(o)?null!=c&&"onScroll"===o&&Hr("scroll",e):null!=c&&x(e,o,c,l))}switch(n){case"input":J(e),$(e,r,!1);break;case"textarea":J(e),oe(e);break;case"option":null!=r.value&&e.setAttribute("value",""+V(r.value));break;case"select":e.multiple=!!r.multiple,null!=(o=r.value)?ne(e,!!r.multiple,o,!1):null!=r.defaultValue&&ne(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof i.onClick&&(e.onclick=$r)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return ys(t),null;case 6:if(e&&null!=t.stateNode)cs(0,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(a(166));if(n=Za(Ya.current),Za(Ka.current),Ha(t)){if(r=t.stateNode,n=t.memoizedProps,r[hi]=t,(o=r.nodeValue!==n)&&null!==(e=Ra))switch(e.tag){case 3:Zr(r.nodeValue,n,0!=(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Zr(r.nodeValue,n,0!=(1&e.mode))}o&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[hi]=t,t.stateNode=r}return ys(t),null;case 13:if(Ai(ro),r=t.memoizedState,Pa&&null!==La&&0!=(1&t.mode)&&0==(128&t.flags)){for(r=La;r;)r=ui(r.nextSibling);return Ua(),t.flags|=98560,t}if(null!==r&&null!==r.dehydrated){if(r=Ha(t),null===e){if(!r)throw Error(a(318));if(!(r=null!==(r=t.memoizedState)?r.dehydrated:null))throw Error(a(317));r[hi]=t}else Ua(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;return ys(t),null}return null!==Da&&(au(Da),Da=null),0!=(128&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?Ha(t):n=null!==e.memoizedState,r!==n&&r&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&ro.current)?0===Ll&&(Ll=3):fu())),null!==t.updateQueue&&(t.flags|=4),ys(t),null);case 4:return eo(),null===e&&zr(t.stateNode.containerInfo),ys(t),null;case 10:return Qi(t.type._context),ys(t),null;case 19:if(Ai(ro),null===(o=t.memoizedState))return ys(t),null;if(r=0!=(128&t.flags),null===(l=o.rendering))if(r)vs(o,!1);else{if(0!==Ll||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(l=io(e))){for(t.flags|=128,vs(o,!1),null!==(r=l.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(o=n).flags&=14680066,null===(l=o.alternate)?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=l.childLanes,o.lanes=l.lanes,o.child=l.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=l.memoizedProps,o.memoizedState=l.memoizedState,o.updateQueue=l.updateQueue,o.type=l.type,e=l.dependencies,o.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ei(ro,1&ro.current|2),t.child}e=e.sibling}null!==o.tail&&Ye()>Hl&&(t.flags|=128,r=!0,vs(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=io(l))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),vs(o,!0),null===o.tail&&"hidden"===o.tailMode&&!l.alternate&&!Pa)return ys(t),null}else 2*Ye()-o.renderingStartTime>Hl&&1073741824!==n&&(t.flags|=128,r=!0,vs(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=o.last)?n.sibling=l:t.child=l,o.last=l)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ye(),t.sibling=null,n=ro.current,Ei(ro,r?1&n|2:1&n),t):(ys(t),null);case 22:case 23:return cu(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(1073741824&Bl)&&(ys(t),6&t.subtreeFlags&&(t.flags|=8192)):ys(t),null;case 24:case 25:return null}throw Error(a(156,t.tag))}ls=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},us=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Za(Ka.current);var a,o=null;switch(n){case"input":i=K(e,i),r=K(e,r),o=[];break;case"select":i=N({},i,{value:void 0}),r=N({},r,{value:void 0}),o=[];break;case"textarea":i=re(e,i),r=re(e,r),o=[];break;default:"function"!=typeof i.onClick&&"function"==typeof r.onClick&&(e.onclick=$r)}for(c in ye(n,r),n=null,i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&null!=i[c])if("style"===c){var l=i[c];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(s.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var u=r[c];if(l=null!=i?i[c]:void 0,r.hasOwnProperty(c)&&u!==l&&(null!=u||null!=l))if("style"===c)if(l){for(a in l)!l.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&l[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(o||(o=[]),o.push(c,n)),n=u;else"dangerouslySetInnerHTML"===c?(u=u?u.__html:void 0,l=l?l.__html:void 0,null!=u&&l!==u&&(o=o||[]).push(c,u)):"children"===c?"string"!=typeof u&&"number"!=typeof u||(o=o||[]).push(c,""+u):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(s.hasOwnProperty(c)?(null!=u&&"onScroll"===c&&Hr("scroll",e),o||l===u||(o=[])):(o=o||[]).push(c,u))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}},cs=function(e,t,n,r){n!==r&&(t.flags|=4)};var bs=b.ReactCurrentOwner,ws=!1;function _s(e,t,n,r){t.child=null===e?qa(t,null,n,r):Ja(t,e.child,n,r)}function Ms(e,t,n,r,i){n=n.render;var a=t.ref;return Zi(t,i),r=bo(e,t,n,r,a,i),n=wo(),null===e||ws?(Pa&&n&&Ta(t),t.flags|=1,_s(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Vs(e,t,i))}function Ss(e,t,n,r,i){if(null===e){var a=n.type;return"function"!=typeof a||Lu(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Du(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,As(e,t,a,r,i))}if(a=e.child,0==(e.lanes&i)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:lr)(o,r)&&e.ref===t.ref)return Vs(e,t,i)}return t.flags|=1,(e=Pu(a,r)).ref=t.ref,e.return=t,t.child=e}function As(e,t,n,r,i){if(null!==e){var a=e.memoizedProps;if(lr(a,r)&&e.ref===t.ref){if(ws=!1,t.pendingProps=r=a,0==(e.lanes&i))return t.lanes=e.lanes,Vs(e,t,i);0!=(131072&e.flags)&&(ws=!0)}}return Ts(e,t,n,r,i)}function Es(e,t,n){var r=t.pendingProps,i=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ei(Rl,Bl),Bl|=n;else{if(0==(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ei(Rl,Bl),Bl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==a?a.baseLanes:n,Ei(Rl,Bl),Bl|=r}else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,Ei(Rl,Bl),Bl|=r;return _s(e,t,i,n),t.child}function Cs(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ts(e,t,n,r,i){var a=Pi(n)?Ri:Ti.current;return a=Li(t,a),Zi(t,i),n=bo(e,t,n,r,a,i),r=wo(),null===e||ws?(Pa&&r&&Ta(t),t.flags|=1,_s(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Vs(e,t,i))}function Bs(e,t,n,r,i){if(Pi(n)){var a=!0;ki(t)}else a=!1;if(Zi(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),fa(t,n,r),ga(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,u=n.contextType;"object"==typeof u&&null!==u?u=$i(u):u=Li(t,u=Pi(n)?Ri:Ti.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof o.getSnapshotBeforeUpdate;d||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(s!==r||l!==u)&&ma(t,o,r,u),ta=!1;var h=t.memoizedState;o.state=h,la(t,r,o,i),l=t.memoizedState,s!==r||h!==l||Bi.current||ta?("function"==typeof c&&(da(t,n,c,r),l=t.memoizedState),(s=ta||pa(t,n,s,r,h,l,u))?(d||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4194308)):("function"==typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=s):("function"==typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,ra(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Vi(t.type,s),o.props=u,d=t.pendingProps,h=o.context,"object"==typeof(l=n.contextType)&&null!==l?l=$i(l):l=Li(t,l=Pi(n)?Ri:Ti.current);var p=n.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(s!==d||h!==l)&&ma(t,o,r,l),ta=!1,h=t.memoizedState,o.state=h,la(t,r,o,i);var f=t.memoizedState;s!==d||h!==f||Bi.current||ta?("function"==typeof p&&(da(t,n,p,r),f=t.memoizedState),(u=ta||pa(t,n,u,r,h,f,l)||!1)?(c||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,f,l),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,f,l)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof o.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=f),o.props=r,o.state=f,o.context=l,r=u):("function"!=typeof o.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Rs(e,t,n,r,a,i)}function Rs(e,t,n,r,i,a){Cs(e,t);var o=0!=(128&t.flags);if(!r&&!o)return i&&Ni(t,n,!1),Vs(e,t,a);r=t.stateNode,bs.current=t;var s=o&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=Ja(t,e.child,null,a),t.child=Ja(t,null,s,a)):_s(e,t,s,a),t.memoizedState=r.state,i&&Ni(t,n,!0),t.child}function Ls(e){var t=e.stateNode;t.pendingContext?Ii(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Ii(0,t.context,!1),$a(e,t.containerInfo)}function Ps(e,t,n,r,i){return Ua(),Ga(i),t.flags|=256,_s(e,t,n,r),t.child}var Ds={dehydrated:null,treeContext:null,retryLane:0};function Is(e){return{baseLanes:e,cachePool:null,transitions:null}}function Fs(e,t){return{baseLanes:e.baseLanes|t,cachePool:null,transitions:e.transitions}}function ks(e,t,n){var r,i=t.pendingProps,o=ro.current,s=!1,l=0!=(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!=(2&o)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(o|=1),Ei(ro,1&o),null===e)return Na(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(o=i.children,e=i.fallback,s?(i=t.mode,s=t.child,o={mode:"hidden",children:o},0==(1&i)&&null!==s?(s.childLanes=0,s.pendingProps=o):s=Fu(o,i,0,null),e=Iu(e,i,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Is(n),t.memoizedState=Ds,e):Ns(t,o));if(null!==(o=e.memoizedState)){if(null!==(r=o.dehydrated)){if(l)return 256&t.flags?(t.flags&=-257,Us(e,t,n,Error(a(422)))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(s=i.fallback,o=t.mode,i=Fu({mode:"visible",children:i.children},o,0,null),(s=Iu(s,o,n,null)).flags|=2,i.return=t,s.return=t,i.sibling=s,t.child=i,0!=(1&t.mode)&&Ja(t,e.child,null,n),t.child.memoizedState=Is(n),t.memoizedState=Ds,s);if(0==(1&t.mode))t=Us(e,t,n,null);else if("$!"===r.data)t=Us(e,t,n,Error(a(419)));else if(i=0!=(n&e.childLanes),ws||i){if(null!==(i=El)){switch(n&-n){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}0!==(i=0!=(s&(i.suspendedLanes|n))?0:s)&&i!==o.retryLane&&(o.retryLane=i,$l(e,i,-1))}fu(),t=Us(e,t,n,Error(a(421)))}else"$?"===r.data?(t.flags|=128,t.child=e.child,t=Eu.bind(null,e),r._reactRetry=t,t=null):(n=o.treeContext,La=ui(r.nextSibling),Ra=t,Pa=!0,Da=null,null!==n&&(wa[_a++]=Sa,wa[_a++]=Aa,wa[_a++]=Ma,Sa=n.id,Aa=n.overflow,Ma=t),(t=Ns(t,t.pendingProps.children)).flags|=4096);return t}return s?(i=Hs(e,t,i.children,i.fallback,n),s=t.child,o=e.child.memoizedState,s.memoizedState=null===o?Is(n):Fs(o,n),s.childLanes=e.childLanes&~n,t.memoizedState=Ds,i):(n=Os(e,t,i.children,n),t.memoizedState=null,n)}return s?(i=Hs(e,t,i.children,i.fallback,n),s=t.child,o=e.child.memoizedState,s.memoizedState=null===o?Is(n):Fs(o,n),s.childLanes=e.childLanes&~n,t.memoizedState=Ds,i):(n=Os(e,t,i.children,n),t.memoizedState=null,n)}function Ns(e,t){return(t=Fu({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Os(e,t,n,r){var i=e.child;return e=i.sibling,n=Pu(i,{mode:"visible",children:n}),0==(1&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n}function Hs(e,t,n,r,i){var a=t.mode,o=(e=e.child).sibling,s={mode:"hidden",children:n};return 0==(1&a)&&t.child!==e?((n=t.child).childLanes=0,n.pendingProps=s,t.deletions=null):(n=Pu(e,s)).subtreeFlags=14680064&e.subtreeFlags,null!==o?r=Pu(o,r):(r=Iu(r,a,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function Us(e,t,n,r){return null!==r&&Ga(r),Ja(t,e.child,null,n),(e=Ns(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Gs(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Yi(e.return,t,n)}function zs(e,t,n,r,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function Ws(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(_s(e,t,r.children,n),0!=(2&(r=ro.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Gs(e,n,t);else if(19===e.tag)Gs(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ei(ro,r),0==(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===io(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),zs(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===io(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}zs(t,!0,n,null,a);break;case"together":zs(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Vs(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Dl|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=Pu(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Pu(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function js(e,t){switch(Ba(t),t.tag){case 1:return Pi(t.type)&&Di(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return eo(),Ai(Bi),Ai(Ti),oo(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return no(t),null;case 13:if(Ai(ro),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));Ua()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Ai(ro),null;case 4:return eo(),null;case 10:return Qi(t.type._context),null;case 22:case 23:return cu(),null;default:return null}}var Js=!1,qs=!1,Xs="function"==typeof WeakSet?WeakSet:Set,Ks=null;function Qs(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){Mu(e,t,n)}else n.current=null}function Ys(e,t,n){try{n()}catch(n){Mu(e,t,n)}}var Zs=!1;function $s(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,void 0!==a&&Ys(t,n,a)}i=i.next}while(i!==r)}}function el(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function tl(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function nl(e){var t=e.alternate;null!==t&&(e.alternate=null,nl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[hi],delete t[pi],delete t[mi],delete t[gi],delete t[vi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function rl(e){return 5===e.tag||3===e.tag||4===e.tag}function il(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||rl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function al(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=$r));else if(4!==r&&null!==(e=e.child))for(al(e,t,n),e=e.sibling;null!==e;)al(e,t,n),e=e.sibling}function ol(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(ol(e,t,n),e=e.sibling;null!==e;)ol(e,t,n),e=e.sibling}var sl=null,ll=!1;function ul(e,t,n){for(n=n.child;null!==n;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(at&&"function"==typeof at.onCommitFiberUnmount)try{at.onCommitFiberUnmount(it,n)}catch(e){}switch(n.tag){case 5:qs||Qs(n,t);case 6:var r=sl,i=ll;sl=null,ul(e,t,n),ll=i,null!==(sl=r)&&(ll?(e=sl,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):sl.removeChild(n.stateNode));break;case 18:null!==sl&&(ll?(e=sl,n=n.stateNode,8===e.nodeType?li(e.parentNode,n):1===e.nodeType&&li(e,n),zt(e)):li(sl,n.stateNode));break;case 4:r=sl,i=ll,sl=n.stateNode.containerInfo,ll=!0,ul(e,t,n),sl=r,ll=i;break;case 0:case 11:case 14:case 15:if(!qs&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,void 0!==o&&(0!=(2&a)||0!=(4&a))&&Ys(n,t,o),i=i.next}while(i!==r)}ul(e,t,n);break;case 1:if(!qs&&(Qs(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Mu(n,t,e)}ul(e,t,n);break;case 21:ul(e,t,n);break;case 22:1&n.mode?(qs=(r=qs)||null!==n.memoizedState,ul(e,t,n),qs=r):ul(e,t,n);break;default:ul(e,t,n)}}function dl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Xs),t.forEach((function(t){var r=Cu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function hl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 5:sl=l.stateNode,ll=!1;break e;case 3:case 4:sl=l.stateNode.containerInfo,ll=!0;break e}l=l.return}if(null===sl)throw Error(a(160));cl(o,s,i),sl=null,ll=!1;var u=i.alternate;null!==u&&(u.return=null),i.return=null}catch(e){Mu(i,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)pl(t,e),t=t.sibling}function pl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(hl(t,e),fl(e),4&r){try{$s(3,e,e.return),el(3,e)}catch(t){Mu(e,e.return,t)}try{$s(5,e,e.return)}catch(t){Mu(e,e.return,t)}}break;case 1:hl(t,e),fl(e),512&r&&null!==n&&Qs(n,n.return);break;case 5:if(hl(t,e),fl(e),512&r&&null!==n&&Qs(n,n.return),32&e.flags){var i=e.stateNode;try{he(i,"")}catch(t){Mu(e,e.return,t)}}if(4&r&&null!=(i=e.stateNode)){var o=e.memoizedProps,s=null!==n?n.memoizedProps:o,l=e.type,u=e.updateQueue;if(e.updateQueue=null,null!==u)try{"input"===l&&"radio"===o.type&&null!=o.name&&Y(i,o),xe(l,s);var c=xe(l,o);for(s=0;s<u.length;s+=2){var d=u[s],h=u[s+1];"style"===d?ge(i,h):"dangerouslySetInnerHTML"===d?de(i,h):"children"===d?he(i,h):x(i,d,h,c)}switch(l){case"input":Z(i,o);break;case"textarea":ae(i,o);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var f=o.value;null!=f?ne(i,!!o.multiple,f,!1):p!==!!o.multiple&&(null!=o.defaultValue?ne(i,!!o.multiple,o.defaultValue,!0):ne(i,!!o.multiple,o.multiple?[]:"",!1))}i[pi]=o}catch(t){Mu(e,e.return,t)}}break;case 6:if(hl(t,e),fl(e),4&r){if(null===e.stateNode)throw Error(a(162));c=e.stateNode,d=e.memoizedProps;try{c.nodeValue=d}catch(t){Mu(e,e.return,t)}}break;case 3:if(hl(t,e),fl(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{zt(t.containerInfo)}catch(t){Mu(e,e.return,t)}break;case 4:default:hl(t,e),fl(e);break;case 13:hl(t,e),fl(e),8192&(c=e.child).flags&&null!==c.memoizedState&&(null===c.alternate||null===c.alternate.memoizedState)&&(Ol=Ye()),4&r&&dl(e);break;case 22:if(c=null!==n&&null!==n.memoizedState,1&e.mode?(qs=(d=qs)||c,hl(t,e),qs=d):hl(t,e),fl(e),8192&r){d=null!==e.memoizedState;e:for(h=null,p=e;;){if(5===p.tag){if(null===h){h=p;try{i=p.stateNode,d?"function"==typeof(o=i.style).setProperty?o.setProperty("display","none","important"):o.display="none":(l=p.stateNode,s=null!=(u=p.memoizedProps.style)&&u.hasOwnProperty("display")?u.display:null,l.style.display=me("display",s))}catch(t){Mu(e,e.return,t)}}}else if(6===p.tag){if(null===h)try{p.stateNode.nodeValue=d?"":p.memoizedProps}catch(t){Mu(e,e.return,t)}}else if((22!==p.tag&&23!==p.tag||null===p.memoizedState||p===e)&&null!==p.child){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;null===p.sibling;){if(null===p.return||p.return===e)break e;h===p&&(h=null),p=p.return}h===p&&(h=null),p.sibling.return=p.return,p=p.sibling}if(d&&!c&&0!=(1&e.mode))for(Ks=e,e=e.child;null!==e;){for(c=Ks=e;null!==Ks;){switch(h=(d=Ks).child,d.tag){case 0:case 11:case 14:case 15:$s(4,d,d.return);break;case 1:if(Qs(d,d.return),"function"==typeof(o=d.stateNode).componentWillUnmount){p=d,f=d.return;try{i=p,o.props=i.memoizedProps,o.state=i.memoizedState,o.componentWillUnmount()}catch(e){Mu(p,f,e)}}break;case 5:Qs(d,d.return);break;case 22:if(null!==d.memoizedState){yl(c);continue}}null!==h?(h.return=d,Ks=h):yl(c)}e=e.sibling}}break;case 19:hl(t,e),fl(e),4&r&&dl(e);case 21:}}function fl(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(rl(n)){var r=n;break e}n=n.return}throw Error(a(160))}switch(r.tag){case 5:var i=r.stateNode;32&r.flags&&(he(i,""),r.flags&=-33),ol(e,il(e),i);break;case 3:case 4:var o=r.stateNode.containerInfo;al(e,il(e),o);break;default:throw Error(a(161))}}catch(t){Mu(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function ml(e,t,n){Ks=e,gl(e,t,n)}function gl(e,t,n){for(var r=0!=(1&e.mode);null!==Ks;){var i=Ks,a=i.child;if(22===i.tag&&r){var o=null!==i.memoizedState||Js;if(!o){var s=i.alternate,l=null!==s&&null!==s.memoizedState||qs;s=Js;var u=qs;if(Js=o,(qs=l)&&!u)for(Ks=i;null!==Ks;)l=(o=Ks).child,22===o.tag&&null!==o.memoizedState?xl(i):null!==l?(l.return=o,Ks=l):xl(i);for(;null!==a;)Ks=a,gl(a,t,n),a=a.sibling;Ks=i,Js=s,qs=u}vl(e)}else 0!=(8772&i.subtreeFlags)&&null!==a?(a.return=i,Ks=a):vl(e)}}function vl(e){for(;null!==Ks;){var t=Ks;if(0!=(8772&t.flags)){var n=t.alternate;try{if(0!=(8772&t.flags))switch(t.tag){case 0:case 11:case 15:qs||el(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!qs)if(null===n)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Vi(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;null!==o&&ua(t,o,r);break;case 3:var s=t.updateQueue;if(null!==s){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}ua(t,s,n)}break;case 5:var l=t.stateNode;if(null===n&&4&t.flags){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:break;case 13:if(null===t.memoizedState){var c=t.alternate;if(null!==c){var d=c.memoizedState;if(null!==d){var h=d.dehydrated;null!==h&&zt(h)}}}break;default:throw Error(a(163))}qs||512&t.flags&&tl(t)}catch(e){Mu(t,t.return,e)}}if(t===e){Ks=null;break}if(null!==(n=t.sibling)){n.return=t.return,Ks=n;break}Ks=t.return}}function yl(e){for(;null!==Ks;){var t=Ks;if(t===e){Ks=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Ks=n;break}Ks=t.return}}function xl(e){for(;null!==Ks;){var t=Ks;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{el(4,t)}catch(e){Mu(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(e){Mu(t,i,e)}}var a=t.return;try{tl(t)}catch(e){Mu(t,a,e)}break;case 5:var o=t.return;try{tl(t)}catch(e){Mu(t,o,e)}}}catch(e){Mu(t,t.return,e)}if(t===e){Ks=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Ks=s;break}Ks=t.return}}var bl,wl=Math.ceil,_l=b.ReactCurrentDispatcher,Ml=b.ReactCurrentOwner,Sl=b.ReactCurrentBatchConfig,Al=0,El=null,Cl=null,Tl=0,Bl=0,Rl=Si(0),Ll=0,Pl=null,Dl=0,Il=0,Fl=0,kl=null,Nl=null,Ol=0,Hl=1/0,Ul=null,Gl=!1,zl=null,Wl=null,Vl=!1,jl=null,Jl=0,ql=0,Xl=null,Kl=-1,Ql=0;function Yl(){return 0!=(6&Al)?Ye():-1!==Kl?Kl:Kl=Ye()}function Zl(e){return 0==(1&e.mode)?1:0!=(2&Al)&&0!==Tl?Tl&-Tl:null!==Wi.transition?(0===Ql&&(Ql=mt()),Ql):0!==(e=xt)?e:e=void 0===(e=window.event)?16:Qt(e.type)}function $l(e,t,n){if(50<ql)throw ql=0,Xl=null,Error(a(185));var r=eu(e,t);return null===r?null:(vt(r,t,n),0!=(2&Al)&&r===El||(r===El&&(0==(2&Al)&&(Il|=t),4===Ll&&ou(r,Tl)),nu(r,n),1===t&&0===Al&&0==(1&e.mode)&&(Hl=Ye()+500,Hi&&zi())),r)}function eu(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function tu(e){return(null!==El||null!==ea)&&0!=(1&e.mode)&&0==(2&Al)}function nu(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-ot(a),s=1<<o,l=i[o];-1===l?0!=(s&n)&&0==(s&r)||(i[o]=pt(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}}(e,t);var r=ht(e,e===El?Tl:0);if(0===r)null!==n&&Xe(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Xe(n),1===t)0===e.tag?function(e){Hi=!0,Gi(e)}(su.bind(null,e)):Gi(su.bind(null,e)),oi((function(){0===Al&&zi()})),n=null;else{switch(bt(r)){case 1:n=$e;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=rt}n=Tu(n,ru.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ru(e,t){if(Kl=-1,Ql=0,0!=(6&Al))throw Error(a(327));var n=e.callbackNode;if(wu()&&e.callbackNode!==n)return null;var r=ht(e,e===El?Tl:0);if(0===r)return null;if(0!=(30&r)||0!=(r&e.expiredLanes)||t)t=mu(e,r);else{t=r;var i=Al;Al|=2;var o=pu();for(El===e&&Tl===t||(Ul=null,Hl=Ye()+500,du(e,t));;)try{vu();break}catch(t){hu(e,t)}Ki(),_l.current=o,Al=i,null!==Cl?t=0:(El=null,Tl=0,t=Ll)}if(0!==t){if(2===t&&(0!==(i=ft(e))&&(r=i,t=iu(e,i))),1===t)throw n=Pl,du(e,0),ou(e,r),nu(e,Ye()),n;if(6===t)ou(e,r);else{if(i=e.current.alternate,0==(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!sr(a(),i))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)&&(2===(t=mu(e,r))&&(0!==(o=ft(e))&&(r=o,t=iu(e,o))),1===t))throw n=Pl,du(e,0),ou(e,r),nu(e,Ye()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(a(345));case 2:case 5:bu(e,Nl,Ul);break;case 3:if(ou(e,r),(130023424&r)===r&&10<(t=Ol+500-Ye())){if(0!==ht(e,0))break;if(((i=e.suspendedLanes)&r)!==r){Yl(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ri(bu.bind(null,e,Nl,Ul),t);break}bu(e,Nl,Ul);break;case 4:if(ou(e,r),(4194240&r)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-ot(r);o=1<<s,(s=t[s])>i&&(i=s),r&=~o}if(r=i,10<(r=(120>(r=Ye()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*wl(r/1960))-r)){e.timeoutHandle=ri(bu.bind(null,e,Nl,Ul),r);break}bu(e,Nl,Ul);break;default:throw Error(a(329))}}}return nu(e,Ye()),e.callbackNode===n?ru.bind(null,e):null}function iu(e,t){var n=kl;return e.current.memoizedState.isDehydrated&&(du(e,t).flags|=256),2!==(e=mu(e,t))&&(t=Nl,Nl=n,null!==t&&au(t)),e}function au(e){null===Nl?Nl=e:Nl.push.apply(Nl,e)}function ou(e,t){for(t&=~Fl,t&=~Il,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ot(t),r=1<<n;e[n]=-1,t&=~r}}function su(e){if(0!=(6&Al))throw Error(a(327));wu();var t=ht(e,0);if(0==(1&t))return nu(e,Ye()),null;var n=mu(e,t);if(0!==e.tag&&2===n){var r=ft(e);0!==r&&(t=r,n=iu(e,r))}if(1===n)throw n=Pl,du(e,0),ou(e,t),nu(e,Ye()),n;if(6===n)throw Error(a(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,bu(e,Nl,Ul),nu(e,Ye()),null}function lu(e,t){var n=Al;Al|=1;try{return e(t)}finally{0===(Al=n)&&(Hl=Ye()+500,Hi&&zi())}}function uu(e){null!==jl&&0===jl.tag&&0==(6&Al)&&wu();var t=Al;Al|=1;var n=Sl.transition,r=xt;try{if(Sl.transition=null,xt=1,e)return e()}finally{xt=r,Sl.transition=n,0==(6&(Al=t))&&zi()}}function cu(){Bl=Rl.current,Ai(Rl)}function du(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,ii(n)),null!==Cl)for(n=Cl.return;null!==n;){var r=n;switch(Ba(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Di();break;case 3:eo(),Ai(Bi),Ai(Ti),oo();break;case 5:no(r);break;case 4:eo();break;case 13:case 19:Ai(ro);break;case 10:Qi(r.type._context);break;case 22:case 23:cu()}n=n.return}if(El=e,Cl=e=Pu(e.current,null),Tl=Bl=t,Ll=0,Pl=null,Fl=Il=Dl=0,Nl=kl=null,null!==ea){for(t=0;t<ea.length;t++)if(null!==(r=(n=ea[t]).interleaved)){n.interleaved=null;var i=r.next,a=n.pending;if(null!==a){var o=a.next;a.next=i,r.next=o}n.pending=r}ea=null}return e}function hu(e,t){for(;;){var n=Cl;try{if(Ki(),so.current=ns,fo){for(var r=co.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}fo=!1}if(uo=0,po=ho=co=null,mo=!1,go=0,Ml.current=null,null===n||null===n.return){Ll=1,Pl=t,Cl=null;break}e:{var o=e,s=n.return,l=n,u=t;if(t=Tl,l.flags|=32768,null!==u&&"object"==typeof u&&"function"==typeof u.then){var c=u,d=l,h=d.tag;if(0==(1&d.mode)&&(0===h||11===h||15===h)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=ms(s);if(null!==f){f.flags&=-257,gs(f,s,l,0,t),1&f.mode&&fs(o,c,t),u=c;var m=(t=f).updateQueue;if(null===m){var g=new Set;g.add(u),t.updateQueue=g}else m.add(u);break e}if(0==(1&t)){fs(o,c,t),fu();break e}u=Error(a(426))}else if(Pa&&1&l.mode){var v=ms(s);if(null!==v){0==(65536&v.flags)&&(v.flags|=256),gs(v,s,l,0,t),Ga(u);break e}}o=u,4!==Ll&&(Ll=2),null===kl?kl=[o]:kl.push(o),u=os(u,l),l=s;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t,sa(l,hs(0,u,t));break e;case 1:o=u;var y=l.type,x=l.stateNode;if(0==(128&l.flags)&&("function"==typeof y.getDerivedStateFromError||null!==x&&"function"==typeof x.componentDidCatch&&(null===Wl||!Wl.has(x)))){l.flags|=65536,t&=-t,l.lanes|=t,sa(l,ps(l,o,t));break e}}l=l.return}while(null!==l)}xu(n)}catch(e){t=e,Cl===n&&null!==n&&(Cl=n=n.return);continue}break}}function pu(){var e=_l.current;return _l.current=ns,null===e?ns:e}function fu(){0!==Ll&&3!==Ll&&2!==Ll||(Ll=4),null===El||0==(268435455&Dl)&&0==(268435455&Il)||ou(El,Tl)}function mu(e,t){var n=Al;Al|=2;var r=pu();for(El===e&&Tl===t||(Ul=null,du(e,t));;)try{gu();break}catch(t){hu(e,t)}if(Ki(),Al=n,_l.current=r,null!==Cl)throw Error(a(261));return El=null,Tl=0,Ll}function gu(){for(;null!==Cl;)yu(Cl)}function vu(){for(;null!==Cl&&!Ke();)yu(Cl)}function yu(e){var t=bl(e.alternate,e,Bl);e.memoizedProps=e.pendingProps,null===t?xu(e):Cl=t,Ml.current=null}function xu(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(32768&t.flags)){if(null!==(n=xs(n,t,Bl)))return void(Cl=n)}else{if(null!==(n=js(n,t)))return n.flags&=32767,void(Cl=n);if(null===e)return Ll=6,void(Cl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Cl=t);Cl=t=e}while(null!==t);0===Ll&&(Ll=5)}function bu(e,t,n){var r=xt,i=Sl.transition;try{Sl.transition=null,xt=1,function(e,t,n,r){do{wu()}while(null!==jl);if(0!=(6&Al))throw Error(a(327));n=e.finishedWork;var i=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(a(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-ot(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}(e,o),e===El&&(Cl=El=null,Tl=0),0==(2064&n.subtreeFlags)&&0==(2064&n.flags)||Vl||(Vl=!0,Tu(tt,(function(){return wu(),null}))),o=0!=(15990&n.flags),0!=(15990&n.subtreeFlags)||o){o=Sl.transition,Sl.transition=null;var s=xt;xt=1;var l=Al;Al|=4,Ml.current=null,function(e,t){if(ei=Vt,pr(e=hr())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch(e){n=null;break e}var s=0,l=-1,u=-1,c=0,d=0,h=e,p=null;t:for(;;){for(var f;h!==n||0!==i&&3!==h.nodeType||(l=s+i),h!==o||0!==r&&3!==h.nodeType||(u=s+r),3===h.nodeType&&(s+=h.nodeValue.length),null!==(f=h.firstChild);)p=h,h=f;for(;;){if(h===e)break t;if(p===n&&++c===i&&(l=s),p===o&&++d===r&&(u=s),null!==(f=h.nextSibling))break;p=(h=p).parentNode}h=f}n=-1===l||-1===u?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ti={focusedElem:e,selectionRange:n},Vt=!1,Ks=t;null!==Ks;)if(e=(t=Ks).child,0!=(1028&t.subtreeFlags)&&null!==e)e.return=t,Ks=e;else for(;null!==Ks;){t=Ks;try{var m=t.alternate;if(0!=(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==m){var g=m.memoizedProps,v=m.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:Vi(t.type,g),v);y.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var b=t.stateNode.containerInfo;if(1===b.nodeType)b.textContent="";else if(9===b.nodeType){var w=b.body;null!=w&&(w.textContent="")}break;default:throw Error(a(163))}}catch(e){Mu(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,Ks=e;break}Ks=t.return}m=Zs,Zs=!1}(e,n),pl(n,e),fr(ti),Vt=!!ei,ti=ei=null,e.current=n,ml(n,e,i),Qe(),Al=l,xt=s,Sl.transition=o}else e.current=n;if(Vl&&(Vl=!1,jl=e,Jl=i),0===(o=e.pendingLanes)&&(Wl=null),function(e){if(at&&"function"==typeof at.onCommitFiberRoot)try{at.onCommitFiberRoot(it,e,void 0,128==(128&e.current.flags))}catch(e){}}(n.stateNode),nu(e,Ye()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)r(t[n]);if(Gl)throw Gl=!1,e=zl,zl=null,e;0!=(1&Jl)&&0!==e.tag&&wu(),0!=(1&(o=e.pendingLanes))?e===Xl?ql++:(ql=0,Xl=e):ql=0,zi()}(e,t,n,r)}finally{Sl.transition=i,xt=r}return null}function wu(){if(null!==jl){var e=bt(Jl),t=Sl.transition,n=xt;try{if(Sl.transition=null,xt=16>e?16:e,null===jl)var r=!1;else{if(e=jl,jl=null,Jl=0,0!=(6&Al))throw Error(a(331));var i=Al;for(Al|=4,Ks=e.current;null!==Ks;){var o=Ks,s=o.child;if(0!=(16&Ks.flags)){var l=o.deletions;if(null!==l){for(var u=0;u<l.length;u++){var c=l[u];for(Ks=c;null!==Ks;){var d=Ks;switch(d.tag){case 0:case 11:case 15:$s(8,d,o)}var h=d.child;if(null!==h)h.return=d,Ks=h;else for(;null!==Ks;){var p=(d=Ks).sibling,f=d.return;if(nl(d),d===c){Ks=null;break}if(null!==p){p.return=f,Ks=p;break}Ks=f}}}var m=o.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(null!==g)}}Ks=o}}if(0!=(2064&o.subtreeFlags)&&null!==s)s.return=o,Ks=s;else e:for(;null!==Ks;){if(0!=(2048&(o=Ks).flags))switch(o.tag){case 0:case 11:case 15:$s(9,o,o.return)}var y=o.sibling;if(null!==y){y.return=o.return,Ks=y;break e}Ks=o.return}}var x=e.current;for(Ks=x;null!==Ks;){var b=(s=Ks).child;if(0!=(2064&s.subtreeFlags)&&null!==b)b.return=s,Ks=b;else e:for(s=x;null!==Ks;){if(0!=(2048&(l=Ks).flags))try{switch(l.tag){case 0:case 11:case 15:el(9,l)}}catch(e){Mu(l,l.return,e)}if(l===s){Ks=null;break e}var w=l.sibling;if(null!==w){w.return=l.return,Ks=w;break e}Ks=l.return}}if(Al=i,zi(),at&&"function"==typeof at.onPostCommitFiberRoot)try{at.onPostCommitFiberRoot(it,e)}catch(e){}r=!0}return r}finally{xt=n,Sl.transition=t}}return!1}function _u(e,t,n){aa(e,t=hs(0,t=os(n,t),1)),t=Yl(),null!==(e=eu(e,1))&&(vt(e,1,t),nu(e,t))}function Mu(e,t,n){if(3===e.tag)_u(e,e,n);else for(;null!==t;){if(3===t.tag){_u(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Wl||!Wl.has(r))){aa(t,e=ps(t,e=os(n,e),1)),e=Yl(),null!==(t=eu(t,1))&&(vt(t,1,e),nu(t,e));break}}t=t.return}}function Su(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Yl(),e.pingedLanes|=e.suspendedLanes&n,El===e&&(Tl&n)===n&&(4===Ll||3===Ll&&(130023424&Tl)===Tl&&500>Ye()-Ol?du(e,0):Fl|=n),nu(e,t)}function Au(e,t){0===t&&(0==(1&e.mode)?t=1:(t=ct,0==(130023424&(ct<<=1))&&(ct=4194304)));var n=Yl();null!==(e=eu(e,t))&&(vt(e,t,n),nu(e,n))}function Eu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Au(e,n)}function Cu(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(a(314))}null!==r&&r.delete(t),Au(e,n)}function Tu(e,t){return qe(e,t)}function Bu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ru(e,t,n,r){return new Bu(e,t,n,r)}function Lu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Pu(e,t){var n=e.alternate;return null===n?((n=Ru(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Du(e,t,n,r,i,o){var s=2;if(r=e,"function"==typeof e)Lu(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case M:return Iu(n.children,i,o,t);case S:s=8,i|=8;break;case A:return(e=Ru(12,n,t,2|i)).elementType=A,e.lanes=o,e;case B:return(e=Ru(13,n,t,i)).elementType=B,e.lanes=o,e;case R:return(e=Ru(19,n,t,i)).elementType=R,e.lanes=o,e;case D:return Fu(n,i,o,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case E:s=10;break e;case C:s=9;break e;case T:s=11;break e;case L:s=14;break e;case P:s=16,r=null;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Ru(s,n,t,i)).elementType=e,t.type=r,t.lanes=o,t}function Iu(e,t,n,r){return(e=Ru(7,e,r,t)).lanes=n,e}function Fu(e,t,n,r){return(e=Ru(22,e,r,t)).elementType=D,e.lanes=n,e.stateNode={},e}function ku(e,t,n){return(e=Ru(6,e,null,t)).lanes=n,e}function Nu(e,t,n){return(t=Ru(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ou(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gt(0),this.expirationTimes=gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Hu(e,t,n,r,i,a,o,s,l){return e=new Ou(e,t,n,s,l),1===t?(t=1,!0===a&&(t|=8)):t=0,a=Ru(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},na(a),e}function Uu(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:_,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function Gu(e){if(!e)return Ci;e:{if(ze(e=e._reactInternals)!==e||1!==e.tag)throw Error(a(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Pi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(a(171))}if(1===e.tag){var n=e.type;if(Pi(n))return Fi(e,n,t)}return t}function zu(e,t,n,r,i,a,o,s,l){return(e=Hu(n,r,!0,e,0,a,0,s,l)).context=Gu(null),n=e.current,(a=ia(r=Yl(),i=Zl(n))).callback=null!=t?t:null,aa(n,a),e.current.lanes=i,vt(e,i,r),nu(e,r),e}function Wu(e,t,n,r){var i=t.current,a=Yl(),o=Zl(i);return n=Gu(n),null===t.context?t.context=n:t.pendingContext=n,(t=ia(a,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),aa(i,t),null!==(e=$l(i,o,a))&&oa(e,i,o),o}function Vu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function ju(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Ju(e,t){ju(e,t),(e=e.alternate)&&ju(e,t)}bl=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Bi.current)ws=!0;else{if(0==(e.lanes&n)&&0==(128&t.flags))return ws=!1,function(e,t,n){switch(t.tag){case 3:Ls(t),Ua();break;case 5:to(t);break;case 1:Pi(t.type)&&ki(t);break;case 4:$a(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ei(ji,r._currentValue),r._currentValue=i;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Ei(ro,1&ro.current),t.flags|=128,null):0!=(n&t.child.childLanes)?ks(e,t,n):(Ei(ro,1&ro.current),null!==(e=Vs(e,t,n))?e.sibling:null);Ei(ro,1&ro.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(128&e.flags)){if(r)return Ws(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ei(ro,ro.current),r)break;return null;case 22:case 23:return t.lanes=0,Es(e,t,n)}return Vs(e,t,n)}(e,t,n);ws=0!=(131072&e.flags)}else ws=!1,Pa&&0!=(1048576&t.flags)&&Ca(t,ba,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps;var i=Li(t,Ti.current);Zi(t,n),i=bo(null,t,r,e,i,n);var o=wo();return t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Pi(r)?(o=!0,ki(t)):o=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,na(t),i.updater=ha,t.stateNode=i,i._reactInternals=t,ga(t,r,e,n),t=Rs(null,t,r,!0,o,n)):(t.tag=0,Pa&&o&&Ta(t),_s(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,r=(i=r._init)(r._payload),t.type=r,i=t.tag=function(e){if("function"==typeof e)return Lu(e)?1:0;if(null!=e){if((e=e.$$typeof)===T)return 11;if(e===L)return 14}return 2}(r),e=Vi(r,e),i){case 0:t=Ts(null,t,r,e,n);break e;case 1:t=Bs(null,t,r,e,n);break e;case 11:t=Ms(null,t,r,e,n);break e;case 14:t=Ss(null,t,r,Vi(r.type,e),n);break e}throw Error(a(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,Ts(e,t,r,i=t.elementType===r?i:Vi(r,i),n);case 1:return r=t.type,i=t.pendingProps,Bs(e,t,r,i=t.elementType===r?i:Vi(r,i),n);case 3:e:{if(Ls(t),null===e)throw Error(a(387));r=t.pendingProps,i=(o=t.memoizedState).element,ra(e,t),la(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=Ps(e,t,r,n,i=Error(a(423)));break e}if(r!==i){t=Ps(e,t,r,n,i=Error(a(424)));break e}for(La=ui(t.stateNode.containerInfo.firstChild),Ra=t,Pa=!0,Da=null,n=qa(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(Ua(),r===i){t=Vs(e,t,n);break e}_s(e,t,r,n)}t=t.child}return t;case 5:return to(t),null===e&&Na(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,s=i.children,ni(r,i)?s=null:null!==o&&ni(r,o)&&(t.flags|=32),Cs(e,t),_s(e,t,s,n),t.child;case 6:return null===e&&Na(t),null;case 13:return ks(e,t,n);case 4:return $a(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Ja(t,null,r,n):_s(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Ms(e,t,r,i=t.elementType===r?i:Vi(r,i),n);case 7:return _s(e,t,t.pendingProps,n),t.child;case 8:case 12:return _s(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,Ei(ji,r._currentValue),r._currentValue=s,null!==o)if(sr(o.value,s)){if(o.children===i.children&&!Bi.current){t=Vs(e,t,n);break e}}else for(null!==(o=t.child)&&(o.return=t);null!==o;){var l=o.dependencies;if(null!==l){s=o.child;for(var u=l.firstContext;null!==u;){if(u.context===r){if(1===o.tag){(u=ia(-1,n&-n)).tag=2;var c=o.updateQueue;if(null!==c){var d=(c=c.shared).pending;null===d?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}o.lanes|=n,null!==(u=o.alternate)&&(u.lanes|=n),Yi(o.return,n,t),l.lanes|=n;break}u=u.next}}else if(10===o.tag)s=o.type===t.type?null:o.child;else if(18===o.tag){if(null===(s=o.return))throw Error(a(341));s.lanes|=n,null!==(l=s.alternate)&&(l.lanes|=n),Yi(s,n,t),s=o.sibling}else s=o.child;if(null!==s)s.return=o;else for(s=o;null!==s;){if(s===t){s=null;break}if(null!==(o=s.sibling)){o.return=s.return,s=o;break}s=s.return}o=s}_s(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Zi(t,n),r=r(i=$i(i)),t.flags|=1,_s(e,t,r,n),t.child;case 14:return i=Vi(r=t.type,t.pendingProps),Ss(e,t,r,i=Vi(r.type,i),n);case 15:return As(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vi(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,Pi(r)?(e=!0,ki(t)):e=!1,Zi(t,n),fa(t,r,i),ga(t,r,i,n),Rs(null,t,r,!0,e,n);case 19:return Ws(e,t,n);case 22:return Es(e,t,n)}throw Error(a(156,t.tag))};var qu="function"==typeof reportError?reportError:function(e){console.error(e)};function Xu(e){this._internalRoot=e}function Ku(e){this._internalRoot=e}function Qu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Yu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Zu(){}function $u(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if("function"==typeof i){var s=i;i=function(){var e=Vu(o);s.call(e)}}Wu(t,o,e,i)}else o=function(e,t,n,r,i){if(i){if("function"==typeof r){var a=r;r=function(){var e=Vu(o);a.call(e)}}var o=zu(t,r,e,0,null,!1,0,"",Zu);return e._reactRootContainer=o,e[fi]=o.current,zr(8===e.nodeType?e.parentNode:e),uu(),o}for(;i=e.lastChild;)e.removeChild(i);if("function"==typeof r){var s=r;r=function(){var e=Vu(l);s.call(e)}}var l=Hu(e,0,!1,null,0,!1,0,"",Zu);return e._reactRootContainer=l,e[fi]=l.current,zr(8===e.nodeType?e.parentNode:e),uu((function(){Wu(t,l,n,r)})),l}(n,t,e,i,r);return Vu(o)}Ku.prototype.render=Xu.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(a(409));Wu(e,t,null,null)},Ku.prototype.unmount=Xu.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;uu((function(){Wu(null,e,null,null)})),t[fi]=null}},Ku.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dt.length&&0!==t&&t<Dt[n].priority;n++);Dt.splice(n,0,e),0===n&&Nt(e)}},wt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dt(t.pendingLanes);0!==n&&(yt(t,1|n),nu(t,Ye()),0==(6&Al)&&(Hl=Ye()+500,zi()))}break;case 13:var r=Yl();uu((function(){return $l(e,1,r)})),Ju(e,1)}},_t=function(e){13===e.tag&&($l(e,134217728,Yl()),Ju(e,134217728))},Mt=function(e){if(13===e.tag){var t=Yl(),n=Zl(e);$l(e,n,t),Ju(e,n)}},St=function(){return xt},At=function(e,t){var n=xt;try{return xt=e,t()}finally{xt=n}},_e=function(e,t,n){switch(t){case"input":if(Z(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=wi(r);if(!i)throw Error(a(90));q(r),Z(r,i)}}}break;case"textarea":ae(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Te=lu,Be=uu;var ec={usingClientEntryPoint:!1,Events:[xi,bi,wi,Ee,Ce,lu]},tc={findFiberByHostInstance:yi,bundleType:0,version:"18.1.0",rendererPackageName:"react-dom"},nc={bundleType:tc.bundleType,version:tc.version,rendererPackageName:tc.rendererPackageName,rendererConfig:tc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:b.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=je(e))?null:e.stateNode},findFiberByHostInstance:tc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.1.0-next-22edb9f77-20220426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{it=rc.inject(nc),at=rc}catch(ce){}}t.render=function(e,t,n){if(!Yu(t))throw Error(a(200));return $u(null,e,t,!1,n)}},3935:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(4448)},4203:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<a(i,t)))break e;e[r]=t,e[n]=i,n=r}}function r(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,o=i>>>1;r<o;){var s=2*(r+1)-1,l=e[s],u=s+1,c=e[u];if(0>a(l,n))u<i&&0>a(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[s]=n,r=s);else{if(!(u<i&&0>a(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var u=[],c=[],d=1,h=null,p=3,f=!1,m=!1,g=!1,v="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,x="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function w(e){if(g=!1,b(e),!m)if(null!==r(u))m=!0,D(_);else{var t=r(c);null!==t&&I(w,t.startTime-e)}}function _(e,n){m=!1,g&&(g=!1,y(E),E=-1),f=!0;var a=p;try{for(b(n),h=r(u);null!==h&&(!(h.expirationTime>n)||e&&!B());){var o=h.callback;if("function"==typeof o){h.callback=null,p=h.priorityLevel;var s=o(h.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?h.callback=s:h===r(u)&&i(u),b(n)}else i(u);h=r(u)}if(null!==h)var l=!0;else{var d=r(c);null!==d&&I(w,d.startTime-n),l=!1}return l}finally{h=null,p=a,f=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var M,S=!1,A=null,E=-1,C=5,T=-1;function B(){return!(t.unstable_now()-T<C)}function R(){if(null!==A){var e=t.unstable_now();T=e;var n=!0;try{n=A(!0,e)}finally{n?M():(S=!1,A=null)}}else S=!1}if("function"==typeof x)M=function(){x(R)};else if("undefined"!=typeof MessageChannel){var L=new MessageChannel,P=L.port2;L.port1.onmessage=R,M=function(){P.postMessage(null)}}else M=function(){v(R,0)};function D(e){A=e,S||(S=!0,M())}function I(e,n){E=v((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||f||(m=!0,D(_))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,i,a){var o=t.unstable_now();switch("object"==typeof a&&null!==a?a="number"==typeof(a=a.delay)&&0<a?o+a:o:a=o,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:d++,callback:i,priorityLevel:e,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>o?(e.sortIndex=a,n(c,e),null===r(u)&&e===r(c)&&(g?(y(E),E=-1):g=!0,I(w,a-o))):(e.sortIndex=s,n(u,e),m||f||(m=!0,D(_))),e},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},4142:(e,t,n)=>{"use strict";e.exports=n(4203)},6511:(e,t)=>{"use strict";t.ConcurrentRoot=1,t.ContinuousEventPriority=4,t.DefaultEventPriority=16,t.DiscreteEventPriority=1},7287:(e,t,n)=>{e.exports=function(e){var t={},r=n(7294),i=n(3840),a=Object.assign;function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,l=Symbol.for("react.element"),u=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),x=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var b=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var w=Symbol.iterator;function _(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=w&&e[w]||e["@@iterator"])?e:null}function M(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case c:return"Fragment";case u:return"Portal";case h:return"Profiler";case d:return"StrictMode";case g:return"Suspense";case v:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case f:return(e.displayName||"Context")+".Consumer";case p:return(e._context.displayName||"Context")+".Provider";case m:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case y:return null!==(t=e.displayName||null)?t:M(e.type)||"Memo";case x:t=e._payload,e=e._init;try{return M(e(t))}catch(e){}}return null}function S(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return M(t);case 8:return t===d?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function A(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function E(e){if(A(e)!==e)throw Error(o(188))}function C(e){var t=e.alternate;if(!t){if(null===(t=A(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(r=i.return)){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return E(i),e;if(a===r)return E(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}function T(e){return null!==(e=C(e))?B(e):null}function B(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=B(e);if(null!==t)return t;e=e.sibling}return null}function R(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){if(4!==e.tag){var t=R(e);if(null!==t)return t}e=e.sibling}return null}var L,P=Array.isArray,D=e.getPublicInstance,I=e.getRootHostContext,F=e.getChildHostContext,k=e.prepareForCommit,N=e.resetAfterCommit,O=e.createInstance,H=e.appendInitialChild,U=e.finalizeInitialChildren,G=e.prepareUpdate,z=e.shouldSetTextContent,W=e.createTextInstance,V=e.scheduleTimeout,j=e.cancelTimeout,J=e.noTimeout,q=e.isPrimaryRenderer,X=e.supportsMutation,K=e.supportsPersistence,Q=e.supportsHydration,Y=e.getInstanceFromNode,Z=e.preparePortalMount,$=e.getCurrentEventPriority,ee=e.detachDeletedInstance,te=e.supportsMicrotasks,ne=e.scheduleMicrotask,re=e.supportsTestSelectors,ie=e.findFiberRoot,ae=e.getBoundingRect,oe=e.getTextContent,se=e.isHiddenSubtree,le=e.matchAccessibilityRole,ue=e.setFocusIfFocusable,ce=e.setupIntersectionObserver,de=e.appendChild,he=e.appendChildToContainer,pe=e.commitTextUpdate,fe=e.commitMount,me=e.commitUpdate,ge=e.insertBefore,ve=e.insertInContainerBefore,ye=e.removeChild,xe=e.removeChildFromContainer,be=e.resetTextContent,we=e.hideInstance,_e=e.hideTextInstance,Me=e.unhideInstance,Se=e.unhideTextInstance,Ae=e.clearContainer,Ee=e.cloneInstance,Ce=e.createContainerChildSet,Te=e.appendChildToContainerChildSet,Be=e.finalizeContainerChildren,Re=e.replaceContainerChildren,Le=e.cloneHiddenInstance,Pe=e.cloneHiddenTextInstance,De=e.canHydrateInstance,Ie=e.canHydrateTextInstance,Fe=e.canHydrateSuspenseInstance,ke=e.isSuspenseInstancePending,Ne=e.isSuspenseInstanceFallback,Oe=e.registerSuspenseInstanceRetry,He=e.getNextHydratableSibling,Ue=e.getFirstHydratableChild,Ge=e.getFirstHydratableChildWithinContainer,ze=e.getFirstHydratableChildWithinSuspenseInstance,We=e.hydrateInstance,Ve=e.hydrateTextInstance,je=e.hydrateSuspenseInstance,Je=e.getNextHydratableInstanceAfterSuspenseInstance,qe=e.commitHydratedContainer,Xe=e.commitHydratedSuspenseInstance,Ke=e.clearSuspenseBoundary,Qe=e.clearSuspenseBoundaryFromContainer,Ye=e.shouldDeleteUnhydratedTailInstances,Ze=e.didNotMatchHydratedContainerTextInstance,$e=e.didNotMatchHydratedTextInstance;function et(e){if(void 0===L)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);L=t&&t[1]||""}return"\n"+L+e}var tt=!1;function nt(e,t){if(!e||tt)return"";tt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),a=r.stack.split("\n"),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(1!==o||1!==s)do{if(o--,0>--s||i[o]!==a[s]){var l="\n"+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=o&&0<=s);break}}}finally{tt=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?et(e):""}var rt=Object.prototype.hasOwnProperty,it=[],at=-1;function ot(e){return{current:e}}function st(e){0>at||(e.current=it[at],it[at]=null,at--)}function lt(e,t){at++,it[at]=e.current,e.current=t}var ut={},ct=ot(ut),dt=ot(!1),ht=ut;function pt(e,t){var n=e.type.contextTypes;if(!n)return ut;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function ft(e){return null!=(e=e.childContextTypes)}function mt(){st(dt),st(ct)}function gt(e,t,n){if(ct.current!==ut)throw Error(o(168));lt(ct,t),lt(dt,n)}function vt(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(o(108,S(e)||"Unknown",i));return a({},n,r)}function yt(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ut,ht=ct.current,lt(ct,e),lt(dt,dt.current),!0}function xt(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=vt(e,t,ht),r.__reactInternalMemoizedMergedChildContext=e,st(dt),st(ct),lt(ct,e)):st(dt),lt(dt,n)}var bt=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(wt(e)/_t|0)|0},wt=Math.log,_t=Math.LN2;var Mt=64,St=4194304;function At(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Et(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=268435455&n;if(0!==o){var s=o&~i;0!==s?r=At(s):0!==(a&=o)&&(r=At(a))}else 0!==(o=n&~i)?r=At(o):0!==a&&(r=At(a));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&i)&&((i=r&-r)>=(a=t&-t)||16===i&&0!=(4194240&a)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-bt(t)),r|=e[n],t&=~i;return r}function Ct(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function Tt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function Bt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Rt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-bt(t)]=n}function Lt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-bt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Pt=0;function Dt(e){return 1<(e&=-e)?4<e?0!=(268435455&e)?16:536870912:4:1}var It=i.unstable_scheduleCallback,Ft=i.unstable_cancelCallback,kt=i.unstable_shouldYield,Nt=i.unstable_requestPaint,Ot=i.unstable_now,Ht=i.unstable_ImmediatePriority,Ut=i.unstable_UserBlockingPriority,Gt=i.unstable_NormalPriority,zt=i.unstable_IdlePriority,Wt=null,Vt=null;var jt="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Jt=null,qt=!1,Xt=!1;function Kt(e){null===Jt?Jt=[e]:Jt.push(e)}function Qt(){if(!Xt&&null!==Jt){Xt=!0;var e=0,t=Pt;try{var n=Jt;for(Pt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Jt=null,qt=!1}catch(t){throw null!==Jt&&(Jt=Jt.slice(e+1)),It(Ht,Qt),t}finally{Pt=t,Xt=!1}}return null}var Yt=s.ReactCurrentBatchConfig;function Zt(e,t){if(jt(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!rt.call(t,i)||!jt(e[i],t[i]))return!1}return!0}function $t(e){switch(e.tag){case 5:return et(e.type);case 16:return et("Lazy");case 13:return et("Suspense");case 19:return et("SuspenseList");case 0:case 2:case 15:return e=nt(e.type,!1);case 11:return e=nt(e.type.render,!1);case 1:return e=nt(e.type,!0);default:return""}}function en(e,t){if(e&&e.defaultProps){for(var n in t=a({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var tn=ot(null),nn=null,rn=null,an=null;function on(){an=rn=nn=null}function sn(e,t,n){q?(lt(tn,t._currentValue),t._currentValue=n):(lt(tn,t._currentValue2),t._currentValue2=n)}function ln(e){var t=tn.current;st(tn),q?e._currentValue=t:e._currentValue2=t}function un(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function cn(e,t){nn=e,an=rn=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(ki=!0),e.firstContext=null)}function dn(e){var t=q?e._currentValue:e._currentValue2;if(an!==e)if(e={context:e,memoizedValue:t,next:null},null===rn){if(null===nn)throw Error(o(308));rn=e,nn.dependencies={lanes:0,firstContext:e}}else rn=rn.next=e;return t}var hn=null,pn=!1;function fn(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mn(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function gn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function vn(e,t){var n=e.updateQueue;null!==n&&(n=n.shared,null!==Xa&&0!=(1&e.mode)&&0==(2&qa)?(null===(e=n.interleaved)?(t.next=t,null===hn?hn=[n]:hn.push(n)):(t.next=e.next,e.next=t),n.interleaved=t):(null===(e=n.pending)?t.next=t:(t.next=e.next,e.next=t),n.pending=t))}function yn(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Lt(e,n)}}function xn(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?i=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?i=a=t:a=a.next=t}else i=a=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function bn(e,t,n,r){var i=e.updateQueue;pn=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(null!==l){i.shared.pending=null;var u=l,c=u.next;u.next=null,null===s?o=c:s.next=c,s=u;var d=e.alternate;null!==d&&((l=(d=d.updateQueue).lastBaseUpdate)!==s&&(null===l?d.firstBaseUpdate=c:l.next=c,d.lastBaseUpdate=u))}if(null!==o){var h=i.baseState;for(s=0,d=c=u=null,l=o;;){var p=l.lane,f=l.eventTime;if((r&p)===p){null!==d&&(d=d.next={eventTime:f,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,g=l;switch(p=t,f=n,g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(f,h,p);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(p="function"==typeof(m=g.payload)?m.call(f,h,p):m))break e;h=a({},h,p);break e;case 2:pn=!0}}null!==l.callback&&0!==l.lane&&(e.flags|=64,null===(p=i.effects)?i.effects=[l]:p.push(l))}else f={eventTime:f,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},null===d?(c=d=f,u=h):d=d.next=f,s|=p;if(null===(l=l.next)){if(null===(l=i.shared.pending))break;l=(p=l).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}if(null===d&&(u=h),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=d,null!==(t=i.shared.interleaved)){i=t;do{s|=i.lane,i=i.next}while(i!==t)}else null===o&&(i.shared.lanes=0);to|=s,e.lanes=s,e.memoizedState=h}}function wn(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(o(191,i));i.call(r)}}}var _n=(new r.Component).refs;function Mn(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:a({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Sn={isMounted:function(e){return!!(e=e._reactInternals)&&A(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=wo(),i=_o(e),a=gn(r,i);a.payload=t,null!=n&&(a.callback=n),vn(e,a),null!==(t=Mo(e,i,r))&&yn(t,e,i)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=wo(),i=_o(e),a=gn(r,i);a.tag=1,a.payload=t,null!=n&&(a.callback=n),vn(e,a),null!==(t=Mo(e,i,r))&&yn(t,e,i)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wo(),r=_o(e),i=gn(n,r);i.tag=2,null!=t&&(i.callback=t),vn(e,i),null!==(t=Mo(e,r,n))&&yn(t,e,r)}};function An(e,t,n,r,i,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!Zt(n,r)||!Zt(i,a))}function En(e,t,n){var r=!1,i=ut,a=t.contextType;return"object"==typeof a&&null!==a?a=dn(a):(i=ft(t)?ht:ct.current,a=(r=null!=(r=t.contextTypes))?pt(e,i):ut),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Sn,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Cn(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Sn.enqueueReplaceState(t,t.state,null)}function Tn(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=_n,fn(e);var a=t.contextType;"object"==typeof a&&null!==a?i.context=dn(a):(a=ft(t)?ht:ct.current,i.context=pt(e,a)),i.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(Mn(e,t,a,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&Sn.enqueueReplaceState(i,i.state,null),bn(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4194308)}var Bn=[],Rn=0,Ln=null,Pn=0,Dn=[],In=0,Fn=null,kn=1,Nn="";function On(e,t){Bn[Rn++]=Pn,Bn[Rn++]=Ln,Ln=e,Pn=t}function Hn(e,t,n){Dn[In++]=kn,Dn[In++]=Nn,Dn[In++]=Fn,Fn=e;var r=kn;e=Nn;var i=32-bt(r)-1;r&=~(1<<i),n+=1;var a=32-bt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,kn=1<<32-bt(t)+i|n<<i|r,Nn=a+e}else kn=1<<a|n<<i|r,Nn=e}function Un(e){null!==e.return&&(On(e,1),Hn(e,1,0))}function Gn(e){for(;e===Ln;)Ln=Bn[--Rn],Bn[Rn]=null,Pn=Bn[--Rn],Bn[Rn]=null;for(;e===Fn;)Fn=Dn[--In],Dn[In]=null,Nn=Dn[--In],Dn[In]=null,kn=Dn[--In],Dn[In]=null}var zn=null,Wn=null,Vn=!1,jn=!1,Jn=null;function qn(e,t){var n=Zo(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function Xn(e,t){switch(e.tag){case 5:return null!==(t=De(t,e.type,e.pendingProps))&&(e.stateNode=t,zn=e,Wn=Ue(t),!0);case 6:return null!==(t=Ie(t,e.pendingProps))&&(e.stateNode=t,zn=e,Wn=null,!0);case 13:if(null!==(t=Fe(t))){var n=null!==Fn?{id:kn,overflow:Nn}:null;return e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Zo(18,null,null,0)).stateNode=t,n.return=e,e.child=n,zn=e,Wn=null,!0}return!1;default:return!1}}function Kn(e){return 0!=(1&e.mode)&&0==(128&e.flags)}function Qn(e){if(Vn){var t=Wn;if(t){var n=t;if(!Xn(e,t)){if(Kn(e))throw Error(o(418));t=He(n);var r=zn;t&&Xn(e,t)?qn(r,n):(e.flags=-4097&e.flags|2,Vn=!1,zn=e)}}else{if(Kn(e))throw Error(o(418));e.flags=-4097&e.flags|2,Vn=!1,zn=e}}}function Yn(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;zn=e}function Zn(e){if(!Q||e!==zn)return!1;if(!Vn)return Yn(e),Vn=!0,!1;if(3!==e.tag&&(5!==e.tag||Ye(e.type)&&!z(e.type,e.memoizedProps))){var t=Wn;if(t){if(Kn(e)){for(e=Wn;e;)e=He(e);throw Error(o(418))}for(;t;)qn(e,t),t=He(t)}}if(Yn(e),13===e.tag){if(!Q)throw Error(o(316));if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));Wn=Je(e)}else Wn=zn?He(e.stateNode):null;return!0}function $n(){Q&&(Wn=zn=null,jn=Vn=!1)}function er(e){null===Jn?Jn=[e]:Jn.push(e)}function tr(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var r=n.stateNode}if(!r)throw Error(o(147,e));var i=r,a=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=i.refs;t===_n&&(t=i.refs={}),null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!=typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function nr(e,t){throw e=Object.prototype.toString.call(t),Error(o(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function rr(e){return(0,e._init)(e._payload)}function ir(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=es(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function d(e,t,n,r){return null===t||6!==t.tag?((t=is(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n,r){var a=n.type;return a===c?f(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===a||"object"==typeof a&&null!==a&&a.$$typeof===x&&rr(a)===t.type)?((r=i(t,n.props)).ref=tr(e,t,n),r.return=e,r):((r=ts(n.type,n.key,n.props,null,e.mode,r)).ref=tr(e,t,n),r.return=e,r)}function p(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=as(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function f(e,t,n,r,a){return null===t||7!==t.tag?((t=ns(n,e.mode,r,a)).return=e,t):((t=i(t,n)).return=e,t)}function m(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=is(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case l:return(n=ts(t.type,t.key,t.props,null,e.mode,n)).ref=tr(e,null,t),n.return=e,n;case u:return(t=as(t,e.mode,n)).return=e,t;case x:return m(e,(0,t._init)(t._payload),n)}if(P(t)||_(t))return(t=ns(t,e.mode,n,null)).return=e,t;nr(e,t)}return null}function g(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==i?null:d(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case l:return n.key===i?h(e,t,n,r):null;case u:return n.key===i?p(e,t,n,r):null;case x:return g(e,t,(i=n._init)(n._payload),r)}if(P(n)||_(n))return null!==i?null:f(e,t,n,r,null);nr(e,n)}return null}function v(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r)return d(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case l:return h(t,e=e.get(null===r.key?n:r.key)||null,r,i);case u:return p(t,e=e.get(null===r.key?n:r.key)||null,r,i);case x:return v(e,t,n,(0,r._init)(r._payload),i)}if(P(r)||_(r))return f(t,e=e.get(n)||null,r,i,null);nr(t,r)}return null}function y(i,o,s,l){for(var u=null,c=null,d=o,h=o=0,p=null;null!==d&&h<s.length;h++){d.index>h?(p=d,d=null):p=d.sibling;var f=g(i,d,s[h],l);if(null===f){null===d&&(d=p);break}e&&d&&null===f.alternate&&t(i,d),o=a(f,o,h),null===c?u=f:c.sibling=f,c=f,d=p}if(h===s.length)return n(i,d),Vn&&On(i,h),u;if(null===d){for(;h<s.length;h++)null!==(d=m(i,s[h],l))&&(o=a(d,o,h),null===c?u=d:c.sibling=d,c=d);return Vn&&On(i,h),u}for(d=r(i,d);h<s.length;h++)null!==(p=v(d,i,h,s[h],l))&&(e&&null!==p.alternate&&d.delete(null===p.key?h:p.key),o=a(p,o,h),null===c?u=p:c.sibling=p,c=p);return e&&d.forEach((function(e){return t(i,e)})),Vn&&On(i,h),u}function b(i,s,l,u){var c=_(l);if("function"!=typeof c)throw Error(o(150));if(null==(l=c.call(l)))throw Error(o(151));for(var d=c=null,h=s,p=s=0,f=null,y=l.next();null!==h&&!y.done;p++,y=l.next()){h.index>p?(f=h,h=null):f=h.sibling;var x=g(i,h,y.value,u);if(null===x){null===h&&(h=f);break}e&&h&&null===x.alternate&&t(i,h),s=a(x,s,p),null===d?c=x:d.sibling=x,d=x,h=f}if(y.done)return n(i,h),Vn&&On(i,p),c;if(null===h){for(;!y.done;p++,y=l.next())null!==(y=m(i,y.value,u))&&(s=a(y,s,p),null===d?c=y:d.sibling=y,d=y);return Vn&&On(i,p),c}for(h=r(i,h);!y.done;p++,y=l.next())null!==(y=v(h,i,p,y.value,u))&&(e&&null!==y.alternate&&h.delete(null===y.key?p:y.key),s=a(y,s,p),null===d?c=y:d.sibling=y,d=y);return e&&h.forEach((function(e){return t(i,e)})),Vn&&On(i,p),c}return function e(r,a,o,d){if("object"==typeof o&&null!==o&&o.type===c&&null===o.key&&(o=o.props.children),"object"==typeof o&&null!==o){switch(o.$$typeof){case l:e:{for(var h=o.key,p=a;null!==p;){if(p.key===h){if((h=o.type)===c){if(7===p.tag){n(r,p.sibling),(a=i(p,o.props.children)).return=r,r=a;break e}}else if(p.elementType===h||"object"==typeof h&&null!==h&&h.$$typeof===x&&rr(h)===p.type){n(r,p.sibling),(a=i(p,o.props)).ref=tr(r,p,o),a.return=r,r=a;break e}n(r,p);break}t(r,p),p=p.sibling}o.type===c?((a=ns(o.props.children,r.mode,d,o.key)).return=r,r=a):((d=ts(o.type,o.key,o.props,null,r.mode,d)).ref=tr(r,a,o),d.return=r,r=d)}return s(r);case u:e:{for(p=o.key;null!==a;){if(a.key===p){if(4===a.tag&&a.stateNode.containerInfo===o.containerInfo&&a.stateNode.implementation===o.implementation){n(r,a.sibling),(a=i(a,o.children||[])).return=r,r=a;break e}n(r,a);break}t(r,a),a=a.sibling}(a=as(o,r.mode,d)).return=r,r=a}return s(r);case x:return e(r,a,(p=o._init)(o._payload),d)}if(P(o))return y(r,a,o,d);if(_(o))return b(r,a,o,d);nr(r,o)}return"string"==typeof o&&""!==o||"number"==typeof o?(o=""+o,null!==a&&6===a.tag?(n(r,a.sibling),(a=i(a,o)).return=r,r=a):(n(r,a),(a=is(o,r.mode,d)).return=r,r=a),s(r)):n(r,a)}}var ar=ir(!0),or=ir(!1),sr={},lr=ot(sr),ur=ot(sr),cr=ot(sr);function dr(e){if(e===sr)throw Error(o(174));return e}function hr(e,t){lt(cr,t),lt(ur,e),lt(lr,sr),e=I(t),st(lr),lt(lr,e)}function pr(){st(lr),st(ur),st(cr)}function fr(e){var t=dr(cr.current),n=dr(lr.current);n!==(t=F(n,e.type,t))&&(lt(ur,e),lt(lr,t))}function mr(e){ur.current===e&&(st(lr),st(ur))}var gr=ot(0);function vr(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||ke(n)||Ne(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var yr=[];function xr(){for(var e=0;e<yr.length;e++){var t=yr[e];q?t._workInProgressVersionPrimary=null:t._workInProgressVersionSecondary=null}yr.length=0}var br=s.ReactCurrentDispatcher,wr=s.ReactCurrentBatchConfig,_r=0,Mr=null,Sr=null,Ar=null,Er=!1,Cr=!1,Tr=0,Br=0;function Rr(){throw Error(o(321))}function Lr(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jt(e[n],t[n]))return!1;return!0}function Pr(e,t,n,r,i,a){if(_r=a,Mr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,br.current=null===e||null===e.memoizedState?fi:mi,e=n(r,i),Cr){a=0;do{if(Cr=!1,Tr=0,25<=a)throw Error(o(301));a+=1,Ar=Sr=null,t.updateQueue=null,br.current=gi,e=n(r,i)}while(Cr)}if(br.current=pi,t=null!==Sr&&null!==Sr.next,_r=0,Ar=Sr=Mr=null,Er=!1,t)throw Error(o(300));return e}function Dr(){var e=0!==Tr;return Tr=0,e}function Ir(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ar?Mr.memoizedState=Ar=e:Ar=Ar.next=e,Ar}function Fr(){if(null===Sr){var e=Mr.alternate;e=null!==e?e.memoizedState:null}else e=Sr.next;var t=null===Ar?Mr.memoizedState:Ar.next;if(null!==t)Ar=t,Sr=e;else{if(null===e)throw Error(o(310));e={memoizedState:(Sr=e).memoizedState,baseState:Sr.baseState,baseQueue:Sr.baseQueue,queue:Sr.queue,next:null},null===Ar?Mr.memoizedState=Ar=e:Ar=Ar.next=e}return Ar}function kr(e,t){return"function"==typeof t?t(e):t}function Nr(e){var t=Fr(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=Sr,i=r.baseQueue,a=n.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}r.baseQueue=i=a,n.pending=null}if(null!==i){a=i.next,r=r.baseState;var l=s=null,u=null,c=a;do{var d=c.lane;if((_r&d)===d)null!==u&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var h={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===u?(l=u=h,s=r):u=u.next=h,Mr.lanes|=d,to|=d}c=c.next}while(null!==c&&c!==a);null===u?s=r:u.next=l,jt(r,t.memoizedState)||(ki=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=u,n.lastRenderedState=r}if(null!==(e=n.interleaved)){i=e;do{a=i.lane,Mr.lanes|=a,to|=a,i=i.next}while(i!==e)}else null===i&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Or(e){var t=Fr(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{a=e(a,s.action),s=s.next}while(s!==i);jt(a,t.memoizedState)||(ki=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Hr(){}function Ur(e,t){var n=Mr,r=Fr(),i=t(),a=!jt(r.memoizedState,i);if(a&&(r.memoizedState=i,ki=!0),r=r.queue,Yr(Wr.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||null!==Ar&&1&Ar.memoizedState.tag){if(n.flags|=2048,Jr(9,zr.bind(null,n,r,i,t),void 0,null),null===Xa)throw Error(o(349));0!=(30&_r)||Gr(n,t,i)}return i}function Gr(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=Mr.updateQueue)?(t={lastEffect:null,stores:null},Mr.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function zr(e,t,n,r){t.value=n,t.getSnapshot=r,Vr(t)&&Mo(e,1,-1)}function Wr(e,t,n){return n((function(){Vr(t)&&Mo(e,1,-1)}))}function Vr(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jt(e,n)}catch(e){return!0}}function jr(e){var t=Ir();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:kr,lastRenderedState:e},t.queue=e,e=e.dispatch=li.bind(null,Mr,e),[t.memoizedState,e]}function Jr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Mr.updateQueue)?(t={lastEffect:null,stores:null},Mr.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function qr(){return Fr().memoizedState}function Xr(e,t,n,r){var i=Ir();Mr.flags|=e,i.memoizedState=Jr(1|t,n,void 0,void 0===r?null:r)}function Kr(e,t,n,r){var i=Fr();r=void 0===r?null:r;var a=void 0;if(null!==Sr){var o=Sr.memoizedState;if(a=o.destroy,null!==r&&Lr(r,o.deps))return void(i.memoizedState=Jr(t,n,a,r))}Mr.flags|=e,i.memoizedState=Jr(1|t,n,a,r)}function Qr(e,t){return Xr(8390656,8,e,t)}function Yr(e,t){return Kr(2048,8,e,t)}function Zr(e,t){return Kr(4,2,e,t)}function $r(e,t){return Kr(4,4,e,t)}function ei(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function ti(e,t,n){return n=null!=n?n.concat([e]):null,Kr(4,4,ei.bind(null,t,e),n)}function ni(){}function ri(e,t){var n=Fr();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Lr(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ii(e,t){var n=Fr();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Lr(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ai(e,t){var n=Pt;Pt=0!==n&&4>n?n:4,e(!0);var r=wr.transition;wr.transition={};try{e(!1),t()}finally{Pt=n,wr.transition=r}}function oi(){return Fr().memoizedState}function si(e,t,n){var r=_o(e);n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ui(e)?ci(t,n):(di(e,t,n),null!==(e=Mo(e,r,n=wo()))&&hi(e,t,r))}function li(e,t,n){var r=_o(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ui(e))ci(t,i);else{di(e,t,i);var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,jt(s,o))return}catch(e){}null!==(e=Mo(e,r,n=wo()))&&hi(e,t,r)}}function ui(e){var t=e.alternate;return e===Mr||null!==t&&t===Mr}function ci(e,t){Cr=Er=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function di(e,t,n){null!==Xa&&0!=(1&e.mode)&&0==(2&qa)?(null===(e=t.interleaved)?(n.next=n,null===hn?hn=[t]:hn.push(t)):(n.next=e.next,e.next=n),t.interleaved=n):(null===(e=t.pending)?n.next=n:(n.next=e.next,e.next=n),t.pending=n)}function hi(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Lt(e,n)}}var pi={readContext:dn,useCallback:Rr,useContext:Rr,useEffect:Rr,useImperativeHandle:Rr,useInsertionEffect:Rr,useLayoutEffect:Rr,useMemo:Rr,useReducer:Rr,useRef:Rr,useState:Rr,useDebugValue:Rr,useDeferredValue:Rr,useTransition:Rr,useMutableSource:Rr,useSyncExternalStore:Rr,useId:Rr,unstable_isNewReconciler:!1},fi={readContext:dn,useCallback:function(e,t){return Ir().memoizedState=[e,void 0===t?null:t],e},useContext:dn,useEffect:Qr,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Xr(4194308,4,ei.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xr(4,2,e,t)},useMemo:function(e,t){var n=Ir();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ir();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=si.bind(null,Mr,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Ir().memoizedState=e},useState:jr,useDebugValue:ni,useDeferredValue:function(e){var t=jr(e),n=t[0],r=t[1];return Qr((function(){var t=wr.transition;wr.transition={};try{r(e)}finally{wr.transition=t}}),[e]),n},useTransition:function(){var e=jr(!1),t=e[0];return e=ai.bind(null,e[1]),Ir().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Mr,i=Ir();if(Vn){if(void 0===n)throw Error(o(407));n=n()}else{if(n=t(),null===Xa)throw Error(o(349));0!=(30&_r)||Gr(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Qr(Wr.bind(null,r,a,e),[e]),r.flags|=2048,Jr(9,zr.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Ir(),t=Xa.identifierPrefix;if(Vn){var n=Nn;t=":"+t+"R"+(n=(kn&~(1<<32-bt(kn)-1)).toString(32)+n),0<(n=Tr++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=Br++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},mi={readContext:dn,useCallback:ri,useContext:dn,useEffect:Yr,useImperativeHandle:ti,useInsertionEffect:Zr,useLayoutEffect:$r,useMemo:ii,useReducer:Nr,useRef:qr,useState:function(){return Nr(kr)},useDebugValue:ni,useDeferredValue:function(e){var t=Nr(kr),n=t[0],r=t[1];return Yr((function(){var t=wr.transition;wr.transition={};try{r(e)}finally{wr.transition=t}}),[e]),n},useTransition:function(){return[Nr(kr)[0],Fr().memoizedState]},useMutableSource:Hr,useSyncExternalStore:Ur,useId:oi,unstable_isNewReconciler:!1},gi={readContext:dn,useCallback:ri,useContext:dn,useEffect:Yr,useImperativeHandle:ti,useInsertionEffect:Zr,useLayoutEffect:$r,useMemo:ii,useReducer:Or,useRef:qr,useState:function(){return Or(kr)},useDebugValue:ni,useDeferredValue:function(e){var t=Or(kr),n=t[0],r=t[1];return Yr((function(){var t=wr.transition;wr.transition={};try{r(e)}finally{wr.transition=t}}),[e]),n},useTransition:function(){return[Or(kr)[0],Fr().memoizedState]},useMutableSource:Hr,useSyncExternalStore:Ur,useId:oi,unstable_isNewReconciler:!1};function vi(e,t){try{var n="",r=t;do{n+=$t(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i}}function yi(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}var xi,bi,wi,_i,Mi="function"==typeof WeakMap?WeakMap:Map;function Si(e,t,n){(n=gn(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){co||(co=!0,ho=r),yi(0,t)},n}function Ai(e,t,n){(n=gn(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){yi(0,t)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){yi(0,t),"function"!=typeof r&&(null===po?po=new Set([this]):po.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function Ei(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new Mi;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Jo.bind(null,e,t,n),t.then(e,e))}function Ci(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function Ti(e,t,n,r,i){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=gn(-1,1)).tag=2,vn(n,t))),n.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}function Bi(e){e.flags|=4}function Ri(e,t){if(null!==e&&e.child===t.child)return!0;if(0!=(16&t.flags))return!1;for(e=t.child;null!==e;){if(0!=(12854&e.flags)||0!=(12854&e.subtreeFlags))return!1;e=e.sibling}return!0}if(X)xi=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)H(e,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},bi=function(){},wi=function(e,t,n,r,i){if((e=e.memoizedProps)!==r){var a=t.stateNode,o=dr(lr.current);n=G(a,n,e,r,i,o),(t.updateQueue=n)&&Bi(t)}},_i=function(e,t,n,r){n!==r&&Bi(t)};else if(K){xi=function(e,t,n,r){for(var i=t.child;null!==i;){if(5===i.tag){var a=i.stateNode;n&&r&&(a=Le(a,i.type,i.memoizedProps,i)),H(e,a)}else if(6===i.tag)a=i.stateNode,n&&r&&(a=Pe(a,i.memoizedProps,i)),H(e,a);else if(4!==i.tag)if(22===i.tag&&null!==i.memoizedState)null!==(a=i.child)&&(a.return=i),xi(e,i,!0,!0);else if(null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};var Li=function(e,t,n,r){for(var i=t.child;null!==i;){if(5===i.tag){var a=i.stateNode;n&&r&&(a=Le(a,i.type,i.memoizedProps,i)),Te(e,a)}else if(6===i.tag)a=i.stateNode,n&&r&&(a=Pe(a,i.memoizedProps,i)),Te(e,a);else if(4!==i.tag)if(22===i.tag&&null!==i.memoizedState)null!==(a=i.child)&&(a.return=i),Li(e,i,!0,!0);else if(null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};bi=function(e,t){var n=t.stateNode;if(!Ri(e,t)){e=n.containerInfo;var r=Ce(e);Li(r,t,!1,!1),n.pendingChildren=r,Bi(t),Be(e,r)}},wi=function(e,t,n,r,i){var a=e.stateNode,o=e.memoizedProps;if((e=Ri(e,t))&&o===r)t.stateNode=a;else{var s=t.stateNode,l=dr(lr.current),u=null;o!==r&&(u=G(s,n,o,r,i,l)),e&&null===u?t.stateNode=a:(a=Ee(a,u,n,o,r,t,e,s),U(a,n,r,i,l)&&Bi(t),t.stateNode=a,e?Bi(t):xi(a,t,!1,!1))}},_i=function(e,t,n,r){n!==r?(e=dr(cr.current),n=dr(lr.current),t.stateNode=W(r,e,n,t),Bi(t)):t.stateNode=e.stateNode}}else bi=function(){},wi=function(){},_i=function(){};function Pi(e,t){if(!Vn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Di(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ii(e,t,n){var r=t.pendingProps;switch(Gn(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Di(t),null;case 1:case 17:return ft(t.type)&&mt(),Di(t),null;case 3:return r=t.stateNode,pr(),st(dt),st(ct),xr(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Zn(t)?Bi(t):null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==Jn&&(To(Jn),Jn=null))),bi(e,t),Di(t),null;case 5:mr(t),n=dr(cr.current);var i=t.type;if(null!==e&&null!=t.stateNode)wi(e,t,i,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(o(166));return Di(t),null}if(e=dr(lr.current),Zn(t)){if(!Q)throw Error(o(175));e=We(t.stateNode,t.type,t.memoizedProps,n,e,t,!jn),t.updateQueue=e,null!==e&&Bi(t)}else{var a=O(i,r,n,e,t);xi(a,t,!1,!1),t.stateNode=a,U(a,i,r,n,e)&&Bi(t)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Di(t),null;case 6:if(e&&null!=t.stateNode)_i(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(e=dr(cr.current),n=dr(lr.current),Zn(t)){if(!Q)throw Error(o(176));if(e=t.stateNode,r=t.memoizedProps,(n=Ve(e,r,t,!jn))&&null!==(i=zn))switch(a=0!=(1&i.mode),i.tag){case 3:Ze(i.stateNode.containerInfo,e,r,a);break;case 5:$e(i.type,i.memoizedProps,i.stateNode,e,r,a)}n&&Bi(t)}else t.stateNode=W(r,e,n,t)}return Di(t),null;case 13:if(st(gr),r=t.memoizedState,Vn&&null!==Wn&&0!=(1&t.mode)&&0==(128&t.flags)){for(e=Wn;e;)e=He(e);return $n(),t.flags|=98560,t}if(null!==r&&null!==r.dehydrated){if(r=Zn(t),null===e){if(!r)throw Error(o(318));if(!Q)throw Error(o(344));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(o(317));je(e,t)}else $n(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;return Di(t),null}return null!==Jn&&(To(Jn),Jn=null),0!=(128&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?Zn(t):n=null!==e.memoizedState,r&&!n&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&gr.current)?0===$a&&($a=3):ko())),null!==t.updateQueue&&(t.flags|=4),Di(t),null);case 4:return pr(),bi(e,t),null===e&&Z(t.stateNode.containerInfo),Di(t),null;case 10:return ln(t.type._context),Di(t),null;case 19:if(st(gr),null===(i=t.memoizedState))return Di(t),null;if(r=0!=(128&t.flags),null===(a=i.rendering))if(r)Pi(i,!1);else{if(0!==$a||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=vr(e))){for(t.flags|=128,Pi(i,!1),null!==(e=a.updateQueue)&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=n,r=t.child;null!==r;)i=e,(n=r).flags&=14680066,null===(a=n.alternate)?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=a.childLanes,n.lanes=a.lanes,n.child=a.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=a.memoizedProps,n.memoizedState=a.memoizedState,n.updateQueue=a.updateQueue,n.type=a.type,i=a.dependencies,n.dependencies=null===i?null:{lanes:i.lanes,firstContext:i.firstContext}),r=r.sibling;return lt(gr,1&gr.current|2),t.child}e=e.sibling}null!==i.tail&&Ot()>so&&(t.flags|=128,r=!0,Pi(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=vr(a))){if(t.flags|=128,r=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),Pi(i,!0),null===i.tail&&"hidden"===i.tailMode&&!a.alternate&&!Vn)return Di(t),null}else 2*Ot()-i.renderingStartTime>so&&1073741824!==n&&(t.flags|=128,r=!0,Pi(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=i.last)?e.sibling=a:t.child=a,i.last=a)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ot(),t.sibling=null,e=gr.current,lt(gr,r?1&e|2:1&e),t):(Di(t),null);case 22:case 23:return Po(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(1073741824&Ya)&&(Di(t),X&&6&t.subtreeFlags&&(t.flags|=8192)):Di(t),null;case 24:case 25:return null}throw Error(o(156,t.tag))}var Fi=s.ReactCurrentOwner,ki=!1;function Ni(e,t,n,r){t.child=null===e?or(t,null,n,r):ar(t,e.child,n,r)}function Oi(e,t,n,r,i){n=n.render;var a=t.ref;return cn(t,i),r=Pr(e,t,n,r,a,i),n=Dr(),null===e||ki?(Vn&&n&&Un(t),t.flags|=1,Ni(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ia(e,t,i))}function Hi(e,t,n,r,i){if(null===e){var a=n.type;return"function"!=typeof a||$o(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=ts(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Ui(e,t,a,r,i))}if(a=e.child,0==(e.lanes&i)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:Zt)(o,r)&&e.ref===t.ref)return ia(e,t,i)}return t.flags|=1,(e=es(a,r)).ref=t.ref,e.return=t,t.child=e}function Ui(e,t,n,r,i){if(null!==e&&Zt(e.memoizedProps,r)&&e.ref===t.ref){if(ki=!1,0==(e.lanes&i))return t.lanes=e.lanes,ia(e,t,i);0!=(131072&e.flags)&&(ki=!0)}return Wi(e,t,n,r,i)}function Gi(e,t,n){var r=t.pendingProps,i=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null},lt(Za,Ya),Ya|=n;else{if(0==(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null},t.updateQueue=null,lt(Za,Ya),Ya|=e,null;t.memoizedState={baseLanes:0,cachePool:null},r=null!==a?a.baseLanes:n,lt(Za,Ya),Ya|=r}else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,lt(Za,Ya),Ya|=r;return Ni(e,t,i,n),t.child}function zi(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Wi(e,t,n,r,i){var a=ft(n)?ht:ct.current;return a=pt(t,a),cn(t,i),n=Pr(e,t,n,r,a,i),r=Dr(),null===e||ki?(Vn&&r&&Un(t),t.flags|=1,Ni(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ia(e,t,i))}function Vi(e,t,n,r,i){if(ft(n)){var a=!0;yt(t)}else a=!1;if(cn(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),En(t,n,r),Tn(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,u=n.contextType;"object"==typeof u&&null!==u?u=dn(u):u=pt(t,u=ft(n)?ht:ct.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof o.getSnapshotBeforeUpdate;d||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(s!==r||l!==u)&&Cn(t,o,r,u),pn=!1;var h=t.memoizedState;o.state=h,bn(t,r,o,i),l=t.memoizedState,s!==r||h!==l||dt.current||pn?("function"==typeof c&&(Mn(t,n,c,r),l=t.memoizedState),(s=pn||An(t,n,s,r,h,l,u))?(d||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4194308)):("function"==typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=s):("function"==typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,mn(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:en(t.type,s),o.props=u,d=t.pendingProps,h=o.context,"object"==typeof(l=n.contextType)&&null!==l?l=dn(l):l=pt(t,l=ft(n)?ht:ct.current);var p=n.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(s!==d||h!==l)&&Cn(t,o,r,l),pn=!1,h=t.memoizedState,o.state=h,bn(t,r,o,i);var f=t.memoizedState;s!==d||h!==f||dt.current||pn?("function"==typeof p&&(Mn(t,n,p,r),f=t.memoizedState),(u=pn||An(t,n,u,r,h,f,l)||!1)?(c||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,f,l),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,f,l)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof o.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=f),o.props=r,o.state=f,o.context=l,r=u):("function"!=typeof o.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return ji(e,t,n,r,a,i)}function ji(e,t,n,r,i,a){zi(e,t);var o=0!=(128&t.flags);if(!r&&!o)return i&&xt(t,n,!1),ia(e,t,a);r=t.stateNode,Fi.current=t;var s=o&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=ar(t,e.child,null,a),t.child=ar(t,null,s,a)):Ni(e,t,s,a),t.memoizedState=r.state,i&&xt(t,n,!0),t.child}function Ji(e){var t=e.stateNode;t.pendingContext?gt(0,t.pendingContext,t.pendingContext!==t.context):t.context&&gt(0,t.context,!1),hr(e,t.containerInfo)}function qi(e,t,n,r,i){return $n(),er(i),t.flags|=256,Ni(e,t,n,r),t.child}var Xi={dehydrated:null,treeContext:null,retryLane:0};function Ki(e){return{baseLanes:e,cachePool:null}}function Qi(e,t,n){var r,i=t.pendingProps,a=gr.current,s=!1,l=0!=(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!=(2&a)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),lt(gr,1&a),null===e)return Qn(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:Ne(e)?t.lanes=8:t.lanes=1073741824,null):(a=i.children,e=i.fallback,s?(i=t.mode,s=t.child,a={mode:"hidden",children:a},0==(1&i)&&null!==s?(s.childLanes=0,s.pendingProps=a):s=rs(a,i,0,null),e=ns(e,i,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Ki(n),t.memoizedState=Xi,e):Yi(t,a));if(null!==(a=e.memoizedState)){if(null!==(r=a.dehydrated)){if(l)return 256&t.flags?(t.flags&=-257,ea(e,t,n,Error(o(422)))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(s=i.fallback,a=t.mode,i=rs({mode:"visible",children:i.children},a,0,null),(s=ns(s,a,n,null)).flags|=2,i.return=t,s.return=t,i.sibling=s,t.child=i,0!=(1&t.mode)&&ar(t,e.child,null,n),t.child.memoizedState=Ki(n),t.memoizedState=Xi,s);if(0==(1&t.mode))t=ea(e,t,n,null);else if(Ne(r))t=ea(e,t,n,Error(o(419)));else if(i=0!=(n&e.childLanes),ki||i){if(null!==(i=Xa)){switch(n&-n){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}0!==(i=0!=(s&(i.suspendedLanes|n))?0:s)&&i!==a.retryLane&&(a.retryLane=i,Mo(e,i,-1))}ko(),t=ea(e,t,n,Error(o(421)))}else ke(r)?(t.flags|=128,t.child=e.child,t=Xo.bind(null,e),Oe(r,t),t=null):(n=a.treeContext,Q&&(Wn=ze(r),zn=t,Vn=!0,Jn=null,jn=!1,null!==n&&(Dn[In++]=kn,Dn[In++]=Nn,Dn[In++]=Fn,kn=n.id,Nn=n.overflow,Fn=t)),(t=Yi(t,t.pendingProps.children)).flags|=4096);return t}return s?(i=$i(e,t,i.children,i.fallback,n),s=t.child,a=e.child.memoizedState,s.memoizedState=null===a?Ki(n):{baseLanes:a.baseLanes|n,cachePool:null},s.childLanes=e.childLanes&~n,t.memoizedState=Xi,i):(n=Zi(e,t,i.children,n),t.memoizedState=null,n)}return s?(i=$i(e,t,i.children,i.fallback,n),s=t.child,a=e.child.memoizedState,s.memoizedState=null===a?Ki(n):{baseLanes:a.baseLanes|n,cachePool:null},s.childLanes=e.childLanes&~n,t.memoizedState=Xi,i):(n=Zi(e,t,i.children,n),t.memoizedState=null,n)}function Yi(e,t){return(t=rs({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Zi(e,t,n,r){var i=e.child;return e=i.sibling,n=es(i,{mode:"visible",children:n}),0==(1&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n}function $i(e,t,n,r,i){var a=t.mode,o=(e=e.child).sibling,s={mode:"hidden",children:n};return 0==(1&a)&&t.child!==e?((n=t.child).childLanes=0,n.pendingProps=s,t.deletions=null):(n=es(e,s)).subtreeFlags=14680064&e.subtreeFlags,null!==o?r=es(o,r):(r=ns(r,a,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function ea(e,t,n,r){return null!==r&&er(r),ar(t,e.child,null,n),(e=Yi(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function ta(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),un(e.return,t,n)}function na(e,t,n,r,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function ra(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Ni(e,t,r.children,n),0!=(2&(r=gr.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ta(e,n,t);else if(19===e.tag)ta(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(lt(gr,r),0==(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===vr(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),na(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===vr(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}na(t,!0,n,null,a);break;case"together":na(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ia(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),to|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=es(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=es(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function aa(e,t){switch(Gn(t),t.tag){case 1:return ft(t.type)&&mt(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return pr(),st(dt),st(ct),xr(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return mr(t),null;case 13:if(st(gr),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));$n()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return st(gr),null;case 4:return pr(),null;case 10:return ln(t.type._context),null;case 22:case 23:return Po(),null;default:return null}}var oa=!1,sa=!1,la="function"==typeof WeakSet?WeakSet:Set,ua=null;function ca(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){jo(e,t,n)}else n.current=null}function da(e,t,n){try{n()}catch(n){jo(e,t,n)}}var ha=!1;function pa(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,void 0!==a&&da(t,n,a)}i=i.next}while(i!==r)}}function fa(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ma(e){var t=e.ref;if(null!==t){var n=e.stateNode;if(5===e.tag)e=D(n);else e=n;"function"==typeof t?t(e):t.current=e}}function ga(e,t,n){if(Vt&&"function"==typeof Vt.onCommitFiberUnmount)try{Vt.onCommitFiberUnmount(Wt,t)}catch(e){}switch(t.tag){case 0:case 11:case 14:case 15:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var r=e=e.next;do{var i=r,a=i.destroy;i=i.tag,void 0!==a&&(0!=(2&i)||0!=(4&i))&&da(t,n,a),r=r.next}while(r!==e)}break;case 1:if(ca(t,n),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(e){jo(t,n,e)}break;case 5:ca(t,n);break;case 4:X?Sa(e,t,n):K&&K&&(t=t.stateNode.containerInfo,n=Ce(t),Re(t,n))}}function va(e,t,n){for(var r=t;;)if(ga(e,r,n),null===r.child||X&&4===r.tag){if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}else r.child.return=r,r=r.child}function ya(e){var t=e.alternate;null!==t&&(e.alternate=null,ya(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&ee(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function xa(e){return 5===e.tag||3===e.tag||4===e.tag}function ba(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||xa(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function wa(e){if(X){e:{for(var t=e.return;null!==t;){if(xa(t))break e;t=t.return}throw Error(o(160))}var n=t;switch(n.tag){case 5:t=n.stateNode,32&n.flags&&(be(t),n.flags&=-33),Ma(e,n=ba(e),t);break;case 3:case 4:t=n.stateNode.containerInfo,_a(e,n=ba(e),t);break;default:throw Error(o(161))}}}function _a(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ve(n,e,t):he(n,e);else if(4!==r&&null!==(e=e.child))for(_a(e,t,n),e=e.sibling;null!==e;)_a(e,t,n),e=e.sibling}function Ma(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ge(n,e,t):de(n,e);else if(4!==r&&null!==(e=e.child))for(Ma(e,t,n),e=e.sibling;null!==e;)Ma(e,t,n),e=e.sibling}function Sa(e,t,n){for(var r,i,a=t,s=!1;;){if(!s){s=a.return;e:for(;;){if(null===s)throw Error(o(160));switch(r=s.stateNode,s.tag){case 5:i=!1;break e;case 3:case 4:r=r.containerInfo,i=!0;break e}s=s.return}s=!0}if(5===a.tag||6===a.tag)va(e,a,n),i?xe(r,a.stateNode):ye(r,a.stateNode);else if(18===a.tag)i?Qe(r,a.stateNode):Ke(r,a.stateNode);else if(4===a.tag){if(null!==a.child){r=a.stateNode.containerInfo,i=!0,a.child.return=a,a=a.child;continue}}else if(ga(e,a,n),null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break;for(;null===a.sibling;){if(null===a.return||a.return===t)return;4===(a=a.return).tag&&(s=!1)}a.sibling.return=a.return,a=a.sibling}}function Aa(e,t){if(X){switch(t.tag){case 0:case 11:case 14:case 15:return pa(3,t,t.return),fa(3,t),void pa(5,t,t.return);case 1:case 12:case 17:return;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps;e=null!==e?e.memoizedProps:r;var i=t.type,a=t.updateQueue;t.updateQueue=null,null!==a&&me(n,a,i,e,r,t)}return;case 6:if(null===t.stateNode)throw Error(o(162));return n=t.memoizedProps,void pe(t.stateNode,null!==e?e.memoizedProps:n,n);case 3:return void(Q&&null!==e&&e.memoizedState.isDehydrated&&qe(t.stateNode.containerInfo));case 13:case 19:return void Ea(t)}throw Error(o(163))}switch(t.tag){case 0:case 11:case 14:case 15:return pa(3,t,t.return),fa(3,t),void pa(5,t,t.return);case 12:case 22:case 23:return;case 13:case 19:return void Ea(t);case 3:Q&&null!==e&&e.memoizedState.isDehydrated&&qe(t.stateNode.containerInfo)}e:if(K){switch(t.tag){case 1:case 5:case 6:break e;case 3:case 4:t=t.stateNode,Re(t.containerInfo,t.pendingChildren);break e}throw Error(o(163))}}function Ea(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new la),t.forEach((function(t){var r=Ko.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Ca(e,t,n){ua=e,Ta(e,t,n)}function Ta(e,t,n){for(var r=0!=(1&e.mode);null!==ua;){var i=ua,a=i.child;if(22===i.tag&&r){var o=null!==i.memoizedState||oa;if(!o){var s=i.alternate,l=null!==s&&null!==s.memoizedState||sa;s=oa;var u=sa;if(oa=o,(sa=l)&&!u)for(ua=i;null!==ua;)l=(o=ua).child,22===o.tag&&null!==o.memoizedState?La(i):null!==l?(l.return=o,ua=l):La(i);for(;null!==a;)ua=a,Ta(a,t,n),a=a.sibling;ua=i,oa=s,sa=u}Ba(e)}else 0!=(8772&i.subtreeFlags)&&null!==a?(a.return=i,ua=a):Ba(e)}}function Ba(e){for(;null!==ua;){var t=ua;if(0!=(8772&t.flags)){var n=t.alternate;try{if(0!=(8772&t.flags))switch(t.tag){case 0:case 11:case 15:sa||fa(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!sa)if(null===n)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:en(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&wn(t,a,r);break;case 3:var s=t.updateQueue;if(null!==s){if(n=null,null!==t.child)switch(t.child.tag){case 5:n=D(t.child.stateNode);break;case 1:n=t.child.stateNode}wn(t,s,n)}break;case 5:var l=t.stateNode;null===n&&4&t.flags&&fe(l,t.type,t.memoizedProps,t);break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:break;case 13:if(Q&&null===t.memoizedState){var u=t.alternate;if(null!==u){var c=u.memoizedState;if(null!==c){var d=c.dehydrated;null!==d&&Xe(d)}}}break;default:throw Error(o(163))}sa||512&t.flags&&ma(t)}catch(e){jo(t,t.return,e)}}if(t===e){ua=null;break}if(null!==(n=t.sibling)){n.return=t.return,ua=n;break}ua=t.return}}function Ra(e){for(;null!==ua;){var t=ua;if(t===e){ua=null;break}var n=t.sibling;if(null!==n){n.return=t.return,ua=n;break}ua=t.return}}function La(e){for(;null!==ua;){var t=ua;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{fa(4,t)}catch(e){jo(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(e){jo(t,i,e)}}var a=t.return;try{ma(t)}catch(e){jo(t,a,e)}break;case 5:var o=t.return;try{ma(t)}catch(e){jo(t,o,e)}}}catch(e){jo(t,t.return,e)}if(t===e){ua=null;break}var s=t.sibling;if(null!==s){s.return=t.return,ua=s;break}ua=t.return}}var Pa=0,Da=1,Ia=2,Fa=3,ka=4;if("function"==typeof Symbol&&Symbol.for){var Na=Symbol.for;Pa=Na("selector.component"),Da=Na("selector.has_pseudo_class"),Ia=Na("selector.role"),Fa=Na("selector.test_id"),ka=Na("selector.text")}function Oa(e){var t=Y(e);if(null!=t){if("string"!=typeof t.memoizedProps["data-testname"])throw Error(o(364));return t}if(null===(e=ie(e)))throw Error(o(362));return e.stateNode.current}function Ha(e,t){switch(t.$$typeof){case Pa:if(e.type===t.value)return!0;break;case Da:e:{t=t.value,e=[e,0];for(var n=0;n<e.length;){var r=e[n++],i=e[n++],a=t[i];if(5!==r.tag||!se(r)){for(;null!=a&&Ha(r,a);)a=t[++i];if(i===t.length){t=!0;break e}for(r=r.child;null!==r;)e.push(r,i),r=r.sibling}}t=!1}return t;case Ia:if(5===e.tag&&le(e.stateNode,t.value))return!0;break;case ka:if((5===e.tag||6===e.tag)&&(null!==(e=oe(e))&&0<=e.indexOf(t.value)))return!0;break;case Fa:if(5===e.tag&&("string"==typeof(e=e.memoizedProps["data-testname"])&&e.toLowerCase()===t.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function Ua(e){switch(e.$$typeof){case Pa:return"<"+(M(e.value)||"Unknown")+">";case Da:return":has("+(Ua(e)||"")+")";case Ia:return'[role="'+e.value+'"]';case ka:return'"'+e.value+'"';case Fa:return'[data-testname="'+e.value+'"]';default:throw Error(o(365))}}function Ga(e,t){var n=[];e=[e,0];for(var r=0;r<e.length;){var i=e[r++],a=e[r++],o=t[a];if(5!==i.tag||!se(i)){for(;null!=o&&Ha(i,o);)o=t[++a];if(a===t.length)n.push(i);else for(i=i.child;null!==i;)e.push(i,a),i=i.sibling}}return n}function za(e,t){if(!re)throw Error(o(363));e=Ga(e=Oa(e),t),t=[],e=Array.from(e);for(var n=0;n<e.length;){var r=e[n++];if(5===r.tag)se(r)||t.push(r.stateNode);else for(r=r.child;null!==r;)e.push(r),r=r.sibling}return t}var Wa=Math.ceil,Va=s.ReactCurrentDispatcher,ja=s.ReactCurrentOwner,Ja=s.ReactCurrentBatchConfig,qa=0,Xa=null,Ka=null,Qa=0,Ya=0,Za=ot(0),$a=0,eo=null,to=0,no=0,ro=0,io=null,ao=null,oo=0,so=1/0;function lo(){so=Ot()+500}var uo,co=!1,ho=null,po=null,fo=!1,mo=null,go=0,vo=0,yo=null,xo=-1,bo=0;function wo(){return 0!=(6&qa)?Ot():-1!==xo?xo:xo=Ot()}function _o(e){return 0==(1&e.mode)?1:0!=(2&qa)&&0!==Qa?Qa&-Qa:null!==Yt.transition?(0===bo&&(e=Mt,0==(4194240&(Mt<<=1))&&(Mt=64),bo=e),bo):0!==(e=Pt)?e:$()}function Mo(e,t,n){if(50<vo)throw vo=0,yo=null,Error(o(185));var r=So(e,t);return null===r?null:(Rt(r,t,n),0!=(2&qa)&&r===Xa||(r===Xa&&(0==(2&qa)&&(no|=t),4===$a&&Bo(r,Qa)),Ao(r,n),1===t&&0===qa&&0==(1&e.mode)&&(lo(),qt&&Qt())),r)}function So(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function Ao(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-bt(a),s=1<<o,l=i[o];-1===l?0!=(s&n)&&0==(s&r)||(i[o]=Ct(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}}(e,t);var r=Et(e,e===Xa?Qa:0);if(0===r)null!==n&&Ft(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Ft(n),1===t)0===e.tag?function(e){qt=!0,Kt(e)}(Ro.bind(null,e)):Kt(Ro.bind(null,e)),te?ne((function(){0===qa&&Qt()})):It(Ht,Qt),n=null;else{switch(Dt(r)){case 1:n=Ht;break;case 4:n=Ut;break;case 16:default:n=Gt;break;case 536870912:n=zt}n=Qo(n,Eo.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Eo(e,t){if(xo=-1,bo=0,0!=(6&qa))throw Error(o(327));var n=e.callbackNode;if(Wo()&&e.callbackNode!==n)return null;var r=Et(e,e===Xa?Qa:0);if(0===r)return null;if(0!=(30&r)||0!=(r&e.expiredLanes)||t)t=No(e,r);else{t=r;var i=qa;qa|=2;var a=Fo();for(Xa===e&&Qa===t||(lo(),Do(e,t));;)try{Ho();break}catch(t){Io(e,t)}on(),Va.current=a,qa=i,null!==Ka?t=0:(Xa=null,Qa=0,t=$a)}if(0!==t){if(2===t&&(0!==(i=Tt(e))&&(r=i,t=Co(e,i))),1===t)throw n=eo,Do(e,0),Bo(e,r),Ao(e,Ot()),n;if(6===t)Bo(e,r);else{if(i=e.current.alternate,0==(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!jt(a(),i))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)&&(2===(t=No(e,r))&&(0!==(a=Tt(e))&&(r=a,t=Co(e,a))),1===t))throw n=eo,Do(e,0),Bo(e,r),Ao(e,Ot()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(o(345));case 2:case 5:zo(e,ao);break;case 3:if(Bo(e,r),(130023424&r)===r&&10<(t=oo+500-Ot())){if(0!==Et(e,0))break;if(((i=e.suspendedLanes)&r)!==r){wo(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=V(zo.bind(null,e,ao),t);break}zo(e,ao);break;case 4:if(Bo(e,r),(4194240&r)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-bt(r);a=1<<s,(s=t[s])>i&&(i=s),r&=~a}if(r=i,10<(r=(120>(r=Ot()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Wa(r/1960))-r)){e.timeoutHandle=V(zo.bind(null,e,ao),r);break}zo(e,ao);break;default:throw Error(o(329))}}}return Ao(e,Ot()),e.callbackNode===n?Eo.bind(null,e):null}function Co(e,t){var n=io;return e.current.memoizedState.isDehydrated&&(Do(e,t).flags|=256),2!==(e=No(e,t))&&(t=ao,ao=n,null!==t&&To(t)),e}function To(e){null===ao?ao=e:ao.push.apply(ao,e)}function Bo(e,t){for(t&=~ro,t&=~no,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-bt(t),r=1<<n;e[n]=-1,t&=~r}}function Ro(e){if(0!=(6&qa))throw Error(o(327));Wo();var t=Et(e,0);if(0==(1&t))return Ao(e,Ot()),null;var n=No(e,t);if(0!==e.tag&&2===n){var r=Tt(e);0!==r&&(t=r,n=Co(e,r))}if(1===n)throw n=eo,Do(e,0),Bo(e,t),Ao(e,Ot()),n;if(6===n)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,zo(e,ao),Ao(e,Ot()),null}function Lo(e){null!==mo&&0===mo.tag&&0==(6&qa)&&Wo();var t=qa;qa|=1;var n=Ja.transition,r=Pt;try{if(Ja.transition=null,Pt=1,e)return e()}finally{Pt=r,Ja.transition=n,0==(6&(qa=t))&&Qt()}}function Po(){Ya=Za.current,st(Za)}function Do(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==J&&(e.timeoutHandle=J,j(n)),null!==Ka)for(n=Ka.return;null!==n;){var r=n;switch(Gn(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&mt();break;case 3:pr(),st(dt),st(ct),xr();break;case 5:mr(r);break;case 4:pr();break;case 13:case 19:st(gr);break;case 10:ln(r.type._context);break;case 22:case 23:Po()}n=n.return}if(Xa=e,Ka=e=es(e.current,null),Qa=Ya=t,$a=0,eo=null,ro=no=to=0,ao=io=null,null!==hn){for(t=0;t<hn.length;t++)if(null!==(r=(n=hn[t]).interleaved)){n.interleaved=null;var i=r.next,a=n.pending;if(null!==a){var o=a.next;a.next=i,r.next=o}n.pending=r}hn=null}return e}function Io(e,t){for(;;){var n=Ka;try{if(on(),br.current=pi,Er){for(var r=Mr.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}Er=!1}if(_r=0,Ar=Sr=Mr=null,Cr=!1,Tr=0,ja.current=null,null===n||null===n.return){$a=1,eo=t,Ka=null;break}e:{var a=e,s=n.return,l=n,u=t;if(t=Qa,l.flags|=32768,null!==u&&"object"==typeof u&&"function"==typeof u.then){var c=u,d=l,h=d.tag;if(0==(1&d.mode)&&(0===h||11===h||15===h)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=Ci(s);if(null!==f){f.flags&=-257,Ti(f,s,l,0,t),1&f.mode&&Ei(a,c,t),u=c;var m=(t=f).updateQueue;if(null===m){var g=new Set;g.add(u),t.updateQueue=g}else m.add(u);break e}if(0==(1&t)){Ei(a,c,t),ko();break e}u=Error(o(426))}else if(Vn&&1&l.mode){var v=Ci(s);if(null!==v){0==(65536&v.flags)&&(v.flags|=256),Ti(v,s,l,0,t),er(u);break e}}a=u,4!==$a&&($a=2),null===io?io=[a]:io.push(a),u=vi(u,l),l=s;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t,xn(l,Si(0,u,t));break e;case 1:a=u;var y=l.type,x=l.stateNode;if(0==(128&l.flags)&&("function"==typeof y.getDerivedStateFromError||null!==x&&"function"==typeof x.componentDidCatch&&(null===po||!po.has(x)))){l.flags|=65536,t&=-t,l.lanes|=t,xn(l,Ai(l,a,t));break e}}l=l.return}while(null!==l)}Go(n)}catch(e){t=e,Ka===n&&null!==n&&(Ka=n=n.return);continue}break}}function Fo(){var e=Va.current;return Va.current=pi,null===e?pi:e}function ko(){0!==$a&&3!==$a&&2!==$a||($a=4),null===Xa||0==(268435455&to)&&0==(268435455&no)||Bo(Xa,Qa)}function No(e,t){var n=qa;qa|=2;var r=Fo();for(Xa===e&&Qa===t||Do(e,t);;)try{Oo();break}catch(t){Io(e,t)}if(on(),qa=n,Va.current=r,null!==Ka)throw Error(o(261));return Xa=null,Qa=0,$a}function Oo(){for(;null!==Ka;)Uo(Ka)}function Ho(){for(;null!==Ka&&!kt();)Uo(Ka)}function Uo(e){var t=uo(e.alternate,e,Ya);e.memoizedProps=e.pendingProps,null===t?Go(e):Ka=t,ja.current=null}function Go(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(32768&t.flags)){if(null!==(n=Ii(n,t,Ya)))return void(Ka=n)}else{if(null!==(n=aa(n,t)))return n.flags&=32767,void(Ka=n);if(null===e)return $a=6,void(Ka=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Ka=t);Ka=t=e}while(null!==t);0===$a&&($a=5)}function zo(e,t){var n=Pt,r=Ja.transition;try{Ja.transition=null,Pt=1,function(e,t,n){do{Wo()}while(null!==mo);if(0!=(6&qa))throw Error(o(327));var r=e.finishedWork,i=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-bt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}(e,a),e===Xa&&(Ka=Xa=null,Qa=0),0==(2064&r.subtreeFlags)&&0==(2064&r.flags)||fo||(fo=!0,Qo(Gt,(function(){return Wo(),null}))),a=0!=(15990&r.flags),0!=(15990&r.subtreeFlags)||a){a=Ja.transition,Ja.transition=null;var s=Pt;Pt=1;var l=qa;qa|=4,ja.current=null,function(e,t){for(k(e.containerInfo),ua=t;null!==ua;)if(t=(e=ua).child,0!=(1028&e.subtreeFlags)&&null!==t)t.return=e,ua=t;else for(;null!==ua;){e=ua;try{var n=e.alternate;if(0!=(1024&e.flags))switch(e.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==n){var r=n.memoizedProps,i=n.memoizedState,a=e.stateNode,s=a.getSnapshotBeforeUpdate(e.elementType===e.type?r:en(e.type,r),i);a.__reactInternalSnapshotBeforeUpdate=s}break;case 3:X&&Ae(e.stateNode.containerInfo);break;default:throw Error(o(163))}}catch(t){jo(e,e.return,t)}if(null!==(t=e.sibling)){t.return=e.return,ua=t;break}ua=e.return}n=ha,ha=!1}(e,r),function(e,t){for(ua=t;null!==ua;){var n=(t=ua).deletions;if(null!==n)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e;X?Sa(a,i,t):va(a,i,t);var o=i.alternate;null!==o&&(o.return=null),i.return=null}catch(e){jo(i,t,e)}}if(n=t.child,0!=(12854&t.subtreeFlags)&&null!==n)n.return=t,ua=n;else for(;null!==ua;){t=ua;try{var s=t.flags;if(32&s&&X&&be(t.stateNode),512&s){var l=t.alternate;if(null!==l){var u=l.ref;null!==u&&("function"==typeof u?u(null):u.current=null)}}if(8192&s)switch(t.tag){case 13:if(null!==t.memoizedState){var c=t.alternate;null!==c&&null!==c.memoizedState||(oo=Ot())}break;case 22:var d=null!==t.memoizedState,h=t.alternate,p=null!==h&&null!==h.memoizedState;if(n=t,X)e:if(r=n,i=d,a=null,X)for(var f=r;;){if(5===f.tag){if(null===a){a=f;var m=f.stateNode;i?we(m):Me(f.stateNode,f.memoizedProps)}}else if(6===f.tag){if(null===a){var g=f.stateNode;i?_e(g):Se(g,f.memoizedProps)}}else if((22!==f.tag&&23!==f.tag||null===f.memoizedState||f===r)&&null!==f.child){f.child.return=f,f=f.child;continue}if(f===r)break;for(;null===f.sibling;){if(null===f.return||f.return===r)break e;a===f&&(a=null),f=f.return}a===f&&(a=null),f.sibling.return=f.return,f=f.sibling}if(d&&!p&&0!=(1&n.mode)){ua=n;for(var v=n.child;null!==v;){for(n=ua=v;null!==ua;){var y=(r=ua).child;switch(r.tag){case 0:case 11:case 14:case 15:pa(4,r,r.return);break;case 1:ca(r,r.return);var x=r.stateNode;if("function"==typeof x.componentWillUnmount){var b=r.return;try{x.props=r.memoizedProps,x.state=r.memoizedState,x.componentWillUnmount()}catch(e){jo(r,b,e)}}break;case 5:ca(r,r.return);break;case 22:if(null!==r.memoizedState){Ra(n);continue}}null!==y?(y.return=r,ua=y):Ra(n)}v=v.sibling}}}switch(4102&s){case 2:wa(t),t.flags&=-3;break;case 6:wa(t),t.flags&=-3,Aa(t.alternate,t);break;case 4096:t.flags&=-4097;break;case 4100:t.flags&=-4097,Aa(t.alternate,t);break;case 4:Aa(t.alternate,t)}}catch(e){jo(t,t.return,e)}if(null!==(n=t.sibling)){n.return=t.return,ua=n;break}ua=t.return}}}(e,r),N(e.containerInfo),e.current=r,Ca(r,e,i),Nt(),qa=l,Pt=s,Ja.transition=a}else e.current=r;if(fo&&(fo=!1,mo=e,go=i),0===(a=e.pendingLanes)&&(po=null),function(e){if(Vt&&"function"==typeof Vt.onCommitFiberRoot)try{Vt.onCommitFiberRoot(Wt,e,void 0,128==(128&e.current.flags))}catch(e){}}(r.stateNode),Ao(e,Ot()),null!==t)for(n=e.onRecoverableError,r=0;r<t.length;r++)n(t[r]);if(co)throw co=!1,e=ho,ho=null,e;0!=(1&go)&&0!==e.tag&&Wo(),0!=(1&(a=e.pendingLanes))?e===yo?vo++:(vo=0,yo=e):vo=0,Qt()}(e,t,n)}finally{Ja.transition=r,Pt=n}return null}function Wo(){if(null!==mo){var e=Dt(go),t=Ja.transition,n=Pt;try{if(Ja.transition=null,Pt=16>e?16:e,null===mo)var r=!1;else{if(e=mo,mo=null,go=0,0!=(6&qa))throw Error(o(331));var i=qa;for(qa|=4,ua=e.current;null!==ua;){var a=ua,s=a.child;if(0!=(16&ua.flags)){var l=a.deletions;if(null!==l){for(var u=0;u<l.length;u++){var c=l[u];for(ua=c;null!==ua;){var d=ua;switch(d.tag){case 0:case 11:case 15:pa(8,d,a)}var h=d.child;if(null!==h)h.return=d,ua=h;else for(;null!==ua;){var p=(d=ua).sibling,f=d.return;if(ya(d),d===c){ua=null;break}if(null!==p){p.return=f,ua=p;break}ua=f}}}var m=a.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(null!==g)}}ua=a}}if(0!=(2064&a.subtreeFlags)&&null!==s)s.return=a,ua=s;else e:for(;null!==ua;){if(0!=(2048&(a=ua).flags))switch(a.tag){case 0:case 11:case 15:pa(9,a,a.return)}var y=a.sibling;if(null!==y){y.return=a.return,ua=y;break e}ua=a.return}}var x=e.current;for(ua=x;null!==ua;){var b=(s=ua).child;if(0!=(2064&s.subtreeFlags)&&null!==b)b.return=s,ua=b;else e:for(s=x;null!==ua;){if(0!=(2048&(l=ua).flags))try{switch(l.tag){case 0:case 11:case 15:fa(9,l)}}catch(e){jo(l,l.return,e)}if(l===s){ua=null;break e}var w=l.sibling;if(null!==w){w.return=l.return,ua=w;break e}ua=l.return}}if(qa=i,Qt(),Vt&&"function"==typeof Vt.onPostCommitFiberRoot)try{Vt.onPostCommitFiberRoot(Wt,e)}catch(e){}r=!0}return r}finally{Pt=n,Ja.transition=t}}return!1}function Vo(e,t,n){vn(e,t=Si(0,t=vi(n,t),1)),t=wo(),null!==(e=So(e,1))&&(Rt(e,1,t),Ao(e,t))}function jo(e,t,n){if(3===e.tag)Vo(e,e,n);else for(;null!==t;){if(3===t.tag){Vo(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===po||!po.has(r))){vn(t,e=Ai(t,e=vi(n,e),1)),e=wo(),null!==(t=So(t,1))&&(Rt(t,1,e),Ao(t,e));break}}t=t.return}}function Jo(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=wo(),e.pingedLanes|=e.suspendedLanes&n,Xa===e&&(Qa&n)===n&&(4===$a||3===$a&&(130023424&Qa)===Qa&&500>Ot()-oo?Do(e,0):ro|=n),Ao(e,t)}function qo(e,t){0===t&&(0==(1&e.mode)?t=1:(t=St,0==(130023424&(St<<=1))&&(St=4194304)));var n=wo();null!==(e=So(e,t))&&(Rt(e,t,n),Ao(e,n))}function Xo(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),qo(e,n)}function Ko(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(o(314))}null!==r&&r.delete(t),qo(e,n)}function Qo(e,t){return It(e,t)}function Yo(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zo(e,t,n,r){return new Yo(e,t,n,r)}function $o(e){return!(!(e=e.prototype)||!e.isReactComponent)}function es(e,t){var n=e.alternate;return null===n?((n=Zo(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ts(e,t,n,r,i,a){var s=2;if(r=e,"function"==typeof e)$o(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case c:return ns(n.children,i,a,t);case d:s=8,i|=8;break;case h:return(e=Zo(12,n,t,2|i)).elementType=h,e.lanes=a,e;case g:return(e=Zo(13,n,t,i)).elementType=g,e.lanes=a,e;case v:return(e=Zo(19,n,t,i)).elementType=v,e.lanes=a,e;case b:return rs(n,i,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case p:s=10;break e;case f:s=9;break e;case m:s=11;break e;case y:s=14;break e;case x:s=16,r=null;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=Zo(s,n,t,i)).elementType=e,t.type=r,t.lanes=a,t}function ns(e,t,n,r){return(e=Zo(7,e,r,t)).lanes=n,e}function rs(e,t,n,r){return(e=Zo(22,e,r,t)).elementType=b,e.lanes=n,e.stateNode={},e}function is(e,t,n){return(e=Zo(6,e,null,t)).lanes=n,e}function as(e,t,n){return(t=Zo(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function os(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=J,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bt(0),this.expirationTimes=Bt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bt(0),this.identifierPrefix=r,this.onRecoverableError=i,Q&&(this.mutableSourceEagerHydrationData=null)}function ss(e,t,n,r,i,a,o,s,l){return e=new os(e,t,n,s,l),1===t?(t=1,!0===a&&(t|=8)):t=0,a=Zo(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null},fn(a),e}function ls(e){if(!e)return ut;e:{if(A(e=e._reactInternals)!==e||1!==e.tag)throw Error(o(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ft(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(o(171))}if(1===e.tag){var n=e.type;if(ft(n))return vt(e,n,t)}return t}function us(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(o(188));throw e=Object.keys(e).join(","),Error(o(268,e))}return null===(e=T(t))?null:e.stateNode}function cs(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function ds(e,t){cs(e,t),(e=e.alternate)&&cs(e,t)}function hs(e){return null===(e=T(e))?null:e.stateNode}function ps(){return null}return uo=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||dt.current)ki=!0;else{if(0==(e.lanes&n)&&0==(128&t.flags))return ki=!1,function(e,t,n){switch(t.tag){case 3:Ji(t),$n();break;case 5:fr(t);break;case 1:ft(t.type)&&yt(t);break;case 4:hr(t,t.stateNode.containerInfo);break;case 10:sn(0,t.type._context,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(null!==r)return null!==r.dehydrated?(lt(gr,1&gr.current),t.flags|=128,null):0!=(n&t.child.childLanes)?Qi(e,t,n):(lt(gr,1&gr.current),null!==(e=ia(e,t,n))?e.sibling:null);lt(gr,1&gr.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(128&e.flags)){if(r)return ra(e,t,n);t.flags|=128}var i=t.memoizedState;if(null!==i&&(i.rendering=null,i.tail=null,i.lastEffect=null),lt(gr,gr.current),r)break;return null;case 22:case 23:return t.lanes=0,Gi(e,t,n)}return ia(e,t,n)}(e,t,n);ki=0!=(131072&e.flags)}else ki=!1,Vn&&0!=(1048576&t.flags)&&Hn(t,Pn,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps;var i=pt(t,ct.current);cn(t,n),i=Pr(null,t,r,e,i,n);var a=Dr();return t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ft(r)?(a=!0,yt(t)):a=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,fn(t),i.updater=Sn,t.stateNode=i,i._reactInternals=t,Tn(t,r,e,n),t=ji(null,t,r,!0,a,n)):(t.tag=0,Vn&&a&&Un(t),Ni(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,r=(i=r._init)(r._payload),t.type=r,i=t.tag=function(e){if("function"==typeof e)return $o(e)?1:0;if(null!=e){if((e=e.$$typeof)===m)return 11;if(e===y)return 14}return 2}(r),e=en(r,e),i){case 0:t=Wi(null,t,r,e,n);break e;case 1:t=Vi(null,t,r,e,n);break e;case 11:t=Oi(null,t,r,e,n);break e;case 14:t=Hi(null,t,r,en(r.type,e),n);break e}throw Error(o(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,Wi(e,t,r,i=t.elementType===r?i:en(r,i),n);case 1:return r=t.type,i=t.pendingProps,Vi(e,t,r,i=t.elementType===r?i:en(r,i),n);case 3:e:{if(Ji(t),null===e)throw Error(o(387));r=t.pendingProps,i=(a=t.memoizedState).element,mn(e,t),bn(t,r,null,n);var s=t.memoizedState;if(r=s.element,Q&&a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:s.cache,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=qi(e,t,r,n,i=Error(o(423)));break e}if(r!==i){t=qi(e,t,r,n,i=Error(o(424)));break e}for(Q&&(Wn=Ge(t.stateNode.containerInfo),zn=t,Vn=!0,Jn=null,jn=!1),n=or(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if($n(),r===i){t=ia(e,t,n);break e}Ni(e,t,r,n)}t=t.child}return t;case 5:return fr(t),null===e&&Qn(t),r=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,s=i.children,z(r,i)?s=null:null!==a&&z(r,a)&&(t.flags|=32),zi(e,t),Ni(e,t,s,n),t.child;case 6:return null===e&&Qn(t),null;case 13:return Qi(e,t,n);case 4:return hr(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=ar(t,null,r,n):Ni(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Oi(e,t,r,i=t.elementType===r?i:en(r,i),n);case 7:return Ni(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ni(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,sn(0,r,s=i.value),null!==a)if(jt(a.value,s)){if(a.children===i.children&&!dt.current){t=ia(e,t,n);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var l=a.dependencies;if(null!==l){s=a.child;for(var u=l.firstContext;null!==u;){if(u.context===r){if(1===a.tag){(u=gn(-1,n&-n)).tag=2;var c=a.updateQueue;if(null!==c){var d=(c=c.shared).pending;null===d?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}a.lanes|=n,null!==(u=a.alternate)&&(u.lanes|=n),un(a.return,n,t),l.lanes|=n;break}u=u.next}}else if(10===a.tag)s=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(s=a.return))throw Error(o(341));s.lanes|=n,null!==(l=s.alternate)&&(l.lanes|=n),un(s,n,t),s=a.sibling}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===t){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}Ni(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,cn(t,n),r=r(i=dn(i)),t.flags|=1,Ni(e,t,r,n),t.child;case 14:return i=en(r=t.type,t.pendingProps),Hi(e,t,r,i=en(r.type,i),n);case 15:return Ui(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:en(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,ft(r)?(e=!0,yt(t)):e=!1,cn(t,n),En(t,r,i),Tn(t,r,i,n),ji(null,t,r,!0,e,n);case 19:return ra(e,t,n);case 22:return Gi(e,t,n)}throw Error(o(156,t.tag))},t.attemptContinuousHydration=function(e){13===e.tag&&(Mo(e,134217728,wo()),ds(e,134217728))},t.attemptHydrationAtCurrentPriority=function(e){if(13===e.tag){var t=wo(),n=_o(e);Mo(e,n,t),ds(e,n)}},t.attemptSynchronousHydration=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=At(t.pendingLanes);0!==n&&(Lt(t,1|n),Ao(t,Ot()),0==(6&qa)&&(lo(),Qt()))}break;case 13:var r=wo();Lo((function(){return Mo(e,1,r)})),ds(e,1)}},t.batchedUpdates=function(e,t){var n=qa;qa|=1;try{return e(t)}finally{0===(qa=n)&&(lo(),qt&&Qt())}},t.createComponentSelector=function(e){return{$$typeof:Pa,value:e}},t.createContainer=function(e,t,n,r,i,a,o){return ss(e,t,!1,null,0,r,0,a,o)},t.createHasPseudoClassSelector=function(e){return{$$typeof:Da,value:e}},t.createHydrationContainer=function(e,t,n,r,i,a,o,s,l){return(e=ss(n,r,!0,e,0,a,0,s,l)).context=ls(null),n=e.current,(a=gn(r=wo(),i=_o(n))).callback=null!=t?t:null,vn(n,a),e.current.lanes=i,Rt(e,i,r),Ao(e,r),e},t.createPortal=function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:u,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}},t.createRoleSelector=function(e){return{$$typeof:Ia,value:e}},t.createTestNameSelector=function(e){return{$$typeof:Fa,value:e}},t.createTextSelector=function(e){return{$$typeof:ka,value:e}},t.deferredUpdates=function(e){var t=Pt,n=Ja.transition;try{return Ja.transition=null,Pt=16,e()}finally{Pt=t,Ja.transition=n}},t.discreteUpdates=function(e,t,n,r,i){var a=Pt,o=Ja.transition;try{return Ja.transition=null,Pt=1,e(t,n,r,i)}finally{Pt=a,Ja.transition=o,0===qa&&lo()}},t.findAllNodes=za,t.findBoundingRects=function(e,t){if(!re)throw Error(o(363));t=za(e,t),e=[];for(var n=0;n<t.length;n++)e.push(ae(t[n]));for(t=e.length-1;0<t;t--)for(var r=(n=e[t]).x,i=r+n.width,a=n.y,s=a+n.height,l=t-1;0<=l;l--)if(t!==l){var u=e[l],c=u.x,d=c+u.width,h=u.y,p=h+u.height;if(r>=c&&a>=h&&i<=d&&s<=p){e.splice(t,1);break}if(!(r!==c||n.width!==u.width||p<a||h>s)){h>a&&(u.height+=h-a,u.y=a),p<s&&(u.height=s-h),e.splice(t,1);break}if(!(a!==h||n.height!==u.height||d<r||c>i)){c>r&&(u.width+=c-r,u.x=r),d<i&&(u.width=i-c),e.splice(t,1);break}}return e},t.findHostInstance=us,t.findHostInstanceWithNoPortals=function(e){return null===(e=null!==(e=C(e))?R(e):null)?null:e.stateNode},t.findHostInstanceWithWarning=function(e){return us(e)},t.flushControlled=function(e){var t=qa;qa|=1;var n=Ja.transition,r=Pt;try{Ja.transition=null,Pt=1,e()}finally{Pt=r,Ja.transition=n,0===(qa=t)&&(lo(),Qt())}},t.flushPassiveEffects=Wo,t.flushSync=Lo,t.focusWithin=function(e,t){if(!re)throw Error(o(363));for(t=Ga(e=Oa(e),t),t=Array.from(t),e=0;e<t.length;){var n=t[e++];if(!se(n)){if(5===n.tag&&ue(n.stateNode))return!0;for(n=n.child;null!==n;)t.push(n),n=n.sibling}}return!1},t.getCurrentUpdatePriority=function(){return Pt},t.getFindAllNodesFailureDescription=function(e,t){if(!re)throw Error(o(363));var n=0,r=[];e=[Oa(e),0];for(var i=0;i<e.length;){var a=e[i++],s=e[i++],l=t[s];if((5!==a.tag||!se(a))&&(Ha(a,l)&&(r.push(Ua(l)),++s>n&&(n=s)),s<t.length))for(a=a.child;null!==a;)e.push(a,s),a=a.sibling}if(n<t.length){for(e=[];n<t.length;n++)e.push(Ua(t[n]));return"findAllNodes was able to match part of the selector:\n "+r.join(" > ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},t.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?D(e.child.stateNode):e.child.stateNode:null},t.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:hs,findFiberByHostInstance:e.findFiberByHostInstance||ps,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{Wt=t.inject(e),Vt=t}catch(e){}e=!!t.checkDCE}}return e},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(e,t,n,r){if(!re)throw Error(o(363));e=za(e,t);var i=ce(e,n,r).disconnect;return{disconnect:function(){i()}}},t.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},t.runWithPriority=function(e,t){var n=Pt;try{return Pt=e,t()}finally{Pt=n}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(e,t,n,r){var i=t.current,a=wo(),o=_o(i);return n=ls(n),null===t.context?t.context=n:t.pendingContext=n,(t=gn(a,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),vn(i,t),null!==(e=Mo(i,o,a))&&yn(e,i,o),o},t}},2576:(e,t,n)=>{"use strict";e.exports=n(6511)},6525:(e,t,n)=>{"use strict";e.exports=n(7287)},5251:(e,t,n)=>{"use strict";var r=n(7294),i=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var r,a={},u=null,c=null;for(r in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)o.call(t,r)&&!l.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:i,type:e,key:u,ref:c,props:a,_owner:s.current}}t.Fragment=a,t.jsx=u,t.jsxs=u},2408:(e,t)=>{"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}function y(){}function x(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=v.prototype;var b=x.prototype=new y;b.constructor=x,m(b,v.prototype),b.isPureReactComponent=!0;var w=Array.isArray,_=Object.prototype.hasOwnProperty,M={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function A(e,t,r){var i,a={},o=null,s=null;if(null!=t)for(i in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(o=""+t.key),t)_.call(t,i)&&!S.hasOwnProperty(i)&&(a[i]=t[i]);var l=arguments.length-2;if(1===l)a.children=r;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];a.children=u}if(e&&e.defaultProps)for(i in l=e.defaultProps)void 0===a[i]&&(a[i]=l[i]);return{$$typeof:n,type:e,key:o,ref:s,props:a,_owner:M.current}}function E(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var C=/\/+/g;function T(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function B(e,t,i,a,o){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l=!1;if(null===e)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case r:l=!0}}if(l)return o=o(l=e),e=""===a?"."+T(l,0):a,w(o)?(i="",null!=e&&(i=e.replace(C,"$&/")+"/"),B(o,t,i,"",(function(e){return e}))):null!=o&&(E(o)&&(o=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,i+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(C,"$&/")+"/")+e)),t.push(o)),1;if(l=0,a=""===a?".":a+":",w(e))for(var u=0;u<e.length;u++){var c=a+T(s=e[u],u);l+=B(s,t,i,c,o)}else if(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"==typeof c)for(e=c.call(e),u=0;!(s=e.next()).done;)l+=B(s=s.value,t,i,c=a+T(s,u++),o);else if("object"===s)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function R(e,t,n){if(null==e)return e;var r=[],i=0;return B(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function L(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var P={current:null},D={transition:null},I={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:D,ReactCurrentOwner:M};t.Children={map:R,forEach:function(e,t,n){R(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return R(e,(function(){t++})),t},toArray:function(e){return R(e,(function(e){return e}))||[]},only:function(e){if(!E(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=v,t.Fragment=i,t.Profiler=o,t.PureComponent=x,t.StrictMode=a,t.Suspense=c,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,t.cloneElement=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=m({},e.props),a=e.key,o=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(o=t.ref,s=M.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)_.call(t,u)&&!S.hasOwnProperty(u)&&(i[u]=void 0===t[u]&&void 0!==l?l[u]:t[u])}var u=arguments.length-2;if(1===u)i.children=r;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];i.children=l}return{$$typeof:n,type:e.type,key:a,ref:o,props:i,_owner:s}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=A,t.createFactory=function(e){var t=A.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:u,render:e}},t.isValidElement=E,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:L}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=D.transition;D.transition={};try{e()}finally{D.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return P.current.useCallback(e,t)},t.useContext=function(e){return P.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return P.current.useDeferredValue(e)},t.useEffect=function(e,t){return P.current.useEffect(e,t)},t.useId=function(){return P.current.useId()},t.useImperativeHandle=function(e,t,n){return P.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return P.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return P.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return P.current.useMemo(e,t)},t.useReducer=function(e,t,n){return P.current.useReducer(e,t,n)},t.useRef=function(e){return P.current.useRef(e)},t.useState=function(e){return P.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return P.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return P.current.useTransition()},t.version="18.1.0"},7294:(e,t,n)=>{"use strict";e.exports=n(2408)},5893:(e,t,n)=>{"use strict";e.exports=n(5251)},53:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<a(i,t)))break e;e[r]=t,e[n]=i,n=r}}function r(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,o=i>>>1;r<o;){var s=2*(r+1)-1,l=e[s],u=s+1,c=e[u];if(0>a(l,n))u<i&&0>a(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[s]=n,r=s);else{if(!(u<i&&0>a(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var u=[],c=[],d=1,h=null,p=3,f=!1,m=!1,g=!1,v="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,x="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function w(e){if(g=!1,b(e),!m)if(null!==r(u))m=!0,D(_);else{var t=r(c);null!==t&&I(w,t.startTime-e)}}function _(e,n){m=!1,g&&(g=!1,y(E),E=-1),f=!0;var a=p;try{for(b(n),h=r(u);null!==h&&(!(h.expirationTime>n)||e&&!B());){var o=h.callback;if("function"==typeof o){h.callback=null,p=h.priorityLevel;var s=o(h.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?h.callback=s:h===r(u)&&i(u),b(n)}else i(u);h=r(u)}if(null!==h)var l=!0;else{var d=r(c);null!==d&&I(w,d.startTime-n),l=!1}return l}finally{h=null,p=a,f=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var M,S=!1,A=null,E=-1,C=5,T=-1;function B(){return!(t.unstable_now()-T<C)}function R(){if(null!==A){var e=t.unstable_now();T=e;var n=!0;try{n=A(!0,e)}finally{n?M():(S=!1,A=null)}}else S=!1}if("function"==typeof x)M=function(){x(R)};else if("undefined"!=typeof MessageChannel){var L=new MessageChannel,P=L.port2;L.port1.onmessage=R,M=function(){P.postMessage(null)}}else M=function(){v(R,0)};function D(e){A=e,S||(S=!0,M())}function I(e,n){E=v((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||f||(m=!0,D(_))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,i,a){var o=t.unstable_now();switch("object"==typeof a&&null!==a?a="number"==typeof(a=a.delay)&&0<a?o+a:o:a=o,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:d++,callback:i,priorityLevel:e,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>o?(e.sortIndex=a,n(c,e),null===r(u)&&e===r(c)&&(g?(y(E),E=-1):g=!0,I(w,a-o))):(e.sortIndex=s,n(u,e),m||f||(m=!0,D(_))),e},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},3840:(e,t,n)=>{"use strict";e.exports=n(53)}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};n.r(e),n.d(e,{ACESFilmicToneMapping:()=>ue,AddEquation:()=>P,AddOperation:()=>ie,AdditiveAnimationBlendMode:()=>Ft,AdditiveBlending:()=>T,AlphaFormat:()=>Ge,AlwaysDepth:()=>K,AlwaysStencilFunc:()=>cn,AmbientLight:()=>Xd,AmbientLightProbe:()=>dh,AnimationClip:()=>xd,AnimationLoader:()=>Cd,AnimationMixer:()=>Vh,AnimationObjectGroup:()=>zh,AnimationUtils:()=>od,ArcCurve:()=>Tu,ArrayCamera:()=>sl,ArrowHelper:()=>Dp,Audio:()=>Mh,AudioAnalyser:()=>Bh,AudioContext:()=>lh,AudioListener:()=>_h,AudioLoader:()=>uh,AxesHelper:()=>Ip,AxisHelper:()=>gf,BackSide:()=>_,BasicDepthPacking:()=>Gt,BasicShadowMap:()=>v,BinaryTextureLoader:()=>wf,Bone:()=>ql,BooleanKeyframeTrack:()=>hd,BoundingBoxHelper:()=>vf,Box2:()=>ep,Box3:()=>gr,Box3Helper:()=>Tp,BoxBufferGeometry:()=>ga,BoxGeometry:()=>ga,BoxHelper:()=>Cp,BufferAttribute:()=>Pi,BufferGeometry:()=>Qi,BufferGeometryLoader:()=>th,ByteType:()=>Le,Cache:()=>wd,Camera:()=>wa,CameraHelper:()=>Sp,CanvasRenderer:()=>Mf,CanvasTexture:()=>Au,CapsuleBufferGeometry:()=>Ku,CapsuleGeometry:()=>Ku,CatmullRomCurve3:()=>Iu,CineonToneMapping:()=>le,CircleBufferGeometry:()=>Qu,CircleGeometry:()=>Qu,ClampToEdgeWrapping:()=>ye,Clock:()=>gh,Color:()=>Zn,ColorKeyframeTrack:()=>pd,ColorManagement:()=>jn,CompressedTexture:()=>Su,CompressedTextureLoader:()=>Td,ConeBufferGeometry:()=>Zu,ConeGeometry:()=>Zu,CubeCamera:()=>Sa,CubeReflectionMapping:()=>he,CubeRefractionMapping:()=>pe,CubeTexture:()=>Aa,CubeTextureLoader:()=>Rd,CubeUVReflectionMapping:()=>ge,CubicBezierCurve:()=>Ou,CubicBezierCurve3:()=>Hu,CubicInterpolant:()=>ld,CullFaceBack:()=>f,CullFaceFront:()=>m,CullFaceFrontBack:()=>g,CullFaceNone:()=>p,Curve:()=>Eu,CurvePath:()=>Ju,CustomBlending:()=>L,CustomToneMapping:()=>ce,CylinderBufferGeometry:()=>Yu,CylinderGeometry:()=>Yu,Cylindrical:()=>Zh,Data3DTexture:()=>ur,DataArrayTexture:()=>sr,DataTexture:()=>Xl,DataTexture2DArray:()=>Df,DataTexture3D:()=>If,DataTextureLoader:()=>Ld,DataUtils:()=>kp,DecrementStencilOp:()=>Zt,DecrementWrapStencilOp:()=>en,DefaultLoadingManager:()=>Md,DepthFormat:()=>Je,DepthStencilFormat:()=>qe,DepthTexture:()=>dl,DirectionalLight:()=>qd,DirectionalLightHelper:()=>wp,DiscreteInterpolant:()=>cd,DodecahedronBufferGeometry:()=>ec,DodecahedronGeometry:()=>ec,DoubleSide:()=>M,DstAlphaFactor:()=>W,DstColorFactor:()=>j,DynamicBufferAttribute:()=>of,DynamicCopyUsage:()=>yn,DynamicDrawUsage:()=>hn,DynamicReadUsage:()=>mn,EdgesGeometry:()=>ac,EdgesHelper:()=>yf,EllipseCurve:()=>Cu,EqualDepth:()=>Z,EqualStencilFunc:()=>an,EquirectangularReflectionMapping:()=>fe,EquirectangularRefractionMapping:()=>me,Euler:()=>ei,EventDispatcher:()=>Mn,ExtrudeBufferGeometry:()=>Fc,ExtrudeGeometry:()=>Fc,FaceColors:()=>Xp,FileLoader:()=>Ed,FlatShading:()=>S,Float16BufferAttribute:()=>Ui,Float32Attribute:()=>ff,Float32BufferAttribute:()=>Gi,Float64Attribute:()=>mf,Float64BufferAttribute:()=>zi,FloatType:()=>ke,Fog:()=>vl,FogExp2:()=>gl,Font:()=>Rf,FontLoader:()=>Bf,FramebufferTexture:()=>Mu,FrontSide:()=>w,Frustum:()=>Da,GLBufferAttribute:()=>qh,GLSL1:()=>bn,GLSL3:()=>wn,GreaterDepth:()=>ee,GreaterEqualDepth:()=>$,GreaterEqualStencilFunc:()=>un,GreaterStencilFunc:()=>sn,GridHelper:()=>gp,Group:()=>ll,HalfFloatType:()=>Ne,HemisphereLight:()=>Id,HemisphereLightHelper:()=>mp,HemisphereLightProbe:()=>ch,IcosahedronBufferGeometry:()=>Nc,IcosahedronGeometry:()=>Nc,ImageBitmapLoader:()=>oh,ImageLoader:()=>Bd,ImageUtils:()=>er,ImmediateRenderObject:()=>Lf,IncrementStencilOp:()=>Yt,IncrementWrapStencilOp:()=>$t,InstancedBufferAttribute:()=>Zl,InstancedBufferGeometry:()=>eh,InstancedInterleavedBuffer:()=>Jh,InstancedMesh:()=>ru,Int16Attribute:()=>cf,Int16BufferAttribute:()=>ki,Int32Attribute:()=>hf,Int32BufferAttribute:()=>Oi,Int8Attribute:()=>sf,Int8BufferAttribute:()=>Di,IntType:()=>Ie,InterleavedBuffer:()=>xl,InterleavedBufferAttribute:()=>wl,Interpolant:()=>sd,InterpolateDiscrete:()=>Tt,InterpolateLinear:()=>Bt,InterpolateSmooth:()=>Rt,InvertStencilOp:()=>tn,JSONLoader:()=>Sf,KeepStencilOp:()=>Kt,KeyframeTrack:()=>dd,LOD:()=>Ul,LatheBufferGeometry:()=>Xu,LatheGeometry:()=>Xu,Layers:()=>ti,LensFlare:()=>Ef,LessDepth:()=>Q,LessEqualDepth:()=>Y,LessEqualStencilFunc:()=>on,LessStencilFunc:()=>rn,Light:()=>Dd,LightProbe:()=>Yd,Line:()=>cu,Line3:()=>rp,LineBasicMaterial:()=>iu,LineCurve:()=>Uu,LineCurve3:()=>Gu,LineDashedMaterial:()=>id,LineLoop:()=>fu,LinePieces:()=>Jp,LineSegments:()=>pu,LineStrip:()=>jp,LinearEncoding:()=>Ht,LinearFilter:()=>Ae,LinearInterpolant:()=>ud,LinearMipMapLinearFilter:()=>Be,LinearMipMapNearestFilter:()=>Ce,LinearMipmapLinearFilter:()=>Te,LinearMipmapNearestFilter:()=>Ee,LinearSRGBColorSpace:()=>qt,LinearToneMapping:()=>oe,Loader:()=>Sd,LoaderUtils:()=>$d,LoadingManager:()=>_d,LoopOnce:()=>At,LoopPingPong:()=>Ct,LoopRepeat:()=>Et,LuminanceAlphaFormat:()=>je,LuminanceFormat:()=>Ve,MOUSE:()=>d,Material:()=>Ti,MaterialLoader:()=>Zd,Math:()=>Fn,MathUtils:()=>Fn,Matrix3:()=>Nn,Matrix4:()=>Vr,MaxEquation:()=>k,Mesh:()=>fa,MeshBasicMaterial:()=>Bi,MeshDepthMaterial:()=>tl,MeshDistanceMaterial:()=>nl,MeshFaceMaterial:()=>Qp,MeshLambertMaterial:()=>nd,MeshMatcapMaterial:()=>rd,MeshNormalMaterial:()=>td,MeshPhongMaterial:()=>$c,MeshPhysicalMaterial:()=>Zc,MeshStandardMaterial:()=>Yc,MeshToonMaterial:()=>ed,MinEquation:()=>F,MirroredRepeatWrapping:()=>xe,MixOperation:()=>re,MultiMaterial:()=>Yp,MultiplyBlending:()=>R,MultiplyOperation:()=>ne,NearestFilter:()=>be,NearestMipMapLinearFilter:()=>Se,NearestMipMapNearestFilter:()=>_e,NearestMipmapLinearFilter:()=>Me,NearestMipmapNearestFilter:()=>we,NeverDepth:()=>X,NeverStencilFunc:()=>nn,NoBlending:()=>E,NoColorSpace:()=>jt,NoColors:()=>qp,NoToneMapping:()=>ae,NormalAnimationBlendMode:()=>It,NormalBlending:()=>C,NotEqualDepth:()=>te,NotEqualStencilFunc:()=>ln,NumberKeyframeTrack:()=>fd,Object3D:()=>mi,ObjectLoader:()=>nh,ObjectSpaceNormalMap:()=>Vt,OctahedronBufferGeometry:()=>Oc,OctahedronGeometry:()=>Oc,OneFactor:()=>O,OneMinusDstAlphaFactor:()=>V,OneMinusDstColorFactor:()=>J,OneMinusSrcAlphaFactor:()=>z,OneMinusSrcColorFactor:()=>U,OrthographicCamera:()=>Ja,PCFShadowMap:()=>y,PCFSoftShadowMap:()=>x,PMREMGenerator:()=>to,ParametricGeometry:()=>Cf,Particle:()=>$p,ParticleBasicMaterial:()=>nf,ParticleSystem:()=>ef,ParticleSystemMaterial:()=>rf,Path:()=>qu,PerspectiveCamera:()=>_a,Plane:()=>Ra,PlaneBufferGeometry:()=>ka,PlaneGeometry:()=>ka,PlaneHelper:()=>Bp,PointCloud:()=>Zp,PointCloudMaterial:()=>tf,PointLight:()=>jd,PointLightHelper:()=>dp,Points:()=>bu,PointsMaterial:()=>mu,PolarGridHelper:()=>vp,PolyhedronBufferGeometry:()=>$u,PolyhedronGeometry:()=>$u,PositionalAudio:()=>Th,PropertyBinding:()=>Gh,PropertyMixer:()=>Rh,QuadraticBezierCurve:()=>zu,QuadraticBezierCurve3:()=>Wu,Quaternion:()=>hr,QuaternionKeyframeTrack:()=>gd,QuaternionLinearInterpolant:()=>md,REVISION:()=>c,RGBADepthPacking:()=>zt,RGBAFormat:()=>We,RGBAIntegerFormat:()=>Ze,RGBA_ASTC_10x10_Format:()=>wt,RGBA_ASTC_10x5_Format:()=>yt,RGBA_ASTC_10x6_Format:()=>xt,RGBA_ASTC_10x8_Format:()=>bt,RGBA_ASTC_12x10_Format:()=>_t,RGBA_ASTC_12x12_Format:()=>Mt,RGBA_ASTC_4x4_Format:()=>ct,RGBA_ASTC_5x4_Format:()=>dt,RGBA_ASTC_5x5_Format:()=>ht,RGBA_ASTC_6x5_Format:()=>pt,RGBA_ASTC_6x6_Format:()=>ft,RGBA_ASTC_8x5_Format:()=>mt,RGBA_ASTC_8x6_Format:()=>gt,RGBA_ASTC_8x8_Format:()=>vt,RGBA_BPTC_Format:()=>St,RGBA_ETC2_EAC_Format:()=>ut,RGBA_PVRTC_2BPPV1_Format:()=>ot,RGBA_PVRTC_4BPPV1_Format:()=>at,RGBA_S3TC_DXT1_Format:()=>et,RGBA_S3TC_DXT3_Format:()=>tt,RGBA_S3TC_DXT5_Format:()=>nt,RGBFormat:()=>ze,RGB_ETC1_Format:()=>st,RGB_ETC2_Format:()=>lt,RGB_PVRTC_2BPPV1_Format:()=>it,RGB_PVRTC_4BPPV1_Format:()=>rt,RGB_S3TC_DXT1_Format:()=>$e,RGFormat:()=>Qe,RGIntegerFormat:()=>Ye,RawShaderMaterial:()=>Qc,Ray:()=>Wr,Raycaster:()=>Xh,RectAreaLight:()=>Kd,RedFormat:()=>Xe,RedIntegerFormat:()=>Ke,ReinhardToneMapping:()=>se,RepeatWrapping:()=>ve,ReplaceStencilOp:()=>Qt,ReverseSubtractEquation:()=>I,RingBufferGeometry:()=>Hc,RingGeometry:()=>Hc,SRGBColorSpace:()=>Jt,Scene:()=>yl,SceneUtils:()=>Af,ShaderChunk:()=>Na,ShaderLib:()=>Ha,ShaderMaterial:()=>ba,ShadowMaterial:()=>Kc,Shape:()=>oc,ShapeBufferGeometry:()=>Uc,ShapeGeometry:()=>Uc,ShapePath:()=>Fp,ShapeUtils:()=>Pc,ShortType:()=>Pe,Skeleton:()=>Yl,SkeletonHelper:()=>up,SkinnedMesh:()=>Jl,SmoothShading:()=>A,Source:()=>tr,Sphere:()=>Fr,SphereBufferGeometry:()=>Gc,SphereGeometry:()=>Gc,Spherical:()=>Yh,SphericalHarmonics3:()=>Qd,SplineCurve:()=>Vu,SpotLight:()=>Ud,SpotLightHelper:()=>ap,Sprite:()=>kl,SpriteMaterial:()=>_l,SrcAlphaFactor:()=>G,SrcAlphaSaturateFactor:()=>q,SrcColorFactor:()=>H,StaticCopyUsage:()=>vn,StaticDrawUsage:()=>dn,StaticReadUsage:()=>fn,StereoCamera:()=>mh,StreamCopyUsage:()=>xn,StreamDrawUsage:()=>pn,StreamReadUsage:()=>gn,StringKeyframeTrack:()=>vd,SubtractEquation:()=>D,SubtractiveBlending:()=>B,TOUCH:()=>h,TangentSpaceNormalMap:()=>Wt,TetrahedronBufferGeometry:()=>zc,TetrahedronGeometry:()=>zc,TextGeometry:()=>Tf,Texture:()=>ir,TextureLoader:()=>Pd,TorusBufferGeometry:()=>Wc,TorusGeometry:()=>Wc,TorusKnotBufferGeometry:()=>Vc,TorusKnotGeometry:()=>Vc,Triangle:()=>Ei,TriangleFanDrawMode:()=>Ot,TriangleStripDrawMode:()=>Nt,TrianglesDrawMode:()=>kt,TubeBufferGeometry:()=>jc,TubeGeometry:()=>jc,UVMapping:()=>de,Uint16Attribute:()=>df,Uint16BufferAttribute:()=>Ni,Uint32Attribute:()=>pf,Uint32BufferAttribute:()=>Hi,Uint8Attribute:()=>lf,Uint8BufferAttribute:()=>Ii,Uint8ClampedAttribute:()=>uf,Uint8ClampedBufferAttribute:()=>Fi,Uniform:()=>jh,UniformsLib:()=>Oa,UniformsUtils:()=>xa,UnsignedByteType:()=>Re,UnsignedInt248Type:()=>Ue,UnsignedIntType:()=>Fe,UnsignedShort4444Type:()=>Oe,UnsignedShort5551Type:()=>He,UnsignedShortType:()=>De,VSMShadowMap:()=>b,Vector2:()=>kn,Vector3:()=>pr,Vector4:()=>ar,VectorKeyframeTrack:()=>yd,Vertex:()=>af,VertexColors:()=>Kp,VideoTexture:()=>_u,WebGL1Renderer:()=>ml,WebGL3DRenderTarget:()=>cr,WebGLArrayRenderTarget:()=>lr,WebGLCubeRenderTarget:()=>Ea,WebGLMultipleRenderTargets:()=>dr,WebGLMultisampleRenderTarget:()=>Pf,WebGLRenderTarget:()=>or,WebGLRenderTargetCube:()=>_f,WebGLRenderer:()=>fl,WebGLUtils:()=>ol,WireframeGeometry:()=>Jc,WireframeHelper:()=>xf,WrapAroundEnding:()=>Dt,XHRLoader:()=>bf,ZeroCurvatureEnding:()=>Lt,ZeroFactor:()=>N,ZeroSlopeEnding:()=>Pt,ZeroStencilOp:()=>Xt,_SRGBAFormat:()=>_n,sRGBEncoding:()=>Ut});var t=n(9669),r=n.n(t),i=n(9755),a=n.n(i),o=n(3935),s=n(7294),l=new URL(document.location.href);function u(e,t){return"".concat(l.protocol,"//").concat(e,".").concat((n="http://gtoria.local",n.replace(/https?:\/\//i,"")),"/").concat(t);var n}const c="139",d={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},h={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},p=0,f=1,m=2,g=3,v=0,y=1,x=2,b=3,w=0,_=1,M=2,S=1,A=2,E=0,C=1,T=2,B=3,R=4,L=5,P=100,D=101,I=102,F=103,k=104,N=200,O=201,H=202,U=203,G=204,z=205,W=206,V=207,j=208,J=209,q=210,X=0,K=1,Q=2,Y=3,Z=4,$=5,ee=6,te=7,ne=0,re=1,ie=2,ae=0,oe=1,se=2,le=3,ue=4,ce=5,de=300,he=301,pe=302,fe=303,me=304,ge=306,ve=1e3,ye=1001,xe=1002,be=1003,we=1004,_e=1004,Me=1005,Se=1005,Ae=1006,Ee=1007,Ce=1007,Te=1008,Be=1008,Re=1009,Le=1010,Pe=1011,De=1012,Ie=1013,Fe=1014,ke=1015,Ne=1016,Oe=1017,He=1018,Ue=1020,Ge=1021,ze=1022,We=1023,Ve=1024,je=1025,Je=1026,qe=1027,Xe=1028,Ke=1029,Qe=1030,Ye=1031,Ze=1033,$e=33776,et=33777,tt=33778,nt=33779,rt=35840,it=35841,at=35842,ot=35843,st=36196,lt=37492,ut=37496,ct=37808,dt=37809,ht=37810,pt=37811,ft=37812,mt=37813,gt=37814,vt=37815,yt=37816,xt=37817,bt=37818,wt=37819,_t=37820,Mt=37821,St=36492,At=2200,Et=2201,Ct=2202,Tt=2300,Bt=2301,Rt=2302,Lt=2400,Pt=2401,Dt=2402,It=2500,Ft=2501,kt=0,Nt=1,Ot=2,Ht=3e3,Ut=3001,Gt=3200,zt=3201,Wt=0,Vt=1,jt="",Jt="srgb",qt="srgb-linear",Xt=0,Kt=7680,Qt=7681,Yt=7682,Zt=7683,$t=34055,en=34056,tn=5386,nn=512,rn=513,an=514,on=515,sn=516,ln=517,un=518,cn=519,dn=35044,hn=35048,pn=35040,fn=35045,mn=35049,gn=35041,vn=35046,yn=35050,xn=35042,bn="100",wn="300 es",_n=1035;class Mn{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,r=n.length;t<r;t++)n[t].call(this,e);e.target=null}}}const Sn=[];for(let e=0;e<256;e++)Sn[e]=(e<16?"0":"")+e.toString(16);let An=1234567;const En=Math.PI/180,Cn=180/Math.PI;function Tn(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(Sn[255&e]+Sn[e>>8&255]+Sn[e>>16&255]+Sn[e>>24&255]+"-"+Sn[255&t]+Sn[t>>8&255]+"-"+Sn[t>>16&15|64]+Sn[t>>24&255]+"-"+Sn[63&n|128]+Sn[n>>8&255]+"-"+Sn[n>>16&255]+Sn[n>>24&255]+Sn[255&r]+Sn[r>>8&255]+Sn[r>>16&255]+Sn[r>>24&255]).toLowerCase()}function Bn(e,t,n){return Math.max(t,Math.min(n,e))}function Rn(e,t){return(e%t+t)%t}function Ln(e,t,n){return(1-n)*e+n*t}function Pn(e){return 0==(e&e-1)&&0!==e}function Dn(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function In(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var Fn=Object.freeze({__proto__:null,DEG2RAD:En,RAD2DEG:Cn,generateUUID:Tn,clamp:Bn,euclideanModulo:Rn,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:Ln,damp:function(e,t,n,r){return Ln(e,t,1-Math.exp(-n*r))},pingpong:function(e,t=1){return t-Math.abs(Rn(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(An=e);let t=An+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*En},radToDeg:function(e){return e*Cn},isPowerOfTwo:Pn,ceilPowerOfTwo:Dn,floorPowerOfTwo:In,setQuaternionFromProperEuler:function(e,t,n,r,i){const a=Math.cos,o=Math.sin,s=a(n/2),l=o(n/2),u=a((t+r)/2),c=o((t+r)/2),d=a((t-r)/2),h=o((t-r)/2),p=a((r-t)/2),f=o((r-t)/2);switch(i){case"XYX":e.set(s*c,l*d,l*h,s*u);break;case"YZY":e.set(l*h,s*c,l*d,s*u);break;case"ZXZ":e.set(l*d,l*h,s*c,s*u);break;case"XZX":e.set(s*c,l*f,l*p,s*u);break;case"YXY":e.set(l*p,s*c,l*f,s*u);break;case"ZYZ":e.set(l*f,l*p,s*c,s*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:function(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}},denormalize:function(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}});class kn{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 new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(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,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(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){const 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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(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}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const 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,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const 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}}kn.prototype.isVector2=!0;class Nn{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,i,a,o,s,l){const u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=t,u[4]=i,u[5]=s,u[6]=n,u[7]=a,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const 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){const 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){const n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],u=n[4],c=n[7],d=n[2],h=n[5],p=n[8],f=r[0],m=r[3],g=r[6],v=r[1],y=r[4],x=r[7],b=r[2],w=r[5],_=r[8];return i[0]=a*f+o*v+s*b,i[3]=a*m+o*y+s*w,i[6]=a*g+o*x+s*_,i[1]=l*f+u*v+c*b,i[4]=l*m+u*y+c*w,i[7]=l*g+u*x+c*_,i[2]=d*f+h*v+p*b,i[5]=d*m+h*y+p*w,i[8]=d*g+h*x+p*_,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8];return t*a*u-t*o*l-n*i*u+n*o*s+r*i*l-r*a*s}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=u*a-o*l,d=o*s-u*i,h=l*i-a*s,p=t*c+n*d+r*h;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return e[0]=c*f,e[1]=(r*l-u*n)*f,e[2]=(o*n-r*a)*f,e[3]=d*f,e[4]=(u*t-r*s)*f,e[5]=(r*i-o*t)*f,e[6]=h*f,e[7]=(n*s-l*t)*f,e[8]=(a*t-n*i)*f,this}transpose(){let e;const 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){const 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){const s=Math.cos(i),l=Math.sin(i);return this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-r*l,r*s,-r*(-l*a+s*o)+o+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],l=r[4],u=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*l,r[6]=t*o+n*u,r[1]=-n*i+t*s,r[4]=-n*a+t*l,r[7]=-n*o+t*u,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const 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){const 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)}}function On(e){for(let t=e.length-1;t>=0;--t)if(e[t]>65535)return!0;return!1}Nn.prototype.isMatrix3=!0;const Hn={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Un(e,t){return new Hn[e](t)}function Gn(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function zn(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Wn(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}const Vn={[Jt]:{[qt]:zn},[qt]:{[Jt]:Wn}},jn={legacyMode:!0,get workingColorSpace(){return qt},set workingColorSpace(e){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(e,t,n){if(this.legacyMode||t===n||!t||!n)return e;if(Vn[t]&&void 0!==Vn[t][n]){const r=Vn[t][n];return e.r=r(e.r),e.g=r(e.g),e.b=r(e.b),e}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this.workingColorSpace)}},Jn={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},qn={r:0,g:0,b:0},Xn={h:0,s:0,l:0},Kn={h:0,s:0,l:0};function Qn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function Yn(e,t){return t.r=e.r,t.g=e.g,t.b=e.b,t}class Zn{constructor(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Jt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,jn.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r=qt){return this.r=e,this.g=t,this.b=n,jn.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r=qt){if(e=Rn(e,1),t=Bn(t,0,1),n=Bn(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Qn(i,r,e+1/3),this.g=Qn(i,r,e),this.b=Qn(i,r,e-1/3)}return jn.toWorkingColorSpace(this,r),this}setStyle(e,t=Jt){function n(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e;const i=r[1],a=r[2];switch(i){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,jn.toWorkingColorSpace(this,t),n(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,jn.toWorkingColorSpace(this,t),n(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){const r=parseFloat(e[1])/360,i=parseInt(e[2],10)/100,a=parseInt(e[3],10)/100;return n(e[4]),this.setHSL(r,i,a,t)}}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const e=r[1],n=e.length;if(3===n)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,jn.toWorkingColorSpace(this,t),this;if(6===n)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,jn.toWorkingColorSpace(this,t),this}return e&&e.length>0?this.setColorName(e,t):this}setColorName(e,t=Jt){const n=Jn[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=zn(e.r),this.g=zn(e.g),this.b=zn(e.b),this}copyLinearToSRGB(e){return this.r=Wn(e.r),this.g=Wn(e.g),this.b=Wn(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Jt){return jn.fromWorkingColorSpace(Yn(this,qn),e),Bn(255*qn.r,0,255)<<16^Bn(255*qn.g,0,255)<<8^Bn(255*qn.b,0,255)<<0}getHexString(e=Jt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=qt){jn.fromWorkingColorSpace(Yn(this,qn),t);const n=qn.r,r=qn.g,i=qn.b,a=Math.max(n,r,i),o=Math.min(n,r,i);let s,l;const u=(o+a)/2;if(o===a)s=0,l=0;else{const e=a-o;switch(l=u<=.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}s/=6}return e.h=s,e.s=l,e.l=u,e}getRGB(e,t=qt){return jn.fromWorkingColorSpace(Yn(this,qn),t),e.r=qn.r,e.g=qn.g,e.b=qn.b,e}getStyle(e=Jt){return jn.fromWorkingColorSpace(Yn(this,qn),e),e!==Jt?`color(${e} ${qn.r} ${qn.g} ${qn.b})`:`rgb(${255*qn.r|0},${255*qn.g|0},${255*qn.b|0})`}offsetHSL(e,t,n){return this.getHSL(Xn),Xn.h+=e,Xn.s+=t,Xn.l+=n,this.setHSL(Xn.h,Xn.s,Xn.l),this}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(Xn),e.getHSL(Kn);const n=Ln(Xn.h,Kn.h,t),r=Ln(Xn.s,Kn.s,t),i=Ln(Xn.l,Kn.l,t);return this.setHSL(n,r,i),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),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}let $n;Zn.NAMES=Jn,Zn.prototype.isColor=!0,Zn.prototype.r=1,Zn.prototype.g=1,Zn.prototype.b=1;class er{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===$n&&($n=Gn("canvas")),$n.width=e.width,$n.height=e.height;const n=$n.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=$n}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=Gn("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=255*zn(i[e]/255);return n.putImageData(r,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*zn(t[e]/255)):t[e]=zn(t[e]);return{data:t,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}class tr{constructor(e=null){this.uuid=Tn(),this.data=e,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(nr(r[t].image)):e.push(nr(r[t]))}else e=nr(r);n.url=e}return t||(e.images[this.uuid]=n),n}}function nr(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?er.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}tr.prototype.isSource=!0;let rr=0;class ir extends Mn{constructor(e=ir.DEFAULT_IMAGE,t=ir.DEFAULT_MAPPING,n=ye,r=ye,i=Ae,a=Te,o=We,s=Re,l=1,u=Ht){super(),Object.defineProperty(this,"id",{value:rr++}),this.uuid=Tn(),this.name="",this.source=new tr(e),this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=s,this.offset=new kn(0,0),this.repeat=new kn(1,1),this.center=new kn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Nn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}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)}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.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.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.encoding=e.encoding,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,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,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==de)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ve:e.x=e.x-Math.floor(e.x);break;case ye:e.x=e.x<0?0:1;break;case xe:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case ve:e.y=e.y-Math.floor(e.y);break;case ye:e.y=e.y<0?0:1;break;case xe:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}}ir.DEFAULT_IMAGE=null,ir.DEFAULT_MAPPING=de,ir.prototype.isTexture=!0;class ar{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 new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(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,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(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){const 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}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const 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;const a=.01,o=.1,s=e.elements,l=s[0],u=s[4],c=s[8],d=s[1],h=s[5],p=s[9],f=s[2],m=s[6],g=s[10];if(Math.abs(u-d)<a&&Math.abs(c-f)<a&&Math.abs(p-m)<a){if(Math.abs(u+d)<o&&Math.abs(c+f)<o&&Math.abs(p+m)<o&&Math.abs(l+h+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,s=(h+1)/2,v=(g+1)/2,y=(u+d)/4,x=(c+f)/4,b=(p+m)/4;return e>s&&e>v?e<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=y/n,i=x/n):s>v?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=y/r,i=b/r):v<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(v),n=x/i,r=b/i),this.set(n,r,i,t),this}let v=Math.sqrt((m-p)*(m-p)+(c-f)*(c-f)+(d-u)*(d-u));return Math.abs(v)<.001&&(v=1),this.x=(m-p)/v,this.y=(c-f)/v,this.z=(d-u)/v,this.w=Math.acos((l+h+g-1)/2),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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(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,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),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}}ar.prototype.isVector4=!0;class or extends Mn{constructor(e,t,n={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new ar(0,0,e,t),this.scissorTest=!1,this.viewport=new ar(0,0,e,t);const r={width:e,height:t,depth:1};this.texture=new ir(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.internalFormat=void 0!==n.internalFormat?n.internalFormat:null,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:Ae,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null,this.samples=void 0!==n.samples?n.samples:0}setSize(e,t,n=1){this.width===e&&this.height===t&&this.depth===n||(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,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){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0,this.texture.image=Object.assign({},e.texture.image),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}or.prototype.isWebGLRenderTarget=!0;class sr extends ir{constructor(e=null,t=1,n=1,r=1){super(null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=be,this.minFilter=be,this.wrapR=ye,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}sr.prototype.isDataArrayTexture=!0;class lr extends or{constructor(e,t,n){super(e,t),this.depth=n,this.texture=new sr(null,e,t,n),this.texture.isRenderTargetTexture=!0}}lr.prototype.isWebGLArrayRenderTarget=!0;class ur extends ir{constructor(e=null,t=1,n=1,r=1){super(null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=be,this.minFilter=be,this.wrapR=ye,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}ur.prototype.isData3DTexture=!0;class cr extends or{constructor(e,t,n){super(e,t),this.depth=n,this.texture=new ur(null,e,t,n),this.texture.isRenderTargetTexture=!0}}cr.prototype.isWebGL3DRenderTarget=!0;class dr extends or{constructor(e,t,n,r={}){super(e,t,r);const i=this.texture;this.texture=[];for(let e=0;e<n;e++)this.texture[e]=i.clone(),this.texture[e].isRenderTargetTexture=!0}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.texture.length;r<i;r++)this.texture[r].image.width=e,this.texture[r].image.height=t,this.texture[r].image.depth=n;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this.texture.length=0;for(let t=0,n=e.texture.length;t<n;t++)this.texture[t]=e.texture[t].clone();return this}}dr.prototype.isWebGLMultipleRenderTargets=!0;class hr{constructor(e=0,t=0,n=0,r=1){this._x=e,this._y=t,this._z=n,this._w=r}static slerp(e,t,n,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(e,t,r)}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],l=n[r+1],u=n[r+2],c=n[r+3];const d=i[a+0],h=i[a+1],p=i[a+2],f=i[a+3];if(0===o)return e[t+0]=s,e[t+1]=l,e[t+2]=u,void(e[t+3]=c);if(1===o)return e[t+0]=d,e[t+1]=h,e[t+2]=p,void(e[t+3]=f);if(c!==f||s!==d||l!==h||u!==p){let e=1-o;const t=s*d+l*h+u*p+c*f,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),a=Math.atan2(i,t*n);e=Math.sin(e*a)/i,o=Math.sin(o*a)/i}const i=o*n;if(s=s*e+d*i,l=l*e+h*i,u=u*e+p*i,c=c*e+f*i,e===1-o){const e=1/Math.sqrt(s*s+l*l+u*u+c*c);s*=e,l*=e,u*=e,c*=e}}e[t]=s,e[t+1]=l,e[t+2]=u,e[t+3]=c}static multiplyQuaternionsFlat(e,t,n,r,i,a){const o=n[r],s=n[r+1],l=n[r+2],u=n[r+3],c=i[a],d=i[a+1],h=i[a+2],p=i[a+3];return e[t]=o*p+u*c+s*h-l*d,e[t+1]=s*p+u*d+l*c-o*h,e[t+2]=l*p+u*h+o*d-s*c,e[t+3]=u*p-o*c-s*d-l*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,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){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,l=o(n/2),u=o(r/2),c=o(i/2),d=s(n/2),h=s(r/2),p=s(i/2);switch(a){case"XYZ":this._x=d*u*c+l*h*p,this._y=l*h*c-d*u*p,this._z=l*u*p+d*h*c,this._w=l*u*c-d*h*p;break;case"YXZ":this._x=d*u*c+l*h*p,this._y=l*h*c-d*u*p,this._z=l*u*p-d*h*c,this._w=l*u*c+d*h*p;break;case"ZXY":this._x=d*u*c-l*h*p,this._y=l*h*c+d*u*p,this._z=l*u*p+d*h*c,this._w=l*u*c-d*h*p;break;case"ZYX":this._x=d*u*c-l*h*p,this._y=l*h*c+d*u*p,this._z=l*u*p-d*h*c,this._w=l*u*c+d*h*p;break;case"YZX":this._x=d*u*c+l*h*p,this._y=l*h*c+d*u*p,this._z=l*u*p-d*h*c,this._w=l*u*c-d*h*p;break;case"XZY":this._x=d*u*c-l*h*p,this._y=l*h*c-d*u*p,this._z=l*u*p+d*h*c,this._w=l*u*c+d*h*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const 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){const t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],l=t[2],u=t[6],c=t[10],d=n+o+c;if(d>0){const e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(u-s)*e,this._y=(i-l)*e,this._z=(a-r)*e}else if(n>o&&n>c){const e=2*Math.sqrt(1+n-o-c);this._w=(u-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+l)/e}else if(o>c){const e=2*Math.sqrt(1+o-n-c);this._w=(i-l)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+u)/e}else{const e=2*Math.sqrt(1+c-n-o);this._w=(a-r)/e,this._x=(i+l)/e,this._y=(s+u)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(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(Bn(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const 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 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,u=t._w;return this._x=n*u+a*o+r*l-i*s,this._y=r*u+a*s+i*o-n*l,this._z=i*u+a*l+n*s-r*o,this._w=a*u-n*o-r*s-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,a=this._w;let o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;const s=1-o*o;if(s<=Number.EPSILON){const e=1-t;return this._w=e*a+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(s),u=Math.atan2(l,o),c=Math.sin((1-t)*u)/l,d=Math.sin(t*u)/l;return this._w=a*c+this._w*d,this._x=n*c+this._x*d,this._y=r*c+this._y*d,this._z=i*c+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),r=2*Math.PI*Math.random(),i=2*Math.PI*Math.random();return this.set(t*Math.cos(r),n*Math.sin(i),n*Math.cos(i),t*Math.sin(r))}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}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}hr.prototype.isQuaternion=!0;class pr{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(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 new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(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,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(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,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(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 e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(mr.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(mr.setFromAxisAngle(e,t))}applyMatrix3(e){const 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){const 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){const t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*r-o*n,u=s*n+o*t-i*r,c=s*r+i*n-a*t,d=-i*t-a*n-o*r;return this.x=l*s+d*-i+u*-o-c*-a,this.y=u*s+d*-a+c*-i-l*-o,this.z=c*s+d*-o+l*-a-u*-i,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const 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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(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,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const 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){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return fr.copy(this).projectOnVector(e),this.sub(fr)}reflect(e){return this.sub(fr.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Bn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const 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){const 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){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const 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,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,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,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),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(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}pr.prototype.isVector3=!0;const fr=new pr,mr=new hr;class gr{constructor(e=new pr(1/0,1/0,1/0),t=new pr(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0;for(let s=0,l=e.length;s<l;s+=3){const l=e[s],u=e[s+1],c=e[s+2];l<t&&(t=l),u<n&&(n=u),c<r&&(r=c),l>i&&(i=l),u>a&&(a=u),c>o&&(o=c)}return this.min.set(t,n,r),this.max.set(i,a,o),this}setFromBufferAttribute(e){let t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0;for(let s=0,l=e.count;s<l;s++){const l=e.getX(s),u=e.getY(s),c=e.getZ(s);l<t&&(t=l),u<n&&(n=u),c<r&&(r=c),l>i&&(i=l),u>a&&(a=u),c>o&&(o=c)}return this.min.set(t,n,r),this.max.set(i,a,o),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=yr.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);const n=e.geometry;if(void 0!==n)if(t&&null!=n.attributes&&void 0!==n.attributes.position){const t=n.attributes.position;for(let n=0,r=t.count;n<r;n++)yr.fromBufferAttribute(t,n).applyMatrix4(e.matrixWorld),this.expandByPoint(yr)}else null===n.boundingBox&&n.computeBoundingBox(),xr.copy(n.boundingBox),xr.applyMatrix4(e.matrixWorld),this.union(xr);const 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,yr),yr.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(Er),Cr.subVectors(this.max,Er),br.subVectors(e.a,Er),wr.subVectors(e.b,Er),_r.subVectors(e.c,Er),Mr.subVectors(wr,br),Sr.subVectors(_r,wr),Ar.subVectors(br,_r);let t=[0,-Mr.z,Mr.y,0,-Sr.z,Sr.y,0,-Ar.z,Ar.y,Mr.z,0,-Mr.x,Sr.z,0,-Sr.x,Ar.z,0,-Ar.x,-Mr.y,Mr.x,0,-Sr.y,Sr.x,0,-Ar.y,Ar.x,0];return!!Rr(t,br,wr,_r,Cr)&&(t=[1,0,0,0,1,0,0,0,1],!!Rr(t,br,wr,_r,Cr)&&(Tr.crossVectors(Mr,Sr),t=[Tr.x,Tr.y,Tr.z],Rr(t,br,wr,_r,Cr)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return yr.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(yr).length(),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()||(vr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),vr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),vr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),vr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),vr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),vr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),vr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),vr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(vr)),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)}}gr.prototype.isBox3=!0;const vr=[new pr,new pr,new pr,new pr,new pr,new pr,new pr,new pr],yr=new pr,xr=new gr,br=new pr,wr=new pr,_r=new pr,Mr=new pr,Sr=new pr,Ar=new pr,Er=new pr,Cr=new pr,Tr=new pr,Br=new pr;function Rr(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){Br.fromArray(e,a);const o=i.x*Math.abs(Br.x)+i.y*Math.abs(Br.y)+i.z*Math.abs(Br.z),s=t.dot(Br),l=n.dot(Br),u=r.dot(Br);if(Math.max(-Math.max(s,l,u),Math.min(s,l,u))>o)return!1}return!0}const Lr=new gr,Pr=new pr,Dr=new pr,Ir=new pr;class Fr{constructor(e=new pr,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):Lr.setFromPoints(e).getCenter(n);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){const 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){const 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=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){Ir.subVectors(e,this.center);const t=Ir.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.add(Ir.multiplyScalar(n/e)),this.radius+=n}return this}union(e){return!0===this.center.equals(e.center)?Dr.set(0,0,1).multiplyScalar(e.radius):Dr.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(Pr.copy(e.center).add(Dr)),this.expandByPoint(Pr.copy(e.center).sub(Dr)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const kr=new pr,Nr=new pr,Or=new pr,Hr=new pr,Ur=new pr,Gr=new pr,zr=new pr;class Wr{constructor(e=new pr,t=new pr(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.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,kr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=kr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(kr.copy(this.direction).multiplyScalar(t).add(this.origin),kr.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Nr.copy(e).add(t).multiplyScalar(.5),Or.copy(t).sub(e).normalize(),Hr.copy(this.origin).sub(Nr);const i=.5*e.distanceTo(t),a=-this.direction.dot(Or),o=Hr.dot(this.direction),s=-Hr.dot(Or),l=Hr.lengthSq(),u=Math.abs(1-a*a);let c,d,h,p;if(u>0)if(c=a*s-o,d=a*o-s,p=i*u,c>=0)if(d>=-p)if(d<=p){const e=1/u;c*=e,d*=e,h=c*(c+a*d+2*o)+d*(a*c+d+2*s)+l}else d=i,c=Math.max(0,-(a*d+o)),h=-c*c+d*(d+2*s)+l;else d=-i,c=Math.max(0,-(a*d+o)),h=-c*c+d*(d+2*s)+l;else d<=-p?(c=Math.max(0,-(-a*i+o)),d=c>0?-i:Math.min(Math.max(-i,-s),i),h=-c*c+d*(d+2*s)+l):d<=p?(c=0,d=Math.min(Math.max(-i,-s),i),h=d*(d+2*s)+l):(c=Math.max(0,-(a*i+o)),d=c>0?i:Math.min(Math.max(-i,-s),i),h=-c*c+d*(d+2*s)+l);else d=a>0?-i:i,c=Math.max(0,-(a*d+o)),h=-c*c+d*(d+2*s)+l;return n&&n.copy(this.direction).multiplyScalar(c).add(this.origin),r&&r.copy(Or).multiplyScalar(d).add(Nr),h}intersectSphere(e,t){kr.subVectors(e.center,this.origin);const n=kr.dot(this.direction),r=kr.dot(kr)-n*n,i=e.radius*e.radius;if(r>i)return null;const a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s;const l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,r=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,r=(e.min.x-d.x)*l),u>=0?(i=(e.min.y-d.y)*u,a=(e.max.y-d.y)*u):(i=(e.max.y-d.y)*u,a=(e.min.y-d.y)*u),n>a||i>r?null:((i>n||n!=n)&&(n=i),(a<r||r!=r)&&(r=a),c>=0?(o=(e.min.z-d.z)*c,s=(e.max.z-d.z)*c):(o=(e.max.z-d.z)*c,s=(e.min.z-d.z)*c),n>s||o>r?null:((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 null!==this.intersectBox(e,kr)}intersectTriangle(e,t,n,r,i){Ur.subVectors(t,e),Gr.subVectors(n,e),zr.crossVectors(Ur,Gr);let a,o=this.direction.dot(zr);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Hr.subVectors(this.origin,e);const s=a*this.direction.dot(Gr.crossVectors(Hr,Gr));if(s<0)return null;const l=a*this.direction.dot(Ur.cross(Hr));if(l<0)return null;if(s+l>o)return null;const u=-a*Hr.dot(zr);return u<0?null:this.at(u/o,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)}}class Vr{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,i,a,o,s,l,u,c,d,h,p,f,m){const 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]=l,g[6]=u,g[10]=c,g[14]=d,g[3]=h,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Vr).fromArray(this.elements)}copy(e){const 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){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const 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 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){const t=this.elements,n=e.elements,r=1/jr.setFromMatrixColumn(e,0).length(),i=1/jr.setFromMatrixColumn(e,1).length(),a=1/jr.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){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),l=Math.sin(r),u=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){const e=a*u,n=a*c,r=o*u,i=o*c;t[0]=s*u,t[4]=-s*c,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-o*s,t[2]=i-e*l,t[6]=r+n*l,t[10]=a*s}else if("YXZ"===e.order){const e=s*u,n=s*c,r=l*u,i=l*c;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*l,t[1]=a*c,t[5]=a*u,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if("ZXY"===e.order){const e=s*u,n=s*c,r=l*u,i=l*c;t[0]=e-i*o,t[4]=-a*c,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*u,t[9]=i-e*o,t[2]=-a*l,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){const e=a*u,n=a*c,r=o*u,i=o*c;t[0]=s*u,t[4]=r*l-n,t[8]=e*l+i,t[1]=s*c,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){const e=a*s,n=a*l,r=o*s,i=o*l;t[0]=s*u,t[4]=i-e*c,t[8]=r*c+n,t[1]=c,t[5]=a*u,t[9]=-o*u,t[2]=-l*u,t[6]=n*c+r,t[10]=e-i*c}else if("XZY"===e.order){const e=a*s,n=a*l,r=o*s,i=o*l;t[0]=s*u,t[4]=-c,t[8]=l*u,t[1]=e*c+i,t[5]=a*u,t[9]=n*c-r,t[2]=r*c-n,t[6]=o*u,t[10]=i*c+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(qr,e,Xr)}lookAt(e,t,n){const r=this.elements;return Yr.subVectors(e,t),0===Yr.lengthSq()&&(Yr.z=1),Yr.normalize(),Kr.crossVectors(n,Yr),0===Kr.lengthSq()&&(1===Math.abs(n.z)?Yr.x+=1e-4:Yr.z+=1e-4,Yr.normalize(),Kr.crossVectors(n,Yr)),Kr.normalize(),Qr.crossVectors(Yr,Kr),r[0]=Kr.x,r[4]=Qr.x,r[8]=Yr.x,r[1]=Kr.y,r[5]=Qr.y,r[9]=Yr.y,r[2]=Kr.z,r[6]=Qr.z,r[10]=Yr.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],u=n[1],c=n[5],d=n[9],h=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],b=n[15],w=r[0],_=r[4],M=r[8],S=r[12],A=r[1],E=r[5],C=r[9],T=r[13],B=r[2],R=r[6],L=r[10],P=r[14],D=r[3],I=r[7],F=r[11],k=r[15];return i[0]=a*w+o*A+s*B+l*D,i[4]=a*_+o*E+s*R+l*I,i[8]=a*M+o*C+s*L+l*F,i[12]=a*S+o*T+s*P+l*k,i[1]=u*w+c*A+d*B+h*D,i[5]=u*_+c*E+d*R+h*I,i[9]=u*M+c*C+d*L+h*F,i[13]=u*S+c*T+d*P+h*k,i[2]=p*w+f*A+m*B+g*D,i[6]=p*_+f*E+m*R+g*I,i[10]=p*M+f*C+m*L+g*F,i[14]=p*S+f*T+m*P+g*k,i[3]=v*w+y*A+x*B+b*D,i[7]=v*_+y*E+x*R+b*I,i[11]=v*M+y*C+x*L+b*F,i[15]=v*S+y*T+x*P+b*k,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],u=e[2],c=e[6],d=e[10],h=e[14];return e[3]*(+i*s*c-r*l*c-i*o*d+n*l*d+r*o*h-n*s*h)+e[7]*(+t*s*h-t*l*d+i*a*d-r*a*h+r*l*u-i*s*u)+e[11]*(+t*l*c-t*o*h-i*a*c+n*a*h+i*o*u-n*l*u)+e[15]*(-r*o*u-t*s*c+t*o*d+r*a*c-n*a*d+n*s*u)}transpose(){const e=this.elements;let 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){const 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(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],d=e[10],h=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=c*m*l-f*d*l+f*s*h-o*m*h-c*s*g+o*d*g,y=p*d*l-u*m*l-p*s*h+a*m*h+u*s*g-a*d*g,x=u*f*l-p*c*l+p*o*h-a*f*h-u*o*g+a*c*g,b=p*c*s-u*f*s-p*o*d+a*f*d+u*o*m-a*c*m,w=t*v+n*y+r*x+i*b;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const _=1/w;return e[0]=v*_,e[1]=(f*d*i-c*m*i-f*r*h+n*m*h+c*r*g-n*d*g)*_,e[2]=(o*m*i-f*s*i+f*r*l-n*m*l-o*r*g+n*s*g)*_,e[3]=(c*s*i-o*d*i-c*r*l+n*d*l+o*r*h-n*s*h)*_,e[4]=y*_,e[5]=(u*m*i-p*d*i+p*r*h-t*m*h-u*r*g+t*d*g)*_,e[6]=(p*s*i-a*m*i-p*r*l+t*m*l+a*r*g-t*s*g)*_,e[7]=(a*d*i-u*s*i+u*r*l-t*d*l-a*r*h+t*s*h)*_,e[8]=x*_,e[9]=(p*c*i-u*f*i-p*n*h+t*f*h+u*n*g-t*c*g)*_,e[10]=(a*f*i-p*o*i+p*n*l-t*f*l-a*n*g+t*o*g)*_,e[11]=(u*o*i-a*c*i-u*n*l+t*c*l+a*n*h-t*o*h)*_,e[12]=b*_,e[13]=(u*f*r-p*c*r+p*n*d-t*f*d-u*n*m+t*c*m)*_,e[14]=(p*o*r-a*f*r-p*n*s+t*f*s+a*n*m-t*o*m)*_,e[15]=(a*c*r-u*o*r+u*n*s-t*c*s-a*n*d+t*o*d)*_,this}scale(e){const 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(){const 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 this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const 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){const 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){const 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){const n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,l=i*a,u=i*o;return this.set(l*a+n,l*o-r*s,l*s+r*o,0,l*o+r*s,u*o+n,u*s-r*a,0,l*s-r*o,u*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){const r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,l=i+i,u=a+a,c=o+o,d=i*l,h=i*u,p=i*c,f=a*u,m=a*c,g=o*c,v=s*l,y=s*u,x=s*c,b=n.x,w=n.y,_=n.z;return r[0]=(1-(f+g))*b,r[1]=(h+x)*b,r[2]=(p-y)*b,r[3]=0,r[4]=(h-x)*w,r[5]=(1-(d+g))*w,r[6]=(m+v)*w,r[7]=0,r[8]=(p+y)*_,r[9]=(m-v)*_,r[10]=(1-(d+f))*_,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=jr.set(r[0],r[1],r[2]).length();const a=jr.set(r[4],r[5],r[6]).length(),o=jr.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Jr.copy(this);const s=1/i,l=1/a,u=1/o;return Jr.elements[0]*=s,Jr.elements[1]*=s,Jr.elements[2]*=s,Jr.elements[4]*=l,Jr.elements[5]*=l,Jr.elements[6]*=l,Jr.elements[8]*=u,Jr.elements[9]*=u,Jr.elements[10]*=u,t.setFromRotationMatrix(Jr),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const o=this.elements,s=2*i/(t-e),l=2*i/(n-r),u=(t+e)/(t-e),c=(n+r)/(n-r),d=-(a+i)/(a-i),h=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=u,o[12]=0,o[1]=0,o[5]=l,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=d,o[14]=h,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,n,r,i,a){const o=this.elements,s=1/(t-e),l=1/(n-r),u=1/(a-i),c=(t+e)*s,d=(n+r)*l,h=(a+i)*u;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-d,o[2]=0,o[6]=0,o[10]=-2*u,o[14]=-h,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){const 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){const 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}}Vr.prototype.isMatrix4=!0;const jr=new pr,Jr=new Vr,qr=new pr(0,0,0),Xr=new pr(1,1,1),Kr=new pr,Qr=new pr,Yr=new pr,Zr=new Vr,$r=new hr;class ei{constructor(e=0,t=0,n=0,r=ei.DefaultOrder){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){const r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],l=r[5],u=r[9],c=r[2],d=r[6],h=r[10];switch(t){case"XYZ":this._y=Math.asin(Bn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Bn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,h),this._z=Math.atan2(s,l)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(Bn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-c,h),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-Bn(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(Bn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(o,h));break;case"XZY":this._z=Math.asin(-Bn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Zr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Zr,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return $r.setFromEuler(this),this.setFromQuaternion($r,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],void 0!==e[3]&&(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(){}}ei.prototype.isEuler=!0,ei.DefaultOrder="XYZ",ei.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class ti{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 0!=(this.mask&e.mask)}isEnabled(e){return 0!=(this.mask&(1<<e|0))}}let ni=0;const ri=new pr,ii=new hr,ai=new Vr,oi=new pr,si=new pr,li=new pr,ui=new hr,ci=new pr(1,0,0),di=new pr(0,1,0),hi=new pr(0,0,1),pi={type:"added"},fi={type:"removed"};class mi extends Mn{constructor(){super(),Object.defineProperty(this,"id",{value:ni++}),this.uuid=Tn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=mi.DefaultUp.clone();const e=new pr,t=new ei,n=new hr,r=new pr(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),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 Vr},normalMatrix:{value:new Nn}}),this.matrix=new Vr,this.matrixWorld=new Vr,this.matrixAutoUpdate=mi.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new ti,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}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 ii.setFromAxisAngle(e,t),this.quaternion.multiply(ii),this}rotateOnWorldAxis(e,t){return ii.setFromAxisAngle(e,t),this.quaternion.premultiply(ii),this}rotateX(e){return this.rotateOnAxis(ci,e)}rotateY(e){return this.rotateOnAxis(di,e)}rotateZ(e){return this.rotateOnAxis(hi,e)}translateOnAxis(e,t){return ri.copy(e).applyQuaternion(this.quaternion),this.position.add(ri.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(ci,e)}translateY(e){return this.translateOnAxis(di,e)}translateZ(e){return this.translateOnAxis(hi,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(ai.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?oi.copy(e):oi.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),si.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ai.lookAt(si,oi,this.up):ai.lookAt(oi,si,this.up),this.quaternion.setFromRotationMatrix(ai),r&&(ai.extractRotation(r.matrixWorld),ii.setFromRotationMatrix(ai),this.quaternion.premultiply(ii.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(pi)):console.error("THREE.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}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(fi)),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(fi)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),ai.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),ai.multiply(e.parent.matrixWorld)),e.applyMatrix4(ai),this.add(e),e.updateWorldMatrix(!1,!0),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++){const r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(si,e,li),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(si,ui,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){const e=this.children;for(let t=0,n=e.length;t<n;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){const t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),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&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){const r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(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++){const n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){const t=a(e.geometries),r=a(e.materials),i=a(e.textures),o=a(e.images),s=a(e.shapes),l=a(e.skeletons),u=a(e.animations),c=a(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),l.length>0&&(n.skeletons=l),u.length>0&&(n.animations=u),c.length>0&&(n.nodes=c)}return n.object=r,n;function a(e){const t=[];for(const n in e){const 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.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,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.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const n=e.children[t];this.add(n.clone())}return this}}mi.DefaultUp=new pr(0,1,0),mi.DefaultMatrixAutoUpdate=!0,mi.prototype.isObject3D=!0;const gi=new pr,vi=new pr,yi=new pr,xi=new pr,bi=new pr,wi=new pr,_i=new pr,Mi=new pr,Si=new pr,Ai=new pr;class Ei{constructor(e=new pr,t=new pr,n=new pr){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),gi.subVectors(e,t),r.cross(gi);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){gi.subVectors(r,t),vi.subVectors(n,t),yi.subVectors(e,t);const a=gi.dot(gi),o=gi.dot(vi),s=gi.dot(yi),l=vi.dot(vi),u=vi.dot(yi),c=a*l-o*o;if(0===c)return i.set(-2,-1,-1);const d=1/c,h=(l*s-o*u)*d,p=(a*u-o*s)*d;return i.set(1-h-p,p,h)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,xi),xi.x>=0&&xi.y>=0&&xi.x+xi.y<=1}static getUV(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,xi),s.set(0,0),s.addScaledVector(i,xi.x),s.addScaledVector(a,xi.y),s.addScaledVector(o,xi.z),s}static isFrontFacing(e,t,n,r){return gi.subVectors(n,t),vi.subVectors(e,t),gi.cross(vi).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 gi.subVectors(this.c,this.b),vi.subVectors(this.a,this.b),.5*gi.cross(vi).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ei.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ei.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,i){return Ei.getUV(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return Ei.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ei.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,i=this.c;let a,o;bi.subVectors(r,n),wi.subVectors(i,n),Mi.subVectors(e,n);const s=bi.dot(Mi),l=wi.dot(Mi);if(s<=0&&l<=0)return t.copy(n);Si.subVectors(e,r);const u=bi.dot(Si),c=wi.dot(Si);if(u>=0&&c<=u)return t.copy(r);const d=s*c-u*l;if(d<=0&&s>=0&&u<=0)return a=s/(s-u),t.copy(n).addScaledVector(bi,a);Ai.subVectors(e,i);const h=bi.dot(Ai),p=wi.dot(Ai);if(p>=0&&h<=p)return t.copy(i);const f=h*l-s*p;if(f<=0&&l>=0&&p<=0)return o=l/(l-p),t.copy(n).addScaledVector(wi,o);const m=u*p-h*c;if(m<=0&&c-u>=0&&h-p>=0)return _i.subVectors(i,r),o=(c-u)/(c-u+(h-p)),t.copy(r).addScaledVector(_i,o);const g=1/(m+f+d);return a=f*g,o=d*g,t.copy(n).addScaledVector(bi,a).addScaledVector(wi,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let Ci=0;class Ti extends Mn{constructor(){super(),Object.defineProperty(this,"id",{value:Ci++}),this.uuid=Tn(),this.name="",this.type="Material",this.fog=!0,this.blending=C,this.side=w,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=G,this.blendDst=z,this.blendEquation=P,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Y,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=cn,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Kt,this.stencilZFail=Kt,this.stencilZPass=Kt,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.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}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if("shading"===t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===S;continue}const r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(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.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,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==C&&(n.blending=this.blending),this.side!==w&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.fog=e.fog,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.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new 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.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,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){!0===e&&this.version++}}Ti.prototype.isMaterial=!0,Ti.fromType=function(){return null};class Bi extends Ti{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new Zn(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.combine=ne,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",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.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}}Bi.prototype.isMeshBasicMaterial=!0;const Ri=new pr,Li=new kn;class Pi{constructor(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=dn,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}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}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}copyColorsArray(e){const t=this.array;let n=0;for(let r=0,i=e.length;r<i;r++){let i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),i=new Zn),t[n++]=i.r,t[n++]=i.g,t[n++]=i.b}return this}copyVector2sArray(e){const t=this.array;let n=0;for(let r=0,i=e.length;r<i;r++){let i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),i=new kn),t[n++]=i.x,t[n++]=i.y}return this}copyVector3sArray(e){const t=this.array;let n=0;for(let r=0,i=e.length;r<i;r++){let i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),i=new pr),t[n++]=i.x,t[n++]=i.y,t[n++]=i.z}return this}copyVector4sArray(e){const t=this.array;let n=0;for(let r=0,i=e.length;r<i;r++){let i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),i=new ar),t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n++]=i.w}return this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)Li.fromBufferAttribute(this,t),Li.applyMatrix3(e),this.setXY(t,Li.x,Li.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)Ri.fromBufferAttribute(this,t),Ri.applyMatrix3(e),this.setXYZ(t,Ri.x,Ri.y,Ri.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Ri.fromBufferAttribute(this,t),Ri.applyMatrix4(e),this.setXYZ(t,Ri.x,Ri.y,Ri.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Ri.fromBufferAttribute(this,t),Ri.applyNormalMatrix(e),this.setXYZ(t,Ri.x,Ri.y,Ri.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Ri.fromBufferAttribute(this,t),Ri.transformDirection(e),this.setXYZ(t,Ri.x,Ri.y,Ri.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,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.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(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==dn&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}}Pi.prototype.isBufferAttribute=!0;class Di extends Pi{constructor(e,t,n){super(new Int8Array(e),t,n)}}class Ii extends Pi{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class Fi extends Pi{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class ki extends Pi{constructor(e,t,n){super(new Int16Array(e),t,n)}}class Ni extends Pi{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Oi extends Pi{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Hi extends Pi{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Ui extends Pi{constructor(e,t,n){super(new Uint16Array(e),t,n)}}Ui.prototype.isFloat16BufferAttribute=!0;class Gi extends Pi{constructor(e,t,n){super(new Float32Array(e),t,n)}}class zi extends Pi{constructor(e,t,n){super(new Float64Array(e),t,n)}}let Wi=0;const Vi=new Vr,ji=new mi,Ji=new pr,qi=new gr,Xi=new gr,Ki=new pr;class Qi extends Mn{constructor(){super(),Object.defineProperty(this,"id",{value:Wi++}),this.uuid=Tn(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(On(e)?Hi:Ni)(e,1):this.index=e,this}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 void 0!==this.attributes[e]}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){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new Nn).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return Vi.makeRotationFromQuaternion(e),this.applyMatrix4(Vi),this}rotateX(e){return Vi.makeRotationX(e),this.applyMatrix4(Vi),this}rotateY(e){return Vi.makeRotationY(e),this.applyMatrix4(Vi),this}rotateZ(e){return Vi.makeRotationZ(e),this.applyMatrix4(Vi),this}translate(e,t,n){return Vi.makeTranslation(e,t,n),this.applyMatrix4(Vi),this}scale(e,t,n){return Vi.makeScale(e,t,n),this.applyMatrix4(Vi),this}lookAt(e){return ji.lookAt(e),ji.updateMatrix(),this.applyMatrix4(ji.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ji).negate(),this.translate(Ji.x,Ji.y,Ji.z),this}setFromPoints(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new Gi(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new gr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new pr(-1/0,-1/0,-1/0),new pr(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];qi.setFromBufferAttribute(n),this.morphTargetsRelative?(Ki.addVectors(this.boundingBox.min,qi.min),this.boundingBox.expandByPoint(Ki),Ki.addVectors(this.boundingBox.max,qi.max),this.boundingBox.expandByPoint(Ki)):(this.boundingBox.expandByPoint(qi.min),this.boundingBox.expandByPoint(qi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Fr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new pr,1/0);if(e){const n=this.boundingSphere.center;if(qi.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];Xi.setFromBufferAttribute(n),this.morphTargetsRelative?(Ki.addVectors(qi.min,Xi.min),qi.expandByPoint(Ki),Ki.addVectors(qi.max,Xi.max),qi.expandByPoint(Ki)):(qi.expandByPoint(Xi.min),qi.expandByPoint(Xi.max))}qi.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)Ki.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(Ki));if(t)for(let i=0,a=t.length;i<a;i++){const a=t[i],o=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)Ki.fromBufferAttribute(a,t),o&&(Ji.fromBufferAttribute(e,t),Ki.add(Ji)),r=Math.max(r,n.distanceToSquared(Ki))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.array,r=t.position.array,i=t.normal.array,a=t.uv.array,o=r.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Pi(new Float32Array(4*o),4));const s=this.getAttribute("tangent").array,l=[],u=[];for(let e=0;e<o;e++)l[e]=new pr,u[e]=new pr;const c=new pr,d=new pr,h=new pr,p=new kn,f=new kn,m=new kn,g=new pr,v=new pr;function y(e,t,n){c.fromArray(r,3*e),d.fromArray(r,3*t),h.fromArray(r,3*n),p.fromArray(a,2*e),f.fromArray(a,2*t),m.fromArray(a,2*n),d.sub(c),h.sub(c),f.sub(p),m.sub(p);const i=1/(f.x*m.y-m.x*f.y);isFinite(i)&&(g.copy(d).multiplyScalar(m.y).addScaledVector(h,-f.y).multiplyScalar(i),v.copy(h).multiplyScalar(f.x).addScaledVector(d,-m.x).multiplyScalar(i),l[e].add(g),l[t].add(g),l[n].add(g),u[e].add(v),u[t].add(v),u[n].add(v))}let x=this.groups;0===x.length&&(x=[{start:0,count:n.length}]);for(let e=0,t=x.length;e<t;++e){const t=x[e],r=t.start;for(let e=r,i=r+t.count;e<i;e+=3)y(n[e+0],n[e+1],n[e+2])}const b=new pr,w=new pr,_=new pr,M=new pr;function S(e){_.fromArray(i,3*e),M.copy(_);const t=l[e];b.copy(t),b.sub(_.multiplyScalar(_.dot(t))).normalize(),w.crossVectors(M,t);const n=w.dot(u[e])<0?-1:1;s[4*e]=b.x,s[4*e+1]=b.y,s[4*e+2]=b.z,s[4*e+3]=n}for(let e=0,t=x.length;e<t;++e){const t=x[e],r=t.start;for(let e=r,i=r+t.count;e<i;e+=3)S(n[e+0]),S(n[e+1]),S(n[e+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new Pi(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);const r=new pr,i=new pr,a=new pr,o=new pr,s=new pr,l=new pr,u=new pr,c=new pr;if(e)for(let d=0,h=e.count;d<h;d+=3){const h=e.getX(d+0),p=e.getX(d+1),f=e.getX(d+2);r.fromBufferAttribute(t,h),i.fromBufferAttribute(t,p),a.fromBufferAttribute(t,f),u.subVectors(a,i),c.subVectors(r,i),u.cross(c),o.fromBufferAttribute(n,h),s.fromBufferAttribute(n,p),l.fromBufferAttribute(n,f),o.add(u),s.add(u),l.add(u),n.setXYZ(h,o.x,o.y,o.z),n.setXYZ(p,s.x,s.y,s.z),n.setXYZ(f,l.x,l.y,l.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),u.subVectors(a,i),c.subVectors(r,i),u.cross(c),n.setXYZ(e+0,u.x,u.y,u.z),n.setXYZ(e+1,u.x,u.y,u.z),n.setXYZ(e+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(e,t){if(!e||!e.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const r in n){if(void 0===e.attributes[r])continue;const i=n[r].array,a=e.attributes[r],o=a.array,s=a.itemSize*t,l=Math.min(o.length,i.length-s);for(let e=0,t=s;e<l;e++,t++)i[t]=o[e]}return this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Ki.fromBufferAttribute(e,t),Ki.normalize(),e.setXYZ(t,Ki.x,Ki.y,Ki.z)}toNonIndexed(){function e(e,t){const n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r);let o=0,s=0;for(let i=0,l=t.length;i<l;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 Pi(a,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Qi,n=this.index.array,r=this.attributes;for(const i in r){const a=e(r[i],n);t.setAttribute(i,a)}const i=this.morphAttributes;for(const r in i){const a=[],o=i[r];for(let t=0,r=o.length;t<r;t++){const r=e(o[t],n);a.push(r)}t.morphAttributes[r]=a}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let e=0,n=a.length;e<n;e++){const n=a[e];t.addGroup(n.start,n.count,n.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const r=n[t];e.data.attributes[t]=r.toJSON(e.data)}const r={};let i=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t<r;t++){const 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);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const e in r){const n=r[e];this.setAttribute(e,n.clone(t))}const i=e.morphAttributes;for(const e in i){const 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;const a=e.groups;for(let e=0,t=a.length;e<t;e++){const t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}const o=e.boundingBox;null!==o&&(this.boundingBox=o.clone());const s=e.boundingSphere;return null!==s&&(this.boundingSphere=s.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,void 0!==e.parameters&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}Qi.prototype.isBufferGeometry=!0;const Yi=new Vr,Zi=new Wr,$i=new Fr,ea=new pr,ta=new pr,na=new pr,ra=new pr,ia=new pr,aa=new pr,oa=new pr,sa=new pr,la=new pr,ua=new kn,ca=new kn,da=new kn,ha=new pr,pa=new pr;class fa extends mi{constructor(e=new Qi,t=new Bi){super(),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t<n;t++){const n=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0===r)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),$i.copy(n.boundingSphere),$i.applyMatrix4(i),!1===e.ray.intersectsSphere($i))return;if(Yi.copy(i).invert(),Zi.copy(e.ray).applyMatrix4(Yi),null!==n.boundingBox&&!1===Zi.intersectsBox(n.boundingBox))return;let a;if(n.isBufferGeometry){const i=n.index,o=n.attributes.position,s=n.morphAttributes.position,l=n.morphTargetsRelative,u=n.attributes.uv,c=n.attributes.uv2,d=n.groups,h=n.drawRange;if(null!==i)if(Array.isArray(r))for(let n=0,p=d.length;n<p;n++){const p=d[n],f=r[p.materialIndex];for(let n=Math.max(p.start,h.start),r=Math.min(i.count,Math.min(p.start+p.count,h.start+h.count));n<r;n+=3){const r=i.getX(n),d=i.getX(n+1),h=i.getX(n+2);a=ma(this,f,e,Zi,o,s,l,u,c,r,d,h),a&&(a.faceIndex=Math.floor(n/3),a.face.materialIndex=p.materialIndex,t.push(a))}}else{for(let n=Math.max(0,h.start),d=Math.min(i.count,h.start+h.count);n<d;n+=3){const d=i.getX(n),h=i.getX(n+1),p=i.getX(n+2);a=ma(this,r,e,Zi,o,s,l,u,c,d,h,p),a&&(a.faceIndex=Math.floor(n/3),t.push(a))}}else if(void 0!==o)if(Array.isArray(r))for(let n=0,i=d.length;n<i;n++){const i=d[n],p=r[i.materialIndex];for(let n=Math.max(i.start,h.start),r=Math.min(o.count,Math.min(i.start+i.count,h.start+h.count));n<r;n+=3){a=ma(this,p,e,Zi,o,s,l,u,c,n,n+1,n+2),a&&(a.faceIndex=Math.floor(n/3),a.face.materialIndex=i.materialIndex,t.push(a))}}else{for(let n=Math.max(0,h.start),i=Math.min(o.count,h.start+h.count);n<i;n+=3){a=ma(this,r,e,Zi,o,s,l,u,c,n,n+1,n+2),a&&(a.faceIndex=Math.floor(n/3),t.push(a))}}}else n.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function ma(e,t,n,r,i,a,o,s,l,u,c,d){ea.fromBufferAttribute(i,u),ta.fromBufferAttribute(i,c),na.fromBufferAttribute(i,d);const h=e.morphTargetInfluences;if(a&&h){oa.set(0,0,0),sa.set(0,0,0),la.set(0,0,0);for(let e=0,t=a.length;e<t;e++){const t=h[e],n=a[e];0!==t&&(ra.fromBufferAttribute(n,u),ia.fromBufferAttribute(n,c),aa.fromBufferAttribute(n,d),o?(oa.addScaledVector(ra,t),sa.addScaledVector(ia,t),la.addScaledVector(aa,t)):(oa.addScaledVector(ra.sub(ea),t),sa.addScaledVector(ia.sub(ta),t),la.addScaledVector(aa.sub(na),t)))}ea.add(oa),ta.add(sa),na.add(la)}e.isSkinnedMesh&&(e.boneTransform(u,ea),e.boneTransform(c,ta),e.boneTransform(d,na));const p=function(e,t,n,r,i,a,o,s){let l;if(l=t.side===_?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side!==M,s),null===l)return null;pa.copy(s),pa.applyMatrix4(e.matrixWorld);const u=n.ray.origin.distanceTo(pa);return u<n.near||u>n.far?null:{distance:u,point:pa.clone(),object:e}}(e,t,n,r,ea,ta,na,ha);if(p){s&&(ua.fromBufferAttribute(s,u),ca.fromBufferAttribute(s,c),da.fromBufferAttribute(s,d),p.uv=Ei.getUV(ha,ea,ta,na,ua,ca,da,new kn)),l&&(ua.fromBufferAttribute(l,u),ca.fromBufferAttribute(l,c),da.fromBufferAttribute(l,d),p.uv2=Ei.getUV(ha,ea,ta,na,ua,ca,da,new kn));const e={a:u,b:c,c:d,normal:new pr,materialIndex:0};Ei.getNormal(ea,ta,na,e.normal),p.face=e}return p}fa.prototype.isMesh=!0;class ga extends Qi{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};const o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);const s=[],l=[],u=[],c=[];let d=0,h=0;function p(e,t,n,r,i,a,p,f,m,g,v){const y=a/m,x=p/g,b=a/2,w=p/2,_=f/2,M=m+1,S=g+1;let A=0,E=0;const C=new pr;for(let a=0;a<S;a++){const o=a*x-w;for(let s=0;s<M;s++){const d=s*y-b;C[e]=d*r,C[t]=o*i,C[n]=_,l.push(C.x,C.y,C.z),C[e]=0,C[t]=0,C[n]=f>0?1:-1,u.push(C.x,C.y,C.z),c.push(s/m),c.push(1-a/g),A+=1}}for(let e=0;e<g;e++)for(let t=0;t<m;t++){const n=d+t+M*e,r=d+t+M*(e+1),i=d+(t+1)+M*(e+1),a=d+(t+1)+M*e;s.push(n,r,a),s.push(r,i,a),E+=6}o.addGroup(h,E,v),h+=E,d+=A}p("z","y","x",-1,-1,n,t,e,a,i,0),p("z","y","x",1,-1,n,t,-e,a,i,1),p("x","z","y",1,1,e,n,t,r,a,2),p("x","z","y",1,-1,e,n,-t,r,a,3),p("x","y","z",1,-1,e,t,n,r,i,4),p("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute("position",new Gi(l,3)),this.setAttribute("normal",new Gi(u,3)),this.setAttribute("uv",new Gi(c,2))}static fromJSON(e){return new ga(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function va(e){const t={};for(const n in e){t[n]={};for(const r in e[n]){const i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}}return t}function ya(e){const t={};for(let n=0;n<e.length;n++){const r=va(e[n]);for(const e in r)t[e]=r[e]}return t}const xa={clone:va,merge:ya};class ba extends Ti{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=va(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const n in this.uniforms){const 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;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}ba.prototype.isShaderMaterial=!0;class wa extends mi{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new Vr,this.projectionMatrix=new Vr,this.projectionMatrixInverse=new Vr}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}wa.prototype.isCamera=!0;class _a extends wa{constructor(e=50,t=1,n=.1,r=2e3){super(),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=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Cn*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*En*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Cn*Math.atan(Math.tan(.5*En*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(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(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*En*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const a=this.view;if(null!==this.view&&this.view.enabled){const e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}const o=this.filmOffset;0!==o&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const 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,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}_a.prototype.isPerspectiveCamera=!0;const Ma=90;class Sa extends mi{constructor(e,t,n){if(super(),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const r=new _a(Ma,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new pr(1,0,0)),this.add(r);const i=new _a(Ma,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new pr(-1,0,0)),this.add(i);const a=new _a(Ma,1,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new pr(0,1,0)),this.add(a);const o=new _a(Ma,1,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new pr(0,-1,0)),this.add(o);const s=new _a(Ma,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new pr(0,0,1)),this.add(s);const l=new _a(Ma,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new pr(0,0,-1)),this.add(l)}update(e,t){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[r,i,a,o,s,l]=this.children,u=e.getRenderTarget(),c=e.outputEncoding,d=e.toneMapping,h=e.xr.enabled;e.outputEncoding=Ht,e.toneMapping=ae,e.xr.enabled=!1;const p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,a),e.setRenderTarget(n,3),e.render(t,o),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=p,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(u),e.outputEncoding=c,e.toneMapping=d,e.xr.enabled=h,n.texture.needsPMREMUpdate=!0}}class Aa extends ir{constructor(e,t,n,r,i,a,o,s,l,u){super(e=void 0!==e?e:[],t=void 0!==t?t:he,n,r,i,a,o,s,l,u),this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}Aa.prototype.isCubeTexture=!0;class Ea extends or{constructor(e,t={}){super(e,e,t);const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new Aa(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:Ae}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},r=new ga(5,5,5),i=new ba({name:"CubemapFromEquirect",uniforms:va(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:_,blending:E});i.uniforms.tEquirect.value=t;const a=new fa(r,i),o=t.minFilter;t.minFilter===Te&&(t.minFilter=Ae);return new Sa(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,r){const i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}}Ea.prototype.isWebGLCubeRenderTarget=!0;const Ca=new pr,Ta=new pr,Ba=new Nn;class Ra{constructor(e=new pr(1,0,0),t=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){const r=Ca.subVectors(n,t).cross(Ta.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const n=e.delta(Ca),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(n).multiplyScalar(i).add(e.start)}intersectsLine(e){const 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){const n=t||Ba.getNormalMatrix(e),r=this.coplanarPoint(Ca).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)}}Ra.prototype.isPlane=!0;const La=new Fr,Pa=new pr;class Da{constructor(e=new Ra,t=new Ra,n=new Ra,r=new Ra,i=new Ra,a=new Ra){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){const 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){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],u=n[6],c=n[7],d=n[8],h=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return t[0].setComponents(o-r,c-s,f-d,y-m).normalize(),t[1].setComponents(o+r,c+s,f+d,y+m).normalize(),t[2].setComponents(o+i,c+l,f+h,y+g).normalize(),t[3].setComponents(o-i,c-l,f-h,y-g).normalize(),t[4].setComponents(o-a,c-u,f-p,y-v).normalize(),t[5].setComponents(o+a,c+u,f+p,y+v).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),La.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(La)}intersectsSprite(e){return La.center.set(0,0,0),La.radius=.7071067811865476,La.applyMatrix4(e.matrixWorld),this.intersectsSphere(La)}intersectsSphere(e){const 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){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(Pa.x=r.normal.x>0?e.max.x:e.min.x,Pa.y=r.normal.y>0?e.max.y:e.min.y,Pa.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Pa)<0)return!1}return!0}containsPoint(e){const 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)}}function Ia(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Fa(e,t){const n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=r.get(t);return void((!e||e.version<t.version)&&r.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);const a=r.get(t);void 0===a?r.set(t,function(t,r){const i=t.array,a=t.usage,o=e.createBuffer();let s;if(e.bindBuffer(r,o),e.bufferData(r,i,a),t.onUploadCallback(),i instanceof Float32Array)s=5126;else if(i instanceof Uint16Array)if(t.isFloat16BufferAttribute){if(!n)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");s=5131}else s=5123;else if(i instanceof Int16Array)s=5122;else if(i instanceof Uint32Array)s=5125;else if(i instanceof Int32Array)s=5124;else if(i instanceof Int8Array)s=5120;else if(i instanceof Uint8Array)s=5121;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);s=5121}return{buffer:o,type:s,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version}}(t,i)):a.version<t.version&&(!function(t,r,i){const a=r.array,o=r.updateRange;e.bindBuffer(i,t),-1===o.count?e.bufferSubData(i,0,a):(n?e.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a,o.offset,o.count):e.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a.subarray(o.offset,o.offset+o.count)),o.count=-1)}(a.buffer,t,i),a.version=t.version)}}}class ka extends Qi{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const i=e/2,a=t/2,o=Math.floor(n),s=Math.floor(r),l=o+1,u=s+1,c=e/o,d=t/s,h=[],p=[],f=[],m=[];for(let e=0;e<u;e++){const t=e*d-a;for(let n=0;n<l;n++){const r=n*c-i;p.push(r,-t,0),f.push(0,0,1),m.push(n/o),m.push(1-e/s)}}for(let e=0;e<s;e++)for(let t=0;t<o;t++){const n=t+l*e,r=t+l*(e+1),i=t+1+l*(e+1),a=t+1+l*e;h.push(n,r,a),h.push(r,i,a)}this.setIndex(h),this.setAttribute("position",new Gi(p,3)),this.setAttribute("normal",new Gi(f,3)),this.setAttribute("uv",new Gi(m,2))}static fromJSON(e){return new ka(e.width,e.height,e.widthSegments,e.heightSegments)}}const Na={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ) + 0.5;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}"},Oa={common:{diffuse:{value:new Zn(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Nn},uv2Transform:{value:new Nn},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new kn(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Zn(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Zn(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Nn}},sprite:{diffuse:{value:new Zn(16777215)},opacity:{value:1},center:{value:new kn(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Nn}}},Ha={basic:{uniforms:ya([Oa.common,Oa.specularmap,Oa.envmap,Oa.aomap,Oa.lightmap,Oa.fog]),vertexShader:Na.meshbasic_vert,fragmentShader:Na.meshbasic_frag},lambert:{uniforms:ya([Oa.common,Oa.specularmap,Oa.envmap,Oa.aomap,Oa.lightmap,Oa.emissivemap,Oa.fog,Oa.lights,{emissive:{value:new Zn(0)}}]),vertexShader:Na.meshlambert_vert,fragmentShader:Na.meshlambert_frag},phong:{uniforms:ya([Oa.common,Oa.specularmap,Oa.envmap,Oa.aomap,Oa.lightmap,Oa.emissivemap,Oa.bumpmap,Oa.normalmap,Oa.displacementmap,Oa.fog,Oa.lights,{emissive:{value:new Zn(0)},specular:{value:new Zn(1118481)},shininess:{value:30}}]),vertexShader:Na.meshphong_vert,fragmentShader:Na.meshphong_frag},standard:{uniforms:ya([Oa.common,Oa.envmap,Oa.aomap,Oa.lightmap,Oa.emissivemap,Oa.bumpmap,Oa.normalmap,Oa.displacementmap,Oa.roughnessmap,Oa.metalnessmap,Oa.fog,Oa.lights,{emissive:{value:new Zn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Na.meshphysical_vert,fragmentShader:Na.meshphysical_frag},toon:{uniforms:ya([Oa.common,Oa.aomap,Oa.lightmap,Oa.emissivemap,Oa.bumpmap,Oa.normalmap,Oa.displacementmap,Oa.gradientmap,Oa.fog,Oa.lights,{emissive:{value:new Zn(0)}}]),vertexShader:Na.meshtoon_vert,fragmentShader:Na.meshtoon_frag},matcap:{uniforms:ya([Oa.common,Oa.bumpmap,Oa.normalmap,Oa.displacementmap,Oa.fog,{matcap:{value:null}}]),vertexShader:Na.meshmatcap_vert,fragmentShader:Na.meshmatcap_frag},points:{uniforms:ya([Oa.points,Oa.fog]),vertexShader:Na.points_vert,fragmentShader:Na.points_frag},dashed:{uniforms:ya([Oa.common,Oa.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Na.linedashed_vert,fragmentShader:Na.linedashed_frag},depth:{uniforms:ya([Oa.common,Oa.displacementmap]),vertexShader:Na.depth_vert,fragmentShader:Na.depth_frag},normal:{uniforms:ya([Oa.common,Oa.bumpmap,Oa.normalmap,Oa.displacementmap,{opacity:{value:1}}]),vertexShader:Na.meshnormal_vert,fragmentShader:Na.meshnormal_frag},sprite:{uniforms:ya([Oa.sprite,Oa.fog]),vertexShader:Na.sprite_vert,fragmentShader:Na.sprite_frag},background:{uniforms:{uvTransform:{value:new Nn},t2D:{value:null}},vertexShader:Na.background_vert,fragmentShader:Na.background_frag},cube:{uniforms:ya([Oa.envmap,{opacity:{value:1}}]),vertexShader:Na.cube_vert,fragmentShader:Na.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Na.equirect_vert,fragmentShader:Na.equirect_frag},distanceRGBA:{uniforms:ya([Oa.common,Oa.displacementmap,{referencePosition:{value:new pr},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Na.distanceRGBA_vert,fragmentShader:Na.distanceRGBA_frag},shadow:{uniforms:ya([Oa.lights,Oa.fog,{color:{value:new Zn(0)},opacity:{value:1}}]),vertexShader:Na.shadow_vert,fragmentShader:Na.shadow_frag}};function Ua(e,t,n,r,i,a){const o=new Zn(0);let s,l,u=!0===i?0:1,c=null,d=0,h=null;function p(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,a)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),u=t,p(o,u)},getClearAlpha:function(){return u},setClearAlpha:function(e){u=e,p(o,u)},render:function(n,i){let a=!1,f=!0===i.isScene?i.background:null;f&&f.isTexture&&(f=t.get(f));const m=e.xr,g=m.getSession&&m.getSession();g&&"additive"===g.environmentBlendMode&&(f=null),null===f?p(o,u):f&&f.isColor&&(p(f,1),a=!0),(e.autoClear||a)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),f&&(f.isCubeTexture||f.mapping===ge)?(void 0===l&&(l=new fa(new ga(1,1,1),new ba({name:"BackgroundCubeMaterial",uniforms:va(Ha.cube.uniforms),vertexShader:Ha.cube.vertexShader,fragmentShader:Ha.cube.fragmentShader,side:_,depthTest:!1,depthWrite:!1,fog:!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=f,l.material.uniforms.flipEnvMap.value=f.isCubeTexture&&!1===f.isRenderTargetTexture?-1:1,c===f&&d===f.version&&h===e.toneMapping||(l.material.needsUpdate=!0,c=f,d=f.version,h=e.toneMapping),n.unshift(l,l.geometry,l.material,0,0,null)):f&&f.isTexture&&(void 0===s&&(s=new fa(new ka(2,2),new ba({name:"BackgroundMaterial",uniforms:va(Ha.background.uniforms),vertexShader:Ha.background.vertexShader,fragmentShader:Ha.background.fragmentShader,side:w,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),Object.defineProperty(s.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(s)),s.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),s.material.uniforms.uvTransform.value.copy(f.matrix),c===f&&d===f.version&&h===e.toneMapping||(s.material.needsUpdate=!0,c=f,d=f.version,h=e.toneMapping),n.unshift(s,s.geometry,s.material,0,0,null))}}}function Ga(e,t,n,r){const i=e.getParameter(34921),a=r.isWebGL2?null:t.get("OES_vertex_array_object"),o=r.isWebGL2||null!==a,s={},l=p(null);let u=l,c=!1;function d(t){return r.isWebGL2?e.bindVertexArray(t):a.bindVertexArrayOES(t)}function h(t){return r.isWebGL2?e.deleteVertexArray(t):a.deleteVertexArrayOES(t)}function p(e){const t=[],n=[],r=[];for(let e=0;e<i;e++)t[e]=0,n[e]=0,r[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:n,attributeDivisors:r,object:e,attributes:{},index:null}}function f(){const e=u.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function m(e){g(e,0)}function g(n,i){const a=u.newAttributes,o=u.enabledAttributes,s=u.attributeDivisors;if(a[n]=1,0===o[n]&&(e.enableVertexAttribArray(n),o[n]=1),s[n]!==i){(r.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),s[n]=i}}function v(){const t=u.newAttributes,n=u.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function y(t,n,i,a,o,s){!0!==r.isWebGL2||5124!==i&&5125!==i?e.vertexAttribPointer(t,n,i,a,o,s):e.vertexAttribIPointer(t,n,i,o,s)}function x(){b(),c=!0,u!==l&&(u=l,d(u.object))}function b(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(i,l,h,x,b){let w=!1;if(o){const t=function(t,n,i){const o=!0===i.wireframe;let l=s[t.id];void 0===l&&(l={},s[t.id]=l);let u=l[n.id];void 0===u&&(u={},l[n.id]=u);let c=u[o];void 0===c&&(c=p(r.isWebGL2?e.createVertexArray():a.createVertexArrayOES()),u[o]=c);return c}(x,h,l);u!==t&&(u=t,d(u.object)),w=function(e,t){const n=u.attributes,r=e.attributes;let i=0;for(const e in r){const t=n[e],a=r[e];if(void 0===t)return!0;if(t.attribute!==a)return!0;if(t.data!==a.data)return!0;i++}return u.attributesNum!==i||u.index!==t}(x,b),w&&function(e,t){const n={},r=e.attributes;let i=0;for(const e in r){const t=r[e],a={};a.attribute=t,t.data&&(a.data=t.data),n[e]=a,i++}u.attributes=n,u.attributesNum=i,u.index=t}(x,b)}else{const e=!0===l.wireframe;u.geometry===x.id&&u.program===h.id&&u.wireframe===e||(u.geometry=x.id,u.program=h.id,u.wireframe=e,w=!0)}!0===i.isInstancedMesh&&(w=!0),null!==b&&n.update(b,34963),(w||c)&&(c=!1,function(i,a,o,s){if(!1===r.isWebGL2&&(i.isInstancedMesh||s.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;f();const l=s.attributes,u=o.getAttributes(),c=a.defaultAttributeValues;for(const t in u){const r=u[t];if(r.location>=0){let a=l[t];if(void 0===a&&("instanceMatrix"===t&&i.instanceMatrix&&(a=i.instanceMatrix),"instanceColor"===t&&i.instanceColor&&(a=i.instanceColor)),void 0!==a){const t=a.normalized,o=a.itemSize,l=n.get(a);if(void 0===l)continue;const u=l.buffer,c=l.type,d=l.bytesPerElement;if(a.isInterleavedBufferAttribute){const n=a.data,l=n.stride,h=a.offset;if(n.isInstancedInterleavedBuffer){for(let e=0;e<r.locationSize;e++)g(r.location+e,n.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=n.meshPerAttribute*n.count)}else for(let e=0;e<r.locationSize;e++)m(r.location+e);e.bindBuffer(34962,u);for(let e=0;e<r.locationSize;e++)y(r.location+e,o/r.locationSize,c,t,l*d,(h+o/r.locationSize*e)*d)}else{if(a.isInstancedBufferAttribute){for(let e=0;e<r.locationSize;e++)g(r.location+e,a.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=a.meshPerAttribute*a.count)}else for(let e=0;e<r.locationSize;e++)m(r.location+e);e.bindBuffer(34962,u);for(let e=0;e<r.locationSize;e++)y(r.location+e,o/r.locationSize,c,t,o*d,o/r.locationSize*e*d)}}else if(void 0!==c){const n=c[t];if(void 0!==n)switch(n.length){case 2:e.vertexAttrib2fv(r.location,n);break;case 3:e.vertexAttrib3fv(r.location,n);break;case 4:e.vertexAttrib4fv(r.location,n);break;default:e.vertexAttrib1fv(r.location,n)}}}}v()}(i,l,h,x),null!==b&&e.bindBuffer(34963,n.get(b).buffer))},reset:x,resetDefaultState:b,dispose:function(){x();for(const e in s){const t=s[e];for(const e in t){const n=t[e];for(const e in n)h(n[e].object),delete n[e];delete t[e]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0===s[e.id])return;const t=s[e.id];for(const e in t){const n=t[e];for(const e in n)h(n[e].object),delete n[e];delete t[e]}delete s[e.id]},releaseStatesOfProgram:function(e){for(const t in s){const n=s[t];if(void 0===n[e.id])continue;const r=n[e.id];for(const e in r)h(r[e].object),delete r[e];delete n[e.id]}},initAttributes:f,enableAttribute:m,disableUnusedAttributes:v}}function za(e,t,n,r){const i=r.isWebGL2;let a;this.setMode=function(e){a=e},this.render=function(t,r){e.drawArrays(a,t,r),n.update(r,a,1)},this.renderInstances=function(r,o,s){if(0===s)return;let l,u;if(i)l=e,u="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),u="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[u](a,r,o,s),n.update(o,a,s)}}function Wa(e,t,n){let r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let o=void 0!==n.precision?n.precision:"highp";const s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);const l=a||t.has("WEBGL_draw_buffers"),u=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),d=e.getParameter(35660),h=e.getParameter(3379),p=e.getParameter(34076),f=e.getParameter(34921),m=e.getParameter(36347),g=e.getParameter(36348),v=e.getParameter(36349),y=d>0,x=a||t.has("OES_texture_float");return{isWebGL2:a,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:u,maxTextures:c,maxVertexTextures:d,maxTextureSize:h,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:x,floatVertexTextures:y&&x,maxSamples:a?e.getParameter(36183):0}}function Va(e){const t=this;let n=null,r=0,i=!1,a=!1;const o=new Ra,s=new Nn,l={value:null,needsUpdate:!1};function u(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function c(e,n,r,i){const a=null!==e?e.length:0;let u=null;if(0!==a){if(u=l.value,!0!==i||null===u){const t=r+4*a,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===u||u.length<t)&&(u=new Float32Array(t));for(let t=0,n=r;t!==a;++t,n+=4)o.copy(e[t]).applyMatrix4(i,s),o.normal.toArray(u,n),u[n+3]=o.constant}l.value=u,l.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,u}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,a){const o=0!==e.length||t||0!==r||i;return i=t,n=c(e,a,0),r=e.length,o},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1,u()},this.setState=function(t,o,s){const d=t.clippingPlanes,h=t.clipIntersection,p=t.clipShadows,f=e.get(t);if(!i||null===d||0===d.length||a&&!p)a?c(null):u();else{const e=a?0:r,t=4*e;let i=f.clippingState||null;l.value=i,i=c(d,o,t,s);for(let e=0;e!==t;++e)i[e]=n[e];f.clippingState=i,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=e}}}function ja(e){let t=new WeakMap;function n(e,t){return t===fe?e.mapping=he:t===me&&(e.mapping=pe),e}function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture&&!1===i.isRenderTargetTexture){const a=i.mapping;if(a===fe||a===me){if(t.has(i)){return n(t.get(i).texture,i.mapping)}{const a=i.image;if(a&&a.height>0){const o=new Ea(a.height/2);return o.fromEquirectangularTexture(e,i),t.set(i,o),i.addEventListener("dispose",r),n(o.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}Ha.physical={uniforms:ya([Ha.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new kn(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new Zn(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new kn},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Zn(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Zn(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Na.meshphysical_vert,fragmentShader:Na.meshphysical_frag};class Ja extends wa{constructor(e=-1,t=1,n=1,r=-1,i=.1,a=2e3){super(),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=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,a){null===this.view&&(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(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const 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;let i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){const 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.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const 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,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}Ja.prototype.isOrthographicCamera=!0;const qa=[.125,.215,.35,.446,.526,.582],Xa=20,Ka=new Ja,Qa=new Zn;let Ya=null;const Za=(1+Math.sqrt(5))/2,$a=1/Za,eo=[new pr(1,1,1),new pr(-1,1,1),new pr(1,1,-1),new pr(-1,1,-1),new pr(0,Za,$a),new pr(0,Za,-$a),new pr($a,0,Za),new pr(-$a,0,Za),new pr(Za,$a,0),new pr(-Za,$a,0)];class to{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,r=100){Ya=this._renderer.getRenderTarget(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=ao(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=io(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Ya),e.scissorTest=!1,ro(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===he||e.mapping===pe?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Ya=this._renderer.getRenderTarget();const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize-32,n={magFilter:Ae,minFilter:Ae,generateMipmaps:!1,type:Ne,format:We,encoding:Ht,depthBuffer:!1},r=no(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=no(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],n=[],r=[];let i=e;const a=e-4+1+qa.length;for(let o=0;o<a;o++){const a=Math.pow(2,i);n.push(a);let s=1/a;o>e-4?s=qa[o-e+4-1]:0===o&&(s=0),r.push(s);const l=1/(a-1),u=-l/2,c=1+l/2,d=[u,u,c,u,c,c,u,u,c,c,u,c],h=6,p=6,f=3,m=2,g=1,v=new Float32Array(f*p*h),y=new Float32Array(m*p*h),x=new Float32Array(g*p*h);for(let e=0;e<h;e++){const 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];v.set(r,f*p*e),y.set(d,m*p*e);const i=[e,e,e,e,e,e];x.set(i,g*p*e)}const b=new Qi;b.setAttribute("position",new Pi(v,f)),b.setAttribute("uv",new Pi(y,m)),b.setAttribute("faceIndex",new Pi(x,g)),t.push(b),i>4&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(e,t,n){const r=new Float32Array(Xa),i=new pr(0,1,0);return new ba({name:"SphericalGaussianBlur",defines:{n:Xa,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:oo(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:E,depthTest:!1,depthWrite:!1})}(r,e,t)}return r}_compileMaterial(e){const t=new fa(this._lodPlanes[0],e);this._renderer.compile(t,Ka)}_sceneToCubeUV(e,t,n,r){const i=new _a(90,1,t,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,l=s.autoClear,u=s.toneMapping;s.getClearColor(Qa),s.toneMapping=ae,s.autoClear=!1;const c=new Bi({name:"PMREM.Background",side:_,depthWrite:!1,depthTest:!1}),d=new fa(new ga,c);let h=!1;const p=e.background;p?p.isColor&&(c.color.copy(p),e.background=null,h=!0):(c.color.copy(Qa),h=!0);for(let t=0;t<6;t++){const n=t%3;0===n?(i.up.set(0,a[t],0),i.lookAt(o[t],0,0)):1===n?(i.up.set(0,0,a[t]),i.lookAt(0,o[t],0)):(i.up.set(0,a[t],0),i.lookAt(0,0,o[t]));const l=this._cubeSize;ro(r,n*l,t>2?l:0,l,l),s.setRenderTarget(r),h&&s.render(d,i),s.render(e,i)}d.geometry.dispose(),d.material.dispose(),s.toneMapping=u,s.autoClear=l,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===he||e.mapping===pe;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=ao()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=io());const i=r?this._cubemapMaterial:this._equirectMaterial,a=new fa(this._lodPlanes[0],i);i.uniforms.envMap.value=e;const o=this._cubeSize;ro(t,0,0,3*o,2*o),n.setRenderTarget(t),n.render(a,Ka)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let t=1;t<this._lodPlanes.length;t++){const n=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),r=eo[(t-1)%eo.length];this._blur(e,t-1,t,n,r)}t.autoClear=n}_blur(e,t,n,r,i){const 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){const s=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");const u=new fa(this._lodPlanes[r],l),c=l.uniforms,d=this._sizeLods[n]-1,h=isFinite(i)?Math.PI/(2*d):2*Math.PI/39,p=i/h,f=isFinite(i)?1+Math.floor(3*p):Xa;f>Xa&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let e=0;e<Xa;++e){const t=e/p,n=Math.exp(-t*t/2);m.push(n),0===e?g+=n:e<f&&(g+=2*n)}for(let e=0;e<m.length;e++)m[e]=m[e]/g;c.envMap.value=e.texture,c.samples.value=f,c.weights.value=m,c.latitudinal.value="latitudinal"===a,o&&(c.poleAxis.value=o);const{_lodMax:v}=this;c.dTheta.value=h,c.mipInt.value=v-n;const y=this._sizeLods[r];ro(t,3*y*(r>v-4?r-v+4:0),4*(this._cubeSize-y),3*y,2*y),s.setRenderTarget(t),s.render(u,Ka)}}function no(e,t,n){const r=new or(e,t,n);return r.texture.mapping=ge,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function ro(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function io(){return new ba({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:oo(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:E,depthTest:!1,depthWrite:!1})}function ao(){return new ba({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:oo(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:E,depthTest:!1,depthWrite:!1})}function oo(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function so(e){let t=new WeakMap,n=null;function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const a=i.mapping,o=a===fe||a===me,s=a===he||a===pe;if(o||s){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let r=t.get(i);return null===n&&(n=new to(e)),r=o?n.fromEquirectangular(i,r):n.fromCubemap(i,r),t.set(i,r),r.texture}if(t.has(i))return t.get(i).texture;{const a=i.image;if(o&&a&&a.height>0||s&&a&&function(e){let t=0;const n=6;for(let r=0;r<n;r++)void 0!==e[r]&&t++;return t===n}(a)){null===n&&(n=new to(e));const a=o?n.fromEquirectangular(i):n.fromCubemap(i);return t.set(i,a),i.addEventListener("dispose",r),a.texture}return null}}}return i},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function lo(e){const t={};function n(n){if(void 0!==t[n])return t[n];let r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(e){const t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function uo(e,t,n,r){const i={},a=new WeakMap;function o(e){const s=e.target;null!==s.index&&t.remove(s.index);for(const e in s.attributes)t.remove(s.attributes[e]);s.removeEventListener("dispose",o),delete i[s.id];const l=a.get(s);l&&(t.remove(l),a.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){const n=[],r=e.index,i=e.attributes.position;let o=0;if(null!==r){const e=r.array;o=r.version;for(let t=0,r=e.length;t<r;t+=3){const r=e[t+0],i=e[t+1],a=e[t+2];n.push(r,i,i,a,a,r)}}else{const e=i.array;o=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){const e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}const s=new(On(n)?Hi:Ni)(n,1);s.version=o;const l=a.get(e);l&&t.remove(l),a.set(e,s)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",o),i[t.id]=!0,n.memory.geometries++),t},update:function(e){const n=e.attributes;for(const e in n)t.update(n[e],34962);const r=e.morphAttributes;for(const e in r){const n=r[e];for(let e=0,r=n.length;e<r;e++)t.update(n[e],34962)}},getWireframeAttribute:function(e){const t=a.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&s(e)}else s(e);return a.get(e)}}}function co(e,t,n,r){const i=r.isWebGL2;let a,o,s;this.setMode=function(e){a=e},this.setIndex=function(e){o=e.type,s=e.bytesPerElement},this.render=function(t,r){e.drawElements(a,r,o,t*s),n.update(r,a,1)},this.renderInstances=function(r,l,u){if(0===u)return;let c,d;if(i)c=e,d="drawElementsInstanced";else if(c=t.get("ANGLE_instanced_arrays"),d="drawElementsInstancedANGLE",null===c)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[d](a,l,o,r*s,u),n.update(l,a,u)}}function ho(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,n,r){switch(t.calls++,n){case 4:t.triangles+=r*(e/3);break;case 1:t.lines+=r*(e/2);break;case 3:t.lines+=r*(e-1);break;case 2:t.lines+=r*e;break;case 0:t.points+=r*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function po(e,t){return e[0]-t[0]}function fo(e,t){return Math.abs(t[1])-Math.abs(e[1])}function mo(e,t){let n=1;const r=t.isInterleavedBufferAttribute?t.data.array:t.array;r instanceof Int8Array?n=127:r instanceof Int16Array?n=32767:r instanceof Int32Array?n=2147483647:console.error("THREE.WebGLMorphtargets: Unsupported morph attribute data type: ",r),e.divideScalar(n)}function go(e,t,n){const r={},i=new Float32Array(8),a=new WeakMap,o=new ar,s=[];for(let e=0;e<8;e++)s[e]=[e,0];return{update:function(l,u,c,d){const h=l.morphTargetInfluences;if(!0===t.isWebGL2){const p=u.morphAttributes.position||u.morphAttributes.normal||u.morphAttributes.color,f=void 0!==p?p.length:0;let m=a.get(u);if(void 0===m||m.count!==f){void 0!==m&&m.texture.dispose();const y=void 0!==u.morphAttributes.position,x=void 0!==u.morphAttributes.normal,b=void 0!==u.morphAttributes.color,w=u.morphAttributes.position||[],_=u.morphAttributes.normal||[],M=u.morphAttributes.color||[];let S=0;!0===y&&(S=1),!0===x&&(S=2),!0===b&&(S=3);let A=u.attributes.position.count*S,E=1;A>t.maxTextureSize&&(E=Math.ceil(A/t.maxTextureSize),A=t.maxTextureSize);const C=new Float32Array(A*E*4*f),T=new sr(C,A,E,f);T.type=ke,T.needsUpdate=!0;const B=4*S;for(let L=0;L<f;L++){const P=w[L],D=_[L],I=M[L],F=A*E*4*L;for(let k=0;k<P.count;k++){const N=k*B;!0===y&&(o.fromBufferAttribute(P,k),!0===P.normalized&&mo(o,P),C[F+N+0]=o.x,C[F+N+1]=o.y,C[F+N+2]=o.z,C[F+N+3]=0),!0===x&&(o.fromBufferAttribute(D,k),!0===D.normalized&&mo(o,D),C[F+N+4]=o.x,C[F+N+5]=o.y,C[F+N+6]=o.z,C[F+N+7]=0),!0===b&&(o.fromBufferAttribute(I,k),!0===I.normalized&&mo(o,I),C[F+N+8]=o.x,C[F+N+9]=o.y,C[F+N+10]=o.z,C[F+N+11]=4===I.itemSize?o.w:1)}}function R(){T.dispose(),a.delete(u),u.removeEventListener("dispose",R)}m={count:f,texture:T,size:new kn(A,E)},a.set(u,m),u.addEventListener("dispose",R)}let g=0;for(let O=0;O<h.length;O++)g+=h[O];const v=u.morphTargetsRelative?1:1-g;d.getUniforms().setValue(e,"morphTargetBaseInfluence",v),d.getUniforms().setValue(e,"morphTargetInfluences",h),d.getUniforms().setValue(e,"morphTargetsTexture",m.texture,n),d.getUniforms().setValue(e,"morphTargetsTextureSize",m.size)}else{const H=void 0===h?0:h.length;let U=r[u.id];if(void 0===U||U.length!==H){U=[];for(let j=0;j<H;j++)U[j]=[j,0];r[u.id]=U}for(let J=0;J<H;J++){const q=U[J];q[0]=J,q[1]=h[J]}U.sort(fo);for(let X=0;X<8;X++)X<H&&U[X][1]?(s[X][0]=U[X][0],s[X][1]=U[X][1]):(s[X][0]=Number.MAX_SAFE_INTEGER,s[X][1]=0);s.sort(po);const G=u.morphAttributes.position,z=u.morphAttributes.normal;let W=0;for(let K=0;K<8;K++){const Q=s[K],Y=Q[0],Z=Q[1];Y!==Number.MAX_SAFE_INTEGER&&Z?(G&&u.getAttribute("morphTarget"+K)!==G[Y]&&u.setAttribute("morphTarget"+K,G[Y]),z&&u.getAttribute("morphNormal"+K)!==z[Y]&&u.setAttribute("morphNormal"+K,z[Y]),i[K]=Z,W+=Z):(G&&!0===u.hasAttribute("morphTarget"+K)&&u.deleteAttribute("morphTarget"+K),z&&!0===u.hasAttribute("morphNormal"+K)&&u.deleteAttribute("morphNormal"+K),i[K]=0)}const V=u.morphTargetsRelative?1:1-W;d.getUniforms().setValue(e,"morphTargetBaseInfluence",V),d.getUniforms().setValue(e,"morphTargetInfluences",i)}}}}function vo(e,t,n,r){let i=new WeakMap;function a(e){const t=e.target;t.removeEventListener("dispose",a),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(e){const o=r.render.frame,s=e.geometry,l=t.get(e,s);return i.get(l)!==o&&(t.update(l),i.set(l,o)),e.isInstancedMesh&&(!1===e.hasEventListener("dispose",a)&&e.addEventListener("dispose",a),n.update(e.instanceMatrix,34962),null!==e.instanceColor&&n.update(e.instanceColor,34962)),l},dispose:function(){i=new WeakMap}}}const yo=new ir,xo=new sr,bo=new ur,wo=new Aa,_o=[],Mo=[],So=new Float32Array(16),Ao=new Float32Array(9),Eo=new Float32Array(4);function Co(e,t,n){const r=e[0];if(r<=0||r>0)return e;const i=t*n;let a=_o[i];if(void 0===a&&(a=new Float32Array(i),_o[i]=a),0!==t){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function To(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 Bo(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function Ro(e,t){let n=Mo[t];void 0===n&&(n=new Int32Array(t),Mo[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function Lo(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Po(e,t){const n=this.cache;if(void 0!==t.x)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(To(n,t))return;e.uniform2fv(this.addr,t),Bo(n,t)}}function Do(e,t){const n=this.cache;if(void 0!==t.x)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(void 0!==t.r)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(To(n,t))return;e.uniform3fv(this.addr,t),Bo(n,t)}}function Io(e,t){const n=this.cache;if(void 0!==t.x)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(To(n,t))return;e.uniform4fv(this.addr,t),Bo(n,t)}}function Fo(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(To(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Bo(n,t)}else{if(To(n,r))return;Eo.set(r),e.uniformMatrix2fv(this.addr,!1,Eo),Bo(n,r)}}function ko(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(To(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Bo(n,t)}else{if(To(n,r))return;Ao.set(r),e.uniformMatrix3fv(this.addr,!1,Ao),Bo(n,r)}}function No(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(To(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Bo(n,t)}else{if(To(n,r))return;So.set(r),e.uniformMatrix4fv(this.addr,!1,So),Bo(n,r)}}function Oo(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Ho(e,t){const n=this.cache;To(n,t)||(e.uniform2iv(this.addr,t),Bo(n,t))}function Uo(e,t){const n=this.cache;To(n,t)||(e.uniform3iv(this.addr,t),Bo(n,t))}function Go(e,t){const n=this.cache;To(n,t)||(e.uniform4iv(this.addr,t),Bo(n,t))}function zo(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function Wo(e,t){const n=this.cache;To(n,t)||(e.uniform2uiv(this.addr,t),Bo(n,t))}function Vo(e,t){const n=this.cache;To(n,t)||(e.uniform3uiv(this.addr,t),Bo(n,t))}function jo(e,t){const n=this.cache;To(n,t)||(e.uniform4uiv(this.addr,t),Bo(n,t))}function Jo(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2D(t||yo,i)}function qo(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||bo,i)}function Xo(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||wo,i)}function Ko(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||xo,i)}function Qo(e,t){e.uniform1fv(this.addr,t)}function Yo(e,t){const n=Co(t,this.size,2);e.uniform2fv(this.addr,n)}function Zo(e,t){const n=Co(t,this.size,3);e.uniform3fv(this.addr,n)}function $o(e,t){const n=Co(t,this.size,4);e.uniform4fv(this.addr,n)}function es(e,t){const n=Co(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function ts(e,t){const n=Co(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function ns(e,t){const n=Co(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function rs(e,t){e.uniform1iv(this.addr,t)}function is(e,t){e.uniform2iv(this.addr,t)}function as(e,t){e.uniform3iv(this.addr,t)}function os(e,t){e.uniform4iv(this.addr,t)}function ss(e,t){e.uniform1uiv(this.addr,t)}function ls(e,t){e.uniform2uiv(this.addr,t)}function us(e,t){e.uniform3uiv(this.addr,t)}function cs(e,t){e.uniform4uiv(this.addr,t)}function ds(e,t,n){const r=t.length,i=Ro(n,r);e.uniform1iv(this.addr,i);for(let e=0;e!==r;++e)n.setTexture2D(t[e]||yo,i[e])}function hs(e,t,n){const r=t.length,i=Ro(n,r);e.uniform1iv(this.addr,i);for(let e=0;e!==r;++e)n.setTexture3D(t[e]||bo,i[e])}function ps(e,t,n){const r=t.length,i=Ro(n,r);e.uniform1iv(this.addr,i);for(let e=0;e!==r;++e)n.setTextureCube(t[e]||wo,i[e])}function fs(e,t,n){const r=t.length,i=Ro(n,r);e.uniform1iv(this.addr,i);for(let e=0;e!==r;++e)n.setTexture2DArray(t[e]||xo,i[e])}function ms(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return Lo;case 35664:return Po;case 35665:return Do;case 35666:return Io;case 35674:return Fo;case 35675:return ko;case 35676:return No;case 5124:case 35670:return Oo;case 35667:case 35671:return Ho;case 35668:case 35672:return Uo;case 35669:case 35673:return Go;case 5125:return zo;case 36294:return Wo;case 36295:return Vo;case 36296:return jo;case 35678:case 36198:case 36298:case 36306:case 35682:return Jo;case 35679:case 36299:case 36307:return qo;case 35680:case 36300:case 36308:case 36293:return Xo;case 36289:case 36303:case 36311:case 36292:return Ko}}(t.type)}function gs(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return Qo;case 35664:return Yo;case 35665:return Zo;case 35666:return $o;case 35674:return es;case 35675:return ts;case 35676:return ns;case 5124:case 35670:return rs;case 35667:case 35671:return is;case 35668:case 35672:return as;case 35669:case 35673:return os;case 5125:return ss;case 36294:return ls;case 36295:return us;case 36296:return cs;case 35678:case 36198:case 36298:case 36306:case 35682:return ds;case 35679:case 36299:case 36307:return hs;case 35680:case 36300:case 36308:case 36293:return ps;case 36289:case 36303:case 36311:case 36292:return fs}}(t.type)}function vs(e){this.id=e,this.seq=[],this.map={}}gs.prototype.updateCache=function(e){const t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Bo(t,e)},vs.prototype.setValue=function(e,t,n){const r=this.seq;for(let i=0,a=r.length;i!==a;++i){const a=r[i];a.setValue(e,t[a.id],n)}};const ys=/(\w+)(\])?(\[|\.)?/g;function xs(e,t){e.seq.push(t),e.map[t.id]=t}function bs(e,t,n){const r=e.name,i=r.length;for(ys.lastIndex=0;;){const a=ys.exec(r),o=ys.lastIndex;let s=a[1];const l="]"===a[2],u=a[3];if(l&&(s|=0),void 0===u||"["===u&&o+2===i){xs(n,void 0===u?new ms(s,e,t):new gs(s,e,t));break}{let e=n.map[s];void 0===e&&(e=new vs(s),xs(n,e)),n=e}}}function ws(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,35718);for(let r=0;r<n;++r){const n=e.getActiveUniform(t,r);bs(n,e.getUniformLocation(t,n.name),this)}}function _s(e,t,n){const r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}ws.prototype.setValue=function(e,t,n,r){const i=this.map[t];void 0!==i&&i.setValue(e,n,r)},ws.prototype.setOptional=function(e,t,n){const r=t[n];void 0!==r&&this.setValue(e,n,r)},ws.upload=function(e,t,n,r){for(let i=0,a=t.length;i!==a;++i){const a=t[i],o=n[a.id];!1!==o.needsUpdate&&a.setValue(e,o.value,r)}},ws.seqWithValue=function(e,t){const n=[];for(let r=0,i=e.length;r!==i;++r){const i=e[r];i.id in t&&n.push(i)}return n};let Ms=0;function Ss(e,t,n){const r=e.getShaderParameter(t,35713),i=e.getShaderInfoLog(t).trim();if(r&&""===i)return"";const a=parseInt(/ERROR: 0:(\d+)/.exec(i)[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(e,t){const n=e.split("\n"),r=[],i=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=i;e<a;e++)r.push(e+1+": "+n[e]);return r.join("\n")}(e.getShaderSource(t),a)}function As(e,t){const n=function(e){switch(e){case Ht:return["Linear","( value )"];case Ut:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Es(e,t){let n;switch(t){case oe:n="Linear";break;case se:n="Reinhard";break;case le:n="OptimizedCineon";break;case ue:n="ACESFilmic";break;case ce:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Cs(e){return""!==e}function Ts(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).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/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Bs(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const Rs=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ls(e){return e.replace(Rs,Ps)}function Ps(e,t){const n=Na[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Ls(n)}const Ds=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Is=/#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 Fs(e){return e.replace(Is,Ns).replace(Ds,ks)}function ks(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Ns(e,t,n,r)}function Ns(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 Os(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function Hs(e,t,n,r){const i=e.getContext(),a=n.defines;let o=n.vertexShader,s=n.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===y?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===x?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===b&&(t="SHADOWMAP_TYPE_VSM"),t}(n),u=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case he:case pe:t="ENVMAP_TYPE_CUBE";break;case ge:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),c=function(e){let t="ENVMAP_MODE_REFLECTION";e.envMap&&e.envMapMode===pe&&(t="ENVMAP_MODE_REFRACTION");return t}(n),d=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case ne:t="ENVMAP_BLENDING_MULTIPLY";break;case re:t="ENVMAP_BLENDING_MIX";break;case ie:t="ENVMAP_BLENDING_ADD"}return t}(n),h=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const n=Math.log2(t/32+1)+3,r=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),p=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUVHeight||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Cs).join("\n")}(n),f=function(e){const t=[];for(const n in e){const r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(a),m=i.createProgram();let g,v,w=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=[f].filter(Cs).join("\n"),g.length>0&&(g+="\n"),v=[p,f].filter(Cs).join("\n"),v.length>0&&(v+="\n")):(g=[Os(n),"#define SHADER_NAME "+n.shaderName,f,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define MAX_BONES "+n.maxBones,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 "+c:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Cs).join("\n"),v=[p,Os(n),"#define SHADER_NAME "+n.shaderName,f,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+c:"",n.envMap?"#define "+d:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==ae?"#define TONE_MAPPING":"",n.toneMapping!==ae?Na.tonemapping_pars_fragment:"",n.toneMapping!==ae?Es("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Na.encodings_pars_fragment,As("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Cs).join("\n")),o=Ls(o),o=Ts(o,n),o=Bs(o,n),s=Ls(s),s=Ts(s,n),s=Bs(s,n),o=Fs(o),s=Fs(s),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(w="#version 300 es\n",g=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in",n.glslVersion===wn?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===wn?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+v);const _=w+v+s,M=_s(i,35633,w+g+o),S=_s(i,35632,_);if(i.attachShader(m,M),i.attachShader(m,S),void 0!==n.index0AttributeName?i.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),e.debug.checkShaderErrors){const e=i.getProgramInfoLog(m).trim(),t=i.getShaderInfoLog(M).trim(),n=i.getShaderInfoLog(S).trim();let r=!0,a=!0;if(!1===i.getProgramParameter(m,35714)){r=!1;const t=Ss(i,M,"vertex"),n=Ss(i,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(m,35715)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+n)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):""!==t&&""!==n||(a=!1);a&&(this.diagnostics={runnable:r,programLog:e,vertexShader:{log:t,prefix:g},fragmentShader:{log:n,prefix:v}})}let A,E;return i.deleteShader(M),i.deleteShader(S),this.getUniforms=function(){return void 0===A&&(A=new ws(i,m)),A},this.getAttributes=function(){return void 0===E&&(E=function(e,t){const n={},r=e.getProgramParameter(t,35721);for(let i=0;i<r;i++){const r=e.getActiveAttrib(t,i),a=r.name;let o=1;35674===r.type&&(o=2),35675===r.type&&(o=3),35676===r.type&&(o=4),n[a]={type:r.type,location:e.getAttribLocation(t,a),locationSize:o}}return n}(i,m)),E},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=Ms++,this.cacheKey=t,this.usedTimes=1,this.program=m,this.vertexShader=M,this.fragmentShader=S,this}let Us=0;class Gs{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return!1===a.has(r)&&(a.add(r),r.usedTimes++),!1===a.has(i)&&(a.add(i),i.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const e of t)e.usedTimes--,0===e.usedTimes&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;return!1===t.has(e)&&t.set(e,new Set),t.get(e)}_getShaderStage(e){const t=this.shaderCache;if(!1===t.has(e)){const n=new zs(e);t.set(e,n)}return t.get(e)}}class zs{constructor(e){this.id=Us++,this.code=e,this.usedTimes=0}}function Ws(e,t,n,r,i,a,o){const s=new ti,l=new Gs,u=[],c=i.isWebGL2,d=i.logarithmicDepthBuffer,h=i.floatVertexTextures,p=i.maxVertexUniforms,f=i.vertexTextures;let m=i.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};return{getParameters:function(a,s,u,v,y){const x=v.fog,b=y.geometry,w=a.isMeshStandardMaterial?v.environment:null,S=(a.isMeshStandardMaterial?n:t).get(a.envMap||w),A=S&&S.mapping===ge?S.image.height:null,E=g[a.type],T=y.isSkinnedMesh?function(e){const t=e.skeleton.bones;if(h)return 1024;{const e=p,n=Math.floor((e-20)/4),r=Math.min(n,t.length);return r<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+r+"."),0):r}}(y):0;null!==a.precision&&(m=i.getMaxPrecision(a.precision),m!==a.precision&&console.warn("THREE.WebGLProgram.getParameters:",a.precision,"not supported, using",m,"instead."));const B=b.morphAttributes.position||b.morphAttributes.normal||b.morphAttributes.color,R=void 0!==B?B.length:0;let L,P,D,I,F=0;if(void 0!==b.morphAttributes.position&&(F=1),void 0!==b.morphAttributes.normal&&(F=2),void 0!==b.morphAttributes.color&&(F=3),E){const e=Ha[E];L=e.vertexShader,P=e.fragmentShader}else L=a.vertexShader,P=a.fragmentShader,l.update(a),D=l.getVertexShaderID(a),I=l.getFragmentShaderID(a);const k=e.getRenderTarget(),N=a.alphaTest>0,O=a.clearcoat>0;return{isWebGL2:c,shaderID:E,shaderName:a.type,vertexShader:L,fragmentShader:P,defines:a.defines,customVertexShaderID:D,customFragmentShaderID:I,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:m,instancing:!0===y.isInstancedMesh,instancingColor:!0===y.isInstancedMesh&&null!==y.instanceColor,supportsVertexTextures:f,outputEncoding:null===k?e.outputEncoding:!0===k.isXRRenderTarget?k.texture.encoding:Ht,map:!!a.map,matcap:!!a.matcap,envMap:!!S,envMapMode:S&&S.mapping,envMapCubeUVHeight:A,lightMap:!!a.lightMap,aoMap:!!a.aoMap,emissiveMap:!!a.emissiveMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,objectSpaceNormalMap:a.normalMapType===Vt,tangentSpaceNormalMap:a.normalMapType===Wt,decodeVideoTexture:!!a.map&&!0===a.map.isVideoTexture&&a.map.encoding===Ut,clearcoat:O,clearcoatMap:O&&!!a.clearcoatMap,clearcoatRoughnessMap:O&&!!a.clearcoatRoughnessMap,clearcoatNormalMap:O&&!!a.clearcoatNormalMap,displacementMap:!!a.displacementMap,roughnessMap:!!a.roughnessMap,metalnessMap:!!a.metalnessMap,specularMap:!!a.specularMap,specularIntensityMap:!!a.specularIntensityMap,specularColorMap:!!a.specularColorMap,opaque:!1===a.transparent&&a.blending===C,alphaMap:!!a.alphaMap,alphaTest:N,gradientMap:!!a.gradientMap,sheen:a.sheen>0,sheenColorMap:!!a.sheenColorMap,sheenRoughnessMap:!!a.sheenRoughnessMap,transmission:a.transmission>0,transmissionMap:!!a.transmissionMap,thicknessMap:!!a.thicknessMap,combine:a.combine,vertexTangents:!!a.normalMap&&!!b.attributes.tangent,vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!b.attributes.color&&4===b.attributes.color.itemSize,vertexUvs:!!(a.map||a.bumpMap||a.normalMap||a.specularMap||a.alphaMap||a.emissiveMap||a.roughnessMap||a.metalnessMap||a.clearcoatMap||a.clearcoatRoughnessMap||a.clearcoatNormalMap||a.displacementMap||a.transmissionMap||a.thicknessMap||a.specularIntensityMap||a.specularColorMap||a.sheenColorMap||a.sheenRoughnessMap),uvsVertexOnly:!(a.map||a.bumpMap||a.normalMap||a.specularMap||a.alphaMap||a.emissiveMap||a.roughnessMap||a.metalnessMap||a.clearcoatNormalMap||a.transmission>0||a.transmissionMap||a.thicknessMap||a.specularIntensityMap||a.specularColorMap||a.sheen>0||a.sheenColorMap||a.sheenRoughnessMap||!a.displacementMap),fog:!!x,useFog:a.fog,fogExp2:x&&x.isFogExp2,flatShading:!!a.flatShading,sizeAttenuation:a.sizeAttenuation,logarithmicDepthBuffer:d,skinning:!0===y.isSkinnedMesh&&T>0,maxBones:T,useVertexTexture:h,morphTargets:void 0!==b.morphAttributes.position,morphNormals:void 0!==b.morphAttributes.normal,morphColors:void 0!==b.morphAttributes.color,morphTargetsCount:R,morphTextureStride:F,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.length>0,shadowMapType:e.shadowMap.type,toneMapping:a.toneMapped?e.toneMapping:ae,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===M,flipSided:a.side===_,depthPacking:void 0!==a.depthPacking&&a.depthPacking,index0AttributeName:a.index0AttributeName,extensionDerivatives:a.extensions&&a.extensions.derivatives,extensionFragDepth:a.extensions&&a.extensions.fragDepth,extensionDrawBuffers:a.extensions&&a.extensions.drawBuffers,extensionShaderTextureLOD:a.extensions&&a.extensions.shaderTextureLOD,rendererExtensionFragDepth:c||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:c||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:c||r.has("EXT_shader_texture_lod"),customProgramCacheKey:a.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function(e,t){e.push(t.precision),e.push(t.outputEncoding),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.combine),e.push(t.vertexUvs),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.maxBones),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection)}(n,t),function(e,t){s.disableAll(),t.isWebGL2&&s.enable(0);t.supportsVertexTextures&&s.enable(1);t.instancing&&s.enable(2);t.instancingColor&&s.enable(3);t.map&&s.enable(4);t.matcap&&s.enable(5);t.envMap&&s.enable(6);t.lightMap&&s.enable(7);t.aoMap&&s.enable(8);t.emissiveMap&&s.enable(9);t.bumpMap&&s.enable(10);t.normalMap&&s.enable(11);t.objectSpaceNormalMap&&s.enable(12);t.tangentSpaceNormalMap&&s.enable(13);t.clearcoat&&s.enable(14);t.clearcoatMap&&s.enable(15);t.clearcoatRoughnessMap&&s.enable(16);t.clearcoatNormalMap&&s.enable(17);t.displacementMap&&s.enable(18);t.specularMap&&s.enable(19);t.roughnessMap&&s.enable(20);t.metalnessMap&&s.enable(21);t.gradientMap&&s.enable(22);t.alphaMap&&s.enable(23);t.alphaTest&&s.enable(24);t.vertexColors&&s.enable(25);t.vertexAlphas&&s.enable(26);t.vertexUvs&&s.enable(27);t.vertexTangents&&s.enable(28);t.uvsVertexOnly&&s.enable(29);t.fog&&s.enable(30);e.push(s.mask),s.disableAll(),t.useFog&&s.enable(0);t.flatShading&&s.enable(1);t.logarithmicDepthBuffer&&s.enable(2);t.skinning&&s.enable(3);t.useVertexTexture&&s.enable(4);t.morphTargets&&s.enable(5);t.morphNormals&&s.enable(6);t.morphColors&&s.enable(7);t.premultipliedAlpha&&s.enable(8);t.shadowMapEnabled&&s.enable(9);t.physicallyCorrectLights&&s.enable(10);t.doubleSided&&s.enable(11);t.flipSided&&s.enable(12);t.depthPacking&&s.enable(13);t.dithering&&s.enable(14);t.specularIntensityMap&&s.enable(15);t.specularColorMap&&s.enable(16);t.transmission&&s.enable(17);t.transmissionMap&&s.enable(18);t.thicknessMap&&s.enable(19);t.sheen&&s.enable(20);t.sheenColorMap&&s.enable(21);t.sheenRoughnessMap&&s.enable(22);t.decodeVideoTexture&&s.enable(23);t.opaque&&s.enable(24);e.push(s.mask)}(n,t),n.push(e.outputEncoding)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=g[e.type];let n;if(t){const e=Ha[t];n=xa.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let r;for(let e=0,t=u.length;e<t;e++){const t=u[e];if(t.cacheKey===n){r=t,++r.usedTimes;break}}return void 0===r&&(r=new Hs(e,n,t,a),u.push(r)),r},releaseProgram:function(e){if(0==--e.usedTimes){const t=u.indexOf(e);u[t]=u[u.length-1],u.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:u,dispose:function(){l.dispose()}}}function Vs(){let e=new WeakMap;return{get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function js(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Js(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function qs(){const e=[];let t=0;const n=[],r=[],i=[];function a(n,r,i,a,o,s){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:r,material:i,groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=o,l.group=s),t++,l}return{opaque:n,transmissive:r,transparent:i,init:function(){t=0,n.length=0,r.length=0,i.length=0},push:function(e,t,o,s,l,u){const c=a(e,t,o,s,l,u);o.transmission>0?r.push(c):!0===o.transparent?i.push(c):n.push(c)},unshift:function(e,t,o,s,l,u){const c=a(e,t,o,s,l,u);o.transmission>0?r.unshift(c):!0===o.transparent?i.unshift(c):n.unshift(c)},finish:function(){for(let n=t,r=e.length;n<r;n++){const t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){n.length>1&&n.sort(e||js),r.length>1&&r.sort(t||Js),i.length>1&&i.sort(t||Js)}}}function Xs(){let e=new WeakMap;return{get:function(t,n){let r;return!1===e.has(t)?(r=new qs,e.set(t,[r])):n>=e.get(t).length?(r=new qs,e.get(t).push(r)):r=e.get(t)[n],r},dispose:function(){e=new WeakMap}}}function Ks(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new pr,color:new Zn};break;case"SpotLight":n={position:new pr,direction:new pr,color:new Zn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new pr,color:new Zn,distance:0,decay:0};break;case"HemisphereLight":n={direction:new pr,skyColor:new Zn,groundColor:new Zn};break;case"RectAreaLight":n={color:new Zn,position:new pr,halfWidth:new pr,halfHeight:new pr}}return e[t.id]=n,n}}}let Qs=0;function Ys(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Zs(e,t){const n=new Ks,r=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new kn};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new kn,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)i.probe.push(new pr);const a=new pr,o=new Vr,s=new Vr;return{setup:function(a,o){let s=0,l=0,u=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let c=0,d=0,h=0,p=0,f=0,m=0,g=0,v=0;a.sort(Ys);const y=!0!==o?Math.PI:1;for(let e=0,t=a.length;e<t;e++){const t=a[e],o=t.color,x=t.intensity,b=t.distance,w=t.shadow&&t.shadow.map?t.shadow.map.texture:null;if(t.isAmbientLight)s+=o.r*x*y,l+=o.g*x*y,u+=o.b*x*y;else if(t.isLightProbe)for(let e=0;e<9;e++)i.probe[e].addScaledVector(t.sh.coefficients[e],x);else if(t.isDirectionalLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*y),t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,i.directionalShadow[c]=n,i.directionalShadowMap[c]=w,i.directionalShadowMatrix[c]=t.shadow.matrix,m++}i.directional[c]=e,c++}else if(t.isSpotLight){const e=n.get(t);if(e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(o).multiplyScalar(x*y),e.distance=b,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,i.spotShadow[h]=n,i.spotShadowMap[h]=w,i.spotShadowMatrix[h]=t.shadow.matrix,v++}i.spot[h]=e,h++}else if(t.isRectAreaLight){const e=n.get(t);e.color.copy(o).multiplyScalar(x),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),i.rectArea[p]=e,p++}else if(t.isPointLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*y),e.distance=t.distance,e.decay=t.decay,t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,n.shadowCameraNear=e.camera.near,n.shadowCameraFar=e.camera.far,i.pointShadow[d]=n,i.pointShadowMap[d]=w,i.pointShadowMatrix[d]=t.shadow.matrix,g++}i.point[d]=e,d++}else if(t.isHemisphereLight){const e=n.get(t);e.skyColor.copy(t.color).multiplyScalar(x*y),e.groundColor.copy(t.groundColor).multiplyScalar(x*y),i.hemi[f]=e,f++}}p>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=Oa.LTC_FLOAT_1,i.rectAreaLTC2=Oa.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=Oa.LTC_HALF_1,i.rectAreaLTC2=Oa.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=s,i.ambient[1]=l,i.ambient[2]=u;const x=i.hash;x.directionalLength===c&&x.pointLength===d&&x.spotLength===h&&x.rectAreaLength===p&&x.hemiLength===f&&x.numDirectionalShadows===m&&x.numPointShadows===g&&x.numSpotShadows===v||(i.directional.length=c,i.spot.length=h,i.rectArea.length=p,i.point.length=d,i.hemi.length=f,i.directionalShadow.length=m,i.directionalShadowMap.length=m,i.pointShadow.length=g,i.pointShadowMap.length=g,i.spotShadow.length=v,i.spotShadowMap.length=v,i.directionalShadowMatrix.length=m,i.pointShadowMatrix.length=g,i.spotShadowMatrix.length=v,x.directionalLength=c,x.pointLength=d,x.spotLength=h,x.rectAreaLength=p,x.hemiLength=f,x.numDirectionalShadows=m,x.numPointShadows=g,x.numSpotShadows=v,i.version=Qs++)},setupView:function(e,t){let n=0,r=0,l=0,u=0,c=0;const d=t.matrixWorldInverse;for(let t=0,h=e.length;t<h;t++){const h=e[t];if(h.isDirectionalLight){const e=i.directional[n];e.direction.setFromMatrixPosition(h.matrixWorld),a.setFromMatrixPosition(h.target.matrixWorld),e.direction.sub(a),e.direction.transformDirection(d),n++}else if(h.isSpotLight){const e=i.spot[l];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(d),e.direction.setFromMatrixPosition(h.matrixWorld),a.setFromMatrixPosition(h.target.matrixWorld),e.direction.sub(a),e.direction.transformDirection(d),l++}else if(h.isRectAreaLight){const e=i.rectArea[u];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(d),s.identity(),o.copy(h.matrixWorld),o.premultiply(d),s.extractRotation(o),e.halfWidth.set(.5*h.width,0,0),e.halfHeight.set(0,.5*h.height,0),e.halfWidth.applyMatrix4(s),e.halfHeight.applyMatrix4(s),u++}else if(h.isPointLight){const e=i.point[r];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(d),r++}else if(h.isHemisphereLight){const e=i.hemi[c];e.direction.setFromMatrixPosition(h.matrixWorld),e.direction.transformDirection(d),e.direction.normalize(),c++}}},state:i}}function $s(e,t){const n=new Zs(e,t),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(e){n.setup(r,e)},setupLightsView:function(e){n.setupView(r,e)},pushLight:function(e){r.push(e)},pushShadow:function(e){i.push(e)}}}function el(e,t){let n=new WeakMap;return{get:function(r,i=0){let a;return!1===n.has(r)?(a=new $s(e,t),n.set(r,[a])):i>=n.get(r).length?(a=new $s(e,t),n.get(r).push(a)):a=n.get(r)[i],a},dispose:function(){n=new WeakMap}}}class tl extends Ti{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=Gt,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!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}}tl.prototype.isMeshDepthMaterial=!0;class nl extends Ti{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new pr,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}nl.prototype.isMeshDistanceMaterial=!0;function rl(e,t,n){let r=new Da;const i=new kn,a=new kn,o=new ar,s=new tl({depthPacking:zt}),l=new nl,u={},c=n.maxTextureSize,d={0:_,1:w,2:M},h=new ba({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new kn},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),p=h.clone();p.defines.HORIZONTAL_PASS=1;const f=new Qi;f.setAttribute("position",new Pi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new fa(f,h),g=this;function v(n,r){const i=t.update(m);h.defines.VSM_SAMPLES!==n.blurSamples&&(h.defines.VSM_SAMPLES=n.blurSamples,p.defines.VSM_SAMPLES=n.blurSamples,h.needsUpdate=!0,p.needsUpdate=!0),h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,h,m,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,i,p,m,null)}function x(t,n,r,i,a,o){let c=null;const h=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(c=void 0!==h?h:!0===r.isPointLight?l:s,e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0){const e=c.uuid,t=n.uuid;let r=u[e];void 0===r&&(r={},u[e]=r);let i=r[t];void 0===i&&(i=c.clone(),r[t]=i),c=i}return c.visible=n.visible,c.wireframe=n.wireframe,c.side=o===b?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:d[n.side],c.alphaMap=n.alphaMap,c.alphaTest=n.alphaTest,c.clipShadows=n.clipShadows,c.clippingPlanes=n.clippingPlanes,c.clipIntersection=n.clipIntersection,c.displacementMap=n.displacementMap,c.displacementScale=n.displacementScale,c.displacementBias=n.displacementBias,c.wireframeLinewidth=n.wireframeLinewidth,c.linewidth=n.linewidth,!0===r.isPointLight&&!0===c.isMeshDistanceMaterial&&(c.referencePosition.setFromMatrixPosition(r.matrixWorld),c.nearDistance=i,c.farDistance=a),c}function S(n,i,a,o,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===b)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);const r=t.update(n),i=n.material;if(Array.isArray(i)){const t=r.groups;for(let l=0,u=t.length;l<u;l++){const u=t[l],c=i[u.materialIndex];if(c&&c.visible){const t=x(n,c,o,a.near,a.far,s);e.renderBufferDirect(a,null,r,t,n,u)}}}else if(i.visible){const t=x(n,i,o,a.near,a.far,s);e.renderBufferDirect(a,null,r,t,n,null)}}const l=n.children;for(let e=0,t=l.length;e<t;e++)S(l[e],i,a,o,s)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=y,this.render=function(t,n,s){if(!1===g.enabled)return;if(!1===g.autoUpdate&&!1===g.needsUpdate)return;if(0===t.length)return;const l=e.getRenderTarget(),u=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),h=e.state;h.setBlending(E),h.buffers.color.setClear(1,1,1,1),h.buffers.depth.setTest(!0),h.setScissorTest(!1);for(let l=0,u=t.length;l<u;l++){const u=t[l],d=u.shadow;if(void 0===d){console.warn("THREE.WebGLShadowMap:",u,"has no shadow.");continue}if(!1===d.autoUpdate&&!1===d.needsUpdate)continue;i.copy(d.mapSize);const p=d.getFrameExtents();if(i.multiply(p),a.copy(d.mapSize),(i.x>c||i.y>c)&&(i.x>c&&(a.x=Math.floor(c/p.x),i.x=a.x*p.x,d.mapSize.x=a.x),i.y>c&&(a.y=Math.floor(c/p.y),i.y=a.y*p.y,d.mapSize.y=a.y)),null!==d.map||d.isPointLightShadow||this.type!==b||(d.map=new or(i.x,i.y),d.map.texture.name=u.name+".shadowMap",d.mapPass=new or(i.x,i.y),d.camera.updateProjectionMatrix()),null===d.map){const e={minFilter:be,magFilter:be,format:We};d.map=new or(i.x,i.y,e),d.map.texture.name=u.name+".shadowMap",d.camera.updateProjectionMatrix()}e.setRenderTarget(d.map),e.clear();const f=d.getViewportCount();for(let e=0;e<f;e++){const t=d.getViewport(e);o.set(a.x*t.x,a.y*t.y,a.x*t.z,a.y*t.w),h.viewport(o),d.updateMatrices(u,e),r=d.getFrustum(),S(n,s,d.camera,u,this.type)}d.isPointLightShadow||this.type!==b||v(d,s),d.needsUpdate=!1}g.needsUpdate=!1,e.setRenderTarget(l,u,d)}}function il(e,t,n){const r=n.isWebGL2;const i=new function(){let t=!1;const n=new ar;let r=null;const i=new ar(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){!0===s&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),!1===i.equals(n)&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},a=new function(){let t=!1,n=null,r=null,i=null;return{setTest:function(e){e?xe(2929):be(2929)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case X:e.depthFunc(512);break;case K:e.depthFunc(519);break;case Q:e.depthFunc(513);break;case Y:e.depthFunc(515);break;case Z:e.depthFunc(514);break;case $:e.depthFunc(518);break;case ee:e.depthFunc(516);break;case te:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},o=new function(){let t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,u=null;return{setTest:function(e){t||(e?xe(2960):be(2960))},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&&l===r||(e.stencilOp(t,n,r),o=t,s=n,l=r)},setLocked:function(e){t=e},setClear:function(t){u!==t&&(e.clearStencil(t),u=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,u=null}}};let s={},l={},u=new WeakMap,c=[],d=null,h=!1,g=null,v=null,y=null,x=null,b=null,w=null,S=null,A=!1,ne=null,re=null,ie=null,ae=null,oe=null;const se=e.getParameter(35661);let le=!1,ue=0;const ce=e.getParameter(7938);-1!==ce.indexOf("WebGL")?(ue=parseFloat(/^WebGL (\d)/.exec(ce)[1]),le=ue>=1):-1!==ce.indexOf("OpenGL ES")&&(ue=parseFloat(/^OpenGL ES (\d)/.exec(ce)[1]),le=ue>=2);let de=null,he={};const pe=e.getParameter(3088),fe=e.getParameter(2978),me=(new ar).fromArray(pe),ge=(new ar).fromArray(fe);function ve(t,n,r){const i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;t<r;t++)e.texImage2D(n+t,0,6408,1,1,0,6408,5121,i);return a}const ye={};function xe(t){!0!==s[t]&&(e.enable(t),s[t]=!0)}function be(t){!1!==s[t]&&(e.disable(t),s[t]=!1)}ye[3553]=ve(3553,3553,1),ye[34067]=ve(34067,34069,6),i.setClear(0,0,0,1),a.setClear(1),o.setClear(0),xe(2929),a.setFunc(Y),Se(!1),Ae(f),xe(2884),Me(E);const we={[P]:32774,[D]:32778,[I]:32779};if(r)we[F]=32775,we[k]=32776;else{const e=t.get("EXT_blend_minmax");null!==e&&(we[F]=e.MIN_EXT,we[k]=e.MAX_EXT)}const _e={[N]:0,[O]:1,[H]:768,[G]:770,[q]:776,[j]:774,[W]:772,[U]:769,[z]:771,[J]:775,[V]:773};function Me(t,n,r,i,a,o,s,l){if(t!==E){if(!1===h&&(xe(3042),h=!0),t===L)a=a||n,o=o||r,s=s||i,n===v&&a===b||(e.blendEquationSeparate(we[n],we[a]),v=n,b=a),r===y&&i===x&&o===w&&s===S||(e.blendFuncSeparate(_e[r],_e[i],_e[o],_e[s]),y=r,x=i,w=o,S=s),g=t,A=null;else if(t!==g||l!==A){if(v===P&&b===P||(e.blendEquation(32774),v=P,b=P),l)switch(t){case C:e.blendFuncSeparate(1,771,1,771);break;case T:e.blendFunc(1,1);break;case B:e.blendFuncSeparate(0,769,0,1);break;case R:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case C:e.blendFuncSeparate(770,771,1,771);break;case T:e.blendFunc(770,1);break;case B:e.blendFuncSeparate(0,769,0,1);break;case R:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}y=null,x=null,w=null,S=null,g=t,A=l}}else!0===h&&(be(3042),h=!1)}function Se(t){ne!==t&&(t?e.frontFace(2304):e.frontFace(2305),ne=t)}function Ae(t){t!==p?(xe(2884),t!==re&&(t===f?e.cullFace(1029):t===m?e.cullFace(1028):e.cullFace(1032))):be(2884),re=t}function Ee(t,n,r){t?(xe(32823),ae===n&&oe===r||(e.polygonOffset(n,r),ae=n,oe=r)):be(32823)}function Ce(t){void 0===t&&(t=33984+se-1),de!==t&&(e.activeTexture(t),de=t)}return{buffers:{color:i,depth:a,stencil:o},enable:xe,disable:be,bindFramebuffer:function(t,n){return l[t]!==n&&(e.bindFramebuffer(t,n),l[t]=n,r&&(36009===t&&(l[36160]=n),36160===t&&(l[36009]=n)),!0)},drawBuffers:function(r,i){let a=c,o=!1;if(r)if(a=u.get(i),void 0===a&&(a=[],u.set(i,a)),r.isWebGLMultipleRenderTargets){const e=r.texture;if(a.length!==e.length||36064!==a[0]){for(let t=0,n=e.length;t<n;t++)a[t]=36064+t;a.length=e.length,o=!0}}else 36064!==a[0]&&(a[0]=36064,o=!0);else 1029!==a[0]&&(a[0]=1029,o=!0);o&&(n.isWebGL2?e.drawBuffers(a):t.get("WEBGL_draw_buffers").drawBuffersWEBGL(a))},useProgram:function(t){return d!==t&&(e.useProgram(t),d=t,!0)},setBlending:Me,setMaterial:function(e,t){e.side===M?be(2884):xe(2884);let n=e.side===_;t&&(n=!n),Se(n),e.blending===C&&!1===e.transparent?Me(E):Me(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),a.setFunc(e.depthFunc),a.setTest(e.depthTest),a.setMask(e.depthWrite),i.setMask(e.colorWrite);const r=e.stencilWrite;o.setTest(r),r&&(o.setMask(e.stencilWriteMask),o.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),o.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),Ee(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?xe(32926):be(32926)},setFlipSided:Se,setCullFace:Ae,setLineWidth:function(t){t!==ie&&(le&&e.lineWidth(t),ie=t)},setPolygonOffset:Ee,setScissorTest:function(e){e?xe(3089):be(3089)},activeTexture:Ce,bindTexture:function(t,n){null===de&&Ce();let r=he[de];void 0===r&&(r={type:void 0,texture:void 0},he[de]=r),r.type===t&&r.texture===n||(e.bindTexture(t,n||ye[t]),r.type=t,r.texture=n)},unbindTexture:function(){const t=he[de];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===me.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),me.copy(t))},viewport:function(t){!1===ge.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),ge.copy(t))},reset:function(){e.disable(3042),e.disable(2884),e.disable(2929),e.disable(32823),e.disable(3089),e.disable(2960),e.disable(32926),e.blendEquation(32774),e.blendFunc(1,0),e.blendFuncSeparate(1,0,1,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(513),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(519,0,4294967295),e.stencilOp(7680,7680,7680),e.clearStencil(0),e.cullFace(1029),e.frontFace(2305),e.polygonOffset(0,0),e.activeTexture(33984),e.bindFramebuffer(36160,null),!0===r&&(e.bindFramebuffer(36009,null),e.bindFramebuffer(36008,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),s={},de=null,he={},l={},u=new WeakMap,c=[],d=null,h=!1,g=null,v=null,y=null,x=null,b=null,w=null,S=null,A=!1,ne=null,re=null,ie=null,ae=null,oe=null,me.set(0,0,e.canvas.width,e.canvas.height),ge.set(0,0,e.canvas.width,e.canvas.height),i.reset(),a.reset(),o.reset()}}}function al(e,t,n,r,i,a,o){const s=i.isWebGL2,l=i.maxTextures,u=i.maxCubemapSize,c=i.maxTextureSize,d=i.maxSamples,h=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,p=/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let m;const g=new WeakMap;let v=!1;try{v="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function y(e,t){return v?new OffscreenCanvas(e,t):Gn("canvas")}function x(e,t,n,r){let i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const r=t?In:Math.floor,a=r(i*e.width),o=r(i*e.height);void 0===m&&(m=y(a,o));const s=n?y(a,o):m;s.width=a,s.height=o;return s.getContext("2d").drawImage(e,0,0,a,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+o+")."),s}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function b(e){return Pn(e.width)&&Pn(e.height)}function w(e,t){return e.generateMipmaps&&t&&e.minFilter!==be&&e.minFilter!==Ae}function _(t){e.generateMipmap(t)}function M(n,r,i,a,o=!1){if(!1===s)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=r;return 6403===r&&(5126===i&&(l=33326),5131===i&&(l=33325),5121===i&&(l=33321)),33319===r&&(5126===i&&(l=33328),5131===i&&(l=33327),5121===i&&(l=33323)),6408===r&&(5126===i&&(l=34836),5131===i&&(l=34842),5121===i&&(l=a===Ut&&!1===o?35907:32856),32819===i&&(l=32854),32820===i&&(l=32855)),33325!==l&&33326!==l&&33327!==l&&33328!==l&&34842!==l&&34836!==l||t.get("EXT_color_buffer_float"),l}function S(e,t,n){return!0===w(e,n)||e.isFramebufferTexture&&e.minFilter!==be&&e.minFilter!==Ae?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function A(e){return e===be||e===we||e===Me?9728:9729}function E(e){const t=e.target;t.removeEventListener("dispose",E),function(e){const t=r.get(e);if(void 0===t.__webglInit)return;const n=e.source,i=g.get(n);if(i){const r=i[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&T(e),0===Object.keys(i).length&&g.delete(n)}r.remove(e)}(t),t.isVideoTexture&&f.delete(t)}function C(t){const n=t.target;n.removeEventListener("dispose",C),function(t){const n=t.texture,i=r.get(t),a=r.get(n);void 0!==a.__webglTexture&&(e.deleteTexture(a.__webglTexture),o.memory.textures--);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(i.__webglFramebuffer[t]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[t]);else e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&e.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer&&e.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&e.deleteRenderbuffer(i.__webglDepthRenderbuffer);if(t.isWebGLMultipleRenderTargets)for(let t=0,i=n.length;t<i;t++){const i=r.get(n[t]);i.__webglTexture&&(e.deleteTexture(i.__webglTexture),o.memory.textures--),r.remove(n[t])}r.remove(n),r.remove(t)}(n)}function T(t){const n=r.get(t);e.deleteTexture(n.__webglTexture);const i=t.source;delete g.get(i)[n.__cacheKey],o.memory.textures--}let B=0;function R(e,t){const i=r.get(e);if(e.isVideoTexture&&function(e){const t=o.render.frame;f.get(e)!==t&&(f.set(e,t),e.update())}(e),!1===e.isRenderTargetTexture&&e.version>0&&i.__version!==e.version){const n=e.image;if(null===n)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==n.complete)return void F(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}const L={[ve]:10497,[ye]:33071,[xe]:33648},P={[be]:9728,[we]:9984,[Me]:9986,[Ae]:9729,[Ee]:9985,[Te]:9987};function D(n,a,o){if(o?(e.texParameteri(n,10242,L[a.wrapS]),e.texParameteri(n,10243,L[a.wrapT]),32879!==n&&35866!==n||e.texParameteri(n,32882,L[a.wrapR]),e.texParameteri(n,10240,P[a.magFilter]),e.texParameteri(n,10241,P[a.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),a.wrapS===ye&&a.wrapT===ye||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,10240,A(a.magFilter)),e.texParameteri(n,10241,A(a.minFilter)),a.minFilter!==be&&a.minFilter!==Ae&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===t.has("EXT_texture_filter_anisotropic")){const o=t.get("EXT_texture_filter_anisotropic");if(a.type===ke&&!1===t.has("OES_texture_float_linear"))return;if(!1===s&&a.type===Ne&&!1===t.has("OES_texture_half_float_linear"))return;(a.anisotropy>1||r.get(a).__currentAnisotropy)&&(e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function I(t,n){let r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",E));const i=n.source;let a=g.get(i);void 0===a&&(a={},g.set(i,a));const s=function(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),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.encoding),t.join()}(n);if(s!==t.__cacheKey){void 0===a[s]&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;const i=a[t.__cacheKey];void 0!==i&&(a[t.__cacheKey].usedTimes--,0===i.usedTimes&&T(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function F(t,r,i){let o=3553;r.isDataArrayTexture&&(o=35866),r.isData3DTexture&&(o=32879);const l=I(t,r),u=r.source;if(n.activeTexture(33984+i),n.bindTexture(o,t.__webglTexture),u.version!==u.__currentVersion||!0===l){e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);const i=function(e){return!s&&(e.wrapS!==ye||e.wrapT!==ye||e.minFilter!==be&&e.minFilter!==Ae)}(r)&&!1===b(r.image);let l=x(r.image,i,!1,c);l=G(r,l);const d=b(l)||s,h=a.convert(r.format,r.encoding);let p,f=a.convert(r.type),m=M(r.internalFormat,h,f,r.encoding,r.isVideoTexture);D(o,r,d);const g=r.mipmaps,v=s&&!0!==r.isVideoTexture,y=void 0===t.__version,A=S(r,l,d);if(r.isDepthTexture)m=6402,s?m=r.type===ke?36012:r.type===Fe?33190:r.type===Ue?35056:33189:r.type===ke&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===Je&&6402===m&&r.type!==De&&r.type!==Fe&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=De,f=a.convert(r.type)),r.format===qe&&6402===m&&(m=34041,r.type!==Ue&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=Ue,f=a.convert(r.type))),v&&y?n.texStorage2D(3553,1,m,l.width,l.height):n.texImage2D(3553,0,m,l.width,l.height,0,h,f,null);else if(r.isDataTexture)if(g.length>0&&d){v&&y&&n.texStorage2D(3553,A,m,g[0].width,g[0].height);for(let e=0,t=g.length;e<t;e++)p=g[e],v?n.texSubImage2D(3553,e,0,0,p.width,p.height,h,f,p.data):n.texImage2D(3553,e,m,p.width,p.height,0,h,f,p.data);r.generateMipmaps=!1}else v?(y&&n.texStorage2D(3553,A,m,l.width,l.height),n.texSubImage2D(3553,0,0,0,l.width,l.height,h,f,l.data)):n.texImage2D(3553,0,m,l.width,l.height,0,h,f,l.data);else if(r.isCompressedTexture){v&&y&&n.texStorage2D(3553,A,m,g[0].width,g[0].height);for(let e=0,t=g.length;e<t;e++)p=g[e],r.format!==We?null!==h?v?n.compressedTexSubImage2D(3553,e,0,0,p.width,p.height,h,p.data):n.compressedTexImage2D(3553,e,m,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):v?n.texSubImage2D(3553,e,0,0,p.width,p.height,h,f,p.data):n.texImage2D(3553,e,m,p.width,p.height,0,h,f,p.data)}else if(r.isDataArrayTexture)v?(y&&n.texStorage3D(35866,A,m,l.width,l.height,l.depth),n.texSubImage3D(35866,0,0,0,0,l.width,l.height,l.depth,h,f,l.data)):n.texImage3D(35866,0,m,l.width,l.height,l.depth,0,h,f,l.data);else if(r.isData3DTexture)v?(y&&n.texStorage3D(32879,A,m,l.width,l.height,l.depth),n.texSubImage3D(32879,0,0,0,0,l.width,l.height,l.depth,h,f,l.data)):n.texImage3D(32879,0,m,l.width,l.height,l.depth,0,h,f,l.data);else if(r.isFramebufferTexture)v&&y?n.texStorage2D(3553,A,m,l.width,l.height):n.texImage2D(3553,0,m,l.width,l.height,0,h,f,null);else if(g.length>0&&d){v&&y&&n.texStorage2D(3553,A,m,g[0].width,g[0].height);for(let e=0,t=g.length;e<t;e++)p=g[e],v?n.texSubImage2D(3553,e,0,0,h,f,p):n.texImage2D(3553,e,m,h,f,p);r.generateMipmaps=!1}else v?(y&&n.texStorage2D(3553,A,m,l.width,l.height),n.texSubImage2D(3553,0,0,0,h,f,l)):n.texImage2D(3553,0,m,h,f,l);w(r,d)&&_(o),u.__currentVersion=u.version,r.onUpdate&&r.onUpdate(r)}t.__version=r.version}function k(t,i,o,s,l){const u=a.convert(o.format,o.encoding),c=a.convert(o.type),d=M(o.internalFormat,u,c,o.encoding);r.get(i).__hasExternalTextures||(32879===l||35866===l?n.texImage3D(l,0,d,i.width,i.height,i.depth,0,u,c,null):n.texImage2D(l,0,d,i.width,i.height,0,u,c,null)),n.bindFramebuffer(36160,t),U(i)?h.framebufferTexture2DMultisampleEXT(36160,s,l,r.get(o).__webglTexture,0,H(i)):e.framebufferTexture2D(36160,s,l,r.get(o).__webglTexture,0),n.bindFramebuffer(36160,null)}function N(t,n,r){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){let i=33189;if(r||U(n)){const t=n.depthTexture;t&&t.isDepthTexture&&(t.type===ke?i=36012:t.type===Fe&&(i=33190));const r=H(n);U(n)?h.renderbufferStorageMultisampleEXT(36161,r,i,n.width,n.height):e.renderbufferStorageMultisample(36161,r,i,n.width,n.height)}else e.renderbufferStorage(36161,i,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer){const i=H(n);r&&!1===U(n)?e.renderbufferStorageMultisample(36161,i,35056,n.width,n.height):U(n)?h.renderbufferStorageMultisampleEXT(36161,i,35056,n.width,n.height):e.renderbufferStorage(36161,34041,n.width,n.height),e.framebufferRenderbuffer(36160,33306,36161,t)}else{const t=!0===n.isWebGLMultipleRenderTargets?n.texture[0]:n.texture,i=a.convert(t.format,t.encoding),o=a.convert(t.type),s=M(t.internalFormat,i,o,t.encoding),l=H(n);r&&!1===U(n)?e.renderbufferStorageMultisample(36161,l,s,n.width,n.height):U(n)?h.renderbufferStorageMultisampleEXT(36161,l,s,n.width,n.height):e.renderbufferStorage(36161,s,n.width,n.height)}e.bindRenderbuffer(36161,null)}function O(t){const i=r.get(t),a=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(36160,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__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),R(i.depthTexture,0);const a=r.get(i.depthTexture).__webglTexture,o=H(i);if(i.depthTexture.format===Je)U(i)?h.framebufferTexture2DMultisampleEXT(36160,36096,3553,a,0,o):e.framebufferTexture2D(36160,36096,3553,a,0);else{if(i.depthTexture.format!==qe)throw new Error("Unknown depthTexture format");U(i)?h.framebufferTexture2DMultisampleEXT(36160,33306,3553,a,0,o):e.framebufferTexture2D(36160,33306,3553,a,0)}}(i.__webglFramebuffer,t)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)n.bindFramebuffer(36160,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]=e.createRenderbuffer(),N(i.__webglDepthbuffer[r],t,!1)}else n.bindFramebuffer(36160,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),N(i.__webglDepthbuffer,t,!1);n.bindFramebuffer(36160,null)}function H(e){return Math.min(d,e.samples)}function U(e){const n=r.get(e);return s&&e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function G(e,n){const r=e.encoding,i=e.format,a=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||e.format===_n||r!==Ht&&(r===Ut?!1===s?!0===t.has("EXT_sRGB")&&i===We?(e.format=_n,e.minFilter=Ae,e.generateMipmaps=!1):n=er.sRGBToLinear(n):i===We&&a===Re||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",r)),n}this.allocateTextureUnit=function(){const e=B;return e>=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),B+=1,e},this.resetTextureUnits=function(){B=0},this.setTexture2D=R,this.setTexture2DArray=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?F(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?F(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=function(t,i){const o=r.get(t);t.version>0&&o.__version!==t.version?function(t,r,i){if(6!==r.image.length)return;const o=I(t,r),l=r.source;if(n.activeTexture(33984+i),n.bindTexture(34067,t.__webglTexture),l.version!==l.__currentVersion||!0===o){e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);const i=r.isCompressedTexture||r.image[0].isCompressedTexture,o=r.image[0]&&r.image[0].isDataTexture,c=[];for(let e=0;e<6;e++)c[e]=i||o?o?r.image[e].image:r.image[e]:x(r.image[e],!1,!0,u),c[e]=G(r,c[e]);const d=c[0],h=b(d)||s,p=a.convert(r.format,r.encoding),f=a.convert(r.type),m=M(r.internalFormat,p,f,r.encoding),g=s&&!0!==r.isVideoTexture,v=void 0===t.__version;let y,A=S(r,d,h);if(D(34067,r,h),i){g&&v&&n.texStorage2D(34067,A,m,d.width,d.height);for(let e=0;e<6;e++){y=c[e].mipmaps;for(let t=0;t<y.length;t++){const i=y[t];r.format!==We?null!==p?g?n.compressedTexSubImage2D(34069+e,t,0,0,i.width,i.height,p,i.data):n.compressedTexImage2D(34069+e,t,m,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):g?n.texSubImage2D(34069+e,t,0,0,i.width,i.height,p,f,i.data):n.texImage2D(34069+e,t,m,i.width,i.height,0,p,f,i.data)}}}else{y=r.mipmaps,g&&v&&(y.length>0&&A++,n.texStorage2D(34067,A,m,c[0].width,c[0].height));for(let e=0;e<6;e++)if(o){g?n.texSubImage2D(34069+e,0,0,0,c[e].width,c[e].height,p,f,c[e].data):n.texImage2D(34069+e,0,m,c[e].width,c[e].height,0,p,f,c[e].data);for(let t=0;t<y.length;t++){const r=y[t].image[e].image;g?n.texSubImage2D(34069+e,t+1,0,0,r.width,r.height,p,f,r.data):n.texImage2D(34069+e,t+1,m,r.width,r.height,0,p,f,r.data)}}else{g?n.texSubImage2D(34069+e,0,0,0,p,f,c[e]):n.texImage2D(34069+e,0,m,p,f,c[e]);for(let t=0;t<y.length;t++){const r=y[t];g?n.texSubImage2D(34069+e,t+1,0,0,p,f,r.image[e]):n.texImage2D(34069+e,t+1,m,p,f,r.image[e])}}}w(r,h)&&_(34067),l.__currentVersion=l.version,r.onUpdate&&r.onUpdate(r)}t.__version=r.version}(o,t,i):(n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture))},this.rebindTextures=function(e,t,n){const i=r.get(e);void 0!==t&&k(i.__webglFramebuffer,e,e.texture,36064,3553),void 0!==n&&O(e)},this.setupRenderTarget=function(t){const l=t.texture,u=r.get(t),c=r.get(l);t.addEventListener("dispose",C),!0!==t.isWebGLMultipleRenderTargets&&(void 0===c.__webglTexture&&(c.__webglTexture=e.createTexture()),c.__version=l.version,o.memory.textures++);const d=!0===t.isWebGLCubeRenderTarget,h=!0===t.isWebGLMultipleRenderTargets,p=b(t)||s;if(d){u.__webglFramebuffer=[];for(let t=0;t<6;t++)u.__webglFramebuffer[t]=e.createFramebuffer()}else if(u.__webglFramebuffer=e.createFramebuffer(),h)if(i.drawBuffers){const n=t.texture;for(let t=0,i=n.length;t<i;t++){const i=r.get(n[t]);void 0===i.__webglTexture&&(i.__webglTexture=e.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(s&&t.samples>0&&!1===U(t)){u.__webglMultisampledFramebuffer=e.createFramebuffer(),u.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,u.__webglColorRenderbuffer);const r=a.convert(l.format,l.encoding),i=a.convert(l.type),o=M(l.internalFormat,r,i,l.encoding),s=H(t);e.renderbufferStorageMultisample(36161,s,o,t.width,t.height),n.bindFramebuffer(36160,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,u.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(u.__webglDepthRenderbuffer=e.createRenderbuffer(),N(u.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(36160,null)}if(d){n.bindTexture(34067,c.__webglTexture),D(34067,l,p);for(let e=0;e<6;e++)k(u.__webglFramebuffer[e],t,l,36064,34069+e);w(l,p)&&_(34067),n.unbindTexture()}else if(h){const e=t.texture;for(let i=0,a=e.length;i<a;i++){const a=e[i],o=r.get(a);n.bindTexture(3553,o.__webglTexture),D(3553,a,p),k(u.__webglFramebuffer,t,a,36064+i,3553),w(a,p)&&_(3553)}n.unbindTexture()}else{let e=3553;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(s?e=t.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(e,c.__webglTexture),D(e,l,p),k(u.__webglFramebuffer,t,l,36064,e),w(l,p)&&_(e),n.unbindTexture()}t.depthBuffer&&O(t)},this.updateRenderTargetMipmap=function(e){const t=b(e)||s,i=!0===e.isWebGLMultipleRenderTargets?e.texture:[e.texture];for(let a=0,o=i.length;a<o;a++){const o=i[a];if(w(o,t)){const t=e.isWebGLCubeRenderTarget?34067:3553,i=r.get(o).__webglTexture;n.bindTexture(t,i),_(t),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(s&&t.samples>0&&!1===U(t)){const i=t.width,a=t.height;let o=16384;const s=[36064],l=t.stencilBuffer?33306:36096;t.depthBuffer&&s.push(l);const u=r.get(t),c=void 0!==u.__ignoreDepthValues&&u.__ignoreDepthValues;!1===c&&(t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024)),n.bindFramebuffer(36008,u.__webglMultisampledFramebuffer),n.bindFramebuffer(36009,u.__webglFramebuffer),!0===c&&(e.invalidateFramebuffer(36008,[l]),e.invalidateFramebuffer(36009,[l])),e.blitFramebuffer(0,0,i,a,0,0,i,a,o,9728),p&&e.invalidateFramebuffer(36008,s),n.bindFramebuffer(36008,null),n.bindFramebuffer(36009,u.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=O,this.setupFrameBufferTexture=k,this.useMultisampledRTT=U}function ol(e,t,n){const r=n.isWebGL2;return{convert:function(e,n=null){let i;if(e===Re)return 5121;if(e===Oe)return 32819;if(e===He)return 32820;if(e===Le)return 5120;if(e===Pe)return 5122;if(e===De)return 5123;if(e===Ie)return 5124;if(e===Fe)return 5125;if(e===ke)return 5126;if(e===Ne)return r?5131:(i=t.get("OES_texture_half_float"),null!==i?i.HALF_FLOAT_OES:null);if(e===Ge)return 6406;if(e===We)return 6408;if(e===Ve)return 6409;if(e===je)return 6410;if(e===Je)return 6402;if(e===qe)return 34041;if(e===Xe)return 6403;if(e===ze)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(e===_n)return i=t.get("EXT_sRGB"),null!==i?i.SRGB_ALPHA_EXT:null;if(e===Ke)return 36244;if(e===Qe)return 33319;if(e===Ye)return 33320;if(e===Ze)return 36249;if(e===$e||e===et||e===tt||e===nt)if(n===Ut){if(i=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===i)return null;if(e===$e)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(e===et)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(e===tt)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(e===nt)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(i=t.get("WEBGL_compressed_texture_s3tc"),null===i)return null;if(e===$e)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===et)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===tt)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===nt)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===rt||e===it||e===at||e===ot){if(i=t.get("WEBGL_compressed_texture_pvrtc"),null===i)return null;if(e===rt)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===it)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===at)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===ot)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===st)return i=t.get("WEBGL_compressed_texture_etc1"),null!==i?i.COMPRESSED_RGB_ETC1_WEBGL:null;if(e===lt||e===ut){if(i=t.get("WEBGL_compressed_texture_etc"),null===i)return null;if(e===lt)return n===Ut?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(e===ut)return n===Ut?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}if(e===ct||e===dt||e===ht||e===pt||e===ft||e===mt||e===gt||e===vt||e===yt||e===xt||e===bt||e===wt||e===_t||e===Mt){if(i=t.get("WEBGL_compressed_texture_astc"),null===i)return null;if(e===ct)return n===Ut?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(e===dt)return n===Ut?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(e===ht)return n===Ut?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(e===pt)return n===Ut?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(e===ft)return n===Ut?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(e===mt)return n===Ut?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(e===gt)return n===Ut?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(e===vt)return n===Ut?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(e===yt)return n===Ut?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(e===xt)return n===Ut?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(e===bt)return n===Ut?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(e===wt)return n===Ut?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(e===_t)return n===Ut?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(e===Mt)return n===Ut?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}if(e===St){if(i=t.get("EXT_texture_compression_bptc"),null===i)return null;if(e===St)return n===Ut?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT}return e===Ue?r?34042:(i=t.get("WEBGL_depth_texture"),null!==i?i.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class sl extends _a{constructor(e=[]){super(),this.cameras=e}}sl.prototype.isArrayCamera=!0;class ll extends mi{constructor(){super(),this.type="Group"}}ll.prototype.isGroup=!0;const ul={type:"move"};class cl{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new ll,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new ll,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new pr,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new pr),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new ll,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new pr,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new pr),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,a=null;const o=this._targetRay,s=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(null!==o&&(r=t.getPose(e.targetRaySpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),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(ul))),l&&e.hand){a=!0;for(const r of e.hand.values()){const e=t.getJointPose(r,n);if(void 0===l.joints[r.jointName]){const e=new ll;e.matrixAutoUpdate=!1,e.visible=!1,l.joints[r.jointName]=e,l.add(e)}const i=l.joints[r.jointName];null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.jointRadius=e.radius),i.visible=null!==e}const r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],o=r.position.distanceTo(i.position),s=.02,u=.005;l.inputState.pinching&&o>s+u?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=s-u&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==s&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),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));return null!==o&&(o.visible=null!==r),null!==s&&(s.visible=null!==i),null!==l&&(l.visible=null!==a),this}}class dl extends ir{constructor(e,t,n,r,i,a,o,s,l,u){if((u=void 0!==u?u:Je)!==Je&&u!==qe)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===Je&&(n=De),void 0===n&&u===qe&&(n=Ue),super(null,r,i,a,o,s,u,n,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:be,this.minFilter=void 0!==s?s:be,this.flipY=!1,this.generateMipmaps=!1}}dl.prototype.isDepthTexture=!0;class hl extends Mn{constructor(e,t){super();const n=this;let r=null,i=1,a=null,o="local-floor",s=null,l=null,u=null,c=null,d=null;const h=t.getContextAttributes();let p=null,f=null;const m=[],g=new Map,v=new _a;v.layers.enable(1),v.viewport=new ar;const y=new _a;y.layers.enable(2),y.viewport=new ar;const x=[v,y],b=new sl;b.layers.enable(1),b.layers.enable(2);let w=null,_=null;function M(e){const t=g.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function S(){g.forEach((function(e,t){e.disconnect(t)})),g.clear(),w=null,_=null,e.setRenderTarget(p),c=null,u=null,l=null,r=null,f=null,R.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function A(e){const t=r.inputSources;for(let e=0;e<m.length;e++)g.set(t[e],m[e]);for(let t=0;t<e.removed.length;t++){const n=e.removed[t],r=g.get(n);r&&(r.dispatchEvent({type:"disconnected",data:n}),g.delete(n))}for(let t=0;t<e.added.length;t++){const n=e.added[t],r=g.get(n);r&&r.dispatchEvent({type:"connected",data:n})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=m[e];return void 0===t&&(t=new cl,m[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=m[e];return void 0===t&&(t=new cl,m[e]=t),t.getGripSpace()},this.getHand=function(e){let t=m[e];return void 0===t&&(t=new cl,m[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getBaseLayer=function(){return null!==u?u:c},this.getBinding=function(){return l},this.getFrame=function(){return d},this.getSession=function(){return r},this.setSession=async function(s){if(r=s,null!==r){if(p=e.getRenderTarget(),r.addEventListener("select",M),r.addEventListener("selectstart",M),r.addEventListener("selectend",M),r.addEventListener("squeeze",M),r.addEventListener("squeezestart",M),r.addEventListener("squeezeend",M),r.addEventListener("end",S),r.addEventListener("inputsourceschange",A),!0!==h.xrCompatible&&await t.makeXRCompatible(),void 0===r.renderState.layers||!1===e.capabilities.isWebGL2){const n={antialias:void 0!==r.renderState.layers||h.antialias,alpha:h.alpha,depth:h.depth,stencil:h.stencil,framebufferScaleFactor:i};c=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:c}),f=new or(c.framebufferWidth,c.framebufferHeight,{format:We,type:Re,encoding:e.outputEncoding})}else{let n=null,a=null,o=null;h.depth&&(o=h.stencil?35056:33190,n=h.stencil?qe:Je,a=h.stencil?Ue:De);const s={colorFormat:e.outputEncoding===Ut?35907:32856,depthFormat:o,scaleFactor:i};l=new XRWebGLBinding(r,t),u=l.createProjectionLayer(s),r.updateRenderState({layers:[u]}),f=new or(u.textureWidth,u.textureHeight,{format:We,type:Re,depthTexture:new dl(u.textureWidth,u.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:h.stencil,encoding:e.outputEncoding,samples:h.antialias?4:0});e.properties.get(f).__ignoreDepthValues=u.ignoreDepthValues}f.isXRRenderTarget=!0,this.setFoveation(1),a=await r.requestReferenceSpace(o),R.setContext(r),R.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const E=new pr,C=new pr;function T(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===r)return;b.near=y.near=v.near=e.near,b.far=y.far=v.far=e.far,w===b.near&&_===b.far||(r.updateRenderState({depthNear:b.near,depthFar:b.far}),w=b.near,_=b.far);const t=e.parent,n=b.cameras;T(b,t);for(let e=0;e<n.length;e++)T(n[e],t);b.matrixWorld.decompose(b.position,b.quaternion,b.scale),e.position.copy(b.position),e.quaternion.copy(b.quaternion),e.scale.copy(b.scale),e.matrix.copy(b.matrix),e.matrixWorld.copy(b.matrixWorld);const i=e.children;for(let e=0,t=i.length;e<t;e++)i[e].updateMatrixWorld(!0);2===n.length?function(e,t,n){E.setFromMatrixPosition(t.matrixWorld),C.setFromMatrixPosition(n.matrixWorld);const r=E.distanceTo(C),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),l=(i[9]+1)/i[5],u=(i[9]-1)/i[5],c=(i[8]-1)/i[0],d=(a[8]+1)/a[0],h=o*c,p=o*d,f=r/(-c+d),m=f*-c;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const g=o+f,v=s+f,y=h-m,x=p+(r-m),b=l*s/v*g,w=u*s/v*g;e.projectionMatrix.makePerspective(y,x,b,w,g,v)}(b,v,y):b.projectionMatrix.copy(v.projectionMatrix)},this.getCamera=function(){return b},this.getFoveation=function(){return null!==u?u.fixedFoveation:null!==c?c.fixedFoveation:void 0},this.setFoveation=function(e){null!==u&&(u.fixedFoveation=e),null!==c&&void 0!==c.fixedFoveation&&(c.fixedFoveation=e)};let B=null;const R=new Ia;R.setAnimationLoop((function(t,n){if(s=n.getViewerPose(a),d=n,null!==s){const t=s.views;null!==c&&(e.setRenderTargetFramebuffer(f,c.framebuffer),e.setRenderTarget(f));let n=!1;t.length!==b.cameras.length&&(b.cameras.length=0,n=!0);for(let r=0;r<t.length;r++){const i=t[r];let a=null;if(null!==c)a=c.getViewport(i);else{const t=l.getViewSubImage(u,i);a=t.viewport,0===r&&(e.setRenderTargetTextures(f,t.colorTexture,u.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(f))}const o=x[r];o.matrix.fromArray(i.transform.matrix),o.projectionMatrix.fromArray(i.projectionMatrix),o.viewport.set(a.x,a.y,a.width,a.height),0===r&&b.matrix.copy(o.matrix),!0===n&&b.cameras.push(o)}}const i=r.inputSources;for(let e=0;e<m.length;e++){const t=m[e],r=i[e];t.update(r,n,a)}B&&B(t,n),d=null})),this.setAnimationLoop=function(e){B=e},this.dispose=function(){}}}function pl(e,t){function n(n,r){n.opacity.value=r.opacity,r.color&&n.diffuse.value.copy(r.color),r.emissive&&n.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(n.map.value=r.map),r.alphaMap&&(n.alphaMap.value=r.alphaMap),r.bumpMap&&(n.bumpMap.value=r.bumpMap,n.bumpScale.value=r.bumpScale,r.side===_&&(n.bumpScale.value*=-1)),r.displacementMap&&(n.displacementMap.value=r.displacementMap,n.displacementScale.value=r.displacementScale,n.displacementBias.value=r.displacementBias),r.emissiveMap&&(n.emissiveMap.value=r.emissiveMap),r.normalMap&&(n.normalMap.value=r.normalMap,n.normalScale.value.copy(r.normalScale),r.side===_&&n.normalScale.value.negate()),r.specularMap&&(n.specularMap.value=r.specularMap),r.alphaTest>0&&(n.alphaTest.value=r.alphaTest);const i=t.get(r).envMap;if(i&&(n.envMap.value=i,n.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,n.reflectivity.value=r.reflectivity,n.ior.value=r.ior,n.refractionRatio.value=r.refractionRatio),r.lightMap){n.lightMap.value=r.lightMap;const t=!0!==e.physicallyCorrectLights?Math.PI:1;n.lightMapIntensity.value=r.lightMapIntensity*t}let a,o;r.aoMap&&(n.aoMap.value=r.aoMap,n.aoMapIntensity.value=r.aoMapIntensity),r.map?a=r.map:r.specularMap?a=r.specularMap:r.displacementMap?a=r.displacementMap:r.normalMap?a=r.normalMap:r.bumpMap?a=r.bumpMap:r.roughnessMap?a=r.roughnessMap:r.metalnessMap?a=r.metalnessMap:r.alphaMap?a=r.alphaMap:r.emissiveMap?a=r.emissiveMap:r.clearcoatMap?a=r.clearcoatMap:r.clearcoatNormalMap?a=r.clearcoatNormalMap:r.clearcoatRoughnessMap?a=r.clearcoatRoughnessMap:r.specularIntensityMap?a=r.specularIntensityMap:r.specularColorMap?a=r.specularColorMap:r.transmissionMap?a=r.transmissionMap:r.thicknessMap?a=r.thicknessMap:r.sheenColorMap?a=r.sheenColorMap:r.sheenRoughnessMap&&(a=r.sheenRoughnessMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),n.uvTransform.value.copy(a.matrix)),r.aoMap?o=r.aoMap:r.lightMap&&(o=r.lightMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),n.uv2Transform.value.copy(o.matrix))}return{refreshFogUniforms:function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)},refreshMaterialUniforms:function(e,r,i,a,o){r.isMeshBasicMaterial||r.isMeshLambertMaterial?n(e,r):r.isMeshToonMaterial?(n(e,r),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,r)):r.isMeshPhongMaterial?(n(e,r),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,r)):r.isMeshStandardMaterial?(n(e,r),function(e,n){e.roughness.value=n.roughness,e.metalness.value=n.metalness,n.roughnessMap&&(e.roughnessMap.value=n.roughnessMap);n.metalnessMap&&(e.metalnessMap.value=n.metalnessMap);t.get(n).envMap&&(e.envMapIntensity.value=n.envMapIntensity)}(e,r),r.isMeshPhysicalMaterial&&function(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),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===_&&e.clearcoatNormalScale.value.negate()));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),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor));e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap);t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap)}(e,r,o)):r.isMeshMatcapMaterial?(n(e,r),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,r)):r.isMeshDepthMaterial?n(e,r):r.isMeshDistanceMaterial?(n(e,r),function(e,t){e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,r)):r.isMeshNormalMaterial?n(e,r):r.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,r),r.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,r)):r.isPointsMaterial?function(e,t,n,r){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*r,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);t.alphaTest>0&&(e.alphaTest.value=t.alphaTest);let i;t.map?i=t.map:t.alphaMap&&(i=t.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}(e,r,i,a):r.isSpriteMaterial?function(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);t.alphaMap&&(e.alphaMap.value=t.alphaMap);t.alphaTest>0&&(e.alphaTest.value=t.alphaTest);let n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(e,r):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function fl(e={}){const t=void 0!==e.canvas?e.canvas:function(){const e=Gn("canvas");return e.style.display="block",e}(),n=void 0!==e.context?e.context:null,r=void 0===e.depth||e.depth,i=void 0===e.stencil||e.stencil,a=void 0!==e.antialias&&e.antialias,o=void 0===e.premultipliedAlpha||e.premultipliedAlpha,s=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",u=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat;let d;d=void 0!==e.context?n.getContextAttributes().alpha:void 0!==e.alpha&&e.alpha;let h=null,p=null;const f=[],m=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=Ht,this.physicallyCorrectLights=!1,this.toneMapping=ae,this.toneMappingExposure=1;const g=this;let v=!1,y=0,x=0,b=null,S=-1,A=null;const E=new ar,C=new ar;let T=null,B=t.width,R=t.height,L=1,P=null,D=null;const I=new ar(0,0,B,R),F=new ar(0,0,B,R);let k=!1;const N=new Da;let O=!1,H=!1,U=null;const G=new Vr,z=new kn,W=new pr,V={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function j(){return null===b?L:1}let J,q,X,K,Q,Y,Z,$,ee,te,ne,re,ie,oe,se,le,ue,ce,de,he,pe,fe,me,ge=n;function ve(e,n){for(let r=0;r<e.length;r++){const i=e[r],a=t.getContext(i,n);if(null!==a)return a}return null}try{const e={alpha:!0,depth:r,stencil:i,antialias:a,premultipliedAlpha:o,preserveDrawingBuffer:s,powerPreference:l,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${c}`),t.addEventListener("webglcontextlost",be,!1),t.addEventListener("webglcontextrestored",we,!1),null===ge){const t=["webgl2","webgl","experimental-webgl"];if(!0===g.isWebGL1Renderer&&t.shift(),ge=ve(t,e),null===ge)throw ve(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===ge.getShaderPrecisionFormat&&(ge.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function ye(){J=new lo(ge),q=new Wa(ge,J,e),J.init(q),fe=new ol(ge,J,q),X=new il(ge,J,q),K=new ho(ge),Q=new Vs,Y=new al(ge,J,X,Q,q,fe,K),Z=new ja(g),$=new so(g),ee=new Fa(ge,q),me=new Ga(ge,J,ee,q),te=new uo(ge,ee,K,me),ne=new vo(ge,te,ee,K),de=new go(ge,q,Y),le=new Va(Q),re=new Ws(g,Z,$,J,q,me,le),ie=new pl(g,Q),oe=new Xs,se=new el(J,q),ce=new Ua(g,Z,X,ne,d,o),ue=new rl(g,ne,q),he=new za(ge,J,K,q),pe=new co(ge,J,K,q),K.programs=re.programs,g.capabilities=q,g.extensions=J,g.properties=Q,g.renderLists=oe,g.shadowMap=ue,g.state=X,g.info=K}ye();const xe=new hl(g,ge);function be(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),v=!0}function we(){console.log("THREE.WebGLRenderer: Context Restored."),v=!1;const e=K.autoReset,t=ue.enabled,n=ue.autoUpdate,r=ue.needsUpdate,i=ue.type;ye(),K.autoReset=e,ue.enabled=t,ue.autoUpdate=n,ue.needsUpdate=r,ue.type=i}function _e(e){const t=e.target;t.removeEventListener("dispose",_e),function(e){(function(e){const t=Q.get(e).programs;void 0!==t&&(t.forEach((function(e){re.releaseProgram(e)})),e.isShaderMaterial&&re.releaseShaderCache(e))})(e),Q.remove(e)}(t)}this.xr=xe,this.getContext=function(){return ge},this.getContextAttributes=function(){return ge.getContextAttributes()},this.forceContextLoss=function(){const e=J.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=J.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return L},this.setPixelRatio=function(e){void 0!==e&&(L=e,this.setSize(B,R,!1))},this.getSize=function(e){return e.set(B,R)},this.setSize=function(e,n,r){xe.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(B=e,R=n,t.width=Math.floor(e*L),t.height=Math.floor(n*L),!1!==r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(B*L,R*L).floor()},this.setDrawingBufferSize=function(e,n,r){B=e,R=n,L=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(E)},this.getViewport=function(e){return e.copy(I)},this.setViewport=function(e,t,n,r){e.isVector4?I.set(e.x,e.y,e.z,e.w):I.set(e,t,n,r),X.viewport(E.copy(I).multiplyScalar(L).floor())},this.getScissor=function(e){return e.copy(F)},this.setScissor=function(e,t,n,r){e.isVector4?F.set(e.x,e.y,e.z,e.w):F.set(e,t,n,r),X.scissor(C.copy(F).multiplyScalar(L).floor())},this.getScissorTest=function(){return k},this.setScissorTest=function(e){X.setScissorTest(k=e)},this.setOpaqueSort=function(e){P=e},this.setTransparentSort=function(e){D=e},this.getClearColor=function(e){return e.copy(ce.getClearColor())},this.setClearColor=function(){ce.setClearColor.apply(ce,arguments)},this.getClearAlpha=function(){return ce.getClearAlpha()},this.setClearAlpha=function(){ce.setClearAlpha.apply(ce,arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;e&&(r|=16384),t&&(r|=256),n&&(r|=1024),ge.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.dispose=function(){t.removeEventListener("webglcontextlost",be,!1),t.removeEventListener("webglcontextrestored",we,!1),oe.dispose(),se.dispose(),Q.dispose(),Z.dispose(),$.dispose(),ne.dispose(),me.dispose(),re.dispose(),xe.dispose(),xe.removeEventListener("sessionstart",Se),xe.removeEventListener("sessionend",Ae),U&&(U.dispose(),U=null),Ee.stop()},this.renderBufferDirect=function(e,t,n,r,i,a){null===t&&(t=V);const o=i.isMesh&&i.matrixWorld.determinant()<0,s=function(e,t,n,r,i){!0!==t.isScene&&(t=V);Y.resetTextureUnits();const a=t.fog,o=r.isMeshStandardMaterial?t.environment:null,s=null===b?g.outputEncoding:!0===b.isXRRenderTarget?b.texture.encoding:Ht,l=(r.isMeshStandardMaterial?$:Z).get(r.envMap||o),u=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,c=!!r.normalMap&&!!n.attributes.tangent,d=!!n.morphAttributes.position,h=!!n.morphAttributes.normal,f=!!n.morphAttributes.color,m=r.toneMapped?g.toneMapping:ae,v=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,y=void 0!==v?v.length:0,x=Q.get(r),w=p.state.lights;if(!0===O&&(!0===H||e!==A)){const t=e===A&&r.id===S;le.setState(r,e,t)}let _=!1;r.version===x.__version?x.needsLights&&x.lightsStateVersion!==w.state.version||x.outputEncoding!==s||i.isInstancedMesh&&!1===x.instancing?_=!0:i.isInstancedMesh||!0!==x.instancing?i.isSkinnedMesh&&!1===x.skinning?_=!0:i.isSkinnedMesh||!0!==x.skinning?x.envMap!==l||r.fog&&x.fog!==a?_=!0:void 0===x.numClippingPlanes||x.numClippingPlanes===le.numPlanes&&x.numIntersection===le.numIntersection?(x.vertexAlphas!==u||x.vertexTangents!==c||x.morphTargets!==d||x.morphNormals!==h||x.morphColors!==f||x.toneMapping!==m||!0===q.isWebGL2&&x.morphTargetsCount!==y)&&(_=!0):_=!0:_=!0:_=!0:(_=!0,x.__version=r.version);let M=x.currentProgram;!0===_&&(M=De(r,t,i));let E=!1,C=!1,T=!1;const B=M.getUniforms(),P=x.uniforms;X.useProgram(M.program)&&(E=!0,C=!0,T=!0);r.id!==S&&(S=r.id,C=!0);if(E||A!==e){if(B.setValue(ge,"projectionMatrix",e.projectionMatrix),q.logarithmicDepthBuffer&&B.setValue(ge,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),A!==e&&(A=e,C=!0,T=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshStandardMaterial||r.envMap){const t=B.map.cameraPosition;void 0!==t&&t.setValue(ge,W.setFromMatrixPosition(e.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&B.setValue(ge,"isOrthographic",!0===e.isOrthographicCamera),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.isShadowMaterial||i.isSkinnedMesh)&&B.setValue(ge,"viewMatrix",e.matrixWorldInverse)}if(i.isSkinnedMesh){B.setOptional(ge,i,"bindMatrix"),B.setOptional(ge,i,"bindMatrixInverse");const e=i.skeleton;e&&(q.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),B.setValue(ge,"boneTexture",e.boneTexture,Y),B.setValue(ge,"boneTextureSize",e.boneTextureSize)):B.setOptional(ge,e,"boneMatrices"))}const D=n.morphAttributes;(void 0!==D.position||void 0!==D.normal||void 0!==D.color&&!0===q.isWebGL2)&&de.update(i,n,r,M);(C||x.receiveShadow!==i.receiveShadow)&&(x.receiveShadow=i.receiveShadow,B.setValue(ge,"receiveShadow",i.receiveShadow));C&&(B.setValue(ge,"toneMappingExposure",g.toneMappingExposure),x.needsLights&&(F=T,(I=P).ambientLightColor.needsUpdate=F,I.lightProbe.needsUpdate=F,I.directionalLights.needsUpdate=F,I.directionalLightShadows.needsUpdate=F,I.pointLights.needsUpdate=F,I.pointLightShadows.needsUpdate=F,I.spotLights.needsUpdate=F,I.spotLightShadows.needsUpdate=F,I.rectAreaLights.needsUpdate=F,I.hemisphereLights.needsUpdate=F),a&&r.fog&&ie.refreshFogUniforms(P,a),ie.refreshMaterialUniforms(P,r,L,R,U),ws.upload(ge,x.uniformsList,P,Y));var I,F;r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(ws.upload(ge,x.uniformsList,P,Y),r.uniformsNeedUpdate=!1);r.isSpriteMaterial&&B.setValue(ge,"center",i.center);return B.setValue(ge,"modelViewMatrix",i.modelViewMatrix),B.setValue(ge,"normalMatrix",i.normalMatrix),B.setValue(ge,"modelMatrix",i.matrixWorld),M}(e,t,n,r,i);X.setMaterial(r,o);let l=n.index;const u=n.attributes.position;if(null===l){if(void 0===u||0===u.count)return}else if(0===l.count)return;let c,d=1;!0===r.wireframe&&(l=te.getWireframeAttribute(n),d=2),me.setup(i,r,s,n,l);let h=he;null!==l&&(c=ee.get(l),h=pe,h.setIndex(c));const f=null!==l?l.count:u.count,m=n.drawRange.start*d,v=n.drawRange.count*d,y=null!==a?a.start*d:0,x=null!==a?a.count*d:1/0,w=Math.max(m,y),_=Math.min(f,m+v,y+x)-1,M=Math.max(0,_-w+1);if(0!==M){if(i.isMesh)!0===r.wireframe?(X.setLineWidth(r.wireframeLinewidth*j()),h.setMode(1)):h.setMode(4);else if(i.isLine){let e=r.linewidth;void 0===e&&(e=1),X.setLineWidth(e*j()),i.isLineSegments?h.setMode(1):i.isLineLoop?h.setMode(2):h.setMode(3)}else i.isPoints?h.setMode(0):i.isSprite&&h.setMode(4);if(i.isInstancedMesh)h.renderInstances(w,M,i.count);else if(n.isInstancedBufferGeometry){const e=Math.min(n.instanceCount,n._maxInstanceCount);h.renderInstances(w,M,e)}else h.render(w,M)}},this.compile=function(e,t){p=se.get(e),p.init(),m.push(p),e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(p.pushLight(e),e.castShadow&&p.pushShadow(e))})),p.setupLights(g.physicallyCorrectLights),e.traverse((function(t){const n=t.material;if(n)if(Array.isArray(n))for(let r=0;r<n.length;r++){De(n[r],e,t)}else De(n,e,t)})),m.pop(),p=null};let Me=null;function Se(){Ee.stop()}function Ae(){Ee.start()}const Ee=new Ia;function Ce(e,t,n,r){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)p.pushLight(e),e.castShadow&&p.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||N.intersectsSprite(e)){r&&W.setFromMatrixPosition(e.matrixWorld).applyMatrix4(G);const t=ne.update(e),i=e.material;i.visible&&h.push(e,t,i,n,W.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==K.render.frame&&(e.skeleton.update(),e.skeleton.frame=K.render.frame),!e.frustumCulled||N.intersectsObject(e))){r&&W.setFromMatrixPosition(e.matrixWorld).applyMatrix4(G);const t=ne.update(e),i=e.material;if(Array.isArray(i)){const r=t.groups;for(let a=0,o=r.length;a<o;a++){const o=r[a],s=i[o.materialIndex];s&&s.visible&&h.push(e,t,s,n,W.z,o)}}else i.visible&&h.push(e,t,i,n,W.z,null)}const i=e.children;for(let e=0,a=i.length;e<a;e++)Ce(i[e],t,n,r)}function Be(e,t,n,r){const i=e.opaque,o=e.transmissive,s=e.transparent;p.setupLightsView(n),o.length>0&&function(e,t,n){const r=q.isWebGL2;null===U&&(U=new or(1,1,{generateMipmaps:!0,type:null!==fe.convert(Ne)?Ne:Re,minFilter:Te,samples:r&&!0===a?4:0}));g.getDrawingBufferSize(z),r?U.setSize(z.x,z.y):U.setSize(In(z.x),In(z.y));const i=g.getRenderTarget();g.setRenderTarget(U),g.clear();const o=g.toneMapping;g.toneMapping=ae,Le(e,t,n),g.toneMapping=o,Y.updateMultisampleRenderTarget(U),Y.updateRenderTargetMipmap(U),g.setRenderTarget(i)}(i,t,n),r&&X.viewport(E.copy(r)),i.length>0&&Le(i,t,n),o.length>0&&Le(o,t,n),s.length>0&&Le(s,t,n),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1)}function Le(e,t,n){const r=!0===t.isScene?t.overrideMaterial:null;for(let i=0,a=e.length;i<a;i++){const a=e[i],o=a.object,s=a.geometry,l=null===r?a.material:r,u=a.group;o.layers.test(n.layers)&&Pe(o,t,n,s,l,u)}}function Pe(e,t,n,r,i,a){e.onBeforeRender(g,t,n,r,i,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(g,t,n,r,e,a),!0===i.transparent&&i.side===M?(i.side=_,i.needsUpdate=!0,g.renderBufferDirect(n,t,r,i,e,a),i.side=w,i.needsUpdate=!0,g.renderBufferDirect(n,t,r,i,e,a),i.side=M):g.renderBufferDirect(n,t,r,i,e,a),e.onAfterRender(g,t,n,r,i,a)}function De(e,t,n){!0!==t.isScene&&(t=V);const r=Q.get(e),i=p.state.lights,a=p.state.shadowsArray,o=i.state.version,s=re.getParameters(e,i.state,a,t,n),l=re.getProgramCacheKey(s);let u=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?$:Z).get(e.envMap||r.environment),void 0===u&&(e.addEventListener("dispose",_e),u=new Map,r.programs=u);let c=u.get(l);if(void 0!==c){if(r.currentProgram===c&&r.lightsStateVersion===o)return Ie(e,s),c}else s.uniforms=re.getUniforms(e),e.onBuild(n,s,g),e.onBeforeCompile(s,g),c=re.acquireProgram(s,l),u.set(l,c),r.uniforms=s.uniforms;const d=r.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(d.clippingPlanes=le.uniform),Ie(e,s),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=o,r.needsLights&&(d.ambientLightColor.value=i.state.ambient,d.lightProbe.value=i.state.probe,d.directionalLights.value=i.state.directional,d.directionalLightShadows.value=i.state.directionalShadow,d.spotLights.value=i.state.spot,d.spotLightShadows.value=i.state.spotShadow,d.rectAreaLights.value=i.state.rectArea,d.ltc_1.value=i.state.rectAreaLTC1,d.ltc_2.value=i.state.rectAreaLTC2,d.pointLights.value=i.state.point,d.pointLightShadows.value=i.state.pointShadow,d.hemisphereLights.value=i.state.hemi,d.directionalShadowMap.value=i.state.directionalShadowMap,d.directionalShadowMatrix.value=i.state.directionalShadowMatrix,d.spotShadowMap.value=i.state.spotShadowMap,d.spotShadowMatrix.value=i.state.spotShadowMatrix,d.pointShadowMap.value=i.state.pointShadowMap,d.pointShadowMatrix.value=i.state.pointShadowMatrix);const h=c.getUniforms(),f=ws.seqWithValue(h.seq,d);return r.currentProgram=c,r.uniformsList=f,c}function Ie(e,t){const n=Q.get(e);n.outputEncoding=t.outputEncoding,n.instancing=t.instancing,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}Ee.setAnimationLoop((function(e){Me&&Me(e)})),"undefined"!=typeof self&&Ee.setContext(self),this.setAnimationLoop=function(e){Me=e,xe.setAnimationLoop(e),null===e?Ee.stop():Ee.start()},xe.addEventListener("sessionstart",Se),xe.addEventListener("sessionend",Ae),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===v)return;!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),!0===xe.enabled&&!0===xe.isPresenting&&(!0===xe.cameraAutoUpdate&&xe.updateCamera(t),t=xe.getCamera()),!0===e.isScene&&e.onBeforeRender(g,e,t,b),p=se.get(e,m.length),p.init(),m.push(p),G.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),N.setFromProjectionMatrix(G),H=this.localClippingEnabled,O=le.init(this.clippingPlanes,H,t),h=oe.get(e,f.length),h.init(),f.push(h),Ce(e,t,0,g.sortObjects),h.finish(),!0===g.sortObjects&&h.sort(P,D),!0===O&&le.beginShadows();const n=p.state.shadowsArray;if(ue.render(n,e,t),!0===O&&le.endShadows(),!0===this.info.autoReset&&this.info.reset(),ce.render(h,e),p.setupLights(g.physicallyCorrectLights),t.isArrayCamera){const n=t.cameras;for(let t=0,r=n.length;t<r;t++){const r=n[t];Be(h,e,r,r.viewport)}}else Be(h,e,t);null!==b&&(Y.updateMultisampleRenderTarget(b),Y.updateRenderTargetMipmap(b)),!0===e.isScene&&e.onAfterRender(g,e,t),me.resetDefaultState(),S=-1,A=null,m.pop(),p=m.length>0?m[m.length-1]:null,f.pop(),h=f.length>0?f[f.length-1]:null},this.getActiveCubeFace=function(){return y},this.getActiveMipmapLevel=function(){return x},this.getRenderTarget=function(){return b},this.setRenderTargetTextures=function(e,t,n){Q.get(e.texture).__webglTexture=t,Q.get(e.depthTexture).__webglTexture=n;const r=Q.get(e);r.__hasExternalTextures=!0,r.__hasExternalTextures&&(r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||!0===J.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(e,t){const n=Q.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,n=0){b=e,y=t,x=n;let r=!0;if(e){const t=Q.get(e);void 0!==t.__useDefaultFramebuffer?(X.bindFramebuffer(36160,null),r=!1):void 0===t.__webglFramebuffer?Y.setupRenderTarget(e):t.__hasExternalTextures&&Y.rebindTextures(e,Q.get(e.texture).__webglTexture,Q.get(e.depthTexture).__webglTexture)}let i=null,a=!1,o=!1;if(e){const n=e.texture;(n.isData3DTexture||n.isDataArrayTexture)&&(o=!0);const r=Q.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=r[t],a=!0):i=q.isWebGL2&&e.samples>0&&!1===Y.useMultisampledRTT(e)?Q.get(e).__webglMultisampledFramebuffer:r,E.copy(e.viewport),C.copy(e.scissor),T=e.scissorTest}else E.copy(I).multiplyScalar(L).floor(),C.copy(F).multiplyScalar(L).floor(),T=k;if(X.bindFramebuffer(36160,i)&&q.drawBuffers&&r&&X.drawBuffers(e,i),X.viewport(E),X.scissor(C),X.setScissorTest(T),a){const r=Q.get(e.texture);ge.framebufferTexture2D(36160,36064,34069+t,r.__webglTexture,n)}else if(o){const r=Q.get(e.texture),i=t||0;ge.framebufferTextureLayer(36160,36064,r.__webglTexture,n||0,i)}S=-1},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=Q.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){X.bindFramebuffer(36160,s);try{const o=e.texture,s=o.format,l=o.type;if(s!==We&&fe.convert(s)!==ge.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const u=l===Ne&&(J.has("EXT_color_buffer_half_float")||q.isWebGL2&&J.has("EXT_color_buffer_float"));if(!(l===Re||fe.convert(l)===ge.getParameter(35738)||l===ke&&(q.isWebGL2||J.has("OES_texture_float")||J.has("WEBGL_color_buffer_float"))||u))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&ge.readPixels(t,n,r,i,fe.convert(s),fe.convert(l),a)}finally{const e=null!==b?Q.get(b).__webglFramebuffer:null;X.bindFramebuffer(36160,e)}}},this.copyFramebufferToTexture=function(e,t,n=0){if(!0!==t.isFramebufferTexture)return void console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");const r=Math.pow(2,-n),i=Math.floor(t.image.width*r),a=Math.floor(t.image.height*r);Y.setTexture2D(t,0),ge.copyTexSubImage2D(3553,n,0,0,e.x,e.y,i,a),X.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r=0){const i=t.image.width,a=t.image.height,o=fe.convert(n.format),s=fe.convert(n.type);Y.setTexture2D(n,0),ge.pixelStorei(37440,n.flipY),ge.pixelStorei(37441,n.premultiplyAlpha),ge.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?ge.texSubImage2D(3553,r,e.x,e.y,i,a,o,s,t.image.data):t.isCompressedTexture?ge.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):ge.texSubImage2D(3553,r,e.x,e.y,o,s,t.image),0===r&&n.generateMipmaps&&ge.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,r,i=0){if(g.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const a=e.max.x-e.min.x+1,o=e.max.y-e.min.y+1,s=e.max.z-e.min.z+1,l=fe.convert(r.format),u=fe.convert(r.type);let c;if(r.isData3DTexture)Y.setTexture3D(r,0),c=32879;else{if(!r.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Y.setTexture2DArray(r,0),c=35866}ge.pixelStorei(37440,r.flipY),ge.pixelStorei(37441,r.premultiplyAlpha),ge.pixelStorei(3317,r.unpackAlignment);const d=ge.getParameter(3314),h=ge.getParameter(32878),p=ge.getParameter(3316),f=ge.getParameter(3315),m=ge.getParameter(32877),v=n.isCompressedTexture?n.mipmaps[0]:n.image;ge.pixelStorei(3314,v.width),ge.pixelStorei(32878,v.height),ge.pixelStorei(3316,e.min.x),ge.pixelStorei(3315,e.min.y),ge.pixelStorei(32877,e.min.z),n.isDataTexture||n.isData3DTexture?ge.texSubImage3D(c,i,t.x,t.y,t.z,a,o,s,l,u,v.data):n.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ge.compressedTexSubImage3D(c,i,t.x,t.y,t.z,a,o,s,l,v.data)):ge.texSubImage3D(c,i,t.x,t.y,t.z,a,o,s,l,u,v),ge.pixelStorei(3314,d),ge.pixelStorei(32878,h),ge.pixelStorei(3316,p),ge.pixelStorei(3315,f),ge.pixelStorei(32877,m),0===i&&r.generateMipmaps&&ge.generateMipmap(c),X.unbindTexture()},this.initTexture=function(e){Y.setTexture2D(e,0),X.unbindTexture()},this.resetState=function(){y=0,x=0,b=null,X.reset(),me.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}fl.prototype.isWebGLRenderer=!0;class ml extends fl{}ml.prototype.isWebGL1Renderer=!0;class gl{constructor(e,t=25e-5){this.name="",this.color=new Zn(e),this.density=t}clone(){return new gl(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}gl.prototype.isFogExp2=!0;class vl{constructor(e,t=1,n=1e3){this.name="",this.color=new Zn(e),this.near=t,this.far=n}clone(){return new vl(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}vl.prototype.isFog=!0;class yl extends mi{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}yl.prototype.isScene=!0;class xl{constructor(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=dn,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Tn()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Tn()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Tn()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}xl.prototype.isInterleavedBuffer=!0;const bl=new pr;class wl{constructor(e,t,n,r=!1){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)bl.fromBufferAttribute(this,t),bl.applyMatrix4(e),this.setXYZ(t,bl.x,bl.y,bl.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)bl.fromBufferAttribute(this,t),bl.applyNormalMatrix(e),this.setXYZ(t,bl.x,bl.y,bl.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)bl.fromBufferAttribute(this,t),bl.transformDirection(e),this.setXYZ(t,bl.x,bl.y,bl.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new Pi(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new wl(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}wl.prototype.isInterleavedBufferAttribute=!0;class _l extends Ti{constructor(e){super(),this.type="SpriteMaterial",this.color=new Zn(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}let Ml;_l.prototype.isSpriteMaterial=!0;const Sl=new pr,Al=new pr,El=new pr,Cl=new kn,Tl=new kn,Bl=new Vr,Rl=new pr,Ll=new pr,Pl=new pr,Dl=new kn,Il=new kn,Fl=new kn;class kl extends mi{constructor(e){if(super(),this.type="Sprite",void 0===Ml){Ml=new Qi;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new xl(e,5);Ml.setIndex([0,1,2,0,2,3]),Ml.setAttribute("position",new wl(t,3,0,!1)),Ml.setAttribute("uv",new wl(t,2,3,!1))}this.geometry=Ml,this.material=void 0!==e?e:new _l,this.center=new kn(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Al.setFromMatrixScale(this.matrixWorld),Bl.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),El.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Al.multiplyScalar(-El.z);const n=this.material.rotation;let r,i;0!==n&&(i=Math.cos(n),r=Math.sin(n));const a=this.center;Nl(Rl.set(-.5,-.5,0),El,a,Al,r,i),Nl(Ll.set(.5,-.5,0),El,a,Al,r,i),Nl(Pl.set(.5,.5,0),El,a,Al,r,i),Dl.set(0,0),Il.set(1,0),Fl.set(1,1);let o=e.ray.intersectTriangle(Rl,Ll,Pl,!1,Sl);if(null===o&&(Nl(Ll.set(-.5,.5,0),El,a,Al,r,i),Il.set(0,1),o=e.ray.intersectTriangle(Rl,Pl,Ll,!1,Sl),null===o))return;const s=e.ray.origin.distanceTo(Sl);s<e.near||s>e.far||t.push({distance:s,point:Sl.clone(),uv:Ei.getUV(Sl,Rl,Ll,Pl,Dl,Il,Fl,new kn),face:null,object:this})}copy(e){return super.copy(e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function Nl(e,t,n,r,i,a){Cl.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(Tl.x=a*Cl.x-i*Cl.y,Tl.y=i*Cl.x+a*Cl.y):Tl.copy(Cl),e.copy(t),e.x+=Tl.x,e.y+=Tl.y,e.applyMatrix4(Bl)}kl.prototype.isSprite=!0;const Ol=new pr,Hl=new pr;class Ul extends mi{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let e=0,n=t.length;e<n;e++){const n=t[e];this.addLevel(n.object.clone(),n.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const n=this.levels;let r;for(r=0;r<n.length&&!(t<n[r].distance);r++);return n.splice(r,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,r;for(n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Ol.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(Ol);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Ol.setFromMatrixPosition(e.matrixWorld),Hl.setFromMatrixPosition(this.matrixWorld);const n=Ol.distanceTo(Hl)/e.zoom;let r,i;for(t[0].object.visible=!0,r=1,i=t.length;r<i&&n>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<i;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let e=0,r=n.length;e<r;e++){const r=n[e];t.object.levels.push({object:r.object.uuid,distance:r.distance})}return t}}const Gl=new pr,zl=new ar,Wl=new ar,Vl=new pr,jl=new Vr;class Jl extends fa{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Vr,this.bindMatrixInverse=new Vr}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new ar,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const n=this.skeleton,r=this.geometry;zl.fromBufferAttribute(r.attributes.skinIndex,e),Wl.fromBufferAttribute(r.attributes.skinWeight,e),Gl.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){const r=Wl.getComponent(e);if(0!==r){const i=zl.getComponent(e);jl.multiplyMatrices(n.bones[i].matrixWorld,n.boneInverses[i]),t.addScaledVector(Vl.copy(Gl).applyMatrix4(jl),r)}}return t.applyMatrix4(this.bindMatrixInverse)}}Jl.prototype.isSkinnedMesh=!0;class ql extends mi{constructor(){super(),this.type="Bone"}}ql.prototype.isBone=!0;class Xl extends ir{constructor(e=null,t=1,n=1,r,i,a,o,s,l=be,u=be,c,d){super(null,a,o,s,l,u,r,i,c,d),this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}Xl.prototype.isDataTexture=!0;const Kl=new Vr,Ql=new Vr;class Yl{constructor(e=[],t=[]){this.uuid=Tn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new Vr)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const t=new Vr;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let r=0,i=e.length;r<i;r++){const i=e[r]?e[r].matrixWorld:Ql;Kl.multiplyMatrices(i,t[r]),Kl.toArray(n,16*r)}null!==r&&(r.needsUpdate=!0)}clone(){return new Yl(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=Dn(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new Xl(t,e,e,We,ke);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const n=this.bones[t];if(n.name===e)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){const r=e.bones[n];let i=t[r];void 0===i&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),i=new ql),this.bones.push(i),this.boneInverses.push((new Vr).fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let r=0,i=t.length;r<i;r++){const i=t[r];e.bones.push(i.uuid);const a=n[r];e.boneInverses.push(a.toArray())}return e}}class Zl extends Pi{constructor(e,t,n,r=1){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,n),this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}Zl.prototype.isInstancedBufferAttribute=!0;const $l=new Vr,eu=new Vr,tu=[],nu=new fa;class ru extends fa{constructor(e,t,n){super(e,t),this.instanceMatrix=new Zl(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){const n=this.matrixWorld,r=this.count;if(nu.geometry=this.geometry,nu.material=this.material,void 0!==nu.material)for(let i=0;i<r;i++){this.getMatrixAt(i,$l),eu.multiplyMatrices(n,$l),nu.matrixWorld=eu,nu.raycast(e,tu);for(let e=0,n=tu.length;e<n;e++){const n=tu[e];n.instanceId=i,n.object=this,t.push(n)}tu.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new Zl(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}ru.prototype.isInstancedMesh=!0;class iu extends Ti{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Zn(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}}iu.prototype.isLineBasicMaterial=!0;const au=new pr,ou=new pr,su=new Vr,lu=new Wr,uu=new Fr;class cu extends mi{constructor(e=new Qi,t=new iu){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)au.fromBufferAttribute(t,e-1),ou.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=au.distanceTo(ou);e.setAttribute("lineDistance",new Gi(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),uu.copy(n.boundingSphere),uu.applyMatrix4(r),uu.radius+=i,!1===e.ray.intersectsSphere(uu))return;su.copy(r).invert(),lu.copy(e.ray).applyMatrix4(su);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,l=new pr,u=new pr,c=new pr,d=new pr,h=this.isLineSegments?2:1;if(n.isBufferGeometry){const r=n.index,i=n.attributes.position;if(null!==r){for(let n=Math.max(0,a.start),o=Math.min(r.count,a.start+a.count)-1;n<o;n+=h){const a=r.getX(n),o=r.getX(n+1);l.fromBufferAttribute(i,a),u.fromBufferAttribute(i,o);if(lu.distanceSqToSegment(l,u,d,c)>s)continue;d.applyMatrix4(this.matrixWorld);const h=e.ray.origin.distanceTo(d);h<e.near||h>e.far||t.push({distance:h,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,a.start),r=Math.min(i.count,a.start+a.count)-1;n<r;n+=h){l.fromBufferAttribute(i,n),u.fromBufferAttribute(i,n+1);if(lu.distanceSqToSegment(l,u,d,c)>s)continue;d.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(d);r<e.near||r>e.far||t.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t<n;t++){const n=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}cu.prototype.isLine=!0;const du=new pr,hu=new pr;class pu extends cu{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)du.fromBufferAttribute(t,e),hu.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+du.distanceTo(hu);e.setAttribute("lineDistance",new Gi(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}pu.prototype.isLineSegments=!0;class fu extends cu{constructor(e,t){super(e,t),this.type="LineLoop"}}fu.prototype.isLineLoop=!0;class mu extends Ti{constructor(e){super(),this.type="PointsMaterial",this.color=new Zn(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this}}mu.prototype.isPointsMaterial=!0;const gu=new Vr,vu=new Wr,yu=new Fr,xu=new pr;class bu extends mi{constructor(e=new Qi,t=new mu){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),yu.copy(n.boundingSphere),yu.applyMatrix4(r),yu.radius+=i,!1===e.ray.intersectsSphere(yu))return;gu.copy(r).invert(),vu.copy(e.ray).applyMatrix4(gu);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o;if(n.isBufferGeometry){const i=n.index,o=n.attributes.position;if(null!==i){for(let n=Math.max(0,a.start),l=Math.min(i.count,a.start+a.count);n<l;n++){const a=i.getX(n);xu.fromBufferAttribute(o,a),wu(xu,a,s,r,e,t,this)}}else{for(let n=Math.max(0,a.start),i=Math.min(o.count,a.start+a.count);n<i;n++)xu.fromBufferAttribute(o,n),wu(xu,n,s,r,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t<n;t++){const n=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function wu(e,t,n,r,i,a,o){const s=vu.distanceSqToPoint(e);if(s<n){const n=new pr;vu.closestPointToPoint(e,n),n.applyMatrix4(r);const l=i.ray.origin.distanceTo(n);if(l<i.near||l>i.far)return;a.push({distance:l,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,object:o})}}bu.prototype.isPoints=!0;class _u extends ir{constructor(e,t,n,r,i,a,o,s,l){super(e,t,n,r,i,a,o,s,l),this.minFilter=void 0!==a?a:Ae,this.magFilter=void 0!==i?i:Ae,this.generateMipmaps=!1;const u=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){u.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}_u.prototype.isVideoTexture=!0;class Mu extends ir{constructor(e,t,n){super({width:e,height:t}),this.format=n,this.magFilter=be,this.minFilter=be,this.generateMipmaps=!1,this.needsUpdate=!0}}Mu.prototype.isFramebufferTexture=!0;class Su extends ir{constructor(e,t,n,r,i,a,o,s,l,u,c,d){super(null,a,o,s,l,u,r,i,c,d),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}Su.prototype.isCompressedTexture=!0;class Au extends ir{constructor(e,t,n,r,i,a,o,s,l){super(e,t,n,r,i,a,o,s,l),this.needsUpdate=!0}}Au.prototype.isCanvasTexture=!0;class Eu{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),i=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let r=0;const i=n.length;let a;a=t||e*n[i-1];let o,s=0,l=i-1;for(;s<=l;)if(r=Math.floor(s+(l-s)/2),o=n[r]-a,o<0)s=r+1;else{if(!(o>0)){l=r;break}l=r-1}if(r=l,n[r]===a)return r/(i-1);const u=n[r];return(r+(a-u)/(n[r+1]-u))/(i-1)}getTangent(e,t){const n=1e-4;let r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);const a=this.getPoint(r),o=this.getPoint(i),s=t||(a.isVector2?new kn:new pr);return s.copy(o).sub(a).normalize(),s}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new pr,r=[],i=[],a=[],o=new pr,s=new Vr;for(let t=0;t<=e;t++){const n=t/e;r[t]=this.getTangentAt(n,new pr)}i[0]=new pr,a[0]=new pr;let l=Number.MAX_VALUE;const u=Math.abs(r[0].x),c=Math.abs(r[0].y),d=Math.abs(r[0].z);u<=l&&(l=u,n.set(1,0,0)),c<=l&&(l=c,n.set(0,1,0)),d<=l&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),a[t]=a[t-1].clone(),o.crossVectors(r[t-1],r[t]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(Bn(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(s.makeRotationAxis(o,e))}a[t].crossVectors(r[t],i[t])}if(!0===t){let t=Math.acos(Bn(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Cu extends Eu{constructor(e=0,t=0,n=1,r=1,i=0,a=2*Math.PI,o=!1,s=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s}getPoint(e,t){const n=t||new kn,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const a=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);const o=this.aStartAngle+e*i;let s=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=s-this.aX,r=l-this.aY;s=n*e-r*t+this.aX,l=n*t+r*e+this.aY}return n.set(s,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}Cu.prototype.isEllipseCurve=!0;class Tu extends Cu{constructor(e,t,n,r,i,a){super(e,t,n,n,r,i,a),this.type="ArcCurve"}}function Bu(){let e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){let l=(t-e)/a-(n-e)/(a+o)+(n-t)/o,u=(n-t)/o-(r-t)/(o+s)+(r-n)/s;l*=o,u*=o,i(t,n,l,u)},calc:function(i){const a=i*i;return e+t*i+n*a+r*(a*i)}}}Tu.prototype.isArcCurve=!0;const Ru=new pr,Lu=new Bu,Pu=new Bu,Du=new Bu;class Iu extends Eu{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new pr){const n=t,r=this.points,i=r.length,a=(i-(this.closed?0:1))*e;let o,s,l=Math.floor(a),u=a-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===u&&l===i-1&&(l=i-2,u=1),this.closed||l>0?o=r[(l-1)%i]:(Ru.subVectors(r[0],r[1]).add(r[0]),o=Ru);const c=r[l%i],d=r[(l+1)%i];if(this.closed||l+2<i?s=r[(l+2)%i]:(Ru.subVectors(r[i-1],r[i-2]).add(r[i-1]),s=Ru),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(o.distanceToSquared(c),e),n=Math.pow(c.distanceToSquared(d),e),r=Math.pow(d.distanceToSquared(s),e);n<1e-4&&(n=1),t<1e-4&&(t=n),r<1e-4&&(r=n),Lu.initNonuniformCatmullRom(o.x,c.x,d.x,s.x,t,n,r),Pu.initNonuniformCatmullRom(o.y,c.y,d.y,s.y,t,n,r),Du.initNonuniformCatmullRom(o.z,c.z,d.z,s.z,t,n,r)}else"catmullrom"===this.curveType&&(Lu.initCatmullRom(o.x,c.x,d.x,s.x,this.tension),Pu.initCatmullRom(o.y,c.y,d.y,s.y,this.tension),Du.initCatmullRom(o.z,c.z,d.z,s.z,this.tension));return n.set(Lu.calc(u),Pu.calc(u),Du.calc(u)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new pr).fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function Fu(e,t,n,r,i){const a=.5*(r-t),o=.5*(i-n),s=e*e;return(2*n-2*r+a+o)*(e*s)+(-3*n+3*r-2*a-o)*s+a*e+n}function ku(e,t,n,r){return function(e,t){const n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function Nu(e,t,n,r,i){return function(e,t){const n=1-e;return n*n*n*t}(e,t)+function(e,t){const n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}Iu.prototype.isCatmullRomCurve3=!0;class Ou extends Eu{constructor(e=new kn,t=new kn,n=new kn,r=new kn){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new kn){const n=t,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Nu(e,r.x,i.x,a.x,o.x),Nu(e,r.y,i.y,a.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Ou.prototype.isCubicBezierCurve=!0;class Hu extends Eu{constructor(e=new pr,t=new pr,n=new pr,r=new pr){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new pr){const n=t,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Nu(e,r.x,i.x,a.x,o.x),Nu(e,r.y,i.y,a.y,o.y),Nu(e,r.z,i.z,a.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Hu.prototype.isCubicBezierCurve3=!0;class Uu extends Eu{constructor(e=new kn,t=new kn){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new kn){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const n=t||new kn;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Uu.prototype.isLineCurve=!0;class Gu extends Eu{constructor(e=new pr,t=new pr){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new pr){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class zu extends Eu{constructor(e=new kn,t=new kn,n=new kn){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new kn){const n=t,r=this.v0,i=this.v1,a=this.v2;return n.set(ku(e,r.x,i.x,a.x),ku(e,r.y,i.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}zu.prototype.isQuadraticBezierCurve=!0;class Wu extends Eu{constructor(e=new pr,t=new pr,n=new pr){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new pr){const n=t,r=this.v0,i=this.v1,a=this.v2;return n.set(ku(e,r.x,i.x,a.x),ku(e,r.y,i.y,a.y),ku(e,r.z,i.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Wu.prototype.isQuadraticBezierCurve3=!0;class Vu extends Eu{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new kn){const n=t,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],l=r[a],u=r[a>r.length-2?r.length-1:a+1],c=r[a>r.length-3?r.length-1:a+2];return n.set(Fu(o,s.x,l.x,u.x,c.x),Fu(o,s.y,l.y,u.y,c.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new kn).fromArray(n))}return this}}Vu.prototype.isSplineCurve=!0;var ju=Object.freeze({__proto__:null,ArcCurve:Tu,CatmullRomCurve3:Iu,CubicBezierCurve:Ou,CubicBezierCurve3:Hu,EllipseCurve:Cu,LineCurve:Uu,LineCurve3:Gu,QuadraticBezierCurve:zu,QuadraticBezierCurve3:Wu,SplineCurve:Vu});class Ju extends Eu{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Uu(t,e))}getPoint(e,t){const n=e*this.getLength(),r=this.getCurveLengths();let i=0;for(;i<r.length;){if(r[i]>=n){const e=r[i]-n,a=this.curves[i],o=a.getLength(),s=0===o?0:1-e/o;return a.getPointAt(s,t)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const a=i[r],o=a.isEllipseCurve?2*e:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o);for(let e=0;e<s.length;e++){const r=s[e];n&&n.equals(r)||(t.push(r),n=r)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push((new ju[n.type]).fromJSON(n))}return this}}class qu extends Ju{constructor(e){super(),this.type="Path",this.currentPoint=new kn,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new Uu(this.currentPoint.clone(),new kn(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const i=new zu(this.currentPoint.clone(),new kn(e,t),new kn(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,i,a){const o=new Ou(this.currentPoint.clone(),new kn(e,t),new kn(n,r),new kn(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new Vu(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,i,a){const o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,i,a),this}absarc(e,t,n,r,i,a){return this.absellipse(e,t,n,n,r,i,a),this}ellipse(e,t,n,r,i,a,o,s){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+l,t+u,n,r,i,a,o,s),this}absellipse(e,t,n,r,i,a,o,s){const l=new Cu(e,t,n,r,i,a,o,s);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const u=l.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Xu extends Qi{constructor(e=[new kn(0,.5),new kn(.5,0),new kn(0,-.5)],t=12,n=0,r=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t),r=Bn(r,0,2*Math.PI);const i=[],a=[],o=[],s=[],l=[],u=1/t,c=new pr,d=new kn,h=new pr,p=new pr,f=new pr;let m=0,g=0;for(let t=0;t<=e.length-1;t++)switch(t){case 0:m=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,h.x=1*g,h.y=-m,h.z=0*g,f.copy(h),h.normalize(),s.push(h.x,h.y,h.z);break;case e.length-1:s.push(f.x,f.y,f.z);break;default:m=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,h.x=1*g,h.y=-m,h.z=0*g,p.copy(h),h.x+=f.x,h.y+=f.y,h.z+=f.z,h.normalize(),s.push(h.x,h.y,h.z),f.copy(p)}for(let i=0;i<=t;i++){const h=n+i*u*r,p=Math.sin(h),f=Math.cos(h);for(let n=0;n<=e.length-1;n++){c.x=e[n].x*p,c.y=e[n].y,c.z=e[n].x*f,a.push(c.x,c.y,c.z),d.x=i/t,d.y=n/(e.length-1),o.push(d.x,d.y);const r=s[3*n+0]*p,u=s[3*n+1],h=s[3*n+0]*f;l.push(r,u,h)}}for(let n=0;n<t;n++)for(let t=0;t<e.length-1;t++){const r=t+n*e.length,a=r,o=r+e.length,s=r+e.length+1,l=r+1;i.push(a,o,l),i.push(s,l,o)}this.setIndex(i),this.setAttribute("position",new Gi(a,3)),this.setAttribute("uv",new Gi(o,2)),this.setAttribute("normal",new Gi(l,3))}static fromJSON(e){return new Xu(e.points,e.segments,e.phiStart,e.phiLength)}}class Ku extends Xu{constructor(e=1,t=1,n=4,r=8){const i=new qu;i.absarc(0,-t/2,e,1.5*Math.PI,0),i.absarc(0,t/2,e,0,.5*Math.PI),super(i.getPoints(n),r),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:r}}static fromJSON(e){return new Ku(e.radius,e.length,e.capSegments,e.radialSegments)}}class Qu extends Qi{constructor(e=1,t=8,n=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const i=[],a=[],o=[],s=[],l=new pr,u=new kn;a.push(0,0,0),o.push(0,0,1),s.push(.5,.5);for(let i=0,c=3;i<=t;i++,c+=3){const d=n+i/t*r;l.x=e*Math.cos(d),l.y=e*Math.sin(d),a.push(l.x,l.y,l.z),o.push(0,0,1),u.x=(a[c]/e+1)/2,u.y=(a[c+1]/e+1)/2,s.push(u.x,u.y)}for(let e=1;e<=t;e++)i.push(e,e+1,0);this.setIndex(i),this.setAttribute("position",new Gi(a,3)),this.setAttribute("normal",new Gi(o,3)),this.setAttribute("uv",new Gi(s,2))}static fromJSON(e){return new Qu(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Yu extends Qi{constructor(e=1,t=1,n=1,r=8,i=1,a=!1,o=0,s=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};const l=this;r=Math.floor(r),i=Math.floor(i);const u=[],c=[],d=[],h=[];let p=0;const f=[],m=n/2;let g=0;function v(n){const i=p,a=new kn,f=new pr;let v=0;const y=!0===n?e:t,x=!0===n?1:-1;for(let e=1;e<=r;e++)c.push(0,m*x,0),d.push(0,x,0),h.push(.5,.5),p++;const b=p;for(let e=0;e<=r;e++){const t=e/r*s+o,n=Math.cos(t),i=Math.sin(t);f.x=y*i,f.y=m*x,f.z=y*n,c.push(f.x,f.y,f.z),d.push(0,x,0),a.x=.5*n+.5,a.y=.5*i*x+.5,h.push(a.x,a.y),p++}for(let e=0;e<r;e++){const t=i+e,r=b+e;!0===n?u.push(r,r+1,t):u.push(r+1,r,t),v+=3}l.addGroup(g,v,!0===n?1:2),g+=v}!function(){const a=new pr,v=new pr;let y=0;const x=(t-e)/n;for(let l=0;l<=i;l++){const u=[],g=l/i,y=g*(t-e)+e;for(let e=0;e<=r;e++){const t=e/r,i=t*s+o,l=Math.sin(i),f=Math.cos(i);v.x=y*l,v.y=-g*n+m,v.z=y*f,c.push(v.x,v.y,v.z),a.set(l,x,f).normalize(),d.push(a.x,a.y,a.z),h.push(t,1-g),u.push(p++)}f.push(u)}for(let e=0;e<r;e++)for(let t=0;t<i;t++){const n=f[t][e],r=f[t+1][e],i=f[t+1][e+1],a=f[t][e+1];u.push(n,r,a),u.push(r,i,a),y+=6}l.addGroup(g,y,0),g+=y}(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(u),this.setAttribute("position",new Gi(c,3)),this.setAttribute("normal",new Gi(d,3)),this.setAttribute("uv",new Gi(h,2))}static fromJSON(e){return new Yu(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Zu extends Yu{constructor(e=1,t=1,n=8,r=1,i=!1,a=0,o=2*Math.PI){super(0,e,t,n,r,i,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}static fromJSON(e){return new Zu(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class $u extends Qi{constructor(e=[],t=[],n=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};const i=[],a=[];function o(e,t,n,r){const i=r+1,a=[];for(let r=0;r<=i;r++){a[r]=[];const o=e.clone().lerp(n,r/i),s=t.clone().lerp(n,r/i),l=i-r;for(let e=0;e<=l;e++)a[r][e]=0===e&&r===i?o:o.clone().lerp(s,e/l)}for(let e=0;e<i;e++)for(let t=0;t<2*(i-e)-1;t++){const n=Math.floor(t/2);t%2==0?(s(a[e][n+1]),s(a[e+1][n]),s(a[e][n])):(s(a[e][n+1]),s(a[e+1][n+1]),s(a[e+1][n]))}}function s(e){i.push(e.x,e.y,e.z)}function l(t,n){const r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function u(e,t,n,r){r<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=r/2/Math.PI+.5)}function c(e){return Math.atan2(e.z,-e.x)}!function(e){const n=new pr,r=new pr,i=new pr;for(let a=0;a<t.length;a+=3)l(t[a+0],n),l(t[a+1],r),l(t[a+2],i),o(n,r,i,e)}(r),function(e){const t=new pr;for(let n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}(n),function(){const e=new pr;for(let n=0;n<i.length;n+=3){e.x=i[n+0],e.y=i[n+1],e.z=i[n+2];const r=c(e)/2/Math.PI+.5,o=(t=e,Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5);a.push(r,1-o)}var t;(function(){const e=new pr,t=new pr,n=new pr,r=new pr,o=new kn,s=new kn,l=new kn;for(let d=0,h=0;d<i.length;d+=9,h+=6){e.set(i[d+0],i[d+1],i[d+2]),t.set(i[d+3],i[d+4],i[d+5]),n.set(i[d+6],i[d+7],i[d+8]),o.set(a[h+0],a[h+1]),s.set(a[h+2],a[h+3]),l.set(a[h+4],a[h+5]),r.copy(e).add(t).add(n).divideScalar(3);const p=c(r);u(o,h+0,e,p),u(s,h+2,t,p),u(l,h+4,n,p)}})(),function(){for(let e=0;e<a.length;e+=6){const t=a[e+0],n=a[e+2],r=a[e+4],i=Math.max(t,n,r),o=Math.min(t,n,r);i>.9&&o<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new Gi(i,3)),this.setAttribute("normal",new Gi(i.slice(),3)),this.setAttribute("uv",new Gi(a,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(e){return new $u(e.vertices,e.indices,e.radius,e.details)}}class ec extends $u{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,r=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new ec(e.radius,e.detail)}}const tc=new pr,nc=new pr,rc=new pr,ic=new Ei;class ac extends Qi{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const n=4,r=Math.pow(10,n),i=Math.cos(En*t),a=e.getIndex(),o=e.getAttribute("position"),s=a?a.count:o.count,l=[0,0,0],u=["a","b","c"],c=new Array(3),d={},h=[];for(let e=0;e<s;e+=3){a?(l[0]=a.getX(e),l[1]=a.getX(e+1),l[2]=a.getX(e+2)):(l[0]=e,l[1]=e+1,l[2]=e+2);const{a:t,b:n,c:s}=ic;if(t.fromBufferAttribute(o,l[0]),n.fromBufferAttribute(o,l[1]),s.fromBufferAttribute(o,l[2]),ic.getNormal(rc),c[0]=`${Math.round(t.x*r)},${Math.round(t.y*r)},${Math.round(t.z*r)}`,c[1]=`${Math.round(n.x*r)},${Math.round(n.y*r)},${Math.round(n.z*r)}`,c[2]=`${Math.round(s.x*r)},${Math.round(s.y*r)},${Math.round(s.z*r)}`,c[0]!==c[1]&&c[1]!==c[2]&&c[2]!==c[0])for(let e=0;e<3;e++){const t=(e+1)%3,n=c[e],r=c[t],a=ic[u[e]],o=ic[u[t]],s=`${n}_${r}`,p=`${r}_${n}`;p in d&&d[p]?(rc.dot(d[p].normal)<=i&&(h.push(a.x,a.y,a.z),h.push(o.x,o.y,o.z)),d[p]=null):s in d||(d[s]={index0:l[e],index1:l[t],normal:rc.clone()})}}for(const e in d)if(d[e]){const{index0:t,index1:n}=d[e];tc.fromBufferAttribute(o,t),nc.fromBufferAttribute(o,n),h.push(tc.x,tc.y,tc.z),h.push(nc.x,nc.y,nc.z)}this.setAttribute("position",new Gi(h,3))}}}class oc extends qu{constructor(e){super(e),this.uuid=Tn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push((new qu).fromJSON(n))}return this}}const sc=function(e,t,n=2){const r=t&&t.length,i=r?t[0]*n:e.length;let a=lc(e,0,i,n,!0);const o=[];if(!a||a.next===a.prev)return o;let s,l,u,c,d,h,p;if(r&&(a=function(e,t,n,r){const i=[];let a,o,s,l,u;for(a=0,o=t.length;a<o;a++)s=t[a]*r,l=a<o-1?t[a+1]*r:e.length,u=lc(e,s,l,r,!1),u===u.next&&(u.steiner=!0),i.push(xc(u));for(i.sort(mc),a=0;a<i.length;a++)gc(i[a],n),n=uc(n,n.next);return n}(e,t,a,n)),e.length>80*n){s=u=e[0],l=c=e[1];for(let t=n;t<i;t+=n)d=e[t],h=e[t+1],d<s&&(s=d),h<l&&(l=h),d>u&&(u=d),h>c&&(c=h);p=Math.max(u-s,c-l),p=0!==p?1/p:0}return cc(a,o,n,s,l,p),o};function lc(e,t,n,r,i){let a,o;if(i===function(e,t,n,r){let i=0;for(let a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(e,t,n,r)>0)for(a=t;a<n;a+=r)o=Bc(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=Bc(a,e[a],e[a+1],o);return o&&Mc(o,o.next)&&(Rc(o),o=o.next),o}function uc(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!Mc(r,r.next)&&0!==_c(r.prev,r,r.next))r=r.next;else{if(Rc(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function cc(e,t,n,r,i,a,o){if(!e)return;!o&&a&&function(e,t,n,r){let i=e;do{null===i.z&&(i.z=yc(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n,r,i,a,o,s,l,u=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<u&&(s++,r=r.nextZ,r);t++);for(l=u;s>0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,u*=2}while(o>1)}(i)}(e,r,i,a);let s,l,u=e;for(;e.prev!==e.next;)if(s=e.prev,l=e.next,a?hc(e,r,i,a):dc(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),Rc(e),e=l.next,u=l.next;else if((e=l)===u){o?1===o?cc(e=pc(uc(e),t,n),t,n,r,i,a,2):2===o&&fc(e,t,n,r,i,a):cc(uc(e),t,n,r,i,a,1);break}}function dc(e){const t=e.prev,n=e,r=e.next;if(_c(t,n,r)>=0)return!1;let i=e.next.next;for(;i!==e.prev;){if(bc(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&_c(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function hc(e,t,n,r){const i=e.prev,a=e,o=e.next;if(_c(i,a,o)>=0)return!1;const s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,u=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,d=yc(s,l,t,n,r),h=yc(u,c,t,n,r);let p=e.prevZ,f=e.nextZ;for(;p&&p.z>=d&&f&&f.z<=h;){if(p!==e.prev&&p!==e.next&&bc(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&_c(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&bc(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&_c(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&bc(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&_c(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=h;){if(f!==e.prev&&f!==e.next&&bc(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&_c(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function pc(e,t,n){let r=e;do{const i=r.prev,a=r.next.next;!Mc(i,a)&&Sc(i,r,r.next,a)&&Cc(i,a)&&Cc(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),Rc(r),Rc(r.next),r=e=a),r=r.next}while(r!==e);return uc(r)}function fc(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&wc(o,e)){let s=Tc(o,e);return o=uc(o,o.next),s=uc(s,s.next),cc(o,t,n,r,i,a),void cc(s,t,n,r,i,a)}e=e.next}o=o.next}while(o!==e)}function mc(e,t){return e.x-t.x}function gc(e,t){if(t=function(e,t){let n=t;const r=e.x,i=e.y;let a,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>o){if(o=e,e===r){if(i===n.y)return n;if(i===n.next.y)return n.next}a=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!a)return null;if(r===o)return a;const s=a,l=a.x,u=a.y;let c,d=1/0;n=a;do{r>=n.x&&n.x>=l&&r!==n.x&&bc(i<u?r:o,i,l,u,i<u?o:r,i,n.x,n.y)&&(c=Math.abs(i-n.y)/(r-n.x),Cc(n,e)&&(c<d||c===d&&(n.x>a.x||n.x===a.x&&vc(a,n)))&&(a=n,d=c)),n=n.next}while(n!==s);return a}(e,t),t){const n=Tc(t,e);uc(t,t.next),uc(n,n.next)}}function vc(e,t){return _c(e.prev,e,t.prev)<0&&_c(t.next,e,e.next)<0}function yc(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function xc(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function bc(e,t,n,r,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function wc(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Sc(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Cc(e,t)&&Cc(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(_c(e.prev,e,t.prev)||_c(e,t.prev,t))||Mc(e,t)&&_c(e.prev,e,e.next)>0&&_c(t.prev,t,t.next)>0)}function _c(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Mc(e,t){return e.x===t.x&&e.y===t.y}function Sc(e,t,n,r){const i=Ec(_c(e,t,n)),a=Ec(_c(e,t,r)),o=Ec(_c(n,r,e)),s=Ec(_c(n,r,t));return i!==a&&o!==s||(!(0!==i||!Ac(e,n,t))||(!(0!==a||!Ac(e,r,t))||(!(0!==o||!Ac(n,e,r))||!(0!==s||!Ac(n,t,r)))))}function Ac(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Ec(e){return e>0?1:e<0?-1:0}function Cc(e,t){return _c(e.prev,e,e.next)<0?_c(e,t,e.next)>=0&&_c(e,e.prev,t)>=0:_c(e,t,e.prev)<0||_c(e,e.next,t)<0}function Tc(e,t){const n=new Lc(e.i,e.x,e.y),r=new Lc(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Bc(e,t,n,r){const i=new Lc(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Rc(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Lc(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Pc{static area(e){const t=e.length;let n=0;for(let r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n}static isClockWise(e){return Pc.area(e)<0}static triangulateShape(e,t){const n=[],r=[],i=[];Dc(e),Ic(n,e);let a=e.length;t.forEach(Dc);for(let e=0;e<t.length;e++)r.push(a),a+=t[e].length,Ic(n,t[e]);const o=sc(n,r);for(let e=0;e<o.length;e+=3)i.push(o.slice(e,e+3));return i}}function Dc(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Ic(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class Fc extends Qi{constructor(e=new oc([new kn(.5,.5),new kn(-.5,.5),new kn(-.5,-.5),new kn(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],i=[];for(let t=0,n=e.length;t<n;t++){a(e[t])}function a(e){const a=[],o=void 0!==t.curveSegments?t.curveSegments:12,s=void 0!==t.steps?t.steps:1;let l=void 0!==t.depth?t.depth:1,u=void 0===t.bevelEnabled||t.bevelEnabled,c=void 0!==t.bevelThickness?t.bevelThickness:.2,d=void 0!==t.bevelSize?t.bevelSize:c-.1,h=void 0!==t.bevelOffset?t.bevelOffset:0,p=void 0!==t.bevelSegments?t.bevelSegments:3;const f=t.extrudePath,m=void 0!==t.UVGenerator?t.UVGenerator:kc;void 0!==t.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=t.amount);let g,v,y,x,b,w=!1;f&&(g=f.getSpacedPoints(s),w=!0,u=!1,v=f.computeFrenetFrames(s,!1),y=new pr,x=new pr,b=new pr),u||(p=0,c=0,d=0,h=0);const _=e.extractPoints(o);let M=_.shape;const S=_.holes;if(!Pc.isClockWise(M)){M=M.reverse();for(let e=0,t=S.length;e<t;e++){const t=S[e];Pc.isClockWise(t)&&(S[e]=t.reverse())}}const A=Pc.triangulateShape(M,S),E=M;for(let e=0,t=S.length;e<t;e++){const t=S[e];M=M.concat(t)}function C(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}const T=M.length,B=A.length;function R(e,t,n){let r,i,a;const o=e.x-t.x,s=e.y-t.y,l=n.x-e.x,u=n.y-e.y,c=o*o+s*s,d=o*u-s*l;if(Math.abs(d)>Number.EPSILON){const d=Math.sqrt(c),h=Math.sqrt(l*l+u*u),p=t.x-s/d,f=t.y+o/d,m=((n.x-u/h-p)*u-(n.y+l/h-f)*l)/(o*u-s*l);r=p+o*m-e.x,i=f+s*m-e.y;const g=r*r+i*i;if(g<=2)return new kn(r,i);a=Math.sqrt(g/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(s)===Math.sign(u)&&(e=!0),e?(r=-s,i=o,a=Math.sqrt(c)):(r=o,i=s,a=Math.sqrt(c/2))}return new kn(r/a,i/a)}const L=[];for(let e=0,t=E.length,n=t-1,r=e+1;e<t;e++,n++,r++)n===t&&(n=0),r===t&&(r=0),L[e]=R(E[e],E[n],E[r]);const P=[];let D,I=L.concat();for(let e=0,t=S.length;e<t;e++){const t=S[e];D=[];for(let e=0,n=t.length,r=n-1,i=e+1;e<n;e++,r++,i++)r===n&&(r=0),i===n&&(i=0),D[e]=R(t[e],t[r],t[i]);P.push(D),I=I.concat(D)}for(let e=0;e<p;e++){const t=e/p,n=c*Math.cos(t*Math.PI/2),r=d*Math.sin(t*Math.PI/2)+h;for(let e=0,t=E.length;e<t;e++){const t=C(E[e],L[e],r);N(t.x,t.y,-n)}for(let e=0,t=S.length;e<t;e++){const t=S[e];D=P[e];for(let e=0,i=t.length;e<i;e++){const i=C(t[e],D[e],r);N(i.x,i.y,-n)}}}const F=d+h;for(let e=0;e<T;e++){const t=u?C(M[e],I[e],F):M[e];w?(x.copy(v.normals[0]).multiplyScalar(t.x),y.copy(v.binormals[0]).multiplyScalar(t.y),b.copy(g[0]).add(x).add(y),N(b.x,b.y,b.z)):N(t.x,t.y,0)}for(let e=1;e<=s;e++)for(let t=0;t<T;t++){const n=u?C(M[t],I[t],F):M[t];w?(x.copy(v.normals[e]).multiplyScalar(n.x),y.copy(v.binormals[e]).multiplyScalar(n.y),b.copy(g[e]).add(x).add(y),N(b.x,b.y,b.z)):N(n.x,n.y,l/s*e)}for(let e=p-1;e>=0;e--){const t=e/p,n=c*Math.cos(t*Math.PI/2),r=d*Math.sin(t*Math.PI/2)+h;for(let e=0,t=E.length;e<t;e++){const t=C(E[e],L[e],r);N(t.x,t.y,l+n)}for(let e=0,t=S.length;e<t;e++){const t=S[e];D=P[e];for(let e=0,i=t.length;e<i;e++){const i=C(t[e],D[e],r);w?N(i.x,i.y+g[s-1].y,g[s-1].x+n):N(i.x,i.y,l+n)}}}function k(e,t){let n=e.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+2*p;e<n;e++){const n=T*e,a=T*(e+1);H(t+r+n,t+i+n,t+i+a,t+r+a)}}}function N(e,t,n){a.push(e),a.push(t),a.push(n)}function O(e,t,i){U(e),U(t),U(i);const a=r.length/3,o=m.generateTopUV(n,r,a-3,a-2,a-1);G(o[0]),G(o[1]),G(o[2])}function H(e,t,i,a){U(e),U(t),U(a),U(t),U(i),U(a);const o=r.length/3,s=m.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);G(s[0]),G(s[1]),G(s[3]),G(s[1]),G(s[2]),G(s[3])}function U(e){r.push(a[3*e+0]),r.push(a[3*e+1]),r.push(a[3*e+2])}function G(e){i.push(e.x),i.push(e.y)}!function(){const e=r.length/3;if(u){let e=0,t=T*e;for(let e=0;e<B;e++){const n=A[e];O(n[2]+t,n[1]+t,n[0]+t)}e=s+2*p,t=T*e;for(let e=0;e<B;e++){const n=A[e];O(n[0]+t,n[1]+t,n[2]+t)}}else{for(let e=0;e<B;e++){const t=A[e];O(t[2],t[1],t[0])}for(let e=0;e<B;e++){const t=A[e];O(t[0]+T*s,t[1]+T*s,t[2]+T*s)}}n.addGroup(e,r.length/3-e,0)}(),function(){const e=r.length/3;let t=0;k(E,t),t+=E.length;for(let e=0,n=S.length;e<n;e++){const n=S[e];k(n,t),t+=n.length}n.addGroup(e,r.length/3-e,1)}()}this.setAttribute("position",new Gi(r,3)),this.setAttribute("uv",new Gi(i,2)),this.computeVertexNormals()}toJSON(){const e=super.toJSON();return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(let t=0,r=e.length;t<r;t++){const r=e[t];n.shapes.push(r.uuid)}else n.shapes.push(e.uuid);void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const n=[];for(let r=0,i=e.shapes.length;r<i;r++){const i=t[e.shapes[r]];n.push(i)}const r=e.options.extrudePath;return void 0!==r&&(e.options.extrudePath=(new ju[r.type]).fromJSON(r)),new Fc(n,e.options)}}const kc={generateTopUV:function(e,t,n,r,i){const a=t[3*n],o=t[3*n+1],s=t[3*r],l=t[3*r+1],u=t[3*i],c=t[3*i+1];return[new kn(a,o),new kn(s,l),new kn(u,c)]},generateSideWallUV:function(e,t,n,r,i,a){const o=t[3*n],s=t[3*n+1],l=t[3*n+2],u=t[3*r],c=t[3*r+1],d=t[3*r+2],h=t[3*i],p=t[3*i+1],f=t[3*i+2],m=t[3*a],g=t[3*a+1],v=t[3*a+2];return Math.abs(s-c)<Math.abs(o-u)?[new kn(o,1-l),new kn(u,1-d),new kn(h,1-f),new kn(m,1-v)]:[new kn(s,1-l),new kn(c,1-d),new kn(p,1-f),new kn(g,1-v)]}};class Nc extends $u{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2;super([-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Nc(e.radius,e.detail)}}class Oc extends $u{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Oc(e.radius,e.detail)}}class Hc extends Qi{constructor(e=.5,t=1,n=8,r=1,i=0,a=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},n=Math.max(3,n);const o=[],s=[],l=[],u=[];let c=e;const d=(t-e)/(r=Math.max(1,r)),h=new pr,p=new kn;for(let e=0;e<=r;e++){for(let e=0;e<=n;e++){const r=i+e/n*a;h.x=c*Math.cos(r),h.y=c*Math.sin(r),s.push(h.x,h.y,h.z),l.push(0,0,1),p.x=(h.x/t+1)/2,p.y=(h.y/t+1)/2,u.push(p.x,p.y)}c+=d}for(let e=0;e<r;e++){const t=e*(n+1);for(let e=0;e<n;e++){const r=e+t,i=r,a=r+n+1,s=r+n+2,l=r+1;o.push(i,a,l),o.push(a,s,l)}}this.setIndex(o),this.setAttribute("position",new Gi(s,3)),this.setAttribute("normal",new Gi(l,3)),this.setAttribute("uv",new Gi(u,2))}static fromJSON(e){return new Hc(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Uc extends Qi{constructor(e=new oc([new kn(0,.5),new kn(-.5,-.5),new kn(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],r=[],i=[],a=[];let o=0,s=0;if(!1===Array.isArray(e))l(e);else for(let t=0;t<e.length;t++)l(e[t]),this.addGroup(o,s,t),o+=s,s=0;function l(e){const o=r.length/3,l=e.extractPoints(t);let u=l.shape;const c=l.holes;!1===Pc.isClockWise(u)&&(u=u.reverse());for(let e=0,t=c.length;e<t;e++){const t=c[e];!0===Pc.isClockWise(t)&&(c[e]=t.reverse())}const d=Pc.triangulateShape(u,c);for(let e=0,t=c.length;e<t;e++){const t=c[e];u=u.concat(t)}for(let e=0,t=u.length;e<t;e++){const t=u[e];r.push(t.x,t.y,0),i.push(0,0,1),a.push(t.x,t.y)}for(let e=0,t=d.length;e<t;e++){const t=d[e],r=t[0]+o,i=t[1]+o,a=t[2]+o;n.push(r,i,a),s+=3}}this.setIndex(n),this.setAttribute("position",new Gi(r,3)),this.setAttribute("normal",new Gi(i,3)),this.setAttribute("uv",new Gi(a,2))}toJSON(){const e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let n=0,r=e.length;n<r;n++){const r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){const n=[];for(let r=0,i=e.shapes.length;r<i;r++){const i=t[e.shapes[r]];n.push(i)}return new Uc(n,e.curveSegments)}}class Gc extends Qi{constructor(e=1,t=32,n=16,r=0,i=2*Math.PI,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const s=Math.min(a+o,Math.PI);let l=0;const u=[],c=new pr,d=new pr,h=[],p=[],f=[],m=[];for(let h=0;h<=n;h++){const g=[],v=h/n;let y=0;0==h&&0==a?y=.5/t:h==n&&s==Math.PI&&(y=-.5/t);for(let n=0;n<=t;n++){const s=n/t;c.x=-e*Math.cos(r+s*i)*Math.sin(a+v*o),c.y=e*Math.cos(a+v*o),c.z=e*Math.sin(r+s*i)*Math.sin(a+v*o),p.push(c.x,c.y,c.z),d.copy(c).normalize(),f.push(d.x,d.y,d.z),m.push(s+y,1-v),g.push(l++)}u.push(g)}for(let e=0;e<n;e++)for(let r=0;r<t;r++){const t=u[e][r+1],i=u[e][r],o=u[e+1][r],l=u[e+1][r+1];(0!==e||a>0)&&h.push(t,i,l),(e!==n-1||s<Math.PI)&&h.push(i,o,l)}this.setIndex(h),this.setAttribute("position",new Gi(p,3)),this.setAttribute("normal",new Gi(f,3)),this.setAttribute("uv",new Gi(m,2))}static fromJSON(e){return new Gc(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class zc extends $u{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new zc(e.radius,e.detail)}}class Wc extends Qi{constructor(e=1,t=.4,n=8,r=6,i=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},n=Math.floor(n),r=Math.floor(r);const a=[],o=[],s=[],l=[],u=new pr,c=new pr,d=new pr;for(let a=0;a<=n;a++)for(let h=0;h<=r;h++){const p=h/r*i,f=a/n*Math.PI*2;c.x=(e+t*Math.cos(f))*Math.cos(p),c.y=(e+t*Math.cos(f))*Math.sin(p),c.z=t*Math.sin(f),o.push(c.x,c.y,c.z),u.x=e*Math.cos(p),u.y=e*Math.sin(p),d.subVectors(c,u).normalize(),s.push(d.x,d.y,d.z),l.push(h/r),l.push(a/n)}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){const n=(r+1)*e+t-1,i=(r+1)*(e-1)+t-1,o=(r+1)*(e-1)+t,s=(r+1)*e+t;a.push(n,i,s),a.push(i,o,s)}this.setIndex(a),this.setAttribute("position",new Gi(o,3)),this.setAttribute("normal",new Gi(s,3)),this.setAttribute("uv",new Gi(l,2))}static fromJSON(e){return new Wc(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Vc extends Qi{constructor(e=1,t=.4,n=64,r=8,i=2,a=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},n=Math.floor(n),r=Math.floor(r);const o=[],s=[],l=[],u=[],c=new pr,d=new pr,h=new pr,p=new pr,f=new pr,m=new pr,g=new pr;for(let o=0;o<=n;++o){const y=o/n*i*Math.PI*2;v(y,i,a,e,h),v(y+.01,i,a,e,p),m.subVectors(p,h),g.addVectors(p,h),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let e=0;e<=r;++e){const i=e/r*Math.PI*2,a=-t*Math.cos(i),p=t*Math.sin(i);c.x=h.x+(a*g.x+p*f.x),c.y=h.y+(a*g.y+p*f.y),c.z=h.z+(a*g.z+p*f.z),s.push(c.x,c.y,c.z),d.subVectors(c,h).normalize(),l.push(d.x,d.y,d.z),u.push(o/n),u.push(e/r)}}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){const n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),a=(r+1)*e+t,s=(r+1)*(e-1)+t;o.push(n,i,s),o.push(i,a,s)}function v(e,t,n,r,i){const a=Math.cos(e),o=Math.sin(e),s=n/t*e,l=Math.cos(s);i.x=r*(2+l)*.5*a,i.y=r*(2+l)*o*.5,i.z=r*Math.sin(s)*.5}this.setIndex(o),this.setAttribute("position",new Gi(s,3)),this.setAttribute("normal",new Gi(l,3)),this.setAttribute("uv",new Gi(u,2))}static fromJSON(e){return new Vc(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class jc extends Qi{constructor(e=new Wu(new pr(-1,-1,0),new pr(-1,1,0),new pr(1,1,0)),t=64,n=1,r=8,i=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i};const a=e.computeFrenetFrames(t,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new pr,s=new pr,l=new kn;let u=new pr;const c=[],d=[],h=[],p=[];function f(i){u=e.getPointAt(i/t,u);const l=a.normals[i],h=a.binormals[i];for(let e=0;e<=r;e++){const t=e/r*Math.PI*2,i=Math.sin(t),a=-Math.cos(t);s.x=a*l.x+i*h.x,s.y=a*l.y+i*h.y,s.z=a*l.z+i*h.z,s.normalize(),d.push(s.x,s.y,s.z),o.x=u.x+n*s.x,o.y=u.y+n*s.y,o.z=u.z+n*s.z,c.push(o.x,o.y,o.z)}}!function(){for(let e=0;e<t;e++)f(e);f(!1===i?t:0),function(){for(let e=0;e<=t;e++)for(let n=0;n<=r;n++)l.x=e/t,l.y=n/r,h.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=r;t++){const n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),a=(r+1)*e+t,o=(r+1)*(e-1)+t;p.push(n,i,o),p.push(i,a,o)}}()}(),this.setIndex(p),this.setAttribute("position",new Gi(c,3)),this.setAttribute("normal",new Gi(d,3)),this.setAttribute("uv",new Gi(h,2))}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new jc((new ju[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class Jc extends Qi{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){const t=[],n=new Set,r=new pr,i=new pr;if(null!==e.index){const a=e.attributes.position,o=e.index;let s=e.groups;0===s.length&&(s=[{start:0,count:o.count,materialIndex:0}]);for(let e=0,l=s.length;e<l;++e){const l=s[e],u=l.start;for(let e=u,s=u+l.count;e<s;e+=3)for(let s=0;s<3;s++){const l=o.getX(e+s),u=o.getX(e+(s+1)%3);r.fromBufferAttribute(a,l),i.fromBufferAttribute(a,u),!0===qc(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}}else{const a=e.attributes.position;for(let e=0,o=a.count/3;e<o;e++)for(let o=0;o<3;o++){const s=3*e+o,l=3*e+(o+1)%3;r.fromBufferAttribute(a,s),i.fromBufferAttribute(a,l),!0===qc(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}this.setAttribute("position",new Gi(t,3))}}}function qc(e,t,n){const r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==n.has(r)&&!0!==n.has(i)&&(n.add(r),n.add(i),!0)}var Xc=Object.freeze({__proto__:null,BoxGeometry:ga,BoxBufferGeometry:ga,CapsuleGeometry:Ku,CapsuleBufferGeometry:Ku,CircleGeometry:Qu,CircleBufferGeometry:Qu,ConeGeometry:Zu,ConeBufferGeometry:Zu,CylinderGeometry:Yu,CylinderBufferGeometry:Yu,DodecahedronGeometry:ec,DodecahedronBufferGeometry:ec,EdgesGeometry:ac,ExtrudeGeometry:Fc,ExtrudeBufferGeometry:Fc,IcosahedronGeometry:Nc,IcosahedronBufferGeometry:Nc,LatheGeometry:Xu,LatheBufferGeometry:Xu,OctahedronGeometry:Oc,OctahedronBufferGeometry:Oc,PlaneGeometry:ka,PlaneBufferGeometry:ka,PolyhedronGeometry:$u,PolyhedronBufferGeometry:$u,RingGeometry:Hc,RingBufferGeometry:Hc,ShapeGeometry:Uc,ShapeBufferGeometry:Uc,SphereGeometry:Gc,SphereBufferGeometry:Gc,TetrahedronGeometry:zc,TetrahedronBufferGeometry:zc,TorusGeometry:Wc,TorusBufferGeometry:Wc,TorusKnotGeometry:Vc,TorusKnotBufferGeometry:Vc,TubeGeometry:jc,TubeBufferGeometry:jc,WireframeGeometry:Jc});class Kc extends Ti{constructor(e){super(),this.type="ShadowMaterial",this.color=new Zn(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}Kc.prototype.isShadowMaterial=!0;class Qc extends ba{constructor(e){super(e),this.type="RawShaderMaterial"}}Qc.prototype.isRawShaderMaterial=!0;class Yc extends Ti{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Zn(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Zn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Wt,this.normalScale=new kn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}Yc.prototype.isMeshStandardMaterial=!0;class Zc extends Yc{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new kn(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Bn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.sheenColor=new Zn(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new Zn(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Zn(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}Zc.prototype.isMeshPhysicalMaterial=!0;class $c extends Ti{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Zn(16777215),this.specular=new Zn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Zn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Wt,this.normalScale=new kn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ne,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,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.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.flatShading=e.flatShading,this}}$c.prototype.isMeshPhongMaterial=!0;class ed extends Ti{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Zn(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Zn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Wt,this.normalScale=new kn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,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.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}ed.prototype.isMeshToonMaterial=!0;class td extends Ti{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Wt,this.normalScale=new kn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}td.prototype.isMeshNormalMaterial=!0;class nd extends Ti{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Zn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Zn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ne,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,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}}nd.prototype.isMeshLambertMaterial=!0;class rd extends Ti{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Zn(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Wt,this.normalScale=new kn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,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.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this}}rd.prototype.isMeshMatcapMaterial=!0;class id extends iu{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}id.prototype.isLineDashedMaterial=!0;const ad={ShadowMaterial:Kc,SpriteMaterial:_l,RawShaderMaterial:Qc,ShaderMaterial:ba,PointsMaterial:mu,MeshPhysicalMaterial:Zc,MeshStandardMaterial:Yc,MeshPhongMaterial:$c,MeshToonMaterial:ed,MeshNormalMaterial:td,MeshLambertMaterial:nd,MeshDepthMaterial:tl,MeshDistanceMaterial:nl,MeshBasicMaterial:Bi,MeshMatcapMaterial:rd,LineDashedMaterial:id,LineBasicMaterial:iu,Material:Ti};Ti.fromType=function(e){return new ad[e]};const od={arraySlice:function(e,t,n){return od.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){const t=e.length,n=new Array(t);for(let e=0;e!==t;++e)n[e]=e;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){const r=e.length,i=new e.constructor(r);for(let a=0,o=0;o!==r;++a){const r=n[a]*t;for(let n=0;n!==t;++n)i[o++]=e[r+n]}return i},flattenJSON:function(e,t,n,r){let i=1,a=e[0];for(;void 0!==a&&void 0===a[r];)a=e[i++];if(void 0===a)return;let o=a[r];if(void 0!==o)if(Array.isArray(o))do{o=a[r],void 0!==o&&(t.push(a.time),n.push.apply(n,o)),a=e[i++]}while(void 0!==a);else if(void 0!==o.toArray)do{o=a[r],void 0!==o&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++]}while(void 0!==a);else do{o=a[r],void 0!==o&&(t.push(a.time),n.push(o)),a=e[i++]}while(void 0!==a)},subclip:function(e,t,n,r,i=30){const a=e.clone();a.name=t;const o=[];for(let e=0;e<a.tracks.length;++e){const t=a.tracks[e],s=t.getValueSize(),l=[],u=[];for(let e=0;e<t.times.length;++e){const a=t.times[e]*i;if(!(a<n||a>=r)){l.push(t.times[e]);for(let n=0;n<s;++n)u.push(t.values[e*s+n])}}0!==l.length&&(t.times=od.convertArray(l,t.times.constructor),t.values=od.convertArray(u,t.values.constructor),o.push(t))}a.tracks=o;let s=1/0;for(let e=0;e<a.tracks.length;++e)s>a.tracks[e].times[0]&&(s=a.tracks[e].times[0]);for(let e=0;e<a.tracks.length;++e)a.tracks[e].shift(-1*s);return a.resetDuration(),a},makeClipAdditive:function(e,t=0,n=e,r=30){r<=0&&(r=30);const i=n.tracks.length,a=t/r;for(let t=0;t<i;++t){const r=n.tracks[t],i=r.ValueTypeName;if("bool"===i||"string"===i)continue;const o=e.tracks.find((function(e){return e.name===r.name&&e.ValueTypeName===i}));if(void 0===o)continue;let s=0;const l=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=l/3);let u=0;const c=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=c/3);const d=r.times.length-1;let h;if(a<=r.times[0]){const e=s,t=l-s;h=od.arraySlice(r.values,e,t)}else if(a>=r.times[d]){const e=d*l+s,t=e+l-s;h=od.arraySlice(r.values,e,t)}else{const e=r.createInterpolant(),t=s,n=l-s;e.evaluate(a),h=od.arraySlice(e.resultBuffer,t,n)}if("quaternion"===i){(new hr).fromArray(h).normalize().conjugate().toArray(h)}const p=o.times.length;for(let e=0;e<p;++e){const t=e*c+u;if("quaternion"===i)hr.multiplyQuaternionsFlat(o.values,t,h,0,o.values,t);else{const e=c-2*u;for(let n=0;n<e;++n)o.values[t+n]-=h[n]}}}return e.blendMode=Ft,e}};class sd{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{let a;n:{r:if(!(e<r)){for(let a=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===a)break;if(i=r,r=t[++n],e<r)break t}a=t.length;break n}if(e>=i)break e;{const o=t[1];e<o&&(n=2,i=o);for(let a=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===a)break;if(r=i,i=t[--n-1],e>=i)break t}a=n,n=0}}for(;n<a;){const r=n+a>>>1;e<t[r]?a=r:n=r+1}if(r=t[n],i=t[n-1],void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const 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 new Error("call to abstract method")}intervalChanged_(){}}sd.prototype.beforeStart_=sd.prototype.copySampleValue_,sd.prototype.afterEnd_=sd.prototype.copySampleValue_;class ld extends sd{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:Lt,endingEnd:Lt}}intervalChanged_(e,t,n){const r=this.parameterPositions;let i=e-2,a=e+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case Pt:i=e,o=2*t-n;break;case Dt:i=r.length-2,o=t+r[i]-r[i+1];break;default:i=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case Pt:a=e,s=2*n-t;break;case Dt:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}const l=.5*(n-t),u=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(s-n),this._offsetPrev=i*u,this._offsetNext=a*u}interpolate_(e,t,n,r){const i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,u=this._offsetPrev,c=this._offsetNext,d=this._weightPrev,h=this._weightNext,p=(n-t)/(r-t),f=p*p,m=f*p,g=-d*m+2*d*f-d*p,v=(1+d)*m+(-1.5-2*d)*f+(-.5+d)*p+1,y=(-1-h)*m+(1.5+h)*f+.5*p,x=h*m-h*f;for(let e=0;e!==o;++e)i[e]=g*a[u+e]+v*a[l+e]+y*a[s+e]+x*a[c+e];return i}}class ud extends sd{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,u=(n-t)/(r-t),c=1-u;for(let e=0;e!==o;++e)i[e]=a[l+e]*c+a[s+e]*u;return i}}class cd extends sd{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class dd{constructor(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=od.convertArray(t,this.TimeBufferType),this.values=od.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:od.convertArray(e.times,Array),values:od.convertArray(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new cd(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new ud(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new ld(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Tt:t=this.InterpolantFactoryMethodDiscrete;break;case Bt:t=this.InterpolantFactoryMethodLinear;break;case Rt:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Tt;case this.InterpolantFactoryMethodLinear:return Bt;case this.InterpolantFactoryMethodSmooth:return Rt}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let i=0,a=r-1;for(;i!==r&&n[i]<e;)++i;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==i||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);const e=this.getValueSize();this.times=od.arraySlice(n,i,a),this.values=od.arraySlice(this.values,i*e,a*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let t=0;t!==i;t++){const r=n[t];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,r),e=!1;break}if(null!==a&&a>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,r,a),e=!1;break}a=r}if(void 0!==r&&od.isTypedArray(r))for(let t=0,n=r.length;t!==n;++t){const n=r[t];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e}optimize(){const e=od.arraySlice(this.times),t=od.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===Rt,i=e.length-1;let a=1;for(let o=1;o<i;++o){let i=!1;const s=e[o];if(s!==e[o+1]&&(1!==o||s!==e[0]))if(r)i=!0;else{const e=o*n,r=e-n,a=e+n;for(let o=0;o!==n;++o){const 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];const 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=od.arraySlice(e,0,a),this.values=od.arraySlice(t,0,a*n)):(this.times=e,this.values=t),this}clone(){const e=od.arraySlice(this.times,0),t=od.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}dd.prototype.TimeBufferType=Float32Array,dd.prototype.ValueBufferType=Float32Array,dd.prototype.DefaultInterpolation=Bt;class hd extends dd{}hd.prototype.ValueTypeName="bool",hd.prototype.ValueBufferType=Array,hd.prototype.DefaultInterpolation=Tt,hd.prototype.InterpolantFactoryMethodLinear=void 0,hd.prototype.InterpolantFactoryMethodSmooth=void 0;class pd extends dd{}pd.prototype.ValueTypeName="color";class fd extends dd{}fd.prototype.ValueTypeName="number";class md extends sd{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t);let l=e*o;for(let e=l+o;l!==e;l+=4)hr.slerpFlat(i,0,a,l-o,a,l,s);return i}}class gd extends dd{InterpolantFactoryMethodLinear(e){return new md(this.times,this.values,this.getValueSize(),e)}}gd.prototype.ValueTypeName="quaternion",gd.prototype.DefaultInterpolation=Bt,gd.prototype.InterpolantFactoryMethodSmooth=void 0;class vd extends dd{}vd.prototype.ValueTypeName="string",vd.prototype.ValueBufferType=Array,vd.prototype.DefaultInterpolation=Tt,vd.prototype.InterpolantFactoryMethodLinear=void 0,vd.prototype.InterpolantFactoryMethodSmooth=void 0;class yd extends dd{}yd.prototype.ValueTypeName="vector";class xd{constructor(e,t=-1,n,r=It){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=Tn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(bd(n[e]).scale(r));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,r=n.length;e!==r;++e)t.push(dd.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){const i=t.length,a=[];for(let e=0;e<i;e++){let o=[],s=[];o.push((e+i-1)%i,e,(e+1)%i),s.push(0,1,0);const l=od.getKeyframeOrder(o);o=od.sortedArray(o,1,l),s=od.sortedArray(s,1,l),r||0!==o[0]||(o.push(i),s.push(s[0])),a.push(new fd(".morphTargetInfluences["+t[e].name+"]",o,s).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<n.length;e++)if(n[e].name===t)return n[e];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},i=/^([\w-]*?)([\d]+)$/;for(let t=0,n=e.length;t<n;t++){const n=e[t],a=n.name.match(i);if(a&&a.length>1){const e=a[1];let t=r[e];t||(r[e]=t=[]),t.push(n)}}const a=[];for(const e in r)a.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return a}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,r,i){if(0!==n.length){const a=[],o=[];od.flattenJSON(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.fps||30,o=e.blendMode;let s=e.length||-1;const l=e.hierarchy||[];for(let e=0;e<l.length;e++){const i=l[e].keys;if(i&&0!==i.length)if(i[0].morphTargets){const e={};let t;for(t=0;t<i.length;t++)if(i[t].morphTargets)for(let n=0;n<i[t].morphTargets.length;n++)e[i[t].morphTargets[n]]=-1;for(const n in e){const e=[],a=[];for(let r=0;r!==i[t].morphTargets.length;++r){const r=i[t];e.push(r.time),a.push(r.morphTarget===n?1:0)}r.push(new fd(".morphTargetInfluence["+n+"]",e,a))}s=e.length*a}else{const a=".bones["+t[e].name+"]";n(yd,a+".position",i,"pos",r),n(gd,a+".quaternion",i,"rot",r),n(yd,a+".scale",i,"scl",r)}}if(0===r.length)return null;return new this(i,s,r,o)}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function bd(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return fd;case"vector":case"vector2":case"vector3":case"vector4":return yd;case"color":return pd;case"quaternion":return gd;case"bool":case"boolean":return hd;case"string":return vd}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],n=[];od.flattenJSON(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}const wd={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class _d{constructor(e,t,n){const r=this;let i,a=!1,o=0,s=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){s++,!1===a&&void 0!==r.onStart&&r.onStart(e,o,s),a=!0},this.itemEnd=function(e){o++,void 0!==r.onProgress&&r.onProgress(e,o,s),o===s&&(a=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t<n;t+=2){const n=l[t],r=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null}}}const Md=new _d;class Sd{constructor(e){this.manager=void 0!==e?e:Md,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const 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}}const Ad={};class Ed extends Sd{constructor(e){super(e)}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=wd.get(e);if(void 0!==i)return this.manager.itemStart(e),setTimeout((()=>{t&&t(i),this.manager.itemEnd(e)}),0),i;if(void 0!==Ad[e])return void Ad[e].push({onLoad:t,onProgress:n,onError:r});Ad[e]=[],Ad[e].push({onLoad:t,onProgress:n,onError:r});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,s=this.responseType;fetch(a).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const n=Ad[e],r=t.body.getReader(),i=t.headers.get("Content-Length"),a=i?parseInt(i):0,o=0!==a;let s=0;const l=new ReadableStream({start(e){!function t(){r.read().then((({done:r,value:i})=>{if(r)e.close();else{s+=i.byteLength;const r=new ProgressEvent("progress",{lengthComputable:o,loaded:s,total:a});for(let e=0,t=n.length;e<t;e++){const t=n[e];t.onProgress&&t.onProgress(r)}e.enqueue(i),t()}}))}()}});return new Response(l)}throw Error(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`)})).then((e=>{switch(s){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,o)));case"json":return e.json();default:if(void 0===o)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(o),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then((e=>r.decode(e)))}}})).then((t=>{wd.add(e,t);const n=Ad[e];delete Ad[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onLoad&&r.onLoad(t)}})).catch((t=>{const n=Ad[e];if(void 0===n)throw this.manager.itemError(e),t;delete Ad[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onError&&r.onError(t)}this.manager.itemError(e)})).finally((()=>{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Cd extends Sd{constructor(e){super(e)}load(e,t,n,r){const i=this,a=new Ed(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){const t=[];for(let n=0;n<e.length;n++){const r=xd.parse(e[n]);t.push(r)}return t}}class Td extends Sd{constructor(e){super(e)}load(e,t,n,r){const i=this,a=[],o=new Su,s=new Ed(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(i.withCredentials);let l=0;function u(u){s.load(e[u],(function(e){const n=i.parse(e,!0);a[u]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,6===l&&(1===n.mipmapCount&&(o.minFilter=Ae),o.image=a,o.format=n.format,o.needsUpdate=!0,t&&t(o))}),n,r)}if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)u(t);else s.load(e,(function(e){const n=i.parse(e,!0);if(n.isCubemap){const e=n.mipmaps.length/n.mipmapCount;for(let t=0;t<e;t++){a[t]={mipmaps:[]};for(let e=0;e<n.mipmapCount;e++)a[t].mipmaps.push(n.mipmaps[t*n.mipmapCount+e]),a[t].format=n.format,a[t].width=n.width,a[t].height=n.height}o.image=a}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=Ae),o.format=n.format,o.needsUpdate=!0,t&&t(o)}),n,r);return o}}class Bd extends Sd{constructor(e){super(e)}load(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,a=wd.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;const o=Gn("img");function s(){u(),wd.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){u(),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}function u(){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",s,!1),o.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o}}class Rd extends Sd{constructor(e){super(e)}load(e,t,n,r){const i=new Aa,a=new Bd(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);let o=0;function s(n){a.load(e[n],(function(e){i.images[n]=e,o++,6===o&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(let t=0;t<e.length;++t)s(t);return i}}class Ld extends Sd{constructor(e){super(e)}load(e,t,n,r){const i=this,a=new Xl,o=new Ed(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(i.withCredentials),o.load(e,(function(e){const n=i.parse(e);n&&(void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:ye,a.wrapT=void 0!==n.wrapT?n.wrapT:ye,a.magFilter=void 0!==n.magFilter?n.magFilter:Ae,a.minFilter=void 0!==n.minFilter?n.minFilter:Ae,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.encoding&&(a.encoding=n.encoding),void 0!==n.flipY&&(a.flipY=n.flipY),void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps,a.minFilter=Te),1===n.mipmapCount&&(a.minFilter=Ae),void 0!==n.generateMipmaps&&(a.generateMipmaps=n.generateMipmaps),a.needsUpdate=!0,t&&t(a,n))}),n,r),a}}class Pd extends Sd{constructor(e){super(e)}load(e,t,n,r){const i=new ir,a=new Bd(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,(function(e){i.image=e,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}class Dd extends mi{constructor(e,t=1){super(),this.type="Light",this.color=new Zn(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}Dd.prototype.isLight=!0;class Id extends Dd{constructor(e,t,n){super(e,n),this.type="HemisphereLight",this.position.copy(mi.DefaultUp),this.updateMatrix(),this.groundColor=new Zn(t)}copy(e){return Dd.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}Id.prototype.isHemisphereLight=!0;const Fd=new Vr,kd=new pr,Nd=new pr;class Od{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new kn(512,512),this.map=null,this.mapPass=null,this.matrix=new Vr,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Da,this._frameExtents=new kn(1,1),this._viewportCount=1,this._viewports=[new ar(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;kd.setFromMatrixPosition(e.matrixWorld),t.position.copy(kd),Nd.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Nd),t.updateMatrixWorld(),Fd.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Fd),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)}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.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Hd extends Od{constructor(){super(new _a(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,n=2*Cn*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}Hd.prototype.isSpotLightShadow=!0;class Ud extends Dd{constructor(e,t,n=0,r=Math.PI/3,i=0,a=1){super(e,t),this.type="SpotLight",this.position.copy(mi.DefaultUp),this.updateMatrix(),this.target=new mi,this.distance=n,this.angle=r,this.penumbra=i,this.decay=a,this.shadow=new Hd}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Ud.prototype.isSpotLight=!0;const Gd=new Vr,zd=new pr,Wd=new pr;class Vd extends Od{constructor(){super(new _a(90,1,.5,500)),this._frameExtents=new kn(4,2),this._viewportCount=6,this._viewports=[new ar(2,1,1,1),new ar(0,1,1,1),new ar(3,1,1,1),new ar(1,1,1,1),new ar(3,0,1,1),new ar(1,0,1,1)],this._cubeDirections=[new pr(1,0,0),new pr(-1,0,0),new pr(0,0,1),new pr(0,0,-1),new pr(0,1,0),new pr(0,-1,0)],this._cubeUps=[new pr(0,1,0),new pr(0,1,0),new pr(0,1,0),new pr(0,1,0),new pr(0,0,1),new pr(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),zd.setFromMatrixPosition(e.matrixWorld),n.position.copy(zd),Wd.copy(n.position),Wd.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Wd),n.updateMatrixWorld(),r.makeTranslation(-zd.x,-zd.y,-zd.z),Gd.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Gd)}}Vd.prototype.isPointLightShadow=!0;class jd extends Dd{constructor(e,t,n=0,r=1){super(e,t),this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new Vd}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}jd.prototype.isPointLight=!0;class Jd extends Od{constructor(){super(new Ja(-5,5,5,-5,.5,500))}}Jd.prototype.isDirectionalLightShadow=!0;class qd extends Dd{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(mi.DefaultUp),this.updateMatrix(),this.target=new mi,this.shadow=new Jd}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}qd.prototype.isDirectionalLight=!0;class Xd extends Dd{constructor(e,t){super(e,t),this.type="AmbientLight"}}Xd.prototype.isAmbientLight=!0;class Kd extends Dd{constructor(e,t,n=10,r=10){super(e,t),this.type="RectAreaLight",this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}Kd.prototype.isRectAreaLight=!0;class Qd{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new pr)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*i),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],n*r*1.092548),t.addScaledVector(a[5],r*i*1.092548),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],n*i*1.092548),t.addScaledVector(a[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*r),t.addScaledVector(a[2],1.023328*i),t.addScaledVector(a[3],1.023328*n),t.addScaledVector(a[4],.858086*n*r),t.addScaledVector(a[5],.858086*r*i),t.addScaledVector(a[6],.743125*i*i-.247708),t.addScaledVector(a[7],.858086*n*i),t.addScaledVector(a[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}toArray(e=[],t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}static getBasisAt(e,t){const n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}Qd.prototype.isSphericalHarmonics3=!0;class Yd extends Dd{constructor(e=new Qd,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}Yd.prototype.isLightProbe=!0;class Zd extends Sd{constructor(e){super(e),this.textures={}}load(e,t,n,r){const i=this,a=new Ed(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){const t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}const r=Ti.fromType(e.type);if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=e.sheen),void 0!==e.sheenColor&&(r.sheenColor=(new Zn).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(r.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.specularIntensity&&(r.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==r.specularColor&&r.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.thickness&&(r.thickness=e.thickness),void 0!==e.attenuationDistance&&(r.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==r.attenuationColor&&r.attenuationColor.setHex(e.attenuationColor),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.shadowSide&&(r.shadowSide=e.shadowSide),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.alphaToCoverage&&(r.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(r.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const i=e.uniforms[t];switch(r.uniforms[t]={},i.type){case"t":r.uniforms[t].value=n(i.value);break;case"c":r.uniforms[t].value=(new Zn).setHex(i.value);break;case"v2":r.uniforms[t].value=(new kn).fromArray(i.value);break;case"v3":r.uniforms[t].value=(new pr).fromArray(i.value);break;case"v4":r.uniforms[t].value=(new ar).fromArray(i.value);break;case"m3":r.uniforms[t].value=(new Nn).fromArray(i.value);break;case"m4":r.uniforms[t].value=(new Vr).fromArray(i.value);break;default:r.uniforms[t].value=i.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(const t in e.extensions)r.extensions[t]=e.extensions[t];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),r.normalScale=(new kn).fromArray(t)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.specularIntensityMap&&(r.specularIntensityMap=n(e.specularIntensityMap)),void 0!==e.specularColorMap&&(r.specularColorMap=n(e.specularColorMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new kn).fromArray(e.clearcoatNormalScale)),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),void 0!==e.thicknessMap&&(r.thicknessMap=n(e.thicknessMap)),void 0!==e.sheenColorMap&&(r.sheenColorMap=n(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(r.sheenRoughnessMap=n(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}}class $d{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class eh extends Qi{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return(new this.constructor).copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}eh.prototype.isInstancedBufferGeometry=!0;class th extends Sd{constructor(e){super(e)}load(e,t,n,r){const i=this,a=new Ed(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){const t={},n={};function r(e,r){if(void 0!==t[r])return t[r];const i=e.interleavedBuffers[r],a=function(e,t){if(void 0!==n[t])return n[t];const r=e.arrayBuffers[t],i=new Uint32Array(r).buffer;return n[t]=i,i}(e,i.buffer),o=Un(i.type,a),s=new xl(o,i.stride);return s.uuid=i.uuid,t[r]=s,s}const i=e.isInstancedBufferGeometry?new eh:new Qi,a=e.data.index;if(void 0!==a){const e=Un(a.type,a.array);i.setIndex(new Pi(e,1))}const o=e.data.attributes;for(const t in o){const n=o[t];let a;if(n.isInterleavedBufferAttribute){const t=r(e.data,n.data);a=new wl(t,n.itemSize,n.offset,n.normalized)}else{const e=Un(n.type,n.array);a=new(n.isInstancedBufferAttribute?Zl:Pi)(e,n.itemSize,n.normalized)}void 0!==n.name&&(a.name=n.name),void 0!==n.usage&&a.setUsage(n.usage),void 0!==n.updateRange&&(a.updateRange.offset=n.updateRange.offset,a.updateRange.count=n.updateRange.count),i.setAttribute(t,a)}const s=e.data.morphAttributes;if(s)for(const t in s){const n=s[t],a=[];for(let t=0,i=n.length;t<i;t++){const i=n[t];let o;if(i.isInterleavedBufferAttribute){const t=r(e.data,i.data);o=new wl(t,i.itemSize,i.offset,i.normalized)}else{const e=Un(i.type,i.array);o=new Pi(e,i.itemSize,i.normalized)}void 0!==i.name&&(o.name=i.name),a.push(o)}i.morphAttributes[t]=a}e.data.morphTargetsRelative&&(i.morphTargetsRelative=!0);const l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let e=0,t=l.length;e!==t;++e){const t=l[e];i.addGroup(t.start,t.count,t.materialIndex)}const u=e.data.boundingSphere;if(void 0!==u){const e=new pr;void 0!==u.center&&e.fromArray(u.center),i.boundingSphere=new Fr(e,u.radius)}return e.name&&(i.name=e.name),e.userData&&(i.userData=e.userData),i}}class nh extends Sd{constructor(e){super(e)}load(e,t,n,r){const i=this,a=""===this.path?$d.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;const o=new Ed(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){let a=null;try{a=JSON.parse(n)}catch(t){return void 0!==r&&r(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}const o=a.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?i.parse(a,t):console.error("THREE.ObjectLoader: Can't load "+e)}),n,r)}async loadAsync(e,t){const n=""===this.path?$d.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||n;const r=new Ed(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials);const i=await r.loadAsync(e,t),a=JSON.parse(i),o=a.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+e);return await this.parseAsync(a)}parse(e,t){const n=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),a=this.parseImages(e.images,(function(){void 0!==t&&t(l)})),o=this.parseTextures(e.textures,a),s=this.parseMaterials(e.materials,o),l=this.parseObject(e.object,i,s,o,n),u=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,u),void 0!==t){let e=!1;for(const t in a)if(a[t]instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,n),i=await this.parseImagesAsync(e.images),a=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,r,o,a,t),l=this.parseSkeletons(e.skeletons,s);return this.bindSkeletons(s,l),s}parseShapes(e){const t={};if(void 0!==e)for(let n=0,r=e.length;n<r;n++){const r=(new oc).fromJSON(e[n]);t[r.uuid]=r}return t}parseSkeletons(e,t){const n={},r={};if(t.traverse((function(e){e.isBone&&(r[e.uuid]=e)})),void 0!==e)for(let t=0,i=e.length;t<i;t++){const i=(new Yl).fromJSON(e[t],r);n[i.uuid]=i}return n}parseGeometries(e,t){const n={};if(void 0!==e){const r=new th;for(let i=0,a=e.length;i<a;i++){let a;const o=e[i];switch(o.type){case"BufferGeometry":case"InstancedBufferGeometry":a=r.parse(o);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:o.type in Xc?a=Xc[o.type].fromJSON(o,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${o.type}"`)}a.uuid=o.uuid,void 0!==o.name&&(a.name=o.name),!0===a.isBufferGeometry&&void 0!==o.userData&&(a.userData=o.userData),n[o.uuid]=a}}return n}parseMaterials(e,t){const n={},r={};if(void 0!==e){const i=new Zd;i.setTextures(t);for(let t=0,a=e.length;t<a;t++){const a=e[t];if("MultiMaterial"===a.type){const e=[];for(let t=0;t<a.materials.length;t++){const r=a.materials[t];void 0===n[r.uuid]&&(n[r.uuid]=i.parse(r)),e.push(n[r.uuid])}r[a.uuid]=e}else void 0===n[a.uuid]&&(n[a.uuid]=i.parse(a)),r[a.uuid]=n[a.uuid]}}return r}parseAnimations(e){const t={};if(void 0!==e)for(let n=0;n<e.length;n++){const r=e[n],i=xd.parse(r);t[i.uuid]=i}return t}parseImages(e,t){const n=this,r={};let i;function a(e){if("string"==typeof e){const t=e;return function(e){return n.manager.itemStart(e),i.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemError(e),n.manager.itemEnd(e)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:n.resourcePath+t)}return e.data?{data:Un(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){const n=new _d(t);i=new Bd(n),i.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t<n;t++){const n=e[t],i=n.url;if(Array.isArray(i)){const e=[];for(let t=0,n=i.length;t<n;t++){const n=a(i[t]);null!==n&&(n instanceof HTMLImageElement?e.push(n):e.push(new Xl(n.data,n.width,n.height)))}r[n.uuid]=new tr(e)}else{const e=a(n.url);r[n.uuid]=new tr(e)}}}return r}async parseImagesAsync(e){const t=this,n={};let r;async function i(e){if("string"==typeof e){const n=e,i=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(n)?n:t.resourcePath+n;return await r.loadAsync(i)}return e.data?{data:Un(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){r=new Bd(this.manager),r.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t<r;t++){const r=e[t],a=r.url;if(Array.isArray(a)){const e=[];for(let t=0,n=a.length;t<n;t++){const n=a[t],r=await i(n);null!==r&&(r instanceof HTMLImageElement?e.push(r):e.push(new Xl(r.data,r.width,r.height)))}n[r.uuid]=new tr(e)}else{const e=await i(r.url);n[r.uuid]=new tr(e)}}}return n}parseTextures(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}const r={};if(void 0!==e)for(let i=0,a=e.length;i<a;i++){const a=e[i];void 0===a.image&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),void 0===t[a.image]&&console.warn("THREE.ObjectLoader: Undefined image",a.image);const o=t[a.image],s=o.data;let l;Array.isArray(s)?(l=new Aa,6===s.length&&(l.needsUpdate=!0)):(l=s&&s.data?new Xl:new ir,s&&(l.needsUpdate=!0)),l.source=o,l.uuid=a.uuid,void 0!==a.name&&(l.name=a.name),void 0!==a.mapping&&(l.mapping=n(a.mapping,rh)),void 0!==a.offset&&l.offset.fromArray(a.offset),void 0!==a.repeat&&l.repeat.fromArray(a.repeat),void 0!==a.center&&l.center.fromArray(a.center),void 0!==a.rotation&&(l.rotation=a.rotation),void 0!==a.wrap&&(l.wrapS=n(a.wrap[0],ih),l.wrapT=n(a.wrap[1],ih)),void 0!==a.format&&(l.format=a.format),void 0!==a.type&&(l.type=a.type),void 0!==a.encoding&&(l.encoding=a.encoding),void 0!==a.minFilter&&(l.minFilter=n(a.minFilter,ah)),void 0!==a.magFilter&&(l.magFilter=n(a.magFilter,ah)),void 0!==a.anisotropy&&(l.anisotropy=a.anisotropy),void 0!==a.flipY&&(l.flipY=a.flipY),void 0!==a.premultiplyAlpha&&(l.premultiplyAlpha=a.premultiplyAlpha),void 0!==a.unpackAlignment&&(l.unpackAlignment=a.unpackAlignment),void 0!==a.userData&&(l.userData=a.userData),r[a.uuid]=l}return r}parseObject(e,t,n,r,i){let a,o,s;function l(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function u(e){if(void 0!==e){if(Array.isArray(e)){const t=[];for(let r=0,i=e.length;r<i;r++){const i=e[r];void 0===n[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),t.push(n[i])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}function c(e){return void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined texture",e),r[e]}switch(e.type){case"Scene":a=new yl,void 0!==e.background&&(Number.isInteger(e.background)?a.background=new Zn(e.background):a.background=c(e.background)),void 0!==e.environment&&(a.environment=c(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?a.fog=new vl(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(a.fog=new gl(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":a=new _a(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(a.focus=e.focus),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.filmGauge&&(a.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(a.filmOffset=e.filmOffset),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"OrthographicCamera":a=new Ja(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"AmbientLight":a=new Xd(e.color,e.intensity);break;case"DirectionalLight":a=new qd(e.color,e.intensity);break;case"PointLight":a=new jd(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":a=new Kd(e.color,e.intensity,e.width,e.height);break;case"SpotLight":a=new Ud(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":a=new Id(e.color,e.groundColor,e.intensity);break;case"LightProbe":a=(new Yd).fromJSON(e);break;case"SkinnedMesh":o=l(e.geometry),s=u(e.material),a=new Jl(o,s),void 0!==e.bindMode&&(a.bindMode=e.bindMode),void 0!==e.bindMatrix&&a.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(a.skeleton=e.skeleton);break;case"Mesh":o=l(e.geometry),s=u(e.material),a=new fa(o,s);break;case"InstancedMesh":o=l(e.geometry),s=u(e.material);const t=e.count,n=e.instanceMatrix,r=e.instanceColor;a=new ru(o,s,t),a.instanceMatrix=new Zl(new Float32Array(n.array),16),void 0!==r&&(a.instanceColor=new Zl(new Float32Array(r.array),r.itemSize));break;case"LOD":a=new Ul;break;case"Line":a=new cu(l(e.geometry),u(e.material));break;case"LineLoop":a=new fu(l(e.geometry),u(e.material));break;case"LineSegments":a=new pu(l(e.geometry),u(e.material));break;case"PointCloud":case"Points":a=new bu(l(e.geometry),u(e.material));break;case"Sprite":a=new kl(u(e.material));break;case"Group":a=new ll;break;case"Bone":a=new ql;break;default:a=new mi}if(a.uuid=e.uuid,void 0!==e.name&&(a.name=e.name),void 0!==e.matrix?(a.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(void 0!==e.position&&a.position.fromArray(e.position),void 0!==e.rotation&&a.rotation.fromArray(e.rotation),void 0!==e.quaternion&&a.quaternion.fromArray(e.quaternion),void 0!==e.scale&&a.scale.fromArray(e.scale)),void 0!==e.castShadow&&(a.castShadow=e.castShadow),void 0!==e.receiveShadow&&(a.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(a.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(a.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(a.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&a.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(a.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.frustumCulled&&(a.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(a.renderOrder=e.renderOrder),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.layers&&(a.layers.mask=e.layers),void 0!==e.children){const o=e.children;for(let e=0;e<o.length;e++)a.add(this.parseObject(o[e],t,n,r,i))}if(void 0!==e.animations){const t=e.animations;for(let e=0;e<t.length;e++){const n=t[e];a.animations.push(i[n])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(a.autoUpdate=e.autoUpdate);const t=e.levels;for(let e=0;e<t.length;e++){const n=t[e],r=a.getObjectByProperty("uuid",n.object);void 0!==r&&a.addLevel(r,n.distance)}}return a}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse((function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){const n=t[e.skeleton];void 0===n?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(n,e.bindMatrix)}}))}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const rh={UVMapping:de,CubeReflectionMapping:he,CubeRefractionMapping:pe,EquirectangularReflectionMapping:fe,EquirectangularRefractionMapping:me,CubeUVReflectionMapping:ge},ih={RepeatWrapping:ve,ClampToEdgeWrapping:ye,MirroredRepeatWrapping:xe},ah={NearestFilter:be,NearestMipmapNearestFilter:we,NearestMipmapLinearFilter:Me,LinearFilter:Ae,LinearMipmapNearestFilter:Ee,LinearMipmapLinearFilter:Te};class oh extends Sd{constructor(e){super(e),"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,a=wd.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;const o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",o.headers=this.requestHeader,fetch(e,o).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(n){wd.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}}let sh;oh.prototype.isImageBitmapLoader=!0;const lh={getContext:function(){return void 0===sh&&(sh=new(window.AudioContext||window.webkitAudioContext)),sh},setContext:function(e){sh=e}};class uh extends Sd{constructor(e){super(e)}load(e,t,n,r){const i=this,a=new Ed(this.manager);a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){try{const e=n.slice(0);lh.getContext().decodeAudioData(e,(function(e){t(e)}))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}}class ch extends Yd{constructor(e,t,n=1){super(void 0,n);const r=(new Zn).set(e),i=(new Zn).set(t),a=new pr(r.r,r.g,r.b),o=new pr(i.r,i.g,i.b),s=Math.sqrt(Math.PI),l=s*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(s),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(l)}}ch.prototype.isHemisphereLightProbe=!0;class dh extends Yd{constructor(e,t=1){super(void 0,t);const n=(new Zn).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}dh.prototype.isAmbientLightProbe=!0;const hh=new Vr,ph=new Vr,fh=new Vr;class mh{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new _a,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new _a,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,fh.copy(e.projectionMatrix);const n=t.eyeSep/2,r=n*t.near/t.focus,i=t.near*Math.tan(En*t.fov*.5)/t.zoom;let a,o;ph.elements[12]=-n,hh.elements[12]=n,a=-i*t.aspect+r,o=i*t.aspect+r,fh.elements[0]=2*t.near/(o-a),fh.elements[8]=(o+a)/(o-a),this.cameraL.projectionMatrix.copy(fh),a=-i*t.aspect-r,o=i*t.aspect-r,fh.elements[0]=2*t.near/(o-a),fh.elements[8]=(o+a)/(o-a),this.cameraR.projectionMatrix.copy(fh)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(ph),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(hh)}}class gh{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=vh(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=vh();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function vh(){return("undefined"==typeof performance?Date:performance).now()}const yh=new pr,xh=new hr,bh=new pr,wh=new pr;class _h extends mi{constructor(){super(),this.type="AudioListener",this.context=lh.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new gh}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(yh,xh,bh),wh.set(0,0,-1).applyQuaternion(xh),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(yh.x,e),t.positionY.linearRampToValueAtTime(yh.y,e),t.positionZ.linearRampToValueAtTime(yh.z,e),t.forwardX.linearRampToValueAtTime(wh.x,e),t.forwardY.linearRampToValueAtTime(wh.y,e),t.forwardZ.linearRampToValueAtTime(wh.z,e),t.upX.linearRampToValueAtTime(n.x,e),t.upY.linearRampToValueAtTime(n.y,e),t.upZ.linearRampToValueAtTime(n.z,e)}else t.setPosition(yh.x,yh.y,yh.z),t.setOrientation(wh.x,wh.y,wh.z,n.x,n.y,n.z)}}class Mh extends mi{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const Sh=new pr,Ah=new hr,Eh=new pr,Ch=new pr;class Th extends Mh{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(Sh,Ah,Eh),Ch.set(0,0,1).applyQuaternion(Ah);const t=this.panner;if(t.positionX){const e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Sh.x,e),t.positionY.linearRampToValueAtTime(Sh.y,e),t.positionZ.linearRampToValueAtTime(Sh.z,e),t.orientationX.linearRampToValueAtTime(Ch.x,e),t.orientationY.linearRampToValueAtTime(Ch.y,e),t.orientationZ.linearRampToValueAtTime(Ch.z,e)}else t.setPosition(Sh.x,Sh.y,Sh.z),t.setOrientation(Ch.x,Ch.y,Ch.z)}}class Bh{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class Rh{constructor(e,t,n){let r,i,a;switch(this.binding=e,this.valueSize=n,t){case"quaternion":r=this._slerp,i=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,r=this.valueSize,i=e*r+r;let a=this.cumulativeWeight;if(0===a){for(let e=0;e!==r;++e)n[i+e]=n[e];a=t}else{a+=t;const e=t/a;this._mixBufferRegion(n,i,0,e,r)}this.cumulativeWeight=a}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,a=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){const e=t*this._origIndex;this._mixBufferRegion(n,r,e,1-i,t)}a>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(n[e]!==n[e+t]){o.setValue(n,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let e=n,i=r;e!==i;++e)t[e]=t[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,r,i){if(r>=.5)for(let r=0;r!==i;++r)e[t+r]=e[n+r]}_slerp(e,t,n,r){hr.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){const a=this._workIndex*i;hr.multiplyQuaternionsFlat(e,a,e,t,e,n),hr.slerpFlat(e,t,e,t,e,a,r)}_lerp(e,t,n,r,i){const a=1-r;for(let o=0;o!==i;++o){const i=t+o;e[i]=e[i]*a+e[n+o]*r}}_lerpAdditive(e,t,n,r,i){for(let a=0;a!==i;++a){const i=t+a;e[i]=e[i]+e[n+a]*r}}}const Lh="\\[\\]\\.:\\/",Ph=new RegExp("[\\[\\]\\.:\\/]","g"),Dh="[^\\[\\]\\.:\\/]",Ih="[^"+Lh.replace("\\.","")+"]",Fh=/((?:WC+[\/:])*)/.source.replace("WC",Dh),kh=/(WCOD+)?/.source.replace("WCOD",Ih),Nh=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Dh),Oh=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Dh),Hh=new RegExp("^"+Fh+kh+Nh+Oh+"$"),Uh=["material","materials","bones"];class Gh{constructor(e,t,n){this.path=t,this.parsedPath=n||Gh.parseTrackName(t),this.node=Gh.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Gh.Composite(e,t,n):new Gh(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Ph,"")}static parseTrackName(e){const t=Hh.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const e=n.nodeName.substring(r+1);-1!==Uh.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let r=0;r<e.length;r++){const i=e[r];if(i.name===t||i.uuid===t)return i;const a=n(i.children);if(a)return a}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const 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){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const 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){const 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;const t=this.parsedPath,n=t.objectName,r=t.propertyName;let i=t.propertyIndex;if(e||(e=Gh.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let r=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===r){r=t;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==r){if(void 0===e[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[r]}}const a=e[r];if(void 0===a){const n=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+r+" but it wasn't found.",e)}let o=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?o=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(o=this.Versioning.MatrixWorldNeedsUpdate);let s=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[i]&&(i=e.morphTargetDictionary[i])}s=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=i}else void 0!==a.fromArray&&void 0!==a.toArray?(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}}Gh.Composite=class{constructor(e,t,n){const r=n||Gh.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},Gh.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Gh.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Gh.prototype.GetterByBindingType=[Gh.prototype._getValue_direct,Gh.prototype._getValue_array,Gh.prototype._getValue_arrayElement,Gh.prototype._getValue_toArray],Gh.prototype.SetterByBindingTypeAndVersioning=[[Gh.prototype._setValue_direct,Gh.prototype._setValue_direct_setNeedsUpdate,Gh.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Gh.prototype._setValue_array,Gh.prototype._setValue_array_setNeedsUpdate,Gh.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Gh.prototype._setValue_arrayElement,Gh.prototype._setValue_arrayElement_setNeedsUpdate,Gh.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Gh.prototype._setValue_fromArray,Gh.prototype._setValue_fromArray_setNeedsUpdate,Gh.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class zh{constructor(){this.uuid=Tn(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,r=this._parsedPaths,i=this._bindings,a=i.length;let o,s=e.length,l=this.nCachedObjects_;for(let u=0,c=arguments.length;u!==c;++u){const c=arguments[u],d=c.uuid;let h=t[d];if(void 0===h){h=s++,t[d]=h,e.push(c);for(let e=0,t=a;e!==t;++e)i[e].push(new Gh(c,n[e],r[e]))}else if(h<l){o=e[h];const s=--l,u=e[s];t[u.uuid]=h,e[h]=u,t[d]=s,e[s]=c;for(let e=0,t=a;e!==t;++e){const t=i[e],a=t[s];let o=t[h];t[h]=a,void 0===o&&(o=new Gh(c,n[e],r[e])),t[s]=o}}else e[h]!==o&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_;for(let a=0,o=arguments.length;a!==o;++a){const o=arguments[a],s=o.uuid,l=t[s];if(void 0!==l&&l>=i){const a=i++,u=e[a];t[u.uuid]=l,e[l]=u,t[s]=a,e[a]=o;for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[a],i=t[l];t[l]=r,t[a]=i}}}this.nCachedObjects_=i}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_,a=e.length;for(let o=0,s=arguments.length;o!==s;++o){const s=arguments[o].uuid,l=t[s];if(void 0!==l)if(delete t[s],l<i){const o=--i,s=e[o],u=--a,c=e[u];t[s.uuid]=l,e[l]=s,t[c.uuid]=o,e[o]=c,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[o],i=t[u];t[l]=r,t[o]=i,t.pop()}}else{const i=--a,o=e[i];i>0&&(t[o.uuid]=l),e[l]=o,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e];t[l]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){const n=this._bindingsIndicesByPath;let r=n[e];const i=this._bindings;if(void 0!==r)return i[r];const a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,u=this.nCachedObjects_,c=new Array(l);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(c);for(let n=u,r=s.length;n!==r;++n){const r=s[n];c[n]=new Gh(r,e,t)}return c}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){const r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}}zh.prototype.isAnimationObjectGroup=!0;class Wh{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const i=t.tracks,a=i.length,o=new Array(a),s={endingStart:Lt,endingEnd:Lt};for(let e=0;e!==a;++e){const t=i[e].createInterpolant(null);o[e]=t,t.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Et,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const n=this._clip.duration,r=e._clip.duration,i=r/n,a=n/r;e.warp(1,i,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const r=this._mixer,i=r.time,a=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);const s=o.parameterPositions,l=o.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/a,l[1]=t/a,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const r=(e-i)*n;if(r<0||0===n)return;this._startTime=null,t=n*r}t*=this._updateTimeScale(e);const a=this._updateTime(t),o=this._updateWeight(e);if(o>0){const e=this._interpolants,t=this._propertyBindings;if(this.blendMode===Ft)for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulateAdditive(o);else for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(a),t[n].accumulate(r,o)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,i=this._loopCount;const a=n===Ct;if(0===e)return-1===i?r:a&&1==(1&i)?t-r:r;if(n===At){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),r>=t||r<0){const n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);const o=this.repetitions-i;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===o){const t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(a&&1==(1&i))return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=Pt,r.endingEnd=Pt):(r.endingStart=e?this.zeroSlopeAtStart?Pt:Lt:Dt,r.endingEnd=t?this.zeroSlopeAtEnd?Pt:Lt:Dt)}_scheduleFading(e,t,n){const r=this._mixer,i=r.time;let a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}class Vh extends Mn{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName;let u=l[s];void 0===u&&(u={},l[s]=u);for(let e=0;e!==i;++e){const i=r[e],l=i.name;let c=u[l];if(void 0!==c)++c.referenceCount,a[e]=c;else{if(c=a[e],void 0!==c){null===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,s,l));continue}const r=t&&t._propertyBindings[e].binding.parsedPath;c=new Rh(Gh.create(n,l,r),i.ValueTypeName,i.getValueSize()),++c.referenceCount,this._addInactiveBinding(c,s,l),a[e]=c}o[e].resultBuffer=c.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,n){const r=this._actions,i=this._actionsByClip;let a=i[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{const t=a.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;const i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,l=s[s.length-1],u=e._byClipCacheIndex;l._byClipCacheIndex=u,s[u]=l,s.pop(),e._byClipCacheIndex=null;delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.referenceCount&&this._removeInactiveBinding(n)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_addInactiveBinding(e,t,n){const r=this._bindingsByRootAndName,i=this._bindings;let a=r[t];void 0===a&&(a={},r[t]=a),a[n]=e,e._cacheIndex=i.length,i.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],l=e._cacheIndex;s._cacheIndex=l,t[l]=s,t.pop(),delete o[i],0===Object.keys(o).length&&delete a[r]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return void 0===n&&(n=new ud(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i}clipAction(e,t,n){const r=t||this._root,i=r.uuid;let a="string"==typeof e?xd.findByName(r,e):e;const o=null!==a?a.uuid:e,s=this._actionsByClip[o];let l=null;if(void 0===n&&(n=null!==a?a.blendMode:It),void 0!==s){const e=s.actionByRoot[i];if(void 0!==e&&e.blendMode===n)return e;l=s.knownActions[0],null===a&&(a=l._clip)}if(null===a)return null;const u=new Wh(this,a,t,n);return this._bindAction(u,l),this._addInactiveAction(u,o,i),u}existingAction(e,t){const n=t||this._root,r=n.uuid,i="string"==typeof e?xd.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let o=0;o!==n;++o){t[o]._update(r,e,i,a)}const o=this._bindings,s=this._nActiveBindings;for(let e=0;e!==s;++e)o[e].apply(a);return this}setTime(e){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){const e=i.knownActions;for(let n=0,r=e.length;n!==r;++n){const r=e[n];this._deactivateAction(r);const i=r._cacheIndex,a=t[t.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,a._cacheIndex=i,t[i]=a,t.pop(),this._removeInactiveBindingsForAction(r)}delete r[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const e in n){const r=n[e].actionByRoot[t];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}const r=this._bindingsByRootAndName[t];if(void 0!==r)for(const e in r){const t=r[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){const n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}Vh.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class jh{constructor(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new jh(void 0===this.value.clone?this.value:this.value.clone())}}class Jh extends xl{constructor(e,t,n=1){super(e,t),this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}Jh.prototype.isInstancedInterleavedBuffer=!0;class qh{constructor(e,t,n,r,i){this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=r,this.count=i,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}qh.prototype.isGLBufferAttribute=!0;class Xh{constructor(e,t,n=0,r=1/0){this.ray=new Wr(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new ti,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,n=[]){return Qh(e,this,n,t),n.sort(Kh),n}intersectObjects(e,t=!0,n=[]){for(let r=0,i=e.length;r<i;r++)Qh(e[r],this,n,t);return n.sort(Kh),n}}function Kh(e,t){return e.distance-t.distance}function Qh(e,t,n,r){if(e.layers.test(t.layers)&&e.raycast(t,n),!0===r){const r=e.children;for(let e=0,i=r.length;e<i;e++)Qh(r[e],t,n,!0)}}class Yh{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}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(){const e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),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),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Bn(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}class Zh{constructor(e=1,t=0,n=0){return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return(new this.constructor).copy(this)}}const $h=new kn;class ep{constructor(e=new kn(1/0,1/0),t=new kn(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=$h.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}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=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(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}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}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}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))}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)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return $h.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),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)}}ep.prototype.isBox2=!0;const tp=new pr,np=new pr;class rp{constructor(e=new pr,t=new pr){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){tp.subVectors(e,this.start),np.subVectors(this.end,this.start);const n=np.dot(np);let r=np.dot(tp)/n;return t&&(r=Bn(r,0,1)),r}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const ip=new pr;class ap extends mi{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const n=new Qi,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1,n=32;e<n;e++,t++){const i=e/n*Math.PI*2,a=t/n*Math.PI*2;r.push(Math.cos(i),Math.sin(i),1,Math.cos(a),Math.sin(a),1)}n.setAttribute("position",new Gi(r,3));const i=new iu({fog:!1,toneMapped:!1});this.cone=new pu(n,i),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),ip.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(ip),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const op=new pr,sp=new Vr,lp=new Vr;class up extends pu{constructor(e){const t=cp(e),n=new Qi,r=[],i=[],a=new Zn(0,0,1),o=new Zn(0,1,0);for(let e=0;e<t.length;e++){const n=t[e];n.parent&&n.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.setAttribute("position",new Gi(r,3)),n.setAttribute("color",new Gi(i,3));super(n,new iu({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,r=n.getAttribute("position");lp.copy(this.root.matrixWorld).invert();for(let e=0,n=0;e<t.length;e++){const i=t[e];i.parent&&i.parent.isBone&&(sp.multiplyMatrices(lp,i.matrixWorld),op.setFromMatrixPosition(sp),r.setXYZ(n,op.x,op.y,op.z),sp.multiplyMatrices(lp,i.parent.matrixWorld),op.setFromMatrixPosition(sp),r.setXYZ(n+1,op.x,op.y,op.z),n+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}function cp(e){const t=[];!0===e.isBone&&t.push(e);for(let n=0;n<e.children.length;n++)t.push.apply(t,cp(e.children[n]));return t}class dp extends fa{constructor(e,t,n){super(new Gc(t,4,2),new Bi({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.light.updateMatrixWorld(),this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const hp=new pr,pp=new Zn,fp=new Zn;class mp extends mi{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;const r=new Oc(t);r.rotateY(.5*Math.PI),this.material=new Bi({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const i=r.getAttribute("position"),a=new Float32Array(3*i.count);r.setAttribute("color",new Pi(a,3)),this.add(new fa(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");pp.copy(this.light.color),fp.copy(this.light.groundColor);for(let e=0,n=t.count;e<n;e++){const r=e<n/2?pp:fp;t.setXYZ(e,r.r,r.g,r.b)}t.needsUpdate=!0}e.lookAt(hp.setFromMatrixPosition(this.light.matrixWorld).negate())}}class gp extends pu{constructor(e=10,t=10,n=4473924,r=8947848){n=new Zn(n),r=new Zn(r);const i=t/2,a=e/t,o=e/2,s=[],l=[];for(let e=0,u=0,c=-o;e<=t;e++,c+=a){s.push(-o,0,c,o,0,c),s.push(c,0,-o,c,0,o);const t=e===i?n:r;t.toArray(l,u),u+=3,t.toArray(l,u),u+=3,t.toArray(l,u),u+=3,t.toArray(l,u),u+=3}const u=new Qi;u.setAttribute("position",new Gi(s,3)),u.setAttribute("color",new Gi(l,3));super(u,new iu({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}class vp extends pu{constructor(e=10,t=16,n=8,r=64,i=4473924,a=8947848){i=new Zn(i),a=new Zn(a);const o=[],s=[];for(let n=0;n<=t;n++){const r=n/t*(2*Math.PI),l=Math.sin(r)*e,u=Math.cos(r)*e;o.push(0,0,0),o.push(l,0,u);const c=1&n?i:a;s.push(c.r,c.g,c.b),s.push(c.r,c.g,c.b)}for(let t=0;t<=n;t++){const l=1&t?i:a,u=e-e/n*t;for(let e=0;e<r;e++){let t=e/r*(2*Math.PI),n=Math.sin(t)*u,i=Math.cos(t)*u;o.push(n,0,i),s.push(l.r,l.g,l.b),t=(e+1)/r*(2*Math.PI),n=Math.sin(t)*u,i=Math.cos(t)*u,o.push(n,0,i),s.push(l.r,l.g,l.b)}}const l=new Qi;l.setAttribute("position",new Gi(o,3)),l.setAttribute("color",new Gi(s,3));super(l,new iu({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}}const yp=new pr,xp=new pr,bp=new pr;class wp extends mi{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);let r=new Qi;r.setAttribute("position",new Gi([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const i=new iu({fog:!1,toneMapped:!1});this.lightPlane=new cu(r,i),this.add(this.lightPlane),r=new Qi,r.setAttribute("position",new Gi([0,0,0,0,0,1],3)),this.targetLine=new cu(r,i),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){yp.setFromMatrixPosition(this.light.matrixWorld),xp.setFromMatrixPosition(this.light.target.matrixWorld),bp.subVectors(xp,yp),this.lightPlane.lookAt(xp),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(xp),this.targetLine.scale.z=bp.length()}}const _p=new pr,Mp=new wa;class Sp extends pu{constructor(e){const t=new Qi,n=new iu({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],a={},o=new Zn(16755200),s=new Zn(16711680),l=new Zn(43775),u=new Zn(16777215),c=new Zn(3355443);function d(e,t,n){h(e,n),h(t,n)}function h(e,t){r.push(0,0,0),i.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(r.length/3-1)}d("n1","n2",o),d("n2","n4",o),d("n4","n3",o),d("n3","n1",o),d("f1","f2",o),d("f2","f4",o),d("f4","f3",o),d("f3","f1",o),d("n1","f1",o),d("n2","f2",o),d("n3","f3",o),d("n4","f4",o),d("p","n1",s),d("p","n2",s),d("p","n3",s),d("p","n4",s),d("u1","u2",l),d("u2","u3",l),d("u3","u1",l),d("c","t",u),d("p","c",c),d("cn1","cn2",c),d("cn3","cn4",c),d("cf1","cf2",c),d("cf3","cf4",c),t.setAttribute("position",new Gi(r,3)),t.setAttribute("color",new Gi(i,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}update(){const e=this.geometry,t=this.pointMap;Mp.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Ap("c",t,e,Mp,0,0,-1),Ap("t",t,e,Mp,0,0,1),Ap("n1",t,e,Mp,-1,-1,-1),Ap("n2",t,e,Mp,1,-1,-1),Ap("n3",t,e,Mp,-1,1,-1),Ap("n4",t,e,Mp,1,1,-1),Ap("f1",t,e,Mp,-1,-1,1),Ap("f2",t,e,Mp,1,-1,1),Ap("f3",t,e,Mp,-1,1,1),Ap("f4",t,e,Mp,1,1,1),Ap("u1",t,e,Mp,.7,1.1,-1),Ap("u2",t,e,Mp,-.7,1.1,-1),Ap("u3",t,e,Mp,0,2,-1),Ap("cf1",t,e,Mp,-1,0,1),Ap("cf2",t,e,Mp,1,0,1),Ap("cf3",t,e,Mp,0,-1,1),Ap("cf4",t,e,Mp,0,1,1),Ap("cn1",t,e,Mp,-1,0,-1),Ap("cn2",t,e,Mp,1,0,-1),Ap("cn3",t,e,Mp,0,-1,-1),Ap("cn4",t,e,Mp,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Ap(e,t,n,r,i,a,o){_p.set(i,a,o).unproject(r);const s=t[e];if(void 0!==s){const e=n.getAttribute("position");for(let t=0,n=s.length;t<n;t++)e.setXYZ(s[t],_p.x,_p.y,_p.z)}}const Ep=new gr;class Cp extends pu{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new Qi;i.setIndex(new Pi(n,1)),i.setAttribute("position",new Pi(r,3)),super(i,new iu({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Ep.setFromObject(this.object),Ep.isEmpty())return;const t=Ep.min,n=Ep.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return pu.prototype.copy.call(this,e),this.object=e.object,this}}class Tp extends pu{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Qi;r.setIndex(new Pi(n,1)),r.setAttribute("position",new Gi([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(r,new iu({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class Bp extends cu{constructor(e,t=1,n=16776960){const r=n,i=new Qi;i.setAttribute("position",new Gi([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),super(i,new iu({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const a=new Qi;a.setAttribute("position",new Gi([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new fa(a,new Bi({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?_:w,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const Rp=new pr;let Lp,Pp;class Dp extends mi{constructor(e=new pr(0,0,1),t=new pr(0,0,0),n=1,r=16776960,i=.2*n,a=.2*i){super(),this.type="ArrowHelper",void 0===Lp&&(Lp=new Qi,Lp.setAttribute("position",new Gi([0,0,0,0,1,0],3)),Pp=new Yu(0,.5,1,5,1),Pp.translate(0,-.5,0)),this.position.copy(t),this.line=new cu(Lp,new iu({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new fa(Pp,new Bi({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Rp.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Rp,t)}}setLength(e,t=.2*e,n=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class Ip extends pu{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new Qi;n.setAttribute("position",new Gi(t,3)),n.setAttribute("color",new Gi([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(n,new iu({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,n){const r=new Zn,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(t),r.toArray(i,6),r.toArray(i,9),r.set(n),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Fp{constructor(){this.type="ShapePath",this.color=new Zn,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new qu,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function n(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n],i=new oc;i.curves=r.curves,t.push(i)}return t}function r(e,t){const n=t.length;let r=!1;for(let i=n-1,a=0;a<n;i=a++){let n=t[i],o=t[a],s=o.x-n.x,l=o.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(n=t[a],s=-s,o=t[i],l=-l),e.y<n.y||e.y>o.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-s*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(o.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=o.x)return!0}}return r}const i=Pc.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return n(a);let o,s,l;const u=[];if(1===a.length)return s=a[0],l=new oc,l.curves=s.curves,u.push(l),u;let c=!i(a[0].getPoints());c=e?!c:c;const d=[],h=[];let p,f,m=[],g=0;h[g]=void 0,m[g]=[];for(let t=0,n=a.length;t<n;t++)s=a[t],p=s.getPoints(),o=i(p),o=e?!o:o,o?(!c&&h[g]&&g++,h[g]={s:new oc,p},h[g].s.curves=s.curves,c&&g++,m[g]=[]):m[g].push({h:s,p:p[0]});if(!h[0])return n(a);if(h.length>1){let e=!1,t=0;for(let e=0,t=h.length;e<t;e++)d[e]=[];for(let n=0,i=h.length;n<i;n++){const i=m[n];for(let a=0;a<i.length;a++){const o=i[a];let s=!0;for(let i=0;i<h.length;i++)r(o.p,h[i].p)&&(n!==i&&t++,s?(s=!1,d[i].push(o)):e=!0);s&&d[n].push(o)}}t>0&&!1===e&&(m=d)}for(let e=0,t=h.length;e<t;e++){l=h[e].s,u.push(l),f=m[e];for(let e=0,t=f.length;e<t;e++)l.holes.push(f[e].h)}return u}}class kp{static toHalfFloat(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=Bn(e,-65504,65504),Op[0]=e;const t=Hp[0],n=t>>23&511;return Up[n]+((8388607&t)>>Gp[n])}static fromHalfFloat(e){const t=e>>10;return Hp[0]=zp[Vp[t]+(1023&e)]+Wp[t],Op[0]}}const Np=new ArrayBuffer(4),Op=new Float32Array(Np),Hp=new Uint32Array(Np),Up=new Uint32Array(512),Gp=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(Up[e]=0,Up[256|e]=32768,Gp[e]=24,Gp[256|e]=24):t<-14?(Up[e]=1024>>-t-14,Up[256|e]=1024>>-t-14|32768,Gp[e]=-t-1,Gp[256|e]=-t-1):t<=15?(Up[e]=t+15<<10,Up[256|e]=t+15<<10|32768,Gp[e]=13,Gp[256|e]=13):t<128?(Up[e]=31744,Up[256|e]=64512,Gp[e]=24,Gp[256|e]=24):(Up[e]=31744,Up[256|e]=64512,Gp[e]=13,Gp[256|e]=13)}const zp=new Uint32Array(2048),Wp=new Uint32Array(64),Vp=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;0==(8388608&t);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,zp[e]=t|n}for(let e=1024;e<2048;++e)zp[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)Wp[e]=e<<23;Wp[31]=1199570944,Wp[32]=2147483648;for(let e=33;e<63;++e)Wp[e]=2147483648+(e-32<<23);Wp[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(Vp[e]=1024);const jp=0,Jp=1,qp=0,Xp=1,Kp=2;function Qp(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function Yp(e=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}class Zp extends bu{constructor(e,t){console.warn("THREE.PointCloud has been renamed to THREE.Points."),super(e,t)}}class $p extends kl{constructor(e){console.warn("THREE.Particle has been renamed to THREE.Sprite."),super(e)}}class ef extends bu{constructor(e,t){console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),super(e,t)}}class tf extends mu{constructor(e){console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),super(e)}}class nf extends mu{constructor(e){console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),super(e)}}class rf extends mu{constructor(e){console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),super(e)}}class af extends pr{constructor(e,t,n){console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),super(e,t,n)}}class of extends Pi{constructor(e,t){console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),super(e,t),this.setUsage(hn)}}class sf extends Di{constructor(e,t){console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),super(e,t)}}class lf extends Ii{constructor(e,t){console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),super(e,t)}}class uf extends Fi{constructor(e,t){console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),super(e,t)}}class cf extends ki{constructor(e,t){console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),super(e,t)}}class df extends Ni{constructor(e,t){console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),super(e,t)}}class hf extends Oi{constructor(e,t){console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),super(e,t)}}class pf extends Hi{constructor(e,t){console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),super(e,t)}}class ff extends Gi{constructor(e,t){console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),super(e,t)}}class mf extends zi{constructor(e,t){console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),super(e,t)}}Eu.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Eu.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},qu.prototype.fromPoints=function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)};class gf extends Ip{constructor(e){console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),super(e)}}class vf extends Cp{constructor(e,t){console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),super(e,t)}}class yf extends pu{constructor(e,t){console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),super(new ac(e.geometry),new iu({color:void 0!==t?t:16777215}))}}gp.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},up.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")};class xf extends pu{constructor(e,t){console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),super(new Jc(e.geometry),new iu({color:void 0!==t?t:16777215}))}}Sd.prototype.extractUrlBase=function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),$d.extractUrlBase(e)},Sd.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}};class bf extends Ed{constructor(e){console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),super(e)}}class wf extends Ld{constructor(e){console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),super(e)}}ep.prototype.center=function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},ep.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},ep.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},ep.prototype.size=function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)},gr.prototype.center=function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},gr.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},gr.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},gr.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},gr.prototype.size=function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)},ei.prototype.toVector3=function(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")},Fr.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Da.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},rp.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Nn.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},Nn.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},Nn.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},Nn.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},Nn.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},Nn.prototype.getInverse=function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},Vr.prototype.extractPosition=function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},Vr.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},Vr.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new pr).setFromMatrixColumn(this,3)},Vr.prototype.setRotationFromQuaternion=function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},Vr.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},Vr.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Vr.prototype.multiplyVector4=function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Vr.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},Vr.prototype.rotateAxis=function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},Vr.prototype.crossVector=function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Vr.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},Vr.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},Vr.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},Vr.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},Vr.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},Vr.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Vr.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},Vr.prototype.makeFrustum=function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)},Vr.prototype.getInverse=function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},Ra.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},hr.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},hr.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},Wr.prototype.isIntersectionBox=function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},Wr.prototype.isIntersectionPlane=function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},Wr.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},Ei.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},Ei.prototype.barycoordFromPoint=function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},Ei.prototype.midpoint=function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},Ei.prototypenormal=function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},Ei.prototype.plane=function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)},Ei.barycoordFromPoint=function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Ei.getBarycoord(e,t,n,r,i)},Ei.normal=function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Ei.getNormal(e,t,n,r)},oc.prototype.extractAllPoints=function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},oc.prototype.extrude=function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Fc(this,e)},oc.prototype.makeGeometry=function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Uc(this,e)},kn.prototype.fromAttribute=function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},kn.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},kn.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},pr.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},pr.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},pr.prototype.getPositionFromMatrix=function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},pr.prototype.getScaleFromMatrix=function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},pr.prototype.getColumnFromMatrix=function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},pr.prototype.applyProjection=function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},pr.prototype.fromAttribute=function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},pr.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},pr.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},ar.prototype.fromAttribute=function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},ar.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},mi.prototype.getChildByName=function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},mi.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},mi.prototype.translate=function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},mi.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},mi.prototype.applyMatrix=function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(mi.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),fa.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(fa.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),kt},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Jl.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},_a.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Dd.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Pi.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===hn},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(hn)}}}),Pi.prototype.setDynamic=function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?hn:dn),this},Pi.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Pi.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Qi.prototype.addIndex=function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},Qi.prototype.addAttribute=function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new Pi(arguments[1],arguments[2])))},Qi.prototype.addDrawCall=function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},Qi.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},Qi.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},Qi.prototype.removeAttribute=function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},Qi.prototype.applyMatrix=function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(Qi.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),xl.prototype.setDynamic=function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?hn:dn),this},xl.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Fc.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},Fc.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},Fc.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},yl.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},jh.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(Ti.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Zn}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=e===S}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}}),Object.defineProperties(ba.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),fl.prototype.clearTarget=function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},fl.prototype.animate=function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},fl.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},fl.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},fl.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},fl.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},fl.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},fl.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},fl.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},fl.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},fl.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},fl.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},fl.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},fl.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},fl.prototype.enableScissorTest=function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},fl.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},fl.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},fl.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},fl.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},fl.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},fl.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},fl.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},fl.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},fl.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},fl.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(fl.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?Ut:Ht}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}},gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}}),Object.defineProperties(rl.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}});class _f extends Ea{constructor(e,t,n){console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),super(e,n)}}function Mf(){console.error("THREE.CanvasRenderer has been removed")}function Sf(){console.error("THREE.JSONLoader has been removed.")}Object.defineProperties(or.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Mh.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const t=this;return(new uh).load(e,(function(e){t.setBuffer(e)})),this},Bh.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Sa.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},Sa.prototype.clear=function(e,t,n,r){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(e,t,n,r)},er.crossOrigin=void 0,er.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const i=new Pd;i.setCrossOrigin(this.crossOrigin);const a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},er.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const i=new Rd;i.setCrossOrigin(this.crossOrigin);const a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},er.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},er.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};const Af={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function Ef(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}class Cf extends Qi{constructor(){console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),super()}}class Tf extends Qi{constructor(){console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),super()}}function Bf(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function Rf(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function Lf(){console.error("THREE.ImmediateRenderObject has been removed.")}class Pf extends or{constructor(e,t,n){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(e,t,n),this.samples=4}}class Df extends sr{constructor(e,t,n,r){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(e,t,n,r)}}class If extends ur{constructor(e,t,n,r){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(e,t,n,r)}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:c}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=c);var Ff=n(2576);function kf(e){let t;const n=new Set,r=(e,r)=>{const i="function"==typeof e?e(t):e;if(i!==t){const e=t;t=r?i:Object.assign({},t,i),n.forEach((n=>n(t,e)))}},i=()=>t,a={setState:r,getState:i,subscribe:(e,r,a)=>r||a?((e,r=i,a=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let o=r(t);function s(){const n=r(t);if(!a(o,n)){const t=o;e(o=n,t)}}return n.add(s),()=>n.delete(s)})(e,r,a):(n.add(e),()=>n.delete(e)),destroy:()=>n.clear()};return t=e(r,i,a),a}const Nf="undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?s.useEffect:s.useLayoutEffect;var Of=n(6525),Hf=n.n(Of),Uf=n(3840);function Gf(e,t,n=((e,t)=>e===t)){if(e===t)return!0;if(!e||!t)return!1;const r=e.length;if(t.length!==r)return!1;for(let i=0;i<r;i++)if(!n(e[i],t[i]))return!1;return!0}const zf=[];function Wf(e,t,n=!1,r={}){for(const e of zf)if(Gf(t,e.keys,e.equal)){if(n)return;if(Object.prototype.hasOwnProperty.call(e,"error"))throw e.error;if(Object.prototype.hasOwnProperty.call(e,"response"))return e.response;if(!n)throw e.promise}const i={keys:t,equal:r.equal,promise:e(...t).then((e=>i.response=e)).then((()=>{r.lifespan&&r.lifespan>0&&setTimeout((()=>{const e=zf.indexOf(i);-1!==e&&zf.splice(e,1)}),r.lifespan)})).catch((e=>i.error=e))};if(zf.push(i),!n)throw i.promise}const Vf=e=>e&&e.isOrthographicCamera,jf="undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?s.useEffect:s.useLayoutEffect;function Jf(e){const t=s.useRef(e);return jf((()=>{t.current=e}),[e]),t}function qf({set:e}){return jf((()=>(e(new Promise((()=>null))),()=>e(!1))),[e]),null}class Xf extends s.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}Xf.getDerivedStateFromError=()=>({error:!0});const Kf="__default";function Qf(e){return Array.isArray(e)?Math.min(Math.max(e[0],window.devicePixelRatio),e[1]):e}const Yf=e=>{var t;return null==(t=e.__r3f)?void 0:t.root.getState()},Zf={obj:e=>e===Object(e)&&!Zf.arr(e)&&"function"!=typeof e,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,boo:e=>"boolean"==typeof e,und:e=>void 0===e,arr:e=>Array.isArray(e),equ(e,t,{arrays:n="shallow",objects:r="reference",strict:i=!0}={}){if(typeof e!=typeof t||!!e!=!!t)return!1;if(Zf.str(e)||Zf.num(e))return e===t;const a=Zf.obj(e);if(a&&"reference"===r)return e===t;const o=Zf.arr(e);if(o&&"reference"===n)return e===t;if((o||a)&&e===t)return!0;let s;for(s in e)if(!(s in t))return!1;for(s in i?t:e)if(e[s]!==t[s])return!1;if(Zf.und(s)){if(o&&0===e.length&&0===t.length)return!0;if(a&&0===Object.keys(e).length&&0===Object.keys(t).length)return!0;if(e!==t)return!1}return!0}};function $f(e){const t={nodes:{},materials:{}};return e&&e.traverse((e=>{e.name&&(t.nodes[e.name]=e),e.material&&!t.materials[e.material.name]&&(t.materials[e.material.name]=e.material)})),t}function em(e,t){const n=e;return(null!=t&&t.primitive||!n.__r3f)&&(n.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...t}),e}function tm(e,t){let n=e;if(t.includes("-")){const r=t.split("-"),i=r.pop();return n=r.reduce(((e,t)=>e[t]),e),{target:n,key:i}}return{target:n,key:t}}const nm=/-\d+$/;function rm(e,t,n){if(Zf.str(n)){if(nm.test(n)){const t=n.replace(nm,""),{target:r,key:i}=tm(e,t);Array.isArray(r[i])||(r[i]=[])}const{target:r,key:i}=tm(e,n);t.__r3f.previousAttach=r[i],r[i]=t}else t.__r3f.previousAttach=n(e,t)}function im(e,t,n){var r,i;if(Zf.str(n)){const{target:r,key:i}=tm(e,n);r[i]=t.__r3f.previousAttach}else null==(r=t.__r3f)||null==r.previousAttach||r.previousAttach(e,t);null==(i=t.__r3f)||delete i.previousAttach}function am(e,{children:t,key:n,ref:r,...i},{children:a,key:o,ref:s,...l}={},u=!1){var c;const d=null!=(c=null==e?void 0:e.__r3f)?c:{},h=Object.entries(i),p=[];if(u){const e=Object.keys(l);for(let t=0;t<e.length;t++)i.hasOwnProperty(e[t])||h.unshift([e[t],Kf+"remove"])}h.forEach((([t,n])=>{var r;if(null!=(r=e.__r3f)&&r.primitive&&"object"===t)return;if(Zf.equ(n,l[t]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(t))return p.push([t,n,!0,[]]);let i=[];t.includes("-")&&(i=t.split("-")),p.push([t,n,!1,i])}));const f={...i};return d.memoizedProps&&d.memoizedProps.args&&(f.args=d.memoizedProps.args),d.memoizedProps&&d.memoizedProps.attach&&(f.attach=d.memoizedProps.attach),{memoized:f,changes:p}}function om(e,t){var n,r;const i=null!=(n=null==e?void 0:e.__r3f)?n:{},a=i.root,o=null!=(r=null==a||null==a.getState?void 0:a.getState())?r:{},{memoized:s,changes:l}=(u=t)&&u.memoized&&u.changes?t:am(e,t);var u;const c=i.eventCount;if(e.__r3f&&(e.__r3f.memoizedProps=s),l.forEach((([t,n,r,a])=>{let l=e,u=l[t];if(a.length&&(u=a.reduce(((e,t)=>e[t]),e),!u||!u.set)){const[n,...r]=a.reverse();l=r.reverse().reduce(((e,t)=>e[t]),e),t=n}var c;if(n===Kf+"remove")if(u&&u.constructor)n=new u.constructor(...null!=(c=s.args)?c:[]);else if(l.constructor){var d;const e=new l.constructor(...null!=(d=l.__r3f.memoizedProps.args)?d:[]);n=e[u],e.dispose&&e.dispose()}else n=0;if(r)n?i.handlers[t]=n:delete i.handlers[t],i.eventCount=Object.keys(i.handlers).length;else if(u&&u.set&&(u.copy||u instanceof ti)){if(Array.isArray(n))u.fromArray?u.fromArray(n):u.set(...n);else if(u.copy&&n&&n.constructor&&u.constructor.name===n.constructor.name)u.copy(n);else if(void 0!==n){const e=u instanceof Zn;!e&&u.setScalar?u.setScalar(n):u instanceof ti&&n instanceof ti?u.mask=n.mask:u.set(n);jn||o.linear||!e||u.convertSRGBToLinear()}}else l[t]=n,!o.linear&&l[t]instanceof ir&&(l[t].encoding=Ut);sm(e)})),i.parent&&o.internal&&e.raycast&&c!==i.eventCount){const t=o.internal.interaction.indexOf(e);t>-1&&o.internal.interaction.splice(t,1),i.eventCount&&o.internal.interaction.push(e)}return l.length&&e.parent&&lm(e),e}function sm(e){var t,n;const r=null==(t=e.__r3f)||null==(n=t.root)||null==n.getState?void 0:n.getState();r&&0===r.internal.frames&&r.invalidate()}function lm(e){null==e.onUpdate||e.onUpdate(e)}function um(e,t){e.manual||(Vf(e)?(e.left=t.width/-2,e.right=t.width/2,e.top=t.height/2,e.bottom=t.height/-2):e.aspect=t.width/t.height,e.updateProjectionMatrix(),e.updateMatrixWorld())}function cm(e){return(e.eventObject||e.object).uuid+"/"+e.index+e.instanceId}function dm(e,t,n,r){const i=n.get(t);i&&(n.delete(t),0===n.size&&(e.delete(r),i.target.releasePointerCapture(r)))}function hm(e){const t=new pr;function n(e){return e.filter((e=>["Move","Over","Enter","Out","Leave"].some((t=>{var n;return null==(n=e.__r3f)?void 0:n.handlers["onPointer"+t]}))))}function r(t){const{internal:n}=e.getState();Array.from(n.hovered.values()).forEach((e=>{if(!t.length||!t.find((t=>t.object===e.object&&t.index===e.index&&t.instanceId===e.instanceId))){const r=e.eventObject.__r3f,i=null==r?void 0:r.handlers;if(n.hovered.delete(cm(e)),null!=r&&r.eventCount){const n={...e,intersections:t||[]};null==i.onPointerOut||i.onPointerOut(n),null==i.onPointerLeave||i.onPointerLeave(n)}}}))}function i(e,t){t.forEach((t=>{var n;return null==(n=t.__r3f)||null==n.handlers.onPointerMissed?void 0:n.handlers.onPointerMissed(e)}))}return{handlePointer:a=>{switch(a){case"onPointerLeave":case"onPointerCancel":return()=>r([]);case"onLostPointerCapture":return t=>{const{internal:n}=e.getState();"pointerId"in t&&!n.capturedMap.has(t.pointerId)&&(n.capturedMap.delete(t.pointerId),r([]))}}return o=>{const{onPointerMissed:s,internal:l}=e.getState();l.lastEvent.current=o;const u="onPointerMove"===a,c="onClick"===a||"onContextMenu"===a||"onDoubleClick"===a,d=function(t,n){const r=e.getState(),i=new Set,a=[],o=n?n(r.internal.interaction):r.internal.interaction;o.forEach((e=>{const t=Yf(e);t&&(t.raycaster.camera=void 0)})),r.previousRoot||null==r.events.compute||r.events.compute(t,r);let s=o.flatMap((e=>{const n=Yf(e);return n&&n.events.enabled&&null!==n.raycaster.camera?(void 0===n.raycaster.camera&&(null==n.events.compute||n.events.compute(t,n,null==(r=n.previousRoot)?void 0:r.getState()),void 0===n.raycaster.camera&&(n.raycaster.camera=null)),n.raycaster.camera?n.raycaster.intersectObject(e,!0):[]):[];var r})).sort(((e,t)=>{const n=Yf(e.object),r=Yf(t.object);return n&&r?r.events.priority-n.events.priority||e.distance-t.distance:0})).filter((e=>{const t=cm(e);return!i.has(t)&&(i.add(t),!0)}));r.events.filter&&(s=r.events.filter(s,r));for(const e of s){let t=e.object;for(;t;){var l;null!=(l=t.__r3f)&&l.eventCount&&a.push({...e,eventObject:t}),t=t.parent}}if("pointerId"in t&&r.internal.capturedMap.has(t.pointerId))for(let e of r.internal.capturedMap.get(t.pointerId).values())a.push(e.intersection);return a}(o,u?n:void 0),h=c?function(t){const{internal:n}=e.getState(),r=t.offsetX-n.initialClick[0],i=t.offsetY-n.initialClick[1];return Math.round(Math.sqrt(r*r+i*i))}(o):0;"onPointerDown"===a&&(l.initialClick=[o.offsetX,o.offsetY],l.initialHits=d.map((e=>e.eventObject))),c&&!d.length&&h<=2&&(i(o,l.interaction),s&&s(o)),u&&r(d),function(n,i,a,o){const{raycaster:s,pointer:l,camera:u,internal:c}=e.getState();if(n.length){const e=t.set(l.x,l.y,0).unproject(u),d={stopped:!1};for(const t of n){const h=e=>{var n,r;return null!=(n=null==(r=c.capturedMap.get(e))?void 0:r.has(t.eventObject))&&n},p=e=>{const n={intersection:t,target:i.target};c.capturedMap.has(e)?c.capturedMap.get(e).set(t.eventObject,n):c.capturedMap.set(e,new Map([[t.eventObject,n]])),i.target.setPointerCapture(e)},f=e=>{const n=c.capturedMap.get(e);n&&dm(c.capturedMap,t.eventObject,n,e)};let m={};for(let e in i){let t=i[e];"function"!=typeof t&&(m[e]=t)}let g={...t,...m,pointer:l,intersections:n,stopped:d.stopped,delta:a,unprojectedPoint:e,ray:s.ray,camera:u,stopPropagation:()=>{const e="pointerId"in i&&c.capturedMap.get(i.pointerId);(!e||e.has(t.eventObject))&&(g.stopped=d.stopped=!0,c.hovered.size&&Array.from(c.hovered.values()).find((e=>e.eventObject===t.eventObject)))&&r([...n.slice(0,n.indexOf(t)),t])},target:{hasPointerCapture:h,setPointerCapture:p,releasePointerCapture:f},currentTarget:{hasPointerCapture:h,setPointerCapture:p,releasePointerCapture:f},nativeEvent:i};if(o(g),!0===d.stopped)break}}}(d,o,h,(e=>{const t=e.eventObject,n=t.__r3f,r=null==n?void 0:n.handlers;if(null!=n&&n.eventCount)if(u){if(r.onPointerOver||r.onPointerEnter||r.onPointerOut||r.onPointerLeave){const t=cm(e),n=l.hovered.get(t);n?n.stopped&&e.stopPropagation():(l.hovered.set(t,e),null==r.onPointerOver||r.onPointerOver(e),null==r.onPointerEnter||r.onPointerEnter(e))}null==r.onPointerMove||r.onPointerMove(e)}else{const n=r[a];n?c&&!l.initialHits.includes(t)||(i(o,l.interaction.filter((e=>!l.initialHits.includes(e)))),n(e)):c&&l.initialHits.includes(t)&&i(o,l.interaction.filter((e=>!l.initialHits.includes(e))))}}))}}}}let pm={},fm=e=>{pm={...pm,...e}};const mm=e=>!(null==e||!e.render),gm=s.createContext(null),vm=(e,t)=>{const n=function(e){const t="function"==typeof e?kf(e):e,n=(e=t.getState,n=Object.is)=>{const[,r]=(0,s.useReducer)((e=>e+1),0),i=t.getState(),a=(0,s.useRef)(i),o=(0,s.useRef)(e),l=(0,s.useRef)(n),u=(0,s.useRef)(!1),c=(0,s.useRef)();let d;void 0===c.current&&(c.current=e(i));let h=!1;(a.current!==i||o.current!==e||l.current!==n||u.current)&&(d=e(i),h=!n(c.current,d)),Nf((()=>{h&&(c.current=d),a.current=i,o.current=e,l.current=n,u.current=!1}));const p=(0,s.useRef)(i);Nf((()=>{const e=()=>{try{const e=t.getState(),n=o.current(e);l.current(c.current,n)||(a.current=e,c.current=n,r())}catch(e){u.current=!0,r()}},n=t.subscribe(e);return t.getState()!==p.current&&e(),n}),[]);const f=h?d:c.current;return(0,s.useDebugValue)(f),f};return Object.assign(n,t),n[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const e=[n,t];return{next(){const t=e.length<=0;return{value:e.shift(),done:t}}}},n}(((n,r)=>{const i=new pr,a=new pr,o=new pr;function l(e=r().camera,t=a,n=r().size){const{width:s,height:l}=n,u=s/l;t instanceof pr?o.copy(t):o.set(...t);const c=e.getWorldPosition(i).distanceTo(o);if(Vf(e))return{width:s/e.zoom,height:l/e.zoom,factor:1,distance:c,aspect:u};{const t=e.fov*Math.PI/180,n=2*Math.tan(t/2)*c,r=n*(s/l);return{width:r,height:n,factor:s/r,distance:c,aspect:u}}}let u;const c=e=>n((t=>({performance:{...t.performance,current:e}}))),d=new kn;return{set:n,get:r,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,invalidate:()=>e(r()),advance:(e,n)=>t(e,n,r()),legacy:!1,linear:!1,flat:!1,scene:em(new yl),controls:null,clock:new gh,pointer:d,mouse:d,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const e=r();u&&clearTimeout(u),e.performance.current!==e.performance.min&&c(e.performance.min),u=setTimeout((()=>c(r().performance.max)),e.performance.debounce)}},size:{width:0,height:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,aspect:0,distance:0,factor:0,getCurrentViewport:l},setEvents:e=>n((t=>({...t,events:{...t.events,...e}}))),setSize:(e,t)=>{const i=r().camera,o={width:e,height:t};n((e=>({size:o,viewport:{...e.viewport,...l(i,a,o)}})))},setDpr:e=>n((t=>{const n=Qf(e);return{viewport:{...t.viewport,dpr:n,initialDpr:t.viewport.initialDpr||n}}})),setFrameloop:(e="always")=>{const t=r().clock;t.stop(),t.elapsedTime=0,"never"!==e&&(t.start(),t.elapsedTime=0),n((()=>({frameloop:e})))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:s.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(e,t,r)=>(n((({internal:n})=>({internal:{...n,priority:n.priority+(t>0?1:0),subscribers:[...n.subscribers,{ref:e,priority:t,store:r}].sort(((e,t)=>e.priority-t.priority))}}))),()=>{n((({internal:n})=>({internal:{...n,priority:n.priority-(t>0?1:0),subscribers:n.subscribers.filter((t=>t.ref!==e))}})))})}}})),r=n.getState();let i=r.size,a=r.viewport.dpr;return n.subscribe((()=>{const{camera:e,size:t,viewport:r,gl:o}=n.getState();t===i&&r.dpr===a||(um(e,t),o.setPixelRatio(r.dpr),o.setSize(t.width,t.height),i=t,a=r.dpr)})),n.subscribe((t=>e(t))),n};let ym,xm=[],bm=[],wm=[];function _m(e,t){for(ym=0;ym<e.length;ym++)e[ym](t)}let Mm,Sm;function Am(e,t,n){let r=t.clock.getDelta();for("never"===t.frameloop&&"number"==typeof e&&(r=e-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=e),Mm=t.internal.subscribers,ym=0;ym<Mm.length;ym++)Sm=Mm[ym],Sm.ref.current(Sm.store.getState(),r,n);return!t.internal.priority&&t.gl.render&&t.gl.render(t.scene,t.camera),t.internal.frames=Math.max(0,t.internal.frames-1),"always"===t.frameloop?1:t.internal.frames}function Em(){const e=s.useContext(gm);if(!e)throw"R3F hooks can only be used within the Canvas component!";return e}function Cm(e=(e=>e),t){return Em()(e,t)}function Tm(e,t=0){const n=Em(),r=n.getState().internal.subscribe,i=Jf(e);return jf((()=>r(i,t,n)),[t,r,n]),null}function Bm(e,t){return function(n,...r){const i=new n;return e&&e(i),Promise.all(r.map((e=>new Promise(((n,r)=>i.load(e,(e=>{e.scene&&Object.assign(e,$f(e.scene)),n(e)}),t,(t=>r(`Could not load ${e}: ${t.message}`))))))))}}function Rm(e,t,n,r){const i=Array.isArray(t)?t:[t],a=((e,t,n)=>Wf(e,t,!1,n))(Bm(n,r),[e,...i],{equal:Zf.equ});return Array.isArray(t)?a:a[0]}Rm.preload=function(e,t,n){const r=Array.isArray(t)?t:[t];return((e,t,n)=>{Wf(e,t,!0,n)})(Bm(n),[e,...r])},Rm.clear=function(e,t){return(e=>{if(void 0===e||0===e.length)zf.splice(0,zf.length);else{const t=zf.find((t=>Gf(e,t.keys,t.equal)));if(t){const e=zf.indexOf(t);-1!==e&&zf.splice(e,1)}}})([e,...Array.isArray(t)?t:[t]])};const Lm=new Map,{invalidate:Pm,advance:Dm}=function(e){let t,n,r,i=!1;function a(o){if(n=requestAnimationFrame(a),i=!0,t=0,xm.length&&_m(xm,o),e.forEach((e=>{var n;r=e.store.getState(),!r.internal.active||!("always"===r.frameloop||r.internal.frames>0)||null!=(n=r.gl.xr)&&n.isPresenting||(t+=Am(o,r))})),bm.length&&_m(bm,o),0===t)return wm.length&&_m(wm,o),i=!1,cancelAnimationFrame(n)}return{loop:a,invalidate:function t(n){var r;if(!n)return e.forEach((e=>t(e.store.getState())));null!=(r=n.gl.xr)&&r.isPresenting||!n.internal.active||"never"===n.frameloop||(n.internal.frames=Math.min(60,n.internal.frames+1),i||(i=!0,requestAnimationFrame(a)))},advance:function(t,n=!0,r,i){n&&_m(xm,t),r?Am(t,r,i):e.forEach((e=>Am(t,e.store.getState()))),n&&_m(bm,t)}}}(Lm),{reconciler:Im,applyProps:Fm}=function(e,t){function n(e,{args:t=[],attach:n,...r},i){let a,o=`${e[0].toUpperCase()}${e.slice(1)}`;if(void 0===n&&(o.endsWith("Geometry")?n="geometry":o.endsWith("Material")&&(n="material")),"primitive"===e){if(void 0===r.object)throw"Primitives without 'object' are invalid!";a=em(r.object,{type:e,root:i,attach:n,primitive:!0})}else{const r=pm[o];if(!r)throw`${o} is not part of the THREE namespace! Did you forget to extend? See: https://github.com/pmndrs/react-three-fiber/blob/master/markdown/api.md#using-3rd-party-objects-declaratively`;if(!Array.isArray(t))throw"The args prop must be an array!";a=em(new r(...t),{type:e,root:i,attach:n,memoizedProps:{args:t}})}return"inject"!==o&&om(a,r),a}function r(e,t){let n=!1;var r,i;t&&(null!=(r=t.__r3f)&&r.attach?rm(e,t,t.__r3f.attach):t.isObject3D&&e.isObject3D&&(e.add(t),n=!0),n||null==(i=e.__r3f)||i.objects.push(t),t.__r3f||em(t,{}),t.__r3f.parent=e,lm(t),sm(t))}function i(e,t,n){let r=!1;if(t){var i,a;if(null!=(i=t.__r3f)&&i.attach)rm(e,t,t.__r3f.attach);else if(t.isObject3D&&e.isObject3D){t.parent=e,t.dispatchEvent({type:"added"});const i=e.children.filter((e=>e!==t)),a=i.indexOf(n);e.children=[...i.slice(0,a),t,...i.slice(a)],r=!0}r||null==(a=e.__r3f)||a.objects.push(t),t.__r3f||em(t,{}),t.__r3f.parent=e,lm(t),sm(t)}}function a(e,t,n=!1){e&&[...e].forEach((e=>o(t,e,n)))}function o(e,t,n){if(t){var r,i,o;if(t.__r3f&&(t.__r3f.parent=null),null!=(r=e.__r3f)&&r.objects&&(e.__r3f.objects=e.__r3f.objects.filter((e=>e!==t))),null!=(i=t.__r3f)&&i.attach)im(e,t,t.__r3f.attach);else if(t.isObject3D&&e.isObject3D){var s;e.remove(t),null!=(s=t.__r3f)&&s.root&&function(e,t){const{events:n,internal:r}=e.getState();r.interaction=r.interaction.filter((e=>e!==t)),r.initialHits=r.initialHits.filter((e=>e!==t)),r.hovered.forEach(((e,n)=>{e.eventObject!==t&&e.object!==t||r.hovered.delete(n)})),r.capturedMap.forEach(((e,n)=>{dm(r.capturedMap,t,e,n)}))}(t.__r3f.root,t)}const u=null==(o=t.__r3f)?void 0:o.primitive,c=void 0===n?null!==t.dispose&&!u:n;var l;if(!u)a(null==(l=t.__r3f)?void 0:l.objects,t,c),a(t.children,t,c);t.__r3f&&(delete t.__r3f.root,delete t.__r3f.objects,delete t.__r3f.handlers,delete t.__r3f.memoizedProps,u||delete t.__r3f),c&&t.dispose&&"Scene"!==t.type&&(0,Uf.unstable_scheduleCallback)(Uf.unstable_IdlePriority,(()=>{try{t.dispose()}catch(e){}})),sm(e)}}return{reconciler:Hf()({createInstance:n,removeChild:o,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMicrotask:!0,warnsIfNotActing:!0,supportsMutation:!0,isPrimaryRenderer:!1,noTimeout:-1,appendChildToContainer:(e,t)=>{const n=e.getState().scene;n.__r3f.root=e,r(n,t)},removeChildFromContainer:(e,t)=>o(e.getState().scene,t),insertInContainerBefore:(e,t,n)=>i(e.getState().scene,t,n),getRootHostContext:()=>null,getChildHostContext:e=>e,finalizeInitialChildren(e){var t;return!!(null!=(t=null==e?void 0:e.__r3f)?t:{}).handlers},prepareUpdate(e,t,n,r){if(e.__r3f.primitive&&r.object&&r.object!==e)return[!0];{const{args:t=[],children:i,...a}=r,{args:o=[],children:s,...l}=n;if(!Array.isArray(t))throw"The args prop must be an array!";if(t.some(((e,t)=>e!==o[t])))return[!0];const u=am(e,a,l,!0);return u.changes.length?[!1,u]:null}},commitUpdate(e,[t,i],a,s,l,u){t?function(e,t,i,a){var s,l;const u=null==(s=e.__r3f)?void 0:s.parent;if(!u)return;const c=n(t,i,null==(l=e.__r3f)?void 0:l.root);"primitive"!==t&&e.children&&(e.children.forEach((e=>r(c,e))),e.children=[]),e.__r3f.objects.forEach((e=>r(c,e))),e.__r3f.objects=[],o(u,e),r(u,c),c.raycast&&c.__r3f.eventCount&&c.__r3f.root.getState().internal.interaction.push(c);[a,a.alternate].forEach((e=>{null!==e&&(e.stateNode=c,e.ref&&("function"==typeof e.ref?e.ref(c):e.ref.current=c))}))}(e,a,l,u):om(e,i)},commitMount(e,t,n,r){var i;const a=null!=(i=null==e?void 0:e.__r3f)?i:{};e.raycast&&a.handlers&&a.eventCount&&e.__r3f.root.getState().internal.interaction.push(e)},getPublicInstance:e=>e,shouldDeprioritizeSubtree:()=>!1,prepareForCommit:()=>null,preparePortalMount:e=>em(e.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,detachDeletedInstance:()=>{},createTextInstance:()=>{},hideInstance(e){var t;const{attach:n,parent:r}=null!=(t=null==e?void 0:e.__r3f)?t:{};n&&r&&im(r,e,n),e.isObject3D&&(e.visible=!1),sm(e)},unhideInstance(e,t){var n;const{attach:r,parent:i}=null!=(n=null==e?void 0:e.__r3f)?n:{};r&&i&&rm(i,e,r),(e.isObject3D&&null==t.visible||t.visible)&&(e.visible=!0),sm(e)},hideTextInstance:()=>{throw new Error("Text is not allowed in the R3F tree.")},getCurrentEventPriority:()=>t?t():Ff.DefaultEventPriority,now:"undefined"!=typeof performance&&Zf.fun(performance.now)?performance.now:Zf.fun(Date.now)?Date.now:void 0,scheduleTimeout:Zf.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Zf.fun(clearTimeout)?clearTimeout:void 0,setTimeout:Zf.fun(setTimeout)?setTimeout:void 0,clearTimeout:Zf.fun(clearTimeout)?clearTimeout:void 0}),applyProps:om}}(0,(function(){var e,t;switch(null==(e=window)||null==(t=e.event)?void 0:t.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Ff.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Ff.ContinuousEventPriority;default:return Ff.DefaultEventPriority}})),km={objects:"shallow",strict:!1},Nm=(e,t)=>{const n="function"==typeof e?e(t):e;return mm(n)?n:new fl({powerPreference:"high-performance",canvas:t,antialias:!0,alpha:!0,...e})};function Om(e){let t=Lm.get(e),n=null==t?void 0:t.fiber,r=null==t?void 0:t.store;t&&console.warn("R3F.createRoot should only be called once!");const i=r||vm(Pm,Dm),a=n||Im.createContainer(i,Ff.ConcurrentRoot,!1,null);let o;t||Lm.set(e,{fiber:a,store:i});let l=!1;return{configure(t={}){var n,r,a,s;let{gl:u,size:c,events:d,onCreated:h,shadows:p=!1,linear:f=!1,flat:m=!1,legacy:g=!1,orthographic:v=!1,frameloop:y="always",dpr:b=[1,2],performance:w,raycaster:_,camera:M,onPointerMissed:S}=t,A=i.getState(),E=A.gl;A.gl||A.set({gl:E=Nm(u,e)});let C=A.raycaster;C||A.set({raycaster:C=new Xh});const{params:T,...B}=_||{};if(Zf.equ(B,C,km)||Fm(C,{...B}),Zf.equ(T,C.params,km)||Fm(C,{params:{...C.params,...T}}),!A.camera){const e=M instanceof wa,t=e?M:v?new Ja(0,0,0,0,.1,1e3):new _a(75,0,.1,1e3);e||(t.position.z=5,M&&Fm(t,M),null!=M&&M.rotation||t.lookAt(0,0,0)),A.set({camera:t})}if(!A.xr){const e=(e,t)=>{const n=i.getState();"never"!==n.frameloop&&Dm(e,!0,n,t)},t=()=>{const t=i.getState().gl;t.xr.enabled=t.xr.isPresenting,t.xr.setAnimationLoop(t.xr.isPresenting?e:null)},n={connect(){const e=i.getState().gl;e.xr.addEventListener("sessionstart",t),e.xr.addEventListener("sessionend",t)},disconnect(){const e=i.getState().gl;e.xr.removeEventListener("sessionstart",t),e.xr.removeEventListener("sessionend",t)}};E.xr&&n.connect(),A.set({xr:n})}if(E.shadowMap){const e=Zf.boo(p);if(e&&E.shadowMap.enabled!==p||!Zf.equ(p,E.shadowMap,km)){const t=E.shadowMap.enabled;E.shadowMap.enabled=!!p,e?E.shadowMap.type=x:Object.assign(E.shadowMap,p),t!==E.shadowMap.enabled&&(E.shadowMap.needsUpdate=!0)}}jn&&(jn.legacyMode=g);const R=f?Ht:Ut,L=m?ae:ue;return E.outputEncoding!==R&&(E.outputEncoding=R),E.toneMapping!==L&&(E.toneMapping=L),A.legacy!==g&&A.set((()=>({legacy:g}))),A.linear!==f&&A.set((()=>({linear:f}))),A.flat!==m&&A.set((()=>({flat:m}))),!u||Zf.fun(u)||mm(u)||Zf.equ(u,E,km)||Fm(E,u),d&&!A.events.handlers&&A.set({events:d(i)}),b&&A.viewport.dpr!==Qf(b)&&A.setDpr(b),c=c||{width:null!=(n=null==(r=e.parentElement)?void 0:r.clientWidth)?n:0,height:null!=(a=null==(s=e.parentElement)?void 0:s.clientHeight)?a:0},Zf.equ(c,A.size,km)||A.setSize(c.width,c.height),A.frameloop!==y&&A.setFrameloop(y),A.onPointerMissed||A.set({onPointerMissed:S}),w&&!Zf.equ(w,A.performance,km)&&A.set((e=>({performance:{...e.performance,...w}}))),o=h,l=!0,this},render(t){return l||this.configure(),Im.updateContainer(s.createElement(Hm,{store:i,children:t,onCreated:o,rootElement:e}),a,null,(()=>{})),i},unmount(){Um(e)}}}function Hm({store:e,children:t,onCreated:n,rootElement:r}){return jf((()=>{const t=e.getState();t.set((e=>({internal:{...e.internal,active:!0}}))),n&&n(t),e.getState().events.connected||null==t.events.connect||t.events.connect(r)}),[]),s.createElement(gm.Provider,{value:e},t)}function Um(e,t){const n=Lm.get(e),r=null==n?void 0:n.fiber;if(r){const i=null==n?void 0:n.store.getState();i&&(i.internal.active=!1),Im.updateContainer(null,r,null,(()=>{i&&setTimeout((()=>{try{var n,r,a,o;null==i.events.disconnect||i.events.disconnect(),null==(n=i.gl)||null==(r=n.renderLists)||null==r.dispose||r.dispose(),null==(a=i.gl)||null==a.forceContextLoss||a.forceContextLoss(),null!=(o=i.gl)&&o.xr&&i.xr.disconnect(),function(e){e.dispose&&"Scene"!==e.type&&e.dispose();for(const t in e)null==t.dispose||t.dispose(),delete e[t]}(i),Lm.delete(e),t&&t(e)}catch(e){}}),500)}))}}Im.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:"18.0.0"});s.unstable_act;function Gm(){return Gm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gm.apply(this,arguments)}const zm=function(e){return function(t){e.forEach((function(e){"function"==typeof e?e(t):null!=e&&(e.current=t)}))}};var Wm=n(296),Vm=n.n(Wm);function jm(e){let{debounce:t,scroll:n,polyfill:r,offsetSize:i}=void 0===e?{debounce:0,scroll:!1,offsetSize:!1}:e;const a=r||("undefined"==typeof window?class{}:window.ResizeObserver);if(!a)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,l]=(0,s.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),u=(0,s.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),c=t?"number"==typeof t?t:t.scroll:null,d=t?"number"==typeof t?t:t.resize:null,h=(0,s.useRef)(!1);(0,s.useEffect)((()=>(h.current=!0,()=>{h.current=!1})));const[p,f,m]=(0,s.useMemo)((()=>{const e=()=>{if(!u.current.element)return;const{left:e,top:t,width:n,height:r,bottom:a,right:o,x:s,y:c}=u.current.element.getBoundingClientRect(),d={left:e,top:t,width:n,height:r,bottom:a,right:o,x:s,y:c};u.current.element instanceof HTMLElement&&i&&(d.height=u.current.element.offsetHeight,d.width=u.current.element.offsetWidth),Object.freeze(d),h.current&&!Xm(u.current.lastBounds,d)&&l(u.current.lastBounds=d)};return[e,d?Vm()(e,d):e,c?Vm()(e,c):e]}),[l,i,c,d]);function g(){u.current.scrollContainers&&(u.current.scrollContainers.forEach((e=>e.removeEventListener("scroll",m,!0))),u.current.scrollContainers=null),u.current.resizeObserver&&(u.current.resizeObserver.disconnect(),u.current.resizeObserver=null)}function v(){u.current.element&&(u.current.resizeObserver=new a(m),u.current.resizeObserver.observe(u.current.element),n&&u.current.scrollContainers&&u.current.scrollContainers.forEach((e=>e.addEventListener("scroll",m,{capture:!0,passive:!0}))))}var y,x,b;return y=m,x=Boolean(n),(0,s.useEffect)((()=>{if(x){const e=y;return window.addEventListener("scroll",e,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",e,!0)}}}),[y,x]),b=f,(0,s.useEffect)((()=>{const e=b;return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[b]),(0,s.useEffect)((()=>{g(),v()}),[n,m,f]),(0,s.useEffect)((()=>g),[]),[e=>{e&&e!==u.current.element&&(g(),u.current.element=e,u.current.scrollContainers=Jm(e),v())},o,p]}function Jm(e){const t=[];if(!e||e===document.body)return t;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(e);return[n,r,i].some((e=>"auto"===e||"scroll"===e))&&t.push(e),[...t,...Jm(e.parentElement)]}const qm=["x","y","top","bottom","left","right","width","height"],Xm=(e,t)=>qm.every((n=>e[n]===t[n])),Km={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function Qm(e){const{handlePointer:t}=hm(e);return{priority:1,enabled:!0,compute(e,t,n){t.pointer.set(e.offsetX/t.size.width*2-1,-e.offsetY/t.size.height*2+1),t.raycaster.setFromCamera(t.pointer,t.camera)},connected:void 0,handlers:Object.keys(Km).reduce(((e,n)=>({...e,[n]:t(n)})),{}),connect:t=>{var n;const{set:r,events:i}=e.getState();null==i.disconnect||i.disconnect(),r((e=>({events:{...e.events,connected:t}}))),Object.entries(null!=(n=null==i?void 0:i.handlers)?n:[]).forEach((([e,n])=>{const[r,i]=Km[e];t.addEventListener(r,n,{passive:i})}))},disconnect:()=>{const{set:t,events:n}=e.getState();var r;n.connected&&(Object.entries(null!=(r=n.handlers)?r:[]).forEach((([e,t])=>{if(n&&n.connected instanceof HTMLElement){const[r]=Km[e];n.connected.removeEventListener(r,t)}})),t((e=>({events:{...e.events,connected:void 0}}))))}}}const Ym=s.forwardRef((function({children:t,fallback:n,resize:r,style:i,gl:a,events:o=Qm,shadows:l,linear:u,flat:c,legacy:d,orthographic:h,frameloop:p,dpr:f,performance:m,raycaster:g,camera:v,onPointerMissed:y,onCreated:x,...b},w){s.useMemo((()=>fm(e)),[]);const[_,{width:M,height:S}]=jm({scroll:!0,debounce:{scroll:50,resize:0},...r}),A=s.useRef(null),E=s.useRef(null),[C,T]=s.useState(null),B=Jf(y),[R,L]=s.useState(!1),[P,D]=s.useState(!1);if(R)throw R;if(P)throw P;const I=s.useRef(null);return M>0&&S>0&&C&&(I.current||(I.current=Om(C)),I.current.configure({gl:a,events:o,shadows:l,linear:u,flat:c,legacy:d,orthographic:h,frameloop:p,dpr:f,performance:m,raycaster:g,camera:v,size:{width:M,height:S},onPointerMissed:(...e)=>null==B.current?void 0:B.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(E.current),null==x||x(e)}}),I.current.render(s.createElement(Xf,{set:D},s.createElement(s.Suspense,{fallback:s.createElement(qf,{set:L})},t)))),jf((()=>{T(A.current)}),[]),s.useEffect((()=>{if(C)return()=>Um(C)}),[C]),s.createElement("div",Gm({ref:zm([E,_]),style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",...i}},b),s.createElement("canvas",{ref:zm([A,w]),style:{display:"block"}},n))})),Zm=new WeakMap;class $m extends Sd{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,r){const i=new Ed(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(e=>{const n={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,n).then(t).catch(r)}),n,r)}decodeDracoFile(e,t,n,r){const i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){for(const e in t.attributeTypes){const n=t.attributeTypes[e];void 0!==n.BYTES_PER_ELEMENT&&(t.attributeTypes[e]=n.name)}const n=JSON.stringify(t);if(Zm.has(e)){const t=Zm.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const i=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(i,a).then((n=>(r=n,new Promise(((n,a)=>{r._callbacks[i]={resolve:n,reject:a},r.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return o.catch((()=>!0)).then((()=>{r&&i&&this._releaseTask(r,i)})),Zm.set(e,{key:n,promise:o}),o}_createGeometry(e){const t=new Qi;e.index&&t.setIndex(new Pi(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const r=e.attributes[n],i=r.name,a=r.array,o=r.itemSize;t.setAttribute(i,new Pi(a,o))}return t}_loadLibrary(e,t){const n=new Ed(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise(((t,r)=>{n.load(e,t,void 0,r)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{const n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const r=eg.toString(),i=["/* draco decoder */",n,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){const e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){const n=t.data;switch(n.type){case"decode":e._callbacks[n.id].resolve(n);break;case"error":e._callbacks[n.id].reject(n);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+n.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function eg(){let e,t;function n(e,t,n,r,i,a){const o=a.num_components(),s=n.num_points()*o,l=s*i.BYTES_PER_ELEMENT,u=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,a,u,l,c);const d=new i(e.HEAPF32.buffer,c,s).slice();return e._free(c),{name:r,array:d,itemSize:o}}onmessage=function(r){const i=r.data;switch(i.type){case"init":e=i.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":const r=i.buffer,a=i.taskConfig;t.then((e=>{const t=e.draco,o=new t.Decoder,s=new t.DecoderBuffer;s.Init(new Int8Array(r),r.byteLength);try{const e=function(e,t,r,i){const a=i.attributeIDs,o=i.attributeTypes;let s,l;const u=t.GetEncodedGeometryType(r);if(u===e.TRIANGULAR_MESH)s=new e.Mesh,l=t.DecodeBufferToMesh(r,s);else{if(u!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");s=new e.PointCloud,l=t.DecodeBufferToPointCloud(r,s)}if(!l.ok()||0===s.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const c={index:null,attributes:[]};for(const r in a){const l=self[o[r]];let u,d;if(i.useUniqueIDs)d=a[r],u=t.GetAttributeByUniqueId(s,d);else{if(d=t.GetAttributeId(s,e[a[r]]),-1===d)continue;u=t.GetAttribute(s,d)}c.attributes.push(n(e,t,s,r,l,u))}u===e.TRIANGULAR_MESH&&(c.index=function(e,t,n){const r=3*n.num_faces(),i=4*r,a=e._malloc(i);t.GetTrianglesUInt32Array(n,i,a);const o=new Uint32Array(e.HEAPF32.buffer,a,r).slice();return e._free(a),{array:o,itemSize:1}}(e,t,s));return e.destroy(s),c}(t,o,s,a),r=e.attributes.map((e=>e.array.buffer));e.index&&r.push(e.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:e},r)}catch(e){console.error(e),self.postMessage({type:"error",id:i.id,error:e.message})}finally{t.destroy(s),t.destroy(o)}}))}}}let tg;const ng=()=>{if(tg)return tg;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!=typeof WebAssembly)return{supported:!1};let n,r="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";WebAssembly.validate(e)&&(r="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB");const i=WebAssembly.instantiate(function(e){const n=new Uint8Array(e.length);for(let t=0;t<e.length;++t){const r=e.charCodeAt(t);n[t]=r>96?r-71:r>64?r-65:r>47?r+4:r>46?63:62}let r=0;for(let i=0;i<e.length;++i)n[r++]=n[i]<60?t[n[i]]:64*(n[i]-60)+n[++i];return n.buffer.slice(0,r)}(r),{}).then((e=>{n=e.instance,n.exports.__wasm_call_ctors()}));function a(e,t,r,i,a,o){const s=n.exports.sbrk,l=r+3&-4,u=s(l*i),c=s(a.length),d=new Uint8Array(n.exports.memory.buffer);d.set(a,c);const h=e(u,r,i,c,a.length);if(0===h&&o&&o(u,l,i),t.set(d.subarray(u,u+r*i)),s(u-s(0)),0!==h)throw new Error(`Malformed buffer data: ${h}`)}const o={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},s={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return tg={ready:i,supported:!0,decodeVertexBuffer(e,t,r,i,s){a(n.exports.meshopt_decodeVertexBuffer,e,t,r,i,n.exports[o[s]])},decodeIndexBuffer(e,t,r,i){a(n.exports.meshopt_decodeIndexBuffer,e,t,r,i)},decodeIndexSequence(e,t,r,i){a(n.exports.meshopt_decodeIndexSequence,e,t,r,i)},decodeGltfBuffer(e,t,r,i,l,u){a(n.exports[s[l]],e,t,r,i,n.exports[o[u]])}},tg};class rg extends Sd{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new lg(e)})),this.register((function(e){return new fg(e)})),this.register((function(e){return new mg(e)})),this.register((function(e){return new ug(e)})),this.register((function(e){return new cg(e)})),this.register((function(e){return new dg(e)})),this.register((function(e){return new hg(e)})),this.register((function(e){return new pg(e)})),this.register((function(e){return new og(e)})),this.register((function(e){return new gg(e)}))}load(e,t,n,r){const i=this;let a;a=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:$d.extractUrlBase(e),this.manager.itemStart(e);const o=function(t){r?r(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},s=new Ed(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(n){try{i.parse(n,a,(function(n){t(n),i.manager.itemEnd(e)}),o)}catch(e){o(e)}}),n,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let i;const a={},o={};if("string"==typeof e)i=e;else{if($d.decodeText(new Uint8Array(e,0,4))===vg){try{a[ag.KHR_BINARY_GLTF]=new bg(e)}catch(e){return void(r&&r(e))}i=a[ag.KHR_BINARY_GLTF].content}else i=$d.decodeText(new Uint8Array(e))}const s=JSON.parse(i);if(void 0===s.asset||s.asset.version[0]<2)return void(r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const l=new Zg(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){const t=this.pluginCallbacks[e](l);o[t.name]=t,a[t.name]=!0}if(s.extensionsUsed)for(let e=0;e<s.extensionsUsed.length;++e){const t=s.extensionsUsed[e],n=s.extensionsRequired||[];switch(t){case ag.KHR_MATERIALS_UNLIT:a[t]=new sg;break;case ag.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:a[t]=new Sg;break;case ag.KHR_DRACO_MESH_COMPRESSION:a[t]=new wg(s,this.dracoLoader);break;case ag.KHR_TEXTURE_TRANSFORM:a[t]=new _g;break;case ag.KHR_MESH_QUANTIZATION:a[t]=new Ag;break;default:n.indexOf(t)>=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}l.setExtensions(a),l.setPlugins(o),l.parse(n,r)}parseAsync(e,t){const n=this;return new Promise((function(r,i){n.parse(e,t,r,i)}))}}function ig(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const ag={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"};class og{constructor(e){this.parser=e,this.name=ag.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){const r=t[n];r.extensions&&r.extensions[this.name]&&void 0!==r.extensions[this.name].light&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const i=t.json,a=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e];let o;const s=new Zn(16777215);void 0!==a.color&&s.fromArray(a.color);const l=void 0!==a.range?a.range:0;switch(a.type){case"directional":o=new qd(s),o.target.position.set(0,0,-1),o.add(o.target);break;case"point":o=new jd(s),o.distance=l;break;case"spot":o=new Ud(s),o.distance=l,a.spot=a.spot||{},a.spot.innerConeAngle=void 0!==a.spot.innerConeAngle?a.spot.innerConeAngle:0,a.spot.outerConeAngle=void 0!==a.spot.outerConeAngle?a.spot.outerConeAngle:Math.PI/4,o.angle=a.spot.outerConeAngle,o.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,o.target.position.set(0,0,-1),o.add(o.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+a.type)}return o.position.set(0,0,0),o.decay=2,void 0!==a.intensity&&(o.intensity=a.intensity),o.name=t.createUniqueName(a.name||"light_"+e),r=Promise.resolve(o),t.cache.add(n,r),r}createNodeAttachment(e){const t=this,n=this.parser,r=n.json.nodes[e],i=(r.extensions&&r.extensions[this.name]||{}).light;return void 0===i?null:this._loadLight(i).then((function(e){return n._getNodeRef(t.cache,i,e)}))}}class sg{constructor(){this.name=ag.KHR_MATERIALS_UNLIT}getMaterialType(){return Bi}extendParams(e,t,n){const r=[];e.color=new Zn(1,1,1),e.opacity=1;const i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){const t=i.baseColorFactor;e.color.fromArray(t),e.opacity=t[3]}void 0!==i.baseColorTexture&&r.push(n.assignTexture(e,"map",i.baseColorTexture))}return Promise.all(r)}}class lg{constructor(e){this.parser=e,this.name=ag.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Zc:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],a=r.extensions[this.name];if(void 0!==a.clearcoatFactor&&(t.clearcoat=a.clearcoatFactor),void 0!==a.clearcoatTexture&&i.push(n.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),void 0!==a.clearcoatRoughnessFactor&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),void 0!==a.clearcoatRoughnessTexture&&i.push(n.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),void 0!==a.clearcoatNormalTexture&&(i.push(n.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),void 0!==a.clearcoatNormalTexture.scale)){const e=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new kn(e,e)}return Promise.all(i)}}class ug{constructor(e){this.parser=e,this.name=ag.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Zc:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[];t.sheenColor=new Zn(0,0,0),t.sheenRoughness=0,t.sheen=1;const a=r.extensions[this.name];return void 0!==a.sheenColorFactor&&t.sheenColor.fromArray(a.sheenColorFactor),void 0!==a.sheenRoughnessFactor&&(t.sheenRoughness=a.sheenRoughnessFactor),void 0!==a.sheenColorTexture&&i.push(n.assignTexture(t,"sheenColorMap",a.sheenColorTexture)),void 0!==a.sheenRoughnessTexture&&i.push(n.assignTexture(t,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(i)}}class cg{constructor(e){this.parser=e,this.name=ag.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Zc:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],a=r.extensions[this.name];return void 0!==a.transmissionFactor&&(t.transmission=a.transmissionFactor),void 0!==a.transmissionTexture&&i.push(n.assignTexture(t,"transmissionMap",a.transmissionTexture)),Promise.all(i)}}class dg{constructor(e){this.parser=e,this.name=ag.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Zc:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],a=r.extensions[this.name];t.thickness=void 0!==a.thicknessFactor?a.thicknessFactor:0,void 0!==a.thicknessTexture&&i.push(n.assignTexture(t,"thicknessMap",a.thicknessTexture)),t.attenuationDistance=a.attenuationDistance||0;const o=a.attenuationColor||[1,1,1];return t.attenuationColor=new Zn(o[0],o[1],o[2]),Promise.all(i)}}class hg{constructor(e){this.parser=e,this.name=ag.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Zc:null}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}}class pg{constructor(e){this.parser=e,this.name=ag.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Zc:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],a=r.extensions[this.name];t.specularIntensity=void 0!==a.specularFactor?a.specularFactor:1,void 0!==a.specularTexture&&i.push(n.assignTexture(t,"specularIntensityMap",a.specularTexture));const o=a.specularColorFactor||[1,1,1];return t.specularColor=new Zn(o[0],o[1],o[2]),void 0!==a.specularColorTexture&&i.push(n.assignTexture(t,"specularColorMap",a.specularColorTexture).then((function(e){e.encoding=Ut}))),Promise.all(i)}}class fg{constructor(e){this.parser=e,this.name=ag.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const i=r.extensions[this.name],a=n.images[i.source],o=t.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,a,o)}}class mg{constructor(e){this.parser=e,this.name=ag.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;const a=i.extensions[t],o=r.images[a.source];let s=n.textureLoader;if(o.uri){const e=n.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(e,o,s);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class gg{constructor(e){this.name=ag.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const e=n.extensions[this.name],r=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([r,i.ready]).then((function(t){const n=e.byteOffset||0,r=e.byteLength||0,a=e.count,o=e.byteStride,s=new ArrayBuffer(a*o),l=new Uint8Array(t[0],n,r);return i.decodeGltfBuffer(new Uint8Array(s),a,o,l,e.mode,e.filter),s}))}return null}}const vg="glTF",yg=1313821514,xg=5130562;class bg{constructor(e){this.name=ag.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,12);if(this.header={magic:$d.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==vg)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-12,r=new DataView(e,12);let i=0;for(;i<n;){const t=r.getUint32(i,!0);i+=4;const n=r.getUint32(i,!0);if(i+=4,n===yg){const n=new Uint8Array(e,12+i,t);this.content=$d.decodeText(n)}else if(n===xg){const n=12+i;this.body=e.slice(n,n+t)}i+=t}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class wg{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=ag.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},s={},l={};for(const e in a){const t=Ug[e]||e.toLowerCase();o[t]=a[e]}for(const t in e.attributes){const r=Ug[t]||t.toLowerCase();if(void 0!==a[t]){const i=n.accessors[e.attributes[t]],a=kg[i.componentType];l[r]=a,s[r]=!0===i.normalized}}return t.getDependency("bufferView",i).then((function(e){return new Promise((function(t){r.decodeDracoFile(e,(function(e){for(const t in e.attributes){const n=e.attributes[t],r=s[t];void 0!==r&&(n.normalized=r)}t(e)}),o,l)}))}))}}class _g{constructor(){this.name=ag.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class Mg extends Yc{constructor(e){super(),this.isGLTFSpecularGlossinessMaterial=!0;const t=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),n=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),r=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),i=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),a=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.roughness += geometryRoughness;","material.roughness = min( material.roughness, 1.0 );","material.specularColor = specularFactor;"].join("\n"),o={specular:{value:(new Zn).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=o,this.onBeforeCompile=function(e){for(const t in o)e.uniforms[t]=o[t];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",n).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",i).replace("#include <lights_physical_fragment>",a)},Object.defineProperties(this,{specular:{get:function(){return o.specular.value},set:function(e){o.specular.value=e}},specularMap:{get:function(){return o.specularMap.value},set:function(e){o.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return o.glossiness.value},set:function(e){o.glossiness.value=e}},glossinessMap:{get:function(){return o.glossinessMap.value},set:function(e){o.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class Sg{constructor(){this.name=ag.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return Mg}extendParams(e,t,n){const r=t.extensions[this.name];e.color=new Zn(1,1,1),e.opacity=1;const i=[];if(Array.isArray(r.diffuseFactor)){const t=r.diffuseFactor;e.color.fromArray(t),e.opacity=t[3]}if(void 0!==r.diffuseTexture&&i.push(n.assignTexture(e,"map",r.diffuseTexture)),e.emissive=new Zn(0,0,0),e.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,e.specular=new Zn(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){const t=r.specularGlossinessTexture;i.push(n.assignTexture(e,"glossinessMap",t)),i.push(n.assignTexture(e,"specularMap",t))}return Promise.all(i)}createMaterial(e){const t=new Mg(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=Wt,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}class Ag{constructor(){this.name=ag.KHR_MESH_QUANTIZATION}}class Eg extends sd{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r;for(let e=0;e!==r;e++)t[e]=n[i+e];return t}}Eg.prototype.beforeStart_=Eg.prototype.copySampleValue_,Eg.prototype.afterEnd_=Eg.prototype.copySampleValue_,Eg.prototype.interpolate_=function(e,t,n,r){const i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=2*o,l=3*o,u=r-t,c=(n-t)/u,d=c*c,h=d*c,p=e*l,f=p-l,m=-2*h+3*d,g=h-d,v=1-m,y=g-d+c;for(let e=0;e!==o;e++){const t=a[f+e+o],n=a[f+e+s]*u,r=a[p+e+o],l=a[p+e]*u;i[e]=v*t+y*n+m*r+g*l}return i};const Cg=new hr;class Tg extends Eg{interpolate_(e,t,n,r){const i=super.interpolate_(e,t,n,r);return Cg.fromArray(i).normalize().toArray(i),i}}const Bg=0,Rg=1,Lg=2,Pg=3,Dg=4,Ig=5,Fg=6,kg={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Ng={9728:be,9729:Ae,9984:we,9985:Ee,9986:Me,9987:Te},Og={33071:ye,33648:xe,10497:ve},Hg={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ug={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Gg={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},zg={CUBICSPLINE:void 0,LINEAR:Bt,STEP:Tt},Wg="OPAQUE",Vg="MASK",jg="BLEND";function Jg(e,t,n){for(const r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function qg(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function Xg(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){const n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,r=n.length;t<r;t++)e.morphTargetDictionary[n[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Kg(e){const t=e.extensions&&e.extensions[ag.KHR_DRACO_MESH_COMPRESSION];let n;return n=t?"draco:"+t.bufferView+":"+t.indices+":"+Qg(t.attributes):e.indices+":"+Qg(e.attributes)+":"+e.mode,n}function Qg(e){let t="";const n=Object.keys(e).sort();for(let r=0,i=n.length;r<i;r++)t+=n[r]+":"+e[n[r]]+";";return t}function Yg(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}class Zg{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new ig,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.textureCache={},this.nodeNamesUsed={},"undefined"!=typeof createImageBitmap&&!1===/Firefox|^((?!chrome|android).)*safari/i.test(navigator.userAgent)?this.textureLoader=new oh(this.options.manager):this.textureLoader=new Pd(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Ed(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])})).then((function(t){const a={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};Jg(i,a,r),qg(a,r),Promise.all(n._invokeAll((function(e){return e.afterRoot&&e.afterRoot(a)}))).then((function(){e(a)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n<r;n++){const r=t[n].joints;for(let t=0,n=r.length;t<n;t++)e[r[t]].isBone=!0}for(let t=0,r=e.length;t<r;t++){const r=e[t];void 0!==r.mesh&&(this._addNodeRef(this.meshCache,r.mesh),void 0!==r.skin&&(n[r.mesh].isSkinnedMesh=!0)),void 0!==r.camera&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const r=n.clone(),i=(e,t)=>{const n=this.associations.get(e);null!=n&&this.associations.set(t,n);for(const[n,r]of e.children.entries())i(r,t.children[n])};return i(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const r=e(t[n]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let r=0;r<t.length;r++){const i=e(t[r]);i&&n.push(i)}return n}getDependency(e,t){const n=e+":"+t;let r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":r=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":r=this.loadSkin(t);break;case"animation":r=this.loadAnimation(t);break;case"camera":r=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(r.map((function(t,r){return n.getDependency(e,r)}))),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[ag.KHR_BINARY_GLTF].body);const r=this.options;return new Promise((function(e,i){n.load($d.resolveURL(t.uri,r.path),e,void 0,(function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){const n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)}))}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(void 0===r.bufferView&&void 0===r.sparse)return Promise.resolve(null);const i=[];return void 0!==r.bufferView?i.push(this.getDependency("bufferView",r.bufferView)):i.push(null),void 0!==r.sparse&&(i.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(i).then((function(e){const i=e[0],a=Hg[r.type],o=kg[r.componentType],s=o.BYTES_PER_ELEMENT,l=s*a,u=r.byteOffset||0,c=void 0!==r.bufferView?n.bufferViews[r.bufferView].byteStride:void 0,d=!0===r.normalized;let h,p;if(c&&c!==l){const e=Math.floor(u/c),n="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+e+":"+r.count;let l=t.cache.get(n);l||(h=new o(i,e*c,r.count*c/s),l=new xl(h,c/s),t.cache.add(n,l)),p=new wl(l,a,u%c/s,d)}else h=null===i?new o(r.count*a):new o(i,u,r.count*a),p=new Pi(h,a,d);if(void 0!==r.sparse){const t=Hg.SCALAR,n=kg[r.sparse.indices.componentType],s=r.sparse.indices.byteOffset||0,l=r.sparse.values.byteOffset||0,u=new n(e[1],s,r.sparse.count*t),c=new o(e[2],l,r.sparse.count*a);null!==i&&(p=new Pi(p.array.slice(),p.itemSize,p.normalized));for(let e=0,t=u.length;e<t;e++){const t=u[e];if(p.setX(t,c[e*a]),a>=2&&p.setY(t,c[e*a+1]),a>=3&&p.setZ(t,c[e*a+2]),a>=4&&p.setW(t,c[e*a+3]),a>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return p}))}loadTexture(e){const t=this.json,n=this.options,r=t.textures[e],i=t.images[r.source];let a=this.textureLoader;if(i.uri){const e=n.manager.getHandler(i.uri);null!==e&&(a=e)}return this.loadTextureImage(e,i,a)}loadTextureImage(e,t,n){const r=this,i=this.json,a=this.options,o=i.textures[e],s=(t.uri||t.bufferView)+":"+o.sampler;if(this.textureCache[s])return this.textureCache[s];const l=self.URL||self.webkitURL;let u=t.uri||"",c=!1;if(void 0!==t.bufferView)u=r.getDependency("bufferView",t.bufferView).then((function(e){c=!0;const n=new Blob([e],{type:t.mimeType});return u=l.createObjectURL(n),u}));else if(void 0===t.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(u).then((function(e){return new Promise((function(t,r){let i=t;!0===n.isImageBitmapLoader&&(i=function(e){const n=new ir(e);n.needsUpdate=!0,t(n)}),n.load($d.resolveURL(e,a.path),i,void 0,r)}))})).then((function(t){!0===c&&l.revokeObjectURL(u),t.flipY=!1,o.name&&(t.name=o.name);const n=(i.samplers||{})[o.sampler]||{};return t.magFilter=Ng[n.magFilter]||Ae,t.minFilter=Ng[n.minFilter]||Te,t.wrapS=Og[n.wrapS]||ve,t.wrapT=Og[n.wrapT]||ve,r.associations.set(t,{textures:e}),t})).catch((function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null}));return this.textureCache[s]=d,d}assignTexture(e,t,n){const r=this;return this.getDependency("texture",n.index).then((function(i){if(void 0===n.texCoord||0==n.texCoord||"aoMap"===t&&1==n.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),r.extensions[ag.KHR_TEXTURE_TRANSFORM]){const e=void 0!==n.extensions?n.extensions[ag.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=r.associations.get(i);i=r.extensions[ag.KHR_TEXTURE_TRANSFORM].extendTexture(i,e),r.associations.set(i,t)}}return e[t]=i,i}))}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new mu,Ti.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){const e="LineBasicMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new iu,Ti.prototype.copy.call(t,n),t.color.copy(n.color),this.cache.add(e,t)),n=t}if(r||i||a){let e="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(e+="specular-glossiness:"),r&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Yc}loadMaterial(e){const t=this,n=this.json,r=this.extensions,i=n.materials[e];let a;const o={},s=i.extensions||{},l=[];if(s[ag.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const e=r[ag.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];a=e.getMaterialType(),l.push(e.extendParams(o,i,t))}else if(s[ag.KHR_MATERIALS_UNLIT]){const e=r[ag.KHR_MATERIALS_UNLIT];a=e.getMaterialType(),l.push(e.extendParams(o,i,t))}else{const n=i.pbrMetallicRoughness||{};if(o.color=new Zn(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){const e=n.baseColorFactor;o.color.fromArray(e),o.opacity=e[3]}void 0!==n.baseColorTexture&&l.push(t.assignTexture(o,"map",n.baseColorTexture)),o.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,o.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(l.push(t.assignTexture(o,"metalnessMap",n.metallicRoughnessTexture)),l.push(t.assignTexture(o,"roughnessMap",n.metallicRoughnessTexture))),a=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)}))))}!0===i.doubleSided&&(o.side=M);const u=i.alphaMode||Wg;if(u===jg?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,u===Vg&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&a!==Bi&&(l.push(t.assignTexture(o,"normalMap",i.normalTexture)),o.normalScale=new kn(1,1),void 0!==i.normalTexture.scale)){const e=i.normalTexture.scale;o.normalScale.set(e,e)}return void 0!==i.occlusionTexture&&a!==Bi&&(l.push(t.assignTexture(o,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&a!==Bi&&(o.emissive=(new Zn).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&a!==Bi&&l.push(t.assignTexture(o,"emissiveMap",i.emissiveTexture)),Promise.all(l).then((function(){let n;return n=a===Mg?r[ag.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new a(o),i.name&&(n.name=i.name),n.map&&(n.map.encoding=Ut),n.emissiveMap&&(n.emissiveMap.encoding=Ut),qg(n,i),t.associations.set(n,{materials:e}),i.extensions&&Jg(r,n,i),n}))}createUniqueName(e){const t=Gh.sanitizeNodeName(e||"");let n=t;for(let e=1;this.nodeNamesUsed[n];++e)n=t+"_"+e;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){const t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[ag.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return ev(n,e,t)}))}const a=[];for(let n=0,o=e.length;n<o;n++){const o=e[n],s=Kg(o),l=r[s];if(l)a.push(l.promise);else{let e;e=o.extensions&&o.extensions[ag.KHR_DRACO_MESH_COMPRESSION]?i(o):ev(new Qi,o,t),r[s]={primitive:o,promise:e},a.push(e)}}return Promise.all(a)}loadMesh(e){const t=this,n=this.json,r=this.extensions,i=n.meshes[e],a=i.primitives,o=[];for(let e=0,t=a.length;e<t;e++){const t=void 0===a[e].material?(void 0===(s=this.cache).DefaultMaterial&&(s.DefaultMaterial=new Yc({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:w})),s.DefaultMaterial):this.getDependency("material",a[e].material);o.push(t)}var s;return o.push(t.loadGeometries(a)),Promise.all(o).then((function(n){const o=n.slice(0,n.length-1),s=n[n.length-1],l=[];for(let n=0,u=s.length;n<u;n++){const u=s[n],c=a[n];let d;const h=o[n];if(c.mode===Dg||c.mode===Ig||c.mode===Fg||void 0===c.mode)d=!0===i.isSkinnedMesh?new Jl(u,h):new fa(u,h),!0!==d.isSkinnedMesh||d.geometry.attributes.skinWeight.normalized||d.normalizeSkinWeights(),c.mode===Ig?d.geometry=tv(d.geometry,Nt):c.mode===Fg&&(d.geometry=tv(d.geometry,Ot));else if(c.mode===Rg)d=new pu(u,h);else if(c.mode===Pg)d=new cu(u,h);else if(c.mode===Lg)d=new fu(u,h);else{if(c.mode!==Bg)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+c.mode);d=new bu(u,h)}Object.keys(d.geometry.morphAttributes).length>0&&Xg(d,i),d.name=t.createUniqueName(i.name||"mesh_"+e),qg(d,i),c.extensions&&Jg(r,d,c),t.assignFinalMaterial(d),l.push(d)}for(let n=0,r=l.length;n<r;n++)t.associations.set(l[n],{meshes:e,primitives:n});if(1===l.length)return l[0];const u=new ll;t.associations.set(u,{meshes:e});for(let e=0,t=l.length;e<t;e++)u.add(l[e]);return u}))}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(r)return"perspective"===n.type?t=new _a(Fn.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===n.type&&(t=new Ja(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),qg(t,n),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){const t=this.json.skins[e],n={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return n.inverseBindMatrices=e,n}))}loadAnimation(e){const t=this.json.animations[e],n=[],r=[],i=[],a=[],o=[];for(let e=0,s=t.channels.length;e<s;e++){const s=t.channels[e],l=t.samplers[s.sampler],u=s.target,c=void 0!==u.node?u.node:u.id,d=void 0!==t.parameters?t.parameters[l.input]:l.input,h=void 0!==t.parameters?t.parameters[l.output]:l.output;n.push(this.getDependency("node",c)),r.push(this.getDependency("accessor",d)),i.push(this.getDependency("accessor",h)),a.push(l),o.push(u)}return Promise.all([Promise.all(n),Promise.all(r),Promise.all(i),Promise.all(a),Promise.all(o)]).then((function(n){const r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=[];for(let e=0,t=r.length;e<t;e++){const t=r[e],n=i[e],u=a[e],c=o[e],d=s[e];if(void 0===t)continue;let h;switch(t.updateMatrix(),t.matrixAutoUpdate=!0,Gg[d.path]){case Gg.weights:h=fd;break;case Gg.rotation:h=gd;break;default:h=yd}const p=t.name?t.name:t.uuid,f=void 0!==c.interpolation?zg[c.interpolation]:Bt,m=[];Gg[d.path]===Gg.weights?t.traverse((function(e){e.morphTargetInfluences&&m.push(e.name?e.name:e.uuid)})):m.push(p);let g=u.array;if(u.normalized){const e=Yg(g.constructor),t=new Float32Array(g.length);for(let n=0,r=g.length;n<r;n++)t[n]=g[n]*e;g=t}for(let e=0,t=m.length;e<t;e++){const t=new h(m[e]+"."+Gg[d.path],n.array,g,f);"CUBICSPLINE"===c.interpolation&&(t.createInterpolant=function(e){return new(this instanceof gd?Tg:Eg)(this.times,this.values,this.getValueSize()/3,e)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(t)}}const u=t.name?t.name:"animation_"+e;return new xd(u,void 0,l)}))}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return void 0===r.mesh?null:n.getDependency("mesh",r.mesh).then((function(e){const t=n._getNodeRef(n.meshCache,r.mesh,e);return void 0!==r.weights&&t.traverse((function(e){if(e.isMesh)for(let t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]})),t}))}loadNode(e){const t=this.json,n=this.extensions,r=this,i=t.nodes[e],a=i.name?r.createUniqueName(i.name):"";return function(){const t=[],n=r._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return n&&t.push(n),void 0!==i.camera&&t.push(r.getDependency("camera",i.camera).then((function(e){return r._getNodeRef(r.cameraCache,i.camera,e)}))),r._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){t.push(e)})),Promise.all(t)}().then((function(t){let o;if(o=!0===i.isBone?new ql:t.length>1?new ll:1===t.length?t[0]:new mi,o!==t[0])for(let e=0,n=t.length;e<n;e++)o.add(t[e]);if(i.name&&(o.userData.name=i.name,o.name=a),qg(o,i),i.extensions&&Jg(n,o,i),void 0!==i.matrix){const e=new Vr;e.fromArray(i.matrix),o.applyMatrix4(e)}else void 0!==i.translation&&o.position.fromArray(i.translation),void 0!==i.rotation&&o.quaternion.fromArray(i.rotation),void 0!==i.scale&&o.scale.fromArray(i.scale);return r.associations.has(o)||r.associations.set(o,{}),r.associations.get(o).nodes=e,o}))}loadScene(e){const t=this.json,n=this.extensions,r=this.json.scenes[e],i=this,a=new ll;r.name&&(a.name=i.createUniqueName(r.name)),qg(a,r),r.extensions&&Jg(n,a,r);const o=r.nodes||[],s=[];for(let e=0,n=o.length;e<n;e++)s.push($g(o[e],a,t,i));return Promise.all(s).then((function(){return i.associations=(e=>{const t=new Map;for(const[e,n]of i.associations)(e instanceof Ti||e instanceof ir)&&t.set(e,n);return e.traverse((e=>{const n=i.associations.get(e);null!=n&&t.set(e,n)})),t})(a),a}))}}function $g(e,t,n,r){const i=n.nodes[e];return r.getDependency("node",e).then((function(e){if(void 0===i.skin)return e;let t;return r.getDependency("skin",i.skin).then((function(e){t=e;const n=[];for(let e=0,i=t.joints.length;e<i;e++)n.push(r.getDependency("node",t.joints[e]));return Promise.all(n)})).then((function(n){return e.traverse((function(e){if(!e.isMesh)return;const r=[],i=[];for(let e=0,a=n.length;e<a;e++){const a=n[e];if(a){r.push(a);const n=new Vr;void 0!==t.inverseBindMatrices&&n.fromArray(t.inverseBindMatrices.array,16*e),i.push(n)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[e])}e.bind(new Yl(r,i),e.matrixWorld)})),e}))})).then((function(e){t.add(e);const a=[];if(i.children){const t=i.children;for(let i=0,o=t.length;i<o;i++){const o=t[i];a.push($g(o,e,n,r))}}return Promise.all(a)}))}function ev(e,t,n){const r=t.attributes,i=[];function a(t,r){return n.getDependency("accessor",t).then((function(t){e.setAttribute(r,t)}))}for(const t in r){const n=Ug[t]||t.toLowerCase();n in e.attributes||i.push(a(r[t],n))}if(void 0!==t.indices&&!e.index){const r=n.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));i.push(r)}return qg(e,t),function(e,t,n){const r=t.attributes,i=new gr;if(void 0===r.POSITION)return;{const e=n.json.accessors[r.POSITION],t=e.min,a=e.max;if(void 0===t||void 0===a)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(i.set(new pr(t[0],t[1],t[2]),new pr(a[0],a[1],a[2])),e.normalized){const t=Yg(kg[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}const a=t.targets;if(void 0!==a){const e=new pr,t=new pr;for(let r=0,i=a.length;r<i;r++){const i=a[r];if(void 0!==i.POSITION){const r=n.json.accessors[i.POSITION],a=r.min,o=r.max;if(void 0!==a&&void 0!==o){if(t.setX(Math.max(Math.abs(a[0]),Math.abs(o[0]))),t.setY(Math.max(Math.abs(a[1]),Math.abs(o[1]))),t.setZ(Math.max(Math.abs(a[2]),Math.abs(o[2]))),r.normalized){const e=Yg(kg[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(e)}e.boundingBox=i;const o=new Fr;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=o}(e,t,n),Promise.all(i).then((function(){return void 0!==t.targets?function(e,t,n){let r=!1,i=!1;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(void 0!==n.POSITION&&(r=!0),void 0!==n.NORMAL&&(i=!0),r&&i)break}if(!r&&!i)return Promise.resolve(e);const a=[],o=[];for(let s=0,l=t.length;s<l;s++){const l=t[s];if(r){const t=void 0!==l.POSITION?n.getDependency("accessor",l.POSITION):e.attributes.position;a.push(t)}if(i){const t=void 0!==l.NORMAL?n.getDependency("accessor",l.NORMAL):e.attributes.normal;o.push(t)}}return Promise.all([Promise.all(a),Promise.all(o)]).then((function(t){const n=t[0],a=t[1];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=a),e.morphTargetsRelative=!0,e}))}(e,t.targets,n):e}))}function tv(e,t){let n=e.getIndex();if(null===n){const t=[],r=e.getAttribute("position");if(void 0===r)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}const r=n.count-2,i=[];if(t===Ot)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length/3!==r&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const a=e.clone();return a.setIndex(i),a}let nv=null;function rv(e,t,n){return r=>{n&&n(r),e&&(nv||(nv=new $m),nv.setDecoderPath("string"==typeof e?e:"https://www.gstatic.com/draco/versioned/decoders/1.4.3/"),r.setDRACOLoader(nv)),t&&r.setMeshoptDecoder(ng())}}function iv(e,t=!0,n=!0,r){return Rm(rg,e,rv(t,n,r))}iv.preload=(e,t=!0,n=!0,r)=>Rm.preload(rg,e,rv(t,n,r)),iv.clear=e=>Rm.clear(rg,e);var av=n(5697),ov=n.n(av);ov().func.isRequired,ov().arrayOf(ov().oneOfType([ov().element,ov().func])).isRequired;const sv=new Vr,lv=new Vr,uv=[],cv=new fa;class dv extends ll{constructor(){super(),this.color=new Zn("white"),this.instance={current:void 0},this.instanceKey={current:void 0}}get geometry(){var e;return null==(e=this.instance.current)?void 0:e.geometry}raycast(e,t){const n=this.instance.current;if(!n)return;if(!n.geometry||!n.material)return;cv.geometry=n.geometry;const r=n.matrixWorld;let i=n.userData.instances.indexOf(this.instanceKey);if(!(-1===i||i>n.count)){n.getMatrixAt(i,sv),lv.multiplyMatrices(r,sv),cv.matrixWorld=lv,cv.raycast(e,uv);for(let e=0,n=uv.length;e<n;e++){const n=uv[e];n.instanceId=i,n.object=this,t.push(n)}uv.length=0}}}let hv,pv;const fv=s.createContext(null),mv=new Vr,gv=new Vr,vv=new Vr;new Zn;const yv=new pr,xv=new hr,bv=new pr,wv=s.forwardRef((({context:e,children:t,...n},r)=>{s.useMemo((()=>fm({Position:dv})),[]);const i=s.useRef(),{subscribe:a,getParent:o}=s.useContext(e||fv);return s.useLayoutEffect((()=>a(i)),[]),s.createElement("position",Gm({instance:o(),instanceKey:i,ref:zm([r,i])},n),t)})),_v=s.forwardRef((({children:e,range:t,limit:n=1e3,frames:r=1/0,...i},a)=>{const[{context:o,instance:l}]=s.useState((()=>{const e=s.createContext(null);return{context:e,instance:s.forwardRef(((t,n)=>s.createElement(wv,Gm({context:e},t,{ref:n}))))}})),u=s.useRef(null),[c,d]=s.useState([]),[[h,p]]=s.useState((()=>{const e=new Float32Array(16*n);for(hv=0;hv<n;hv++)vv.identity().toArray(e,16*hv);return[e,new Float32Array([...new Array(3*n)].map((()=>1)))]}));s.useLayoutEffect((()=>{u.current.count=u.current.instanceMatrix.updateRange.count=u.current.instanceColor.updateRange.count=Math.min(n,void 0!==t?t:n,c.length)}),[c,t]),s.useEffect((()=>{u.current.instanceMatrix.needsUpdate=!0}));let f=0;Tm((()=>{if(r===1/0||f<r){for(u.current.updateMatrix(),u.current.updateMatrixWorld(),mv.copy(u.current.matrixWorld).invert(),hv=0;hv<c.length;hv++)pv=c[hv].current,pv.matrixWorld.decompose(yv,xv,bv),gv.compose(yv,xv,bv).premultiply(mv),gv.toArray(h,16*hv),u.current.instanceMatrix.needsUpdate=!0,pv.color.toArray(p,3*hv),u.current.instanceColor.needsUpdate=!0;f++}}));const m=s.useMemo((()=>({getParent:()=>u,subscribe:e=>(d((t=>[...t,e])),()=>d((t=>t.filter((t=>t.current!==e.current)))))})),[]);return s.createElement("instancedMesh",Gm({userData:{instances:c},matrixAutoUpdate:!1,ref:zm([a,u]),args:[null,null,0],raycast:()=>null},i),s.createElement("instancedBufferAttribute",{attach:"instanceMatrix",count:h.length/16,array:h,itemSize:16,usage:hn}),s.createElement("instancedBufferAttribute",{attach:"instanceColor",count:p.length/3,array:p,itemSize:3,usage:hn}),"function"==typeof e?s.createElement(o.Provider,{value:m},e(l)):s.createElement(fv.Provider,{value:m},e))}));const Mv=s.forwardRef((({makeDefault:e,...t},n)=>{const r=Cm((({set:e})=>e)),i=Cm((({camera:e})=>e)),a=Cm((({size:e})=>e)),o=s.useRef();return s.useLayoutEffect((()=>{const{current:e}=o;e&&!t.manual&&(e.aspect=a.width/a.height,e.updateProjectionMatrix())}),[a,t]),s.useLayoutEffect((()=>{if(e&&o.current){const e=i;return r((()=>({camera:o.current}))),()=>r((()=>({camera:e})))}}),[o,e,r]),s.createElement("perspectiveCamera",Gm({ref:zm([o,n])},t))}));var Sv=n(5893),Av=["random"];function Ev(){return Ev=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ev.apply(this,arguments)}function Cv(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Tv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tv(Object(n),!0).forEach((function(t){Rv(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}r().defaults.withCredentials=!0;var Lv=function(e){return[e/2-Math.random()*e,e/2-Math.random()*e,e/2-Math.random()*e]},Pv=function(){return[Math.random()*Math.PI,Math.random()*Math.PI,Math.random()*Math.PI]},Dv=Array.from({length:2e3},(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;return{random:Math.random(),position:Lv(e),rotation:Pv()}}));function Iv(){var e=iv("/models/graphictoriapart.glb"),t=e.nodes,n=e.materials;return(0,Sv.jsxs)(Sv.Fragment,{children:[(0,Sv.jsx)("ambientLight",{}),(0,Sv.jsx)("pointLight",{position:[10,10,10]}),(0,Sv.jsx)(_v,{range:2e3,material:n.Material,geometry:t.Cube.geometry,children:Dv.map((function(e,t){return(0,Sv.jsx)(Fv,Bv({},e),t)}))}),(0,Sv.jsx)(kv,{makeDefault:!0})]})}function Fv(e){var t=e.random,n=Cv(e,Av),r=(0,s.useRef)();return Tm((function(e){var n=e.clock.getElapsedTime()+1e4*t;r.current.rotation.set(Math.cos(n/4)/2,Math.sin(n/4)/2,Math.cos(n/1.5)/2),r.current.position.y=Math.sin(n/1.5)/2})),(0,Sv.jsx)("group",Bv(Bv({},n),{},{children:(0,Sv.jsx)(wv,{ref:r})}))}function kv(e){var t=Ev({},e),n=(0,s.useRef)();return Tm((function(e){var t=e.clock.getElapsedTime()/30;n.current.position.x=10*Math.cos(t),n.current.position.y=4*Math.sin(t),n.current.position.z=10*Math.sin(t),n.current.lookAt(0,0,0)})),(0,Sv.jsx)(Mv,Bv({ref:n},t))}var Nv=[];a()(document).ready((function(){o.render((0,Sv.jsx)(Ym,{children:(0,Sv.jsx)(s.Suspense,{fallback:null,children:(0,Sv.jsx)(Iv,{})})}),document.getElementsByClassName("gtoria-maintenance-background")[0]),a()("#gt_mt_buttons").on("click","button",(function(){var e=parseInt(this.getAttribute("name").substr(8));Nv.push(e),r().post(u("apis","v1/maintenance/bypass"),{password:a()("#gt_mt_buttons > input").val(),buttons:Nv.slice(-40)}).then((function(e){window.location.reload()}))}))}))})()})();